From 756102138db193fea422cb5ee80e1f042686df1c Mon Sep 17 00:00:00 2001 From: Faerbit Date: Mon, 1 Dec 2014 12:44:08 +0100 Subject: [PATCH] Revert "Updating glfw." Code was not ready for release. This reverts commit 81234ca22ab86df10d72209137593b6c0096c528. --- extern/glfw/.gitignore | 6 +- extern/glfw/CMake/modules/FindEGL.cmake | 4 +- extern/glfw/CMake/modules/FindGLESv1.cmake | 4 +- extern/glfw/CMake/modules/FindGLESv2.cmake | 4 +- extern/glfw/CMake/modules/FindMir.cmake | 18 - extern/glfw/CMake/modules/FindWayland.cmake | 66 - extern/glfw/CMake/modules/FindXKBCommon.cmake | 34 - extern/glfw/CMakeLists.txt | 327 +-- extern/glfw/README.md | 351 +-- extern/glfw/deps/GL/glext.h | 1715 +++++---------- extern/glfw/deps/GL/glxext.h | 82 +- extern/glfw/deps/GL/wglext.h | 21 +- extern/glfw/deps/KHR/khrplatform.h | 282 --- extern/glfw/deps/getopt.c | 469 ++-- extern/glfw/deps/getopt.h | 94 +- extern/glfw/deps/glad.c | 728 ------- extern/glfw/deps/glad/glad.h | 1925 ----------------- extern/glfw/deps/tinycthread.h | 1 - extern/glfw/docs/CMakeLists.txt | 10 +- extern/glfw/docs/Doxyfile.in | 26 +- extern/glfw/docs/DoxygenLayout.xml | 188 -- extern/glfw/docs/build.dox | 244 +-- extern/glfw/docs/compat.dox | 93 +- extern/glfw/docs/compile.dox | 313 --- extern/glfw/docs/context.dox | 223 +- extern/glfw/docs/extra.css | 1 - extern/glfw/docs/extra.less | 370 ---- extern/glfw/docs/footer.html | 7 - extern/glfw/docs/header.html | 34 - extern/glfw/docs/input.dox | 579 ----- extern/glfw/docs/internal.dox | 16 +- extern/glfw/docs/intro.dox | 336 --- extern/glfw/docs/main.dox | 40 +- extern/glfw/docs/monitor.dox | 143 +- extern/glfw/docs/moving.dox | 534 ++--- extern/glfw/docs/news.dox | 85 +- extern/glfw/docs/quick.dox | 244 +-- extern/glfw/docs/rift.dox | 81 - extern/glfw/docs/spaces.svg | 352 --- extern/glfw/docs/window.dox | 717 ++---- extern/glfw/examples/CMakeLists.txt | 72 - extern/glfw/examples/boing.c | 669 ------ extern/glfw/examples/gears.c | 372 ---- extern/glfw/examples/heightmap.c | 601 ----- extern/glfw/examples/particles.c | 1061 --------- extern/glfw/examples/simple.c | 102 - extern/glfw/examples/splitview.c | 511 ----- extern/glfw/examples/wave.c | 457 ---- extern/glfw/include/GLFW/glfw3.h | 1887 ++++------------ extern/glfw/include/GLFW/glfw3native.h | 202 +- extern/glfw/src/CMakeLists.txt | 64 +- extern/glfw/src/{posix_tls.h => clipboard.c} | 39 +- .../src/{posix_tls.c => cocoa_clipboard.m} | 66 +- extern/glfw/src/cocoa_gamma.c | 84 + extern/glfw/src/cocoa_init.m | 7 +- .../{iokit_joystick.m => cocoa_joystick.m} | 108 +- extern/glfw/src/cocoa_monitor.m | 299 +-- extern/glfw/src/cocoa_platform.h | 98 +- extern/glfw/src/{mach_time.c => cocoa_time.c} | 14 +- extern/glfw/src/cocoa_window.m | 438 +--- .../src/{glfw_config.h.in => config.h.in} | 27 +- extern/glfw/src/context.c | 223 +- extern/glfw/src/egl_context.c | 93 +- .../src/{egl_context.h => egl_platform.h} | 39 +- extern/glfw/src/gamma.c | 126 ++ extern/glfw/src/glfw3.pc.in | 4 +- extern/glfw/src/glx_context.c | 210 +- .../src/{glx_context.h => glx_platform.h} | 55 +- extern/glfw/src/init.c | 16 +- extern/glfw/src/input.c | 252 +-- extern/glfw/src/internal.h | 224 +- extern/glfw/src/iokit_joystick.h | 61 - extern/glfw/src/{win32_tls.c => joystick.c} | 65 +- extern/glfw/src/linux_joystick.h | 51 - extern/glfw/src/mir_init.c | 78 - extern/glfw/src/mir_monitor.c | 136 -- extern/glfw/src/mir_platform.h | 92 - extern/glfw/src/mir_window.c | 547 ----- extern/glfw/src/monitor.c | 141 +- extern/glfw/src/nsgl_context.m | 145 +- .../src/{nsgl_context.h => nsgl_platform.h} | 40 +- extern/glfw/src/{posix_time.h => time.c} | 33 +- extern/glfw/src/wgl_context.c | 157 +- .../src/{wgl_context.h => wgl_platform.h} | 49 +- extern/glfw/src/win32_clipboard.c | 127 ++ extern/glfw/src/win32_gamma.c | 82 + extern/glfw/src/win32_init.c | 65 +- .../{winmm_joystick.c => win32_joystick.c} | 30 +- extern/glfw/src/win32_monitor.c | 238 +- extern/glfw/src/win32_platform.h | 193 +- extern/glfw/src/win32_time.c | 60 +- extern/glfw/src/win32_tls.h | 48 - extern/glfw/src/win32_window.c | 719 ++---- extern/glfw/src/window.c | 317 ++- extern/glfw/src/winmm_joystick.h | 47 - extern/glfw/src/wl_init.c | 630 ------ extern/glfw/src/wl_monitor.c | 250 --- extern/glfw/src/wl_platform.h | 140 -- extern/glfw/src/wl_window.c | 493 ----- extern/glfw/src/x11_clipboard.c | 335 +++ extern/glfw/src/x11_gamma.c | 123 ++ extern/glfw/src/x11_init.c | 454 ++-- .../src/{linux_joystick.c => x11_joystick.c} | 86 +- extern/glfw/src/x11_monitor.c | 392 ++-- extern/glfw/src/x11_platform.h | 157 +- extern/glfw/src/{posix_time.c => x11_time.c} | 21 +- .../glfw/src/{xkb_unicode.c => x11_unicode.c} | 34 +- extern/glfw/src/x11_window.c | 1064 ++------- extern/glfw/src/xkb_unicode.h | 33 - extern/glfw/tests/CMakeLists.txt | 78 - extern/glfw/tests/accuracy.c | 128 -- extern/glfw/tests/clipboard.c | 149 -- extern/glfw/tests/cursor.c | 289 --- extern/glfw/tests/cursoranim.c | 135 -- extern/glfw/tests/defaults.c | 131 -- extern/glfw/tests/empty.c | 129 -- extern/glfw/tests/events.c | 581 ----- extern/glfw/tests/fsaa.c | 157 -- extern/glfw/tests/gamma.c | 181 -- extern/glfw/tests/glfwinfo.c | 429 ---- extern/glfw/tests/iconify.c | 182 -- extern/glfw/tests/joysticks.c | 234 -- extern/glfw/tests/modes.c | 240 -- extern/glfw/tests/peter.c | 145 -- extern/glfw/tests/reopen.c | 177 -- extern/glfw/tests/sharing.c | 184 -- extern/glfw/tests/tearing.c | 130 -- extern/glfw/tests/threads.c | 135 -- extern/glfw/tests/title.c | 76 - extern/glfw/tests/windows.c | 117 - 130 files changed, 5520 insertions(+), 25407 deletions(-) delete mode 100644 extern/glfw/CMake/modules/FindMir.cmake delete mode 100644 extern/glfw/CMake/modules/FindWayland.cmake delete mode 100644 extern/glfw/CMake/modules/FindXKBCommon.cmake delete mode 100644 extern/glfw/deps/KHR/khrplatform.h delete mode 100644 extern/glfw/deps/glad.c delete mode 100644 extern/glfw/deps/glad/glad.h delete mode 100644 extern/glfw/docs/DoxygenLayout.xml delete mode 100644 extern/glfw/docs/compile.dox delete mode 100644 extern/glfw/docs/extra.css delete mode 100644 extern/glfw/docs/extra.less delete mode 100644 extern/glfw/docs/footer.html delete mode 100644 extern/glfw/docs/header.html delete mode 100644 extern/glfw/docs/input.dox delete mode 100644 extern/glfw/docs/intro.dox delete mode 100644 extern/glfw/docs/rift.dox delete mode 100644 extern/glfw/docs/spaces.svg delete mode 100644 extern/glfw/examples/CMakeLists.txt delete mode 100644 extern/glfw/examples/boing.c delete mode 100644 extern/glfw/examples/gears.c delete mode 100644 extern/glfw/examples/heightmap.c delete mode 100644 extern/glfw/examples/particles.c delete mode 100644 extern/glfw/examples/simple.c delete mode 100644 extern/glfw/examples/splitview.c delete mode 100644 extern/glfw/examples/wave.c rename extern/glfw/src/{posix_tls.h => clipboard.c} (58%) rename extern/glfw/src/{posix_tls.c => cocoa_clipboard.m} (56%) create mode 100644 extern/glfw/src/cocoa_gamma.c rename extern/glfw/src/{iokit_joystick.m => cocoa_joystick.m} (87%) rename extern/glfw/src/{mach_time.c => cocoa_time.c} (85%) rename extern/glfw/src/{glfw_config.h.in => config.h.in} (78%) rename extern/glfw/src/{egl_context.h => egl_platform.h} (69%) create mode 100644 extern/glfw/src/gamma.c rename extern/glfw/src/{glx_context.h => glx_platform.h} (69%) delete mode 100644 extern/glfw/src/iokit_joystick.h rename extern/glfw/src/{win32_tls.c => joystick.c} (54%) delete mode 100644 extern/glfw/src/linux_joystick.h delete mode 100644 extern/glfw/src/mir_init.c delete mode 100644 extern/glfw/src/mir_monitor.c delete mode 100644 extern/glfw/src/mir_platform.h delete mode 100644 extern/glfw/src/mir_window.c rename extern/glfw/src/{nsgl_context.h => nsgl_platform.h} (59%) rename extern/glfw/src/{posix_time.h => time.c} (71%) rename extern/glfw/src/{wgl_context.h => wgl_platform.h} (71%) create mode 100644 extern/glfw/src/win32_clipboard.c create mode 100644 extern/glfw/src/win32_gamma.c rename extern/glfw/src/{winmm_joystick.c => win32_joystick.c} (83%) delete mode 100644 extern/glfw/src/win32_tls.h delete mode 100644 extern/glfw/src/winmm_joystick.h delete mode 100644 extern/glfw/src/wl_init.c delete mode 100644 extern/glfw/src/wl_monitor.c delete mode 100644 extern/glfw/src/wl_platform.h delete mode 100644 extern/glfw/src/wl_window.c create mode 100644 extern/glfw/src/x11_clipboard.c create mode 100644 extern/glfw/src/x11_gamma.c rename extern/glfw/src/{linux_joystick.c => x11_joystick.c} (72%) rename extern/glfw/src/{posix_time.c => x11_time.c} (84%) rename extern/glfw/src/{xkb_unicode.c => x11_unicode.c} (96%) delete mode 100644 extern/glfw/src/xkb_unicode.h delete mode 100644 extern/glfw/tests/CMakeLists.txt delete mode 100644 extern/glfw/tests/accuracy.c delete mode 100644 extern/glfw/tests/clipboard.c delete mode 100644 extern/glfw/tests/cursor.c delete mode 100644 extern/glfw/tests/cursoranim.c delete mode 100644 extern/glfw/tests/defaults.c delete mode 100644 extern/glfw/tests/empty.c delete mode 100644 extern/glfw/tests/events.c delete mode 100644 extern/glfw/tests/fsaa.c delete mode 100644 extern/glfw/tests/gamma.c delete mode 100644 extern/glfw/tests/glfwinfo.c delete mode 100644 extern/glfw/tests/iconify.c delete mode 100644 extern/glfw/tests/joysticks.c delete mode 100644 extern/glfw/tests/modes.c delete mode 100644 extern/glfw/tests/peter.c delete mode 100644 extern/glfw/tests/reopen.c delete mode 100644 extern/glfw/tests/sharing.c delete mode 100644 extern/glfw/tests/tearing.c delete mode 100644 extern/glfw/tests/threads.c delete mode 100644 extern/glfw/tests/title.c delete mode 100644 extern/glfw/tests/windows.c diff --git a/extern/glfw/.gitignore b/extern/glfw/.gitignore index 3e206b4..3ba142e 100644 --- a/extern/glfw/.gitignore +++ b/extern/glfw/.gitignore @@ -21,7 +21,7 @@ cmake_uninstall.cmake docs/Doxyfile docs/html docs/warnings.txt -src/glfw_config.h +src/config.h src/glfw3.pc src/glfwConfig.cmake src/glfwConfigVersion.cmake @@ -44,7 +44,6 @@ examples/*.exe examples/boing examples/gears examples/heightmap -examples/particles examples/splitview examples/simple examples/wave @@ -52,10 +51,7 @@ tests/*.app tests/*.exe tests/accuracy tests/clipboard -tests/cursor -tests/cursoranim tests/defaults -tests/empty tests/events tests/fsaa tests/gamma diff --git a/extern/glfw/CMake/modules/FindEGL.cmake b/extern/glfw/CMake/modules/FindEGL.cmake index 796eef9..0929c92 100644 --- a/extern/glfw/CMake/modules/FindEGL.cmake +++ b/extern/glfw/CMake/modules/FindEGL.cmake @@ -4,10 +4,10 @@ # EGL_LIBRARY # EGL_FOUND -find_path(EGL_INCLUDE_DIR NAMES EGL/egl.h PATHS /opt/vc/include) +find_path(EGL_INCLUDE_DIR NAMES EGL/egl.h) set(EGL_NAMES ${EGL_NAMES} egl EGL) -find_library(EGL_LIBRARY NAMES ${EGL_NAMES} PATHS /opt/vc/lib) +find_library(EGL_LIBRARY NAMES ${EGL_NAMES}) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(EGL DEFAULT_MSG EGL_LIBRARY EGL_INCLUDE_DIR) diff --git a/extern/glfw/CMake/modules/FindGLESv1.cmake b/extern/glfw/CMake/modules/FindGLESv1.cmake index 6ab0414..3c77929 100644 --- a/extern/glfw/CMake/modules/FindGLESv1.cmake +++ b/extern/glfw/CMake/modules/FindGLESv1.cmake @@ -4,10 +4,10 @@ # GLESv1_LIBRARY # GLESv1_FOUND -find_path(GLESv1_INCLUDE_DIR NAMES GLES/gl.h PATHS /opt/vc/include) +find_path(GLESv1_INCLUDE_DIR NAMES GLES/gl.h) set(GLESv1_NAMES ${GLESv1_NAMES} GLESv1_CM) -find_library(GLESv1_LIBRARY NAMES ${GLESv1_NAMES} PATHS /opt/vc/lib) +find_library(GLESv1_LIBRARY NAMES ${GLESv1_NAMES}) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GLESv1 DEFAULT_MSG GLESv1_LIBRARY GLESv1_INCLUDE_DIR) diff --git a/extern/glfw/CMake/modules/FindGLESv2.cmake b/extern/glfw/CMake/modules/FindGLESv2.cmake index 12c4d06..0a2f810 100644 --- a/extern/glfw/CMake/modules/FindGLESv2.cmake +++ b/extern/glfw/CMake/modules/FindGLESv2.cmake @@ -4,10 +4,10 @@ # GLESv2_LIBRARY # GLESv2_FOUND -find_path(GLESv2_INCLUDE_DIR NAMES GLES2/gl2.h PATHS /opt/vc/include) +find_path(GLESv2_INCLUDE_DIR NAMES GLES2/gl2.h) set(GLESv2_NAMES ${GLESv2_NAMES} GLESv2) -find_library(GLESv2_LIBRARY NAMES ${GLESv2_NAMES} PATHS /opt/vc/lib) +find_library(GLESv2_LIBRARY NAMES ${GLESv2_NAMES}) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GLESv2 DEFAULT_MSG GLESv2_LIBRARY GLESv2_INCLUDE_DIR) diff --git a/extern/glfw/CMake/modules/FindMir.cmake b/extern/glfw/CMake/modules/FindMir.cmake deleted file mode 100644 index b1a495b..0000000 --- a/extern/glfw/CMake/modules/FindMir.cmake +++ /dev/null @@ -1,18 +0,0 @@ -# Try to find Mir on a Unix system -# -# This will define: -# -# MIR_LIBRARIES - Link these to use Wayland -# MIR_INCLUDE_DIR - Include directory for Wayland -# -# Copyright (c) 2014 Brandon Schaefer - -if (NOT WIN32) - - find_package (PkgConfig) - pkg_check_modules (PKG_MIR QUIET mirclient) - - set (MIR_INCLUDE_DIR ${PKG_MIR_INCLUDE_DIRS}) - set (MIR_LIBRARIES ${PKG_MIR_LIBRARIES}) - -endif () diff --git a/extern/glfw/CMake/modules/FindWayland.cmake b/extern/glfw/CMake/modules/FindWayland.cmake deleted file mode 100644 index f93218b..0000000 --- a/extern/glfw/CMake/modules/FindWayland.cmake +++ /dev/null @@ -1,66 +0,0 @@ -# Try to find Wayland on a Unix system -# -# This will define: -# -# WAYLAND_FOUND - True if Wayland is found -# WAYLAND_LIBRARIES - Link these to use Wayland -# WAYLAND_INCLUDE_DIR - Include directory for Wayland -# WAYLAND_DEFINITIONS - Compiler flags for using Wayland -# -# In addition the following more fine grained variables will be defined: -# -# WAYLAND_CLIENT_FOUND WAYLAND_CLIENT_INCLUDE_DIR WAYLAND_CLIENT_LIBRARIES -# WAYLAND_SERVER_FOUND WAYLAND_SERVER_INCLUDE_DIR WAYLAND_SERVER_LIBRARIES -# WAYLAND_EGL_FOUND WAYLAND_EGL_INCLUDE_DIR WAYLAND_EGL_LIBRARIES -# -# Copyright (c) 2013 Martin Gräßlin -# -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. - -IF (NOT WIN32) - IF (WAYLAND_INCLUDE_DIR AND WAYLAND_LIBRARIES) - # In the cache already - SET(WAYLAND_FIND_QUIETLY TRUE) - ENDIF () - - # Use pkg-config to get the directories and then use these values - # in the FIND_PATH() and FIND_LIBRARY() calls - FIND_PACKAGE(PkgConfig) - PKG_CHECK_MODULES(PKG_WAYLAND QUIET wayland-client wayland-server wayland-egl wayland-cursor) - - SET(WAYLAND_DEFINITIONS ${PKG_WAYLAND_CFLAGS}) - - FIND_PATH(WAYLAND_CLIENT_INCLUDE_DIR NAMES wayland-client.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS}) - FIND_PATH(WAYLAND_SERVER_INCLUDE_DIR NAMES wayland-server.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS}) - FIND_PATH(WAYLAND_EGL_INCLUDE_DIR NAMES wayland-egl.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS}) - FIND_PATH(WAYLAND_CURSOR_INCLUDE_DIR NAMES wayland-cursor.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS}) - - FIND_LIBRARY(WAYLAND_CLIENT_LIBRARIES NAMES wayland-client HINTS ${PKG_WAYLAND_LIBRARY_DIRS}) - FIND_LIBRARY(WAYLAND_SERVER_LIBRARIES NAMES wayland-server HINTS ${PKG_WAYLAND_LIBRARY_DIRS}) - FIND_LIBRARY(WAYLAND_EGL_LIBRARIES NAMES wayland-egl HINTS ${PKG_WAYLAND_LIBRARY_DIRS}) - FIND_LIBRARY(WAYLAND_CURSOR_LIBRARIES NAMES wayland-cursor HINTS ${PKG_WAYLAND_LIBRARY_DIRS}) - - set(WAYLAND_INCLUDE_DIR ${WAYLAND_CLIENT_INCLUDE_DIR} ${WAYLAND_SERVER_INCLUDE_DIR} ${WAYLAND_EGL_INCLUDE_DIR} ${WAYLAND_CURSOR_INCLUDE_DIR}) - - set(WAYLAND_LIBRARIES ${WAYLAND_CLIENT_LIBRARIES} ${WAYLAND_SERVER_LIBRARIES} ${WAYLAND_EGL_LIBRARIES} ${WAYLAND_CURSOR_LIBRARIES}) - - list(REMOVE_DUPLICATES WAYLAND_INCLUDE_DIR) - - include(FindPackageHandleStandardArgs) - - FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_CLIENT DEFAULT_MSG WAYLAND_CLIENT_LIBRARIES WAYLAND_CLIENT_INCLUDE_DIR) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_SERVER DEFAULT_MSG WAYLAND_SERVER_LIBRARIES WAYLAND_SERVER_INCLUDE_DIR) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_EGL DEFAULT_MSG WAYLAND_EGL_LIBRARIES WAYLAND_EGL_INCLUDE_DIR) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_CURSOR DEFAULT_MSG WAYLAND_CURSOR_LIBRARIES WAYLAND_CURSOR_INCLUDE_DIR) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND DEFAULT_MSG WAYLAND_LIBRARIES WAYLAND_INCLUDE_DIR) - - MARK_AS_ADVANCED( - WAYLAND_INCLUDE_DIR WAYLAND_LIBRARIES - WAYLAND_CLIENT_INCLUDE_DIR WAYLAND_CLIENT_LIBRARIES - WAYLAND_SERVER_INCLUDE_DIR WAYLAND_SERVER_LIBRARIES - WAYLAND_EGL_INCLUDE_DIR WAYLAND_EGL_LIBRARIES - WAYLAND_CURSOR_INCLUDE_DIR WAYLAND_CURSOR_LIBRARIES - ) - -ENDIF () diff --git a/extern/glfw/CMake/modules/FindXKBCommon.cmake b/extern/glfw/CMake/modules/FindXKBCommon.cmake deleted file mode 100644 index 0f571ee..0000000 --- a/extern/glfw/CMake/modules/FindXKBCommon.cmake +++ /dev/null @@ -1,34 +0,0 @@ -# - 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) - diff --git a/extern/glfw/CMakeLists.txt b/extern/glfw/CMakeLists.txt index be1c6b6..49c119f 100644 --- a/extern/glfw/CMakeLists.txt +++ b/extern/glfw/CMakeLists.txt @@ -1,19 +1,18 @@ project(GLFW C) -cmake_minimum_required(VERSION 2.8.9) +cmake_minimum_required(VERSION 2.8) set(GLFW_VERSION_MAJOR "3") -set(GLFW_VERSION_MINOR "1") -set(GLFW_VERSION_PATCH "0") +set(GLFW_VERSION_MINOR "0") +set(GLFW_VERSION_PATCH "2") set(GLFW_VERSION_EXTRA "") set(GLFW_VERSION "${GLFW_VERSION_MAJOR}.${GLFW_VERSION_MINOR}") set(GLFW_VERSION_FULL "${GLFW_VERSION}.${GLFW_VERSION_PATCH}${GLFW_VERSION_EXTRA}") set(LIB_SUFFIX "" CACHE STRING "Takes an empty string or 64. Directory where lib will be installed: lib or lib64") 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_BUILD_EXAMPLES "Build the GLFW example programs" OFF) +option(GLFW_BUILD_TESTS "Build the GLFW test programs" OFF) option(GLFW_INSTALL "Generate installation target" ON) option(GLFW_DOCUMENT_INTERNALS "Include internals in documentation" OFF) @@ -26,16 +25,10 @@ if (APPLE) option(GLFW_BUILD_UNIVERSAL "Build GLFW as a Universal Binary" OFF) option(GLFW_USE_CHDIR "Make glfwInit chdir to Contents/Resources" ON) option(GLFW_USE_MENUBAR "Populate the menu bar on first window creation" ON) - option(GLFW_USE_RETINA "Use the full resolution of Retina displays" ON) else() option(GLFW_USE_EGL "Use EGL for context creation" OFF) endif() -if (UNIX AND NOT APPLE) - option(GLFW_USE_WAYLAND "Use Wayland for context creation (implies EGL as well)" OFF) - option(GLFW_USE_MIR "Use Mir for context creation (implies EGL as well)" OFF) -endif() - if (MSVC) option(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC runtime library DLL" ON) endif() @@ -44,12 +37,6 @@ if (BUILD_SHARED_LIBS) set(_GLFW_BUILD_DLL 1) endif() -if (GLFW_USE_WAYLAND) - set(GLFW_USE_EGL ON) -elseif (GLFW_USE_MIR) - set(GLFW_USE_EGL ON) -endif() - if (GLFW_USE_EGL) set(GLFW_CLIENT_LIBRARY "opengl" CACHE STRING "The client library to use; one of opengl, glesv1 or glesv2") @@ -64,7 +51,7 @@ if (GLFW_USE_EGL) message(FATAL_ERROR "Unsupported client library") endif() - set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMake/modules") + set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake/modules) find_package(EGL REQUIRED) if (NOT _GLFW_USE_OPENGL) @@ -86,13 +73,11 @@ endif() find_package(Threads REQUIRED) -if (GLFW_BUILD_DOCS) - set(DOXYGEN_SKIP_DOT TRUE) - find_package(Doxygen) +set(DOXYGEN_SKIP_DOT TRUE) +find_package(Doxygen) - if (GLFW_DOCUMENT_INTERNALS) - set(GLFW_INTERNAL_DOCS "${GLFW_SOURCE_DIR}/src/internal.h ${GLFW_SOURCE_DIR}/docs/internal.dox") - endif() +if (GLFW_DOCUMENT_INTERNALS) + set(GLFW_INTERNAL_DOCS "${GLFW_SOURCE_DIR}/src/internal.h ${GLFW_SOURCE_DIR}/docs/internal.dox") endif() #-------------------------------------------------------------------- @@ -127,39 +112,12 @@ if (MSVC) endif() endif() -if (MINGW) - # Enable link-time exploit mitigation features enabled by default on MSVC - - include(CheckCCompilerFlag) - - # Compatibility with data execution prevention (DEP) - set(CMAKE_REQUIRED_FLAGS "-Wl,--nxcompat") - check_c_compiler_flag("" _GLFW_HAS_DEP) - if (_GLFW_HAS_DEP) - set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--nxcompat ${CMAKE_SHARED_LINKER_FLAGS}") - endif() - - # Compatibility with address space layout randomization (ASLR) - set(CMAKE_REQUIRED_FLAGS "-Wl,--dynamicbase") - check_c_compiler_flag("" _GLFW_HAS_ASLR) - if (_GLFW_HAS_ASLR) - set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--dynamicbase ${CMAKE_SHARED_LINKER_FLAGS}") - endif() - - # Compatibility with 64-bit address space layout randomization (ASLR) - set(CMAKE_REQUIRED_FLAGS "-Wl,--high-entropy-va") - check_c_compiler_flag("" _GLFW_HAS_64ASLR) - if (_GLFW_HAS_64ASLR) - set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--high-entropy-va ${CMAKE_SHARED_LINKER_FLAGS}") - endif() -endif() - #-------------------------------------------------------------------- # Detect and select backend APIs #-------------------------------------------------------------------- if (WIN32) set(_GLFW_WIN32 1) - message(STATUS "Using Win32 for window creation") + message(STATUS "Using Win32 for window creation") if (GLFW_USE_EGL) set(_GLFW_EGL 1) @@ -174,16 +132,8 @@ elseif (APPLE) set(_GLFW_NSGL 1) message(STATUS "Using NSGL for context creation") elseif (UNIX) - if (GLFW_USE_WAYLAND) - set(_GLFW_WAYLAND 1) - message(STATUS "Using Wayland for window creation") - elseif (GLFW_USE_MIR) - set(_GLFW_MIR 1) - message(STATUS "Using Mir for window creation") - else() - set(_GLFW_X11 1) - message(STATUS "Using X11 for window creation") - endif() + set(_GLFW_X11 1) + message(STATUS "Using X11 for window creation") if (GLFW_USE_EGL) set(_GLFW_EGL 1) @@ -200,8 +150,12 @@ endif() # Use Win32 for window creation #-------------------------------------------------------------------- if (_GLFW_WIN32) - - set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -lgdi32") + # The DLL links against winmm; the static library loads it + # That way, both code paths receive testing + if (BUILD_SHARED_LIBS) + set(_GLFW_NO_DLOAD_WINMM 1) + list(APPEND glfw_LIBRARIES winmm) + endif() if (GLFW_USE_DWM_SWAP_INTERVAL) set(_GLFW_USE_DWM_SWAP_INTERVAL 1) @@ -209,25 +163,14 @@ if (_GLFW_WIN32) if (GLFW_USE_OPTIMUS_HPG) set(_GLFW_USE_OPTIMUS_HPG 1) endif() - - # HACK: When building on MinGW, WINVER and UNICODE need to be defined before - # the inclusion of stddef.h (by glfw3.h), which is itself included before - # win32_platform.h. We define them here until a saner solution can be found - # NOTE: MinGW-w64 and Visual C++ do /not/ need this hack. - if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU") - add_definitions(-DUNICODE -DWINVER=0x0501) - endif() endif() #-------------------------------------------------------------------- # Use WGL for context creation #-------------------------------------------------------------------- if (_GLFW_WGL) - - set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -lopengl32") - - list(APPEND glfw_INCLUDE_DIRS "${OPENGL_INCLUDE_DIR}") - list(APPEND glfw_LIBRARIES "${OPENGL_gl_LIBRARY}") + list(APPEND glfw_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR}) + list(APPEND glfw_LIBRARIES ${OPENGL_gl_LIBRARY}) endif() #-------------------------------------------------------------------- @@ -240,10 +183,10 @@ if (_GLFW_X11) set(GLFW_PKG_DEPS "${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}") + list(APPEND glfw_INCLUDE_DIRS ${X11_X11_INCLUDE_PATH}) + list(APPEND glfw_LIBRARIES ${X11_X11_LIB} ${CMAKE_THREAD_LIBS_INIT}) if (UNIX AND NOT APPLE) - list(APPEND glfw_LIBRARIES "${RT_LIBRARY}") + list(APPEND glfw_LIBRARIES ${RT_LIBRARY}) endif() # Check for XRandR (modern resolution switching and gamma control) @@ -251,32 +194,17 @@ if (_GLFW_X11) message(FATAL_ERROR "The RandR library and headers were not found") endif() - list(APPEND glfw_INCLUDE_DIRS "${X11_Xrandr_INCLUDE_PATH}") - list(APPEND glfw_LIBRARIES "${X11_Xrandr_LIB}") + list(APPEND glfw_INCLUDE_DIRS ${X11_Xrandr_INCLUDE_PATH}) + list(APPEND glfw_LIBRARIES ${X11_Xrandr_LIB}) set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} xrandr") - # Check for Xinerama (legacy multi-monitor support) - if (NOT X11_Xinerama_FOUND) - message(FATAL_ERROR "The Xinerama library and headers were not found") - endif() - - list(APPEND glfw_INCLUDE_DIRS "${X11_Xinerama_INCLUDE_PATH}") - list(APPEND glfw_LIBRARIES "${X11_Xinerama_LIB}") - set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} xinerama") - # Check for XInput (high-resolution cursor motion) if (NOT X11_Xinput_FOUND) message(FATAL_ERROR "The XInput library and headers were not found") endif() - list(APPEND glfw_INCLUDE_DIRS "${X11_Xinput_INCLUDE_PATH}") - - if (X11_Xinput_LIB) - list(APPEND glfw_LIBRARIES "${X11_Xinput_LIB}") - else() - # Backwards compatibility (bug in CMake 2.8.7) - list(APPEND glfw_LIBRARIES Xi) - endif() + list(APPEND glfw_INCLUDE_DIRS ${X11_Xinput_INCLUDE_PATH}) + list(APPEND glfw_LIBRARIES ${X11_Xinput_LIB}) set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} xi") # Check for Xf86VidMode (fallback gamma control) @@ -284,11 +212,11 @@ if (_GLFW_X11) message(FATAL_ERROR "The Xf86VidMode library and headers were not found") endif() - list(APPEND glfw_INCLUDE_DIRS "${X11_xf86vmode_INCLUDE_PATH}") + list(APPEND glfw_INCLUDE_DIRS ${X11_xf86vmode_INCLUDE_PATH}) set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} xxf86vm") if (X11_Xxf86vm_LIB) - list(APPEND glfw_LIBRARIES "${X11_Xxf86vm_LIB}") + list(APPEND glfw_LIBRARIES ${X11_Xxf86vm_LIB}) else() # Backwards compatibility (see CMake bug 0006976) list(APPEND glfw_LIBRARIES Xxf86vm) @@ -297,79 +225,24 @@ if (_GLFW_X11) # Check for Xkb (X keyboard extension) if (NOT X11_Xkb_FOUND) message(FATAL_ERROR "The X keyboard extension headers were not found") - endif() + endif() - list(APPEND glfw_INCLUDE_DIR "${X11_Xkb_INCLUDE_PATH}") + list(APPEND glfw_INCLUDE_DIR ${X11_Xkb_INCLUDE_PATH}) find_library(RT_LIBRARY rt) mark_as_advanced(RT_LIBRARY) if (RT_LIBRARY) - list(APPEND glfw_LIBRARIES "${RT_LIBRARY}") + list(APPEND glfw_LIBRARIES ${RT_LIBRARY}) set(GLFW_PKG_LIBS "${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_LIBRARIES ${MATH_LIBRARY}) set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -lm") endif() - # Check for Xcursor - if (NOT X11_Xcursor_FOUND) - message(FATAL_ERROR "The Xcursor libraries and headers were not found") - endif() - - list(APPEND glfw_INCLUDE_DIR "${X11_Xcursor_INCLUDE_PATH}") - list(APPEND glfw_LIBRARIES "${X11_Xcursor_LIB}") - set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} xcursor") - -endif() - -#-------------------------------------------------------------------- -# Use Wayland for window creation -#-------------------------------------------------------------------- -if (_GLFW_WAYLAND) - find_package(Wayland REQUIRED) - set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} wayland-egl") - - list(APPEND glfw_INCLUDE_DIRS "${WAYLAND_INCLUDE_DIR}") - list(APPEND glfw_LIBRARIES "${WAYLAND_LIBRARIES}" "${CMAKE_THREAD_LIBS_INIT}") - - find_package(XKBCommon REQUIRED) - set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} xkbcommon") - list(APPEND glfw_INCLUDE_DIRS "${XKBCOMMON_INCLUDE_DIRS}") - list(APPEND glfw_LIBRARIES "${XKBCOMMON_LIBRARY}") - - find_library(MATH_LIBRARY m) - mark_as_advanced(MATH_LIBRARY) - if (MATH_LIBRARY) - list(APPEND glfw_LIBRARIES "${MATH_LIBRARY}") - set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -lm") - endif() -endif() - -#-------------------------------------------------------------------- -# Use Mir for window creation -#-------------------------------------------------------------------- -if (_GLFW_MIR) - find_package(Mir REQUIRED) - set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} mirclient") - - list(APPEND glfw_INCLUDE_DIRS "${MIR_INCLUDE_DIR}") - list(APPEND glfw_LIBRARIES "${MIR_LIBRARIES}" "${CMAKE_THREAD_LIBS_INIT}") - - find_package(XKBCommon REQUIRED) - set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} xkbcommon") - list(APPEND glfw_INCLUDE_DIRS "${XKBCOMMON_INCLUDE_DIRS}") - list(APPEND glfw_LIBRARIES "${XKBCOMMON_LIBRARY}") - - find_library(MATH_LIBRARY m) - mark_as_advanced(MATH_LIBRARY) - if (MATH_LIBRARY) - list(APPEND glfw_LIBRARIES "${MATH_LIBRARY}") - set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -lm") - endif() endif() #-------------------------------------------------------------------- @@ -377,14 +250,14 @@ endif() #-------------------------------------------------------------------- if (_GLFW_GLX) - list(APPEND glfw_INCLUDE_DIRS "${OPENGL_INCLUDE_DIR}") - list(APPEND glfw_LIBRARIES "${OPENGL_gl_LIBRARY}") + list(APPEND glfw_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR}) + list(APPEND glfw_LIBRARIES ${OPENGL_gl_LIBRARY}) set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} gl") include(CheckFunctionExists) - set(CMAKE_REQUIRED_LIBRARIES "${OPENGL_gl_LIBRARY}") + set(CMAKE_REQUIRED_LIBRARIES ${OPENGL_gl_LIBRARY}) check_function_exists(glXGetProcAddress _GLFW_HAS_GLXGETPROCADDRESS) check_function_exists(glXGetProcAddressARB _GLFW_HAS_GLXGETPROCADDRESSARB) check_function_exists(glXGetProcAddressEXT _GLFW_HAS_GLXGETPROCADDRESSEXT) @@ -396,15 +269,23 @@ if (_GLFW_GLX) # Check for dlopen support as a fallback - set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_DL_LIBS}") + find_library(DL_LIBRARY dl) + mark_as_advanced(DL_LIBRARY) + if (DL_LIBRARY) + set(CMAKE_REQUIRED_LIBRARIES ${DL_LIBRARY}) + else() + set(CMAKE_REQUIRED_LIBRARIES "") + endif() + check_function_exists(dlopen _GLFW_HAS_DLOPEN) + if (NOT _GLFW_HAS_DLOPEN) message(FATAL_ERROR "No entry point retrieval mechanism found") endif() - if (CMAKE_DL_LIBS) - list(APPEND glfw_LIBRARIES "${CMAKE_DL_LIBS}") - set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -l${CMAKE_DL_LIBS}") + if (DL_LIBRARY) + list(APPEND glfw_LIBRARIES ${DL_LIBRARY}) + set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -ldl") endif() endif() @@ -415,22 +296,24 @@ endif() #-------------------------------------------------------------------- if (_GLFW_EGL) - list(APPEND glfw_INCLUDE_DIRS "${EGL_INCLUDE_DIR}") - list(APPEND glfw_LIBRARIES "${EGL_LIBRARY}") + list(APPEND glfw_INCLUDE_DIRS ${EGL_INCLUDE_DIR}) + list(APPEND glfw_LIBRARIES ${EGL_LIBRARY}) - set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} egl") + if (UNIX) + set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} egl") + endif() if (_GLFW_USE_OPENGL) - list(APPEND glfw_LIBRARIES "${OPENGL_gl_LIBRARY}") - list(APPEND glfw_INCLUDE_DIRS "${OPENGL_INCLUDE_DIR}") + list(APPEND glfw_LIBRARIES ${OPENGL_gl_LIBRARY}) + list(APPEND glfw_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR}) set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} gl") elseif (_GLFW_USE_GLESV1) - list(APPEND glfw_LIBRARIES "${GLESv1_LIBRARY}") - list(APPEND glfw_INCLUDE_DIRS "${GLESv1_INCLUDE_DIR}") + list(APPEND glfw_LIBRARIES ${GLESv1_LIBRARY}) + list(APPEND glfw_INCLUDE_DIRS ${GLESv1_INCLUDE_DIR}) set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} glesv1_cm") elseif (_GLFW_USE_GLESV2) - list(APPEND glfw_LIBRARIES "${GLESv2_LIBRARY}") - list(APPEND glfw_INCLUDE_DIRS "${GLESv2_INCLUDE_DIR}") + list(APPEND glfw_LIBRARIES ${GLESv2_LIBRARY}) + list(APPEND glfw_INCLUDE_DIRS ${GLESv2_INCLUDE_DIR}) set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} glesv2") endif() @@ -440,7 +323,7 @@ endif() # Use Cocoa for window creation and NSOpenGL for context creation #-------------------------------------------------------------------- if (_GLFW_COCOA AND _GLFW_NSGL) - + if (GLFW_USE_MENUBAR) set(_GLFW_USE_MENUBAR 1) endif() @@ -449,30 +332,24 @@ if (_GLFW_COCOA AND _GLFW_NSGL) set(_GLFW_USE_CHDIR 1) endif() - if (GLFW_USE_RETINA) - set(_GLFW_USE_RETINA 1) - endif() - if (GLFW_BUILD_UNIVERSAL) message(STATUS "Building GLFW as Universal Binaries") set(CMAKE_OSX_ARCHITECTURES i386;x86_64) else() message(STATUS "Building GLFW only for the native architecture") endif() - + # Set up library and include paths find_library(COCOA_FRAMEWORK Cocoa) find_library(IOKIT_FRAMEWORK IOKit) find_library(CORE_FOUNDATION_FRAMEWORK CoreFoundation) - find_library(CORE_VIDEO_FRAMEWORK CoreVideo) - list(APPEND glfw_LIBRARIES "${COCOA_FRAMEWORK}" - "${OPENGL_gl_LIBRARY}" - "${IOKIT_FRAMEWORK}" - "${CORE_FOUNDATION_FRAMEWORK}" - "${CORE_VIDEO_FRAMEWORK}") + list(APPEND glfw_LIBRARIES ${COCOA_FRAMEWORK} + ${OPENGL_gl_LIBRARY} + ${IOKIT_FRAMEWORK} + ${CORE_FOUNDATION_FRAMEWORK}) set(GLFW_PKG_DEPS "") - set(GLFW_PKG_LIBS "-framework Cocoa -framework OpenGL -framework IOKit -framework CoreFoundation -framework CoreVideo") + set(GLFW_PKG_LIBS "-framework Cocoa -framework OpenGL -framework IOKit -framework CoreFoundation") endif() #-------------------------------------------------------------------- @@ -493,64 +370,66 @@ endif() #-------------------------------------------------------------------- # Create generated files #-------------------------------------------------------------------- -if (GLFW_BUILD_DOCS) - configure_file("${GLFW_SOURCE_DIR}/docs/Doxyfile.in" - "${GLFW_BINARY_DIR}/docs/Doxyfile" @ONLY) +configure_file(${GLFW_SOURCE_DIR}/docs/Doxyfile.in + ${GLFW_BINARY_DIR}/docs/Doxyfile @ONLY) + +configure_file(${GLFW_SOURCE_DIR}/src/config.h.in + ${GLFW_BINARY_DIR}/src/config.h @ONLY) + +configure_file(${GLFW_SOURCE_DIR}/src/glfwConfig.cmake.in + ${GLFW_BINARY_DIR}/src/glfwConfig.cmake @ONLY) + +configure_file(${GLFW_SOURCE_DIR}/src/glfwConfigVersion.cmake.in + ${GLFW_BINARY_DIR}/src/glfwConfigVersion.cmake @ONLY) + +if (UNIX) + configure_file(${GLFW_SOURCE_DIR}/src/glfw3.pc.in + ${GLFW_BINARY_DIR}/src/glfw3.pc @ONLY) endif() -configure_file("${GLFW_SOURCE_DIR}/src/glfw_config.h.in" - "${GLFW_BINARY_DIR}/src/glfw_config.h" @ONLY) - -configure_file("${GLFW_SOURCE_DIR}/src/glfwConfig.cmake.in" - "${GLFW_BINARY_DIR}/src/glfwConfig.cmake" @ONLY) - -configure_file("${GLFW_SOURCE_DIR}/src/glfwConfigVersion.cmake.in" - "${GLFW_BINARY_DIR}/src/glfwConfigVersion.cmake" @ONLY) - -configure_file("${GLFW_SOURCE_DIR}/src/glfw3.pc.in" - "${GLFW_BINARY_DIR}/src/glfw3.pc" @ONLY) - #-------------------------------------------------------------------- # Add subdirectories #-------------------------------------------------------------------- add_subdirectory(src) -if (GLFW_BUILD_EXAMPLES) - add_subdirectory(examples) -endif() +#if (GLFW_BUILD_EXAMPLES) +# add_subdirectory(examples) +#endif() -if (GLFW_BUILD_TESTS) - add_subdirectory(tests) -endif() +#if (GLFW_BUILD_TESTS) +# add_subdirectory(tests) +#endif() -if (DOXYGEN_FOUND AND GLFW_BUILD_DOCS) - add_subdirectory(docs) -endif() +#if (DOXYGEN_FOUND) +# 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 include + install(DIRECTORY include/GLFW DESTINATION include FILES_MATCHING PATTERN glfw3.h PATTERN glfw3native.h) - install(FILES "${GLFW_BINARY_DIR}/src/glfwConfig.cmake" - "${GLFW_BINARY_DIR}/src/glfwConfigVersion.cmake" + install(FILES ${GLFW_BINARY_DIR}/src/glfwConfig.cmake + ${GLFW_BINARY_DIR}/src/glfwConfigVersion.cmake DESTINATION lib${LIB_SUFFIX}/cmake/glfw) - install(EXPORT glfwTargets DESTINATION lib${LIB_SUFFIX}/cmake/glfw) - install(FILES "${GLFW_BINARY_DIR}/src/glfw3.pc" - DESTINATION lib${LIB_SUFFIX}/pkgconfig) + if (UNIX) + install(EXPORT glfwTargets DESTINATION lib${LIB_SUFFIX}/cmake/glfw) + install(FILES ${GLFW_BINARY_DIR}/src/glfw3.pc + DESTINATION lib${LIB_SUFFIX}/pkgconfig) + endif() # Only generate this target if no higher-level project already has if (NOT TARGET uninstall) - configure_file("${GLFW_SOURCE_DIR}/cmake_uninstall.cmake.in" - "${GLFW_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) + configure_file(${GLFW_SOURCE_DIR}/cmake_uninstall.cmake.in + ${GLFW_BINARY_DIR}/cmake_uninstall.cmake IMMEDIATE @ONLY) add_custom_target(uninstall - "${CMAKE_COMMAND}" -P - "${GLFW_BINARY_DIR}/cmake_uninstall.cmake") + ${CMAKE_COMMAND} -P + ${GLFW_BINARY_DIR}/cmake_uninstall.cmake) endif() endif() diff --git a/extern/glfw/README.md b/extern/glfw/README.md index be6751a..a120479 100644 --- a/extern/glfw/README.md +++ b/extern/glfw/README.md @@ -2,11 +2,13 @@ ## Introduction -GLFW is a free, Open Source, multi-platform library for OpenGL and OpenGL ES +GLFW is a free, Open Source, portable library for OpenGL and OpenGL ES application development. It provides a simple, platform-independent API for creating windows and contexts, reading input, handling events, etc. -Version 3.1 is *not yet described*. +Version 3.0.2 adds support for OpenGL 4 on and precise scrolling deltas on OS +X and fixes for a number of bugs that together affect all supported platforms. +As this is a patch release, there are no API changes. If you are new to GLFW, you may find the [introductory tutorial](http://www.glfw.org/docs/latest/quick.html) for GLFW @@ -14,135 +16,224 @@ If you are new to GLFW, you may find the [transition guide](http://www.glfw.org/docs/latest/moving.html) for moving to the GLFW 3 API. -Note that a number of source files have been added or renamed in 3.1, which may -require you to update any custom build files you have. - ## Compiling GLFW -See the [Compiling GLFW](http://www.glfw.org/docs/latest/compile.html) guide in -the GLFW documentation. +### Dependencies + +To compile GLFW and the accompanying example programs, you will need **CMake**, +which will generate the project files or makefiles for your particular +development environment. If you are on a Unix-like system such as Linux or +FreeBSD or have a package system like Fink, MacPorts, Cygwin or Homebrew, you +can simply install its CMake package. If not, you can get installers for +Windows and OS X from the [CMake website](http://www.cmake.org/). + +Additional dependencies are listed below. + + +#### Visual C++ on Windows + +The Microsoft Platform SDK that is installed along with Visual C++ contains all +the necessary headers, link libraries and tools except for CMake. + + +#### MinGW or MinGW-w64 on Windows + +These packages contain all the necessary headers, link libraries and tools +except for CMake. + + +#### MinGW or MinGW-w64 cross-compilation + +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/` directory that allow for easy +cross-compilation of Windows binaries. To use these files you need to add a +special parameter when generating the project files or makefiles: + + cmake -DCMAKE_TOOLCHAIN_FILE= . + +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 Debian/Ubuntu and Cygwin MinGW-w64 packages +have `/usr/x86_64-w64-mingw32` for the 64-bit compilers, so the correct +invocation would be: + + cmake -DCMAKE_TOOLCHAIN_FILE=CMake/x86_64-w64-mingw32.cmake . + +For more details see the article +[CMake Cross Compiling](http://www.paraview.org/Wiki/CMake_Cross_Compiling) on +the CMake wiki. + + +#### Xcode on OS X + +Xcode contains all necessary tools except for CMake. The necessary headers and +libraries are included in the core OS frameworks. Xcode can be downloaded from +the Mac App Store. + + +#### Unix-like systems with X11 + +To compile GLFW for X11, you need to have the X11 and OpenGL header packages +installed, as well as the basic development tools like GCC and make. For +example, on Ubuntu and other distributions based on Debian GNU/Linux, you need +to install the `xorg-dev` and `libglu1-mesa-dev` packages. The former pulls in +all X.org header packages and the latter pulls in the Mesa OpenGL and GLU +packages. Note that using header files and libraries from Mesa during +compilation *will not* tie your binaries to the Mesa implementation of OpenGL. + + +### Generating with CMake + +Once you have all necessary dependencies, it is time to generate the project +files or makefiles for your development environment. CMake needs to know two +paths for this: the path to the source directory and the target path for the +generated files and compiled binaries. If these are the same, it is called an +in-tree build, otherwise it is called an out-of-tree build. + +One of several advantages of out-of-tree builds is that you can generate files +and compile for different development environments using a single source tree. + + +#### Using CMake from the command-line + +To make an in-tree build, enter the root directory of the GLFW source tree and +run CMake. The current directory is used as target path, while the path +provided as an argument is used to find the source tree. + + cd + cmake . + +To make an out-of-tree build, make another directory, enter it and run CMake +with the (relative or absolute) path to the root of the source tree as an +argument. + + cd + mkdir build + cd build + cmake .. + + +#### Using the CMake GUI + +If you are using the GUI version, choose the root of the GLFW source tree as +source location and the same directory or another, empty directory as the +destination for binaries. Choose *Configure*, change any options you wish to, +*Configure* again to let the changes take effect and then *Generate*. + + +### 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 CMake users 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, use the `ccmake` tool. +Some package systems like Ubuntu and other distributions based on Debian +GNU/Linux have this tool in a separate `cmake-curses-gui` package. + + +#### Shared options + +`BUILD_SHARED_LIBS` determines whether GLFW is built as a static +library or as a DLL / shared library / dynamic library. + +`LIB_SUFFIX` affects where the GLFW shared /dynamic library is +installed. If it is empty, it is installed to `$PREFIX/lib`. If it is set to +`64`, it is installed to `$PREFIX/lib64`. + +`GLFW_BUILD_EXAMPLES` determines whether the GLFW examples are built +along with the library. + +`GLFW_BUILD_TESTS` determines whether the GLFW test programs are +built along with the library. + + +#### OS X specific options + +`GLFW_USE_CHDIR` determines whether `glfwInit` changes the current +directory of bundled applications to the `Contents/Resources` directory. + +`GLFW_USE_MENUBAR` determines whether the first call to +`glfwCreateWindow` sets up a minimal menu bar. + +`GLFW_BUILD_UNIVERSAL` determines whether to build Universal Binaries. + + +#### Windows specific options + +`USE_MSVC_RUNTIME_LIBRARY_DLL` determines whether to use the DLL version or the +static library version of the Visual C++ runtime library. + +`GLFW_USE_DWM_SWAP_INTERVAL` determines whether the swap interval is set even +when DWM compositing is enabled. This can lead to severe jitter and is not +usually recommended. + +`GLFW_USE_OPTIMUS_HPG` determines whether to export the `NvOptimusEnablement` +symbol, which forces the use of the high-performance GPU on nVidia Optimus +systems. + + +#### EGL specific options + +`GLFW_USE_EGL` determines whether to use EGL instead of the platform-specific +context creation API. Note that EGL is not yet provided on all supported +platforms. + +`GLFW_CLIENT_LIBRARY` determines which client API library to use. If set to +`opengl` the OpenGL library is used, if set to `glesv1` for the OpenGL ES 1.x +library is used, or if set to `glesv2` the OpenGL ES 2.0 library is used. The +selected library and its header files must be present on the system for this to +work. + + +## Installing GLFW + +A rudimentary installation target is provided for all supported platforms via +CMake. ## Using GLFW -See the -[Building programs that use GLFW](http://www.glfw.org/docs/latest/build.html) -guide in the GLFW documentation. - - -## Reporting bugs - -Bugs are reported to our [issue tracker](https://github.com/glfw/glfw/issues). -Please always include the name and version of the OS where the bug occurs and -the version of GLFW used. If you have cloned it, include the commit ID used. - -If it's a build issue, please also include the build log and the name and -version of your development environment. - -If it's a context creation issue, please also include the make and model of your -graphics card and the version of your driver. - -This will help both us and other people experiencing the same bug. - - -## Dependencies - -GLFW bundles a number of dependencies in the `deps/` directory. - - - [Khronos extension headers](https://www.opengl.org/registry/) for API - extension symbols used by GLFW - - [getopt\_port](https://github.com/kimgr/getopt_port/) for examples - with command-line options - - [TinyCThread](https://github.com/tinycthread/tinycthread) for threaded - examples - - An OpenGL 3.2 core loader generated by - [glad](https://github.com/Dav1dde/glad) for examples using modern OpenGL +See the [GLFW documentation](http://www.glfw.org/docs/latest/). ## Changelog - - Added `GLFWcursor` custom system cursor handle - - Added `glfwCreateCursor`, `glfwDestroyCursor` and `glfwSetCursor` for - managing custom system cursors - - Added `GLFWimage` struct for passing 32-bit RGBA images - - Added monitor and adapter identifier access to native API - - Added `glfwSetDropCallback` and `GLFWdropfun` for receiving dropped files - - Added `glfwPostEmptyEvent` for allowing secondary threads to cause - `glfwWaitEvents` to return - - Added `empty` test program for verifying posting of empty events - - Added `glfwSetCharModsCallback` for receiving character events with modifiers - - Added `glfwGetWindowFrameSize` for retrieving the size of the frame around - the client area of a window - - Added `GLFW_AUTO_ICONIFY` for controlling whether full screen windows - automatically iconify (and restore the previous video mode) on focus loss - - Added `GLFW_DONT_CARE` for indicating that any value is acceptable - - Added `GLFW_DOUBLEBUFFER` for controlling whether to use double buffering - - Added `GLFW_CONTEXT_RELEASE_BEHAVIOR` and values - `GLFW_ANY_RELEASE_BEHAVIOR`, `GLFW_RELEASE_BEHAVIOR_FLUSH` and - `GLFW_RELEASE_BEHAVIOR_NONE` for `GL_KHR_context_flush_control` support - - Added `GLFW_INCLUDE_ES31` for including the OpenGL ES 3.1 header - - Added `GLFW_FLOATING` for creating always-on-top windowed mode windows - - Added `GLFW_FOCUSED` window hint for controlling initial input focus - - Added *partial and experimental* support for Wayland - - Added *partial and experimental* support for Mir - - Changed the default of `GLFW_REFRESH_RATE` to `GLFW_DONT_CARE` to maintain - the default behavior - - Changed static library to build as position independent code for easier use - from the Rust language - - Bugfix: The debug context attribute was set from `GL_ARB_debug_output` even - when a debug context had not been requested - - Bugfix: The particles example was not linked against the threading library - - Bugfix: The cursor was not positioned over newly created full screen windows - - [Cocoa] Added `_GLFW_USE_RETINA` to control whether windows will use the full - resolution on Retina displays - - [Cocoa] Bugfix: Using a 1x1 cursor for hidden mode caused some screen - recorders to fail - - [Cocoa] Bugfix: Some Core Foundation objects were leaked during joystick - enumeration and termination - - [Cocoa] Bugfix: One copy of each display name string was leaked - - [Cocoa] Bugfix: Monitor enumeration caused a segfault if no `NSScreen` was - found for a given `CGDisplay` - - [Cocoa] Bugfix: Modifier key events were lost if the corresponding modifier - bit field was unchanged - - [Cocoa] Bugfix: Joystick enumeration took hundreds of ms on some systems - - [Cocoa] Bugfix: The cursor was hidden when the user resized a GLFW window - - [Win32] Enabled generation of pkg-config file for MinGW - - [Win32] Removed option to require explicitly linking against `winmm.dll` - - [Win32] Bugfix: Failure to load winmm or its functions was not reported to - the error callback - - [Win32] Bugfix: Some keys were reported based on the current layout instead - of their physical location - - [Win32] Bugfix: Maximized hidden windows were restored by `glfwShowWindow` - - [Win32] Bugfix: Context re-creation was not triggered by sRGB hint - - [Win32] Bugfix: Full screen windows were incorrectly sized and placed on some - systems - - [Win32] Bugfix: Gamma ramp functions acted on entire desktop instead of the - specified monitor - - [Win32] Bugfix: The wrong incorrect physical size was returned for - non-primary monitors - - [Win32] Bugfix: X-axis scroll offsets were inverted - - [X11] Added run-time support for systems lacking the XKB extension - - [X11] Made GLX 1.3 the minimum supported version - - [X11] Replaced `XRRGetScreenResources` with `XRRGetScreenResourcesCurrent` - for monitor property retrieval - - [X11] Bugfix: The case of finding no usable CRTCs was not detected - - [X11] Bugfix: Detection of broken Nvidia RandR gamma support did not verify - that at least one CRTC was present - - [X11] Bugfix: A stale `_NET_SUPPORTING_WM_CHECK` root window property would - cause an uncaught `BadWindow` error - - [X11] Bugfix: No check was made for the presence of GLX 1.3 when - `GLX_SGIX_fbconfig` was unavailable - - [X11] Bugfix: The message type of ICCCM protocol events was not checked - - [X11] Bugfix: `glfwDestroyWindow` did not flush the output buffer - - [X11] Bugfix: Window frame interactions were reported as focus events - - [X11] Bugfix: Workaround for legacy Compiz caused flickering during resize - - [X11] Bugfix: The name pointer of joysticks were not cleared on disconnection - - [X11] Bugfix: Video mode dimensions were not rotated to match the CRTC - - [X11] Bugfix: Unicode character input ignored dead keys - - [X11] Bugfix: X-axis scroll offsets were inverted - - [X11] Bugfix: Full screen override redirect windows were not always - positioned over the specified monitor + - Allowed character callback to be triggered regardless of modifier keys + - Bugfix: The `-Wall` flag was not used with Clang and other GCC compatibles + - Bugfix: The default for `GLFW_ALPHA_BITS` was set to zero + - Bugfix: `glfwInit` would segfault if monitor enumeration failed and no error + callback was set + - [Win32] Added `_GLFW_USE_DWM_SWAP_INTERVAL` for forcing the swap interval + to be set even when DWM compositing is enabled + - [Win32] Added support for forcing the use of the high-performance GPU + on nVidia Optimus systems + - [Win32] Bugfix: The clipboard string was not freed on terminate + - [Win32] Bugfix: Entry points for OpenGL 1.0 and 1.1 functions were not + returned by `glfwGetProcAddress` + - [Win32] Bugfix: The `user32` and `dwmapi` module handles were not freed on + library termination + - [Cocoa] Added support for precise scrolling deltas on OS X 10.7 and later + - [Cocoa] Enabled explicit creation of OpenGL 3.x and 4.x contexts as supported + by OS X 10.9 + - [Cocoa] Bugfix: The clipboard string was not freed on terminate + - [Cocoa] Bugfix: Selectors were used that are not declared by the 10.6 SDK + - [Cocoa] Bugfix: The position set by `glfwSetWindowPos` was incorrect + - [X11] Bugfix: Override-redirect windows were resized to the desired instead + of the actual resolution of the selected video mode + - [X11] Bugfix: Screensaver override for full screen windows had a possible + race condition + - [X11] Bugfix: The reported window position did not account for the size of + the window frame on some WMs + - [X11] Bugfix: The original video mode of a monitor was overwritten by calls + to `glfwSetWindowSize` + - [X11] Bugfix: Key release events for `GLFW_KEY_KP_5` were discarded. ## Contact @@ -180,29 +271,21 @@ skills. - Niklas Bergström - Doug Binks - blanco - - Martin Capitanio - Lambert Clara - - Andrew Corrigan - Noel Cower - Jarrod Davis - Olivier Delannoy - Paul R. Deppe - - Michael Dickens - Jonathan Dummer - Ralph Eastwood - - Michael Fogleman - Gerald Franz - GeO4d - Marcus Geelnard - - Eloi Marín Gratacós - Stefan Gustavson - Sylvain Hellegouarch - - Matthew Henry - heromyth - - Lucas Hinderberger - Paul Holden - Toni Jovanoski - - Arseny Kapoulkine - Osman Keskin - Cameron King - Peter Knut @@ -219,28 +302,20 @@ skills. - Marcel Metz - Kenneth Miller - Bruce Mitchener - - Jack Moffitt - Jeff Molofee - Jon Morton - - Pierre Moulon - Julian Møller - - Kamil Nowakowski - Ozzy - - Andri Pálsson - Peoro - Braden Pellett - Arturo J. Pérez - - Cyril Pichard - - Pieroman - Jorge Rodriguez - Ed Ropple - Riku Salminen - - Brandon Schaefer - Sebastian Schuberth - Matt Sealey - SephiRok - Steve Sexton - - Systemcluster - Dmitri Shuralyov - Daniel Skorupski - Bradley Smith @@ -251,17 +326,13 @@ skills. - TTK-Bandit - Sergey Tikhomirov - Samuli Tuomola - - urraka - Jari Vetoniemi - - Ricardo Vieira - Simon Voordouw - Torsten Walluhn - - Patrick Walton - Jay Weisskopf - Frank Wille - yuriks - Santi Zupancic - - Jonas Ådahl - Lasse Öörni - All the unmentioned and anonymous contributors in the GLFW community, for bug reports, patches, feedback, testing and encouragement diff --git a/extern/glfw/deps/GL/glext.h b/extern/glfw/deps/GL/glext.h index e619fa3..fa506fa 100644 --- a/extern/glfw/deps/GL/glext.h +++ b/extern/glfw/deps/GL/glext.h @@ -6,7 +6,7 @@ extern "C" { #endif /* -** Copyright (c) 2013-2014 The Khronos Group Inc. +** Copyright (c) 2013 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 @@ -33,7 +33,7 @@ extern "C" { ** used to make the header, and the header can be found at ** http://www.opengl.org/registry/ ** -** Khronos $Revision: 27684 $ on $Date: 2014-08-11 01:21:35 -0700 (Mon, 11 Aug 2014) $ +** Khronos $Revision$ on $Date$ */ #if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) @@ -53,7 +53,7 @@ extern "C" { #define GLAPI extern #endif -#define GL_GLEXT_VERSION 20140810 +#define GL_GLEXT_VERSION 20130721 /* Generated C header for: * API: gl @@ -108,14 +108,18 @@ extern "C" { #define GL_SINGLE_COLOR 0x81F9 #define GL_SEPARATE_SPECULAR_COLOR 0x81FA #define GL_ALIASED_POINT_SIZE_RANGE 0x846D -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); -typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); -GLAPI void APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void APIENTRY glBlendEquation (GLenum mode); +GLAPI void APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +GLAPI void APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); GLAPI void APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); #endif #endif /* GL_VERSION_1_2 */ @@ -220,13 +224,13 @@ GLAPI void APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffs #define GL_DOT3_RGBA 0x86AF typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, void *img); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); @@ -267,13 +271,13 @@ typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glActiveTexture (GLenum texture); GLAPI void APIENTRY glSampleCoverage (GLfloat value, GLboolean invert); -GLAPI void APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glGetCompressedTexImage (GLenum target, GLint level, void *img); +GLAPI void APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glGetCompressedTexImage (GLenum target, GLint level, GLvoid *img); GLAPI void APIENTRY glClientActiveTexture (GLenum texture); GLAPI void APIENTRY glMultiTexCoord1d (GLenum target, GLdouble s); GLAPI void APIENTRY glMultiTexCoord1dv (GLenum target, const GLdouble *v); @@ -355,18 +359,9 @@ GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *m); #define GL_TEXTURE_FILTER_CONTROL 0x8500 #define GL_DEPTH_TEXTURE_MODE 0x884B #define GL_COMPARE_R_TO_TEXTURE 0x884E -#define GL_FUNC_ADD 0x8006 -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid *const*indices, GLsizei drawcount); typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); @@ -375,7 +370,7 @@ typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord); typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); @@ -392,7 +387,7 @@ typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, G typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v); typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); @@ -409,12 +404,10 @@ typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v); typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); GLAPI void APIENTRY glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); -GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount); +GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const GLvoid *const*indices, GLsizei drawcount); GLAPI void APIENTRY glPointParameterf (GLenum pname, GLfloat param); GLAPI void APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params); GLAPI void APIENTRY glPointParameteri (GLenum pname, GLint param); @@ -423,7 +416,7 @@ GLAPI void APIENTRY glFogCoordf (GLfloat coord); GLAPI void APIENTRY glFogCoordfv (const GLfloat *coord); GLAPI void APIENTRY glFogCoordd (GLdouble coord); GLAPI void APIENTRY glFogCoorddv (const GLdouble *coord); -GLAPI void APIENTRY glFogCoordPointer (GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glFogCoordPointer (GLenum type, GLsizei stride, const GLvoid *pointer); GLAPI void APIENTRY glSecondaryColor3b (GLbyte red, GLbyte green, GLbyte blue); GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *v); GLAPI void APIENTRY glSecondaryColor3d (GLdouble red, GLdouble green, GLdouble blue); @@ -440,7 +433,7 @@ GLAPI void APIENTRY glSecondaryColor3ui (GLuint red, GLuint green, GLuint blue); GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *v); GLAPI void APIENTRY glSecondaryColor3us (GLushort red, GLushort green, GLushort blue); GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *v); -GLAPI void APIENTRY glSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); GLAPI void APIENTRY glWindowPos2d (GLdouble x, GLdouble y); GLAPI void APIENTRY glWindowPos2dv (const GLdouble *v); GLAPI void APIENTRY glWindowPos2f (GLfloat x, GLfloat y); @@ -457,8 +450,6 @@ GLAPI void APIENTRY glWindowPos3i (GLint x, GLint y, GLint z); GLAPI void APIENTRY glWindowPos3iv (const GLint *v); GLAPI void APIENTRY glWindowPos3s (GLshort x, GLshort y, GLshort z); GLAPI void APIENTRY glWindowPos3sv (const GLshort *v); -GLAPI void APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GLAPI void APIENTRY glBlendEquation (GLenum mode); #endif #endif /* GL_VERSION_1_4 */ @@ -529,13 +520,13 @@ typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage); -typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, void *data); +typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); typedef void *(APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target); typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, void **params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid **params); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glGenQueries (GLsizei n, GLuint *ids); GLAPI void APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids); @@ -549,13 +540,13 @@ GLAPI void APIENTRY glBindBuffer (GLenum target, GLuint buffer); GLAPI void APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers); GLAPI void APIENTRY glGenBuffers (GLsizei n, GLuint *buffers); GLAPI GLboolean APIENTRY glIsBuffer (GLuint buffer); -GLAPI void APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage); -GLAPI void APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data); -GLAPI void APIENTRY glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, void *data); +GLAPI void APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); +GLAPI void APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); +GLAPI void APIENTRY glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); GLAPI void *APIENTRY glMapBuffer (GLenum target, GLenum access); GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum target); GLAPI void APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, void **params); +GLAPI void APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, GLvoid **params); #endif #endif /* GL_VERSION_1_5 */ @@ -676,7 +667,7 @@ typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params); typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params); typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void **pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid **pointer); typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader); typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); @@ -738,7 +729,7 @@ typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort * typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v); typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v); typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); GLAPI void APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs); @@ -770,7 +761,7 @@ GLAPI void APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *param GLAPI void APIENTRY glGetVertexAttribdv (GLuint index, GLenum pname, GLdouble *params); GLAPI void APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params); GLAPI void APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer); +GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid **pointer); GLAPI GLboolean APIENTRY glIsProgram (GLuint program); GLAPI GLboolean APIENTRY glIsShader (GLuint shader); GLAPI void APIENTRY glLinkProgram (GLuint program); @@ -832,7 +823,7 @@ GLAPI void APIENTRY glVertexAttrib4sv (GLuint index, const GLshort *v); GLAPI void APIENTRY glVertexAttrib4ubv (GLuint index, const GLubyte *v); GLAPI void APIENTRY glVertexAttrib4uiv (GLuint index, const GLuint *v); GLAPI void APIENTRY glVertexAttrib4usv (GLuint index, const GLushort *v); -GLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); #endif #endif /* GL_VERSION_2_0 */ @@ -1116,7 +1107,7 @@ typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, G typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp); typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode); typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void); -typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params); typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params); typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x); @@ -1201,7 +1192,7 @@ GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLAPI void APIENTRY glClampColor (GLenum target, GLenum clamp); GLAPI void APIENTRY glBeginConditionalRender (GLuint id, GLenum mode); GLAPI void APIENTRY glEndConditionalRender (void); -GLAPI void APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); GLAPI void APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params); GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params); GLAPI void APIENTRY glVertexAttribI1i (GLuint index, GLint x); @@ -1308,13 +1299,11 @@ GLAPI GLboolean APIENTRY glIsVertexArray (GLuint array); #define GL_UNIFORM_BUFFER_START 0x8A29 #define GL_UNIFORM_BUFFER_SIZE 0x8A2A #define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B -#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C #define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D #define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E #define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F #define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 #define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 -#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 #define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 #define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 #define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 @@ -1333,11 +1322,10 @@ GLAPI GLboolean APIENTRY glIsVertexArray (GLuint array); #define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 #define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 #define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 #define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 #define GL_INVALID_INDEX 0xFFFFFFFFu typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount); typedef void (APIENTRYP PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer); typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint index); typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); @@ -1350,7 +1338,7 @@ typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLu typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei instancecount); -GLAPI void APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount); +GLAPI void APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount); GLAPI void APIENTRY glTexBuffer (GLenum target, GLenum internalformat, GLuint buffer); GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint index); GLAPI void APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); @@ -1470,45 +1458,45 @@ typedef int64_t GLint64; #define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E #define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F #define GL_MAX_INTEGER_SAMPLES 0x9110 -typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex); +typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount, GLint basevertex); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid *const*indices, GLsizei drawcount, const GLint *basevertex); typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC) (GLenum mode); typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags); typedef GLboolean (APIENTRYP PFNGLISSYNCPROC) (GLsync sync); typedef void (APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync); typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); typedef void (APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); -typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *data); +typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *params); typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data); typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params); typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val); -typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint maskNumber, GLbitfield mask); +typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); -GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); -GLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); -GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex); +GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +GLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount, GLint basevertex); +GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const GLvoid *const*indices, GLsizei drawcount, const GLint *basevertex); GLAPI void APIENTRY glProvokingVertex (GLenum mode); GLAPI GLsync APIENTRY glFenceSync (GLenum condition, GLbitfield flags); GLAPI GLboolean APIENTRY glIsSync (GLsync sync); GLAPI void APIENTRY glDeleteSync (GLsync sync); GLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); GLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); -GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *data); +GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *params); GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); GLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data); GLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params); GLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level); -GLAPI void APIENTRY glTexImage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -GLAPI void APIENTRY glTexImage3DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTexImage2DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTexImage3DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); GLAPI void APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val); -GLAPI void APIENTRY glSampleMaski (GLuint maskNumber, GLbitfield mask); +GLAPI void APIENTRY glSampleMaski (GLuint index, GLbitfield mask); #endif #endif /* GL_VERSION_3_2 */ @@ -1734,8 +1722,8 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); typedef void (APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -typedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect); +typedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const GLvoid *indirect); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const GLvoid *indirect); typedef void (APIENTRYP PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); typedef void (APIENTRYP PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); typedef void (APIENTRYP PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z); @@ -1781,8 +1769,8 @@ GLAPI void APIENTRY glBlendEquationi (GLuint buf, GLenum mode); GLAPI void APIENTRY glBlendEquationSeparatei (GLuint buf, GLenum modeRGB, GLenum modeAlpha); GLAPI void APIENTRY glBlendFunci (GLuint buf, GLenum src, GLenum dst); GLAPI void APIENTRY glBlendFuncSeparatei (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -GLAPI void APIENTRY glDrawArraysIndirect (GLenum mode, const void *indirect); -GLAPI void APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const void *indirect); +GLAPI void APIENTRY glDrawArraysIndirect (GLenum mode, const GLvoid *indirect); +GLAPI void APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const GLvoid *indirect); GLAPI void APIENTRY glUniform1d (GLint location, GLdouble x); GLAPI void APIENTRY glUniform2d (GLint location, GLdouble x, GLdouble y); GLAPI void APIENTRY glUniform3d (GLint location, GLdouble x, GLdouble y, GLdouble z); @@ -1863,12 +1851,12 @@ GLAPI void APIENTRY glGetQueryIndexediv (GLenum target, GLuint index, GLenum pna #define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F #define GL_UNDEFINED_VERTEX 0x8260 typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void); -typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length); +typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length); typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f); typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d); -typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); -typedef void (APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length); +typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); +typedef void (APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length); typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program); typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program); @@ -1938,7 +1926,7 @@ typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble *v); typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble *v); typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble *params); typedef void (APIENTRYP PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat *v); typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); @@ -1952,12 +1940,12 @@ typedef void (APIENTRYP PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfl typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glReleaseShaderCompiler (void); -GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const void *binary, GLsizei length); +GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length); GLAPI void APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); GLAPI void APIENTRY glDepthRangef (GLfloat n, GLfloat f); GLAPI void APIENTRY glClearDepthf (GLfloat d); -GLAPI void APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); -GLAPI void APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length); +GLAPI void APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); +GLAPI void APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length); GLAPI void APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value); GLAPI void APIENTRY glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program); GLAPI void APIENTRY glActiveShaderProgram (GLuint pipeline, GLuint program); @@ -2027,7 +2015,7 @@ GLAPI void APIENTRY glVertexAttribL1dv (GLuint index, const GLdouble *v); GLAPI void APIENTRY glVertexAttribL2dv (GLuint index, const GLdouble *v); GLAPI void APIENTRY glVertexAttribL3dv (GLuint index, const GLdouble *v); GLAPI void APIENTRY glVertexAttribL4dv (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribLPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glVertexAttribLPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); GLAPI void APIENTRY glGetVertexAttribLdv (GLuint index, GLenum pname, GLdouble *params); GLAPI void APIENTRY glViewportArrayv (GLuint first, GLsizei count, const GLfloat *v); GLAPI void APIENTRY glViewportIndexedf (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); @@ -2147,15 +2135,11 @@ GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data) #define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD #define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE #define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF -#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C -#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D -#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E -#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F #define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); -typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); +typedef void (APIENTRYP PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params); typedef void (APIENTRYP PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params); typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); typedef void (APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); @@ -2168,7 +2152,7 @@ typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum m GLAPI void APIENTRY glDrawArraysInstancedBaseInstance (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance); GLAPI void APIENTRY glDrawElementsInstancedBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance); GLAPI void APIENTRY glDrawElementsInstancedBaseVertexBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); -GLAPI void APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); +GLAPI void APIENTRY glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params); GLAPI void APIENTRY glGetActiveAtomicCounterBufferiv (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params); GLAPI void APIENTRY glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); GLAPI void APIENTRY glMemoryBarrier (GLbitfield barriers); @@ -2207,15 +2191,14 @@ typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum #define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 #define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 #define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 -#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB +#define GL_MAX_COMPUTE_LOCAL_INVOCATIONS 0x90EB #define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE #define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF -#define GL_COMPUTE_WORK_GROUP_SIZE 0x8267 +#define GL_COMPUTE_LOCAL_WORK_SIZE 0x8267 #define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC #define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED #define GL_DISPATCH_INDIRECT_BUFFER 0x90EE #define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF -#define GL_COMPUTE_SHADER_BIT 0x00000020 #define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 #define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 #define GL_DEBUG_CALLBACK_FUNCTION 0x8244 @@ -2440,7 +2423,6 @@ typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum #define GL_VERTEX_BINDING_STRIDE 0x82D8 #define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 #define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA -#define GL_VERTEX_BINDING_BUFFER 0x8F4F #define GL_DISPLAY_LIST 0x82E7 typedef void (APIENTRYP PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); typedef void (APIENTRYP PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); @@ -2449,7 +2431,6 @@ typedef void (APIENTRYP PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect); typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); typedef void (APIENTRYP PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params); typedef void (APIENTRYP PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); typedef void (APIENTRYP PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level); typedef void (APIENTRYP PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); @@ -2478,7 +2459,7 @@ typedef void (APIENTRYP PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLu typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam); -typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); typedef void (APIENTRYP PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message); typedef void (APIENTRYP PFNGLPOPDEBUGGROUPPROC) (void); typedef void (APIENTRYP PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); @@ -2493,7 +2474,6 @@ GLAPI void APIENTRY glDispatchComputeIndirect (GLintptr indirect); GLAPI void APIENTRY glCopyImageSubData (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); GLAPI void APIENTRY glFramebufferParameteri (GLenum target, GLenum pname, GLint param); GLAPI void APIENTRY glGetFramebufferParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetInternalformati64v (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params); GLAPI void APIENTRY glInvalidateTexSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); GLAPI void APIENTRY glInvalidateTexImage (GLuint texture, GLint level); GLAPI void APIENTRY glInvalidateBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr length); @@ -2522,7 +2502,7 @@ GLAPI void APIENTRY glVertexBindingDivisor (GLuint bindingindex, GLuint divisor) GLAPI void APIENTRY glDebugMessageControl (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); GLAPI void APIENTRY glDebugMessageInsert (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); GLAPI void APIENTRY glDebugMessageCallback (GLDEBUGPROC callback, const void *userParam); -GLAPI GLuint APIENTRY glGetDebugMessageLog (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +GLAPI GLuint APIENTRY glGetDebugMessageLog (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); GLAPI void APIENTRY glPushDebugGroup (GLenum source, GLuint id, GLsizei length, const GLchar *message); GLAPI void APIENTRY glPopDebugGroup (void); GLAPI void APIENTRY glObjectLabel (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); @@ -2535,8 +2515,6 @@ GLAPI void APIENTRY glGetObjectPtrLabel (const void *ptr, GLsizei bufSize, GLsiz #ifndef GL_VERSION_4_4 #define GL_VERSION_4_4 1 #define GL_MAX_VERTEX_ATTRIB_STRIDE 0x82E5 -#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221 -#define GL_TEXTURE_BUFFER_BINDING 0x8C2A #define GL_MAP_PERSISTENT_BIT 0x0040 #define GL_MAP_COHERENT_BIT 0x0080 #define GL_DYNAMIC_STORAGE_BIT 0x0100 @@ -2575,279 +2553,10 @@ GLAPI void APIENTRY glBindVertexBuffers (GLuint first, GLsizei count, const GLui #endif #endif /* GL_VERSION_4_4 */ -#ifndef GL_VERSION_4_5 -#define GL_VERSION_4_5 1 -#define GL_CONTEXT_LOST 0x0507 -#define GL_NEGATIVE_ONE_TO_ONE 0x935E -#define GL_ZERO_TO_ONE 0x935F -#define GL_CLIP_ORIGIN 0x935C -#define GL_CLIP_DEPTH_MODE 0x935D -#define GL_QUERY_WAIT_INVERTED 0x8E17 -#define GL_QUERY_NO_WAIT_INVERTED 0x8E18 -#define GL_QUERY_BY_REGION_WAIT_INVERTED 0x8E19 -#define GL_QUERY_BY_REGION_NO_WAIT_INVERTED 0x8E1A -#define GL_MAX_CULL_DISTANCES 0x82F9 -#define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES 0x82FA -#define GL_TEXTURE_TARGET 0x1006 -#define GL_QUERY_TARGET 0x82EA -#define GL_TEXTURE_BINDING 0x82EB -#define GL_GUILTY_CONTEXT_RESET 0x8253 -#define GL_INNOCENT_CONTEXT_RESET 0x8254 -#define GL_UNKNOWN_CONTEXT_RESET 0x8255 -#define GL_RESET_NOTIFICATION_STRATEGY 0x8256 -#define GL_LOSE_CONTEXT_ON_RESET 0x8252 -#define GL_NO_RESET_NOTIFICATION 0x8261 -#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT 0x00000004 -#define GL_CONTEXT_RELEASE_BEHAVIOR 0x82FB -#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82FC -typedef void (APIENTRYP PFNGLCLIPCONTROLPROC) (GLenum origin, GLenum depth); -typedef void (APIENTRYP PFNGLCREATETRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC) (GLuint xfb, GLuint index, GLuint buffer); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC) (GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizei size); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKIVPROC) (GLuint xfb, GLenum pname, GLint *param); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint *param); -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI64_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint64 *param); -typedef void (APIENTRYP PFNGLCREATEBUFFERSPROC) (GLsizei n, GLuint *buffers); -typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEPROC) (GLuint buffer, GLsizei size, const void *data, GLbitfield flags); -typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAPROC) (GLuint buffer, GLsizei size, const void *data, GLenum usage); -typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizei size, const void *data); -typedef void (APIENTRYP PFNGLCOPYNAMEDBUFFERSUBDATAPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizei size); -typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizei size, GLenum format, GLenum type, const void *data); -typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFERPROC) (GLuint buffer, GLenum access); -typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizei length, GLbitfield access); -typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFERPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizei length); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVPROC) (GLuint buffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERI64VPROC) (GLuint buffer, GLenum pname, GLint64 *params); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVPROC) (GLuint buffer, GLenum pname, void **params); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizei size, void *data); -typedef void (APIENTRYP PFNGLCREATEFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC) (GLuint framebuffer, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC) (GLuint framebuffer, GLenum buf); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs); -typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC) (GLuint framebuffer, GLenum src); -typedef void (APIENTRYP PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments); -typedef void (APIENTRYP PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint *value); -typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint *value); -typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERFVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat *value); -typedef void (APIENTRYP PFNGLCLEARNAMEDFRAMEBUFFERFIPROC) (GLuint framebuffer, GLenum buffer, const GLfloat depth, GLint stencil); -typedef void (APIENTRYP PFNGLBLITNAMEDFRAMEBUFFERPROC) (GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC) (GLuint framebuffer, GLenum target); -typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC) (GLuint framebuffer, GLenum pname, GLint *param); -typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLCREATERENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC) (GLuint renderbuffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLCREATETEXTURESPROC) (GLenum target, GLsizei n, GLuint *textures); -typedef void (APIENTRYP PFNGLTEXTUREBUFFERPROC) (GLuint texture, GLenum internalformat, GLuint buffer); -typedef void (APIENTRYP PFNGLTEXTUREBUFFERRANGEPROC) (GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizei size); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC) (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC) (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFPROC) (GLuint texture, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, const GLfloat *param); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIPROC) (GLuint texture, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, const GLuint *params); -typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, const GLint *param); -typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPPROC) (GLuint texture); -typedef void (APIENTRYP PFNGLBINDTEXTUREUNITPROC) (GLuint unit, GLuint texture); -typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLsizei bufSize, void *pixels); -typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVPROC) (GLuint texture, GLint level, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVPROC) (GLuint texture, GLint level, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLCREATEVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays); -typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index); -typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index); -typedef void (APIENTRYP PFNGLVERTEXARRAYELEMENTBUFFERPROC) (GLuint vaobj, GLuint buffer); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBUFFERPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBUFFERSPROC) (GLuint vaobj, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides); -typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBBINDINGPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); -typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBIFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -typedef void (APIENTRYP PFNGLVERTEXARRAYATTRIBLFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -typedef void (APIENTRYP PFNGLVERTEXARRAYBINDINGDIVISORPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); -typedef void (APIENTRYP PFNGLGETVERTEXARRAYIVPROC) (GLuint vaobj, GLenum pname, GLint *param); -typedef void (APIENTRYP PFNGLGETVERTEXARRAYINDEXEDIVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint *param); -typedef void (APIENTRYP PFNGLGETVERTEXARRAYINDEXED64IVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint64 *param); -typedef void (APIENTRYP PFNGLCREATESAMPLERSPROC) (GLsizei n, GLuint *samplers); -typedef void (APIENTRYP PFNGLCREATEPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines); -typedef void (APIENTRYP PFNGLCREATEQUERIESPROC) (GLenum target, GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLMEMORYBARRIERBYREGIONPROC) (GLbitfield barriers); -typedef void (APIENTRYP PFNGLGETTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void *pixels); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void *pixels); -typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSPROC) (void); -typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLsizei bufSize, void *pixels); -typedef void (APIENTRYP PFNGLGETNTEXIMAGEPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels); -typedef void (APIENTRYP PFNGLGETNUNIFORMDVPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); -typedef void (APIENTRYP PFNGLGETNUNIFORMFVPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -typedef void (APIENTRYP PFNGLGETNUNIFORMIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); -typedef void (APIENTRYP PFNGLGETNUNIFORMUIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params); -typedef void (APIENTRYP PFNGLREADNPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); -typedef void (APIENTRYP PFNGLGETNMAPDVPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); -typedef void (APIENTRYP PFNGLGETNMAPFVPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); -typedef void (APIENTRYP PFNGLGETNMAPIVPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint *v); -typedef void (APIENTRYP PFNGLGETNPIXELMAPFVPROC) (GLenum map, GLsizei bufSize, GLfloat *values); -typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVPROC) (GLenum map, GLsizei bufSize, GLuint *values); -typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVPROC) (GLenum map, GLsizei bufSize, GLushort *values); -typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEPROC) (GLsizei bufSize, GLubyte *pattern); -typedef void (APIENTRYP PFNGLGETNCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table); -typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image); -typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span); -typedef void (APIENTRYP PFNGLGETNHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); -typedef void (APIENTRYP PFNGLGETNMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); -typedef void (APIENTRYP PFNGLTEXTUREBARRIERPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glClipControl (GLenum origin, GLenum depth); -GLAPI void APIENTRY glCreateTransformFeedbacks (GLsizei n, GLuint *ids); -GLAPI void APIENTRY glTransformFeedbackBufferBase (GLuint xfb, GLuint index, GLuint buffer); -GLAPI void APIENTRY glTransformFeedbackBufferRange (GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizei size); -GLAPI void APIENTRY glGetTransformFeedbackiv (GLuint xfb, GLenum pname, GLint *param); -GLAPI void APIENTRY glGetTransformFeedbacki_v (GLuint xfb, GLenum pname, GLuint index, GLint *param); -GLAPI void APIENTRY glGetTransformFeedbacki64_v (GLuint xfb, GLenum pname, GLuint index, GLint64 *param); -GLAPI void APIENTRY glCreateBuffers (GLsizei n, GLuint *buffers); -GLAPI void APIENTRY glNamedBufferStorage (GLuint buffer, GLsizei size, const void *data, GLbitfield flags); -GLAPI void APIENTRY glNamedBufferData (GLuint buffer, GLsizei size, const void *data, GLenum usage); -GLAPI void APIENTRY glNamedBufferSubData (GLuint buffer, GLintptr offset, GLsizei size, const void *data); -GLAPI void APIENTRY glCopyNamedBufferSubData (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizei size); -GLAPI void APIENTRY glClearNamedBufferData (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glClearNamedBufferSubData (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizei size, GLenum format, GLenum type, const void *data); -GLAPI void *APIENTRY glMapNamedBuffer (GLuint buffer, GLenum access); -GLAPI void *APIENTRY glMapNamedBufferRange (GLuint buffer, GLintptr offset, GLsizei length, GLbitfield access); -GLAPI GLboolean APIENTRY glUnmapNamedBuffer (GLuint buffer); -GLAPI void APIENTRY glFlushMappedNamedBufferRange (GLuint buffer, GLintptr offset, GLsizei length); -GLAPI void APIENTRY glGetNamedBufferParameteriv (GLuint buffer, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetNamedBufferParameteri64v (GLuint buffer, GLenum pname, GLint64 *params); -GLAPI void APIENTRY glGetNamedBufferPointerv (GLuint buffer, GLenum pname, void **params); -GLAPI void APIENTRY glGetNamedBufferSubData (GLuint buffer, GLintptr offset, GLsizei size, void *data); -GLAPI void APIENTRY glCreateFramebuffers (GLsizei n, GLuint *framebuffers); -GLAPI void APIENTRY glNamedFramebufferRenderbuffer (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -GLAPI void APIENTRY glNamedFramebufferParameteri (GLuint framebuffer, GLenum pname, GLint param); -GLAPI void APIENTRY glNamedFramebufferTexture (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); -GLAPI void APIENTRY glNamedFramebufferTextureLayer (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); -GLAPI void APIENTRY glNamedFramebufferDrawBuffer (GLuint framebuffer, GLenum buf); -GLAPI void APIENTRY glNamedFramebufferDrawBuffers (GLuint framebuffer, GLsizei n, const GLenum *bufs); -GLAPI void APIENTRY glNamedFramebufferReadBuffer (GLuint framebuffer, GLenum src); -GLAPI void APIENTRY glInvalidateNamedFramebufferData (GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments); -GLAPI void APIENTRY glInvalidateNamedFramebufferSubData (GLuint framebuffer, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glClearNamedFramebufferiv (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint *value); -GLAPI void APIENTRY glClearNamedFramebufferuiv (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint *value); -GLAPI void APIENTRY glClearNamedFramebufferfv (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat *value); -GLAPI void APIENTRY glClearNamedFramebufferfi (GLuint framebuffer, GLenum buffer, const GLfloat depth, GLint stencil); -GLAPI void APIENTRY glBlitNamedFramebuffer (GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -GLAPI GLenum APIENTRY glCheckNamedFramebufferStatus (GLuint framebuffer, GLenum target); -GLAPI void APIENTRY glGetNamedFramebufferParameteriv (GLuint framebuffer, GLenum pname, GLint *param); -GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameteriv (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); -GLAPI void APIENTRY glCreateRenderbuffers (GLsizei n, GLuint *renderbuffers); -GLAPI void APIENTRY glNamedRenderbufferStorage (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glNamedRenderbufferStorageMultisample (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetNamedRenderbufferParameteriv (GLuint renderbuffer, GLenum pname, GLint *params); -GLAPI void APIENTRY glCreateTextures (GLenum target, GLsizei n, GLuint *textures); -GLAPI void APIENTRY glTextureBuffer (GLuint texture, GLenum internalformat, GLuint buffer); -GLAPI void APIENTRY glTextureBufferRange (GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizei size); -GLAPI void APIENTRY glTextureStorage1D (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width); -GLAPI void APIENTRY glTextureStorage2D (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -GLAPI void APIENTRY glTextureStorage3D (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -GLAPI void APIENTRY glTextureStorage2DMultisample (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -GLAPI void APIENTRY glTextureStorage3DMultisample (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -GLAPI void APIENTRY glTextureSubImage1D (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTextureSubImage2D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTextureSubImage3D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glCompressedTextureSubImage1D (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTextureSubImage2D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTextureSubImage3D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCopyTextureSubImage1D (GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glCopyTextureSubImage2D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glCopyTextureSubImage3D (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glTextureParameterf (GLuint texture, GLenum pname, GLfloat param); -GLAPI void APIENTRY glTextureParameterfv (GLuint texture, GLenum pname, const GLfloat *param); -GLAPI void APIENTRY glTextureParameteri (GLuint texture, GLenum pname, GLint param); -GLAPI void APIENTRY glTextureParameterIiv (GLuint texture, GLenum pname, const GLint *params); -GLAPI void APIENTRY glTextureParameterIuiv (GLuint texture, GLenum pname, const GLuint *params); -GLAPI void APIENTRY glTextureParameteriv (GLuint texture, GLenum pname, const GLint *param); -GLAPI void APIENTRY glGenerateTextureMipmap (GLuint texture); -GLAPI void APIENTRY glBindTextureUnit (GLuint unit, GLuint texture); -GLAPI void APIENTRY glGetTextureImage (GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels); -GLAPI void APIENTRY glGetCompressedTextureImage (GLuint texture, GLint level, GLsizei bufSize, void *pixels); -GLAPI void APIENTRY glGetTextureLevelParameterfv (GLuint texture, GLint level, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetTextureLevelParameteriv (GLuint texture, GLint level, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetTextureParameterfv (GLuint texture, GLenum pname, GLfloat *params); -GLAPI void APIENTRY glGetTextureParameterIiv (GLuint texture, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetTextureParameterIuiv (GLuint texture, GLenum pname, GLuint *params); -GLAPI void APIENTRY glGetTextureParameteriv (GLuint texture, GLenum pname, GLint *params); -GLAPI void APIENTRY glCreateVertexArrays (GLsizei n, GLuint *arrays); -GLAPI void APIENTRY glDisableVertexArrayAttrib (GLuint vaobj, GLuint index); -GLAPI void APIENTRY glEnableVertexArrayAttrib (GLuint vaobj, GLuint index); -GLAPI void APIENTRY glVertexArrayElementBuffer (GLuint vaobj, GLuint buffer); -GLAPI void APIENTRY glVertexArrayVertexBuffer (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -GLAPI void APIENTRY glVertexArrayVertexBuffers (GLuint vaobj, GLuint first, GLsizei count, const GLuint *buffers, const GLintptr *offsets, const GLsizei *strides); -GLAPI void APIENTRY glVertexArrayAttribBinding (GLuint vaobj, GLuint attribindex, GLuint bindingindex); -GLAPI void APIENTRY glVertexArrayAttribFormat (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -GLAPI void APIENTRY glVertexArrayAttribIFormat (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI void APIENTRY glVertexArrayAttribLFormat (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -GLAPI void APIENTRY glVertexArrayBindingDivisor (GLuint vaobj, GLuint bindingindex, GLuint divisor); -GLAPI void APIENTRY glGetVertexArrayiv (GLuint vaobj, GLenum pname, GLint *param); -GLAPI void APIENTRY glGetVertexArrayIndexediv (GLuint vaobj, GLuint index, GLenum pname, GLint *param); -GLAPI void APIENTRY glGetVertexArrayIndexed64iv (GLuint vaobj, GLuint index, GLenum pname, GLint64 *param); -GLAPI void APIENTRY glCreateSamplers (GLsizei n, GLuint *samplers); -GLAPI void APIENTRY glCreateProgramPipelines (GLsizei n, GLuint *pipelines); -GLAPI void APIENTRY glCreateQueries (GLenum target, GLsizei n, GLuint *ids); -GLAPI void APIENTRY glMemoryBarrierByRegion (GLbitfield barriers); -GLAPI void APIENTRY glGetTextureSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void *pixels); -GLAPI void APIENTRY glGetCompressedTextureSubImage (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void *pixels); -GLAPI GLenum APIENTRY glGetGraphicsResetStatus (void); -GLAPI void APIENTRY glGetnCompressedTexImage (GLenum target, GLint lod, GLsizei bufSize, void *pixels); -GLAPI void APIENTRY glGetnTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels); -GLAPI void APIENTRY glGetnUniformdv (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); -GLAPI void APIENTRY glGetnUniformfv (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); -GLAPI void APIENTRY glGetnUniformiv (GLuint program, GLint location, GLsizei bufSize, GLint *params); -GLAPI void APIENTRY glGetnUniformuiv (GLuint program, GLint location, GLsizei bufSize, GLuint *params); -GLAPI void APIENTRY glReadnPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); -GLAPI void APIENTRY glGetnMapdv (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); -GLAPI void APIENTRY glGetnMapfv (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); -GLAPI void APIENTRY glGetnMapiv (GLenum target, GLenum query, GLsizei bufSize, GLint *v); -GLAPI void APIENTRY glGetnPixelMapfv (GLenum map, GLsizei bufSize, GLfloat *values); -GLAPI void APIENTRY glGetnPixelMapuiv (GLenum map, GLsizei bufSize, GLuint *values); -GLAPI void APIENTRY glGetnPixelMapusv (GLenum map, GLsizei bufSize, GLushort *values); -GLAPI void APIENTRY glGetnPolygonStipple (GLsizei bufSize, GLubyte *pattern); -GLAPI void APIENTRY glGetnColorTable (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table); -GLAPI void APIENTRY glGetnConvolutionFilter (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image); -GLAPI void APIENTRY glGetnSeparableFilter (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span); -GLAPI void APIENTRY glGetnHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); -GLAPI void APIENTRY glGetnMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); -GLAPI void APIENTRY glTextureBarrier (void); -#endif -#endif /* GL_VERSION_4_5 */ - #ifndef GL_ARB_ES2_compatibility #define GL_ARB_ES2_compatibility 1 #endif /* GL_ARB_ES2_compatibility */ -#ifndef GL_ARB_ES3_1_compatibility -#define GL_ARB_ES3_1_compatibility 1 -#endif /* GL_ARB_ES3_1_compatibility */ - #ifndef GL_ARB_ES3_compatibility #define GL_ARB_ES3_compatibility 1 #endif /* GL_ARB_ES3_compatibility */ @@ -2928,10 +2637,6 @@ GLAPI GLsync APIENTRY glCreateSyncFromCLeventARB (struct _cl_context *context, s #define GL_ARB_clear_texture 1 #endif /* GL_ARB_clear_texture */ -#ifndef GL_ARB_clip_control -#define GL_ARB_clip_control 1 -#endif /* GL_ARB_clip_control */ - #ifndef GL_ARB_color_buffer_float #define GL_ARB_color_buffer_float 1 #define GL_RGBA_FLOAT_MODE_ARB 0x8820 @@ -2955,6 +2660,7 @@ GLAPI void APIENTRY glClampColorARB (GLenum target, GLenum clamp); #ifndef GL_ARB_compute_shader #define GL_ARB_compute_shader 1 +#define GL_COMPUTE_SHADER_BIT 0x00000020 #endif /* GL_ARB_compute_shader */ #ifndef GL_ARB_compute_variable_group_size @@ -2969,10 +2675,6 @@ GLAPI void APIENTRY glDispatchComputeGroupSizeARB (GLuint num_groups_x, GLuint n #endif #endif /* GL_ARB_compute_variable_group_size */ -#ifndef GL_ARB_conditional_render_inverted -#define GL_ARB_conditional_render_inverted 1 -#endif /* GL_ARB_conditional_render_inverted */ - #ifndef GL_ARB_conservative_depth #define GL_ARB_conservative_depth 1 #endif /* GL_ARB_conservative_depth */ @@ -2987,10 +2689,6 @@ GLAPI void APIENTRY glDispatchComputeGroupSizeARB (GLuint num_groups_x, GLuint n #define GL_ARB_copy_image 1 #endif /* GL_ARB_copy_image */ -#ifndef GL_ARB_cull_distance -#define GL_ARB_cull_distance 1 -#endif /* GL_ARB_cull_distance */ - #ifndef GL_ARB_debug_output #define GL_ARB_debug_output 1 typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); @@ -3019,12 +2717,12 @@ typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLe typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const void *userParam); -typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glDebugMessageControlARB (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); GLAPI void APIENTRY glDebugMessageInsertARB (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); GLAPI void APIENTRY glDebugMessageCallbackARB (GLDEBUGPROCARB callback, const void *userParam); -GLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +GLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); #endif #endif /* GL_ARB_debug_output */ @@ -3045,14 +2743,6 @@ GLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufSize, GL #define GL_DEPTH_TEXTURE_MODE_ARB 0x884B #endif /* GL_ARB_depth_texture */ -#ifndef GL_ARB_derivative_control -#define GL_ARB_derivative_control 1 -#endif /* GL_ARB_derivative_control */ - -#ifndef GL_ARB_direct_state_access -#define GL_ARB_direct_state_access 1 -#endif /* GL_ARB_direct_state_access */ - #ifndef GL_ARB_draw_buffers #define GL_ARB_draw_buffers 1 #define GL_MAX_DRAW_BUFFERS_ARB 0x8824 @@ -3103,10 +2793,10 @@ GLAPI void APIENTRY glBlendFuncSeparateiARB (GLuint buf, GLenum srcRGB, GLenum d #ifndef GL_ARB_draw_instanced #define GL_ARB_draw_instanced 1 typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); #endif #endif /* GL_ARB_draw_instanced */ @@ -3210,7 +2900,7 @@ GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLen #define GL_MATRIX29_ARB 0x88DD #define GL_MATRIX30_ARB 0x88DE #define GL_MATRIX31_ARB 0x88DF -typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const void *string); +typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string); typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs); typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); @@ -3227,10 +2917,10 @@ typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GL typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, void *string); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string); typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramStringARB (GLenum target, GLenum format, GLsizei len, const void *string); +GLAPI void APIENTRY glProgramStringARB (GLenum target, GLenum format, GLsizei len, const GLvoid *string); GLAPI void APIENTRY glBindProgramARB (GLenum target, GLuint program); GLAPI void APIENTRY glDeleteProgramsARB (GLsizei n, const GLuint *programs); GLAPI void APIENTRY glGenProgramsARB (GLsizei n, GLuint *programs); @@ -3247,7 +2937,7 @@ GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum target, GLuint index, GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum target, GLuint index, GLdouble *params); GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum target, GLuint index, GLfloat *params); GLAPI void APIENTRY glGetProgramivARB (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetProgramStringARB (GLenum target, GLenum pname, void *string); +GLAPI void APIENTRY glGetProgramStringARB (GLenum target, GLenum pname, GLvoid *string); GLAPI GLboolean APIENTRY glIsProgramARB (GLuint program); #endif #endif /* GL_ARB_fragment_program */ @@ -3311,10 +3001,6 @@ GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum target, GLenum attachmen #define GL_ARB_get_program_binary 1 #endif /* GL_ARB_get_program_binary */ -#ifndef GL_ARB_get_texture_sub_image -#define GL_ARB_get_texture_sub_image 1 -#endif /* GL_ARB_get_texture_sub_image */ - #ifndef GL_ARB_gpu_shader5 #define GL_ARB_gpu_shader5 1 #endif /* GL_ARB_gpu_shader5 */ @@ -3335,8 +3021,17 @@ typedef unsigned short GLhalfARB; #ifndef GL_ARB_imaging #define GL_ARB_imaging 1 +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 #define GL_BLEND_COLOR 0x8005 +#define GL_FUNC_ADD 0x8006 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 #define GL_BLEND_EQUATION 0x8009 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B #define GL_CONVOLUTION_1D 0x8010 #define GL_CONVOLUTION_2D 0x8011 #define GL_SEPARABLE_2D 0x8012 @@ -3401,32 +3096,32 @@ typedef unsigned short GLhalfARB; #define GL_CONSTANT_BORDER 0x8151 #define GL_REPLICATE_BORDER 0x8153 #define GL_CONVOLUTION_BORDER_COLOR 0x8154 -typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, void *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, void *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); @@ -3434,32 +3129,32 @@ typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); +GLAPI void APIENTRY glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); GLAPI void APIENTRY glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params); GLAPI void APIENTRY glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params); GLAPI void APIENTRY glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glGetColorTable (GLenum target, GLenum format, GLenum type, void *table); +GLAPI void APIENTRY glGetColorTable (GLenum target, GLenum format, GLenum type, GLvoid *table); GLAPI void APIENTRY glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params); GLAPI void APIENTRY glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); GLAPI void APIENTRY glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); -GLAPI void APIENTRY glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); +GLAPI void APIENTRY glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +GLAPI void APIENTRY glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); GLAPI void APIENTRY glConvolutionParameterf (GLenum target, GLenum pname, GLfloat params); GLAPI void APIENTRY glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params); GLAPI void APIENTRY glConvolutionParameteri (GLenum target, GLenum pname, GLint params); GLAPI void APIENTRY glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params); GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, void *image); +GLAPI void APIENTRY glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, GLvoid *image); GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params); GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetSeparableFilter (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); -GLAPI void APIENTRY glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); -GLAPI void APIENTRY glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +GLAPI void APIENTRY glGetSeparableFilter (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +GLAPI void APIENTRY glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +GLAPI void APIENTRY glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); GLAPI void APIENTRY glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params); GLAPI void APIENTRY glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +GLAPI void APIENTRY glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params); GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params); GLAPI void APIENTRY glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); @@ -3492,6 +3187,10 @@ GLAPI void APIENTRY glVertexAttribDivisorARB (GLuint index, GLuint divisor); #ifndef GL_ARB_internalformat_query #define GL_ARB_internalformat_query 1 +typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params); +#endif #endif /* GL_ARB_internalformat_query */ #ifndef GL_ARB_internalformat_query2 @@ -3527,13 +3226,13 @@ typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices); typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint index); GLAPI void APIENTRY glMatrixIndexubvARB (GLint size, const GLubyte *indices); GLAPI void APIENTRY glMatrixIndexusvARB (GLint size, const GLushort *indices); GLAPI void APIENTRY glMatrixIndexuivARB (GLint size, const GLuint *indices); -GLAPI void APIENTRY glMatrixIndexPointerARB (GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glMatrixIndexPointerARB (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); #endif #endif /* GL_ARB_matrix_palette */ @@ -3702,20 +3401,6 @@ GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint id, GLenum pname, GLuint *par #define GL_ARB_occlusion_query2 1 #endif /* GL_ARB_occlusion_query2 */ -#ifndef GL_ARB_pipeline_statistics_query -#define GL_ARB_pipeline_statistics_query 1 -#define GL_VERTICES_SUBMITTED_ARB 0x82EE -#define GL_PRIMITIVES_SUBMITTED_ARB 0x82EF -#define GL_VERTEX_SHADER_INVOCATIONS_ARB 0x82F0 -#define GL_TESS_CONTROL_SHADER_PATCHES_ARB 0x82F1 -#define GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB 0x82F2 -#define GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB 0x82F3 -#define GL_FRAGMENT_SHADER_INVOCATIONS_ARB 0x82F4 -#define GL_COMPUTE_SHADER_INVOCATIONS_ARB 0x82F5 -#define GL_CLIPPING_INPUT_PRIMITIVES_ARB 0x82F6 -#define GL_CLIPPING_OUTPUT_PRIMITIVES_ARB 0x82F7 -#endif /* GL_ARB_pipeline_statistics_query */ - #ifndef GL_ARB_pixel_buffer_object #define GL_ARB_pixel_buffer_object 1 #define GL_PIXEL_PACK_BUFFER_ARB 0x88EB @@ -3770,9 +3455,9 @@ GLAPI void APIENTRY glPointParameterfvARB (GLenum pname, const GLfloat *params); #define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 #define GL_NO_RESET_NOTIFICATION_ARB 0x8261 typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); -typedef void (APIENTRYP PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *img); -typedef void (APIENTRYP PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); -typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void *img); +typedef void (APIENTRYP PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img); +typedef void (APIENTRYP PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data); +typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, GLvoid *img); typedef void (APIENTRYP PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); typedef void (APIENTRYP PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); typedef void (APIENTRYP PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params); @@ -3784,16 +3469,16 @@ typedef void (APIENTRYP PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint *values); typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort *values); typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte *pattern); -typedef void (APIENTRYP PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table); -typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image); -typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span); -typedef void (APIENTRYP PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); -typedef void (APIENTRYP PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); +typedef void (APIENTRYP PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table); +typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image); +typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values); +typedef void (APIENTRYP PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values); #ifdef GL_GLEXT_PROTOTYPES GLAPI GLenum APIENTRY glGetGraphicsResetStatusARB (void); -GLAPI void APIENTRY glGetnTexImageARB (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *img); -GLAPI void APIENTRY glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); -GLAPI void APIENTRY glGetnCompressedTexImageARB (GLenum target, GLint lod, GLsizei bufSize, void *img); +GLAPI void APIENTRY glGetnTexImageARB (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img); +GLAPI void APIENTRY glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data); +GLAPI void APIENTRY glGetnCompressedTexImageARB (GLenum target, GLint lod, GLsizei bufSize, GLvoid *img); GLAPI void APIENTRY glGetnUniformfvARB (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); GLAPI void APIENTRY glGetnUniformivARB (GLuint program, GLint location, GLsizei bufSize, GLint *params); GLAPI void APIENTRY glGetnUniformuivARB (GLuint program, GLint location, GLsizei bufSize, GLuint *params); @@ -3805,11 +3490,11 @@ GLAPI void APIENTRY glGetnPixelMapfvARB (GLenum map, GLsizei bufSize, GLfloat *v GLAPI void APIENTRY glGetnPixelMapuivARB (GLenum map, GLsizei bufSize, GLuint *values); GLAPI void APIENTRY glGetnPixelMapusvARB (GLenum map, GLsizei bufSize, GLushort *values); GLAPI void APIENTRY glGetnPolygonStippleARB (GLsizei bufSize, GLubyte *pattern); -GLAPI void APIENTRY glGetnColorTableARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table); -GLAPI void APIENTRY glGetnConvolutionFilterARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image); -GLAPI void APIENTRY glGetnSeparableFilterARB (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span); -GLAPI void APIENTRY glGetnHistogramARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); -GLAPI void APIENTRY glGetnMinmaxARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values); +GLAPI void APIENTRY glGetnColorTableARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table); +GLAPI void APIENTRY glGetnConvolutionFilterARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image); +GLAPI void APIENTRY glGetnSeparableFilterARB (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span); +GLAPI void APIENTRY glGetnHistogramARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values); +GLAPI void APIENTRY glGetnMinmaxARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values); #endif #endif /* GL_ARB_robustness */ @@ -4007,10 +3692,6 @@ GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GL #define GL_ARB_shader_subroutine 1 #endif /* GL_ARB_shader_subroutine */ -#ifndef GL_ARB_shader_texture_image_samples -#define GL_ARB_shader_texture_image_samples 1 -#endif /* GL_ARB_shader_texture_image_samples */ - #ifndef GL_ARB_shader_texture_lod #define GL_ARB_shader_texture_lod 1 #endif /* GL_ARB_shader_texture_lod */ @@ -4061,20 +3742,6 @@ GLAPI void APIENTRY glGetNamedStringivARB (GLint namelen, const GLchar *name, GL #define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF #endif /* GL_ARB_shadow_ambient */ -#ifndef GL_ARB_sparse_buffer -#define GL_ARB_sparse_buffer 1 -#define GL_SPARSE_STORAGE_BIT_ARB 0x0400 -#define GL_SPARSE_BUFFER_PAGE_SIZE_ARB 0x82F8 -typedef void (APIENTRYP PFNGLBUFFERPAGECOMMITMENTARBPROC) (GLenum target, GLintptr offset, GLsizei size, GLboolean commit); -typedef void (APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTEXTPROC) (GLuint buffer, GLintptr offset, GLsizei size, GLboolean commit); -typedef void (APIENTRYP PFNGLNAMEDBUFFERPAGECOMMITMENTARBPROC) (GLuint buffer, GLintptr offset, GLsizei size, GLboolean commit); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBufferPageCommitmentARB (GLenum target, GLintptr offset, GLsizei size, GLboolean commit); -GLAPI void APIENTRY glNamedBufferPageCommitmentEXT (GLuint buffer, GLintptr offset, GLsizei size, GLboolean commit); -GLAPI void APIENTRY glNamedBufferPageCommitmentARB (GLuint buffer, GLintptr offset, GLsizei size, GLboolean commit); -#endif -#endif /* GL_ARB_sparse_buffer */ - #ifndef GL_ARB_sparse_texture #define GL_ARB_sparse_texture 1 #define GL_TEXTURE_SPARSE_ARB 0x91A6 @@ -4106,10 +3773,6 @@ GLAPI void APIENTRY glTexPageCommitmentARB (GLenum target, GLint level, GLint xo #define GL_ARB_tessellation_shader 1 #endif /* GL_ARB_tessellation_shader */ -#ifndef GL_ARB_texture_barrier -#define GL_ARB_texture_barrier 1 -#endif /* GL_ARB_texture_barrier */ - #ifndef GL_ARB_texture_border_clamp #define GL_ARB_texture_border_clamp 1 #define GL_CLAMP_TO_BORDER_ARB 0x812D @@ -4149,21 +3812,21 @@ GLAPI void APIENTRY glTexBufferARB (GLenum target, GLenum internalformat, GLuint #define GL_TEXTURE_COMPRESSED_ARB 0x86A1 #define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 #define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, void *img); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); -GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum target, GLint level, void *img); +GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum target, GLint level, GLvoid *img); #endif #endif /* GL_ARB_texture_compression */ @@ -4356,12 +4019,6 @@ GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum target, GLint level, void #define GL_ARB_transform_feedback_instanced 1 #endif /* GL_ARB_transform_feedback_instanced */ -#ifndef GL_ARB_transform_feedback_overflow_query -#define GL_ARB_transform_feedback_overflow_query 1 -#define GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB 0x82EC -#define GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB 0x82ED -#endif /* GL_ARB_transform_feedback_overflow_query */ - #ifndef GL_ARB_transpose_matrix #define GL_ARB_transpose_matrix 1 #define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 @@ -4382,6 +4039,9 @@ GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *m); #ifndef GL_ARB_uniform_buffer_object #define GL_ARB_uniform_buffer_object 1 +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 #endif /* GL_ARB_uniform_buffer_object */ #ifndef GL_ARB_vertex_array_bgra @@ -4452,7 +4112,7 @@ typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weigh typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights); typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights); typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights); -typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glWeightbvARB (GLint size, const GLbyte *weights); @@ -4463,23 +4123,15 @@ GLAPI void APIENTRY glWeightdvARB (GLint size, const GLdouble *weights); GLAPI void APIENTRY glWeightubvARB (GLint size, const GLubyte *weights); GLAPI void APIENTRY glWeightusvARB (GLint size, const GLushort *weights); GLAPI void APIENTRY glWeightuivARB (GLint size, const GLuint *weights); -GLAPI void APIENTRY glWeightPointerARB (GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glWeightPointerARB (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); GLAPI void APIENTRY glVertexBlendARB (GLint count); #endif #endif /* GL_ARB_vertex_blend */ #ifndef GL_ARB_vertex_buffer_object #define GL_ARB_vertex_buffer_object 1 -/* HACK: This is a workaround for gltypes.h on OS X 10.9 defining these types as - * long instead of ptrdiff_t - */ -#if defined(__APPLE__) -typedef long GLsizeiptrARB; -typedef long GLintptrARB; -#else typedef ptrdiff_t GLsizeiptrARB; typedef ptrdiff_t GLintptrARB; -#endif #define GL_BUFFER_SIZE_ARB 0x8764 #define GL_BUFFER_USAGE_ARB 0x8765 #define GL_ARRAY_BUFFER_ARB 0x8892 @@ -4515,25 +4167,25 @@ typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage); -typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data); -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data); +typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); typedef void *(APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, void **params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid **params); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glBindBufferARB (GLenum target, GLuint buffer); GLAPI void APIENTRY glDeleteBuffersARB (GLsizei n, const GLuint *buffers); GLAPI void APIENTRY glGenBuffersARB (GLsizei n, GLuint *buffers); GLAPI GLboolean APIENTRY glIsBufferARB (GLuint buffer); -GLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage); -GLAPI void APIENTRY glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data); -GLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data); +GLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); +GLAPI void APIENTRY glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); +GLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); GLAPI void *APIENTRY glMapBufferARB (GLenum target, GLenum access); GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum target); GLAPI void APIENTRY glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetBufferPointervARB (GLenum target, GLenum pname, void **params); +GLAPI void APIENTRY glGetBufferPointervARB (GLenum target, GLenum pname, GLvoid **params); #endif #endif /* GL_ARB_vertex_buffer_object */ @@ -4591,13 +4243,13 @@ typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshor typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v); typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v); typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params); typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, void **pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid **pointer); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glVertexAttrib1dARB (GLuint index, GLdouble x); GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint index, const GLdouble *v); @@ -4635,13 +4287,13 @@ GLAPI void APIENTRY glVertexAttrib4svARB (GLuint index, const GLshort *v); GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint index, const GLubyte *v); GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint index, const GLuint *v); GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint index, const GLushort *v); -GLAPI void APIENTRY glVertexAttribPointerARB (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glVertexAttribPointerARB (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint index); GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint index); GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint index, GLenum pname, GLdouble *params); GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint index, GLenum pname, GLfloat *params); GLAPI void APIENTRY glGetVertexAttribivARB (GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint index, GLenum pname, void **pointer); +GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint index, GLenum pname, GLvoid **pointer); #endif #endif /* GL_ARB_vertex_program */ @@ -4714,53 +4366,12 @@ GLAPI void APIENTRY glWindowPos3svARB (const GLshort *v); #endif #endif /* GL_ARB_window_pos */ -#ifndef GL_KHR_blend_equation_advanced -#define GL_KHR_blend_equation_advanced 1 -#define GL_MULTIPLY_KHR 0x9294 -#define GL_SCREEN_KHR 0x9295 -#define GL_OVERLAY_KHR 0x9296 -#define GL_DARKEN_KHR 0x9297 -#define GL_LIGHTEN_KHR 0x9298 -#define GL_COLORDODGE_KHR 0x9299 -#define GL_COLORBURN_KHR 0x929A -#define GL_HARDLIGHT_KHR 0x929B -#define GL_SOFTLIGHT_KHR 0x929C -#define GL_DIFFERENCE_KHR 0x929E -#define GL_EXCLUSION_KHR 0x92A0 -#define GL_HSL_HUE_KHR 0x92AD -#define GL_HSL_SATURATION_KHR 0x92AE -#define GL_HSL_COLOR_KHR 0x92AF -#define GL_HSL_LUMINOSITY_KHR 0x92B0 -typedef void (APIENTRYP PFNGLBLENDBARRIERKHRPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendBarrierKHR (void); -#endif -#endif /* GL_KHR_blend_equation_advanced */ - -#ifndef GL_KHR_blend_equation_advanced_coherent -#define GL_KHR_blend_equation_advanced_coherent 1 -#define GL_BLEND_ADVANCED_COHERENT_KHR 0x9285 -#endif /* GL_KHR_blend_equation_advanced_coherent */ - -#ifndef GL_KHR_context_flush_control -#define GL_KHR_context_flush_control 1 -#endif /* GL_KHR_context_flush_control */ - #ifndef GL_KHR_debug #define GL_KHR_debug 1 #endif /* GL_KHR_debug */ -#ifndef GL_KHR_robust_buffer_access_behavior -#define GL_KHR_robust_buffer_access_behavior 1 -#endif /* GL_KHR_robust_buffer_access_behavior */ - -#ifndef GL_KHR_robustness -#define GL_KHR_robustness 1 -#define GL_CONTEXT_ROBUST_ACCESS 0x90F3 -#endif /* GL_KHR_robustness */ - -#ifndef GL_KHR_texture_compression_astc_hdr -#define GL_KHR_texture_compression_astc_hdr 1 +#ifndef GL_KHR_texture_compression_astc_ldr +#define GL_KHR_texture_compression_astc_ldr 1 #define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 #define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 #define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 @@ -4789,10 +4400,6 @@ GLAPI void APIENTRY glBlendBarrierKHR (void); #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD -#endif /* GL_KHR_texture_compression_astc_hdr */ - -#ifndef GL_KHR_texture_compression_astc_ldr -#define GL_KHR_texture_compression_astc_ldr 1 #endif /* GL_KHR_texture_compression_astc_ldr */ #ifndef GL_OES_byte_coordinates @@ -4813,11 +4420,11 @@ typedef void (APIENTRYP PFNGLTEXCOORD3BOESPROC) (GLbyte s, GLbyte t, GLbyte r); typedef void (APIENTRYP PFNGLTEXCOORD3BVOESPROC) (const GLbyte *coords); typedef void (APIENTRYP PFNGLTEXCOORD4BOESPROC) (GLbyte s, GLbyte t, GLbyte r, GLbyte q); typedef void (APIENTRYP PFNGLTEXCOORD4BVOESPROC) (const GLbyte *coords); -typedef void (APIENTRYP PFNGLVERTEX2BOESPROC) (GLbyte x, GLbyte y); +typedef void (APIENTRYP PFNGLVERTEX2BOESPROC) (GLbyte x); typedef void (APIENTRYP PFNGLVERTEX2BVOESPROC) (const GLbyte *coords); -typedef void (APIENTRYP PFNGLVERTEX3BOESPROC) (GLbyte x, GLbyte y, GLbyte z); +typedef void (APIENTRYP PFNGLVERTEX3BOESPROC) (GLbyte x, GLbyte y); typedef void (APIENTRYP PFNGLVERTEX3BVOESPROC) (const GLbyte *coords); -typedef void (APIENTRYP PFNGLVERTEX4BOESPROC) (GLbyte x, GLbyte y, GLbyte z, GLbyte w); +typedef void (APIENTRYP PFNGLVERTEX4BOESPROC) (GLbyte x, GLbyte y, GLbyte z); typedef void (APIENTRYP PFNGLVERTEX4BVOESPROC) (const GLbyte *coords); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glMultiTexCoord1bOES (GLenum texture, GLbyte s); @@ -4836,11 +4443,11 @@ GLAPI void APIENTRY glTexCoord3bOES (GLbyte s, GLbyte t, GLbyte r); GLAPI void APIENTRY glTexCoord3bvOES (const GLbyte *coords); GLAPI void APIENTRY glTexCoord4bOES (GLbyte s, GLbyte t, GLbyte r, GLbyte q); GLAPI void APIENTRY glTexCoord4bvOES (const GLbyte *coords); -GLAPI void APIENTRY glVertex2bOES (GLbyte x, GLbyte y); +GLAPI void APIENTRY glVertex2bOES (GLbyte x); GLAPI void APIENTRY glVertex2bvOES (const GLbyte *coords); -GLAPI void APIENTRY glVertex3bOES (GLbyte x, GLbyte y, GLbyte z); +GLAPI void APIENTRY glVertex3bOES (GLbyte x, GLbyte y); GLAPI void APIENTRY glVertex3bvOES (const GLbyte *coords); -GLAPI void APIENTRY glVertex4bOES (GLbyte x, GLbyte y, GLbyte z, GLbyte w); +GLAPI void APIENTRY glVertex4bOES (GLbyte x, GLbyte y, GLbyte z); GLAPI void APIENTRY glVertex4bvOES (const GLbyte *coords); #endif #endif /* GL_OES_byte_coordinates */ @@ -5188,113 +4795,6 @@ GLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint buf, GLenum modeRG #endif #endif /* GL_AMD_draw_buffers_blend */ -#ifndef GL_AMD_gcn_shader -#define GL_AMD_gcn_shader 1 -#endif /* GL_AMD_gcn_shader */ - -#ifndef GL_AMD_gpu_shader_int64 -#define GL_AMD_gpu_shader_int64 1 -typedef int64_t GLint64EXT; -#define GL_INT64_NV 0x140E -#define GL_UNSIGNED_INT64_NV 0x140F -#define GL_INT8_NV 0x8FE0 -#define GL_INT8_VEC2_NV 0x8FE1 -#define GL_INT8_VEC3_NV 0x8FE2 -#define GL_INT8_VEC4_NV 0x8FE3 -#define GL_INT16_NV 0x8FE4 -#define GL_INT16_VEC2_NV 0x8FE5 -#define GL_INT16_VEC3_NV 0x8FE6 -#define GL_INT16_VEC4_NV 0x8FE7 -#define GL_INT64_VEC2_NV 0x8FE9 -#define GL_INT64_VEC3_NV 0x8FEA -#define GL_INT64_VEC4_NV 0x8FEB -#define GL_UNSIGNED_INT8_NV 0x8FEC -#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED -#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE -#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF -#define GL_UNSIGNED_INT16_NV 0x8FF0 -#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 -#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 -#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 -#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 -#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 -#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 -#define GL_FLOAT16_NV 0x8FF8 -#define GL_FLOAT16_VEC2_NV 0x8FF9 -#define GL_FLOAT16_VEC3_NV 0x8FFA -#define GL_FLOAT16_VEC4_NV 0x8FFB -typedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); -typedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); -typedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -typedef void (APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -typedef void (APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); -typedef void (APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); -typedef void (APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -typedef void (APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -typedef void (APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params); -typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT *params); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glUniform1i64NV (GLint location, GLint64EXT x); -GLAPI void APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y); -GLAPI void APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -GLAPI void APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -GLAPI void APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x); -GLAPI void APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y); -GLAPI void APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -GLAPI void APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -GLAPI void APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params); -GLAPI void APIENTRY glGetUniformui64vNV (GLuint program, GLint location, GLuint64EXT *params); -GLAPI void APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x); -GLAPI void APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); -GLAPI void APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -GLAPI void APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -GLAPI void APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); -GLAPI void APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x); -GLAPI void APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); -GLAPI void APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -GLAPI void APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -GLAPI void APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -GLAPI void APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); -#endif -#endif /* GL_AMD_gpu_shader_int64 */ - #ifndef GL_AMD_interleaved_elements #define GL_AMD_interleaved_elements 1 #define GL_VERTEX_ELEMENT_SWIZZLE_AMD 0x91A4 @@ -5307,11 +4807,11 @@ GLAPI void APIENTRY glVertexAttribParameteriAMD (GLuint index, GLenum pname, GLi #ifndef GL_AMD_multi_draw_indirect #define GL_AMD_multi_draw_indirect 1 -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysIndirectAMD (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); -GLAPI void APIENTRY glMultiDrawElementsIndirectAMD (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); +GLAPI void APIENTRY glMultiDrawArraysIndirectAMD (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride); +GLAPI void APIENTRY glMultiDrawElementsIndirectAMD (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride); #endif #endif /* GL_AMD_multi_draw_indirect */ @@ -5332,20 +4832,6 @@ GLAPI GLboolean APIENTRY glIsNameAMD (GLenum identifier, GLuint name); #endif #endif /* GL_AMD_name_gen_delete */ -#ifndef GL_AMD_occlusion_query_event -#define GL_AMD_occlusion_query_event 1 -#define GL_OCCLUSION_QUERY_EVENT_MASK_AMD 0x874F -#define GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD 0x00000001 -#define GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD 0x00000002 -#define GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD 0x00000004 -#define GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD 0x00000008 -#define GL_QUERY_ALL_EVENT_BITS_AMD 0xFFFFFFFF -typedef void (APIENTRYP PFNGLQUERYOBJECTPARAMETERUIAMDPROC) (GLenum target, GLuint id, GLenum pname, GLuint param); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glQueryObjectParameteruiAMD (GLenum target, GLuint id, GLenum pname, GLuint param); -#endif -#endif /* GL_AMD_occlusion_query_event */ - #ifndef GL_AMD_performance_monitor #define GL_AMD_performance_monitor 1 #define GL_COUNTER_TYPE_AMD 0x8BC0 @@ -5359,7 +4845,7 @@ typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLs typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); -typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data); typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); @@ -5371,7 +4857,7 @@ GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsS GLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); GLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); GLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); -GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, void *data); +GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, GLvoid *data); GLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors); GLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors); GLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); @@ -5406,10 +4892,6 @@ GLAPI void APIENTRY glSetMultisamplefvAMD (GLenum pname, GLuint index, const GLf #define GL_AMD_seamless_cubemap_per_texture 1 #endif /* GL_AMD_seamless_cubemap_per_texture */ -#ifndef GL_AMD_shader_atomic_counter_ops -#define GL_AMD_shader_atomic_counter_ops 1 -#endif /* GL_AMD_shader_atomic_counter_ops */ - #ifndef GL_AMD_shader_stencil_export #define GL_AMD_shader_stencil_export 1 #endif /* GL_AMD_shader_stencil_export */ @@ -5457,11 +4939,6 @@ GLAPI void APIENTRY glStencilOpValueAMD (GLenum face, GLuint value); #define GL_AMD_transform_feedback3_lines_triangles 1 #endif /* GL_AMD_transform_feedback3_lines_triangles */ -#ifndef GL_AMD_transform_feedback4 -#define GL_AMD_transform_feedback4 1 -#define GL_STREAM_RASTERIZATION_AMD 0x91A0 -#endif /* GL_AMD_transform_feedback4 */ - #ifndef GL_AMD_vertex_shader_layer #define GL_AMD_vertex_shader_layer 1 #endif /* GL_AMD_vertex_shader_layer */ @@ -5502,13 +4979,13 @@ GLAPI void APIENTRY glTessellationModeAMD (GLenum mode); #define GL_ELEMENT_ARRAY_APPLE 0x8A0C #define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D #define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E -typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const void *pointer); +typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer); typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glElementPointerAPPLE (GLenum type, const void *pointer); +GLAPI void APIENTRY glElementPointerAPPLE (GLenum type, const GLvoid *pointer); GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum mode, GLint first, GLsizei count); GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); @@ -5593,7 +5070,6 @@ GLAPI void APIENTRY glGetObjectParameterivAPPLE (GLenum objectType, GLuint name, #define GL_RGB_422_APPLE 0x8A1F #define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA #define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB -#define GL_RGB_RAW_422_APPLE 0x8A51 #endif /* GL_APPLE_rgb_422 */ #ifndef GL_APPLE_row_bytes @@ -5615,11 +5091,11 @@ GLAPI void APIENTRY glGetObjectParameterivAPPLE (GLenum objectType, GLuint name, #define GL_STORAGE_PRIVATE_APPLE 0x85BD #define GL_STORAGE_CACHED_APPLE 0x85BE #define GL_STORAGE_SHARED_APPLE 0x85BF -typedef void (APIENTRYP PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, const void *pointer); -typedef void (APIENTRYP PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, void **params); +typedef void (APIENTRYP PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid **params); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureRangeAPPLE (GLenum target, GLsizei length, const void *pointer); -GLAPI void APIENTRY glGetTexParameterPointervAPPLE (GLenum target, GLenum pname, void **params); +GLAPI void APIENTRY glTextureRangeAPPLE (GLenum target, GLsizei length, const GLvoid *pointer); +GLAPI void APIENTRY glGetTexParameterPointervAPPLE (GLenum target, GLenum pname, GLvoid **params); #endif #endif /* GL_APPLE_texture_range */ @@ -5650,12 +5126,12 @@ GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint array); #define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F #define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 #define GL_STORAGE_CLIENT_APPLE 0x85B4 -typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer); -typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer); +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei length, void *pointer); -GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei length, void *pointer); +GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei length, GLvoid *pointer); +GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei length, GLvoid *pointer); GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum pname, GLint param); #endif #endif /* GL_APPLE_vertex_array_range */ @@ -5725,11 +5201,11 @@ GLAPI void APIENTRY glDrawBuffersATI (GLsizei n, const GLenum *bufs); #define GL_ELEMENT_ARRAY_ATI 0x8768 #define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 #define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A -typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const void *pointer); +typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer); typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glElementPointerATI (GLenum type, const void *pointer); +GLAPI void APIENTRY glElementPointerATI (GLenum type, const GLvoid *pointer); GLAPI void APIENTRY glDrawElementArrayATI (GLenum mode, GLsizei count); GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum mode, GLuint start, GLuint end, GLsizei count); #endif @@ -5995,9 +5471,9 @@ GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum frontfunc, GLenum backfunc, #define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 #define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 #define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 -typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const void *pointer, GLenum usage); +typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const void *pointer, GLenum preserve); +typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); @@ -6008,9 +5484,9 @@ typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params); typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params); #ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei size, const void *pointer, GLenum usage); +GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei size, const GLvoid *pointer, GLenum usage); GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint buffer); -GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint buffer, GLuint offset, GLsizei size, const void *pointer, GLenum preserve); +GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint buffer, GLenum pname, GLfloat *params); GLAPI void APIENTRY glGetObjectBufferivATI (GLuint buffer, GLenum pname, GLint *params); GLAPI void APIENTRY glFreeObjectBufferATI (GLuint buffer); @@ -6250,10 +5726,10 @@ GLAPI void APIENTRY glBlendEquationEXT (GLenum mode); #ifndef GL_EXT_color_subtable #define GL_EXT_color_subtable 1 -typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorSubTableEXT (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glColorSubTableEXT (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); #endif #endif /* GL_EXT_color_subtable */ @@ -6292,33 +5768,33 @@ GLAPI void APIENTRY glUnlockArraysEXT (void); #define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 #define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 #define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); -GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); +GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum target, GLenum pname, GLfloat params); GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params); GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum target, GLenum pname, GLint params); GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum target, GLenum pname, const GLint *params); GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum target, GLenum format, GLenum type, void *image); +GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid *image); GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); -GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); +GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); #endif #endif /* GL_EXT_convolution */ @@ -6358,8 +5834,8 @@ typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v); typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); -typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glTangent3bEXT (GLbyte tx, GLbyte ty, GLbyte tz); GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *v); @@ -6381,8 +5857,8 @@ GLAPI void APIENTRY glBinormal3iEXT (GLint bx, GLint by, GLint bz); GLAPI void APIENTRY glBinormal3ivEXT (const GLint *v); GLAPI void APIENTRY glBinormal3sEXT (GLshort bx, GLshort by, GLshort bz); GLAPI void APIENTRY glBinormal3svEXT (const GLshort *v); -GLAPI void APIENTRY glTangentPointerEXT (GLenum type, GLsizei stride, const void *pointer); -GLAPI void APIENTRY glBinormalPointerEXT (GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glTangentPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glBinormalPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer); #endif #endif /* GL_EXT_coordinate_frame */ @@ -6415,34 +5891,6 @@ GLAPI void APIENTRY glCullParameterfvEXT (GLenum pname, GLfloat *params); #endif #endif /* GL_EXT_cull_vertex */ -#ifndef GL_EXT_debug_label -#define GL_EXT_debug_label 1 -#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F -#define GL_PROGRAM_OBJECT_EXT 0x8B40 -#define GL_SHADER_OBJECT_EXT 0x8B48 -#define GL_BUFFER_OBJECT_EXT 0x9151 -#define GL_QUERY_OBJECT_EXT 0x9153 -#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 -typedef void (APIENTRYP PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label); -typedef void (APIENTRYP PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLabelObjectEXT (GLenum type, GLuint object, GLsizei length, const GLchar *label); -GLAPI void APIENTRY glGetObjectLabelEXT (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); -#endif -#endif /* GL_EXT_debug_label */ - -#ifndef GL_EXT_debug_marker -#define GL_EXT_debug_marker 1 -typedef void (APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker); -typedef void (APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker); -typedef void (APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker); -GLAPI void APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker); -GLAPI void APIENTRY glPopGroupMarkerEXT (void); -#endif -#endif /* GL_EXT_debug_marker */ - #ifndef GL_EXT_depth_bounds_test #define GL_EXT_depth_bounds_test 1 #define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 @@ -6479,24 +5927,24 @@ typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum t typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat *params); typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); typedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); typedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); typedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); @@ -6516,57 +5964,57 @@ typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); typedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat *data); typedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble *data); -typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, void **data); +typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid **data); typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data); typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint lod, void *img); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint lod, void *img); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint lod, GLvoid *img); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint lod, GLvoid *img); typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); -typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); -typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data); typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, void **params); -typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, GLvoid **params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data); typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); @@ -6623,8 +6071,8 @@ typedef void (APIENTRYP PFNGLENABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint in typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); typedef void (APIENTRYP PFNGLGETFLOATI_VEXTPROC) (GLenum pname, GLuint index, GLfloat *params); typedef void (APIENTRYP PFNGLGETDOUBLEI_VEXTPROC) (GLenum pname, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, void **params); -typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const void *string); +typedef void (APIENTRYP PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, GLvoid **params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string); typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble *params); typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); @@ -6632,7 +6080,7 @@ typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint progr typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble *params); typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat *params); typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, void *string); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, GLvoid *string); typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint *params); typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); @@ -6671,14 +6119,13 @@ typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum ar typedef void (APIENTRYP PFNGLENABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); typedef void (APIENTRYP PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); typedef void (APIENTRYP PFNGLGETVERTEXARRAYINTEGERVEXTPROC) (GLuint vaobj, GLenum pname, GLint *param); -typedef void (APIENTRYP PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, void **param); +typedef void (APIENTRYP PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, GLvoid **param); typedef void (APIENTRYP PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint *param); -typedef void (APIENTRYP PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, void **param); +typedef void (APIENTRYP PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLvoid **param); typedef void *(APIENTRYP PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); -typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); -typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, GLsizeiptr offset, GLsizeiptr size, const void *data); typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param); typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params); typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x); @@ -6711,8 +6158,7 @@ typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC) (GLuint vaob typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (APIENTRYP PFNGLTEXTUREPAGECOMMITMENTEXTPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean resident); -typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC) (GLuint vaobj, GLuint index, GLuint divisor); +typedef void (APIENTRYP PFNGLTEXTUREPAGECOMMITMENTEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean resident); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glMatrixLoadfEXT (GLenum mode, const GLfloat *m); GLAPI void APIENTRY glMatrixLoaddEXT (GLenum mode, const GLdouble *m); @@ -6735,24 +6181,24 @@ GLAPI void APIENTRY glTextureParameterfEXT (GLuint texture, GLenum target, GLenu GLAPI void APIENTRY glTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); GLAPI void APIENTRY glTextureParameteriEXT (GLuint texture, GLenum target, GLenum pname, GLint param); GLAPI void APIENTRY glTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params); -GLAPI void APIENTRY glTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); GLAPI void APIENTRY glCopyTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); GLAPI void APIENTRY glCopyTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); GLAPI void APIENTRY glCopyTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); GLAPI void APIENTRY glCopyTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetTextureImageEXT (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +GLAPI void APIENTRY glGetTextureImageEXT (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); GLAPI void APIENTRY glGetTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, GLfloat *params); GLAPI void APIENTRY glGetTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params); GLAPI void APIENTRY glGetTextureLevelParameterfvEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); GLAPI void APIENTRY glGetTextureLevelParameterivEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); -GLAPI void APIENTRY glTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); GLAPI void APIENTRY glCopyTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); GLAPI void APIENTRY glBindMultiTextureEXT (GLenum texunit, GLenum target, GLuint texture); -GLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); GLAPI void APIENTRY glMultiTexEnvfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param); GLAPI void APIENTRY glMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); GLAPI void APIENTRY glMultiTexEnviEXT (GLenum texunit, GLenum target, GLenum pname, GLint param); @@ -6772,57 +6218,57 @@ GLAPI void APIENTRY glMultiTexParameteriEXT (GLenum texunit, GLenum target, GLen GLAPI void APIENTRY glMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); GLAPI void APIENTRY glMultiTexParameterfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param); GLAPI void APIENTRY glMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); GLAPI void APIENTRY glCopyMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); GLAPI void APIENTRY glCopyMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); GLAPI void APIENTRY glCopyMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); GLAPI void APIENTRY glCopyMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void APIENTRY glGetMultiTexImageEXT (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +GLAPI void APIENTRY glGetMultiTexImageEXT (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); GLAPI void APIENTRY glGetMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); GLAPI void APIENTRY glGetMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); GLAPI void APIENTRY glGetMultiTexLevelParameterfvEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); GLAPI void APIENTRY glGetMultiTexLevelParameterivEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); -GLAPI void APIENTRY glMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); GLAPI void APIENTRY glCopyMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); GLAPI void APIENTRY glEnableClientStateIndexedEXT (GLenum array, GLuint index); GLAPI void APIENTRY glDisableClientStateIndexedEXT (GLenum array, GLuint index); GLAPI void APIENTRY glGetFloatIndexedvEXT (GLenum target, GLuint index, GLfloat *data); GLAPI void APIENTRY glGetDoubleIndexedvEXT (GLenum target, GLuint index, GLdouble *data); -GLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum target, GLuint index, void **data); +GLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum target, GLuint index, GLvoid **data); GLAPI void APIENTRY glEnableIndexedEXT (GLenum target, GLuint index); GLAPI void APIENTRY glDisableIndexedEXT (GLenum target, GLuint index); GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum target, GLuint index); GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum target, GLuint index, GLint *data); GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum target, GLuint index, GLboolean *data); -GLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint texture, GLenum target, GLint lod, void *img); -GLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *bits); -GLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum texunit, GLenum target, GLint lod, void *img); +GLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint texture, GLenum target, GLint lod, GLvoid *img); +GLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum texunit, GLenum target, GLint lod, GLvoid *img); GLAPI void APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m); GLAPI void APIENTRY glMatrixLoadTransposedEXT (GLenum mode, const GLdouble *m); GLAPI void APIENTRY glMatrixMultTransposefEXT (GLenum mode, const GLfloat *m); GLAPI void APIENTRY glMatrixMultTransposedEXT (GLenum mode, const GLdouble *m); -GLAPI void APIENTRY glNamedBufferDataEXT (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); -GLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); +GLAPI void APIENTRY glNamedBufferDataEXT (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage); +GLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data); GLAPI void *APIENTRY glMapNamedBufferEXT (GLuint buffer, GLenum access); GLAPI GLboolean APIENTRY glUnmapNamedBufferEXT (GLuint buffer); GLAPI void APIENTRY glGetNamedBufferParameterivEXT (GLuint buffer, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint buffer, GLenum pname, void **params); -GLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); +GLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint buffer, GLenum pname, GLvoid **params); +GLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data); GLAPI void APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0); GLAPI void APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1); GLAPI void APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); @@ -6879,8 +6325,8 @@ GLAPI void APIENTRY glEnableClientStateiEXT (GLenum array, GLuint index); GLAPI void APIENTRY glDisableClientStateiEXT (GLenum array, GLuint index); GLAPI void APIENTRY glGetFloati_vEXT (GLenum pname, GLuint index, GLfloat *params); GLAPI void APIENTRY glGetDoublei_vEXT (GLenum pname, GLuint index, GLdouble *params); -GLAPI void APIENTRY glGetPointeri_vEXT (GLenum pname, GLuint index, void **params); -GLAPI void APIENTRY glNamedProgramStringEXT (GLuint program, GLenum target, GLenum format, GLsizei len, const void *string); +GLAPI void APIENTRY glGetPointeri_vEXT (GLenum pname, GLuint index, GLvoid **params); +GLAPI void APIENTRY glNamedProgramStringEXT (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string); GLAPI void APIENTRY glNamedProgramLocalParameter4dEXT (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); GLAPI void APIENTRY glNamedProgramLocalParameter4dvEXT (GLuint program, GLenum target, GLuint index, const GLdouble *params); GLAPI void APIENTRY glNamedProgramLocalParameter4fEXT (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); @@ -6888,7 +6334,7 @@ GLAPI void APIENTRY glNamedProgramLocalParameter4fvEXT (GLuint program, GLenum t GLAPI void APIENTRY glGetNamedProgramLocalParameterdvEXT (GLuint program, GLenum target, GLuint index, GLdouble *params); GLAPI void APIENTRY glGetNamedProgramLocalParameterfvEXT (GLuint program, GLenum target, GLuint index, GLfloat *params); GLAPI void APIENTRY glGetNamedProgramivEXT (GLuint program, GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint program, GLenum target, GLenum pname, void *string); +GLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint program, GLenum target, GLenum pname, GLvoid *string); GLAPI void APIENTRY glNamedRenderbufferStorageEXT (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); GLAPI void APIENTRY glGetNamedRenderbufferParameterivEXT (GLuint renderbuffer, GLenum pname, GLint *params); GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleEXT (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); @@ -6927,14 +6373,13 @@ GLAPI void APIENTRY glDisableVertexArrayEXT (GLuint vaobj, GLenum array); GLAPI void APIENTRY glEnableVertexArrayAttribEXT (GLuint vaobj, GLuint index); GLAPI void APIENTRY glDisableVertexArrayAttribEXT (GLuint vaobj, GLuint index); GLAPI void APIENTRY glGetVertexArrayIntegervEXT (GLuint vaobj, GLenum pname, GLint *param); -GLAPI void APIENTRY glGetVertexArrayPointervEXT (GLuint vaobj, GLenum pname, void **param); +GLAPI void APIENTRY glGetVertexArrayPointervEXT (GLuint vaobj, GLenum pname, GLvoid **param); GLAPI void APIENTRY glGetVertexArrayIntegeri_vEXT (GLuint vaobj, GLuint index, GLenum pname, GLint *param); -GLAPI void APIENTRY glGetVertexArrayPointeri_vEXT (GLuint vaobj, GLuint index, GLenum pname, void **param); +GLAPI void APIENTRY glGetVertexArrayPointeri_vEXT (GLuint vaobj, GLuint index, GLenum pname, GLvoid **param); GLAPI void *APIENTRY glMapNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); GLAPI void APIENTRY glFlushMappedNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length); -GLAPI void APIENTRY glNamedBufferStorageEXT (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); GLAPI void APIENTRY glClearNamedBufferDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); -GLAPI void APIENTRY glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); +GLAPI void APIENTRY glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, GLsizeiptr offset, GLsizeiptr size, const void *data); GLAPI void APIENTRY glNamedFramebufferParameteriEXT (GLuint framebuffer, GLenum pname, GLint param); GLAPI void APIENTRY glGetNamedFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params); GLAPI void APIENTRY glProgramUniform1dEXT (GLuint program, GLint location, GLdouble x); @@ -6967,8 +6412,7 @@ GLAPI void APIENTRY glVertexArrayVertexAttribLFormatEXT (GLuint vaobj, GLuint at GLAPI void APIENTRY glVertexArrayVertexAttribBindingEXT (GLuint vaobj, GLuint attribindex, GLuint bindingindex); GLAPI void APIENTRY glVertexArrayVertexBindingDivisorEXT (GLuint vaobj, GLuint bindingindex, GLuint divisor); GLAPI void APIENTRY glVertexArrayVertexAttribLOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); -GLAPI void APIENTRY glTexturePageCommitmentEXT (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean resident); -GLAPI void APIENTRY glVertexArrayVertexAttribDivisorEXT (GLuint vaobj, GLuint index, GLuint divisor); +GLAPI void APIENTRY glTexturePageCommitmentEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean resident); #endif #endif /* GL_EXT_direct_state_access */ @@ -6983,10 +6427,10 @@ GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint index, GLboolean r, GLboolean #ifndef GL_EXT_draw_instanced #define GL_EXT_draw_instanced 1 typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount); -GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); #endif #endif /* GL_EXT_draw_instanced */ @@ -6994,9 +6438,9 @@ GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLen #define GL_EXT_draw_range_elements 1 #define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 #define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); +GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); #endif #endif /* GL_EXT_draw_range_elements */ @@ -7014,13 +6458,13 @@ typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord); typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord); typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glFogCoordfEXT (GLfloat coord); GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *coord); GLAPI void APIENTRY glFogCoorddEXT (GLdouble coord); GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *coord); -GLAPI void APIENTRY glFogCoordPointerEXT (GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glFogCoordPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer); #endif #endif /* GL_EXT_fog_coord */ @@ -7260,10 +6704,10 @@ GLAPI void APIENTRY glUniform4uivEXT (GLint location, GLsizei count, const GLuin #define GL_MINMAX_FORMAT_EXT 0x802F #define GL_MINMAX_SINK_EXT 0x8030 #define GL_TABLE_TOO_LARGE_EXT 0x8031 -typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); @@ -7271,10 +6715,10 @@ typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalforma typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetHistogramEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +GLAPI void APIENTRY glGetHistogramEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum target, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetMinmaxEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); +GLAPI void APIENTRY glGetMinmaxEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum target, GLenum pname, GLint *params); GLAPI void APIENTRY glHistogramEXT (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); @@ -7350,10 +6794,10 @@ GLAPI void APIENTRY glTextureMaterialEXT (GLenum face, GLenum mode); #ifndef GL_EXT_multi_draw_arrays #define GL_EXT_multi_draw_arrays 1 typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid *const*indices, GLsizei primcount); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount); +GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const GLvoid *const*indices, GLsizei primcount); #endif #endif /* GL_EXT_multi_draw_arrays */ @@ -7417,13 +6861,13 @@ GLAPI void APIENTRY glSamplePatternEXT (GLenum pattern); #define GL_COLOR_INDEX12_EXT 0x80E6 #define GL_COLOR_INDEX16_EXT 0x80E7 #define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED -typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, void *data); +typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTableEXT (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void *table); -GLAPI void APIENTRY glGetColorTableEXT (GLenum target, GLenum format, GLenum type, void *data); +GLAPI void APIENTRY glColorTableEXT (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +GLAPI void APIENTRY glGetColorTableEXT (GLenum target, GLenum format, GLenum type, GLvoid *data); GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum target, GLenum pname, GLint *params); GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); #endif @@ -7535,7 +6979,7 @@ typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte red, GLbyte green, GLbyte blue); GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *v); @@ -7553,7 +6997,7 @@ GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint red, GLuint green, GLuint blu GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *v); GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort red, GLushort green, GLushort blue); GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *v); -GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); #endif #endif /* GL_EXT_secondary_color */ @@ -7577,10 +7021,6 @@ GLAPI GLuint APIENTRY glCreateShaderProgramEXT (GLenum type, const GLchar *strin #define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA #endif /* GL_EXT_separate_specular_color */ -#ifndef GL_EXT_shader_image_load_formatted -#define GL_EXT_shader_image_load_formatted 1 -#endif /* GL_EXT_shader_image_load_formatted */ - #ifndef GL_EXT_shader_image_load_store #define GL_EXT_shader_image_load_store 1 #define GL_MAX_IMAGE_UNITS_EXT 0x8F38 @@ -7646,10 +7086,6 @@ GLAPI void APIENTRY glMemoryBarrierEXT (GLbitfield barriers); #endif #endif /* GL_EXT_shader_image_load_store */ -#ifndef GL_EXT_shader_integer_mix -#define GL_EXT_shader_integer_mix 1 -#endif /* GL_EXT_shader_integer_mix */ - #ifndef GL_EXT_shadow_funcs #define GL_EXT_shadow_funcs 1 #endif /* GL_EXT_shadow_funcs */ @@ -7687,11 +7123,11 @@ GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum face); #ifndef GL_EXT_subtexture #define GL_EXT_subtexture 1 -typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); #endif #endif /* GL_EXT_subtexture */ @@ -7753,11 +7189,11 @@ GLAPI void APIENTRY glTexSubImage2DEXT (GLenum target, GLint level, GLint xoffse #define GL_TEXTURE_DEPTH_EXT 0x8071 #define GL_TEXTURE_WRAP_R_EXT 0x8072 #define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 -typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage3DEXT (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTexImage3DEXT (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); #endif #endif /* GL_EXT_texture3D */ @@ -7771,10 +7207,6 @@ GLAPI void APIENTRY glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffse #define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D #define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF #define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -#endif #endif /* GL_EXT_texture_array */ #ifndef GL_EXT_texture_buffer_object @@ -8127,24 +7559,24 @@ GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint program, GLuint ind #define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 #define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i); -typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); -typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, void **params); -typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer); -typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); -typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid **params); +typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glArrayElementEXT (GLint i); -GLAPI void APIENTRY glColorPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +GLAPI void APIENTRY glColorPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); GLAPI void APIENTRY glDrawArraysEXT (GLenum mode, GLint first, GLsizei count); GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei stride, GLsizei count, const GLboolean *pointer); -GLAPI void APIENTRY glGetPointervEXT (GLenum pname, void **params); -GLAPI void APIENTRY glIndexPointerEXT (GLenum type, GLsizei stride, GLsizei count, const void *pointer); -GLAPI void APIENTRY glNormalPointerEXT (GLenum type, GLsizei stride, GLsizei count, const void *pointer); -GLAPI void APIENTRY glTexCoordPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); -GLAPI void APIENTRY glVertexPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); +GLAPI void APIENTRY glGetPointervEXT (GLenum pname, GLvoid **params); +GLAPI void APIENTRY glIndexPointerEXT (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +GLAPI void APIENTRY glNormalPointerEXT (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +GLAPI void APIENTRY glTexCoordPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +GLAPI void APIENTRY glVertexPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); #endif #endif /* GL_EXT_vertex_array */ @@ -8174,7 +7606,7 @@ typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdou typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble *v); typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble *v); typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble *params); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glVertexAttribL1dEXT (GLuint index, GLdouble x); @@ -8185,7 +7617,7 @@ GLAPI void APIENTRY glVertexAttribL1dvEXT (GLuint index, const GLdouble *v); GLAPI void APIENTRY glVertexAttribL2dvEXT (GLuint index, const GLdouble *v); GLAPI void APIENTRY glVertexAttribL3dvEXT (GLuint index, const GLdouble *v); GLAPI void APIENTRY glVertexAttribL4dvEXT (GLuint index, const GLdouble *v); -GLAPI void APIENTRY glVertexAttribLPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glVertexAttribLPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); GLAPI void APIENTRY glGetVertexAttribLdvEXT (GLuint index, GLenum pname, GLdouble *params); #endif #endif /* GL_EXT_vertex_attrib_64bit */ @@ -8315,8 +7747,8 @@ typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum ou typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); -typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const void *addr); -typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const void *addr); +typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); +typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr); typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr); typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr); @@ -8325,7 +7757,7 @@ typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr) typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr); typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr); typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr); -typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const void *addr); +typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr); typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); @@ -8337,7 +7769,7 @@ typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum ca typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, void **data); +typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid **data); typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); @@ -8358,8 +7790,8 @@ GLAPI void APIENTRY glWriteMaskEXT (GLuint res, GLuint in, GLenum outX, GLenum o GLAPI void APIENTRY glInsertComponentEXT (GLuint res, GLuint src, GLuint num); GLAPI void APIENTRY glExtractComponentEXT (GLuint res, GLuint src, GLuint num); GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); -GLAPI void APIENTRY glSetInvariantEXT (GLuint id, GLenum type, const void *addr); -GLAPI void APIENTRY glSetLocalConstantEXT (GLuint id, GLenum type, const void *addr); +GLAPI void APIENTRY glSetInvariantEXT (GLuint id, GLenum type, const GLvoid *addr); +GLAPI void APIENTRY glSetLocalConstantEXT (GLuint id, GLenum type, const GLvoid *addr); GLAPI void APIENTRY glVariantbvEXT (GLuint id, const GLbyte *addr); GLAPI void APIENTRY glVariantsvEXT (GLuint id, const GLshort *addr); GLAPI void APIENTRY glVariantivEXT (GLuint id, const GLint *addr); @@ -8368,7 +7800,7 @@ GLAPI void APIENTRY glVariantdvEXT (GLuint id, const GLdouble *addr); GLAPI void APIENTRY glVariantubvEXT (GLuint id, const GLubyte *addr); GLAPI void APIENTRY glVariantusvEXT (GLuint id, const GLushort *addr); GLAPI void APIENTRY glVariantuivEXT (GLuint id, const GLuint *addr); -GLAPI void APIENTRY glVariantPointerEXT (GLuint id, GLenum type, GLuint stride, const void *addr); +GLAPI void APIENTRY glVariantPointerEXT (GLuint id, GLenum type, GLuint stride, const GLvoid *addr); GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint id); GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint id); GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum light, GLenum value); @@ -8380,7 +7812,7 @@ GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint id, GLenum cap); GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint id, GLenum value, GLint *data); GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint id, GLenum value, GLfloat *data); -GLAPI void APIENTRY glGetVariantPointervEXT (GLuint id, GLenum value, void **data); +GLAPI void APIENTRY glGetVariantPointervEXT (GLuint id, GLenum value, GLvoid **data); GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint id, GLenum value, GLint *data); GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint id, GLenum value, GLfloat *data); @@ -8407,11 +7839,11 @@ GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint id, GLenum value, GLfloa #define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glVertexWeightfEXT (GLfloat weight); GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *weight); -GLAPI void APIENTRY glVertexWeightPointerEXT (GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glVertexWeightPointerEXT (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); #endif #endif /* GL_EXT_vertex_weighting */ @@ -8434,9 +7866,9 @@ GLAPI void APIENTRY glFrameTerminatorGREMEDY (void); #ifndef GL_GREMEDY_string_marker #define GL_GREMEDY_string_marker 1 -typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const void *string); +typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei len, const void *string); +GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei len, const GLvoid *string); #endif #endif /* GL_GREMEDY_string_marker */ @@ -8502,10 +7934,10 @@ GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum target, GLenum pnam #ifndef GL_IBM_multimode_draw_arrays #define GL_IBM_multimode_draw_arrays 1 typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); -typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, GLint modestride); +typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid *const*indices, GLsizei primcount, GLint modestride); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); -GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, GLint modestride); +GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid *const*indices, GLsizei primcount, GLint modestride); #endif #endif /* GL_IBM_multimode_draw_arrays */ @@ -8547,23 +7979,23 @@ GLAPI void APIENTRY glFlushStaticDataIBM (GLenum target); #define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 #define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 #define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 -typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +GLAPI void APIENTRY glColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); +GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint stride, const GLboolean **pointer, GLint ptrstride); -GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride); -GLAPI void APIENTRY glIndexPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride); -GLAPI void APIENTRY glNormalPointerListIBM (GLenum type, GLint stride, const void **pointer, GLint ptrstride); -GLAPI void APIENTRY glTexCoordPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); -GLAPI void APIENTRY glVertexPointerListIBM (GLint size, GLenum type, GLint stride, const void **pointer, GLint ptrstride); +GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); +GLAPI void APIENTRY glIndexPointerListIBM (GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); +GLAPI void APIENTRY glNormalPointerListIBM (GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); +GLAPI void APIENTRY glTexCoordPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); +GLAPI void APIENTRY glVertexPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride); #endif #endif /* GL_IBM_vertex_array_lists */ @@ -8592,10 +8024,6 @@ GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum sfactorRGB, GLenum dfactorRG #define GL_INTERLACE_READ_INGR 0x8568 #endif /* GL_INGR_interlace_read */ -#ifndef GL_INTEL_fragment_shader_ordering -#define GL_INTEL_fragment_shader_ordering 1 -#endif /* GL_INTEL_fragment_shader_ordering */ - #ifndef GL_INTEL_map_texture #define GL_INTEL_map_texture 1 #define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF @@ -8604,11 +8032,11 @@ GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum sfactorRGB, GLenum dfactorRG #define GL_LAYOUT_LINEAR_CPU_CACHED_INTEL 2 typedef void (APIENTRYP PFNGLSYNCTEXTUREINTELPROC) (GLuint texture); typedef void (APIENTRYP PFNGLUNMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level); -typedef void *(APIENTRYP PFNGLMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level, GLbitfield access, GLint *stride, GLenum *layout); +typedef void *(APIENTRYP PFNGLMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level, GLbitfield access, const GLint *stride, const GLenum *layout); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glSyncTextureINTEL (GLuint texture); GLAPI void APIENTRY glUnmapTexture2DINTEL (GLuint texture, GLint level); -GLAPI void *APIENTRY glMapTexture2DINTEL (GLuint texture, GLint level, GLbitfield access, GLint *stride, GLenum *layout); +GLAPI void *APIENTRY glMapTexture2DINTEL (GLuint texture, GLint level, GLbitfield access, const GLint *stride, const GLenum *layout); #endif #endif /* GL_INTEL_map_texture */ @@ -8619,64 +8047,18 @@ GLAPI void *APIENTRY glMapTexture2DINTEL (GLuint texture, GLint level, GLbitfiel #define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 #define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 #define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 -typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer); -typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void **pointer); -typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void **pointer); +typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid **pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid **pointer); +typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid **pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid **pointer); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexPointervINTEL (GLint size, GLenum type, const void **pointer); -GLAPI void APIENTRY glNormalPointervINTEL (GLenum type, const void **pointer); -GLAPI void APIENTRY glColorPointervINTEL (GLint size, GLenum type, const void **pointer); -GLAPI void APIENTRY glTexCoordPointervINTEL (GLint size, GLenum type, const void **pointer); +GLAPI void APIENTRY glVertexPointervINTEL (GLint size, GLenum type, const GLvoid **pointer); +GLAPI void APIENTRY glNormalPointervINTEL (GLenum type, const GLvoid **pointer); +GLAPI void APIENTRY glColorPointervINTEL (GLint size, GLenum type, const GLvoid **pointer); +GLAPI void APIENTRY glTexCoordPointervINTEL (GLint size, GLenum type, const GLvoid **pointer); #endif #endif /* GL_INTEL_parallel_arrays */ -#ifndef GL_INTEL_performance_query -#define GL_INTEL_performance_query 1 -#define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x00000000 -#define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x00000001 -#define GL_PERFQUERY_WAIT_INTEL 0x83FB -#define GL_PERFQUERY_FLUSH_INTEL 0x83FA -#define GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9 -#define GL_PERFQUERY_COUNTER_EVENT_INTEL 0x94F0 -#define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1 -#define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2 -#define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3 -#define GL_PERFQUERY_COUNTER_RAW_INTEL 0x94F4 -#define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5 -#define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8 -#define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9 -#define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA -#define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB -#define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC -#define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD -#define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE -#define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF -#define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500 -typedef void (APIENTRYP PFNGLBEGINPERFQUERYINTELPROC) (GLuint queryHandle); -typedef void (APIENTRYP PFNGLCREATEPERFQUERYINTELPROC) (GLuint queryId, GLuint *queryHandle); -typedef void (APIENTRYP PFNGLDELETEPERFQUERYINTELPROC) (GLuint queryHandle); -typedef void (APIENTRYP PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle); -typedef void (APIENTRYP PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint *queryId); -typedef void (APIENTRYP PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint *nextQueryId); -typedef void (APIENTRYP PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); -typedef void (APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten); -typedef void (APIENTRYP PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar *queryName, GLuint *queryId); -typedef void (APIENTRYP PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginPerfQueryINTEL (GLuint queryHandle); -GLAPI void APIENTRY glCreatePerfQueryINTEL (GLuint queryId, GLuint *queryHandle); -GLAPI void APIENTRY glDeletePerfQueryINTEL (GLuint queryHandle); -GLAPI void APIENTRY glEndPerfQueryINTEL (GLuint queryHandle); -GLAPI void APIENTRY glGetFirstPerfQueryIdINTEL (GLuint *queryId); -GLAPI void APIENTRY glGetNextPerfQueryIdINTEL (GLuint queryId, GLuint *nextQueryId); -GLAPI void APIENTRY glGetPerfCounterInfoINTEL (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); -GLAPI void APIENTRY glGetPerfQueryDataINTEL (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten); -GLAPI void APIENTRY glGetPerfQueryIdByNameINTEL (GLchar *queryName, GLuint *queryId); -GLAPI void APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); -#endif -#endif /* GL_INTEL_performance_query */ - #ifndef GL_MESAX_texture_stack #define GL_MESAX_texture_stack 1 #define GL_TEXTURE_1D_STACK_MESAX 0x8759 @@ -8771,35 +8153,16 @@ GLAPI void APIENTRY glEndConditionalRenderNVX (void); #endif #endif /* GL_NVX_conditional_render */ -#ifndef GL_NVX_gpu_memory_info -#define GL_NVX_gpu_memory_info 1 -#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 -#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 -#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 -#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A -#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B -#endif /* GL_NVX_gpu_memory_info */ - #ifndef GL_NV_bindless_multi_draw_indirect #define GL_NV_bindless_multi_draw_indirect 1 -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const GLvoid *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysIndirectBindlessNV (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); -GLAPI void APIENTRY glMultiDrawElementsIndirectBindlessNV (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); +GLAPI void APIENTRY glMultiDrawArraysIndirectBindlessNV (GLenum mode, const GLvoid *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); +GLAPI void APIENTRY glMultiDrawElementsIndirectBindlessNV (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); #endif #endif /* GL_NV_bindless_multi_draw_indirect */ -#ifndef GL_NV_bindless_multi_draw_indirect_count -#define GL_NV_bindless_multi_draw_indirect_count 1 -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysIndirectBindlessCountNV (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); -GLAPI void APIENTRY glMultiDrawElementsIndirectBindlessCountNV (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); -#endif -#endif /* GL_NV_bindless_multi_draw_indirect_count */ - #ifndef GL_NV_bindless_texture #define GL_NV_bindless_texture 1 typedef GLuint64 (APIENTRYP PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); @@ -8834,9 +8197,9 @@ GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle); #ifndef GL_NV_blend_equation_advanced #define GL_NV_blend_equation_advanced 1 +#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 #define GL_BLEND_OVERLAP_NV 0x9281 #define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 -#define GL_BLUE_NV 0x1905 #define GL_COLORBURN_NV 0x929A #define GL_COLORDODGE_NV 0x9299 #define GL_CONJOINT_NV 0x9284 @@ -8850,7 +8213,6 @@ GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle); #define GL_DST_OUT_NV 0x928D #define GL_DST_OVER_NV 0x9289 #define GL_EXCLUSION_NV 0x92A0 -#define GL_GREEN_NV 0x1904 #define GL_HARDLIGHT_NV 0x929B #define GL_HARDMIX_NV 0x92A9 #define GL_HSL_COLOR_NV 0x92AF @@ -8872,7 +8234,6 @@ GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle); #define GL_PLUS_CLAMPED_NV 0x92B1 #define GL_PLUS_DARKER_NV 0x9292 #define GL_PLUS_NV 0x9291 -#define GL_RED_NV 0x1903 #define GL_SCREEN_NV 0x9295 #define GL_SOFTLIGHT_NV 0x929C #define GL_SRC_ATOP_NV 0x928E @@ -8882,7 +8243,6 @@ GLAPI GLboolean APIENTRY glIsImageHandleResidentNV (GLuint64 handle); #define GL_SRC_OVER_NV 0x9288 #define GL_UNCORRELATED_NV 0x9282 #define GL_VIVIDLIGHT_NV 0x92A6 -#define GL_XOR_NV 0x1506 typedef void (APIENTRYP PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value); typedef void (APIENTRYP PFNGLBLENDBARRIERNVPROC) (void); #ifdef GL_GLEXT_PROTOTYPES @@ -8893,7 +8253,6 @@ GLAPI void APIENTRY glBlendBarrierNV (void); #ifndef GL_NV_blend_equation_advanced_coherent #define GL_NV_blend_equation_advanced_coherent 1 -#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 #endif /* GL_NV_blend_equation_advanced_coherent */ #ifndef GL_NV_blend_square @@ -8995,20 +8354,20 @@ GLAPI void APIENTRY glDrawTextureNV (GLuint texture, GLuint sampler, GLfloat x0, #define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 #define GL_MAX_MAP_TESSELLATION_NV 0x86D6 #define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 -typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points); +typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void *points); +typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params); typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params); typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points); +GLAPI void APIENTRY glMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); GLAPI void APIENTRY glMapParameterivNV (GLenum target, GLenum pname, const GLint *params); GLAPI void APIENTRY glMapParameterfvNV (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void APIENTRY glGetMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void *points); +GLAPI void APIENTRY glGetMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); GLAPI void APIENTRY glGetMapParameterivNV (GLenum target, GLenum pname, GLint *params); GLAPI void APIENTRY glGetMapParameterfvNV (GLenum target, GLenum pname, GLfloat *params); GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum target, GLuint index, GLenum pname, GLint *params); @@ -9148,10 +8507,12 @@ GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum target, G #define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glProgramVertexLimitNV (GLenum target, GLint limit); GLAPI void APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); #endif #endif /* GL_NV_geometry_program4 */ @@ -9230,6 +8591,103 @@ GLAPI void APIENTRY glGetProgramSubroutineParameteruivNV (GLenum target, GLuint #ifndef GL_NV_gpu_shader5 #define GL_NV_gpu_shader5 1 +typedef int64_t GLint64EXT; +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F +#define GL_INT8_NV 0x8FE0 +#define GL_INT8_VEC2_NV 0x8FE1 +#define GL_INT8_VEC3_NV 0x8FE2 +#define GL_INT8_VEC4_NV 0x8FE3 +#define GL_INT16_NV 0x8FE4 +#define GL_INT16_VEC2_NV 0x8FE5 +#define GL_INT16_VEC3_NV 0x8FE6 +#define GL_INT16_VEC4_NV 0x8FE7 +#define GL_INT64_VEC2_NV 0x8FE9 +#define GL_INT64_VEC3_NV 0x8FEA +#define GL_INT64_VEC4_NV 0x8FEB +#define GL_UNSIGNED_INT8_NV 0x8FEC +#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED +#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE +#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF +#define GL_UNSIGNED_INT16_NV 0x8FF0 +#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 +#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 +#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 +#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 +#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 +#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 +#define GL_FLOAT16_NV 0x8FF8 +#define GL_FLOAT16_VEC2_NV 0x8FF9 +#define GL_FLOAT16_VEC3_NV 0x8FFA +#define GL_FLOAT16_VEC4_NV 0x8FFB +typedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); +typedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); +typedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); +typedef void (APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniform1i64NV (GLint location, GLint64EXT x); +GLAPI void APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y); +GLAPI void APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GLAPI void APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GLAPI void APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x); +GLAPI void APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y); +GLAPI void APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GLAPI void APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GLAPI void APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params); +GLAPI void APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x); +GLAPI void APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +GLAPI void APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GLAPI void APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GLAPI void APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x); +GLAPI void APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +GLAPI void APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GLAPI void APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GLAPI void APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#endif #endif /* GL_NV_gpu_shader5 */ #ifndef GL_NV_half_float @@ -9530,50 +8988,16 @@ GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum target, GLuint bindi #define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 #define GL_PRIMARY_COLOR_NV 0x852C #define GL_SECONDARY_COLOR_NV 0x852D -#define GL_ROUNDED_RECT_NV 0xE8 -#define GL_RELATIVE_ROUNDED_RECT_NV 0xE9 -#define GL_ROUNDED_RECT2_NV 0xEA -#define GL_RELATIVE_ROUNDED_RECT2_NV 0xEB -#define GL_ROUNDED_RECT4_NV 0xEC -#define GL_RELATIVE_ROUNDED_RECT4_NV 0xED -#define GL_ROUNDED_RECT8_NV 0xEE -#define GL_RELATIVE_ROUNDED_RECT8_NV 0xEF -#define GL_RELATIVE_RECT_NV 0xF7 -#define GL_FONT_GLYPHS_AVAILABLE_NV 0x9368 -#define GL_FONT_TARGET_UNAVAILABLE_NV 0x9369 -#define GL_FONT_UNAVAILABLE_NV 0x936A -#define GL_FONT_UNINTELLIGIBLE_NV 0x936B -#define GL_CONIC_CURVE_TO_NV 0x1A -#define GL_RELATIVE_CONIC_CURVE_TO_NV 0x1B -#define GL_FONT_NUM_GLYPH_INDICES_BIT_NV 0x20000000 -#define GL_STANDARD_FONT_FORMAT_NV 0x936C -#define GL_2_BYTES_NV 0x1407 -#define GL_3_BYTES_NV 0x1408 -#define GL_4_BYTES_NV 0x1409 -#define GL_EYE_LINEAR_NV 0x2400 -#define GL_OBJECT_LINEAR_NV 0x2401 -#define GL_CONSTANT_NV 0x8576 -#define GL_PATH_PROJECTION_NV 0x1701 -#define GL_PATH_MODELVIEW_NV 0x1700 -#define GL_PATH_MODELVIEW_STACK_DEPTH_NV 0x0BA3 -#define GL_PATH_MODELVIEW_MATRIX_NV 0x0BA6 -#define GL_PATH_MAX_MODELVIEW_STACK_DEPTH_NV 0x0D36 -#define GL_PATH_TRANSPOSE_MODELVIEW_MATRIX_NV 0x84E3 -#define GL_PATH_PROJECTION_STACK_DEPTH_NV 0x0BA4 -#define GL_PATH_PROJECTION_MATRIX_NV 0x0BA7 -#define GL_PATH_MAX_PROJECTION_STACK_DEPTH_NV 0x0D38 -#define GL_PATH_TRANSPOSE_PROJECTION_MATRIX_NV 0x84E4 -#define GL_FRAGMENT_INPUT_NV 0x936D typedef GLuint (APIENTRYP PFNGLGENPATHSNVPROC) (GLsizei range); typedef void (APIENTRYP PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); typedef GLboolean (APIENTRYP PFNGLISPATHNVPROC) (GLuint path); -typedef void (APIENTRYP PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); -typedef void (APIENTRYP PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); -typedef void (APIENTRYP PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); -typedef void (APIENTRYP PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); -typedef void (APIENTRYP PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void *pathString); -typedef void (APIENTRYP PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef void (APIENTRYP PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (APIENTRYP PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const GLvoid *coords); +typedef void (APIENTRYP PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const GLvoid *coords); +typedef void (APIENTRYP PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const GLvoid *coords); +typedef void (APIENTRYP PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const GLvoid *coords); +typedef void (APIENTRYP PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const GLvoid *pathString); +typedef void (APIENTRYP PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const GLvoid *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const GLvoid *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (APIENTRYP PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const GLvoid *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); typedef void (APIENTRYP PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights); typedef void (APIENTRYP PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); typedef void (APIENTRYP PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); @@ -9587,24 +9011,24 @@ typedef void (APIENTRYP PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLu typedef void (APIENTRYP PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); typedef void (APIENTRYP PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); -typedef void (APIENTRYP PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); -typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (APIENTRYP PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (APIENTRYP PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); typedef void (APIENTRYP PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum func); typedef void (APIENTRYP PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs); typedef void (APIENTRYP PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs); typedef void (APIENTRYP PFNGLPATHFOGGENNVPROC) (GLenum genMode); typedef void (APIENTRYP PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); typedef void (APIENTRYP PFNGLCOVERSTROKEPATHNVPROC) (GLuint path, GLenum coverMode); -typedef void (APIENTRYP PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef void (APIENTRYP PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (APIENTRYP PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (APIENTRYP PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); typedef void (APIENTRYP PFNGLGETPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, GLint *value); typedef void (APIENTRYP PFNGLGETPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, GLfloat *value); typedef void (APIENTRYP PFNGLGETPATHCOMMANDSNVPROC) (GLuint path, GLubyte *commands); typedef void (APIENTRYP PFNGLGETPATHCOORDSNVPROC) (GLuint path, GLfloat *coords); typedef void (APIENTRYP PFNGLGETPATHDASHARRAYNVPROC) (GLuint path, GLfloat *dashArray); -typedef void (APIENTRYP PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); +typedef void (APIENTRYP PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); typedef void (APIENTRYP PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics); -typedef void (APIENTRYP PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); +typedef void (APIENTRYP PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); typedef void (APIENTRYP PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint *value); typedef void (APIENTRYP PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat *value); typedef void (APIENTRYP PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint *value); @@ -9613,32 +9037,17 @@ typedef GLboolean (APIENTRYP PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint typedef GLboolean (APIENTRYP PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); typedef GLfloat (APIENTRYP PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); typedef GLboolean (APIENTRYP PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); -typedef void (APIENTRYP PFNGLMATRIXLOAD3X2FNVPROC) (GLenum matrixMode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXLOAD3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXMULT3X2FNVPROC) (GLenum matrixMode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXMULT3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); -typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat *m); -typedef void (APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); -typedef void (APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask, GLenum coverMode); -typedef void (APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef void (APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]); -typedef GLenum (APIENTRYP PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef GLenum (APIENTRYP PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef void (APIENTRYP PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs); -typedef void (APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params); #ifdef GL_GLEXT_PROTOTYPES GLAPI GLuint APIENTRY glGenPathsNV (GLsizei range); GLAPI void APIENTRY glDeletePathsNV (GLuint path, GLsizei range); GLAPI GLboolean APIENTRY glIsPathNV (GLuint path); -GLAPI void APIENTRY glPathCommandsNV (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); -GLAPI void APIENTRY glPathCoordsNV (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); -GLAPI void APIENTRY glPathSubCommandsNV (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords); -GLAPI void APIENTRY glPathSubCoordsNV (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); -GLAPI void APIENTRY glPathStringNV (GLuint path, GLenum format, GLsizei length, const void *pathString); -GLAPI void APIENTRY glPathGlyphsNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GLAPI void APIENTRY glPathGlyphRangeNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +GLAPI void APIENTRY glPathCommandsNV (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const GLvoid *coords); +GLAPI void APIENTRY glPathCoordsNV (GLuint path, GLsizei numCoords, GLenum coordType, const GLvoid *coords); +GLAPI void APIENTRY glPathSubCommandsNV (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const GLvoid *coords); +GLAPI void APIENTRY glPathSubCoordsNV (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const GLvoid *coords); +GLAPI void APIENTRY glPathStringNV (GLuint path, GLenum format, GLsizei length, const GLvoid *pathString); +GLAPI void APIENTRY glPathGlyphsNV (GLuint firstPathName, GLenum fontTarget, const GLvoid *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const GLvoid *charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +GLAPI void APIENTRY glPathGlyphRangeNV (GLuint firstPathName, GLenum fontTarget, const GLvoid *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); GLAPI void APIENTRY glWeightPathsNV (GLuint resultPath, GLsizei numPaths, const GLuint *paths, const GLfloat *weights); GLAPI void APIENTRY glCopyPathNV (GLuint resultPath, GLuint srcPath); GLAPI void APIENTRY glInterpolatePathsNV (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); @@ -9652,24 +9061,24 @@ GLAPI void APIENTRY glPathStencilFuncNV (GLenum func, GLint ref, GLuint mask); GLAPI void APIENTRY glPathStencilDepthOffsetNV (GLfloat factor, GLfloat units); GLAPI void APIENTRY glStencilFillPathNV (GLuint path, GLenum fillMode, GLuint mask); GLAPI void APIENTRY glStencilStrokePathNV (GLuint path, GLint reference, GLuint mask); -GLAPI void APIENTRY glStencilFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); -GLAPI void APIENTRY glStencilStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); +GLAPI void APIENTRY glStencilFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); +GLAPI void APIENTRY glStencilStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); GLAPI void APIENTRY glPathCoverDepthFuncNV (GLenum func); GLAPI void APIENTRY glPathColorGenNV (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat *coeffs); GLAPI void APIENTRY glPathTexGenNV (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat *coeffs); GLAPI void APIENTRY glPathFogGenNV (GLenum genMode); GLAPI void APIENTRY glCoverFillPathNV (GLuint path, GLenum coverMode); GLAPI void APIENTRY glCoverStrokePathNV (GLuint path, GLenum coverMode); -GLAPI void APIENTRY glCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -GLAPI void APIENTRY glCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +GLAPI void APIENTRY glCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +GLAPI void APIENTRY glCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); GLAPI void APIENTRY glGetPathParameterivNV (GLuint path, GLenum pname, GLint *value); GLAPI void APIENTRY glGetPathParameterfvNV (GLuint path, GLenum pname, GLfloat *value); GLAPI void APIENTRY glGetPathCommandsNV (GLuint path, GLubyte *commands); GLAPI void APIENTRY glGetPathCoordsNV (GLuint path, GLfloat *coords); GLAPI void APIENTRY glGetPathDashArrayNV (GLuint path, GLfloat *dashArray); -GLAPI void APIENTRY glGetPathMetricsNV (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); +GLAPI void APIENTRY glGetPathMetricsNV (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); GLAPI void APIENTRY glGetPathMetricRangeNV (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat *metrics); -GLAPI void APIENTRY glGetPathSpacingNV (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); +GLAPI void APIENTRY glGetPathSpacingNV (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const GLvoid *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); GLAPI void APIENTRY glGetPathColorGenivNV (GLenum color, GLenum pname, GLint *value); GLAPI void APIENTRY glGetPathColorGenfvNV (GLenum color, GLenum pname, GLfloat *value); GLAPI void APIENTRY glGetPathTexGenivNV (GLenum texCoordSet, GLenum pname, GLint *value); @@ -9678,21 +9087,6 @@ GLAPI GLboolean APIENTRY glIsPointInFillPathNV (GLuint path, GLuint mask, GLfloa GLAPI GLboolean APIENTRY glIsPointInStrokePathNV (GLuint path, GLfloat x, GLfloat y); GLAPI GLfloat APIENTRY glGetPathLengthNV (GLuint path, GLsizei startSegment, GLsizei numSegments); GLAPI GLboolean APIENTRY glPointAlongPathNV (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat *x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); -GLAPI void APIENTRY glMatrixLoad3x2fNV (GLenum matrixMode, const GLfloat *m); -GLAPI void APIENTRY glMatrixLoad3x3fNV (GLenum matrixMode, const GLfloat *m); -GLAPI void APIENTRY glMatrixLoadTranspose3x3fNV (GLenum matrixMode, const GLfloat *m); -GLAPI void APIENTRY glMatrixMult3x2fNV (GLenum matrixMode, const GLfloat *m); -GLAPI void APIENTRY glMatrixMult3x3fNV (GLenum matrixMode, const GLfloat *m); -GLAPI void APIENTRY glMatrixMultTranspose3x3fNV (GLenum matrixMode, const GLfloat *m); -GLAPI void APIENTRY glStencilThenCoverFillPathNV (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); -GLAPI void APIENTRY glStencilThenCoverStrokePathNV (GLuint path, GLint reference, GLuint mask, GLenum coverMode); -GLAPI void APIENTRY glStencilThenCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -GLAPI void APIENTRY glStencilThenCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -GLAPI GLenum APIENTRY glPathGlyphIndexRangeNV (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]); -GLAPI GLenum APIENTRY glPathGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GLAPI GLenum APIENTRY glPathMemoryGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -GLAPI void APIENTRY glProgramPathFragmentInputGenNV (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs); -GLAPI void APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params); #endif #endif /* GL_NV_path_rendering */ @@ -9704,10 +9098,10 @@ GLAPI void APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInte #define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B #define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C #define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D -typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, const void *pointer); +typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, const GLvoid *pointer); typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelDataRangeNV (GLenum target, GLsizei length, const void *pointer); +GLAPI void APIENTRY glPixelDataRangeNV (GLenum target, GLsizei length, const GLvoid *pointer); GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum target); #endif #endif /* GL_NV_pixel_data_range */ @@ -9861,10 +9255,6 @@ GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname, #define GL_NV_shader_atomic_float 1 #endif /* GL_NV_shader_atomic_float */ -#ifndef GL_NV_shader_atomic_int64 -#define GL_NV_shader_atomic_int64 1 -#endif /* GL_NV_shader_atomic_int64 */ - #ifndef GL_NV_shader_buffer_load #define GL_NV_shader_buffer_load 1 #define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D @@ -9881,6 +9271,7 @@ typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, typedef void (APIENTRYP PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT *result); typedef void (APIENTRYP PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value); typedef void (APIENTRYP PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT *params); typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value); typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); #ifdef GL_GLEXT_PROTOTYPES @@ -9895,6 +9286,7 @@ GLAPI void APIENTRY glGetNamedBufferParameterui64vNV (GLuint buffer, GLenum pnam GLAPI void APIENTRY glGetIntegerui64vNV (GLenum value, GLuint64EXT *result); GLAPI void APIENTRY glUniformui64NV (GLint location, GLuint64EXT value); GLAPI void APIENTRY glUniformui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glGetUniformui64vNV (GLuint program, GLint location, GLuint64EXT *params); GLAPI void APIENTRY glProgramUniformui64NV (GLuint program, GLint location, GLuint64EXT value); GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); #endif @@ -9909,17 +9301,6 @@ GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLs #define GL_NV_shader_storage_buffer_object 1 #endif /* GL_NV_shader_storage_buffer_object */ -#ifndef GL_NV_shader_thread_group -#define GL_NV_shader_thread_group 1 -#define GL_WARP_SIZE_NV 0x9339 -#define GL_WARPS_PER_SM_NV 0x933A -#define GL_SM_COUNT_NV 0x933B -#endif /* GL_NV_shader_thread_group */ - -#ifndef GL_NV_shader_thread_shuffle -#define GL_NV_shader_thread_shuffle 1 -#endif /* GL_NV_shader_thread_shuffle */ - #ifndef GL_NV_tessellation_program5 #define GL_NV_tessellation_program5 1 #define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 @@ -10134,7 +9515,7 @@ GLAPI void APIENTRY glTextureImage3DMultisampleCoverageNV (GLuint texture, GLenu #define GL_SKIP_COMPONENTS1_NV -6 typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLsizei count, const GLint *attribs, GLenum bufferMode); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); @@ -10147,7 +9528,7 @@ typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC) (GLsizei coun #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum primitiveMode); GLAPI void APIENTRY glEndTransformFeedbackNV (void); -GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLsizei count, const GLint *attribs, GLenum bufferMode); +GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint count, const GLint *attribs, GLenum bufferMode); GLAPI void APIENTRY glBindBufferRangeNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); GLAPI void APIENTRY glBindBufferOffsetNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset); GLAPI void APIENTRY glBindBufferBaseNV (GLenum target, GLuint index, GLuint buffer); @@ -10191,22 +9572,22 @@ typedef GLintptr GLvdpauSurfaceNV; #define GL_SURFACE_REGISTERED_NV 0x86FD #define GL_SURFACE_MAPPED_NV 0x8700 #define GL_WRITE_DISCARD_NV 0x88BE -typedef void (APIENTRYP PFNGLVDPAUINITNVPROC) (const void *vdpDevice, const void *getProcAddress); +typedef void (APIENTRYP PFNGLVDPAUINITNVPROC) (const GLvoid *vdpDevice, const GLvoid *getProcAddress); typedef void (APIENTRYP PFNGLVDPAUFININVPROC) (void); -typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -typedef GLboolean (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); +typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef void (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); typedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); typedef void (APIENTRYP PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces); typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVDPAUInitNV (const void *vdpDevice, const void *getProcAddress); +GLAPI void APIENTRY glVDPAUInitNV (const GLvoid *vdpDevice, const GLvoid *getProcAddress); GLAPI void APIENTRY glVDPAUFiniNV (void); -GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterOutputSurfaceNV (const void *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -GLAPI GLboolean APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface); +GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (const GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterOutputSurfaceNV (const GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +GLAPI void APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface); GLAPI void APIENTRY glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface); GLAPI void APIENTRY glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); GLAPI void APIENTRY glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access); @@ -10223,10 +9604,10 @@ GLAPI void APIENTRY glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSur #define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 #define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); -typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const void *pointer); +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); -GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei length, const void *pointer); +GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei length, const GLvoid *pointer); #endif #endif /* GL_NV_vertex_array_range */ @@ -10432,7 +9813,7 @@ typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint addr typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, void **pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid **pointer); typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id); typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); @@ -10443,7 +9824,7 @@ typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *v); typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); @@ -10497,7 +9878,7 @@ GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum target, GLuint address, GLenum GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint index, GLenum pname, GLdouble *params); GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint index, GLenum pname, GLfloat *params); GLAPI void APIENTRY glGetVertexAttribivNV (GLuint index, GLenum pname, GLint *params); -GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint index, GLenum pname, void **pointer); +GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint index, GLenum pname, GLvoid **pointer); GLAPI GLboolean APIENTRY glIsProgramNV (GLuint id); GLAPI void APIENTRY glLoadProgramNV (GLenum target, GLuint id, GLsizei len, const GLubyte *program); GLAPI void APIENTRY glProgramParameter4dNV (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); @@ -10508,7 +9889,7 @@ GLAPI void APIENTRY glProgramParameters4dvNV (GLenum target, GLuint index, GLsiz GLAPI void APIENTRY glProgramParameters4fvNV (GLenum target, GLuint index, GLsizei count, const GLfloat *v); GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei n, const GLuint *programs); GLAPI void APIENTRY glTrackMatrixNV (GLenum target, GLuint address, GLenum matrix, GLenum transform); -GLAPI void APIENTRY glVertexAttribPointerNV (GLuint index, GLint fsize, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glVertexAttribPointerNV (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); GLAPI void APIENTRY glVertexAttrib1dNV (GLuint index, GLdouble x); GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint index, const GLdouble *v); GLAPI void APIENTRY glVertexAttrib1fNV (GLuint index, GLfloat x); @@ -10590,7 +9971,7 @@ typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyt typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); #ifdef GL_GLEXT_PROTOTYPES @@ -10614,7 +9995,7 @@ GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint index, const GLbyte *v); GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint index, const GLshort *v); GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint index, const GLubyte *v); GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint index, const GLushort *v); -GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params); GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params); #endif @@ -10908,11 +10289,11 @@ GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum target, GLfloat *points); #define GL_TEXTURE_WRAP_Q_SGIS 0x8137 #define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 #define GL_TEXTURE_4D_BINDING_SGIS 0x814F -typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage4DSGIS (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const void *pixels); +GLAPI void APIENTRY glTexImage4DSGIS (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); #endif #endif /* GL_SGIS_texture4D */ @@ -11148,9 +10529,9 @@ GLAPI void APIENTRY glFrameZoomSGIX (GLint factor); #ifndef GL_SGIX_igloo_interface #define GL_SGIX_igloo_interface 1 -typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const void *params); +typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum pname, const void *params); +GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum pname, const GLvoid *params); #endif #endif /* GL_SGIX_igloo_interface */ @@ -11407,19 +10788,19 @@ GLAPI void APIENTRY glTagSampleBufferSGIX (void); #define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD #define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE #define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF -typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); +typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, void *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); #ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTableSGI (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); +GLAPI void APIENTRY glColorTableSGI (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum target, GLenum pname, const GLfloat *params); GLAPI void APIENTRY glColorTableParameterivSGI (GLenum target, GLenum pname, const GLint *params); GLAPI void APIENTRY glCopyColorTableSGI (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -GLAPI void APIENTRY glGetColorTableSGI (GLenum target, GLenum format, GLenum type, void *table); +GLAPI void APIENTRY glGetColorTableSGI (GLenum target, GLenum format, GLenum type, GLvoid *table); GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum target, GLenum pname, GLfloat *params); GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum target, GLenum pname, GLint *params); #endif @@ -11510,7 +10891,7 @@ typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const void **pointer); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid **pointer); #ifdef GL_GLEXT_PROTOTYPES GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint code); GLAPI void APIENTRY glReplacementCodeusSUN (GLushort code); @@ -11518,7 +10899,7 @@ GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte code); GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *code); GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *code); GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *code); -GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum type, GLsizei stride, const void **pointer); +GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum type, GLsizei stride, const GLvoid **pointer); #endif #endif /* GL_SUN_triangle_list */ diff --git a/extern/glfw/deps/GL/glxext.h b/extern/glfw/deps/GL/glxext.h index 174fc21..992e065 100644 --- a/extern/glfw/deps/GL/glxext.h +++ b/extern/glfw/deps/GL/glxext.h @@ -6,7 +6,7 @@ extern "C" { #endif /* -** Copyright (c) 2013-2014 The Khronos Group Inc. +** Copyright (c) 2013 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 @@ -33,10 +33,10 @@ extern "C" { ** used to make the header, and the header can be found at ** http://www.opengl.org/registry/ ** -** Khronos $Revision: 27684 $ on $Date: 2014-08-11 01:21:35 -0700 (Mon, 11 Aug 2014) $ +** Khronos $Revision$ on $Date$ */ -#define GLX_GLXEXT_VERSION 20140810 +#define GLX_GLXEXT_VERSION 20130710 /* Generated C header for: * API: glx @@ -49,7 +49,6 @@ extern "C" { #ifndef GLX_VERSION_1_3 #define GLX_VERSION_1_3 1 -typedef XID GLXContextID; typedef struct __GLXFBConfigRec *GLXFBConfig; typedef XID GLXWindow; typedef XID GLXPbuffer; @@ -158,13 +157,6 @@ __GLXextFuncPtr glXGetProcAddress (const GLubyte *procName); #endif #endif /* GLX_VERSION_1_4 */ -#ifndef GLX_ARB_context_flush_control -#define GLX_ARB_context_flush_control 1 -#define GLX_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097 -#define GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0 -#define GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098 -#endif /* GLX_ARB_context_flush_control */ - #ifndef GLX_ARB_create_context #define GLX_ARB_create_context 1 #define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001 @@ -280,6 +272,7 @@ __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *procName); #ifndef GLX_EXT_import_context #define GLX_EXT_import_context 1 +typedef XID GLXContextID; #define GLX_SHARE_CONTEXT_EXT 0x800A #define GLX_VISUAL_ID_EXT 0x800B #define GLX_SCREEN_EXT 0x800C @@ -297,23 +290,6 @@ void glXFreeContextEXT (Display *dpy, GLXContext context); #endif #endif /* GLX_EXT_import_context */ -#ifndef GLX_EXT_stereo_tree -#define GLX_EXT_stereo_tree 1 -typedef struct { - int type; - unsigned long serial; - Bool send_event; - Display *display; - int extension; - int evtype; - GLXDrawable window; - Bool stereo_tree; -} GLXStereoNotifyEventEXT; -#define GLX_STEREO_TREE_EXT 0x20F5 -#define GLX_STEREO_NOTIFY_MASK_EXT 0x00000001 -#define GLX_STEREO_NOTIFY_EXT 0x00000000 -#endif /* GLX_EXT_stereo_tree */ - #ifndef GLX_EXT_swap_control #define GLX_EXT_swap_control 1 #define GLX_SWAP_INTERVAL_EXT 0x20F1 @@ -431,32 +407,6 @@ GLXPixmap glXCreateGLXPixmapMESA (Display *dpy, XVisualInfo *visual, Pixmap pixm #endif #endif /* GLX_MESA_pixmap_colormap */ -#ifndef GLX_MESA_query_renderer -#define GLX_MESA_query_renderer 1 -#define GLX_RENDERER_VENDOR_ID_MESA 0x8183 -#define GLX_RENDERER_DEVICE_ID_MESA 0x8184 -#define GLX_RENDERER_VERSION_MESA 0x8185 -#define GLX_RENDERER_ACCELERATED_MESA 0x8186 -#define GLX_RENDERER_VIDEO_MEMORY_MESA 0x8187 -#define GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA 0x8188 -#define GLX_RENDERER_PREFERRED_PROFILE_MESA 0x8189 -#define GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA 0x818A -#define GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA 0x818B -#define GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA 0x818C -#define GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA 0x818D -#define GLX_RENDERER_ID_MESA 0x818E -typedef Bool ( *PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC) (int attribute, unsigned int *value); -typedef const char *( *PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC) (int attribute); -typedef Bool ( *PFNGLXQUERYRENDERERINTEGERMESAPROC) (Display *dpy, int screen, int renderer, int attribute, unsigned int *value); -typedef const char *( *PFNGLXQUERYRENDERERSTRINGMESAPROC) (Display *dpy, int screen, int renderer, int attribute); -#ifdef GLX_GLXEXT_PROTOTYPES -Bool glXQueryCurrentRendererIntegerMESA (int attribute, unsigned int *value); -const char *glXQueryCurrentRendererStringMESA (int attribute); -Bool glXQueryRendererIntegerMESA (Display *dpy, int screen, int renderer, int attribute, unsigned int *value); -const char *glXQueryRendererStringMESA (Display *dpy, int screen, int renderer, int attribute); -#endif -#endif /* GLX_MESA_query_renderer */ - #ifndef GLX_MESA_release_buffers #define GLX_MESA_release_buffers 1 typedef Bool ( *PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawable); @@ -475,16 +425,6 @@ Bool glXSet3DfxModeMESA (int mode); #endif #endif /* GLX_MESA_set_3dfx_mode */ -#ifndef GLX_NV_copy_buffer -#define GLX_NV_copy_buffer 1 -typedef void ( *PFNGLXCOPYBUFFERSUBDATANVPROC) (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -typedef void ( *PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC) (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -#ifdef GLX_GLXEXT_PROTOTYPES -void glXCopyBufferSubDataNV (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -void glXNamedCopyBufferSubDataNV (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -#endif -#endif /* GLX_NV_copy_buffer */ - #ifndef GLX_NV_copy_image #define GLX_NV_copy_image 1 typedef void ( *PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); @@ -493,14 +433,6 @@ void glXCopyImageSubDataNV (Display *dpy, GLXContext srcCtx, GLuint srcName, GLe #endif #endif /* GLX_NV_copy_image */ -#ifndef GLX_NV_delay_before_swap -#define GLX_NV_delay_before_swap 1 -typedef Bool ( *PFNGLXDELAYBEFORESWAPNVPROC) (Display *dpy, GLXDrawable drawable, GLfloat seconds); -#ifdef GLX_GLXEXT_PROTOTYPES -Bool glXDelayBeforeSwapNV (Display *dpy, GLXDrawable drawable, GLfloat seconds); -#endif -#endif /* GLX_NV_delay_before_swap */ - #ifndef GLX_NV_float_buffer #define GLX_NV_float_buffer 1 #define GLX_FLOAT_COMPONENTS_NV 0x20B0 @@ -561,8 +493,8 @@ void glXReleaseVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV devic #endif #endif /* GLX_NV_video_capture */ -#ifndef GLX_NV_video_out -#define GLX_NV_video_out 1 +#ifndef GLX_NV_video_output +#define GLX_NV_video_output 1 typedef unsigned int GLXVideoDeviceNV; #define GLX_VIDEO_OUT_COLOR_NV 0x20C3 #define GLX_VIDEO_OUT_ALPHA_NV 0x20C4 @@ -588,7 +520,7 @@ int glXReleaseVideoImageNV (Display *dpy, GLXPbuffer pbuf); int glXSendPbufferToVideoNV (Display *dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock); int glXGetVideoInfoNV (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); #endif -#endif /* GLX_NV_video_out */ +#endif /* GLX_NV_video_output */ #ifndef GLX_OML_swap_method #define GLX_OML_swap_method 1 diff --git a/extern/glfw/deps/GL/wglext.h b/extern/glfw/deps/GL/wglext.h index daba410..c235685 100644 --- a/extern/glfw/deps/GL/wglext.h +++ b/extern/glfw/deps/GL/wglext.h @@ -6,7 +6,7 @@ extern "C" { #endif /* -** Copyright (c) 2013-2014 The Khronos Group Inc. +** Copyright (c) 2013 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 @@ -33,7 +33,7 @@ extern "C" { ** used to make the header, and the header can be found at ** http://www.opengl.org/registry/ ** -** Khronos $Revision: 27684 $ on $Date: 2014-08-11 01:21:35 -0700 (Mon, 11 Aug 2014) $ +** Khronos $Revision$ on $Date$ */ #if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) @@ -41,7 +41,7 @@ extern "C" { #include #endif -#define WGL_WGLEXT_VERSION 20140810 +#define WGL_WGLEXT_VERSION 20130710 /* Generated C header for: * API: wgl @@ -70,13 +70,6 @@ BOOL WINAPI wglRestoreBufferRegionARB (HANDLE hRegion, int x, int y, int width, #endif #endif /* WGL_ARB_buffer_region */ -#ifndef WGL_ARB_context_flush_control -#define WGL_ARB_context_flush_control 1 -#define WGL_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097 -#define WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0 -#define WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098 -#endif /* WGL_ARB_context_flush_control */ - #ifndef WGL_ARB_create_context #define WGL_ARB_create_context 1 #define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001 @@ -652,14 +645,6 @@ BOOL WINAPI wglCopyImageSubDataNV (HGLRC hSrcRC, GLuint srcName, GLenum srcTarge #endif #endif /* WGL_NV_copy_image */ -#ifndef WGL_NV_delay_before_swap -#define WGL_NV_delay_before_swap 1 -typedef BOOL (WINAPI * PFNWGLDELAYBEFORESWAPNVPROC) (HDC hDC, GLfloat seconds); -#ifdef WGL_WGLEXT_PROTOTYPES -BOOL WINAPI wglDelayBeforeSwapNV (HDC hDC, GLfloat seconds); -#endif -#endif /* WGL_NV_delay_before_swap */ - #ifndef WGL_NV_float_buffer #define WGL_NV_float_buffer 1 #define WGL_FLOAT_COMPONENTS_NV 0x20B0 diff --git a/extern/glfw/deps/KHR/khrplatform.h b/extern/glfw/deps/KHR/khrplatform.h deleted file mode 100644 index c9e6f17..0000000 --- a/extern/glfw/deps/KHR/khrplatform.h +++ /dev/null @@ -1,282 +0,0 @@ -#ifndef __khrplatform_h_ -#define __khrplatform_h_ - -/* -** Copyright (c) 2008-2009 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. - * - * $Revision: 23298 $ on $Date: 2013-09-30 17:07:13 -0700 (Mon, 30 Sep 2013) $ - * - * 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 sending them to the public Khronos Bugzilla - * (http://khronos.org/bugzilla) by filing a bug against product - * "Khronos (general)" component "Registry". - * - * A predefined template which fills in some of the bug fields can be - * reached using http://tinyurl.com/khrplatform-h-bugreport, but you - * must create a Bugzilla login first. - * - * - * See the Implementer's Guidelines for information about where this file - * should be located on your system and for more details of its use: - * http://www.khronos.org/registry/implementers_guide.pdf - * - * This file should be included as - * #include - * by Khronos client API header files that use its types and defines. - * - * The types in khrplatform.h should only be used to define API-specific types. - * - * Types defined in khrplatform.h: - * khronos_int8_t signed 8 bit - * khronos_uint8_t unsigned 8 bit - * khronos_int16_t signed 16 bit - * khronos_uint16_t unsigned 16 bit - * khronos_int32_t signed 32 bit - * khronos_uint32_t unsigned 32 bit - * khronos_int64_t signed 64 bit - * khronos_uint64_t unsigned 64 bit - * khronos_intptr_t signed same number of bits as a pointer - * khronos_uintptr_t unsigned same number of bits as a pointer - * khronos_ssize_t signed size - * khronos_usize_t unsigned size - * khronos_float_t signed 32 bit floating point - * khronos_time_ns_t unsigned 64 bit time in nanoseconds - * khronos_utime_nanoseconds_t unsigned time interval or absolute time in - * nanoseconds - * khronos_stime_nanoseconds_t signed time interval in nanoseconds - * khronos_boolean_enum_t enumerated boolean type. This should - * only be used as a base type when a client API's boolean type is - * an enum. Client APIs which use an integer or other type for - * booleans cannot use this as the base type for their boolean. - * - * Tokens defined in khrplatform.h: - * - * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values. - * - * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. - * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. - * - * Calling convention macros defined in this file: - * KHRONOS_APICALL - * KHRONOS_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 -#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 - */ -#include -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(__VMS ) || defined(__sgi) - -/* - * Using - */ -#include -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(_WIN32) && !defined(__SCITECH_SNAP__) - -/* - * Win32 - */ -typedef __int32 khronos_int32_t; -typedef unsigned __int32 khronos_uint32_t; -typedef __int64 khronos_int64_t; -typedef unsigned __int64 khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(__sun__) || defined(__digital__) - -/* - * Sun or Digital - */ -typedef int khronos_int32_t; -typedef unsigned int khronos_uint32_t; -#if defined(__arch64__) || defined(_LP64) -typedef long int khronos_int64_t; -typedef unsigned long int khronos_uint64_t; -#else -typedef long long int khronos_int64_t; -typedef unsigned long long int khronos_uint64_t; -#endif /* __arch64__ */ -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif 0 - -/* - * Hypothetical platform with no float or int64 support - */ -typedef int khronos_int32_t; -typedef unsigned int khronos_uint32_t; -#define KHRONOS_SUPPORT_INT64 0 -#define KHRONOS_SUPPORT_FLOAT 0 - -#else - -/* - * Generic fallback - */ -#include -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#endif - - -/* - * Types that are (so far) the same on all platforms - */ -typedef signed char khronos_int8_t; -typedef unsigned char khronos_uint8_t; -typedef signed short int khronos_int16_t; -typedef unsigned short int khronos_uint16_t; - -/* - * Types that differ between LLP64 and LP64 architectures - in LLP64, - * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears - * to be the only LLP64 architecture in current use. - */ -#ifdef _WIN64 -typedef signed long long int khronos_intptr_t; -typedef unsigned long long int khronos_uintptr_t; -typedef signed long long int khronos_ssize_t; -typedef unsigned long long int khronos_usize_t; -#else -typedef signed long int khronos_intptr_t; -typedef unsigned long int khronos_uintptr_t; -typedef signed long int khronos_ssize_t; -typedef unsigned long int khronos_usize_t; -#endif - -#if KHRONOS_SUPPORT_FLOAT -/* - * Float type - */ -typedef float khronos_float_t; -#endif - -#if KHRONOS_SUPPORT_INT64 -/* Time types - * - * These types can be used to represent a time interval in nanoseconds or - * an absolute Unadjusted System Time. Unadjusted System Time is the number - * of nanoseconds since some arbitrary system event (e.g. since the last - * time the system booted). The Unadjusted System Time is an unsigned - * 64 bit value that wraps back to 0 every 584 years. Time intervals - * may be either signed or unsigned. - */ -typedef khronos_uint64_t khronos_utime_nanoseconds_t; -typedef khronos_int64_t khronos_stime_nanoseconds_t; -#endif - -/* - * Dummy value used to pad enum types to 32 bits. - */ -#ifndef KHRONOS_MAX_ENUM -#define KHRONOS_MAX_ENUM 0x7FFFFFFF -#endif - -/* - * Enumerated boolean type - * - * Values other than zero should be considered to be true. Therefore - * comparisons should not be made against KHRONOS_TRUE. - */ -typedef enum { - KHRONOS_FALSE = 0, - KHRONOS_TRUE = 1, - KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM -} khronos_boolean_enum_t; - -#endif /* __khrplatform_h_ */ diff --git a/extern/glfw/deps/getopt.c b/extern/glfw/deps/getopt.c index 9743046..7b3decd 100644 --- a/extern/glfw/deps/getopt.c +++ b/extern/glfw/deps/getopt.c @@ -1,230 +1,267 @@ -/* 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. - */ +/***************************************************************************** +* getopt.c - competent and free getopt library. +* $Header: /cvsroot/freegetopt/freegetopt/getopt.c,v 1.2 2003/10/26 03:10:20 vindaci Exp $ +* +* Copyright (c)2002-2003 Mark K. Kim +* 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 original author of this software nor the names of its +* 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 THE +* COPYRIGHT OWNER OR CONTRIBUTORS 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 _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS +#endif +#include +#include +#include #include "getopt.h" -#include -#include +/* 2013-01-06 Camilla Berglund + * + * Only define _CRT_SECURE_NO_WARNINGS if not already defined. + */ +/* 2012-08-12 Lambert Clara + * + * Constify third argument of getopt. + */ +/* 2011-07-27 Camilla Berglund + * + * Added _CRT_SECURE_NO_WARNINGS macro. + */ +/* 2009-10-12 Camilla Berglund + * + * Removed unused global static variable 'ID'. + */ -const int no_argument = 0; -const int required_argument = 1; -const int optional_argument = 2; +char* optarg = NULL; +int optind = 0; +int opterr = 1; +int optopt = '?'; -char* optarg; -int optopt; -/* The variable optind [...] shall be initialized to 1 by the system. */ -int optind = 1; -int opterr; -static char* optcursor = NULL; +static char** prev_argv = NULL; /* Keep a copy of argv and argc to */ +static int prev_argc = 0; /* tell if getopt params change */ +static int argv_index = 0; /* Option we're checking */ +static int argv_index2 = 0; /* Option argument we're checking */ +static int opt_offset = 0; /* Index into compounded "-option" */ +static int dashdash = 0; /* True if "--" option reached */ +static int nonopt = 0; /* How many nonopts we've found */ -/* 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; +static void increment_index() +{ + /* Move onto the next option */ + if(argv_index < argv_index2) + { + while(prev_argv[++argv_index] && prev_argv[argv_index][0] != '-' + && argv_index < argv_index2+1); + } + else argv_index++; + opt_offset = 1; } -/* Implementation based on [1]. -[1] http://www.kernel.org/doc/man-pages/online/pages/man3/getopt.3.html +/* +* Permutes argv[] so that the argument currently being processed is moved +* to the end. */ -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; +static int permute_argv_once() +{ + /* Movability check */ + if(argv_index + nonopt >= prev_argc) return 1; + /* Move the current option to the end, bring the others to front */ + else + { + char* tmp = prev_argv[argv_index]; - optarg = NULL; - optopt = 0; + /* Move the data */ + memmove(&prev_argv[argv_index], &prev_argv[argv_index+1], + sizeof(char**) * (prev_argc - argv_index - 1)); + prev_argv[prev_argc - 1] = tmp; - 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; + nonopt++; + return 0; + } } + + +int getopt(int argc, char** argv, const char* optstr) +{ + int c = 0; + + /* If we have new argv, reinitialize */ + if(prev_argv != argv || prev_argc != argc) + { + /* Initialize variables */ + prev_argv = argv; + prev_argc = argc; + argv_index = 1; + argv_index2 = 1; + opt_offset = 1; + dashdash = 0; + nonopt = 0; + } + + /* Jump point in case we want to ignore the current argv_index */ + getopt_top: + + /* Misc. initializations */ + optarg = NULL; + + /* Dash-dash check */ + if(argv[argv_index] && !strcmp(argv[argv_index], "--")) + { + dashdash = 1; + increment_index(); + } + + /* If we're at the end of argv, that's it. */ + if(argv[argv_index] == NULL) + { + c = -1; + } + /* Are we looking at a string? Single dash is also a string */ + else if(dashdash || argv[argv_index][0] != '-' || !strcmp(argv[argv_index], "-")) + { + /* If we want a string... */ + if(optstr[0] == '-') + { + c = 1; + optarg = argv[argv_index]; + increment_index(); + } + /* If we really don't want it (we're in POSIX mode), we're done */ + else if(optstr[0] == '+' || getenv("POSIXLY_CORRECT")) + { + c = -1; + + /* Everything else is a non-opt argument */ + nonopt = argc - argv_index; + } + /* If we mildly don't want it, then move it back */ + else + { + if(!permute_argv_once()) goto getopt_top; + else c = -1; + } + } + /* Otherwise we're looking at an option */ + else + { + char* opt_ptr = NULL; + + /* Grab the option */ + c = argv[argv_index][opt_offset++]; + + /* Is the option in the optstr? */ + if(optstr[0] == '-') opt_ptr = strchr(optstr+1, c); + else opt_ptr = strchr(optstr, c); + /* Invalid argument */ + if(!opt_ptr) + { + if(opterr) + { + fprintf(stderr, "%s: invalid option -- %c\n", argv[0], c); + } + + optopt = c; + c = '?'; + + /* Move onto the next option */ + increment_index(); + } + /* Option takes argument */ + else if(opt_ptr[1] == ':') + { + /* ie, -oARGUMENT, -xxxoARGUMENT, etc. */ + if(argv[argv_index][opt_offset] != '\0') + { + optarg = &argv[argv_index][opt_offset]; + increment_index(); + } + /* ie, -o ARGUMENT (only if it's a required argument) */ + else if(opt_ptr[2] != ':') + { + /* One of those "you're not expected to understand this" moment */ + if(argv_index2 < argv_index) argv_index2 = argv_index; + while(argv[++argv_index2] && argv[argv_index2][0] == '-'); + optarg = argv[argv_index2]; + + /* Don't cross into the non-option argument list */ + if(argv_index2 + nonopt >= prev_argc) optarg = NULL; + + /* Move onto the next option */ + increment_index(); + } + else + { + /* Move onto the next option */ + increment_index(); + } + + /* In case we got no argument for an option with required argument */ + if(optarg == NULL && opt_ptr[2] != ':') + { + optopt = c; + c = '?'; + + if(opterr) + { + fprintf(stderr,"%s: option requires an argument -- %c\n", + argv[0], optopt); + } + } + } + /* Option does not take argument */ + else + { + /* Next argv_index */ + if(argv[argv_index][opt_offset] == '\0') + { + increment_index(); + } + } + } + + /* Calculate optind */ + if(c == -1) + { + optind = argc - nonopt; + } + else + { + optind = argv_index; + } + + return c; +} + + +/* vim:ts=3 +*/ diff --git a/extern/glfw/deps/getopt.h b/extern/glfw/deps/getopt.h index e1eb540..6d2e4af 100644 --- a/extern/glfw/deps/getopt.h +++ b/extern/glfw/deps/getopt.h @@ -1,57 +1,63 @@ -/* 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. - */ +/***************************************************************************** +* getopt.h - competent and free getopt library. +* $Header: /cvsroot/freegetopt/freegetopt/getopt.h,v 1.2 2003/10/26 03:10:20 vindaci Exp $ +* +* Copyright (c)2002-2003 Mark K. Kim +* 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 original author of this software nor the names of its +* 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 THE +* COPYRIGHT OWNER OR CONTRIBUTORS 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 GETOPT_H_ +#define GETOPT_H_ -#ifndef INCLUDED_GETOPT_PORT_H -#define INCLUDED_GETOPT_PORT_H -#if defined(__cplusplus) +#ifdef __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; +extern int optind; +extern int opterr; +extern int optopt; -struct option { - const char* name; - int has_arg; - int* flag; - int val; -}; +int getopt(int argc, char** argv, const char* optstr); -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) +#ifdef __cplusplus } #endif -#endif // INCLUDED_GETOPT_PORT_H + +#endif /* GETOPT_H_ */ + + +/* vim:ts=3 +*/ diff --git a/extern/glfw/deps/glad.c b/extern/glfw/deps/glad.c deleted file mode 100644 index da75d08..0000000 --- a/extern/glfw/deps/glad.c +++ /dev/null @@ -1,728 +0,0 @@ -#include -#include - -struct gladGLversionStruct GLVersion; - -#if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0) -#define _GLAD_IS_SOME_NEW_VERSION 1 -#endif - -int GLAD_GL_VERSION_1_0; -int GLAD_GL_VERSION_1_1; -int GLAD_GL_VERSION_1_2; -int GLAD_GL_VERSION_1_3; -int GLAD_GL_VERSION_1_4; -int GLAD_GL_VERSION_1_5; -int GLAD_GL_VERSION_2_0; -int GLAD_GL_VERSION_2_1; -int GLAD_GL_VERSION_3_0; -int GLAD_GL_VERSION_3_1; -int GLAD_GL_VERSION_3_2; -PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays; -PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback; -PFNGLFLUSHPROC glad_glFlush; -PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D; -PFNGLCLEARCOLORPROC glad_glClearColor; -PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui; -PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex; -PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv; -PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv; -PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate; -PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv; -PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv; -PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation; -PFNGLLINKPROGRAMPROC glad_glLinkProgram; -PFNGLBINDTEXTUREPROC glad_glBindTexture; -PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName; -PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv; -PFNGLFENCESYNCPROC glad_glFenceSync; -PFNGLUNIFORM3UIPROC glad_glUniform3ui; -PFNGLUNIFORM2UIVPROC glad_glUniform2uiv; -PFNGLGETSTRINGPROC glad_glGetString; -PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D; -PFNGLDETACHSHADERPROC glad_glDetachShader; -PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv; -PFNGLGENBUFFERSPROC glad_glGenBuffers; -PFNGLENDQUERYPROC glad_glEndQuery; -PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv; -PFNGLLINEWIDTHPROC glad_glLineWidth; -PFNGLUNIFORM2FVPROC glad_glUniform2fv; -PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced; -PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v; -PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation; -PFNGLCOMPILESHADERPROC glad_glCompileShader; -PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying; -PFNGLDELETETEXTURESPROC glad_glDeleteTextures; -PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate; -PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv; -PFNGLPOLYGONMODEPROC glad_glPolygonMode; -PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange; -PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f; -PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers; -PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d; -PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f; -PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v; -PFNGLISSYNCPROC glad_glIsSync; -PFNGLCLAMPCOLORPROC glad_glClampColor; -PFNGLUNIFORM4IVPROC glad_glUniform4iv; -PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv; -PFNGLCLEARSTENCILPROC glad_glClearStencil; -PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture; -PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv; -PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s; -PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex; -PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv; -PFNGLENABLEIPROC glad_glEnablei; -PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage; -PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv; -PFNGLGENTEXTURESPROC glad_glGenTextures; -PFNGLDEPTHFUNCPROC glad_glDepthFunc; -PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D; -PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv; -PFNGLUNIFORM1FPROC glad_glUniform1f; -PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv; -PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv; -PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv; -PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv; -PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage; -PFNGLISVERTEXARRAYPROC glad_glIsVertexArray; -PFNGLCREATESHADERPROC glad_glCreateShader; -PFNGLISBUFFERPROC glad_glIsBuffer; -PFNGLUNIFORM1IPROC glad_glUniform1i; -PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s; -PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib; -PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D; -PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv; -PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D; -PFNGLDISABLEPROC glad_glDisable; -PFNGLUNIFORM2IPROC glad_glUniform2i; -PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate; -PFNGLLOGICOPPROC glad_glLogicOp; -PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv; -PFNGLGETPROGRAMIVPROC glad_glGetProgramiv; -PFNGLCOLORMASKPROC glad_glColorMask; -PFNGLHINTPROC glad_glHint; -PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s; -PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer; -PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv; -PFNGLBLENDEQUATIONPROC glad_glBlendEquation; -PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation; -PFNGLSAMPLEMASKIPROC glad_glSampleMaski; -PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer; -PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback; -PFNGLCULLFACEPROC glad_glCullFace; -PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv; -PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv; -PFNGLUNIFORM4FVPROC glad_glUniform4fv; -PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv; -PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers; -PFNGLUNIFORM1UIVPROC glad_glUniform1uiv; -PFNGLPOINTSIZEPROC glad_glPointSize; -PFNGLGETSTRINGIPROC glad_glGetStringi; -PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv; -PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv; -PFNGLDELETEPROGRAMPROC glad_glDeleteProgram; -PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv; -PFNGLGENQUERIESPROC glad_glGenQueries; -PFNGLWAITSYNCPROC glad_glWaitSync; -PFNGLATTACHSHADERPROC glad_glAttachShader; -PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer; -PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage; -PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv; -PFNGLUNIFORM3IPROC glad_glUniform3i; -PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D; -PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D; -PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex; -PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus; -PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D; -PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v; -PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex; -PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv; -PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D; -PFNGLUNIFORM3FPROC glad_glUniform3f; -PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv; -PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv; -PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv; -PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender; -PFNGLDRAWELEMENTSPROC glad_glDrawElements; -PFNGLCOLORMASKIPROC glad_glColorMaski; -PFNGLISENABLEDIPROC glad_glIsEnabledi; -PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv; -PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements; -PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv; -PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays; -PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase; -PFNGLBUFFERSUBDATAPROC glad_glBufferSubData; -PFNGLUNIFORM1IVPROC glad_glUniform1iv; -PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv; -PFNGLUNIFORM4UIVPROC glad_glUniform4uiv; -PFNGLREADBUFFERPROC glad_glReadBuffer; -PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData; -PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray; -PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync; -PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender; -PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv; -PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui; -PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap; -PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays; -PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D; -PFNGLGETSHADERIVPROC glad_glGetShaderiv; -PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv; -PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv; -PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f; -PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv; -PFNGLPOINTPARAMETERIPROC glad_glPointParameteri; -PFNGLBLENDCOLORPROC glad_glBlendColor; -PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray; -PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer; -PFNGLDEPTHMASKPROC glad_glDepthMask; -PFNGLPOINTPARAMETERFPROC glad_glPointParameterf; -PFNGLDISABLEIPROC glad_glDisablei; -PFNGLGETDOUBLEVPROC glad_glGetDoublev; -PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv; -PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv; -PFNGLSHADERSOURCEPROC glad_glShaderSource; -PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer; -PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D; -PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv; -PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv; -PFNGLDRAWARRAYSPROC glad_glDrawArrays; -PFNGLUNIFORM1UIPROC glad_glUniform1ui; -PFNGLISPROGRAMPROC glad_glIsProgram; -PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv; -PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation; -PFNGLGETSYNCIVPROC glad_glGetSynciv; -PFNGLGETUNIFORMIVPROC glad_glGetUniformiv; -PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i; -PFNGLUNIFORM4IPROC glad_glUniform4i; -PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d; -PFNGLCLEARPROC glad_glClear; -PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv; -PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName; -PFNGLUNIFORM2FPROC glad_glUniform2f; -PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample; -PFNGLACTIVETEXTUREPROC glad_glActiveTexture; -PFNGLBEGINQUERYPROC glad_glBeginQuery; -PFNGLUNIFORM2IVPROC glad_glUniform2iv; -PFNGLBINDBUFFERPROC glad_glBindBuffer; -PFNGLISENABLEDPROC glad_glIsEnabled; -PFNGLSTENCILOPPROC glad_glStencilOp; -PFNGLREADPIXELSPROC glad_glReadPixels; -PFNGLCLEARDEPTHPROC glad_glClearDepth; -PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv; -PFNGLUNIFORM4FPROC glad_glUniform4f; -PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D; -PFNGLMAPBUFFERPROC glad_glMapBuffer; -PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d; -PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub; -PFNGLUNIFORM3FVPROC glad_glUniform3fv; -PFNGLGETUNIFORMFVPROC glad_glGetUniformfv; -PFNGLBUFFERDATAPROC glad_glBufferData; -PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv; -PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D; -PFNGLTEXIMAGE1DPROC glad_glTexImage1D; -PFNGLDELETESYNCPROC glad_glDeleteSync; -PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D; -PFNGLGETERRORPROC glad_glGetError; -PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers; -PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv; -PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv; -PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements; -PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv; -PFNGLGETFLOATVPROC glad_glGetFloatv; -PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D; -PFNGLUNIFORM3IVPROC glad_glUniform3iv; -PFNGLGETTEXIMAGEPROC glad_glGetTexImage; -PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv; -PFNGLUSEPROGRAMPROC glad_glUseProgram; -PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv; -PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv; -PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i; -PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers; -PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer; -PFNGLDRAWBUFFERSPROC glad_glDrawBuffers; -PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv; -PFNGLSTENCILFUNCPROC glad_glStencilFunc; -PFNGLGETINTEGERVPROC glad_glGetIntegerv; -PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders; -PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding; -PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer; -PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv; -PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv; -PFNGLDRAWBUFFERPROC glad_glDrawBuffer; -PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D; -PFNGLUNIFORM1FVPROC glad_glUniform1fv; -PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample; -PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange; -PFNGLISQUERYPROC glad_glIsQuery; -PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv; -PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv; -PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray; -PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv; -PFNGLGETQUERYIVPROC glad_glGetQueryiv; -PFNGLTEXIMAGE2DPROC glad_glTexImage2D; -PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog; -PFNGLSTENCILMASKPROC glad_glStencilMask; -PFNGLUNIFORM4UIPROC glad_glUniform4ui; -PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv; -PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog; -PFNGLISTEXTUREPROC glad_glIsTexture; -PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices; -PFNGLISSHADERPROC glad_glIsShader; -PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource; -PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv; -PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv; -PFNGLGETINTEGER64VPROC glad_glGetInteger64v; -PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer; -PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv; -PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData; -PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv; -PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv; -PFNGLENABLEPROC glad_glEnable; -PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv; -PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced; -PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i; -PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate; -PFNGLDELETEQUERIESPROC glad_glDeleteQueries; -PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv; -PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate; -PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui; -PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D; -PFNGLFINISHPROC glad_glFinish; -PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation; -PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv; -PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv; -PFNGLDELETESHADERPROC glad_glDeleteShader; -PFNGLBLENDFUNCPROC glad_glBlendFunc; -PFNGLCREATEPROGRAMPROC glad_glCreateProgram; -PFNGLTEXIMAGE3DPROC glad_glTexImage3D; -PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv; -PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer; -PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui; -PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange; -PFNGLVIEWPORTPROC glad_glViewport; -PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv; -PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d; -PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings; -PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f; -PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv; -PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex; -PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex; -PFNGLUNIFORM2UIPROC glad_glUniform2ui; -PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset; -PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv; -PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i; -PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s; -PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample; -PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv; -PFNGLDEPTHRANGEPROC glad_glDepthRange; -PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform; -PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv; -PFNGLTEXPARAMETERFPROC glad_glTexParameterf; -PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi; -PFNGLTEXPARAMETERIPROC glad_glTexParameteri; -PFNGLFRONTFACEPROC glad_glFrontFace; -PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers; -PFNGLSCISSORPROC glad_glScissor; -PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex; -PFNGLGETBOOLEANVPROC glad_glGetBooleanv; -PFNGLTEXBUFFERPROC glad_glTexBuffer; -PFNGLPIXELSTOREIPROC glad_glPixelStorei; -PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram; -PFNGLPIXELSTOREFPROC glad_glPixelStoref; -PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv; -PFNGLUNIFORM3UIVPROC glad_glUniform3uiv; -PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v; -PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer; -static void load_GL_VERSION_1_0(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_0) return; - glad_glCullFace = (PFNGLCULLFACEPROC)load("glCullFace"); - glad_glFrontFace = (PFNGLFRONTFACEPROC)load("glFrontFace"); - glad_glHint = (PFNGLHINTPROC)load("glHint"); - glad_glLineWidth = (PFNGLLINEWIDTHPROC)load("glLineWidth"); - glad_glPointSize = (PFNGLPOINTSIZEPROC)load("glPointSize"); - glad_glPolygonMode = (PFNGLPOLYGONMODEPROC)load("glPolygonMode"); - glad_glScissor = (PFNGLSCISSORPROC)load("glScissor"); - glad_glTexParameterf = (PFNGLTEXPARAMETERFPROC)load("glTexParameterf"); - glad_glTexParameterfv = (PFNGLTEXPARAMETERFVPROC)load("glTexParameterfv"); - glad_glTexParameteri = (PFNGLTEXPARAMETERIPROC)load("glTexParameteri"); - glad_glTexParameteriv = (PFNGLTEXPARAMETERIVPROC)load("glTexParameteriv"); - glad_glTexImage1D = (PFNGLTEXIMAGE1DPROC)load("glTexImage1D"); - glad_glTexImage2D = (PFNGLTEXIMAGE2DPROC)load("glTexImage2D"); - glad_glDrawBuffer = (PFNGLDRAWBUFFERPROC)load("glDrawBuffer"); - glad_glClear = (PFNGLCLEARPROC)load("glClear"); - glad_glClearColor = (PFNGLCLEARCOLORPROC)load("glClearColor"); - glad_glClearStencil = (PFNGLCLEARSTENCILPROC)load("glClearStencil"); - glad_glClearDepth = (PFNGLCLEARDEPTHPROC)load("glClearDepth"); - glad_glStencilMask = (PFNGLSTENCILMASKPROC)load("glStencilMask"); - glad_glColorMask = (PFNGLCOLORMASKPROC)load("glColorMask"); - glad_glDepthMask = (PFNGLDEPTHMASKPROC)load("glDepthMask"); - glad_glDisable = (PFNGLDISABLEPROC)load("glDisable"); - glad_glEnable = (PFNGLENABLEPROC)load("glEnable"); - glad_glFinish = (PFNGLFINISHPROC)load("glFinish"); - glad_glFlush = (PFNGLFLUSHPROC)load("glFlush"); - glad_glBlendFunc = (PFNGLBLENDFUNCPROC)load("glBlendFunc"); - glad_glLogicOp = (PFNGLLOGICOPPROC)load("glLogicOp"); - glad_glStencilFunc = (PFNGLSTENCILFUNCPROC)load("glStencilFunc"); - glad_glStencilOp = (PFNGLSTENCILOPPROC)load("glStencilOp"); - glad_glDepthFunc = (PFNGLDEPTHFUNCPROC)load("glDepthFunc"); - glad_glPixelStoref = (PFNGLPIXELSTOREFPROC)load("glPixelStoref"); - glad_glPixelStorei = (PFNGLPIXELSTOREIPROC)load("glPixelStorei"); - glad_glReadBuffer = (PFNGLREADBUFFERPROC)load("glReadBuffer"); - glad_glReadPixels = (PFNGLREADPIXELSPROC)load("glReadPixels"); - glad_glGetBooleanv = (PFNGLGETBOOLEANVPROC)load("glGetBooleanv"); - glad_glGetDoublev = (PFNGLGETDOUBLEVPROC)load("glGetDoublev"); - glad_glGetError = (PFNGLGETERRORPROC)load("glGetError"); - glad_glGetFloatv = (PFNGLGETFLOATVPROC)load("glGetFloatv"); - glad_glGetIntegerv = (PFNGLGETINTEGERVPROC)load("glGetIntegerv"); - glad_glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); - glad_glGetTexImage = (PFNGLGETTEXIMAGEPROC)load("glGetTexImage"); - glad_glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC)load("glGetTexParameterfv"); - glad_glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC)load("glGetTexParameteriv"); - glad_glGetTexLevelParameterfv = (PFNGLGETTEXLEVELPARAMETERFVPROC)load("glGetTexLevelParameterfv"); - glad_glGetTexLevelParameteriv = (PFNGLGETTEXLEVELPARAMETERIVPROC)load("glGetTexLevelParameteriv"); - glad_glIsEnabled = (PFNGLISENABLEDPROC)load("glIsEnabled"); - glad_glDepthRange = (PFNGLDEPTHRANGEPROC)load("glDepthRange"); - glad_glViewport = (PFNGLVIEWPORTPROC)load("glViewport"); -} -static void load_GL_VERSION_1_1(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_1) return; - glad_glDrawArrays = (PFNGLDRAWARRAYSPROC)load("glDrawArrays"); - glad_glDrawElements = (PFNGLDRAWELEMENTSPROC)load("glDrawElements"); - glad_glPolygonOffset = (PFNGLPOLYGONOFFSETPROC)load("glPolygonOffset"); - glad_glCopyTexImage1D = (PFNGLCOPYTEXIMAGE1DPROC)load("glCopyTexImage1D"); - glad_glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC)load("glCopyTexImage2D"); - glad_glCopyTexSubImage1D = (PFNGLCOPYTEXSUBIMAGE1DPROC)load("glCopyTexSubImage1D"); - glad_glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC)load("glCopyTexSubImage2D"); - glad_glTexSubImage1D = (PFNGLTEXSUBIMAGE1DPROC)load("glTexSubImage1D"); - glad_glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC)load("glTexSubImage2D"); - glad_glBindTexture = (PFNGLBINDTEXTUREPROC)load("glBindTexture"); - glad_glDeleteTextures = (PFNGLDELETETEXTURESPROC)load("glDeleteTextures"); - glad_glGenTextures = (PFNGLGENTEXTURESPROC)load("glGenTextures"); - glad_glIsTexture = (PFNGLISTEXTUREPROC)load("glIsTexture"); -} -static void load_GL_VERSION_1_2(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_2) return; - glad_glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)load("glDrawRangeElements"); - glad_glTexImage3D = (PFNGLTEXIMAGE3DPROC)load("glTexImage3D"); - glad_glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)load("glTexSubImage3D"); - glad_glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)load("glCopyTexSubImage3D"); -} -static void load_GL_VERSION_1_3(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_3) return; - glad_glActiveTexture = (PFNGLACTIVETEXTUREPROC)load("glActiveTexture"); - glad_glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)load("glSampleCoverage"); - glad_glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)load("glCompressedTexImage3D"); - glad_glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)load("glCompressedTexImage2D"); - glad_glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)load("glCompressedTexImage1D"); - glad_glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)load("glCompressedTexSubImage3D"); - glad_glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)load("glCompressedTexSubImage2D"); - glad_glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)load("glCompressedTexSubImage1D"); - glad_glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)load("glGetCompressedTexImage"); -} -static void load_GL_VERSION_1_4(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_4) return; - glad_glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)load("glBlendFuncSeparate"); - glad_glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)load("glMultiDrawArrays"); - glad_glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)load("glMultiDrawElements"); - glad_glPointParameterf = (PFNGLPOINTPARAMETERFPROC)load("glPointParameterf"); - glad_glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)load("glPointParameterfv"); - glad_glPointParameteri = (PFNGLPOINTPARAMETERIPROC)load("glPointParameteri"); - glad_glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)load("glPointParameteriv"); - glad_glBlendColor = (PFNGLBLENDCOLORPROC)load("glBlendColor"); - glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC)load("glBlendEquation"); -} -static void load_GL_VERSION_1_5(GLADloadproc load) { - if(!GLAD_GL_VERSION_1_5) return; - glad_glGenQueries = (PFNGLGENQUERIESPROC)load("glGenQueries"); - glad_glDeleteQueries = (PFNGLDELETEQUERIESPROC)load("glDeleteQueries"); - glad_glIsQuery = (PFNGLISQUERYPROC)load("glIsQuery"); - glad_glBeginQuery = (PFNGLBEGINQUERYPROC)load("glBeginQuery"); - glad_glEndQuery = (PFNGLENDQUERYPROC)load("glEndQuery"); - glad_glGetQueryiv = (PFNGLGETQUERYIVPROC)load("glGetQueryiv"); - glad_glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)load("glGetQueryObjectiv"); - glad_glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)load("glGetQueryObjectuiv"); - glad_glBindBuffer = (PFNGLBINDBUFFERPROC)load("glBindBuffer"); - glad_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)load("glDeleteBuffers"); - glad_glGenBuffers = (PFNGLGENBUFFERSPROC)load("glGenBuffers"); - glad_glIsBuffer = (PFNGLISBUFFERPROC)load("glIsBuffer"); - glad_glBufferData = (PFNGLBUFFERDATAPROC)load("glBufferData"); - glad_glBufferSubData = (PFNGLBUFFERSUBDATAPROC)load("glBufferSubData"); - glad_glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)load("glGetBufferSubData"); - glad_glMapBuffer = (PFNGLMAPBUFFERPROC)load("glMapBuffer"); - glad_glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)load("glUnmapBuffer"); - glad_glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)load("glGetBufferParameteriv"); - glad_glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)load("glGetBufferPointerv"); -} -static void load_GL_VERSION_2_0(GLADloadproc load) { - if(!GLAD_GL_VERSION_2_0) return; - glad_glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)load("glBlendEquationSeparate"); - glad_glDrawBuffers = (PFNGLDRAWBUFFERSPROC)load("glDrawBuffers"); - glad_glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)load("glStencilOpSeparate"); - glad_glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)load("glStencilFuncSeparate"); - glad_glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)load("glStencilMaskSeparate"); - glad_glAttachShader = (PFNGLATTACHSHADERPROC)load("glAttachShader"); - glad_glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)load("glBindAttribLocation"); - glad_glCompileShader = (PFNGLCOMPILESHADERPROC)load("glCompileShader"); - glad_glCreateProgram = (PFNGLCREATEPROGRAMPROC)load("glCreateProgram"); - glad_glCreateShader = (PFNGLCREATESHADERPROC)load("glCreateShader"); - glad_glDeleteProgram = (PFNGLDELETEPROGRAMPROC)load("glDeleteProgram"); - glad_glDeleteShader = (PFNGLDELETESHADERPROC)load("glDeleteShader"); - glad_glDetachShader = (PFNGLDETACHSHADERPROC)load("glDetachShader"); - glad_glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)load("glDisableVertexAttribArray"); - glad_glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)load("glEnableVertexAttribArray"); - glad_glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)load("glGetActiveAttrib"); - glad_glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)load("glGetActiveUniform"); - glad_glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)load("glGetAttachedShaders"); - glad_glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)load("glGetAttribLocation"); - glad_glGetProgramiv = (PFNGLGETPROGRAMIVPROC)load("glGetProgramiv"); - glad_glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)load("glGetProgramInfoLog"); - glad_glGetShaderiv = (PFNGLGETSHADERIVPROC)load("glGetShaderiv"); - glad_glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)load("glGetShaderInfoLog"); - glad_glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)load("glGetShaderSource"); - glad_glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)load("glGetUniformLocation"); - glad_glGetUniformfv = (PFNGLGETUNIFORMFVPROC)load("glGetUniformfv"); - glad_glGetUniformiv = (PFNGLGETUNIFORMIVPROC)load("glGetUniformiv"); - glad_glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)load("glGetVertexAttribdv"); - glad_glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)load("glGetVertexAttribfv"); - glad_glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)load("glGetVertexAttribiv"); - glad_glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)load("glGetVertexAttribPointerv"); - glad_glIsProgram = (PFNGLISPROGRAMPROC)load("glIsProgram"); - glad_glIsShader = (PFNGLISSHADERPROC)load("glIsShader"); - glad_glLinkProgram = (PFNGLLINKPROGRAMPROC)load("glLinkProgram"); - glad_glShaderSource = (PFNGLSHADERSOURCEPROC)load("glShaderSource"); - glad_glUseProgram = (PFNGLUSEPROGRAMPROC)load("glUseProgram"); - glad_glUniform1f = (PFNGLUNIFORM1FPROC)load("glUniform1f"); - glad_glUniform2f = (PFNGLUNIFORM2FPROC)load("glUniform2f"); - glad_glUniform3f = (PFNGLUNIFORM3FPROC)load("glUniform3f"); - glad_glUniform4f = (PFNGLUNIFORM4FPROC)load("glUniform4f"); - glad_glUniform1i = (PFNGLUNIFORM1IPROC)load("glUniform1i"); - glad_glUniform2i = (PFNGLUNIFORM2IPROC)load("glUniform2i"); - glad_glUniform3i = (PFNGLUNIFORM3IPROC)load("glUniform3i"); - glad_glUniform4i = (PFNGLUNIFORM4IPROC)load("glUniform4i"); - glad_glUniform1fv = (PFNGLUNIFORM1FVPROC)load("glUniform1fv"); - glad_glUniform2fv = (PFNGLUNIFORM2FVPROC)load("glUniform2fv"); - glad_glUniform3fv = (PFNGLUNIFORM3FVPROC)load("glUniform3fv"); - glad_glUniform4fv = (PFNGLUNIFORM4FVPROC)load("glUniform4fv"); - glad_glUniform1iv = (PFNGLUNIFORM1IVPROC)load("glUniform1iv"); - glad_glUniform2iv = (PFNGLUNIFORM2IVPROC)load("glUniform2iv"); - glad_glUniform3iv = (PFNGLUNIFORM3IVPROC)load("glUniform3iv"); - glad_glUniform4iv = (PFNGLUNIFORM4IVPROC)load("glUniform4iv"); - glad_glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)load("glUniformMatrix2fv"); - glad_glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)load("glUniformMatrix3fv"); - glad_glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)load("glUniformMatrix4fv"); - glad_glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)load("glValidateProgram"); - glad_glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)load("glVertexAttrib1d"); - glad_glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)load("glVertexAttrib1dv"); - glad_glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)load("glVertexAttrib1f"); - glad_glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)load("glVertexAttrib1fv"); - glad_glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)load("glVertexAttrib1s"); - glad_glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)load("glVertexAttrib1sv"); - glad_glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)load("glVertexAttrib2d"); - glad_glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)load("glVertexAttrib2dv"); - glad_glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)load("glVertexAttrib2f"); - glad_glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)load("glVertexAttrib2fv"); - glad_glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)load("glVertexAttrib2s"); - glad_glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)load("glVertexAttrib2sv"); - glad_glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)load("glVertexAttrib3d"); - glad_glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)load("glVertexAttrib3dv"); - glad_glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)load("glVertexAttrib3f"); - glad_glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)load("glVertexAttrib3fv"); - glad_glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)load("glVertexAttrib3s"); - glad_glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)load("glVertexAttrib3sv"); - glad_glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)load("glVertexAttrib4Nbv"); - glad_glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)load("glVertexAttrib4Niv"); - glad_glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)load("glVertexAttrib4Nsv"); - glad_glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)load("glVertexAttrib4Nub"); - glad_glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)load("glVertexAttrib4Nubv"); - glad_glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)load("glVertexAttrib4Nuiv"); - glad_glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)load("glVertexAttrib4Nusv"); - glad_glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)load("glVertexAttrib4bv"); - glad_glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)load("glVertexAttrib4d"); - glad_glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)load("glVertexAttrib4dv"); - glad_glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)load("glVertexAttrib4f"); - glad_glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)load("glVertexAttrib4fv"); - glad_glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)load("glVertexAttrib4iv"); - glad_glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)load("glVertexAttrib4s"); - glad_glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)load("glVertexAttrib4sv"); - glad_glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)load("glVertexAttrib4ubv"); - glad_glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)load("glVertexAttrib4uiv"); - glad_glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)load("glVertexAttrib4usv"); - glad_glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)load("glVertexAttribPointer"); -} -static void load_GL_VERSION_2_1(GLADloadproc load) { - if(!GLAD_GL_VERSION_2_1) return; - glad_glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)load("glUniformMatrix2x3fv"); - glad_glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)load("glUniformMatrix3x2fv"); - glad_glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)load("glUniformMatrix2x4fv"); - glad_glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)load("glUniformMatrix4x2fv"); - glad_glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)load("glUniformMatrix3x4fv"); - glad_glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)load("glUniformMatrix4x3fv"); -} -static void load_GL_VERSION_3_0(GLADloadproc load) { - if(!GLAD_GL_VERSION_3_0) return; - glad_glColorMaski = (PFNGLCOLORMASKIPROC)load("glColorMaski"); - glad_glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)load("glGetBooleani_v"); - glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); - glad_glEnablei = (PFNGLENABLEIPROC)load("glEnablei"); - glad_glDisablei = (PFNGLDISABLEIPROC)load("glDisablei"); - glad_glIsEnabledi = (PFNGLISENABLEDIPROC)load("glIsEnabledi"); - glad_glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)load("glBeginTransformFeedback"); - glad_glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)load("glEndTransformFeedback"); - glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); - glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); - glad_glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)load("glTransformFeedbackVaryings"); - glad_glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)load("glGetTransformFeedbackVarying"); - glad_glClampColor = (PFNGLCLAMPCOLORPROC)load("glClampColor"); - glad_glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)load("glBeginConditionalRender"); - glad_glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)load("glEndConditionalRender"); - glad_glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)load("glVertexAttribIPointer"); - glad_glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)load("glGetVertexAttribIiv"); - glad_glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)load("glGetVertexAttribIuiv"); - glad_glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)load("glVertexAttribI1i"); - glad_glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)load("glVertexAttribI2i"); - glad_glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)load("glVertexAttribI3i"); - glad_glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)load("glVertexAttribI4i"); - glad_glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)load("glVertexAttribI1ui"); - glad_glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)load("glVertexAttribI2ui"); - glad_glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)load("glVertexAttribI3ui"); - glad_glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)load("glVertexAttribI4ui"); - glad_glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)load("glVertexAttribI1iv"); - glad_glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)load("glVertexAttribI2iv"); - glad_glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)load("glVertexAttribI3iv"); - glad_glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)load("glVertexAttribI4iv"); - glad_glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)load("glVertexAttribI1uiv"); - glad_glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)load("glVertexAttribI2uiv"); - glad_glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)load("glVertexAttribI3uiv"); - glad_glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)load("glVertexAttribI4uiv"); - glad_glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)load("glVertexAttribI4bv"); - glad_glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)load("glVertexAttribI4sv"); - glad_glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)load("glVertexAttribI4ubv"); - glad_glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)load("glVertexAttribI4usv"); - glad_glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)load("glGetUniformuiv"); - glad_glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)load("glBindFragDataLocation"); - glad_glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)load("glGetFragDataLocation"); - glad_glUniform1ui = (PFNGLUNIFORM1UIPROC)load("glUniform1ui"); - glad_glUniform2ui = (PFNGLUNIFORM2UIPROC)load("glUniform2ui"); - glad_glUniform3ui = (PFNGLUNIFORM3UIPROC)load("glUniform3ui"); - glad_glUniform4ui = (PFNGLUNIFORM4UIPROC)load("glUniform4ui"); - glad_glUniform1uiv = (PFNGLUNIFORM1UIVPROC)load("glUniform1uiv"); - glad_glUniform2uiv = (PFNGLUNIFORM2UIVPROC)load("glUniform2uiv"); - glad_glUniform3uiv = (PFNGLUNIFORM3UIVPROC)load("glUniform3uiv"); - glad_glUniform4uiv = (PFNGLUNIFORM4UIVPROC)load("glUniform4uiv"); - glad_glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)load("glTexParameterIiv"); - glad_glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)load("glTexParameterIuiv"); - glad_glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)load("glGetTexParameterIiv"); - glad_glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)load("glGetTexParameterIuiv"); - glad_glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)load("glClearBufferiv"); - glad_glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)load("glClearBufferuiv"); - glad_glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)load("glClearBufferfv"); - glad_glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)load("glClearBufferfi"); - glad_glGetStringi = (PFNGLGETSTRINGIPROC)load("glGetStringi"); - glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)load("glIsRenderbuffer"); - glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)load("glBindRenderbuffer"); - glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)load("glDeleteRenderbuffers"); - glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)load("glGenRenderbuffers"); - glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)load("glRenderbufferStorage"); - glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)load("glGetRenderbufferParameteriv"); - glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)load("glIsFramebuffer"); - glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)load("glBindFramebuffer"); - glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)load("glDeleteFramebuffers"); - glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)load("glGenFramebuffers"); - glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)load("glCheckFramebufferStatus"); - glad_glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)load("glFramebufferTexture1D"); - glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)load("glFramebufferTexture2D"); - glad_glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)load("glFramebufferTexture3D"); - glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)load("glFramebufferRenderbuffer"); - glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetFramebufferAttachmentParameteriv"); - glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)load("glGenerateMipmap"); - glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)load("glBlitFramebuffer"); - glad_glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glRenderbufferStorageMultisample"); - glad_glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)load("glFramebufferTextureLayer"); - glad_glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)load("glMapBufferRange"); - glad_glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)load("glFlushMappedBufferRange"); - glad_glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)load("glBindVertexArray"); - glad_glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)load("glDeleteVertexArrays"); - glad_glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)load("glGenVertexArrays"); - glad_glIsVertexArray = (PFNGLISVERTEXARRAYPROC)load("glIsVertexArray"); -} -static void load_GL_VERSION_3_1(GLADloadproc load) { - if(!GLAD_GL_VERSION_3_1) return; - glad_glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)load("glDrawArraysInstanced"); - glad_glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)load("glDrawElementsInstanced"); - glad_glTexBuffer = (PFNGLTEXBUFFERPROC)load("glTexBuffer"); - glad_glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)load("glPrimitiveRestartIndex"); - glad_glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)load("glCopyBufferSubData"); - glad_glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)load("glGetUniformIndices"); - glad_glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)load("glGetActiveUniformsiv"); - glad_glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)load("glGetActiveUniformName"); - glad_glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)load("glGetUniformBlockIndex"); - glad_glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)load("glGetActiveUniformBlockiv"); - glad_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)load("glGetActiveUniformBlockName"); - glad_glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)load("glUniformBlockBinding"); -} -static void load_GL_VERSION_3_2(GLADloadproc load) { - if(!GLAD_GL_VERSION_3_2) return; - glad_glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)load("glDrawElementsBaseVertex"); - glad_glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)load("glDrawRangeElementsBaseVertex"); - glad_glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)load("glDrawElementsInstancedBaseVertex"); - glad_glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)load("glMultiDrawElementsBaseVertex"); - glad_glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)load("glProvokingVertex"); - glad_glFenceSync = (PFNGLFENCESYNCPROC)load("glFenceSync"); - glad_glIsSync = (PFNGLISSYNCPROC)load("glIsSync"); - glad_glDeleteSync = (PFNGLDELETESYNCPROC)load("glDeleteSync"); - glad_glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)load("glClientWaitSync"); - glad_glWaitSync = (PFNGLWAITSYNCPROC)load("glWaitSync"); - glad_glGetInteger64v = (PFNGLGETINTEGER64VPROC)load("glGetInteger64v"); - glad_glGetSynciv = (PFNGLGETSYNCIVPROC)load("glGetSynciv"); - glad_glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)load("glGetInteger64i_v"); - glad_glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)load("glGetBufferParameteri64v"); - glad_glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)load("glFramebufferTexture"); - glad_glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)load("glTexImage2DMultisample"); - glad_glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)load("glTexImage3DMultisample"); - glad_glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)load("glGetMultisamplefv"); - glad_glSampleMaski = (PFNGLSAMPLEMASKIPROC)load("glSampleMaski"); -} -static void find_extensionsGL(void) { -} - -static void find_coreGL(void) { - const char *v = (const char *)glGetString(GL_VERSION); - int major = v[0] - '0'; - int minor = v[2] - '0'; - GLVersion.major = major; GLVersion.minor = minor; - GLAD_GL_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1; - GLAD_GL_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1; - GLAD_GL_VERSION_1_2 = (major == 1 && minor >= 2) || major > 1; - GLAD_GL_VERSION_1_3 = (major == 1 && minor >= 3) || major > 1; - GLAD_GL_VERSION_1_4 = (major == 1 && minor >= 4) || major > 1; - GLAD_GL_VERSION_1_5 = (major == 1 && minor >= 5) || major > 1; - GLAD_GL_VERSION_2_0 = (major == 2 && minor >= 0) || major > 2; - GLAD_GL_VERSION_2_1 = (major == 2 && minor >= 1) || major > 2; - GLAD_GL_VERSION_3_0 = (major == 3 && minor >= 0) || major > 3; - GLAD_GL_VERSION_3_1 = (major == 3 && minor >= 1) || major > 3; - GLAD_GL_VERSION_3_2 = (major == 3 && minor >= 2) || major > 3; -} - -void gladLoadGLLoader(GLADloadproc load) { - GLVersion.major = 0; GLVersion.minor = 0; - glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); - if(glGetString == NULL) return; - find_coreGL(); - load_GL_VERSION_1_0(load); - load_GL_VERSION_1_1(load); - load_GL_VERSION_1_2(load); - load_GL_VERSION_1_3(load); - load_GL_VERSION_1_4(load); - load_GL_VERSION_1_5(load); - load_GL_VERSION_2_0(load); - load_GL_VERSION_2_1(load); - load_GL_VERSION_3_0(load); - load_GL_VERSION_3_1(load); - load_GL_VERSION_3_2(load); - - find_extensionsGL(); - - return; -} - diff --git a/extern/glfw/deps/glad/glad.h b/extern/glfw/deps/glad/glad.h deleted file mode 100644 index e5de4ef..0000000 --- a/extern/glfw/deps/glad/glad.h +++ /dev/null @@ -1,1925 +0,0 @@ - -#ifndef __glad_h_ - -#ifdef __gl_h_ -#error OpenGL header already included, remove this include, glad already provides it -#endif - -#define __glad_h_ -#define __gl_h_ - -#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN 1 -#endif -#include -#endif - -#ifndef APIENTRY -#define APIENTRY -#endif -#ifndef APIENTRYP -#define APIENTRYP APIENTRY * -#endif - -extern struct gladGLversionStruct { - int major; - int minor; -} GLVersion; - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void* (* GLADloadproc)(const char *name); - -#ifndef GLAPI -# if defined(GLAD_GLAPI_EXPORT) -# if defined(WIN32) || defined(__CYGWIN__) -# if defined(GLAD_GLAPI_EXPORT_BUILD) -# if defined(__GNUC__) -# define GLAPI __attribute__ ((dllexport)) extern -# else -# define GLAPI __declspec(dllexport) extern -# endif -# else -# if defined(__GNUC__) -# define GLAPI __attribute__ ((dllimport)) extern -# else -# define GLAPI __declspec(dllimport) extern -# endif -# endif -# elif defined(__GNUC__) && defined(GLAD_GLAPI_EXPORT_BUILD) -# define GLAPI __attribute__ ((visibility ("default"))) extern -# else -# define GLAPI extern -# endif -# else -# define GLAPI extern -# endif -#endif -GLAPI void gladLoadGLLoader(GLADloadproc); - -#include -#include -#ifndef GLEXT_64_TYPES_DEFINED -/* This code block is duplicated in glxext.h, so must be protected */ -#define GLEXT_64_TYPES_DEFINED -/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ -/* (as used in the GL_EXT_timer_query extension). */ -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -#include -#elif defined(__sun__) || defined(__digital__) -#include -#if defined(__STDC__) -#if defined(__arch64__) || defined(_LP64) -typedef long int int64_t; -typedef unsigned long int uint64_t; -#else -typedef long long int int64_t; -typedef unsigned long long int uint64_t; -#endif /* __arch64__ */ -#endif /* __STDC__ */ -#elif defined( __VMS ) || defined(__sgi) -#include -#elif defined(__SCO__) || defined(__USLC__) -#include -#elif defined(__UNIXOS2__) || defined(__SOL64__) -typedef long int int32_t; -typedef long long int int64_t; -typedef unsigned long long int uint64_t; -#elif defined(_WIN32) && defined(__GNUC__) -#include -#elif defined(_WIN32) -typedef __int32 int32_t; -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; -#else -/* Fallback if nothing above works */ -#include -#endif -#endif -typedef unsigned int GLenum; -typedef unsigned char GLboolean; -typedef unsigned int GLbitfield; -typedef void GLvoid; -typedef signed char GLbyte; -typedef short GLshort; -typedef int GLint; -typedef int GLclampx; -typedef unsigned char GLubyte; -typedef unsigned short GLushort; -typedef unsigned int GLuint; -typedef int GLsizei; -typedef float GLfloat; -typedef float GLclampf; -typedef double GLdouble; -typedef double GLclampd; -typedef void *GLeglImageOES; -typedef char GLchar; -typedef char GLcharARB; -#ifdef __APPLE__ -typedef void *GLhandleARB; -#else -typedef unsigned int GLhandleARB; -#endif -typedef unsigned short GLhalfARB; -typedef unsigned short GLhalf; -typedef GLint GLfixed; -typedef ptrdiff_t GLintptr; -typedef ptrdiff_t GLsizeiptr; -typedef int64_t GLint64; -typedef uint64_t GLuint64; -typedef ptrdiff_t GLintptrARB; -typedef ptrdiff_t GLsizeiptrARB; -typedef int64_t GLint64EXT; -typedef uint64_t GLuint64EXT; -typedef struct __GLsync *GLsync; -struct _cl_context; -struct _cl_event; -typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam); -typedef unsigned short GLhalfNV; -typedef GLintptr GLvdpauSurfaceNV; -#define GL_DEPTH_BUFFER_BIT 0x00000100 -#define GL_STENCIL_BUFFER_BIT 0x00000400 -#define GL_COLOR_BUFFER_BIT 0x00004000 -#define GL_FALSE 0 -#define GL_TRUE 1 -#define GL_POINTS 0x0000 -#define GL_LINES 0x0001 -#define GL_LINE_LOOP 0x0002 -#define GL_LINE_STRIP 0x0003 -#define GL_TRIANGLES 0x0004 -#define GL_TRIANGLE_STRIP 0x0005 -#define GL_TRIANGLE_FAN 0x0006 -#define GL_NEVER 0x0200 -#define GL_LESS 0x0201 -#define GL_EQUAL 0x0202 -#define GL_LEQUAL 0x0203 -#define GL_GREATER 0x0204 -#define GL_NOTEQUAL 0x0205 -#define GL_GEQUAL 0x0206 -#define GL_ALWAYS 0x0207 -#define GL_ZERO 0 -#define GL_ONE 1 -#define GL_SRC_COLOR 0x0300 -#define GL_ONE_MINUS_SRC_COLOR 0x0301 -#define GL_SRC_ALPHA 0x0302 -#define GL_ONE_MINUS_SRC_ALPHA 0x0303 -#define GL_DST_ALPHA 0x0304 -#define GL_ONE_MINUS_DST_ALPHA 0x0305 -#define GL_DST_COLOR 0x0306 -#define GL_ONE_MINUS_DST_COLOR 0x0307 -#define GL_SRC_ALPHA_SATURATE 0x0308 -#define GL_NONE 0 -#define GL_FRONT_LEFT 0x0400 -#define GL_FRONT_RIGHT 0x0401 -#define GL_BACK_LEFT 0x0402 -#define GL_BACK_RIGHT 0x0403 -#define GL_FRONT 0x0404 -#define GL_BACK 0x0405 -#define GL_LEFT 0x0406 -#define GL_RIGHT 0x0407 -#define GL_FRONT_AND_BACK 0x0408 -#define GL_NO_ERROR 0 -#define GL_INVALID_ENUM 0x0500 -#define GL_INVALID_VALUE 0x0501 -#define GL_INVALID_OPERATION 0x0502 -#define GL_OUT_OF_MEMORY 0x0505 -#define GL_CW 0x0900 -#define GL_CCW 0x0901 -#define GL_POINT_SIZE 0x0B11 -#define GL_POINT_SIZE_RANGE 0x0B12 -#define GL_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_LINE_SMOOTH 0x0B20 -#define GL_LINE_WIDTH 0x0B21 -#define GL_LINE_WIDTH_RANGE 0x0B22 -#define GL_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_POLYGON_MODE 0x0B40 -#define GL_POLYGON_SMOOTH 0x0B41 -#define GL_CULL_FACE 0x0B44 -#define GL_CULL_FACE_MODE 0x0B45 -#define GL_FRONT_FACE 0x0B46 -#define GL_DEPTH_RANGE 0x0B70 -#define GL_DEPTH_TEST 0x0B71 -#define GL_DEPTH_WRITEMASK 0x0B72 -#define GL_DEPTH_CLEAR_VALUE 0x0B73 -#define GL_DEPTH_FUNC 0x0B74 -#define GL_STENCIL_TEST 0x0B90 -#define GL_STENCIL_CLEAR_VALUE 0x0B91 -#define GL_STENCIL_FUNC 0x0B92 -#define GL_STENCIL_VALUE_MASK 0x0B93 -#define GL_STENCIL_FAIL 0x0B94 -#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 -#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 -#define GL_STENCIL_REF 0x0B97 -#define GL_STENCIL_WRITEMASK 0x0B98 -#define GL_VIEWPORT 0x0BA2 -#define GL_DITHER 0x0BD0 -#define GL_BLEND_DST 0x0BE0 -#define GL_BLEND_SRC 0x0BE1 -#define GL_BLEND 0x0BE2 -#define GL_LOGIC_OP_MODE 0x0BF0 -#define GL_COLOR_LOGIC_OP 0x0BF2 -#define GL_DRAW_BUFFER 0x0C01 -#define GL_READ_BUFFER 0x0C02 -#define GL_SCISSOR_BOX 0x0C10 -#define GL_SCISSOR_TEST 0x0C11 -#define GL_COLOR_CLEAR_VALUE 0x0C22 -#define GL_COLOR_WRITEMASK 0x0C23 -#define GL_DOUBLEBUFFER 0x0C32 -#define GL_STEREO 0x0C33 -#define GL_LINE_SMOOTH_HINT 0x0C52 -#define GL_POLYGON_SMOOTH_HINT 0x0C53 -#define GL_UNPACK_SWAP_BYTES 0x0CF0 -#define GL_UNPACK_LSB_FIRST 0x0CF1 -#define GL_UNPACK_ROW_LENGTH 0x0CF2 -#define GL_UNPACK_SKIP_ROWS 0x0CF3 -#define GL_UNPACK_SKIP_PIXELS 0x0CF4 -#define GL_UNPACK_ALIGNMENT 0x0CF5 -#define GL_PACK_SWAP_BYTES 0x0D00 -#define GL_PACK_LSB_FIRST 0x0D01 -#define GL_PACK_ROW_LENGTH 0x0D02 -#define GL_PACK_SKIP_ROWS 0x0D03 -#define GL_PACK_SKIP_PIXELS 0x0D04 -#define GL_PACK_ALIGNMENT 0x0D05 -#define GL_MAX_TEXTURE_SIZE 0x0D33 -#define GL_MAX_VIEWPORT_DIMS 0x0D3A -#define GL_SUBPIXEL_BITS 0x0D50 -#define GL_TEXTURE_1D 0x0DE0 -#define GL_TEXTURE_2D 0x0DE1 -#define GL_POLYGON_OFFSET_UNITS 0x2A00 -#define GL_POLYGON_OFFSET_POINT 0x2A01 -#define GL_POLYGON_OFFSET_LINE 0x2A02 -#define GL_POLYGON_OFFSET_FILL 0x8037 -#define GL_POLYGON_OFFSET_FACTOR 0x8038 -#define GL_TEXTURE_BINDING_1D 0x8068 -#define GL_TEXTURE_BINDING_2D 0x8069 -#define GL_TEXTURE_WIDTH 0x1000 -#define GL_TEXTURE_HEIGHT 0x1001 -#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 -#define GL_TEXTURE_BORDER_COLOR 0x1004 -#define GL_TEXTURE_RED_SIZE 0x805C -#define GL_TEXTURE_GREEN_SIZE 0x805D -#define GL_TEXTURE_BLUE_SIZE 0x805E -#define GL_TEXTURE_ALPHA_SIZE 0x805F -#define GL_DONT_CARE 0x1100 -#define GL_FASTEST 0x1101 -#define GL_NICEST 0x1102 -#define GL_BYTE 0x1400 -#define GL_UNSIGNED_BYTE 0x1401 -#define GL_SHORT 0x1402 -#define GL_UNSIGNED_SHORT 0x1403 -#define GL_INT 0x1404 -#define GL_UNSIGNED_INT 0x1405 -#define GL_FLOAT 0x1406 -#define GL_DOUBLE 0x140A -#define GL_CLEAR 0x1500 -#define GL_AND 0x1501 -#define GL_AND_REVERSE 0x1502 -#define GL_COPY 0x1503 -#define GL_AND_INVERTED 0x1504 -#define GL_NOOP 0x1505 -#define GL_XOR 0x1506 -#define GL_OR 0x1507 -#define GL_NOR 0x1508 -#define GL_EQUIV 0x1509 -#define GL_INVERT 0x150A -#define GL_OR_REVERSE 0x150B -#define GL_COPY_INVERTED 0x150C -#define GL_OR_INVERTED 0x150D -#define GL_NAND 0x150E -#define GL_SET 0x150F -#define GL_TEXTURE 0x1702 -#define GL_COLOR 0x1800 -#define GL_DEPTH 0x1801 -#define GL_STENCIL 0x1802 -#define GL_STENCIL_INDEX 0x1901 -#define GL_DEPTH_COMPONENT 0x1902 -#define GL_RED 0x1903 -#define GL_GREEN 0x1904 -#define GL_BLUE 0x1905 -#define GL_ALPHA 0x1906 -#define GL_RGB 0x1907 -#define GL_RGBA 0x1908 -#define GL_POINT 0x1B00 -#define GL_LINE 0x1B01 -#define GL_FILL 0x1B02 -#define GL_KEEP 0x1E00 -#define GL_REPLACE 0x1E01 -#define GL_INCR 0x1E02 -#define GL_DECR 0x1E03 -#define GL_VENDOR 0x1F00 -#define GL_RENDERER 0x1F01 -#define GL_VERSION 0x1F02 -#define GL_EXTENSIONS 0x1F03 -#define GL_NEAREST 0x2600 -#define GL_LINEAR 0x2601 -#define GL_NEAREST_MIPMAP_NEAREST 0x2700 -#define GL_LINEAR_MIPMAP_NEAREST 0x2701 -#define GL_NEAREST_MIPMAP_LINEAR 0x2702 -#define GL_LINEAR_MIPMAP_LINEAR 0x2703 -#define GL_TEXTURE_MAG_FILTER 0x2800 -#define GL_TEXTURE_MIN_FILTER 0x2801 -#define GL_TEXTURE_WRAP_S 0x2802 -#define GL_TEXTURE_WRAP_T 0x2803 -#define GL_PROXY_TEXTURE_1D 0x8063 -#define GL_PROXY_TEXTURE_2D 0x8064 -#define GL_REPEAT 0x2901 -#define GL_R3_G3_B2 0x2A10 -#define GL_RGB4 0x804F -#define GL_RGB5 0x8050 -#define GL_RGB8 0x8051 -#define GL_RGB10 0x8052 -#define GL_RGB12 0x8053 -#define GL_RGB16 0x8054 -#define GL_RGBA2 0x8055 -#define GL_RGBA4 0x8056 -#define GL_RGB5_A1 0x8057 -#define GL_RGBA8 0x8058 -#define GL_RGB10_A2 0x8059 -#define GL_RGBA12 0x805A -#define GL_RGBA16 0x805B -#define GL_UNSIGNED_BYTE_3_3_2 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2 0x8036 -#define GL_TEXTURE_BINDING_3D 0x806A -#define GL_PACK_SKIP_IMAGES 0x806B -#define GL_PACK_IMAGE_HEIGHT 0x806C -#define GL_UNPACK_SKIP_IMAGES 0x806D -#define GL_UNPACK_IMAGE_HEIGHT 0x806E -#define GL_TEXTURE_3D 0x806F -#define GL_PROXY_TEXTURE_3D 0x8070 -#define GL_TEXTURE_DEPTH 0x8071 -#define GL_TEXTURE_WRAP_R 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE 0x8073 -#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 -#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 -#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 -#define GL_BGR 0x80E0 -#define GL_BGRA 0x80E1 -#define GL_MAX_ELEMENTS_VERTICES 0x80E8 -#define GL_MAX_ELEMENTS_INDICES 0x80E9 -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_TEXTURE_MIN_LOD 0x813A -#define GL_TEXTURE_MAX_LOD 0x813B -#define GL_TEXTURE_BASE_LEVEL 0x813C -#define GL_TEXTURE_MAX_LEVEL 0x813D -#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 -#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 -#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_ACTIVE_TEXTURE 0x84E0 -#define GL_MULTISAMPLE 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE 0x809F -#define GL_SAMPLE_COVERAGE 0x80A0 -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C -#define GL_COMPRESSED_RGB 0x84ED -#define GL_COMPRESSED_RGBA 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 -#define GL_TEXTURE_COMPRESSED 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 -#define GL_CLAMP_TO_BORDER 0x812D -#define GL_BLEND_DST_RGB 0x80C8 -#define GL_BLEND_SRC_RGB 0x80C9 -#define GL_BLEND_DST_ALPHA 0x80CA -#define GL_BLEND_SRC_ALPHA 0x80CB -#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 -#define GL_DEPTH_COMPONENT16 0x81A5 -#define GL_DEPTH_COMPONENT24 0x81A6 -#define GL_DEPTH_COMPONENT32 0x81A7 -#define GL_MIRRORED_REPEAT 0x8370 -#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD -#define GL_TEXTURE_LOD_BIAS 0x8501 -#define GL_INCR_WRAP 0x8507 -#define GL_DECR_WRAP 0x8508 -#define GL_TEXTURE_DEPTH_SIZE 0x884A -#define GL_TEXTURE_COMPARE_MODE 0x884C -#define GL_TEXTURE_COMPARE_FUNC 0x884D -#define GL_FUNC_ADD 0x8006 -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_BUFFER_SIZE 0x8764 -#define GL_BUFFER_USAGE 0x8765 -#define GL_QUERY_COUNTER_BITS 0x8864 -#define GL_CURRENT_QUERY 0x8865 -#define GL_QUERY_RESULT 0x8866 -#define GL_QUERY_RESULT_AVAILABLE 0x8867 -#define GL_ARRAY_BUFFER 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER 0x8893 -#define GL_ARRAY_BUFFER_BINDING 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F -#define GL_READ_ONLY 0x88B8 -#define GL_WRITE_ONLY 0x88B9 -#define GL_READ_WRITE 0x88BA -#define GL_BUFFER_ACCESS 0x88BB -#define GL_BUFFER_MAPPED 0x88BC -#define GL_BUFFER_MAP_POINTER 0x88BD -#define GL_STREAM_DRAW 0x88E0 -#define GL_STREAM_READ 0x88E1 -#define GL_STREAM_COPY 0x88E2 -#define GL_STATIC_DRAW 0x88E4 -#define GL_STATIC_READ 0x88E5 -#define GL_STATIC_COPY 0x88E6 -#define GL_DYNAMIC_DRAW 0x88E8 -#define GL_DYNAMIC_READ 0x88E9 -#define GL_DYNAMIC_COPY 0x88EA -#define GL_SAMPLES_PASSED 0x8914 -#define GL_SRC1_ALPHA 0x8589 -#define GL_BLEND_EQUATION_RGB 0x8009 -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB 0x8626 -#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 -#define GL_STENCIL_BACK_FUNC 0x8800 -#define GL_STENCIL_BACK_FAIL 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 -#define GL_MAX_DRAW_BUFFERS 0x8824 -#define GL_DRAW_BUFFER0 0x8825 -#define GL_DRAW_BUFFER1 0x8826 -#define GL_DRAW_BUFFER2 0x8827 -#define GL_DRAW_BUFFER3 0x8828 -#define GL_DRAW_BUFFER4 0x8829 -#define GL_DRAW_BUFFER5 0x882A -#define GL_DRAW_BUFFER6 0x882B -#define GL_DRAW_BUFFER7 0x882C -#define GL_DRAW_BUFFER8 0x882D -#define GL_DRAW_BUFFER9 0x882E -#define GL_DRAW_BUFFER10 0x882F -#define GL_DRAW_BUFFER11 0x8830 -#define GL_DRAW_BUFFER12 0x8831 -#define GL_DRAW_BUFFER13 0x8832 -#define GL_DRAW_BUFFER14 0x8833 -#define GL_DRAW_BUFFER15 0x8834 -#define GL_BLEND_EQUATION_ALPHA 0x883D -#define GL_MAX_VERTEX_ATTRIBS 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A -#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_VERTEX_SHADER 0x8B31 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A -#define GL_MAX_VARYING_FLOATS 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D -#define GL_SHADER_TYPE 0x8B4F -#define GL_FLOAT_VEC2 0x8B50 -#define GL_FLOAT_VEC3 0x8B51 -#define GL_FLOAT_VEC4 0x8B52 -#define GL_INT_VEC2 0x8B53 -#define GL_INT_VEC3 0x8B54 -#define GL_INT_VEC4 0x8B55 -#define GL_BOOL 0x8B56 -#define GL_BOOL_VEC2 0x8B57 -#define GL_BOOL_VEC3 0x8B58 -#define GL_BOOL_VEC4 0x8B59 -#define GL_FLOAT_MAT2 0x8B5A -#define GL_FLOAT_MAT3 0x8B5B -#define GL_FLOAT_MAT4 0x8B5C -#define GL_SAMPLER_1D 0x8B5D -#define GL_SAMPLER_2D 0x8B5E -#define GL_SAMPLER_3D 0x8B5F -#define GL_SAMPLER_CUBE 0x8B60 -#define GL_SAMPLER_1D_SHADOW 0x8B61 -#define GL_SAMPLER_2D_SHADOW 0x8B62 -#define GL_DELETE_STATUS 0x8B80 -#define GL_COMPILE_STATUS 0x8B81 -#define GL_LINK_STATUS 0x8B82 -#define GL_VALIDATE_STATUS 0x8B83 -#define GL_INFO_LOG_LENGTH 0x8B84 -#define GL_ATTACHED_SHADERS 0x8B85 -#define GL_ACTIVE_UNIFORMS 0x8B86 -#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 -#define GL_SHADER_SOURCE_LENGTH 0x8B88 -#define GL_ACTIVE_ATTRIBUTES 0x8B89 -#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B -#define GL_SHADING_LANGUAGE_VERSION 0x8B8C -#define GL_CURRENT_PROGRAM 0x8B8D -#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 -#define GL_LOWER_LEFT 0x8CA1 -#define GL_UPPER_LEFT 0x8CA2 -#define GL_STENCIL_BACK_REF 0x8CA3 -#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 -#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 -#define GL_PIXEL_PACK_BUFFER 0x88EB -#define GL_PIXEL_UNPACK_BUFFER 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF -#define GL_FLOAT_MAT2x3 0x8B65 -#define GL_FLOAT_MAT2x4 0x8B66 -#define GL_FLOAT_MAT3x2 0x8B67 -#define GL_FLOAT_MAT3x4 0x8B68 -#define GL_FLOAT_MAT4x2 0x8B69 -#define GL_FLOAT_MAT4x3 0x8B6A -#define GL_SRGB 0x8C40 -#define GL_SRGB8 0x8C41 -#define GL_SRGB_ALPHA 0x8C42 -#define GL_SRGB8_ALPHA8 0x8C43 -#define GL_COMPRESSED_SRGB 0x8C48 -#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 -#define GL_COMPARE_REF_TO_TEXTURE 0x884E -#define GL_CLIP_DISTANCE0 0x3000 -#define GL_CLIP_DISTANCE1 0x3001 -#define GL_CLIP_DISTANCE2 0x3002 -#define GL_CLIP_DISTANCE3 0x3003 -#define GL_CLIP_DISTANCE4 0x3004 -#define GL_CLIP_DISTANCE5 0x3005 -#define GL_CLIP_DISTANCE6 0x3006 -#define GL_CLIP_DISTANCE7 0x3007 -#define GL_MAX_CLIP_DISTANCES 0x0D32 -#define GL_MAJOR_VERSION 0x821B -#define GL_MINOR_VERSION 0x821C -#define GL_NUM_EXTENSIONS 0x821D -#define GL_CONTEXT_FLAGS 0x821E -#define GL_COMPRESSED_RED 0x8225 -#define GL_COMPRESSED_RG 0x8226 -#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001 -#define GL_RGBA32F 0x8814 -#define GL_RGB32F 0x8815 -#define GL_RGBA16F 0x881A -#define GL_RGB16F 0x881B -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD -#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF -#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 -#define GL_CLAMP_READ_COLOR 0x891C -#define GL_FIXED_ONLY 0x891D -#define GL_MAX_VARYING_COMPONENTS 0x8B4B -#define GL_TEXTURE_1D_ARRAY 0x8C18 -#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 -#define GL_TEXTURE_2D_ARRAY 0x8C1A -#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B -#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C -#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D -#define GL_R11F_G11F_B10F 0x8C3A -#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B -#define GL_RGB9_E5 0x8C3D -#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E -#define GL_TEXTURE_SHARED_SIZE 0x8C3F -#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 -#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 -#define GL_PRIMITIVES_GENERATED 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 -#define GL_RASTERIZER_DISCARD 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B -#define GL_INTERLEAVED_ATTRIBS 0x8C8C -#define GL_SEPARATE_ATTRIBS 0x8C8D -#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F -#define GL_RGBA32UI 0x8D70 -#define GL_RGB32UI 0x8D71 -#define GL_RGBA16UI 0x8D76 -#define GL_RGB16UI 0x8D77 -#define GL_RGBA8UI 0x8D7C -#define GL_RGB8UI 0x8D7D -#define GL_RGBA32I 0x8D82 -#define GL_RGB32I 0x8D83 -#define GL_RGBA16I 0x8D88 -#define GL_RGB16I 0x8D89 -#define GL_RGBA8I 0x8D8E -#define GL_RGB8I 0x8D8F -#define GL_RED_INTEGER 0x8D94 -#define GL_GREEN_INTEGER 0x8D95 -#define GL_BLUE_INTEGER 0x8D96 -#define GL_RGB_INTEGER 0x8D98 -#define GL_RGBA_INTEGER 0x8D99 -#define GL_BGR_INTEGER 0x8D9A -#define GL_BGRA_INTEGER 0x8D9B -#define GL_SAMPLER_1D_ARRAY 0x8DC0 -#define GL_SAMPLER_2D_ARRAY 0x8DC1 -#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 -#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 -#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 -#define GL_UNSIGNED_INT_VEC2 0x8DC6 -#define GL_UNSIGNED_INT_VEC3 0x8DC7 -#define GL_UNSIGNED_INT_VEC4 0x8DC8 -#define GL_INT_SAMPLER_1D 0x8DC9 -#define GL_INT_SAMPLER_2D 0x8DCA -#define GL_INT_SAMPLER_3D 0x8DCB -#define GL_INT_SAMPLER_CUBE 0x8DCC -#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE -#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF -#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 -#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 -#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 -#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 -#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 -#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 -#define GL_QUERY_WAIT 0x8E13 -#define GL_QUERY_NO_WAIT 0x8E14 -#define GL_QUERY_BY_REGION_WAIT 0x8E15 -#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 -#define GL_BUFFER_ACCESS_FLAGS 0x911F -#define GL_BUFFER_MAP_LENGTH 0x9120 -#define GL_BUFFER_MAP_OFFSET 0x9121 -#define GL_DEPTH_COMPONENT32F 0x8CAC -#define GL_DEPTH32F_STENCIL8 0x8CAD -#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD -#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 -#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 -#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 -#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 -#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 -#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 -#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 -#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 -#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 -#define GL_FRAMEBUFFER_DEFAULT 0x8218 -#define GL_FRAMEBUFFER_UNDEFINED 0x8219 -#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A -#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 -#define GL_DEPTH_STENCIL 0x84F9 -#define GL_UNSIGNED_INT_24_8 0x84FA -#define GL_DEPTH24_STENCIL8 0x88F0 -#define GL_TEXTURE_STENCIL_SIZE 0x88F1 -#define GL_TEXTURE_RED_TYPE 0x8C10 -#define GL_TEXTURE_GREEN_TYPE 0x8C11 -#define GL_TEXTURE_BLUE_TYPE 0x8C12 -#define GL_TEXTURE_ALPHA_TYPE 0x8C13 -#define GL_TEXTURE_DEPTH_TYPE 0x8C16 -#define GL_UNSIGNED_NORMALIZED 0x8C17 -#define GL_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_RENDERBUFFER_BINDING 0x8CA7 -#define GL_READ_FRAMEBUFFER 0x8CA8 -#define GL_DRAW_FRAMEBUFFER 0x8CA9 -#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA -#define GL_RENDERBUFFER_SAMPLES 0x8CAB -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 -#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD -#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF -#define GL_COLOR_ATTACHMENT0 0x8CE0 -#define GL_COLOR_ATTACHMENT1 0x8CE1 -#define GL_COLOR_ATTACHMENT2 0x8CE2 -#define GL_COLOR_ATTACHMENT3 0x8CE3 -#define GL_COLOR_ATTACHMENT4 0x8CE4 -#define GL_COLOR_ATTACHMENT5 0x8CE5 -#define GL_COLOR_ATTACHMENT6 0x8CE6 -#define GL_COLOR_ATTACHMENT7 0x8CE7 -#define GL_COLOR_ATTACHMENT8 0x8CE8 -#define GL_COLOR_ATTACHMENT9 0x8CE9 -#define GL_COLOR_ATTACHMENT10 0x8CEA -#define GL_COLOR_ATTACHMENT11 0x8CEB -#define GL_COLOR_ATTACHMENT12 0x8CEC -#define GL_COLOR_ATTACHMENT13 0x8CED -#define GL_COLOR_ATTACHMENT14 0x8CEE -#define GL_COLOR_ATTACHMENT15 0x8CEF -#define GL_DEPTH_ATTACHMENT 0x8D00 -#define GL_STENCIL_ATTACHMENT 0x8D20 -#define GL_FRAMEBUFFER 0x8D40 -#define GL_RENDERBUFFER 0x8D41 -#define GL_RENDERBUFFER_WIDTH 0x8D42 -#define GL_RENDERBUFFER_HEIGHT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 -#define GL_STENCIL_INDEX1 0x8D46 -#define GL_STENCIL_INDEX4 0x8D47 -#define GL_STENCIL_INDEX8 0x8D48 -#define GL_STENCIL_INDEX16 0x8D49 -#define GL_RENDERBUFFER_RED_SIZE 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 -#define GL_MAX_SAMPLES 0x8D57 -#define GL_INDEX 0x8222 -#define GL_FRAMEBUFFER_SRGB 0x8DB9 -#define GL_HALF_FLOAT 0x140B -#define GL_MAP_READ_BIT 0x0001 -#define GL_MAP_WRITE_BIT 0x0002 -#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 -#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 -#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 -#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 -#define GL_COMPRESSED_RED_RGTC1 0x8DBB -#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC -#define GL_COMPRESSED_RG_RGTC2 0x8DBD -#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE -#define GL_RG 0x8227 -#define GL_RG_INTEGER 0x8228 -#define GL_R8 0x8229 -#define GL_R16 0x822A -#define GL_RG8 0x822B -#define GL_RG16 0x822C -#define GL_R16F 0x822D -#define GL_R32F 0x822E -#define GL_RG16F 0x822F -#define GL_RG32F 0x8230 -#define GL_R8I 0x8231 -#define GL_R8UI 0x8232 -#define GL_R16I 0x8233 -#define GL_R16UI 0x8234 -#define GL_R32I 0x8235 -#define GL_R32UI 0x8236 -#define GL_RG8I 0x8237 -#define GL_RG8UI 0x8238 -#define GL_RG16I 0x8239 -#define GL_RG16UI 0x823A -#define GL_RG32I 0x823B -#define GL_RG32UI 0x823C -#define GL_VERTEX_ARRAY_BINDING 0x85B5 -#define GL_SAMPLER_2D_RECT 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 -#define GL_SAMPLER_BUFFER 0x8DC2 -#define GL_INT_SAMPLER_2D_RECT 0x8DCD -#define GL_INT_SAMPLER_BUFFER 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 -#define GL_TEXTURE_BUFFER 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D -#define GL_TEXTURE_RECTANGLE 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 -#define GL_R8_SNORM 0x8F94 -#define GL_RG8_SNORM 0x8F95 -#define GL_RGB8_SNORM 0x8F96 -#define GL_RGBA8_SNORM 0x8F97 -#define GL_R16_SNORM 0x8F98 -#define GL_RG16_SNORM 0x8F99 -#define GL_RGB16_SNORM 0x8F9A -#define GL_RGBA16_SNORM 0x8F9B -#define GL_SIGNED_NORMALIZED 0x8F9C -#define GL_PRIMITIVE_RESTART 0x8F9D -#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E -#define GL_COPY_READ_BUFFER 0x8F36 -#define GL_COPY_WRITE_BUFFER 0x8F37 -#define GL_UNIFORM_BUFFER 0x8A11 -#define GL_UNIFORM_BUFFER_BINDING 0x8A28 -#define GL_UNIFORM_BUFFER_START 0x8A29 -#define GL_UNIFORM_BUFFER_SIZE 0x8A2A -#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B -#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D -#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E -#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F -#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 -#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 -#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 -#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 -#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 -#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 -#define GL_UNIFORM_TYPE 0x8A37 -#define GL_UNIFORM_SIZE 0x8A38 -#define GL_UNIFORM_NAME_LENGTH 0x8A39 -#define GL_UNIFORM_BLOCK_INDEX 0x8A3A -#define GL_UNIFORM_OFFSET 0x8A3B -#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C -#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D -#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E -#define GL_UNIFORM_BLOCK_BINDING 0x8A3F -#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 -#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 -#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 -#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 -#define GL_INVALID_INDEX 0xFFFFFFFF -#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 -#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 -#define GL_LINES_ADJACENCY 0x000A -#define GL_LINE_STRIP_ADJACENCY 0x000B -#define GL_TRIANGLES_ADJACENCY 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D -#define GL_PROGRAM_POINT_SIZE 0x8642 -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 -#define GL_GEOMETRY_SHADER 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT 0x8916 -#define GL_GEOMETRY_INPUT_TYPE 0x8917 -#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 -#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 -#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 -#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 -#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 -#define GL_CONTEXT_PROFILE_MASK 0x9126 -#define GL_DEPTH_CLAMP 0x864F -#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C -#define GL_FIRST_VERTEX_CONVENTION 0x8E4D -#define GL_LAST_VERTEX_CONVENTION 0x8E4E -#define GL_PROVOKING_VERTEX 0x8E4F -#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F -#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 -#define GL_OBJECT_TYPE 0x9112 -#define GL_SYNC_CONDITION 0x9113 -#define GL_SYNC_STATUS 0x9114 -#define GL_SYNC_FLAGS 0x9115 -#define GL_SYNC_FENCE 0x9116 -#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 -#define GL_UNSIGNALED 0x9118 -#define GL_SIGNALED 0x9119 -#define GL_ALREADY_SIGNALED 0x911A -#define GL_TIMEOUT_EXPIRED 0x911B -#define GL_CONDITION_SATISFIED 0x911C -#define GL_WAIT_FAILED 0x911D -#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF -#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 -#define GL_SAMPLE_POSITION 0x8E50 -#define GL_SAMPLE_MASK 0x8E51 -#define GL_SAMPLE_MASK_VALUE 0x8E52 -#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 -#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 -#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 -#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 -#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 -#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 -#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 -#define GL_TEXTURE_SAMPLES 0x9106 -#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 -#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 -#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 -#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A -#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B -#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C -#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D -#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E -#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F -#define GL_MAX_INTEGER_SAMPLES 0x9110 -#ifndef GL_VERSION_1_0 -#define GL_VERSION_1_0 1 -GLAPI int GLAD_GL_VERSION_1_0; -typedef void (APIENTRYP PFNGLCULLFACEPROC)(GLenum); -GLAPI PFNGLCULLFACEPROC glad_glCullFace; -#define glCullFace glad_glCullFace -typedef void (APIENTRYP PFNGLFRONTFACEPROC)(GLenum); -GLAPI PFNGLFRONTFACEPROC glad_glFrontFace; -#define glFrontFace glad_glFrontFace -typedef void (APIENTRYP PFNGLHINTPROC)(GLenum, GLenum); -GLAPI PFNGLHINTPROC glad_glHint; -#define glHint glad_glHint -typedef void (APIENTRYP PFNGLLINEWIDTHPROC)(GLfloat); -GLAPI PFNGLLINEWIDTHPROC glad_glLineWidth; -#define glLineWidth glad_glLineWidth -typedef void (APIENTRYP PFNGLPOINTSIZEPROC)(GLfloat); -GLAPI PFNGLPOINTSIZEPROC glad_glPointSize; -#define glPointSize glad_glPointSize -typedef void (APIENTRYP PFNGLPOLYGONMODEPROC)(GLenum, GLenum); -GLAPI PFNGLPOLYGONMODEPROC glad_glPolygonMode; -#define glPolygonMode glad_glPolygonMode -typedef void (APIENTRYP PFNGLSCISSORPROC)(GLint, GLint, GLsizei, GLsizei); -GLAPI PFNGLSCISSORPROC glad_glScissor; -#define glScissor glad_glScissor -typedef void (APIENTRYP PFNGLTEXPARAMETERFPROC)(GLenum, GLenum, GLfloat); -GLAPI PFNGLTEXPARAMETERFPROC glad_glTexParameterf; -#define glTexParameterf glad_glTexParameterf -typedef void (APIENTRYP PFNGLTEXPARAMETERFVPROC)(GLenum, GLenum, const GLfloat*); -GLAPI PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv; -#define glTexParameterfv glad_glTexParameterfv -typedef void (APIENTRYP PFNGLTEXPARAMETERIPROC)(GLenum, GLenum, GLint); -GLAPI PFNGLTEXPARAMETERIPROC glad_glTexParameteri; -#define glTexParameteri glad_glTexParameteri -typedef void (APIENTRYP PFNGLTEXPARAMETERIVPROC)(GLenum, GLenum, const GLint*); -GLAPI PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv; -#define glTexParameteriv glad_glTexParameteriv -typedef void (APIENTRYP PFNGLTEXIMAGE1DPROC)(GLenum, GLint, GLint, GLsizei, GLint, GLenum, GLenum, const void*); -GLAPI PFNGLTEXIMAGE1DPROC glad_glTexImage1D; -#define glTexImage1D glad_glTexImage1D -typedef void (APIENTRYP PFNGLTEXIMAGE2DPROC)(GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const void*); -GLAPI PFNGLTEXIMAGE2DPROC glad_glTexImage2D; -#define glTexImage2D glad_glTexImage2D -typedef void (APIENTRYP PFNGLDRAWBUFFERPROC)(GLenum); -GLAPI PFNGLDRAWBUFFERPROC glad_glDrawBuffer; -#define glDrawBuffer glad_glDrawBuffer -typedef void (APIENTRYP PFNGLCLEARPROC)(GLbitfield); -GLAPI PFNGLCLEARPROC glad_glClear; -#define glClear glad_glClear -typedef void (APIENTRYP PFNGLCLEARCOLORPROC)(GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI PFNGLCLEARCOLORPROC glad_glClearColor; -#define glClearColor glad_glClearColor -typedef void (APIENTRYP PFNGLCLEARSTENCILPROC)(GLint); -GLAPI PFNGLCLEARSTENCILPROC glad_glClearStencil; -#define glClearStencil glad_glClearStencil -typedef void (APIENTRYP PFNGLCLEARDEPTHPROC)(GLdouble); -GLAPI PFNGLCLEARDEPTHPROC glad_glClearDepth; -#define glClearDepth glad_glClearDepth -typedef void (APIENTRYP PFNGLSTENCILMASKPROC)(GLuint); -GLAPI PFNGLSTENCILMASKPROC glad_glStencilMask; -#define glStencilMask glad_glStencilMask -typedef void (APIENTRYP PFNGLCOLORMASKPROC)(GLboolean, GLboolean, GLboolean, GLboolean); -GLAPI PFNGLCOLORMASKPROC glad_glColorMask; -#define glColorMask glad_glColorMask -typedef void (APIENTRYP PFNGLDEPTHMASKPROC)(GLboolean); -GLAPI PFNGLDEPTHMASKPROC glad_glDepthMask; -#define glDepthMask glad_glDepthMask -typedef void (APIENTRYP PFNGLDISABLEPROC)(GLenum); -GLAPI PFNGLDISABLEPROC glad_glDisable; -#define glDisable glad_glDisable -typedef void (APIENTRYP PFNGLENABLEPROC)(GLenum); -GLAPI PFNGLENABLEPROC glad_glEnable; -#define glEnable glad_glEnable -typedef void (APIENTRYP PFNGLFINISHPROC)(); -GLAPI PFNGLFINISHPROC glad_glFinish; -#define glFinish glad_glFinish -typedef void (APIENTRYP PFNGLFLUSHPROC)(); -GLAPI PFNGLFLUSHPROC glad_glFlush; -#define glFlush glad_glFlush -typedef void (APIENTRYP PFNGLBLENDFUNCPROC)(GLenum, GLenum); -GLAPI PFNGLBLENDFUNCPROC glad_glBlendFunc; -#define glBlendFunc glad_glBlendFunc -typedef void (APIENTRYP PFNGLLOGICOPPROC)(GLenum); -GLAPI PFNGLLOGICOPPROC glad_glLogicOp; -#define glLogicOp glad_glLogicOp -typedef void (APIENTRYP PFNGLSTENCILFUNCPROC)(GLenum, GLint, GLuint); -GLAPI PFNGLSTENCILFUNCPROC glad_glStencilFunc; -#define glStencilFunc glad_glStencilFunc -typedef void (APIENTRYP PFNGLSTENCILOPPROC)(GLenum, GLenum, GLenum); -GLAPI PFNGLSTENCILOPPROC glad_glStencilOp; -#define glStencilOp glad_glStencilOp -typedef void (APIENTRYP PFNGLDEPTHFUNCPROC)(GLenum); -GLAPI PFNGLDEPTHFUNCPROC glad_glDepthFunc; -#define glDepthFunc glad_glDepthFunc -typedef void (APIENTRYP PFNGLPIXELSTOREFPROC)(GLenum, GLfloat); -GLAPI PFNGLPIXELSTOREFPROC glad_glPixelStoref; -#define glPixelStoref glad_glPixelStoref -typedef void (APIENTRYP PFNGLPIXELSTOREIPROC)(GLenum, GLint); -GLAPI PFNGLPIXELSTOREIPROC glad_glPixelStorei; -#define glPixelStorei glad_glPixelStorei -typedef void (APIENTRYP PFNGLREADBUFFERPROC)(GLenum); -GLAPI PFNGLREADBUFFERPROC glad_glReadBuffer; -#define glReadBuffer glad_glReadBuffer -typedef void (APIENTRYP PFNGLREADPIXELSPROC)(GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, void*); -GLAPI PFNGLREADPIXELSPROC glad_glReadPixels; -#define glReadPixels glad_glReadPixels -typedef void (APIENTRYP PFNGLGETBOOLEANVPROC)(GLenum, GLboolean*); -GLAPI PFNGLGETBOOLEANVPROC glad_glGetBooleanv; -#define glGetBooleanv glad_glGetBooleanv -typedef void (APIENTRYP PFNGLGETDOUBLEVPROC)(GLenum, GLdouble*); -GLAPI PFNGLGETDOUBLEVPROC glad_glGetDoublev; -#define glGetDoublev glad_glGetDoublev -typedef GLenum (APIENTRYP PFNGLGETERRORPROC)(); -GLAPI PFNGLGETERRORPROC glad_glGetError; -#define glGetError glad_glGetError -typedef void (APIENTRYP PFNGLGETFLOATVPROC)(GLenum, GLfloat*); -GLAPI PFNGLGETFLOATVPROC glad_glGetFloatv; -#define glGetFloatv glad_glGetFloatv -typedef void (APIENTRYP PFNGLGETINTEGERVPROC)(GLenum, GLint*); -GLAPI PFNGLGETINTEGERVPROC glad_glGetIntegerv; -#define glGetIntegerv glad_glGetIntegerv -typedef const GLubyte* (APIENTRYP PFNGLGETSTRINGPROC)(GLenum); -GLAPI PFNGLGETSTRINGPROC glad_glGetString; -#define glGetString glad_glGetString -typedef void (APIENTRYP PFNGLGETTEXIMAGEPROC)(GLenum, GLint, GLenum, GLenum, void*); -GLAPI PFNGLGETTEXIMAGEPROC glad_glGetTexImage; -#define glGetTexImage glad_glGetTexImage -typedef void (APIENTRYP PFNGLGETTEXPARAMETERFVPROC)(GLenum, GLenum, GLfloat*); -GLAPI PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv; -#define glGetTexParameterfv glad_glGetTexParameterfv -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIVPROC)(GLenum, GLenum, GLint*); -GLAPI PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv; -#define glGetTexParameteriv glad_glGetTexParameteriv -typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERFVPROC)(GLenum, GLint, GLenum, GLfloat*); -GLAPI PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv; -#define glGetTexLevelParameterfv glad_glGetTexLevelParameterfv -typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERIVPROC)(GLenum, GLint, GLenum, GLint*); -GLAPI PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv; -#define glGetTexLevelParameteriv glad_glGetTexLevelParameteriv -typedef GLboolean (APIENTRYP PFNGLISENABLEDPROC)(GLenum); -GLAPI PFNGLISENABLEDPROC glad_glIsEnabled; -#define glIsEnabled glad_glIsEnabled -typedef void (APIENTRYP PFNGLDEPTHRANGEPROC)(GLdouble, GLdouble); -GLAPI PFNGLDEPTHRANGEPROC glad_glDepthRange; -#define glDepthRange glad_glDepthRange -typedef void (APIENTRYP PFNGLVIEWPORTPROC)(GLint, GLint, GLsizei, GLsizei); -GLAPI PFNGLVIEWPORTPROC glad_glViewport; -#define glViewport glad_glViewport -#endif -#ifndef GL_VERSION_1_1 -#define GL_VERSION_1_1 1 -GLAPI int GLAD_GL_VERSION_1_1; -typedef void (APIENTRYP PFNGLDRAWARRAYSPROC)(GLenum, GLint, GLsizei); -GLAPI PFNGLDRAWARRAYSPROC glad_glDrawArrays; -#define glDrawArrays glad_glDrawArrays -typedef void (APIENTRYP PFNGLDRAWELEMENTSPROC)(GLenum, GLsizei, GLenum, const void*); -GLAPI PFNGLDRAWELEMENTSPROC glad_glDrawElements; -#define glDrawElements glad_glDrawElements -typedef void (APIENTRYP PFNGLPOLYGONOFFSETPROC)(GLfloat, GLfloat); -GLAPI PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset; -#define glPolygonOffset glad_glPolygonOffset -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DPROC)(GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); -GLAPI PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D; -#define glCopyTexImage1D glad_glCopyTexImage1D -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DPROC)(GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); -GLAPI PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D; -#define glCopyTexImage2D glad_glCopyTexImage2D -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DPROC)(GLenum, GLint, GLint, GLint, GLint, GLsizei); -GLAPI PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D; -#define glCopyTexSubImage1D glad_glCopyTexSubImage1D -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DPROC)(GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -GLAPI PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D; -#define glCopyTexSubImage2D glad_glCopyTexSubImage2D -typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DPROC)(GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const void*); -GLAPI PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D; -#define glTexSubImage1D glad_glTexSubImage1D -typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DPROC)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const void*); -GLAPI PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D; -#define glTexSubImage2D glad_glTexSubImage2D -typedef void (APIENTRYP PFNGLBINDTEXTUREPROC)(GLenum, GLuint); -GLAPI PFNGLBINDTEXTUREPROC glad_glBindTexture; -#define glBindTexture glad_glBindTexture -typedef void (APIENTRYP PFNGLDELETETEXTURESPROC)(GLsizei, const GLuint*); -GLAPI PFNGLDELETETEXTURESPROC glad_glDeleteTextures; -#define glDeleteTextures glad_glDeleteTextures -typedef void (APIENTRYP PFNGLGENTEXTURESPROC)(GLsizei, GLuint*); -GLAPI PFNGLGENTEXTURESPROC glad_glGenTextures; -#define glGenTextures glad_glGenTextures -typedef GLboolean (APIENTRYP PFNGLISTEXTUREPROC)(GLuint); -GLAPI PFNGLISTEXTUREPROC glad_glIsTexture; -#define glIsTexture glad_glIsTexture -#endif -#ifndef GL_VERSION_1_2 -#define GL_VERSION_1_2 1 -GLAPI int GLAD_GL_VERSION_1_2; -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC)(GLenum, GLuint, GLuint, GLsizei, GLenum, const void*); -GLAPI PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements; -#define glDrawRangeElements glad_glDrawRangeElements -typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC)(GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const void*); -GLAPI PFNGLTEXIMAGE3DPROC glad_glTexImage3D; -#define glTexImage3D glad_glTexImage3D -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC)(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const void*); -GLAPI PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D; -#define glTexSubImage3D glad_glTexSubImage3D -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC)(GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -GLAPI PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D; -#define glCopyTexSubImage3D glad_glCopyTexSubImage3D -#endif -#ifndef GL_VERSION_1_3 -#define GL_VERSION_1_3 1 -GLAPI int GLAD_GL_VERSION_1_3; -typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC)(GLenum); -GLAPI PFNGLACTIVETEXTUREPROC glad_glActiveTexture; -#define glActiveTexture glad_glActiveTexture -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC)(GLfloat, GLboolean); -GLAPI PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage; -#define glSampleCoverage glad_glSampleCoverage -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const void*); -GLAPI PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D; -#define glCompressedTexImage3D glad_glCompressedTexImage3D -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const void*); -GLAPI PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D; -#define glCompressedTexImage2D glad_glCompressedTexImage2D -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC)(GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const void*); -GLAPI PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D; -#define glCompressedTexImage1D glad_glCompressedTexImage1D -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const void*); -GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D; -#define glCompressedTexSubImage3D glad_glCompressedTexSubImage3D -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const void*); -GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D; -#define glCompressedTexSubImage2D glad_glCompressedTexSubImage2D -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)(GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const void*); -GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D; -#define glCompressedTexSubImage1D glad_glCompressedTexSubImage1D -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC)(GLenum, GLint, void*); -GLAPI PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage; -#define glGetCompressedTexImage glad_glGetCompressedTexImage -#endif -#ifndef GL_VERSION_1_4 -#define GL_VERSION_1_4 1 -GLAPI int GLAD_GL_VERSION_1_4; -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC)(GLenum, GLenum, GLenum, GLenum); -GLAPI PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate; -#define glBlendFuncSeparate glad_glBlendFuncSeparate -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC)(GLenum, const GLint*, const GLsizei*, GLsizei); -GLAPI PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays; -#define glMultiDrawArrays glad_glMultiDrawArrays -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC)(GLenum, const GLsizei*, GLenum, const void**, GLsizei); -GLAPI PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements; -#define glMultiDrawElements glad_glMultiDrawElements -typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC)(GLenum, GLfloat); -GLAPI PFNGLPOINTPARAMETERFPROC glad_glPointParameterf; -#define glPointParameterf glad_glPointParameterf -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC)(GLenum, const GLfloat*); -GLAPI PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv; -#define glPointParameterfv glad_glPointParameterfv -typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC)(GLenum, GLint); -GLAPI PFNGLPOINTPARAMETERIPROC glad_glPointParameteri; -#define glPointParameteri glad_glPointParameteri -typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC)(GLenum, const GLint*); -GLAPI PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv; -#define glPointParameteriv glad_glPointParameteriv -typedef void (APIENTRYP PFNGLBLENDCOLORPROC)(GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI PFNGLBLENDCOLORPROC glad_glBlendColor; -#define glBlendColor glad_glBlendColor -typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC)(GLenum); -GLAPI PFNGLBLENDEQUATIONPROC glad_glBlendEquation; -#define glBlendEquation glad_glBlendEquation -#endif -#ifndef GL_VERSION_1_5 -#define GL_VERSION_1_5 1 -GLAPI int GLAD_GL_VERSION_1_5; -typedef void (APIENTRYP PFNGLGENQUERIESPROC)(GLsizei, GLuint*); -GLAPI PFNGLGENQUERIESPROC glad_glGenQueries; -#define glGenQueries glad_glGenQueries -typedef void (APIENTRYP PFNGLDELETEQUERIESPROC)(GLsizei, const GLuint*); -GLAPI PFNGLDELETEQUERIESPROC glad_glDeleteQueries; -#define glDeleteQueries glad_glDeleteQueries -typedef GLboolean (APIENTRYP PFNGLISQUERYPROC)(GLuint); -GLAPI PFNGLISQUERYPROC glad_glIsQuery; -#define glIsQuery glad_glIsQuery -typedef void (APIENTRYP PFNGLBEGINQUERYPROC)(GLenum, GLuint); -GLAPI PFNGLBEGINQUERYPROC glad_glBeginQuery; -#define glBeginQuery glad_glBeginQuery -typedef void (APIENTRYP PFNGLENDQUERYPROC)(GLenum); -GLAPI PFNGLENDQUERYPROC glad_glEndQuery; -#define glEndQuery glad_glEndQuery -typedef void (APIENTRYP PFNGLGETQUERYIVPROC)(GLenum, GLenum, GLint*); -GLAPI PFNGLGETQUERYIVPROC glad_glGetQueryiv; -#define glGetQueryiv glad_glGetQueryiv -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC)(GLuint, GLenum, GLint*); -GLAPI PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv; -#define glGetQueryObjectiv glad_glGetQueryObjectiv -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC)(GLuint, GLenum, GLuint*); -GLAPI PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv; -#define glGetQueryObjectuiv glad_glGetQueryObjectuiv -typedef void (APIENTRYP PFNGLBINDBUFFERPROC)(GLenum, GLuint); -GLAPI PFNGLBINDBUFFERPROC glad_glBindBuffer; -#define glBindBuffer glad_glBindBuffer -typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC)(GLsizei, const GLuint*); -GLAPI PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers; -#define glDeleteBuffers glad_glDeleteBuffers -typedef void (APIENTRYP PFNGLGENBUFFERSPROC)(GLsizei, GLuint*); -GLAPI PFNGLGENBUFFERSPROC glad_glGenBuffers; -#define glGenBuffers glad_glGenBuffers -typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC)(GLuint); -GLAPI PFNGLISBUFFERPROC glad_glIsBuffer; -#define glIsBuffer glad_glIsBuffer -typedef void (APIENTRYP PFNGLBUFFERDATAPROC)(GLenum, GLsizeiptr, const void*, GLenum); -GLAPI PFNGLBUFFERDATAPROC glad_glBufferData; -#define glBufferData glad_glBufferData -typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC)(GLenum, GLintptr, GLsizeiptr, const void*); -GLAPI PFNGLBUFFERSUBDATAPROC glad_glBufferSubData; -#define glBufferSubData glad_glBufferSubData -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC)(GLenum, GLintptr, GLsizeiptr, void*); -GLAPI PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData; -#define glGetBufferSubData glad_glGetBufferSubData -typedef void* (APIENTRYP PFNGLMAPBUFFERPROC)(GLenum, GLenum); -GLAPI PFNGLMAPBUFFERPROC glad_glMapBuffer; -#define glMapBuffer glad_glMapBuffer -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC)(GLenum); -GLAPI PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer; -#define glUnmapBuffer glad_glUnmapBuffer -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC)(GLenum, GLenum, GLint*); -GLAPI PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv; -#define glGetBufferParameteriv glad_glGetBufferParameteriv -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC)(GLenum, GLenum, void**); -GLAPI PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv; -#define glGetBufferPointerv glad_glGetBufferPointerv -#endif -#ifndef GL_VERSION_2_0 -#define GL_VERSION_2_0 1 -GLAPI int GLAD_GL_VERSION_2_0; -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC)(GLenum, GLenum); -GLAPI PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate; -#define glBlendEquationSeparate glad_glBlendEquationSeparate -typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC)(GLsizei, const GLenum*); -GLAPI PFNGLDRAWBUFFERSPROC glad_glDrawBuffers; -#define glDrawBuffers glad_glDrawBuffers -typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC)(GLenum, GLenum, GLenum, GLenum); -GLAPI PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate; -#define glStencilOpSeparate glad_glStencilOpSeparate -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC)(GLenum, GLenum, GLint, GLuint); -GLAPI PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate; -#define glStencilFuncSeparate glad_glStencilFuncSeparate -typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC)(GLenum, GLuint); -GLAPI PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate; -#define glStencilMaskSeparate glad_glStencilMaskSeparate -typedef void (APIENTRYP PFNGLATTACHSHADERPROC)(GLuint, GLuint); -GLAPI PFNGLATTACHSHADERPROC glad_glAttachShader; -#define glAttachShader glad_glAttachShader -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC)(GLuint, GLuint, const GLchar*); -GLAPI PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation; -#define glBindAttribLocation glad_glBindAttribLocation -typedef void (APIENTRYP PFNGLCOMPILESHADERPROC)(GLuint); -GLAPI PFNGLCOMPILESHADERPROC glad_glCompileShader; -#define glCompileShader glad_glCompileShader -typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC)(); -GLAPI PFNGLCREATEPROGRAMPROC glad_glCreateProgram; -#define glCreateProgram glad_glCreateProgram -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC)(GLenum); -GLAPI PFNGLCREATESHADERPROC glad_glCreateShader; -#define glCreateShader glad_glCreateShader -typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC)(GLuint); -GLAPI PFNGLDELETEPROGRAMPROC glad_glDeleteProgram; -#define glDeleteProgram glad_glDeleteProgram -typedef void (APIENTRYP PFNGLDELETESHADERPROC)(GLuint); -GLAPI PFNGLDELETESHADERPROC glad_glDeleteShader; -#define glDeleteShader glad_glDeleteShader -typedef void (APIENTRYP PFNGLDETACHSHADERPROC)(GLuint, GLuint); -GLAPI PFNGLDETACHSHADERPROC glad_glDetachShader; -#define glDetachShader glad_glDetachShader -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC)(GLuint); -GLAPI PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray; -#define glDisableVertexAttribArray glad_glDisableVertexAttribArray -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC)(GLuint); -GLAPI PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray; -#define glEnableVertexAttribArray glad_glEnableVertexAttribArray -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC)(GLuint, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLchar*); -GLAPI PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib; -#define glGetActiveAttrib glad_glGetActiveAttrib -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC)(GLuint, GLuint, GLsizei, GLsizei*, GLint*, GLenum*, GLchar*); -GLAPI PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform; -#define glGetActiveUniform glad_glGetActiveUniform -typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC)(GLuint, GLsizei, GLsizei*, GLuint*); -GLAPI PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders; -#define glGetAttachedShaders glad_glGetAttachedShaders -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC)(GLuint, const GLchar*); -GLAPI PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation; -#define glGetAttribLocation glad_glGetAttribLocation -typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC)(GLuint, GLenum, GLint*); -GLAPI PFNGLGETPROGRAMIVPROC glad_glGetProgramiv; -#define glGetProgramiv glad_glGetProgramiv -typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC)(GLuint, GLsizei, GLsizei*, GLchar*); -GLAPI PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog; -#define glGetProgramInfoLog glad_glGetProgramInfoLog -typedef void (APIENTRYP PFNGLGETSHADERIVPROC)(GLuint, GLenum, GLint*); -GLAPI PFNGLGETSHADERIVPROC glad_glGetShaderiv; -#define glGetShaderiv glad_glGetShaderiv -typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC)(GLuint, GLsizei, GLsizei*, GLchar*); -GLAPI PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog; -#define glGetShaderInfoLog glad_glGetShaderInfoLog -typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC)(GLuint, GLsizei, GLsizei*, GLchar*); -GLAPI PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource; -#define glGetShaderSource glad_glGetShaderSource -typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC)(GLuint, const GLchar*); -GLAPI PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation; -#define glGetUniformLocation glad_glGetUniformLocation -typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC)(GLuint, GLint, GLfloat*); -GLAPI PFNGLGETUNIFORMFVPROC glad_glGetUniformfv; -#define glGetUniformfv glad_glGetUniformfv -typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC)(GLuint, GLint, GLint*); -GLAPI PFNGLGETUNIFORMIVPROC glad_glGetUniformiv; -#define glGetUniformiv glad_glGetUniformiv -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC)(GLuint, GLenum, GLdouble*); -GLAPI PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv; -#define glGetVertexAttribdv glad_glGetVertexAttribdv -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC)(GLuint, GLenum, GLfloat*); -GLAPI PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv; -#define glGetVertexAttribfv glad_glGetVertexAttribfv -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC)(GLuint, GLenum, GLint*); -GLAPI PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv; -#define glGetVertexAttribiv glad_glGetVertexAttribiv -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC)(GLuint, GLenum, void**); -GLAPI PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv; -#define glGetVertexAttribPointerv glad_glGetVertexAttribPointerv -typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC)(GLuint); -GLAPI PFNGLISPROGRAMPROC glad_glIsProgram; -#define glIsProgram glad_glIsProgram -typedef GLboolean (APIENTRYP PFNGLISSHADERPROC)(GLuint); -GLAPI PFNGLISSHADERPROC glad_glIsShader; -#define glIsShader glad_glIsShader -typedef void (APIENTRYP PFNGLLINKPROGRAMPROC)(GLuint); -GLAPI PFNGLLINKPROGRAMPROC glad_glLinkProgram; -#define glLinkProgram glad_glLinkProgram -typedef void (APIENTRYP PFNGLSHADERSOURCEPROC)(GLuint, GLsizei, const GLchar**, const GLint*); -GLAPI PFNGLSHADERSOURCEPROC glad_glShaderSource; -#define glShaderSource glad_glShaderSource -typedef void (APIENTRYP PFNGLUSEPROGRAMPROC)(GLuint); -GLAPI PFNGLUSEPROGRAMPROC glad_glUseProgram; -#define glUseProgram glad_glUseProgram -typedef void (APIENTRYP PFNGLUNIFORM1FPROC)(GLint, GLfloat); -GLAPI PFNGLUNIFORM1FPROC glad_glUniform1f; -#define glUniform1f glad_glUniform1f -typedef void (APIENTRYP PFNGLUNIFORM2FPROC)(GLint, GLfloat, GLfloat); -GLAPI PFNGLUNIFORM2FPROC glad_glUniform2f; -#define glUniform2f glad_glUniform2f -typedef void (APIENTRYP PFNGLUNIFORM3FPROC)(GLint, GLfloat, GLfloat, GLfloat); -GLAPI PFNGLUNIFORM3FPROC glad_glUniform3f; -#define glUniform3f glad_glUniform3f -typedef void (APIENTRYP PFNGLUNIFORM4FPROC)(GLint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI PFNGLUNIFORM4FPROC glad_glUniform4f; -#define glUniform4f glad_glUniform4f -typedef void (APIENTRYP PFNGLUNIFORM1IPROC)(GLint, GLint); -GLAPI PFNGLUNIFORM1IPROC glad_glUniform1i; -#define glUniform1i glad_glUniform1i -typedef void (APIENTRYP PFNGLUNIFORM2IPROC)(GLint, GLint, GLint); -GLAPI PFNGLUNIFORM2IPROC glad_glUniform2i; -#define glUniform2i glad_glUniform2i -typedef void (APIENTRYP PFNGLUNIFORM3IPROC)(GLint, GLint, GLint, GLint); -GLAPI PFNGLUNIFORM3IPROC glad_glUniform3i; -#define glUniform3i glad_glUniform3i -typedef void (APIENTRYP PFNGLUNIFORM4IPROC)(GLint, GLint, GLint, GLint, GLint); -GLAPI PFNGLUNIFORM4IPROC glad_glUniform4i; -#define glUniform4i glad_glUniform4i -typedef void (APIENTRYP PFNGLUNIFORM1FVPROC)(GLint, GLsizei, const GLfloat*); -GLAPI PFNGLUNIFORM1FVPROC glad_glUniform1fv; -#define glUniform1fv glad_glUniform1fv -typedef void (APIENTRYP PFNGLUNIFORM2FVPROC)(GLint, GLsizei, const GLfloat*); -GLAPI PFNGLUNIFORM2FVPROC glad_glUniform2fv; -#define glUniform2fv glad_glUniform2fv -typedef void (APIENTRYP PFNGLUNIFORM3FVPROC)(GLint, GLsizei, const GLfloat*); -GLAPI PFNGLUNIFORM3FVPROC glad_glUniform3fv; -#define glUniform3fv glad_glUniform3fv -typedef void (APIENTRYP PFNGLUNIFORM4FVPROC)(GLint, GLsizei, const GLfloat*); -GLAPI PFNGLUNIFORM4FVPROC glad_glUniform4fv; -#define glUniform4fv glad_glUniform4fv -typedef void (APIENTRYP PFNGLUNIFORM1IVPROC)(GLint, GLsizei, const GLint*); -GLAPI PFNGLUNIFORM1IVPROC glad_glUniform1iv; -#define glUniform1iv glad_glUniform1iv -typedef void (APIENTRYP PFNGLUNIFORM2IVPROC)(GLint, GLsizei, const GLint*); -GLAPI PFNGLUNIFORM2IVPROC glad_glUniform2iv; -#define glUniform2iv glad_glUniform2iv -typedef void (APIENTRYP PFNGLUNIFORM3IVPROC)(GLint, GLsizei, const GLint*); -GLAPI PFNGLUNIFORM3IVPROC glad_glUniform3iv; -#define glUniform3iv glad_glUniform3iv -typedef void (APIENTRYP PFNGLUNIFORM4IVPROC)(GLint, GLsizei, const GLint*); -GLAPI PFNGLUNIFORM4IVPROC glad_glUniform4iv; -#define glUniform4iv glad_glUniform4iv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC)(GLint, GLsizei, GLboolean, const GLfloat*); -GLAPI PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv; -#define glUniformMatrix2fv glad_glUniformMatrix2fv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC)(GLint, GLsizei, GLboolean, const GLfloat*); -GLAPI PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv; -#define glUniformMatrix3fv glad_glUniformMatrix3fv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC)(GLint, GLsizei, GLboolean, const GLfloat*); -GLAPI PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv; -#define glUniformMatrix4fv glad_glUniformMatrix4fv -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC)(GLuint); -GLAPI PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram; -#define glValidateProgram glad_glValidateProgram -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC)(GLuint, GLdouble); -GLAPI PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d; -#define glVertexAttrib1d glad_glVertexAttrib1d -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC)(GLuint, const GLdouble*); -GLAPI PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv; -#define glVertexAttrib1dv glad_glVertexAttrib1dv -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC)(GLuint, GLfloat); -GLAPI PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f; -#define glVertexAttrib1f glad_glVertexAttrib1f -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC)(GLuint, const GLfloat*); -GLAPI PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv; -#define glVertexAttrib1fv glad_glVertexAttrib1fv -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC)(GLuint, GLshort); -GLAPI PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s; -#define glVertexAttrib1s glad_glVertexAttrib1s -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC)(GLuint, const GLshort*); -GLAPI PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv; -#define glVertexAttrib1sv glad_glVertexAttrib1sv -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC)(GLuint, GLdouble, GLdouble); -GLAPI PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d; -#define glVertexAttrib2d glad_glVertexAttrib2d -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC)(GLuint, const GLdouble*); -GLAPI PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv; -#define glVertexAttrib2dv glad_glVertexAttrib2dv -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC)(GLuint, GLfloat, GLfloat); -GLAPI PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f; -#define glVertexAttrib2f glad_glVertexAttrib2f -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC)(GLuint, const GLfloat*); -GLAPI PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv; -#define glVertexAttrib2fv glad_glVertexAttrib2fv -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC)(GLuint, GLshort, GLshort); -GLAPI PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s; -#define glVertexAttrib2s glad_glVertexAttrib2s -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC)(GLuint, const GLshort*); -GLAPI PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv; -#define glVertexAttrib2sv glad_glVertexAttrib2sv -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC)(GLuint, GLdouble, GLdouble, GLdouble); -GLAPI PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d; -#define glVertexAttrib3d glad_glVertexAttrib3d -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC)(GLuint, const GLdouble*); -GLAPI PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv; -#define glVertexAttrib3dv glad_glVertexAttrib3dv -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC)(GLuint, GLfloat, GLfloat, GLfloat); -GLAPI PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f; -#define glVertexAttrib3f glad_glVertexAttrib3f -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC)(GLuint, const GLfloat*); -GLAPI PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv; -#define glVertexAttrib3fv glad_glVertexAttrib3fv -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC)(GLuint, GLshort, GLshort, GLshort); -GLAPI PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s; -#define glVertexAttrib3s glad_glVertexAttrib3s -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC)(GLuint, const GLshort*); -GLAPI PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv; -#define glVertexAttrib3sv glad_glVertexAttrib3sv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC)(GLuint, const GLbyte*); -GLAPI PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv; -#define glVertexAttrib4Nbv glad_glVertexAttrib4Nbv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC)(GLuint, const GLint*); -GLAPI PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv; -#define glVertexAttrib4Niv glad_glVertexAttrib4Niv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC)(GLuint, const GLshort*); -GLAPI PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv; -#define glVertexAttrib4Nsv glad_glVertexAttrib4Nsv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC)(GLuint, GLubyte, GLubyte, GLubyte, GLubyte); -GLAPI PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub; -#define glVertexAttrib4Nub glad_glVertexAttrib4Nub -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC)(GLuint, const GLubyte*); -GLAPI PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv; -#define glVertexAttrib4Nubv glad_glVertexAttrib4Nubv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC)(GLuint, const GLuint*); -GLAPI PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv; -#define glVertexAttrib4Nuiv glad_glVertexAttrib4Nuiv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC)(GLuint, const GLushort*); -GLAPI PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv; -#define glVertexAttrib4Nusv glad_glVertexAttrib4Nusv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC)(GLuint, const GLbyte*); -GLAPI PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv; -#define glVertexAttrib4bv glad_glVertexAttrib4bv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC)(GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d; -#define glVertexAttrib4d glad_glVertexAttrib4d -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC)(GLuint, const GLdouble*); -GLAPI PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv; -#define glVertexAttrib4dv glad_glVertexAttrib4dv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f; -#define glVertexAttrib4f glad_glVertexAttrib4f -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC)(GLuint, const GLfloat*); -GLAPI PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv; -#define glVertexAttrib4fv glad_glVertexAttrib4fv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC)(GLuint, const GLint*); -GLAPI PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv; -#define glVertexAttrib4iv glad_glVertexAttrib4iv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC)(GLuint, GLshort, GLshort, GLshort, GLshort); -GLAPI PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s; -#define glVertexAttrib4s glad_glVertexAttrib4s -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC)(GLuint, const GLshort*); -GLAPI PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv; -#define glVertexAttrib4sv glad_glVertexAttrib4sv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC)(GLuint, const GLubyte*); -GLAPI PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv; -#define glVertexAttrib4ubv glad_glVertexAttrib4ubv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC)(GLuint, const GLuint*); -GLAPI PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv; -#define glVertexAttrib4uiv glad_glVertexAttrib4uiv -typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC)(GLuint, const GLushort*); -GLAPI PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv; -#define glVertexAttrib4usv glad_glVertexAttrib4usv -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC)(GLuint, GLint, GLenum, GLboolean, GLsizei, const void*); -GLAPI PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer; -#define glVertexAttribPointer glad_glVertexAttribPointer -#endif -#ifndef GL_VERSION_2_1 -#define GL_VERSION_2_1 1 -GLAPI int GLAD_GL_VERSION_2_1; -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC)(GLint, GLsizei, GLboolean, const GLfloat*); -GLAPI PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv; -#define glUniformMatrix2x3fv glad_glUniformMatrix2x3fv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC)(GLint, GLsizei, GLboolean, const GLfloat*); -GLAPI PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv; -#define glUniformMatrix3x2fv glad_glUniformMatrix3x2fv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC)(GLint, GLsizei, GLboolean, const GLfloat*); -GLAPI PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv; -#define glUniformMatrix2x4fv glad_glUniformMatrix2x4fv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC)(GLint, GLsizei, GLboolean, const GLfloat*); -GLAPI PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv; -#define glUniformMatrix4x2fv glad_glUniformMatrix4x2fv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC)(GLint, GLsizei, GLboolean, const GLfloat*); -GLAPI PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv; -#define glUniformMatrix3x4fv glad_glUniformMatrix3x4fv -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC)(GLint, GLsizei, GLboolean, const GLfloat*); -GLAPI PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv; -#define glUniformMatrix4x3fv glad_glUniformMatrix4x3fv -#endif -#ifndef GL_VERSION_3_0 -#define GL_VERSION_3_0 1 -GLAPI int GLAD_GL_VERSION_3_0; -typedef void (APIENTRYP PFNGLCOLORMASKIPROC)(GLuint, GLboolean, GLboolean, GLboolean, GLboolean); -GLAPI PFNGLCOLORMASKIPROC glad_glColorMaski; -#define glColorMaski glad_glColorMaski -typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC)(GLenum, GLuint, GLboolean*); -GLAPI PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v; -#define glGetBooleani_v glad_glGetBooleani_v -typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC)(GLenum, GLuint, GLint*); -GLAPI PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v; -#define glGetIntegeri_v glad_glGetIntegeri_v -typedef void (APIENTRYP PFNGLENABLEIPROC)(GLenum, GLuint); -GLAPI PFNGLENABLEIPROC glad_glEnablei; -#define glEnablei glad_glEnablei -typedef void (APIENTRYP PFNGLDISABLEIPROC)(GLenum, GLuint); -GLAPI PFNGLDISABLEIPROC glad_glDisablei; -#define glDisablei glad_glDisablei -typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC)(GLenum, GLuint); -GLAPI PFNGLISENABLEDIPROC glad_glIsEnabledi; -#define glIsEnabledi glad_glIsEnabledi -typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC)(GLenum); -GLAPI PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback; -#define glBeginTransformFeedback glad_glBeginTransformFeedback -typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC)(); -GLAPI PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback; -#define glEndTransformFeedback glad_glEndTransformFeedback -typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC)(GLenum, GLuint, GLuint, GLintptr, GLsizeiptr); -GLAPI PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange; -#define glBindBufferRange glad_glBindBufferRange -typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC)(GLenum, GLuint, GLuint); -GLAPI PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase; -#define glBindBufferBase glad_glBindBufferBase -typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC)(GLuint, GLsizei, const GLchar**, GLenum); -GLAPI PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings; -#define glTransformFeedbackVaryings glad_glTransformFeedbackVaryings -typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)(GLuint, GLuint, GLsizei, GLsizei*, GLsizei*, GLenum*, GLchar*); -GLAPI PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying; -#define glGetTransformFeedbackVarying glad_glGetTransformFeedbackVarying -typedef void (APIENTRYP PFNGLCLAMPCOLORPROC)(GLenum, GLenum); -GLAPI PFNGLCLAMPCOLORPROC glad_glClampColor; -#define glClampColor glad_glClampColor -typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC)(GLuint, GLenum); -GLAPI PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender; -#define glBeginConditionalRender glad_glBeginConditionalRender -typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC)(); -GLAPI PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender; -#define glEndConditionalRender glad_glEndConditionalRender -typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC)(GLuint, GLint, GLenum, GLsizei, const void*); -GLAPI PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer; -#define glVertexAttribIPointer glad_glVertexAttribIPointer -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC)(GLuint, GLenum, GLint*); -GLAPI PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv; -#define glGetVertexAttribIiv glad_glGetVertexAttribIiv -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC)(GLuint, GLenum, GLuint*); -GLAPI PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv; -#define glGetVertexAttribIuiv glad_glGetVertexAttribIuiv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC)(GLuint, GLint); -GLAPI PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i; -#define glVertexAttribI1i glad_glVertexAttribI1i -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC)(GLuint, GLint, GLint); -GLAPI PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i; -#define glVertexAttribI2i glad_glVertexAttribI2i -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC)(GLuint, GLint, GLint, GLint); -GLAPI PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i; -#define glVertexAttribI3i glad_glVertexAttribI3i -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC)(GLuint, GLint, GLint, GLint, GLint); -GLAPI PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i; -#define glVertexAttribI4i glad_glVertexAttribI4i -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC)(GLuint, GLuint); -GLAPI PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui; -#define glVertexAttribI1ui glad_glVertexAttribI1ui -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC)(GLuint, GLuint, GLuint); -GLAPI PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui; -#define glVertexAttribI2ui glad_glVertexAttribI2ui -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC)(GLuint, GLuint, GLuint, GLuint); -GLAPI PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui; -#define glVertexAttribI3ui glad_glVertexAttribI3ui -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC)(GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui; -#define glVertexAttribI4ui glad_glVertexAttribI4ui -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC)(GLuint, const GLint*); -GLAPI PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv; -#define glVertexAttribI1iv glad_glVertexAttribI1iv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC)(GLuint, const GLint*); -GLAPI PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv; -#define glVertexAttribI2iv glad_glVertexAttribI2iv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC)(GLuint, const GLint*); -GLAPI PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv; -#define glVertexAttribI3iv glad_glVertexAttribI3iv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC)(GLuint, const GLint*); -GLAPI PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv; -#define glVertexAttribI4iv glad_glVertexAttribI4iv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC)(GLuint, const GLuint*); -GLAPI PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv; -#define glVertexAttribI1uiv glad_glVertexAttribI1uiv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC)(GLuint, const GLuint*); -GLAPI PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv; -#define glVertexAttribI2uiv glad_glVertexAttribI2uiv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC)(GLuint, const GLuint*); -GLAPI PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv; -#define glVertexAttribI3uiv glad_glVertexAttribI3uiv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC)(GLuint, const GLuint*); -GLAPI PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv; -#define glVertexAttribI4uiv glad_glVertexAttribI4uiv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC)(GLuint, const GLbyte*); -GLAPI PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv; -#define glVertexAttribI4bv glad_glVertexAttribI4bv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC)(GLuint, const GLshort*); -GLAPI PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv; -#define glVertexAttribI4sv glad_glVertexAttribI4sv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC)(GLuint, const GLubyte*); -GLAPI PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv; -#define glVertexAttribI4ubv glad_glVertexAttribI4ubv -typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC)(GLuint, const GLushort*); -GLAPI PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv; -#define glVertexAttribI4usv glad_glVertexAttribI4usv -typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC)(GLuint, GLint, GLuint*); -GLAPI PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv; -#define glGetUniformuiv glad_glGetUniformuiv -typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC)(GLuint, GLuint, const GLchar*); -GLAPI PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation; -#define glBindFragDataLocation glad_glBindFragDataLocation -typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC)(GLuint, const GLchar*); -GLAPI PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation; -#define glGetFragDataLocation glad_glGetFragDataLocation -typedef void (APIENTRYP PFNGLUNIFORM1UIPROC)(GLint, GLuint); -GLAPI PFNGLUNIFORM1UIPROC glad_glUniform1ui; -#define glUniform1ui glad_glUniform1ui -typedef void (APIENTRYP PFNGLUNIFORM2UIPROC)(GLint, GLuint, GLuint); -GLAPI PFNGLUNIFORM2UIPROC glad_glUniform2ui; -#define glUniform2ui glad_glUniform2ui -typedef void (APIENTRYP PFNGLUNIFORM3UIPROC)(GLint, GLuint, GLuint, GLuint); -GLAPI PFNGLUNIFORM3UIPROC glad_glUniform3ui; -#define glUniform3ui glad_glUniform3ui -typedef void (APIENTRYP PFNGLUNIFORM4UIPROC)(GLint, GLuint, GLuint, GLuint, GLuint); -GLAPI PFNGLUNIFORM4UIPROC glad_glUniform4ui; -#define glUniform4ui glad_glUniform4ui -typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC)(GLint, GLsizei, const GLuint*); -GLAPI PFNGLUNIFORM1UIVPROC glad_glUniform1uiv; -#define glUniform1uiv glad_glUniform1uiv -typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC)(GLint, GLsizei, const GLuint*); -GLAPI PFNGLUNIFORM2UIVPROC glad_glUniform2uiv; -#define glUniform2uiv glad_glUniform2uiv -typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC)(GLint, GLsizei, const GLuint*); -GLAPI PFNGLUNIFORM3UIVPROC glad_glUniform3uiv; -#define glUniform3uiv glad_glUniform3uiv -typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC)(GLint, GLsizei, const GLuint*); -GLAPI PFNGLUNIFORM4UIVPROC glad_glUniform4uiv; -#define glUniform4uiv glad_glUniform4uiv -typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC)(GLenum, GLenum, const GLint*); -GLAPI PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv; -#define glTexParameterIiv glad_glTexParameterIiv -typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC)(GLenum, GLenum, const GLuint*); -GLAPI PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv; -#define glTexParameterIuiv glad_glTexParameterIuiv -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC)(GLenum, GLenum, GLint*); -GLAPI PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv; -#define glGetTexParameterIiv glad_glGetTexParameterIiv -typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC)(GLenum, GLenum, GLuint*); -GLAPI PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv; -#define glGetTexParameterIuiv glad_glGetTexParameterIuiv -typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC)(GLenum, GLint, const GLint*); -GLAPI PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv; -#define glClearBufferiv glad_glClearBufferiv -typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC)(GLenum, GLint, const GLuint*); -GLAPI PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv; -#define glClearBufferuiv glad_glClearBufferuiv -typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC)(GLenum, GLint, const GLfloat*); -GLAPI PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv; -#define glClearBufferfv glad_glClearBufferfv -typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC)(GLenum, GLint, GLfloat, GLint); -GLAPI PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi; -#define glClearBufferfi glad_glClearBufferfi -typedef const GLubyte* (APIENTRYP PFNGLGETSTRINGIPROC)(GLenum, GLuint); -GLAPI PFNGLGETSTRINGIPROC glad_glGetStringi; -#define glGetStringi glad_glGetStringi -typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC)(GLuint); -GLAPI PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer; -#define glIsRenderbuffer glad_glIsRenderbuffer -typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC)(GLenum, GLuint); -GLAPI PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer; -#define glBindRenderbuffer glad_glBindRenderbuffer -typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC)(GLsizei, const GLuint*); -GLAPI PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers; -#define glDeleteRenderbuffers glad_glDeleteRenderbuffers -typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC)(GLsizei, GLuint*); -GLAPI PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers; -#define glGenRenderbuffers glad_glGenRenderbuffers -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC)(GLenum, GLenum, GLsizei, GLsizei); -GLAPI PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage; -#define glRenderbufferStorage glad_glRenderbufferStorage -typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC)(GLenum, GLenum, GLint*); -GLAPI PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv; -#define glGetRenderbufferParameteriv glad_glGetRenderbufferParameteriv -typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC)(GLuint); -GLAPI PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer; -#define glIsFramebuffer glad_glIsFramebuffer -typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC)(GLenum, GLuint); -GLAPI PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer; -#define glBindFramebuffer glad_glBindFramebuffer -typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC)(GLsizei, const GLuint*); -GLAPI PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers; -#define glDeleteFramebuffers glad_glDeleteFramebuffers -typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC)(GLsizei, GLuint*); -GLAPI PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers; -#define glGenFramebuffers glad_glGenFramebuffers -typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC)(GLenum); -GLAPI PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus; -#define glCheckFramebufferStatus glad_glCheckFramebufferStatus -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC)(GLenum, GLenum, GLenum, GLuint, GLint); -GLAPI PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D; -#define glFramebufferTexture1D glad_glFramebufferTexture1D -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC)(GLenum, GLenum, GLenum, GLuint, GLint); -GLAPI PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D; -#define glFramebufferTexture2D glad_glFramebufferTexture2D -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC)(GLenum, GLenum, GLenum, GLuint, GLint, GLint); -GLAPI PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D; -#define glFramebufferTexture3D glad_glFramebufferTexture3D -typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC)(GLenum, GLenum, GLenum, GLuint); -GLAPI PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer; -#define glFramebufferRenderbuffer glad_glFramebufferRenderbuffer -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLenum, GLenum, GLenum, GLint*); -GLAPI PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv; -#define glGetFramebufferAttachmentParameteriv glad_glGetFramebufferAttachmentParameteriv -typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC)(GLenum); -GLAPI PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap; -#define glGenerateMipmap glad_glGenerateMipmap -typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC)(GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum); -GLAPI PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer; -#define glBlitFramebuffer glad_glBlitFramebuffer -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)(GLenum, GLsizei, GLenum, GLsizei, GLsizei); -GLAPI PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample; -#define glRenderbufferStorageMultisample glad_glRenderbufferStorageMultisample -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC)(GLenum, GLenum, GLuint, GLint, GLint); -GLAPI PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer; -#define glFramebufferTextureLayer glad_glFramebufferTextureLayer -typedef void* (APIENTRYP PFNGLMAPBUFFERRANGEPROC)(GLenum, GLintptr, GLsizeiptr, GLbitfield); -GLAPI PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange; -#define glMapBufferRange glad_glMapBufferRange -typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC)(GLenum, GLintptr, GLsizeiptr); -GLAPI PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange; -#define glFlushMappedBufferRange glad_glFlushMappedBufferRange -typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC)(GLuint); -GLAPI PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray; -#define glBindVertexArray glad_glBindVertexArray -typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC)(GLsizei, const GLuint*); -GLAPI PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays; -#define glDeleteVertexArrays glad_glDeleteVertexArrays -typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC)(GLsizei, GLuint*); -GLAPI PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays; -#define glGenVertexArrays glad_glGenVertexArrays -typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC)(GLuint); -GLAPI PFNGLISVERTEXARRAYPROC glad_glIsVertexArray; -#define glIsVertexArray glad_glIsVertexArray -#endif -#ifndef GL_VERSION_3_1 -#define GL_VERSION_3_1 1 -GLAPI int GLAD_GL_VERSION_3_1; -typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC)(GLenum, GLint, GLsizei, GLsizei); -GLAPI PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced; -#define glDrawArraysInstanced glad_glDrawArraysInstanced -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC)(GLenum, GLsizei, GLenum, const void*, GLsizei); -GLAPI PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced; -#define glDrawElementsInstanced glad_glDrawElementsInstanced -typedef void (APIENTRYP PFNGLTEXBUFFERPROC)(GLenum, GLenum, GLuint); -GLAPI PFNGLTEXBUFFERPROC glad_glTexBuffer; -#define glTexBuffer glad_glTexBuffer -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC)(GLuint); -GLAPI PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex; -#define glPrimitiveRestartIndex glad_glPrimitiveRestartIndex -typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC)(GLenum, GLenum, GLintptr, GLintptr, GLsizeiptr); -GLAPI PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData; -#define glCopyBufferSubData glad_glCopyBufferSubData -typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC)(GLuint, GLsizei, const GLchar**, GLuint*); -GLAPI PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices; -#define glGetUniformIndices glad_glGetUniformIndices -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC)(GLuint, GLsizei, const GLuint*, GLenum, GLint*); -GLAPI PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv; -#define glGetActiveUniformsiv glad_glGetActiveUniformsiv -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC)(GLuint, GLuint, GLsizei, GLsizei*, GLchar*); -GLAPI PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName; -#define glGetActiveUniformName glad_glGetActiveUniformName -typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC)(GLuint, const GLchar*); -GLAPI PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex; -#define glGetUniformBlockIndex glad_glGetUniformBlockIndex -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC)(GLuint, GLuint, GLenum, GLint*); -GLAPI PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv; -#define glGetActiveUniformBlockiv glad_glGetActiveUniformBlockiv -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)(GLuint, GLuint, GLsizei, GLsizei*, GLchar*); -GLAPI PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName; -#define glGetActiveUniformBlockName glad_glGetActiveUniformBlockName -typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC)(GLuint, GLuint, GLuint); -GLAPI PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding; -#define glUniformBlockBinding glad_glUniformBlockBinding -#endif -#ifndef GL_VERSION_3_2 -#define GL_VERSION_3_2 1 -GLAPI int GLAD_GL_VERSION_3_2; -typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC)(GLenum, GLsizei, GLenum, const void*, GLint); -GLAPI PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex; -#define glDrawElementsBaseVertex glad_glDrawElementsBaseVertex -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)(GLenum, GLuint, GLuint, GLsizei, GLenum, const void*, GLint); -GLAPI PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex; -#define glDrawRangeElementsBaseVertex glad_glDrawRangeElementsBaseVertex -typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)(GLenum, GLsizei, GLenum, const void*, GLsizei, GLint); -GLAPI PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex; -#define glDrawElementsInstancedBaseVertex glad_glDrawElementsInstancedBaseVertex -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)(GLenum, const GLsizei*, GLenum, const void**, GLsizei, const GLint*); -GLAPI PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex; -#define glMultiDrawElementsBaseVertex glad_glMultiDrawElementsBaseVertex -typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC)(GLenum); -GLAPI PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex; -#define glProvokingVertex glad_glProvokingVertex -typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC)(GLenum, GLbitfield); -GLAPI PFNGLFENCESYNCPROC glad_glFenceSync; -#define glFenceSync glad_glFenceSync -typedef GLboolean (APIENTRYP PFNGLISSYNCPROC)(GLsync); -GLAPI PFNGLISSYNCPROC glad_glIsSync; -#define glIsSync glad_glIsSync -typedef void (APIENTRYP PFNGLDELETESYNCPROC)(GLsync); -GLAPI PFNGLDELETESYNCPROC glad_glDeleteSync; -#define glDeleteSync glad_glDeleteSync -typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC)(GLsync, GLbitfield, GLuint64); -GLAPI PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync; -#define glClientWaitSync glad_glClientWaitSync -typedef void (APIENTRYP PFNGLWAITSYNCPROC)(GLsync, GLbitfield, GLuint64); -GLAPI PFNGLWAITSYNCPROC glad_glWaitSync; -#define glWaitSync glad_glWaitSync -typedef void (APIENTRYP PFNGLGETINTEGER64VPROC)(GLenum, GLint64*); -GLAPI PFNGLGETINTEGER64VPROC glad_glGetInteger64v; -#define glGetInteger64v glad_glGetInteger64v -typedef void (APIENTRYP PFNGLGETSYNCIVPROC)(GLsync, GLenum, GLsizei, GLsizei*, GLint*); -GLAPI PFNGLGETSYNCIVPROC glad_glGetSynciv; -#define glGetSynciv glad_glGetSynciv -typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC)(GLenum, GLuint, GLint64*); -GLAPI PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v; -#define glGetInteger64i_v glad_glGetInteger64i_v -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC)(GLenum, GLenum, GLint64*); -GLAPI PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v; -#define glGetBufferParameteri64v glad_glGetBufferParameteri64v -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC)(GLenum, GLenum, GLuint, GLint); -GLAPI PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture; -#define glFramebufferTexture glad_glFramebufferTexture -typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC)(GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLboolean); -GLAPI PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample; -#define glTexImage2DMultisample glad_glTexImage2DMultisample -typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC)(GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLsizei, GLboolean); -GLAPI PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample; -#define glTexImage3DMultisample glad_glTexImage3DMultisample -typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC)(GLenum, GLuint, GLfloat*); -GLAPI PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv; -#define glGetMultisamplefv glad_glGetMultisamplefv -typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC)(GLuint, GLbitfield); -GLAPI PFNGLSAMPLEMASKIPROC glad_glSampleMaski; -#define glSampleMaski glad_glSampleMaski -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/extern/glfw/deps/tinycthread.h b/extern/glfw/deps/tinycthread.h index 86a9080..18451ef 100644 --- a/extern/glfw/deps/tinycthread.h +++ b/extern/glfw/deps/tinycthread.h @@ -122,7 +122,6 @@ typedef int _tthread_clockid_t; /* Emulate clock_gettime */ int _tthread_clock_gettime(clockid_t clk_id, struct timespec *ts); #define clock_gettime _tthread_clock_gettime -#define CLOCK_REALTIME 0 #endif diff --git a/extern/glfw/docs/CMakeLists.txt b/extern/glfw/docs/CMakeLists.txt index 45a6162..bad6bf8 100644 --- a/extern/glfw/docs/CMakeLists.txt +++ b/extern/glfw/docs/CMakeLists.txt @@ -1,5 +1,5 @@ - -add_custom_target(docs ALL ${DOXYGEN_EXECUTABLE} - WORKING_DIRECTORY ${GLFW_BINARY_DIR}/docs - COMMENT "Generating HTML documentation" VERBATIM) - + +add_custom_target(docs ALL ${DOXYGEN_EXECUTABLE} + WORKING_DIRECTORY ${GLFW_BINARY_DIR}/docs + COMMENT "Generating HTML documentation" VERBATIM) + diff --git a/extern/glfw/docs/Doxyfile.in b/extern/glfw/docs/Doxyfile.in index 8410a85..7c3c431 100644 --- a/extern/glfw/docs/Doxyfile.in +++ b/extern/glfw/docs/Doxyfile.in @@ -657,16 +657,12 @@ INPUT = @GLFW_INTERNAL_DOCS@ \ @GLFW_SOURCE_DIR@/include/GLFW/glfw3native.h \ @GLFW_SOURCE_DIR@/docs/main.dox \ @GLFW_SOURCE_DIR@/docs/news.dox \ - @GLFW_SOURCE_DIR@/docs/moving.dox \ @GLFW_SOURCE_DIR@/docs/quick.dox \ - @GLFW_SOURCE_DIR@/docs/compile.dox \ + @GLFW_SOURCE_DIR@/docs/moving.dox \ @GLFW_SOURCE_DIR@/docs/build.dox \ - @GLFW_SOURCE_DIR@/docs/intro.dox \ @GLFW_SOURCE_DIR@/docs/context.dox \ @GLFW_SOURCE_DIR@/docs/monitor.dox \ @GLFW_SOURCE_DIR@/docs/window.dox \ - @GLFW_SOURCE_DIR@/docs/input.dox \ - @GLFW_SOURCE_DIR@/docs/rift.dox \ @GLFW_SOURCE_DIR@/docs/compat.dox # This tag can be used to specify the character encoding of the source files @@ -903,13 +899,13 @@ HTML_FILE_EXTENSION = .html # have to redo this when upgrading to a newer version of doxygen or when # changing the value of configuration settings such as GENERATE_TREEVIEW! -HTML_HEADER = @GLFW_SOURCE_DIR@/docs/header.html +HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. -HTML_FOOTER = @GLFW_SOURCE_DIR@/docs/footer.html +HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to @@ -928,7 +924,7 @@ HTML_STYLESHEET = # robust against future updates. Doxygen will copy the style sheet file to # the output directory. -HTML_EXTRA_STYLESHEET = @GLFW_SOURCE_DIR@/docs/extra.css +HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note @@ -937,7 +933,7 @@ HTML_EXTRA_STYLESHEET = @GLFW_SOURCE_DIR@/docs/extra.css # files. In the HTML_STYLESHEET file, use the file name only. Also note that # the files will be copied as-is; there are no commands or markers available. -HTML_EXTRA_FILES = @GLFW_SOURCE_DIR@/docs/spaces.svg +HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. # Doxygen will adjust the colors in the style sheet and background images @@ -1470,6 +1466,18 @@ GENERATE_XML = NO XML_OUTPUT = xml +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that diff --git a/extern/glfw/docs/DoxygenLayout.xml b/extern/glfw/docs/DoxygenLayout.xml deleted file mode 100644 index 7917f91..0000000 --- a/extern/glfw/docs/DoxygenLayout.xml +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extern/glfw/docs/build.dox b/extern/glfw/docs/build.dox index 4ee7938..e9ecaf5 100644 --- a/extern/glfw/docs/build.dox +++ b/extern/glfw/docs/build.dox @@ -1,177 +1,126 @@ /*! -@page build Building applications +@page build Building programs using GLFW @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). -For information on how to compile the GLFW library itself, see the @ref compile -guide. +This is about compiling and linking programs that use GLFW. For information on +how to *write* such programs, start with the [introductory tutorial](@ref quick). -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 -In the source files of your application where you use OpenGL or GLFW, you should -include the GLFW header file, i.e.: +In the files of your program where you use OpenGL or GLFW, you should include +the GLFW 3 header file, i.e.: @code #include @endcode -The GLFW header declares the GLFW API and by default also includes the OpenGL -header of your development environment, which in turn defines all the constants, -types and function prototypes of the OpenGL API. +This defines all the constants, types and function prototypes of the GLFW API. +It also includes the chosen client API header files (by default OpenGL), and +defines all the constants and types necessary for those headers to work on that +platform. -The GLFW header also defines everything necessary for your OpenGL header to -function. For example, under Windows you are normally required to include -`windows.h` before the OpenGL header, which would pollute your code namespace -with the entire Win32 API. +For example, under Windows you are normally required to include `windows.h` +before including `GL/gl.h`. This would make your source file tied to Windows +and pollute your code's namespace with the whole Win32 API. Instead, the GLFW header takes care of this for you, not by including -`windows.h`, but by duplicating only the very few necessary parts of it. It -does this only when needed, so if `windows.h` _is_ included, the GLFW header -does not try to redefine those symbols. The reverse is not true, i.e. -`windows.h` cannot cope if any of its symbols have already been defined. +`windows.h`, but rather by itself duplicating only the necessary parts of it. +It does this only where needed, so if `windows.h` *is* included, the GLFW header +does not try to redefine those symbols. In other words: - - Do _not_ include the OpenGL headers yourself, as GLFW does this for you - - Do _not_ include `windows.h` or other platform-specific headers unless you + - Do *not* include the OpenGL headers yourself, as GLFW does this for you + - Do *not* include `windows.h` or other platform-specific headers unless you plan on using those APIs directly - - If you _do_ need to include such headers, do it _before_ including - the GLFW header and it will handle this + - If you *do* need to include such headers, do it *before* including + the GLFW one and it will detect this If you are using an OpenGL extension loading library such as -[glad](https://github.com/Dav1dde/glad), the extension loader header should -either be included _before_ the GLFW one, or the `GLFW_INCLUDE_NONE` macro -(described below) should be defined. +[GLEW](http://glew.sourceforge.net/), the GLEW header should also be included +*before* the GLFW one. The GLEW header defines macros that disable any OpenGL +header that the GLFW header includes and GLEW will work as expected. @subsection build_macros GLFW header option macros These macros may be defined before the inclusion of the GLFW header and affect -its behavior. +how that header behaves. -`GLFW_DLL` is required on Windows when using the GLFW DLL, to tell the compiler -that the GLFW functions are defined in a DLL. +`GLFW_INCLUDE_GLCOREARB` makes the header include the modern `GL/glcorearb.h` +header (`OpenGL/gl3.h` on OS X) instead of the regular OpenGL header. -The following macros control which OpenGL or OpenGL ES API header is included. +`GLFW_INCLUDE_ES1` makes the header include the OpenGL ES 1.x `GLES/gl.h` header +instead of the regular OpenGL header. -`GLFW_INCLUDE_GLCOREARB` makes the GLFW header include the modern -`GL/glcorearb.h` header (`OpenGL/gl3.h` on OS X) instead of the regular OpenGL -header. - -`GLFW_INCLUDE_ES1` makes the GLFW header include the OpenGL ES 1.x `GLES/gl.h` +`GLFW_INCLUDE_ES2` makes the header include the OpenGL ES 2.0 `GLES2/gl2.h` header instead of the regular OpenGL header. -`GLFW_INCLUDE_ES2` makes the GLFW header include the OpenGL ES 2.0 `GLES2/gl2.h` +`GLFW_INCLUDE_ES3` makes the header include the OpenGL ES 3.0 `GLES3/gl3.h` header instead of the regular OpenGL header. -`GLFW_INCLUDE_ES3` makes the GLFW header include the OpenGL ES 3.0 `GLES3/gl3.h` -header instead of the regular OpenGL header. +`GLFW_INCLUDE_NONE` makes the header not include any client API header. -`GLFW_INCLUDE_ES31` makes the GLFW header include the OpenGL ES 3.1 `GLES3/gl31.h` -header instead of the regular OpenGL header. +`GLFW_INCLUDE_GLU` makes the header include the GLU header *in addition to* the +OpenGL header. This should only be used with the default `GL/gl.h` header +(`OpenGL/gl.h` on OS X), i.e. if you are not using any of the above macros. -`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 OS X) is included. - -`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. - -`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 legacy code. GLU has been deprecated and should not be used in new -code. - -@note GLFW does not provide any of the API headers mentioned above. They must -be provided by your development environment or your OpenGL or OpenGL ES SDK. +`GLFW_DLL` is necessary when using the GLFW DLL on Windows, in order to explain +to the compiler that the GLFW functions will be coming from another executable. +It has no function on other platforms. @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 OS X, 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](http://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 linking an application under Windows that uses the static version of GLFW, -you must link with `opengl32`. On some versions of MinGW, you must also -explicitly link with `gdi32`, while other versions of MinGW include it in the -set of default libraries along with other dependencies like `user32` and -`kernel32`. If you are using GLU, you must also link with `glu32`. +When linking a program under Windows that uses the static version of GLFW, you +must link with `opengl32`. If you are using GLU, you must also link with +`glu32`. -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 `GLFW_DLL` -macro _before_ any inclusion of the GLFW header. This can be done either with +The link library for the GLFW DLL is named `glfw3dll`. When compiling a program +that uses the DLL version of GLFW, you need to define the `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. -An application using the GLFW DLL does not need to link against any of its -dependencies, but you still have to link against `opengl32` if your application -uses OpenGL and `glu32` if it uses GLU. +A program using the GLFW DLL does not need to link against any of its +dependencies, but you still have to link against `opengl32` if your program uses +OpenGL and `glu32` if it uses GLU. @subsection build_link_cmake_source With CMake and GLFW source -With just a few changes to your `CMakeLists.txt` you can have the GLFW source -tree built along with your application. +You can use the GLFW source tree directly from a project that uses CMake. This +way, GLFW will be built along with your application as needed. Firstly, add the root directory of the GLFW source tree to your project. This will add the `glfw` target and the necessary cache variables to your project. -@code{.cmake} -add_subdirectory(path/to/glfw) -@endcode + add_subdirectory(path/to/glfw) To be able to include the GLFW header from your code, you need to tell the compiler where to find it. -@code{.cmake} -include_directories(path/to/glfw/include) -@endcode + include_directories(path/to/glfw/include) Once GLFW has been added to the project, the `GLFW_LIBRARIES` cache variable contains all link-time dependencies of GLFW as it is currently configured. To link against GLFW, link against them and the `glfw` target. -@code{.cmake} -target_link_libraries(myapp glfw ${GLFW_LIBRARIES}) -@endcode + target_link_libraries(myapp glfw ${GLFW_LIBRARIES}) Note that `GLFW_LIBRARIES` does not include GLU, as GLFW does not use it. If your application needs GLU, you can add it to the list of dependencies with the `OPENGL_glu_LIBRARY` cache variable, which is implicitly created when the GLFW CMake files look for OpenGL. -@code{.cmake} -target_link_libraries(myapp glfw ${OPENGL_glu_LIBRARY} ${GLFW_LIBRARIES}) -@endcode + target_link_libraries(myapp glfw ${OPENGL_glu_LIBRARY} ${GLFW_LIBRARIES}) @subsection build_link_cmake_pkgconfig With CMake on Unix and installed GLFW binaries @@ -182,83 +131,56 @@ installed GLFW, the pkg-config file `glfw3.pc` was installed along with it. First you need to find the PkgConfig package. If this fails, you may need to install the pkg-config package for your distribution. -@code{.cmake} -find_package(PkgConfig REQUIRED) -@endcode + find_package(PkgConfig REQUIRED) This creates the CMake commands to find pkg-config packages. Then you need to find the GLFW package. -@code{.cmake} -pkg_search_module(GLFW REQUIRED glfw3) -@endcode + pkg_search_module(GLFW REQUIRED glfw3) This creates the CMake variables you need to use GLFW. To be able to include the GLFW header, you need to tell your compiler where it is. -@code{.cmake} -include_directories(${GLFW_INCLUDE_DIRS}) -@endcode + include_directories(${GLFW_INCLUDE_DIRS}) You also need to link against the correct libraries. If you are using the shared library version of GLFW, use the `GLFW_LIBRARIES` variable. -@code{.cmake} -target_link_libraries(simple ${GLFW_LIBRARIES}) -@endcode + target_link_libraries(simple ${GLFW_LIBRARIES}) + If you are using the static library version of GLFW, use the `GLFW_STATIC_LIBRARIES` variable instead. -@code{.cmake} -target_link_libraries(simple ${GLFW_STATIC_LIBRARIES}) -@endcode + target_link_libraries(simple ${GLFW_STATIC_LIBRARIES}) @subsection build_link_pkgconfig With pkg-config on OS X or other Unix GLFW supports [pkg-config](http://www.freedesktop.org/wiki/Software/pkg-config/), -and the `glfw3.pc` pkf-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. +and `glfw3.pc` file is generated when the GLFW library is built and installed +along with it. -A typical compile and link command-line when using the static version of the -GLFW library may look like this: +A typical compile and link command-line when using the static may look like this: -@code{.sh} -cc `pkg-config --cflags glfw3` -o myprog myprog.c `pkg-config --static --libs glfw3` -@endcode + cc `pkg-config --cflags glfw3` -o myprog myprog.c `pkg-config --static --libs glfw3` -If you are using the shared version of the GLFW library, simply omit the -`--static` flag. +If you are using the shared library, simply omit the `--static` flag. -@code{.sh} -cc `pkg-config --cflags glfw3` -o myprog myprog.c `pkg-config --libs glfw3` -@endcode + cc `pkg-config --cflags glfw3` -o myprog myprog.c `pkg-config --libs glfw3` You can also use the `glfw3.pc` file without installing it first, by using the `PKG_CONFIG_PATH` environment variable. -@code{.sh} -env PKG_CONFIG_PATH=path/to/glfw/src cc `pkg-config --cflags glfw3` -o myprog myprog.c `pkg-config --libs glfw3` -@endcode + env PKG_CONFIG_PATH=path/to/glfw/src cc `pkg-config --cflags glfw3` -o myprog myprog.c `pkg-config --static --libs glfw3` The dependencies do not include GLU, as GLFW does not need it. On OS X, GLU is built into the OpenGL framework, so if you need GLU you don't need to do -anything extra. If you need GLU and are using Linux or BSD, you should add the -`glu` pkg-config module. +anything extra. If you need GLU and are using Linux or BSD, you should add +`-lGLU` to your link flags. -@code{.sh} -cc `pkg-config --cflags glfw3 glu` -o myprog myprog.c `pkg-config --libs glfw3 glu` -@endcode - -If you are using the static version of the GLFW library, make sure you don't link statically against GLU. - -@code{.sh} -cc `pkg-config --cflags glfw3 glu` -o myprog myprog.c `pkg-config --static --libs glfw3` `pkg-config --libs glu` -@endcode +See the manpage and other documentation for pkg-config and your compiler and +linker for more information on how to link programs. @subsection build_link_xcode With Xcode on OS X @@ -267,37 +189,23 @@ If you are using the dynamic library version of GLFW, simply add it to the project dependencies. If you are using the static library version of GLFW, add it and the Cocoa, -OpenGL, IOKit, CoreVideo and Carbon frameworks to the project as dependencies. -They can all be found in `/System/Library/Frameworks`. - -@note GLFW needs the Carbon framework only to access the current keyboard layout -via the Text Input Source Services. This is one of the non-deprecated parts of -the Carbon API and the only way to access this information on OS X. +OpenGL and IOKit frameworks to the project as dependencies. @subsection build_link_osx With command-line on OS X -It is recommended that you use [pkg-config](@ref build_link_pkgconfig) when -building from the command line on OS X. 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 do not wish to use pkg-config, you need to add the required frameworks +and libraries to your command-line using the `-l` and `-framework` switches, +i.e.: -If you are using the dynamic GLFW library, which is named `libglfw.3.dylib`, do: + cc -o myprog myprog.c -lglfw -framework Cocoa -framework OpenGL -framework IOKit -@code{.sh} -cc -o myprog myprog.c -lglfw -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo -@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 that you do not add the `.framework` extension to a framework when adding +it from the command-line. The OpenGL framework contains both the OpenGL and GLU APIs, so there is nothing special to do when using GLU. Also note that even though your machine may have `libGL`-style OpenGL libraries, they are for use with the X Window System and -will _not_ work with the OS X native version of GLFW. +will *not* work with the OS X native version of GLFW. */ diff --git a/extern/glfw/docs/compat.dox b/extern/glfw/docs/compat.dox index d3d9a6c..9f78f47 100644 --- a/extern/glfw/docs/compat.dox +++ b/extern/glfw/docs/compat.dox @@ -4,20 +4,19 @@ @tableofcontents -This guide describes the various API extensions used by this version of GLFW. +This chapter 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. +vital knowledge for developers wishing to deploy their applications on machines +with varied specifications. -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. +Note that the information in this appendix is not a part of the API +specification but merely list some of the preconditions for certain parts of the +API to function on a given machine. As such, any part of it may change in +future versions without this being considered a breaking API change. +@section compat_wm ICCCM and EWMH conformance -@section compat_x11 X11 extensions, protocols and IPC standards - -As GLFW uses Xlib directly, without any intervening toolkit +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 @@ -28,10 +27,6 @@ X11 API; most importantly the [Extended Window Manager Hints](http://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. @@ -41,16 +36,11 @@ 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 EWMH `_NET_WM_STATE` protocol to tell the window manager to make +the GLFW window full screen. If the running window manager does not support this +protocol, full screen windows may not work properly. GLFW has a fallback code +path in case this protocol is unavailable, but every window manager behaves +slightly differently in this regard. GLFW uses the [clipboard manager protocol](http://www.freedesktop.org/wiki/ClipboardManager/) @@ -58,36 +48,15 @@ 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](http://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 XInput 2 extension to provide sub-pixel cursor motion events. If -the running X server does not support this version of this extension, cursor -motion will be snapped to the pixel grid. - -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 requires the Xkb extension with detectable auto-repeat to provide keyboard -input. If the running X server does not support this extension, a non-Xkb -fallback path is used. - - @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 `GLXFBConfig` API to enumerate and select framebuffer pixel +formats. This requires either GLX 1.3 or greater, or the `GLX_SGIX_fbconfig` +extension. Where both are available, the SGIX extension is preferred. If +neither is available, GLFW will be unable to create windows. GLFW uses the `GLX_MESA_swap_control,` `GLX_EXT_swap_control` and `GLX_SGI_swap_control` extensions to provide vertical retrace synchronization @@ -111,11 +80,6 @@ context profiles. Where this extension is unavailable, setting the `GLFW_OPENGL_PROFILE` hint to anything but zero, or setting `GLFW_CLIENT_API` to anything but `GLFW_OPENGL_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. - @section compat_wgl WGL extensions The WGL API is used to create OpenGL contexts on Microsoft Windows and other @@ -148,11 +112,6 @@ context profiles. Where this extension is unavailable, setting the `GLFW_OPENGL_PROFILE` hint to anything but zero 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. - @section compat_osx OpenGL 3.2 and later on OS X Support for OpenGL 3.2 and above was introduced with OS X 10.7 and even then @@ -164,15 +123,15 @@ 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 -non-zero and the `GLFW_OPENGL_PROFILE` hint must be set to -`GLFW_OPENGL_CORE_PROFILE` when creating OpenGL 3.2 and later contexts and the -`GLFW_OPENGL_DEBUG_CONTEXT` hint is ignored. +given version 3.0 or 3.1, the `GLFW_OPENGL_FORWARD_COMPAT` is required for +creating contexts for OpenGL 3.2 and later, the `GLFW_OPENGL_DEBUG_CONTEXT` hint +is ignored and setting the `GLFW_OPENGL_PROFILE` hint to anything except +`GLFW_OPENGL_CORE_PROFILE` will cause @ref glfwCreateWindow to fail. 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. +`GLFW_CONTEXT_VERSION_MINOR` hints will fail if given a version above 2.1, the +`GLFW_OPENGL_DEBUG_CONTEXT` hint will have no effect, and setting the +`GLFW_OPENGL_PROFILE` or `GLFW_OPENGL_FORWARD_COMPAT` hints to a non-zero value +will cause @ref glfwCreateWindow to fail. */ diff --git a/extern/glfw/docs/compile.dox b/extern/glfw/docs/compile.dox deleted file mode 100644 index 67e5404..0000000 --- a/extern/glfw/docs/compile.dox +++ /dev/null @@ -1,313 +0,0 @@ -/*! - -@page compile Compiling GLFW - -@tableofcontents - -This is about compiling the GLFW library itself. For information on how to -build applications that use GLFW, see the @ref build guide. - - -@section compile_cmake Using CMake - -GLFW uses [CMake](http://www.cmake.org/) to generate project files or makefiles -for a particular development environment. If you are on a Unix-like system such -as Linux or FreeBSD or have a package system like Fink, MacPorts, Cygwin or -Homebrew, you can simply install its CMake package. If not, you can download -installers for Windows and OS X from the [CMake website](http://www.cmake.org/). - -@note CMake only generates project files or makefiles. It does not compile the -actual GLFW library. To compile GLFW, first generate these files and then use -them in your chosen development environment to compile the actual GLFW library. - - -@subsection compile_deps Dependencies - -Once you have installed CMake, make sure that all other dependencies are -available. On some platforms, GLFW needs a few additional packages to be -installed. See the section for your chosen platform and development environment -below. - - -@subsubsection compile_deps_msvc Dependencies for Visual C++ on Windows - -The Microsoft Platform SDK that is installed along with Visual C++ already -contains all the necessary headers, link libraries and tools except for CMake. -Move on to @ref compile_generate. - - -@subsubsection compile_deps_mingw Dependencies for MinGW or MinGW-w64 on Windows - -Both the MinGW and the MinGW-w64 packages already contain all the necessary -headers, link libraries and tools except for CMake. Move on to @ref -compile_generate. - - -@subsubsection compile_deps_mingw_cross Dependencies for MinGW or MinGW-w64 cross-compilation - -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/` directory that allow for easy -cross-compilation of Windows binaries. To use these files you need to add a -special parameter when generating the project files or makefiles: - -@code{.sh} -cmake -DCMAKE_TOOLCHAIN_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 Debian/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 -DCMAKE_TOOLCHAIN_FILE=CMake/x86_64-w64-mingw32.cmake . -@endcode - -For more details see the article -[CMake Cross Compiling](http://www.paraview.org/Wiki/CMake_Cross_Compiling) on -the CMake wiki. - -Once you have this set up, move on to @ref compile_generate. - - -@subsubsection compile_deps_xcode Dependencies for Xcode on OS X - -Xcode comes with all necessary tools except for CMake. The required headers -and libraries are included in the core OS X frameworks. Xcode can be downloaded -from the Mac App Store or from the ADC Member Center. - -Once you have Xcode installed, move on to @ref compile_generate. - - -@subsubsection compile_deps_x11 Dependencies for Linux and X11 - -To compile GLFW for X11, you need to have the X11 and OpenGL header packages -installed, as well as the basic development tools like GCC and make. For -example, on Ubuntu and other distributions based on Debian GNU/Linux, you need -to install the `xorg-dev` and `libglu1-mesa-dev` packages. The former pulls in -all X.org header packages and the latter pulls in the Mesa OpenGL and GLU -packages. GLFW itself doesn't need or use GLU, but some of the examples do. -Note that using header files and libraries from Mesa during compilation -_will not_ tie your binaries to the Mesa implementation of OpenGL. - -Once you have installed the necessary packages, 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 to know two -paths for this: the path to the _root_ directory of the GLFW source tree (i.e. -_not_ the `src` subdirectory) and the target path for the generated files and -compiled binaries. If these are the same, it is called an in-tree build, -otherwise it is called an out-of-tree build. - -One of several advantages of out-of-tree builds is that you can generate files -and compile for different development environments using a single source tree. - -@note This section is about generating the project files or makefiles necessary -to compile the GLFW library, not about compiling the actual library. - - -@subsubsection compile_generate_cli Generating files with the CMake command-line tool - -To make an in-tree build, enter the _root_ directory of the GLFW source tree -(i.e. _not_ the `src` subdirectory) and run CMake. The current directory is -used as target path, while the path provided as an argument is used to find the -source tree. - -@code{.sh} -cd -cmake . -@endcode - -To make an out-of-tree build, make another directory, enter it and run CMake -with the (relative or absolute) path to the root of the source tree as an -argument. - -@code{.sh} -cd -mkdir build -cd build -cmake .. -@endcode - -Once you have generated the project files or makefiles for your chosen -development environment, move on to @ref compile_compile. - - -@subsubsection compile_generate_gui Generating files with the CMake GUI - -If you are using the GUI version, choose the root of the GLFW source tree as -source location and the same directory or another, empty directory as the -destination for binaries. Choose _Configure_, change any options you wish to, -_Configure_ again to let the changes take effect and then _Generate_. - -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. - -Once the GLFW library is compiled, you are ready to build your applications, -linking it to the GLFW library. See the @ref build guide for more information. - - -@subsection 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, use the `ccmake` tool. -Some package systems like Ubuntu and other distributions based on Debian -GNU/Linux have this tool in a separate `cmake-curses-gui` package. - - -@subsubsection compile_options_shared Shared CMake options - -`BUILD_SHARED_LIBS` determines whether GLFW is built as a static -library or as a DLL / shared library / dynamic library. - -`LIB_SUFFIX` affects where the GLFW shared /dynamic library is installed. If it -is empty, it is installed to `${CMAKE_INSTALL_PREFIX}/lib`. If it is set to -`64`, it is installed to `${CMAKE_INSTALL_PREFIX}/lib64`. - -`GLFW_CLIENT_LIBRARY` determines which client API library to use. If set to -`opengl` the OpenGL library is used, if set to `glesv1` for the OpenGL ES 1.x -library is used, or if set to `glesv2` the OpenGL ES 2.0 library is used. The -selected library and its header files must be present on the system for this to -work. - -`GLFW_BUILD_EXAMPLES` determines whether the GLFW examples are built -along with the library. - -`GLFW_BUILD_TESTS` determines whether the GLFW test programs are -built along with the library. - -`GLFW_BUILD_DOCS` determines whether the GLFW documentation is built along with -the library. - - -@subsubsection compile_options_osx OS X specific CMake options - -`GLFW_USE_CHDIR` determines whether `glfwInit` changes the current -directory of bundled applications to the `Contents/Resources` directory. - -`GLFW_USE_MENUBAR` determines whether the first call to -`glfwCreateWindow` sets up a minimal menu bar. - -`GLFW_USE_RETINA` determines whether windows will use the full resolution of -Retina displays. - -`GLFW_BUILD_UNIVERSAL` determines whether to build Universal Binaries. - - -@subsubsection compile_options_win32 Windows specific CMake options - -`USE_MSVC_RUNTIME_LIBRARY_DLL` determines whether to use the DLL version or the -static library version of the Visual C++ runtime library. If set to `ON`, the -DLL version of the Visual C++ library is used. It is recommended to set this to -`ON`, as this keeps the executable smaller and benefits from security and bug -fix updates of the Visual C++ runtime. - -`GLFW_USE_DWM_SWAP_INTERVAL` determines whether the swap interval is set even -when DWM compositing is enabled. If this is `ON`, the swap interval is set even -if DWM is enabled. It is recommended to set this to `OFF`, as doing otherwise -can lead to severe jitter. - -`GLFW_USE_OPTIMUS_HPG` determines whether to export the `NvOptimusEnablement` -symbol, which forces the use of the high-performance GPU on nVidia Optimus -systems. - - -@subsubsection compile_options_egl EGL specific CMake options - -`GLFW_USE_EGL` determines whether to use EGL instead of the platform-specific -context creation API. Note that EGL is not yet provided on all supported -platforms. - - -@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 number of configuration macros to be defined in order to know what it's being -compiled for and has many 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 `_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. - -Three macros _must_ be defined when compiling GLFW: one selecting the window -creation API, one selecting the context creation API and one client library. -Exactly one of each kind must be defined for GLFW to compile and link. - -The window creation API is used to create windows, handle input, monitors, gamma -ramps and clipboard. The options are: - - - `_GLFW_COCOA` to use the Cocoa frameworks - - `_GLFW_WIN32` to use the Win32 API - - `_GLFW_X11` to use the X Window System - - `_GLFW_WAYLAND` to use the Wayland API (experimental and incomplete) - - `_GLFW_MIR` to use the Mir API (experimental and incomplete) - -The context creation API is used to enumerate pixel formats / framebuffer -configurations and to create contexts. The options are: - - - `_GLFW_NSGL` to use the Cocoa OpenGL framework - - `_GLFW_WGL` to use the Win32 WGL API - - `_GLFW_GLX` to use the X11 GLX API - - `_GLFW_EGL` to use the EGL API - -Wayland and Mir both require the EGL backend. - -The client library is the one providing the OpenGL or OpenGL ES API, which is -used by GLFW to probe the created context. This is not the same thing as the -client API, as many desktop OpenGL client libraries now expose the OpenGL ES API -through extensions. The options are: - - - `_GLFW_USE_OPENGL` for the desktop OpenGL (opengl32.dll, libGL.so or - OpenGL.framework) - - `_GLFW_USE_GLESV1` for OpenGL ES 1.x (experimental) - - `_GLFW_USE_GLESV2` for OpenGL ES 2.x (experimental) - -Note that `_GLFW_USE_GLESV1` and `_GLFW_USE_GLESV2` may only be used with EGL, -as the other context creation APIs do not interface with OpenGL ES client -libraries. - -If you are building GLFW as a shared library / dynamic library / DLL then you -must also define `_GLFW_BUILD_DLL`. Otherwise, you may not define it. - -If you are using the X11 window creation API then you _must_ also select an entry -point retrieval mechanism. - - - `_GLFW_HAS_GLXGETPROCADDRESS` to use `glXGetProcAddress` (recommended) - - `_GLFW_HAS_GLXGETPROCADDRESSARB` to use `glXGetProcAddressARB` (legacy) - - `_GLFW_HAS_GLXGETPROCADDRESSEXT` to use `glXGetProcAddressEXT` (legacy) - - `_GLFW_HAS_DLOPEN` to do manual retrieval with `dlopen` (fallback) - -If you are using the Cocoa window creation API, the following options are -available: - - - `_GLFW_USE_CHDIR` to `chdir` to the `Resources` subdirectory of the - application bundle during @ref glfwInit (recommended) - - `_GLFW_USE_MENUBAR` to create and populate the menu bar when the first window - is created (recommended) - - `_GLFW_USE_RETINA` to have windows use the full resolution of Retina displays - (recommended) - -*/ diff --git a/extern/glfw/docs/context.dox b/extern/glfw/docs/context.dox index 16ad7a6..56d1de7 100644 --- a/extern/glfw/docs/context.dox +++ b/extern/glfw/docs/context.dox @@ -1,90 +1,37 @@ /*! -@page context Context guide +@page context Context handling guide @tableofcontents The primary purpose of GLFW is to provide a simple interface to window management and OpenGL and OpenGL ES context creation. GLFW supports -multiple windows, with each window having its own context. - -This guide introduces the functions related to managing OpenGL and OpenGL ES -contexts. There are also guides for the other areas of the GLFW API. - - - @ref intro - - @ref window - - @ref monitor - - @ref input +multiple windows, each of which has its own context. -@section context_object Context objects +@section context_object Context handles -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. +The @ref GLFWwindow object encapsulates both a window and a context. They are +created with @ref glfwCreateWindow and destroyed with @ref glfwDestroyWindow (or +@ref glfwTerminate, if any remain). As the window and context are inseparably +linked, the object pointer is used as both a context and window handle. -As the window and context are inseparably linked, the window object also serves -as the context handle. -@subsection context_hints Context creation hints +@section 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](http://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 simple object sharing test 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 window_hints_wnd) window hint. - -@code -glfwWindowHint(GLFW_VISIBLE, GL_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. - -__OS X:__ The first time a window is created the menu bar is populated with -common commands like Hide, Quit and About. This is not desirable for example -when writing a command-line only application. The menu bar setup can be -disabled with a [compile-time option](@ref compile_options_osx). +[context related hints](@ref window_hints_ctx) in the window handling guide. @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. +Before you can use the OpenGL or OpenGL ES APIs, you need to have a current +context of the proper type. The context encapsulates all render state and all +objects like textures and shaders. + +Note that a context can only be current for a single thread at a time, and +a thread can only have a single context at a time. A context is made current with @ref glfwMakeContextCurrent. @@ -98,28 +45,18 @@ The current context is returned by @ref glfwGetCurrentContext. GLFWwindow* window = glfwGetCurrentContext(); @endcode -The following GLFW functions require a context to be current: - - @ref glfwSwapInterval - - @ref glfwExtensionSupported - - @ref glfwGetProcAddress +@section context_swap Swapping buffers -Calling any these functions without a current context will generate a @ref -GLFW_NO_CURRENT_CONTEXT error. - -@section context_swap Buffer swapping - -Buffer swapping is part of the window and framebuffer, not the context. See -@ref window_swap in the window guide. +See [swapping buffers](@ref window_swap) in the window handling guide. -@section context_glext OpenGL and OpenGL ES extensions +@section context_glext OpenGL extension handling -One of the benefits of OpenGL and OpenGL ES are 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. +One of the benefits of OpenGL is its extensibility. Independent hardware +vendors (IHVs) may include functionality in their OpenGL implementations that +expand upon the OpenGL standard before that functionality is included in a new +version of the OpenGL specification. An extension is defined by: @@ -128,103 +65,23 @@ An extension is defined by: - New OpenGL functions (e.g. `glGetDebugMessageLogARB`) 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](http://www.opengl.org/registry/) and -[OpenGL ES Registry](https://www.khronos.org/registry/gles/). - - -@subsection context_glext_auto Using an extension loader library - -This is the easiest and best way to load extensions and newer versions of the -OpenGL or OpenGL ES API. One such library is -[glad](https://github.com/Dav1dde/glad) and there are several others. They will -take care of all the details of declaring and loading everything you need. - -The following example will use glad, but other extension loader libraries work -similary. - -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 --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 and glad can call this instead of -having to implement its own. - -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. - -@code -#include -#include -@endcode - -Finally you need to initialize glad once you have a matching 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 the context you created 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_context), 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_debug_output) -{ - // Use GL_ARB_debug_output -} -@endcode - - -@subsection context_glext_manual Loading extensions manually +for official extensions. There are many different affixes, depending on who +wrote the extension. A list of extensions, together with their specifications, +can be found at the [OpenGL Registry](http://www.opengl.org/registry/). 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. +to those functions. -@note It is recommended that you use an existing extension loader library, as -described above, instead of loading manually. +This can be done with GLFW, as will be described in this section, but usually +you will instead want to use a dedicated extension loading library such as +[GLEW](http://glew.sourceforge.net/). This kind of library greatly reduces the +amount of work necessary to use both OpenGL extensions and modern versions of +the OpenGL API. GLEW in particular has been extensively tested with and works +well with GLFW. -@subsubsection context_glext_header The glext.h header +@subsection context_glext_header The glext.h header The `glext.h` header is a continually updated file that defines the interfaces for all OpenGL extensions. The latest version of this can always be found at @@ -235,11 +92,11 @@ you wish to use. The header defines function pointer types for all functions of all extensions it supports. These have names like `PFNGLGETDEBUGMESSAGELOGARB` (for -`glGetDebugMessageLogARB`), i.e. the name is made uppercase and `PFN` (pointer -to function) and `PROC` (procedure) are added to the ends. +`glGetDebugMessageLogARB`), i.e. the name is made uppercase and `PFN` and `PROC` +are added to the ends. -@subsubsection context_glext_string Checking for extensions +@subsection 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 @@ -258,12 +115,12 @@ extension is supported, @ref glfwExtensionSupported returns non-zero, otherwise it returns zero. -@subsubsection context_glext_proc Fetching function pointers +@subsection 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 -retreive pointers to these functions with @ref glfwGetProcAddress. +These entry points are often not exposed by your link libraries, making +it necessary to fetch them at run time. With @ref glfwGetProcAddress you can +retrieve the address of extension and non-extension OpenGL functions. @code PFNGLGETDEBUGMESSAGELOGARB pfnGetDebugMessageLog = glfwGetProcAddress("glGetDebugMessageLogARB"); diff --git a/extern/glfw/docs/extra.css b/extern/glfw/docs/extra.css deleted file mode 100644 index e9896fa..0000000 --- a/extern/glfw/docs/extra.css +++ /dev/null @@ -1 +0,0 @@ -#navrow1,#navrow2,#navrow3,#navrow4,.tablist a,.tablist a:visited,.tablist a:hover,.tablist li,.tablist li.current a,.memdoc,dl.reflist dd,div.toc li,.ah,span.lineno,span.lineno a,span.lineno a:hover,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,.doxtable code{background:none}#titlearea,.footer,.contents,div.header,.memdoc,table.doxtable td,table.doxtable th,hr,.memSeparator{border:none}.tablist a,.tablist a:visited,.tablist a:hover,.tablist li,.tablist li.current a,.reflist dt a.el,.levels span,.directory .levels span{text-shadow:none}.memdoc,dl.reflist dd{box-shadow:none}div.headertitle,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,table.doxtable code{padding:0}#nav-path,.directory .levels,span.lineno{display:none}html,#titlearea,.footer,tr.even,.directory tr.even,.doxtable tr:nth-child(even),.mdescLeft,.mdescRight,.memItemLeft,.memItemRight,code{background:#f2f2f2}body{color:#4d4d4d}h1,h2,h2.groupheader,h3,div.toc h3,h4,h5,h6,strong,em{color:#1a1a1a;border-bottom:none}h1{padding-top: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;height:64px;max-width:920px;min-width:800px;padding:0 32px;margin:0 auto}#glfwhome{line-height:64px;padding-right:48px;color:#666;font-size:2.5em;background:url("http://www.glfw.org/css/arrow.png") no-repeat right}.glfwnavbar{list-style-type:none;margin:0 auto;float:right}#glfwhome,.glfwnavbar li{float:left}.glfwnavbar a,.glfwnavbar a:visited{line-height:64px;margin-left:2em;display:block;color:#666}#glfwhome,.glfwnavbar a,.glfwnavbar a:visited{transition:.35s ease}#titlearea,.footer{color:#666}address.footer{text-align:center;padding:2em;margin-top:3em}#top{background:#666}#navrow1,#navrow2,#navrow3,#navrow4{max-width:920px;min-width:800px;margin:0 auto;font-size:13px}.tablist{height:36px;display:block;position:relative}.tablist a,.tablist a:visited,.tablist a:hover,.tablist li,.tablist li.current a{color:#f2f2f2}.tablist li.current a{background:linear-gradient(to bottom, #ffa733 0, #f60 100%);box-shadow:inset 0 0 32px #f60;text-shadow:0 -1px 1px #b34700;color:#fff}.contents{min-height:590px}div.contents,div.header{max-width:920px;margin:0 auto;padding:0 32px;background:#fff none}table.doxtable th,dl.reflist dt{background:linear-gradient(to bottom, #ffa733 0, #f60 100%);box-shadow:inset 0 0 32px #f60;text-shadow:0 -1px 1px #b34700;color:#fff}dl.reflist dt a.el{color:#f60;padding:.2em;border-radius:4px;background-color:#ffe0cc}div.toc{float:none;width:auto}div.toc h3{font-size:1.17em}div.toc ul{padding-left:1.5em}div.toc li{font-size:1em;padding-left:0;list-style-type:disc}div.toc,.memproto,div.qindex,div.ah{background:linear-gradient(to bottom, #f2f2f2 0, #e6e6e6 100%);box-shadow:inset 0 0 32px #e6e6e6;text-shadow:0 1px 1px #fff;color:#1a1a1a;border:2px solid #e6e6e6;border-radius:4px}.paramname{color:#803300}dl.reflist dt{border:2px solid #f60;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom:none}dl.reflist dd{border:2px solid #f60;border-bottom-right-radius:4px;border-bottom-left-radius:4px;border-top:none}table.doxtable{border-collapse:inherit;border-spacing:0;border:2px solid #f60;border-radius:4px}a,a:hover,a:visited,a:visited:hover,.contents a:visited,.el,a.el:visited,#glfwhome:hover,.tablist a:hover,span.lineno a:hover{color:#f60;text-decoration:none}div.directory{border-collapse:inherit;border-spacing:0;border:2px solid #f60;border-radius:4px}hr,.memSeparator{height:2px;background:linear-gradient(to right, #f2f2f2 0, #d9d9d9 50%, #f2f2f2 100%)}dl.note,dl.pre,dl.post,dl.invariant{background:linear-gradient(to bottom, #ddfad1 0, #cbf7ba 100%);box-shadow:inset 0 0 32px #baf5a3;color:#1e5309;border:2px solid #afe599}dl.warning,dl.attention{background:linear-gradient(to bottom, #fae8d1 0, #f7ddba 100%);box-shadow:inset 0 0 32px #f5d1a3;color:#533309;border:2px solid #e5c499}dl.deprecated,dl.bug{background:linear-gradient(to bottom, #fad1e3 0, #f7bad6 100%);box-shadow:inset 0 0 32px #f5a3c8;color:#53092a;border:2px solid #e599bb}dl.todo,dl.test{background:linear-gradient(to bottom, #d1ecfa 0, #bae3f7 100%);box-shadow:inset 0 0 32px #a3daf5;color:#093a53;border:2px solid #99cce5}dl.note,dl.pre,dl.post,dl.invariant,dl.warning,dl.attention,dl.deprecated,dl.bug,dl.todo,dl.test{border-radius:4px;padding:1em;text-shadow:0 1px 1px #fff;margin:1em 0}.note a,.pre a,.post a,.invariant a,.warning a,.attention a,.deprecated a,.bug a,.todo a,.test a,.note a:visited,.pre a:visited,.post a:visited,.invariant a:visited,.warning a:visited,.attention a:visited,.deprecated a:visited,.bug a:visited,.todo a:visited,.test a:visited{color:inherit}div.line{line-height:inherit}div.fragment,pre.fragment{background:#f2f2f2;border-radius:4px;border:none;padding:1em;overflow:auto;border-left:4px solid #ccc;margin:1em 0}.lineno a,.lineno a:visited,.line,pre.fragment{color:#4d4d4d}span.preprocessor,span.comment{color:#007899}a.code,a.code:visited{color:#e64500}span.keyword,span.keywordtype,span.keywordflow{color:#404040;font-weight:bold}span.stringliteral{color:#360099}code{padding:.1em;border-radius:4px} diff --git a/extern/glfw/docs/extra.less b/extern/glfw/docs/extra.less deleted file mode 100644 index 9d0ce97..0000000 --- a/extern/glfw/docs/extra.less +++ /dev/null @@ -1,370 +0,0 @@ -// NOTE: Please use this file to perform modifications on default style sheets. -// -// You need to install a few Ruby gems to generate extra.css from this file: -// gem install less therubyracer -// -// Run this command to regenerate extra.css after you're finished with changes: -// lessc --compress extra.less > 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(spin(@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 -.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%); -} - - -#navrow1,#navrow2,#navrow3,#navrow4,.tablist a,.tablist a:visited,.tablist a:hover,.tablist li,.tablist li.current a,.memdoc,dl.reflist dd,div.toc li,.ah,span.lineno,span.lineno a,span.lineno a:hover,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,.doxtable code { - background:none; -} - -#titlearea,.footer,.contents,div.header,.memdoc,table.doxtable td,table.doxtable th,hr,.memSeparator { - border:none; -} - -.tablist a,.tablist a:visited,.tablist a:hover,.tablist li,.tablist li.current a,.reflist dt a.el,.levels span,.directory .levels span { - text-shadow:none; -} - -.memdoc,dl.reflist dd { - box-shadow:none; -} - -div.headertitle,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,table.doxtable code { - padding:0; -} - -#nav-path,.directory .levels,span.lineno { - display:none; -} - -html,#titlearea,.footer,tr.even,.directory tr.even,.doxtable tr:nth-child(even),.mdescLeft,.mdescRight,.memItemLeft,.memItemRight,code { - background:@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; - height:64px; - max-width:920px; - min-width:800px; - padding:0 32px; - margin:0 auto; -} - -#glfwhome { - line-height:64px; - padding-right:48px; - color:@header-footer-link-color; - font-size:2.5em; - background:url("http://www.glfw.org/css/arrow.png") no-repeat right; -} - -.glfwnavbar { - list-style-type:none; - margin:0 auto; - float:right; -} - -#glfwhome,.glfwnavbar li { - float:left; -} - -.glfwnavbar a,.glfwnavbar a:visited { - line-height:64px; - margin-left:2em; - display:block; - color:@header-footer-link-color; -} - -#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; -} - -#navrow1,#navrow2,#navrow3,#navrow4 { - max-width:920px; - min-width:800px; - margin:0 auto; - font-size:13px; -} - -.tablist { - height:36px; - display:block; - position:relative; -} - -.tablist a,.tablist a:visited,.tablist a:hover,.tablist li,.tablist li.current a { - color:@navbar-link-color; -} - -.tablist li.current a { - background:linear-gradient(to bottom,@tab-background-color2 0%,@tab-background-color1 100%); - box-shadow:inset 0 0 32px @tab-background-color1; - text-shadow:0 -1px 1px darken(@tab-background-color1, 15%); - color:@tab-text-color; -} - -.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,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%); - 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 { - 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,.tablist 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 { - .message-box(@box-note-color); -} - -dl.warning,dl.attention { - .message-box(@box-warning-color); -} - -dl.deprecated,dl.bug { - .message-box(@box-bug-color); -} - -dl.todo,dl.test { - .message-box(@box-todo-color); -} - -dl.note,dl.pre,dl.post,dl.invariant,dl.warning,dl.attention,dl.deprecated,dl.bug,dl.todo,dl.test { - border-radius:4px; - padding:1em; - text-shadow:0 1px 1px hsl(0,0%,100%); - margin:1em 0; -} - -.note a,.pre a,.post a,.invariant a,.warning a,.attention a,.deprecated a,.bug a,.todo a,.test a,.note a:visited,.pre a:visited,.post a:visited,.invariant a:visited,.warning a:visited,.attention a:visited,.deprecated a:visited,.bug a:visited,.todo a:visited,.test a:visited { - color:inherit; -} - -div.line { - line-height:inherit; -} - -div.fragment,pre.fragment { - background:hsl(0,0%,95%); - border-radius:4px; - border:none; - padding:1em; - overflow:auto; - border-left:4px solid hsl(0,0%,80%); - margin:1em 0; -} - -.lineno a,.lineno a:visited,.line,pre.fragment { - color:@default-text-color; -} - -span.preprocessor,span.comment { - color:hsl(193,100%,30%); -} - -a.code,a.code:visited { - color:hsl(18,100%,45%); -} - -span.keyword,span.keywordtype,span.keywordflow { - color:darken(@default-text-color, 5%); - font-weight:bold; -} - -span.stringliteral { - color:hsl(261,100%,30%); -} - -code { - padding:.1em; - border-radius:4px; -} diff --git a/extern/glfw/docs/footer.html b/extern/glfw/docs/footer.html deleted file mode 100644 index b0434ca..0000000 --- a/extern/glfw/docs/footer.html +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/extern/glfw/docs/header.html b/extern/glfw/docs/header.html deleted file mode 100644 index 9759d8b..0000000 --- a/extern/glfw/docs/header.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - -$projectname: $title -$title - - - -$treeview -$search -$mathjax - -$extrastylesheet - - -
- - - - - diff --git a/extern/glfw/docs/input.dox b/extern/glfw/docs/input.dox deleted file mode 100644 index e565514..0000000 --- a/extern/glfw/docs/input.dox +++ /dev/null @@ -1,579 +0,0 @@ -/*! - -@page input Input guide - -@tableofcontents - -This guide introduces the input related functions of GLFW. There are also -guides for the other areas of GLFW. - - - @ref intro - - @ref window - - @ref context - - @ref monitor - -GLFW provides many kinds of input. While some can only be polled, like time, or -only received via callbacks, like scrolling, there are those that provide both -callbacks and polling. Where a callback is provided, that is the recommended -way to receive that kind of input. The more you can use callbacks the less time -your users' machines will need to spend polling. - -All input callbacks receive a window handle. By using the -[window user pointer](@ref window_userptr), you can access non-global structures -or objects from your callbacks. - -To get a better feel for how the various events callbacks behave, run the -`events` test program. It register every callback supported by GLFW and prints -out all arguments provided for every event, along with time and sequence -information. - - -@section input_event Event processing - -GLFW needs to communicate regularly with the window system both in order to -receive events and to show that the application hasn't locked up. Event -processing must be done regularly while you have visible windows and is normally -done each frame after [buffer swapping](@ref window_swap). - -There are two functions for processing pending events. @ref glfwPollEvents, -processes only those events that have already been received and then returns -immediately. - -@code -glfwPollEvents(); -@endcode - -This is the best choice when rendering continually, like most games do. - -If you only need to update the contents of the window when you receive new -input, @ref glfwWaitEvents is a better choice. - -@code -glfwWaitEvents(); -@endcode - -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. There must be at least one GLFW window -for this function to sleep. - -If the main thread is sleeping in @ref glfwWaitEvents, you can wake it from -another thread by posting an empty event to the event queue with @ref -glfwPostEmptyEvent. - -@code -glfwPostEmptyEvent(); -@endcode - -Do not assume that callbacks will _only_ be called through either of the above -functions. While it is necessary to process events in the event queue, some -window systems will send some events directly to the application, which in turn -causes callbacks to be called outside of regular event processing. - - -@section input_keyboard Keyboard input - -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. - -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. - - -@subsection input_key Key input - -If you wish to be notified when a physical key is pressed or released or when it -repeats, set a key callback. - -@code -glfwSetKeyCallback(window, key_callback); -@endcode - -The callback function receives the [keyboard key](@ref keys), platform-specific -scancode, key action and [modifier bits](@ref mods). - -@code -void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key == GLFW_KEY_E && action == GLFW_PRESS) - activate_airship(); -} -@endcode - -The action is one of `GLFW_PRESS`, `GLFW_REPEAT` or `GLFW_RELEASE`. The key -will be `GLFW_KEY_UNKNOWN` if GLFW lacks a key token for it. These keys still -have unique, if platform-specific scancodes. - -The scancode is unique for every key but is platform-specific, so a scancode -will map to different keys on different platforms. - -The key will be `GLFW_KEY_UNKNOWN` for special keys like _E-mail_ or _Play_ that -don't have a key token. Those keys will still have unique, if platform-specific -scancodes. - -Key states for [named keys](@ref keys) are also saved in per-window state arrays -that can be polled with @ref glfwGetKey. - -@code -int state = glfwGetKey(window, GLFW_KEY_E); -if (state == GLFW_PRESS) - activate_airship(); -@endcode - -The returned state is one of `GLFW_PRESS` or `GLFW_RELEASE`. - -This function only returns cached key event state. It does not poll the -system for the current state of the key. - -Whenever you poll state, you risk missing the state change you are looking for. -If a pressed key is released again before you poll its state, you will have -missed the key press. The recommended solution for this is to use a -key callback, but there is also the `GLFW_STICKY_KEYS` input mode. - -@code -glfwSetInputMode(window, GLFW_STICKY_KEYS, 1); -@endcode - -When sticky keys mode is enabled, the pollable state of a key will remain -`GLFW_PRESS` until the state of that key is polled with @ref glfwGetKey. Once -it has been polled, if a key release event had been processed in the meantime, -the state will reset to `GLFW_RELEASE`, otherwise it will remain `GLFW_PRESS`. - -The `GLFW_KEY_LAST` constant holds the highest value of any -[named key](@ref keys). - - -@subsection input_char Text input - -GLFW supports text input in the form of a stream of -[Unicode code points](https://en.wikipedia.org/wiki/Unicode), as produced by the -operating system text input system. Unlike key input, text input obeys keyboard -layouts and modifier keys and supports composing characters using -[dead keys](https://en.wikipedia.org/wiki/Dead_key). Once received, you can -encode the code points into -[UTF-8](https://en.wikipedia.org/wiki/UTF-8) or any other encoding you prefer. - -Because an `unsigned int` is 32 bits long on all platforms supported by GLFW, -you can treat the code point argument as native endian -[UTF-32](https://en.wikipedia.org/wiki/UTF-32). - -There are two callbacks for receiving Unicode code points. If you wish to -offer regular text input, set a character callback. - -@code -glfwSetCharCallback(window, character_callback); -@endcode - -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. - -@code -void character_callback(GLFWwindow* window, unsigned int codepoint) -{ -} -@endcode - -If you wish to receive even those Unicode code points generated with modifier -key combinations that a plain text field would ignore, or just want to know -exactly what modifier keys were used, set a character with modifiers callback. - -@code -glfwSetCharCallback(window, charmods_callback); -@endcode - -The callback function receives Unicode code points and -[modifier bits](@ref mods). - -@code -void charmods_callback(GLFWwindow* window, unsigned int codepoint, int mods) -{ -} -@endcode - - -@section input_mouse Mouse input - -Mouse input comes in many forms, including of mouse motion and button presses, -system cursor appearance and behavior, and two-dimensional scrolling. All of -these are supported by GLFW. - - -@subsection input_cursor_pos Cursor position - -If you wish to be notified when the system cursor moves over the window, set -a cursor position callback. - -@code -glfwSetCursorPosCallback(window, cursor_pos_callback); -@endcode - -The callback functions receives the cursor position. On platforms that provide -it, the full sub-pixel cursor position is passed on. - -@code -static void cursor_position_callback(GLFWwindow* window, double xpos, double ypos) -{ -} -@endcode - -The cursor position is also saved per-window and can be polled with @ref -glfwGetCursorPos. - -@code -double xpos, ypos; -glfwGetCursorPos(window, &xpos, &ypos); -@endcode - -This function only returns cached cursor positions. It does not poll the -system for the current position. Whenever you poll state, you risk missing the -state change you are looking for. - - -@subsection input_cursor_mode Cursor modes - -The `GLFW_CURSOR` input mode provides several cursor modes for special forms of -mouse motion input. By default, the `GLFW_CURSOR_NORMAL` cursor mode is used, -meaning the regular arrow cursor or a [custom cursor](@ref input_cursor) is used -and cursor motion is not limited. - -If you wish to implement mouse motion based camera controls or other input -schemes that require unlimited mouse movement, set the cursor mode to -`GLFW_CURSOR_DISABLED`. - -@code -glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED); -@endcode - -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, both via the cursor position callback and via position -polling. - -@note You should not implement your own version of this functionality using -other features of GLFW. It will not work as robustly as `GLFW_CURSOR_DISABLED`, -as those features are not intended for this purpose. - -If you just wish the cursor to become hidden when it is over a window, set -the cursor mode to `GLFW_CURSOR_HIDDEN`. - -@code -glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_HIDDEN); -@endcode - -This mode puts no limit on the motion of the cursor. - -To exit out of either of these special modes, restore the `GLFW_CURSOR_NORMAL` -cursor mode. - -@code -glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL); -@endcode - - -@subsection input_cursor Cursor objects - -GLFW supports creating custom system cursor images, encapsulated as @ref -GLFWcursor objects. They are created with @ref glfwCreateCursor and destroyed -with @ref glfwDestroyCursor (or @ref glfwTerminate, if any remain). - - -@subsubsection input_cursor_creation Cursor creation - -A cursor is created with @ref glfwCreateCursor, which returns a handle to the -created cursor object. For example, this creates a 16x16 white square cursor -with the hot-spot in the upper-left corner: - -@code -unsigned char pixels[16 * 16 * 4]; -memset(pixels, 0xff, sizeof(pixels)); - -GLFWimage image; -image.width = 16; -image.height = 16; -image.pixels = pixels; - -GLFWcursor* cursor = glfwCreateCursor(&image, 0, 0); -@endcode - -If cursor creation fails, `NULL` will be returned, so it is necessary to check -the return value. - -The image data is 32-bit RGBA, i.e. eight bits per channel. The pixels are -arranged canonically as sequental rows, starting from the top-left corner. - - -@subsubsection input_cursor_destruction Cursor destruction - -When a cursor is no longer needed, destroy it with @ref glfwDestroyCursor. - -@code -glfwDestroyCursor(cursor); -@endcode - -Cursor destruction always succeeds. All cursors remaining when @ref -glfwTerminate is called are destroyed as well. - - -@subsubsection input_cursor_set Cursor setting - -A cursor can be set as current for a window with @ref glfwSetCursor. - -@code -glfwSetCursor(window, cursor); -@endcode - -Once set, the cursor image will be used as long as the system cursor is over the -client area of the window and the [cursor mode](@ref input_cursor_mode) is set -to `GLFW_CURSOR_NORMAL`. - -A single cursor may be set for any number of windows. - -To remove a cursor from a window, set the cursor of that window to `NULL`. - -@code -glfwSetCursor(window, NULL); -@endcode - -When a cursor is destroyed, it is removed from any window where it is set. This -does not affect the cursor modes of those windows. - - -@subsection input_cursor_enter Cursor enter/leave events - -If you wish to be notified when the cursor enters or leaves the client area of -a window, set a cursor enter/leave callback. - -@code -glfwSetCursorEnterCallback(window, cursor_enter_callback); -@endcode - -The callback function receives the new classification of the cursor. - -@code -void cursor_enter_callback(GLFWwindow* window, int entered) -{ - if (entered) - { - // The cursor entered the client area of the window - } - else - { - // The cursor left the client area of the window - } -} -@endcode - - -@subsection input_mouse_button Mouse button input - -If you wish to be notified when a mouse button is pressed or released, set -a mouse button callback. - -@code -glfwSetMouseButtonCallback(window, mouse_button_callback); -@endcode - -The callback function receives the [mouse button](@ref buttons), button action -and [modifier bits](@ref mods). - -@code -void mouse_button_callback(GLFWwindow* window, int button, int action, int mods) -{ - if (button == GLFW_MOUSE_BUTTON_RIGHT && action == GLFW_PRESS) - popup_menu(); -} -@endcode - -The action is one of `GLFW_PRESS` or `GLFW_RELEASE`. - -Mouse button states for [named buttons](@ref buttons) are also saved in -per-window state arrays that can be polled with @ref glfwGetMouseButton. - -@code -int state = glfwGetMouseButton(window, GLFW_MOUSE_BUTTON_LEFT); -if (state == GLFW_PRESS) - upgrade_cow(); -@endcode - -The returned state is one of `GLFW_PRESS` or `GLFW_RELEASE`. - -This function only returns cached mouse button event state. It does not poll -the system for the current state of the mouse button. - -Whenever you poll state, you risk missing the state change you are looking for. -If a pressed mouse button is released again before you poll its state, you will have -missed the button press. The recommended solution for this is to use a -mouse button callback, but there is also the `GLFW_STICKY_MOUSE_BUTTONS` -input mode. - -@code -glfwSetInputMode(window, GLFW_STICKY_MOUSE_BUTTONS, 1); -@endcode - -When sticky mouse buttons mode is enabled, the pollable state of a mouse button -will remain `GLFW_PRESS` until the state of that button is polled with @ref -glfwGetMouseButton. Once it has been polled, if a mouse button release event -had been processed in the meantime, the state will reset to `GLFW_RELEASE`, -otherwise it will remain `GLFW_PRESS`. - -The `GLFW_MOUSE_BUTTON_LAST` constant holds the highest value of any -[named button](@ref buttons). - - -@subsection input_scroll Scroll input - -If you wish to be notified when the user scrolls, whether with a mouse wheel or -touchpad gesture, set a scroll callback. - -@code -glfwSetScrollCallback(window, scroll_callback); -@endcode - -The callback function receives two-dimensional scroll offsets. - -@code -void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) -{ -} -@endcode - -A simple mouse wheel, being vertical, provides offsets along the Y-axis. - - -@section input_joy Joystick input - -The joystick functions expose connected joysticks and controllers, with both -referred to as joysticks. It supports up to sixteen joysticks, ranging from -`GLFW_JOYSTICK_1`, `GLFW_JOYSTICK_2` up to `GLFW_JOYSTICK_LAST`. You can test -whether a [joystick](@ref joysticks) is present with @ref glfwJoystickPresent. - -@code -int present = glfwJoystickPresent(GLFW_JOYSTICK_1); -@endcode - -When GLFW is initialized, detected joysticks are added to to the beginning of -the array, starting with `GLFW_JOYSTICK_1`. Once a joystick is detected, it -keeps its assigned index until it is disconnected, so as joysticks are connected -and disconnected, they will become spread out. - -Joystick state is updated as needed when a joystick function is called and does -not require a window to be created or @ref glfwPollEvents or @ref glfwWaitEvents -to be called. - - -@subsection input_joy_axis Joystick axis states - -The positions of all axes of a joystick are returned by @ref -glfwGetJoystickAxes. See the reference documentation for the lifetime of the -returned array. - -@code -int count; -const float* axes = glfwGetJoystickAxes(GLFW_JOYSTICK_1, &count); -@endcode - -Each element in the returned array is a value between -1.0 and 1.0. - - -@subsection input_joy_button Joystick button states - -The states of all buttons of a joystick are returned by @ref -glfwGetJoystickButtons. See the reference documentation for the lifetime of the -returned array. - -@code -int count; -const unsigned char* axes = glfwGetJoystickButtons(GLFW_JOYSTICK_1, &count); -@endcode - -Each element in the returned array is either `GLFW_PRESS` or `GLFW_RELEASE`. - - -@subsection input_joy_name Joystick name - -The human-readable, UTF-8 encoded name of a joystick is returned by @ref -glfwGetJoystickName. See the reference documentation for the lifetime of the -returned string. - -@code -const char* name = glfwGetJoystickName(GLFW_JOYSTICK_1); -@endcode - -Joystick names are not guaranteed to be unique. Two joysticks of the same model -and make may have the same name. Only the [joystick token](@ref joysticks) is -guaranteed to be unique, and only until that joystick is disconnected. - - -@section input_time Time input - -GLFW provides high-resolution time input, in seconds, with @ref glfwGetTime. - -@code -double seconds = glfwGetTime(); -@endcode - -It returns the number of seconds since the timer was started when the library -was initialized with @ref glfwInit. The platform-specific time sources used -usually have micro- or nanosecond resolution. - -You can modify the reference time with @ref glfwSetTime. - -@code -glfwSetTime(4.0); -@endcode - -This sets the timer to the specified time, in seconds. - - -@section input_clipboard Clipboard input and output - -If the system clipboard contains a UTF-8 encoded string or if it can be -converted to one, you can retrieve it with @ref glfwGetClipboardString. See the -reference documentation for the lifetime of the returned string. - -@code -const char* clipboard = glfwGetClipboardString(window); -@endcode - -The contents of the system clipboard can be set to a UTF-8 encoded string with -@ref glfwSetClipboardString. - -@code -glfwSetClipboardString(window, "A string with words in it"); -@endcode - -The clipboard functions take a window handle argument because some window -systems require a window to communicate with the system clipboard. Any valid -window may be used. - - -@section input_drop Path drop input - -If you wish to receive the paths of files and/or directories dropped on -a window, set a file drop callback. - -@code -glfwSetDropCallback(window, drop_callback); -@endcode - -The callback function receives an array of paths encoded as UTF-8. - -@code -void drop_callback(GLFWwindow* window, int count, const char** paths) -{ - int i; - for (i = 0; i < count; i++) - handle_dropped_file(paths[i]); -} -@endcode - -The path array and its strings are only valid until the file drop callback -returns, as they may have been generated specifically for that event. You need -to make a deep copy of the array if you want to keep the paths. - -*/ diff --git a/extern/glfw/docs/internal.dox b/extern/glfw/docs/internal.dox index 0389af6..e32db62 100644 --- a/extern/glfw/docs/internal.dox +++ b/extern/glfw/docs/internal.dox @@ -57,10 +57,10 @@ Examples: @ref _glfwIsValidContextConfig, @ref _GLFWwindow, `_glfw.currentRamp` 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. +interface is never directly called by users of GLFW and never directly calls the +user's code. It is also prohibited from modifying the platform-independent part +of the internal structs. Instead, it calls the event interface when events +interesting to GLFW are received. The platform interface mirrors those parts of the public interface that needs to perform platform-specific operations on some or all platforms. The are also @@ -85,8 +85,8 @@ Examples: `window.win32.handle`, `_glfw.x11.display` @section internals_event Event interface 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. +interface and is responsible for delivering the events it receives to the user, +either via callbacks, via window state changes or both. The function names of the event interface use a `_glfwInput` prefix and the ObjectEvent pattern. @@ -105,8 +105,8 @@ Examples: `clearScrollOffsets` @section internals_config Configuration macros 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 `glfw_config.h.in` file by CMake. +interfaces and code paths to use. They are defined in the config.h header file, +which is generated from the `config.h.in` file by CMake. Configuration macros the same style as tokens in the public interface, except with a leading underscore. diff --git a/extern/glfw/docs/intro.dox b/extern/glfw/docs/intro.dox deleted file mode 100644 index 5304678..0000000 --- a/extern/glfw/docs/intro.dox +++ /dev/null @@ -1,336 +0,0 @@ -/*! - -@page intro Introduction to the API - -@tableofcontents - -This guide introduces the basic concepts of GLFW and describes initialization, -error handling and API guarantees and limitations. For a broad but shallow -tutorial, see @ref quick instead. There are also guides for the other areas of -GLFW. - - - @ref window - - @ref context - - @ref monitor - - @ref input - - -@section intro_init Initialization and termination - -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. - -Only the following functions may be called before the library has been -successfully initialized, and only from the main thread. - - - @ref glfwGetVersion - - @ref glfwGetVersionString - - @ref glfwSetErrorCallback - - @ref glfwInit - - @ref glfwTerminate - -Calling any other function before that time will cause a @ref -GLFW_NOT_INITIALIZED error. - - -@subsection intro_init_init Initializing GLFW - -The library is initialized with @ref glfwInit, which returns zero if an error -occurred. - -@code -if (!glfwInit()) -{ - // Handle initialization failure -} -@endcode - -If any part of initialization fails, all remaining bits are terminated as if -@ref glfwTerminate was called. The library only needs to be initialized once -and additional calls to an already initialized library will simply return -non-zero immediately. - -Once the library has been successfully initialized, it should be terminated -before the application exits. - - -@subsection intro_init_terminate Terminating GLFW - -Before your application exits, you should terminate the GLFW library if it has -been initialized. This is done with @ref glfwTerminate. - -@code -glfwTerminate(); -@endcode - -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 resources allocated by GLFW. - -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. - - -@section error_handling Error handling - -Some GLFW functions have return values that indicate an error, but this is often -not very helpful when trying to figure out _why_ the error occurred. Some -functions also return otherwise valid values on error. Finally, far from all -GLFW functions have return values. - -This is where the error callback comes in. This callback is called whenever an -error occurs. It is set with @ref glfwSetErrorCallback, a function that may be -called regardless of whether GLFW is initialized. - -@code -glfwSetErrorCallback(error_callback); -@endcode - -The error callback receives a human-readable description of the error and (when -possible) its cause. The description encoded as UTF-8. The callback is also -provided with an [error code](@ref errors). - -@code -void error_callback(int error, const char* description) -{ - puts(description); -} -@endcode - -The error code indicates the general category of the error. Some error codes, -such as @ref GLFW_NOT_INITIALIZED has only a single meaning, whereas others like -@ref GLFW_PLATFORM_ERROR are used for many different errors. - -The description string is only valid until the error callback returns, as it may -have been generated specifically for that error. This lets GLFW provide much -more specific error descriptions but means you must make a copy if you want to -keep the description string. - - -@section coordinate_systems Coordinate systems - -GLFW has two primary coordinate systems: the _virtual screen_ and the window -_client area_ or _content area_. Both use the same unit: _virtual screen -coordinates_, or just _screen coordinates_, which don't necessarily correspond -to pixels. - - - -Both the virtual screen and the client area coordinate systems have the X-axis -pointing to the right and the Y-axis pointing down. - -Window and monitor positions are specified as the position of the upper-left -corners of their content areas relative to the virtual screen, while cursor -positions are specified relative to a window's client area. - -Because the origin of the window's client area coordinate system is also the -point from which the window position is specified, you can translate client area -coordinates to the virtual screen by adding the window position. The window -frame, when present, extends out from the client area but does not affect the -window position. - -Almost all positions and sizes in GLFW are measured in screen coordinates -relative to one of the two origins above. This includes cursor positions, -window positions and sizes, window frame sizes, monitor positions and video mode -resolutions. - -Two exceptions are the [monitor physical size](@ref monitor_size), which is -measured in millimetres, and [framebuffer size](@ref window_fbsize), which is -measured in pixels. - -Pixels and screen coordinates may map 1:1 on your machine, but they won't on -every other machine, for example on a Mac with a Retina display. The ratio -between screen coordinates and pixels may also change at run-time depending on -which monitor the window is currently considered to be on. - - -@section guarantees_limitations Guarantees and limitations - -This section describes the conditions under which GLFW can be expected to -function, barring any bugs in GLFW, 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 -will not be considered a bug. - - -@subsection lifetime Pointer lifetimes - -GLFW will never free any pointer you provide to it and you must never free any -pointer it provides to you. - -Many GLFW functions return pointers to dynamically allocated structures, strings -or arrays, and some callbacks are provided with strings or arrays. These are -always managed by GLFW and should never be freed by the application. The -lifetime of these pointers is documented for each GLFW function and callback. -If you need to keep this data, you must copy it before its lifetime expires. - -Many GLFW functions accept pointers to structures or strings allocated by the -application. These are never freed by GLFW and are always the responsibility of -the application. If GLFW needs to keep the data in these structures or strings, -they are copied before the function returns. - -Pointer lifetimes are guaranteed not to be shortened in future minor releases. - - -@subsection reentrancy Reentrancy - -GLFW event processing and object creation and destruction are not reentrant. -This means that the following functions may not be called from any callback -function: - - - @ref glfwCreateWindow - - @ref glfwDestroyWindow - - @ref glfwCreateCursor - - @ref glfwDestroyCursor - - @ref glfwPollEvents - - @ref glfwWaitEvents - - -@subsection thread_safety Thread safety - -Most GLFW functions may only be called from the main thread. The reference -documentation for every GLFW function states whether it is limited to the main -thread. - -There are some general rules that make it easier to remember which functions are -limited to the main thread. The following tasks may only be performed on the -main thread: - - - Initialization and termination - - Event processing - - Creation and destruction of window, context and cursor objects - -Because event processing must be performed on the main thread, all callbacks -except for the error callback will only be called on that thread. The error -callback may be called on any thread, as any GLFW function may generate errors. - -The posting of empty events may be done from any thread. The window user -pointer and close flag may also be accessed and modified from any thread, but -this is not synchronized by GLFW. The following window related functions may -be called from any thread: - - - @ref glfwPostEmptyEvent - - @ref glfwGetWindowUserPointer - - @ref glfwSetWindowUserPointer - - @ref glfwWindowShouldClose - - @ref glfwSetWindowShouldClose - -Rendering may be done on any thread. The following context related functions -may be called from any thread: - - - @ref glfwMakeContextCurrent - - @ref glfwGetCurrentContext - - @ref glfwSwapBuffers - - @ref glfwSwapInterval - - @ref glfwExtensionSupported - - @ref glfwGetProcAddress - -The timer may be accessed from any thread, but this is not synchronized by GLFW. -The following timer related functions may be called from any thread: - - - @ref glfwGetTime - -No GLFW function may be called from any other thread until GLFW has been -successfully initialized on the main thread, including functions that may called -before initialization. - -GLFW uses no synchronization objects internally except for thread-local storage -to keep track of the current context for each thread. Synchronization is left -to the application. - -Functions that may currently be called from any thread will always remain so, -but functions that are currently limited to the main may be updated to allow -calls from any thread in future releases. - - -@subsection compatibility Version compatibility - -GLFW guarantees binary backward compatibility with earlier minor versions of the -API. This means that you can drop in a newer version of the GLFW DLL / shared -library / dynamic library and existing applications will continue to run. - -Once a function or constant has been added, the signature of that function or -value of that constant will remain unchanged until the next major version of -GLFW. No compatibility of any kind is guaranteed between major versions. - -Undefined behavior, i.e. behavior that is not described in reference -documentation, may change at any time until it is documented. - -If the reference documentation and the implementation differ, the reference -documentation is correct and the implementation will be fixed in the next -release. - - -@subsection event_order Event order - -The order of arrival of related events is not guaranteed to be consistent -across platforms. The exception is synthetic key and mouse button release -events, which are always delivered after the window defocus event. - - -@section intro_version Version management - -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. - - -@subsection intro_version_compile Compile-time version - -The compile-time version of GLFW is provided by the GLFW header with the -`GLFW_VERSION_MAJOR`, `GLFW_VERSION_MINOR` and `GLFW_VERSION_REVISION` macros. - -@code -printf("Compiled against GLFW %i.%i.%i\n", - GLFW_VERSION_MAJOR, - GLFW_VERSION_MINOR, - GLFW_VERSION_REVISION); -@endcode - - -@subsection intro_version_runtime Run-time version - -The run-time version can be retrieved with @ref glfwGetVersion, a function that -may be called regardless of whether GLFW is initialized. - -@code -int major, minor, revision; -glfwGetVersion(&major, &minor, &revision); - -printf("Running against GLFW %i.%i.%i\n", major, minor, revision); -@endcode - - -@subsection intro_version_string Version string - -GLFW 3 also provides a compile-time generated version string that describes the -version, platform, compiler and any platform-specific compile-time options. -This is primarily intended for submitting bug reports, to allow developers to -see which code paths are enabled in a binary. - -The version string is returned by @ref glfwGetVersionString, a function that may -be called regardless of whether GLFW is initialized. - -The format of the string is as follows: - - The version of GLFW - - The name of the window system API - - The name of the context creation API - - Any additional options or APIs - -For example, when compiling GLFW 3.0 with MinGW using the Win32 and WGL -back ends, the version string may look something like this: - -@code -3.0.0 Win32 WGL MinGW -@endcode - -@note Do not parse the version string to find the GLFW library version. The -@ref glfwGetVersion function provides the version of the library binary in -numeric form. - -*/ diff --git a/extern/glfw/docs/main.dox b/extern/glfw/docs/main.dox index 7aa1d45..fac4b4d 100644 --- a/extern/glfw/docs/main.dox +++ b/extern/glfw/docs/main.dox @@ -4,39 +4,17 @@ @section main_intro Introduction -__GLFW__ is a free, Open Source, multi-platform library for creating windows -with OpenGL or OpenGL ES contexts and receiving many kinds of input. It is easy -to integrate into existing applications and does not lay claim to the main loop. +GLFW is a free, Open Source, multi-platform library for opening a window, +creating an OpenGL context and managing input. It is easy to integrate into +existing applications and does not lay claim to the main loop. -This is the documentation for version 3.1, which adds many -[new features](@ref news_31). +This is the documentation for version 3.0, which has [many new features](@ref news). -@ref quick is a guide for those new to GLFW. It takes you through how to write -a small but complete program. For people coming from GLFW 2, the @ref moving -guide explains what has changed and how to update existing code to use the new -API. +There is a [quick tutorial](@ref quick) for people new to GLFW, which shows how +to write a small but complete program. -There are guides for each of the various areas of the API. - - - @ref intro – initialization, error handling and high-level design - - @ref window – creating and working with windows and framebuffers - - @ref context – working with OpenGL and OpenGL ES contexts - - @ref monitor – enumerating and working with monitors and video modes - - @ref input – receiving events, polling and processing input - -The [FAQ](http://www.glfw.org/faq.html) answers many common questions about the -design, implementation and use of GLFW. - -The [reference documentation](modules.html) provides more detailed information -about specific functions. - -Once you have written a program, see the @ref compile and @ref build guides. - -Finally, the @ref compat guide explains what APIs, standards and protocols GLFW -uses and what happens when they are not present on a given machine. - -This documentation was generated with Doxygen. The sources for it are available -in both the [source distribution](http://www.glfw.org/download.html) and -[GitHub repository](https://github.com/glfw/glfw). +If you have used GLFW 2.x in the past, there is a +[transition guide](@ref moving) that explains what has changed and how to update +existing code to use the new API. */ diff --git a/extern/glfw/docs/monitor.dox b/extern/glfw/docs/monitor.dox index a42d195..a3ada5a 100644 --- a/extern/glfw/docs/monitor.dox +++ b/extern/glfw/docs/monitor.dox @@ -1,43 +1,19 @@ /*! -@page monitor Monitor guide +@page monitor Multi-monitor guide @tableofcontents -This guide introduces the monitor related functions of GLFW. There are also -guides for the other areas of GLFW. - - - @ref intro - - @ref window - - @ref context - - @ref input - -To see how GLFW views your monitor setup and its available video modes, run the -`modes` test program. - @section monitor_objects Monitor objects -A monitor object represents a currently connected monitor and is represented as -a pointer to the [opaque](https://en.wikipedia.org/wiki/Opaque_data_type) type -@ref GLFWmonitor. Monitor objects cannot be created or destroyed by the -application and retain their addresses until the monitors they represent are -disconnected or until the library is [terminated](@ref intro_init_terminate). - -Each monitor has a current video mode, a list of supported video modes, -a virtual position, a human-readable name, an estimated physical size and -a gamma ramp. One of the monitors is the primary monitor. - -The virtual position of a monitor is in -[screen coordinates](@ref coordinate_systems) and, together with the current -video mode, describes the viewports that the connected monitors provide into the -virtual desktop that spans them. +The @ref GLFWmonitor object represents a currently connected monitor. -@subsection monitor_monitors Retrieving monitors +@section monitor_monitors Retrieving monitors -The primary monitor is returned by @ref glfwGetPrimaryMonitor. It is the user's -preferred monitor and is usually the one with global UI elements like task bar +The primary monitor is returned by @ref glfwGetPrimaryMonitor. It is usually +the user's preferred monitor and the one with global UI elements like task bar or menu bar. @code @@ -45,78 +21,38 @@ GLFWmonitor* primary = glfwGetPrimaryMonitor(); @endcode You can retrieve all currently connected monitors with @ref glfwGetMonitors. -See the reference documentation for the lifetime of the returned array. @code int count; GLFWmonitor** monitors = glfwGetMonitors(&count); @endcode -The primary monitor is always the first monitor in the returned array, but other -monitors may be moved to a different index when a monitor is connected or -disconnected. +@section monitor_modes Retrieving video modes -@subsection monitor_event Monitor configuration changes - -If you wish to be notified when a monitor is connected or disconnected, set -a monitor callback. - -@code -glfwSetMonitorCallback(monitor_callback); -@endcode - -The callback function receives the handle for the monitor that has been -connected or disconnected and a monitor action. - -@code -void monitor_callback(GLFWmonitor* monitor, int event) -{ -} -@endcode - -The action is one of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`. - - -@section monitor_properties Monitor properties - -Each monitor has a current video mode, a list of supported video modes, -a virtual position, a human-readable name, an estimated physical size and -a gamma ramp. - - -@subsection monitor_modes Video modes - -GLFW generally does a good job selecting a suitable video mode when you create -a full screen window, but it is sometimes useful to know exactly which video -modes are supported. - -Video modes are represented as @ref GLFWvidmode structures. You can get an -array of the video modes supported by a monitor with @ref glfwGetVideoModes. -See the reference documentation for the lifetime of the returned array. +Although GLFW generally does a good job at selecting a suitable video +mode for you when you open a full screen window, it is sometimes useful to +know exactly which modes are available on a certain system. For example, +you may want to present the user with a list of video modes to select +from. To get a list of available video modes, you can use the function +@ref glfwGetVideoModes. @code int count; GLFWvidmode* modes = glfwGetVideoModes(monitor, &count); @endcode -To get the current video mode of a monitor call @ref glfwGetVideoMode. See the -reference documentation for the lifetime of the returned pointer. +To get the current video mode of a monitor call @ref glfwGetVideoMode. @code const GLFWvidmode* mode = glfwGetVideoMode(monitor); @endcode -The resolution of a video mode is specified in -[screen coordinates](@ref coordinate_systems), not pixels. +@section monitor_size Monitor physical size -@subsection monitor_size Physical size - -The physical size of a monitor in millimetres, or an estimation of it, can be -retrieved with @ref glfwGetMonitorPhysicalSize. This has no relation to its -current _resolution_, i.e. the width and height of its current -[video mode](@ref monitor_modes). +The physical size in millimetres of a monitor, or an approximation of it, can be +retrieved with @ref glfwGetMonitorPhysicalSize. @code int widthMM, heightMM; @@ -131,63 +67,28 @@ const double dpi = mode->width / (widthMM / 25.4); @endcode -@subsection monitor_pos Virtual position +@section monitor_name Monitor name -The position of the monitor on the virtual desktop, in -[screen coordinates](@ref coordinate_systems), can be retrieved with @ref -glfwGetMonitorPos. - -@code -int xpos, ypos; -glfwGetMonitorPos(monitor, &xpos, &ypos); -@endcode - - -@subsection monitor_name Human-readable name - -The human-readable, UTF-8 encoded name of a monitor is returned by @ref -glfwGetMonitorName. See the reference documentation for the lifetime of the -returned string. +The name of a monitor is returned by @ref glfwGetMonitorName. @code const char* name = glfwGetMonitorName(monitor); @endcode -Monitor names are not guaranteed to be unique. Two monitors of the same model -and make may have the same name. Only the monitor handle is guaranteed to be -unique, and only until that monitor is disconnected. +The monitor name is a regular C string using the UTF-8 encoding. Note that +monitor names are not guaranteed to be unique. -@subsection monitor_gamma Gamma ramp +@section monitor_gamma Monitor gamma ramp The gamma ramp of a monitor can be set with @ref glfwSetGammaRamp, which accepts a monitor handle and a pointer to a @ref GLFWgammaramp structure. @code -GLFWgammaramp ramp; -unsigned short red[256], green[256], blue[256]; - -ramp.size = 256; -ramp.red = red; -ramp.green = green; -ramp.blue = blue; - -for (i = 0; i < ramp.size; i++) -{ - // Fill out gamma ramp arrays as desired -} - glfwSetGammaRamp(monitor, &ramp); @endcode -The gamma ramp data is copied before the function returns, so there is no need -to keep it around once the ramp has been set. - -@note It is recommended to use gamma ramps of size 256, as that is the size -supported by all graphics cards on all platforms. - -The current gamma ramp for a monitor is returned by @ref glfwGetGammaRamp. See -the reference documentation for the lifetime of the returned structure. +The current gamma ramp for a monitor is returned by @ref glfwGetGammaRamp. @code const GLFWgammaramp* ramp = glfwGetGammaRamp(monitor); diff --git a/extern/glfw/docs/moving.dox b/extern/glfw/docs/moving.dox index c850ab4..4ca9d6c 100644 --- a/extern/glfw/docs/moving.dox +++ b/extern/glfw/docs/moving.dox @@ -5,279 +5,55 @@ @tableofcontents This is a transition guide for moving from GLFW 2 to 3. It describes what has -changed or been removed, but does _not_ include +changed or been removed, but does *not* include [new features](@ref news) unless they are required when moving an existing code -base onto the new API. For example, the new multi-monitor functions are +base onto the new API. For example, use of the new multi-monitor functions are required to create full screen windows with GLFW 3. -@section moving_removed Changed and removed features +@section moving_removed Removed features -@subsection moving_renamed_files Renamed library and header file +@subsection moving_threads Threading functions -The GLFW 3 header is named @ref glfw3.h and moved to the `GLFW` directory, to -avoid collisions with the headers of other major versions. Similarly, the GLFW -3 library is named `glfw3,` except when it's installed as a shared library on -Unix-like systems, where it uses the -[soname](https://en.wikipedia.org/wiki/soname) `libglfw.so.3`. - -@par Old syntax -@code -#include -@endcode - -@par New syntax -@code -#include -@endcode - - -@subsection moving_threads Removal of threading functions - -The threading functions have been removed, including the per-thread sleep -function. They were fairly primitive, under-used, poorly integrated and took -time away from the focus of GLFW (i.e. context, input and window). There are -better threading libraries available and native threading support is available -in both [C++11](http://en.cppreference.com/w/cpp/thread) and -[C11](http://en.cppreference.com/w/c/thread), both of which are gaining -traction. +The threading functions have been removed, including the sleep function. They +were fairly primitive, under-used, poorly integrated and took time away from the +focus of GLFW (i.e. context, input and window). There are better threading +libraries available and native threading support is available in both C++11 and +C11, both of which are gaining traction. If you wish to use the C++11 or C11 facilities but your compiler doesn't yet support them, see the [TinyThread++](https://gitorious.org/tinythread/tinythreadpp) and -[TinyCThread](https://github.com/tinycthread/tinycthread) projects created by +[TinyCThread](https://gitorious.org/tinythread/tinycthread) projects created by the original author of GLFW. These libraries implement a usable subset of the threading APIs in C++11 and C11, and in fact some GLFW 3 test programs use TinyCThread. -However, GLFW 3 has better support for _use from multiple threads_ than GLFW -2 had. Contexts can be made current on any thread, although only a single -thread at a time, and the documentation explicitly states which functions may be -used from any thread and which may only be used from the main thread. - -@par Removed functions -`glfwSleep`, `glfwCreateThread`, `glfwDestroyThread`, `glfwWaitThread`, -`glfwGetThreadID`, `glfwCreateMutex`, `glfwDestroyMutex`, `glfwLockMutex`, -`glfwUnlockMutex`, `glfwCreateCond`, `glfwDestroyCond`, `glfwWaitCond`, -`glfwSignalCond`, `glfwBroadcastCond` and `glfwGetNumberOfProcessors`. +However, GLFW 3 has better support for *use from multiple threads* than GLFW +2 had. Contexts can be made current on and rendered with from secondary +threads, and the documentation explicitly states which functions may be used +from secondary threads and which may only be used from the main thread, i.e. the +thread that calls main. -@subsection moving_image Removal of image and texture loading +@subsection moving_image Image and texture loading The image and texture loading functions have been removed. They only supported the Targa image format, making them mostly useful for beginner level examples. To become of sufficiently high quality to warrant keeping them in GLFW 3, they -would need not only to support other formats, but also modern extensions to -OpenGL texturing. This would either add a number of external +would need not only to support other formats, but also modern extensions to the +OpenGL texturing facilities. This would either add a number of external dependencies (libjpeg, libpng, etc.), or force GLFW to ship with inline versions of these libraries. -As there already are libraries doing this, it is unnecessary both to duplicate -the work and to tie the duplicate to GLFW. The resulting library would also be -platform-independent, as both OpenGL and stdio are available wherever GLFW is. - -@par Removed functions -`glfwReadImage`, `glfwReadMemoryImage`, `glfwFreeImage`, `glfwLoadTexture2D`, -`glfwLoadMemoryTexture2D` and `glfwLoadTextureImage2D`. +As there already are libraries doing this, it seems unnecessary both to +duplicate this work and to tie this duplicate to GLFW. Projects similar to +GLFW, such as freeglut, could also gain from such a library. Also, would be no +platform-specific part of such a library, as both OpenGL and stdio are available +wherever GLFW is. -@subsection moving_stdcall Removal of GLFWCALL macro - -The `GLFWCALL` macro, which made callback functions use -[__stdcall](http://msdn.microsoft.com/en-us/library/zxk0tw93.aspx) on Windows, -has been removed. GLFW is written in C, not Pascal. Removing this macro means -there's one less thing for application programmers to remember, i.e. the -requirement to mark all callback functions with `GLFWCALL`. It also simplifies -the creation of DLLs and DLL link libraries, as there's no need to explicitly -disable `@n` entry point suffixes. - -@par Old syntax -@code -void GLFWCALL callback_function(...); -@endcode - -@par New syntax -@code -void callback_function(...); -@endcode - - -@subsection moving_window_handles Window handle parameters - -Because GLFW 3 supports multiple windows, window handle parameters have been -added to all window-related GLFW functions and callbacks. The handle of -a newly created window is returned by @ref glfwCreateWindow (formerly -`glfwOpenWindow`). Window handles are pointers to the -[opaque](https://en.wikipedia.org/wiki/Opaque_data_type) type @ref GLFWwindow. - -@par Old syntax -@code -glfwSetWindowTitle("New Window Title"); -@endcode - -@par New syntax -@code -glfwSetWindowTitle(window, "New Window Title"); -@endcode - - -@subsection moving_monitor Explicit monitor selection - -GLFW 3 provides support for multiple monitors. To request a full screen mode window, -instead of passing `GLFW_FULLSCREEN` you specify which monitor you wish the -window to use. The @ref glfwGetPrimaryMonitor function returns the monitor that -GLFW 2 would have selected, but there are many other -[monitor functions](@ref monitor). Monitor handles are pointers to the -[opaque](https://en.wikipedia.org/wiki/Opaque_data_type) type @ref GLFWmonitor. - -@par Old basic full screen -@code -glfwOpenWindow(640, 480, 8, 8, 8, 0, 24, 0, GLFW_FULLSCREEN); -@endcode - -@par New basic full screen -@code -window = glfwCreateWindow(640, 480, "My Window", glfwGetPrimaryMonitor(), NULL); -@endcode - -@note The framebuffer bit depth parameters of `glfwOpenWindow` have been turned -into [window hints](@ref window_hints), but as they have been given -[sane defaults](@ref window_hints_values) you rarely need to set these hints. - - -@subsection moving_autopoll Removal of automatic event polling - -GLFW 3 does not automatically poll for events on @ref glfwSwapBuffers, which -means you need to call @ref glfwPollEvents or @ref glfwWaitEvents yourself. -Unlike buffer swap, which acts on a single window, __glfwPollEvents__ and -__glfwWaitEvents__ process events for all windows at once. - -@par Old basic main loop -@code -while (...) -{ - // Process input - // Render output - glfwSwapBuffers(); -} -@endcode - -@par New basic main loop -@code -while (...) -{ - // Process input - // Render output - glfwSwapBuffers(window); - glfwPollEvents(); -} -@endcode - - -@subsection moving_context Explicit context management - -Each GLFW 3 window has its own OpenGL context and only you, the application -programmer, can know which context should be current on which thread at any -given time. Therefore, GLFW 3 leaves that decision to you. - -This means that you need to call @ref glfwMakeContextCurrent after creating -a window before you can call any OpenGL functions. - - -@subsection moving_hidpi Separation of window and framebuffer sizes - -Window positions and sizes now use screen coordinates, which may not be the same -as pixels on machines with high-DPI monitors. This is important as OpenGL uses -pixels, not screen coordinates. For example, the rectangle specified with -`glViewport` needs to use pixels. Therefore, framebuffer size functions have -been added. You can retrieve the size of the framebuffer of a window with @ref -glfwGetFramebufferSize function. A framebuffer size callback has also been -added, which can be set with @ref glfwSetFramebufferSizeCallback. - -@par Old basic viewport setup -@code -glfwGetWindowSize(&width, &height); -glViewport(0, 0, width, height); -@endcode - -@par New basic viewport setup -@code -glfwGetFramebufferSize(window, &width, &height); -glViewport(0, 0, width, height); -@endcode - - -@subsection moving_window_close Window closing changes - -The `GLFW_OPENED` window parameter has been removed. As long as the window has -not been destroyed, whether through @ref glfwDestroyWindow or @ref -glfwTerminate, the window is "open". - -A user attempting to close a window is now just an event like any other. Unlike -GLFW 2, windows and contexts created with GLFW 3 will never be destroyed unless -you choose them to be. Each window now has a close flag that is set to -`GL_TRUE` when the user attempts to close that window. By default, nothing else -happens and the window stays visible. It is then up to you to either destroy -the window, take some other action or simply ignore the request. - -You can query the close flag at any time with @ref glfwWindowShouldClose and set -it at any time with @ref glfwSetWindowShouldClose. - -@par Old basic main loop -@code -while (glfwGetWindowParam(GLFW_OPENED)) -{ - ... -} -@endcode - -@par New basic main loop -@code -while (!glfwWindowShouldClose(window)) -{ - ... -} -@endcode - -The close callback no longer returns a value. Instead, it is called after the -close flag has been set so it can override its value, if it chooses to, before -event processing completes. You may however not call @ref glfwDestroyWindow -from the close callback (or any other window related callback). - -@par Old syntax -@code -int GLFWCALL window_close_callback(void); -@endcode - -@par New syntax -@code -void window_close_callback(GLFWwindow* window); -@endcode - -@note GLFW never clears the close flag to `GL_FALSE`, meaning you can use it -for other reasons to close the window as well, for example the user choosing -Quit from an in-game menu. - - -@subsection moving_hints Persistent window hints - -The `glfwOpenWindowHint` function has been renamed to @ref glfwWindowHint. - -Window hints are no longer reset to their default values on window creation, but -instead retain their values until modified by @ref glfwWindowHint or @ref -glfwDefaultWindowHints, or until the library is terminated and re-initialized. - - -@subsection moving_video_modes Video mode enumeration - -Video mode enumeration is now per-monitor. The @ref glfwGetVideoModes function -now returns all available modes for a specific monitor instead of requiring you -to guess how large an array you need. The `glfwGetDesktopMode` function, which -had poorly defined behavior, has been replaced by @ref glfwGetVideoMode, which -returns the current mode of a monitor. - - -@subsection moving_char_up Removal of character actions +@subsection moving_char_up Character actions The action parameter of the [character callback](@ref GLFWcharfun) has been removed. This was an artefact of the origin of GLFW, i.e. being developed in @@ -285,92 +61,29 @@ English by a Swede. However, many keyboard layouts require more than one key to produce characters with diacritical marks. Even the Swedish keyboard layout requires this for uncommon cases like ü. -@par Old syntax -@code -void GLFWCALL character_callback(int character, int action); -@endcode - -@par New syntax -@code -void character_callback(GLFWwindow* window, int character); -@endcode +Note that this is only the removal of the *action parameter* of the character +callback, *not* the removal of the character callback itself. -@subsection moving_cursorpos Cursor position changes +@subsection moving_wheel Mouse wheel position -The `glfwGetMousePos` function has been renamed to @ref glfwGetCursorPos, -`glfwSetMousePos` to @ref glfwSetCursorPos and `glfwSetMousePosCallback` to @ref -glfwSetCursorPosCallback. - -The cursor position is now `double` instead of `int`, both for the direct -functions and for the callback. Some platforms can provide sub-pixel cursor -movement and this data is now passed on to the application where available. On -platforms where this is not provided, the decimal part is zero. - -GLFW 3 only allows you to position the cursor within a window using @ref -glfwSetCursorPos (formerly `glfwSetMousePos`) when that window is active. -Unless the window is active, the function fails silently. +The `glfwGetMouseWheel` function has been removed. Scroll events do not +represent an absolute state, but is instead an interpretation of a relative +change in state, like character input. So, like character input, there is no +sane 'current state' to return. The mouse wheel callback has been replaced by +a [scroll callback](@ref GLFWscrollfun) that receives two-dimensional scroll +offsets. -@subsection moving_wheel Wheel position replaced by scroll offsets +@subsection moving_stdcall GLFWCALL macro -The `glfwGetMouseWheel` function has been removed. Scrolling is the input of -offsets and has no absolute position. The mouse wheel callback has been -replaced by a [scroll callback](@ref GLFWscrollfun) that receives -two-dimensional floating point scroll offsets. This allows you to receive -precise scroll data from for example modern touchpads. - -@par Old syntax -@code -void GLFWCALL mouse_wheel_callback(int position); -@endcode - -@par New syntax -@code -void scroll_callback(GLFWwindow* window, double xoffset, double yoffset); -@endcode - -@par Removed functions -`glfwGetMouseWheel` - - -@subsection moving_repeat Key repeat action - -The `GLFW_KEY_REPEAT` enable has been removed and key repeat is always enabled -for both keys and characters. A new key action, `GLFW_REPEAT`, has been added -to allow the [key callback](@ref GLFWkeyfun) to distinguish an initial key press -from a repeat. Note that @ref glfwGetKey still returns only `GLFW_PRESS` or -`GLFW_RELEASE`. - - -@subsection moving_keys Physical key input - -GLFW 3 key tokens map to physical keys, unlike in GLFW 2 where they mapped to -the values generated by the current keyboard layout. The tokens are named -according to the values they would have using the standard US layout, but this -is only a convenience, as most programmers are assumed to know that layout. -This means that (for example) `GLFW_KEY_LEFT_BRACKET` is always a single key and -is the same key in the same place regardless of what keyboard layouts the users -of your program has. - -The key input facility was never meant for text input, although using it that -way worked slightly better in GLFW 2. If you were using it to input text, you -should be using the character callback instead, on both GLFW 2 and 3. This will -give you the characters being input, as opposed to the keys being pressed. - -GLFW 3 has key tokens for all keys on a standard 105 key keyboard, so instead of -having to remember whether to check for `'a'` or `'A'`, you now check for -`GLFW_KEY_A`. - - -@subsection moving_joystick Joystick function changes - -The `glfwGetJoystickPos` function has been renamed to @ref glfwGetJoystickAxes. - -The `glfwGetJoystickParam` function and the `GLFW_PRESENT`, `GLFW_AXES` and -`GLFW_BUTTONS` tokens have been replaced by the @ref glfwJoystickPresent -function as well as axis and button counts returned by the @ref -glfwGetJoystickAxes and @ref glfwGetJoystickButtons functions. +The `GLFWCALL` macro, which made callback functions use +[__stdcall](http://msdn.microsoft.com/en-us/library/zxk0tw93.aspx) on Windows, +has been removed. GLFW is written in C, not Pascal. Removing this macro means +there's one less thing for users of GLFW to remember, i.e. the requirement to +mark all callback functions with `GLFWCALL`. It also simplifies the creation of +DLLs and DLL link libraries, as there's no need to explicitly disable `@n` entry +point suffixes. @subsection moving_mbcs Win32 MBCS support @@ -412,43 +125,152 @@ or something else, are nowadays expected to be good desktop citizens and allow these hotkeys to function even when running in full screen mode. +@subsection moving_opened Window open parameter + +The `GLFW_OPENED` window parameter has been removed. As long as the +[window object](@ref window_object) is around, the window is "open". To detect +when the user attempts to close the window, see @ref glfwWindowShouldClose and +the [close callback](@ref GLFWwindowclosefun). + + +@subsection moving_autopoll Automatic polling of events + +GLFW 3 does not automatically poll for events on @ref glfwSwapBuffers, which +means you need to call @ref glfwPollEvents or @ref glfwWaitEvents yourself. +Unlike buffer swap, the event processing functions act on all windows at once. + + @subsection moving_terminate Automatic termination -GLFW 3 does not register @ref glfwTerminate with `atexit` at initialization, -because `exit` calls registered functions from the calling thread and while it -is permitted to call `exit` from any thread, @ref glfwTerminate may only be -called from the main thread. - -To release all resources allocated by GLFW, you should call @ref glfwTerminate -yourself, from the main thread, before the program terminates. Note that this -destroys all windows not already destroyed with @ref glfwDestroyWindow, -invalidating any window handles you may still have. +GLFW 3 does not register @ref glfwTerminate with `atexit` at initialization. To +properly release all resources allocated by GLFW, you should therefore call @ref +glfwTerminate yourself before exiting. @subsection moving_glu GLU header inclusion -GLFW 3 does not by default include the GLU header and GLU itself has been -deprecated by [Khronos](https://en.wikipedia.org/wiki/Khronos_Group). __New -projects should avoid using GLU__, but if you need to compile legacy code that -has been moved to GLFW 3, you can request that the GLFW header includes it by -defining `GLFW_INCLUDE_GLU` before the inclusion of the GLFW header. - -@par Old syntax -@code -#include -@endcode - -@par New syntax -@code -#define GLFW_INCLUDE_GLU -#include -@endcode +GLFW 3 does not include the GLU header by default and GLU itself has been +deprecated, but you can request that the GLFW 3 header includes it by defining +`GLFW_INCLUDE_GLU` before the inclusion of the GLFW 3 header. -@section moving_tables Name change tables +@section moving_changed Changes to existing features + +@subsection moving_window_handles Window handles + +Because GLFW 3 supports multiple windows, window handle parameters have been +added to all window-related GLFW functions and callbacks. The handle of +a newly created window is returned by @ref glfwCreateWindow (formerly +`glfwOpenWindow`). Window handles are of the `GLFWwindow*` type, i.e. a pointer +to an opaque struct. -@subsection moving_renamed_functions Renamed functions +@subsection moving_monitor Multi-monitor support + +GLFW 3 provides support for multiple monitors, adding the `GLFWmonitor*` handle +type and a set of related functions. To request a full screen mode window, +instead of passing `GLFW_FULLSCREEN` you specify which monitor you wish the +window to use. There is @ref glfwGetPrimaryMonitor that provides behaviour +similar to that of GLFW 2. + + +@subsection moving_window_close Window closing + +Window closing is now just an event like any other. GLFW 3 windows won't +disappear from underfoot even when no close callback is set; instead the +window's close flag is set. You can query this flag using @ref +glfwWindowShouldClose, or capture close events by setting a close callback. The +close flag can be modified from any point in your program using @ref +glfwSetWindowShouldClose. + + +@subsection moving_context Explicit context management + +Each GLFW 3 window has its own OpenGL context and only you, the user, can know +which context should be current on which thread at any given time. Therefore, +GLFW 3 makes no assumptions about when you want a certain context to be current, +leaving that decision to you. + +This means, among other things, that you need to call @ref +glfwMakeContextCurrent after creating a window before you can call any OpenGL +functions. + + +@subsection moving_repeat Key repeat + +The `GLFW_KEY_REPEAT` enable has been removed and key repeat is always enabled +for both keys and characters. A new key action, `GLFW_REPEAT`, has been added +to allow the [key callback](@ref GLFWkeyfun) to distinguish an initial key press +from a repeat. Note that @ref glfwGetKey still returns only `GLFW_PRESS` or +`GLFW_RELEASE`. + + +@subsection moving_keys Physical key input + +GLFW 3 key tokens map to physical keys, unlike in GLFW 2 where they mapped to +the values generated by the current keyboard layout. The tokens are named +according to the values they would have using the standard US layout, but this +is only a convenience, as most programmers are assumed to know that layout. +This means that (for example) `GLFW_KEY_LEFT_BRACKET` is always a single key and +is the same key in the same place regardless of what keyboard layouts the users +of your program has. + +The key input facility was never meant for text input, although using it that +way worked slightly better in GLFW 2. If you were using it to input text, you +should be using the character callback instead, on both GLFW 2 and 3. This will +give you the characters being input, as opposed to the keys being pressed. + +GLFW 3 has key tokens for all keys on a standard 105 key keyboard, so instead of +having to remember whether to check for `'a'` or `'A'`, you now check for +`GLFW_KEY_A`. + + +@subsection moving_joystick Joystick input + +The `glfwGetJoystickPos` function has been renamed to @ref glfwGetJoystickAxes. + +The `glfwGetJoystickParam` function and the `GLFW_PRESENT`, `GLFW_AXES` and +`GLFW_BUTTONS` tokens have been replaced by the @ref glfwJoystickPresent +function as well as axis and button counts returned by the @ref +glfwGetJoystickAxes and @ref glfwGetJoystickButtons functions. + + +@subsection moving_video_modes Video mode enumeration + +Video mode enumeration is now per-monitor. The @ref glfwGetVideoModes function +now returns all available modes for a specific monitor instead of requiring you +to guess how large an array you need. The `glfwGetDesktopMode` function, which +had poorly defined behavior, has been replaced by @ref glfwGetVideoMode, which +returns the current mode of a monitor. + + +@subsection moving_cursor Cursor positioning + +GLFW 3 only allows you to position the cursor within a window using @ref +glfwSetCursorPos (formerly `glfwSetMousePos`) when that window is active. +Unless the window is active, the function fails silently. + + +@subsection moving_hints Persistent window hints + +Window hints are no longer reset to their default values on window creation, but +instead retain their values until modified by @ref glfwWindowHint (formerly +`glfwOpenWindowHint`) or @ref glfwDefaultWindowHints, or until the library is +terminated and re-initialized. + + +@section moving_renamed Name changes + +@subsection moving_renamed_files Library and header file + +The GLFW 3 header is named @ref glfw3.h and moved to the `GLFW` directory, to +avoid collisions with the headers of other major versions. Similarly, the GLFW +3 library is named `glfw3,` except when it's installed as a shared library on +Unix-like systems, where it uses the +[soname](https://en.wikipedia.org/wiki/soname) `libglfw.so.3`. + + +@subsection moving_renamed_functions Functions | GLFW 2 | GLFW 3 | Notes | | --------------------------- | ----------------------------- | ----- | @@ -467,7 +289,7 @@ defining `GLFW_INCLUDE_GLU` before the inclusion of the GLFW header. | `glfwGetDesktopMode` | @ref glfwGetVideoMode | Returns the current mode of a monitor | | `glfwGetJoystickParam` | @ref glfwJoystickPresent | The axis and button counts are provided by @ref glfwGetJoystickAxes and @ref glfwGetJoystickButtons | -@subsection moving_renamed_tokens Renamed tokens +@subsection moving_renamed_tokens Tokens | GLFW 2 | GLFW 3 | Notes | | --------------------------- | ---------------------------- | ----- | diff --git a/extern/glfw/docs/news.dox b/extern/glfw/docs/news.dox index d225d22..6f97afc 100644 --- a/extern/glfw/docs/news.dox +++ b/extern/glfw/docs/news.dox @@ -5,83 +5,6 @@ @tableofcontents -@section news_31 New features in version 3.1 - -@subsection news_31_cursor Custom system cursor support - -GLFW now supports creating and setting custom system cursors. They can be -created with @ref glfwCreateCursor, set with @ref glfwSetCursor and destroyed -with @ref glfwDestroyCursor. Custom cursors are only visible in normal cursor -mode. - - -@subsection news_31_drop File drop event support - -GLFW now provides a callback for receiving the paths of files dropped onto GLFW -windows. The callback is set with @ref glfwSetDropCallback. - - -@subsection news_31_emptyevent Main thread waking support - -GLFW now provides the @ref glfwPostEmptyEvent function for posting an empty -event from another thread to the main thread event queue, causing @ref -glfwWaitEvents to return. - - -@subsection news_31_framesize Window frame size query - -GLFW now supports querying the size, on each side, of the frame around the -client area of a window, with @ref glfwGetWindowFrameSize. - - -@subsection news_31_autoiconify Multi-monitor installation support - -GLFW now supports disabling auto-iconification of full screen windows with -the [GLFW_AUTO_ICONIFY](@ref window_hints_wnd) window hint. This is intended -for people building multi-monitor installations, where you need windows to stay -in full screen despite losing focus. - - -@subsection news_31_floating Floating windows - -GLFW now supports floating windows, also called topmost or always on top, for -easier debugging with the [GLFW_FLOATING](@ref window_hints_wnd) window hint. - - -@subsection news_31_focused Initially unfocused windows - -GLFW now supports preventing a windowed mode window from gaining input focus on -creation, with the [GLFW_FOCUSED](@ref window_hints_wnd) window hint. - - -@subsection news_31_charmods Character with modifiers callback - -GLFW now provides a callback for character events with modifier key bits. The -callback is set with @ref glfwSetCharModsCallback. Unlike the regular character -callback, this will report character events that will not result in a character -being input, for example if the Control key is held down. - - -@subsection news_31_release Context release behavior support - -GLFW now supports controlling whether the pipeline is flushed when a context is -made non-current, with the -[GLFW_CONTEXT_RELEASE_BEHAVIOR](@ref window_hints_ctx) window hint, provided the -machine supports the `GL_KHR_context_flush_control` extension. - - -@subsection news_31_single Single buffering support - -GLFW now supports the creation of single buffered windows, with the -[GLFW_DOUBLEBUFFER](@ref window_hints_fb) window hint. - - -@subsection news_31_egl Stable EGL support - -The support for EGL is now stable, successfully running on PandaBoards, Mesa, -ANGLE, Wayland, AMD EGL and others. - - @section news_30 New features in version 3.0 @subsection news_30_cmake CMake build system @@ -95,7 +18,7 @@ For more information on how to use CMake, see the [CMake manual](http://cmake.org/cmake/help/documentation.html). -@subsection news_30_multiwnd Multi-window support +@subsection new_30_multiwnd Multi-window support GLFW now supports the creation of multiple windows, each with their own OpenGL or OpenGL ES context, and all window functions now take a window handle. Event @@ -139,7 +62,7 @@ glfwSetGamma, which generates a ramp from a gamma value and then sets it. GLFW now supports the creation of OpenGL ES contexts, by setting the `GLFW_CLIENT_API` window hint to `GLFW_OPENGL_ES_API`, where creation of such -contexts are supported. Note that GLFW _does not implement_ OpenGL ES, so your +contexts are supported. Note that GLFW *does not implement* OpenGL ES, so your driver must provide support in a way usable by GLFW. Modern nVidia and Intel drivers support creation of OpenGL ES context using the GLX and WGL APIs, while AMD provides an EGL implementation instead. @@ -156,8 +79,8 @@ through CMake options. GLFW now supports high-DPI monitors on both Windows and OS X, giving windows full resolution framebuffers where other UI elements are scaled up. To achieve this, @ref glfwGetFramebufferSize and @ref glfwSetFramebufferSizeCallback have been -added. These work with pixels, while the rest of the GLFW API works with screen -coordinates. This is important as OpenGL uses pixels, not screen coordinates. +added. These work with pixels, while the rest of the GLFW API work with screen +coordinates. @subsection news_30_error Error callback diff --git a/extern/glfw/docs/quick.dox b/extern/glfw/docs/quick.dox index 21a8a8c..aa32ff3 100644 --- a/extern/glfw/docs/quick.dox +++ b/extern/glfw/docs/quick.dox @@ -4,22 +4,20 @@ @tableofcontents -This guide takes you through writing a simple application using GLFW 3. The -application will create a window and OpenGL context, render a rotating triangle -and exit when the user closes the window or presses Escape. This guide will -introduce a few of the most commonly used functions, but there are many more. +This guide will show how to write simple OpenGL applications using GLFW 3. It +will introduce a few of the most commonly used functions, but there are many +others. To see detailed documentation on any GLFW function, just click on its +name. This guide assumes no experience with earlier versions of GLFW. If you -have used GLFW 2 in the past, read the @ref moving guide, as some functions -behave differently in GLFW 3. +have used GLFW 2.x in the past, you should also read the +[transition guide](@ref moving). -@section quick_steps Step by step +@section quick_include Including the GLFW header -@subsection quick_include Including the GLFW header - -In the source files of your application where you use OpenGL or GLFW, you need -to include the GLFW 3 header file. +In the files of your program where you use OpenGL or GLFW, you need to include +the GLFW 3 header file. @code #include @@ -35,15 +33,15 @@ and pollute your code's namespace with the whole Win32 API. Instead, the GLFW header takes care of this for you, not by including `windows.h`, but rather by itself duplicating only the necessary parts of it. -It does this only where needed, so if `windows.h` _is_ included, the GLFW header +It does this only where needed, so if `windows.h` *is* included, the GLFW header does not try to redefine those symbols. In other words: -- Do _not_ include the OpenGL headers yourself, as GLFW does this for you -- Do _not_ include `windows.h` or other platform-specific headers unless +- Do *not* include the OpenGL headers yourself, as GLFW does this for you +- Do *not* include `windows.h` or other platform-specific headers unless you plan on using those APIs directly -- If you _do_ need to include such headers, do it _before_ including the +- If you *do* need to include such headers, do it *before* including the GLFW one and it will detect this Starting with version 3.0, the GLU header `glu.h` is no longer included by @@ -56,39 +54,40 @@ inclusion of the GLFW header. @endcode -@subsection quick_init_term Initializing and terminating GLFW +@section quick_init_term Initializing and terminating GLFW -Before you can use most GLFW functions, the library must be initialized. On -successful initialization, non-zero is returned. If an error occurred, zero is -returned. +Before you can use most GLFW functions, the library must be initialized. This +is done with @ref glfwInit, which returns non-zero if successful, or zero if an +error occurred. @code if (!glfwInit()) exit(EXIT_FAILURE); @endcode -When you are done using GLFW, typically just before the application exits, you -need to terminate GLFW. +When you are done using GLFW, typically at the very end of the program, you need +to call @ref glfwTerminate. @code glfwTerminate(); @endcode This destroys any remaining windows and releases any other resources allocated by -GLFW. After this call, you must initialize GLFW again before using any GLFW +GLFW. After this call, you must call @ref glfwInit again before using any GLFW functions that require it. -@subsection quick_capture_error Setting an error callback +@section quick_capture_error Setting an error callback Most events are reported through callbacks, whether it's a key being pressed, a GLFW window being moved, or an error occurring. Callbacks are simply C functions (or C++ static methods) that are called by GLFW with arguments describing the event. -In case a GLFW function fails, an error is reported to the GLFW error callback. -You can receive these reports with an error callback. This function must have -the signature below. This simple error callback just prints the error +In case @ref glfwInit or any other GLFW function fails, an error is reported to +the GLFW error callback. You can receive these reports by setting the error +callback. The callback function itself should match the signature of @ref +GLFWerrorfun. Here is a simple error callback that just prints the error description to `stderr`. @code @@ -98,28 +97,28 @@ void error_callback(int error, const char* description) } @endcode -Callback functions must be set, so GLFW knows to call them. The function to set -the error callback is one of the few GLFW functions that may be called before -initialization, which lets you be notified of errors both during and after -initialization. +Setting the callback, so GLFW knows to call it, is done with @ref +glfwSetErrorCallback. This is one of the few GLFW functions that may be called +before @ref glfwInit, which lets you be notified of errors during +initialization, so you should set it before you do anything else with GLFW. @code glfwSetErrorCallback(error_callback); @endcode -@subsection quick_create_window Creating a window and context +@section quick_create_window Creating a window and context -The window and its OpenGL context are created with a single call, which returns -a handle to the created combined window and context object. For example, this -creates a 640 by 480 windowed mode window with an OpenGL context: +The window (and its context) is created with @ref glfwCreateWindow, which +returns a handle to the created window. For example, this creates a 640 by 480 +windowed mode window: @code GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", NULL, NULL); @endcode -If window or context creation fails, `NULL` will be returned, so it is necessary -to check the return value. +If window creation fails, `NULL` will be returned, so you need to check whether +it did. @code if (!window) @@ -129,11 +128,24 @@ if (!window) } @endcode -The window handle is passed to all window related functions and is provided to -along to all window related callbacks, so they can tell which window received -the event. +This handle is then passed to all window related functions, and is provided to +you along with input events, so you know which window received the input. -When a window is no longer needed, destroy it. +To create a full screen window, you need to specify which monitor the window +should use. In most cases, the user's primary monitor is a good choice. You +can get this with @ref glfwGetPrimaryMonitor. To make the above window +full screen, just pass along the monitor handle: + +@code +GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", glfwGetPrimaryMonitor(), NULL); +@endcode + +Full screen windows cover the entire display area of a monitor, have no border +or decorations, and change the monitor's resolution to the one most closely +matching the requested window size. + +When you are done with the window, destroy it with the @ref glfwDestroyWindow +function. @code glfwDestroyWindow(window); @@ -143,26 +155,26 @@ Once this function is called, no more events will be delivered for that window and its handle becomes invalid. -@subsection quick_context_current Making the OpenGL context current +@section quick_context_current Making the OpenGL context current Before you can use the OpenGL API, it must have a current OpenGL context. You -make a window's context current. +make a window's context current with @ref glfwMakeContextCurrent. It will then +remain as the current context until you make another context current or until +the window owning it is destroyed. @code glfwMakeContextCurrent(window); @endcode -The context will then remain as current until you make another context current -or until the window owning the current context is destroyed. +@section quick_window_close Checking the window close flag -@subsection quick_window_close Checking the window close flag - -Each window has a flag indicating whether the window should be closed. +Each window has a flag indicating whether the window should be closed. This can +be checked with @ref glfwWindowShouldClose. When the user attempts to close the window, either by pressing the close widget in the title bar or using a key combination like Alt+F4, this flag is set to 1. -Note that __the window isn't actually closed__, so you are expected to monitor +Note that **the window isn't actually closed**, so you are expected to monitor this flag and either destroy the window or give some kind of feedback to the user. @@ -182,11 +194,11 @@ useful if you want to interpret other kinds of input as closing the window, like for example pressing the escape key. -@subsection quick_key_input Receiving input events +@section quick_key_input Receiving input events Each window has a large number of callbacks that can be set to receive all the -various kinds of events. To receive key press and release events, create a key -callback function. +various kinds of events. To receive key press and release events, a +[key callback](@ref GLFWkeyfun) is set using @ref glfwSetKeyCallback. @code static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) @@ -196,21 +208,16 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action, } @endcode -The key callback, like other window related callbacks, are set per-window. - -@code -glfwSetKeyCallback(window, key_callback); -@endcode - -In order for event callbacks to be called when events occur, you need to process -events as described below. +For event callbacks to actually be called when an event occurs, you need to +process events as described below. -@subsection quick_render Rendering with OpenGL +@section quick_render Rendering with OpenGL Once you have a current OpenGL context, you can use OpenGL normally. In this tutorial, a multi-colored rotating triangle will be rendered. The framebuffer -size needs to be retrieved for `glViewport`. +size, needed by this example for `glViewport` and `glOrtho`, is retrieved with +@ref glfwGetFramebufferSize. @code int width, height; @@ -218,112 +225,81 @@ glfwGetFramebufferSize(window, &width, &height); glViewport(0, 0, width, height); @endcode -You can also set a framebuffer size callback using @ref +However, you can also set a framebuffer size callback using @ref glfwSetFramebufferSizeCallback and call `glViewport` from there. +@code +void framebuffer_size_callback(GLFWwindow* window, int width, int height) +{ + glViewport(0, 0, width, height); +} +@endcode -@subsection quick_timer Reading the timer -To create smooth animation, a time source is needed. GLFW provides a timer that -returns the number of seconds since initialization. The time source used is the -most accurate on each platform and generally has micro- or nanosecond -resolution. +@section quick_timer Reading the timer + +For the triangle to rotate properly, a time source is needed. GLFW provides +@ref glfwGetTime, which returns the number of seconds since @ref glfwInit as +a `double`. The time source used is the most accurate on each platform and +generally has micro- or nanosecond resolution. @code double time = glfwGetTime(); @endcode -@subsection quick_swap_buffers Swapping buffers +@section quick_swap_buffers Swapping buffers -GLFW windows by default use double buffering. That means that each window has -two rendering buffers; a front buffer and a back buffer. The front buffer is -the one being displayed and the back buffer the one you render to. +GLFW windows always use double-buffering. That means that you have two +rendering buffers; a front buffer and a back buffer. The front buffer is the +one being displayed and the back buffer the one you render to. -When the entire frame has been rendered, the buffers need to be swapped with one -another, so the back buffer becomes the front buffer and vice versa. +When the entire frame has been rendered, it is time to swap the back and the +front buffers in order to display the rendered frame, and begin rendering a new +frame. This is done with @ref glfwSwapBuffers. @code glfwSwapBuffers(window); @endcode -The swap interval indicates how many frames to wait until swapping the buffers, -commonly known as _vsync_. By default, the swap interval is zero, meaning -buffer swapping will occur immediately. On fast machines, many of those frames -will never be seen, as the screen is still only updated typically 60-75 times -per second, so this wastes a lot of CPU and GPU cycles. -Also, because the buffers will be swapped in the middle the screen update, -leading to [screen tearing](https://en.wikipedia.org/wiki/Screen_tearing). - -For these reasons, applications will typically want to set the swap interval to -one. It can be set to higher values, but this is usually not recommended, -because of the input latency it leads to. - -@code -glfwSwapInterval(1); -@endcode - -This function acts on the current context and will fail unless a context is -current. - - -@subsection quick_process_events Processing events +@section quick_process_events Processing events GLFW needs to communicate regularly with the window system both in order to -receive events and to show that the application hasn't locked up. Event -processing must be done regularly while you have visible windows and is normally -done each frame after buffer swapping. +receive events and to show that it hasn't locked up. Event processing must be +done regularly and is normally done each frame before rendering but after buffer +swap. -There are two methods for processing pending events; polling and waiting. This -example will use event polling, which processes only those events that have -already been received and then returns immediately. +There are two ways to process pending events. @ref glfwPollEvents processes +only those events that have already been received and then returns immediately. +This is the best choice when rendering continually, like most games do. @code glfwPollEvents(); @endcode -This is the best choice when rendering continually, like most games do. If -instead you only need to update your rendering once you have received new input, -@ref glfwWaitEvents is a better choice. It waits until at least one event has -been received, putting the thread to sleep in the meantime, and then processes -all received events. This saves a great deal of CPU cycles and is useful for, -for example, many kinds of editing tools. +If instead you only need to update your rendering once you have received new +input, @ref glfwWaitEvents is a better choice. It waits until at least one +event has been received, putting the thread to sleep in the meantime, and then +processes all received events just like @ref glfwPollEvents does. This saves +a great deal of CPU cycles and is useful for, for example, many kinds of editing +tools. + +@code +glfwWaitEvents(); +@endcode -@section quick_example Putting it together +@section quick_example Putting it together: A small GLFW application Now that you know how to initialize GLFW, create a window and poll for keyboard input, it's possible to create a simple program. @snippet simple.c code -This program creates a 640 by 480 windowed mode window and starts a loop that -clears the screen, renders a triangle and processes events until the user either -presses Escape or closes the window. - -This program uses only a few of the many functions GLFW provides. There are -guides for each of the areas covered by GLFW. Each guide will introduce all the -functions for that category. - - - @ref intro - - @ref window - - @ref context - - @ref monitor - - @ref input - - -@section quick_build Compiling and linking the program - -The complete program above can be found in the source distribution as -`examples/simple.c` and is compiled along with all other examples when you -build GLFW. That is, if you have compiled GLFW then you have already built this -as `simple.exe` on Windows, `simple` on Linux or `simple.app` on OS X. - -This tutorial ends here. Once you have written a program that uses GLFW, you -will need to compile and link it. How to do that depends on the development -environment you are using and is best explained by the documentation for that -environment. To learn about the details that are specific to GLFW, see -@ref build. +This program creates a 640 by 480 windowed mode window and runs a loop clearing +the screen, rendering a triangle and processing events until the user closes the +window. It can be found in the source distribution as `examples/simple.c`, and +is by default compiled along with all other examples when you build GLFW. */ diff --git a/extern/glfw/docs/rift.dox b/extern/glfw/docs/rift.dox deleted file mode 100644 index d763d47..0000000 --- a/extern/glfw/docs/rift.dox +++ /dev/null @@ -1,81 +0,0 @@ -/*! - -@page rift Oculus Rift guide - -@tableofcontents - -GLFW has no explicit support for the Oculus Rift, but - -This guide requires you to use the [native API](@ref native) and assumes -a certain level of proficiency with system level APIs and the compiler -toolchain. - - -@section rift_init Initializing libOVR and GLFW - -libOVR needs to be initialized before GLFW. This means calling -`ovr_Initialize`, `ovrHmd_Create` and `ovrHmd_ConfigureTracking` before @ref -glfwInit. Similarly, libOVR must be shut down after GLFW. This means calling -`ovrHmd_Destroy` and `ovr_Shutdown` after @ref glfwTerminate. - - -@section rift_extend Extend Desktop mode - -@subsection rift_extend_detect Detecting a Rift with GLFW - -If you have an actual Rift connected to your machine you can deduce which GLFW -monitor it corresponds to. Doing this requires you to use the -[native API](@ref native). - - -@subsubsection rift_extend_detect_win32 Detecting a Rift on Windows - -The native display device name of a GLFW monitor, as returned by @ref -glfwGetWin32Monitor, corresponds to the display device name of the detected Rift -as stored, in the `DisplayDeviceName` member of `ovrHmdDesc`. - -@code -int i, count; -GLFWmonitor** monitors = glfwGetMonitors(&count); - -for (i = 0; i < count; i++) -{ - if (strcmp(glfwGetWin32Monitor(monitors[i]), hmd->DisplayDeviceName) == 0) - return monitors[i]; -} -@endcode - - -@subsubsection rift_extend_detect_osx Detecting a Rift on OS X - -The native display ID of a GLFW monitor, as returned by @ref -glfwGetCocoaMonitor, corresponds to the display ID of the detected Rift, as -stored in the `DisplayId` member of `ovrHmdDesc`. - -@code -int i, count; -GLFWmonitor** monitors = glfwGetMonitors(&count); - -for (i = 0; i < count; i++) -{ - if (glfwGetCocoaMonitor(monitors[i]) == hmd->DisplayId) - return monitors[i]; -} -@endcode - - -@subsubsection rift_extend_detect_x11 Detecting a Rift on X11 - -At the time of writing, the 0.4 Rift SDK does not yet support X11. - - -@subsection rift_extend_create Creating a window and context - -LOL create. - - -@section rift_direct Direct HMD mode - -LOL direct. - -*/ diff --git a/extern/glfw/docs/spaces.svg b/extern/glfw/docs/spaces.svg deleted file mode 100644 index c0b872e..0000000 --- a/extern/glfw/docs/spaces.svg +++ /dev/null @@ -1,352 +0,0 @@ - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - Primary monitor position - Secondary Monitor - Primary Monitor - Virtual Screen - - - Window - - - - - - Window position - Secondary monitor position - Client area origin - Virtual screen origin - - - - - Window Title - - diff --git a/extern/glfw/docs/window.dox b/extern/glfw/docs/window.dox index 6b2b557..c91a67d 100644 --- a/extern/glfw/docs/window.dox +++ b/extern/glfw/docs/window.dox @@ -1,6 +1,6 @@ /*! -@page window Window guide +@page window Window handling guide @tableofcontents @@ -8,16 +8,8 @@ The primary purpose of GLFW is to provide a simple interface to window management and OpenGL and OpenGL ES context creation. GLFW supports multiple windows, which can be either a normal desktop window or a full screen window. -This guide introduces the window related functions of GLFW. There are also -guides for the other areas of GLFW. - - @ref intro - - @ref context - - @ref monitor - - @ref input - - -@section window_object Window objects +@section window_object Window handles The @ref GLFWwindow object encapsulates both a window and a context. They are created with @ref glfwCreateWindow and destroyed with @ref glfwDestroyWindow (or @@ -25,100 +17,52 @@ created with @ref glfwCreateWindow and destroyed with @ref glfwDestroyWindow (or linked, the object pointer is used as both a context and window handle. -@subsection window_creation Window creation +@section window_creation Window creation -A window and its OpenGL or OpenGL ES context are created with @ref -glfwCreateWindow, which returns a handle to the created window object. For -example, this creates a 640 by 480 windowed mode window: +The window and its context are created with @ref glfwCreateWindow, which +returns a handle to the created window object. For example, this creates a 640 +by 480 windowed mode window: @code GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", NULL, NULL); @endcode -If window creation fails, `NULL` will be returned, so it is necessary to check -the return value. +If window creation fails, `NULL` will be returned, so you need to check whether +it did. -The window handle is passed to all window related functions and is provided to -along with all input events, so event handlers can tell which window received -the event. - - -@subsubsection window_full_screen Full screen windows +This handle is then passed to all window related functions, and is provided to +you along with input events, so you know which window received the input. To create a full screen window, you need to specify which monitor the window -should use. In most cases, the user's primary monitor is a good choice. -For more information about retrieving monitors, see @ref monitor_monitors. +should use. In most cases, the user's primary monitor is a good choice. For +more information about monitors, see the @ref monitor. @code GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", glfwGetPrimaryMonitor(), NULL); @endcode Full screen windows cover the entire display area of a monitor, have no border -or decorations. +or decorations, and change the monitor's resolution to the one most closely +matching the requested window size. -Each field of the @ref GLFWvidmode structure corresponds to a function parameter -or window hint and combine to form the _desired video mode_ for that window. -The supported video mode most closely matching the desired video mode will be -set for the chosen monitor as long as the window is focused. For more -information about retrieving video modes, see @ref monitor_modes. - -Video mode field | Corresponds to ------------------------ | ------------------------ -GLFWvidmode.width | `width` parameter -GLFWvidmode.height | `height` parameter -GLFWvidmode.redBits | `GLFW_RED_BITS` hint -GLFWvidmode.greenBits | `GLFW_GREEN_BITS` hint -GLFWvidmode.blueBits | `GLFW_BLUE_BITS` hint -GLFWvidmode.refreshRate | `GLFW_REFRESH_RATE` hint - -Once you have a full screen window, you can change its resolution with @ref -glfwSetWindowSize. The new video mode will be selected and set the same way as -the video mode chosen by @ref glfwCreateWindow. +For more control over how the window and its context are created, see @ref +window_hints below. -@subsubsection window_windowed_full_screen "Windowed full screen" windows +@section window_destruction Window destruction -By default, the original video mode of the monitor will be restored and the -window iconified if it loses input focus, to allow the user to switch back to -the desktop. This behavior can be disabled with the `GLFW_AUTO_ICONIFY` window -hint, for example if you wish to simultaneously cover multiple windows with full -screen windows. - -To create a so called _windowed full screen_ or _borderless full screen_ window, -i.e. a full screen window that doesn't change the video mode of the monitor, you -need to request the current video mode of the chosen monitor. - -@code -const GLFWvidmode* mode = glfwGetVideoMode(monitor); - -glfwWindowHint(GLFW_RED_BITS, mode->redBits); -glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits); -glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits); -glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate); - -GLFWwindow* window = glfwCreateWindow(mode->width, mode->height, "My Title", monitor, NULL); -@endcode - -GLFW will detect this and will not perform any mode setting for that window. - - -@subsection window_destruction Window destruction - -When a window is no longer needed, destroy it with @ref glfwDestroyWindow. +When you are done with the window, destroy it with the @ref glfwDestroyWindow +function. @code glfwDestroyWindow(window); @endcode -Window destruction always succeeds. Before the actual destruction, all -callbacks are removed so no further events will be delivered for the window. -All windows remaining when @ref glfwTerminate is called are destroyed as well. - -When a full screen window is destroyed, the original video mode of its monitor -is restored, but the gamma ramp is left untouched. +Once this function is called, no more events will be delivered for that window +and its handle becomes invalid. -@subsection window_hints Window creation hints +@section window_hints Window creation hints There are a number of hints that can be set before the creation of a window and context. Some affect the window itself, others affect the framebuffer or @@ -126,232 +70,152 @@ context. These hints are set to their default values each time the library is initialized with @ref glfwInit, can be set individually with @ref glfwWindowHint and reset all at once to their defaults with @ref glfwDefaultWindowHints. -Note that hints need to be set _before_ the creation of the window and context +Note that hints need to be set *before* the creation of the window and context you wish to have the specified attributes. -@subsubsection window_hints_hard Hard and soft constraints +@subsection window_hints_hard Hard and soft constraints Some window hints are hard constraints. These must match the available -capabilities _exactly_ for window and context creation to succeed. Hints +capabilities *exactly* for window and context creation to succeed. Hints that are not hard constraints are matched as closely as possible, but the resulting window and context may differ from what these hints requested. To find out the actual attributes of the created window and context, use the @ref glfwGetWindowAttrib function. -The following hints are always hard constraints: +The following hints are hard constraints: - `GLFW_STEREO` -- `GLFW_DOUBLEBUFFER` - `GLFW_CLIENT_API` -The following additional hints are hard constraints when requesting an OpenGL -context, but are ignored when requesting an OpenGL ES context: +The following additional hints are hard constraints if requesting an OpenGL +context: - `GLFW_OPENGL_FORWARD_COMPAT` - `GLFW_OPENGL_PROFILE` +Hints that do not apply to a given type of window or context are ignored. -@subsubsection window_hints_wnd Window related hints -`GLFW_RESIZABLE` specifies whether the (windowed mode) window will be resizable -_by the user_. The window will still be resizable using the @ref -glfwSetWindowSize function. This hint is ignored for full screen windows. +@subsection window_hints_wnd Window related hints -`GLFW_VISIBLE` specifies whether the (windowed mode) window will be initially +The `GLFW_RESIZABLE` hint specifies whether the window will be resizable *by the +user*. The window will still be resizable using the @ref glfwSetWindowSize +function. This hint is ignored for full screen windows. + +The `GLFW_VISIBLE` hint specifies whether the window will be initially visible. This hint is ignored for full screen windows. -`GLFW_DECORATED` specifies whether the (windowed mode) window will have window +The `GLFW_DECORATED` hint specifies whether the window will have window decorations such as a border, a close widget, etc. This hint is ignored for full screen windows. Note that even though a window may lack a close widget, it is usually still possible for the user to generate close events. -`GLFW_FOCUSED` specifies whether the (windowed mode) window will be given input -focus when created. This hint is ignored for full screen and initially hidden -windows. -`GLFW_AUTO_ICONIFY` specifies whether the (full screen) window will -automatically iconify and restore the previous video mode on focus loss. This +@subsection window_hints_fb Framebuffer related hints + +The `GLFW_RED_BITS`, `GLFW_GREEN_BITS`, `GLFW_BLUE_BITS`, `GLFW_ALPHA_BITS`, +`GLFW_DEPTH_BITS` and `GLFW_STENCIL_BITS` hints specify the desired bit +depths of the various components of the default framebuffer. + +The `GLFW_ACCUM_RED_BITS`, `GLFW_ACCUM_GREEN_BITS`, `GLFW_ACCUM_BLUE_BITS` +and `GLFW_ACCUM_ALPHA_BITS` hints specify the desired bit depths of the +various components of the accumulation buffer. + +The `GLFW_AUX_BUFFERS` hint specifies the desired number of auxiliary +buffers. + +The `GLFW_STEREO` hint specifies whether to use stereoscopic rendering. + +The `GLFW_SAMPLES` hint specifies the desired number of samples to use for +multisampling. Zero disables multisampling. + +The `GLFW_SRGB_CAPABLE` hint specifies whether the framebuffer should be +sRGB capable. + +The `GLFW_REFRESH_RATE` hint specifies the desired refresh rate for full screen +windows. If set to zero, the highest available refresh rate will be used. This hint is ignored for windowed mode windows. -`GLFW_FLOATING` specifies whether the window will be floating above other -regular windows, also called topmost or always-on-top. This is intended -primarily for debugging purposes and cannot be used to implement proper full -screen windows. This hint is ignored for full screen windows. +@subsection window_hints_ctx Context related hints -@subsubsection window_hints_fb Framebuffer related hints +The `GLFW_CLIENT_API` hint specifies which client API to create the context +for. Possible values are `GLFW_OPENGL_API` and `GLFW_OPENGL_ES_API`. -`GLFW_RED_BITS`, `GLFW_GREEN_BITS`, `GLFW_BLUE_BITS`, `GLFW_ALPHA_BITS`, -`GLFW_DEPTH_BITS` and `GLFW_STENCIL_BITS` specify the desired bit depths of the -various components of the default framebuffer. `GLFW_DONT_CARE` means the -application has no preference. +The `GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR` hints +specify the client API version that the created context must be compatible +with. -`GLFW_ACCUM_RED_BITS`, `GLFW_ACCUM_GREEN_BITS`, `GLFW_ACCUM_BLUE_BITS` and -`GLFW_ACCUM_ALPHA_BITS` specify the desired bit depths of the various components -of the accumulation buffer. `GLFW_DONT_CARE` means the application has no -preference. +For OpenGL, these hints are *not* hard constraints, as they don't have to +match exactly, but @ref glfwCreateWindow will still fail if the resulting +OpenGL version is less than the one requested. It is therefore perfectly +safe to use the default of version 1.0 for legacy code and you may still +get backwards-compatible contexts of version 3.0 and above when available. -@par -Accumulation buffers are a legacy OpenGL feature and should not be used in new -code. - -`GLFW_AUX_BUFFERS` specifies the desired number of auxiliary buffers. -`GLFW_DONT_CARE` means the application has no preference. - -@par -Auxiliary buffers are a legacy OpenGL feature and should not be used in new -code. - -`GLFW_STEREO` specifies whether to use stereoscopic rendering. This is a hard -constraint. - -`GLFW_SAMPLES` specifies the desired number of samples to use for multisampling. -Zero disables multisampling. `GLFW_DONT_CARE` means the application has no -preference. - -`GLFW_SRGB_CAPABLE` specifies whether the framebuffer should be sRGB capable. - -`GLFW_DOUBLEBUFFER` specifies whether the framebuffer should be double buffered. -You nearly always want to use double buffering. This is a hard constraint. - - -@subsubsection window_hints_mtr Monitor related hints - -`GLFW_REFRESH_RATE` specifies the desired refresh rate for full screen windows. -If set to `GLFW_DONT_CARE`, the highest available refresh rate will be used. -This hint is ignored for windowed mode windows. - - -@subsubsection window_hints_ctx Context related hints - -`GLFW_CLIENT_API` specifies which client API to create the context for. -Possible values are `GLFW_OPENGL_API` and `GLFW_OPENGL_ES_API`. This is a hard -constraint. - -`GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR` specify the client -API version that the created context must be compatible with. The exact -behavior of these hints depend on the requested client API. - -@par OpenGL -`GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR` are not hard -constraints, but creation will fail if the OpenGL version of the created context -is less than the one requested. It is therefore perfectly safe to use the -default of version 1.0 for legacy code and you may still get -backwards-compatible contexts of version 3.0 and above when available. - -@par While there is no way to ask the driver for a context of the highest supported -version, GLFW will attempt to provide this when you ask for a version 1.0 -context, which is the default for these hints. +version, most drivers provide this when you ask GLFW for a version +1.0 context. -@par OpenGL ES -`GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR` are not hard -constraints, but creation will fail if the OpenGL ES version of the created -context is less than the one requested. Additionally, OpenGL ES 1.x cannot be -returned if 2.0 or later was requested, and vice versa. This is because OpenGL -ES 3.x is backward compatible with 2.0, but OpenGL ES 2.0 is not backard -compatible with 1.x. +For OpenGL ES, these hints are hard constraints. -`GLFW_OPENGL_FORWARD_COMPAT` specifies whether the OpenGL context should be -forward-compatible, i.e. one where all functionality deprecated in the requested -version of OpenGL is removed. This may only be used if the requested OpenGL -version is 3.0 or above. If OpenGL S is requested, this hint is ignored. +If an OpenGL context is requested, the `GLFW_OPENGL_FORWARD_COMPAT` hint +specifies whether the OpenGL context should be forward-compatible, i.e. one +where all functionality deprecated in the requested version of OpenGL is +removed. This may only be used if the requested OpenGL version is 3.0 or +above. If another client API is requested, this hint is ignored. -@par -Forward-compatibility is described in detail in the -[OpenGL Reference Manual](https://www.opengl.org/registry/). +If an OpenGL context is requested, the `GLFW_OPENGL_DEBUG_CONTEXT` hint +specifies whether to create a debug OpenGL context, which may have +additional error and performance issue reporting functionality. If another +client API is requested, this hint is ignored. -`GLFW_OPENGL_DEBUG_CONTEXT` specifies whether to create a debug OpenGL context, -which may have additional error and performance issue reporting functionality. -If OpenGL ES is requested, this hint is ignored. +If an OpenGL context is requested, the `GLFW_OPENGL_PROFILE` hint specifies +which OpenGL profile to create the context for. Possible values are one of +`GLFW_OPENGL_CORE_PROFILE` or `GLFW_OPENGL_COMPAT_PROFILE`, or +`GLFW_OPENGL_ANY_PROFILE` to not request a specific profile. If requesting +an OpenGL version below 3.2, `GLFW_OPENGL_ANY_PROFILE` must be used. If +another client API is requested, this hint is ignored. -`GLFW_OPENGL_PROFILE` specifies which OpenGL profile to create the context for. -Possible values are one of `GLFW_OPENGL_CORE_PROFILE` or -`GLFW_OPENGL_COMPAT_PROFILE`, or `GLFW_OPENGL_ANY_PROFILE` to not request -a specific profile. If requesting an OpenGL version below 3.2, -`GLFW_OPENGL_ANY_PROFILE` must be used. If another OpenGL ES is requested, -this hint is ignored. - -@par -OpenGL profiles are described in detail in the -[OpenGL Reference Manual](https://www.opengl.org/registry/). - -`GLFW_CONTEXT_ROBUSTNESS` specifies the robustness strategy to be used by the -context. This can be one of `GLFW_NO_RESET_NOTIFICATION` or +The `GLFW_CONTEXT_ROBUSTNESS` hint specifies the robustness strategy to be +used by the context. This can be one of `GLFW_NO_RESET_NOTIFICATION` or `GLFW_LOSE_CONTEXT_ON_RESET`, or `GLFW_NO_ROBUSTNESS` to not request a robustness strategy. -`GLFW_CONTEXT_RELEASE_BEHAVIOR` specifies the release behavior to be -used by the context. Possible values are one of `GLFW_ANY_RELEASE_BEHAVIOR`, -`GLFW_RELEASE_BEHAVIOR_FLUSH` or `GLFW_RELEASE_BEHAVIOR_NONE`. If the -behavior is `GLFW_ANY_RELEASE_BEHAVIOR`, the default behavior of the context -creation API will be used. If the behavior is `GLFW_RELEASE_BEHAVIOR_FLUSH`, -the pipeline will be flushed whenever the context is released from being the -current one. If the behavior is `GLFW_RELEASE_BEHAVIOR_NONE`, the pipeline will -not be flushed on release. -@par -Context release behaviors are described in detail by the -[GL_KHR_context_flush_control](https://www.opengl.org/registry/specs/KHR/context_flush_control.txt) -extension. +@subsection window_hints_values Supported and default values + +| Name | Default value | Supported values | +| ---------------------------- | ------------------------- | ----------------------- | +| `GLFW_RESIZABLE` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE` | +| `GLFW_VISIBLE` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE` | +| `GLFW_DECORATED` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE` | +| `GLFW_RED_BITS` | 8 | 0 to `INT_MAX` | +| `GLFW_GREEN_BITS` | 8 | 0 to `INT_MAX` | +| `GLFW_BLUE_BITS` | 8 | 0 to `INT_MAX` | +| `GLFW_ALPHA_BITS` | 8 | 0 to `INT_MAX` | +| `GLFW_DEPTH_BITS` | 24 | 0 to `INT_MAX` | +| `GLFW_STENCIL_BITS` | 8 | 0 to `INT_MAX` | +| `GLFW_ACCUM_RED_BITS` | 0 | 0 to `INT_MAX` | +| `GLFW_ACCUM_GREEN_BITS` | 0 | 0 to `INT_MAX` | +| `GLFW_ACCUM_BLUE_BITS` | 0 | 0 to `INT_MAX` | +| `GLFW_ACCUM_ALPHA_BITS` | 0 | 0 to `INT_MAX` | +| `GLFW_AUX_BUFFERS` | 0 | 0 to `INT_MAX` | +| `GLFW_SAMPLES` | 0 | 0 to `INT_MAX` | +| `GLFW_REFRESH_RATE` | 0 | 0 to `INT_MAX` | +| `GLFW_STEREO` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE` | +| `GLFW_SRGB_CAPABLE` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE` | +| `GLFW_CLIENT_API` | `GLFW_OPENGL_API` | `GLFW_OPENGL_API` or `GLFW_OPENGL_ES_API` | +| `GLFW_CONTEXT_VERSION_MAJOR` | 1 | Any valid major version number of the chosen client API | +| `GLFW_CONTEXT_VERSION_MINOR` | 0 | Any valid minor version number of the chosen client API | +| `GLFW_CONTEXT_ROBUSTNESS` | `GLFW_NO_ROBUSTNESS` | `GLFW_NO_ROBUSTNESS`, `GLFW_NO_RESET_NOTIFICATION` or `GLFW_LOSE_CONTEXT_ON_RESET` | +| `GLFW_OPENGL_FORWARD_COMPAT` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE` | +| `GLFW_OPENGL_DEBUG_CONTEXT` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE` | +| `GLFW_OPENGL_PROFILE` | `GLFW_OPENGL_ANY_PROFILE` | `GLFW_OPENGL_ANY_PROFILE`, `GLFW_OPENGL_COMPAT_PROFILE` or `GLFW_OPENGL_CORE_PROFILE` | -@subsubsection window_hints_values Supported and default values - -Window hint | Default value | Supported values -------------------------------- | --------------------------- | ---------------- -`GLFW_RESIZABLE` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE` -`GLFW_VISIBLE` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE` -`GLFW_DECORATED` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE` -`GLFW_FOCUSED` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE` -`GLFW_AUTO_ICONIFY` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE` -`GLFW_FLOATING` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE` -`GLFW_RED_BITS` | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -`GLFW_GREEN_BITS` | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -`GLFW_BLUE_BITS` | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -`GLFW_ALPHA_BITS` | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -`GLFW_DEPTH_BITS` | 24 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -`GLFW_STENCIL_BITS` | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -`GLFW_ACCUM_RED_BITS` | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -`GLFW_ACCUM_GREEN_BITS` | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -`GLFW_ACCUM_BLUE_BITS` | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -`GLFW_ACCUM_ALPHA_BITS` | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -`GLFW_AUX_BUFFERS` | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -`GLFW_SAMPLES` | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -`GLFW_REFRESH_RATE` | `GLFW_DONT_CARE` | 0 to `INT_MAX` or `GLFW_DONT_CARE` -`GLFW_STEREO` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE` -`GLFW_SRGB_CAPABLE` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE` -`GLFW_DOUBLEBUFFER` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE` -`GLFW_CLIENT_API` | `GLFW_OPENGL_API` | `GLFW_OPENGL_API` or `GLFW_OPENGL_ES_API` -`GLFW_CONTEXT_VERSION_MAJOR` | 1 | Any valid major version number of the chosen client API -`GLFW_CONTEXT_VERSION_MINOR` | 0 | Any valid minor version number of the chosen client API -`GLFW_CONTEXT_ROBUSTNESS` | `GLFW_NO_ROBUSTNESS` | `GLFW_NO_ROBUSTNESS`, `GLFW_NO_RESET_NOTIFICATION` or `GLFW_LOSE_CONTEXT_ON_RESET` -`GLFW_CONTEXT_RELEASE_BEHAVIOR` | `GLFW_ANY_RELEASE_BEHAVIOR` | `GLFW_ANY_RELEASE_BEHAVIOR`, `GLFW_RELEASE_BEHAVIOR_FLUSH` or `GLFW_RELEASE_BEHAVIOR_NONE` -`GLFW_OPENGL_FORWARD_COMPAT` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE` -`GLFW_OPENGL_DEBUG_CONTEXT` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE` -`GLFW_OPENGL_PROFILE` | `GLFW_OPENGL_ANY_PROFILE` | `GLFW_OPENGL_ANY_PROFILE`, `GLFW_OPENGL_COMPAT_PROFILE` or `GLFW_OPENGL_CORE_PROFILE` - - -@section window_events Window event processing - -See @ref input_event in the @ref input. - - -@section window_properties Window properties and events - -@subsection window_userptr User pointer - -Each window has a user pointer that can be set with @ref -glfwSetWindowUserPointer and fetched with @ref glfwGetWindowUserPointer. This -can be used for any purpose you need and will not be modified by GLFW throughout -the life-time of the window. - -The initial value of the pointer is `NULL`. - - -@subsection window_close Closing and close flag +@section window_close Window close flag When the user attempts to close the window, for example by clicking the close -widget or using a key chord like Alt+F4, the _close flag_ of the window is set. +widget or using a key chord like Alt+F4, the *close flag* of the window is set. The window is however not actually destroyed and, unless you watch for this state change, nothing further happens. @@ -369,16 +233,16 @@ while (!glfwWindowShouldClose(window)) } @endcode -If you wish to be notified when the user attempts to close a window, set a close -callback. +If you wish to be notified when the user attempts to close a window, you can set +the close callback with @ref glfwSetWindowCloseCallback. This callback is +called directly *after* the close flag has been set. @code glfwSetWindowCloseCallback(window, window_close_callback); @endcode -The callback function is called directly _after_ the close flag has been set. -It can be used for example to filter close requests and clear the close flag -again unless certain conditions are met. +The callback function can be used for example to filter close requests and clear +the close flag again unless certain conditions are met. @code void window_close_callback(GLFWwindow* window) @@ -389,31 +253,26 @@ void window_close_callback(GLFWwindow* window) @endcode -@subsection window_size Size +@section window_size Window size The size of a window can be changed with @ref glfwSetWindowSize. For windowed -mode windows, this sets the size, in -[screen coordinates](@ref coordinate_systems) of the _client area_ or _content -area_ of the window. The window system may impose limits on window size. +mode windows, this resizes the specified window so that its *client area* has +the specified size. Note that the window system may put limitations on size. +For full screen windows, it selects and sets the video mode most closely +matching the specified size. @code -glfwSetWindowSize(window, 640, 480); +void glfwSetWindowSize(window, 640, 480); @endcode -For full screen windows, the specified size becomes the new resolution of the -window's *desired video mode*. The video mode most closely matching the new -desired video mode is set immediately. The window is resized to fit the -resolution of the set video mode. - If you wish to be notified when a window is resized, whether by the user or -the system, set a size callback. +the system, you can set the size callback with @ref glfwSetWindowSizeCallback. @code glfwSetWindowSizeCallback(window, window_size_callback); @endcode -The callback function receives the new size, in screen coordinates, of the -client area of the window when it is resized. +The callback function receives the new size of the client area of the window. @code void window_size_callback(GLFWwindow* window, int width, int height) @@ -429,42 +288,26 @@ int width, height; glfwGetWindowSize(window, &width, &height); @endcode -@note Do not pass the window size to `glViewport` or other pixel-based OpenGL -calls. The window size is in screen coordinates, not pixels. Use the -[framebuffer size](@ref window_fbsize), which is in pixels, for pixel-based -calls. -The above functions work with the size of the client area, but decorated windows -typically have title bars and window frames around this rectangle. You can -retrieve the extents of these with @ref glfwGetWindowFrameSize. - -@code -int left, top, right, bottom; -glfwGetWindowFrameSize(window, &left, &top, &right, &bottom); -@endcode - -The returned values are the distances, in screen coordinates, from the edges of -the client area to the corresponding edges of the full window. As they are -distances and not coordinates, they are always zero or positive. - - -@subsection window_fbsize Framebuffer size +@section window_fbsize Window framebuffer size While the size of a window is measured in screen coordinates, OpenGL works with -pixels. The size you pass into `glViewport`, for example, should be in pixels. -On some machines screen coordinates and pixels are the same, but on others they -will not be. There is a second set of functions to retrieve the size, in -pixels, of the framebuffer of a window. +pixels. The size you pass into `glViewport`, for example, should be in pixels +and not screen coordinates. On some platforms screen coordinates and pixels are +the same, but this is not the case on all platforms supported by GLFW. There is +a second set of functions to retrieve the size in pixels of the framebuffer of +a window. If you wish to be notified when the framebuffer of a window is resized, whether -by the user or the system, set a size callback. +by the user or the system, you can set the size callback with @ref +glfwSetFramebufferSizeCallback. @code glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); @endcode -The callback function receives the new size of the framebuffer when it is -resized, which can for example be used to update the OpenGL viewport. +The callback function receives the new size of the client area of the window, +which can for example be used to update the OpenGL viewport. @code void framebuffer_size_callback(GLFWwindow* window, int width, int height) @@ -487,29 +330,29 @@ a window, for example if the window is dragged between a regular monitor and a high-DPI one. -@subsection window_pos Position +@section window_pos Window position The position of a windowed-mode window can be changed with @ref glfwSetWindowPos. This moves the window so that the upper-left corner of its -client area has the specified [screen coordinates](@ref coordinate_systems). -The window system may put limitats on window placement. +client area has the specified screen coordinates. Note that the window system +may put limitations on placement. @code glfwSetWindowPos(window, 100, 100); @endcode -If you wish to be notified when a window is moved, whether by the user, system -or your own code, set a position callback. +If you wish to be notified when a window is moved, whether by the user or +the system, you can set the position callback with @ref glfwSetWindowPosCallback. @code glfwSetWindowPosCallback(window, window_pos_callback); @endcode -The callback function receives the new position of the upper-left corner of the -client area when the window is moved. +The callback function receives the new position of the upper-left corner of its +client area. @code -void window_pos_callback(GLFWwindow* window, int xpos, int ypos) +void window_size_callback(GLFWwindow* window, int xpos, int ypos) { } @endcode @@ -523,187 +366,31 @@ glfwGetWindowPos(window, &xpos, &ypos); @endcode -@subsection window_title Title +@section window_title Window title All GLFW windows have a title, although undecorated or full screen windows may -not display it or only display it in a task bar or similar interface. You can -set a UTF-8 encoded window title with @ref glfwSetWindowTitle. +not display it or only display it in a task bar or similar interface. To change +the title of a window, use @ref glfwSetWindowTitle. @code glfwSetWindowTitle(window, "My Window"); @endcode -The specified string is copied before the function returns, so there is no need -to keep it around. - -As long as your source file is encoded as UTF-8, you can use any Unicode -characters directly in the source. +The window title is a regular C string using the UTF-8 encoding. This means +for example that, as long as your source file is encoded as UTF-8, you can use +any Unicode characters. @code -glfwSetWindowTitle(window, "ヒカルの碁"); +glfwSetWindowTitle(window, "さよなら絶望先生"); @endcode -@subsection window_monitor Monitor - -Full screen windows are associated with a specific monitor. You can get the -handle for this monitor with @ref glfwGetWindowMonitor. - -@code -GLFWmonitor* monitor = glfwGetWindowMonitor(window); -@endcode - -This monitor handle is one of those returned by @ref glfwGetMonitors. - -For windowed mode windows, this function returns `NULL`. This is the -recommended way to tell full screen windows from windowed mode windows. - - -@subsection window_iconify Iconification - -Windows can be iconified (i.e. minimized) with @ref glfwIconifyWindow. - -@code -glfwIconifyWindow(window); -@endcode - -When a full screen window is iconified, the original video mode of its monitor -is restored until the user or application restores the window. - -Iconified windows can be restored with @ref glfwRestoreWindow. - -@code -glfwRestoreWindow(window); -@endcode - -When a full screen window is restored, the desired video mode is restored to its -monitor as well. - -If you wish to be notified when a window is iconified or restored, whether by -the user, system or your own code, set a iconify callback. - -@code -glfwSetWindowIconifyCallback(window, window_iconify_callback); -@endcode - -The callback function receives changes in the iconification state of the window. - -@code -void window_iconify_callback(GLFWwindow* window, int iconified) -{ - if (iconified) - { - // The window was iconified - } - else - { - // The window was restored - } -} -@endcode - -You can also get the iconification state with @ref glfwGetWindowAttrib. - -@code -int iconified = glfwGetWindowAttrib(window, GLFW_ICONIFIED); -@endcode - - -@subsection window_hide Visibility - -Windowed mode windows can be hidden with @ref glfwHideWindow. - -@code -glfwHideWindow(window); -@endcode - -This makes the window completely invisible to the user, including removing it -from the task bar, dock or window list. Full screen windows cannot be hidden -and calling @ref glfwHideWindow on a full screen window does nothing. - -Hidden windows can be shown with @ref glfwShowWindow. - -@code -glfwShowWindow(window); -@endcode - -Windowed mode windows can be created initially hidden with the `GLFW_VISIBLE` -[window hint](@ref window_hints_wnd). Windows created hidden are completely -invisible to the user until shown. This can be useful if you need to set up -your window further before showing it, for example moving it to a specific -location. - -You can also get the visibility state with @ref glfwGetWindowAttrib. - -@code -int visible = glfwGetWindowAttrib(window, GLFW_VISIBLE); -@endcode - - -@subsection window_focus Input focus - -If you wish to be notified when a window gains or loses focus, whether by -the user, system or your own code, set a focus callback. - -@code -glfwSetWindowFocusCallback(window, window_focus_callback); -@endcode - -The callback function receives changes in the focus state of the window. - -@code -void window_focus_callback(GLFWwindow* window, int focused) -{ - if (focused) - { - // The window gained focus - } - else - { - // The window lost focus - } -} -@endcode - -You can also get the focus state with @ref glfwGetWindowAttrib. - -@code -int focused = glfwGetWindowAttrib(window, GLFW_FOCUSED); -@endcode - - -@subsection window_refresh Damage and refresh - -If you wish to be notified when the contents of a window is damaged and needs -to be refreshed, set a window refresh callback. - -@code -glfwSetWindowRefreshCallback(m_handle, window_refresh_callback); -@endcode - -The callback function is called when the contents of the window needs to be -refreshed. - -@code -void window_refresh_callback(GLFWwindow* window) -{ - draw_editor_ui(window); - glfwSwapBuffers(window); -} -@endcode - -@note On compositing window systems such as Aero, Compiz or Aqua, where the -window contents are saved off-screen, this callback may be called only very -infrequently or never at all. - - -@subsection window_attribs Attributes +@section window_attribs Window attributes Windows have a number of attributes that can be returned using @ref glfwGetWindowAttrib. Some reflect state that may change during the lifetime of the window, while others reflect the corresponding hints and are fixed at the -time of creation. Some are related to the actual window and others to its -context. +time of creation. @code if (glfwGetWindowAttrib(window, GLFW_FOCUSED)) @@ -713,60 +400,57 @@ if (glfwGetWindowAttrib(window, GLFW_FOCUSED)) @endcode -@subsubsection window_attribs_window Window related attributes +@subsection window_attribs_window Window attributes -`GLFW_FOCUSED` indicates whether the specified window has input focus. +The `GLFW_FOCUSED` attribute indicates whether the specified window currently +has input focus. -`GLFW_ICONIFIED` indicates whether the specified window is iconified, whether by -the user or with @ref glfwIconifyWindow. +The `GLFW_ICONIFIED` attribute indicates whether the specified window is +currently iconified, whether by the user or with @ref glfwIconifyWindow. -`GLFW_VISIBLE` indicates whether the specified window is visible. Window -visibility can be controlled with @ref glfwShowWindow and @ref glfwHideWindow -and initial visibility is controlled by the [window hint](@ref window_hints) -with the same name. +The `GLFW_VISIBLE` attribute indicates whether the specified window is currently +visible. Window visibility can be controlled with @ref glfwShowWindow and @ref +glfwHideWindow and initial visibility is controlled by the +[window hint](@ref window_hints) with the same name. -`GLFW_RESIZABLE` indicates whether the specified window is resizable _by the -user_. This is controlled by the [window hint](@ref window_hints) with the same -name. +The `GLFW_RESIZABLE` attribute indicates whether the specified window is +resizable *by the user*. This is controlled by the +[window hint](@ref window_hints) with the same name. -`GLFW_DECORATED` indicates whether the specified window has decorations such as -a border, a close widget, etc. This is controlled by the -[window hint](@ref window_hints) with the same name. - -`GLFW_FLOATING` indicates whether the specified window is floating, also called -topmost or always-on-top. This is controlled by the +The `GLFW_DECORATED` attribute indicates whether the specified window has +decorations such as a border, a close widget, etc. This is controlled by the [window hint](@ref window_hints) with the same name. -@subsubsection window_attribs_context Context related attributes +@subsection window_attribs_context Context attributes -`GLFW_CLIENT_API` indicates the client API provided by the window's context; -either `GLFW_OPENGL_API` or `GLFW_OPENGL_ES_API`. +The `GLFW_CLIENT_API` attribute indicates the client API provided by the +window's context; either `GLFW_OPENGL_API` or `GLFW_OPENGL_ES_API`. -`GLFW_CONTEXT_VERSION_MAJOR`, `GLFW_CONTEXT_VERSION_MINOR` and -`GLFW_CONTEXT_REVISION` indicate the client API version of the window's context. +The `GLFW_CONTEXT_VERSION_MAJOR`, `GLFW_CONTEXT_VERSION_MINOR` and +`GLFW_CONTEXT_REVISION` attributes indicate the client API version of the +window's context. -`GLFW_OPENGL_FORWARD_COMPAT` is `GL_TRUE` if the window's context is an OpenGL -forward-compatible one, or `GL_FALSE` otherwise. +The `GLFW_OPENGL_FORWARD_COMPAT` attribute is `GL_TRUE` if the window's +context is an OpenGL forward-compatible one, or `GL_FALSE` otherwise. -`GLFW_OPENGL_DEBUG_CONTEXT` is `GL_TRUE` if the window's context is an OpenGL -debug context, or `GL_FALSE` otherwise. +The `GLFW_OPENGL_DEBUG_CONTEXT` attribute is `GL_TRUE` if the window's +context is an OpenGL debug context, or `GL_FALSE` otherwise. -`GLFW_OPENGL_PROFILE` indicates the OpenGL profile used by the context. This is -`GLFW_OPENGL_CORE_PROFILE` or `GLFW_OPENGL_COMPAT_PROFILE` if the context uses -a known profile, or `GLFW_OPENGL_ANY_PROFILE` if the OpenGL profile is unknown -or the context is an OpenGL ES context. Note that the returned profile may not -match the profile bits of the context flags, as GLFW will try other means of -detecting the profile when no bits are set. +The `GLFW_OPENGL_PROFILE` attribute indicates the OpenGL profile used by the +context. This is `GLFW_OPENGL_CORE_PROFILE` or `GLFW_OPENGL_COMPAT_PROFILE` +if the context uses a known profile, or `GLFW_OPENGL_ANY_PROFILE` if the +OpenGL profile is unknown or the context is for another client API. -`GLFW_CONTEXT_ROBUSTNESS` indicates the robustness strategy used by the context. -This is `GLFW_LOSE_CONTEXT_ON_RESET` or `GLFW_NO_RESET_NOTIFICATION` if the -window's context supports robustness, or `GLFW_NO_ROBUSTNESS` otherwise. +The `GLFW_CONTEXT_ROBUSTNESS` attribute indicates the robustness strategy +used by the context. This is `GLFW_LOSE_CONTEXT_ON_RESET` or +`GLFW_NO_RESET_NOTIFICATION` if the window's context supports robustness, or +`GLFW_NO_ROBUSTNESS` otherwise. -@section window_swap Buffer swapping +@section window_swap Swapping buffers -GLFW windows are by default double buffered. That means that you have two +GLFW windows are always double buffered. That means that you have two rendering buffers; a front buffer and a back buffer. The front buffer is the one being displayed and the back buffer the one you render to. @@ -780,8 +464,7 @@ glfwSwapBuffers(window); Sometimes it can be useful to select when the buffer swap will occur. With the function @ref glfwSwapInterval it is possible to select the minimum number of -monitor refreshes the driver wait should from the time @ref glfwSwapBuffers was -called before swapping the buffers: +monitor refreshes the driver should wait before swapping the buffers: @code glfwSwapInterval(1); @@ -794,10 +477,8 @@ zero can be useful for benchmarking purposes, when it is not desirable to measure the time it takes to wait for the vertical retrace. However, a swap interval of one lets you avoid tearing. -Note that this may not work on all machines, as some drivers have -user-controlled settings that override any swap interval the application -requests. It is also by default disabled on Windows Vista and later when using -DWM (Aero), as using it there sometimes leads to severe jitter. You can -forcibly enable it for machines using DWM using @ref compile_options_win32. +Note that not all OpenGL implementations properly implement this function, in +which case @ref glfwSwapInterval will have no effect. Some drivers also have +user settings that override requests by GLFW. */ diff --git a/extern/glfw/examples/CMakeLists.txt b/extern/glfw/examples/CMakeLists.txt deleted file mode 100644 index 10e6208..0000000 --- a/extern/glfw/examples/CMakeLists.txt +++ /dev/null @@ -1,72 +0,0 @@ - -link_libraries(glfw "${OPENGL_glu_LIBRARY}") - -if (BUILD_SHARED_LIBS) - add_definitions(-DGLFW_DLL) - link_libraries("${OPENGL_gl_LIBRARY}" "${MATH_LIBRARY}") -else() - link_libraries(${glfw_LIBRARIES}) -endif() - -include_directories("${GLFW_SOURCE_DIR}/include" - "${GLFW_SOURCE_DIR}/deps") - -if ("${OPENGL_INCLUDE_DIR}") - include_directories("${OPENGL_INCLUDE_DIR}") -endif() - -set(GLAD "${GLFW_SOURCE_DIR}/deps/glad/glad.h" - "${GLFW_SOURCE_DIR}/deps/glad.c") -set(GETOPT "${GLFW_SOURCE_DIR}/deps/getopt.h" - "${GLFW_SOURCE_DIR}/deps/getopt.c") -set(TINYCTHREAD "${GLFW_SOURCE_DIR}/deps/tinycthread.h" - "${GLFW_SOURCE_DIR}/deps/tinycthread.c") - -if (APPLE) - # Set fancy names for bundles - add_executable(Boing MACOSX_BUNDLE boing.c) - add_executable(Gears MACOSX_BUNDLE gears.c) - add_executable(Particles MACOSX_BUNDLE particles.c ${TINYCTHREAD}) - add_executable(Simple MACOSX_BUNDLE simple.c) - add_executable("Split View" MACOSX_BUNDLE splitview.c) - add_executable(Wave MACOSX_BUNDLE wave.c) - - set_target_properties(Boing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Boing") - set_target_properties(Gears PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Gears") - set_target_properties(Particles PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Particles") - set_target_properties(Simple PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Simple") - set_target_properties("Split View" PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Split View") - set_target_properties(Wave PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Wave") -else() - # Set boring names for executables - add_executable(boing WIN32 boing.c) - add_executable(gears WIN32 gears.c) - add_executable(heightmap WIN32 heightmap.c ${GETOPT} ${GLAD}) - add_executable(particles WIN32 particles.c ${TINYCTHREAD} ${GETOPT}) - add_executable(simple WIN32 simple.c) - add_executable(splitview WIN32 splitview.c) - add_executable(wave WIN32 wave.c) -endif() - -if (APPLE) - target_link_libraries(Particles "${CMAKE_THREAD_LIBS_INIT}") -elseif (UNIX) - target_link_libraries(particles "${CMAKE_THREAD_LIBS_INIT}" "${RT_LIBRARY}") -endif() - -if (MSVC) - set(WINDOWS_BINARIES boing gears heightmap particles simple splitview wave) - - # Tell MSVC to use main instead of WinMain for Windows subsystem executables - set_target_properties(${WINDOWS_BINARIES} PROPERTIES - LINK_FLAGS "/ENTRY:mainCRTStartup") -endif() - -if (APPLE) - set(BUNDLE_BINARIES Boing Gears Particles Simple "Split View" Wave) - - set_target_properties(${BUNDLE_BINARIES} PROPERTIES - MACOSX_BUNDLE_SHORT_VERSION_STRING ${GLFW_VERSION} - MACOSX_BUNDLE_LONG_VERSION_STRING ${GLFW_VERSION_FULL}) -endif() - diff --git a/extern/glfw/examples/boing.c b/extern/glfw/examples/boing.c deleted file mode 100644 index ec31359..0000000 --- a/extern/glfw/examples/boing.c +++ /dev/null @@ -1,669 +0,0 @@ -/***************************************************************************** - * Title: GLBoing - * Desc: Tribute to Amiga Boing. - * Author: Jim Brooks - * Original Amiga authors were R.J. Mical and Dale Luck. - * GLFW conversion by Marcus Geelnard - * Notes: - 360' = 2*PI [radian] - * - * - Distances between objects are created by doing a relative - * Z translations. - * - * - Although OpenGL enticingly supports alpha-blending, - * the shadow of the original Boing didn't affect the color - * of the grid. - * - * - [Marcus] Changed timing scheme from interval driven to frame- - * time based animation steps (which results in much smoother - * movement) - * - * History of Amiga Boing: - * - * Boing was demonstrated on the prototype Amiga (codenamed "Lorraine") in - * 1985. According to legend, it was written ad-hoc in one night by - * R. J. Mical and Dale Luck. Because the bouncing ball animation was so fast - * and smooth, attendees did not believe the Amiga prototype was really doing - * the rendering. Suspecting a trick, they began looking around the booth for - * a hidden computer or VCR. - *****************************************************************************/ - -#include -#include -#include - -#define GLFW_INCLUDE_GLU -#include - - -/***************************************************************************** - * Various declarations and macros - *****************************************************************************/ - -/* Prototypes */ -void init( void ); -void display( void ); -void reshape( GLFWwindow* window, int w, int h ); -void key_callback( GLFWwindow* window, int key, int scancode, int action, int mods ); -void mouse_button_callback( GLFWwindow* window, int button, int action, int mods ); -void cursor_position_callback( GLFWwindow* window, double x, double y ); -void DrawBoingBall( void ); -void BounceBall( double dt ); -void DrawBoingBallBand( GLfloat long_lo, GLfloat long_hi ); -void DrawGrid( void ); - -#define RADIUS 70.f -#define STEP_LONGITUDE 22.5f /* 22.5 makes 8 bands like original Boing */ -#define STEP_LATITUDE 22.5f - -#define DIST_BALL (RADIUS * 2.f + RADIUS * 0.1f) - -#define VIEW_SCENE_DIST (DIST_BALL * 3.f + 200.f)/* distance from viewer to middle of boing area */ -#define GRID_SIZE (RADIUS * 4.5f) /* length (width) of grid */ -#define BOUNCE_HEIGHT (RADIUS * 2.1f) -#define BOUNCE_WIDTH (RADIUS * 2.1f) - -#define SHADOW_OFFSET_X -20.f -#define SHADOW_OFFSET_Y 10.f -#define SHADOW_OFFSET_Z 0.f - -#define WALL_L_OFFSET 0.f -#define WALL_R_OFFSET 5.f - -/* Animation speed (50.0 mimics the original GLUT demo speed) */ -#define ANIMATION_SPEED 50.f - -/* Maximum allowed delta time per physics iteration */ -#define MAX_DELTA_T 0.02f - -/* Draw ball, or its shadow */ -typedef enum { DRAW_BALL, DRAW_BALL_SHADOW } DRAW_BALL_ENUM; - -/* Vertex type */ -typedef struct {float x; float y; float z;} vertex_t; - -/* Global vars */ -int width, height; -GLfloat deg_rot_y = 0.f; -GLfloat deg_rot_y_inc = 2.f; -GLboolean override_pos = GL_FALSE; -GLfloat cursor_x = 0.f; -GLfloat cursor_y = 0.f; -GLfloat ball_x = -RADIUS; -GLfloat ball_y = -RADIUS; -GLfloat ball_x_inc = 1.f; -GLfloat ball_y_inc = 2.f; -DRAW_BALL_ENUM drawBallHow; -double t; -double t_old = 0.f; -double dt; - -/* Random number generator */ -#ifndef RAND_MAX - #define RAND_MAX 4095 -#endif - -/* PI */ -#ifndef M_PI - #define M_PI 3.1415926535897932384626433832795 -#endif - - -/***************************************************************************** - * Truncate a degree. - *****************************************************************************/ -GLfloat TruncateDeg( GLfloat deg ) -{ - if ( deg >= 360.f ) - return (deg - 360.f); - else - return deg; -} - -/***************************************************************************** - * Convert a degree (360-based) into a radian. - * 360' = 2 * PI - *****************************************************************************/ -double deg2rad( double deg ) -{ - return deg / 360 * (2 * M_PI); -} - -/***************************************************************************** - * 360' sin(). - *****************************************************************************/ -double sin_deg( double deg ) -{ - return sin( deg2rad( deg ) ); -} - -/***************************************************************************** - * 360' cos(). - *****************************************************************************/ -double cos_deg( double deg ) -{ - return cos( deg2rad( deg ) ); -} - -/***************************************************************************** - * Compute a cross product (for a normal vector). - * - * c = a x b - *****************************************************************************/ -void CrossProduct( vertex_t a, vertex_t b, vertex_t c, vertex_t *n ) -{ - GLfloat u1, u2, u3; - GLfloat v1, v2, v3; - - u1 = b.x - a.x; - u2 = b.y - a.y; - u3 = b.y - a.z; - - v1 = c.x - a.x; - v2 = c.y - a.y; - v3 = c.z - a.z; - - n->x = u2 * v3 - v2 * v3; - n->y = u3 * v1 - v3 * u1; - n->z = u1 * v2 - v1 * u2; -} - -/***************************************************************************** - * Calculate the angle to be passed to gluPerspective() so that a scene - * is visible. This function originates from the OpenGL Red Book. - * - * Parms : size - * The size of the segment when the angle is intersected at "dist" - * (ie at the outermost edge of the angle of vision). - * - * dist - * Distance from viewpoint to scene. - *****************************************************************************/ -GLfloat PerspectiveAngle( GLfloat size, - GLfloat dist ) -{ - GLfloat radTheta, degTheta; - - radTheta = 2.f * (GLfloat) atan2( size / 2.f, dist ); - degTheta = (180.f * radTheta) / (GLfloat) M_PI; - return degTheta; -} - - - -#define BOING_DEBUG 0 - - -/***************************************************************************** - * init() - *****************************************************************************/ -void init( void ) -{ - /* - * Clear background. - */ - glClearColor( 0.55f, 0.55f, 0.55f, 0.f ); - - glShadeModel( GL_FLAT ); -} - - -/***************************************************************************** - * display() - *****************************************************************************/ -void display(void) -{ - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - glPushMatrix(); - - drawBallHow = DRAW_BALL_SHADOW; - DrawBoingBall(); - - DrawGrid(); - - drawBallHow = DRAW_BALL; - DrawBoingBall(); - - glPopMatrix(); - glFlush(); -} - - -/***************************************************************************** - * reshape() - *****************************************************************************/ -void reshape( GLFWwindow* window, int w, int h ) -{ - glViewport( 0, 0, (GLsizei)w, (GLsizei)h ); - - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - - gluPerspective( PerspectiveAngle( RADIUS * 2, 200 ), - (GLfloat)w / (GLfloat)h, - 1.0, - VIEW_SCENE_DIST ); - - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - - gluLookAt( 0.0, 0.0, VIEW_SCENE_DIST,/* eye */ - 0.0, 0.0, 0.0, /* center of vision */ - 0.0, -1.0, 0.0 ); /* up vector */ -} - -void key_callback( GLFWwindow* window, int key, int scancode, int action, int mods ) -{ - if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) - glfwSetWindowShouldClose(window, GL_TRUE); -} - -static void set_ball_pos ( GLfloat x, GLfloat y ) -{ - ball_x = (width / 2) - x; - ball_y = y - (height / 2); -} - -void mouse_button_callback( GLFWwindow* window, int button, int action, int mods ) -{ - if (button != GLFW_MOUSE_BUTTON_LEFT) - return; - - if (action == GLFW_PRESS) - { - override_pos = GL_TRUE; - set_ball_pos(cursor_x, cursor_y); - } - else - { - override_pos = GL_FALSE; - } -} - -void cursor_position_callback( GLFWwindow* window, double x, double y ) -{ - cursor_x = (float) x; - cursor_y = (float) y; - - if ( override_pos ) - set_ball_pos(cursor_x, cursor_y); -} - -/***************************************************************************** - * Draw the Boing ball. - * - * The Boing ball is sphere in which each facet is a rectangle. - * Facet colors alternate between red and white. - * The ball is built by stacking latitudinal circles. Each circle is composed - * of a widely-separated set of points, so that each facet is noticably large. - *****************************************************************************/ -void DrawBoingBall( void ) -{ - GLfloat lon_deg; /* degree of longitude */ - double dt_total, dt2; - - glPushMatrix(); - glMatrixMode( GL_MODELVIEW ); - - /* - * Another relative Z translation to separate objects. - */ - glTranslatef( 0.0, 0.0, DIST_BALL ); - - /* Update ball position and rotation (iterate if necessary) */ - dt_total = dt; - while( dt_total > 0.0 ) - { - dt2 = dt_total > MAX_DELTA_T ? MAX_DELTA_T : dt_total; - dt_total -= dt2; - BounceBall( dt2 ); - deg_rot_y = TruncateDeg( deg_rot_y + deg_rot_y_inc*((float)dt2*ANIMATION_SPEED) ); - } - - /* Set ball position */ - glTranslatef( ball_x, ball_y, 0.0 ); - - /* - * Offset the shadow. - */ - if ( drawBallHow == DRAW_BALL_SHADOW ) - { - glTranslatef( SHADOW_OFFSET_X, - SHADOW_OFFSET_Y, - SHADOW_OFFSET_Z ); - } - - /* - * Tilt the ball. - */ - glRotatef( -20.0, 0.0, 0.0, 1.0 ); - - /* - * Continually rotate ball around Y axis. - */ - glRotatef( deg_rot_y, 0.0, 1.0, 0.0 ); - - /* - * Set OpenGL state for Boing ball. - */ - glCullFace( GL_FRONT ); - glEnable( GL_CULL_FACE ); - glEnable( GL_NORMALIZE ); - - /* - * Build a faceted latitude slice of the Boing ball, - * stepping same-sized vertical bands of the sphere. - */ - for ( lon_deg = 0; - lon_deg < 180; - lon_deg += STEP_LONGITUDE ) - { - /* - * Draw a latitude circle at this longitude. - */ - DrawBoingBallBand( lon_deg, - lon_deg + STEP_LONGITUDE ); - } - - glPopMatrix(); - - return; -} - - -/***************************************************************************** - * Bounce the ball. - *****************************************************************************/ -void BounceBall( double delta_t ) -{ - GLfloat sign; - GLfloat deg; - - if ( override_pos ) - return; - - /* Bounce on walls */ - if ( ball_x > (BOUNCE_WIDTH/2 + WALL_R_OFFSET ) ) - { - ball_x_inc = -0.5f - 0.75f * (GLfloat)rand() / (GLfloat)RAND_MAX; - deg_rot_y_inc = -deg_rot_y_inc; - } - if ( ball_x < -(BOUNCE_HEIGHT/2 + WALL_L_OFFSET) ) - { - ball_x_inc = 0.5f + 0.75f * (GLfloat)rand() / (GLfloat)RAND_MAX; - deg_rot_y_inc = -deg_rot_y_inc; - } - - /* Bounce on floor / roof */ - if ( ball_y > BOUNCE_HEIGHT/2 ) - { - ball_y_inc = -0.75f - 1.f * (GLfloat)rand() / (GLfloat)RAND_MAX; - } - if ( ball_y < -BOUNCE_HEIGHT/2*0.85 ) - { - ball_y_inc = 0.75f + 1.f * (GLfloat)rand() / (GLfloat)RAND_MAX; - } - - /* Update ball position */ - ball_x += ball_x_inc * ((float)delta_t*ANIMATION_SPEED); - ball_y += ball_y_inc * ((float)delta_t*ANIMATION_SPEED); - - /* - * Simulate the effects of gravity on Y movement. - */ - if ( ball_y_inc < 0 ) sign = -1.0; else sign = 1.0; - - deg = (ball_y + BOUNCE_HEIGHT/2) * 90 / BOUNCE_HEIGHT; - if ( deg > 80 ) deg = 80; - if ( deg < 10 ) deg = 10; - - ball_y_inc = sign * 4.f * (float) sin_deg( deg ); -} - - -/***************************************************************************** - * Draw a faceted latitude band of the Boing ball. - * - * Parms: long_lo, long_hi - * Low and high longitudes of slice, resp. - *****************************************************************************/ -void DrawBoingBallBand( GLfloat long_lo, - GLfloat long_hi ) -{ - vertex_t vert_ne; /* "ne" means south-east, so on */ - vertex_t vert_nw; - vertex_t vert_sw; - vertex_t vert_se; - vertex_t vert_norm; - GLfloat lat_deg; - static int colorToggle = 0; - - /* - * Iterate thru the points of a latitude circle. - * A latitude circle is a 2D set of X,Z points. - */ - for ( lat_deg = 0; - lat_deg <= (360 - STEP_LATITUDE); - lat_deg += STEP_LATITUDE ) - { - /* - * Color this polygon with red or white. - */ - if ( colorToggle ) - glColor3f( 0.8f, 0.1f, 0.1f ); - else - glColor3f( 0.95f, 0.95f, 0.95f ); -#if 0 - if ( lat_deg >= 180 ) - if ( colorToggle ) - glColor3f( 0.1f, 0.8f, 0.1f ); - else - glColor3f( 0.5f, 0.5f, 0.95f ); -#endif - colorToggle = ! colorToggle; - - /* - * Change color if drawing shadow. - */ - if ( drawBallHow == DRAW_BALL_SHADOW ) - glColor3f( 0.35f, 0.35f, 0.35f ); - - /* - * Assign each Y. - */ - vert_ne.y = vert_nw.y = (float) cos_deg(long_hi) * RADIUS; - vert_sw.y = vert_se.y = (float) cos_deg(long_lo) * RADIUS; - - /* - * Assign each X,Z with sin,cos values scaled by latitude radius indexed by longitude. - * Eg, long=0 and long=180 are at the poles, so zero scale is sin(longitude), - * while long=90 (sin(90)=1) is at equator. - */ - vert_ne.x = (float) cos_deg( lat_deg ) * (RADIUS * (float) sin_deg( long_lo + STEP_LONGITUDE )); - vert_se.x = (float) cos_deg( lat_deg ) * (RADIUS * (float) sin_deg( long_lo )); - vert_nw.x = (float) cos_deg( lat_deg + STEP_LATITUDE ) * (RADIUS * (float) sin_deg( long_lo + STEP_LONGITUDE )); - vert_sw.x = (float) cos_deg( lat_deg + STEP_LATITUDE ) * (RADIUS * (float) sin_deg( long_lo )); - - vert_ne.z = (float) sin_deg( lat_deg ) * (RADIUS * (float) sin_deg( long_lo + STEP_LONGITUDE )); - vert_se.z = (float) sin_deg( lat_deg ) * (RADIUS * (float) sin_deg( long_lo )); - vert_nw.z = (float) sin_deg( lat_deg + STEP_LATITUDE ) * (RADIUS * (float) sin_deg( long_lo + STEP_LONGITUDE )); - vert_sw.z = (float) sin_deg( lat_deg + STEP_LATITUDE ) * (RADIUS * (float) sin_deg( long_lo )); - - /* - * Draw the facet. - */ - glBegin( GL_POLYGON ); - - CrossProduct( vert_ne, vert_nw, vert_sw, &vert_norm ); - glNormal3f( vert_norm.x, vert_norm.y, vert_norm.z ); - - glVertex3f( vert_ne.x, vert_ne.y, vert_ne.z ); - glVertex3f( vert_nw.x, vert_nw.y, vert_nw.z ); - glVertex3f( vert_sw.x, vert_sw.y, vert_sw.z ); - glVertex3f( vert_se.x, vert_se.y, vert_se.z ); - - glEnd(); - -#if BOING_DEBUG - printf( "----------------------------------------------------------- \n" ); - printf( "lat = %f long_lo = %f long_hi = %f \n", lat_deg, long_lo, long_hi ); - printf( "vert_ne x = %.8f y = %.8f z = %.8f \n", vert_ne.x, vert_ne.y, vert_ne.z ); - printf( "vert_nw x = %.8f y = %.8f z = %.8f \n", vert_nw.x, vert_nw.y, vert_nw.z ); - printf( "vert_se x = %.8f y = %.8f z = %.8f \n", vert_se.x, vert_se.y, vert_se.z ); - printf( "vert_sw x = %.8f y = %.8f z = %.8f \n", vert_sw.x, vert_sw.y, vert_sw.z ); -#endif - - } - - /* - * Toggle color so that next band will opposite red/white colors than this one. - */ - colorToggle = ! colorToggle; - - /* - * This circular band is done. - */ - return; -} - - -/***************************************************************************** - * Draw the purple grid of lines, behind the Boing ball. - * When the Workbench is dropped to the bottom, Boing shows 12 rows. - *****************************************************************************/ -void DrawGrid( void ) -{ - int row, col; - const int rowTotal = 12; /* must be divisible by 2 */ - const int colTotal = rowTotal; /* must be same as rowTotal */ - const GLfloat widthLine = 2.0; /* should be divisible by 2 */ - const GLfloat sizeCell = GRID_SIZE / rowTotal; - const GLfloat z_offset = -40.0; - GLfloat xl, xr; - GLfloat yt, yb; - - glPushMatrix(); - glDisable( GL_CULL_FACE ); - - /* - * Another relative Z translation to separate objects. - */ - glTranslatef( 0.0, 0.0, DIST_BALL ); - - /* - * Draw vertical lines (as skinny 3D rectangles). - */ - for ( col = 0; col <= colTotal; col++ ) - { - /* - * Compute co-ords of line. - */ - xl = -GRID_SIZE / 2 + col * sizeCell; - xr = xl + widthLine; - - yt = GRID_SIZE / 2; - yb = -GRID_SIZE / 2 - widthLine; - - glBegin( GL_POLYGON ); - - glColor3f( 0.6f, 0.1f, 0.6f ); /* purple */ - - glVertex3f( xr, yt, z_offset ); /* NE */ - glVertex3f( xl, yt, z_offset ); /* NW */ - glVertex3f( xl, yb, z_offset ); /* SW */ - glVertex3f( xr, yb, z_offset ); /* SE */ - - glEnd(); - } - - /* - * Draw horizontal lines (as skinny 3D rectangles). - */ - for ( row = 0; row <= rowTotal; row++ ) - { - /* - * Compute co-ords of line. - */ - yt = GRID_SIZE / 2 - row * sizeCell; - yb = yt - widthLine; - - xl = -GRID_SIZE / 2; - xr = GRID_SIZE / 2 + widthLine; - - glBegin( GL_POLYGON ); - - glColor3f( 0.6f, 0.1f, 0.6f ); /* purple */ - - glVertex3f( xr, yt, z_offset ); /* NE */ - glVertex3f( xl, yt, z_offset ); /* NW */ - glVertex3f( xl, yb, z_offset ); /* SW */ - glVertex3f( xr, yb, z_offset ); /* SE */ - - glEnd(); - } - - glPopMatrix(); - - return; -} - - -/*======================================================================* - * main() - *======================================================================*/ - -int main( void ) -{ - GLFWwindow* window; - - /* Init GLFW */ - if( !glfwInit() ) - exit( EXIT_FAILURE ); - - glfwWindowHint(GLFW_DEPTH_BITS, 16); - - window = glfwCreateWindow( 400, 400, "Boing (classic Amiga demo)", NULL, NULL ); - if (!window) - { - glfwTerminate(); - exit( EXIT_FAILURE ); - } - - glfwSetFramebufferSizeCallback(window, reshape); - glfwSetKeyCallback(window, key_callback); - glfwSetMouseButtonCallback(window, mouse_button_callback); - glfwSetCursorPosCallback(window, cursor_position_callback); - - glfwMakeContextCurrent(window); - glfwSwapInterval( 1 ); - - glfwGetFramebufferSize(window, &width, &height); - reshape(window, width, height); - - glfwSetTime( 0.0 ); - - init(); - - /* Main loop */ - for (;;) - { - /* Timing */ - t = glfwGetTime(); - dt = t - t_old; - t_old = t; - - /* Draw one frame */ - display(); - - /* Swap buffers */ - glfwSwapBuffers(window); - glfwPollEvents(); - - /* Check if we are still running */ - if (glfwWindowShouldClose(window)) - break; - } - - glfwTerminate(); - exit( EXIT_SUCCESS ); -} - diff --git a/extern/glfw/examples/gears.c b/extern/glfw/examples/gears.c deleted file mode 100644 index 2d44596..0000000 --- a/extern/glfw/examples/gears.c +++ /dev/null @@ -1,372 +0,0 @@ -/* - * 3-D gear wheels. This program is in the public domain. - * - * Command line options: - * -info print GL implementation information - * -exit automatically exit after 30 seconds - * - * - * Brian Paul - * - * - * Marcus Geelnard: - * - Conversion to GLFW - * - Time based rendering (frame rate independent) - * - Slightly modified camera that should work better for stereo viewing - * - * - * Camilla Berglund: - * - Removed FPS counter (this is not a benchmark) - * - Added a few comments - * - Enabled vsync - */ - - -#include -#include -#include -#include -#include - -#ifndef M_PI -#define M_PI 3.141592654 -#endif - -/* If non-zero, the program exits after that many seconds - */ -static int autoexit = 0; - -/** - - Draw a gear wheel. You'll probably want to call this function when - building a display list since we do a lot of trig here. - - Input: inner_radius - radius of hole at center - outer_radius - radius at center of teeth - width - width of gear teeth - number of teeth - tooth_depth - depth of tooth - - **/ - -static void -gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width, - GLint teeth, GLfloat tooth_depth) -{ - GLint i; - GLfloat r0, r1, r2; - GLfloat angle, da; - GLfloat u, v, len; - - r0 = inner_radius; - r1 = outer_radius - tooth_depth / 2.f; - r2 = outer_radius + tooth_depth / 2.f; - - da = 2.f * (float) M_PI / teeth / 4.f; - - glShadeModel(GL_FLAT); - - glNormal3f(0.f, 0.f, 1.f); - - /* draw front face */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= teeth; i++) { - angle = i * 2.f * (float) M_PI / teeth; - glVertex3f(r0 * (float) cos(angle), r0 * (float) sin(angle), width * 0.5f); - glVertex3f(r1 * (float) cos(angle), r1 * (float) sin(angle), width * 0.5f); - if (i < teeth) { - glVertex3f(r0 * (float) cos(angle), r0 * (float) sin(angle), width * 0.5f); - glVertex3f(r1 * (float) cos(angle + 3 * da), r1 * (float) sin(angle + 3 * da), width * 0.5f); - } - } - glEnd(); - - /* draw front sides of teeth */ - glBegin(GL_QUADS); - da = 2.f * (float) M_PI / teeth / 4.f; - for (i = 0; i < teeth; i++) { - angle = i * 2.f * (float) M_PI / teeth; - - glVertex3f(r1 * (float) cos(angle), r1 * (float) sin(angle), width * 0.5f); - glVertex3f(r2 * (float) cos(angle + da), r2 * (float) sin(angle + da), width * 0.5f); - glVertex3f(r2 * (float) cos(angle + 2 * da), r2 * (float) sin(angle + 2 * da), width * 0.5f); - glVertex3f(r1 * (float) cos(angle + 3 * da), r1 * (float) sin(angle + 3 * da), width * 0.5f); - } - glEnd(); - - glNormal3f(0.0, 0.0, -1.0); - - /* draw back face */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= teeth; i++) { - angle = i * 2.f * (float) M_PI / teeth; - glVertex3f(r1 * (float) cos(angle), r1 * (float) sin(angle), -width * 0.5f); - glVertex3f(r0 * (float) cos(angle), r0 * (float) sin(angle), -width * 0.5f); - if (i < teeth) { - glVertex3f(r1 * (float) cos(angle + 3 * da), r1 * (float) sin(angle + 3 * da), -width * 0.5f); - glVertex3f(r0 * (float) cos(angle), r0 * (float) sin(angle), -width * 0.5f); - } - } - glEnd(); - - /* draw back sides of teeth */ - glBegin(GL_QUADS); - da = 2.f * (float) M_PI / teeth / 4.f; - for (i = 0; i < teeth; i++) { - angle = i * 2.f * (float) M_PI / teeth; - - glVertex3f(r1 * (float) cos(angle + 3 * da), r1 * (float) sin(angle + 3 * da), -width * 0.5f); - glVertex3f(r2 * (float) cos(angle + 2 * da), r2 * (float) sin(angle + 2 * da), -width * 0.5f); - glVertex3f(r2 * (float) cos(angle + da), r2 * (float) sin(angle + da), -width * 0.5f); - glVertex3f(r1 * (float) cos(angle), r1 * (float) sin(angle), -width * 0.5f); - } - glEnd(); - - /* draw outward faces of teeth */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i < teeth; i++) { - angle = i * 2.f * (float) M_PI / teeth; - - glVertex3f(r1 * (float) cos(angle), r1 * (float) sin(angle), width * 0.5f); - glVertex3f(r1 * (float) cos(angle), r1 * (float) sin(angle), -width * 0.5f); - u = r2 * (float) cos(angle + da) - r1 * (float) cos(angle); - v = r2 * (float) sin(angle + da) - r1 * (float) sin(angle); - len = (float) sqrt(u * u + v * v); - u /= len; - v /= len; - glNormal3f(v, -u, 0.0); - glVertex3f(r2 * (float) cos(angle + da), r2 * (float) sin(angle + da), width * 0.5f); - glVertex3f(r2 * (float) cos(angle + da), r2 * (float) sin(angle + da), -width * 0.5f); - glNormal3f((float) cos(angle), (float) sin(angle), 0.f); - glVertex3f(r2 * (float) cos(angle + 2 * da), r2 * (float) sin(angle + 2 * da), width * 0.5f); - glVertex3f(r2 * (float) cos(angle + 2 * da), r2 * (float) sin(angle + 2 * da), -width * 0.5f); - u = r1 * (float) cos(angle + 3 * da) - r2 * (float) cos(angle + 2 * da); - v = r1 * (float) sin(angle + 3 * da) - r2 * (float) sin(angle + 2 * da); - glNormal3f(v, -u, 0.f); - glVertex3f(r1 * (float) cos(angle + 3 * da), r1 * (float) sin(angle + 3 * da), width * 0.5f); - glVertex3f(r1 * (float) cos(angle + 3 * da), r1 * (float) sin(angle + 3 * da), -width * 0.5f); - glNormal3f((float) cos(angle), (float) sin(angle), 0.f); - } - - glVertex3f(r1 * (float) cos(0), r1 * (float) sin(0), width * 0.5f); - glVertex3f(r1 * (float) cos(0), r1 * (float) sin(0), -width * 0.5f); - - glEnd(); - - glShadeModel(GL_SMOOTH); - - /* draw inside radius cylinder */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= teeth; i++) { - angle = i * 2.f * (float) M_PI / teeth; - glNormal3f(-(float) cos(angle), -(float) sin(angle), 0.f); - glVertex3f(r0 * (float) cos(angle), r0 * (float) sin(angle), -width * 0.5f); - glVertex3f(r0 * (float) cos(angle), r0 * (float) sin(angle), width * 0.5f); - } - glEnd(); - -} - - -static GLfloat view_rotx = 20.f, view_roty = 30.f, view_rotz = 0.f; -static GLint gear1, gear2, gear3; -static GLfloat angle = 0.f; - -/* OpenGL draw function & timing */ -static void draw(void) -{ - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - glPushMatrix(); - glRotatef(view_rotx, 1.0, 0.0, 0.0); - glRotatef(view_roty, 0.0, 1.0, 0.0); - glRotatef(view_rotz, 0.0, 0.0, 1.0); - - glPushMatrix(); - glTranslatef(-3.0, -2.0, 0.0); - glRotatef(angle, 0.0, 0.0, 1.0); - glCallList(gear1); - glPopMatrix(); - - glPushMatrix(); - glTranslatef(3.1f, -2.f, 0.f); - glRotatef(-2.f * angle - 9.f, 0.f, 0.f, 1.f); - glCallList(gear2); - glPopMatrix(); - - glPushMatrix(); - glTranslatef(-3.1f, 4.2f, 0.f); - glRotatef(-2.f * angle - 25.f, 0.f, 0.f, 1.f); - glCallList(gear3); - glPopMatrix(); - - glPopMatrix(); -} - - -/* update animation parameters */ -static void animate(void) -{ - angle = 100.f * (float) glfwGetTime(); -} - - -/* change view angle, exit upon ESC */ -void key( GLFWwindow* window, int k, int s, int action, int mods ) -{ - if( action != GLFW_PRESS ) return; - - switch (k) { - case GLFW_KEY_Z: - if( mods & GLFW_MOD_SHIFT ) - view_rotz -= 5.0; - else - view_rotz += 5.0; - break; - case GLFW_KEY_ESCAPE: - glfwSetWindowShouldClose(window, GL_TRUE); - break; - case GLFW_KEY_UP: - view_rotx += 5.0; - break; - case GLFW_KEY_DOWN: - view_rotx -= 5.0; - break; - case GLFW_KEY_LEFT: - view_roty += 5.0; - break; - case GLFW_KEY_RIGHT: - view_roty -= 5.0; - break; - default: - return; - } -} - - -/* new window size */ -void reshape( GLFWwindow* window, int width, int height ) -{ - GLfloat h = (GLfloat) height / (GLfloat) width; - GLfloat xmax, znear, zfar; - - znear = 5.0f; - zfar = 30.0f; - xmax = znear * 0.5f; - - glViewport( 0, 0, (GLint) width, (GLint) height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -xmax, xmax, -xmax*h, xmax*h, znear, zfar ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -20.0 ); -} - - -/* program & OpenGL initialization */ -static void init(int argc, char *argv[]) -{ - static GLfloat pos[4] = {5.f, 5.f, 10.f, 0.f}; - static GLfloat red[4] = {0.8f, 0.1f, 0.f, 1.f}; - static GLfloat green[4] = {0.f, 0.8f, 0.2f, 1.f}; - static GLfloat blue[4] = {0.2f, 0.2f, 1.f, 1.f}; - GLint i; - - glLightfv(GL_LIGHT0, GL_POSITION, pos); - glEnable(GL_CULL_FACE); - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - glEnable(GL_DEPTH_TEST); - - /* make the gears */ - gear1 = glGenLists(1); - glNewList(gear1, GL_COMPILE); - glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red); - gear(1.f, 4.f, 1.f, 20, 0.7f); - glEndList(); - - gear2 = glGenLists(1); - glNewList(gear2, GL_COMPILE); - glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green); - gear(0.5f, 2.f, 2.f, 10, 0.7f); - glEndList(); - - gear3 = glGenLists(1); - glNewList(gear3, GL_COMPILE); - glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue); - gear(1.3f, 2.f, 0.5f, 10, 0.7f); - glEndList(); - - glEnable(GL_NORMALIZE); - - for ( i=1; i -#include -#include -#include -#include -#include "getopt.h" - -#include -#include - -/* Map height updates */ -#define MAX_CIRCLE_SIZE (5.0f) -#define MAX_DISPLACEMENT (1.0f) -#define DISPLACEMENT_SIGN_LIMIT (0.3f) -#define MAX_ITER (200) -#define NUM_ITER_AT_A_TIME (1) - -/* Map general information */ -#define MAP_SIZE (10.0f) -#define MAP_NUM_VERTICES (80) -#define MAP_NUM_TOTAL_VERTICES (MAP_NUM_VERTICES*MAP_NUM_VERTICES) -#define MAP_NUM_LINES (3* (MAP_NUM_VERTICES - 1) * (MAP_NUM_VERTICES - 1) + \ - 2 * (MAP_NUM_VERTICES - 1)) - - -/********************************************************************** - * Default shader programs - *********************************************************************/ - -static const char* default_vertex_shader = -"#version 150\n" -"uniform mat4 project;\n" -"uniform mat4 modelview;\n" -"in float x;\n" -"in float y;\n" -"in float z;\n" -"\n" -"void main()\n" -"{\n" -" gl_Position = project * modelview * vec4(x, y, z, 1.0);\n" -"}\n"; - -static const char* default_fragment_shader = -"#version 150\n" -"out vec4 gl_FragColor;\n" -"void main()\n" -"{\n" -" gl_FragColor = vec4(0.2, 1.0, 0.2, 1.0); \n" -"}\n"; - -/********************************************************************** - * Values for shader uniforms - *********************************************************************/ - -/* Frustum configuration */ -static GLfloat view_angle = 45.0f; -static GLfloat aspect_ratio = 4.0f/3.0f; -static GLfloat z_near = 1.0f; -static GLfloat z_far = 100.f; - -/* Projection matrix */ -static GLfloat projection_matrix[16] = { - 1.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f -}; - -/* Model view matrix */ -static GLfloat modelview_matrix[16] = { - 1.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f -}; - -/********************************************************************** - * Heightmap vertex and index data - *********************************************************************/ - -static GLfloat map_vertices[3][MAP_NUM_TOTAL_VERTICES]; -static GLuint map_line_indices[2*MAP_NUM_LINES]; - -/* Store uniform location for the shaders - * Those values are setup as part of the process of creating - * the shader program. They should not be used before creating - * the program. - */ -static GLuint mesh; -static GLuint mesh_vbo[4]; - -/********************************************************************** - * OpenGL helper functions - *********************************************************************/ - -/* Load a (text) file into memory and return its contents - */ -static char* read_file_content(const char* filename) -{ - FILE* fd; - size_t size = 0; - char* result = NULL; - - fd = fopen(filename, "r"); - if (fd != NULL) - { - size = fseek(fd, 0, SEEK_END); - (void) fseek(fd, 0, SEEK_SET); - - result = malloc(size + 1); - result[size] = '\0'; - if (fread(result, size, 1, fd) != 1) - { - free(result); - result = NULL; - } - (void) fclose(fd); - } - return result; -} - -/* Creates a shader object of the specified type using the specified text - */ -static GLuint make_shader(GLenum type, const char* shader_src) -{ - GLuint shader; - GLint shader_ok; - GLsizei log_length; - char info_log[8192]; - - shader = glCreateShader(type); - if (shader != 0) - { - glShaderSource(shader, 1, (const GLchar**)&shader_src, NULL); - glCompileShader(shader); - glGetShaderiv(shader, GL_COMPILE_STATUS, &shader_ok); - if (shader_ok != GL_TRUE) - { - fprintf(stderr, "ERROR: Failed to compile %s shader\n", (type == GL_FRAGMENT_SHADER) ? "fragment" : "vertex" ); - glGetShaderInfoLog(shader, 8192, &log_length,info_log); - fprintf(stderr, "ERROR: \n%s\n\n", info_log); - glDeleteShader(shader); - shader = 0; - } - } - return shader; -} - -/* Creates a program object using the specified vertex and fragment text - */ -static GLuint make_shader_program(const char* vertex_shader_src, const char* fragment_shader_src) -{ - GLuint program = 0u; - GLint program_ok; - GLuint vertex_shader = 0u; - GLuint fragment_shader = 0u; - GLsizei log_length; - char info_log[8192]; - - vertex_shader = make_shader(GL_VERTEX_SHADER, (vertex_shader_src == NULL) ? default_vertex_shader : vertex_shader_src); - if (vertex_shader != 0u) - { - fragment_shader = make_shader(GL_FRAGMENT_SHADER, (fragment_shader_src == NULL) ? default_fragment_shader : fragment_shader_src); - if (fragment_shader != 0u) - { - /* make the program that connect the two shader and link it */ - program = glCreateProgram(); - if (program != 0u) - { - /* attach both shader and link */ - glAttachShader(program, vertex_shader); - glAttachShader(program, fragment_shader); - glLinkProgram(program); - glGetProgramiv(program, GL_LINK_STATUS, &program_ok); - - if (program_ok != GL_TRUE) - { - fprintf(stderr, "ERROR, failed to link shader program\n"); - glGetProgramInfoLog(program, 8192, &log_length, info_log); - fprintf(stderr, "ERROR: \n%s\n\n", info_log); - glDeleteProgram(program); - glDeleteShader(fragment_shader); - glDeleteShader(vertex_shader); - program = 0u; - } - } - } - else - { - fprintf(stderr, "ERROR: Unable to load fragment shader\n"); - glDeleteShader(vertex_shader); - } - } - else - { - fprintf(stderr, "ERROR: Unable to load vertex shader\n"); - } - return program; -} - -/********************************************************************** - * Geometry creation functions - *********************************************************************/ - -/* Generate vertices and indices for the heightmap - */ -static void init_map(void) -{ - int i; - int j; - int k; - GLfloat step = MAP_SIZE / (MAP_NUM_VERTICES - 1); - GLfloat x = 0.0f; - GLfloat z = 0.0f; - /* Create a flat grid */ - k = 0; - for (i = 0 ; i < MAP_NUM_VERTICES ; ++i) - { - for (j = 0 ; j < MAP_NUM_VERTICES ; ++j) - { - map_vertices[0][k] = x; - map_vertices[1][k] = 0.0f; - map_vertices[2][k] = z; - z += step; - ++k; - } - x += step; - z = 0.0f; - } -#if DEBUG_ENABLED - for (i = 0 ; i < MAP_NUM_TOTAL_VERTICES ; ++i) - { - printf ("Vertice %d (%f, %f, %f)\n", - i, map_vertices[0][i], map_vertices[1][i], map_vertices[2][i]); - - } -#endif - /* create indices */ - /* line fan based on i - * i+1 - * | / i + n + 1 - * | / - * |/ - * i --- i + n - */ - - /* close the top of the square */ - k = 0; - for (i = 0 ; i < MAP_NUM_VERTICES -1 ; ++i) - { - map_line_indices[k++] = (i + 1) * MAP_NUM_VERTICES -1; - map_line_indices[k++] = (i + 2) * MAP_NUM_VERTICES -1; - } - /* close the right of the square */ - for (i = 0 ; i < MAP_NUM_VERTICES -1 ; ++i) - { - map_line_indices[k++] = (MAP_NUM_VERTICES - 1) * MAP_NUM_VERTICES + i; - map_line_indices[k++] = (MAP_NUM_VERTICES - 1) * MAP_NUM_VERTICES + i + 1; - } - - for (i = 0 ; i < (MAP_NUM_VERTICES - 1) ; ++i) - { - for (j = 0 ; j < (MAP_NUM_VERTICES - 1) ; ++j) - { - int ref = i * (MAP_NUM_VERTICES) + j; - map_line_indices[k++] = ref; - map_line_indices[k++] = ref + 1; - - map_line_indices[k++] = ref; - map_line_indices[k++] = ref + MAP_NUM_VERTICES; - - map_line_indices[k++] = ref; - map_line_indices[k++] = ref + MAP_NUM_VERTICES + 1; - } - } - -#ifdef DEBUG_ENABLED - for (k = 0 ; k < 2 * MAP_NUM_LINES ; k += 2) - { - int beg, end; - beg = map_line_indices[k]; - end = map_line_indices[k+1]; - printf ("Line %d: %d -> %d (%f, %f, %f) -> (%f, %f, %f)\n", - k / 2, beg, end, - map_vertices[0][beg], map_vertices[1][beg], map_vertices[2][beg], - map_vertices[0][end], map_vertices[1][end], map_vertices[2][end]); - } -#endif -} - -static void generate_heightmap__circle(float* center_x, float* center_y, - float* size, float* displacement) -{ - float sign; - /* random value for element in between [0-1.0] */ - *center_x = (MAP_SIZE * rand()) / (1.0f * RAND_MAX); - *center_y = (MAP_SIZE * rand()) / (1.0f * RAND_MAX); - *size = (MAX_CIRCLE_SIZE * rand()) / (1.0f * RAND_MAX); - sign = (1.0f * rand()) / (1.0f * RAND_MAX); - sign = (sign < DISPLACEMENT_SIGN_LIMIT) ? -1.0f : 1.0f; - *displacement = (sign * (MAX_DISPLACEMENT * rand())) / (1.0f * RAND_MAX); -} - -/* Run the specified number of iterations of the generation process for the - * heightmap - */ -static void update_map(int num_iter) -{ - assert(num_iter > 0); - while(num_iter) - { - /* center of the circle */ - float center_x; - float center_z; - float circle_size; - float disp; - size_t ii; - generate_heightmap__circle(¢er_x, ¢er_z, &circle_size, &disp); - disp = disp / 2.0f; - for (ii = 0u ; ii < MAP_NUM_TOTAL_VERTICES ; ++ii) - { - GLfloat dx = center_x - map_vertices[0][ii]; - GLfloat dz = center_z - map_vertices[2][ii]; - GLfloat pd = (2.0f * sqrtf((dx * dx) + (dz * dz))) / circle_size; - if (fabs(pd) <= 1.0f) - { - /* tx,tz is within the circle */ - GLfloat new_height = disp + (float) (cos(pd*3.14f)*disp); - map_vertices[1][ii] += new_height; - } - } - --num_iter; - } -} - -/********************************************************************** - * OpenGL helper functions - *********************************************************************/ - -/* Create VBO, IBO and VAO objects for the heightmap geometry and bind them to - * the specified program object - */ -static void make_mesh(GLuint program) -{ - GLuint attrloc; - - glGenVertexArrays(1, &mesh); - glGenBuffers(4, mesh_vbo); - glBindVertexArray(mesh); - /* Prepare the data for drawing through a buffer inidices */ - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mesh_vbo[3]); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(GLuint)* MAP_NUM_LINES * 2, map_line_indices, GL_STATIC_DRAW); - - /* Prepare the attributes for rendering */ - attrloc = glGetAttribLocation(program, "x"); - glBindBuffer(GL_ARRAY_BUFFER, mesh_vbo[0]); - glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * MAP_NUM_TOTAL_VERTICES, &map_vertices[0][0], GL_STATIC_DRAW); - glEnableVertexAttribArray(attrloc); - glVertexAttribPointer(attrloc, 1, GL_FLOAT, GL_FALSE, 0, 0); - - attrloc = glGetAttribLocation(program, "z"); - glBindBuffer(GL_ARRAY_BUFFER, mesh_vbo[2]); - glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * MAP_NUM_TOTAL_VERTICES, &map_vertices[2][0], GL_STATIC_DRAW); - glEnableVertexAttribArray(attrloc); - glVertexAttribPointer(attrloc, 1, GL_FLOAT, GL_FALSE, 0, 0); - - attrloc = glGetAttribLocation(program, "y"); - glBindBuffer(GL_ARRAY_BUFFER, mesh_vbo[1]); - glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * MAP_NUM_TOTAL_VERTICES, &map_vertices[1][0], GL_DYNAMIC_DRAW); - glEnableVertexAttribArray(attrloc); - glVertexAttribPointer(attrloc, 1, GL_FLOAT, GL_FALSE, 0, 0); -} - -/* Update VBO vertices from source data - */ -static void update_mesh(void) -{ - glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(GLfloat) * MAP_NUM_TOTAL_VERTICES, &map_vertices[1][0]); -} - -/********************************************************************** - * GLFW callback functions - *********************************************************************/ - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - switch(key) - { - case GLFW_KEY_ESCAPE: - /* Exit program on Escape */ - glfwSetWindowShouldClose(window, GL_TRUE); - break; - } -} - -/* Print usage information */ -static void usage(void) -{ - printf("Usage: heightmap [-v ] [-f ]\n"); - printf(" heightmap [-h]\n"); -} - -int main(int argc, char** argv) -{ - GLFWwindow* window; - int ch, iter; - double dt; - double last_update_time; - int frame; - float f; - GLint uloc_modelview; - GLint uloc_project; - - char* vertex_shader_path = NULL; - char* fragment_shader_path = NULL; - char* vertex_shader_src = NULL; - char* fragment_shader_src = NULL; - GLuint shader_program; - - while ((ch = getopt(argc, argv, "f:v:h")) != -1) - { - switch (ch) - { - case 'f': - fragment_shader_path = optarg; - break; - case 'v': - vertex_shader_path = optarg; - break; - case 'h': - usage(); - exit(EXIT_SUCCESS); - default: - usage(); - exit(EXIT_FAILURE); - } - } - - if (fragment_shader_path) - { - vertex_shader_src = read_file_content(fragment_shader_path); - if (!fragment_shader_src) - { - fprintf(stderr, - "ERROR: unable to load fragment shader from '%s'\n", - fragment_shader_path); - exit(EXIT_FAILURE); - } - } - - if (vertex_shader_path) - { - vertex_shader_src = read_file_content(vertex_shader_path); - if (!vertex_shader_src) - { - fprintf(stderr, - "ERROR: unable to load vertex shader from '%s'\n", - fragment_shader_path); - exit(EXIT_FAILURE); - } - } - - if (!glfwInit()) - { - fprintf(stderr, "ERROR: Unable to initialize GLFW\n"); - usage(); - - free(vertex_shader_src); - free(fragment_shader_src); - exit(EXIT_FAILURE); - } - - glfwWindowHint(GLFW_RESIZABLE, GL_FALSE); - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); - glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); - glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_FALSE); - - window = glfwCreateWindow(800, 600, "GLFW OpenGL3 Heightmap demo", NULL, NULL); - if (! window ) - { - fprintf(stderr, "ERROR: Unable to create the OpenGL context and associated window\n"); - usage(); - - free(vertex_shader_src); - free(fragment_shader_src); - - glfwTerminate(); - exit(EXIT_FAILURE); - } - - /* Register events callback */ - glfwSetKeyCallback(window, key_callback); - - glfwMakeContextCurrent(window); - gladLoadGLLoader((GLADloadproc) glfwGetProcAddress); - - /* Prepare opengl resources for rendering */ - shader_program = make_shader_program(vertex_shader_src , fragment_shader_src); - free(vertex_shader_src); - free(fragment_shader_src); - - if (shader_program == 0u) - { - fprintf(stderr, "ERROR: during creation of the shader program\n"); - usage(); - - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glUseProgram(shader_program); - uloc_project = glGetUniformLocation(shader_program, "project"); - uloc_modelview = glGetUniformLocation(shader_program, "modelview"); - - /* Compute the projection matrix */ - f = 1.0f / tanf(view_angle / 2.0f); - projection_matrix[0] = f / aspect_ratio; - projection_matrix[5] = f; - projection_matrix[10] = (z_far + z_near)/ (z_near - z_far); - projection_matrix[11] = -1.0f; - projection_matrix[14] = 2.0f * (z_far * z_near) / (z_near - z_far); - glUniformMatrix4fv(uloc_project, 1, GL_FALSE, projection_matrix); - - /* Set the camera position */ - modelview_matrix[12] = -5.0f; - modelview_matrix[13] = -5.0f; - modelview_matrix[14] = -20.0f; - glUniformMatrix4fv(uloc_modelview, 1, GL_FALSE, modelview_matrix); - - /* Create mesh data */ - init_map(); - make_mesh(shader_program); - - /* Create vao + vbo to store the mesh */ - /* Create the vbo to store all the information for the grid and the height */ - - /* setup the scene ready for rendering */ - glViewport(0, 0, 800, 600); - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - - /* main loop */ - frame = 0; - iter = 0; - last_update_time = glfwGetTime(); - - while (!glfwWindowShouldClose(window)) - { - ++frame; - /* render the next frame */ - glClear(GL_COLOR_BUFFER_BIT); - glDrawElements(GL_LINES, 2* MAP_NUM_LINES , GL_UNSIGNED_INT, 0); - - /* display and process events through callbacks */ - glfwSwapBuffers(window); - glfwPollEvents(); - /* Check the frame rate and update the heightmap if needed */ - dt = glfwGetTime(); - if ((dt - last_update_time) > 0.2) - { - /* generate the next iteration of the heightmap */ - if (iter < MAX_ITER) - { - update_map(NUM_ITER_AT_A_TIME); - update_mesh(); - iter += NUM_ITER_AT_A_TIME; - } - last_update_time = dt; - frame = 0; - } - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/extern/glfw/examples/particles.c b/extern/glfw/examples/particles.c deleted file mode 100644 index dc9e9fc..0000000 --- a/extern/glfw/examples/particles.c +++ /dev/null @@ -1,1061 +0,0 @@ -//======================================================================== -// A simple particle engine with threaded physics -// Copyright (c) Marcus Geelnard -// Copyright (c) Camilla Berglund -// -// 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. -// -//======================================================================== - -#include -#include -#include -#include -#include - -#include -#include - -#define GLFW_INCLUDE_GLU -#include - -// Define tokens for GL_EXT_separate_specular_color if not already defined -#ifndef GL_EXT_separate_specular_color -#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 -#define GL_SINGLE_COLOR_EXT 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA -#endif // GL_EXT_separate_specular_color - -// Some 's do not define M_PI -#ifndef M_PI -#define M_PI 3.141592654 -#endif - - -//======================================================================== -// Type definitions -//======================================================================== - -typedef struct -{ - float x, y, z; -} Vec3; - -// This structure is used for interleaved vertex arrays (see the -// draw_particles function) -// -// NOTE: This structure SHOULD be packed on most systems. It uses 32-bit fields -// on 32-bit boundaries, and is a multiple of 64 bits in total (6x32=3x64). If -// it does not work, try using pragmas or whatever to force the structure to be -// packed. -typedef struct -{ - GLfloat s, t; // Texture coordinates - GLuint rgba; // Color (four ubytes packed into an uint) - GLfloat x, y, z; // Vertex coordinates -} Vertex; - - -//======================================================================== -// Program control global variables -//======================================================================== - -// Window dimensions -float aspect_ratio; - -// "wireframe" flag (true if we use wireframe view) -int wireframe; - -// Thread synchronization -struct { - double t; // Time (s) - float dt; // Time since last frame (s) - int p_frame; // Particle physics frame number - int d_frame; // Particle draw frame number - cnd_t p_done; // Condition: particle physics done - cnd_t d_done; // Condition: particle draw done - mtx_t particles_lock; // Particles data sharing mutex -} thread_sync; - - -//======================================================================== -// Texture declarations (we hard-code them into the source code, since -// they are so simple) -//======================================================================== - -#define P_TEX_WIDTH 8 // Particle texture dimensions -#define P_TEX_HEIGHT 8 -#define F_TEX_WIDTH 16 // Floor texture dimensions -#define F_TEX_HEIGHT 16 - -// Texture object IDs -GLuint particle_tex_id, floor_tex_id; - -// Particle texture (a simple spot) -const unsigned char particle_texture[ P_TEX_WIDTH * P_TEX_HEIGHT ] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x11, 0x22, 0x22, 0x11, 0x00, 0x00, - 0x00, 0x11, 0x33, 0x88, 0x77, 0x33, 0x11, 0x00, - 0x00, 0x22, 0x88, 0xff, 0xee, 0x77, 0x22, 0x00, - 0x00, 0x22, 0x77, 0xee, 0xff, 0x88, 0x22, 0x00, - 0x00, 0x11, 0x33, 0x77, 0x88, 0x33, 0x11, 0x00, - 0x00, 0x00, 0x11, 0x33, 0x22, 0x11, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -// Floor texture (your basic checkered floor) -const unsigned char floor_texture[ F_TEX_WIDTH * F_TEX_HEIGHT ] = { - 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0xff, 0xf0, 0xcc, 0xf0, 0xf0, 0xf0, 0xff, 0xf0, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0xf0, 0xcc, 0xee, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0x30, 0x66, 0x30, 0x30, 0x30, 0x20, 0x30, 0x30, - 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xee, 0xf0, 0xf0, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0xf0, 0xf0, 0xf0, 0xf0, 0xcc, 0xf0, 0xf0, 0xf0, 0x30, 0x30, 0x55, 0x30, 0x30, 0x44, 0x30, 0x30, - 0xf0, 0xdd, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x33, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xf0, 0xf0, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x60, 0x30, - 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x33, 0x33, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x30, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, 0x30, 0x30, 0xf0, 0xff, 0xf0, 0xf0, 0xdd, 0xf0, 0xf0, 0xff, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x55, 0x33, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xf0, 0xf0, - 0x30, 0x44, 0x66, 0x30, 0x30, 0x30, 0x30, 0x30, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0xf0, 0xf0, 0xf0, 0xaa, 0xf0, 0xf0, 0xcc, 0xf0, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0xff, 0xf0, 0xf0, 0xf0, 0xff, 0xf0, 0xdd, 0xf0, - 0x30, 0x30, 0x30, 0x77, 0x30, 0x30, 0x30, 0x30, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, -}; - - -//======================================================================== -// These are fixed constants that control the particle engine. In a -// modular world, these values should be variables... -//======================================================================== - -// Maximum number of particles -#define MAX_PARTICLES 3000 - -// Life span of a particle (in seconds) -#define LIFE_SPAN 8.f - -// A new particle is born every [BIRTH_INTERVAL] second -#define BIRTH_INTERVAL (LIFE_SPAN/(float)MAX_PARTICLES) - -// Particle size (meters) -#define PARTICLE_SIZE 0.7f - -// Gravitational constant (m/s^2) -#define GRAVITY 9.8f - -// Base initial velocity (m/s) -#define VELOCITY 8.f - -// Bounce friction (1.0 = no friction, 0.0 = maximum friction) -#define FRICTION 0.75f - -// "Fountain" height (m) -#define FOUNTAIN_HEIGHT 3.f - -// Fountain radius (m) -#define FOUNTAIN_RADIUS 1.6f - -// Minimum delta-time for particle phisics (s) -#define MIN_DELTA_T (BIRTH_INTERVAL * 0.5f) - - -//======================================================================== -// Particle system global variables -//======================================================================== - -// This structure holds all state for a single particle -typedef struct { - float x,y,z; // Position in space - float vx,vy,vz; // Velocity vector - float r,g,b; // Color of particle - float life; // Life of particle (1.0 = newborn, < 0.0 = dead) - int active; // Tells if this particle is active -} PARTICLE; - -// Global vectors holding all particles. We use two vectors for double -// buffering. -static PARTICLE particles[MAX_PARTICLES]; - -// Global variable holding the age of the youngest particle -static float min_age; - -// Color of latest born particle (used for fountain lighting) -static float glow_color[4]; - -// Position of latest born particle (used for fountain lighting) -static float glow_pos[4]; - - -//======================================================================== -// Object material and fog configuration constants -//======================================================================== - -const GLfloat fountain_diffuse[4] = { 0.7f, 1.f, 1.f, 1.f }; -const GLfloat fountain_specular[4] = { 1.f, 1.f, 1.f, 1.f }; -const GLfloat fountain_shininess = 12.f; -const GLfloat floor_diffuse[4] = { 1.f, 0.6f, 0.6f, 1.f }; -const GLfloat floor_specular[4] = { 0.6f, 0.6f, 0.6f, 1.f }; -const GLfloat floor_shininess = 18.f; -const GLfloat fog_color[4] = { 0.1f, 0.1f, 0.1f, 1.f }; - - -//======================================================================== -// Print usage information -//======================================================================== - -static void usage(void) -{ - printf("Usage: particles [-bfhs]\n"); - printf("Options:\n"); - printf(" -f Run in full screen\n"); - printf(" -h Display this help\n"); - printf(" -s Run program as single thread (default is to use two threads)\n"); - printf("\n"); - printf("Program runtime controls:\n"); - printf(" W Toggle wireframe mode\n"); - printf(" Esc Exit program\n"); -} - - -//======================================================================== -// Initialize a new particle -//======================================================================== - -static void init_particle(PARTICLE *p, double t) -{ - float xy_angle, velocity; - - // Start position of particle is at the fountain blow-out - p->x = 0.f; - p->y = 0.f; - p->z = FOUNTAIN_HEIGHT; - - // Start velocity is up (Z)... - p->vz = 0.7f + (0.3f / 4096.f) * (float) (rand() & 4095); - - // ...and a randomly chosen X/Y direction - xy_angle = (2.f * (float) M_PI / 4096.f) * (float) (rand() & 4095); - p->vx = 0.4f * (float) cos(xy_angle); - p->vy = 0.4f * (float) sin(xy_angle); - - // Scale velocity vector according to a time-varying velocity - velocity = VELOCITY * (0.8f + 0.1f * (float) (sin(0.5 * t) + sin(1.31 * t))); - p->vx *= velocity; - p->vy *= velocity; - p->vz *= velocity; - - // Color is time-varying - p->r = 0.7f + 0.3f * (float) sin(0.34 * t + 0.1); - p->g = 0.6f + 0.4f * (float) sin(0.63 * t + 1.1); - p->b = 0.6f + 0.4f * (float) sin(0.91 * t + 2.1); - - // Store settings for fountain glow lighting - glow_pos[0] = 0.4f * (float) sin(1.34 * t); - glow_pos[1] = 0.4f * (float) sin(3.11 * t); - glow_pos[2] = FOUNTAIN_HEIGHT + 1.f; - glow_pos[3] = 1.f; - glow_color[0] = p->r; - glow_color[1] = p->g; - glow_color[2] = p->b; - glow_color[3] = 1.f; - - // The particle is new-born and active - p->life = 1.f; - p->active = 1; -} - - -//======================================================================== -// Update a particle -//======================================================================== - -#define FOUNTAIN_R2 (FOUNTAIN_RADIUS+PARTICLE_SIZE/2)*(FOUNTAIN_RADIUS+PARTICLE_SIZE/2) - -static void update_particle(PARTICLE *p, float dt) -{ - // If the particle is not active, we need not do anything - if (!p->active) - return; - - // The particle is getting older... - p->life -= dt * (1.f / LIFE_SPAN); - - // Did the particle die? - if (p->life <= 0.f) - { - p->active = 0; - return; - } - - // Apply gravity - p->vz = p->vz - GRAVITY * dt; - - // Update particle position - p->x = p->x + p->vx * dt; - p->y = p->y + p->vy * dt; - p->z = p->z + p->vz * dt; - - // Simple collision detection + response - if (p->vz < 0.f) - { - // Particles should bounce on the fountain (with friction) - if ((p->x * p->x + p->y * p->y) < FOUNTAIN_R2 && - p->z < (FOUNTAIN_HEIGHT + PARTICLE_SIZE / 2)) - { - p->vz = -FRICTION * p->vz; - p->z = FOUNTAIN_HEIGHT + PARTICLE_SIZE / 2 + - FRICTION * (FOUNTAIN_HEIGHT + - PARTICLE_SIZE / 2 - p->z); - } - - // Particles should bounce on the floor (with friction) - else if (p->z < PARTICLE_SIZE / 2) - { - p->vz = -FRICTION * p->vz; - p->z = PARTICLE_SIZE / 2 + - FRICTION * (PARTICLE_SIZE / 2 - p->z); - } - } -} - - -//======================================================================== -// The main frame for the particle engine. Called once per frame. -//======================================================================== - -static void particle_engine(double t, float dt) -{ - int i; - float dt2; - - // Update particles (iterated several times per frame if dt is too large) - while (dt > 0.f) - { - // Calculate delta time for this iteration - dt2 = dt < MIN_DELTA_T ? dt : MIN_DELTA_T; - - for (i = 0; i < MAX_PARTICLES; i++) - update_particle(&particles[i], dt2); - - min_age += dt2; - - // Should we create any new particle(s)? - while (min_age >= BIRTH_INTERVAL) - { - min_age -= BIRTH_INTERVAL; - - // Find a dead particle to replace with a new one - for (i = 0; i < MAX_PARTICLES; i++) - { - if (!particles[i].active) - { - init_particle(&particles[i], t + min_age); - update_particle(&particles[i], min_age); - break; - } - } - } - - dt -= dt2; - } -} - - -//======================================================================== -// Draw all active particles. We use OpenGL 1.1 vertex -// arrays for this in order to accelerate the drawing. -//======================================================================== - -#define BATCH_PARTICLES 70 // Number of particles to draw in each batch - // (70 corresponds to 7.5 KB = will not blow - // the L1 data cache on most CPUs) -#define PARTICLE_VERTS 4 // Number of vertices per particle - -static void draw_particles(GLFWwindow* window, double t, float dt) -{ - int i, particle_count; - Vertex vertex_array[BATCH_PARTICLES * PARTICLE_VERTS]; - Vertex* vptr; - float alpha; - GLuint rgba; - Vec3 quad_lower_left, quad_lower_right; - GLfloat mat[16]; - PARTICLE* pptr; - - // Here comes the real trick with flat single primitive objects (s.c. - // "billboards"): We must rotate the textured primitive so that it - // always faces the viewer (is coplanar with the view-plane). - // We: - // 1) Create the primitive around origo (0,0,0) - // 2) Rotate it so that it is coplanar with the view plane - // 3) Translate it according to the particle position - // Note that 1) and 2) is the same for all particles (done only once). - - // Get modelview matrix. We will only use the upper left 3x3 part of - // the matrix, which represents the rotation. - glGetFloatv(GL_MODELVIEW_MATRIX, mat); - - // 1) & 2) We do it in one swift step: - // Although not obvious, the following six lines represent two matrix/ - // vector multiplications. The matrix is the inverse 3x3 rotation - // matrix (i.e. the transpose of the same matrix), and the two vectors - // represent the lower left corner of the quad, PARTICLE_SIZE/2 * - // (-1,-1,0), and the lower right corner, PARTICLE_SIZE/2 * (1,-1,0). - // The upper left/right corners of the quad is always the negative of - // the opposite corners (regardless of rotation). - quad_lower_left.x = (-PARTICLE_SIZE / 2) * (mat[0] + mat[1]); - quad_lower_left.y = (-PARTICLE_SIZE / 2) * (mat[4] + mat[5]); - quad_lower_left.z = (-PARTICLE_SIZE / 2) * (mat[8] + mat[9]); - quad_lower_right.x = (PARTICLE_SIZE / 2) * (mat[0] - mat[1]); - quad_lower_right.y = (PARTICLE_SIZE / 2) * (mat[4] - mat[5]); - quad_lower_right.z = (PARTICLE_SIZE / 2) * (mat[8] - mat[9]); - - // Don't update z-buffer, since all particles are transparent! - glDepthMask(GL_FALSE); - - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE); - - // Select particle texture - if (!wireframe) - { - glEnable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, particle_tex_id); - } - - // Set up vertex arrays. We use interleaved arrays, which is easier to - // handle (in most situations) and it gives a linear memeory access - // access pattern (which may give better performance in some - // situations). GL_T2F_C4UB_V3F means: 2 floats for texture coords, - // 4 ubytes for color and 3 floats for vertex coord (in that order). - // Most OpenGL cards / drivers are optimized for this format. - glInterleavedArrays(GL_T2F_C4UB_V3F, 0, vertex_array); - - // Wait for particle physics thread to be done - mtx_lock(&thread_sync.particles_lock); - while (!glfwWindowShouldClose(window) && - thread_sync.p_frame <= thread_sync.d_frame) - { - struct timespec ts; - clock_gettime(CLOCK_REALTIME, &ts); - ts.tv_nsec += 100000000; - cnd_timedwait(&thread_sync.p_done, &thread_sync.particles_lock, &ts); - } - - // Store the frame time and delta time for the physics thread - thread_sync.t = t; - thread_sync.dt = dt; - - // Update frame counter - thread_sync.d_frame++; - - // Loop through all particles and build vertex arrays. - particle_count = 0; - vptr = vertex_array; - pptr = particles; - - for (i = 0; i < MAX_PARTICLES; i++) - { - if (pptr->active) - { - // Calculate particle intensity (we set it to max during 75% - // of its life, then it fades out) - alpha = 4.f * pptr->life; - if (alpha > 1.f) - alpha = 1.f; - - // Convert color from float to 8-bit (store it in a 32-bit - // integer using endian independent type casting) - ((GLubyte*) &rgba)[0] = (GLubyte)(pptr->r * 255.f); - ((GLubyte*) &rgba)[1] = (GLubyte)(pptr->g * 255.f); - ((GLubyte*) &rgba)[2] = (GLubyte)(pptr->b * 255.f); - ((GLubyte*) &rgba)[3] = (GLubyte)(alpha * 255.f); - - // 3) Translate the quad to the correct position in modelview - // space and store its parameters in vertex arrays (we also - // store texture coord and color information for each vertex). - - // Lower left corner - vptr->s = 0.f; - vptr->t = 0.f; - vptr->rgba = rgba; - vptr->x = pptr->x + quad_lower_left.x; - vptr->y = pptr->y + quad_lower_left.y; - vptr->z = pptr->z + quad_lower_left.z; - vptr ++; - - // Lower right corner - vptr->s = 1.f; - vptr->t = 0.f; - vptr->rgba = rgba; - vptr->x = pptr->x + quad_lower_right.x; - vptr->y = pptr->y + quad_lower_right.y; - vptr->z = pptr->z + quad_lower_right.z; - vptr ++; - - // Upper right corner - vptr->s = 1.f; - vptr->t = 1.f; - vptr->rgba = rgba; - vptr->x = pptr->x - quad_lower_left.x; - vptr->y = pptr->y - quad_lower_left.y; - vptr->z = pptr->z - quad_lower_left.z; - vptr ++; - - // Upper left corner - vptr->s = 0.f; - vptr->t = 1.f; - vptr->rgba = rgba; - vptr->x = pptr->x - quad_lower_right.x; - vptr->y = pptr->y - quad_lower_right.y; - vptr->z = pptr->z - quad_lower_right.z; - vptr ++; - - // Increase count of drawable particles - particle_count ++; - } - - // If we have filled up one batch of particles, draw it as a set - // of quads using glDrawArrays. - if (particle_count >= BATCH_PARTICLES) - { - // The first argument tells which primitive type we use (QUAD) - // The second argument tells the index of the first vertex (0) - // The last argument is the vertex count - glDrawArrays(GL_QUADS, 0, PARTICLE_VERTS * particle_count); - particle_count = 0; - vptr = vertex_array; - } - - // Next particle - pptr++; - } - - // We are done with the particle data - mtx_unlock(&thread_sync.particles_lock); - cnd_signal(&thread_sync.d_done); - - // Draw final batch of particles (if any) - glDrawArrays(GL_QUADS, 0, PARTICLE_VERTS * particle_count); - - // Disable vertex arrays (Note: glInterleavedArrays implicitly called - // glEnableClientState for vertex, texture coord and color arrays) - glDisableClientState(GL_VERTEX_ARRAY); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - glDisableClientState(GL_COLOR_ARRAY); - - glDisable(GL_TEXTURE_2D); - glDisable(GL_BLEND); - - glDepthMask(GL_TRUE); -} - - -//======================================================================== -// Fountain geometry specification -//======================================================================== - -#define FOUNTAIN_SIDE_POINTS 14 -#define FOUNTAIN_SWEEP_STEPS 32 - -static const float fountain_side[FOUNTAIN_SIDE_POINTS * 2] = -{ - 1.2f, 0.f, 1.f, 0.2f, 0.41f, 0.3f, 0.4f, 0.35f, - 0.4f, 1.95f, 0.41f, 2.f, 0.8f, 2.2f, 1.2f, 2.4f, - 1.5f, 2.7f, 1.55f,2.95f, 1.6f, 3.f, 1.f, 3.f, - 0.5f, 3.f, 0.f, 3.f -}; - -static const float fountain_normal[FOUNTAIN_SIDE_POINTS * 2] = -{ - 1.0000f, 0.0000f, 0.6428f, 0.7660f, 0.3420f, 0.9397f, 1.0000f, 0.0000f, - 1.0000f, 0.0000f, 0.3420f,-0.9397f, 0.4226f,-0.9063f, 0.5000f,-0.8660f, - 0.7660f,-0.6428f, 0.9063f,-0.4226f, 0.0000f,1.00000f, 0.0000f,1.00000f, - 0.0000f,1.00000f, 0.0000f,1.00000f -}; - - -//======================================================================== -// Draw a fountain -//======================================================================== - -static void draw_fountain(void) -{ - static GLuint fountain_list = 0; - double angle; - float x, y; - int m, n; - - // The first time, we build the fountain display list - if (!fountain_list) - { - fountain_list = glGenLists(1); - glNewList(fountain_list, GL_COMPILE_AND_EXECUTE); - - glMaterialfv(GL_FRONT, GL_DIFFUSE, fountain_diffuse); - glMaterialfv(GL_FRONT, GL_SPECULAR, fountain_specular); - glMaterialf(GL_FRONT, GL_SHININESS, fountain_shininess); - - // Build fountain using triangle strips - for (n = 0; n < FOUNTAIN_SIDE_POINTS - 1; n++) - { - glBegin(GL_TRIANGLE_STRIP); - for (m = 0; m <= FOUNTAIN_SWEEP_STEPS; m++) - { - angle = (double) m * (2.0 * M_PI / (double) FOUNTAIN_SWEEP_STEPS); - x = (float) cos(angle); - y = (float) sin(angle); - - // Draw triangle strip - glNormal3f(x * fountain_normal[n * 2 + 2], - y * fountain_normal[n * 2 + 2], - fountain_normal[n * 2 + 3]); - glVertex3f(x * fountain_side[n * 2 + 2], - y * fountain_side[n * 2 + 2], - fountain_side[n * 2 +3 ]); - glNormal3f(x * fountain_normal[n * 2], - y * fountain_normal[n * 2], - fountain_normal[n * 2 + 1]); - glVertex3f(x * fountain_side[n * 2], - y * fountain_side[n * 2], - fountain_side[n * 2 + 1]); - } - - glEnd(); - } - - glEndList(); - } - else - glCallList(fountain_list); -} - - -//======================================================================== -// Recursive function for building variable tesselated floor -//======================================================================== - -static void tessellate_floor(float x1, float y1, float x2, float y2, int depth) -{ - float delta, x, y; - - // Last recursion? - if (depth >= 5) - delta = 999999.f; - else - { - x = (float) (fabs(x1) < fabs(x2) ? fabs(x1) : fabs(x2)); - y = (float) (fabs(y1) < fabs(y2) ? fabs(y1) : fabs(y2)); - delta = x*x + y*y; - } - - // Recurse further? - if (delta < 0.1f) - { - x = (x1 + x2) * 0.5f; - y = (y1 + y2) * 0.5f; - tessellate_floor(x1, y1, x, y, depth + 1); - tessellate_floor(x, y1, x2, y, depth + 1); - tessellate_floor(x1, y, x, y2, depth + 1); - tessellate_floor(x, y, x2, y2, depth + 1); - } - else - { - glTexCoord2f(x1 * 30.f, y1 * 30.f); - glVertex3f( x1 * 80.f, y1 * 80.f, 0.f); - glTexCoord2f(x2 * 30.f, y1 * 30.f); - glVertex3f( x2 * 80.f, y1 * 80.f, 0.f); - glTexCoord2f(x2 * 30.f, y2 * 30.f); - glVertex3f( x2 * 80.f, y2 * 80.f, 0.f); - glTexCoord2f(x1 * 30.f, y2 * 30.f); - glVertex3f( x1 * 80.f, y2 * 80.f, 0.f); - } -} - - -//======================================================================== -// Draw floor. We build the floor recursively and let the tessellation in the -// center (near x,y=0,0) be high, while the tessellation around the edges be -// low. -//======================================================================== - -static void draw_floor(void) -{ - static GLuint floor_list = 0; - - if (!wireframe) - { - glEnable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, floor_tex_id); - } - - // The first time, we build the floor display list - if (!floor_list) - { - floor_list = glGenLists(1); - glNewList(floor_list, GL_COMPILE_AND_EXECUTE); - - glMaterialfv(GL_FRONT, GL_DIFFUSE, floor_diffuse); - glMaterialfv(GL_FRONT, GL_SPECULAR, floor_specular); - glMaterialf(GL_FRONT, GL_SHININESS, floor_shininess); - - // Draw floor as a bunch of triangle strips (high tesselation - // improves lighting) - glNormal3f(0.f, 0.f, 1.f); - glBegin(GL_QUADS); - tessellate_floor(-1.f, -1.f, 0.f, 0.f, 0); - tessellate_floor( 0.f, -1.f, 1.f, 0.f, 0); - tessellate_floor( 0.f, 0.f, 1.f, 1.f, 0); - tessellate_floor(-1.f, 0.f, 0.f, 1.f, 0); - glEnd(); - - glEndList(); - } - else - glCallList(floor_list); - - glDisable(GL_TEXTURE_2D); - -} - - -//======================================================================== -// Position and configure light sources -//======================================================================== - -static void setup_lights(void) -{ - float l1pos[4], l1amb[4], l1dif[4], l1spec[4]; - float l2pos[4], l2amb[4], l2dif[4], l2spec[4]; - - // Set light source 1 parameters - l1pos[0] = 0.f; l1pos[1] = -9.f; l1pos[2] = 8.f; l1pos[3] = 1.f; - l1amb[0] = 0.2f; l1amb[1] = 0.2f; l1amb[2] = 0.2f; l1amb[3] = 1.f; - l1dif[0] = 0.8f; l1dif[1] = 0.4f; l1dif[2] = 0.2f; l1dif[3] = 1.f; - l1spec[0] = 1.f; l1spec[1] = 0.6f; l1spec[2] = 0.2f; l1spec[3] = 0.f; - - // Set light source 2 parameters - l2pos[0] = -15.f; l2pos[1] = 12.f; l2pos[2] = 1.5f; l2pos[3] = 1.f; - l2amb[0] = 0.f; l2amb[1] = 0.f; l2amb[2] = 0.f; l2amb[3] = 1.f; - l2dif[0] = 0.2f; l2dif[1] = 0.4f; l2dif[2] = 0.8f; l2dif[3] = 1.f; - l2spec[0] = 0.2f; l2spec[1] = 0.6f; l2spec[2] = 1.f; l2spec[3] = 0.f; - - glLightfv(GL_LIGHT1, GL_POSITION, l1pos); - glLightfv(GL_LIGHT1, GL_AMBIENT, l1amb); - glLightfv(GL_LIGHT1, GL_DIFFUSE, l1dif); - glLightfv(GL_LIGHT1, GL_SPECULAR, l1spec); - glLightfv(GL_LIGHT2, GL_POSITION, l2pos); - glLightfv(GL_LIGHT2, GL_AMBIENT, l2amb); - glLightfv(GL_LIGHT2, GL_DIFFUSE, l2dif); - glLightfv(GL_LIGHT2, GL_SPECULAR, l2spec); - glLightfv(GL_LIGHT3, GL_POSITION, glow_pos); - glLightfv(GL_LIGHT3, GL_DIFFUSE, glow_color); - glLightfv(GL_LIGHT3, GL_SPECULAR, glow_color); - - glEnable(GL_LIGHT1); - glEnable(GL_LIGHT2); - glEnable(GL_LIGHT3); -} - - -//======================================================================== -// Main rendering function -//======================================================================== - -static void draw_scene(GLFWwindow* window, double t) -{ - double xpos, ypos, zpos, angle_x, angle_y, angle_z; - static double t_old = 0.0; - float dt; - - // Calculate frame-to-frame delta time - dt = (float) (t - t_old); - t_old = t; - - glClearColor(0.1f, 0.1f, 0.1f, 1.f); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - gluPerspective(65.0, aspect_ratio, 1.0, 60.0); - - // Setup camera - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - - // Rotate camera - angle_x = 90.0 - 10.0; - angle_y = 10.0 * sin(0.3 * t); - angle_z = 10.0 * t; - glRotated(-angle_x, 1.0, 0.0, 0.0); - glRotated(-angle_y, 0.0, 1.0, 0.0); - glRotated(-angle_z, 0.0, 0.0, 1.0); - - // Translate camera - xpos = 15.0 * sin((M_PI / 180.0) * angle_z) + - 2.0 * sin((M_PI / 180.0) * 3.1 * t); - ypos = -15.0 * cos((M_PI / 180.0) * angle_z) + - 2.0 * cos((M_PI / 180.0) * 2.9 * t); - zpos = 4.0 + 2.0 * cos((M_PI / 180.0) * 4.9 * t); - glTranslated(-xpos, -ypos, -zpos); - - glFrontFace(GL_CCW); - glCullFace(GL_BACK); - glEnable(GL_CULL_FACE); - - setup_lights(); - glEnable(GL_LIGHTING); - - glEnable(GL_FOG); - glFogi(GL_FOG_MODE, GL_EXP); - glFogf(GL_FOG_DENSITY, 0.05f); - glFogfv(GL_FOG_COLOR, fog_color); - - draw_floor(); - - glEnable(GL_DEPTH_TEST); - glDepthFunc(GL_LEQUAL); - glDepthMask(GL_TRUE); - - draw_fountain(); - - glDisable(GL_LIGHTING); - glDisable(GL_FOG); - - // Particles must be drawn after all solid objects have been drawn - draw_particles(window, t, dt); - - // Z-buffer not needed anymore - glDisable(GL_DEPTH_TEST); -} - - -//======================================================================== -// Window resize callback function -//======================================================================== - -static void resize_callback(GLFWwindow* window, int width, int height) -{ - glViewport(0, 0, width, height); - aspect_ratio = height ? width / (float) height : 1.f; -} - - -//======================================================================== -// Key callback functions -//======================================================================== - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action == GLFW_PRESS) - { - switch (key) - { - case GLFW_KEY_ESCAPE: - glfwSetWindowShouldClose(window, GL_TRUE); - break; - case GLFW_KEY_W: - wireframe = !wireframe; - glPolygonMode(GL_FRONT_AND_BACK, - wireframe ? GL_LINE : GL_FILL); - break; - default: - break; - } - } -} - - -//======================================================================== -// Thread for updating particle physics -//======================================================================== - -static int physics_thread_main(void* arg) -{ - GLFWwindow* window = arg; - - for (;;) - { - mtx_lock(&thread_sync.particles_lock); - - // Wait for particle drawing to be done - while (!glfwWindowShouldClose(window) && - thread_sync.p_frame > thread_sync.d_frame) - { - struct timespec ts; - clock_gettime(CLOCK_REALTIME, &ts); - ts.tv_nsec += 100000000; - cnd_timedwait(&thread_sync.d_done, &thread_sync.particles_lock, &ts); - } - - if (glfwWindowShouldClose(window)) - break; - - // Update particles - particle_engine(thread_sync.t, thread_sync.dt); - - // Update frame counter - thread_sync.p_frame++; - - // Unlock mutex and signal drawing thread - mtx_unlock(&thread_sync.particles_lock); - cnd_signal(&thread_sync.p_done); - } - - return 0; -} - - -//======================================================================== -// main -//======================================================================== - -int main(int argc, char** argv) -{ - int ch, width, height; - thrd_t physics_thread = 0; - GLFWwindow* window; - GLFWmonitor* monitor = NULL; - - if (!glfwInit()) - { - fprintf(stderr, "Failed to initialize GLFW\n"); - exit(EXIT_FAILURE); - } - - while ((ch = getopt(argc, argv, "fh")) != -1) - { - switch (ch) - { - case 'f': - monitor = glfwGetPrimaryMonitor(); - break; - case 'h': - usage(); - exit(EXIT_SUCCESS); - } - } - - if (monitor) - { - const GLFWvidmode* mode = glfwGetVideoMode(monitor); - - glfwWindowHint(GLFW_RED_BITS, mode->redBits); - glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits); - glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits); - glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate); - - width = mode->width; - height = mode->height; - } - else - { - width = 640; - height = 480; - } - - window = glfwCreateWindow(width, height, "Particle Engine", monitor, NULL); - if (!window) - { - fprintf(stderr, "Failed to create GLFW window\n"); - glfwTerminate(); - exit(EXIT_FAILURE); - } - - if (monitor) - glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED); - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - glfwSetWindowSizeCallback(window, resize_callback); - glfwSetKeyCallback(window, key_callback); - - // Set initial aspect ratio - glfwGetWindowSize(window, &width, &height); - resize_callback(window, width, height); - - // Upload particle texture - glGenTextures(1, &particle_tex_id); - glBindTexture(GL_TEXTURE_2D, particle_tex_id); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, P_TEX_WIDTH, P_TEX_HEIGHT, - 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, particle_texture); - - // Upload floor texture - glGenTextures(1, &floor_tex_id); - glBindTexture(GL_TEXTURE_2D, floor_tex_id); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, F_TEX_WIDTH, F_TEX_HEIGHT, - 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, floor_texture); - - if (glfwExtensionSupported("GL_EXT_separate_specular_color")) - { - glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL_EXT, - GL_SEPARATE_SPECULAR_COLOR_EXT); - } - - // Set filled polygon mode as default (not wireframe) - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - wireframe = 0; - - // Set initial times - thread_sync.t = 0.0; - thread_sync.dt = 0.001f; - thread_sync.p_frame = 0; - thread_sync.d_frame = 0; - - mtx_init(&thread_sync.particles_lock, mtx_timed); - cnd_init(&thread_sync.p_done); - cnd_init(&thread_sync.d_done); - - if (thrd_create(&physics_thread, physics_thread_main, window) != thrd_success) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwSetTime(0.0); - - while (!glfwWindowShouldClose(window)) - { - draw_scene(window, glfwGetTime()); - - glfwSwapBuffers(window); - glfwPollEvents(); - } - - thrd_join(physics_thread, NULL); - - glfwDestroyWindow(window); - glfwTerminate(); - - exit(EXIT_SUCCESS); -} - diff --git a/extern/glfw/examples/simple.c b/extern/glfw/examples/simple.c deleted file mode 100644 index c39be57..0000000 --- a/extern/glfw/examples/simple.c +++ /dev/null @@ -1,102 +0,0 @@ -//======================================================================== -// Simple GLFW example -// Copyright (c) Camilla Berglund -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -//! [code] - -#include - -#include -#include - -static void error_callback(int error, const char* description) -{ - fputs(description, stderr); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) - glfwSetWindowShouldClose(window, GL_TRUE); -} - -int main(void) -{ - GLFWwindow* window; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - window = glfwCreateWindow(640, 480, "Simple example", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - glfwSetKeyCallback(window, key_callback); - - while (!glfwWindowShouldClose(window)) - { - float ratio; - int width, height; - - glfwGetFramebufferSize(window, &width, &height); - ratio = width / (float) height; - - glViewport(0, 0, width, height); - glClear(GL_COLOR_BUFFER_BIT); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-ratio, ratio, -1.f, 1.f, 1.f, -1.f); - glMatrixMode(GL_MODELVIEW); - - glLoadIdentity(); - glRotatef((float) glfwGetTime() * 50.f, 0.f, 0.f, 1.f); - - glBegin(GL_TRIANGLES); - glColor3f(1.f, 0.f, 0.f); - glVertex3f(-0.6f, -0.4f, 0.f); - glColor3f(0.f, 1.f, 0.f); - glVertex3f(0.6f, -0.4f, 0.f); - glColor3f(0.f, 0.f, 1.f); - glVertex3f(0.f, 0.6f, 0.f); - glEnd(); - - glfwSwapBuffers(window); - glfwPollEvents(); - } - - glfwDestroyWindow(window); - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - -//! [code] diff --git a/extern/glfw/examples/splitview.c b/extern/glfw/examples/splitview.c deleted file mode 100644 index 30b093b..0000000 --- a/extern/glfw/examples/splitview.c +++ /dev/null @@ -1,511 +0,0 @@ -//======================================================================== -// This is an example program for the GLFW library -// -// The program uses a "split window" view, rendering four views of the -// same scene in one window (e.g. uesful for 3D modelling software). This -// demo uses scissors to separete the four different rendering areas from -// each other. -// -// (If the code seems a little bit strange here and there, it may be -// because I am not a friend of orthogonal projections) -//======================================================================== - -#define GLFW_INCLUDE_GLU -#include - -#include -#include -#include - -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - - -//======================================================================== -// Global variables -//======================================================================== - -// Mouse position -static double xpos = 0, ypos = 0; - -// Window size -static int width, height; - -// Active view: 0 = none, 1 = upper left, 2 = upper right, 3 = lower left, -// 4 = lower right -static int active_view = 0; - -// Rotation around each axis -static int rot_x = 0, rot_y = 0, rot_z = 0; - -// Do redraw? -static int do_redraw = 1; - - -//======================================================================== -// Draw a solid torus (use a display list for the model) -//======================================================================== - -#define TORUS_MAJOR 1.5 -#define TORUS_MINOR 0.5 -#define TORUS_MAJOR_RES 32 -#define TORUS_MINOR_RES 32 - -static void drawTorus(void) -{ - static GLuint torus_list = 0; - int i, j, k; - double s, t, x, y, z, nx, ny, nz, scale, twopi; - - if (!torus_list) - { - // Start recording displaylist - torus_list = glGenLists(1); - glNewList(torus_list, GL_COMPILE_AND_EXECUTE); - - // Draw torus - twopi = 2.0 * M_PI; - for (i = 0; i < TORUS_MINOR_RES; i++) - { - glBegin(GL_QUAD_STRIP); - for (j = 0; j <= TORUS_MAJOR_RES; j++) - { - for (k = 1; k >= 0; k--) - { - s = (i + k) % TORUS_MINOR_RES + 0.5; - t = j % TORUS_MAJOR_RES; - - // Calculate point on surface - x = (TORUS_MAJOR + TORUS_MINOR * cos(s * twopi / TORUS_MINOR_RES)) * cos(t * twopi / TORUS_MAJOR_RES); - y = TORUS_MINOR * sin(s * twopi / TORUS_MINOR_RES); - z = (TORUS_MAJOR + TORUS_MINOR * cos(s * twopi / TORUS_MINOR_RES)) * sin(t * twopi / TORUS_MAJOR_RES); - - // Calculate surface normal - nx = x - TORUS_MAJOR * cos(t * twopi / TORUS_MAJOR_RES); - ny = y; - nz = z - TORUS_MAJOR * sin(t * twopi / TORUS_MAJOR_RES); - scale = 1.0 / sqrt(nx*nx + ny*ny + nz*nz); - nx *= scale; - ny *= scale; - nz *= scale; - - glNormal3f((float) nx, (float) ny, (float) nz); - glVertex3f((float) x, (float) y, (float) z); - } - } - - glEnd(); - } - - // Stop recording displaylist - glEndList(); - } - else - { - // Playback displaylist - glCallList(torus_list); - } -} - - -//======================================================================== -// Draw the scene (a rotating torus) -//======================================================================== - -static void drawScene(void) -{ - const GLfloat model_diffuse[4] = {1.0f, 0.8f, 0.8f, 1.0f}; - const GLfloat model_specular[4] = {0.6f, 0.6f, 0.6f, 1.0f}; - const GLfloat model_shininess = 20.0f; - - glPushMatrix(); - - // Rotate the object - glRotatef((GLfloat) rot_x * 0.5f, 1.0f, 0.0f, 0.0f); - glRotatef((GLfloat) rot_y * 0.5f, 0.0f, 1.0f, 0.0f); - glRotatef((GLfloat) rot_z * 0.5f, 0.0f, 0.0f, 1.0f); - - // Set model color (used for orthogonal views, lighting disabled) - glColor4fv(model_diffuse); - - // Set model material (used for perspective view, lighting enabled) - glMaterialfv(GL_FRONT, GL_DIFFUSE, model_diffuse); - glMaterialfv(GL_FRONT, GL_SPECULAR, model_specular); - glMaterialf(GL_FRONT, GL_SHININESS, model_shininess); - - // Draw torus - drawTorus(); - - glPopMatrix(); -} - - -//======================================================================== -// Draw a 2D grid (used for orthogonal views) -//======================================================================== - -static void drawGrid(float scale, int steps) -{ - int i; - float x, y; - - glPushMatrix(); - - // Set background to some dark bluish grey - glClearColor(0.05f, 0.05f, 0.2f, 0.0f); - glClear(GL_COLOR_BUFFER_BIT); - - // Setup modelview matrix (flat XY view) - glLoadIdentity(); - gluLookAt(0.0, 0.0, 1.0, - 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0); - - // We don't want to update the Z-buffer - glDepthMask(GL_FALSE); - - // Set grid color - glColor3f(0.0f, 0.5f, 0.5f); - - glBegin(GL_LINES); - - // Horizontal lines - x = scale * 0.5f * (float) (steps - 1); - y = -scale * 0.5f * (float) (steps - 1); - for (i = 0; i < steps; i++) - { - glVertex3f(-x, y, 0.0f); - glVertex3f(x, y, 0.0f); - y += scale; - } - - // Vertical lines - x = -scale * 0.5f * (float) (steps - 1); - y = scale * 0.5f * (float) (steps - 1); - for (i = 0; i < steps; i++) - { - glVertex3f(x, -y, 0.0f); - glVertex3f(x, y, 0.0f); - x += scale; - } - - glEnd(); - - // Enable Z-buffer writing again - glDepthMask(GL_TRUE); - - glPopMatrix(); -} - - -//======================================================================== -// Draw all views -//======================================================================== - -static void drawAllViews(void) -{ - const GLfloat light_position[4] = {0.0f, 8.0f, 8.0f, 1.0f}; - const GLfloat light_diffuse[4] = {1.0f, 1.0f, 1.0f, 1.0f}; - const GLfloat light_specular[4] = {1.0f, 1.0f, 1.0f, 1.0f}; - const GLfloat light_ambient[4] = {0.2f, 0.2f, 0.3f, 1.0f}; - double aspect; - - // Calculate aspect of window - if (height > 0) - aspect = (double) width / (double) height; - else - aspect = 1.0; - - // Clear screen - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - // Enable scissor test - glEnable(GL_SCISSOR_TEST); - - // Enable depth test - glEnable(GL_DEPTH_TEST); - glDepthFunc(GL_LEQUAL); - - // ** ORTHOGONAL VIEWS ** - - // For orthogonal views, use wireframe rendering - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - - // Enable line anti-aliasing - glEnable(GL_LINE_SMOOTH); - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - // Setup orthogonal projection matrix - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-3.0 * aspect, 3.0 * aspect, -3.0, 3.0, 1.0, 50.0); - - // Upper left view (TOP VIEW) - glViewport(0, height / 2, width / 2, height / 2); - glScissor(0, height / 2, width / 2, height / 2); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - gluLookAt(0.0f, 10.0f, 1e-3f, // Eye-position (above) - 0.0f, 0.0f, 0.0f, // View-point - 0.0f, 1.0f, 0.0f); // Up-vector - drawGrid(0.5, 12); - drawScene(); - - // Lower left view (FRONT VIEW) - glViewport(0, 0, width / 2, height / 2); - glScissor(0, 0, width / 2, height / 2); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - gluLookAt(0.0f, 0.0f, 10.0f, // Eye-position (in front of) - 0.0f, 0.0f, 0.0f, // View-point - 0.0f, 1.0f, 0.0f); // Up-vector - drawGrid(0.5, 12); - drawScene(); - - // Lower right view (SIDE VIEW) - glViewport(width / 2, 0, width / 2, height / 2); - glScissor(width / 2, 0, width / 2, height / 2); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - gluLookAt(10.0f, 0.0f, 0.0f, // Eye-position (to the right) - 0.0f, 0.0f, 0.0f, // View-point - 0.0f, 1.0f, 0.0f); // Up-vector - drawGrid(0.5, 12); - drawScene(); - - // Disable line anti-aliasing - glDisable(GL_LINE_SMOOTH); - glDisable(GL_BLEND); - - // ** PERSPECTIVE VIEW ** - - // For perspective view, use solid rendering - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - - // Enable face culling (faster rendering) - glEnable(GL_CULL_FACE); - glCullFace(GL_BACK); - glFrontFace(GL_CW); - - // Setup perspective projection matrix - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - gluPerspective(65.0f, aspect, 1.0f, 50.0f); - - // Upper right view (PERSPECTIVE VIEW) - glViewport(width / 2, height / 2, width / 2, height / 2); - glScissor(width / 2, height / 2, width / 2, height / 2); - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - gluLookAt(3.0f, 1.5f, 3.0f, // Eye-position - 0.0f, 0.0f, 0.0f, // View-point - 0.0f, 1.0f, 0.0f); // Up-vector - - // Configure and enable light source 1 - glLightfv(GL_LIGHT1, GL_POSITION, light_position); - glLightfv(GL_LIGHT1, GL_AMBIENT, light_ambient); - glLightfv(GL_LIGHT1, GL_DIFFUSE, light_diffuse); - glLightfv(GL_LIGHT1, GL_SPECULAR, light_specular); - glEnable(GL_LIGHT1); - glEnable(GL_LIGHTING); - - // Draw scene - drawScene(); - - // Disable lighting - glDisable(GL_LIGHTING); - - // Disable face culling - glDisable(GL_CULL_FACE); - - // Disable depth test - glDisable(GL_DEPTH_TEST); - - // Disable scissor test - glDisable(GL_SCISSOR_TEST); - - // Draw a border around the active view - if (active_view > 0 && active_view != 2) - { - glViewport(0, 0, width, height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(0.0, 2.0, 0.0, 2.0, 0.0, 1.0); - - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef((GLfloat) ((active_view - 1) & 1), (GLfloat) (1 - (active_view - 1) / 2), 0.0f); - - glColor3f(1.0f, 1.0f, 0.6f); - - glBegin(GL_LINE_STRIP); - glVertex2i(0, 0); - glVertex2i(1, 0); - glVertex2i(1, 1); - glVertex2i(0, 1); - glVertex2i(0, 0); - glEnd(); - } -} - - -//======================================================================== -// Framebuffer size callback function -//======================================================================== - -static void framebufferSizeFun(GLFWwindow* window, int w, int h) -{ - width = w; - height = h > 0 ? h : 1; - do_redraw = 1; -} - - -//======================================================================== -// Window refresh callback function -//======================================================================== - -static void windowRefreshFun(GLFWwindow* window) -{ - do_redraw = 1; -} - - -//======================================================================== -// Mouse position callback function -//======================================================================== - -static void cursorPosFun(GLFWwindow* window, double x, double y) -{ - // Depending on which view was selected, rotate around different axes - switch (active_view) - { - case 1: - rot_x += (int) (y - ypos); - rot_z += (int) (x - xpos); - do_redraw = 1; - break; - case 3: - rot_x += (int) (y - ypos); - rot_y += (int) (x - xpos); - do_redraw = 1; - break; - case 4: - rot_y += (int) (x - xpos); - rot_z += (int) (y - ypos); - do_redraw = 1; - break; - default: - // Do nothing for perspective view, or if no view is selected - break; - } - - // Remember cursor position - xpos = x; - ypos = y; -} - - -//======================================================================== -// Mouse button callback function -//======================================================================== - -static void mouseButtonFun(GLFWwindow* window, int button, int action, int mods) -{ - if ((button == GLFW_MOUSE_BUTTON_LEFT) && action == GLFW_PRESS) - { - // Detect which of the four views was clicked - active_view = 1; - if (xpos >= width / 2) - active_view += 1; - if (ypos >= height / 2) - active_view += 2; - } - else if (button == GLFW_MOUSE_BUTTON_LEFT) - { - // Deselect any previously selected view - active_view = 0; - } - - do_redraw = 1; -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) - glfwSetWindowShouldClose(window, GL_TRUE); -} - - -//======================================================================== -// main -//======================================================================== - -int main(void) -{ - GLFWwindow* window; - - // Initialise GLFW - if (!glfwInit()) - { - fprintf(stderr, "Failed to initialize GLFW\n"); - exit(EXIT_FAILURE); - } - - // Open OpenGL window - window = glfwCreateWindow(500, 500, "Split view demo", NULL, NULL); - if (!window) - { - fprintf(stderr, "Failed to open GLFW window\n"); - - glfwTerminate(); - exit(EXIT_FAILURE); - } - - // Set callback functions - glfwSetFramebufferSizeCallback(window, framebufferSizeFun); - glfwSetWindowRefreshCallback(window, windowRefreshFun); - glfwSetCursorPosCallback(window, cursorPosFun); - glfwSetMouseButtonCallback(window, mouseButtonFun); - glfwSetKeyCallback(window, key_callback); - - // Enable vsync - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - glfwGetFramebufferSize(window, &width, &height); - framebufferSizeFun(window, width, height); - - // Main loop - for (;;) - { - // Only redraw if we need to - if (do_redraw) - { - // Draw all views - drawAllViews(); - - // Swap buffers - glfwSwapBuffers(window); - - do_redraw = 0; - } - - // Wait for new events - glfwWaitEvents(); - - // Check if the window should be closed - if (glfwWindowShouldClose(window)) - break; - } - - // Close OpenGL window and terminate GLFW - glfwTerminate(); - - exit(EXIT_SUCCESS); -} - diff --git a/extern/glfw/examples/wave.c b/extern/glfw/examples/wave.c deleted file mode 100644 index 6890e85..0000000 --- a/extern/glfw/examples/wave.c +++ /dev/null @@ -1,457 +0,0 @@ -/***************************************************************************** - * Wave Simulation in OpenGL - * (C) 2002 Jakob Thomsen - * http://home.in.tum.de/~thomsen - * Modified for GLFW by Sylvain Hellegouarch - sh@programmationworld.com - * Modified for variable frame rate by Marcus Geelnard - * 2003-Jan-31: Minor cleanups and speedups / MG - * 2010-10-24: Formatting and cleanup - Camilla Berglund - *****************************************************************************/ - -#include -#include -#include - -#define GLFW_INCLUDE_GLU -#include - -#ifndef M_PI - #define M_PI 3.1415926535897932384626433832795 -#endif - -// Maximum delta T to allow for differential calculations -#define MAX_DELTA_T 0.01 - -// Animation speed (10.0 looks good) -#define ANIMATION_SPEED 10.0 - -GLfloat alpha = 210.f, beta = -70.f; -GLfloat zoom = 2.f; - -GLboolean locked = GL_FALSE; - -int cursorX; -int cursorY; - -struct Vertex -{ - GLfloat x, y, z; - GLfloat r, g, b; -}; - -#define GRIDW 50 -#define GRIDH 50 -#define VERTEXNUM (GRIDW*GRIDH) - -#define QUADW (GRIDW - 1) -#define QUADH (GRIDH - 1) -#define QUADNUM (QUADW*QUADH) - -GLuint quad[4 * QUADNUM]; -struct Vertex vertex[VERTEXNUM]; - -/* The grid will look like this: - * - * 3 4 5 - * *---*---* - * | | | - * | 0 | 1 | - * | | | - * *---*---* - * 0 1 2 - */ - -//======================================================================== -// Initialize grid geometry -//======================================================================== - -void init_vertices(void) -{ - int x, y, p; - - // Place the vertices in a grid - for (y = 0; y < GRIDH; y++) - { - for (x = 0; x < GRIDW; x++) - { - p = y * GRIDW + x; - - vertex[p].x = (GLfloat) (x - GRIDW / 2) / (GLfloat) (GRIDW / 2); - vertex[p].y = (GLfloat) (y - GRIDH / 2) / (GLfloat) (GRIDH / 2); - vertex[p].z = 0; - - if ((x % 4 < 2) ^ (y % 4 < 2)) - vertex[p].r = 0.0; - else - vertex[p].r = 1.0; - - vertex[p].g = (GLfloat) y / (GLfloat) GRIDH; - vertex[p].b = 1.f - ((GLfloat) x / (GLfloat) GRIDW + (GLfloat) y / (GLfloat) GRIDH) / 2.f; - } - } - - for (y = 0; y < QUADH; y++) - { - for (x = 0; x < QUADW; x++) - { - p = 4 * (y * QUADW + x); - - quad[p + 0] = y * GRIDW + x; // Some point - quad[p + 1] = y * GRIDW + x + 1; // Neighbor at the right side - quad[p + 2] = (y + 1) * GRIDW + x + 1; // Upper right neighbor - quad[p + 3] = (y + 1) * GRIDW + x; // Upper neighbor - } - } -} - -double dt; -double p[GRIDW][GRIDH]; -double vx[GRIDW][GRIDH], vy[GRIDW][GRIDH]; -double ax[GRIDW][GRIDH], ay[GRIDW][GRIDH]; - -//======================================================================== -// Initialize grid -//======================================================================== - -void init_grid(void) -{ - int x, y; - double dx, dy, d; - - for (y = 0; y < GRIDH; y++) - { - for (x = 0; x < GRIDW; x++) - { - dx = (double) (x - GRIDW / 2); - dy = (double) (y - GRIDH / 2); - d = sqrt(dx * dx + dy * dy); - if (d < 0.1 * (double) (GRIDW / 2)) - { - d = d * 10.0; - p[x][y] = -cos(d * (M_PI / (double)(GRIDW * 4))) * 100.0; - } - else - p[x][y] = 0.0; - - vx[x][y] = 0.0; - vy[x][y] = 0.0; - } - } -} - - -//======================================================================== -// Draw scene -//======================================================================== - -void draw_scene(GLFWwindow* window) -{ - // Clear the color and depth buffers - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - // We don't want to modify the projection matrix - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - - // Move back - glTranslatef(0.0, 0.0, -zoom); - // Rotate the view - glRotatef(beta, 1.0, 0.0, 0.0); - glRotatef(alpha, 0.0, 0.0, 1.0); - - glDrawElements(GL_QUADS, 4 * QUADNUM, GL_UNSIGNED_INT, quad); - - glfwSwapBuffers(window); -} - - -//======================================================================== -// Initialize Miscellaneous OpenGL state -//======================================================================== - -void init_opengl(void) -{ - // Use Gouraud (smooth) shading - glShadeModel(GL_SMOOTH); - - // Switch on the z-buffer - glEnable(GL_DEPTH_TEST); - - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_COLOR_ARRAY); - glVertexPointer(3, GL_FLOAT, sizeof(struct Vertex), vertex); - glColorPointer(3, GL_FLOAT, sizeof(struct Vertex), &vertex[0].r); // Pointer to the first color - - glPointSize(2.0); - - // Background color is black - glClearColor(0, 0, 0, 0); -} - - -//======================================================================== -// Modify the height of each vertex according to the pressure -//======================================================================== - -void adjust_grid(void) -{ - int pos; - int x, y; - - for (y = 0; y < GRIDH; y++) - { - for (x = 0; x < GRIDW; x++) - { - pos = y * GRIDW + x; - vertex[pos].z = (float) (p[x][y] * (1.0 / 50.0)); - } - } -} - - -//======================================================================== -// Calculate wave propagation -//======================================================================== - -void calc_grid(void) -{ - int x, y, x2, y2; - double time_step = dt * ANIMATION_SPEED; - - // Compute accelerations - for (x = 0; x < GRIDW; x++) - { - x2 = (x + 1) % GRIDW; - for(y = 0; y < GRIDH; y++) - ax[x][y] = p[x][y] - p[x2][y]; - } - - for (y = 0; y < GRIDH; y++) - { - y2 = (y + 1) % GRIDH; - for(x = 0; x < GRIDW; x++) - ay[x][y] = p[x][y] - p[x][y2]; - } - - // Compute speeds - for (x = 0; x < GRIDW; x++) - { - for (y = 0; y < GRIDH; y++) - { - vx[x][y] = vx[x][y] + ax[x][y] * time_step; - vy[x][y] = vy[x][y] + ay[x][y] * time_step; - } - } - - // Compute pressure - for (x = 1; x < GRIDW; x++) - { - x2 = x - 1; - for (y = 1; y < GRIDH; y++) - { - y2 = y - 1; - p[x][y] = p[x][y] + (vx[x2][y] - vx[x][y] + vy[x][y2] - vy[x][y]) * time_step; - } - } -} - - -//======================================================================== -// Print errors -//======================================================================== - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - - -//======================================================================== -// Handle key strokes -//======================================================================== - -void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_ESCAPE: - glfwSetWindowShouldClose(window, GL_TRUE); - break; - case GLFW_KEY_SPACE: - init_grid(); - break; - case GLFW_KEY_LEFT: - alpha += 5; - break; - case GLFW_KEY_RIGHT: - alpha -= 5; - break; - case GLFW_KEY_UP: - beta -= 5; - break; - case GLFW_KEY_DOWN: - beta += 5; - break; - case GLFW_KEY_PAGE_UP: - zoom -= 0.25f; - if (zoom < 0.f) - zoom = 0.f; - break; - case GLFW_KEY_PAGE_DOWN: - zoom += 0.25f; - break; - default: - break; - } -} - - -//======================================================================== -// Callback function for mouse button events -//======================================================================== - -void mouse_button_callback(GLFWwindow* window, int button, int action, int mods) -{ - if (button != GLFW_MOUSE_BUTTON_LEFT) - return; - - if (action == GLFW_PRESS) - { - glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED); - locked = GL_TRUE; - } - else - { - locked = GL_FALSE; - glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL); - } -} - - -//======================================================================== -// Callback function for cursor motion events -//======================================================================== - -void cursor_position_callback(GLFWwindow* window, double x, double y) -{ - if (locked) - { - alpha += (GLfloat) (x - cursorX) / 10.f; - beta += (GLfloat) (y - cursorY) / 10.f; - } - - cursorX = (int) x; - cursorY = (int) y; -} - - -//======================================================================== -// Callback function for scroll events -//======================================================================== - -void scroll_callback(GLFWwindow* window, double x, double y) -{ - zoom += (float) y / 4.f; - if (zoom < 0) - zoom = 0; -} - - -//======================================================================== -// Callback function for framebuffer resize events -//======================================================================== - -void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - float ratio = 1.f; - - if (height > 0) - ratio = (float) width / (float) height; - - // Setup viewport - glViewport(0, 0, width, height); - - // Change to the projection matrix and set our viewing volume - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - gluPerspective(60.0, ratio, 1.0, 1024.0); -} - - -//======================================================================== -// main -//======================================================================== - -int main(int argc, char* argv[]) -{ - GLFWwindow* window; - double t, dt_total, t_old; - int width, height; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - window = glfwCreateWindow(640, 480, "Wave Simulation", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwSetKeyCallback(window, key_callback); - glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); - glfwSetMouseButtonCallback(window, mouse_button_callback); - glfwSetCursorPosCallback(window, cursor_position_callback); - glfwSetScrollCallback(window, scroll_callback); - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - glfwGetFramebufferSize(window, &width, &height); - framebuffer_size_callback(window, width, height); - - // Initialize OpenGL - init_opengl(); - - // Initialize simulation - init_vertices(); - init_grid(); - adjust_grid(); - - // Initialize timer - t_old = glfwGetTime() - 0.01; - - while (!glfwWindowShouldClose(window)) - { - t = glfwGetTime(); - dt_total = t - t_old; - t_old = t; - - // Safety - iterate if dt_total is too large - while (dt_total > 0.f) - { - // Select iteration time step - dt = dt_total > MAX_DELTA_T ? MAX_DELTA_T : dt_total; - dt_total -= dt; - - // Calculate wave propagation - calc_grid(); - } - - // Compute height of each vertex - adjust_grid(); - - // Draw wave grid to OpenGL display - draw_scene(window); - - glfwPollEvents(); - } - - exit(EXIT_SUCCESS); -} - diff --git a/extern/glfw/include/GLFW/glfw3.h b/extern/glfw/include/GLFW/glfw3.h index 83b2ff0..de2798b 100644 --- a/extern/glfw/include/GLFW/glfw3.h +++ b/extern/glfw/include/GLFW/glfw3.h @@ -1,5 +1,5 @@ /************************************************************************* - * GLFW 3.1 - www.glfw.org + * GLFW 3.0 - www.glfw.org * A library for OpenGL, window and input *------------------------------------------------------------------------ * Copyright (c) 2002-2006 Marcus Geelnard @@ -38,27 +38,23 @@ extern "C" { * Doxygen documentation *************************************************************************/ -/*! @defgroup context Context handling - * - * This is the reference documentation for context related functions. For more - * information, see the @ref context. +/*! @defgroup clipboard Clipboard support */ -/*! @defgroup init Initialization, version and errors - * - * This is the reference documentation for initialization and termination of - * the library, version management and error handling. For more information, - * see the @ref intro. +/*! @defgroup context Context handling + */ +/*! @defgroup error Error handling + */ +/*! @defgroup init Initialization and version information */ /*! @defgroup input Input handling - * - * This is the reference documentation for input related functions and types. - * For more information, see the @ref input. */ /*! @defgroup monitor Monitor handling * * This is the reference documentation for monitor related functions and types. * For more information, see the @ref monitor. */ +/*! @defgroup time Time input + */ /*! @defgroup window Window handling * * This is the reference documentation for window related functions and types, @@ -137,22 +133,53 @@ extern "C" { /* Most GL/glu.h variants on Windows need wchar_t * OpenGL/gl.h blocks the definition of ptrdiff_t by glext.h on OS X */ -#if !defined(GLFW_INCLUDE_NONE) - #include +#include + + +/* ---------------- GLFW related system specific defines ----------------- */ + +#if defined(GLFW_DLL) && defined(_GLFW_BUILD_DLL) + /* GLFW_DLL is defined by users of GLFW when compiling programs that will link + * to the DLL version of the GLFW library. _GLFW_BUILD_DLL is defined by the + * GLFW configuration header when compiling the DLL version of the library. + */ + #error "You must not have both GLFW_DLL and _GLFW_BUILD_DLL defined" #endif +#if defined(_WIN32) && defined(_GLFW_BUILD_DLL) + + /* We are building a Win32 DLL */ + #define GLFWAPI __declspec(dllexport) + +#elif defined(_WIN32) && defined(GLFW_DLL) + + /* We are calling a Win32 DLL */ + #if defined(__LCC__) + #define GLFWAPI extern + #else + #define GLFWAPI __declspec(dllimport) + #endif + +#elif defined(__GNUC__) && defined(_GLFW_BUILD_DLL) + + #define GLFWAPI __attribute__((visibility("default"))) + +#else + + /* We are either building/calling a static lib or we are non-win32 */ + #define GLFWAPI + +#endif + +/* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */ + /* Include the chosen client API headers. */ #if defined(__APPLE_CC__) #if defined(GLFW_INCLUDE_GLCOREARB) #include - #if defined(GLFW_INCLUDE_GLEXT) - #include - #endif #elif !defined(GLFW_INCLUDE_NONE) - #if !defined(GLFW_INCLUDE_GLEXT) - #define GL_GLEXT_LEGACY - #endif + #define GL_GLEXT_LEGACY #include #endif #if defined(GLFW_INCLUDE_GLU) @@ -163,71 +190,18 @@ extern "C" { #include #elif defined(GLFW_INCLUDE_ES1) #include - #if defined(GLFW_INCLUDE_GLEXT) - #include - #endif #elif defined(GLFW_INCLUDE_ES2) #include - #if defined(GLFW_INCLUDE_GLEXT) - #include - #endif #elif defined(GLFW_INCLUDE_ES3) #include - #if defined(GLFW_INCLUDE_GLEXT) - #include - #endif - #elif defined(GLFW_INCLUDE_ES31) - #include - #if defined(GLFW_INCLUDE_GLEXT) - #include - #endif #elif !defined(GLFW_INCLUDE_NONE) #include - #if defined(GLFW_INCLUDE_GLEXT) - #include - #endif #endif #if defined(GLFW_INCLUDE_GLU) #include #endif #endif -#if defined(GLFW_DLL) && defined(_GLFW_BUILD_DLL) - /* GLFW_DLL must be defined by applications that are linking against the DLL - * version of the GLFW library. _GLFW_BUILD_DLL is defined by the GLFW - * configuration header when compiling the DLL version of the library. - */ - #error "You must not have both GLFW_DLL and _GLFW_BUILD_DLL defined" -#endif - -#if defined(_WIN32) && defined(_GLFW_BUILD_DLL) - - /* We are building GLFW as a Win32 DLL */ - #define GLFWAPI __declspec(dllexport) - -#elif defined(_WIN32) && defined(GLFW_DLL) - - /* We are calling GLFW as a Win32 DLL */ - #if defined(__LCC__) - #define GLFWAPI extern - #else - #define GLFWAPI __declspec(dllimport) - #endif - -#elif defined(__GNUC__) && defined(_GLFW_BUILD_DLL) - - /* We are building GLFW as a shared / dynamic library */ - #define GLFWAPI __attribute__((visibility("default"))) - -#else - - /* We are building or calling GLFW as a static library */ - #define GLFWAPI - -#endif - -/* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */ - /************************************************************************* * GLFW API tokens @@ -247,36 +221,27 @@ extern "C" { * backward-compatible. * @ingroup init */ -#define GLFW_VERSION_MINOR 1 +#define GLFW_VERSION_MINOR 0 /*! @brief The revision number of the GLFW library. * * This is incremented when a bug fix release is made that does not contain any * API changes. * @ingroup init */ -#define GLFW_VERSION_REVISION 0 +#define GLFW_VERSION_REVISION 2 /*! @} */ /*! @name Key and button actions * @{ */ -/*! @brief The key or mouse button was released. - * - * The key or mouse button was released. - * +/*! @brief The key or button was released. * @ingroup input */ #define GLFW_RELEASE 0 -/*! @brief The key or mouse button was pressed. - * - * The key or mouse button was pressed. - * +/*! @brief The key or button was pressed. * @ingroup input */ #define GLFW_PRESS 1 /*! @brief The key was held down until it repeated. - * - * The key was held down until it repeated. - * * @ingroup input */ #define GLFW_REPEAT 2 @@ -284,7 +249,7 @@ extern "C" { /*! @defgroup keys Keyboard keys * - * These key codes are inspired by the _USB HID Usage Tables v1.12_ (p. 53-60), + * These key codes are inspired by the *USB HID Usage Tables v1.12* (p. 53-60), * but re-arranged to map to 7-bit ASCII for printable keys (function keys are * put in the 256+ range). * @@ -492,124 +457,36 @@ extern "C" { /*! @} */ /*! @defgroup errors Error codes - * @ingroup init + * @ingroup error * @{ */ /*! @brief GLFW has not been initialized. - * - * This occurs if a GLFW function was called that may not be called unless the - * library is [initialized](@ref intro_init). - * - * @par Analysis - * Application programmer error. Initialize GLFW before calling any function - * that requires initialization. */ #define GLFW_NOT_INITIALIZED 0x00010001 /*! @brief No context is current for this thread. - * - * 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 @ref glfwSwapInterval. - * - * @par Analysis - * Application programmer error. Ensure a context is current before calling - * functions that require a current context. */ #define GLFW_NO_CURRENT_CONTEXT 0x00010002 -/*! @brief One of the arguments to the function was an invalid enum value. - * - * One of the arguments to the function was an invalid enum value, for example - * requesting `GLFW_RED_BITS` with @ref glfwGetWindowAttrib. - * - * @par Analysis - * Application programmer error. Fix the offending call. +/*! @brief One of the enum parameters for the function was given an invalid + * enum. */ #define GLFW_INVALID_ENUM 0x00010003 -/*! @brief One of the arguments to the function was an invalid value. - * - * 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. - * - * Requesting a valid but unavailable OpenGL or OpenGL ES version will instead - * result in a @ref GLFW_VERSION_UNAVAILABLE error. - * - * @par Analysis - * Application programmer error. Fix the offending call. +/*! @brief One of the parameters for the function was given an invalid value. */ #define GLFW_INVALID_VALUE 0x00010004 /*! @brief A memory allocation failed. - * - * A memory allocation failed. - * - * @par Analysis - * A bug in GLFW or the underlying operating system. Report the bug to our - * [issue tracker](https://github.com/glfw/glfw/issues). */ #define GLFW_OUT_OF_MEMORY 0x00010005 /*! @brief GLFW could not find support for the requested client API on the * system. - * - * GLFW could not find support for the requested client API on the system. - * - * @par Analysis - * The installed graphics driver does not support the requested client API, or - * does not support it via the chosen context creation backend. Below are - * a few examples. - * - * @par - * Some pre-installed Windows graphics drivers do not support OpenGL. AMD only - * supports OpenGL ES via EGL, while nVidia and Intel only supports it via - * a WGL or GLX extension. OS X does not provide OpenGL ES at all. The Mesa - * EGL, OpenGL and OpenGL ES libraries do not interface with the nVidia binary - * driver. */ #define GLFW_API_UNAVAILABLE 0x00010006 -/*! @brief The requested OpenGL or OpenGL ES version is not available. - * - * The requested OpenGL or OpenGL ES version (including any requested profile - * or context option) is not available on this machine. - * - * @par Analysis - * 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. - * - * @par - * 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 @ref GLFW_INVALID_VALUE, because GLFW cannot know what future versions - * will exist. +/*! @brief The requested client API version is not available. */ #define GLFW_VERSION_UNAVAILABLE 0x00010007 /*! @brief A platform-specific error occurred that does not match any of the * more specific categories. - * - * A platform-specific error occurred that does not match any of the more - * specific categories. - * - * @par Analysis - * A bug in GLFW or the underlying operating system. Report the bug to our - * [issue tracker](https://github.com/glfw/glfw/issues). */ #define GLFW_PLATFORM_ERROR 0x00010008 -/*! @brief The requested format is not supported or available. - * - * If emitted during window creation, the requested pixel format is not - * supported. - * - * If emitted when querying the clipboard, the contents of the clipboard could - * not be converted to the requested format. - * - * @par Analysis - * If emitted during window creation, one or more - * [hard constraints](@ref window_hints_hard) 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. - * - * @par - * If emitted when querying the clipboard, ignore the error or report it to - * the user, as appropriate. +/*! @brief The clipboard did not contain data in the requested format. */ #define GLFW_FORMAT_UNAVAILABLE 0x00010009 /*! @} */ @@ -619,8 +496,6 @@ extern "C" { #define GLFW_RESIZABLE 0x00020003 #define GLFW_VISIBLE 0x00020004 #define GLFW_DECORATED 0x00020005 -#define GLFW_AUTO_ICONIFY 0x00020006 -#define GLFW_FLOATING 0x00020007 #define GLFW_RED_BITS 0x00021001 #define GLFW_GREEN_BITS 0x00021002 @@ -637,7 +512,6 @@ extern "C" { #define GLFW_SAMPLES 0x0002100D #define GLFW_SRGB_CAPABLE 0x0002100E #define GLFW_REFRESH_RATE 0x0002100F -#define GLFW_DOUBLEBUFFER 0x00021010 #define GLFW_CLIENT_API 0x00022001 #define GLFW_CONTEXT_VERSION_MAJOR 0x00022002 @@ -647,7 +521,6 @@ extern "C" { #define GLFW_OPENGL_FORWARD_COMPAT 0x00022006 #define GLFW_OPENGL_DEBUG_CONTEXT 0x00022007 #define GLFW_OPENGL_PROFILE 0x00022008 -#define GLFW_CONTEXT_RELEASE_BEHAVIOR 0x00022009 #define GLFW_OPENGL_API 0x00030001 #define GLFW_OPENGL_ES_API 0x00030002 @@ -668,15 +541,9 @@ extern "C" { #define GLFW_CURSOR_HIDDEN 0x00034002 #define GLFW_CURSOR_DISABLED 0x00034003 -#define GLFW_ANY_RELEASE_BEHAVIOR 0 -#define GLFW_RELEASE_BEHAVIOR_FLUSH 0x00035001 -#define GLFW_RELEASE_BEHAVIOR_NONE 0x00035002 - #define GLFW_CONNECTED 0x00040001 #define GLFW_DISCONNECTED 0x00040002 -#define GLFW_DONT_CARE -1 - /************************************************************************* * GLFW API types @@ -707,14 +574,6 @@ typedef struct GLFWmonitor GLFWmonitor; */ typedef struct GLFWwindow GLFWwindow; -/*! @brief Opaque cursor object. - * - * Opaque cursor object. - * - * @ingroup cursor - */ -typedef struct GLFWcursor GLFWcursor; - /*! @brief The function signature for error callbacks. * * This is the function signature for error callback functions. @@ -724,7 +583,7 @@ typedef struct GLFWcursor GLFWcursor; * * @sa glfwSetErrorCallback * - * @ingroup init + * @ingroup error */ typedef void (* GLFWerrorfun)(int,const char*); @@ -732,7 +591,7 @@ typedef void (* GLFWerrorfun)(int,const char*); * * This is the function signature for window position callback functions. * - * @param[in] window The window that was moved. + * @param[in] window The window that the user moved. * @param[in] xpos The new x-coordinate, in screen coordinates, of the * upper-left corner of the client area of the window. * @param[in] ypos The new y-coordinate, in screen coordinates, of the @@ -748,7 +607,7 @@ typedef void (* GLFWwindowposfun)(GLFWwindow*,int,int); * * This is the function signature for window size callback functions. * - * @param[in] window The window that was resized. + * @param[in] window The window that the user resized. * @param[in] width The new width, in screen coordinates, of the window. * @param[in] height The new height, in screen coordinates, of the window. * @@ -848,8 +707,8 @@ typedef void (* GLFWmousebuttonfun)(GLFWwindow*,int,int,int); * This is the function signature for cursor position callback functions. * * @param[in] window The window that received the event. - * @param[in] xpos The new x-coordinate, in screen coordinates, of the cursor. - * @param[in] ypos The new y-coordinate, in screen coordinates, of the cursor. + * @param[in] xpos The new x-coordinate of the cursor. + * @param[in] ypos The new y-coordinate of the cursor. * * @sa glfwSetCursorPosCallback * @@ -892,7 +751,7 @@ typedef void (* GLFWscrollfun)(GLFWwindow*,double,double); * @param[in] window The window that received the event. * @param[in] key The [keyboard key](@ref keys) that was pressed or released. * @param[in] scancode The system-specific scancode of the key. - * @param[in] action `GLFW_PRESS`, `GLFW_RELEASE` or `GLFW_REPEAT`. + * @param[in] action @ref GLFW_PRESS, @ref GLFW_RELEASE or @ref GLFW_REPEAT. * @param[in] mods Bit field describing which [modifier keys](@ref mods) were * held down. * @@ -907,7 +766,7 @@ typedef void (* GLFWkeyfun)(GLFWwindow*,int,int,int,int); * This is the function signature for Unicode character callback functions. * * @param[in] window The window that received the event. - * @param[in] codepoint The Unicode code point of the character. + * @param[in] character The Unicode code point of the character. * * @sa glfwSetCharCallback * @@ -915,38 +774,6 @@ typedef void (* GLFWkeyfun)(GLFWwindow*,int,int,int,int); */ typedef void (* GLFWcharfun)(GLFWwindow*,unsigned int); -/*! @brief The function signature for Unicode character with modifiers - * callbacks. - * - * This is the function signature for Unicode character with modifiers callback - * functions. It is called for each input character, regardless of what - * modifier keys are held down. - * - * @param[in] window The window that received the event. - * @param[in] codepoint The Unicode code point of the character. - * @param[in] mods Bit field describing which [modifier keys](@ref mods) were - * held down. - * - * @sa glfwSetCharModsCallback - * - * @ingroup input - */ -typedef void (* GLFWcharmodsfun)(GLFWwindow*,unsigned int,int); - -/*! @brief The function signature for file drop callbacks. - * - * This is the function signature for file drop callbacks. - * - * @param[in] window The window that received the event. - * @param[in] count The number of dropped files. - * @param[in] names The UTF-8 encoded path names of the dropped files. - * - * @sa glfwSetDropCallback - * - * @ingroup input - */ -typedef void (* GLFWdropfun)(GLFWwindow*,int,const char**); - /*! @brief The function signature for monitor configuration callbacks. * * This is the function signature for monitor configuration callback functions. @@ -966,7 +793,7 @@ typedef void (* GLFWmonitorfun)(GLFWmonitor*,int); * * @ingroup monitor */ -typedef struct GLFWvidmode +typedef struct { /*! The width, in screen coordinates, of the video mode. */ @@ -996,7 +823,7 @@ typedef struct GLFWvidmode * * @ingroup monitor */ -typedef struct GLFWgammaramp +typedef struct { /*! An array of value describing the response of the red channel. */ @@ -1012,23 +839,6 @@ typedef struct GLFWgammaramp unsigned int size; } GLFWgammaramp; -/*! @brief Image data. - * - * @ingroup window - */ -typedef struct GLFWimage -{ - /*! The width, in pixels, of this image. - */ - int width; - /*! The height, in pixels, of this image. - */ - int height; - /*! The pixel data of this image, arranged left-to-right, top-to-bottom. - */ - unsigned char* pixels; -} GLFWimage; - /************************************************************************* * GLFW API functions @@ -1037,66 +847,56 @@ typedef struct GLFWimage /*! @brief Initializes the GLFW library. * * This function initializes the GLFW library. Before most GLFW functions can - * be used, GLFW must be initialized, and before an application terminates GLFW + * be used, GLFW must be initialized, and before a program terminates GLFW * should be terminated in order to free any resources allocated during or * after initialization. * * If this function fails, it calls @ref glfwTerminate before returning. If it - * succeeds, you should call @ref glfwTerminate before the application exits. + * succeeds, you should call @ref glfwTerminate before the program exits. * * Additional calls to this function after successful initialization but before - * termination will return `GL_TRUE` immediately. + * termination will succeed but will do nothing. * - * @return `GL_TRUE` if successful, or `GL_FALSE` if an - * [error](@ref error_handling) occurred. + * @return `GL_TRUE` if successful, or `GL_FALSE` if an error occurred. * - * @remarks __OS X:__ This function will change the current directory of the + * @par New in GLFW 3 + * This function no longer registers @ref glfwTerminate with `atexit`. + * + * @note This function may only be called from the main thread. + * + * @note This function may take several seconds to complete on some systems, + * while on other systems it may take only a fraction of a second to complete. + * + * @note **Mac OS X:** This function will change the current directory of the * application to the `Contents/Resources` subdirectory of the application's - * bundle, if present. This can be disabled with a - * [compile-time option](@ref compile_options_osx). + * bundle, if present. * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref intro_init * @sa glfwTerminate * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ This function no longer registers @ref glfwTerminate with `atexit`. - * * @ingroup init */ GLFWAPI int glfwInit(void); /*! @brief Terminates the GLFW library. * - * 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 @ref glfwInit successfully before - * you will be able to use most GLFW functions. + * This function destroys all remaining windows, frees any allocated resources + * and sets the library to an uninitialized state. Once this is called, you + * must again call @ref glfwInit successfully before you will be able to use + * most GLFW functions. * * 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 @ref glfwInit before it returns - * failure. + * before the program exits. If initialization fails, there is no need to call + * this function, as it is called by @ref glfwInit before it returns failure. * * @remarks This function may be called before @ref glfwInit. * + * @note This function may only be called from the main thread. + * * @warning No window's context may be current on another thread when this * function is called. * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref intro_init * @sa glfwInit * - * @par History - * Added in GLFW 1.0. - * * @ingroup init */ GLFWAPI void glfwTerminate(void); @@ -1107,53 +907,46 @@ GLFWAPI void glfwTerminate(void); * 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. * - * Any or all of the version arguments may be `NULL`. This function always - * succeeds. - * * @param[out] major Where to store the major version number, or `NULL`. * @param[out] minor Where to store the minor version number, or `NULL`. * @param[out] rev Where to store the revision number, or `NULL`. * * @remarks This function may be called before @ref glfwInit. * - * @par Thread Safety - * This function may be called from any thread. + * @remarks This function may be called from any thread. * - * @sa @ref intro_version * @sa glfwGetVersionString * - * @par History - * Added in GLFW 1.0. - * * @ingroup init */ GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev); /*! @brief Returns a string describing the compile-time configuration. * - * This function returns the compile-time generated - * [version string](@ref intro_version_string) of the GLFW library binary. It - * describes the version, platform, compiler and any platform-specific - * compile-time options. + * This function returns a static string generated at compile-time according to + * which configuration macros were defined. This is intended for use when + * submitting bug reports, to allow developers to see which code paths are + * enabled in a binary. * - * This function always succeeds. + * The format of the string is as follows: + * - The version of GLFW + * - The name of the window system API + * - The name of the context creation API + * - Any additional options or APIs + * + * For example, when compiling GLFW 3.0 with MinGW using the Win32 and WGL + * back ends, the version string may look something like this: + * + * 3.0.0 Win32 WGL MinGW * * @return The GLFW version string. * * @remarks This function may be called before @ref glfwInit. * - * @par Pointer Lifetime - * The returned string is static and compile-time generated. + * @remarks This function may be called from any thread. * - * @par Thread Safety - * This function may be called from any thread. - * - * @sa @ref intro_version * @sa glfwGetVersion * - * @par History - * Added in GLFW 3.0. - * * @ingroup init */ GLFWAPI const char* glfwGetVersionString(void); @@ -1163,29 +956,23 @@ GLFWAPI const char* glfwGetVersionString(void); * This function sets the error callback, which is called with an error code * and a human-readable description each time a GLFW error occurs. * - * 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. - * - * 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. - * * @param[in] cbfun The new callback, or `NULL` to remove the currently set * callback. - * @return The previously set callback, or `NULL` if no callback was set. + * @return The previously set callback, or `NULL` if no callback was set or an + * error occurred. * * @remarks This function may be called before @ref glfwInit. * - * @par Thread Safety - * This function may only be called from the main thread. + * @note The error callback is called by the thread where the error was + * generated. If you are using GLFW from multiple threads, your error callback + * needs to be written accordingly. * - * @sa @ref error_handling + * @note Because the description string provided to the callback 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 that, you need + * to make your own copy of it before returning. * - * @par History - * Added in GLFW 3.0. - * - * @ingroup init + * @ingroup error */ GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun); @@ -1194,26 +981,19 @@ GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun); * This function returns an array of handles for all currently connected * monitors. * - * @param[out] count Where to store the number of monitors in the returned - * array. This is set to zero if an error occurred. - * @return An array of monitor handles, or `NULL` if an - * [error](@ref error_handling) occurred. + * @param[out] count Where to store the size of the returned array. This is + * set to zero if an error occurred. + * @return An array of monitor handles, or `NULL` if an error occurred. * - * @par Pointer Lifetime - * The returned array is allocated and freed by GLFW. You should not free it - * yourself. It is guaranteed to be valid only until the monitor configuration - * changes or the library is terminated. + * @note The returned array is allocated and freed by GLFW. You should not + * free it yourself. * - * @par Thread Safety - * This function may only be called from the main thread. + * @note The returned array is valid only until the monitor configuration + * changes. See @ref glfwSetMonitorCallback to receive notifications of + * configuration changes. * - * @sa @ref monitor_monitors - * @sa @ref monitor_event * @sa glfwGetPrimaryMonitor * - * @par History - * Added in GLFW 3.0. - * * @ingroup monitor */ GLFWAPI GLFWmonitor** glfwGetMonitors(int* count); @@ -1223,18 +1003,10 @@ GLFWAPI GLFWmonitor** glfwGetMonitors(int* count); * This function returns the primary monitor. This is usually the monitor * where elements like the Windows task bar or the OS X menu bar is located. * - * @return The primary monitor, or `NULL` if an [error](@ref error_handling) - * occurred. + * @return The primary monitor, or `NULL` if an error occurred. * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref monitor_monitors * @sa glfwGetMonitors * - * @par History - * Added in GLFW 3.0. - * * @ingroup monitor */ GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void); @@ -1244,21 +1016,10 @@ GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void); * This function returns the position, in screen coordinates, of the upper-left * corner of the specified monitor. * - * Any or all of the position arguments may be `NULL`. If an error occurs, all - * non-`NULL` position arguments will be set to zero. - * * @param[in] monitor The monitor to query. * @param[out] xpos Where to store the monitor x-coordinate, or `NULL`. * @param[out] ypos Where to store the monitor y-coordinate, or `NULL`. * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref monitor_properties - * - * @par History - * Added in GLFW 3.0. - * * @ingroup monitor */ GLFWAPI void glfwGetMonitorPos(GLFWmonitor* monitor, int* xpos, int* ypos); @@ -1268,26 +1029,15 @@ GLFWAPI void glfwGetMonitorPos(GLFWmonitor* monitor, int* xpos, int* ypos); * This function returns the size, in millimetres, of the display area of the * specified monitor. * - * Any or all of the size arguments may be `NULL`. If an error occurs, all - * non-`NULL` size arguments will be set to zero. - * * @param[in] monitor The monitor to query. * @param[out] width Where to store the width, in mm, of the monitor's display * area, or `NULL`. * @param[out] height Where to store the height, in mm, of the monitor's * display area, or `NULL`. * - * @note Some systems do not provide accurate monitor size information, either - * because the EDID data is incorrect, or because the driver does not report it - * accurately. - * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref monitor_properties - * - * @par History - * Added in GLFW 3.0. + * @note Some operating systems do not provide accurate information, either + * because the monitor's EDID data is incorrect, or because the driver does not + * report it accurately. * * @ingroup monitor */ @@ -1296,25 +1046,14 @@ GLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor* monitor, int* width, int* h /*! @brief Returns the name of the specified monitor. * * 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. + * specified monitor. * * @param[in] monitor The monitor to query. - * @return The UTF-8 encoded name of the monitor, or `NULL` if an - * [error](@ref error_handling) occurred. + * @return The UTF-8 encoded name of the monitor, or `NULL` if an error + * occurred. * - * @par Pointer Lifetime - * 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. - * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref monitor_properties - * - * @par History - * Added in GLFW 3.0. + * @note The returned string is allocated and freed by GLFW. You should not + * free it yourself. * * @ingroup monitor */ @@ -1328,20 +1067,12 @@ GLFWAPI const char* glfwGetMonitorName(GLFWmonitor* monitor); * * @param[in] cbfun The new callback, or `NULL` to remove the currently set * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). + * @return The previously set callback, or `NULL` if no callback was set or an + * error occurred. * - * @bug __X11:__ This callback is not yet called on monitor configuration + * @bug **X11:** This callback is not yet called on monitor configuration * changes. * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref monitor_event - * - * @par History - * Added in GLFW 3.0. - * * @ingroup monitor */ GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun); @@ -1356,27 +1087,16 @@ GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun); * @param[in] monitor The monitor to query. * @param[out] count Where to store the number of video modes in the returned * array. This is set to zero if an error occurred. - * @return An array of video modes, or `NULL` if an - * [error](@ref error_handling) occurred. + * @return An array of video modes, or `NULL` if an error occurred. * - * @par Pointer Lifetime - * 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. + * @note The returned array is allocated and freed by GLFW. You should not + * free it yourself. * - * @par Thread Safety - * This function may only be called from the main thread. + * @note The returned array is valid only until this function is called again + * for the specified monitor. * - * @sa @ref monitor_modes * @sa glfwGetVideoMode * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Changed to return a dynamic array of video modes for a specific - * monitor. - * * @ingroup monitor */ GLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* monitor, int* count); @@ -1384,27 +1104,17 @@ GLFWAPI const GLFWvidmode* glfwGetVideoModes(GLFWmonitor* monitor, int* count); /*! @brief Returns the current mode of the specified monitor. * * 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. + * you are using a full screen window, the return value will therefore depend + * on whether it is focused. * * @param[in] monitor The monitor to query. - * @return The current mode of the monitor, or `NULL` if an - * [error](@ref error_handling) occurred. + * @return The current mode of the monitor, or `NULL` if an error occurred. * - * @par Pointer Lifetime - * 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. + * @note The returned struct is allocated and freed by GLFW. You should not + * free it yourself. * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref monitor_modes * @sa glfwGetVideoModes * - * @par History - * Added in GLFW 3.0. Replaced `glfwGetDesktopMode`. - * * @ingroup monitor */ GLFWAPI const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor); @@ -1417,39 +1127,19 @@ GLFWAPI const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor); * @param[in] monitor The monitor whose gamma ramp to set. * @param[in] gamma The desired exponent. * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref monitor_gamma - * - * @par History - * Added in GLFW 3.0. - * * @ingroup monitor */ GLFWAPI void glfwSetGamma(GLFWmonitor* monitor, float gamma); -/*! @brief Returns the current gamma ramp for the specified monitor. +/*! @brief Retrieves the current gamma ramp for the specified monitor. * - * This function returns the current gamma ramp of the specified monitor. + * This function retrieves the current gamma ramp of the specified monitor. * * @param[in] monitor The monitor to query. - * @return The current gamma ramp, or `NULL` if an - * [error](@ref error_handling) occurred. + * @return The current gamma ramp, or `NULL` if an error occurred. * - * @par Pointer Lifetime - * The returned structure and its arrays are allocated and freed by GLFW. You - * should not free them yourself. They are valid until the specified monitor - * is disconnected, this function is called again for that monitor or the - * library is terminated. - * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref monitor_gamma - * - * @par History - * Added in GLFW 3.0. + * @note The value arrays of the returned ramp are allocated and freed by GLFW. + * You should not free them yourself. * * @ingroup monitor */ @@ -1457,26 +1147,13 @@ GLFWAPI const GLFWgammaramp* glfwGetGammaRamp(GLFWmonitor* monitor); /*! @brief Sets the current gamma ramp for the specified monitor. * - * 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 @ref glfwTerminate. + * This function sets the current gamma ramp for the specified monitor. * * @param[in] monitor The monitor whose gamma ramp to set. * @param[in] ramp The gamma ramp to use. * * @note Gamma ramp sizes other than 256 are not supported by all hardware. * - * @par Pointer Lifetime - * The specified gamma ramp is copied before this function returns. - * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref monitor_gamma - * - * @par History - * Added in GLFW 3.0. - * * @ingroup monitor */ GLFWAPI void glfwSetGammaRamp(GLFWmonitor* monitor, const GLFWgammaramp* ramp); @@ -1486,15 +1163,10 @@ GLFWAPI void glfwSetGammaRamp(GLFWmonitor* monitor, const GLFWgammaramp* ramp); * This function resets all window hints to their * [default values](@ref window_hints_values). * - * @par Thread Safety - * This function may only be called from the main thread. + * @note This function may only be called from the main thread. * - * @sa @ref window_hints * @sa glfwWindowHint * - * @par History - * Added in GLFW 3.0. - * * @ingroup window */ GLFWAPI void glfwDefaultWindowHints(void); @@ -1504,74 +1176,52 @@ GLFWAPI void glfwDefaultWindowHints(void); * This function sets hints for the next call to @ref glfwCreateWindow. The * hints, once set, retain their values until changed by a call to @ref * glfwWindowHint or @ref glfwDefaultWindowHints, or until the library is - * terminated. + * terminated with @ref glfwTerminate. * * @param[in] target The [window hint](@ref window_hints) to set. * @param[in] hint The new value of the window hint. * - * @par Thread Safety - * This function may only be called from the main thread. + * @par New in GLFW 3 + * Hints are no longer reset to their default values on window creation. To + * set default hint values, use @ref glfwDefaultWindowHints. + * + * @note This function may only be called from the main thread. * - * @sa @ref window_hints * @sa glfwDefaultWindowHints * - * @par History - * Added in GLFW 2.2. - * - * @par - * __GLFW 3:__ Renamed from `glfwOpenWindowHint`. Hints are no longer reset to - * default values on window creation. - * * @ingroup window */ GLFWAPI void glfwWindowHint(int target, int hint); /*! @brief Creates a window and its associated context. * - * This function creates a window and its associated OpenGL or OpenGL ES - * context. Most of the options controlling how the window and its context - * should be created are specified with [window hints](@ref window_hints). + * This function creates a window and its associated context. Most of the + * options controlling how the window and its context should be created are + * specified through @ref glfwWindowHint. * * Successful creation does not change which context is current. Before you - * can use the newly created context, you need to - * [make it current](@ref context_current). For information about the `share` - * parameter, see @ref context_sharing. + * can use the newly created context, you need to make it current using @ref + * glfwMakeContextCurrent. * - * The created window, framebuffer and context may differ from what you - * requested, as not all parameters and hints are + * Note that the created window and context may differ from what you requested, + * as not all parameters and hints are * [hard constraints](@ref window_hints_hard). This includes the size of the - * window, especially for full screen windows. To query the actual attributes - * of the created window, framebuffer and context, use queries like @ref + * window, especially for full screen windows. To retrieve the actual + * attributes of the created window and context, use queries like @ref * glfwGetWindowAttrib and @ref glfwGetWindowSize. * - * To create a full screen window, you need to specify the monitor the window - * will cover. If no monitor is specified, windowed mode will be used. Unless - * you have a way for the user to choose a specific monitor, it is recommended - * that you pick the primary monitor. For more information on how to query - * connected monitors, see @ref monitor_monitors. + * To create a full screen window, you need to specify the monitor to use. If + * no monitor is specified, windowed mode will be used. Unless you have a way + * for the user to choose a specific monitor, it is recommended that you pick + * the primary monitor. For more information on how to retrieve monitors, see + * @ref monitor_monitors. * - * For full screen windows, the specified size becomes the resolution of the - * window's _desired video mode_. As long as a full screen window has input - * focus, the supported video mode most closely matching the desired video mode - * is set for the specified monitor. For more information about full screen - * windows, including the creation of so called _windowed full screen_ or - * _borderless full screen_ windows, see @ref window_full_screen. + * To create the window at a specific position, make it initially invisible + * using the `GLFW_VISIBLE` window hint, set its position and then show it. * - * By default, newly created windows use the placement recommended by the - * window system. To create the window at a specific position, make it - * initially invisible using the `GLFW_VISIBLE` window hint, set its - * [position](@ref window_pos) and then [show](@ref window_hide) it. - * - * If a full screen window is focused, the screensaver is prohibited from + * If a full screen window is active, the screensaver is prohibited from * starting. * - * Window systems put limits on window sizes. Very large or very small window - * dimensions may be overridden by the window system on creation. Check the - * actual [size](@ref window_size) after creation. - * - * The [swap interval](@ref window_swap) is not set during window creation and - * the initial value may vary depending on driver settings and defaults. - * * @param[in] width The desired width, in screen coordinates, of the window. * This must be greater than zero. * @param[in] height The desired height, in screen coordinates, of the window. @@ -1581,47 +1231,23 @@ GLFWAPI void glfwWindowHint(int target, int hint); * windowed mode. * @param[in] share The window whose context to share resources with, or `NULL` * to not share resources. - * @return The handle of the created window, or `NULL` if an - * [error](@ref error_handling) occurred. + * @return The handle of the created window, or `NULL` if an error occurred. * - * @remarks __Windows:__ Window creation will fail if the Microsoft GDI - * software OpenGL implementation is the only one available. - * - * @remarks __Windows:__ If the executable has an icon resource named + * @remarks **Windows:** If the executable has an icon resource named * `GLFW_ICON,` it will be set as the icon for the window. If no such icon is * present, the `IDI_WINLOGO` icon will be used instead. * - * @remarks __OS X:__ The GLFW window has no icon, as it is not a document + * @remarks **Mac OS X:** The GLFW window has no icon, as it is not a document * window, but the dock icon will be the same as the application bundle's icon. - * For more information on bundles, see the - * [Bundle Programming Guide](https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/) - * in the Mac Developer Library. + * Also, the first time a window is opened the menu bar is populated with + * common commands like Hide, Quit and About. The (minimal) about dialog uses + * information from the application's bundle. For more information on bundles, + * see the Bundle Programming Guide provided by Apple. * - * @remarks __OS X:__ The first time a window is created the menu bar is - * populated with common commands like Hide, Quit and About. The About entry - * opens a minimal about dialog with information from the application's bundle. - * The menu bar can be disabled with a - * [compile-time option](@ref compile_options_osx). + * @note This function may only be called from the main thread. * - * @remarks __X11:__ There is no mechanism for setting the window icon yet. - * - * @remarks __X11:__ Some window managers will not respect the placement of - * initially hidden windows. - * - * @note This function may not be called from a callback. - * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref window_creation * @sa glfwDestroyWindow * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Renamed from `glfwOpenWindow`. Complete signature overhaul. - * * @ingroup window */ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, const char* title, GLFWmonitor* monitor, GLFWwindow* share); @@ -1631,28 +1257,19 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, const char* title, G * This function destroys the specified window and its context. On calling * this function, no further callbacks will be called for that window. * - * If the context of the specified window is current on the main thread, it is - * detached before being destroyed. - * * @param[in] window The window to destroy. * + * @note This function may only be called from the main thread. + * * @note This function may not be called from a callback. * - * @note The context of the specified window must not be current on any other - * thread when this function is called. + * @note If the window's context is current on the main thread, it is + * detached before being destroyed. * - * @par Thread Safety - * This function may only be called from the main thread. + * @warning The window's context must not be current on any other thread. * - * @sa @ref window_creation * @sa glfwCreateWindow * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Renamed from `glfwCloseWindow`. Added window handle parameter. - * * @ingroup window */ GLFWAPI void glfwDestroyWindow(GLFWwindow* window); @@ -1664,13 +1281,7 @@ GLFWAPI void glfwDestroyWindow(GLFWwindow* window); * @param[in] window The window to query. * @return The value of the close flag. * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. - * - * @sa @ref window_close - * - * @par History - * Added in GLFW 3.0. + * @remarks This function may be called from secondary threads. * * @ingroup window */ @@ -1685,13 +1296,7 @@ GLFWAPI int glfwWindowShouldClose(GLFWwindow* window); * @param[in] window The window whose flag to change. * @param[in] value The new value. * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. - * - * @sa @ref window_close - * - * @par History - * Added in GLFW 3.0. + * @remarks This function may be called from secondary threads. * * @ingroup window */ @@ -1705,16 +1310,7 @@ GLFWAPI void glfwSetWindowShouldClose(GLFWwindow* window, int value); * @param[in] window The window whose title to change. * @param[in] title The UTF-8 encoded window title. * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref window_title - * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Added window handle parameter. + * @note This function may only be called from the main thread. * * @ingroup window */ @@ -1725,24 +1321,14 @@ GLFWAPI void glfwSetWindowTitle(GLFWwindow* window, const char* title); * This function retrieves the position, in screen coordinates, of the * upper-left corner of the client area of the specified window. * - * Any or all of the position arguments may be `NULL`. If an error occurs, all - * non-`NULL` position arguments will be set to zero. - * * @param[in] window The window to query. * @param[out] xpos Where to store the x-coordinate of the upper-left corner of * the client area, or `NULL`. * @param[out] ypos Where to store the y-coordinate of the upper-left corner of * the client area, or `NULL`. * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref window_pos * @sa glfwSetWindowPos * - * @par History - * Added in GLFW 3.0. - * * @ingroup window */ GLFWAPI void glfwGetWindowPos(GLFWwindow* window, int* xpos, int* ypos); @@ -1750,8 +1336,13 @@ GLFWAPI void glfwGetWindowPos(GLFWwindow* window, int* xpos, int* ypos); /*! @brief Sets the position of the client area of the specified window. * * This function sets the position, in screen coordinates, of the upper-left - * corner of the client area of the specified windowed mode window. If the - * window is a full screen window, this function does nothing. + * corner of the client area of the window. + * + * If the specified window is a full screen window, this function does nothing. + * + * If you wish to set an initial window position you should create a hidden + * window (using @ref glfwWindowHint and `GLFW_VISIBLE`), set its position and + * then show it. * * @param[in] window The window to query. * @param[in] xpos The x-coordinate of the upper-left corner of the client area. @@ -1760,20 +1351,16 @@ GLFWAPI void glfwGetWindowPos(GLFWwindow* window, int* xpos, int* ypos); * @note It is very rarely a good idea to move an already visible window, as it * will confuse and annoy the user. * + * @note This function may only be called from the main thread. + * * @note The window manager may put limits on what positions are allowed. * - * @par Thread Safety - * This function may only be called from the main thread. + * @bug **X11:** Some window managers ignore the set position of hidden (i.e. + * unmapped) windows, instead placing them where it thinks is appropriate once + * they are shown. * - * @sa @ref window_pos * @sa glfwGetWindowPos * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Added window handle parameter. - * * @ingroup window */ GLFWAPI void glfwSetWindowPos(GLFWwindow* window, int xpos, int ypos); @@ -1781,11 +1368,7 @@ GLFWAPI void glfwSetWindowPos(GLFWwindow* window, int xpos, int ypos); /*! @brief Retrieves the size of the client area of the specified window. * * This function retrieves the size, in screen coordinates, of the client area - * of the specified window. If you wish to retrieve the size of the - * framebuffer in pixels, see @ref glfwGetFramebufferSize. - * - * Any or all of the size arguments may be `NULL`. If an error occurs, all - * non-`NULL` size arguments will be set to zero. + * of the specified window. * * @param[in] window The window whose size to retrieve. * @param[out] width Where to store the width, in screen coordinates, of the @@ -1793,18 +1376,8 @@ GLFWAPI void glfwSetWindowPos(GLFWwindow* window, int xpos, int ypos); * @param[out] height Where to store the height, in screen coordinates, of the * client area, or `NULL`. * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref window_size * @sa glfwSetWindowSize * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Added window handle parameter. - * * @ingroup window */ GLFWAPI void glfwGetWindowSize(GLFWwindow* window, int* width, int* height); @@ -1823,20 +1396,12 @@ GLFWAPI void glfwGetWindowSize(GLFWwindow* window, int* width, int* height); * @param[in] width The desired width of the specified window. * @param[in] height The desired height of the specified window. * + * @note This function may only be called from the main thread. + * * @note The window manager may put limits on what window sizes are allowed. * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref window_size * @sa glfwGetWindowSize * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Added window handle parameter. - * * @ingroup window */ GLFWAPI void glfwSetWindowSize(GLFWwindow* window, int width, int height); @@ -1844,11 +1409,7 @@ GLFWAPI void glfwSetWindowSize(GLFWwindow* window, int width, int height); /*! @brief Retrieves the size of the framebuffer of the specified window. * * This function retrieves the size, in pixels, of the framebuffer of the - * specified window. If you wish to retrieve the size of the window in screen - * coordinates, see @ref glfwGetWindowSize. - * - * Any or all of the size arguments may be `NULL`. If an error occurs, all - * non-`NULL` size arguments will be set to zero. + * specified window. * * @param[in] window The window whose framebuffer to query. * @param[out] width Where to store the width, in pixels, of the framebuffer, @@ -1856,146 +1417,74 @@ GLFWAPI void glfwSetWindowSize(GLFWwindow* window, int width, int height); * @param[out] height Where to store the height, in pixels, of the framebuffer, * or `NULL`. * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref window_fbsize * @sa glfwSetFramebufferSizeCallback * - * @par History - * Added in GLFW 3.0. - * * @ingroup window */ GLFWAPI void glfwGetFramebufferSize(GLFWwindow* window, int* width, int* height); -/*! @brief Retrieves the size of the frame of the window. - * - * This function retrieves the size, in screen coordinates, of each edge of the - * frame of the specified window. This size includes the title bar, if the - * window has one. The size of the frame may vary depending on the - * [window-related hints](@ref window_hints_wnd) used to create it. - * - * Because this function retrieves the size of each window frame edge and not - * the offset along a particular coordinate axis, the retrieved values will - * always be zero or positive. - * - * Any or all of the size arguments may be `NULL`. If an error occurs, all - * non-`NULL` size arguments will be set to zero. - * - * @param[in] window The window whose frame size to query. - * @param[out] left Where to store the size, in screen coordinates, of the left - * edge of the window frame, or `NULL`. - * @param[out] top Where to store the size, in screen coordinates, of the top - * edge of the window frame, or `NULL`. - * @param[out] right Where to store the size, in screen coordinates, of the - * right edge of the window frame, or `NULL`. - * @param[out] bottom Where to store the size, in screen coordinates, of the - * bottom edge of the window frame, or `NULL`. - * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref window_size - * - * @par History - * Added in GLFW 3.1. - * - * @ingroup window - */ -GLFWAPI void glfwGetWindowFrameSize(GLFWwindow* window, int* left, int* top, int* right, int* bottom); - /*! @brief Iconifies the specified window. * - * This function iconifies (minimizes) the specified window if it was - * previously restored. If the window is already iconified, this function does - * nothing. - * - * If the specified window is a full screen window, the original monitor - * resolution is restored until the window is restored. + * This function iconifies/minimizes the specified window, if it was previously + * restored. If it is a full screen window, the original monitor resolution is + * restored until the window is restored. If the window is already iconified, + * this function does nothing. * * @param[in] window The window to iconify. * - * @par Thread Safety - * This function may only be called from the main thread. + * @note This function may only be called from the main thread. * - * @sa @ref window_iconify * @sa glfwRestoreWindow * - * @par History - * Added in GLFW 2.1. - * - * @par - * __GLFW 3:__ Added window handle parameter. - * * @ingroup window */ GLFWAPI void glfwIconifyWindow(GLFWwindow* window); /*! @brief Restores the specified window. * - * This function restores the specified window if it was previously iconified - * (minimized). If the window is already restored, this function does nothing. - * - * If the specified window is a full screen window, the resolution chosen for - * the window is restored on the selected monitor. + * This function restores the specified window, if it was previously + * iconified/minimized. If it is a full screen window, the resolution chosen + * for the window is restored on the selected monitor. If the window is + * already restored, this function does nothing. * * @param[in] window The window to restore. * - * @par Thread Safety - * This function may only be called from the main thread. + * @note This function may only be called from the main thread. * - * @sa @ref window_iconify * @sa glfwIconifyWindow * - * @par History - * Added in GLFW 2.1. - * - * @par - * __GLFW 3:__ Added window handle parameter. - * * @ingroup window */ GLFWAPI void glfwRestoreWindow(GLFWwindow* window); /*! @brief Makes the specified window visible. * - * This function makes the specified window visible if it was previously + * This function makes the specified window visible, if it was previously * hidden. If the window is already visible or is in full screen mode, this * function does nothing. * * @param[in] window The window to make visible. * - * @par Thread Safety - * This function may only be called from the main thread. + * @note This function may only be called from the main thread. * - * @sa @ref window_hide * @sa glfwHideWindow * - * @par History - * Added in GLFW 3.0. - * * @ingroup window */ GLFWAPI void glfwShowWindow(GLFWwindow* window); /*! @brief Hides the specified window. * - * This function hides the specified window if it was previously visible. If + * This function hides the specified window, if it was previously visible. If * the window is already hidden or is in full screen mode, this function does * nothing. * * @param[in] window The window to hide. * - * @par Thread Safety - * This function may only be called from the main thread. + * @note This function may only be called from the main thread. * - * @sa @ref window_hide * @sa glfwShowWindow * - * @par History - * Added in GLFW 3.0. - * * @ingroup window */ GLFWAPI void glfwHideWindow(GLFWwindow* window); @@ -2006,16 +1495,7 @@ GLFWAPI void glfwHideWindow(GLFWwindow* window); * in full screen on. * * @param[in] window The window to query. - * @return The monitor, or `NULL` if the window is in windowed mode or an error - * occurred. - * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref window_monitor - * - * @par History - * Added in GLFW 3.0. + * @return The monitor, or `NULL` if the window is in windowed mode. * * @ingroup window */ @@ -2023,26 +1503,13 @@ GLFWAPI GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* window); /*! @brief Returns an attribute of the specified window. * - * This function returns the value of an attribute of the specified window or - * its OpenGL or OpenGL ES context. + * This function returns an attribute of the specified window. There are many + * attributes, some related to the window and others to its context. * * @param[in] window The window to query. * @param[in] attrib The [window attribute](@ref window_attribs) whose value to * return. - * @return The value of the attribute, or zero if an - * [error](@ref error_handling) occurred. - * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref window_attribs - * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Renamed from `glfwGetWindowParam`. Added window handle - * parameter. + * @return The value of the attribute, or zero if an error occurred. * * @ingroup window */ @@ -2057,15 +1524,8 @@ GLFWAPI int glfwGetWindowAttrib(GLFWwindow* window, int attrib); * @param[in] window The window whose pointer to set. * @param[in] pointer The new value. * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. - * - * @sa @ref window_userptr * @sa glfwGetWindowUserPointer * - * @par History - * Added in GLFW 3.0. - * * @ingroup window */ GLFWAPI void glfwSetWindowUserPointer(GLFWwindow* window, void* pointer); @@ -2077,15 +1537,8 @@ GLFWAPI void glfwSetWindowUserPointer(GLFWwindow* window, void* pointer); * * @param[in] window The window whose pointer to return. * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. - * - * @sa @ref window_userptr * @sa glfwSetWindowUserPointer * - * @par History - * Added in GLFW 3.0. - * * @ingroup window */ GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* window); @@ -2099,19 +1552,8 @@ GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* window); * @param[in] window The window whose callback to set. * @param[in] cbfun The new callback, or `NULL` to remove the currently set * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref window_pos - * - * @par History - * Added in GLFW 3.0. - * - * @par - * __GLFW 3:__ Added window handle parameter. Updated callback signature. + * @return The previously set callback, or `NULL` if no callback was set or an + * error occurred. * * @ingroup window */ @@ -2126,19 +1568,8 @@ GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindow * @param[in] window The window whose callback to set. * @param[in] cbfun The new callback, or `NULL` to remove the currently set * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref window_size - * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Added window handle parameter. Updated callback signature. + * @return The previously set callback, or `NULL` if no callback was set or an + * error occurred. * * @ingroup window */ @@ -2158,23 +1589,12 @@ GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwind * @param[in] window The window whose callback to set. * @param[in] cbfun The new callback, or `NULL` to remove the currently set * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). + * @return The previously set callback, or `NULL` if no callback was set or an + * error occurred. * - * @remarks __OS X:__ Selecting Quit from the application menu will + * @remarks **Mac OS X:** Selecting Quit from the application menu will * trigger the close callback for all windows. * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref window_close - * - * @par History - * Added in GLFW 2.5. - * - * @par - * __GLFW 3:__ Added window handle parameter. Updated callback signature. - * * @ingroup window */ GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwindowclosefun cbfun); @@ -2192,19 +1612,12 @@ GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwi * @param[in] window The window whose callback to set. * @param[in] cbfun The new callback, or `NULL` to remove the currently set * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). + * @return The previously set callback, or `NULL` if no callback was set or an + * error occurred. * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref window_refresh - * - * @par History - * Added in GLFW 2.5. - * - * @par - * __GLFW 3:__ Added window handle parameter. Updated callback signature. + * @note On compositing window systems such as Aero, Compiz or Aqua, where the + * window contents are saved off-screen, this callback may be called only very + * infrequently or never at all. * * @ingroup window */ @@ -2223,16 +1636,8 @@ GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GL * @param[in] window The window whose callback to set. * @param[in] cbfun The new callback, or `NULL` to remove the currently set * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref window_focus - * - * @par History - * Added in GLFW 3.0. + * @return The previously set callback, or `NULL` if no callback was set or an + * error occurred. * * @ingroup window */ @@ -2246,16 +1651,8 @@ GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwi * @param[in] window The window whose callback to set. * @param[in] cbfun The new callback, or `NULL` to remove the currently set * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref window_iconify - * - * @par History - * Added in GLFW 3.0. + * @return The previously set callback, or `NULL` if no callback was set or an + * error occurred. * * @ingroup window */ @@ -2269,16 +1666,8 @@ GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GL * @param[in] window The window whose callback to set. * @param[in] cbfun The new callback, or `NULL` to remove the currently set * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref window_fbsize - * - * @par History - * Added in GLFW 3.0. + * @return The previously set callback, or `NULL` if no callback was set or an + * error occurred. * * @ingroup window */ @@ -2286,172 +1675,99 @@ GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window /*! @brief Processes all pending events. * - * This function processes only those events that are already in the event - * queue and then returns immediately. Processing events will cause the window - * and input callbacks associated with those events to be called. + * This function processes only those events that have already been received + * and then returns immediately. Processing events will cause the window and + * input callbacks associated with those events to be called. * - * On some platforms, a window move, resize or menu operation will cause event - * processing to block. This is due to how event processing is designed on - * those platforms. You can use the - * [window refresh callback](@ref window_refresh) to redraw the contents of - * your window when necessary during such operations. + * This function is not required for joystick input to work. * - * On some platforms, certain events are sent directly to the application - * without going through the event queue, causing callbacks to be called - * outside of a call to one of the event processing functions. + * @par New in GLFW 3 + * This function is no longer called by @ref glfwSwapBuffers. You need to call + * it or @ref glfwWaitEvents yourself. * - * Event processing is not required for joystick input to work. - * - * @note This function may not be called from a callback. - * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref input_event - * @sa glfwWaitEvents - * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ This function is no longer called by @ref glfwSwapBuffers. - * - * @ingroup window - */ -GLFWAPI void glfwPollEvents(void); - -/*! @brief Waits until events are queued and processes them. - * - * This function puts the calling thread to sleep until at least one event is - * available in the event queue. Once one or more events are available, - * it behaves exactly like @ref glfwPollEvents, i.e. the events in the queue - * are processed and the function then returns immediately. Processing events - * will cause the window and input callbacks associated with those events to be - * called. - * - * Since not all events are associated with callbacks, this function may return - * without a callback having been called even if you are monitoring all - * callbacks. - * - * On some platforms, a window move, resize or menu operation will cause event - * processing to block. This is due to how event processing is designed on - * those platforms. You can use the - * [window refresh callback](@ref window_refresh) to redraw the contents of - * your window when necessary during such operations. - * - * If no windows exist, this function returns immediately. For synchronization - * of threads in applications that do not create windows, use your threading - * library of choice. - * - * Event processing is not required for joystick input to work. + * @note This function may only be called from the main thread. * * @note This function may not be called from a callback. * * @note On some platforms, certain callbacks may be called outside of a call * to one of the event processing functions. * - * @par Thread Safety - * This function may only be called from the main thread. + * @sa glfwWaitEvents + * + * @ingroup window + */ +GLFWAPI void glfwPollEvents(void); + +/*! @brief Waits until events are pending and processes them. + * + * This function puts the calling thread to sleep until at least one event has + * been received. Once one or more events have been received, it behaves as if + * @ref glfwPollEvents was called, i.e. the events are processed and the + * function then returns immediately. Processing events will cause the window + * and input callbacks associated with those events to be called. + * + * Since not all events are associated with callbacks, this function may return + * without a callback having been called even if you are monitoring all + * callbacks. + * + * This function is not required for joystick input to work. + * + * @note This function may only be called from the main thread. + * + * @note This function may not be called from a callback. + * + * @note On some platforms, certain callbacks may be called outside of a call + * to one of the event processing functions. * - * @sa @ref input_event * @sa glfwPollEvents * - * @par History - * Added in GLFW 2.5. - * * @ingroup window */ GLFWAPI void glfwWaitEvents(void); -/*! @brief Posts an empty event to the event queue. - * - * This function posts an empty event from the current thread to the event - * queue, causing @ref glfwWaitEvents to return. - * - * If no windows exist, this function returns immediately. For synchronization - * of threads in applications that do not create windows, use your threading - * library of choice. - * - * @par Thread Safety - * This function may be called from any thread. - * - * @sa @ref input_event - * @sa glfwWaitEvents - * - * @par History - * Added in GLFW 3.1. - * - * @ingroup window - */ -GLFWAPI void glfwPostEmptyEvent(void); - /*! @brief Returns the value of an input option for the specified window. - * - * This function returns the value of an input option for the specified window. - * The mode must be one of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or - * `GLFW_STICKY_MOUSE_BUTTONS`. * * @param[in] window The window to query. * @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or * `GLFW_STICKY_MOUSE_BUTTONS`. * - * @par Thread Safety - * This function may only be called from the main thread. - * * @sa glfwSetInputMode * - * @par History - * Added in GLFW 3.0. - * * @ingroup input */ GLFWAPI int glfwGetInputMode(GLFWwindow* window, int mode); /*! @brief Sets an input option for the specified window. - * - * This function sets an input mode option for the specified window. The mode - * must be one of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or - * `GLFW_STICKY_MOUSE_BUTTONS`. - * - * If the mode is `GLFW_CURSOR`, the value must be one of the following cursor - * modes: - * - `GLFW_CURSOR_NORMAL` makes the cursor visible and behaving normally. - * - `GLFW_CURSOR_HIDDEN` makes the cursor invisible when it is over the client - * area of the window but does not restrict the cursor from leaving. This is - * useful if you wish to render your own cursor or have no visible cursor at - * all. - * - `GLFW_CURSOR_DISABLED` hides and grabs the cursor, providing virtual - * and unlimited cursor movement. This is useful for implementing for - * example 3D camera controls. - * - * If the mode is `GLFW_STICKY_KEYS`, the value must be either `GL_TRUE` to - * enable sticky keys, or `GL_FALSE` to disable it. If sticky keys are - * enabled, a key press will ensure that @ref glfwGetKey returns `GLFW_PRESS` - * the next time it is called even if the key had been released before the - * call. This is useful when you are only interested in whether keys have been - * pressed but not when or in which order. - * - * If the mode is `GLFW_STICKY_MOUSE_BUTTONS`, the value must be either - * `GL_TRUE` to enable sticky mouse buttons, or `GL_FALSE` to disable it. If - * sticky mouse buttons are enabled, a mouse button press will ensure that @ref - * glfwGetMouseButton returns `GLFW_PRESS` the next time it is called even if - * the mouse button had been released before the call. This is useful when you - * are only interested in whether mouse buttons have been pressed but not when - * or in which order. - * * @param[in] window The window whose input mode to set. * @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or * `GLFW_STICKY_MOUSE_BUTTONS`. * @param[in] value The new value of the specified input mode. * - * @par Thread Safety - * This function may only be called from the main thread. + * If `mode` is `GLFW_CURSOR`, the value must be one of the supported input + * modes: + * - `GLFW_CURSOR_NORMAL` makes the cursor visible and behaving normally. + * - `GLFW_CURSOR_HIDDEN` makes the cursor invisible when it is over the client + * area of the window. + * - `GLFW_CURSOR_DISABLED` disables the cursor and removes any limitations on + * cursor movement. + * + * If `mode` is `GLFW_STICKY_KEYS`, the value must be either `GL_TRUE` to + * enable sticky keys, or `GL_FALSE` to disable it. If sticky keys are + * enabled, a key press will ensure that @ref glfwGetKey returns @ref + * GLFW_PRESS the next time it is called even if the key had been released + * before the call. This is useful when you are only interested in whether + * keys have been pressed but not when or in which order. + * + * If `mode` is `GLFW_STICKY_MOUSE_BUTTONS`, the value must be either `GL_TRUE` + * to enable sticky mouse buttons, or `GL_FALSE` to disable it. If sticky + * mouse buttons are enabled, a mouse button press will ensure that @ref + * glfwGetMouseButton returns @ref GLFW_PRESS the next time it is called even + * if the mouse button had been released before the call. This is useful when + * you are only interested in whether mouse buttons have been pressed but not + * when or in which order. * * @sa glfwGetInputMode * - * @par History - * Added in GLFW 3.0. Replaced `glfwEnable` and `glfwDisable`. - * * @ingroup input */ GLFWAPI void glfwSetInputMode(GLFWwindow* window, int mode, int value); @@ -2461,35 +1777,22 @@ GLFWAPI void glfwSetInputMode(GLFWwindow* window, int mode, int value); * * This function returns the last state reported for the specified key to the * specified window. The returned state is one of `GLFW_PRESS` or - * `GLFW_RELEASE`. The higher-level action `GLFW_REPEAT` is only reported to + * `GLFW_RELEASE`. The higher-level state `GLFW_REPEAT` is only reported to * the key callback. * * If the `GLFW_STICKY_KEYS` input mode is enabled, this function returns - * `GLFW_PRESS` the first time you call it for a key that was pressed, even if - * that key has already been released. + * `GLFW_PRESS` the first time you call this function after a key has been + * pressed, even if the key has already been released. * * The key functions deal with physical keys, with [key tokens](@ref keys) * named after their use on the standard US keyboard layout. If you want to * input text, use the Unicode character callback instead. * - * The [modifier key bit masks](@ref mods) are not key tokens and cannot be - * used with this function. - * * @param[in] window The desired window. - * @param[in] key The desired [keyboard key](@ref keys). `GLFW_KEY_UNKNOWN` is - * not a valid key for this function. + * @param[in] key The desired [keyboard key](@ref keys). * @return One of `GLFW_PRESS` or `GLFW_RELEASE`. * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref input_key - * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Added window handle parameter. + * @note `GLFW_KEY_UNKNOWN` is not a valid key for this function. * * @ingroup input */ @@ -2499,29 +1802,16 @@ GLFWAPI int glfwGetKey(GLFWwindow* window, int key); * window. * * This function returns the last state reported for the specified mouse button - * to the specified window. The returned state is one of `GLFW_PRESS` or - * `GLFW_RELEASE`. The higher-level action `GLFW_REPEAT` is only reported to - * the mouse button callback. + * to the specified window. * * If the `GLFW_STICKY_MOUSE_BUTTONS` input mode is enabled, this function - * `GLFW_PRESS` the first time you call it for a mouse button that was pressed, - * even if that mouse button has already been released. + * returns `GLFW_PRESS` the first time you call this function after a mouse + * button has been pressed, even if the mouse button has already been released. * * @param[in] window The desired window. * @param[in] button The desired [mouse button](@ref buttons). * @return One of `GLFW_PRESS` or `GLFW_RELEASE`. * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref input_mouse_button - * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Added window handle parameter. - * * @ingroup input */ GLFWAPI int glfwGetMouseButton(GLFWwindow* window, int button); @@ -2529,8 +1819,7 @@ GLFWAPI int glfwGetMouseButton(GLFWwindow* window, int button); /*! @brief Retrieves the last reported cursor position, relative to the client * area of the window. * - * This function returns the last reported position of the cursor, in screen - * coordinates, relative to the upper-left corner of the client area of the + * This function returns the last reported position of the cursor to the * specified window. * * If the cursor is disabled (with `GLFW_CURSOR_DISABLED`) then the cursor @@ -2541,39 +1830,23 @@ GLFWAPI int glfwGetMouseButton(GLFWwindow* window, int button); * `floor` function. Casting directly to an integer type works for positive * coordinates, but fails for negative ones. * - * Any or all of the position arguments may be `NULL`. If an error occurs, all - * non-`NULL` position arguments will be set to zero. - * * @param[in] window The desired window. * @param[out] xpos Where to store the cursor x-coordinate, relative to the * left edge of the client area, or `NULL`. * @param[out] ypos Where to store the cursor y-coordinate, relative to the to * top edge of the client area, or `NULL`. * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref input_cursor_pos * @sa glfwSetCursorPos * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Renamed from `glfwGetMousePos`. Added window handle parameter. - * Moved to floating-point coordinates. - * * @ingroup input */ GLFWAPI void glfwGetCursorPos(GLFWwindow* window, double* xpos, double* ypos); -/*! @brief Sets the position of the cursor, relative to the client area of the - * window. +/*! @brief Sets the position of the cursor, relative to the client area of the window. * - * This function sets the position, in screen coordinates, of the cursor - * relative to the upper-left corner of the client area of the specified - * window. The window must be focused. If the window does not have focus when - * this function is called, it fails silently. + * This function sets the position of the cursor. The specified window must be + * focused. If the window does not have focus when this function is called, it + * fails silently. * * If the cursor is disabled (with `GLFW_CURSOR_DISABLED`) then the cursor * position is unbounded and limited only by the minimum and maximum values of @@ -2581,112 +1854,19 @@ GLFWAPI void glfwGetCursorPos(GLFWwindow* window, double* xpos, double* ypos); * * @param[in] window The desired window. * @param[in] xpos The desired x-coordinate, relative to the left edge of the - * client area. + * client area, or `NULL`. * @param[in] ypos The desired y-coordinate, relative to the top edge of the - * client area. + * client area, or `NULL`. * - * @remarks __X11:__ Due to the asynchronous nature of a modern X desktop, it - * may take a moment for the window focus event to arrive. This means you will - * not be able to set the cursor position directly after window creation. - * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref input_cursor_pos * @sa glfwGetCursorPos * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Renamed from `glfwSetMousePos`. Added window handle parameter. - * Moved to floating-point coordinates. - * * @ingroup input */ GLFWAPI void glfwSetCursorPos(GLFWwindow* window, double xpos, double ypos); -/*! @brief Creates a cursor. - * - * Creates a new cursor that can be made the system cursor for a window with - * @ref glfwSetCursor. The cursor can be destroyed with @ref - * glfwDestroyCursor. Any remaining cursors are destroyed by @ref - * glfwTerminate. - * - * The image data is 32-bit RGBA, i.e. eight bits per channel. The pixels are - * arranged canonically as sequental rows, starting from the top-left corner. - * - * @param[in] image The desired cursor image. - * @param[in] xhot The desired x-coordinate of the cursor hotspot. - * @param[in] yhot The desired y-coordinate of the cursor hotspot. - * - * @return A new cursor ready to use or `NULL` if an - * [error](@ref error_handling) occurred. - * - * @note This function may not be called from a callback. - * - * @par Pointer Lifetime - * The specified image data is copied before this function returns. - * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref input_cursor - * @sa glfwDestroyCursor - * - * @par History - * Added in GLFW 3.1. - * - * @ingroup input - */ -GLFWAPI GLFWcursor* glfwCreateCursor(const GLFWimage* image, int xhot, int yhot); - -/*! @brief Destroys a cursor. - * - * This function destroys a cursor previously created with @ref - * glfwCreateCursor. Any remaining cursors will be destroyed by @ref - * glfwTerminate. - * - * @param[in] cursor The cursor object to destroy. - * - * @note This function may not be called from a callback. - * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref input_cursor - * @sa glfwCreateCursor - * - * @par History - * Added in GLFW 3.1. - * - * @ingroup input - */ -GLFWAPI void glfwDestroyCursor(GLFWcursor* cursor); - -/*! @brief Sets the system cursor for a given window. - * - * This function sets the system cursor for the specified window. - * - * @param[in] window The window to set the system cursor for. - * @param[in] cursor The cursor to change to, or `NULL` to switch back - * to the default system cursor. - * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref input_cursor - * - * @par History - * Added in GLFW 3.1. - * - * @ingroup input - */ -GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor); - /*! @brief Sets the key callback. * - * This function sets the key callback of the specified window, which is called + * This function sets the key callback of the specific window, which is called * when a key is pressed, repeated or released. * * The key functions deal with physical keys, with layout independent @@ -2703,7 +1883,7 @@ GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor); * The scancode of a key is specific to that platform or sometimes even to that * machine. Scancodes are intended to allow users to bind keys that don't have * a GLFW key token. Such keys have `key` set to `GLFW_KEY_UNKNOWN`, their - * state is not saved and so it cannot be queried with @ref glfwGetKey. + * state is not saved and so it cannot be retrieved with @ref glfwGetKey. * * Sometimes GLFW needs to generate synthetic key events, in which case the * scancode may be zero. @@ -2711,19 +1891,8 @@ GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor); * @param[in] window The window whose callback to set. * @param[in] cbfun The new key callback, or `NULL` to remove the currently * set callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref input_key - * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Added window handle parameter. Updated callback signature. + * @return The previously set callback, or `NULL` if no callback was set or an + * error occurred. * * @ingroup input */ @@ -2731,57 +1900,11 @@ GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun); /*! @brief Sets the Unicode character callback. * - * This function sets the character callback of the specified window, which is + * This function sets the character callback of the specific window, which is * called when a Unicode character is input. * - * The character callback is intended for Unicode text input. As it deals with - * characters, it is keyboard layout dependent, whereas the - * [key callback](@ref glfwSetKeyCallback) is not. Characters do not map 1:1 - * to physical keys, as a key may produce zero, one or more characters. If you - * want to know whether a specific physical key was pressed or released, see - * the key callback instead. - * - * The character callback behaves as system text input normally does and will - * not be called if modifier keys are held down that would prevent normal text - * input on that platform, for example a Super (Command) key on OS X or Alt key - * on Windows. There is a - * [character with modifiers callback](@ref glfwSetCharModsCallback) that - * receives these events. - * - * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set - * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref input_char - * - * @par History - * Added in GLFW 2.4. - * - * @par - * __GLFW 3:__ Added window handle parameter. Updated callback signature. - * - * @ingroup input - */ -GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun); - -/*! @brief Sets the Unicode character with modifiers callback. - * - * This function sets the character with modifiers callback of the specified - * window, which is called when a Unicode character is input regardless of what - * modifier keys are used. - * - * The character with modifiers callback is intended for implementing custom - * Unicode character input. For regular Unicode text input, see the - * [character callback](@ref glfwSetCharCallback). Like the character - * callback, the character with modifiers callback deals with characters and is - * keyboard layout dependent. Characters do not map 1:1 to physical keys, as - * a key may produce zero, one or more characters. If you want to know whether - * a specific physical key was pressed or released, see the + * The character callback is intended for text input. If you want to know + * whether a specific key was pressed or released, use the * [key callback](@ref glfwSetKeyCallback) instead. * * @param[in] window The window whose callback to set. @@ -2790,17 +1913,9 @@ GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun); * @return The previously set callback, or `NULL` if no callback was set or an * error occurred. * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref input_char - * - * @par History - * Added in GLFW 3.1. - * * @ingroup input */ -GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmodsfun cbfun); +GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun); /*! @brief Sets the mouse button callback. * @@ -2816,19 +1931,8 @@ GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmods * @param[in] window The window whose callback to set. * @param[in] cbfun The new callback, or `NULL` to remove the currently set * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref input_mouse_button - * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Added window handle parameter. Updated callback signature. + * @return The previously set callback, or `NULL` if no callback was set or an + * error occurred. * * @ingroup input */ @@ -2838,26 +1942,13 @@ GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmo * * This function sets the cursor position callback of the specified window, * which is called when the cursor is moved. The callback is provided with the - * position, in screen coordinates, relative to the upper-left corner of the - * client area of the window. + * position relative to the upper-left corner of the client area of the window. * * @param[in] window The window whose callback to set. * @param[in] cbfun The new callback, or `NULL` to remove the currently set * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref input_cursor_pos - * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Renamed from `glfwSetMousePosCallback`. Added window handle - * parameter. Updated callback signature. + * @return The previously set callback, or `NULL` if no callback was set or an + * error occurred. * * @ingroup input */ @@ -2872,16 +1963,8 @@ GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursor * @param[in] window The window whose callback to set. * @param[in] cbfun The new callback, or `NULL` to remove the currently set * callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref input_cursor_enter - * - * @par History - * Added in GLFW 3.0. + * @return The previously set callback, or `NULL` if no callback was set or an + * error occurred. * * @ingroup input */ @@ -2899,68 +1982,20 @@ GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcu * @param[in] window The window whose callback to set. * @param[in] cbfun The new scroll callback, or `NULL` to remove the currently * set callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref input_scroll - * - * @par History - * Added in GLFW 2.1. - * - * @par - * __GLFW 3:__ Renamed from `glfwSetMouseWheelCallback`. Added window handle. - * Updated callback signature. + * @return The previously set callback, or `NULL` if no callback was set or an + * error occurred. * * @ingroup input */ GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cbfun); -/*! @brief Sets the file drop callback. - * - * This function sets the file drop callback of the specified window, which is - * called when one or more dragged files are dropped on the window. - * - * Because the path array and its strings may have been generated specifically - * for that event, they are not guaranteed to be valid after the callback has - * returned. If you wish to use them after the callback returns, you need to - * make a deep copy. - * - * @param[in] window The window whose callback to set. - * @param[in] cbfun The new file drop callback, or `NULL` to remove the - * currently set callback. - * @return The previously set callback, or `NULL` if no callback was set or the - * library had not been [initialized](@ref intro_init). - * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref input_drop - * - * @par History - * Added in GLFW 3.1. - * - * @ingroup input - */ -GLFWAPI GLFWdropfun glfwSetDropCallback(GLFWwindow* window, GLFWdropfun cbfun); - /*! @brief Returns whether the specified joystick is present. * * This function returns whether the specified joystick is present. * - * @param[in] joy The [joystick](@ref joysticks) to query. + * @param[in] joy The joystick to query. * @return `GL_TRUE` if the joystick is present, or `GL_FALSE` otherwise. * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref input_joy - * - * @par History - * Added in GLFW 3.0. Replaced `glfwGetJoystickParam`. - * * @ingroup input */ GLFWAPI int glfwJoystickPresent(int joy); @@ -2968,29 +2003,17 @@ GLFWAPI int glfwJoystickPresent(int joy); /*! @brief Returns the values of all axes of the specified joystick. * * This function returns the values of all axes of the specified joystick. - * Each element in the array is a value between -1.0 and 1.0. * - * @param[in] joy The [joystick](@ref joysticks) to query. - * @param[out] count Where to store the number of axis values in the returned - * array. This is set to zero if an error occurred. + * @param[in] joy The joystick to query. + * @param[out] count Where to store the size of the returned array. This is + * set to zero if an error occurred. * @return An array of axis values, or `NULL` if the joystick is not present. * - * @par Pointer Lifetime - * The returned array is allocated and freed by GLFW. You should not free it - * yourself. It is valid until the specified joystick is disconnected, this - * function is called again for that joystick or the library is terminated. + * @note The returned array is allocated and freed by GLFW. You should not + * free it yourself. * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref input_joy_axis - * - * @par History - * Added in GLFW 2.2. - * - * @par - * __GLFW 3:__ Renamed from `glfwGetJoystickPos`. Changed to return a dynamic - * array. + * @note The returned array is valid only until the next call to @ref + * glfwGetJoystickAxes for that joystick. * * @ingroup input */ @@ -2999,28 +2022,17 @@ GLFWAPI const float* glfwGetJoystickAxes(int joy, int* count); /*! @brief Returns the state of all buttons of the specified joystick. * * This function returns the state of all buttons of the specified joystick. - * Each element in the array is either `GLFW_PRESS` or `GLFW_RELEASE`. * - * @param[in] joy The [joystick](@ref joysticks) to query. - * @param[out] count Where to store the number of button states in the returned - * array. This is set to zero if an error occurred. + * @param[in] joy The joystick to query. + * @param[out] count Where to store the size of the returned array. This is + * set to zero if an error occurred. * @return An array of button states, or `NULL` if the joystick is not present. * - * @par Pointer Lifetime - * The returned array is allocated and freed by GLFW. You should not free it - * yourself. It is valid until the specified joystick is disconnected, this - * function is called again for that joystick or the library is terminated. + * @note The returned array is allocated and freed by GLFW. You should not + * free it yourself. * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref input_joy_button - * - * @par History - * Added in GLFW 2.2. - * - * @par - * __GLFW 3:__ Changed to return a dynamic array. + * @note The returned array is valid only until the next call to @ref + * glfwGetJoystickButtons for that joystick. * * @ingroup input */ @@ -3029,25 +2041,16 @@ GLFWAPI const unsigned char* glfwGetJoystickButtons(int joy, int* count); /*! @brief Returns the name of the specified joystick. * * This function returns the name, encoded as UTF-8, of the specified joystick. - * The returned string is allocated and freed by GLFW. You should not free it - * yourself. * - * @param[in] joy The [joystick](@ref joysticks) to query. + * @param[in] joy The joystick to query. * @return The UTF-8 encoded name of the joystick, or `NULL` if the joystick * is not present. * - * @par Pointer Lifetime - * The returned string is allocated and freed by GLFW. You should not free it - * yourself. It is valid until the specified joystick is disconnected, this - * function is called again for that joystick or the library is terminated. + * @note The returned string is allocated and freed by GLFW. You should not + * free it yourself. * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref input_joy_name - * - * @par History - * Added in GLFW 3.0. + * @note The returned string is valid only until the next call to @ref + * glfwGetJoystickName for that joystick. * * @ingroup input */ @@ -3056,52 +2059,40 @@ GLFWAPI const char* glfwGetJoystickName(int joy); /*! @brief Sets the clipboard to the specified string. * * This function sets the system clipboard to the specified, UTF-8 encoded - * string. + * string. The string is copied before returning, so you don't have to retain + * it afterwards. * * @param[in] window The window that will own the clipboard contents. * @param[in] string A UTF-8 encoded string. * - * @par Pointer Lifetime - * The specified string is copied before this function returns. + * @note This function may only be called from the main thread. * - * @par Thread Safety - * This function may only be called from the main thread. - * - * @sa @ref input_clipboard * @sa glfwGetClipboardString * - * @par History - * Added in GLFW 3.0. - * - * @ingroup input + * @ingroup clipboard */ GLFWAPI void glfwSetClipboardString(GLFWwindow* window, const char* string); -/*! @brief Returns the contents of the clipboard as a string. +/*! @brief Retrieves the contents of the clipboard as a string. * * This function returns the contents of the system clipboard, if it contains * or is convertible to a UTF-8 encoded string. * * @param[in] window The window that will request the clipboard contents. * @return The contents of the clipboard as a UTF-8 encoded string, or `NULL` - * if an [error](@ref error_handling) occurred. + * if an error occurred. * - * @par Pointer Lifetime - * The returned string is allocated and freed by GLFW. You should not free it - * yourself. It is valid until the next call to @ref - * glfwGetClipboardString or @ref glfwSetClipboardString, or until the library - * is terminated. + * @note This function may only be called from the main thread. * - * @par Thread Safety - * This function may only be called from the main thread. + * @note The returned string is allocated and freed by GLFW. You should not + * free it yourself. + * + * @note The returned string is valid only until the next call to @ref + * glfwGetClipboardString or @ref glfwSetClipboardString. * - * @sa @ref input_clipboard * @sa glfwSetClipboardString * - * @par History - * Added in GLFW 3.0. - * - * @ingroup input + * @ingroup clipboard */ GLFWAPI const char* glfwGetClipboardString(GLFWwindow* window); @@ -3111,22 +2102,15 @@ GLFWAPI const char* glfwGetClipboardString(GLFWwindow* window); * been set using @ref glfwSetTime, the timer measures time elapsed since GLFW * was initialized. * - * The resolution of the timer is system dependent, but is usually on the order - * of a few micro- or nanoseconds. It uses the highest-resolution monotonic - * time source on each supported platform. + * @return The current value, in seconds, or zero if an error occurred. * - * @return The current value, in seconds, or zero if an - * [error](@ref error_handling) occurred. + * @remarks This function may be called from secondary threads. * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. + * @note The resolution of the timer is system dependent, but is usually on the + * order of a few micro- or nanoseconds. It uses the highest-resolution + * monotonic time source on each supported platform. * - * @sa @ref input_time - * - * @par History - * Added in GLFW 1.0. - * - * @ingroup input + * @ingroup time */ GLFWAPI double glfwGetTime(void); @@ -3137,64 +2121,44 @@ GLFWAPI double glfwGetTime(void); * * @param[in] time The new value, in seconds. * - * @par Thread Safety - * This function may only be called from the main thread. + * @note The resolution of the timer is system dependent, but is usually on the + * order of a few micro- or nanoseconds. It uses the highest-resolution + * monotonic time source on each supported platform. * - * @sa @ref input_time - * - * @par History - * Added in GLFW 2.2. - * - * @ingroup input + * @ingroup time */ GLFWAPI void glfwSetTime(double time); /*! @brief Makes the context of the specified window current for the calling * thread. * - * This function makes the OpenGL or OpenGL ES context of the specified window - * current on the calling thread. A context can only be made current on - * a single thread at a time and each thread can have only a single current - * context at a time. - * - * By default, making a context non-current implicitly forces a pipeline flush. - * On machines that support `GL_KHR_context_flush_control`, you can control - * whether a context performs this flush by setting the - * `GLFW_CONTEXT_RELEASE_BEHAVIOR` [window hint](@ref window_hints_ctx). + * This function makes the context of the specified window current on the + * calling thread. A context can only be made current on a single thread at + * a time and each thread can have only a single current context at a time. * * @param[in] window The window whose context to make current, or `NULL` to * detach the current context. * - * @par Thread Safety - * This function may be called from any thread. + * @remarks This function may be called from secondary threads. * - * @sa @ref context_current * @sa glfwGetCurrentContext * - * @par History - * Added in GLFW 3.0. - * * @ingroup context */ GLFWAPI void glfwMakeContextCurrent(GLFWwindow* window); /*! @brief Returns the window whose context is current on the calling thread. * - * This function returns the window whose OpenGL or OpenGL ES context is - * current on the calling thread. + * This function returns the window whose context is current on the calling + * thread. * * @return The window whose context is current, or `NULL` if no window's * context is current. * - * @par Thread Safety - * This function may be called from any thread. + * @remarks This function may be called from secondary threads. * - * @sa @ref context_current * @sa glfwMakeContextCurrent * - * @par History - * Added in GLFW 3.0. - * * @ingroup context */ GLFWAPI GLFWwindow* glfwGetCurrentContext(void); @@ -3207,29 +2171,24 @@ GLFWAPI GLFWwindow* glfwGetCurrentContext(void); * * @param[in] window The window whose buffers to swap. * - * @par Thread Safety - * This function may be called from any thread. + * @remarks This function may be called from secondary threads. + * + * @par New in GLFW 3 + * This function no longer calls @ref glfwPollEvents. You need to call it or + * @ref glfwWaitEvents yourself. * - * @sa @ref window_swap * @sa glfwSwapInterval * - * @par History - * Added in GLFW 1.0. - * - * @par - * __GLFW 3:__ Added window handle parameter. Removed call to @ref - * glfwPollEvents. - * - * @ingroup window + * @ingroup context */ GLFWAPI void glfwSwapBuffers(GLFWwindow* window); /*! @brief Sets the swap interval for the current context. * * This function sets the swap interval for the current context, i.e. the - * number of screen updates to wait from the time @ref glfwSwapBuffers was - * called before swapping the buffers and returning. This is sometimes called - * 'vertical synchronization', 'vertical retrace synchronization' or 'vsync'. + * number of screen updates to wait before swapping the buffers of a window and + * returning from @ref glfwSwapBuffers. This is sometimes called 'vertical + * synchronization', 'vertical retrace synchronization' or 'vsync'. * * Contexts that support either of the `WGL_EXT_swap_control_tear` and * `GLX_EXT_swap_control_tear` extensions also accept negative swap intervals, @@ -3238,30 +2197,17 @@ GLFWAPI void glfwSwapBuffers(GLFWwindow* window); * glfwExtensionSupported. For more information about swap tearing, see the * extension specifications. * - * A context must be current on the calling thread. Calling this function - * without a current context will cause a `GLFW_NO_CURRENT_CONTEXT` error. - * * @param[in] interval The minimum number of screen updates to wait for * until the buffers are swapped by @ref glfwSwapBuffers. * - * @note This function is not called during window 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. + * @remarks This function may be called from secondary threads. * * @note Some GPU drivers do not honor the requested swap interval, either * because of user settings that override the request or due to bugs in the * driver. * - * @par Thread Safety - * This function may be called from any thread. - * - * @sa @ref window_swap * @sa glfwSwapBuffers * - * @par History - * Added in GLFW 1.0. - * * @ingroup context */ GLFWAPI void glfwSwapInterval(int interval); @@ -3269,29 +2215,19 @@ GLFWAPI void glfwSwapInterval(int interval); /*! @brief Returns whether the specified extension is available. * * This function returns whether the specified - * [API extension](@ref context_glext) is supported by the current OpenGL or - * OpenGL ES context. It searches both for OpenGL and OpenGL ES extension and - * platform-specific context creation API extensions. - * - * A context must be current on the calling thread. Calling this function - * without a current context will cause a `GLFW_NO_CURRENT_CONTEXT` error. - * - * 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. + * [OpenGL or context creation API extension](@ref context_glext) is supported + * by the current context. For example, on Windows both the OpenGL and WGL + * extension strings are checked. * * @param[in] extension The ASCII encoded name of the extension. * @return `GL_TRUE` if the extension is available, or `GL_FALSE` otherwise. * - * @par Thread Safety - * This function may be called from any thread. + * @remarks This function may be called from secondary threads. * - * @sa @ref context_glext - * @sa glfwGetProcAddress - * - * @par History - * Added in GLFW 1.0. + * @note As this functions searches one or more extension strings on each call, + * it is recommended that you cache its results if it's 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. * * @ingroup context */ @@ -3304,28 +2240,15 @@ GLFWAPI int glfwExtensionSupported(const char* extension); * [client API or extension function](@ref context_glext), if it is supported * by the current context. * - * A context must be current on the calling thread. Calling this function - * without a current context will cause a `GLFW_NO_CURRENT_CONTEXT` error. - * * @param[in] procname The ASCII encoded name of the function. * @return The address of the function, or `NULL` if the function is - * unavailable or an [error](@ref error_handling) occurred. + * unavailable. * - * @note The addresses of a given function is not guaranteed to be the same - * between contexts. + * @remarks This function may be called from secondary threads. * - * @par Pointer Lifetime - * The returned function pointer is valid until the context is destroyed or the - * library is terminated. - * - * @par Thread Safety - * This function may be called from any thread. - * - * @sa @ref context_glext - * @sa glfwExtensionSupported - * - * @par History - * Added in GLFW 1.0. + * @note The addresses of these functions are not guaranteed to be the same for + * all contexts, especially if they use different client APIs or even different + * context creation hints. * * @ingroup context */ diff --git a/extern/glfw/include/GLFW/glfw3native.h b/extern/glfw/include/GLFW/glfw3native.h index 881f504..d570f58 100644 --- a/extern/glfw/include/GLFW/glfw3native.h +++ b/extern/glfw/include/GLFW/glfw3native.h @@ -1,5 +1,5 @@ /************************************************************************* - * GLFW 3.1 - www.glfw.org + * GLFW 3.0 - www.glfw.org * A library for OpenGL, window and input *------------------------------------------------------------------------ * Copyright (c) 2002-2006 Marcus Geelnard @@ -45,8 +45,8 @@ extern "C" { * using it.** * * Before the inclusion of @ref glfw3native.h, you must define exactly one - * window system API macro and exactly one context creation API macro. Failure - * to do this will cause a compile-time error. + * window API macro and exactly one context API macro. Failure to do this + * will cause a compile-time error. * * The available window API macros are: * * `GLFW_EXPOSE_NATIVE_WIN32` @@ -71,13 +71,8 @@ extern "C" { *************************************************************************/ #if defined(GLFW_EXPOSE_NATIVE_WIN32) - // This is a workaround for the fact that glfw3.h needs to export APIENTRY (for - // example to allow applications to correctly declare a GL_ARB_debug_output - // callback) but windows.h assumes no one will define APIENTRY before it does - #undef APIENTRY #include #elif defined(GLFW_EXPOSE_NATIVE_COCOA) - #include #if defined(__OBJC__) #import #else @@ -85,7 +80,6 @@ extern "C" { #endif #elif defined(GLFW_EXPOSE_NATIVE_X11) #include - #include #else #error "No window API specified" #endif @@ -108,49 +102,8 @@ extern "C" { *************************************************************************/ #if defined(GLFW_EXPOSE_NATIVE_WIN32) -/*! @brief Returns the adapter device name of the specified monitor. - * - * @return The UTF-8 encoded adapter device name (for example `\\.\DISPLAY1`) - * of the specified monitor, or `NULL` if an [error](@ref error_handling) - * occurred. - * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. - * - * @par History - * Added in GLFW 3.1. - * - * @ingroup native - */ -GLFWAPI const char* glfwGetWin32Adapter(GLFWmonitor* monitor); - -/*! @brief Returns the display device name of the specified monitor. - * - * @return The UTF-8 encoded display device name (for example - * `\\.\DISPLAY1\Monitor0`) of the specified monitor, or `NULL` if an - * [error](@ref error_handling) occurred. - * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. - * - * @par History - * Added in GLFW 3.1. - * - * @ingroup native - */ -GLFWAPI const char* glfwGetWin32Monitor(GLFWmonitor* monitor); - /*! @brief Returns the `HWND` of the specified window. - * - * @return The `HWND` of the specified window, or `NULL` if an - * [error](@ref error_handling) occurred. - * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. - * - * @par History - * Added in GLFW 3.0. - * + * @return The `HWND` of the specified window. * @ingroup native */ GLFWAPI HWND glfwGetWin32Window(GLFWwindow* window); @@ -158,48 +111,15 @@ GLFWAPI HWND glfwGetWin32Window(GLFWwindow* window); #if defined(GLFW_EXPOSE_NATIVE_WGL) /*! @brief Returns the `HGLRC` of the specified window. - * - * @return The `HGLRC` of the specified window, or `NULL` if an - * [error](@ref error_handling) occurred. - * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. - * - * @par History - * Added in GLFW 3.0. - * + * @return The `HGLRC` of the specified window. * @ingroup native */ GLFWAPI HGLRC glfwGetWGLContext(GLFWwindow* window); #endif #if defined(GLFW_EXPOSE_NATIVE_COCOA) -/*! @brief Returns the `CGDirectDisplayID` of the specified monitor. - * - * @return The `CGDirectDisplayID` of the specified monitor, or - * `kCGNullDirectDisplay` if an [error](@ref error_handling) occurred. - * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. - * - * @par History - * Added in GLFW 3.1. - * - * @ingroup native - */ -GLFWAPI CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* monitor); - /*! @brief Returns the `NSWindow` of the specified window. - * - * @return The `NSWindow` of the specified window, or `nil` if an - * [error](@ref error_handling) occurred. - * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. - * - * @par History - * Added in GLFW 3.0. - * + * @return The `NSWindow` of the specified window. * @ingroup native */ GLFWAPI id glfwGetCocoaWindow(GLFWwindow* window); @@ -207,16 +127,7 @@ GLFWAPI id glfwGetCocoaWindow(GLFWwindow* window); #if defined(GLFW_EXPOSE_NATIVE_NSGL) /*! @brief Returns the `NSOpenGLContext` of the specified window. - * - * @return The `NSOpenGLContext` of the specified window, or `nil` if an - * [error](@ref error_handling) occurred. - * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. - * - * @par History - * Added in GLFW 3.0. - * + * @return The `NSOpenGLContext` of the specified window. * @ingroup native */ GLFWAPI id glfwGetNSGLContext(GLFWwindow* window); @@ -224,61 +135,12 @@ GLFWAPI id glfwGetNSGLContext(GLFWwindow* window); #if defined(GLFW_EXPOSE_NATIVE_X11) /*! @brief Returns the `Display` used by GLFW. - * - * @return The `Display` used by GLFW, or `NULL` if an - * [error](@ref error_handling) occurred. - * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. - * - * @par History - * Added in GLFW 3.0. - * + * @return The `Display` used by GLFW. * @ingroup native */ GLFWAPI Display* glfwGetX11Display(void); - -/*! @brief Returns the `RRCrtc` of the specified monitor. - * - * @return The `RRCrtc` of the specified monitor, or `None` if an - * [error](@ref error_handling) occurred. - * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. - * - * @par History - * Added in GLFW 3.1. - * - * @ingroup native - */ -GLFWAPI RRCrtc glfwGetX11Adapter(GLFWmonitor* monitor); - -/*! @brief Returns the `RROutput` of the specified monitor. - * - * @return The `RROutput` of the specified monitor, or `None` if an - * [error](@ref error_handling) occurred. - * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. - * - * @par History - * Added in GLFW 3.1. - * - * @ingroup native - */ -GLFWAPI RROutput glfwGetX11Monitor(GLFWmonitor* monitor); - /*! @brief Returns the `Window` of the specified window. - * - * @return The `Window` of the specified window, or `None` if an - * [error](@ref error_handling) occurred. - * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. - * - * @par History - * Added in GLFW 3.0. - * + * @return The `Window` of the specified window. * @ingroup native */ GLFWAPI Window glfwGetX11Window(GLFWwindow* window); @@ -286,16 +148,7 @@ GLFWAPI Window glfwGetX11Window(GLFWwindow* window); #if defined(GLFW_EXPOSE_NATIVE_GLX) /*! @brief Returns the `GLXContext` of the specified window. - * - * @return The `GLXContext` of the specified window, or `NULL` if an - * [error](@ref error_handling) occurred. - * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. - * - * @par History - * Added in GLFW 3.0. - * + * @return The `GLXContext` of the specified window. * @ingroup native */ GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* window); @@ -303,46 +156,17 @@ GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* window); #if defined(GLFW_EXPOSE_NATIVE_EGL) /*! @brief Returns the `EGLDisplay` used by GLFW. - * - * @return The `EGLDisplay` used by GLFW, or `EGL_NO_DISPLAY` if an - * [error](@ref error_handling) occurred. - * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. - * - * @par History - * Added in GLFW 3.0. - * + * @return The `EGLDisplay` used by GLFW. * @ingroup native */ GLFWAPI EGLDisplay glfwGetEGLDisplay(void); - /*! @brief Returns the `EGLContext` of the specified window. - * - * @return The `EGLContext` of the specified window, or `EGL_NO_CONTEXT` if an - * [error](@ref error_handling) occurred. - * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. - * - * @par History - * Added in GLFW 3.0. - * + * @return The `EGLContext` of the specified window. * @ingroup native */ GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* window); - /*! @brief Returns the `EGLSurface` of the specified window. - * - * @return The `EGLSurface` of the specified window, or `EGL_NO_SURFACE` if an - * [error](@ref error_handling) occurred. - * - * @par Thread Safety - * This function may be called from any thread. Access is not synchronized. - * - * @par History - * Added in GLFW 3.0. - * + * @return The `EGLSurface` of the specified window. * @ingroup native */ GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* window); diff --git a/extern/glfw/src/CMakeLists.txt b/extern/glfw/src/CMakeLists.txt index 9ba9fc5..6817192 100644 --- a/extern/glfw/src/CMakeLists.txt +++ b/extern/glfw/src/CMakeLists.txt @@ -1,53 +1,42 @@ -include_directories("${GLFW_SOURCE_DIR}/src" - "${GLFW_BINARY_DIR}/src" +include_directories(${GLFW_SOURCE_DIR}/src + ${GLFW_BINARY_DIR}/src ${glfw_INCLUDE_DIRS}) -add_definitions(-D_GLFW_USE_CONFIG_H) - -set(common_HEADERS "${GLFW_BINARY_DIR}/src/glfw_config.h" internal.h - "${GLFW_SOURCE_DIR}/include/GLFW/glfw3.h" - "${GLFW_SOURCE_DIR}/include/GLFW/glfw3native.h") -set(common_SOURCES context.c init.c input.c monitor.c window.c) +set(common_HEADERS ${GLFW_BINARY_DIR}/src/config.h internal.h + ${GLFW_SOURCE_DIR}/include/GLFW/glfw3.h + ${GLFW_SOURCE_DIR}/include/GLFW/glfw3native.h) +set(common_SOURCES clipboard.c context.c gamma.c init.c input.c joystick.c + monitor.c time.c window.c) if (_GLFW_COCOA) - set(glfw_HEADERS ${common_HEADERS} cocoa_platform.h iokit_joystick.h - posix_tls.h) - set(glfw_SOURCES ${common_SOURCES} cocoa_init.m cocoa_monitor.m - cocoa_window.m iokit_joystick.m mach_time.c posix_tls.c) + set(glfw_HEADERS ${common_HEADERS} cocoa_platform.h) + set(glfw_SOURCES ${common_SOURCES} cocoa_clipboard.m cocoa_gamma.c + cocoa_init.m cocoa_joystick.m cocoa_monitor.m cocoa_time.c + cocoa_window.m) elseif (_GLFW_WIN32) - set(glfw_HEADERS ${common_HEADERS} win32_platform.h win32_tls.h - winmm_joystick.h) - set(glfw_SOURCES ${common_SOURCES} win32_init.c win32_monitor.c win32_time.c - win32_tls.c win32_window.c winmm_joystick.c) + set(glfw_HEADERS ${common_HEADERS} win32_platform.h) + set(glfw_SOURCES ${common_SOURCES} win32_clipboard.c win32_gamma.c + win32_init.c win32_joystick.c win32_monitor.c win32_time.c + win32_window.c) elseif (_GLFW_X11) - set(glfw_HEADERS ${common_HEADERS} x11_platform.h xkb_unicode.h - linux_joystick.h posix_time.h posix_tls.h) - set(glfw_SOURCES ${common_SOURCES} x11_init.c x11_monitor.c x11_window.c - xkb_unicode.c linux_joystick.c posix_time.c posix_tls.c) -elseif (_GLFW_WAYLAND) - set(glfw_HEADERS ${common_HEADERS} wl_platform.h linux_joystick.h - posix_time.h posix_tls.h xkb_unicode.h) - set(glfw_SOURCES ${common_SOURCES} wl_init.c wl_monitor.c wl_window.c - linux_joystick.c posix_time.c posix_tls.c xkb_unicode.c) -elseif (_GLFW_MIR) - set(glfw_HEADERS ${common_HEADERS} mir_platform.h linux_joystick.h - posix_time.h posix_tls.h xkb_unicode.h) - set(glfw_SOURCES ${common_SOURCES} mir_init.c mir_monitor.c mir_window.c - linux_joystick.c posix_time.c posix_tls.c xkb_unicode.c) + set(glfw_HEADERS ${common_HEADERS} x11_platform.h) + set(glfw_SOURCES ${common_SOURCES} x11_clipboard.c x11_gamma.c x11_init.c + x11_joystick.c x11_monitor.c x11_time.c x11_window.c + x11_unicode.c) endif() if (_GLFW_EGL) - list(APPEND glfw_HEADERS ${common_HEADERS} egl_context.h) + list(APPEND glfw_HEADERS ${common_HEADERS} egl_platform.h) list(APPEND glfw_SOURCES ${common_SOURCES} egl_context.c) elseif (_GLFW_NSGL) - list(APPEND glfw_HEADERS ${common_HEADERS} nsgl_context.h) + list(APPEND glfw_HEADERS ${common_HEADERS} nsgl_platform.h) list(APPEND glfw_SOURCES ${common_SOURCES} nsgl_context.m) elseif (_GLFW_WGL) - list(APPEND glfw_HEADERS ${common_HEADERS} wgl_context.h) + list(APPEND glfw_HEADERS ${common_HEADERS} wgl_platform.h) list(APPEND glfw_SOURCES ${common_SOURCES} wgl_context.c) elseif (_GLFW_X11) - list(APPEND glfw_HEADERS ${common_HEADERS} glx_context.h) + list(APPEND glfw_HEADERS ${common_HEADERS} glx_platform.h) list(APPEND glfw_SOURCES ${common_SOURCES} glx_context.c) endif() @@ -57,8 +46,7 @@ if (APPLE) endif() add_library(glfw ${glfw_SOURCES} ${glfw_HEADERS}) -set_target_properties(glfw PROPERTIES OUTPUT_NAME "${GLFW_LIB_NAME}" - POSITION_INDEPENDENT_CODE ON) +set_target_properties(glfw PROPERTIES OUTPUT_NAME "${GLFW_LIB_NAME}") if (BUILD_SHARED_LIBS) # Include version information in the output @@ -84,11 +72,11 @@ if (BUILD_SHARED_LIBS) set(glfw_CFLAGS "") endif() set_target_properties(glfw PROPERTIES - COMPILE_FLAGS "${glfw_CFLAGS} -fno-common" - INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}") + COMPILE_FLAGS "${glfw_CFLAGS} -fno-common") endif() target_link_libraries(glfw ${glfw_LIBRARIES}) + target_link_libraries(glfw LINK_INTERFACE_LIBRARIES) endif() if (GLFW_INSTALL) diff --git a/extern/glfw/src/posix_tls.h b/extern/glfw/src/clipboard.c similarity index 58% rename from extern/glfw/src/posix_tls.h rename to extern/glfw/src/clipboard.c index d6fa000..f28c5c6 100644 --- a/extern/glfw/src/posix_tls.h +++ b/extern/glfw/src/clipboard.c @@ -1,8 +1,7 @@ //======================================================================== -// GLFW 3.1 POSIX - www.glfw.org +// GLFW 3.0 - www.glfw.org //------------------------------------------------------------------------ -// Copyright (c) 2002-2006 Marcus Geelnard -// Copyright (c) 2006-2010 Camilla Berglund +// Copyright (c) 2010 Camilla Berglund // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages @@ -25,25 +24,27 @@ // //======================================================================== -#ifndef _posix_tls_h_ -#define _posix_tls_h_ +#include "internal.h" -#include - -#define _GLFW_PLATFORM_LIBRARY_TLS_STATE _GLFWtlsPOSIX posix_tls +#include +#include -// POSIX-specific global TLS data -// -typedef struct _GLFWtlsPOSIX +////////////////////////////////////////////////////////////////////////// +////// GLFW public API ////// +////////////////////////////////////////////////////////////////////////// + +GLFWAPI void glfwSetClipboardString(GLFWwindow* handle, const char* string) { - pthread_key_t context; + _GLFWwindow* window = (_GLFWwindow*) handle; + _GLFW_REQUIRE_INIT(); + _glfwPlatformSetClipboardString(window, string); +} -} _GLFWtlsPOSIX; +GLFWAPI const char* glfwGetClipboardString(GLFWwindow* handle) +{ + _GLFWwindow* window = (_GLFWwindow*) handle; + _GLFW_REQUIRE_INIT_OR_RETURN(NULL); + return _glfwPlatformGetClipboardString(window); +} - -int _glfwInitTLS(void); -void _glfwTerminateTLS(void); -void _glfwSetCurrentContext(_GLFWwindow* context); - -#endif // _posix_tls_h_ diff --git a/extern/glfw/src/posix_tls.c b/extern/glfw/src/cocoa_clipboard.m similarity index 56% rename from extern/glfw/src/posix_tls.c rename to extern/glfw/src/cocoa_clipboard.m index 70fe19b..a58eb5c 100644 --- a/extern/glfw/src/posix_tls.c +++ b/extern/glfw/src/cocoa_clipboard.m @@ -1,8 +1,7 @@ //======================================================================== -// GLFW 3.1 POSIX - www.glfw.org +// GLFW 3.0 OS X - www.glfw.org //------------------------------------------------------------------------ -// Copyright (c) 2002-2006 Marcus Geelnard -// Copyright (c) 2006-2010 Camilla Berglund +// Copyright (c) 2010 Camilla Berglund // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages @@ -27,40 +26,45 @@ #include "internal.h" - -////////////////////////////////////////////////////////////////////////// -////// GLFW internal API ////// -////////////////////////////////////////////////////////////////////////// - -int _glfwInitTLS(void) -{ - if (pthread_key_create(&_glfw.posix_tls.context, NULL) != 0) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "POSIX: Failed to create context TLS"); - return GL_FALSE; - } - - return GL_TRUE; -} - -void _glfwTerminateTLS(void) -{ - pthread_key_delete(_glfw.posix_tls.context); -} - -void _glfwSetCurrentContext(_GLFWwindow* context) -{ - pthread_setspecific(_glfw.posix_tls.context, context); -} +#include +#include ////////////////////////////////////////////////////////////////////////// ////// GLFW platform API ////// ////////////////////////////////////////////////////////////////////////// -_GLFWwindow* _glfwPlatformGetCurrentContext(void) +void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string) { - return pthread_getspecific(_glfw.posix_tls.context); + NSArray* types = [NSArray arrayWithObjects:NSStringPboardType, nil]; + + NSPasteboard* pasteboard = [NSPasteboard generalPasteboard]; + [pasteboard declareTypes:types owner:nil]; + [pasteboard setString:[NSString stringWithUTF8String:string] + forType:NSStringPboardType]; +} + +const char* _glfwPlatformGetClipboardString(_GLFWwindow* window) +{ + NSPasteboard* pasteboard = [NSPasteboard generalPasteboard]; + + if (![[pasteboard types] containsObject:NSStringPboardType]) + { + _glfwInputError(GLFW_FORMAT_UNAVAILABLE, NULL); + return NULL; + } + + NSString* object = [pasteboard stringForType:NSStringPboardType]; + if (!object) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "Cocoa: Failed to retrieve object from pasteboard"); + return NULL; + } + + free(_glfw.ns.clipboardString); + _glfw.ns.clipboardString = strdup([object UTF8String]); + + return _glfw.ns.clipboardString; } diff --git a/extern/glfw/src/cocoa_gamma.c b/extern/glfw/src/cocoa_gamma.c new file mode 100644 index 0000000..f2905f4 --- /dev/null +++ b/extern/glfw/src/cocoa_gamma.c @@ -0,0 +1,84 @@ +//======================================================================== +// GLFW 3.0 OS X - www.glfw.org +//------------------------------------------------------------------------ +// Copyright (c) 2010 Camilla Berglund +// +// 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. +// +//======================================================================== + +#include "internal.h" + +#include +#include +#include + +#include + + +////////////////////////////////////////////////////////////////////////// +////// GLFW platform API ////// +////////////////////////////////////////////////////////////////////////// + +void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp) +{ + uint32_t i, size = CGDisplayGammaTableCapacity(monitor->ns.displayID); + CGGammaValue* values = calloc(size * 3, sizeof(CGGammaValue)); + + CGGetDisplayTransferByTable(monitor->ns.displayID, + size, + values, + values + size, + values + size * 2, + &size); + + _glfwAllocGammaArrays(ramp, size); + + for (i = 0; i < size; i++) + { + ramp->red[i] = (unsigned short) (values[i] * 65535); + ramp->green[i] = (unsigned short) (values[i + size] * 65535); + ramp->blue[i] = (unsigned short) (values[i + size * 2] * 65535); + } + + free(values); +} + +void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp) +{ + int i; + CGGammaValue* values = calloc(ramp->size * 3, sizeof(CGGammaValue)); + + for (i = 0; i < ramp->size; i++) + { + values[i] = ramp->red[i] / 65535.f; + values[i + ramp->size] = ramp->green[i] / 65535.f; + values[i + ramp->size * 2] = ramp->blue[i] / 65535.f; + } + + CGSetDisplayTransferByTable(monitor->ns.displayID, + ramp->size, + values, + values + ramp->size, + values + ramp->size * 2); + + free(values); +} + diff --git a/extern/glfw/src/cocoa_init.m b/extern/glfw/src/cocoa_init.m index afb1a54..9c2813f 100644 --- a/extern/glfw/src/cocoa_init.m +++ b/extern/glfw/src/cocoa_init.m @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 OS X - www.glfw.org +// GLFW 3.0 OS X - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2009-2010 Camilla Berglund // @@ -122,7 +122,7 @@ void _glfwPlatformTerminate(void) const char* _glfwPlatformGetVersionString(void) { - const char* version = _GLFW_VERSION_NUMBER " Cocoa" + const char* version = _GLFW_VERSION_FULL " Cocoa" #if defined(_GLFW_NSGL) " NSGL" #endif @@ -132,9 +132,6 @@ const char* _glfwPlatformGetVersionString(void) #if defined(_GLFW_USE_MENUBAR) " menubar" #endif -#if defined(_GLFW_USE_RETINA) - " retina" -#endif #if defined(_GLFW_BUILD_DLL) " dynamic" #endif diff --git a/extern/glfw/src/iokit_joystick.m b/extern/glfw/src/cocoa_joystick.m similarity index 87% rename from extern/glfw/src/iokit_joystick.m rename to extern/glfw/src/cocoa_joystick.m index 5ff67dd..6824726 100644 --- a/extern/glfw/src/iokit_joystick.m +++ b/extern/glfw/src/cocoa_joystick.m @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 IOKit - www.glfw.org +// GLFW 3.0 OS X - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2009-2010 Camilla Berglund // Copyright (c) 2012 Torsten Walluhn @@ -58,7 +58,7 @@ static void getElementsCFArrayHandler(const void* value, void* parameter); // Adds an element to the specified joystick // -static void addJoystickElement(_GLFWjoystickIOKit* joystick, CFTypeRef elementRef) +static void addJoystickElement(_GLFWjoy* joystick, CFTypeRef elementRef) { long elementType, usagePage, usage; CFMutableArrayRef elementsArray = NULL; @@ -146,12 +146,12 @@ static void addJoystickElement(_GLFWjoystickIOKit* joystick, CFTypeRef elementRe static void getElementsCFArrayHandler(const void* value, void* parameter) { if (CFGetTypeID(value) == CFDictionaryGetTypeID()) - addJoystickElement((_GLFWjoystickIOKit*) parameter, (CFTypeRef) value); + addJoystickElement((_GLFWjoy*) parameter, (CFTypeRef) value); } // Returns the value of the specified element of the specified joystick // -static long getElementValue(_GLFWjoystickIOKit* joystick, _GLFWjoyelement* element) +static long getElementValue(_GLFWjoy* joystick, _GLFWjoyelement* element) { IOReturn result = kIOReturnSuccess; IOHIDEventStruct hidEvent; @@ -178,7 +178,7 @@ static long getElementValue(_GLFWjoystickIOKit* joystick, _GLFWjoyelement* eleme // Removes the specified joystick // -static void removeJoystick(_GLFWjoystickIOKit* joystick) +static void removeJoystick(_GLFWjoy* joystick) { int i; @@ -203,14 +203,14 @@ static void removeJoystick(_GLFWjoystickIOKit* joystick) (*(joystick->interface))->close(joystick->interface); (*(joystick->interface))->Release(joystick->interface); - memset(joystick, 0, sizeof(_GLFWjoystickIOKit)); + memset(joystick, 0, sizeof(_GLFWjoy)); } // Callback for user-initiated joystick removal // static void removalCallback(void* target, IOReturn result, void* refcon, void* sender) { - removeJoystick((_GLFWjoystickIOKit*) refcon); + removeJoystick((_GLFWjoy*) refcon); } // Polls for joystick events and updates GLFW state @@ -223,7 +223,7 @@ static void pollJoystickEvents(void) { CFIndex i; int buttonIndex = 0; - _GLFWjoystickIOKit* joystick = _glfw.iokit_js + joy; + _GLFWjoy* joystick = _glfw.ns.joysticks + joy; if (!joystick->present) continue; @@ -251,6 +251,9 @@ static void pollJoystickEvents(void) joystick->axes[i] = value; else joystick->axes[i] = (2.f * (value - axis->minReport) / readScale) - 1.f; + + if (i & 1) + joystick->axes[i] = -joystick->axes[i]; } for (i = 0; i < CFArrayGetCount(joystick->hatElements); i++) @@ -316,58 +319,52 @@ void _glfwInitJoysticks(void) while ((ioHIDDeviceObject = IOIteratorNext(objectIterator))) { - CFMutableDictionaryRef propsRef = NULL; - CFTypeRef valueRef = NULL; kern_return_t result; + CFTypeRef valueRef = 0; IOCFPlugInInterface** ppPlugInInterface = NULL; HRESULT plugInResult = S_OK; SInt32 score = 0; - long usagePage = 0; - long usage = 0; + long usagePage, usage; + // Check device type valueRef = IORegistryEntryCreateCFProperty(ioHIDDeviceObject, CFSTR(kIOHIDPrimaryUsagePageKey), - kCFAllocatorDefault, kNilOptions); + kCFAllocatorDefault, + kNilOptions); if (valueRef) { CFNumberGetValue(valueRef, kCFNumberLongType, &usagePage); + if (usagePage != kHIDPage_GenericDesktop) + { + // This device is not relevant to GLFW + continue; + } + CFRelease(valueRef); } valueRef = IORegistryEntryCreateCFProperty(ioHIDDeviceObject, CFSTR(kIOHIDPrimaryUsageKey), - kCFAllocatorDefault, kNilOptions); + kCFAllocatorDefault, + kNilOptions); if (valueRef) { CFNumberGetValue(valueRef, kCFNumberLongType, &usage); + + if ((usage != kHIDUsage_GD_Joystick && + usage != kHIDUsage_GD_GamePad && + usage != kHIDUsage_GD_MultiAxisController)) + { + // This device is not relevant to GLFW + continue; + } + CFRelease(valueRef); } - if (usagePage != kHIDPage_GenericDesktop) - { - // This device is not relevant to GLFW - continue; - } - - if ((usage != kHIDUsage_GD_Joystick && - usage != kHIDUsage_GD_GamePad && - usage != kHIDUsage_GD_MultiAxisController)) - { - // This device is not relevant to GLFW - continue; - } - - result = IORegistryEntryCreateCFProperties(ioHIDDeviceObject, - &propsRef, - kCFAllocatorDefault, - kNilOptions); - - if (result != kIOReturnSuccess) - continue; - - _GLFWjoystickIOKit* joystick = _glfw.iokit_js + joy; + _GLFWjoy* joystick = _glfw.ns.joysticks + joy; joystick->present = GL_TRUE; result = IOCreatePlugInInterfaceForService(ioHIDDeviceObject, @@ -377,10 +374,7 @@ void _glfwInitJoysticks(void) &score); if (kIOReturnSuccess != result) - { - CFRelease(propsRef); return; - } plugInResult = (*ppPlugInInterface)->QueryInterface( ppPlugInInterface, @@ -388,10 +382,7 @@ void _glfwInitJoysticks(void) (void *) &(joystick->interface)); if (plugInResult != S_OK) - { - CFRelease(propsRef); return; - } (*ppPlugInInterface)->Release(ppPlugInInterface); @@ -402,20 +393,27 @@ void _glfwInitJoysticks(void) joystick); // Get product string - valueRef = CFDictionaryGetValue(propsRef, CFSTR(kIOHIDProductKey)); + valueRef = IORegistryEntryCreateCFProperty(ioHIDDeviceObject, + CFSTR(kIOHIDProductKey), + kCFAllocatorDefault, + kNilOptions); if (valueRef) { CFStringGetCString(valueRef, joystick->name, sizeof(joystick->name), kCFStringEncodingUTF8); + CFRelease(valueRef); } joystick->axisElements = CFArrayCreateMutable(NULL, 0, NULL); joystick->buttonElements = CFArrayCreateMutable(NULL, 0, NULL); joystick->hatElements = CFArrayCreateMutable(NULL, 0, NULL); - valueRef = CFDictionaryGetValue(propsRef, CFSTR(kIOHIDElementKey)); + valueRef = IORegistryEntryCreateCFProperty(ioHIDDeviceObject, + CFSTR(kIOHIDElementKey), + kCFAllocatorDefault, + kNilOptions); if (CFGetTypeID(valueRef) == CFArrayGetTypeID()) { CFRange range = { 0, CFArrayGetCount(valueRef) }; @@ -423,10 +421,9 @@ void _glfwInitJoysticks(void) range, getElementsCFArrayHandler, (void*) joystick); + CFRelease(valueRef); } - CFRelease(propsRef); - joystick->axes = calloc(CFArrayGetCount(joystick->axisElements), sizeof(float)); joystick->buttons = calloc(CFArrayGetCount(joystick->buttonElements) + @@ -446,15 +443,8 @@ void _glfwTerminateJoysticks(void) for (i = 0; i < GLFW_JOYSTICK_LAST + 1; i++) { - _GLFWjoystickIOKit* joystick = &_glfw.iokit_js[i]; + _GLFWjoy* joystick = &_glfw.ns.joysticks[i]; removeJoystick(joystick); - - if (joystick->axisElements) - CFRelease(joystick->axisElements); - if (joystick->buttonElements) - CFRelease(joystick->buttonElements); - if (joystick->hatElements) - CFRelease(joystick->hatElements); } } @@ -467,12 +457,12 @@ int _glfwPlatformJoystickPresent(int joy) { pollJoystickEvents(); - return _glfw.iokit_js[joy].present; + return _glfw.ns.joysticks[joy].present; } const float* _glfwPlatformGetJoystickAxes(int joy, int* count) { - _GLFWjoystickIOKit* joystick = _glfw.iokit_js + joy; + _GLFWjoy* joystick = _glfw.ns.joysticks + joy; pollJoystickEvents(); @@ -485,7 +475,7 @@ const float* _glfwPlatformGetJoystickAxes(int joy, int* count) const unsigned char* _glfwPlatformGetJoystickButtons(int joy, int* count) { - _GLFWjoystickIOKit* joystick = _glfw.iokit_js + joy; + _GLFWjoy* joystick = _glfw.ns.joysticks + joy; pollJoystickEvents(); @@ -501,6 +491,6 @@ const char* _glfwPlatformGetJoystickName(int joy) { pollJoystickEvents(); - return _glfw.iokit_js[joy].name; + return _glfw.ns.joysticks[joy].name; } diff --git a/extern/glfw/src/cocoa_monitor.m b/extern/glfw/src/cocoa_monitor.m index cfb76a7..190c1cd 100644 --- a/extern/glfw/src/cocoa_monitor.m +++ b/extern/glfw/src/cocoa_monitor.m @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 OS X - www.glfw.org +// GLFW 3.0 OS X - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -27,38 +27,28 @@ #include "internal.h" -#include #include #include #include -#include -#include -#include -#include // Get the name of the specified display // -static char* getDisplayName(CGDirectDisplayID displayID) +static const char* getDisplayName(CGDirectDisplayID displayID) { char* name; CFDictionaryRef info, names; CFStringRef value; CFIndex size; - // NOTE: This uses a deprecated function because Apple has - // (as of September 2014) not provided any alternative info = IODisplayCreateInfoDictionary(CGDisplayIOServicePort(displayID), kIODisplayOnlyPreferredName); names = CFDictionaryGetValue(info, CFSTR(kDisplayProductName)); - if (!names || !CFDictionaryGetValueIfPresent(names, CFSTR("en_US"), - (const void**) &value)) + if (!CFDictionaryGetValueIfPresent(names, CFSTR("en_US"), + (const void**) &value)) { - // This may happen if a desktop Mac is running headless - _glfwInputError(GLFW_PLATFORM_ERROR, "Failed to retrieve display name"); - CFRelease(info); return strdup("Unknown"); } @@ -84,6 +74,9 @@ static GLboolean modeIsGood(CGDisplayModeRef mode) if (flags & kDisplayModeInterlacedFlag) return GL_FALSE; + if (flags & kDisplayModeTelevisionFlag) + return GL_FALSE; + if (flags & kDisplayModeStretchedFlag) return GL_FALSE; @@ -101,21 +94,13 @@ static GLboolean modeIsGood(CGDisplayModeRef mode) // Convert Core Graphics display mode to GLFW video mode // -static GLFWvidmode vidmodeFromCGDisplayMode(CGDisplayModeRef mode, - CVDisplayLinkRef link) +static GLFWvidmode vidmodeFromCGDisplayMode(CGDisplayModeRef mode) { GLFWvidmode result; - result.width = (int) CGDisplayModeGetWidth(mode); - result.height = (int) CGDisplayModeGetHeight(mode); + result.width = CGDisplayModeGetWidth(mode); + result.height = CGDisplayModeGetHeight(mode); result.refreshRate = (int) CGDisplayModeGetRefreshRate(mode); - if (result.refreshRate == 0) - { - const CVTime time = CVDisplayLinkGetNominalOutputVideoRefreshPeriod(link); - if (!(time.flags & kCVTimeIsIndefinite)) - result.refreshRate = (int) (time.timeScale / (double) time.timeValue); - } - CFStringRef format = CGDisplayModeCopyPixelEncoding(mode); if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) == 0) @@ -167,58 +152,74 @@ static void endFadeReservation(CGDisplayFadeReservationToken token) // GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired) { + CGDisplayModeRef bestMode = NULL; CFArrayRef modes; CFIndex count, i; - CVDisplayLinkRef link; - CGDisplayModeRef native = NULL; - GLFWvidmode current; - const GLFWvidmode* best; - - best = _glfwChooseVideoMode(monitor, desired); - _glfwPlatformGetVideoMode(monitor, ¤t); - if (_glfwCompareVideoModes(¤t, best) == 0) - return GL_TRUE; - - CVDisplayLinkCreateWithCGDisplay(monitor->ns.displayID, &link); + unsigned int sizeDiff, leastSizeDiff = UINT_MAX; + unsigned int rateDiff, leastRateDiff = UINT_MAX; + const int bpp = desired->redBits - desired->greenBits - desired->blueBits; modes = CGDisplayCopyAllDisplayModes(monitor->ns.displayID, NULL); count = CFArrayGetCount(modes); for (i = 0; i < count; i++) { - CGDisplayModeRef dm = (CGDisplayModeRef) CFArrayGetValueAtIndex(modes, i); - if (!modeIsGood(dm)) + CGDisplayModeRef mode = (CGDisplayModeRef) CFArrayGetValueAtIndex(modes, i); + if (!modeIsGood(mode)) continue; - const GLFWvidmode mode = vidmodeFromCGDisplayMode(dm, link); - if (_glfwCompareVideoModes(best, &mode) == 0) + int modeBPP; + + // Identify display mode pixel encoding { - native = dm; - break; + CFStringRef format = CGDisplayModeCopyPixelEncoding(mode); + + if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) == 0) + modeBPP = 16; + else + modeBPP = 32; + + CFRelease(format); + } + + const int modeWidth = (int) CGDisplayModeGetWidth(mode); + const int modeHeight = (int) CGDisplayModeGetHeight(mode); + const int modeRate = (int) CGDisplayModeGetRefreshRate(mode); + + sizeDiff = (abs(modeBPP - bpp) << 25) | + ((modeWidth - desired->width) * (modeWidth - desired->width) + + (modeHeight - desired->height) * (modeHeight - desired->height)); + + if (desired->refreshRate) + rateDiff = abs(modeRate - desired->refreshRate); + else + rateDiff = UINT_MAX - modeRate; + + if ((sizeDiff < leastSizeDiff) || + (sizeDiff == leastSizeDiff && rateDiff < leastRateDiff)) + { + bestMode = mode; + leastSizeDiff = sizeDiff; + leastRateDiff = rateDiff; } } - if (native) + if (!bestMode) { - if (monitor->ns.previousMode == NULL) - monitor->ns.previousMode = CGDisplayCopyDisplayMode(monitor->ns.displayID); - - CGDisplayFadeReservationToken token = beginFadeReservation(); - CGDisplayCapture(monitor->ns.displayID); - CGDisplaySetDisplayMode(monitor->ns.displayID, native, NULL); - endFadeReservation(token); - } - - CFRelease(modes); - CVDisplayLinkRelease(link); - - if (!native) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Cocoa: Monitor mode list changed"); + CFRelease(modes); return GL_FALSE; } + monitor->ns.previousMode = CGDisplayCopyDisplayMode(monitor->ns.displayID); + + CGDisplayFadeReservationToken token = beginFadeReservation(); + + CGDisplayCapture(monitor->ns.displayID); + CGDisplaySetDisplayMode(monitor->ns.displayID, bestMode, NULL); + + endFadeReservation(token); + + CFRelease(modes); return GL_TRUE; } @@ -226,17 +227,12 @@ GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired) // void _glfwRestoreVideoMode(_GLFWmonitor* monitor) { - if (monitor->ns.previousMode) - { - CGDisplayFadeReservationToken token = beginFadeReservation(); - CGDisplaySetDisplayMode(monitor->ns.displayID, - monitor->ns.previousMode, NULL); - CGDisplayRelease(monitor->ns.displayID); - endFadeReservation(token); + CGDisplayFadeReservationToken token = beginFadeReservation(); - CGDisplayModeRelease(monitor->ns.previousMode); - monitor->ns.previousMode = NULL; - } + CGDisplaySetDisplayMode(monitor->ns.displayID, monitor->ns.previousMode, NULL); + CGDisplayRelease(monitor->ns.displayID); + + endFadeReservation(token); } @@ -246,65 +242,75 @@ void _glfwRestoreVideoMode(_GLFWmonitor* monitor) _GLFWmonitor** _glfwPlatformGetMonitors(int* count) { - uint32_t i, found = 0, displayCount; + uint32_t i, found = 0, monitorCount; _GLFWmonitor** monitors; CGDirectDisplayID* displays; *count = 0; - CGGetOnlineDisplayList(0, NULL, &displayCount); + CGGetActiveDisplayList(0, NULL, &monitorCount); - displays = calloc(displayCount, sizeof(CGDirectDisplayID)); - monitors = calloc(displayCount, sizeof(_GLFWmonitor*)); + displays = calloc(monitorCount, sizeof(CGDirectDisplayID)); + monitors = calloc(monitorCount, sizeof(_GLFWmonitor*)); - CGGetOnlineDisplayList(displayCount, displays, &displayCount); + CGGetActiveDisplayList(monitorCount, displays, &monitorCount); + + for (i = 0; i < monitorCount; i++) + { + const CGSize size = CGDisplayScreenSize(displays[i]); + + monitors[found] = _glfwCreateMonitor(getDisplayName(displays[i]), + size.width, size.height); + + monitors[found]->ns.displayID = displays[i]; + found++; + } + + free(displays); + + for (i = 0; i < monitorCount; i++) + { + if (CGDisplayIsMain(monitors[i]->ns.displayID)) + { + _GLFWmonitor* temp = monitors[0]; + monitors[0] = monitors[i]; + monitors[i] = temp; + break; + } + } NSArray* screens = [NSScreen screens]; - for (i = 0; i < displayCount; i++) + for (i = 0; i < monitorCount; i++) { int j; - if (CGDisplayIsAsleep(displays[i])) - continue; - - CGDirectDisplayID screenDisplayID = CGDisplayMirrorsDisplay(displays[i]); - if (screenDisplayID == kCGNullDirectDisplay) - screenDisplayID = displays[i]; - - const CGSize size = CGDisplayScreenSize(displays[i]); - char* name = getDisplayName(displays[i]); - - monitors[found] = _glfwAllocMonitor(name, size.width, size.height); - monitors[found]->ns.displayID = displays[i]; - - free(name); - for (j = 0; j < [screens count]; j++) { NSScreen* screen = [screens objectAtIndex:j]; NSDictionary* dictionary = [screen deviceDescription]; NSNumber* number = [dictionary objectForKey:@"NSScreenNumber"]; - if ([number unsignedIntegerValue] == screenDisplayID) + if (monitors[i]->ns.displayID == [number unsignedIntegerValue]) { - monitors[found]->ns.screen = screen; + monitors[i]->ns.screen = screen; break; } } - if (monitors[found]->ns.screen) - found++; - else + if (monitors[i]->ns.screen == nil) { - _glfwFreeMonitor(monitors[found]); - monitors[found] = NULL; + _glfwDestroyMonitors(monitors, monitorCount); + _glfwInputError(GLFW_PLATFORM_ERROR, + "Cocoa: Failed to find NSScreen for CGDisplay %s", + monitors[i]->name); + + free(monitors); + return NULL; } } - free(displays); - - *count = found; + *count = monitorCount; return monitors; } @@ -326,11 +332,8 @@ void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos) GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found) { CFArrayRef modes; - CFIndex count, i, j; + CFIndex count, i; GLFWvidmode* result; - CVDisplayLinkRef link; - - CVDisplayLinkCreateWithCGDisplay(monitor->ns.displayID, &link); modes = CGDisplayCopyAllDisplayModes(monitor->ns.displayID, NULL); count = CFArrayGetCount(modes); @@ -340,102 +343,26 @@ GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found) for (i = 0; i < count; i++) { - CGDisplayModeRef dm = (CGDisplayModeRef) CFArrayGetValueAtIndex(modes, i); - if (!modeIsGood(dm)) - continue; + CGDisplayModeRef mode; - const GLFWvidmode mode = vidmodeFromCGDisplayMode(dm, link); - - for (j = 0; j < *found; j++) + mode = (CGDisplayModeRef) CFArrayGetValueAtIndex(modes, i); + if (modeIsGood(mode)) { - if (_glfwCompareVideoModes(result + j, &mode) == 0) - break; + result[*found] = vidmodeFromCGDisplayMode(mode); + (*found)++; } - - if (i < *found) - { - // This is a duplicate, so skip it - continue; - } - - result[*found] = mode; - (*found)++; } CFRelease(modes); - - CVDisplayLinkRelease(link); return result; } void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode *mode) { CGDisplayModeRef displayMode; - CVDisplayLinkRef link; - - CVDisplayLinkCreateWithCGDisplay(monitor->ns.displayID, &link); displayMode = CGDisplayCopyDisplayMode(monitor->ns.displayID); - *mode = vidmodeFromCGDisplayMode(displayMode, link); + *mode = vidmodeFromCGDisplayMode(displayMode); CGDisplayModeRelease(displayMode); - - CVDisplayLinkRelease(link); -} - -void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp) -{ - uint32_t i, size = CGDisplayGammaTableCapacity(monitor->ns.displayID); - CGGammaValue* values = calloc(size * 3, sizeof(CGGammaValue)); - - CGGetDisplayTransferByTable(monitor->ns.displayID, - size, - values, - values + size, - values + size * 2, - &size); - - _glfwAllocGammaArrays(ramp, size); - - for (i = 0; i < size; i++) - { - ramp->red[i] = (unsigned short) (values[i] * 65535); - ramp->green[i] = (unsigned short) (values[i + size] * 65535); - ramp->blue[i] = (unsigned short) (values[i + size * 2] * 65535); - } - - free(values); -} - -void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp) -{ - int i; - CGGammaValue* values = calloc(ramp->size * 3, sizeof(CGGammaValue)); - - for (i = 0; i < ramp->size; i++) - { - values[i] = ramp->red[i] / 65535.f; - values[i + ramp->size] = ramp->green[i] / 65535.f; - values[i + ramp->size * 2] = ramp->blue[i] / 65535.f; - } - - CGSetDisplayTransferByTable(monitor->ns.displayID, - ramp->size, - values, - values + ramp->size, - values + ramp->size * 2); - - free(values); -} - - -////////////////////////////////////////////////////////////////////////// -////// GLFW native API ////// -////////////////////////////////////////////////////////////////////////// - -GLFWAPI CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* handle) -{ - _GLFWmonitor* monitor = (_GLFWmonitor*) handle; - _GLFW_REQUIRE_INIT_OR_RETURN(kCGNullDirectDisplay); - return monitor->ns.displayID; } diff --git a/extern/glfw/src/cocoa_platform.h b/extern/glfw/src/cocoa_platform.h index 6b768c7..b422e13 100644 --- a/extern/glfw/src/cocoa_platform.h +++ b/extern/glfw/src/cocoa_platform.h @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 OS X - www.glfw.org +// GLFW 3.0 OS X - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2009-2010 Camilla Berglund // @@ -37,52 +37,85 @@ typedef void* id; #endif -#include "posix_tls.h" - #if defined(_GLFW_NSGL) - #include "nsgl_context.h" + #include "nsgl_platform.h" #else #error "No supported context creation API selected" #endif -#include "iokit_joystick.h" +#include +#include +#include +#include #define _GLFW_PLATFORM_WINDOW_STATE _GLFWwindowNS ns #define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE _GLFWlibraryNS ns -#define _GLFW_PLATFORM_LIBRARY_TIME_STATE _GLFWtimeNS ns_time #define _GLFW_PLATFORM_MONITOR_STATE _GLFWmonitorNS ns -#define _GLFW_PLATFORM_CURSOR_STATE _GLFWcursorNS ns -// Cocoa-specific per-window data -// +//======================================================================== +// GLFW platform specific types +//======================================================================== + + +//------------------------------------------------------------------------ +// Platform-specific window structure +//------------------------------------------------------------------------ typedef struct _GLFWwindowNS { id object; id delegate; id view; unsigned int modifierFlags; - int cursorInside; - } _GLFWwindowNS; -// Cocoa-specific global data -// +//------------------------------------------------------------------------ +// Joystick information & state +//------------------------------------------------------------------------ +typedef struct +{ + int present; + char name[256]; + + IOHIDDeviceInterface** interface; + + CFMutableArrayRef axisElements; + CFMutableArrayRef buttonElements; + CFMutableArrayRef hatElements; + + float* axes; + unsigned char* buttons; + +} _GLFWjoy; + + +//------------------------------------------------------------------------ +// Platform-specific library global data for Cocoa +//------------------------------------------------------------------------ typedef struct _GLFWlibraryNS { + struct { + double base; + double resolution; + } timer; + CGEventSourceRef eventSource; id delegate; id autoreleasePool; id cursor; + GLboolean cursorHidden; + char* clipboardString; + _GLFWjoy joysticks[GLFW_JOYSTICK_LAST + 1]; } _GLFWlibraryNS; -// Cocoa-specific per-monitor data -// +//------------------------------------------------------------------------ +// Platform-specific monitor structure +//------------------------------------------------------------------------ typedef struct _GLFWmonitorNS { CGDirectDisplayID displayID; @@ -92,28 +125,27 @@ typedef struct _GLFWmonitorNS } _GLFWmonitorNS; -// Cocoa-specific per-cursor data -// -typedef struct _GLFWcursorNS -{ - id object; - -} _GLFWcursorNS; - - -// Cocoa-specific global timer data -// -typedef struct _GLFWtimeNS -{ - double base; - double resolution; - -} _GLFWtimeNS; - +//======================================================================== +// Prototypes for platform specific internal functions +//======================================================================== +// Time void _glfwInitTimer(void); +// Joystick input +void _glfwInitJoysticks(void); +void _glfwTerminateJoysticks(void); + +// Fullscreen GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired); void _glfwRestoreVideoMode(_GLFWmonitor* monitor); +// OpenGL support +int _glfwInitContextAPI(void); +void _glfwTerminateContextAPI(void); +int _glfwCreateContext(_GLFWwindow* window, + const _GLFWwndconfig* wndconfig, + const _GLFWfbconfig* fbconfig); +void _glfwDestroyContext(_GLFWwindow* window); + #endif // _cocoa_platform_h_ diff --git a/extern/glfw/src/mach_time.c b/extern/glfw/src/cocoa_time.c similarity index 85% rename from extern/glfw/src/mach_time.c rename to extern/glfw/src/cocoa_time.c index 59916bb..cb294cb 100644 --- a/extern/glfw/src/mach_time.c +++ b/extern/glfw/src/cocoa_time.c @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 OS X - www.glfw.org +// GLFW 3.0 OS X - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2009-2010 Camilla Berglund // @@ -48,8 +48,8 @@ void _glfwInitTimer(void) mach_timebase_info_data_t info; mach_timebase_info(&info); - _glfw.ns_time.resolution = (double) info.numer / (info.denom * 1.0e9); - _glfw.ns_time.base = getRawTime(); + _glfw.ns.timer.resolution = (double) info.numer / (info.denom * 1.0e9); + _glfw.ns.timer.base = getRawTime(); } @@ -59,13 +59,13 @@ void _glfwInitTimer(void) double _glfwPlatformGetTime(void) { - return (double) (getRawTime() - _glfw.ns_time.base) * - _glfw.ns_time.resolution; + return (double) (getRawTime() - _glfw.ns.timer.base) * + _glfw.ns.timer.resolution; } void _glfwPlatformSetTime(double time) { - _glfw.ns_time.base = getRawTime() - - (uint64_t) (time / _glfw.ns_time.resolution); + _glfw.ns.timer.base = getRawTime() - + (uint64_t) (time / _glfw.ns.timer.resolution); } diff --git a/extern/glfw/src/cocoa_window.m b/extern/glfw/src/cocoa_window.m index 1f5bec4..6bdba4b 100644 --- a/extern/glfw/src/cocoa_window.m +++ b/extern/glfw/src/cocoa_window.m @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 OS X - www.glfw.org +// GLFW 3.0 OS X - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2009-2010 Camilla Berglund // @@ -26,68 +26,35 @@ #include "internal.h" -#include - // Needed for _NSGetProgname #include -// Center the cursor in the view of the window -// -static void centerCursor(_GLFWwindow *window) -{ - int width, height; - _glfwPlatformGetWindowSize(window, &width, &height); - _glfwPlatformSetCursorPos(window, width / 2.0, height / 2.0); -} - -// Get the cursor object that window uses in the specified cursor mode -// -static NSCursor* getModeCursor(_GLFWwindow* window) -{ - if (window->cursorMode == GLFW_CURSOR_NORMAL) - { - if (window->cursor) - return (NSCursor*) window->cursor->ns.object; - else - return [NSCursor arrowCursor]; - } - else - return (NSCursor*) _glfw.ns.cursor; -} - -// Update the cursor to match the specified cursor mode -// -static void updateModeCursor(_GLFWwindow* window) -{ - // This is required for the cursor to update if it's inside the window - [getModeCursor(window) set]; - - // This is required for the cursor to update if it's outside the window - [window->ns.object invalidateCursorRectsForView:window->ns.view]; -} - // Enter fullscreen mode // -static GLboolean enterFullscreenMode(_GLFWwindow* window) +static void enterFullscreenMode(_GLFWwindow* window) { - GLboolean status; + if ([window->ns.view isInFullScreenMode]) + return; - status = _glfwSetVideoMode(window->monitor, &window->videoMode); + _glfwSetVideoMode(window->monitor, &window->videoMode); - // NOTE: The window is resized despite mode setting failure to make - // glfwSetWindowSize more robust - [window->ns.object setFrame:[window->monitor->ns.screen frame] - display:YES]; - - return status; + [window->ns.view enterFullScreenMode:window->monitor->ns.screen + withOptions:nil]; } // Leave fullscreen mode // static void leaveFullscreenMode(_GLFWwindow* window) { + if (![window->ns.view isInFullScreenMode]) + return; + _glfwRestoreVideoMode(window->monitor); + + // Exit full screen after the video restore to avoid a nasty display + // flickering during the fade + [window->ns.view exitFullScreenModeWithOptions:nil]; } // Transforms the specified y-coordinate between the CG display and NS screen @@ -104,7 +71,7 @@ static float transformY(float y) static NSRect convertRectToBacking(_GLFWwindow* window, NSRect contentRect) { #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 - if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6) + if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_7) return [window->ns.view convertRectToBacking:contentRect]; else #endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/ @@ -121,12 +88,19 @@ static NSRect convertRectToBacking(_GLFWwindow* window, NSRect contentRect) _GLFWwindow* window; } -- (id)initWithGlfwWindow:(_GLFWwindow *)initWindow; +- (id)initWithGlfwWindow:(_GLFWwindow *)initWndow; @end @implementation GLFWWindowDelegate +static void centerCursor(_GLFWwindow *window) +{ + int width, height; + _glfwPlatformGetWindowSize(window, &width, &height); + _glfwPlatformSetCursorPos(window, width / 2.0, height / 2.0); +} + - (id)initWithGlfwWindow:(_GLFWwindow *)initWindow { self = [super init]; @@ -185,7 +159,9 @@ static NSRect convertRectToBacking(_GLFWwindow* window, NSRect contentRect) - (void)windowDidBecomeKey:(NSNotification *)notification { _glfwInputWindowFocus(window, GL_TRUE); - _glfwPlatformApplyCursorMode(window); + + if (window->cursorMode == GLFW_CURSOR_DISABLED) + centerCursor(window); } - (void)windowDidResignKey:(NSNotification *)notification @@ -264,6 +240,7 @@ static int translateFlags(NSUInteger flags) static int translateKey(unsigned int key) { // Keyboard symbol translation table + // TODO: Need to find mappings for F13-F15, volume down/up/mute, and eject. static const unsigned int table[128] = { /* 00 */ GLFW_KEY_A, @@ -276,7 +253,7 @@ static int translateKey(unsigned int key) /* 07 */ GLFW_KEY_X, /* 08 */ GLFW_KEY_C, /* 09 */ GLFW_KEY_V, - /* 0a */ GLFW_KEY_WORLD_1, + /* 0a */ GLFW_KEY_GRAVE_ACCENT, /* 0b */ GLFW_KEY_B, /* 0c */ GLFW_KEY_Q, /* 0d */ GLFW_KEY_W, @@ -316,7 +293,7 @@ static int translateKey(unsigned int key) /* 2f */ GLFW_KEY_PERIOD, /* 30 */ GLFW_KEY_TAB, /* 31 */ GLFW_KEY_SPACE, - /* 32 */ GLFW_KEY_GRAVE_ACCENT, + /* 32 */ GLFW_KEY_WORLD_1, /* 33 */ GLFW_KEY_BACKSPACE, /* 34 */ GLFW_KEY_UNKNOWN, /* 35 */ GLFW_KEY_ESCAPE, @@ -371,7 +348,7 @@ static int translateKey(unsigned int key) /* 66 */ GLFW_KEY_UNKNOWN, /* 67 */ GLFW_KEY_F11, /* 68 */ GLFW_KEY_UNKNOWN, - /* 69 */ GLFW_KEY_F13, + /* 69 */ GLFW_KEY_PRINT_SCREEN, /* 6a */ GLFW_KEY_F16, /* 6b */ GLFW_KEY_F14, /* 6c */ GLFW_KEY_UNKNOWN, @@ -425,7 +402,7 @@ static int translateKey(unsigned int key) { if (_glfw.ns.cursor == nil) { - NSImage* data = [[NSImage alloc] initWithSize:NSMakeSize(16, 16)]; + NSImage* data = [[NSImage alloc] initWithSize:NSMakeSize(1, 1)]; _glfw.ns.cursor = [[NSCursor alloc] initWithImage:data hotSpot:NSZeroPoint]; [data release]; @@ -442,8 +419,6 @@ static int translateKey(unsigned int key) trackingArea = nil; [self updateTrackingAreas]; - [self registerForDraggedTypes:[NSArray arrayWithObjects: - NSFilenamesPboardType, nil]]; } return self; @@ -470,11 +445,6 @@ static int translateKey(unsigned int key) return YES; } -- (void)cursorUpdate:(NSEvent *)event -{ - updateModeCursor(window); -} - - (void)mouseDown:(NSEvent *)event { _glfwInputMouseClick(window, @@ -533,7 +503,7 @@ static int translateKey(unsigned int key) - (void)otherMouseDown:(NSEvent *)event { _glfwInputMouseClick(window, - (int) [event buttonNumber], + [event buttonNumber], GLFW_PRESS, translateFlags([event modifierFlags])); } @@ -546,20 +516,18 @@ static int translateKey(unsigned int key) - (void)otherMouseUp:(NSEvent *)event { _glfwInputMouseClick(window, - (int) [event buttonNumber], + [event buttonNumber], GLFW_RELEASE, translateFlags([event modifierFlags])); } - (void)mouseExited:(NSEvent *)event { - window->ns.cursorInside = GL_FALSE; _glfwInputCursorEnter(window, GL_FALSE); } - (void)mouseEntered:(NSEvent *)event { - window->ns.cursorInside = GL_TRUE; _glfwInputCursorEnter(window, GL_TRUE); } @@ -580,8 +548,7 @@ static int translateKey(unsigned int key) } NSTrackingAreaOptions options = NSTrackingMouseEnteredAndExited | - NSTrackingActiveInKeyWindow | - NSTrackingCursorUpdate | + NSTrackingActiveAlways | NSTrackingInVisibleRect; trackingArea = [[NSTrackingArea alloc] initWithRect:[self bounds] @@ -597,39 +564,30 @@ static int translateKey(unsigned int key) { const int key = translateKey([event keyCode]); const int mods = translateFlags([event modifierFlags]); - _glfwInputKey(window, key, [event keyCode], GLFW_PRESS, mods); NSString* characters = [event characters]; NSUInteger i, length = [characters length]; - const int plain = !(mods & GLFW_MOD_SUPER); for (i = 0; i < length; i++) - _glfwInputChar(window, [characters characterAtIndex:i], mods, plain); + _glfwInputChar(window, [characters characterAtIndex:i]); } - (void)flagsChanged:(NSEvent *)event { int action; - const unsigned int modifierFlags = + unsigned int newModifierFlags = [event modifierFlags] & NSDeviceIndependentModifierFlagsMask; - const int key = translateKey([event keyCode]); - const int mods = translateFlags(modifierFlags); - if (modifierFlags == window->ns.modifierFlags) - { - if (window->keys[key] == GLFW_PRESS) - action = GLFW_RELEASE; - else - action = GLFW_PRESS; - } - else if (modifierFlags > window->ns.modifierFlags) + if (newModifierFlags > window->ns.modifierFlags) action = GLFW_PRESS; else action = GLFW_RELEASE; - window->ns.modifierFlags = modifierFlags; + window->ns.modifierFlags = newModifierFlags; + const int key = translateKey([event keyCode]); + const int mods = translateFlags([event modifierFlags]); _glfwInputKey(window, key, [event keyCode], action, mods); } @@ -645,7 +603,7 @@ static int translateKey(unsigned int key) double deltaX, deltaY; #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 - if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6) + if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_7) { deltaX = [event scrollingDeltaX]; deltaY = [event scrollingDeltaY]; @@ -669,61 +627,8 @@ static int translateKey(unsigned int key) - (void)resetCursorRects { - [self addCursorRect:[self bounds] cursor:getModeCursor(window)]; -} - -- (NSDragOperation)draggingEntered:(id )sender -{ - if ((NSDragOperationGeneric & [sender draggingSourceOperationMask]) - == NSDragOperationGeneric) - { - [self setNeedsDisplay:YES]; - return NSDragOperationGeneric; - } - - return NSDragOperationNone; -} - -- (BOOL)prepareForDragOperation:(id )sender -{ - [self setNeedsDisplay:YES]; - return YES; -} - -- (BOOL)performDragOperation:(id )sender -{ - NSPasteboard* pasteboard = [sender draggingPasteboard]; - NSArray* files = [pasteboard propertyListForType:NSFilenamesPboardType]; - - int height; - _glfwPlatformGetWindowSize(window, NULL, &height); - _glfwInputCursorMotion(window, - [sender draggingLocation].x, - height - [sender draggingLocation].y); - - const int count = [files count]; - if (count) - { - NSEnumerator* e = [files objectEnumerator]; - char** names = calloc(count, sizeof(char*)); - int i; - - for (i = 0; i < count; i++) - names[i] = strdup([[e nextObject] UTF8String]); - - _glfwInputDrop(window, count, (const char**) names); - - for (i = 0; i < count; i++) - free(names[i]); - free(names); - } - - return YES; -} - -- (void)concludeDragOperation:(id )sender -{ - [self setNeedsDisplay:YES]; + [self discardCursorRects]; + [self addCursorRect:[self bounds] cursor:_glfw.ns.cursor]; } @end @@ -854,7 +759,7 @@ static void createMenuBar(void) [NSApp setWindowsMenu:windowMenu]; [windowMenuItem setSubmenu:windowMenu]; - [windowMenu addItemWithTitle:@"Minimize" + [windowMenu addItemWithTitle:@"Miniaturize" action:@selector(performMiniaturize:) keyEquivalent:@"m"]; [windowMenu addItemWithTitle:@"Zoom" @@ -865,23 +770,9 @@ static void createMenuBar(void) action:@selector(arrangeInFront:) keyEquivalent:@""]; -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 - if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6) - { - // TODO: Make this appear at the bottom of the menu (for consistency) - - [windowMenu addItem:[NSMenuItem separatorItem]]; - [[windowMenu addItemWithTitle:@"Enter Full Screen" - action:@selector(toggleFullScreen:) - keyEquivalent:@"f"] - setKeyEquivalentModifierMask:NSControlKeyMask | NSCommandKeyMask]; - } -#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/ - // Prior to Snow Leopard, we need to use this oddly-named semi-private API // to get the application menu working properly. - SEL setAppleMenuSelector = NSSelectorFromString(@"setAppleMenu:"); - [NSApp performSelector:setAppleMenuSelector withObject:appMenu]; + [NSApp performSelector:@selector(setAppleMenu:) withObject:appMenu]; } #endif /* _GLFW_USE_MENUBAR */ @@ -896,8 +787,13 @@ static GLboolean initializeAppKit(void) // Implicitly create shared NSApplication instance [GLFWApplication sharedApplication]; - // In case we are unbundled, make us a proper UI application - [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; + // If we get here, the application is unbundled + ProcessSerialNumber psn = { 0, kCurrentProcess }; + TransformProcessType(&psn, kProcessTransformToForegroundApplication); + + // Having the app in front of the terminal window is also generally + // handy. There is an NSApplication API to do this, but... + SetFrontProcess(&psn); #if defined(_GLFW_USE_MENUBAR) // Menu bar setup must go between sharedApplication above and @@ -916,14 +812,6 @@ static GLboolean initializeAppKit(void) static GLboolean createWindow(_GLFWwindow* window, const _GLFWwndconfig* wndconfig) { - window->ns.delegate = [[GLFWWindowDelegate alloc] initWithGlfwWindow:window]; - if (window->ns.delegate == nil) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Cocoa: Failed to create window delegate"); - return GL_FALSE; - } - unsigned int styleMask = 0; if (wndconfig->monitor || !wndconfig->decorated) @@ -937,15 +825,8 @@ static GLboolean createWindow(_GLFWwindow* window, styleMask |= NSResizableWindowMask; } - NSRect contentRect; - - if (wndconfig->monitor) - contentRect = [wndconfig->monitor->ns.screen frame]; - else - contentRect = NSMakeRect(0, 0, wndconfig->width, wndconfig->height); - window->ns.object = [[GLFWWindow alloc] - initWithContentRect:contentRect + initWithContentRect:NSMakeRect(0, 0, wndconfig->width, wndconfig->height) styleMask:styleMask backing:NSBackingStoreBuffered defer:NO]; @@ -959,35 +840,19 @@ static GLboolean createWindow(_GLFWwindow* window, window->ns.view = [[GLFWContentView alloc] initWithGlfwWindow:window]; #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 - if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6) - { -#if defined(_GLFW_USE_RETINA) + if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_7) [window->ns.view setWantsBestResolutionOpenGLSurface:YES]; -#endif - - if (wndconfig->resizable) - [window->ns.object setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; - } #endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/ - if (wndconfig->monitor) - [window->ns.object setLevel:NSMainMenuWindowLevel + 1]; - else - { - [window->ns.object center]; - - if (wndconfig->floating) - [window->ns.object setLevel:NSFloatingWindowLevel]; - } - [window->ns.object setTitle:[NSString stringWithUTF8String:wndconfig->title]]; [window->ns.object setContentView:window->ns.view]; [window->ns.object setDelegate:window->ns.delegate]; [window->ns.object setAcceptsMouseMovedEvents:YES]; - [window->ns.object setHidesOnDeactivate:YES]; + [window->ns.object disableCursorRects]; + [window->ns.object center]; #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 - if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6) + if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_7) [window->ns.object setRestorable:NO]; #endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/ @@ -1001,7 +866,6 @@ static GLboolean createWindow(_GLFWwindow* window, int _glfwPlatformCreateWindow(_GLFWwindow* window, const _GLFWwndconfig* wndconfig, - const _GLFWctxconfig* ctxconfig, const _GLFWfbconfig* fbconfig) { if (!initializeAppKit()) @@ -1022,20 +886,27 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window, [NSApp setDelegate:_glfw.ns.delegate]; } + window->ns.delegate = [[GLFWWindowDelegate alloc] initWithGlfwWindow:window]; + if (window->ns.delegate == nil) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "Cocoa: Failed to create window delegate"); + return GL_FALSE; + } + + // Don't use accumulation buffer support; it's not accelerated + // Aux buffers probably aren't accelerated either + if (!createWindow(window, wndconfig)) return GL_FALSE; - if (!_glfwCreateContext(window, ctxconfig, fbconfig)) + if (!_glfwCreateContext(window, wndconfig, fbconfig)) return GL_FALSE; [window->nsgl.context setView:window->ns.view]; if (wndconfig->monitor) - { - _glfwPlatformShowWindow(window); - if (!enterFullscreenMode(window)) - return GL_FALSE; - } + enterFullscreenMode(window); return GL_TRUE; } @@ -1110,25 +981,6 @@ void _glfwPlatformGetFramebufferSize(_GLFWwindow* window, int* width, int* heigh *height = (int) fbRect.size.height; } -void _glfwPlatformGetWindowFrameSize(_GLFWwindow* window, - int* left, int* top, - int* right, int* bottom) -{ - const NSRect contentRect = [window->ns.view frame]; - const NSRect frameRect = [window->ns.object frameRectForContentRect:contentRect]; - - if (left) - *left = contentRect.origin.x - frameRect.origin.x; - if (top) - *top = frameRect.origin.y + frameRect.size.height - - contentRect.origin.y - contentRect.size.height; - if (right) - *right = frameRect.origin.x + frameRect.size.width - - contentRect.origin.x - contentRect.size.width; - if (bottom) - *bottom = contentRect.origin.y - frameRect.origin.y; -} - void _glfwPlatformIconifyWindow(_GLFWwindow* window) { if (window->monitor) @@ -1144,18 +996,7 @@ void _glfwPlatformRestoreWindow(_GLFWwindow* window) void _glfwPlatformShowWindow(_GLFWwindow* window) { - // Make us the active application - // HACK: This has been moved here from initializeAppKit to prevent - // applications using only hidden windows from being activated, but - // should probably not be done every time any window is shown - [NSApp activateIgnoringOtherApps:YES]; - [window->ns.object makeKeyAndOrderFront:nil]; -} - -void _glfwPlatformUnhideWindow(_GLFWwindow* window) -{ - [window->ns.object orderFront:nil]; _glfwInputWindowVisibility(window, GL_TRUE); } @@ -1197,26 +1038,8 @@ void _glfwPlatformWaitEvents(void) _glfwPlatformPollEvents(); } -void _glfwPlatformPostEmptyEvent(void) -{ - NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; - NSEvent* event = [NSEvent otherEventWithType:NSApplicationDefined - location:NSMakePoint(0, 0) - modifierFlags:0 - timestamp:0 - windowNumber:0 - context:nil - subtype:0 - data1:0 - data2:0]; - [NSApp postEvent:event atStart:YES]; - [pool drain]; -} - void _glfwPlatformSetCursorPos(_GLFWwindow* window, double x, double y) { - updateModeCursor(window); - if (window->monitor) { CGDisplayMoveCursorToPoint(window->monitor->ns.displayID, @@ -1233,110 +1056,41 @@ void _glfwPlatformSetCursorPos(_GLFWwindow* window, double x, double y) } } -void _glfwPlatformApplyCursorMode(_GLFWwindow* window) +void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode) { - updateModeCursor(window); - - if (window->cursorMode == GLFW_CURSOR_DISABLED) + if (mode == GLFW_CURSOR_HIDDEN) { - CGAssociateMouseAndMouseCursorPosition(false); - centerCursor(window); + [window->ns.object enableCursorRects]; + [window->ns.object invalidateCursorRectsForView:window->ns.view]; } else + { + [window->ns.object disableCursorRects]; + [window->ns.object invalidateCursorRectsForView:window->ns.view]; + } + + if (mode == GLFW_CURSOR_DISABLED) + { + CGAssociateMouseAndMouseCursorPosition(false); + + if (!_glfw.ns.cursorHidden) + { + [NSCursor hide]; + _glfw.ns.cursorHidden = GL_TRUE; + } + } + else + { CGAssociateMouseAndMouseCursorPosition(true); -} -int _glfwPlatformCreateCursor(_GLFWcursor* cursor, - const GLFWimage* image, - int xhot, int yhot) -{ - NSImage* native; - NSBitmapImageRep* rep; - - rep = [[NSBitmapImageRep alloc] - initWithBitmapDataPlanes:NULL - pixelsWide:image->width - pixelsHigh:image->height - bitsPerSample:8 - samplesPerPixel:4 - hasAlpha:YES - isPlanar:NO - colorSpaceName:NSCalibratedRGBColorSpace - bitmapFormat:NSAlphaNonpremultipliedBitmapFormat - bytesPerRow:image->width * 4 - bitsPerPixel:32]; - - if (rep == nil) - return GL_FALSE; - - memcpy([rep bitmapData], image->pixels, image->width * image->height * 4); - - native = [[NSImage alloc] initWithSize:NSMakeSize(image->width, image->height)]; - [native addRepresentation: rep]; - - cursor->ns.object = [[NSCursor alloc] initWithImage:native - hotSpot:NSMakePoint(xhot, yhot)]; - - [native release]; - [rep release]; - - if (cursor->ns.object == nil) - return GL_FALSE; - - return GL_TRUE; -} - -void _glfwPlatformDestroyCursor(_GLFWcursor* cursor) -{ - if (cursor->ns.object) - [(NSCursor*) cursor->ns.object release]; -} - -void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor) -{ - if (window->cursorMode == GLFW_CURSOR_NORMAL && window->ns.cursorInside) - { - if (cursor) - [(NSCursor*) cursor->ns.object set]; - else - [[NSCursor arrowCursor] set]; + if (_glfw.ns.cursorHidden) + { + [NSCursor unhide]; + _glfw.ns.cursorHidden = GL_FALSE; + } } } -void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string) -{ - NSArray* types = [NSArray arrayWithObjects:NSStringPboardType, nil]; - - NSPasteboard* pasteboard = [NSPasteboard generalPasteboard]; - [pasteboard declareTypes:types owner:nil]; - [pasteboard setString:[NSString stringWithUTF8String:string] - forType:NSStringPboardType]; -} - -const char* _glfwPlatformGetClipboardString(_GLFWwindow* window) -{ - NSPasteboard* pasteboard = [NSPasteboard generalPasteboard]; - - if (![[pasteboard types] containsObject:NSStringPboardType]) - { - _glfwInputError(GLFW_FORMAT_UNAVAILABLE, NULL); - return NULL; - } - - NSString* object = [pasteboard stringForType:NSStringPboardType]; - if (!object) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Cocoa: Failed to retrieve object from pasteboard"); - return NULL; - } - - free(_glfw.ns.clipboardString); - _glfw.ns.clipboardString = strdup([object UTF8String]); - - return _glfw.ns.clipboardString; -} - ////////////////////////////////////////////////////////////////////////// ////// GLFW native API ////// diff --git a/extern/glfw/src/glfw_config.h.in b/extern/glfw/src/config.h.in similarity index 78% rename from extern/glfw/src/glfw_config.h.in rename to extern/glfw/src/config.h.in index 485cac5..5925966 100644 --- a/extern/glfw/src/glfw_config.h.in +++ b/extern/glfw/src/config.h.in @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 - www.glfw.org +// GLFW 3.0 - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2010 Camilla Berglund // @@ -23,15 +23,13 @@ // distribution. // //======================================================================== -// As glfw_config.h.in, this file is used by CMake to produce the -// glfw_config.h configuration header file. If you are adding a feature -// requiring conditional compilation, this is where to add the macro. +// As config.h.in, this file is used by CMake to produce the config.h shared +// configuration header file. If you are adding a feature requiring +// conditional compilation, this is the proper place to add the macros. //======================================================================== -// As glfw_config.h, this file defines compile-time option macros for a -// specific platform and development environment. If you are using the -// GLFW CMake files, modify glfw_config.h.in instead of this file. If you -// are using your own build system, make this file define the appropriate -// macros in whatever way is suitable. +// As config.h, this file defines compile-time build options and macros for +// all platforms supported by GLFW. As this is a generated file, don't modify +// it. Instead, you should modify the config.h.in file. //======================================================================== // Define this to 1 if building GLFW for X11 @@ -40,10 +38,6 @@ #cmakedefine _GLFW_WIN32 // Define this to 1 if building GLFW for Cocoa #cmakedefine _GLFW_COCOA -// Define this to 1 if building GLFW for Wayland -#cmakedefine _GLFW_WAYLAND -// Define this to 1 if building GLFW for Mir -#cmakedefine _GLFW_MIR // Define this to 1 if building GLFW for EGL #cmakedefine _GLFW_EGL @@ -57,6 +51,8 @@ // Define this to 1 if building as a shared library / dynamic library / DLL #cmakedefine _GLFW_BUILD_DLL +// Define this to 1 to disable dynamic loading of winmm +#cmakedefine _GLFW_NO_DLOAD_WINMM // Define this to 1 if glfwSwapInterval should ignore DWM compositing status #cmakedefine _GLFW_USE_DWM_SWAP_INTERVAL // Define this to 1 to force use of high-performance GPU on Optimus systems @@ -75,8 +71,6 @@ #cmakedefine _GLFW_USE_CHDIR // Define this to 1 if glfwCreateWindow should populate the menu bar #cmakedefine _GLFW_USE_MENUBAR -// Define this to 1 if windows should use full resolution on Retina displays -#cmakedefine _GLFW_USE_RETINA // Define this to 1 if using OpenGL as the client library #cmakedefine _GLFW_USE_OPENGL @@ -85,3 +79,6 @@ // Define this to 1 if using OpenGL ES 2.0 as the client library #cmakedefine _GLFW_USE_GLESV2 +// The GLFW version as used by glfwGetVersionString +#define _GLFW_VERSION_FULL "@GLFW_VERSION_FULL@" + diff --git a/extern/glfw/src/context.c b/extern/glfw/src/context.c index 8f01846..456413b 100644 --- a/extern/glfw/src/context.c +++ b/extern/glfw/src/context.c @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 - www.glfw.org +// GLFW 3.0 - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -35,9 +35,9 @@ // Parses the client API version string and extracts the version number // -static GLboolean parseVersionString(int* api, int* major, int* minor, int* rev) +static GLboolean parseGLVersion(int* api, int* major, int* minor, int* rev) { - int i; + int i, _api = GLFW_OPENGL_API, _major, _minor = 0, _rev = 0; const char* version; const char* prefixes[] = { @@ -47,8 +47,6 @@ static GLboolean parseVersionString(int* api, int* major, int* minor, int* rev) NULL }; - *api = GLFW_OPENGL_API; - version = (const char*) glGetString(GL_VERSION); if (!version) { @@ -64,18 +62,23 @@ static GLboolean parseVersionString(int* api, int* major, int* minor, int* rev) if (strncmp(version, prefixes[i], length) == 0) { version += length; - *api = GLFW_OPENGL_ES_API; + _api = GLFW_OPENGL_ES_API; break; } } - if (!sscanf(version, "%d.%d.%d", major, minor, rev)) + if (!sscanf(version, "%d.%d.%d", &_major, &_minor, &_rev)) { _glfwInputError(GLFW_PLATFORM_ERROR, "No version found in context version string"); return GL_FALSE; } + *api = _api; + *major = _major; + *minor = _minor; + *rev = _rev; + return GL_TRUE; } @@ -84,21 +87,21 @@ static GLboolean parseVersionString(int* api, int* major, int* minor, int* rev) ////// GLFW internal API ////// ////////////////////////////////////////////////////////////////////////// -GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig) +GLboolean _glfwIsValidContextConfig(_GLFWwndconfig* wndconfig) { - if (ctxconfig->api != GLFW_OPENGL_API && - ctxconfig->api != GLFW_OPENGL_ES_API) + if (wndconfig->clientAPI != GLFW_OPENGL_API && + wndconfig->clientAPI != GLFW_OPENGL_ES_API) { _glfwInputError(GLFW_INVALID_ENUM, "Invalid client API requested"); return GL_FALSE; } - if (ctxconfig->api == GLFW_OPENGL_API) + if (wndconfig->clientAPI == GLFW_OPENGL_API) { - if ((ctxconfig->major < 1 || ctxconfig->minor < 0) || - (ctxconfig->major == 1 && ctxconfig->minor > 5) || - (ctxconfig->major == 2 && ctxconfig->minor > 1) || - (ctxconfig->major == 3 && ctxconfig->minor > 3)) + if (wndconfig->glMajor < 1 || wndconfig->glMinor < 0 || + (wndconfig->glMajor == 1 && wndconfig->glMinor > 5) || + (wndconfig->glMajor == 2 && wndconfig->glMinor > 1) || + (wndconfig->glMajor == 3 && wndconfig->glMinor > 3)) { // OpenGL 1.0 is the smallest valid version // OpenGL 1.x series ended with version 1.5 @@ -107,7 +110,7 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig) _glfwInputError(GLFW_INVALID_VALUE, "Invalid OpenGL version %i.%i requested", - ctxconfig->major, ctxconfig->minor); + wndconfig->glMajor, wndconfig->glMinor); return GL_FALSE; } else @@ -115,18 +118,18 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig) // For now, let everything else through } - if (ctxconfig->profile) + if (wndconfig->glProfile) { - if (ctxconfig->profile != GLFW_OPENGL_CORE_PROFILE && - ctxconfig->profile != GLFW_OPENGL_COMPAT_PROFILE) + if (wndconfig->glProfile != GLFW_OPENGL_CORE_PROFILE && + wndconfig->glProfile != GLFW_OPENGL_COMPAT_PROFILE) { _glfwInputError(GLFW_INVALID_ENUM, "Invalid OpenGL profile requested"); return GL_FALSE; } - if (ctxconfig->major < 3 || - (ctxconfig->major == 3 && ctxconfig->minor < 2)) + if (wndconfig->glMajor < 3 || + (wndconfig->glMajor == 3 && wndconfig->glMinor < 2)) { // Desktop OpenGL context profiles are only defined for version 3.2 // and above @@ -138,7 +141,7 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig) } } - if (ctxconfig->forward && ctxconfig->major < 3) + if (wndconfig->glForward && wndconfig->glMajor < 3) { // Forward-compatible contexts are only defined for OpenGL version 3.0 and above _glfwInputError(GLFW_INVALID_VALUE, @@ -147,11 +150,11 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig) return GL_FALSE; } } - else if (ctxconfig->api == GLFW_OPENGL_ES_API) + else if (wndconfig->clientAPI == GLFW_OPENGL_ES_API) { - if (ctxconfig->major < 1 || ctxconfig->minor < 0 || - (ctxconfig->major == 1 && ctxconfig->minor > 1) || - (ctxconfig->major == 2 && ctxconfig->minor > 0)) + if (wndconfig->glMajor < 1 || wndconfig->glMinor < 0 || + (wndconfig->glMajor == 1 && wndconfig->glMinor > 1) || + (wndconfig->glMajor == 2 && wndconfig->glMinor > 0)) { // OpenGL ES 1.0 is the smallest valid version // OpenGL ES 1.x series ended with version 1.1 @@ -159,7 +162,7 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig) _glfwInputError(GLFW_INVALID_VALUE, "Invalid OpenGL ES version %i.%i requested", - ctxconfig->major, ctxconfig->minor); + wndconfig->glMajor, wndconfig->glMinor); return GL_FALSE; } else @@ -167,7 +170,7 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig) // For now, let everything else through } - if (ctxconfig->profile) + if (wndconfig->glProfile) { // OpenGL ES does not support profiles _glfwInputError(GLFW_INVALID_VALUE, @@ -175,7 +178,7 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig) return GL_FALSE; } - if (ctxconfig->forward) + if (wndconfig->glForward) { // OpenGL ES does not support forward-compatibility _glfwInputError(GLFW_INVALID_VALUE, @@ -184,10 +187,10 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig) } } - if (ctxconfig->robustness) + if (wndconfig->glRobustness) { - if (ctxconfig->robustness != GLFW_NO_RESET_NOTIFICATION && - ctxconfig->robustness != GLFW_LOSE_CONTEXT_ON_RESET) + if (wndconfig->glRobustness != GLFW_NO_RESET_NOTIFICATION && + wndconfig->glRobustness != GLFW_LOSE_CONTEXT_ON_RESET) { _glfwInputError(GLFW_INVALID_VALUE, "Invalid context robustness mode requested"); @@ -195,17 +198,6 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig) } } - if (ctxconfig->release) - { - if (ctxconfig->release != GLFW_RELEASE_BEHAVIOR_NONE && - ctxconfig->release != GLFW_RELEASE_BEHAVIOR_FLUSH) - { - _glfwInputError(GLFW_INVALID_VALUE, - "Invalid context release behavior requested"); - return GL_FALSE; - } - } - return GL_TRUE; } @@ -230,12 +222,6 @@ const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired, continue; } - if (desired->doublebuffer != current->doublebuffer) - { - // Double buffering is a hard constraint - continue; - } - // Count number of missing buffers { missing = 0; @@ -249,11 +235,8 @@ const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired, if (desired->stencilBits > 0 && current->stencilBits == 0) missing++; - if (desired->auxBuffers > 0 && - current->auxBuffers < desired->auxBuffers) - { + if (desired->auxBuffers > 0 && current->auxBuffers < desired->auxBuffers) missing += desired->auxBuffers - current->auxBuffers; - } if (desired->samples > 0 && current->samples == 0) { @@ -271,19 +254,19 @@ const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired, { colorDiff = 0; - if (desired->redBits != GLFW_DONT_CARE) + if (desired->redBits > 0) { colorDiff += (desired->redBits - current->redBits) * (desired->redBits - current->redBits); } - if (desired->greenBits != GLFW_DONT_CARE) + if (desired->greenBits > 0) { colorDiff += (desired->greenBits - current->greenBits) * (desired->greenBits - current->greenBits); } - if (desired->blueBits != GLFW_DONT_CARE) + if (desired->blueBits > 0) { colorDiff += (desired->blueBits - current->blueBits) * (desired->blueBits - current->blueBits); @@ -294,56 +277,59 @@ const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired, { extraDiff = 0; - if (desired->alphaBits != GLFW_DONT_CARE) + if (desired->alphaBits > 0) { extraDiff += (desired->alphaBits - current->alphaBits) * (desired->alphaBits - current->alphaBits); } - if (desired->depthBits != GLFW_DONT_CARE) + if (desired->depthBits > 0) { extraDiff += (desired->depthBits - current->depthBits) * (desired->depthBits - current->depthBits); } - if (desired->stencilBits != GLFW_DONT_CARE) + if (desired->stencilBits > 0) { extraDiff += (desired->stencilBits - current->stencilBits) * (desired->stencilBits - current->stencilBits); } - if (desired->accumRedBits != GLFW_DONT_CARE) + if (desired->accumRedBits > 0) { extraDiff += (desired->accumRedBits - current->accumRedBits) * (desired->accumRedBits - current->accumRedBits); } - if (desired->accumGreenBits != GLFW_DONT_CARE) + if (desired->accumGreenBits > 0) { extraDiff += (desired->accumGreenBits - current->accumGreenBits) * (desired->accumGreenBits - current->accumGreenBits); } - if (desired->accumBlueBits != GLFW_DONT_CARE) + if (desired->accumBlueBits > 0) { extraDiff += (desired->accumBlueBits - current->accumBlueBits) * (desired->accumBlueBits - current->accumBlueBits); } - if (desired->accumAlphaBits != GLFW_DONT_CARE) + if (desired->accumAlphaBits > 0) { extraDiff += (desired->accumAlphaBits - current->accumAlphaBits) * (desired->accumAlphaBits - current->accumAlphaBits); } - if (desired->samples != GLFW_DONT_CARE) + if (desired->samples > 0) { extraDiff += (desired->samples - current->samples) * (desired->samples - current->samples); } - if (desired->sRGB && !current->sRGB) - extraDiff++; + if (desired->sRGB) + { + if (!current->sRGB) + extraDiff++; + } } // Figure out if the current one is better than the best one found so far @@ -372,20 +358,20 @@ const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired, return closest; } -GLboolean _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig) +GLboolean _glfwRefreshContextAttribs(void) { _GLFWwindow* window = _glfwPlatformGetCurrentContext(); - if (!parseVersionString(&window->context.api, - &window->context.major, - &window->context.minor, - &window->context.revision)) + if (!parseGLVersion(&window->clientAPI, + &window->glMajor, + &window->glMinor, + &window->glRevision)) { return GL_FALSE; } #if defined(_GLFW_USE_OPENGL) - if (window->context.major > 2) + if (window->glMajor > 2) { // OpenGL 3.0+ uses a different function for extension string retrieval // We cache it here instead of in glfwExtensionSupported mostly to alert @@ -400,63 +386,54 @@ GLboolean _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig) } } - if (window->context.api == GLFW_OPENGL_API) + if (window->clientAPI == GLFW_OPENGL_API) { // Read back context flags (OpenGL 3.0 and above) - if (window->context.major >= 3) + if (window->glMajor >= 3) { GLint flags; glGetIntegerv(GL_CONTEXT_FLAGS, &flags); if (flags & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT) - window->context.forward = GL_TRUE; + window->glForward = GL_TRUE; if (flags & GL_CONTEXT_FLAG_DEBUG_BIT) - window->context.debug = GL_TRUE; - else if (glfwExtensionSupported("GL_ARB_debug_output") && - ctxconfig->debug) + window->glDebug = GL_TRUE; + else if (glfwExtensionSupported("GL_ARB_debug_output")) { // HACK: This is a workaround for older drivers (pre KHR_debug) - // not setting the debug bit in the context flags for - // debug contexts - window->context.debug = GL_TRUE; + // not setting the debug bit in the context flags for debug + // contexts + window->glDebug = GL_TRUE; } } // Read back OpenGL context profile (OpenGL 3.2 and above) - if (window->context.major > 3 || - (window->context.major == 3 && window->context.minor >= 2)) + if (window->glMajor > 3 || + (window->glMajor == 3 && window->glMinor >= 2)) { GLint mask; glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &mask); if (mask & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT) - window->context.profile = GLFW_OPENGL_COMPAT_PROFILE; + window->glProfile = GLFW_OPENGL_COMPAT_PROFILE; else if (mask & GL_CONTEXT_CORE_PROFILE_BIT) - window->context.profile = GLFW_OPENGL_CORE_PROFILE; - else if (glfwExtensionSupported("GL_ARB_compatibility")) - { - // HACK: This is a workaround for the compatibility profile bit - // not being set in the context flags if an OpenGL 3.2+ - // context was created without having requested a specific - // version - window->context.profile = GLFW_OPENGL_COMPAT_PROFILE; - } + window->glProfile = GLFW_OPENGL_CORE_PROFILE; } // Read back robustness strategy if (glfwExtensionSupported("GL_ARB_robustness")) { // NOTE: We avoid using the context flags for detection, as they are - // only present from 3.0 while the extension applies from 1.1 + // only present from 3.0 while the extension applies from 1.1 GLint strategy; glGetIntegerv(GL_RESET_NOTIFICATION_STRATEGY_ARB, &strategy); if (strategy == GL_LOSE_CONTEXT_ON_RESET_ARB) - window->context.robustness = GLFW_LOSE_CONTEXT_ON_RESET; + window->glRobustness = GLFW_LOSE_CONTEXT_ON_RESET; else if (strategy == GL_NO_RESET_NOTIFICATION_ARB) - window->context.robustness = GLFW_NO_RESET_NOTIFICATION; + window->glRobustness = GLFW_NO_RESET_NOTIFICATION; } } else @@ -465,40 +442,29 @@ GLboolean _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig) if (glfwExtensionSupported("GL_EXT_robustness")) { // NOTE: The values of these constants match those of the OpenGL ARB - // one, so we can reuse them here + // one, so we can reuse them here GLint strategy; glGetIntegerv(GL_RESET_NOTIFICATION_STRATEGY_ARB, &strategy); if (strategy == GL_LOSE_CONTEXT_ON_RESET_ARB) - window->context.robustness = GLFW_LOSE_CONTEXT_ON_RESET; + window->glRobustness = GLFW_LOSE_CONTEXT_ON_RESET; else if (strategy == GL_NO_RESET_NOTIFICATION_ARB) - window->context.robustness = GLFW_NO_RESET_NOTIFICATION; + window->glRobustness = GLFW_NO_RESET_NOTIFICATION; } } - - if (glfwExtensionSupported("GL_KHR_context_flush_control")) - { - GLint behavior; - glGetIntegerv(GL_CONTEXT_RELEASE_BEHAVIOR, &behavior); - - if (behavior == GL_NONE) - window->context.release = GLFW_RELEASE_BEHAVIOR_NONE; - else if (behavior == GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH) - window->context.release = GLFW_RELEASE_BEHAVIOR_FLUSH; - } #endif // _GLFW_USE_OPENGL return GL_TRUE; } -GLboolean _glfwIsValidContext(const _GLFWctxconfig* ctxconfig) +GLboolean _glfwIsValidContext(_GLFWwndconfig* wndconfig) { _GLFWwindow* window = _glfwPlatformGetCurrentContext(); - if (window->context.major < ctxconfig->major || - (window->context.major == ctxconfig->major && - window->context.minor < ctxconfig->minor)) + if (window->glMajor < wndconfig->glMajor || + (window->glMajor == wndconfig->glMajor && + window->glMinor < wndconfig->glMinor)) { // The desired OpenGL version is greater than the actual version // This only happens if the machine lacks {GLX|WGL}_ARB_create_context @@ -600,26 +566,22 @@ GLFWAPI int glfwExtensionSupported(const char* extension) return GL_FALSE; } - if (!extension || *extension == '\0') + if (extension == NULL || *extension == '\0') { _glfwInputError(GLFW_INVALID_VALUE, NULL); return GL_FALSE; } - if (window->context.major < 3) + if (window->glMajor < 3) { // Check if extension is in the old style OpenGL extensions string extensions = glGetString(GL_EXTENSIONS); - if (!extensions) + if (extensions != NULL) { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Failed to retrieve extension string"); - return GL_FALSE; + if (_glfwStringInExtensionString(extension, extensions)) + return GL_TRUE; } - - if (_glfwStringInExtensionString(extension, extensions)) - return GL_TRUE; } #if defined(_GLFW_USE_OPENGL) else @@ -633,16 +595,11 @@ GLFWAPI int glfwExtensionSupported(const char* extension) for (i = 0; i < count; i++) { - const char* en = (const char*) window->GetStringi(GL_EXTENSIONS, i); - if (!en) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Failed to retrieve extension string %i", i); - return GL_FALSE; - } - - if (strcmp(en, extension) == 0) - return GL_TRUE; + if (strcmp((const char*) window->GetStringi(GL_EXTENSIONS, i), + extension) == 0) + { + return GL_TRUE; + } } } #endif // _GLFW_USE_OPENGL diff --git a/extern/glfw/src/egl_context.c b/extern/glfw/src/egl_context.c index e3335a5..bab955f 100644 --- a/extern/glfw/src/egl_context.c +++ b/extern/glfw/src/egl_context.c @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 EGL - www.glfw.org +// GLFW 3.0 EGL - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -32,6 +32,22 @@ #include +// Thread local storage attribute macro +// +#if defined(_MSC_VER) + #define _GLFW_TLS __declspec(thread) +#elif defined(__GNUC__) + #define _GLFW_TLS __thread +#else + #define _GLFW_TLS +#endif + + +// The per-thread current context/window pointer +// +static _GLFW_TLS _GLFWwindow* _glfwCurrentWindow = NULL; + + // Return a description of the specified EGL error // static const char* getErrorString(EGLint error) @@ -92,7 +108,7 @@ static int getConfigAttrib(EGLConfig config, int attrib) // Return a list of available and usable framebuffer configs // -static GLboolean chooseFBConfigs(const _GLFWctxconfig* ctxconfig, +static GLboolean chooseFBConfigs(const _GLFWwndconfig* wndconfig, const _GLFWfbconfig* desired, EGLConfig* result) { @@ -139,9 +155,9 @@ static GLboolean chooseFBConfigs(const _GLFWctxconfig* ctxconfig, continue; } - if (ctxconfig->api == GLFW_OPENGL_ES_API) + if (wndconfig->clientAPI == GLFW_OPENGL_ES_API) { - if (ctxconfig->major == 1) + if (wndconfig->glMajor == 1) { if (!(getConfigAttrib(n, EGL_RENDERABLE_TYPE) & EGL_OPENGL_ES_BIT)) continue; @@ -152,7 +168,7 @@ static GLboolean chooseFBConfigs(const _GLFWctxconfig* ctxconfig, continue; } } - else if (ctxconfig->api == GLFW_OPENGL_API) + else if (wndconfig->clientAPI == GLFW_OPENGL_API) { if (!(getConfigAttrib(n, EGL_RENDERABLE_TYPE) & EGL_OPENGL_BIT)) continue; @@ -167,7 +183,6 @@ static GLboolean chooseFBConfigs(const _GLFWctxconfig* ctxconfig, u->stencilBits = getConfigAttrib(n, EGL_STENCIL_SIZE); u->samples = getConfigAttrib(n, EGL_SAMPLES); - u->doublebuffer = GL_TRUE; u->egl = n; usableCount++; @@ -192,9 +207,6 @@ static GLboolean chooseFBConfigs(const _GLFWctxconfig* ctxconfig, // int _glfwInitContextAPI(void) { - if (!_glfwInitTLS()) - return GL_FALSE; - _glfw.egl.display = eglGetDisplay((EGLNativeDisplayType)_GLFW_EGL_NATIVE_DISPLAY); if (_glfw.egl.display == EGL_NO_DISPLAY) { @@ -225,8 +237,6 @@ int _glfwInitContextAPI(void) void _glfwTerminateContextAPI(void) { eglTerminate(_glfw.egl.display); - - _glfwTerminateTLS(); } #define setEGLattrib(attribName, attribValue) \ @@ -236,20 +246,21 @@ void _glfwTerminateContextAPI(void) assert((size_t) index < sizeof(attribs) / sizeof(attribs[0])); \ } -// Create the OpenGL or OpenGL ES context +// Prepare for creation of the OpenGL context // int _glfwCreateContext(_GLFWwindow* window, - const _GLFWctxconfig* ctxconfig, + const _GLFWwndconfig* wndconfig, const _GLFWfbconfig* fbconfig) { int attribs[40]; + EGLint count = 0; EGLConfig config; EGLContext share = NULL; - if (ctxconfig->share) - share = ctxconfig->share->egl.context; + if (wndconfig->share) + share = wndconfig->share->egl.context; - if (!chooseFBConfigs(ctxconfig, fbconfig, &config)) + if (!chooseFBConfigs(wndconfig, fbconfig, &config)) { _glfwInputError(GLFW_PLATFORM_ERROR, "EGL: Failed to find a suitable EGLConfig"); @@ -259,7 +270,6 @@ int _glfwCreateContext(_GLFWwindow* window, #if defined(_GLFW_X11) // Retrieve the visual corresponding to the chosen EGL config { - EGLint count = 0; int mask; EGLint redBits, greenBits, blueBits, alphaBits, visualID = 0; XVisualInfo info; @@ -296,7 +306,8 @@ int _glfwCreateContext(_GLFWwindow* window, window->egl.visual = XGetVisualInfo(_glfw.x11.display, mask, &info, &count); - if (!window->egl.visual) + + if (window->egl.visual == NULL) { _glfwInputError(GLFW_PLATFORM_ERROR, "EGL: Failed to retrieve visual for EGLConfig"); @@ -305,7 +316,7 @@ int _glfwCreateContext(_GLFWwindow* window, } #endif // _GLFW_X11 - if (ctxconfig->api == GLFW_OPENGL_ES_API) + if (wndconfig->clientAPI == GLFW_OPENGL_ES_API) { if (!eglBindAPI(EGL_OPENGL_ES_API)) { @@ -330,34 +341,34 @@ int _glfwCreateContext(_GLFWwindow* window, { int index = 0, mask = 0, flags = 0, strategy = 0; - if (ctxconfig->api == GLFW_OPENGL_API) + if (wndconfig->clientAPI == GLFW_OPENGL_API) { - if (ctxconfig->profile == GLFW_OPENGL_CORE_PROFILE) + if (wndconfig->glProfile == GLFW_OPENGL_CORE_PROFILE) mask |= EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR; - else if (ctxconfig->profile == GLFW_OPENGL_COMPAT_PROFILE) + else if (wndconfig->glProfile == GLFW_OPENGL_COMPAT_PROFILE) mask |= EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR; - if (ctxconfig->forward) + if (wndconfig->glForward) flags |= EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR; - if (ctxconfig->debug) + if (wndconfig->glDebug) flags |= EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR; } - if (ctxconfig->robustness) + if (wndconfig->glRobustness != GLFW_NO_ROBUSTNESS) { - if (ctxconfig->robustness == GLFW_NO_RESET_NOTIFICATION) + if (wndconfig->glRobustness == GLFW_NO_RESET_NOTIFICATION) strategy = EGL_NO_RESET_NOTIFICATION_KHR; - else if (ctxconfig->robustness == GLFW_LOSE_CONTEXT_ON_RESET) + else if (wndconfig->glRobustness == GLFW_LOSE_CONTEXT_ON_RESET) strategy = EGL_LOSE_CONTEXT_ON_RESET_KHR; flags |= EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR; } - if (ctxconfig->major != 1 || ctxconfig->minor != 0) + if (wndconfig->glMajor != 1 || wndconfig->glMinor != 0) { - setEGLattrib(EGL_CONTEXT_MAJOR_VERSION_KHR, ctxconfig->major); - setEGLattrib(EGL_CONTEXT_MINOR_VERSION_KHR, ctxconfig->minor); + setEGLattrib(EGL_CONTEXT_MAJOR_VERSION_KHR, wndconfig->glMajor); + setEGLattrib(EGL_CONTEXT_MINOR_VERSION_KHR, wndconfig->glMinor); } if (mask) @@ -375,15 +386,12 @@ int _glfwCreateContext(_GLFWwindow* window, { int index = 0; - if (ctxconfig->api == GLFW_OPENGL_ES_API) - setEGLattrib(EGL_CONTEXT_CLIENT_VERSION, ctxconfig->major); + if (wndconfig->clientAPI == GLFW_OPENGL_ES_API) + setEGLattrib(EGL_CONTEXT_CLIENT_VERSION, wndconfig->glMajor); setEGLattrib(EGL_NONE, EGL_NONE); } - // Context release behaviors (GL_KHR_context_flush_control) are not yet - // supported on EGL but are not a hard constraint, so ignore and continue - window->egl.context = eglCreateContext(_glfw.egl.display, config, share, attribs); @@ -430,7 +438,7 @@ void _glfwDestroyContext(_GLFWwindow* window) // Analyzes the specified context for possible recreation // int _glfwAnalyzeContext(const _GLFWwindow* window, - const _GLFWctxconfig* ctxconfig, + const _GLFWwndconfig* wndconfig, const _GLFWfbconfig* fbconfig) { #if defined(_GLFW_WIN32) @@ -474,7 +482,12 @@ void _glfwPlatformMakeContextCurrent(_GLFWwindow* window) EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); } - _glfwSetCurrentContext(window); + _glfwCurrentWindow = window; +} + +_GLFWwindow* _glfwPlatformGetCurrentContext(void) +{ + return _glfwCurrentWindow; } void _glfwPlatformSwapBuffers(_GLFWwindow* window) @@ -513,21 +526,21 @@ GLFWglproc _glfwPlatformGetProcAddress(const char* procname) GLFWAPI EGLDisplay glfwGetEGLDisplay(void) { - _GLFW_REQUIRE_INIT_OR_RETURN(EGL_NO_DISPLAY); + _GLFW_REQUIRE_INIT_OR_RETURN(NULL); return _glfw.egl.display; } GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* handle) { _GLFWwindow* window = (_GLFWwindow*) handle; - _GLFW_REQUIRE_INIT_OR_RETURN(EGL_NO_CONTEXT); + _GLFW_REQUIRE_INIT_OR_RETURN(NULL); return window->egl.context; } GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* handle) { _GLFWwindow* window = (_GLFWwindow*) handle; - _GLFW_REQUIRE_INIT_OR_RETURN(EGL_NO_SURFACE); + _GLFW_REQUIRE_INIT_OR_RETURN(0); return window->egl.surface; } diff --git a/extern/glfw/src/egl_context.h b/extern/glfw/src/egl_platform.h similarity index 69% rename from extern/glfw/src/egl_context.h rename to extern/glfw/src/egl_platform.h index 21d6852..1109eb9 100644 --- a/extern/glfw/src/egl_context.h +++ b/extern/glfw/src/egl_platform.h @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 EGL - www.glfw.org +// GLFW 3.0 EGL - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -25,8 +25,8 @@ // //======================================================================== -#ifndef _egl_context_h_ -#define _egl_context_h_ +#ifndef _egl_platform_h_ +#define _egl_platform_h_ #include @@ -40,13 +40,18 @@ #include #endif -#define _GLFW_PLATFORM_FBCONFIG EGLConfig egl -#define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextEGL egl -#define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE _GLFWlibraryEGL egl +#define _GLFW_PLATFORM_FBCONFIG EGLConfig egl +#define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextEGL egl +#define _GLFW_PLATFORM_LIBRARY_OPENGL_STATE _GLFWlibraryEGL egl -// EGL-specific per-context data -// +//======================================================================== +// GLFW platform specific types +//======================================================================== + +//------------------------------------------------------------------------ +// Platform-specific OpenGL context structure +//------------------------------------------------------------------------ typedef struct _GLFWcontextEGL { EGLConfig config; @@ -56,12 +61,12 @@ typedef struct _GLFWcontextEGL #if defined(_GLFW_X11) XVisualInfo* visual; #endif - } _GLFWcontextEGL; -// EGL-specific global data -// +//------------------------------------------------------------------------ +// Platform-specific library global data for EGL +//------------------------------------------------------------------------ typedef struct _GLFWlibraryEGL { EGLDisplay display; @@ -72,14 +77,4 @@ typedef struct _GLFWlibraryEGL } _GLFWlibraryEGL; -int _glfwInitContextAPI(void); -void _glfwTerminateContextAPI(void); -int _glfwCreateContext(_GLFWwindow* window, - const _GLFWctxconfig* ctxconfig, - const _GLFWfbconfig* fbconfig); -void _glfwDestroyContext(_GLFWwindow* window); -int _glfwAnalyzeContext(const _GLFWwindow* window, - const _GLFWctxconfig* ctxconfig, - const _GLFWfbconfig* fbconfig); - -#endif // _egl_context_h_ +#endif // _egl_platform_h_ diff --git a/extern/glfw/src/gamma.c b/extern/glfw/src/gamma.c new file mode 100644 index 0000000..8d78304 --- /dev/null +++ b/extern/glfw/src/gamma.c @@ -0,0 +1,126 @@ +//======================================================================== +// GLFW 3.0 - www.glfw.org +//------------------------------------------------------------------------ +// Copyright (c) 2010 Camilla Berglund +// +// 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. +// +//======================================================================== + +#include "internal.h" + +#include +#include +#include + +#if defined(_MSC_VER) + #include +#endif + + +////////////////////////////////////////////////////////////////////////// +////// GLFW internal API ////// +////////////////////////////////////////////////////////////////////////// + +void _glfwAllocGammaArrays(GLFWgammaramp* ramp, unsigned int size) +{ + ramp->red = calloc(size, sizeof(unsigned short)); + ramp->green = calloc(size, sizeof(unsigned short)); + ramp->blue = calloc(size, sizeof(unsigned short)); + ramp->size = size; +} + +void _glfwFreeGammaArrays(GLFWgammaramp* ramp) +{ + free(ramp->red); + free(ramp->green); + free(ramp->blue); + + memset(ramp, 0, sizeof(GLFWgammaramp)); +} + + +////////////////////////////////////////////////////////////////////////// +////// GLFW public API ////// +////////////////////////////////////////////////////////////////////////// + +GLFWAPI void glfwSetGamma(GLFWmonitor* handle, float gamma) +{ + int i; + unsigned short values[256]; + GLFWgammaramp ramp; + + _GLFW_REQUIRE_INIT(); + + if (gamma <= 0.f) + { + _glfwInputError(GLFW_INVALID_VALUE, + "Gamma value must be greater than zero"); + return; + } + + for (i = 0; i < 256; i++) + { + double value; + + // Calculate intensity + value = i / 255.0; + // Apply gamma curve + value = pow(value, 1.0 / gamma) * 65535.0 + 0.5; + + // Clamp to value range + if (value > 65535.0) + value = 65535.0; + + values[i] = (unsigned short) value; + } + + ramp.red = values; + ramp.green = values; + ramp.blue = values; + ramp.size = 256; + + glfwSetGammaRamp(handle, &ramp); +} + +GLFWAPI const GLFWgammaramp* glfwGetGammaRamp(GLFWmonitor* handle) +{ + _GLFWmonitor* monitor = (_GLFWmonitor*) handle; + + _GLFW_REQUIRE_INIT_OR_RETURN(NULL); + + _glfwFreeGammaArrays(&monitor->currentRamp); + _glfwPlatformGetGammaRamp(monitor, &monitor->currentRamp); + + return &monitor->currentRamp; +} + +GLFWAPI void glfwSetGammaRamp(GLFWmonitor* handle, const GLFWgammaramp* ramp) +{ + _GLFWmonitor* monitor = (_GLFWmonitor*) handle; + + _GLFW_REQUIRE_INIT(); + + if (!monitor->originalRamp.size) + _glfwPlatformGetGammaRamp(monitor, &monitor->originalRamp); + + _glfwPlatformSetGammaRamp(monitor, ramp); +} + diff --git a/extern/glfw/src/glfw3.pc.in b/extern/glfw/src/glfw3.pc.in index f2e4d97..175c902 100644 --- a/extern/glfw/src/glfw3.pc.in +++ b/extern/glfw/src/glfw3.pc.in @@ -1,10 +1,10 @@ prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=${prefix} includedir=${prefix}/include -libdir=${exec_prefix}/lib@LIB_SUFFIX@ +libdir=${exec_prefix}/lib Name: GLFW -Description: A multi-platform library for OpenGL, window and input +Description: A portable library for OpenGL, window and input Version: @GLFW_VERSION_FULL@ URL: http://www.glfw.org/ Requires.private: @GLFW_PKG_DEPS@ diff --git a/extern/glfw/src/glx_context.c b/extern/glfw/src/glx_context.c index 562abf7..58c2575 100644 --- a/extern/glfw/src/glx_context.c +++ b/extern/glfw/src/glx_context.c @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 GLX - www.glfw.org +// GLFW 3.0 GLX - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -30,6 +30,7 @@ #include #include #include +#include // This is the only glXGetProcAddress variant not declared by glxext.h @@ -42,11 +43,20 @@ void (*glXGetProcAddressEXT(const GLubyte* procName))(); // Returns the specified attribute of the specified GLXFBConfig +// NOTE: Do not call this unless we have found GLX 1.3+ or GLX_SGIX_fbconfig // static int getFBConfigAttrib(GLXFBConfig fbconfig, int attrib) { int value; - glXGetFBConfigAttrib(_glfw.x11.display, fbconfig, attrib, &value); + + if (_glfw.glx.SGIX_fbconfig) + { + _glfw.glx.GetFBConfigAttribSGIX(_glfw.x11.display, + fbconfig, attrib, &value); + } + else + glXGetFBConfigAttrib(_glfw.x11.display, fbconfig, attrib, &value); + return value; } @@ -65,15 +75,28 @@ static GLboolean chooseFBConfig(const _GLFWfbconfig* desired, GLXFBConfig* resul if (strcmp(vendor, "Chromium") == 0) { // HACK: This is a (hopefully temporary) workaround for Chromium - // (VirtualBox GL) not setting the window bit on any GLXFBConfigs + // (VirtualBox GL) not setting the window bit on any GLXFBConfigs trustWindowBit = GL_FALSE; } - nativeConfigs = glXGetFBConfigs(_glfw.x11.display, _glfw.x11.screen, - &nativeCount); + if (_glfw.glx.SGIX_fbconfig) + { + nativeConfigs = _glfw.glx.ChooseFBConfigSGIX(_glfw.x11.display, + _glfw.x11.screen, + NULL, + &nativeCount); + } + else + { + nativeConfigs = glXGetFBConfigs(_glfw.x11.display, + _glfw.x11.screen, + &nativeCount); + } + if (!nativeCount) { - _glfwInputError(GLFW_API_UNAVAILABLE, "GLX: No GLXFBConfigs returned"); + _glfwInputError(GLFW_API_UNAVAILABLE, + "GLX: No GLXFBConfigs returned"); return GL_FALSE; } @@ -85,9 +108,10 @@ static GLboolean chooseFBConfig(const _GLFWfbconfig* desired, GLXFBConfig* resul const GLXFBConfig n = nativeConfigs[i]; _GLFWfbconfig* u = usableConfigs + usableCount; - if (!getFBConfigAttrib(n, GLX_VISUAL_ID)) + if (!getFBConfigAttrib(n, GLX_DOUBLEBUFFER) || + !getFBConfigAttrib(n, GLX_VISUAL_ID)) { - // Only consider GLXFBConfigs with associated visuals + // Only consider double-buffered GLXFBConfigs with associated visuals continue; } @@ -120,11 +144,7 @@ static GLboolean chooseFBConfig(const _GLFWfbconfig* desired, GLXFBConfig* resul u->accumAlphaBits = getFBConfigAttrib(n, GLX_ACCUM_ALPHA_SIZE); u->auxBuffers = getFBConfigAttrib(n, GLX_AUX_BUFFERS); - - if (getFBConfigAttrib(n, GLX_STEREO)) - u->stereo = GL_TRUE; - if (getFBConfigAttrib(n, GLX_DOUBLEBUFFER)) - u->doublebuffer = GL_TRUE; + u->stereo = getFBConfigAttrib(n, GLX_STEREO); if (_glfw.glx.ARB_multisample) u->samples = getFBConfigAttrib(n, GLX_SAMPLES); @@ -152,6 +172,15 @@ static GLXContext createLegacyContext(_GLFWwindow* window, GLXFBConfig fbconfig, GLXContext share) { + if (_glfw.glx.SGIX_fbconfig) + { + return _glfw.glx.CreateContextWithConfigSGIX(_glfw.x11.display, + fbconfig, + GLX_RGBA_TYPE, + share, + True); + } + return glXCreateNewContext(_glfw.x11.display, fbconfig, GLX_RGBA_TYPE, @@ -168,11 +197,24 @@ static GLXContext createLegacyContext(_GLFWwindow* window, // int _glfwInitContextAPI(void) { - if (!_glfwInitTLS()) - return GL_FALSE; - #ifdef _GLFW_DLOPEN_LIBGL - _glfw.glx.libGL = dlopen("libGL.so.1", RTLD_LAZY | RTLD_GLOBAL); + int i; + char* libGL_names[ ] = + { + "libGL.so", + "libGL.so.1", + "/usr/lib/libGL.so", + "/usr/lib/libGL.so.1", + NULL + }; + + for (i = 0; libGL_names[i] != NULL; i++) + { + _glfw.glx.libGL = dlopen(libGL_names[i], RTLD_LAZY | RTLD_GLOBAL); + if (_glfw.glx.libGL) + break; + } + if (!_glfw.glx.libGL) { _glfwInputError(GLFW_PLATFORM_ERROR, "GLX: Failed to find libGL"); @@ -180,11 +222,19 @@ int _glfwInitContextAPI(void) } #endif + if (pthread_key_create(&_glfw.glx.current, NULL) != 0) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "GLX: Failed to create context TLS"); + return GL_FALSE; + } + + // Check if GLX is supported on this display if (!glXQueryExtension(_glfw.x11.display, &_glfw.glx.errorBase, &_glfw.glx.eventBase)) { - _glfwInputError(GLFW_API_UNAVAILABLE, "GLX: GLX extension not found"); + _glfwInputError(GLFW_API_UNAVAILABLE, "GLX: GLX support not found"); return GL_FALSE; } @@ -197,13 +247,6 @@ int _glfwInitContextAPI(void) return GL_FALSE; } - if (_glfw.glx.versionMajor == 1 && _glfw.glx.versionMinor < 3) - { - _glfwInputError(GLFW_API_UNAVAILABLE, - "GLX: GLX version 1.3 is required"); - return GL_FALSE; - } - if (_glfwPlatformExtensionSupported("GLX_EXT_swap_control")) { _glfw.glx.SwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC) @@ -231,6 +274,26 @@ int _glfwInitContextAPI(void) _glfw.glx.MESA_swap_control = GL_TRUE; } + if (_glfwPlatformExtensionSupported("GLX_SGIX_fbconfig")) + { + _glfw.glx.GetFBConfigAttribSGIX = (PFNGLXGETFBCONFIGATTRIBSGIXPROC) + _glfwPlatformGetProcAddress("glXGetFBConfigAttribSGIX"); + _glfw.glx.ChooseFBConfigSGIX = (PFNGLXCHOOSEFBCONFIGSGIXPROC) + _glfwPlatformGetProcAddress("glXChooseFBConfigSGIX"); + _glfw.glx.CreateContextWithConfigSGIX = (PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) + _glfwPlatformGetProcAddress("glXCreateContextWithConfigSGIX"); + _glfw.glx.GetVisualFromFBConfigSGIX = (PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) + _glfwPlatformGetProcAddress("glXGetVisualFromFBConfigSGIX"); + + if (_glfw.glx.GetFBConfigAttribSGIX && + _glfw.glx.ChooseFBConfigSGIX && + _glfw.glx.CreateContextWithConfigSGIX && + _glfw.glx.GetVisualFromFBConfigSGIX) + { + _glfw.glx.SGIX_fbconfig = GL_TRUE; + } + } + if (_glfwPlatformExtensionSupported("GLX_ARB_multisample")) _glfw.glx.ARB_multisample = GL_TRUE; @@ -255,9 +318,6 @@ int _glfwInitContextAPI(void) if (_glfwPlatformExtensionSupported("GLX_EXT_create_context_es2_profile")) _glfw.glx.EXT_create_context_es2_profile = GL_TRUE; - if (_glfwPlatformExtensionSupported("GLX_ARB_context_flush_control")) - _glfw.glx.ARB_context_flush_control = GL_TRUE; - return GL_TRUE; } @@ -274,7 +334,7 @@ void _glfwTerminateContextAPI(void) } #endif - _glfwTerminateTLS(); + pthread_key_delete(_glfw.glx.current); } #define setGLXattrib(attribName, attribValue) \ @@ -284,18 +344,18 @@ void _glfwTerminateContextAPI(void) assert((size_t) index < sizeof(attribs) / sizeof(attribs[0])); \ } -// Create the OpenGL or OpenGL ES context +// Prepare for creation of the OpenGL context // int _glfwCreateContext(_GLFWwindow* window, - const _GLFWctxconfig* ctxconfig, + const _GLFWwndconfig* wndconfig, const _GLFWfbconfig* fbconfig) { int attribs[40]; GLXFBConfig native; GLXContext share = NULL; - if (ctxconfig->share) - share = ctxconfig->share->glx.context; + if (wndconfig->share) + share = wndconfig->share->glx.context; if (!chooseFBConfig(fbconfig, &native)) { @@ -305,15 +365,22 @@ int _glfwCreateContext(_GLFWwindow* window, } // Retrieve the corresponding visual - window->glx.visual = glXGetVisualFromFBConfig(_glfw.x11.display, native); - if (!window->glx.visual) + if (_glfw.glx.SGIX_fbconfig) + { + window->glx.visual = + _glfw.glx.GetVisualFromFBConfigSGIX(_glfw.x11.display, native); + } + else + window->glx.visual = glXGetVisualFromFBConfig(_glfw.x11.display, native); + + if (window->glx.visual == NULL) { _glfwInputError(GLFW_PLATFORM_ERROR, "GLX: Failed to retrieve visual for GLXFBConfig"); return GL_FALSE; } - if (ctxconfig->api == GLFW_OPENGL_ES_API) + if (wndconfig->clientAPI == GLFW_OPENGL_ES_API) { if (!_glfw.glx.ARB_create_context || !_glfw.glx.ARB_create_context_profile || @@ -326,7 +393,7 @@ int _glfwCreateContext(_GLFWwindow* window, } } - if (ctxconfig->forward) + if (wndconfig->glForward) { if (!_glfw.glx.ARB_create_context) { @@ -337,7 +404,7 @@ int _glfwCreateContext(_GLFWwindow* window, } } - if (ctxconfig->profile) + if (wndconfig->glProfile) { if (!_glfw.glx.ARB_create_context || !_glfw.glx.ARB_create_context_profile) @@ -355,63 +422,46 @@ int _glfwCreateContext(_GLFWwindow* window, { int index = 0, mask = 0, flags = 0, strategy = 0; - if (ctxconfig->api == GLFW_OPENGL_API) + if (wndconfig->clientAPI == GLFW_OPENGL_API) { - if (ctxconfig->forward) + if (wndconfig->glForward) flags |= GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; - if (ctxconfig->debug) + if (wndconfig->glDebug) flags |= GLX_CONTEXT_DEBUG_BIT_ARB; - if (ctxconfig->profile) + if (wndconfig->glProfile) { - if (ctxconfig->profile == GLFW_OPENGL_CORE_PROFILE) + if (wndconfig->glProfile == GLFW_OPENGL_CORE_PROFILE) mask |= GLX_CONTEXT_CORE_PROFILE_BIT_ARB; - else if (ctxconfig->profile == GLFW_OPENGL_COMPAT_PROFILE) + else if (wndconfig->glProfile == GLFW_OPENGL_COMPAT_PROFILE) mask |= GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; } } else mask |= GLX_CONTEXT_ES2_PROFILE_BIT_EXT; - if (ctxconfig->robustness) + if (wndconfig->glRobustness != GLFW_NO_ROBUSTNESS) { if (_glfw.glx.ARB_create_context_robustness) { - if (ctxconfig->robustness == GLFW_NO_RESET_NOTIFICATION) + if (wndconfig->glRobustness == GLFW_NO_RESET_NOTIFICATION) strategy = GLX_NO_RESET_NOTIFICATION_ARB; - else if (ctxconfig->robustness == GLFW_LOSE_CONTEXT_ON_RESET) + else if (wndconfig->glRobustness == GLFW_LOSE_CONTEXT_ON_RESET) strategy = GLX_LOSE_CONTEXT_ON_RESET_ARB; flags |= GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB; } } - if (ctxconfig->release) - { - if (_glfw.glx.ARB_context_flush_control) - { - if (ctxconfig->release == GLFW_RELEASE_BEHAVIOR_NONE) - { - setGLXattrib(GLX_CONTEXT_RELEASE_BEHAVIOR_ARB, - GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB); - } - else if (ctxconfig->release == GLFW_RELEASE_BEHAVIOR_FLUSH) - { - setGLXattrib(GLX_CONTEXT_RELEASE_BEHAVIOR_ARB, - GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB); - } - } - } - - if (ctxconfig->major != 1 || ctxconfig->minor != 0) + if (wndconfig->glMajor != 1 || wndconfig->glMinor != 0) { // NOTE: Only request an explicitly versioned context when - // necessary, as explicitly requesting version 1.0 does not - // always return the highest available version + // necessary, as explicitly requesting version 1.0 does not always + // return the highest available version - setGLXattrib(GLX_CONTEXT_MAJOR_VERSION_ARB, ctxconfig->major); - setGLXattrib(GLX_CONTEXT_MINOR_VERSION_ARB, ctxconfig->minor); + setGLXattrib(GLX_CONTEXT_MAJOR_VERSION_ARB, wndconfig->glMajor); + setGLXattrib(GLX_CONTEXT_MINOR_VERSION_ARB, wndconfig->glMinor); } if (mask) @@ -432,16 +482,15 @@ int _glfwCreateContext(_GLFWwindow* window, True, attribs); - if (!window->glx.context) + if (window->glx.context == NULL) { // HACK: This is a fallback for the broken Mesa implementation of - // GLX_ARB_create_context_profile, which fails default 1.0 - // context creation with a GLXBadProfileARB error in violation - // of the extension spec + // GLX_ARB_create_context_profile, which fails default 1.0 context + // creation with a GLXBadProfileARB error in violation of the spec if (_glfw.x11.errorCode == _glfw.glx.errorBase + GLXBadProfileARB && - ctxconfig->api == GLFW_OPENGL_API && - ctxconfig->profile == GLFW_OPENGL_ANY_PROFILE && - ctxconfig->forward == GL_FALSE) + wndconfig->clientAPI == GLFW_OPENGL_API && + wndconfig->glProfile == GLFW_OPENGL_ANY_PROFILE && + wndconfig->glForward == GL_FALSE) { window->glx.context = createLegacyContext(window, native, share); } @@ -452,7 +501,7 @@ int _glfwCreateContext(_GLFWwindow* window, _glfwReleaseXErrorHandler(); - if (!window->glx.context) + if (window->glx.context == NULL) { _glfwInputXError(GLFW_PLATFORM_ERROR, "GLX: Failed to create context"); return GL_FALSE; @@ -496,7 +545,12 @@ void _glfwPlatformMakeContextCurrent(_GLFWwindow* window) else glXMakeCurrent(_glfw.x11.display, None, NULL); - _glfwSetCurrentContext(window); + pthread_setspecific(_glfw.glx.current, window); +} + +_GLFWwindow* _glfwPlatformGetCurrentContext(void) +{ + return (_GLFWwindow*) pthread_getspecific(_glfw.glx.current); } void _glfwPlatformSwapBuffers(_GLFWwindow* window) diff --git a/extern/glfw/src/glx_context.h b/extern/glfw/src/glx_platform.h similarity index 69% rename from extern/glfw/src/glx_context.h rename to extern/glfw/src/glx_platform.h index 918ab00..74e60a8 100644 --- a/extern/glfw/src/glx_context.h +++ b/extern/glfw/src/glx_platform.h @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 GLX - www.glfw.org +// GLFW 3.0 GLX - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -25,8 +25,8 @@ // //======================================================================== -#ifndef _glx_context_h_ -#define _glx_context_h_ +#ifndef _glx_platform_h_ +#define _glx_platform_h_ #define GLX_GLXEXT_LEGACY #include @@ -57,40 +57,53 @@ #error "No OpenGL entry point retrieval mechanism was enabled" #endif -#define _GLFW_PLATFORM_FBCONFIG GLXFBConfig glx -#define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextGLX glx -#define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE _GLFWlibraryGLX glx +#define _GLFW_PLATFORM_FBCONFIG GLXFBConfig glx +#define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextGLX glx +#define _GLFW_PLATFORM_LIBRARY_OPENGL_STATE _GLFWlibraryGLX glx #ifndef GLX_MESA_swap_control typedef int (*PFNGLXSWAPINTERVALMESAPROC)(int); #endif -// GLX-specific per-context data -// +//======================================================================== +// GLFW platform specific types +//======================================================================== + +//------------------------------------------------------------------------ +// Platform-specific OpenGL context structure +//------------------------------------------------------------------------ typedef struct _GLFWcontextGLX { - // Rendering context - GLXContext context; - // Visual of selected GLXFBConfig - XVisualInfo* visual; + GLXContext context; // OpenGL rendering context + XVisualInfo* visual; // Visual for selected GLXFBConfig } _GLFWcontextGLX; -// GLX-specific global data -// +//------------------------------------------------------------------------ +// Platform-specific library global data for GLX +//------------------------------------------------------------------------ typedef struct _GLFWlibraryGLX { + // Server-side GLX version int versionMajor, versionMinor; int eventBase; int errorBase; + // TLS key for per-thread current context/window + pthread_key_t current; + // GLX extensions PFNGLXSWAPINTERVALSGIPROC SwapIntervalSGI; PFNGLXSWAPINTERVALEXTPROC SwapIntervalEXT; PFNGLXSWAPINTERVALMESAPROC SwapIntervalMESA; + PFNGLXGETFBCONFIGATTRIBSGIXPROC GetFBConfigAttribSGIX; + PFNGLXCHOOSEFBCONFIGSGIXPROC ChooseFBConfigSGIX; + PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC CreateContextWithConfigSGIX; + PFNGLXGETVISUALFROMFBCONFIGSGIXPROC GetVisualFromFBConfigSGIX; PFNGLXCREATECONTEXTATTRIBSARBPROC CreateContextAttribsARB; + GLboolean SGIX_fbconfig; GLboolean SGI_swap_control; GLboolean EXT_swap_control; GLboolean MESA_swap_control; @@ -100,21 +113,11 @@ typedef struct _GLFWlibraryGLX GLboolean ARB_create_context_profile; GLboolean ARB_create_context_robustness; GLboolean EXT_create_context_es2_profile; - GLboolean ARB_context_flush_control; #if defined(_GLFW_DLOPEN_LIBGL) - // dlopen handle for libGL.so (for glfwGetProcAddress) - void* libGL; + void* libGL; // dlopen handle for libGL.so #endif - } _GLFWlibraryGLX; -int _glfwInitContextAPI(void); -void _glfwTerminateContextAPI(void); -int _glfwCreateContext(_GLFWwindow* window, - const _GLFWctxconfig* ctxconfig, - const _GLFWfbconfig* fbconfig); -void _glfwDestroyContext(_GLFWwindow* window); - -#endif // _glx_context_h_ +#endif // _glx_platform_h_ diff --git a/extern/glfw/src/init.c b/extern/glfw/src/init.c index 4a044ed..d34abea 100644 --- a/extern/glfw/src/init.c +++ b/extern/glfw/src/init.c @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 - www.glfw.org +// GLFW 3.0 - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -33,15 +33,14 @@ #include -// The three global variables below comprise all global data in GLFW, except for -// various static const translation tables. Any other global variable is a bug. - // Global state shared between compilation units of GLFW // These are documented in internal.h // GLboolean _glfwInitialized = GL_FALSE; _GLFWlibrary _glfw; + +// The current error callback // This is outside of _glfw so it can be initialized and usable before // glfwInit is called, which lets that function report errors // @@ -129,7 +128,7 @@ GLFWAPI int glfwInit(void) } _glfw.monitors = _glfwPlatformGetMonitors(&_glfw.monitorCount); - if (!_glfw.monitorCount) + if (_glfw.monitors == NULL) { _glfwInputError(GLFW_PLATFORM_ERROR, "No monitors found"); _glfwPlatformTerminate(); @@ -153,12 +152,10 @@ GLFWAPI void glfwTerminate(void) memset(&_glfw.callbacks, 0, sizeof(_glfw.callbacks)); + // Close all remaining windows while (_glfw.windowListHead) glfwDestroyWindow((GLFWwindow*) _glfw.windowListHead); - while (_glfw.cursorListHead) - glfwDestroyCursor((GLFWcursor*) _glfw.cursorListHead); - for (i = 0; i < _glfw.monitorCount; i++) { _GLFWmonitor* monitor = _glfw.monitors[i]; @@ -166,13 +163,12 @@ GLFWAPI void glfwTerminate(void) _glfwPlatformSetGammaRamp(monitor, &monitor->originalRamp); } - _glfwFreeMonitors(_glfw.monitors, _glfw.monitorCount); + _glfwDestroyMonitors(_glfw.monitors, _glfw.monitorCount); _glfw.monitors = NULL; _glfw.monitorCount = 0; _glfwPlatformTerminate(); - memset(&_glfw, 0, sizeof(_glfw)); _glfwInitialized = GL_FALSE; } diff --git a/extern/glfw/src/input.c b/extern/glfw/src/input.c index a2d8ddc..1bd7e6d 100644 --- a/extern/glfw/src/input.c +++ b/extern/glfw/src/input.c @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 - www.glfw.org +// GLFW 3.0 - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -27,11 +27,6 @@ #include "internal.h" -#include -#if defined(_MSC_VER) - #include -#endif - // Internal key state used for sticky keys #define _GLFW_STICK 3 @@ -40,7 +35,7 @@ // static void setCursorMode(_GLFWwindow* window, int newMode) { - const int oldMode = window->cursorMode; + int oldMode; if (newMode != GLFW_CURSOR_NORMAL && newMode != GLFW_CURSOR_HIDDEN && @@ -50,11 +45,10 @@ static void setCursorMode(_GLFWwindow* window, int newMode) return; } + oldMode = window->cursorMode; if (oldMode == newMode) return; - window->cursorMode = newMode; - if (window == _glfw.focusedWindow) { if (oldMode == GLFW_CURSOR_DISABLED) @@ -75,8 +69,10 @@ static void setCursorMode(_GLFWwindow* window, int newMode) _glfwPlatformSetCursorPos(window, width / 2.0, height / 2.0); } - _glfwPlatformApplyCursorMode(window); + _glfwPlatformSetCursorMode(window, newMode); } + + window->cursorMode = newMode; } // Set sticky keys mode for the specified window @@ -93,8 +89,8 @@ static void setStickyKeys(_GLFWwindow* window, int enabled) // Release all sticky keys for (i = 0; i <= GLFW_KEY_LAST; i++) { - if (window->keys[i] == _GLFW_STICK) - window->keys[i] = GLFW_RELEASE; + if (window->key[i] == _GLFW_STICK) + window->key[i] = GLFW_RELEASE; } } @@ -115,8 +111,8 @@ static void setStickyMouseButtons(_GLFWwindow* window, int enabled) // Release all sticky mouse buttons for (i = 0; i <= GLFW_MOUSE_BUTTON_LAST; i++) { - if (window->mouseButtons[i] == _GLFW_STICK) - window->mouseButtons[i] = GLFW_RELEASE; + if (window->mouseButton[i] == _GLFW_STICK) + window->mouseButton[i] = GLFW_RELEASE; } } @@ -130,42 +126,36 @@ static void setStickyMouseButtons(_GLFWwindow* window, int enabled) void _glfwInputKey(_GLFWwindow* window, int key, int scancode, int action, int mods) { + GLboolean repeated = GL_FALSE; + + if (action == GLFW_RELEASE && window->key[key] == GLFW_RELEASE) + return; + if (key >= 0 && key <= GLFW_KEY_LAST) { - GLboolean repeated = GL_FALSE; - - if (action == GLFW_RELEASE && window->keys[key] == GLFW_RELEASE) - return; - - if (action == GLFW_PRESS && window->keys[key] == GLFW_PRESS) + if (action == GLFW_PRESS && window->key[key] == GLFW_PRESS) repeated = GL_TRUE; if (action == GLFW_RELEASE && window->stickyKeys) - window->keys[key] = _GLFW_STICK; + window->key[key] = _GLFW_STICK; else - window->keys[key] = (char) action; - - if (repeated) - action = GLFW_REPEAT; + window->key[key] = (char) action; } + if (repeated) + action = GLFW_REPEAT; + if (window->callbacks.key) window->callbacks.key((GLFWwindow*) window, key, scancode, action, mods); } -void _glfwInputChar(_GLFWwindow* window, unsigned int codepoint, int mods, int plain) +void _glfwInputChar(_GLFWwindow* window, unsigned int character) { - if (codepoint < 32 || (codepoint > 126 && codepoint < 160)) + if (character < 32 || (character > 126 && character < 160)) return; - if (window->callbacks.charmods) - window->callbacks.charmods((GLFWwindow*) window, codepoint, mods); - - if (plain) - { - if (window->callbacks.character) - window->callbacks.character((GLFWwindow*) window, codepoint); - } + if (window->callbacks.character) + window->callbacks.character((GLFWwindow*) window, character); } void _glfwInputScroll(_GLFWwindow* window, double xoffset, double yoffset) @@ -181,9 +171,9 @@ void _glfwInputMouseClick(_GLFWwindow* window, int button, int action, int mods) // Register mouse button action if (action == GLFW_RELEASE && window->stickyMouseButtons) - window->mouseButtons[button] = _GLFW_STICK; + window->mouseButton[button] = _GLFW_STICK; else - window->mouseButtons[button] = (char) action; + window->mouseButton[button] = (char) action; if (window->callbacks.mouseButton) window->callbacks.mouseButton((GLFWwindow*) window, button, action, mods); @@ -222,12 +212,6 @@ void _glfwInputCursorEnter(_GLFWwindow* window, int entered) window->callbacks.cursorEnter((GLFWwindow*) window, entered); } -void _glfwInputDrop(_GLFWwindow* window, int count, const char** names) -{ - if (window->callbacks.drop) - window->callbacks.drop((GLFWwindow*) window, count, names); -} - ////////////////////////////////////////////////////////////////////////// ////// GLFW public API ////// @@ -288,14 +272,14 @@ GLFWAPI int glfwGetKey(GLFWwindow* handle, int key) return GLFW_RELEASE; } - if (window->keys[key] == _GLFW_STICK) + if (window->key[key] == _GLFW_STICK) { // Sticky mode: release key now - window->keys[key] = GLFW_RELEASE; + window->key[key] = GLFW_RELEASE; return GLFW_PRESS; } - return (int) window->keys[key]; + return (int) window->key[key]; } GLFWAPI int glfwGetMouseButton(GLFWwindow* handle, int button) @@ -311,29 +295,25 @@ GLFWAPI int glfwGetMouseButton(GLFWwindow* handle, int button) return GLFW_RELEASE; } - if (window->mouseButtons[button] == _GLFW_STICK) + if (window->mouseButton[button] == _GLFW_STICK) { // Sticky mode: release mouse button now - window->mouseButtons[button] = GLFW_RELEASE; + window->mouseButton[button] = GLFW_RELEASE; return GLFW_PRESS; } - return (int) window->mouseButtons[button]; + return (int) window->mouseButton[button]; } GLFWAPI void glfwGetCursorPos(GLFWwindow* handle, double* xpos, double* ypos) { _GLFWwindow* window = (_GLFWwindow*) handle; - if (xpos) - *xpos = 0; - if (ypos) - *ypos = 0; - _GLFW_REQUIRE_INIT(); if (xpos) *xpos = window->cursorPosX; + if (ypos) *ypos = window->cursorPosY; } @@ -363,72 +343,6 @@ GLFWAPI void glfwSetCursorPos(GLFWwindow* handle, double xpos, double ypos) _glfwPlatformSetCursorPos(window, xpos, ypos); } -GLFWAPI GLFWcursor* glfwCreateCursor(const GLFWimage* image, int xhot, int yhot) -{ - _GLFWcursor* cursor; - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - - cursor = calloc(1, sizeof(_GLFWcursor)); - cursor->next = _glfw.cursorListHead; - _glfw.cursorListHead = cursor; - - if (!_glfwPlatformCreateCursor(cursor, image, xhot, yhot)) - { - glfwDestroyCursor((GLFWcursor*) cursor); - return NULL; - } - - return (GLFWcursor*) cursor; -} - -GLFWAPI void glfwDestroyCursor(GLFWcursor* handle) -{ - _GLFWcursor* cursor = (_GLFWcursor*) handle; - - _GLFW_REQUIRE_INIT(); - - if (cursor == NULL) - return; - - // Make sure the cursor is not being used by any window - { - _GLFWwindow* window; - - for (window = _glfw.windowListHead; window; window = window->next) - { - if (window->cursor == cursor) - glfwSetCursor((GLFWwindow*) window, NULL); - } - } - - _glfwPlatformDestroyCursor(cursor); - - // Unlink cursor from global linked list - { - _GLFWcursor** prev = &_glfw.cursorListHead; - - while (*prev != cursor) - prev = &((*prev)->next); - - *prev = cursor->next; - } - - free(cursor); -} - -GLFWAPI void glfwSetCursor(GLFWwindow* windowHandle, GLFWcursor* cursorHandle) -{ - _GLFWwindow* window = (_GLFWwindow*) windowHandle; - _GLFWcursor* cursor = (_GLFWcursor*) cursorHandle; - - _GLFW_REQUIRE_INIT(); - - _glfwPlatformSetCursor(window, cursor); - - window->cursor = cursor; -} - GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* handle, GLFWkeyfun cbfun) { _GLFWwindow* window = (_GLFWwindow*) handle; @@ -445,14 +359,6 @@ GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* handle, GLFWcharfun cbfun) return cbfun; } -GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* handle, GLFWcharmodsfun cbfun) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - _GLFW_SWAP_POINTERS(window->callbacks.charmods, cbfun); - return cbfun; -} - GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* handle, GLFWmousebuttonfun cbfun) { @@ -489,93 +395,3 @@ GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* handle, return cbfun; } -GLFWAPI GLFWdropfun glfwSetDropCallback(GLFWwindow* handle, GLFWdropfun cbfun) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - _GLFW_SWAP_POINTERS(window->callbacks.drop, cbfun); - return cbfun; -} - -GLFWAPI int glfwJoystickPresent(int joy) -{ - _GLFW_REQUIRE_INIT_OR_RETURN(0); - - if (joy < 0 || joy > GLFW_JOYSTICK_LAST) - { - _glfwInputError(GLFW_INVALID_ENUM, NULL); - return 0; - } - - return _glfwPlatformJoystickPresent(joy); -} - -GLFWAPI const float* glfwGetJoystickAxes(int joy, int* count) -{ - *count = 0; - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - - if (joy < 0 || joy > GLFW_JOYSTICK_LAST) - { - _glfwInputError(GLFW_INVALID_ENUM, NULL); - return NULL; - } - - return _glfwPlatformGetJoystickAxes(joy, count); -} - -GLFWAPI const unsigned char* glfwGetJoystickButtons(int joy, int* count) -{ - *count = 0; - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - - if (joy < 0 || joy > GLFW_JOYSTICK_LAST) - { - _glfwInputError(GLFW_INVALID_ENUM, NULL); - return NULL; - } - - return _glfwPlatformGetJoystickButtons(joy, count); -} - -GLFWAPI const char* glfwGetJoystickName(int joy) -{ - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - - if (joy < 0 || joy > GLFW_JOYSTICK_LAST) - { - _glfwInputError(GLFW_INVALID_ENUM, NULL); - return NULL; - } - - return _glfwPlatformGetJoystickName(joy); -} - -GLFWAPI void glfwSetClipboardString(GLFWwindow* handle, const char* string) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - _GLFW_REQUIRE_INIT(); - _glfwPlatformSetClipboardString(window, string); -} - -GLFWAPI const char* glfwGetClipboardString(GLFWwindow* handle) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - return _glfwPlatformGetClipboardString(window); -} - -GLFWAPI double glfwGetTime(void) -{ - _GLFW_REQUIRE_INIT_OR_RETURN(0.0); - return _glfwPlatformGetTime(); -} - -GLFWAPI void glfwSetTime(double time) -{ - _GLFW_REQUIRE_INIT(); - _glfwPlatformSetTime(time); -} - diff --git a/extern/glfw/src/internal.h b/extern/glfw/src/internal.h index 0565256..b6e2136 100644 --- a/extern/glfw/src/internal.h +++ b/extern/glfw/src/internal.h @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 - www.glfw.org +// GLFW 3.0 - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -29,11 +29,7 @@ #define _internal_h_ -#if defined(_GLFW_USE_CONFIG_H) - #include "glfw_config.h" -#endif - -#define _GLFW_VERSION_NUMBER "3.1.0" +#include "config.h" #if defined(_GLFW_USE_OPENGL) // This is the default for glfw3.h @@ -58,13 +54,12 @@ #include "../deps/GL/glext.h" #endif +typedef struct _GLFWhints _GLFWhints; typedef struct _GLFWwndconfig _GLFWwndconfig; -typedef struct _GLFWctxconfig _GLFWctxconfig; typedef struct _GLFWfbconfig _GLFWfbconfig; typedef struct _GLFWwindow _GLFWwindow; typedef struct _GLFWlibrary _GLFWlibrary; typedef struct _GLFWmonitor _GLFWmonitor; -typedef struct _GLFWcursor _GLFWcursor; #if defined(_GLFW_COCOA) #include "cocoa_platform.h" @@ -72,10 +67,6 @@ typedef struct _GLFWcursor _GLFWcursor; #include "win32_platform.h" #elif defined(_GLFW_X11) #include "x11_platform.h" -#elif defined(_GLFW_WAYLAND) - #include "wl_platform.h" -#elif defined(_GLFW_MIR) - #include "mir_platform.h" #else #error "No supported window creation API selected" #endif @@ -137,14 +128,14 @@ typedef struct _GLFWcursor _GLFWcursor; //======================================================================== -// Platform-independent structures +// Internal types //======================================================================== -/*! @brief Window configuration. +/*! @brief Window and context configuration. * - * Parameters relating to the creation of the window but not directly related - * to the framebuffer. This is used to pass window creation parameters from - * shared code to the platform API. + * Parameters relating to the creation of the context and window but not + * directly related to the framebuffer. This is used to pass window and + * context creation parameters from shared code to the platform API. */ struct _GLFWwndconfig { @@ -154,29 +145,14 @@ struct _GLFWwndconfig GLboolean resizable; GLboolean visible; GLboolean decorated; - GLboolean focused; - GLboolean autoIconify; - GLboolean floating; + int clientAPI; + int glMajor; + int glMinor; + GLboolean glForward; + GLboolean glDebug; + int glProfile; + int glRobustness; _GLFWmonitor* monitor; -}; - - -/*! @brief Context configuration. - * - * Parameters relating to the creation of the context but not directly related - * to the framebuffer. This is used to pass context creation parameters from - * shared code to the platform API. - */ -struct _GLFWctxconfig -{ - int api; - int major; - int minor; - GLboolean forward; - GLboolean debug; - int profile; - int robustness; - int release; _GLFWwindow* share; }; @@ -202,12 +178,11 @@ struct _GLFWfbconfig int accumBlueBits; int accumAlphaBits; int auxBuffers; - int stereo; + GLboolean stereo; int samples; - int sRGB; - int doublebuffer; + GLboolean sRGB; - // This is defined in the context API's context.h + // This is defined in the context API's platform.h _GLFW_PLATFORM_FBCONFIG; }; @@ -222,33 +197,26 @@ struct _GLFWwindow GLboolean iconified; GLboolean resizable; GLboolean decorated; - GLboolean autoIconify; - GLboolean floating; GLboolean visible; GLboolean closed; void* userPointer; GLFWvidmode videoMode; _GLFWmonitor* monitor; - _GLFWcursor* cursor; // Window input state GLboolean stickyKeys; GLboolean stickyMouseButtons; double cursorPosX, cursorPosY; int cursorMode; - char mouseButtons[GLFW_MOUSE_BUTTON_LAST + 1]; - char keys[GLFW_KEY_LAST + 1]; + char mouseButton[GLFW_MOUSE_BUTTON_LAST + 1]; + char key[GLFW_KEY_LAST + 1]; // OpenGL extensions and context attributes - struct { - int api; - int major, minor, revision; - GLboolean forward, debug; - int profile; - int robustness; - int release; - } context; - + int clientAPI; + int glMajor, glMinor, glRevision; + GLboolean glForward, glDebug; + int glProfile; + int glRobustness; #if defined(_GLFW_USE_OPENGL) PFNGLGETSTRINGIPROC GetStringi; #endif @@ -267,13 +235,11 @@ struct _GLFWwindow GLFWscrollfun scroll; GLFWkeyfun key; GLFWcharfun character; - GLFWcharmodsfun charmods; - GLFWdropfun drop; } callbacks; // This is defined in the window API's platform.h _GLFW_PLATFORM_WINDOW_STATE; - // This is defined in the context API's context.h + // This is defined in the context API's platform.h _GLFW_PLATFORM_CONTEXT_STATE; }; @@ -299,16 +265,6 @@ struct _GLFWmonitor }; -/*! @brief Cursor structure - */ -struct _GLFWcursor -{ - _GLFWcursor* next; - - // This is defined in the window API's platform.h - _GLFW_PLATFORM_CURSOR_STATE; -}; - /*! @brief Library global data. */ struct _GLFWlibrary @@ -325,31 +281,24 @@ struct _GLFWlibrary int accumBlueBits; int accumAlphaBits; int auxBuffers; - int stereo; - int resizable; - int visible; - int decorated; - int focused; - int autoIconify; - int floating; + GLboolean stereo; + GLboolean resizable; + GLboolean visible; + GLboolean decorated; int samples; - int sRGB; + GLboolean sRGB; int refreshRate; - int doublebuffer; - int api; - int major; - int minor; - int forward; - int debug; - int profile; - int robustness; - int release; + int clientAPI; + int glMajor; + int glMinor; + GLboolean glForward; + GLboolean glDebug; + int glProfile; + int glRobustness; } hints; double cursorPosX, cursorPosY; - _GLFWcursor* cursorListHead; - _GLFWwindow* windowListHead; _GLFWwindow* focusedWindow; @@ -362,14 +311,8 @@ struct _GLFWlibrary // This is defined in the window API's platform.h _GLFW_PLATFORM_LIBRARY_WINDOW_STATE; - // This is defined in the context API's context.h - _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE; - // This is defined in the platform's time.h - _GLFW_PLATFORM_LIBRARY_TIME_STATE; - // This is defined in the platform's joystick.h - _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE; - // This is defined in the platform's tls.h - _GLFW_PLATFORM_LIBRARY_TLS_STATE; + // This is defined in the context API's platform.h + _GLFW_PLATFORM_LIBRARY_OPENGL_STATE; }; @@ -417,11 +360,12 @@ const char* _glfwPlatformGetVersionString(void); */ void _glfwPlatformSetCursorPos(_GLFWwindow* window, double xpos, double ypos); -/*! @brief Applies the cursor mode of the specified window to the system. - * @param[in] window The window whose cursor mode to apply. +/*! @brief Sets up the specified cursor mode for the specified window. + * @param[in] window The window whose cursor mode to change. + * @param[in] mode The desired cursor mode. * @ingroup platform */ -void _glfwPlatformApplyCursorMode(_GLFWwindow* window); +void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode); /*! @copydoc glfwGetMonitors * @ingroup platform @@ -509,7 +453,6 @@ void _glfwPlatformSetTime(double time); */ int _glfwPlatformCreateWindow(_GLFWwindow* window, const _GLFWwndconfig* wndconfig, - const _GLFWctxconfig* ctxconfig, const _GLFWfbconfig* fbconfig); /*! @ingroup platform @@ -546,11 +489,6 @@ void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height); */ void _glfwPlatformGetFramebufferSize(_GLFWwindow* window, int* width, int* height); -/*! @copydoc glfwGetWindowFrameSize - * @ingroup platform - */ -void _glfwPlatformGetWindowFrameSize(_GLFWwindow* window, int* left, int* top, int* right, int* bottom); - /*! @copydoc glfwIconifyWindow * @ingroup platform */ @@ -566,10 +504,6 @@ void _glfwPlatformRestoreWindow(_GLFWwindow* window); */ void _glfwPlatformShowWindow(_GLFWwindow* window); -/*! @ingroup platform - */ -void _glfwPlatformUnhideWindow(_GLFWwindow* window); - /*! @copydoc glfwHideWindow * @ingroup platform */ @@ -585,11 +519,6 @@ void _glfwPlatformPollEvents(void); */ void _glfwPlatformWaitEvents(void); -/*! @copydoc glfwPostEmptyEvent - * @ingroup platform - */ -void _glfwPlatformPostEmptyEvent(void); - /*! @copydoc glfwMakeContextCurrent * @ingroup platform */ @@ -610,8 +539,7 @@ void _glfwPlatformSwapBuffers(_GLFWwindow* window); */ void _glfwPlatformSwapInterval(int interval); -/*! @copydoc glfwExtensionSupported - * @ingroup platform +/*! @ingroup platform */ int _glfwPlatformExtensionSupported(const char* extension); @@ -620,21 +548,6 @@ int _glfwPlatformExtensionSupported(const char* extension); */ GLFWglproc _glfwPlatformGetProcAddress(const char* procname); -/*! @copydoc glfwCreateCursor - * @ingroup platform - */ -int _glfwPlatformCreateCursor(_GLFWcursor* cursor, const GLFWimage* image, int xhot, int yhot); - -/*! @copydoc glfwDestroyCursor - * @ingroup platform - */ -void _glfwPlatformDestroyCursor(_GLFWcursor* cursor); - -/*! @copydoc glfwSetCursor - * @ingroup platform - */ -void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor); - //======================================================================== // Event API functions @@ -711,13 +624,10 @@ void _glfwInputKey(_GLFWwindow* window, int key, int scancode, int action, int m /*! @brief Notifies shared code of a Unicode character input event. * @param[in] window The window that received the event. - * @param[in] codepoint The Unicode code point of the input character. - * @param[in] mods Bit field describing which modifier keys were held down. - * @param[in] plain `GL_TRUE` if the character is regular text input, or - * `GL_FALSE` otherwise. + * @param[in] character The Unicode code point of the input character. * @ingroup event */ -void _glfwInputChar(_GLFWwindow* window, unsigned int codepoint, int mods, int plain); +void _glfwInputChar(_GLFWwindow* window, unsigned int character); /*! @brief Notifies shared code of a scroll event. * @param[in] window The window that received the event. @@ -765,14 +675,6 @@ void _glfwInputMonitorChange(void); */ void _glfwInputError(int error, const char* format, ...); -/*! @brief Notifies dropped object over window. - * @param[in] window The window that received the event. - * @param[in] count The number of dropped objects. - * @param[in] names The names of the dropped objects. - * @ingroup event - */ -void _glfwInputDrop(_GLFWwindow* window, int count, const char** names); - //======================================================================== // Utility functions @@ -814,14 +716,13 @@ const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired, unsigned int count); /*! @brief Retrieves the attributes of the current context. - * @param[in] ctxconfig The desired context attributes. * @return `GL_TRUE` if successful, or `GL_FALSE` if the context is unusable. * @ingroup utility */ -GLboolean _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig); +GLboolean _glfwRefreshContextAttribs(void); /*! @brief Checks whether the desired context attributes are valid. - * @param[in] ctxconfig The context attributes to check. + * @param[in] wndconfig The context attributes to check. * @return `GL_TRUE` if the context attributes are valid, or `GL_FALSE` * otherwise. * @ingroup utility @@ -830,16 +731,16 @@ GLboolean _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig); * exists and whether all relevant options have supported and non-conflicting * values. */ -GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig); +GLboolean _glfwIsValidContextConfig(_GLFWwndconfig* wndconfig); /*! @brief Checks whether the current context fulfils the specified hard * constraints. - * @param[in] ctxconfig The desired context attributes. + * @param[in] wndconfig The desired context attributes. * @return `GL_TRUE` if the context fulfils the hard constraints, or `GL_FALSE` * otherwise. * @ingroup utility */ -GLboolean _glfwIsValidContext(const _GLFWctxconfig* ctxconfig); +GLboolean _glfwIsValidContext(_GLFWwndconfig* wndconfig); /*! @ingroup utility */ @@ -849,23 +750,16 @@ void _glfwAllocGammaArrays(GLFWgammaramp* ramp, unsigned int size); */ void _glfwFreeGammaArrays(GLFWgammaramp* ramp); -/*! @brief Allocates and returns a monitor object with the specified name - * and dimensions. - * @param[in] name The name of the monitor. - * @param[in] widthMM The width, in mm, of the monitor's display area. - * @param[in] heightMM The height, in mm, of the monitor's display area. - * @return The newly created object. - * @ingroup utility +/*! @ingroup utility */ -_GLFWmonitor* _glfwAllocMonitor(const char* name, int widthMM, int heightMM); - -/*! @brief Frees a monitor object and any data associated with it. - * @ingroup utility - */ -void _glfwFreeMonitor(_GLFWmonitor* monitor); +_GLFWmonitor* _glfwCreateMonitor(const char* name, int widthMM, int heightMM); /*! @ingroup utility */ -void _glfwFreeMonitors(_GLFWmonitor** monitors, int count); +void _glfwDestroyMonitor(_GLFWmonitor* monitor); + +/*! @ingroup utility + */ +void _glfwDestroyMonitors(_GLFWmonitor** monitors, int count); #endif // _internal_h_ diff --git a/extern/glfw/src/iokit_joystick.h b/extern/glfw/src/iokit_joystick.h deleted file mode 100644 index c08809f..0000000 --- a/extern/glfw/src/iokit_joystick.h +++ /dev/null @@ -1,61 +0,0 @@ -//======================================================================== -// GLFW 3.1 IOKit - www.glfw.org -//------------------------------------------------------------------------ -// Copyright (c) 2006-2014 Camilla Berglund -// -// 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 _iokit_joystick_h_ -#define _iokit_joystick_h_ - -#include -#include -#include -#include - -#define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE \ - _GLFWjoystickIOKit iokit_js[GLFW_JOYSTICK_LAST + 1] - - -// IOKit-specific per-joystick data -// -typedef struct _GLFWjoystickIOKit -{ - int present; - char name[256]; - - IOHIDDeviceInterface** interface; - - CFMutableArrayRef axisElements; - CFMutableArrayRef buttonElements; - CFMutableArrayRef hatElements; - - float* axes; - unsigned char* buttons; - -} _GLFWjoystickIOKit; - - -void _glfwInitJoysticks(void); -void _glfwTerminateJoysticks(void); - -#endif // _iokit_joystick_h_ diff --git a/extern/glfw/src/win32_tls.c b/extern/glfw/src/joystick.c similarity index 54% rename from extern/glfw/src/win32_tls.c rename to extern/glfw/src/joystick.c index 088e25d..b53ea11 100644 --- a/extern/glfw/src/win32_tls.c +++ b/extern/glfw/src/joystick.c @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 Win32 - www.glfw.org +// GLFW 3.0 - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -29,41 +29,62 @@ ////////////////////////////////////////////////////////////////////////// -////// GLFW internal API ////// +////// GLFW public API ////// ////////////////////////////////////////////////////////////////////////// -int _glfwInitTLS(void) +GLFWAPI int glfwJoystickPresent(int joy) { - _glfw.win32_tls.context = TlsAlloc(); - if (_glfw.win32_tls.context == TLS_OUT_OF_INDEXES) + _GLFW_REQUIRE_INIT_OR_RETURN(0); + + if (joy < 0 || joy > GLFW_JOYSTICK_LAST) { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Win32: Failed to allocate TLS index"); - return GL_FALSE; + _glfwInputError(GLFW_INVALID_ENUM, NULL); + return 0; } - _glfw.win32_tls.allocated = GL_TRUE; - return GL_TRUE; + return _glfwPlatformJoystickPresent(joy); } -void _glfwTerminateTLS(void) +GLFWAPI const float* glfwGetJoystickAxes(int joy, int* count) { - if (_glfw.win32_tls.allocated) - TlsFree(_glfw.win32_tls.context); + *count = 0; + + _GLFW_REQUIRE_INIT_OR_RETURN(NULL); + + if (joy < 0 || joy > GLFW_JOYSTICK_LAST) + { + _glfwInputError(GLFW_INVALID_ENUM, NULL); + return NULL; + } + + return _glfwPlatformGetJoystickAxes(joy, count); } -void _glfwSetCurrentContext(_GLFWwindow* context) +GLFWAPI const unsigned char* glfwGetJoystickButtons(int joy, int* count) { - TlsSetValue(_glfw.win32_tls.context, context); + *count = 0; + + _GLFW_REQUIRE_INIT_OR_RETURN(NULL); + + if (joy < 0 || joy > GLFW_JOYSTICK_LAST) + { + _glfwInputError(GLFW_INVALID_ENUM, NULL); + return NULL; + } + + return _glfwPlatformGetJoystickButtons(joy, count); } - -////////////////////////////////////////////////////////////////////////// -////// GLFW platform API ////// -////////////////////////////////////////////////////////////////////////// - -_GLFWwindow* _glfwPlatformGetCurrentContext(void) +GLFWAPI const char* glfwGetJoystickName(int joy) { - return TlsGetValue(_glfw.win32_tls.context); + _GLFW_REQUIRE_INIT_OR_RETURN(NULL); + + if (joy < 0 || joy > GLFW_JOYSTICK_LAST) + { + _glfwInputError(GLFW_INVALID_ENUM, NULL); + return NULL; + } + + return _glfwPlatformGetJoystickName(joy); } diff --git a/extern/glfw/src/linux_joystick.h b/extern/glfw/src/linux_joystick.h deleted file mode 100644 index 8f713d8..0000000 --- a/extern/glfw/src/linux_joystick.h +++ /dev/null @@ -1,51 +0,0 @@ -//======================================================================== -// GLFW 3.1 Linux - www.glfw.org -//------------------------------------------------------------------------ -// Copyright (c) 2014 Jonas Ådahl -// -// 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 _linux_joystick_h_ -#define _linux_joystick_h_ - -#define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE \ - _GLFWjoystickLinux linux_js[GLFW_JOYSTICK_LAST + 1] - - -// Linux-specific per-joystick data -// -typedef struct _GLFWjoystickLinux -{ - int present; - int fd; - float* axes; - int axisCount; - unsigned char* buttons; - int buttonCount; - char* name; -} _GLFWjoystickLinux; - - -void _glfwInitJoysticks(void); -void _glfwTerminateJoysticks(void); - -#endif // _linux_joystick_h_ diff --git a/extern/glfw/src/mir_init.c b/extern/glfw/src/mir_init.c deleted file mode 100644 index ab16861..0000000 --- a/extern/glfw/src/mir_init.c +++ /dev/null @@ -1,78 +0,0 @@ -//======================================================================== -// GLFW 3.1 Mir - www.glfw.org -//------------------------------------------------------------------------ -// Copyright (c) 2014 Brandon Schaefer -// -// 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. -// -//======================================================================== - -#include "internal.h" - - -////////////////////////////////////////////////////////////////////////// -////// GLFW internal API ////// -////////////////////////////////////////////////////////////////////////// - -int _glfwPlatformInit(void) -{ - _glfw.mir.connection = mir_connect_sync(NULL, __PRETTY_FUNCTION__); - - if (!mir_connection_is_valid(_glfw.mir.connection)) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unable to connect to Server"); - return GL_FALSE; - } - - _glfw.mir.display = - mir_connection_get_egl_native_display(_glfw.mir.connection); - - if (!_glfwInitContextAPI()) - return GL_FALSE; - - _glfwInitTimer(); - _glfwInitJoysticks(); - - return GL_TRUE; -} - -void _glfwPlatformTerminate(void) -{ - _glfwTerminateContextAPI(); - _glfwTerminateJoysticks(); - - mir_connection_release(_glfw.mir.connection); -} - -const char* _glfwPlatformGetVersionString(void) -{ - const char* version = _GLFW_VERSION_NUMBER " Mir EGL " -#if defined(_POSIX_TIMERS) && defined(_POSIX_MONOTONIC_CLOCK) - " clock_gettime" -#endif -#if defined(_GLFW_BUILD_DLL) - " shared" -#endif - ; - - return version; -} - diff --git a/extern/glfw/src/mir_monitor.c b/extern/glfw/src/mir_monitor.c deleted file mode 100644 index 5fb73ef..0000000 --- a/extern/glfw/src/mir_monitor.c +++ /dev/null @@ -1,136 +0,0 @@ -//======================================================================== -// GLFW 3.1 Mir - www.glfw.org -//------------------------------------------------------------------------ -// Copyright (c) 2014 Brandon Schaefer -// -// 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. -// -//======================================================================== - -#include "internal.h" - -#include - - -////////////////////////////////////////////////////////////////////////// -////// GLFW platform API ////// -////////////////////////////////////////////////////////////////////////// - -_GLFWmonitor** _glfwPlatformGetMonitors(int* count) -{ - int i, found = 0; - _GLFWmonitor** monitors = NULL; - MirDisplayConfiguration* displayConfig = - mir_connection_create_display_config(_glfw.mir.connection); - - *count = 0; - - for (i = 0; i < displayConfig->num_outputs; i++) - { - const MirDisplayOutput* out = displayConfig->outputs + i; - - if (out->used && - out->connected && - out->num_modes && - out->current_mode < out->num_modes) - { - found++; - - monitors[found] = realloc(monitors, sizeof(_GLFWmonitor*) * found); - monitors[found] = _glfwAllocMonitor("Unknown", - out->physical_width_mm, - out->physical_height_mm); - - monitors[found]->mir.x = out->position_x; - monitors[found]->mir.y = out->position_y; - monitors[found]->mir.output_id = out->output_id; - monitors[found]->mir.cur_mode = out->current_mode; - } - } - - mir_display_config_destroy(displayConfig); - - *count = found; - return monitors; -} - -GLboolean _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second) -{ - return first->mir.output_id == second->mir.output_id; -} - -void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos) -{ - if (xpos) - *xpos = monitor->mir.x; - if (ypos) - *ypos = monitor->mir.y; -} - -GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found) -{ - int i; - GLFWvidmode* modes = NULL; - MirDisplayConfiguration* displayConfig = - mir_connection_create_display_config(_glfw.mir.connection); - - for (i = 0; i < displayConfig->num_outputs; i++) - { - const MirDisplayOutput* out = displayConfig->outputs + i; - if (out->output_id != monitor->mir.output_id) - continue; - - modes = calloc(out->num_modes, sizeof(GLFWvidmode)); - - for (*found = 0; *found < out->num_modes; (*found)++) - { - modes[*found].width = out->modes[*found].horizontal_resolution; - modes[*found].height = out->modes[*found].vertical_resolution; - modes[*found].refreshRate = out->modes[*found].refresh_rate; - modes[*found].redBits = 8; - modes[*found].greenBits = 8; - modes[*found].blueBits = 8; - } - - break; - } - - mir_display_config_destroy(displayConfig); - - return modes; -} - -void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode) -{ - *mode = monitor->modes[monitor->mir.cur_mode]; -} - -void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp) -{ - _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); -} - -void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp) -{ - _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); -} - diff --git a/extern/glfw/src/mir_platform.h b/extern/glfw/src/mir_platform.h deleted file mode 100644 index 4a3ebfb..0000000 --- a/extern/glfw/src/mir_platform.h +++ /dev/null @@ -1,92 +0,0 @@ -//======================================================================== -// GLFW 3.1 Mir - www.glfw.org -//------------------------------------------------------------------------ -// Copyright (c) 2014 Brandon Schaefer -// -// 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 _mir_platform_h_ -#define _mir_platform_h_ - -#include - -#include "posix_tls.h" -#include "posix_time.h" -#include "linux_joystick.h" - -#if defined(_GLFW_EGL) - #include "egl_context.h" -#else - #error "The Mir backend depends on EGL platform support" -#endif - -#define _GLFW_EGL_NATIVE_WINDOW window->mir.window -#define _GLFW_EGL_NATIVE_DISPLAY _glfw.mir.display - -#define _GLFW_PLATFORM_WINDOW_STATE _GLFWwindowMir mir -#define _GLFW_PLATFORM_MONITOR_STATE _GLFWmonitorMir mir -#define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE _GLFWlibraryMir mir -#define _GLFW_PLATFORM_CURSOR_STATE _GLFWcursorMir mir - - -// Mir-specific per-window data -// -typedef struct _GLFWwindowMir -{ - MirSurface* surface; - int width; - int height; - MirEGLNativeWindowType window; - -} _GLFWwindowMir; - - -// Mir-specific per-monitor data -// -typedef struct _GLFWmonitorMir -{ - int cur_mode; - int output_id; - int x; - int y; - -} _GLFWmonitorMir; - - -// Mir-specific global data -// -typedef struct _GLFWlibraryMir -{ - MirConnection* connection; - MirEGLNativeDisplayType display; - -} _GLFWlibraryMir; - - -// Mir-specific per-cursor data -// TODO: Only system cursors are implemented in mir atm. Need to wait for support. -// -typedef struct _GLFWcursorMir -{ -} _GLFWcursorMir; - -#endif // _mir_platform_h_ diff --git a/extern/glfw/src/mir_window.c b/extern/glfw/src/mir_window.c deleted file mode 100644 index 0a63745..0000000 --- a/extern/glfw/src/mir_window.c +++ /dev/null @@ -1,547 +0,0 @@ -//======================================================================== -// GLFW 3.1 Mir - www.glfw.org -//------------------------------------------------------------------------ -// Copyright (c) 2014 Brandon Schaefer -// -// 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. -// -//======================================================================== - -#include "internal.h" -#include "xkb_unicode.h" - -#include - - -static MirPixelFormat findValidPixelFormat(void) -{ - unsigned int i, validFormats, size = 32; - MirPixelFormat formats[size]; - - mir_connection_get_available_surface_formats(_glfw.mir.connection, formats, - size, &validFormats); - - for (i = 0; i < validFormats; i++) - { - if (formats[i] == mir_pixel_format_abgr_8888 || - formats[i] == mir_pixel_format_xbgr_8888 || - formats[i] == mir_pixel_format_argb_8888 || - formats[i] == mir_pixel_format_xrgb_8888) - { - return formats[i]; - } - } - - return mir_pixel_format_invalid; -} - -static int mirModToGLFWMod(uint32_t mods) -{ - int publicMods = 0x0; - - if (mods & mir_key_modifier_alt) - publicMods |= GLFW_MOD_ALT; - else if (mods & mir_key_modifier_shift) - publicMods |= GLFW_MOD_SHIFT; - else if (mods & mir_key_modifier_ctrl) - publicMods |= GLFW_MOD_CONTROL; - else if (mods & mir_key_modifier_meta) - publicMods |= GLFW_MOD_SUPER; - - return publicMods; -} - -// Taken from wl_init.c -static int toGLFWKeyCode(uint32_t key) -{ - switch (key) - { - case KEY_GRAVE: return GLFW_KEY_GRAVE_ACCENT; - case KEY_1: return GLFW_KEY_1; - case KEY_2: return GLFW_KEY_2; - case KEY_3: return GLFW_KEY_3; - case KEY_4: return GLFW_KEY_4; - case KEY_5: return GLFW_KEY_5; - case KEY_6: return GLFW_KEY_6; - case KEY_7: return GLFW_KEY_7; - case KEY_8: return GLFW_KEY_8; - case KEY_9: return GLFW_KEY_9; - case KEY_0: return GLFW_KEY_0; - case KEY_MINUS: return GLFW_KEY_MINUS; - case KEY_EQUAL: return GLFW_KEY_EQUAL; - case KEY_Q: return GLFW_KEY_Q; - case KEY_W: return GLFW_KEY_W; - case KEY_E: return GLFW_KEY_E; - case KEY_R: return GLFW_KEY_R; - case KEY_T: return GLFW_KEY_T; - case KEY_Y: return GLFW_KEY_Y; - case KEY_U: return GLFW_KEY_U; - case KEY_I: return GLFW_KEY_I; - case KEY_O: return GLFW_KEY_O; - case KEY_P: return GLFW_KEY_P; - case KEY_LEFTBRACE: return GLFW_KEY_LEFT_BRACKET; - case KEY_RIGHTBRACE: return GLFW_KEY_RIGHT_BRACKET; - case KEY_A: return GLFW_KEY_A; - case KEY_S: return GLFW_KEY_S; - case KEY_D: return GLFW_KEY_D; - case KEY_F: return GLFW_KEY_F; - case KEY_G: return GLFW_KEY_G; - case KEY_H: return GLFW_KEY_H; - case KEY_J: return GLFW_KEY_J; - case KEY_K: return GLFW_KEY_K; - case KEY_L: return GLFW_KEY_L; - case KEY_SEMICOLON: return GLFW_KEY_SEMICOLON; - case KEY_APOSTROPHE: return GLFW_KEY_APOSTROPHE; - case KEY_Z: return GLFW_KEY_Z; - case KEY_X: return GLFW_KEY_X; - case KEY_C: return GLFW_KEY_C; - case KEY_V: return GLFW_KEY_V; - case KEY_B: return GLFW_KEY_B; - case KEY_N: return GLFW_KEY_N; - case KEY_M: return GLFW_KEY_M; - case KEY_COMMA: return GLFW_KEY_COMMA; - case KEY_DOT: return GLFW_KEY_PERIOD; - case KEY_SLASH: return GLFW_KEY_SLASH; - case KEY_BACKSLASH: return GLFW_KEY_BACKSLASH; - case KEY_ESC: return GLFW_KEY_ESCAPE; - case KEY_TAB: return GLFW_KEY_TAB; - case KEY_LEFTSHIFT: return GLFW_KEY_LEFT_SHIFT; - case KEY_RIGHTSHIFT: return GLFW_KEY_RIGHT_SHIFT; - case KEY_LEFTCTRL: return GLFW_KEY_LEFT_CONTROL; - case KEY_RIGHTCTRL: return GLFW_KEY_RIGHT_CONTROL; - case KEY_LEFTALT: return GLFW_KEY_LEFT_ALT; - case KEY_RIGHTALT: return GLFW_KEY_RIGHT_ALT; - case KEY_LEFTMETA: return GLFW_KEY_LEFT_SUPER; - case KEY_RIGHTMETA: return GLFW_KEY_RIGHT_SUPER; - case KEY_MENU: return GLFW_KEY_MENU; - case KEY_NUMLOCK: return GLFW_KEY_NUM_LOCK; - case KEY_CAPSLOCK: return GLFW_KEY_CAPS_LOCK; - case KEY_PRINT: return GLFW_KEY_PRINT_SCREEN; - case KEY_SCROLLLOCK: return GLFW_KEY_SCROLL_LOCK; - case KEY_PAUSE: return GLFW_KEY_PAUSE; - case KEY_DELETE: return GLFW_KEY_DELETE; - case KEY_BACKSPACE: return GLFW_KEY_BACKSPACE; - case KEY_ENTER: return GLFW_KEY_ENTER; - case KEY_HOME: return GLFW_KEY_HOME; - case KEY_END: return GLFW_KEY_END; - case KEY_PAGEUP: return GLFW_KEY_PAGE_UP; - case KEY_PAGEDOWN: return GLFW_KEY_PAGE_DOWN; - case KEY_INSERT: return GLFW_KEY_INSERT; - case KEY_LEFT: return GLFW_KEY_LEFT; - case KEY_RIGHT: return GLFW_KEY_RIGHT; - case KEY_DOWN: return GLFW_KEY_DOWN; - case KEY_UP: return GLFW_KEY_UP; - case KEY_F1: return GLFW_KEY_F1; - case KEY_F2: return GLFW_KEY_F2; - case KEY_F3: return GLFW_KEY_F3; - case KEY_F4: return GLFW_KEY_F4; - case KEY_F5: return GLFW_KEY_F5; - case KEY_F6: return GLFW_KEY_F6; - case KEY_F7: return GLFW_KEY_F7; - case KEY_F8: return GLFW_KEY_F8; - case KEY_F9: return GLFW_KEY_F9; - case KEY_F10: return GLFW_KEY_F10; - case KEY_F11: return GLFW_KEY_F11; - case KEY_F12: return GLFW_KEY_F12; - case KEY_F13: return GLFW_KEY_F13; - case KEY_F14: return GLFW_KEY_F14; - case KEY_F15: return GLFW_KEY_F15; - case KEY_F16: return GLFW_KEY_F16; - case KEY_F17: return GLFW_KEY_F17; - case KEY_F18: return GLFW_KEY_F18; - case KEY_F19: return GLFW_KEY_F19; - case KEY_F20: return GLFW_KEY_F20; - case KEY_F21: return GLFW_KEY_F21; - case KEY_F22: return GLFW_KEY_F22; - case KEY_F23: return GLFW_KEY_F23; - case KEY_F24: return GLFW_KEY_F24; - case KEY_KPSLASH: return GLFW_KEY_KP_DIVIDE; - case KEY_KPDOT: return GLFW_KEY_KP_MULTIPLY; - case KEY_KPMINUS: return GLFW_KEY_KP_SUBTRACT; - case KEY_KPPLUS: return GLFW_KEY_KP_ADD; - case KEY_KP0: return GLFW_KEY_KP_0; - case KEY_KP1: return GLFW_KEY_KP_1; - case KEY_KP2: return GLFW_KEY_KP_2; - case KEY_KP3: return GLFW_KEY_KP_3; - case KEY_KP4: return GLFW_KEY_KP_4; - case KEY_KP5: return GLFW_KEY_KP_5; - case KEY_KP6: return GLFW_KEY_KP_6; - case KEY_KP7: return GLFW_KEY_KP_7; - case KEY_KP8: return GLFW_KEY_KP_8; - case KEY_KP9: return GLFW_KEY_KP_9; - case KEY_KPCOMMA: return GLFW_KEY_KP_DECIMAL; - case KEY_KPEQUAL: return GLFW_KEY_KP_EQUAL; - case KEY_KPENTER: return GLFW_KEY_KP_ENTER; - default: return GLFW_KEY_UNKNOWN; - } -} - -static void handleKeyEvent(const MirKeyEvent key, _GLFWwindow* window) -{ - const int pressed = key.action == mir_key_action_up ? GLFW_RELEASE : GLFW_PRESS; - const int mods = mirModToGLFWMod(key.modifiers); - const long text = _glfwKeySym2Unicode(key.key_code); - const int plain = !(mods & (GLFW_MOD_CONTROL | GLFW_MOD_ALT)); - - _glfwInputKey(window, toGLFWKeyCode(key.scan_code), key.scan_code, pressed, mods); - - if (text != -1) - _glfwInputChar(window, text, mods, plain); -} - -static void handleMouseButton(_GLFWwindow* window, - int pressed, int mods, MirMotionButton button) -{ - static int lastButton; - int publicButton; - const int publicMods = mirModToGLFWMod(mods); - - switch (button) - { - case mir_motion_button_primary: - publicButton = GLFW_MOUSE_BUTTON_LEFT; - break; - case mir_motion_button_secondary: - publicButton = GLFW_MOUSE_BUTTON_RIGHT; - break; - case mir_motion_button_tertiary: - publicButton = GLFW_MOUSE_BUTTON_MIDDLE; - break; - case mir_motion_button_forward: - // FIXME What is the forward button? - publicButton = GLFW_MOUSE_BUTTON_4; - break; - case mir_motion_button_back: - // FIXME What is the back button? - publicButton = GLFW_MOUSE_BUTTON_5; - break; - default: - publicButton = lastButton; - break; - } - - lastButton = publicButton; - - _glfwInputMouseClick(window, publicButton, pressed, publicMods); -} - -static void handleMouseMotion(_GLFWwindow* window, int x, int y) -{ - _glfwInputCursorMotion(window, x, y); -} - -static void handleMouseScroll(_GLFWwindow* window, int dx, int dy) -{ - _glfwInputScroll(window, dx, dy); -} - -static void handleMouseEvent(const MirMotionEvent motion, - int cord_index, - _GLFWwindow* window) -{ - switch (motion.action) - { - case mir_motion_action_down: - case mir_motion_action_pointer_down: - handleMouseButton(window, GLFW_PRESS, - motion.modifiers, motion.button_state); - break; - case mir_motion_action_up: - case mir_motion_action_pointer_up: - handleMouseButton(window, GLFW_RELEASE, - motion.modifiers, motion.button_state); - break; - case mir_motion_action_hover_move: - case mir_motion_action_move: - handleMouseMotion(window, - motion.pointer_coordinates[cord_index].x, - motion.pointer_coordinates[cord_index].y); - break; - case mir_motion_action_outside: - break; - case mir_motion_action_scroll: - handleMouseScroll(window, - motion.pointer_coordinates[cord_index].hscroll, - motion.pointer_coordinates[cord_index].vscroll); - break; - case mir_motion_action_cancel: - case mir_motion_action_hover_enter: - case mir_motion_action_hover_exit: - break; - default: - break; - - } -} - -static void handleMotionEvent(const MirMotionEvent motion, _GLFWwindow* window) -{ - int i; - for (i = 0; i < motion.pointer_count; i++) - handleMouseEvent(motion, i, window); -} - -static void handleInput(MirSurface* surface, const MirEvent* event, void* context) -{ - switch (event->type) - { - case mir_event_type_key: - handleKeyEvent(event->key, (_GLFWwindow*) context); - break; - case mir_event_type_motion: - handleMotionEvent(event->motion, (_GLFWwindow*) context); - break; - default: - break; - } -} - -static int createSurface(_GLFWwindow* window) -{ - MirSurfaceParameters params = - { - .name = "MirSurface", - .width = window->mir.width, - .height = window->mir.height, - .pixel_format = mir_pixel_format_invalid, - .buffer_usage = mir_buffer_usage_hardware, - .output_id = mir_display_output_id_invalid - }; - - MirEventDelegate delegate = - { - handleInput, - window - }; - - params.pixel_format = findValidPixelFormat(); - if (params.pixel_format == mir_pixel_format_invalid) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unable to find a correct pixel format"); - return GL_FALSE; - } - - window->mir.surface = - mir_connection_create_surface_sync(_glfw.mir.connection, ¶ms); - if (!mir_surface_is_valid(window->mir.surface)) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unable to create surface"); - return GL_FALSE; - } - - mir_surface_set_event_handler(window->mir.surface, &delegate); - - return GL_TRUE; -} - - -////////////////////////////////////////////////////////////////////////// -////// GLFW platform API ////// -////////////////////////////////////////////////////////////////////////// - -int _glfwPlatformCreateWindow(_GLFWwindow* window, - const _GLFWwndconfig* wndconfig, - const _GLFWctxconfig* ctxconfig, - const _GLFWfbconfig* fbconfig) -{ - if (!_glfwCreateContext(window, ctxconfig, fbconfig)) - return GL_FALSE; - - if (wndconfig->monitor) - { - GLFWvidmode mode; - _glfwPlatformGetVideoMode(wndconfig->monitor, &mode); - - mir_surface_set_type(window->mir.surface, mir_surface_state_fullscreen); - - if (wndconfig->width > mode.width || wndconfig->height > mode.height) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Requested surface size is to large (%i %i)", - wndconfig->width, wndconfig->height); - - return GL_FALSE; - } - } - - window->mir.width = wndconfig->width; - window->mir.height = wndconfig->height; - - if (!createSurface(window)) - return GL_FALSE; - - window->mir.window = mir_surface_get_egl_native_window(window->mir.surface); - - return GL_TRUE; -} - -void _glfwPlatformDestroyWindow(_GLFWwindow* window) -{ - if (mir_surface_is_valid(window->mir.surface)) - { - mir_surface_release_sync(window->mir.surface); - window->mir.surface = NULL; - } - - _glfwDestroyContext(window); -} - -void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title) -{ - _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); -} - -void _glfwPlatformSetWindowPos(_GLFWwindow* window, int xpos, int ypos) -{ - _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); -} - -void _glfwPlatformGetWindowFrameSize(_GLFWwindow* window, - int* left, int* top, - int* right, int* bottom) -{ - _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); -} - -void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos) -{ - _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); -} - -void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height) -{ - _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); -} - -void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height) -{ - if (width) - *width = window->mir.width; - if (height) - *height = window->mir.height; -} - -void _glfwPlatformIconifyWindow(_GLFWwindow* window) -{ - mir_surface_set_type(window->mir.surface, mir_surface_state_minimized); -} - -void _glfwPlatformRestoreWindow(_GLFWwindow* window) -{ - mir_surface_set_type(window->mir.surface, mir_surface_state_restored); -} - -void _glfwPlatformHideWindow(_GLFWwindow* window) -{ - _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); -} - -void _glfwPlatformShowWindow(_GLFWwindow* window) -{ - _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); -} - -void _glfwPlatformUnhideWindow(_GLFWwindow* window) -{ - _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); -} - -void _glfwPlatformPollEvents(void) -{ - // Mir does event handling in a different thread, so windows get events - // directly as they happen -} - -void _glfwPlatformWaitEvents(void) -{ - // Mir does event handling in a different thread, so windows get events - // directly as they happen -} - -void _glfwPlatformPostEmptyEvent(void) -{ -} - -void _glfwPlatformGetFramebufferSize(_GLFWwindow* window, int* width, int* height) -{ - if (width) - *width = window->mir.width; - if (height) - *height = window->mir.height; -} - -int _glfwPlatformCreateCursor(_GLFWcursor* cursor, - const GLFWimage* image, - int xhot, int yhot) -{ - _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); - - return GL_FALSE; -} - -void _glfwPlatformDestroyCursor(_GLFWcursor* cursor) -{ - _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); -} - -void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor) -{ - _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); -} - -void _glfwPlatformSetCursorPos(_GLFWwindow* window, double xpos, double ypos) -{ - _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); -} - -void _glfwPlatformApplyCursorMode(_GLFWwindow* window) -{ - _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); -} - -void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string) -{ - _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); -} - -const char* _glfwPlatformGetClipboardString(_GLFWwindow* window) -{ - _glfwInputError(GLFW_PLATFORM_ERROR, - "Mir: Unsupported Function %s!", __PRETTY_FUNCTION__); - - return NULL; -} - diff --git a/extern/glfw/src/monitor.c b/extern/glfw/src/monitor.c index ad35353..f80d5e9 100644 --- a/extern/glfw/src/monitor.c +++ b/extern/glfw/src/monitor.c @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 - www.glfw.org +// GLFW 3.0 - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -27,33 +27,46 @@ #include "internal.h" -#include #include #include #include +#if defined(_MSC_VER) + #include + #define strdup _strdup +#endif + // Lexical comparison function for GLFW video modes, used by qsort // static int compareVideoModes(const void* firstPtr, const void* secondPtr) { int firstBPP, secondBPP, firstSize, secondSize; - const GLFWvidmode* first = firstPtr; - const GLFWvidmode* second = secondPtr; + GLFWvidmode* first = (GLFWvidmode*) firstPtr; + GLFWvidmode* second = (GLFWvidmode*) secondPtr; // First sort on color bits per pixel - firstBPP = first->redBits + first->greenBits + first->blueBits; - secondBPP = second->redBits + second->greenBits + second->blueBits; + + firstBPP = first->redBits + + first->greenBits + + first->blueBits; + secondBPP = second->redBits + + second->greenBits + + second->blueBits; + if (firstBPP != secondBPP) return firstBPP - secondBPP; // Then sort on screen area, in pixels + firstSize = first->width * first->height; secondSize = second->width * second->height; + if (firstSize != secondSize) return firstSize - secondSize; // Lastly sort on refresh rate + return first->refreshRate - second->refreshRate; } @@ -100,7 +113,7 @@ void _glfwInputMonitorChange(void) { if (_glfwPlatformIsSameMonitor(_glfw.monitors[i], monitors[j])) { - _glfwFreeMonitor(_glfw.monitors[i]); + _glfwDestroyMonitor(_glfw.monitors[i]); _glfw.monitors[i] = monitors[j]; break; } @@ -154,7 +167,7 @@ void _glfwInputMonitorChange(void) _glfw.callbacks.monitor((GLFWmonitor*) _glfw.monitors[i], GLFW_CONNECTED); } - _glfwFreeMonitors(monitors, monitorCount); + _glfwDestroyMonitors(monitors, monitorCount); } @@ -162,7 +175,7 @@ void _glfwInputMonitorChange(void) ////// GLFW internal API ////// ////////////////////////////////////////////////////////////////////////// -_GLFWmonitor* _glfwAllocMonitor(const char* name, int widthMM, int heightMM) +_GLFWmonitor* _glfwCreateMonitor(const char* name, int widthMM, int heightMM) { _GLFWmonitor* monitor = calloc(1, sizeof(_GLFWmonitor)); monitor->name = strdup(name); @@ -172,7 +185,7 @@ _GLFWmonitor* _glfwAllocMonitor(const char* name, int widthMM, int heightMM) return monitor; } -void _glfwFreeMonitor(_GLFWmonitor* monitor) +void _glfwDestroyMonitor(_GLFWmonitor* monitor) { if (monitor == NULL) return; @@ -185,29 +198,12 @@ void _glfwFreeMonitor(_GLFWmonitor* monitor) free(monitor); } -void _glfwAllocGammaArrays(GLFWgammaramp* ramp, unsigned int size) -{ - ramp->red = calloc(size, sizeof(unsigned short)); - ramp->green = calloc(size, sizeof(unsigned short)); - ramp->blue = calloc(size, sizeof(unsigned short)); - ramp->size = size; -} - -void _glfwFreeGammaArrays(GLFWgammaramp* ramp) -{ - free(ramp->red); - free(ramp->green); - free(ramp->blue); - - memset(ramp, 0, sizeof(GLFWgammaramp)); -} - -void _glfwFreeMonitors(_GLFWmonitor** monitors, int count) +void _glfwDestroyMonitors(_GLFWmonitor** monitors, int count) { int i; for (i = 0; i < count; i++) - _glfwFreeMonitor(monitors[i]); + _glfwDestroyMonitor(monitors[i]); free(monitors); } @@ -229,21 +225,15 @@ const GLFWvidmode* _glfwChooseVideoMode(_GLFWmonitor* monitor, { current = monitor->modes + i; - colorDiff = 0; - - if (desired->redBits != GLFW_DONT_CARE) - colorDiff += abs(current->redBits - desired->redBits); - if (desired->greenBits != GLFW_DONT_CARE) - colorDiff += abs(current->greenBits - desired->greenBits); - if (desired->blueBits != GLFW_DONT_CARE) - colorDiff += abs(current->blueBits - desired->blueBits); + colorDiff = abs((current->redBits + current->greenBits + current->blueBits) - + (desired->redBits + desired->greenBits + desired->blueBits)); sizeDiff = abs((current->width - desired->width) * (current->width - desired->width) + (current->height - desired->height) * (current->height - desired->height)); - if (desired->refreshRate != GLFW_DONT_CARE) + if (desired->refreshRate) rateDiff = abs(current->refreshRate - desired->refreshRate); else rateDiff = UINT_MAX - current->refreshRate; @@ -310,14 +300,7 @@ GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void) GLFWAPI void glfwGetMonitorPos(GLFWmonitor* handle, int* xpos, int* ypos) { _GLFWmonitor* monitor = (_GLFWmonitor*) handle; - - if (xpos) - *xpos = 0; - if (ypos) - *ypos = 0; - _GLFW_REQUIRE_INIT(); - _glfwPlatformGetMonitorPos(monitor, xpos, ypos); } @@ -325,11 +308,6 @@ GLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor* handle, int* width, int* he { _GLFWmonitor* monitor = (_GLFWmonitor*) handle; - if (width) - *width = 0; - if (height) - *height = 0; - _GLFW_REQUIRE_INIT(); if (width) @@ -377,66 +355,3 @@ GLFWAPI const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* handle) return &monitor->currentMode; } -GLFWAPI void glfwSetGamma(GLFWmonitor* handle, float gamma) -{ - int i; - unsigned short values[256]; - GLFWgammaramp ramp; - - _GLFW_REQUIRE_INIT(); - - if (gamma <= 0.f) - { - _glfwInputError(GLFW_INVALID_VALUE, - "Gamma value must be greater than zero"); - return; - } - - for (i = 0; i < 256; i++) - { - double value; - - // Calculate intensity - value = i / 255.0; - // Apply gamma curve - value = pow(value, 1.0 / gamma) * 65535.0 + 0.5; - - // Clamp to value range - if (value > 65535.0) - value = 65535.0; - - values[i] = (unsigned short) value; - } - - ramp.red = values; - ramp.green = values; - ramp.blue = values; - ramp.size = 256; - - glfwSetGammaRamp(handle, &ramp); -} - -GLFWAPI const GLFWgammaramp* glfwGetGammaRamp(GLFWmonitor* handle) -{ - _GLFWmonitor* monitor = (_GLFWmonitor*) handle; - - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - - _glfwFreeGammaArrays(&monitor->currentRamp); - _glfwPlatformGetGammaRamp(monitor, &monitor->currentRamp); - - return &monitor->currentRamp; -} - -GLFWAPI void glfwSetGammaRamp(GLFWmonitor* handle, const GLFWgammaramp* ramp) -{ - _GLFWmonitor* monitor = (_GLFWmonitor*) handle; - - _GLFW_REQUIRE_INIT(); - - if (!monitor->originalRamp.size) - _glfwPlatformGetGammaRamp(monitor, &monitor->originalRamp); - - _glfwPlatformSetGammaRamp(monitor, ramp); -} - diff --git a/extern/glfw/src/nsgl_context.m b/extern/glfw/src/nsgl_context.m index 406685b..2c3dcca 100644 --- a/extern/glfw/src/nsgl_context.m +++ b/extern/glfw/src/nsgl_context.m @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 OS X - www.glfw.org +// GLFW 3.0 OS X - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2009-2010 Camilla Berglund // @@ -26,6 +26,8 @@ #include "internal.h" +#include + ////////////////////////////////////////////////////////////////////////// ////// GLFW internal API ////// @@ -35,8 +37,12 @@ // int _glfwInitContextAPI(void) { - if (!_glfwInitTLS()) + if (pthread_key_create(&_glfw.nsgl.current, NULL) != 0) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "NSOpenGL: Failed to create context TLS"); return GL_FALSE; + } _glfw.nsgl.framework = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengl")); @@ -54,48 +60,56 @@ int _glfwInitContextAPI(void) // void _glfwTerminateContextAPI(void) { - _glfwTerminateTLS(); + pthread_key_delete(_glfw.nsgl.current); } // Create the OpenGL context // int _glfwCreateContext(_GLFWwindow* window, - const _GLFWctxconfig* ctxconfig, + const _GLFWwndconfig* wndconfig, const _GLFWfbconfig* fbconfig) { unsigned int attributeCount = 0; - if (ctxconfig->api == GLFW_OPENGL_ES_API) + // OS X needs non-zero color size, so set resonable values + int colorBits = fbconfig->redBits + fbconfig->greenBits + fbconfig->blueBits; + if (colorBits == 0) + colorBits = 24; + else if (colorBits < 15) + colorBits = 15; + + if (wndconfig->clientAPI == GLFW_OPENGL_ES_API) { _glfwInputError(GLFW_VERSION_UNAVAILABLE, - "NSGL: This API does not support OpenGL ES"); + "NSOpenGL: This API does not support OpenGL ES"); return GL_FALSE; } #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 - if (ctxconfig->major == 3 && ctxconfig->minor < 2) + // Fail if any OpenGL version above 2.1 other than 3.2 was requested + if (wndconfig->glMajor == 3 && wndconfig->glMinor < 2) { _glfwInputError(GLFW_VERSION_UNAVAILABLE, - "NSGL: The targeted version of OS X does not " + "NSOpenGL: The targeted version of OS X does not " "support OpenGL 3.0 or 3.1"); return GL_FALSE; } - if (ctxconfig->major > 2) + if (wndconfig->glMajor > 2) { - if (!ctxconfig->forward) + if (!wndconfig->glForward) { _glfwInputError(GLFW_VERSION_UNAVAILABLE, - "NSGL: The targeted version of OS X only " + "NSOpenGL: The targeted version of OS X only " "supports OpenGL 3.2 and later versions if they " "are forward-compatible"); return GL_FALSE; } - if (ctxconfig->profile != GLFW_OPENGL_CORE_PROFILE) + if (wndconfig->glProfile != GLFW_OPENGL_CORE_PROFILE) { _glfwInputError(GLFW_VERSION_UNAVAILABLE, - "NSGL: The targeted version of OS X only " + "NSOpenGL: The targeted version of OS X only " "supports OpenGL 3.2 and later versions if they " "use the core profile"); return GL_FALSE; @@ -103,20 +117,23 @@ int _glfwCreateContext(_GLFWwindow* window, } #else // Fail if OpenGL 3.0 or above was requested - if (ctxconfig->major > 2) + if (wndconfig->glMajor > 2) { _glfwInputError(GLFW_VERSION_UNAVAILABLE, - "NSGL: The targeted version of OS X does not " + "NSOpenGL: The targeted version of OS X does not " "support OpenGL version 3.0 or above"); return GL_FALSE; } #endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/ - // Context robustness modes (GL_KHR_robustness) are not yet supported on - // OS X but are not a hard constraint, so ignore and continue - - // Context release behaviors (GL_KHR_context_flush_control) are not yet - // supported on OS X but are not a hard constraint, so ignore and continue + // Fail if a robustness strategy was requested + if (wndconfig->glRobustness) + { + _glfwInputError(GLFW_VERSION_UNAVAILABLE, + "NSOpenGL: OS X does not support OpenGL robustness " + "strategies"); + return GL_FALSE; + } #define ADD_ATTR(x) { attributes[attributeCount++] = x; } #define ADD_ATTR2(x, y) { ADD_ATTR(x); ADD_ATTR(y); } @@ -124,80 +141,45 @@ int _glfwCreateContext(_GLFWwindow* window, // Arbitrary array size here NSOpenGLPixelFormatAttribute attributes[40]; + ADD_ATTR(NSOpenGLPFADoubleBuffer); ADD_ATTR(NSOpenGLPFAClosestPolicy); #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 - if (ctxconfig->major > 2) - { + if (wndconfig->glMajor > 2) ADD_ATTR2(NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core); - } - else #endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/ - { - if (fbconfig->auxBuffers != GLFW_DONT_CARE) - ADD_ATTR2(NSOpenGLPFAAuxBuffers, fbconfig->auxBuffers); - if (fbconfig->accumRedBits != GLFW_DONT_CARE && - fbconfig->accumGreenBits != GLFW_DONT_CARE && - fbconfig->accumBlueBits != GLFW_DONT_CARE && - fbconfig->accumAlphaBits != GLFW_DONT_CARE) - { - const int accumBits = fbconfig->accumRedBits + - fbconfig->accumGreenBits + - fbconfig->accumBlueBits + - fbconfig->accumAlphaBits; + ADD_ATTR2(NSOpenGLPFAColorSize, colorBits); - ADD_ATTR2(NSOpenGLPFAAccumSize, accumBits); - } - } - - if (fbconfig->redBits != GLFW_DONT_CARE && - fbconfig->greenBits != GLFW_DONT_CARE && - fbconfig->blueBits != GLFW_DONT_CARE) - { - int colorBits = fbconfig->redBits + - fbconfig->greenBits + - fbconfig->blueBits; - - // OS X needs non-zero color size, so set resonable values - if (colorBits == 0) - colorBits = 24; - else if (colorBits < 15) - colorBits = 15; - - ADD_ATTR2(NSOpenGLPFAColorSize, colorBits); - } - - if (fbconfig->alphaBits != GLFW_DONT_CARE) + if (fbconfig->alphaBits > 0) ADD_ATTR2(NSOpenGLPFAAlphaSize, fbconfig->alphaBits); - if (fbconfig->depthBits != GLFW_DONT_CARE) + if (fbconfig->depthBits > 0) ADD_ATTR2(NSOpenGLPFADepthSize, fbconfig->depthBits); - if (fbconfig->stencilBits != GLFW_DONT_CARE) + if (fbconfig->stencilBits > 0) ADD_ATTR2(NSOpenGLPFAStencilSize, fbconfig->stencilBits); + int accumBits = fbconfig->accumRedBits + fbconfig->accumGreenBits + + fbconfig->accumBlueBits + fbconfig->accumAlphaBits; + + if (accumBits > 0) + ADD_ATTR2(NSOpenGLPFAAccumSize, accumBits); + + if (fbconfig->auxBuffers > 0) + ADD_ATTR2(NSOpenGLPFAAuxBuffers, fbconfig->auxBuffers); + if (fbconfig->stereo) ADD_ATTR(NSOpenGLPFAStereo); - if (fbconfig->doublebuffer) - ADD_ATTR(NSOpenGLPFADoubleBuffer); - - if (fbconfig->samples != GLFW_DONT_CARE) + if (fbconfig->samples > 0) { - if (fbconfig->samples == 0) - { - ADD_ATTR2(NSOpenGLPFASampleBuffers, 0); - } - else - { - ADD_ATTR2(NSOpenGLPFASampleBuffers, 1); - ADD_ATTR2(NSOpenGLPFASamples, fbconfig->samples); - } + ADD_ATTR2(NSOpenGLPFASampleBuffers, 1); + ADD_ATTR2(NSOpenGLPFASamples, fbconfig->samples); } // NOTE: All NSOpenGLPixelFormats on the relevant cards support sRGB - // frambuffer, so there's no need (and no way) to request it + // frambuffer, so there's no need (and no way) to request it ADD_ATTR(0); @@ -209,14 +191,14 @@ int _glfwCreateContext(_GLFWwindow* window, if (window->nsgl.pixelFormat == nil) { _glfwInputError(GLFW_PLATFORM_ERROR, - "NSGL: Failed to create OpenGL pixel format"); + "NSOpenGL: Failed to create OpenGL pixel format"); return GL_FALSE; } NSOpenGLContext* share = NULL; - if (ctxconfig->share) - share = ctxconfig->share->nsgl.context; + if (wndconfig->share) + share = wndconfig->share->nsgl.context; window->nsgl.context = [[NSOpenGLContext alloc] initWithFormat:window->nsgl.pixelFormat @@ -224,7 +206,7 @@ int _glfwCreateContext(_GLFWwindow* window, if (window->nsgl.context == nil) { _glfwInputError(GLFW_PLATFORM_ERROR, - "NSGL: Failed to create OpenGL context"); + "NSOpenGL: Failed to create OpenGL context"); return GL_FALSE; } @@ -254,7 +236,12 @@ void _glfwPlatformMakeContextCurrent(_GLFWwindow* window) else [NSOpenGLContext clearCurrentContext]; - _glfwSetCurrentContext(window); + pthread_setspecific(_glfw.nsgl.current, window); +} + +_GLFWwindow* _glfwPlatformGetCurrentContext(void) +{ + return (_GLFWwindow*) pthread_getspecific(_glfw.nsgl.current); } void _glfwPlatformSwapBuffers(_GLFWwindow* window) diff --git a/extern/glfw/src/nsgl_context.h b/extern/glfw/src/nsgl_platform.h similarity index 59% rename from extern/glfw/src/nsgl_context.h rename to extern/glfw/src/nsgl_platform.h index fd04535..31da2f6 100644 --- a/extern/glfw/src/nsgl_context.h +++ b/extern/glfw/src/nsgl_platform.h @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 OS X - www.glfw.org +// GLFW 3.0 OS X - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2009-2010 Camilla Berglund // @@ -24,39 +24,41 @@ // //======================================================================== -#ifndef _nsgl_context_h_ -#define _nsgl_context_h_ +#ifndef _nsgl_platform_h_ +#define _nsgl_platform_h_ + #define _GLFW_PLATFORM_FBCONFIG -#define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextNSGL nsgl -#define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE _GLFWlibraryNSGL nsgl +#define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextNSGL nsgl +#define _GLFW_PLATFORM_LIBRARY_OPENGL_STATE _GLFWlibraryNSGL nsgl -// NSGL-specific per-context data -// +//======================================================================== +// GLFW platform specific types +//======================================================================== + +//------------------------------------------------------------------------ +// Platform-specific OpenGL context structure +//------------------------------------------------------------------------ typedef struct _GLFWcontextNSGL { id pixelFormat; id context; - } _GLFWcontextNSGL; -// NSGL-specific global data -// +//------------------------------------------------------------------------ +// Platform-specific library global data for NSGL +//------------------------------------------------------------------------ typedef struct _GLFWlibraryNSGL { - // dlopen handle for OpenGL.framework (for glfwGetProcAddress) + // dlopen handle for dynamically loading OpenGL extension entry points void* framework; + // TLS key for per-thread current context/window + pthread_key_t current; + } _GLFWlibraryNSGL; -int _glfwInitContextAPI(void); -void _glfwTerminateContextAPI(void); -int _glfwCreateContext(_GLFWwindow* window, - const _GLFWctxconfig* ctxconfig, - const _GLFWfbconfig* fbconfig); -void _glfwDestroyContext(_GLFWwindow* window); - -#endif // _nsgl_context_h_ +#endif // _nsgl_platform_h_ diff --git a/extern/glfw/src/posix_time.h b/extern/glfw/src/time.c similarity index 71% rename from extern/glfw/src/posix_time.h rename to extern/glfw/src/time.c index 3e0955a..6af4813 100644 --- a/extern/glfw/src/posix_time.h +++ b/extern/glfw/src/time.c @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 POSIX - www.glfw.org +// GLFW 3.0 - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -25,25 +25,22 @@ // //======================================================================== -#ifndef _posix_time_h_ -#define _posix_time_h_ - -#define _GLFW_PLATFORM_LIBRARY_TIME_STATE _GLFWtimePOSIX posix_time - -#include +#include "internal.h" -// POSIX-specific global timer data -// -typedef struct _GLFWtimePOSIX +////////////////////////////////////////////////////////////////////////// +////// GLFW public API ////// +////////////////////////////////////////////////////////////////////////// + +GLFWAPI double glfwGetTime(void) { - GLboolean monotonic; - double resolution; - uint64_t base; + _GLFW_REQUIRE_INIT_OR_RETURN(0.0); + return _glfwPlatformGetTime(); +} -} _GLFWtimePOSIX; +GLFWAPI void glfwSetTime(double time) +{ + _GLFW_REQUIRE_INIT(); + _glfwPlatformSetTime(time); +} - -void _glfwInitTimer(void); - -#endif // _posix_time_h_ diff --git a/extern/glfw/src/wgl_context.c b/extern/glfw/src/wgl_context.c index 7b3b9c9..ccd7f57 100644 --- a/extern/glfw/src/wgl_context.c +++ b/extern/glfw/src/wgl_context.c @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 WGL - www.glfw.org +// GLFW 3.0 WGL - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -57,7 +57,6 @@ static void initWGLExtensions(_GLFWwindow* window) window->wgl.ARB_create_context_robustness = GL_FALSE; window->wgl.EXT_swap_control = GL_FALSE; window->wgl.ARB_pixel_format = GL_FALSE; - window->wgl.ARB_context_flush_control = GL_FALSE; window->wgl.GetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC) wglGetProcAddress("wglGetExtensionsStringEXT"); @@ -120,9 +119,6 @@ static void initWGLExtensions(_GLFWwindow* window) if (window->wgl.GetPixelFormatAttribivARB) window->wgl.ARB_pixel_format = GL_TRUE; } - - if (_glfwPlatformExtensionSupported("WGL_ARB_context_flush_control")) - window->wgl.ARB_context_flush_control = GL_TRUE; } // Returns the specified attribute of the specified pixel format @@ -185,7 +181,8 @@ static GLboolean choosePixelFormat(_GLFWwindow* window, { // Get pixel format attributes through WGL_ARB_pixel_format if (!getPixelFormatAttrib(window, n, WGL_SUPPORT_OPENGL_ARB) || - !getPixelFormatAttrib(window, n, WGL_DRAW_TO_WINDOW_ARB)) + !getPixelFormatAttrib(window, n, WGL_DRAW_TO_WINDOW_ARB) || + !getPixelFormatAttrib(window, n, WGL_DOUBLE_BUFFER_ARB)) { continue; } @@ -216,20 +213,13 @@ static GLboolean choosePixelFormat(_GLFWwindow* window, u->accumAlphaBits = getPixelFormatAttrib(window, n, WGL_ACCUM_ALPHA_BITS_ARB); u->auxBuffers = getPixelFormatAttrib(window, n, WGL_AUX_BUFFERS_ARB); - - if (getPixelFormatAttrib(window, n, WGL_STEREO_ARB)) - u->stereo = GL_TRUE; - if (getPixelFormatAttrib(window, n, WGL_DOUBLE_BUFFER_ARB)) - u->doublebuffer = GL_TRUE; + u->stereo = getPixelFormatAttrib(window, n, WGL_STEREO_ARB); if (window->wgl.ARB_multisample) u->samples = getPixelFormatAttrib(window, n, WGL_SAMPLES_ARB); if (window->wgl.ARB_framebuffer_sRGB) - { - if (getPixelFormatAttrib(window, n, WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB)) - u->sRGB = GL_TRUE; - } + u->sRGB = getPixelFormatAttrib(window, n, WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB); } else { @@ -246,7 +236,8 @@ static GLboolean choosePixelFormat(_GLFWwindow* window, } if (!(pfd.dwFlags & PFD_DRAW_TO_WINDOW) || - !(pfd.dwFlags & PFD_SUPPORT_OPENGL)) + !(pfd.dwFlags & PFD_SUPPORT_OPENGL) || + !(pfd.dwFlags & PFD_DOUBLEBUFFER)) { continue; } @@ -274,32 +265,16 @@ static GLboolean choosePixelFormat(_GLFWwindow* window, u->accumAlphaBits = pfd.cAccumAlphaBits; u->auxBuffers = pfd.cAuxBuffers; - - if (pfd.dwFlags & PFD_STEREO) - u->stereo = GL_TRUE; - if (pfd.dwFlags & PFD_DOUBLEBUFFER) - u->doublebuffer = GL_TRUE; + u->stereo = (pfd.dwFlags & PFD_STEREO) ? GL_TRUE : GL_FALSE; } u->wgl = n; usableCount++; } - if (!usableCount) - { - _glfwInputError(GLFW_API_UNAVAILABLE, - "WGL: The driver does not appear to support OpenGL"); - - free(usableConfigs); - return GL_FALSE; - } - closest = _glfwChooseFBConfig(desired, usableConfigs, usableCount); if (!closest) { - _glfwInputError(GLFW_PLATFORM_ERROR, - "WGL: Failed to find a suitable pixel format"); - free(usableConfigs); return GL_FALSE; } @@ -319,16 +294,23 @@ static GLboolean choosePixelFormat(_GLFWwindow* window, // int _glfwInitContextAPI(void) { - if (!_glfwInitTLS()) - return GL_FALSE; - - _glfw.wgl.opengl32.instance = LoadLibraryW(L"opengl32.dll"); + _glfw.wgl.opengl32.instance = LoadLibrary(L"opengl32.dll"); if (!_glfw.wgl.opengl32.instance) { _glfwInputError(GLFW_PLATFORM_ERROR, "Failed to load opengl32.dll"); return GL_FALSE; } + _glfw.wgl.current = TlsAlloc(); + if (_glfw.wgl.current == TLS_OUT_OF_INDEXES) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "WGL: Failed to allocate TLS index"); + return GL_FALSE; + } + + _glfw.wgl.hasTLS = GL_TRUE; + return GL_TRUE; } @@ -336,10 +318,11 @@ int _glfwInitContextAPI(void) // void _glfwTerminateContextAPI(void) { + if (_glfw.wgl.hasTLS) + TlsFree(_glfw.wgl.current); + if (_glfw.wgl.opengl32.instance) FreeLibrary(_glfw.wgl.opengl32.instance); - - _glfwTerminateTLS(); } #define setWGLattrib(attribName, attribValue) \ @@ -349,10 +332,10 @@ void _glfwTerminateContextAPI(void) assert((size_t) index < sizeof(attribs) / sizeof(attribs[0])); \ } -// Create the OpenGL or OpenGL ES context +// Prepare for creation of the OpenGL context // int _glfwCreateContext(_GLFWwindow* window, - const _GLFWctxconfig* ctxconfig, + const _GLFWwndconfig* wndconfig, const _GLFWfbconfig* fbconfig) { int attribs[40]; @@ -360,8 +343,8 @@ int _glfwCreateContext(_GLFWwindow* window, PIXELFORMATDESCRIPTOR pfd; HGLRC share = NULL; - if (ctxconfig->share) - share = ctxconfig->share->wgl.context; + if (wndconfig->share) + share = wndconfig->share->wgl.context; window->wgl.dc = GetDC(window->win32.handle); if (!window->wgl.dc) @@ -372,7 +355,11 @@ int _glfwCreateContext(_GLFWwindow* window, } if (!choosePixelFormat(window, fbconfig, &pixelFormat)) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "WGL: Failed to find a suitable pixel format"); return GL_FALSE; + } if (!DescribePixelFormat(window->wgl.dc, pixelFormat, sizeof(pfd), &pfd)) { @@ -393,63 +380,42 @@ int _glfwCreateContext(_GLFWwindow* window, { int index = 0, mask = 0, flags = 0, strategy = 0; - if (ctxconfig->api == GLFW_OPENGL_API) + if (wndconfig->clientAPI == GLFW_OPENGL_API) { - if (ctxconfig->forward) + if (wndconfig->glForward) flags |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; - if (ctxconfig->debug) + if (wndconfig->glDebug) flags |= WGL_CONTEXT_DEBUG_BIT_ARB; - if (ctxconfig->profile) + if (wndconfig->glProfile) { - if (ctxconfig->profile == GLFW_OPENGL_CORE_PROFILE) + if (wndconfig->glProfile == GLFW_OPENGL_CORE_PROFILE) mask |= WGL_CONTEXT_CORE_PROFILE_BIT_ARB; - else if (ctxconfig->profile == GLFW_OPENGL_COMPAT_PROFILE) + else if (wndconfig->glProfile == GLFW_OPENGL_COMPAT_PROFILE) mask |= WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; } } else mask |= WGL_CONTEXT_ES2_PROFILE_BIT_EXT; - if (ctxconfig->robustness) + if (wndconfig->glRobustness) { if (window->wgl.ARB_create_context_robustness) { - if (ctxconfig->robustness == GLFW_NO_RESET_NOTIFICATION) + if (wndconfig->glRobustness == GLFW_NO_RESET_NOTIFICATION) strategy = WGL_NO_RESET_NOTIFICATION_ARB; - else if (ctxconfig->robustness == GLFW_LOSE_CONTEXT_ON_RESET) + else if (wndconfig->glRobustness == GLFW_LOSE_CONTEXT_ON_RESET) strategy = WGL_LOSE_CONTEXT_ON_RESET_ARB; flags |= WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB; } } - if (ctxconfig->release) + if (wndconfig->glMajor != 1 || wndconfig->glMinor != 0) { - if (window->wgl.ARB_context_flush_control) - { - if (ctxconfig->release == GLFW_RELEASE_BEHAVIOR_NONE) - { - setWGLattrib(WGL_CONTEXT_RELEASE_BEHAVIOR_ARB, - WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB); - } - else if (ctxconfig->release == GLFW_RELEASE_BEHAVIOR_FLUSH) - { - setWGLattrib(WGL_CONTEXT_RELEASE_BEHAVIOR_ARB, - WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB); - } - } - } - - if (ctxconfig->major != 1 || ctxconfig->minor != 0) - { - // NOTE: Only request an explicitly versioned context when - // necessary, as explicitly requesting version 1.0 does not - // always return the highest available version - - setWGLattrib(WGL_CONTEXT_MAJOR_VERSION_ARB, ctxconfig->major); - setWGLattrib(WGL_CONTEXT_MINOR_VERSION_ARB, ctxconfig->minor); + setWGLattrib(WGL_CONTEXT_MAJOR_VERSION_ARB, wndconfig->glMajor); + setWGLattrib(WGL_CONTEXT_MINOR_VERSION_ARB, wndconfig->glMinor); } if (flags) @@ -523,14 +489,14 @@ void _glfwDestroyContext(_GLFWwindow* window) // Analyzes the specified context for possible recreation // int _glfwAnalyzeContext(const _GLFWwindow* window, - const _GLFWctxconfig* ctxconfig, + const _GLFWwndconfig* wndconfig, const _GLFWfbconfig* fbconfig) { GLboolean required = GL_FALSE; - if (ctxconfig->api == GLFW_OPENGL_API) + if (wndconfig->clientAPI == GLFW_OPENGL_API) { - if (ctxconfig->forward) + if (wndconfig->glForward) { if (!window->wgl.ARB_create_context) { @@ -544,7 +510,7 @@ int _glfwAnalyzeContext(const _GLFWwindow* window, required = GL_TRUE; } - if (ctxconfig->profile) + if (wndconfig->glProfile) { if (!window->wgl.ARB_create_context_profile) { @@ -556,12 +522,6 @@ int _glfwAnalyzeContext(const _GLFWwindow* window, required = GL_TRUE; } - - if (ctxconfig->release) - { - if (window->wgl.ARB_context_flush_control) - required = GL_TRUE; - } } else { @@ -578,13 +538,13 @@ int _glfwAnalyzeContext(const _GLFWwindow* window, required = GL_TRUE; } - if (ctxconfig->major != 1 || ctxconfig->minor != 0) + if (wndconfig->glMajor != 1 || wndconfig->glMinor != 0) { if (window->wgl.ARB_create_context) required = GL_TRUE; } - if (ctxconfig->debug) + if (wndconfig->glDebug) { if (window->wgl.ARB_create_context) required = GL_TRUE; @@ -602,18 +562,6 @@ int _glfwAnalyzeContext(const _GLFWwindow* window, } } - if (fbconfig->sRGB) - { - // We want sRGB, but can we get it? - // sRGB is not a hard constraint, so otherwise we just don't care - - if (window->wgl.ARB_framebuffer_sRGB && window->wgl.ARB_pixel_format) - { - // We appear to have both the extension and the means to ask for it - required = GL_TRUE; - } - } - if (required) return _GLFW_RECREATION_REQUIRED; @@ -632,7 +580,12 @@ void _glfwPlatformMakeContextCurrent(_GLFWwindow* window) else wglMakeCurrent(NULL, NULL); - _glfwSetCurrentContext(window); + TlsSetValue(_glfw.wgl.current, window); +} + +_GLFWwindow* _glfwPlatformGetCurrentContext(void) +{ + return TlsGetValue(_glfw.wgl.current); } void _glfwPlatformSwapBuffers(_GLFWwindow* window) @@ -645,7 +598,7 @@ void _glfwPlatformSwapInterval(int interval) _GLFWwindow* window = _glfwPlatformGetCurrentContext(); #if !defined(_GLFW_USE_DWM_SWAP_INTERVAL) - if (_glfwIsCompositionEnabled() && interval) + if (_glfwIsCompositionEnabled()) { // Don't enabled vsync when desktop compositing is enabled, as it leads // to frame jitter diff --git a/extern/glfw/src/wgl_context.h b/extern/glfw/src/wgl_platform.h similarity index 71% rename from extern/glfw/src/wgl_context.h rename to extern/glfw/src/wgl_platform.h index 3fc29e7..bffdf74 100644 --- a/extern/glfw/src/wgl_context.h +++ b/extern/glfw/src/wgl_platform.h @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 WGL - www.glfw.org +// GLFW 3.0 WGL - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -25,27 +25,34 @@ // //======================================================================== -#ifndef _wgl_context_h_ -#define _wgl_context_h_ +#ifndef _wgl_platform_h_ +#define _wgl_platform_h_ // This path may need to be changed if you build GLFW using your own setup // We ship and use our own copy of wglext.h since GLFW uses fairly new // extensions and not all operating systems come with an up-to-date version #include "../deps/GL/wglext.h" -#define _GLFW_PLATFORM_FBCONFIG int wgl -#define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextWGL wgl -#define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE _GLFWlibraryWGL wgl + +#define _GLFW_PLATFORM_FBCONFIG int wgl +#define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextWGL wgl +#define _GLFW_PLATFORM_LIBRARY_OPENGL_STATE _GLFWlibraryWGL wgl -// WGL-specific per-context data -// +//======================================================================== +// GLFW platform specific types +//======================================================================== + +//------------------------------------------------------------------------ +// Platform-specific OpenGL context structure +//------------------------------------------------------------------------ typedef struct _GLFWcontextWGL { + // Platform specific window resources HDC dc; // Private GDI device context HGLRC context; // Permanent rendering context - // WGL extensions (context specific) + // Platform specific extensions (context specific) PFNWGLSWAPINTERVALEXTPROC SwapIntervalEXT; PFNWGLGETPIXELFORMATATTRIBIVARBPROC GetPixelFormatAttribivARB; PFNWGLGETEXTENSIONSSTRINGEXTPROC GetExtensionsStringEXT; @@ -59,16 +66,18 @@ typedef struct _GLFWcontextWGL GLboolean ARB_create_context_profile; GLboolean EXT_create_context_es2_profile; GLboolean ARB_create_context_robustness; - GLboolean ARB_context_flush_control; - } _GLFWcontextWGL; -// WGL-specific global data -// +//------------------------------------------------------------------------ +// Platform-specific library global data for WGL +//------------------------------------------------------------------------ typedef struct _GLFWlibraryWGL { - // opengl32.dll (for glfwGetProcAddress) + GLboolean hasTLS; + DWORD current; + + // opengl32.dll struct { HINSTANCE instance; } opengl32; @@ -76,14 +85,4 @@ typedef struct _GLFWlibraryWGL } _GLFWlibraryWGL; -int _glfwInitContextAPI(void); -void _glfwTerminateContextAPI(void); -int _glfwCreateContext(_GLFWwindow* window, - const _GLFWctxconfig* ctxconfig, - const _GLFWfbconfig* fbconfig); -void _glfwDestroyContext(_GLFWwindow* window); -int _glfwAnalyzeContext(const _GLFWwindow* window, - const _GLFWctxconfig* ctxconfig, - const _GLFWfbconfig* fbconfig); - -#endif // _wgl_context_h_ +#endif // _wgl_platform_h_ diff --git a/extern/glfw/src/win32_clipboard.c b/extern/glfw/src/win32_clipboard.c new file mode 100644 index 0000000..8fcba46 --- /dev/null +++ b/extern/glfw/src/win32_clipboard.c @@ -0,0 +1,127 @@ +//======================================================================== +// GLFW 3.0 Win32 - www.glfw.org +//------------------------------------------------------------------------ +// Copyright (c) 2010 Camilla Berglund +// +// 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. +// +//======================================================================== + +#include "internal.h" + +#include +#include +#include +#include + + +////////////////////////////////////////////////////////////////////////// +////// GLFW platform API ////// +////////////////////////////////////////////////////////////////////////// + +void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string) +{ + WCHAR* wideString; + HANDLE stringHandle; + size_t wideSize; + + wideString = _glfwCreateWideStringFromUTF8(string); + if (!wideString) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "Win32: Failed to convert clipboard string to " + "wide string"); + return; + } + + wideSize = (wcslen(wideString) + 1) * sizeof(WCHAR); + + stringHandle = GlobalAlloc(GMEM_MOVEABLE, wideSize); + if (!stringHandle) + { + free(wideString); + + _glfwInputError(GLFW_PLATFORM_ERROR, + "Win32: Failed to allocate global handle for clipboard"); + return; + } + + memcpy(GlobalLock(stringHandle), wideString, wideSize); + GlobalUnlock(stringHandle); + + if (!OpenClipboard(window->win32.handle)) + { + GlobalFree(stringHandle); + free(wideString); + + _glfwInputError(GLFW_PLATFORM_ERROR, "Win32: Failed to open clipboard"); + return; + } + + EmptyClipboard(); + SetClipboardData(CF_UNICODETEXT, stringHandle); + CloseClipboard(); + + free(wideString); +} + +const char* _glfwPlatformGetClipboardString(_GLFWwindow* window) +{ + HANDLE stringHandle; + + if (!IsClipboardFormatAvailable(CF_UNICODETEXT)) + { + _glfwInputError(GLFW_FORMAT_UNAVAILABLE, NULL); + return NULL; + } + + if (!OpenClipboard(window->win32.handle)) + { + _glfwInputError(GLFW_PLATFORM_ERROR, "Win32: Failed to open clipboard"); + return NULL; + } + + stringHandle = GetClipboardData(CF_UNICODETEXT); + if (!stringHandle) + { + CloseClipboard(); + + _glfwInputError(GLFW_PLATFORM_ERROR, + "Win32: Failed to retrieve clipboard data"); + return NULL; + } + + free(_glfw.win32.clipboardString); + _glfw.win32.clipboardString = + _glfwCreateUTF8FromWideString(GlobalLock(stringHandle)); + + GlobalUnlock(stringHandle); + CloseClipboard(); + + if (!_glfw.win32.clipboardString) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "Win32: Failed to convert wide string to UTF-8"); + return NULL; + } + + return _glfw.win32.clipboardString; +} + diff --git a/extern/glfw/src/win32_gamma.c b/extern/glfw/src/win32_gamma.c new file mode 100644 index 0000000..b062bcf --- /dev/null +++ b/extern/glfw/src/win32_gamma.c @@ -0,0 +1,82 @@ +//======================================================================== +// GLFW 3.0 Win32 - www.glfw.org +//------------------------------------------------------------------------ +// Copyright (c) 2010 Camilla Berglund +// +// 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. +// +//======================================================================== + +#include "internal.h" + +#include + + +////////////////////////////////////////////////////////////////////////// +////// GLFW platform API ////// +////////////////////////////////////////////////////////////////////////// + +void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp) +{ + HDC dc; + WORD values[768]; + DISPLAY_DEVICE display; + + ZeroMemory(&display, sizeof(DISPLAY_DEVICE)); + display.cb = sizeof(DISPLAY_DEVICE); + EnumDisplayDevices(monitor->win32.name, 0, &display, 0); + + dc = CreateDC(L"DISPLAY", display.DeviceString, NULL, NULL); + GetDeviceGammaRamp(dc, values); + DeleteDC(dc); + + _glfwAllocGammaArrays(ramp, 256); + + memcpy(ramp->red, values + 0, 256 * sizeof(unsigned short)); + memcpy(ramp->green, values + 256, 256 * sizeof(unsigned short)); + memcpy(ramp->blue, values + 512, 256 * sizeof(unsigned short)); +} + +void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp) +{ + HDC dc; + WORD values[768]; + DISPLAY_DEVICE display; + + if (ramp->size != 256) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "Win32: Gamma ramp size must be 256"); + return; + } + + memcpy(values + 0, ramp->red, 256 * sizeof(unsigned short)); + memcpy(values + 256, ramp->green, 256 * sizeof(unsigned short)); + memcpy(values + 512, ramp->blue, 256 * sizeof(unsigned short)); + + ZeroMemory(&display, sizeof(DISPLAY_DEVICE)); + display.cb = sizeof(DISPLAY_DEVICE); + EnumDisplayDevices(monitor->win32.name, 0, &display, 0); + + dc = CreateDC(L"DISPLAY", display.DeviceString, NULL, NULL); + SetDeviceGammaRamp(dc, values); + DeleteDC(dc); +} + diff --git a/extern/glfw/src/win32_init.c b/extern/glfw/src/win32_init.c index 5b1c18b..8e0c19b 100644 --- a/extern/glfw/src/win32_init.c +++ b/extern/glfw/src/win32_init.c @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 Win32 - www.glfw.org +// GLFW 3.0 Win32 - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -60,13 +60,12 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) // static GLboolean initLibraries(void) { - _glfw.win32.winmm.instance = LoadLibraryW(L"winmm.dll"); +#ifndef _GLFW_NO_DLOAD_WINMM + // winmm.dll (for joystick and timer support) + + _glfw.win32.winmm.instance = LoadLibrary(L"winmm.dll"); if (!_glfw.win32.winmm.instance) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Win32: Failed to load winmm.dll"); return GL_FALSE; - } _glfw.win32.winmm.joyGetDevCaps = (JOYGETDEVCAPS_T) GetProcAddress(_glfw.win32.winmm.instance, "joyGetDevCapsW"); @@ -82,21 +81,18 @@ static GLboolean initLibraries(void) !_glfw.win32.winmm.joyGetPosEx || !_glfw.win32.winmm.timeGetTime) { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Win32: Failed to load winmm functions"); return GL_FALSE; } +#endif // _GLFW_NO_DLOAD_WINMM - _glfw.win32.user32.instance = LoadLibraryW(L"user32.dll"); + _glfw.win32.user32.instance = LoadLibrary(L"user32.dll"); if (_glfw.win32.user32.instance) { _glfw.win32.user32.SetProcessDPIAware = (SETPROCESSDPIAWARE_T) GetProcAddress(_glfw.win32.user32.instance, "SetProcessDPIAware"); - _glfw.win32.user32.ChangeWindowMessageFilterEx = (CHANGEWINDOWMESSAGEFILTEREX_T) - GetProcAddress(_glfw.win32.user32.instance, "ChangeWindowMessageFilterEx"); } - _glfw.win32.dwmapi.instance = LoadLibraryW(L"dwmapi.dll"); + _glfw.win32.dwmapi.instance = LoadLibrary(L"dwmapi.dll"); if (_glfw.win32.dwmapi.instance) { _glfw.win32.dwmapi.DwmIsCompositionEnabled = (DWMISCOMPOSITIONENABLED_T) @@ -110,8 +106,13 @@ static GLboolean initLibraries(void) // static void terminateLibraries(void) { - if (_glfw.win32.winmm.instance) +#ifndef _GLFW_NO_DLOAD_WINMM + if (_glfw.win32.winmm.instance != NULL) + { FreeLibrary(_glfw.win32.winmm.instance); + _glfw.win32.winmm.instance = NULL; + } +#endif // _GLFW_NO_DLOAD_WINMM if (_glfw.win32.user32.instance) FreeLibrary(_glfw.win32.user32.instance); @@ -151,9 +152,9 @@ WCHAR* _glfwCreateWideStringFromUTF8(const char* source) if (!length) return NULL; - target = calloc(length, sizeof(WCHAR)); + target = calloc(length + 1, sizeof(WCHAR)); - if (!MultiByteToWideChar(CP_UTF8, 0, source, -1, target, length)) + if (!MultiByteToWideChar(CP_UTF8, 0, source, -1, target, length + 1)) { free(target); return NULL; @@ -173,9 +174,9 @@ char* _glfwCreateUTF8FromWideString(const WCHAR* source) if (!length) return NULL; - target = calloc(length, sizeof(char)); + target = calloc(length + 1, sizeof(char)); - if (!WideCharToMultiByte(CP_UTF8, 0, source, -1, target, length, NULL, NULL)) + if (!WideCharToMultiByte(CP_UTF8, 0, source, -1, target, length + 1, NULL, NULL)) { free(target); return NULL; @@ -194,10 +195,10 @@ int _glfwPlatformInit(void) // To make SetForegroundWindow work as we want, we need to fiddle // with the FOREGROUNDLOCKTIMEOUT system setting (we do this as early // as possible in the hope of still being the foreground process) - SystemParametersInfoW(SPI_GETFOREGROUNDLOCKTIMEOUT, 0, - &_glfw.win32.foregroundLockTimeout, 0); - SystemParametersInfoW(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, UIntToPtr(0), - SPIF_SENDCHANGE); + SystemParametersInfo(SPI_GETFOREGROUNDLOCKTIMEOUT, 0, + &_glfw.win32.foregroundLockTimeout, 0); + SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, UIntToPtr(0), + SPIF_SENDCHANGE); if (!initLibraries()) return GL_FALSE; @@ -211,9 +212,6 @@ int _glfwPlatformInit(void) _control87(MCW_EM, MCW_EM); #endif - if (!_glfwRegisterWindowClass()) - return GL_FALSE; - if (!_glfwInitContextAPI()) return GL_FALSE; @@ -225,12 +223,16 @@ int _glfwPlatformInit(void) void _glfwPlatformTerminate(void) { - _glfwUnregisterWindowClass(); + if (_glfw.win32.classAtom) + { + UnregisterClass(_GLFW_WNDCLASSNAME, GetModuleHandle(NULL)); + _glfw.win32.classAtom = 0; + } // Restore previous foreground lock timeout system setting - SystemParametersInfoW(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, - UIntToPtr(_glfw.win32.foregroundLockTimeout), - SPIF_SENDCHANGE); + SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, + UIntToPtr(_glfw.win32.foregroundLockTimeout), + SPIF_SENDCHANGE); free(_glfw.win32.clipboardString); @@ -241,7 +243,7 @@ void _glfwPlatformTerminate(void) const char* _glfwPlatformGetVersionString(void) { - const char* version = _GLFW_VERSION_NUMBER " Win32" + const char* version = _GLFW_VERSION_FULL " Win32" #if defined(_GLFW_WGL) " WGL" #elif defined(_GLFW_EGL) @@ -250,10 +252,13 @@ const char* _glfwPlatformGetVersionString(void) #if defined(__MINGW32__) " MinGW" #elif defined(_MSC_VER) - " VisualC" + " VisualC " #elif defined(__BORLANDC__) " BorlandC" #endif +#if !defined(_GLFW_NO_DLOAD_WINMM) + " LoadLibrary(winmm)" +#endif #if defined(_GLFW_BUILD_DLL) " DLL" #endif diff --git a/extern/glfw/src/winmm_joystick.c b/extern/glfw/src/win32_joystick.c similarity index 83% rename from extern/glfw/src/winmm_joystick.c rename to extern/glfw/src/win32_joystick.c index fcf6d94..8b67dc0 100644 --- a/extern/glfw/src/winmm_joystick.c +++ b/extern/glfw/src/win32_joystick.c @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 WinMM - www.glfw.org +// GLFW 3.0 Win32 - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -34,9 +34,9 @@ ////// GLFW internal API ////// ////////////////////////////////////////////////////////////////////////// -// Convert axis value to the [-1,1] range +// Calculate normalized joystick position // -static float normalizeAxis(DWORD pos, DWORD min, DWORD max) +static float calcJoystickPos(DWORD pos, DWORD min, DWORD max) { float fpos = (float) pos; float fmin = (float) min; @@ -63,7 +63,7 @@ void _glfwTerminateJoysticks(void) int i; for (i = 0; i < GLFW_JOYSTICK_LAST; i++) - free(_glfw.winmm_js[i].name); + free(_glfw.win32.joystick[i].name); } @@ -85,7 +85,7 @@ const float* _glfwPlatformGetJoystickAxes(int joy, int* count) { JOYCAPS jc; JOYINFOEX ji; - float* axes = _glfw.winmm_js[joy].axes; + float* axes = _glfw.win32.joystick[joy].axes; if (_glfw_joyGetDevCaps(joy, &jc, sizeof(JOYCAPS)) != JOYERR_NOERROR) return NULL; @@ -96,20 +96,20 @@ const float* _glfwPlatformGetJoystickAxes(int joy, int* count) if (_glfw_joyGetPosEx(joy, &ji) != JOYERR_NOERROR) return NULL; - axes[(*count)++] = normalizeAxis(ji.dwXpos, jc.wXmin, jc.wXmax); - axes[(*count)++] = normalizeAxis(ji.dwYpos, jc.wYmin, jc.wYmax); + axes[(*count)++] = calcJoystickPos(ji.dwXpos, jc.wXmin, jc.wXmax); + axes[(*count)++] = -calcJoystickPos(ji.dwYpos, jc.wYmin, jc.wYmax); if (jc.wCaps & JOYCAPS_HASZ) - axes[(*count)++] = normalizeAxis(ji.dwZpos, jc.wZmin, jc.wZmax); + axes[(*count)++] = calcJoystickPos(ji.dwZpos, jc.wZmin, jc.wZmax); if (jc.wCaps & JOYCAPS_HASR) - axes[(*count)++] = normalizeAxis(ji.dwRpos, jc.wRmin, jc.wRmax); + axes[(*count)++] = calcJoystickPos(ji.dwRpos, jc.wRmin, jc.wRmax); if (jc.wCaps & JOYCAPS_HASU) - axes[(*count)++] = normalizeAxis(ji.dwUpos, jc.wUmin, jc.wUmax); + axes[(*count)++] = calcJoystickPos(ji.dwUpos, jc.wUmin, jc.wUmax); if (jc.wCaps & JOYCAPS_HASV) - axes[(*count)++] = normalizeAxis(ji.dwVpos, jc.wVmin, jc.wVmax); + axes[(*count)++] = -calcJoystickPos(ji.dwVpos, jc.wVmin, jc.wVmax); return axes; } @@ -118,7 +118,7 @@ const unsigned char* _glfwPlatformGetJoystickButtons(int joy, int* count) { JOYCAPS jc; JOYINFOEX ji; - unsigned char* buttons = _glfw.winmm_js[joy].buttons; + unsigned char* buttons = _glfw.win32.joystick[joy].buttons; if (_glfw_joyGetDevCaps(joy, &jc, sizeof(JOYCAPS)) != JOYERR_NOERROR) return NULL; @@ -169,9 +169,9 @@ const char* _glfwPlatformGetJoystickName(int joy) if (_glfw_joyGetDevCaps(joy, &jc, sizeof(JOYCAPS)) != JOYERR_NOERROR) return NULL; - free(_glfw.winmm_js[joy].name); - _glfw.winmm_js[joy].name = _glfwCreateUTF8FromWideString(jc.szPname); + free(_glfw.win32.joystick[joy].name); + _glfw.win32.joystick[joy].name = _glfwCreateUTF8FromWideString(jc.szPname); - return _glfw.winmm_js[joy].name; + return _glfw.win32.joystick[joy].name; } diff --git a/extern/glfw/src/win32_monitor.c b/extern/glfw/src/win32_monitor.c index 0690dc1..c7ec314 100644 --- a/extern/glfw/src/win32_monitor.c +++ b/extern/glfw/src/win32_monitor.c @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 Win32 - www.glfw.org +// GLFW 3.0 Win32 - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -51,15 +51,16 @@ GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired) { GLFWvidmode current; const GLFWvidmode* best; - DEVMODEW dm; + DEVMODE dm; best = _glfwChooseVideoMode(monitor, desired); + _glfwPlatformGetVideoMode(monitor, ¤t); if (_glfwCompareVideoModes(¤t, best) == 0) return GL_TRUE; ZeroMemory(&dm, sizeof(dm)); - dm.dmSize = sizeof(DEVMODEW); + dm.dmSize = sizeof(DEVMODE); dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL | DM_DISPLAYFREQUENCY; dm.dmPelsWidth = best->width; @@ -70,17 +71,16 @@ GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired) if (dm.dmBitsPerPel < 15 || dm.dmBitsPerPel >= 24) dm.dmBitsPerPel = 32; - if (ChangeDisplaySettingsExW(monitor->win32.adapterName, - &dm, - NULL, - CDS_FULLSCREEN, - NULL) != DISP_CHANGE_SUCCESSFUL) + if (ChangeDisplaySettingsEx(monitor->win32.name, + &dm, + NULL, + CDS_FULLSCREEN, + NULL) != DISP_CHANGE_SUCCESSFUL) { _glfwInputError(GLFW_PLATFORM_ERROR, "Win32: Failed to set video mode"); return GL_FALSE; } - monitor->win32.modeChanged = GL_TRUE; return GL_TRUE; } @@ -88,12 +88,8 @@ GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired) // void _glfwRestoreVideoMode(_GLFWmonitor* monitor) { - if (monitor->win32.modeChanged) - { - ChangeDisplaySettingsExW(monitor->win32.adapterName, - NULL, NULL, CDS_FULLSCREEN, NULL); - monitor->win32.modeChanged = GL_FALSE; - } + ChangeDisplaySettingsEx(monitor->win32.name, + NULL, NULL, CDS_FULLSCREEN, NULL); } @@ -105,81 +101,77 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count) { int size = 0, found = 0; _GLFWmonitor** monitors = NULL; - DWORD adapterIndex, displayIndex; + DWORD adapterIndex = 0; + int primaryIndex = 0; *count = 0; - for (adapterIndex = 0; ; adapterIndex++) + for (;;) { - DISPLAY_DEVICEW adapter; + DISPLAY_DEVICE adapter, display; + char* name; + HDC dc; - ZeroMemory(&adapter, sizeof(DISPLAY_DEVICEW)); - adapter.cb = sizeof(DISPLAY_DEVICEW); + ZeroMemory(&adapter, sizeof(DISPLAY_DEVICE)); + adapter.cb = sizeof(DISPLAY_DEVICE); - if (!EnumDisplayDevicesW(NULL, adapterIndex, &adapter, 0)) + if (!EnumDisplayDevices(NULL, adapterIndex, &adapter, 0)) break; - if (!(adapter.StateFlags & DISPLAY_DEVICE_ACTIVE)) - continue; + adapterIndex++; - for (displayIndex = 0; ; displayIndex++) + if ((adapter.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER) || + !(adapter.StateFlags & DISPLAY_DEVICE_ACTIVE)) { - DISPLAY_DEVICEW display; - char* name; - HDC dc; - - ZeroMemory(&display, sizeof(DISPLAY_DEVICEW)); - display.cb = sizeof(DISPLAY_DEVICEW); - - if (!EnumDisplayDevicesW(adapter.DeviceName, displayIndex, &display, 0)) - break; - - if (found == size) - { - size += 4; - monitors = realloc(monitors, sizeof(_GLFWmonitor*) * size); - } - - name = _glfwCreateUTF8FromWideString(display.DeviceString); - if (!name) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Failed to convert string to UTF-8"); - continue; - } - - dc = CreateDCW(L"DISPLAY", adapter.DeviceName, NULL, NULL); - - monitors[found] = _glfwAllocMonitor(name, - GetDeviceCaps(dc, HORZSIZE), - GetDeviceCaps(dc, VERTSIZE)); - - DeleteDC(dc); - free(name); - - wcscpy(monitors[found]->win32.adapterName, adapter.DeviceName); - wcscpy(monitors[found]->win32.displayName, display.DeviceName); - - WideCharToMultiByte(CP_UTF8, 0, - adapter.DeviceName, -1, - monitors[found]->win32.publicAdapterName, - sizeof(monitors[found]->win32.publicAdapterName), - NULL, NULL); - - WideCharToMultiByte(CP_UTF8, 0, - display.DeviceName, -1, - monitors[found]->win32.publicDisplayName, - sizeof(monitors[found]->win32.publicDisplayName), - NULL, NULL); - - if (adapter.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE && - displayIndex == 0) - { - _GLFW_SWAP_POINTERS(monitors[0], monitors[found]); - } - - found++; + continue; } + + if (found == size) + { + if (size) + size *= 2; + else + size = 4; + + monitors = (_GLFWmonitor**) realloc(monitors, sizeof(_GLFWmonitor*) * size); + } + + ZeroMemory(&display, sizeof(DISPLAY_DEVICE)); + display.cb = sizeof(DISPLAY_DEVICE); + + EnumDisplayDevices(adapter.DeviceName, 0, &display, 0); + dc = CreateDC(L"DISPLAY", display.DeviceString, NULL, NULL); + + if (adapter.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) + primaryIndex = found; + + name = _glfwCreateUTF8FromWideString(display.DeviceString); + if (!name) + { + _glfwDestroyMonitors(monitors, found); + _glfwInputError(GLFW_PLATFORM_ERROR, + "Failed to convert string to UTF-8"); + + free(monitors); + return NULL; + } + + monitors[found] = _glfwCreateMonitor(name, + GetDeviceCaps(dc, HORZSIZE), + GetDeviceCaps(dc, VERTSIZE)); + + free(name); + DeleteDC(dc); + + wcscpy(monitors[found]->win32.name, adapter.DeviceName); + found++; + } + + if (primaryIndex > 0) + { + _GLFWmonitor* temp = monitors[0]; + monitors[0] = monitors[primaryIndex]; + monitors[primaryIndex] = temp; } *count = found; @@ -188,19 +180,19 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count) GLboolean _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second) { - return wcscmp(first->win32.displayName, second->win32.displayName) == 0; + return wcscmp(first->win32.name, second->win32.name) == 0; } void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos) { - DEVMODEW settings; - ZeroMemory(&settings, sizeof(DEVMODEW)); - settings.dmSize = sizeof(DEVMODEW); + DEVMODE settings; + ZeroMemory(&settings, sizeof(DEVMODE)); + settings.dmSize = sizeof(DEVMODE); - EnumDisplaySettingsExW(monitor->win32.adapterName, - ENUM_CURRENT_SETTINGS, - &settings, - EDS_ROTATEDMODE); + EnumDisplaySettingsEx(monitor->win32.name, + ENUM_CURRENT_SETTINGS, + &settings, + EDS_ROTATEDMODE); if (xpos) *xpos = settings.dmPosition.x; @@ -219,12 +211,12 @@ GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found) { int i; GLFWvidmode mode; - DEVMODEW dm; + DEVMODE dm; - ZeroMemory(&dm, sizeof(DEVMODEW)); - dm.dmSize = sizeof(DEVMODEW); + ZeroMemory(&dm, sizeof(DEVMODE)); + dm.dmSize = sizeof(DEVMODE); - if (!EnumDisplaySettingsW(monitor->win32.adapterName, modeIndex, &dm)) + if (!EnumDisplaySettings(monitor->win32.name, modeIndex, &dm)) break; modeIndex++; @@ -274,12 +266,12 @@ GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found) void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode) { - DEVMODEW dm; + DEVMODE dm; - ZeroMemory(&dm, sizeof(DEVMODEW)); - dm.dmSize = sizeof(DEVMODEW); + ZeroMemory(&dm, sizeof(DEVMODE)); + dm.dmSize = sizeof(DEVMODE); - EnumDisplaySettingsW(monitor->win32.adapterName, ENUM_CURRENT_SETTINGS, &dm); + EnumDisplaySettings(monitor->win32.name, ENUM_CURRENT_SETTINGS, &dm); mode->width = dm.dmPelsWidth; mode->height = dm.dmPelsHeight; @@ -290,59 +282,3 @@ void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode) &mode->blueBits); } -void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp) -{ - HDC dc; - WORD values[768]; - - dc = CreateDCW(L"DISPLAY", monitor->win32.adapterName, NULL, NULL); - GetDeviceGammaRamp(dc, values); - DeleteDC(dc); - - _glfwAllocGammaArrays(ramp, 256); - - memcpy(ramp->red, values + 0, 256 * sizeof(unsigned short)); - memcpy(ramp->green, values + 256, 256 * sizeof(unsigned short)); - memcpy(ramp->blue, values + 512, 256 * sizeof(unsigned short)); -} - -void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp) -{ - HDC dc; - WORD values[768]; - - if (ramp->size != 256) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Win32: Gamma ramp size must be 256"); - return; - } - - memcpy(values + 0, ramp->red, 256 * sizeof(unsigned short)); - memcpy(values + 256, ramp->green, 256 * sizeof(unsigned short)); - memcpy(values + 512, ramp->blue, 256 * sizeof(unsigned short)); - - dc = CreateDCW(L"DISPLAY", monitor->win32.adapterName, NULL, NULL); - SetDeviceGammaRamp(dc, values); - DeleteDC(dc); -} - - -////////////////////////////////////////////////////////////////////////// -////// GLFW native API ////// -////////////////////////////////////////////////////////////////////////// - -GLFWAPI const char* glfwGetWin32Adapter(GLFWmonitor* handle) -{ - _GLFWmonitor* monitor = (_GLFWmonitor*) handle; - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - return monitor->win32.publicAdapterName; -} - -GLFWAPI const char* glfwGetWin32Monitor(GLFWmonitor* handle) -{ - _GLFWmonitor* monitor = (_GLFWmonitor*) handle; - _GLFW_REQUIRE_INIT_OR_RETURN(NULL); - return monitor->win32.publicDisplayName; -} - diff --git a/extern/glfw/src/win32_platform.h b/extern/glfw/src/win32_platform.h index 5eb61d3..e31abd9 100644 --- a/extern/glfw/src/win32_platform.h +++ b/extern/glfw/src/win32_platform.h @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 Win32 - www.glfw.org +// GLFW 3.0 Win32 - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -42,9 +42,9 @@ #define WIN32_LEAN_AND_MEAN #endif -// This is a workaround for the fact that glfw3.h needs to export APIENTRY (for -// example to allow applications to correctly declare a GL_ARB_debug_output -// callback) but windows.h assumes no one will define APIENTRY before it does +// This is a workaround for the fact that glfw3.h needs to export APIENTRY (to +// correctly declare a GL_ARB_debug_output callback, for example) but windows.h +// thinks it is the only one that gets to do so #undef APIENTRY // GLFW on Windows is Unicode only and does not work in MBCS mode @@ -52,27 +52,19 @@ #define UNICODE #endif -// GLFW requires Windows XP or later -#if WINVER < 0x0501 - #undef WINVER +// GLFW requires Windows XP +#ifndef WINVER #define WINVER 0x0501 #endif -#if _WIN32_WINNT < 0x0501 - #undef _WIN32_WINNT - #define _WIN32_WINNT 0x0501 -#endif #include #include #include -#if defined(_MSC_VER) - #include - #define strdup _strdup -#endif - -// HACK: Define macros that some older windows.h variants don't +//======================================================================== +// Hack: Define things that some windows.h variants don't +//======================================================================== #ifndef WM_MOUSEHWHEEL #define WM_MOUSEHWHEEL 0x020E @@ -80,99 +72,108 @@ #ifndef WM_DWMCOMPOSITIONCHANGED #define WM_DWMCOMPOSITIONCHANGED 0x031E #endif -#ifndef WM_COPYGLOBALDATA - #define WM_COPYGLOBALDATA 0x0049 -#endif -#ifndef WM_UNICHAR - #define WM_UNICHAR 0x0109 -#endif -#ifndef UNICODE_NOCHAR - #define UNICODE_NOCHAR 0xFFFF -#endif -#if WINVER < 0x0601 -typedef struct tagCHANGEFILTERSTRUCT -{ - DWORD cbSize; - DWORD ExtStatus; - -} CHANGEFILTERSTRUCT, *PCHANGEFILTERSTRUCT; -#ifndef MSGFLT_ALLOW - #define MSGFLT_ALLOW 1 -#endif -#endif /*Windows 7*/ +//======================================================================== +// DLLs that are loaded at glfwInit() +//======================================================================== // winmm.dll function pointer typedefs -typedef MMRESULT (WINAPI * JOYGETDEVCAPS_T)(UINT,LPJOYCAPS,UINT); -typedef MMRESULT (WINAPI * JOYGETPOS_T)(UINT,LPJOYINFO); -typedef MMRESULT (WINAPI * JOYGETPOSEX_T)(UINT,LPJOYINFOEX); -typedef DWORD (WINAPI * TIMEGETTIME_T)(void); -#define _glfw_joyGetDevCaps _glfw.win32.winmm.joyGetDevCaps -#define _glfw_joyGetPos _glfw.win32.winmm.joyGetPos -#define _glfw_joyGetPosEx _glfw.win32.winmm.joyGetPosEx -#define _glfw_timeGetTime _glfw.win32.winmm.timeGetTime +#ifndef _GLFW_NO_DLOAD_WINMM +typedef MMRESULT (WINAPI * JOYGETDEVCAPS_T) (UINT,LPJOYCAPS,UINT); +typedef MMRESULT (WINAPI * JOYGETPOS_T) (UINT,LPJOYINFO); +typedef MMRESULT (WINAPI * JOYGETPOSEX_T) (UINT,LPJOYINFOEX); +typedef DWORD (WINAPI * TIMEGETTIME_T) (void); +#endif // _GLFW_NO_DLOAD_WINMM + + +// winmm.dll shortcuts +#ifndef _GLFW_NO_DLOAD_WINMM + #define _glfw_joyGetDevCaps _glfw.win32.winmm.joyGetDevCaps + #define _glfw_joyGetPos _glfw.win32.winmm.joyGetPos + #define _glfw_joyGetPosEx _glfw.win32.winmm.joyGetPosEx + #define _glfw_timeGetTime _glfw.win32.winmm.timeGetTime +#else + #define _glfw_joyGetDevCaps joyGetDevCaps + #define _glfw_joyGetPos joyGetPos + #define _glfw_joyGetPosEx joyGetPosEx + #define _glfw_timeGetTime timeGetTime +#endif // _GLFW_NO_DLOAD_WINMM // user32.dll function pointer typedefs typedef BOOL (WINAPI * SETPROCESSDPIAWARE_T)(void); -typedef BOOL (WINAPI * CHANGEWINDOWMESSAGEFILTEREX_T)(HWND,UINT,DWORD,PCHANGEFILTERSTRUCT); #define _glfw_SetProcessDPIAware _glfw.win32.user32.SetProcessDPIAware -#define _glfw_ChangeWindowMessageFilterEx _glfw.win32.user32.ChangeWindowMessageFilterEx // dwmapi.dll function pointer typedefs typedef HRESULT (WINAPI * DWMISCOMPOSITIONENABLED_T)(BOOL*); #define _glfw_DwmIsCompositionEnabled _glfw.win32.dwmapi.DwmIsCompositionEnabled +// We use versioned window class names in order not to cause conflicts +// between applications using different versions of GLFW +#define _GLFW_WNDCLASSNAME L"GLFW30" + #define _GLFW_RECREATION_NOT_NEEDED 0 #define _GLFW_RECREATION_REQUIRED 1 #define _GLFW_RECREATION_IMPOSSIBLE 2 -#include "win32_tls.h" - #if defined(_GLFW_WGL) - #include "wgl_context.h" + #include "wgl_platform.h" #elif defined(_GLFW_EGL) #define _GLFW_EGL_NATIVE_WINDOW window->win32.handle #define _GLFW_EGL_NATIVE_DISPLAY EGL_DEFAULT_DISPLAY - #include "egl_context.h" + #include "egl_platform.h" #else #error "No supported context creation API selected" #endif -#include "winmm_joystick.h" - #define _GLFW_PLATFORM_WINDOW_STATE _GLFWwindowWin32 win32 #define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE _GLFWlibraryWin32 win32 -#define _GLFW_PLATFORM_LIBRARY_TIME_STATE _GLFWtimeWin32 win32_time #define _GLFW_PLATFORM_MONITOR_STATE _GLFWmonitorWin32 win32 -#define _GLFW_PLATFORM_CURSOR_STATE _GLFWcursorWin32 win32 -// Win32-specific per-window data -// +//======================================================================== +// GLFW platform specific types +//======================================================================== + + +//------------------------------------------------------------------------ +// Platform-specific window structure +//------------------------------------------------------------------------ typedef struct _GLFWwindowWin32 { - HWND handle; - DWORD dwStyle; - DWORD dwExStyle; + // Platform specific window resources + HWND handle; // Window handle + DWORD dwStyle; // Window styles used for window creation + DWORD dwExStyle; // --"-- + // Various platform specific internal variables GLboolean cursorCentered; GLboolean cursorInside; GLboolean cursorHidden; - int oldCursorX, oldCursorY; - + double oldCursorX, oldCursorY; } _GLFWwindowWin32; -// Win32-specific global data -// +//------------------------------------------------------------------------ +// Platform-specific library global data for Win32 +//------------------------------------------------------------------------ typedef struct _GLFWlibraryWin32 { + ATOM classAtom; DWORD foregroundLockTimeout; char* clipboardString; + // Timer data + struct { + GLboolean hasPC; + double resolution; + unsigned int t0_32; + __int64 t0_64; + } timer; + +#ifndef _GLFW_NO_DLOAD_WINMM // winmm.dll struct { HINSTANCE instance; @@ -181,12 +182,12 @@ typedef struct _GLFWlibraryWin32 JOYGETPOSEX_T joyGetPosEx; TIMEGETTIME_T timeGetTime; } winmm; +#endif // _GLFW_NO_DLOAD_WINMM // user32.dll struct { HINSTANCE instance; SETPROCESSDPIAWARE_T SetProcessDPIAware; - CHANGEWINDOWMESSAGEFILTEREX_T ChangeWindowMessageFilterEx; } user32; // dwmapi.dll @@ -195,54 +196,58 @@ typedef struct _GLFWlibraryWin32 DWMISCOMPOSITIONENABLED_T DwmIsCompositionEnabled; } dwmapi; + struct { + float axes[6]; + unsigned char buttons[36]; // 32 buttons plus one hat + char* name; + } joystick[GLFW_JOYSTICK_LAST + 1]; + } _GLFWlibraryWin32; -// Win32-specific per-monitor data -// +//------------------------------------------------------------------------ +// Platform-specific monitor structure +//------------------------------------------------------------------------ typedef struct _GLFWmonitorWin32 { // This size matches the static size of DISPLAY_DEVICE.DeviceName - WCHAR adapterName[32]; - WCHAR displayName[32]; - char publicAdapterName[64]; - char publicDisplayName[64]; - GLboolean modeChanged; + WCHAR name[32]; } _GLFWmonitorWin32; -// Win32-specific per-cursor data -// -typedef struct _GLFWcursorWin32 -{ - HCURSOR handle; - -} _GLFWcursorWin32; - - -// Win32-specific global timer data -// -typedef struct _GLFWtimeWin32 -{ - GLboolean hasPC; - double resolution; - unsigned __int64 base; - -} _GLFWtimeWin32; - - -GLboolean _glfwRegisterWindowClass(void); -void _glfwUnregisterWindowClass(void); +//======================================================================== +// Prototypes for platform specific internal functions +//======================================================================== +// Desktop compositing BOOL _glfwIsCompositionEnabled(void); +// Wide strings WCHAR* _glfwCreateWideStringFromUTF8(const char* source); char* _glfwCreateUTF8FromWideString(const WCHAR* source); +// Time void _glfwInitTimer(void); +// Joystick input +void _glfwInitJoysticks(void); +void _glfwTerminateJoysticks(void); + +// OpenGL support +int _glfwInitContextAPI(void); +void _glfwTerminateContextAPI(void); +int _glfwCreateContext(_GLFWwindow* window, + const _GLFWwndconfig* wndconfig, + const _GLFWfbconfig* fbconfig); +void _glfwDestroyContext(_GLFWwindow* window); +int _glfwAnalyzeContext(const _GLFWwindow* window, + const _GLFWwndconfig* wndconfig, + const _GLFWfbconfig* fbconfig); + +// Fullscreen support GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired); void _glfwRestoreVideoMode(_GLFWmonitor* monitor); + #endif // _win32_platform_h_ diff --git a/extern/glfw/src/win32_time.c b/extern/glfw/src/win32_time.c index 5f7adf8..73383d4 100644 --- a/extern/glfw/src/win32_time.c +++ b/extern/glfw/src/win32_time.c @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 Win32 - www.glfw.org +// GLFW 3.0 Win32 - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -28,21 +28,6 @@ #include "internal.h" -// Return raw time -// -static unsigned __int64 getRawTime(void) -{ - if (_glfw.win32_time.hasPC) - { - unsigned __int64 time; - QueryPerformanceCounter((LARGE_INTEGER*) &time); - return time; - } - else - return (unsigned __int64) _glfw_timeGetTime(); -} - - ////////////////////////////////////////////////////////////////////////// ////// GLFW internal API ////// ////////////////////////////////////////////////////////////////////////// @@ -51,20 +36,20 @@ static unsigned __int64 getRawTime(void) // void _glfwInitTimer(void) { - unsigned __int64 frequency; + __int64 freq; - if (QueryPerformanceFrequency((LARGE_INTEGER*) &frequency)) + if (QueryPerformanceFrequency((LARGE_INTEGER*) &freq)) { - _glfw.win32_time.hasPC = GL_TRUE; - _glfw.win32_time.resolution = 1.0 / (double) frequency; + _glfw.win32.timer.hasPC = GL_TRUE; + _glfw.win32.timer.resolution = 1.0 / (double) freq; + QueryPerformanceCounter((LARGE_INTEGER*) &_glfw.win32.timer.t0_64); } else { - _glfw.win32_time.hasPC = GL_FALSE; - _glfw.win32_time.resolution = 0.001; // winmm resolution is 1 ms + _glfw.win32.timer.hasPC = GL_FALSE; + _glfw.win32.timer.resolution = 0.001; // winmm resolution is 1 ms + _glfw.win32.timer.t0_32 = _glfw_timeGetTime(); } - - _glfw.win32_time.base = getRawTime(); } @@ -74,13 +59,30 @@ void _glfwInitTimer(void) double _glfwPlatformGetTime(void) { - return (double) (getRawTime() - _glfw.win32_time.base) * - _glfw.win32_time.resolution; + double t; + __int64 t_64; + + if (_glfw.win32.timer.hasPC) + { + QueryPerformanceCounter((LARGE_INTEGER*) &t_64); + t = (double)(t_64 - _glfw.win32.timer.t0_64); + } + else + t = (double)(_glfw_timeGetTime() - _glfw.win32.timer.t0_32); + + return t * _glfw.win32.timer.resolution; } -void _glfwPlatformSetTime(double time) +void _glfwPlatformSetTime(double t) { - _glfw.win32_time.base = getRawTime() - - (unsigned __int64) (time / _glfw.win32_time.resolution); + __int64 t_64; + + if (_glfw.win32.timer.hasPC) + { + QueryPerformanceCounter((LARGE_INTEGER*) &t_64); + _glfw.win32.timer.t0_64 = t_64 - (__int64) (t / _glfw.win32.timer.resolution); + } + else + _glfw.win32.timer.t0_32 = _glfw_timeGetTime() - (int)(t * 1000.0); } diff --git a/extern/glfw/src/win32_tls.h b/extern/glfw/src/win32_tls.h deleted file mode 100644 index 3ffef72..0000000 --- a/extern/glfw/src/win32_tls.h +++ /dev/null @@ -1,48 +0,0 @@ -//======================================================================== -// GLFW 3.1 Win32 - www.glfw.org -//------------------------------------------------------------------------ -// Copyright (c) 2002-2006 Marcus Geelnard -// Copyright (c) 2006-2010 Camilla Berglund -// -// 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 _win32_tls_h_ -#define _win32_tls_h_ - -#define _GLFW_PLATFORM_LIBRARY_TLS_STATE _GLFWtlsWin32 win32_tls - - -// Win32-specific global TLS data -// -typedef struct _GLFWtlsWin32 -{ - GLboolean allocated; - DWORD context; - -} _GLFWtlsWin32; - - -int _glfwInitTLS(void); -void _glfwTerminateTLS(void); -void _glfwSetCurrentContext(_GLFWwindow* context); - -#endif // _win32_tls_h_ diff --git a/extern/glfw/src/win32_window.c b/extern/glfw/src/win32_window.c index f7c531d..139e661 100644 --- a/extern/glfw/src/win32_window.c +++ b/extern/glfw/src/win32_window.c @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 Win32 - www.glfw.org +// GLFW 3.0 Win32 - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -29,14 +29,10 @@ #include #include -#include #include -#include #define _GLFW_KEY_INVALID -2 -#define _GLFW_WNDCLASSNAME L"GLFW30" - // Updates the cursor clip rect // @@ -49,7 +45,7 @@ static void updateClipRect(_GLFWwindow* window) ClipCursor(&clipRect); } -// Hide the mouse cursor +// Hide mouse cursor // static void hideCursor(_GLFWwindow* window) { @@ -71,9 +67,9 @@ static void hideCursor(_GLFWwindow* window) } } -// Disable the mouse cursor +// Capture mouse cursor // -static void disableCursor(_GLFWwindow* window) +static void captureCursor(_GLFWwindow* window) { if (!window->win32.cursorHidden) { @@ -85,9 +81,9 @@ static void disableCursor(_GLFWwindow* window) SetCapture(window->win32.handle); } -// Restores the mouse cursor +// Show mouse cursor // -static void restoreCursor(_GLFWwindow* window) +static void showCursor(_GLFWwindow* window) { POINT pos; @@ -103,12 +99,7 @@ static void restoreCursor(_GLFWwindow* window) if (GetCursorPos(&pos)) { if (WindowFromPoint(pos) == window->win32.handle) - { - if (window->cursor) - SetCursor(window->cursor->win32.handle); - else - SetCursor(LoadCursorW(NULL, IDC_ARROW)); - } + SetCursor(LoadCursor(NULL, IDC_ARROW)); } } @@ -154,7 +145,7 @@ static int translateKey(WPARAM wParam, LPARAM lParam) { // Check for numeric keypad keys // NOTE: This way we always force "NumLock = ON", which is intentional since - // the returned key code should correspond to a physical location. + // the returned key code should correspond to a physical location. if ((HIWORD(lParam) & 0x100) == 0) { switch (MapVirtualKey(HIWORD(lParam) & 0xFF, 1)) @@ -178,70 +169,6 @@ static int translateKey(WPARAM wParam, LPARAM lParam) } } - switch (HIWORD(lParam) & 0xFF) - { - // handle printable chars except space in a language independent way, - // using scancodes rather than virtual keys - // as virtual keys are language dependent. - // Printable keys are mapped according to US layout. - - // Row 0: - case 0x29: return GLFW_KEY_GRAVE_ACCENT; - case 0x02: return GLFW_KEY_1; - case 0x03: return GLFW_KEY_2; - case 0x04: return GLFW_KEY_3; - case 0x05: return GLFW_KEY_4; - case 0x06: return GLFW_KEY_5; - case 0x07: return GLFW_KEY_6; - case 0x08: return GLFW_KEY_7; - case 0x09: return GLFW_KEY_8; - case 0x0A: return GLFW_KEY_9; - case 0x0B: return GLFW_KEY_0; - case 0x0C: return GLFW_KEY_MINUS; - case 0x0D: return GLFW_KEY_EQUAL; - - // Row 1: - case 0x10: return GLFW_KEY_Q; - case 0x11: return GLFW_KEY_W; - case 0x12: return GLFW_KEY_E; - case 0x13: return GLFW_KEY_R; - case 0x14: return GLFW_KEY_T; - case 0x15: return GLFW_KEY_Y; - case 0x16: return GLFW_KEY_U; - case 0x17: return GLFW_KEY_I; - case 0x18: return GLFW_KEY_O; - case 0x19: return GLFW_KEY_P; - case 0x1A: return GLFW_KEY_LEFT_BRACKET; - case 0x1B: return GLFW_KEY_RIGHT_BRACKET; - // We do not map 0x2B as this is only on US - use vKeys for this to prevent confusion with 0x56 - - // Row 2: - case 0x1E: return GLFW_KEY_A; - case 0x1F: return GLFW_KEY_S; - case 0x20: return GLFW_KEY_D; - case 0x21: return GLFW_KEY_F; - case 0x22: return GLFW_KEY_G; - case 0x23: return GLFW_KEY_H; - case 0x24: return GLFW_KEY_J; - case 0x25: return GLFW_KEY_K; - case 0x26: return GLFW_KEY_L; - case 0x27: return GLFW_KEY_SEMICOLON; - case 0x28: return GLFW_KEY_APOSTROPHE; - - // Row 3: - case 0x2C: return GLFW_KEY_Z; - case 0x2D: return GLFW_KEY_X; - case 0x2E: return GLFW_KEY_C; - case 0x2F: return GLFW_KEY_V; - case 0x30: return GLFW_KEY_B; - case 0x31: return GLFW_KEY_N; - case 0x32: return GLFW_KEY_M; - case 0x33: return GLFW_KEY_COMMA; - case 0x34: return GLFW_KEY_PERIOD; - case 0x35: return GLFW_KEY_SLASH; - default: break; - } - // Check which key was pressed or released switch (wParam) { @@ -273,7 +200,7 @@ static int translateKey(WPARAM wParam, LPARAM lParam) // is a RALT message. In that case, this is a false LCTRL! time = GetMessageTime(); - if (PeekMessageW(&next, NULL, 0, 0, PM_NOREMOVE)) + if (PeekMessage(&next, NULL, 0, 0, PM_NOREMOVE)) { if (next.message == WM_KEYDOWN || next.message == WM_SYSKEYDOWN || @@ -380,7 +307,53 @@ static int translateKey(WPARAM wParam, LPARAM lParam) // Printable keys are mapped according to US layout case VK_SPACE: return GLFW_KEY_SPACE; + case 0x30: return GLFW_KEY_0; + case 0x31: return GLFW_KEY_1; + case 0x32: return GLFW_KEY_2; + case 0x33: return GLFW_KEY_3; + case 0x34: return GLFW_KEY_4; + case 0x35: return GLFW_KEY_5; + case 0x36: return GLFW_KEY_6; + case 0x37: return GLFW_KEY_7; + case 0x38: return GLFW_KEY_8; + case 0x39: return GLFW_KEY_9; + case 0x41: return GLFW_KEY_A; + case 0x42: return GLFW_KEY_B; + case 0x43: return GLFW_KEY_C; + case 0x44: return GLFW_KEY_D; + case 0x45: return GLFW_KEY_E; + case 0x46: return GLFW_KEY_F; + case 0x47: return GLFW_KEY_G; + case 0x48: return GLFW_KEY_H; + case 0x49: return GLFW_KEY_I; + case 0x4A: return GLFW_KEY_J; + case 0x4B: return GLFW_KEY_K; + case 0x4C: return GLFW_KEY_L; + case 0x4D: return GLFW_KEY_M; + case 0x4E: return GLFW_KEY_N; + case 0x4F: return GLFW_KEY_O; + case 0x50: return GLFW_KEY_P; + case 0x51: return GLFW_KEY_Q; + case 0x52: return GLFW_KEY_R; + case 0x53: return GLFW_KEY_S; + case 0x54: return GLFW_KEY_T; + case 0x55: return GLFW_KEY_U; + case 0x56: return GLFW_KEY_V; + case 0x57: return GLFW_KEY_W; + case 0x58: return GLFW_KEY_X; + case 0x59: return GLFW_KEY_Y; + case 0x5A: return GLFW_KEY_Z; + case 0xBD: return GLFW_KEY_MINUS; + case 0xBB: return GLFW_KEY_EQUAL; + case 0xDB: return GLFW_KEY_LEFT_BRACKET; + case 0xDD: return GLFW_KEY_RIGHT_BRACKET; case 0xDC: return GLFW_KEY_BACKSLASH; + case 0xBA: return GLFW_KEY_SEMICOLON; + case 0xDE: return GLFW_KEY_APOSTROPHE; + case 0xC0: return GLFW_KEY_GRAVE_ACCENT; + case 0xBC: return GLFW_KEY_COMMA; + case 0xBE: return GLFW_KEY_PERIOD; + case 0xBF: return GLFW_KEY_SLASH; case 0xDF: return GLFW_KEY_WORLD_1; case 0xE2: return GLFW_KEY_WORLD_2; default: break; @@ -390,45 +363,19 @@ static int translateKey(WPARAM wParam, LPARAM lParam) return GLFW_KEY_UNKNOWN; } -// Enter fullscreen mode -// -static GLboolean enterFullscreenMode(_GLFWwindow* window) -{ - GLFWvidmode mode; - GLboolean status; - int xpos, ypos; - - status = _glfwSetVideoMode(window->monitor, &window->videoMode); - - _glfwPlatformGetVideoMode(window->monitor, &mode); - _glfwPlatformGetMonitorPos(window->monitor, &xpos, &ypos); - - SetWindowPos(window->win32.handle, HWND_TOPMOST, - xpos, ypos, mode.width, mode.height, SWP_NOCOPYBITS); - - return status; -} - -// Leave fullscreen mode -// -static void leaveFullscreenMode(_GLFWwindow* window) -{ - _glfwRestoreVideoMode(window->monitor); -} - // Window callback function (handles window events) // static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - _GLFWwindow* window = (_GLFWwindow*) GetWindowLongPtrW(hWnd, 0); + _GLFWwindow* window = (_GLFWwindow*) GetWindowLongPtr(hWnd, 0); switch (uMsg) { - case WM_NCCREATE: + case WM_CREATE: { - CREATESTRUCTW* cs = (CREATESTRUCTW*) lParam; - SetWindowLongPtrW(hWnd, 0, (LONG_PTR) cs->lpCreateParams); + CREATESTRUCT* cs = (CREATESTRUCT*) lParam; + SetWindowLongPtr(hWnd, 0, (LONG_PTR) cs->lpCreateParams); break; } @@ -441,21 +388,10 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, if (focused && iconified) { - if (window->iconified && _glfw.focusedWindow != window) - { - // This is a workaround for window restoration using the - // Win+D hot key leading to windows being told they're - // focused and iconified and then never told they're - // restored - iconified = FALSE; - } - else - { - // This is a workaround for window iconification using the - // taskbar leading to windows being told they're focused and - // iconified and then never told they're defocused - focused = FALSE; - } + // This is a workaround for window iconification using the + // taskbar leading to windows being told they're focused and + // iconified and then never told they're defocused + focused = FALSE; } if (!focused && _glfw.focusedWindow == window) @@ -463,9 +399,9 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, // The window was defocused (or iconified, see above) if (window->cursorMode != GLFW_CURSOR_NORMAL) - restoreCursor(window); + showCursor(window); - if (window->monitor && window->autoIconify) + if (window->monitor) { if (!iconified) { @@ -474,18 +410,20 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, _glfwPlatformIconifyWindow(window); } - leaveFullscreenMode(window); + _glfwRestoreVideoMode(window->monitor); } } else if (focused && _glfw.focusedWindow != window) { // The window was focused - if (window->cursorMode != GLFW_CURSOR_NORMAL) - _glfwPlatformApplyCursorMode(window); + if (window->cursorMode == GLFW_CURSOR_DISABLED) + captureCursor(window); + else if (window->cursorMode == GLFW_CURSOR_HIDDEN) + hideCursor(window); - if (window->monitor && window->autoIconify) - enterFullscreenMode(window); + if (window->monitor) + _glfwSetVideoMode(window->monitor, &window->videoMode); } _glfwInputWindowFocus(window, focused); @@ -493,19 +431,6 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, return 0; } - case WM_ACTIVATEAPP: - { - if (!wParam && IsIconic(hWnd)) - { - // This is a workaround for full screen windows losing focus - // through Alt+Tab leading to windows being told they're - // unfocused and restored and then never told they're iconified - _glfwInputWindowIconify(window, GL_TRUE); - } - - return 0; - } - case WM_SHOWWINDOW: { _glfwInputWindowVisibility(window, wParam ? GL_TRUE : GL_FALSE); @@ -545,7 +470,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, case WM_KEYDOWN: case WM_SYSKEYDOWN: { - const int scancode = (lParam >> 16) & 0x1ff; + const int scancode = (lParam >> 16) & 0xff; const int key = translateKey(wParam, lParam); if (key == _GLFW_KEY_INVALID) break; @@ -555,14 +480,9 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, } case WM_CHAR: - { - _glfwInputChar(window, (unsigned int) wParam, getKeyMods(), GL_TRUE); - return 0; - } - case WM_SYSCHAR: { - _glfwInputChar(window, (unsigned int) wParam, getKeyMods(), GL_FALSE); + _glfwInputChar(window, (unsigned int) wParam); return 0; } @@ -577,7 +497,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, return TRUE; } - _glfwInputChar(window, (unsigned int) wParam, getKeyMods(), GL_TRUE); + _glfwInputChar(window, (unsigned int) wParam); return FALSE; } @@ -585,7 +505,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, case WM_SYSKEYUP: { const int mods = getKeyMods(); - const int scancode = (lParam >> 16) & 0x1ff; + const int scancode = (lParam >> 16) & 0xff; const int key = translateKey(wParam, lParam); if (key == _GLFW_KEY_INVALID) break; @@ -673,7 +593,7 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, if (newCursorX != window->win32.oldCursorX || newCursorY != window->win32.oldCursorY) { - int x, y; + double x, y; if (window->cursorMode == GLFW_CURSOR_DISABLED) { @@ -728,18 +648,14 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, case WM_MOUSEHWHEEL: { // This message is only sent on Windows Vista and later - // NOTE: The X-axis is inverted for consistency with OS X and X11. - _glfwInputScroll(window, -((SHORT) HIWORD(wParam) / (double) WHEEL_DELTA), 0.0); + _glfwInputScroll(window, (SHORT) HIWORD(wParam) / (double) WHEEL_DELTA, 0.0); return 0; } case WM_SIZE: { - if (_glfw.focusedWindow == window) - { - if (window->cursorMode == GLFW_CURSOR_DISABLED) - updateClipRect(window); - } + if (window->cursorMode == GLFW_CURSOR_DISABLED) + updateClipRect(window); _glfwInputFramebufferSize(window, LOWORD(lParam), HIWORD(lParam)); _glfwInputWindowSize(window, LOWORD(lParam), HIWORD(lParam)); @@ -748,17 +664,10 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, case WM_MOVE: { - if (_glfw.focusedWindow == window) - { - if (window->cursorMode == GLFW_CURSOR_DISABLED) - updateClipRect(window); - } + if (window->cursorMode == GLFW_CURSOR_DISABLED) + updateClipRect(window); - // NOTE: This cannot use LOWORD/HIWORD recommended by MSDN, as - // those macros do not handle negative window positions correctly - _glfwInputWindowPos(window, - GET_X_LPARAM(lParam), - GET_Y_LPARAM(lParam)); + _glfwInputWindowPos(window, LOWORD(lParam), HIWORD(lParam)); return 0; } @@ -768,26 +677,14 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, break; } - case WM_ERASEBKGND: - { - return TRUE; - } - case WM_SETCURSOR: { - if (_glfw.focusedWindow == window && LOWORD(lParam) == HTCLIENT) + if (window->cursorMode == GLFW_CURSOR_HIDDEN && + window->win32.handle == GetForegroundWindow() && + LOWORD(lParam) == HTCLIENT) { - if (window->cursorMode == GLFW_CURSOR_HIDDEN || - window->cursorMode == GLFW_CURSOR_DISABLED) - { - SetCursor(NULL); - return TRUE; - } - else if (window->cursor) - { - SetCursor(window->cursor->win32.handle); - return TRUE; - } + SetCursor(NULL); + return TRUE; } break; @@ -816,40 +713,6 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, // TODO: Restore vsync if compositing was disabled break; } - - case WM_DROPFILES: - { - HDROP hDrop = (HDROP) wParam; - POINT pt; - int i; - - const int count = DragQueryFileW(hDrop, 0xffffffff, NULL, 0); - char** names = calloc(count, sizeof(char*)); - - // Move the mouse to the position of the drop - DragQueryPoint(hDrop, &pt); - _glfwInputCursorMotion(window, pt.x, pt.y); - - for (i = 0; i < count; i++) - { - const UINT length = DragQueryFileW(hDrop, i, NULL, 0); - WCHAR* buffer = calloc(length + 1, sizeof(WCHAR)); - - DragQueryFileW(hDrop, i, buffer, length + 1); - names[i] = _glfwCreateUTF8FromWideString(buffer); - - free(buffer); - } - - _glfwInputDrop(window, count, (const char**) names); - - for (i = 0; i < count; i++) - free(names[i]); - free(names); - - DragFinish(hDrop); - return 0; - } } return DefWindowProc(hWnd, uMsg, wParam, lParam); @@ -868,11 +731,47 @@ static void getFullWindowSize(_GLFWwindow* window, *fullHeight = rect.bottom - rect.top; } +// Registers the GLFW window class +// +static ATOM registerWindowClass(void) +{ + WNDCLASS wc; + ATOM classAtom; + + // Set window class parameters + wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; + wc.lpfnWndProc = (WNDPROC) windowProc; + wc.cbClsExtra = 0; // No extra class data + wc.cbWndExtra = sizeof(void*) + sizeof(int); // Make room for one pointer + wc.hInstance = GetModuleHandle(NULL); + wc.hCursor = LoadCursor(NULL, IDC_ARROW); + wc.hbrBackground = NULL; // No background + wc.lpszMenuName = NULL; // No menu + wc.lpszClassName = _GLFW_WNDCLASSNAME; + + // Load user-provided icon if available + wc.hIcon = LoadIcon(GetModuleHandle(NULL), L"GLFW_ICON"); + if (!wc.hIcon) + { + // No user-provided icon found, load default icon + wc.hIcon = LoadIcon(NULL, IDI_WINLOGO); + } + + classAtom = RegisterClass(&wc); + if (!classAtom) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "Win32: Failed to register window class"); + return 0; + } + + return classAtom; +} + // Creates the GLFW window and rendering context // static int createWindow(_GLFWwindow* window, const _GLFWwndconfig* wndconfig, - const _GLFWctxconfig* ctxconfig, const _GLFWfbconfig* fbconfig) { int xpos, ypos, fullWidth, fullHeight; @@ -885,9 +784,6 @@ static int createWindow(_GLFWwindow* window, { window->win32.dwStyle |= WS_POPUP; - // NOTE: This window placement is temporary and approximate, as the - // correct position and size cannot be known until the monitor - // video mode has been set _glfwPlatformGetMonitorPos(wndconfig->monitor, &xpos, &ypos); fullWidth = wndconfig->width; fullHeight = wndconfig->height; @@ -923,16 +819,16 @@ static int createWindow(_GLFWwindow* window, return GL_FALSE; } - window->win32.handle = CreateWindowExW(window->win32.dwExStyle, - _GLFW_WNDCLASSNAME, - wideTitle, - window->win32.dwStyle, - xpos, ypos, - fullWidth, fullHeight, - NULL, // No parent window - NULL, // No window menu - GetModuleHandleW(NULL), - window); // Pass object to WM_CREATE + window->win32.handle = CreateWindowEx(window->win32.dwExStyle, + _GLFW_WNDCLASSNAME, + wideTitle, + window->win32.dwStyle, + xpos, ypos, + fullWidth, fullHeight, + NULL, // No parent window + NULL, // No window menu + GetModuleHandle(NULL), + window); // Pass object to WM_CREATE free(wideTitle); @@ -942,27 +838,7 @@ static int createWindow(_GLFWwindow* window, return GL_FALSE; } - if (_glfw_ChangeWindowMessageFilterEx) - { - _glfw_ChangeWindowMessageFilterEx(window->win32.handle, - WM_DROPFILES, MSGFLT_ALLOW, NULL); - _glfw_ChangeWindowMessageFilterEx(window->win32.handle, - WM_COPYDATA, MSGFLT_ALLOW, NULL); - _glfw_ChangeWindowMessageFilterEx(window->win32.handle, - WM_COPYGLOBALDATA, MSGFLT_ALLOW, NULL); - } - - if (wndconfig->floating && !wndconfig->monitor) - { - SetWindowPos(window->win32.handle, - HWND_TOPMOST, - 0, 0, 0, 0, - SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); - } - - DragAcceptFiles(window->win32.handle, TRUE); - - if (!_glfwCreateContext(window, ctxconfig, fbconfig)) + if (!_glfwCreateContext(window, wndconfig, fbconfig)) return GL_FALSE; return GL_TRUE; @@ -982,67 +858,27 @@ static void destroyWindow(_GLFWwindow* window) } -////////////////////////////////////////////////////////////////////////// -////// GLFW internal API ////// -////////////////////////////////////////////////////////////////////////// - -// Registers the GLFW window class -// -GLboolean _glfwRegisterWindowClass(void) -{ - WNDCLASSW wc; - - wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; - wc.lpfnWndProc = (WNDPROC) windowProc; - wc.cbClsExtra = 0; // No extra class data - wc.cbWndExtra = sizeof(void*) + sizeof(int); // Make room for one pointer - wc.hInstance = GetModuleHandleW(NULL); - wc.hCursor = LoadCursorW(NULL, IDC_ARROW); - wc.hbrBackground = NULL; // No background - wc.lpszMenuName = NULL; // No menu - wc.lpszClassName = _GLFW_WNDCLASSNAME; - - // Load user-provided icon if available - wc.hIcon = LoadIconW(GetModuleHandleW(NULL), L"GLFW_ICON"); - if (!wc.hIcon) - { - // No user-provided icon found, load default icon - wc.hIcon = LoadIconW(NULL, IDI_WINLOGO); - } - - if (!RegisterClassW(&wc)) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Win32: Failed to register window class"); - return GL_FALSE; - } - - return GL_TRUE; -} - -// Unregisters the GLFW window class -// -void _glfwUnregisterWindowClass(void) -{ - UnregisterClassW(_GLFW_WNDCLASSNAME, GetModuleHandleW(NULL)); -} - - ////////////////////////////////////////////////////////////////////////// ////// GLFW platform API ////// ////////////////////////////////////////////////////////////////////////// int _glfwPlatformCreateWindow(_GLFWwindow* window, const _GLFWwndconfig* wndconfig, - const _GLFWctxconfig* ctxconfig, const _GLFWfbconfig* fbconfig) { int status; - if (!createWindow(window, wndconfig, ctxconfig, fbconfig)) + if (!_glfw.win32.classAtom) + { + _glfw.win32.classAtom = registerWindowClass(); + if (!_glfw.win32.classAtom) + return GL_FALSE; + } + + if (!createWindow(window, wndconfig, fbconfig)) return GL_FALSE; - status = _glfwAnalyzeContext(window, ctxconfig, fbconfig); + status = _glfwAnalyzeContext(window, wndconfig, fbconfig); if (status == _GLFW_RECREATION_IMPOSSIBLE) return GL_FALSE; @@ -1066,7 +902,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window, // First we clear the current context (the one we just created) // This is usually done by glfwDestroyWindow, but as we're not doing - // full GLFW window destruction, it's duplicated here + // full window destruction, it's duplicated here _glfwPlatformMakeContextCurrent(NULL); // Next destroy the Win32 window and WGL context (without resetting or @@ -1074,15 +910,19 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window, destroyWindow(window); // ...and then create them again, this time with better APIs - if (!createWindow(window, wndconfig, ctxconfig, fbconfig)) + if (!createWindow(window, wndconfig, fbconfig)) return GL_FALSE; } if (window->monitor) { - _glfwPlatformShowWindow(window); - if (!enterFullscreenMode(window)) + if (!_glfwSetVideoMode(window->monitor, &window->videoMode)) return GL_FALSE; + + // Place the window above all topmost windows + _glfwPlatformShowWindow(window); + SetWindowPos(window->win32.handle, HWND_TOPMOST, 0,0,0,0, + SWP_NOMOVE | SWP_NOSIZE); } return GL_TRUE; @@ -1090,10 +930,10 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window, void _glfwPlatformDestroyWindow(_GLFWwindow* window) { - if (window->monitor) - leaveFullscreenMode(window); - destroyWindow(window); + + if (window->monitor) + _glfwRestoreVideoMode(window->monitor); } void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title) @@ -1106,7 +946,7 @@ void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title) return; } - SetWindowTextW(window->win32.handle, wideTitle); + SetWindowText(window->win32.handle, wideTitle); free(wideTitle); } @@ -1144,7 +984,15 @@ void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height) void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height) { if (window->monitor) - enterFullscreenMode(window); + { + GLFWvidmode mode; + _glfwSetVideoMode(window->monitor, &window->videoMode); + _glfwPlatformGetVideoMode(window->monitor, &mode); + + SetWindowPos(window->win32.handle, HWND_TOP, + 0, 0, mode.width, mode.height, + SWP_NOMOVE); + } else { int fullWidth, fullHeight; @@ -1152,7 +1000,7 @@ void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height) SetWindowPos(window->win32.handle, HWND_TOP, 0, 0, fullWidth, fullHeight, - SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOZORDER); + SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOZORDER); } } @@ -1161,28 +1009,6 @@ void _glfwPlatformGetFramebufferSize(_GLFWwindow* window, int* width, int* heigh _glfwPlatformGetWindowSize(window, width, height); } -void _glfwPlatformGetWindowFrameSize(_GLFWwindow* window, - int* left, int* top, - int* right, int* bottom) -{ - RECT rect; - int width, height; - - _glfwPlatformGetWindowSize(window, &width, &height); - SetRect(&rect, 0, 0, width, height); - AdjustWindowRectEx(&rect, window->win32.dwStyle, - FALSE, window->win32.dwExStyle); - - if (left) - *left = -rect.left; - if (top) - *top = -rect.top; - if (right) - *right = rect.right - width; - if (bottom) - *bottom = rect.bottom - height; -} - void _glfwPlatformIconifyWindow(_GLFWwindow* window) { ShowWindow(window->win32.handle, SW_MINIMIZE); @@ -1195,17 +1021,12 @@ void _glfwPlatformRestoreWindow(_GLFWwindow* window) void _glfwPlatformShowWindow(_GLFWwindow* window) { - ShowWindow(window->win32.handle, SW_SHOW); + ShowWindow(window->win32.handle, SW_SHOWNORMAL); BringWindowToTop(window->win32.handle); SetForegroundWindow(window->win32.handle); SetFocus(window->win32.handle); } -void _glfwPlatformUnhideWindow(_GLFWwindow* window) -{ - ShowWindow(window->win32.handle, SW_SHOW); -} - void _glfwPlatformHideWindow(_GLFWwindow* window) { ShowWindow(window->win32.handle, SW_HIDE); @@ -1216,7 +1037,7 @@ void _glfwPlatformPollEvents(void) MSG msg; _GLFWwindow* window; - while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE)) + while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if (msg.message == WM_QUIT) { @@ -1232,7 +1053,7 @@ void _glfwPlatformPollEvents(void) else { TranslateMessage(&msg); - DispatchMessageW(&msg); + DispatchMessage(&msg); } } @@ -1251,14 +1072,14 @@ void _glfwPlatformPollEvents(void) // See if this differs from our belief of what has happened // (we only have to check for lost key up events) - if (!lshiftDown && window->keys[GLFW_KEY_LEFT_SHIFT] == 1) + if (!lshiftDown && window->key[GLFW_KEY_LEFT_SHIFT] == 1) _glfwInputKey(window, GLFW_KEY_LEFT_SHIFT, 0, GLFW_RELEASE, mods); - if (!rshiftDown && window->keys[GLFW_KEY_RIGHT_SHIFT] == 1) + if (!rshiftDown && window->key[GLFW_KEY_RIGHT_SHIFT] == 1) _glfwInputKey(window, GLFW_KEY_RIGHT_SHIFT, 0, GLFW_RELEASE, mods); } - // Did the cursor move in an focused window that has disabled the cursor + // Did the cursor move in an focused window that has captured the cursor if (window->cursorMode == GLFW_CURSOR_DISABLED && !window->win32.cursorCentered) { @@ -1277,214 +1098,32 @@ void _glfwPlatformWaitEvents(void) _glfwPlatformPollEvents(); } -void _glfwPlatformPostEmptyEvent(void) -{ - _GLFWwindow* window = _glfw.windowListHead; - PostMessage(window->win32.handle, WM_NULL, 0, 0); -} - void _glfwPlatformSetCursorPos(_GLFWwindow* window, double xpos, double ypos) { POINT pos = { (int) xpos, (int) ypos }; ClientToScreen(window->win32.handle, &pos); SetCursorPos(pos.x, pos.y); - window->win32.oldCursorX = (int) xpos; - window->win32.oldCursorY = (int) ypos; + window->win32.oldCursorX = xpos; + window->win32.oldCursorY = ypos; } -void _glfwPlatformApplyCursorMode(_GLFWwindow* window) +void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode) { - switch (window->cursorMode) + switch (mode) { case GLFW_CURSOR_NORMAL: - restoreCursor(window); + showCursor(window); break; case GLFW_CURSOR_HIDDEN: hideCursor(window); break; case GLFW_CURSOR_DISABLED: - disableCursor(window); + captureCursor(window); break; } } -int _glfwPlatformCreateCursor(_GLFWcursor* cursor, - const GLFWimage* image, - int xhot, int yhot) -{ - HDC dc; - HBITMAP bitmap, mask; - BITMAPV5HEADER bi; - ICONINFO ii; - DWORD* target = 0; - BYTE* source = (BYTE*) image->pixels; - int i; - - ZeroMemory(&bi, sizeof(bi)); - bi.bV5Size = sizeof(BITMAPV5HEADER); - bi.bV5Width = image->width; - bi.bV5Height = -image->height; - bi.bV5Planes = 1; - bi.bV5BitCount = 32; - bi.bV5Compression = BI_BITFIELDS; - bi.bV5RedMask = 0x00ff0000; - bi.bV5GreenMask = 0x0000ff00; - bi.bV5BlueMask = 0x000000ff; - bi.bV5AlphaMask = 0xff000000; - - dc = GetDC(NULL); - bitmap = CreateDIBSection(dc, (BITMAPINFO*) &bi, DIB_RGB_COLORS, - (void**) &target, NULL, (DWORD) 0); - ReleaseDC(NULL, dc); - - if (!bitmap) - return GL_FALSE; - - mask = CreateBitmap(image->width, image->height, 1, 1, NULL); - if (!mask) - { - DeleteObject(bitmap); - return GL_FALSE; - } - - for (i = 0; i < image->width * image->height; i++, target++, source += 4) - { - *target = (source[3] << 24) | - (source[0] << 16) | - (source[1] << 8) | - source[2]; - } - - ZeroMemory(&ii, sizeof(ii)); - ii.fIcon = FALSE; - ii.xHotspot = xhot; - ii.yHotspot = yhot; - ii.hbmMask = mask; - ii.hbmColor = bitmap; - - cursor->win32.handle = (HCURSOR) CreateIconIndirect(&ii); - - DeleteObject(bitmap); - DeleteObject(mask); - - if (!cursor->win32.handle) - return GL_FALSE; - - return GL_TRUE; -} - -void _glfwPlatformDestroyCursor(_GLFWcursor* cursor) -{ - if (cursor->win32.handle) - DestroyIcon((HICON) cursor->win32.handle); -} - -void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor) -{ - // It should be guaranteed that the cursor is not being used by this window if - // the following condition is not met. That way it should be safe to destroy the - // cursor after calling glfwSetCursor(window, NULL) on all windows using the cursor. - - if (window->cursorMode == GLFW_CURSOR_NORMAL && _glfw.focusedWindow == window && - window->win32.cursorInside) - { - if (cursor) - SetCursor(cursor->win32.handle); - else - SetCursor(LoadCursorW(NULL, IDC_ARROW)); - } -} - -void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string) -{ - WCHAR* wideString; - HANDLE stringHandle; - size_t wideSize; - - wideString = _glfwCreateWideStringFromUTF8(string); - if (!wideString) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Win32: Failed to convert clipboard string to " - "wide string"); - return; - } - - wideSize = (wcslen(wideString) + 1) * sizeof(WCHAR); - - stringHandle = GlobalAlloc(GMEM_MOVEABLE, wideSize); - if (!stringHandle) - { - free(wideString); - - _glfwInputError(GLFW_PLATFORM_ERROR, - "Win32: Failed to allocate global handle for clipboard"); - return; - } - - memcpy(GlobalLock(stringHandle), wideString, wideSize); - GlobalUnlock(stringHandle); - - if (!OpenClipboard(window->win32.handle)) - { - GlobalFree(stringHandle); - free(wideString); - - _glfwInputError(GLFW_PLATFORM_ERROR, "Win32: Failed to open clipboard"); - return; - } - - EmptyClipboard(); - SetClipboardData(CF_UNICODETEXT, stringHandle); - CloseClipboard(); - - free(wideString); -} - -const char* _glfwPlatformGetClipboardString(_GLFWwindow* window) -{ - HANDLE stringHandle; - - if (!IsClipboardFormatAvailable(CF_UNICODETEXT)) - { - _glfwInputError(GLFW_FORMAT_UNAVAILABLE, NULL); - return NULL; - } - - if (!OpenClipboard(window->win32.handle)) - { - _glfwInputError(GLFW_PLATFORM_ERROR, "Win32: Failed to open clipboard"); - return NULL; - } - - stringHandle = GetClipboardData(CF_UNICODETEXT); - if (!stringHandle) - { - CloseClipboard(); - - _glfwInputError(GLFW_PLATFORM_ERROR, - "Win32: Failed to retrieve clipboard data"); - return NULL; - } - - free(_glfw.win32.clipboardString); - _glfw.win32.clipboardString = - _glfwCreateUTF8FromWideString(GlobalLock(stringHandle)); - - GlobalUnlock(stringHandle); - CloseClipboard(); - - if (!_glfw.win32.clipboardString) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Win32: Failed to convert wide string to UTF-8"); - return NULL; - } - - return _glfw.win32.clipboardString; -} - ////////////////////////////////////////////////////////////////////////// ////// GLFW native API ////// diff --git a/extern/glfw/src/window.c b/extern/glfw/src/window.c index 561671e..f6bac5a 100644 --- a/extern/glfw/src/window.c +++ b/extern/glfw/src/window.c @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 - www.glfw.org +// GLFW 3.0 - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -30,6 +30,17 @@ #include #include +#if defined(_MSC_VER) + #include +#endif + + +// Return the maxiumum of the specified values +// +static int Max(int a, int b) +{ + return (a > b) ? a : b; +} ////////////////////////////////////////////////////////////////////////// @@ -40,32 +51,38 @@ void _glfwInputWindowFocus(_GLFWwindow* window, GLboolean focused) { if (focused) { - _glfw.focusedWindow = window; + if (_glfw.focusedWindow != window) + { + _glfw.focusedWindow = window; - if (window->callbacks.focus) - window->callbacks.focus((GLFWwindow*) window, focused); + if (window->callbacks.focus) + window->callbacks.focus((GLFWwindow*) window, focused); + } } else { - int i; - - _glfw.focusedWindow = NULL; - - if (window->callbacks.focus) - window->callbacks.focus((GLFWwindow*) window, focused); - - // Release all pressed keyboard keys - for (i = 0; i <= GLFW_KEY_LAST; i++) + if (_glfw.focusedWindow == window) { - if (window->keys[i] == GLFW_PRESS) - _glfwInputKey(window, i, 0, GLFW_RELEASE, 0); - } + int i; - // Release all pressed mouse buttons - for (i = 0; i <= GLFW_MOUSE_BUTTON_LAST; i++) - { - if (window->mouseButtons[i] == GLFW_PRESS) - _glfwInputMouseClick(window, i, GLFW_RELEASE, 0); + _glfw.focusedWindow = NULL; + + if (window->callbacks.focus) + window->callbacks.focus((GLFWwindow*) window, focused); + + // Release all pressed keyboard keys + for (i = 0; i <= GLFW_KEY_LAST; i++) + { + if (window->key[i] == GLFW_PRESS) + _glfwInputKey(window, i, 0, GLFW_RELEASE, 0); + } + + // Release all pressed mouse buttons + for (i = 0; i <= GLFW_MOUSE_BUTTON_LAST; i++) + { + if (window->mouseButton[i] == GLFW_PRESS) + _glfwInputMouseClick(window, i, GLFW_RELEASE, 0); + } } } } @@ -84,6 +101,9 @@ void _glfwInputWindowSize(_GLFWwindow* window, int width, int height) void _glfwInputWindowIconify(_GLFWwindow* window, int iconified) { + if (window->iconified == iconified) + return; + window->iconified = iconified; if (window->callbacks.iconify) @@ -109,7 +129,7 @@ void _glfwInputWindowDamage(_GLFWwindow* window) void _glfwInputWindowCloseRequest(_GLFWwindow* window) { - window->closed = GL_TRUE; + window->closed = GL_TRUE; if (window->callbacks.close) window->callbacks.close((GLFWwindow*) window); @@ -126,7 +146,6 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, GLFWwindow* share) { _GLFWfbconfig fbconfig; - _GLFWctxconfig ctxconfig; _GLFWwndconfig wndconfig; _GLFWwindow* window; _GLFWwindow* previous; @@ -140,21 +159,20 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, } // Set up desired framebuffer config - fbconfig.redBits = _glfw.hints.redBits; - fbconfig.greenBits = _glfw.hints.greenBits; - fbconfig.blueBits = _glfw.hints.blueBits; - fbconfig.alphaBits = _glfw.hints.alphaBits; - fbconfig.depthBits = _glfw.hints.depthBits; - fbconfig.stencilBits = _glfw.hints.stencilBits; - fbconfig.accumRedBits = _glfw.hints.accumRedBits; - fbconfig.accumGreenBits = _glfw.hints.accumGreenBits; - fbconfig.accumBlueBits = _glfw.hints.accumBlueBits; - fbconfig.accumAlphaBits = _glfw.hints.accumAlphaBits; - fbconfig.auxBuffers = _glfw.hints.auxBuffers; + fbconfig.redBits = Max(_glfw.hints.redBits, 0); + fbconfig.greenBits = Max(_glfw.hints.greenBits, 0); + fbconfig.blueBits = Max(_glfw.hints.blueBits, 0); + fbconfig.alphaBits = Max(_glfw.hints.alphaBits, 0); + fbconfig.depthBits = Max(_glfw.hints.depthBits, 0); + fbconfig.stencilBits = Max(_glfw.hints.stencilBits, 0); + fbconfig.accumRedBits = Max(_glfw.hints.accumRedBits, 0); + fbconfig.accumGreenBits = Max(_glfw.hints.accumGreenBits, 0); + fbconfig.accumBlueBits = Max(_glfw.hints.accumBlueBits, 0); + fbconfig.accumAlphaBits = Max(_glfw.hints.accumAlphaBits, 0); + fbconfig.auxBuffers = Max(_glfw.hints.auxBuffers, 0); fbconfig.stereo = _glfw.hints.stereo ? GL_TRUE : GL_FALSE; - fbconfig.samples = _glfw.hints.samples; - fbconfig.sRGB = _glfw.hints.sRGB; - fbconfig.doublebuffer = _glfw.hints.doublebuffer ? GL_TRUE : GL_FALSE; + fbconfig.samples = Max(_glfw.hints.samples, 0); + fbconfig.sRGB = _glfw.hints.sRGB ? GL_TRUE : GL_FALSE; // Set up desired window config wndconfig.width = width; @@ -163,24 +181,18 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, wndconfig.resizable = _glfw.hints.resizable ? GL_TRUE : GL_FALSE; wndconfig.visible = _glfw.hints.visible ? GL_TRUE : GL_FALSE; wndconfig.decorated = _glfw.hints.decorated ? GL_TRUE : GL_FALSE; - wndconfig.focused = _glfw.hints.focused ? GL_TRUE : GL_FALSE; - wndconfig.autoIconify = _glfw.hints.autoIconify ? GL_TRUE : GL_FALSE; - wndconfig.floating = _glfw.hints.floating ? GL_TRUE : GL_FALSE; + wndconfig.clientAPI = _glfw.hints.clientAPI; + wndconfig.glMajor = _glfw.hints.glMajor; + wndconfig.glMinor = _glfw.hints.glMinor; + wndconfig.glForward = _glfw.hints.glForward ? GL_TRUE : GL_FALSE; + wndconfig.glDebug = _glfw.hints.glDebug ? GL_TRUE : GL_FALSE; + wndconfig.glProfile = _glfw.hints.glProfile; + wndconfig.glRobustness = _glfw.hints.glRobustness; wndconfig.monitor = (_GLFWmonitor*) monitor; - - // Set up desired context config - ctxconfig.api = _glfw.hints.api; - ctxconfig.major = _glfw.hints.major; - ctxconfig.minor = _glfw.hints.minor; - ctxconfig.forward = _glfw.hints.forward ? GL_TRUE : GL_FALSE; - ctxconfig.debug = _glfw.hints.debug ? GL_TRUE : GL_FALSE; - ctxconfig.profile = _glfw.hints.profile; - ctxconfig.robustness = _glfw.hints.robustness; - ctxconfig.release = _glfw.hints.release; - ctxconfig.share = (_GLFWwindow*) share; + wndconfig.share = (_GLFWwindow*) share; // Check the OpenGL bits of the window config - if (!_glfwIsValidContextConfig(&ctxconfig)) + if (!_glfwIsValidContextConfig(&wndconfig)) return NULL; window = calloc(1, sizeof(_GLFWwindow)); @@ -191,52 +203,47 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, { wndconfig.resizable = GL_TRUE; wndconfig.visible = GL_TRUE; - wndconfig.focused = GL_TRUE; // Set up desired video mode window->videoMode.width = width; window->videoMode.height = height; - window->videoMode.redBits = _glfw.hints.redBits; - window->videoMode.greenBits = _glfw.hints.greenBits; - window->videoMode.blueBits = _glfw.hints.blueBits; - window->videoMode.refreshRate = _glfw.hints.refreshRate; + window->videoMode.redBits = Max(_glfw.hints.redBits, 0); + window->videoMode.greenBits = Max(_glfw.hints.greenBits, 0); + window->videoMode.blueBits = Max(_glfw.hints.blueBits, 0); + window->videoMode.refreshRate = Max(_glfw.hints.refreshRate, 0); } - // Transfer window hints that are persistent settings and not - // just initial states window->monitor = wndconfig.monitor; window->resizable = wndconfig.resizable; window->decorated = wndconfig.decorated; - window->autoIconify = wndconfig.autoIconify; - window->floating = wndconfig.floating; window->cursorMode = GLFW_CURSOR_NORMAL; // Save the currently current context so it can be restored later - previous = _glfwPlatformGetCurrentContext(); + previous = (_GLFWwindow*) glfwGetCurrentContext(); // Open the actual window and create its context - if (!_glfwPlatformCreateWindow(window, &wndconfig, &ctxconfig, &fbconfig)) + if (!_glfwPlatformCreateWindow(window, &wndconfig, &fbconfig)) { glfwDestroyWindow((GLFWwindow*) window); - _glfwPlatformMakeContextCurrent(previous); + glfwMakeContextCurrent((GLFWwindow*) previous); return NULL; } - _glfwPlatformMakeContextCurrent(window); + glfwMakeContextCurrent((GLFWwindow*) window); // Retrieve the actual (as opposed to requested) context attributes - if (!_glfwRefreshContextAttribs(&ctxconfig)) + if (!_glfwRefreshContextAttribs()) { glfwDestroyWindow((GLFWwindow*) window); - _glfwPlatformMakeContextCurrent(previous); + glfwMakeContextCurrent((GLFWwindow*) previous); return NULL; } // Verify the context against the requested parameters - if (!_glfwIsValidContext(&ctxconfig)) + if (!_glfwIsValidContext(&wndconfig)) { glfwDestroyWindow((GLFWwindow*) window); - _glfwPlatformMakeContextCurrent(previous); + glfwMakeContextCurrent((GLFWwindow*) previous); return NULL; } @@ -246,28 +253,10 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, _glfwPlatformSwapBuffers(window); // Restore the previously current context (or NULL) - _glfwPlatformMakeContextCurrent(previous); + glfwMakeContextCurrent((GLFWwindow*) previous); - if (wndconfig.monitor) - { - int width, height; - _glfwPlatformGetWindowSize(window, &width, &height); - - window->cursorPosX = width / 2; - window->cursorPosY = height / 2; - - _glfwPlatformSetCursorPos(window, window->cursorPosX, window->cursorPosY); - } - else - { - if (wndconfig.visible) - { - if (wndconfig.focused) - _glfwPlatformShowWindow(window); - else - _glfwPlatformUnhideWindow(window); - } - } + if (wndconfig.monitor == NULL && wndconfig.visible) + glfwShowWindow((GLFWwindow*) window); return (GLFWwindow*) window; } @@ -279,29 +268,22 @@ void glfwDefaultWindowHints(void) memset(&_glfw.hints, 0, sizeof(_glfw.hints)); // The default is OpenGL with minimum version 1.0 - _glfw.hints.api = GLFW_OPENGL_API; - _glfw.hints.major = 1; - _glfw.hints.minor = 0; + _glfw.hints.clientAPI = GLFW_OPENGL_API; + _glfw.hints.glMajor = 1; + _glfw.hints.glMinor = 0; - // The default is a focused, visible, resizable window with decorations - _glfw.hints.resizable = GL_TRUE; - _glfw.hints.visible = GL_TRUE; - _glfw.hints.decorated = GL_TRUE; - _glfw.hints.focused = GL_TRUE; - _glfw.hints.autoIconify = GL_TRUE; + // The default is a visible, resizable window with decorations + _glfw.hints.resizable = GL_TRUE; + _glfw.hints.visible = GL_TRUE; + _glfw.hints.decorated = GL_TRUE; - // The default is to select the highest available refresh rate - _glfw.hints.refreshRate = GLFW_DONT_CARE; - - // The default is 24 bits of color, 24 bits of depth and 8 bits of stencil, - // double buffered - _glfw.hints.redBits = 8; - _glfw.hints.greenBits = 8; - _glfw.hints.blueBits = 8; - _glfw.hints.alphaBits = 8; - _glfw.hints.depthBits = 24; - _glfw.hints.stencilBits = 8; - _glfw.hints.doublebuffer = GL_TRUE; + // The default is 24 bits of color, 24 bits of depth and 8 bits of stencil + _glfw.hints.redBits = 8; + _glfw.hints.greenBits = 8; + _glfw.hints.blueBits = 8; + _glfw.hints.alphaBits = 8; + _glfw.hints.depthBits = 24; + _glfw.hints.stencilBits = 8; } GLFWAPI void glfwWindowHint(int target, int hint) @@ -349,24 +331,12 @@ GLFWAPI void glfwWindowHint(int target, int hint) case GLFW_REFRESH_RATE: _glfw.hints.refreshRate = hint; break; - case GLFW_DOUBLEBUFFER: - _glfw.hints.doublebuffer = hint; - break; case GLFW_RESIZABLE: _glfw.hints.resizable = hint; break; case GLFW_DECORATED: _glfw.hints.decorated = hint; break; - case GLFW_FOCUSED: - _glfw.hints.focused = hint; - break; - case GLFW_AUTO_ICONIFY: - _glfw.hints.autoIconify = hint; - break; - case GLFW_FLOATING: - _glfw.hints.floating = hint; - break; case GLFW_VISIBLE: _glfw.hints.visible = hint; break; @@ -377,28 +347,25 @@ GLFWAPI void glfwWindowHint(int target, int hint) _glfw.hints.sRGB = hint; break; case GLFW_CLIENT_API: - _glfw.hints.api = hint; + _glfw.hints.clientAPI = hint; break; case GLFW_CONTEXT_VERSION_MAJOR: - _glfw.hints.major = hint; + _glfw.hints.glMajor = hint; break; case GLFW_CONTEXT_VERSION_MINOR: - _glfw.hints.minor = hint; + _glfw.hints.glMinor = hint; break; case GLFW_CONTEXT_ROBUSTNESS: - _glfw.hints.robustness = hint; + _glfw.hints.glRobustness = hint; break; case GLFW_OPENGL_FORWARD_COMPAT: - _glfw.hints.forward = hint; + _glfw.hints.glForward = hint; break; case GLFW_OPENGL_DEBUG_CONTEXT: - _glfw.hints.debug = hint; + _glfw.hints.glDebug = hint; break; case GLFW_OPENGL_PROFILE: - _glfw.hints.profile = hint; - break; - case GLFW_CONTEXT_RELEASE_BEHAVIOR: - _glfw.hints.release = hint; + _glfw.hints.glProfile = hint; break; default: _glfwInputError(GLFW_INVALID_ENUM, NULL); @@ -467,12 +434,6 @@ GLFWAPI void glfwSetWindowTitle(GLFWwindow* handle, const char* title) GLFWAPI void glfwGetWindowPos(GLFWwindow* handle, int* xpos, int* ypos) { _GLFWwindow* window = (_GLFWwindow*) handle; - - if (xpos) - *xpos = 0; - if (ypos) - *ypos = 0; - _GLFW_REQUIRE_INIT(); _glfwPlatformGetWindowPos(window, xpos, ypos); } @@ -496,12 +457,6 @@ GLFWAPI void glfwSetWindowPos(GLFWwindow* handle, int xpos, int ypos) GLFWAPI void glfwGetWindowSize(GLFWwindow* handle, int* width, int* height) { _GLFWwindow* window = (_GLFWwindow*) handle; - - if (width) - *width = 0; - if (height) - *height = 0; - _GLFW_REQUIRE_INIT(); _glfwPlatformGetWindowSize(window, width, height); } @@ -512,6 +467,9 @@ GLFWAPI void glfwSetWindowSize(GLFWwindow* handle, int width, int height) _GLFW_REQUIRE_INIT(); + if (window->iconified) + return; + if (window->monitor) { window->videoMode.width = width; @@ -525,45 +483,32 @@ GLFWAPI void glfwGetFramebufferSize(GLFWwindow* handle, int* width, int* height) { _GLFWwindow* window = (_GLFWwindow*) handle; - if (width) - *width = 0; - if (height) - *height = 0; - _GLFW_REQUIRE_INIT(); + _glfwPlatformGetFramebufferSize(window, width, height); } -GLFWAPI void glfwGetWindowFrameSize(GLFWwindow* handle, - int* left, int* top, - int* right, int* bottom) -{ - _GLFWwindow* window = (_GLFWwindow*) handle; - - if (left) - *left = 0; - if (top) - *top = 0; - if (right) - *right = 0; - if (bottom) - *bottom = 0; - - _GLFW_REQUIRE_INIT(); - _glfwPlatformGetWindowFrameSize(window, left, top, right, bottom); -} - GLFWAPI void glfwIconifyWindow(GLFWwindow* handle) { _GLFWwindow* window = (_GLFWwindow*) handle; + _GLFW_REQUIRE_INIT(); + + if (window->iconified) + return; + _glfwPlatformIconifyWindow(window); } GLFWAPI void glfwRestoreWindow(GLFWwindow* handle) { _GLFWwindow* window = (_GLFWwindow*) handle; + _GLFW_REQUIRE_INIT(); + + if (!window->iconified) + return; + _glfwPlatformRestoreWindow(window); } @@ -607,28 +552,24 @@ GLFWAPI int glfwGetWindowAttrib(GLFWwindow* handle, int attrib) return window->resizable; case GLFW_DECORATED: return window->decorated; - case GLFW_FLOATING: - return window->floating; case GLFW_VISIBLE: return window->visible; case GLFW_CLIENT_API: - return window->context.api; + return window->clientAPI; case GLFW_CONTEXT_VERSION_MAJOR: - return window->context.major; + return window->glMajor; case GLFW_CONTEXT_VERSION_MINOR: - return window->context.minor; + return window->glMinor; case GLFW_CONTEXT_REVISION: - return window->context.revision; + return window->glRevision; case GLFW_CONTEXT_ROBUSTNESS: - return window->context.robustness; + return window->glRobustness; case GLFW_OPENGL_FORWARD_COMPAT: - return window->context.forward; + return window->glForward; case GLFW_OPENGL_DEBUG_CONTEXT: - return window->context.debug; + return window->glDebug; case GLFW_OPENGL_PROFILE: - return window->context.profile; - case GLFW_CONTEXT_RELEASE_BEHAVIOR: - return window->context.release; + return window->glProfile; } _glfwInputError(GLFW_INVALID_ENUM, NULL); @@ -728,20 +669,6 @@ GLFWAPI void glfwPollEvents(void) GLFWAPI void glfwWaitEvents(void) { _GLFW_REQUIRE_INIT(); - - if (!_glfw.windowListHead) - return; - _glfwPlatformWaitEvents(); } -GLFWAPI void glfwPostEmptyEvent(void) -{ - _GLFW_REQUIRE_INIT(); - - if (!_glfw.windowListHead) - return; - - _glfwPlatformPostEmptyEvent(); -} - diff --git a/extern/glfw/src/winmm_joystick.h b/extern/glfw/src/winmm_joystick.h deleted file mode 100644 index 608f1dc..0000000 --- a/extern/glfw/src/winmm_joystick.h +++ /dev/null @@ -1,47 +0,0 @@ -//======================================================================== -// GLFW 3.1 WinMM - www.glfw.org -//------------------------------------------------------------------------ -// Copyright (c) 2006-2014 Camilla Berglund -// -// 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 _winmm_joystick_h_ -#define _winmm_joystick_h_ - -#define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE \ - _GLFWjoystickWinMM winmm_js[GLFW_JOYSTICK_LAST + 1] - - -// WinMM-specific per-joystick data -// -typedef struct _GLFWjoystickWinMM -{ - float axes[6]; - unsigned char buttons[36]; // 32 buttons plus one hat - char* name; -} _GLFWjoystickWinMM; - - -void _glfwInitJoysticks(void); -void _glfwTerminateJoysticks(void); - -#endif // _winmm_joystick_h_ diff --git a/extern/glfw/src/wl_init.c b/extern/glfw/src/wl_init.c deleted file mode 100644 index 0269ee3..0000000 --- a/extern/glfw/src/wl_init.c +++ /dev/null @@ -1,630 +0,0 @@ -//======================================================================== -// GLFW 3.1 Wayland - www.glfw.org -//------------------------------------------------------------------------ -// Copyright (c) 2014 Jonas Ådahl -// -// 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. -// -//======================================================================== - -#include "internal.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "xkb_unicode.h" - -static void pointerHandleEnter(void* data, - struct wl_pointer* pointer, - uint32_t serial, - struct wl_surface* surface, - wl_fixed_t sx, - wl_fixed_t sy) -{ - _GLFWwindow* window = wl_surface_get_user_data(surface); - - _glfw.wl.pointerSerial = serial; - _glfw.wl.pointerFocus = window; - - _glfwPlatformSetCursor(window, window->wl.currentCursor); - _glfwInputCursorEnter(window, GL_TRUE); -} - -static void pointerHandleLeave(void* data, - struct wl_pointer* pointer, - uint32_t serial, - struct wl_surface* surface) -{ - _GLFWwindow* window = _glfw.wl.pointerFocus; - - if (!window) - return; - - _glfw.wl.pointerSerial = serial; - _glfw.wl.pointerFocus = NULL; - _glfwInputCursorEnter(window, GL_FALSE); -} - -static void pointerHandleMotion(void* data, - struct wl_pointer* pointer, - uint32_t time, - wl_fixed_t sx, - wl_fixed_t sy) -{ - _GLFWwindow* window = _glfw.wl.pointerFocus; - - if (!window) - return; - - if (window->cursorMode == GLFW_CURSOR_DISABLED) - { - /* TODO */ - _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: GLFW_CURSOR_DISABLED not supported"); - return; - } - - _glfwInputCursorMotion(window, - wl_fixed_to_double(sx), - wl_fixed_to_double(sy)); -} - -static void pointerHandleButton(void* data, - struct wl_pointer* wl_pointer, - uint32_t serial, - uint32_t time, - uint32_t button, - uint32_t state) -{ - _GLFWwindow* window = _glfw.wl.pointerFocus; - int glfwButton; - - if (!window) - return; - - /* Makes left, right and middle 0, 1 and 2. Overall order follows evdev - * codes. */ - glfwButton = button - BTN_LEFT; - - _glfwInputMouseClick(window, - glfwButton, - state == WL_POINTER_BUTTON_STATE_PRESSED - ? GLFW_PRESS - : GLFW_RELEASE, - _glfw.wl.xkb.modifiers); -} - -static void pointerHandleAxis(void* data, - struct wl_pointer* wl_pointer, - uint32_t time, - uint32_t axis, - wl_fixed_t value) -{ - _GLFWwindow* window = _glfw.wl.pointerFocus; - double scroll_factor; - double x, y; - - if (!window) - return; - - /* Wayland scroll events are in pointer motion coordinate space (think - * two finger scroll). The factor 10 is commonly used to convert to - * "scroll step means 1.0. */ - scroll_factor = 1.0/10.0; - - switch (axis) - { - case WL_POINTER_AXIS_HORIZONTAL_SCROLL: - x = wl_fixed_to_double(value) * scroll_factor; - y = 0.0; - break; - case WL_POINTER_AXIS_VERTICAL_SCROLL: - x = 0.0; - y = wl_fixed_to_double(value) * scroll_factor; - break; - default: - break; - } - - _glfwInputScroll(window, x, y); -} - -static const struct wl_pointer_listener pointerListener = { - pointerHandleEnter, - pointerHandleLeave, - pointerHandleMotion, - pointerHandleButton, - pointerHandleAxis, -}; - -static void keyboardHandleKeymap(void* data, - struct wl_keyboard* keyboard, - uint32_t format, - int fd, - uint32_t size) -{ - struct xkb_keymap* keymap; - struct xkb_state* state; - char* mapStr; - - if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) - { - close(fd); - return; - } - - mapStr = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); - if (mapStr == MAP_FAILED) { - close(fd); - return; - } - - keymap = xkb_map_new_from_string(_glfw.wl.xkb.context, - mapStr, - XKB_KEYMAP_FORMAT_TEXT_V1, - 0); - munmap(mapStr, size); - close(fd); - - if (!keymap) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: Failed to compile keymap"); - return; - } - - state = xkb_state_new(keymap); - if (!state) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: Failed to create XKB state"); - xkb_map_unref(keymap); - return; - } - - xkb_keymap_unref(_glfw.wl.xkb.keymap); - xkb_state_unref(_glfw.wl.xkb.state); - _glfw.wl.xkb.keymap = keymap; - _glfw.wl.xkb.state = state; - - _glfw.wl.xkb.control_mask = - 1 << xkb_map_mod_get_index(_glfw.wl.xkb.keymap, "Control"); - _glfw.wl.xkb.alt_mask = - 1 << xkb_map_mod_get_index(_glfw.wl.xkb.keymap, "Mod1"); - _glfw.wl.xkb.shift_mask = - 1 << xkb_map_mod_get_index(_glfw.wl.xkb.keymap, "Shift"); - _glfw.wl.xkb.super_mask = - 1 << xkb_map_mod_get_index(_glfw.wl.xkb.keymap, "Mod4"); -} - -static void keyboardHandleEnter(void* data, - struct wl_keyboard* keyboard, - uint32_t serial, - struct wl_surface* surface, - struct wl_array* keys) -{ - _GLFWwindow* window = wl_surface_get_user_data(surface); - - _glfw.wl.keyboardFocus = window; - _glfwInputWindowFocus(window, GL_TRUE); -} - -static void keyboardHandleLeave(void* data, - struct wl_keyboard* keyboard, - uint32_t serial, - struct wl_surface* surface) -{ - _GLFWwindow* window = _glfw.wl.keyboardFocus; - - if (!window) - return; - - _glfw.wl.keyboardFocus = NULL; - _glfwInputWindowFocus(window, GL_FALSE); -} - -static int toGLFWKeyCode(uint32_t key) -{ - switch (key) - { - case KEY_GRAVE: return GLFW_KEY_GRAVE_ACCENT; - case KEY_1: return GLFW_KEY_1; - case KEY_2: return GLFW_KEY_2; - case KEY_3: return GLFW_KEY_3; - case KEY_4: return GLFW_KEY_4; - case KEY_5: return GLFW_KEY_5; - case KEY_6: return GLFW_KEY_6; - case KEY_7: return GLFW_KEY_7; - case KEY_8: return GLFW_KEY_8; - case KEY_9: return GLFW_KEY_9; - case KEY_0: return GLFW_KEY_0; - case KEY_MINUS: return GLFW_KEY_MINUS; - case KEY_EQUAL: return GLFW_KEY_EQUAL; - case KEY_Q: return GLFW_KEY_Q; - case KEY_W: return GLFW_KEY_W; - case KEY_E: return GLFW_KEY_E; - case KEY_R: return GLFW_KEY_R; - case KEY_T: return GLFW_KEY_T; - case KEY_Y: return GLFW_KEY_Y; - case KEY_U: return GLFW_KEY_U; - case KEY_I: return GLFW_KEY_I; - case KEY_O: return GLFW_KEY_O; - case KEY_P: return GLFW_KEY_P; - case KEY_LEFTBRACE: return GLFW_KEY_LEFT_BRACKET; - case KEY_RIGHTBRACE: return GLFW_KEY_RIGHT_BRACKET; - case KEY_A: return GLFW_KEY_A; - case KEY_S: return GLFW_KEY_S; - case KEY_D: return GLFW_KEY_D; - case KEY_F: return GLFW_KEY_F; - case KEY_G: return GLFW_KEY_G; - case KEY_H: return GLFW_KEY_H; - case KEY_J: return GLFW_KEY_J; - case KEY_K: return GLFW_KEY_K; - case KEY_L: return GLFW_KEY_L; - case KEY_SEMICOLON: return GLFW_KEY_SEMICOLON; - case KEY_APOSTROPHE: return GLFW_KEY_APOSTROPHE; - case KEY_Z: return GLFW_KEY_Z; - case KEY_X: return GLFW_KEY_X; - case KEY_C: return GLFW_KEY_C; - case KEY_V: return GLFW_KEY_V; - case KEY_B: return GLFW_KEY_B; - case KEY_N: return GLFW_KEY_N; - case KEY_M: return GLFW_KEY_M; - case KEY_COMMA: return GLFW_KEY_COMMA; - case KEY_DOT: return GLFW_KEY_PERIOD; - case KEY_SLASH: return GLFW_KEY_SLASH; - case KEY_BACKSLASH: return GLFW_KEY_BACKSLASH; - case KEY_ESC: return GLFW_KEY_ESCAPE; - case KEY_TAB: return GLFW_KEY_TAB; - case KEY_LEFTSHIFT: return GLFW_KEY_LEFT_SHIFT; - case KEY_RIGHTSHIFT: return GLFW_KEY_RIGHT_SHIFT; - case KEY_LEFTCTRL: return GLFW_KEY_LEFT_CONTROL; - case KEY_RIGHTCTRL: return GLFW_KEY_RIGHT_CONTROL; - case KEY_LEFTALT: return GLFW_KEY_LEFT_ALT; - case KEY_RIGHTALT: return GLFW_KEY_RIGHT_ALT; - case KEY_LEFTMETA: return GLFW_KEY_LEFT_SUPER; - case KEY_RIGHTMETA: return GLFW_KEY_RIGHT_SUPER; - case KEY_MENU: return GLFW_KEY_MENU; - case KEY_NUMLOCK: return GLFW_KEY_NUM_LOCK; - case KEY_CAPSLOCK: return GLFW_KEY_CAPS_LOCK; - case KEY_PRINT: return GLFW_KEY_PRINT_SCREEN; - case KEY_SCROLLLOCK: return GLFW_KEY_SCROLL_LOCK; - case KEY_PAUSE: return GLFW_KEY_PAUSE; - case KEY_DELETE: return GLFW_KEY_DELETE; - case KEY_BACKSPACE: return GLFW_KEY_BACKSPACE; - case KEY_ENTER: return GLFW_KEY_ENTER; - case KEY_HOME: return GLFW_KEY_HOME; - case KEY_END: return GLFW_KEY_END; - case KEY_PAGEUP: return GLFW_KEY_PAGE_UP; - case KEY_PAGEDOWN: return GLFW_KEY_PAGE_DOWN; - case KEY_INSERT: return GLFW_KEY_INSERT; - case KEY_LEFT: return GLFW_KEY_LEFT; - case KEY_RIGHT: return GLFW_KEY_RIGHT; - case KEY_DOWN: return GLFW_KEY_DOWN; - case KEY_UP: return GLFW_KEY_UP; - case KEY_F1: return GLFW_KEY_F1; - case KEY_F2: return GLFW_KEY_F2; - case KEY_F3: return GLFW_KEY_F3; - case KEY_F4: return GLFW_KEY_F4; - case KEY_F5: return GLFW_KEY_F5; - case KEY_F6: return GLFW_KEY_F6; - case KEY_F7: return GLFW_KEY_F7; - case KEY_F8: return GLFW_KEY_F8; - case KEY_F9: return GLFW_KEY_F9; - case KEY_F10: return GLFW_KEY_F10; - case KEY_F11: return GLFW_KEY_F11; - case KEY_F12: return GLFW_KEY_F12; - case KEY_F13: return GLFW_KEY_F13; - case KEY_F14: return GLFW_KEY_F14; - case KEY_F15: return GLFW_KEY_F15; - case KEY_F16: return GLFW_KEY_F16; - case KEY_F17: return GLFW_KEY_F17; - case KEY_F18: return GLFW_KEY_F18; - case KEY_F19: return GLFW_KEY_F19; - case KEY_F20: return GLFW_KEY_F20; - case KEY_F21: return GLFW_KEY_F21; - case KEY_F22: return GLFW_KEY_F22; - case KEY_F23: return GLFW_KEY_F23; - case KEY_F24: return GLFW_KEY_F24; - case KEY_KPSLASH: return GLFW_KEY_KP_DIVIDE; - case KEY_KPDOT: return GLFW_KEY_KP_MULTIPLY; - case KEY_KPMINUS: return GLFW_KEY_KP_SUBTRACT; - case KEY_KPPLUS: return GLFW_KEY_KP_ADD; - case KEY_KP0: return GLFW_KEY_KP_0; - case KEY_KP1: return GLFW_KEY_KP_1; - case KEY_KP2: return GLFW_KEY_KP_2; - case KEY_KP3: return GLFW_KEY_KP_3; - case KEY_KP4: return GLFW_KEY_KP_4; - case KEY_KP5: return GLFW_KEY_KP_5; - case KEY_KP6: return GLFW_KEY_KP_6; - case KEY_KP7: return GLFW_KEY_KP_7; - case KEY_KP8: return GLFW_KEY_KP_8; - case KEY_KP9: return GLFW_KEY_KP_9; - case KEY_KPCOMMA: return GLFW_KEY_KP_DECIMAL; - case KEY_KPEQUAL: return GLFW_KEY_KP_EQUAL; - case KEY_KPENTER: return GLFW_KEY_KP_ENTER; - default: return GLFW_KEY_UNKNOWN; - } -} - -static void keyboardHandleKey(void* data, - struct wl_keyboard* keyboard, - uint32_t serial, - uint32_t time, - uint32_t key, - uint32_t state) -{ - uint32_t code, num_syms; - long cp; - int keyCode; - int action; - const xkb_keysym_t *syms; - _GLFWwindow* window = _glfw.wl.keyboardFocus; - - if (!window) - return; - - keyCode = toGLFWKeyCode(key); - action = state == WL_KEYBOARD_KEY_STATE_PRESSED - ? GLFW_PRESS : GLFW_RELEASE; - - _glfwInputKey(window, keyCode, key, action, - _glfw.wl.xkb.modifiers); - - code = key + 8; - num_syms = xkb_key_get_syms(_glfw.wl.xkb.state, code, &syms); - - if (num_syms == 1) - { - cp = _glfwKeySym2Unicode(syms[0]); - if (cp != -1) - { - const int mods = _glfw.wl.xkb.modifiers; - const int plain = !(mods & (GLFW_MOD_CONTROL | GLFW_MOD_ALT)); - _glfwInputChar(window, cp, mods, plain); - } - } -} - -static void keyboardHandleModifiers(void* data, - struct wl_keyboard* keyboard, - uint32_t serial, - uint32_t modsDepressed, - uint32_t modsLatched, - uint32_t modsLocked, - uint32_t group) -{ - xkb_mod_mask_t mask; - unsigned int modifiers = 0; - - if (!_glfw.wl.xkb.keymap) - return; - - xkb_state_update_mask(_glfw.wl.xkb.state, - modsDepressed, - modsLatched, - modsLocked, - 0, - 0, - group); - - mask = xkb_state_serialize_mods(_glfw.wl.xkb.state, - XKB_STATE_DEPRESSED | - XKB_STATE_LATCHED); - if (mask & _glfw.wl.xkb.control_mask) - modifiers |= GLFW_MOD_CONTROL; - if (mask & _glfw.wl.xkb.alt_mask) - modifiers |= GLFW_MOD_ALT; - if (mask & _glfw.wl.xkb.shift_mask) - modifiers |= GLFW_MOD_SHIFT; - if (mask & _glfw.wl.xkb.super_mask) - modifiers |= GLFW_MOD_SUPER; - _glfw.wl.xkb.modifiers = modifiers; -} - -static const struct wl_keyboard_listener keyboardListener = { - keyboardHandleKeymap, - keyboardHandleEnter, - keyboardHandleLeave, - keyboardHandleKey, - keyboardHandleModifiers, -}; - -static void seatHandleCapabilities(void* data, - struct wl_seat* seat, - enum wl_seat_capability caps) -{ - if ((caps & WL_SEAT_CAPABILITY_POINTER) && !_glfw.wl.pointer) - { - _glfw.wl.pointer = wl_seat_get_pointer(seat); - wl_pointer_add_listener(_glfw.wl.pointer, &pointerListener, NULL); - } - else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && _glfw.wl.pointer) - { - wl_pointer_destroy(_glfw.wl.pointer); - _glfw.wl.pointer = NULL; - } - - if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !_glfw.wl.keyboard) - { - _glfw.wl.keyboard = wl_seat_get_keyboard(seat); - wl_keyboard_add_listener(_glfw.wl.keyboard, &keyboardListener, NULL); - } - else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && _glfw.wl.keyboard) - { - wl_keyboard_destroy(_glfw.wl.keyboard); - _glfw.wl.keyboard = NULL; - } -} - -static const struct wl_seat_listener seatListener = { - seatHandleCapabilities -}; - -static void registryHandleGlobal(void* data, - struct wl_registry* registry, - uint32_t name, - const char* interface, - uint32_t version) -{ - if (strcmp(interface, "wl_compositor") == 0) - { - _glfw.wl.compositor = - wl_registry_bind(registry, name, &wl_compositor_interface, 1); - } - else if (strcmp(interface, "wl_shm") == 0) - { - _glfw.wl.shm = - wl_registry_bind(registry, name, &wl_shm_interface, 1); - } - else if (strcmp(interface, "wl_shell") == 0) - { - _glfw.wl.shell = - wl_registry_bind(registry, name, &wl_shell_interface, 1); - } - else if (strcmp(interface, "wl_output") == 0) - { - _glfwAddOutput(name, version); - } - else if (strcmp(interface, "wl_seat") == 0) - { - if (!_glfw.wl.seat) - { - _glfw.wl.seat = - wl_registry_bind(registry, name, &wl_seat_interface, 1); - wl_seat_add_listener(_glfw.wl.seat, &seatListener, NULL); - } - } -} - -static void registryHandleGlobalRemove(void *data, - struct wl_registry *registry, - uint32_t name) -{ -} - - -static const struct wl_registry_listener registryListener = { - registryHandleGlobal, - registryHandleGlobalRemove -}; - - -////////////////////////////////////////////////////////////////////////// -////// GLFW platform API ////// -////////////////////////////////////////////////////////////////////////// - -int _glfwPlatformInit(void) -{ - _glfw.wl.display = wl_display_connect(NULL); - if (!_glfw.wl.display) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: Failed to connect to display"); - return GL_FALSE; - } - - _glfw.wl.registry = wl_display_get_registry(_glfw.wl.display); - wl_registry_add_listener(_glfw.wl.registry, ®istryListener, NULL); - - _glfw.wl.monitors = calloc(4, sizeof(_GLFWmonitor*)); - _glfw.wl.monitorsSize = 4; - - _glfw.wl.xkb.context = xkb_context_new(0); - if (!_glfw.wl.xkb.context) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: Failed to initialize xkb context"); - return GL_FALSE; - } - - // Sync so we got all registry objects - wl_display_roundtrip(_glfw.wl.display); - - // Sync so we got all initial output events - wl_display_roundtrip(_glfw.wl.display); - - if (!_glfwInitContextAPI()) - return GL_FALSE; - - _glfwInitTimer(); - _glfwInitJoysticks(); - - if (_glfw.wl.pointer && _glfw.wl.shm) - { - _glfw.wl.cursorTheme = wl_cursor_theme_load(NULL, 32, _glfw.wl.shm); - if (!_glfw.wl.cursorTheme) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: Unable to load default cursor theme\n"); - return GL_FALSE; - } - _glfw.wl.defaultCursor = - wl_cursor_theme_get_cursor(_glfw.wl.cursorTheme, "left_ptr"); - if (!_glfw.wl.defaultCursor) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: Unable to load default left pointer\n"); - return GL_FALSE; - } - _glfw.wl.cursorSurface = - wl_compositor_create_surface(_glfw.wl.compositor); - } - - return GL_TRUE; -} - -void _glfwPlatformTerminate(void) -{ - _glfwTerminateContextAPI(); - _glfwTerminateJoysticks(); - - if (_glfw.wl.cursorTheme) - wl_cursor_theme_destroy(_glfw.wl.cursorTheme); - if (_glfw.wl.cursorSurface) - wl_surface_destroy(_glfw.wl.cursorSurface); - if (_glfw.wl.registry) - wl_registry_destroy(_glfw.wl.registry); - if (_glfw.wl.display) - wl_display_flush(_glfw.wl.display); - if (_glfw.wl.display) - wl_display_disconnect(_glfw.wl.display); -} - -const char* _glfwPlatformGetVersionString(void) -{ - const char* version = _GLFW_VERSION_NUMBER " Wayland EGL " -#if defined(_POSIX_TIMERS) && defined(_POSIX_MONOTONIC_CLOCK) - " clock_gettime" -#endif -#if defined(_GLFW_BUILD_DLL) - " shared" -#endif - ; - - return version; -} - diff --git a/extern/glfw/src/wl_monitor.c b/extern/glfw/src/wl_monitor.c deleted file mode 100644 index fbcefd3..0000000 --- a/extern/glfw/src/wl_monitor.c +++ /dev/null @@ -1,250 +0,0 @@ -//======================================================================== -// GLFW 3.1 Wayland - www.glfw.org -//------------------------------------------------------------------------ -// Copyright (c) 2014 Jonas Ådahl -// -// 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. -// -//======================================================================== - -#include "internal.h" - -#include -#include -#include -#include - - -struct _GLFWvidmodeWayland -{ - GLFWvidmode base; - uint32_t flags; -}; - -static void geometry(void* data, - struct wl_output* output, - int32_t x, - int32_t y, - int32_t physicalWidth, - int32_t physicalHeight, - int32_t subpixel, - const char* make, - const char* model, - int32_t transform) -{ - struct _GLFWmonitor *monitor = data; - - monitor->wl.x = x; - monitor->wl.y = y; - monitor->widthMM = physicalWidth; - monitor->heightMM = physicalHeight; -} - -static void mode(void* data, - struct wl_output* output, - uint32_t flags, - int32_t width, - int32_t height, - int32_t refresh) -{ - struct _GLFWmonitor *monitor = data; - _GLFWvidmodeWayland mode = { { 0 }, }; - - mode.base.width = width; - mode.base.height = height; - mode.base.refreshRate = refresh; - mode.flags = flags; - - if (monitor->wl.modesCount + 1 >= monitor->wl.modesSize) - { - int size = monitor->wl.modesSize * 2; - _GLFWvidmodeWayland* modes = - realloc(monitor->wl.modes, - size * sizeof(_GLFWvidmodeWayland)); - monitor->wl.modes = modes; - monitor->wl.modesSize = size; - } - - monitor->wl.modes[monitor->wl.modesCount++] = mode; -} - -static void done(void* data, - struct wl_output* output) -{ - struct _GLFWmonitor *monitor = data; - - monitor->wl.done = GL_TRUE; -} - -static void scale(void* data, - struct wl_output* output, - int32_t factor) -{ -} - -static const struct wl_output_listener output_listener = { - geometry, - mode, - done, - scale, -}; - - -////////////////////////////////////////////////////////////////////////// -////// GLFW internal API ////// -////////////////////////////////////////////////////////////////////////// - -void _glfwAddOutput(uint32_t name, uint32_t version) -{ - _GLFWmonitor *monitor; - struct wl_output *output; - char name_str[80]; - - memset(name_str, 0, 80 * sizeof(char)); - snprintf(name_str, 79, "wl_output@%u", name); - - if (version < 2) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: Unsupported output interface version"); - return; - } - - monitor = _glfwAllocMonitor(name_str, 0, 0); - - output = wl_registry_bind(_glfw.wl.registry, - name, - &wl_output_interface, - 2); - if (!output) - { - _glfwFreeMonitor(monitor); - return; - } - - monitor->wl.modes = calloc(4, sizeof(_GLFWvidmodeWayland)); - monitor->wl.modesSize = 4; - - monitor->wl.output = output; - wl_output_add_listener(output, &output_listener, monitor); - - if (_glfw.wl.monitorsCount + 1 >= _glfw.wl.monitorsSize) - { - _GLFWmonitor** monitors = _glfw.wl.monitors; - int size = _glfw.wl.monitorsSize * 2; - - monitors = realloc(monitors, size * sizeof(_GLFWmonitor*)); - - _glfw.wl.monitors = monitors; - _glfw.wl.monitorsSize = size; - } - - _glfw.wl.monitors[_glfw.wl.monitorsCount++] = monitor; -} - - -////////////////////////////////////////////////////////////////////////// -////// GLFW platform API ////// -////////////////////////////////////////////////////////////////////////// - -_GLFWmonitor** _glfwPlatformGetMonitors(int* count) -{ - _GLFWmonitor** monitors; - _GLFWmonitor* monitor; - int i, monitorsCount = _glfw.wl.monitorsCount; - - if (_glfw.wl.monitorsCount == 0) - goto err; - - monitors = calloc(monitorsCount, sizeof(_GLFWmonitor*)); - - for (i = 0; i < monitorsCount; i++) - { - _GLFWmonitor* origMonitor = _glfw.wl.monitors[i]; - monitor = calloc(1, sizeof(_GLFWmonitor)); - - monitor->modes = - _glfwPlatformGetVideoModes(origMonitor, - &origMonitor->wl.modesCount); - *monitor = *_glfw.wl.monitors[i]; - monitors[i] = monitor; - } - - *count = monitorsCount; - return monitors; - -err: - *count = 0; - return NULL; -} - -GLboolean _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second) -{ - return first->wl.output == second->wl.output; -} - -void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos) -{ - if (xpos) - *xpos = monitor->wl.x; - if (ypos) - *ypos = monitor->wl.y; -} - -GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found) -{ - GLFWvidmode *modes; - int i, modesCount = monitor->wl.modesCount; - - modes = calloc(modesCount, sizeof(GLFWvidmode)); - - for (i = 0; i < modesCount; i++) - modes[i] = monitor->wl.modes[i].base; - - *found = modesCount; - return modes; -} - -void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode) -{ - int i; - - for (i = 0; i < monitor->wl.modesCount; i++) - { - if (monitor->wl.modes[i].flags & WL_OUTPUT_MODE_CURRENT) - { - *mode = monitor->wl.modes[i].base; - return; - } - } -} - -void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp) -{ - // TODO - fprintf(stderr, "_glfwPlatformGetGammaRamp not implemented yet\n"); -} - -void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp) -{ - // TODO - fprintf(stderr, "_glfwPlatformSetGammaRamp not implemented yet\n"); -} - diff --git a/extern/glfw/src/wl_platform.h b/extern/glfw/src/wl_platform.h deleted file mode 100644 index 66736b5..0000000 --- a/extern/glfw/src/wl_platform.h +++ /dev/null @@ -1,140 +0,0 @@ -//======================================================================== -// GLFW 3.1 Wayland - www.glfw.org -//------------------------------------------------------------------------ -// Copyright (c) 2014 Jonas Ådahl -// -// 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 _wayland_platform_h_ -#define _wayland_platform_h_ - - -#include -#include - -#if defined(_GLFW_EGL) - #include "egl_context.h" -#else - #error "The Wayland backend depends on EGL platform support" -#endif - -#include "posix_tls.h" -#include "posix_time.h" -#include "linux_joystick.h" - -#define _GLFW_EGL_NATIVE_WINDOW window->wl.native -#define _GLFW_EGL_NATIVE_DISPLAY _glfw.wl.display - -#define _GLFW_PLATFORM_WINDOW_STATE _GLFWwindowWayland wl -#define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE _GLFWlibraryWayland wl -#define _GLFW_PLATFORM_MONITOR_STATE _GLFWmonitorWayland wl -#define _GLFW_PLATFORM_CURSOR_STATE _GLFWcursorWayland wl - - -// Wayland-specific video mode data -// -typedef struct _GLFWvidmodeWayland _GLFWvidmodeWayland; - - -// Wayland-specific per-window data -// -typedef struct _GLFWwindowWayland -{ - int width, height; - GLboolean visible; - struct wl_surface* surface; - struct wl_egl_window* native; - struct wl_shell_surface* shell_surface; - struct wl_callback* callback; - _GLFWcursor* currentCursor; -} _GLFWwindowWayland; - - -// Wayland-specific global data -// -typedef struct _GLFWlibraryWayland -{ - struct wl_display* display; - struct wl_registry* registry; - struct wl_compositor* compositor; - struct wl_shell* shell; - struct wl_shm* shm; - struct wl_seat* seat; - struct wl_pointer* pointer; - struct wl_keyboard* keyboard; - - struct wl_cursor_theme* cursorTheme; - struct wl_cursor* defaultCursor; - struct wl_surface* cursorSurface; - uint32_t pointerSerial; - - _GLFWmonitor** monitors; - int monitorsCount; - int monitorsSize; - - struct { - struct xkb_context* context; - struct xkb_keymap* keymap; - struct xkb_state* state; - xkb_mod_mask_t control_mask; - xkb_mod_mask_t alt_mask; - xkb_mod_mask_t shift_mask; - xkb_mod_mask_t super_mask; - unsigned int modifiers; - } xkb; - - _GLFWwindow* pointerFocus; - _GLFWwindow* keyboardFocus; - -} _GLFWlibraryWayland; - - -// Wayland-specific per-monitor data -// -typedef struct _GLFWmonitorWayland -{ - struct wl_output* output; - - _GLFWvidmodeWayland* modes; - int modesCount; - int modesSize; - GLboolean done; - - int x; - int y; - -} _GLFWmonitorWayland; - - -// Wayland-specific per-cursor data -// -typedef struct _GLFWcursorWayland -{ - struct wl_buffer* buffer; - int width, height; - int xhot, yhot; -} _GLFWcursorWayland; - - -void _glfwAddOutput(uint32_t name, uint32_t version); - -#endif // _wayland_platform_h_ diff --git a/extern/glfw/src/wl_window.c b/extern/glfw/src/wl_window.c deleted file mode 100644 index 9ace38f..0000000 --- a/extern/glfw/src/wl_window.c +++ /dev/null @@ -1,493 +0,0 @@ -//======================================================================== -// GLFW 3.1 Wayland - www.glfw.org -//------------------------------------------------------------------------ -// Copyright (c) 2014 Jonas Ådahl -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== - -#define _GNU_SOURCE - -#include "internal.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - - -static void handlePing(void* data, - struct wl_shell_surface* shellSurface, - uint32_t serial) -{ - wl_shell_surface_pong(shellSurface, serial); -} - -static void handleConfigure(void* data, - struct wl_shell_surface* shellSurface, - uint32_t edges, - int32_t width, - int32_t height) -{ - _GLFWwindow* window = data; - _glfwInputFramebufferSize(window, width, height); - _glfwInputWindowSize(window, width, height); - _glfwPlatformSetWindowSize(window, width, height); - _glfwInputWindowDamage(window); -} - -static void handlePopupDone(void* data, - struct wl_shell_surface* shellSurface) -{ -} - -static const struct wl_shell_surface_listener shellSurfaceListener = { - handlePing, - handleConfigure, - handlePopupDone -}; - -static GLboolean createSurface(_GLFWwindow* window, - const _GLFWwndconfig* wndconfig) -{ - window->wl.surface = wl_compositor_create_surface(_glfw.wl.compositor); - if (!window->wl.surface) - return GL_FALSE; - - wl_surface_set_user_data(window->wl.surface, window); - - window->wl.native = wl_egl_window_create(window->wl.surface, - wndconfig->width, - wndconfig->height); - if (!window->wl.native) - return GL_FALSE; - - window->wl.shell_surface = wl_shell_get_shell_surface(_glfw.wl.shell, - window->wl.surface); - if (!window->wl.shell_surface) - return GL_FALSE; - - wl_shell_surface_add_listener(window->wl.shell_surface, - &shellSurfaceListener, - window); - - window->wl.width = wndconfig->width; - window->wl.height = wndconfig->height; - - return GL_TRUE; -} - -static int -createTmpfileCloexec(char* tmpname) -{ - int fd; - - fd = mkostemp(tmpname, O_CLOEXEC); - if (fd >= 0) - unlink(tmpname); - - return fd; -} - -/* - * Create a new, unique, anonymous file of the given size, and - * return the file descriptor for it. The file descriptor is set - * CLOEXEC. The file is immediately suitable for mmap()'ing - * the given size at offset zero. - * - * The file should not have a permanent backing store like a disk, - * but may have if XDG_RUNTIME_DIR is not properly implemented in OS. - * - * The file name is deleted from the file system. - * - * The file is suitable for buffer sharing between processes by - * transmitting the file descriptor over Unix sockets using the - * SCM_RIGHTS methods. - * - * posix_fallocate() is used to guarantee that disk space is available - * for the file at the given size. If disk space is insufficent, errno - * is set to ENOSPC. If posix_fallocate() is not supported, program may - * receive SIGBUS on accessing mmap()'ed file contents instead. - */ -int -createAnonymousFile(off_t size) -{ - static const char template[] = "/glfw-shared-XXXXXX"; - const char* path; - char* name; - int fd; - int ret; - - path = getenv("XDG_RUNTIME_DIR"); - if (!path) - { - errno = ENOENT; - return -1; - } - - name = malloc(strlen(path) + sizeof(template)); - strcpy(name, path); - strcat(name, template); - - fd = createTmpfileCloexec(name); - - free(name); - - if (fd < 0) - return -1; - ret = posix_fallocate(fd, 0, size); - if (ret != 0) - { - close(fd); - errno = ret; - return -1; - } - return fd; -} - -////////////////////////////////////////////////////////////////////////// -////// GLFW platform API ////// -////////////////////////////////////////////////////////////////////////// - -int _glfwPlatformCreateWindow(_GLFWwindow* window, - const _GLFWwndconfig* wndconfig, - const _GLFWctxconfig* ctxconfig, - const _GLFWfbconfig* fbconfig) -{ - if (!_glfwCreateContext(window, ctxconfig, fbconfig)) - return GL_FALSE; - - if (!createSurface(window, wndconfig)) - return GL_FALSE; - - if (wndconfig->monitor) - { - wl_shell_surface_set_fullscreen( - window->wl.shell_surface, - WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, - 0, - wndconfig->monitor->wl.output); - } - else - { - wl_shell_surface_set_toplevel(window->wl.shell_surface); - } - - window->wl.currentCursor = NULL; - - return GL_TRUE; -} - -void _glfwPlatformDestroyWindow(_GLFWwindow* window) -{ - if (window == _glfw.wl.pointerFocus) - { - _glfw.wl.pointerFocus = NULL; - _glfwInputCursorEnter(window, GL_FALSE); - } - if (window == _glfw.wl.keyboardFocus) - { - _glfw.wl.keyboardFocus = NULL; - _glfwInputWindowFocus(window, GL_FALSE); - } - - _glfwDestroyContext(window); - - if (window->wl.native) - wl_egl_window_destroy(window->wl.native); - - if (window->wl.shell_surface) - wl_shell_surface_destroy(window->wl.shell_surface); - - if (window->wl.surface) - wl_surface_destroy(window->wl.surface); -} - -void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title) -{ - wl_shell_surface_set_title(window->wl.shell_surface, title); -} - -void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos) -{ - // A Wayland client is not aware of its position, so just warn and leave it - // as (0, 0) - - _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: Window position retreival not supported"); -} - -void _glfwPlatformSetWindowPos(_GLFWwindow* window, int xpos, int ypos) -{ - // A Wayland client can not set its position, so just warn - - _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: Window position setting not supported"); -} - -void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height) -{ - if (width) - *width = window->wl.width; - if (height) - *height = window->wl.height; -} - -void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height) -{ - wl_egl_window_resize(window->wl.native, width, height, 0, 0); - window->wl.width = width; - window->wl.height = height; -} - -void _glfwPlatformGetFramebufferSize(_GLFWwindow* window, int* width, int* height) -{ - _glfwPlatformGetWindowSize(window, width, height); -} - -void _glfwPlatformGetWindowFrameSize(_GLFWwindow* window, - int* left, int* top, - int* right, int* bottom) -{ - // TODO - fprintf(stderr, "_glfwPlatformGetWindowFrameSize not implemented yet\n"); -} - -void _glfwPlatformIconifyWindow(_GLFWwindow* window) -{ - // TODO - fprintf(stderr, "_glfwPlatformIconifyWindow not implemented yet\n"); -} - -void _glfwPlatformRestoreWindow(_GLFWwindow* window) -{ - // TODO - fprintf(stderr, "_glfwPlatformRestoreWindow not implemented yet\n"); -} - -void _glfwPlatformShowWindow(_GLFWwindow* window) -{ - wl_shell_surface_set_toplevel(window->wl.shell_surface); -} - -void _glfwPlatformUnhideWindow(_GLFWwindow* window) -{ - // TODO - fprintf(stderr, "_glfwPlatformUnhideWindow not implemented yet\n"); -} - -void _glfwPlatformHideWindow(_GLFWwindow* window) -{ - wl_surface_attach(window->wl.surface, NULL, 0, 0); - wl_surface_commit(window->wl.surface); -} - -void _glfwPlatformPollEvents(void) -{ - struct wl_display* display = _glfw.wl.display; - struct pollfd fds[] = { - { wl_display_get_fd(display), POLLIN }, - }; - - while (wl_display_prepare_read(display) != 0) - wl_display_dispatch_pending(display); - wl_display_flush(display); - if (poll(fds, 1, 0) > 0) - { - wl_display_read_events(display); - wl_display_dispatch_pending(display); - } - else - { - wl_display_cancel_read(display); - } -} - -void _glfwPlatformWaitEvents(void) -{ - struct wl_display* display = _glfw.wl.display; - struct pollfd fds[] = { - { wl_display_get_fd(display), POLLIN }, - }; - - while (wl_display_prepare_read(display) != 0) - wl_display_dispatch_pending(display); - wl_display_flush(display); - if (poll(fds, 1, -1) > 0) - { - wl_display_read_events(display); - wl_display_dispatch_pending(display); - } - else - { - wl_display_cancel_read(display); - } -} - -void _glfwPlatformPostEmptyEvent(void) -{ - wl_display_sync(_glfw.wl.display); -} - -void _glfwPlatformSetCursorPos(_GLFWwindow* window, double x, double y) -{ - // A Wayland client can not set the cursor position - _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: Cursor position setting not supported"); -} - -void _glfwPlatformApplyCursorMode(_GLFWwindow* window) -{ - _glfwPlatformSetCursor(window, window->wl.currentCursor); -} - -int _glfwPlatformCreateCursor(_GLFWcursor* cursor, - const GLFWimage* image, - int xhot, int yhot) -{ - struct wl_shm_pool* pool; - int stride = image->width * 4; - int length = image->width * image->height * 4; - void* data; - int fd, i; - - fd = createAnonymousFile(length); - if (fd < 0) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: Creating a buffer file for %d B failed: %m\n", - length); - return GL_FALSE; - } - - data = mmap(NULL, length, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); - if (data == MAP_FAILED) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Wayland: Cursor mmap failed: %m\n"); - close(fd); - return GL_FALSE; - } - - pool = wl_shm_create_pool(_glfw.wl.shm, fd, length); - - close(fd); - unsigned char* source = (unsigned char*) image->pixels; - unsigned char* target = data; - for (i = 0; i < image->width * image->height; i++, source += 4) - { - *target++ = source[2]; - *target++ = source[1]; - *target++ = source[0]; - *target++ = source[3]; - } - - cursor->wl.buffer = - wl_shm_pool_create_buffer(pool, 0, - image->width, - image->height, - stride, WL_SHM_FORMAT_ARGB8888); - munmap(data, length); - wl_shm_pool_destroy(pool); - - cursor->wl.width = image->width; - cursor->wl.height = image->height; - cursor->wl.xhot = xhot; - cursor->wl.yhot = yhot; - return GL_TRUE; -} - -void _glfwPlatformDestroyCursor(_GLFWcursor* cursor) -{ - wl_buffer_destroy(cursor->wl.buffer); -} - -void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor) -{ - struct wl_buffer* buffer; - struct wl_cursor_image* image; - struct wl_surface* surface = _glfw.wl.cursorSurface; - - if (!_glfw.wl.pointer) - return; - - window->wl.currentCursor = cursor; - - // If we're not in the correct window just save the cursor - // the next time the pointer enters the window the cursor will change - if (window != _glfw.wl.pointerFocus) - return; - - if (window->cursorMode == GLFW_CURSOR_NORMAL) - { - if (cursor == NULL) - { - image = _glfw.wl.defaultCursor->images[0]; - buffer = wl_cursor_image_get_buffer(image); - if (!buffer) - return; - wl_pointer_set_cursor(_glfw.wl.pointer, _glfw.wl.pointerSerial, - surface, - image->hotspot_x, - image->hotspot_y); - wl_surface_attach(surface, buffer, 0, 0); - wl_surface_damage(surface, 0, 0, - image->width, image->height); - wl_surface_commit(surface); - } - else - { - wl_pointer_set_cursor(_glfw.wl.pointer, _glfw.wl.pointerSerial, - surface, - cursor->wl.xhot, - cursor->wl.yhot); - wl_surface_attach(surface, cursor->wl.buffer, 0, 0); - wl_surface_damage(surface, 0, 0, - cursor->wl.width, cursor->wl.height); - wl_surface_commit(surface); - } - } - else /* Cursor is hidden set cursor surface to NULL */ - { - wl_pointer_set_cursor(_glfw.wl.pointer, _glfw.wl.pointerSerial, NULL, 0, 0); - } -} - -void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string) -{ - // TODO - fprintf(stderr, "_glfwPlatformSetClipboardString not implemented yet\n"); -} - -const char* _glfwPlatformGetClipboardString(_GLFWwindow* window) -{ - // TODO - fprintf(stderr, "_glfwPlatformGetClipboardString not implemented yet\n"); - return NULL; -} - diff --git a/extern/glfw/src/x11_clipboard.c b/extern/glfw/src/x11_clipboard.c new file mode 100644 index 0000000..614ba36 --- /dev/null +++ b/extern/glfw/src/x11_clipboard.c @@ -0,0 +1,335 @@ +//======================================================================== +// GLFW 3.0 X11 - www.glfw.org +//------------------------------------------------------------------------ +// Copyright (c) 2010 Camilla Berglund +// +// 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. +// +//======================================================================== + +#include "internal.h" + +#include +#include +#include +#include + + +// Returns whether the event is a selection event +// +static Bool isSelectionMessage(Display* display, XEvent* event, XPointer pointer) +{ + return event->type == SelectionRequest || + event->type == SelectionNotify || + event->type == SelectionClear; +} + +// Set the specified property to the selection converted to the requested target +// +static Atom writeTargetToProperty(const XSelectionRequestEvent* request) +{ + int i; + const Atom formats[] = { _glfw.x11.UTF8_STRING, + _glfw.x11.COMPOUND_STRING, + XA_STRING }; + const int formatCount = sizeof(formats) / sizeof(formats[0]); + + if (request->property == None) + { + // The requestor is a legacy client (ICCCM section 2.2) + // We don't support legacy clients, so fail here + return None; + } + + if (request->target == _glfw.x11.TARGETS) + { + // The list of supported targets was requested + + const Atom targets[] = { _glfw.x11.TARGETS, + _glfw.x11.MULTIPLE, + _glfw.x11.UTF8_STRING, + _glfw.x11.COMPOUND_STRING, + XA_STRING }; + + XChangeProperty(_glfw.x11.display, + request->requestor, + request->property, + XA_ATOM, + 32, + PropModeReplace, + (unsigned char*) targets, + sizeof(targets) / sizeof(targets[0])); + + return request->property; + } + + if (request->target == _glfw.x11.MULTIPLE) + { + // Multiple conversions were requested + + Atom* targets; + unsigned long i, count; + + count = _glfwGetWindowProperty(request->requestor, + request->property, + _glfw.x11.ATOM_PAIR, + (unsigned char**) &targets); + + for (i = 0; i < count; i += 2) + { + int j; + + for (j = 0; j < formatCount; j++) + { + if (targets[i] == formats[j]) + break; + } + + if (j < formatCount) + { + XChangeProperty(_glfw.x11.display, + request->requestor, + targets[i + 1], + targets[i], + 8, + PropModeReplace, + (unsigned char*) _glfw.x11.selection.string, + strlen(_glfw.x11.selection.string)); + } + else + targets[i + 1] = None; + } + + XChangeProperty(_glfw.x11.display, + request->requestor, + request->property, + _glfw.x11.ATOM_PAIR, + 32, + PropModeReplace, + (unsigned char*) targets, + count); + + XFree(targets); + + return request->property; + } + + if (request->target == _glfw.x11.SAVE_TARGETS) + { + // The request is a check whether we support SAVE_TARGETS + // It should be handled as a no-op side effect target + + XChangeProperty(_glfw.x11.display, + request->requestor, + request->property, + XInternAtom(_glfw.x11.display, "NULL", False), + 32, + PropModeReplace, + NULL, + 0); + + return request->property; + } + + // Conversion to a data target was requested + + for (i = 0; i < formatCount; i++) + { + if (request->target == formats[i]) + { + // The requested target is one we support + + XChangeProperty(_glfw.x11.display, + request->requestor, + request->property, + request->target, + 8, + PropModeReplace, + (unsigned char*) _glfw.x11.selection.string, + strlen(_glfw.x11.selection.string)); + + return request->property; + } + } + + // The requested target is not supported + + return None; +} + + +////////////////////////////////////////////////////////////////////////// +////// GLFW internal API ////// +////////////////////////////////////////////////////////////////////////// + +void _glfwHandleSelectionClear(XEvent* event) +{ + free(_glfw.x11.selection.string); + _glfw.x11.selection.string = NULL; +} + +void _glfwHandleSelectionRequest(XEvent* event) +{ + const XSelectionRequestEvent* request = &event->xselectionrequest; + + XEvent response; + memset(&response, 0, sizeof(response)); + + response.xselection.property = writeTargetToProperty(request); + response.xselection.type = SelectionNotify; + response.xselection.display = request->display; + response.xselection.requestor = request->requestor; + response.xselection.selection = request->selection; + response.xselection.target = request->target; + response.xselection.time = request->time; + + XSendEvent(_glfw.x11.display, request->requestor, False, 0, &response); +} + +void _glfwPushSelectionToManager(_GLFWwindow* window) +{ + XConvertSelection(_glfw.x11.display, + _glfw.x11.CLIPBOARD_MANAGER, + _glfw.x11.SAVE_TARGETS, + None, + window->x11.handle, + CurrentTime); + + for (;;) + { + XEvent event; + + if (!XCheckIfEvent(_glfw.x11.display, &event, isSelectionMessage, NULL)) + continue; + + switch (event.type) + { + case SelectionRequest: + _glfwHandleSelectionRequest(&event); + break; + + case SelectionClear: + _glfwHandleSelectionClear(&event); + break; + + case SelectionNotify: + { + if (event.xselection.target == _glfw.x11.SAVE_TARGETS) + { + // This means one of two things; either the selection was + // not owned, which means there is no clipboard manager, or + // the transfer to the clipboard manager has completed + // In either case, it means we are done here + return; + } + + break; + } + } + } +} + + +////////////////////////////////////////////////////////////////////////// +////// GLFW platform API ////// +////////////////////////////////////////////////////////////////////////// + +void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string) +{ + free(_glfw.x11.selection.string); + _glfw.x11.selection.string = strdup(string); + + XSetSelectionOwner(_glfw.x11.display, + _glfw.x11.CLIPBOARD, + window->x11.handle, CurrentTime); + + if (XGetSelectionOwner(_glfw.x11.display, _glfw.x11.CLIPBOARD) != + window->x11.handle) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "X11: Failed to become owner of the clipboard selection"); + } +} + +const char* _glfwPlatformGetClipboardString(_GLFWwindow* window) +{ + size_t i; + const Atom formats[] = { _glfw.x11.UTF8_STRING, + _glfw.x11.COMPOUND_STRING, + XA_STRING }; + const size_t formatCount = sizeof(formats) / sizeof(formats[0]); + + if (_glfwFindWindowByHandle(XGetSelectionOwner(_glfw.x11.display, + _glfw.x11.CLIPBOARD))) + { + // Instead of doing a large number of X round-trips just to put this + // string into a window property and then read it back, just return it + return _glfw.x11.selection.string; + } + + free(_glfw.x11.selection.string); + _glfw.x11.selection.string = NULL; + + for (i = 0; i < formatCount; i++) + { + char* data; + XEvent event; + + XConvertSelection(_glfw.x11.display, + _glfw.x11.CLIPBOARD, + formats[i], + _glfw.x11.GLFW_SELECTION, + window->x11.handle, CurrentTime); + + // XCheckTypedEvent is used instead of XIfEvent in order not to lock + // other threads out from the display during the entire wait period + while (!XCheckTypedEvent(_glfw.x11.display, SelectionNotify, &event)) + ; + + if (event.xselection.property == None) + continue; + + if (_glfwGetWindowProperty(event.xselection.requestor, + event.xselection.property, + event.xselection.target, + (unsigned char**) &data)) + { + _glfw.x11.selection.string = strdup(data); + } + + XFree(data); + + XDeleteProperty(_glfw.x11.display, + event.xselection.requestor, + event.xselection.property); + + if (_glfw.x11.selection.string) + break; + } + + if (_glfw.x11.selection.string == NULL) + { + _glfwInputError(GLFW_FORMAT_UNAVAILABLE, + "X11: Failed to convert selection to string"); + } + + return _glfw.x11.selection.string; +} + diff --git a/extern/glfw/src/x11_gamma.c b/extern/glfw/src/x11_gamma.c new file mode 100644 index 0000000..1831263 --- /dev/null +++ b/extern/glfw/src/x11_gamma.c @@ -0,0 +1,123 @@ +//======================================================================== +// GLFW 3.0 X11 - www.glfw.org +//------------------------------------------------------------------------ +// Copyright (c) 2010 Camilla Berglund +// +// 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. +// +//======================================================================== + +#include "internal.h" + +#include +#include + + +////////////////////////////////////////////////////////////////////////// +////// GLFW internal API ////// +////////////////////////////////////////////////////////////////////////// + +// Detect gamma ramp support +// +void _glfwInitGammaRamp(void) +{ + // RandR gamma support is only available with version 1.2 and above + if (_glfw.x11.randr.available && + (_glfw.x11.randr.versionMajor > 1 || + (_glfw.x11.randr.versionMajor == 1 && + _glfw.x11.randr.versionMinor >= 2))) + { + // FIXME: Assumes that all monitors have the same size gamma tables + // This is reasonable as I suspect the that if they did differ, it + // would imply that setting the gamma size to an arbitary size is + // possible as well. + XRRScreenResources* rr = XRRGetScreenResources(_glfw.x11.display, + _glfw.x11.root); + + if (XRRGetCrtcGammaSize(_glfw.x11.display, rr->crtcs[0]) == 0) + { + // This is probably older Nvidia RandR with broken gamma support + // Flag it as useless and try Xf86VidMode below, if available + _glfw.x11.randr.gammaBroken = GL_TRUE; + } + + XRRFreeScreenResources(rr); + } +} + + +////////////////////////////////////////////////////////////////////////// +////// GLFW platform API ////// +////////////////////////////////////////////////////////////////////////// + +void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp) +{ + if (_glfw.x11.randr.available && !_glfw.x11.randr.gammaBroken) + { + const size_t size = XRRGetCrtcGammaSize(_glfw.x11.display, + monitor->x11.crtc); + XRRCrtcGamma* gamma = XRRGetCrtcGamma(_glfw.x11.display, + monitor->x11.crtc); + + _glfwAllocGammaArrays(ramp, size); + + memcpy(ramp->red, gamma->red, size * sizeof(unsigned short)); + memcpy(ramp->green, gamma->green, size * sizeof(unsigned short)); + memcpy(ramp->blue, gamma->blue, size * sizeof(unsigned short)); + + XRRFreeGamma(gamma); + } + else if (_glfw.x11.vidmode.available) + { + int size; + XF86VidModeGetGammaRampSize(_glfw.x11.display, _glfw.x11.screen, &size); + + _glfwAllocGammaArrays(ramp, size); + + XF86VidModeGetGammaRamp(_glfw.x11.display, + _glfw.x11.screen, + ramp->size, ramp->red, ramp->green, ramp->blue); + } +} + +void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp) +{ + if (_glfw.x11.randr.available && !_glfw.x11.randr.gammaBroken) + { + XRRCrtcGamma* gamma = XRRAllocGamma(ramp->size); + + memcpy(gamma->red, ramp->red, ramp->size * sizeof(unsigned short)); + memcpy(gamma->green, ramp->green, ramp->size * sizeof(unsigned short)); + memcpy(gamma->blue, ramp->blue, ramp->size * sizeof(unsigned short)); + + XRRSetCrtcGamma(_glfw.x11.display, monitor->x11.crtc, gamma); + XRRFreeGamma(gamma); + } + else if (_glfw.x11.vidmode.available) + { + XF86VidModeSetGammaRamp(_glfw.x11.display, + _glfw.x11.screen, + ramp->size, + (unsigned short*) ramp->red, + (unsigned short*) ramp->green, + (unsigned short*) ramp->blue); + } +} + diff --git a/extern/glfw/src/x11_init.c b/extern/glfw/src/x11_init.c index ea0b693..3d94ff5 100644 --- a/extern/glfw/src/x11_init.c +++ b/extern/glfw/src/x11_init.c @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 X11 - www.glfw.org +// GLFW 3.0 X11 - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -32,7 +32,6 @@ #include #include #include -#include // Translate an X11 key code to a GLFW key code. @@ -45,47 +44,34 @@ static int translateKey(int keyCode) if (keyCode < 8 || keyCode > 255) return GLFW_KEY_UNKNOWN; - if (_glfw.x11.xkb.available) + // Try secondary keysym, for numeric keypad keys + // Note: This way we always force "NumLock = ON", which is intentional + // since the returned key code should correspond to a physical + // location. + keySym = XkbKeycodeToKeysym(_glfw.x11.display, keyCode, 0, 1); + switch (keySym) { - // Try secondary keysym, for numeric keypad keys - // Note: This way we always force "NumLock = ON", which is intentional - // since the returned key code should correspond to a physical - // location. - keySym = XkbKeycodeToKeysym(_glfw.x11.display, keyCode, 0, 1); - switch (keySym) - { - case XK_KP_0: return GLFW_KEY_KP_0; - case XK_KP_1: return GLFW_KEY_KP_1; - case XK_KP_2: return GLFW_KEY_KP_2; - case XK_KP_3: return GLFW_KEY_KP_3; - case XK_KP_4: return GLFW_KEY_KP_4; - case XK_KP_5: return GLFW_KEY_KP_5; - case XK_KP_6: return GLFW_KEY_KP_6; - case XK_KP_7: return GLFW_KEY_KP_7; - case XK_KP_8: return GLFW_KEY_KP_8; - case XK_KP_9: return GLFW_KEY_KP_9; - case XK_KP_Separator: - case XK_KP_Decimal: return GLFW_KEY_KP_DECIMAL; - case XK_KP_Equal: return GLFW_KEY_KP_EQUAL; - case XK_KP_Enter: return GLFW_KEY_KP_ENTER; - default: break; - } - - // Now try pimary keysym for function keys (non-printable keys). These - // should not be layout dependent (i.e. US layout and international - // layouts should give the same result). - keySym = XkbKeycodeToKeysym(_glfw.x11.display, keyCode, 0, 0); - } - else - { - int dummy; - KeySym* keySyms; - - keySyms = XGetKeyboardMapping(_glfw.x11.display, keyCode, 1, &dummy); - keySym = keySyms[0]; - XFree(keySyms); + case XK_KP_0: return GLFW_KEY_KP_0; + case XK_KP_1: return GLFW_KEY_KP_1; + case XK_KP_2: return GLFW_KEY_KP_2; + case XK_KP_3: return GLFW_KEY_KP_3; + case XK_KP_4: return GLFW_KEY_KP_4; + case XK_KP_5: return GLFW_KEY_KP_5; + case XK_KP_6: return GLFW_KEY_KP_6; + case XK_KP_7: return GLFW_KEY_KP_7; + case XK_KP_8: return GLFW_KEY_KP_8; + case XK_KP_9: return GLFW_KEY_KP_9; + case XK_KP_Separator: + case XK_KP_Decimal: return GLFW_KEY_KP_DECIMAL; + case XK_KP_Equal: return GLFW_KEY_KP_EQUAL; + case XK_KP_Enter: return GLFW_KEY_KP_ENTER; + default: break; } + // Now try pimary keysym for function keys (non-printable keys). These + // should not be layout dependent (i.e. US layout and international + // layouts should give the same result). + keySym = XkbKeycodeToKeysym(_glfw.x11.display, keyCode, 0, 0); switch (keySym) { case XK_Escape: return GLFW_KEY_ESCAPE; @@ -238,88 +224,85 @@ static void updateKeyCodeLUT(void) for (keyCode = 0; keyCode < 256; keyCode++) _glfw.x11.keyCodeLUT[keyCode] = GLFW_KEY_UNKNOWN; - if (_glfw.x11.xkb.available) + // Use XKB to determine physical key locations independently of the current + // keyboard layout + + // Get keyboard description + descr = XkbGetKeyboard(_glfw.x11.display, + XkbAllComponentsMask, + XkbUseCoreKbd); + + // Find the X11 key code -> GLFW key code mapping + for (keyCode = descr->min_key_code; keyCode <= descr->max_key_code; ++keyCode) { - // Use XKB to determine physical key locations independently of the current - // keyboard layout + // Get the key name + for (i = 0; i < XkbKeyNameLength; i++) + name[i] = descr->names->keys[keyCode].name[i]; - // Get keyboard description - descr = XkbGetKeyboard(_glfw.x11.display, - XkbAllComponentsMask, - XkbUseCoreKbd); + name[XkbKeyNameLength] = 0; - // Find the X11 key code -> GLFW key code mapping - for (keyCode = descr->min_key_code; keyCode <= descr->max_key_code; ++keyCode) - { - // Get the key name - for (i = 0; i < XkbKeyNameLength; i++) - name[i] = descr->names->keys[keyCode].name[i]; + // Map the key name to a GLFW key code. Note: We only map printable + // keys here, and we use the US keyboard layout. The rest of the + // keys (function keys) are mapped using traditional KeySym + // translations. + if (strcmp(name, "TLDE") == 0) keyCodeGLFW = GLFW_KEY_GRAVE_ACCENT; + else if (strcmp(name, "AE01") == 0) keyCodeGLFW = GLFW_KEY_1; + else if (strcmp(name, "AE02") == 0) keyCodeGLFW = GLFW_KEY_2; + else if (strcmp(name, "AE03") == 0) keyCodeGLFW = GLFW_KEY_3; + else if (strcmp(name, "AE04") == 0) keyCodeGLFW = GLFW_KEY_4; + else if (strcmp(name, "AE05") == 0) keyCodeGLFW = GLFW_KEY_5; + else if (strcmp(name, "AE06") == 0) keyCodeGLFW = GLFW_KEY_6; + else if (strcmp(name, "AE07") == 0) keyCodeGLFW = GLFW_KEY_7; + else if (strcmp(name, "AE08") == 0) keyCodeGLFW = GLFW_KEY_8; + else if (strcmp(name, "AE09") == 0) keyCodeGLFW = GLFW_KEY_9; + else if (strcmp(name, "AE10") == 0) keyCodeGLFW = GLFW_KEY_0; + else if (strcmp(name, "AE11") == 0) keyCodeGLFW = GLFW_KEY_MINUS; + else if (strcmp(name, "AE12") == 0) keyCodeGLFW = GLFW_KEY_EQUAL; + else if (strcmp(name, "AD01") == 0) keyCodeGLFW = GLFW_KEY_Q; + else if (strcmp(name, "AD02") == 0) keyCodeGLFW = GLFW_KEY_W; + else if (strcmp(name, "AD03") == 0) keyCodeGLFW = GLFW_KEY_E; + else if (strcmp(name, "AD04") == 0) keyCodeGLFW = GLFW_KEY_R; + else if (strcmp(name, "AD05") == 0) keyCodeGLFW = GLFW_KEY_T; + else if (strcmp(name, "AD06") == 0) keyCodeGLFW = GLFW_KEY_Y; + else if (strcmp(name, "AD07") == 0) keyCodeGLFW = GLFW_KEY_U; + else if (strcmp(name, "AD08") == 0) keyCodeGLFW = GLFW_KEY_I; + else if (strcmp(name, "AD09") == 0) keyCodeGLFW = GLFW_KEY_O; + else if (strcmp(name, "AD10") == 0) keyCodeGLFW = GLFW_KEY_P; + else if (strcmp(name, "AD11") == 0) keyCodeGLFW = GLFW_KEY_LEFT_BRACKET; + else if (strcmp(name, "AD12") == 0) keyCodeGLFW = GLFW_KEY_RIGHT_BRACKET; + else if (strcmp(name, "AC01") == 0) keyCodeGLFW = GLFW_KEY_A; + else if (strcmp(name, "AC02") == 0) keyCodeGLFW = GLFW_KEY_S; + else if (strcmp(name, "AC03") == 0) keyCodeGLFW = GLFW_KEY_D; + else if (strcmp(name, "AC04") == 0) keyCodeGLFW = GLFW_KEY_F; + else if (strcmp(name, "AC05") == 0) keyCodeGLFW = GLFW_KEY_G; + else if (strcmp(name, "AC06") == 0) keyCodeGLFW = GLFW_KEY_H; + else if (strcmp(name, "AC07") == 0) keyCodeGLFW = GLFW_KEY_J; + else if (strcmp(name, "AC08") == 0) keyCodeGLFW = GLFW_KEY_K; + else if (strcmp(name, "AC09") == 0) keyCodeGLFW = GLFW_KEY_L; + else if (strcmp(name, "AC10") == 0) keyCodeGLFW = GLFW_KEY_SEMICOLON; + else if (strcmp(name, "AC11") == 0) keyCodeGLFW = GLFW_KEY_APOSTROPHE; + else if (strcmp(name, "AB01") == 0) keyCodeGLFW = GLFW_KEY_Z; + else if (strcmp(name, "AB02") == 0) keyCodeGLFW = GLFW_KEY_X; + else if (strcmp(name, "AB03") == 0) keyCodeGLFW = GLFW_KEY_C; + else if (strcmp(name, "AB04") == 0) keyCodeGLFW = GLFW_KEY_V; + else if (strcmp(name, "AB05") == 0) keyCodeGLFW = GLFW_KEY_B; + else if (strcmp(name, "AB06") == 0) keyCodeGLFW = GLFW_KEY_N; + else if (strcmp(name, "AB07") == 0) keyCodeGLFW = GLFW_KEY_M; + else if (strcmp(name, "AB08") == 0) keyCodeGLFW = GLFW_KEY_COMMA; + else if (strcmp(name, "AB09") == 0) keyCodeGLFW = GLFW_KEY_PERIOD; + else if (strcmp(name, "AB10") == 0) keyCodeGLFW = GLFW_KEY_SLASH; + else if (strcmp(name, "BKSL") == 0) keyCodeGLFW = GLFW_KEY_BACKSLASH; + else if (strcmp(name, "LSGT") == 0) keyCodeGLFW = GLFW_KEY_WORLD_1; + else keyCodeGLFW = GLFW_KEY_UNKNOWN; - name[XkbKeyNameLength] = 0; - - // Map the key name to a GLFW key code. Note: We only map printable - // keys here, and we use the US keyboard layout. The rest of the - // keys (function keys) are mapped using traditional KeySym - // translations. - if (strcmp(name, "TLDE") == 0) keyCodeGLFW = GLFW_KEY_GRAVE_ACCENT; - else if (strcmp(name, "AE01") == 0) keyCodeGLFW = GLFW_KEY_1; - else if (strcmp(name, "AE02") == 0) keyCodeGLFW = GLFW_KEY_2; - else if (strcmp(name, "AE03") == 0) keyCodeGLFW = GLFW_KEY_3; - else if (strcmp(name, "AE04") == 0) keyCodeGLFW = GLFW_KEY_4; - else if (strcmp(name, "AE05") == 0) keyCodeGLFW = GLFW_KEY_5; - else if (strcmp(name, "AE06") == 0) keyCodeGLFW = GLFW_KEY_6; - else if (strcmp(name, "AE07") == 0) keyCodeGLFW = GLFW_KEY_7; - else if (strcmp(name, "AE08") == 0) keyCodeGLFW = GLFW_KEY_8; - else if (strcmp(name, "AE09") == 0) keyCodeGLFW = GLFW_KEY_9; - else if (strcmp(name, "AE10") == 0) keyCodeGLFW = GLFW_KEY_0; - else if (strcmp(name, "AE11") == 0) keyCodeGLFW = GLFW_KEY_MINUS; - else if (strcmp(name, "AE12") == 0) keyCodeGLFW = GLFW_KEY_EQUAL; - else if (strcmp(name, "AD01") == 0) keyCodeGLFW = GLFW_KEY_Q; - else if (strcmp(name, "AD02") == 0) keyCodeGLFW = GLFW_KEY_W; - else if (strcmp(name, "AD03") == 0) keyCodeGLFW = GLFW_KEY_E; - else if (strcmp(name, "AD04") == 0) keyCodeGLFW = GLFW_KEY_R; - else if (strcmp(name, "AD05") == 0) keyCodeGLFW = GLFW_KEY_T; - else if (strcmp(name, "AD06") == 0) keyCodeGLFW = GLFW_KEY_Y; - else if (strcmp(name, "AD07") == 0) keyCodeGLFW = GLFW_KEY_U; - else if (strcmp(name, "AD08") == 0) keyCodeGLFW = GLFW_KEY_I; - else if (strcmp(name, "AD09") == 0) keyCodeGLFW = GLFW_KEY_O; - else if (strcmp(name, "AD10") == 0) keyCodeGLFW = GLFW_KEY_P; - else if (strcmp(name, "AD11") == 0) keyCodeGLFW = GLFW_KEY_LEFT_BRACKET; - else if (strcmp(name, "AD12") == 0) keyCodeGLFW = GLFW_KEY_RIGHT_BRACKET; - else if (strcmp(name, "AC01") == 0) keyCodeGLFW = GLFW_KEY_A; - else if (strcmp(name, "AC02") == 0) keyCodeGLFW = GLFW_KEY_S; - else if (strcmp(name, "AC03") == 0) keyCodeGLFW = GLFW_KEY_D; - else if (strcmp(name, "AC04") == 0) keyCodeGLFW = GLFW_KEY_F; - else if (strcmp(name, "AC05") == 0) keyCodeGLFW = GLFW_KEY_G; - else if (strcmp(name, "AC06") == 0) keyCodeGLFW = GLFW_KEY_H; - else if (strcmp(name, "AC07") == 0) keyCodeGLFW = GLFW_KEY_J; - else if (strcmp(name, "AC08") == 0) keyCodeGLFW = GLFW_KEY_K; - else if (strcmp(name, "AC09") == 0) keyCodeGLFW = GLFW_KEY_L; - else if (strcmp(name, "AC10") == 0) keyCodeGLFW = GLFW_KEY_SEMICOLON; - else if (strcmp(name, "AC11") == 0) keyCodeGLFW = GLFW_KEY_APOSTROPHE; - else if (strcmp(name, "AB01") == 0) keyCodeGLFW = GLFW_KEY_Z; - else if (strcmp(name, "AB02") == 0) keyCodeGLFW = GLFW_KEY_X; - else if (strcmp(name, "AB03") == 0) keyCodeGLFW = GLFW_KEY_C; - else if (strcmp(name, "AB04") == 0) keyCodeGLFW = GLFW_KEY_V; - else if (strcmp(name, "AB05") == 0) keyCodeGLFW = GLFW_KEY_B; - else if (strcmp(name, "AB06") == 0) keyCodeGLFW = GLFW_KEY_N; - else if (strcmp(name, "AB07") == 0) keyCodeGLFW = GLFW_KEY_M; - else if (strcmp(name, "AB08") == 0) keyCodeGLFW = GLFW_KEY_COMMA; - else if (strcmp(name, "AB09") == 0) keyCodeGLFW = GLFW_KEY_PERIOD; - else if (strcmp(name, "AB10") == 0) keyCodeGLFW = GLFW_KEY_SLASH; - else if (strcmp(name, "BKSL") == 0) keyCodeGLFW = GLFW_KEY_BACKSLASH; - else if (strcmp(name, "LSGT") == 0) keyCodeGLFW = GLFW_KEY_WORLD_1; - else keyCodeGLFW = GLFW_KEY_UNKNOWN; - - // Update the key code LUT - if ((keyCode >= 0) && (keyCode < 256)) - _glfw.x11.keyCodeLUT[keyCode] = keyCodeGLFW; - } - - // Free the keyboard description - XkbFreeKeyboard(descr, 0, True); + // Update the key code LUT + if ((keyCode >= 0) && (keyCode < 256)) + _glfw.x11.keyCodeLUT[keyCode] = keyCodeGLFW; } + // Free the keyboard description + XkbFreeKeyboard(descr, 0, True); + // Translate the un-translated key codes using traditional X11 KeySym // lookups for (keyCode = 0; keyCode < 256; keyCode++) @@ -329,30 +312,6 @@ static void updateKeyCodeLUT(void) } } -// Check whether the IM has a usable style -// -static GLboolean hasUsableInputMethodStyle(void) -{ - unsigned int i; - GLboolean found = GL_FALSE; - XIMStyles* styles = NULL; - - if (XGetIMValues(_glfw.x11.im, XNQueryInputStyle, &styles, NULL) != NULL) - return GL_FALSE; - - for (i = 0; i < styles->count_styles; i++) - { - if (styles->supported_styles[i] == (XIMPreeditNothing | XIMStatusNothing)) - { - found = GL_TRUE; - break; - } - } - - XFree(styles); - return found; -} - // Check whether the specified atom is supported // static Atom getSupportedAtom(Atom* supportedAtoms, @@ -395,13 +354,10 @@ static void detectEWMH(void) XA_WINDOW, (unsigned char**) &windowFromRoot) != 1) { - if (windowFromRoot) - XFree(windowFromRoot); + XFree(windowFromRoot); return; } - _glfwGrabXErrorHandler(); - // It should be the ID of a child window (of the root) // Then we look for the same property on the child window if (_glfwGetWindowProperty(*windowFromRoot, @@ -410,13 +366,10 @@ static void detectEWMH(void) (unsigned char**) &windowFromChild) != 1) { XFree(windowFromRoot); - if (windowFromChild) - XFree(windowFromChild); + XFree(windowFromChild); return; } - _glfwReleaseXErrorHandler(); - // It should be the ID of that same child window if (*windowFromRoot != *windowFromChild) { @@ -441,14 +394,11 @@ static void detectEWMH(void) (unsigned char**) &supportedAtoms); // See which of the atoms we support that are supported by the WM + _glfw.x11.NET_WM_STATE = getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_STATE"); - _glfw.x11.NET_WM_STATE_ABOVE = - getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_STATE_ABOVE"); _glfw.x11.NET_WM_STATE_FULLSCREEN = getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_STATE_FULLSCREEN"); - _glfw.x11.NET_WM_FULLSCREEN_MONITORS = - getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_FULLSCREEN_MONITORS"); _glfw.x11.NET_WM_NAME = getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_NAME"); _glfw.x11.NET_WM_ICON_NAME = @@ -459,12 +409,6 @@ static void detectEWMH(void) getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_PING"); _glfw.x11.NET_ACTIVE_WINDOW = getSupportedAtom(supportedAtoms, atomCount, "_NET_ACTIVE_WINDOW"); - _glfw.x11.NET_FRAME_EXTENTS = - getSupportedAtom(supportedAtoms, atomCount, "_NET_FRAME_EXTENTS"); - _glfw.x11.NET_REQUEST_FRAME_EXTENTS = - getSupportedAtom(supportedAtoms, atomCount, "_NET_REQUEST_FRAME_EXTENTS"); - _glfw.x11.NET_WM_BYPASS_COMPOSITOR = - getSupportedAtom(supportedAtoms, atomCount, "_NET_WM_BYPASS_COMPOSITOR"); XFree(supportedAtoms); @@ -475,10 +419,9 @@ static void detectEWMH(void) // static GLboolean initExtensions(void) { + Bool supported; + // Find or create window manager atoms - _glfw.x11.WM_PROTOCOLS = XInternAtom(_glfw.x11.display, - "WM_PROTOCOLS", - False); _glfw.x11.WM_STATE = XInternAtom(_glfw.x11.display, "WM_STATE", False); _glfw.x11.WM_DELETE_WINDOW = XInternAtom(_glfw.x11.display, "WM_DELETE_WINDOW", @@ -501,8 +444,6 @@ static GLboolean initExtensions(void) if (_glfw.x11.randr.available) { - XRRScreenResources* sr; - if (!XRRQueryVersion(_glfw.x11.display, &_glfw.x11.randr.versionMajor, &_glfw.x11.randr.versionMinor)) @@ -518,29 +459,6 @@ static GLboolean initExtensions(void) { _glfw.x11.randr.available = GL_FALSE; } - - sr = XRRGetScreenResources(_glfw.x11.display, _glfw.x11.root); - - if (!sr->ncrtc || !XRRGetCrtcGammaSize(_glfw.x11.display, sr->crtcs[0])) - { - // This is either a headless system or an older Nvidia binary driver - // with broken gamma support - // Flag it as useless and fall back to Xf86VidMode gamma, if - // available - _glfwInputError(GLFW_PLATFORM_ERROR, - "X11: RandR gamma ramp support seems broken"); - _glfw.x11.randr.gammaBroken = GL_TRUE; - } - - XRRFreeScreenResources(sr); - } - - if (XineramaQueryExtension(_glfw.x11.display, - &_glfw.x11.xinerama.versionMajor, - &_glfw.x11.xinerama.versionMinor)) - { - if (XineramaIsActive(_glfw.x11.display)) - _glfw.x11.xinerama.available = GL_TRUE; } if (XQueryExtension(_glfw.x11.display, @@ -563,23 +481,30 @@ static GLboolean initExtensions(void) // Check if Xkb is supported on this display _glfw.x11.xkb.versionMajor = 1; _glfw.x11.xkb.versionMinor = 0; - _glfw.x11.xkb.available = - XkbQueryExtension(_glfw.x11.display, - &_glfw.x11.xkb.majorOpcode, - &_glfw.x11.xkb.eventBase, - &_glfw.x11.xkb.errorBase, - &_glfw.x11.xkb.versionMajor, - &_glfw.x11.xkb.versionMinor); - - if (_glfw.x11.xkb.available) + if (!XkbQueryExtension(_glfw.x11.display, + &_glfw.x11.xkb.majorOpcode, + &_glfw.x11.xkb.eventBase, + &_glfw.x11.xkb.errorBase, + &_glfw.x11.xkb.versionMajor, + &_glfw.x11.xkb.versionMinor)) { - Bool supported; + _glfwInputError(GLFW_PLATFORM_ERROR, + "X11: The keyboard extension is not available"); + return GL_FALSE; + } - if (XkbSetDetectableAutoRepeat(_glfw.x11.display, True, &supported)) - { - if (supported) - _glfw.x11.xkb.detectable = GL_TRUE; - } + if (!XkbSetDetectableAutoRepeat(_glfw.x11.display, True, &supported)) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "X11: Failed to set detectable key repeat"); + return GL_FALSE; + } + + if (!supported) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "X11: Detectable key repeat is not supported"); + return GL_FALSE; } // Update the key code LUT @@ -591,7 +516,6 @@ static GLboolean initExtensions(void) detectEWMH(); // Find or create string format atoms - _glfw.x11._NULL = XInternAtom(_glfw.x11.display, "NULL", False); _glfw.x11.UTF8_STRING = XInternAtom(_glfw.x11.display, "UTF8_STRING", False); _glfw.x11.COMPOUND_STRING = @@ -613,30 +537,54 @@ static GLboolean initExtensions(void) _glfw.x11.SAVE_TARGETS = XInternAtom(_glfw.x11.display, "SAVE_TARGETS", False); - // Find Xdnd (drag and drop) atoms, if available - _glfw.x11.XdndAware = XInternAtom(_glfw.x11.display, "XdndAware", True); - _glfw.x11.XdndEnter = XInternAtom(_glfw.x11.display, "XdndEnter", True); - _glfw.x11.XdndPosition = XInternAtom(_glfw.x11.display, "XdndPosition", True); - _glfw.x11.XdndStatus = XInternAtom(_glfw.x11.display, "XdndStatus", True); - _glfw.x11.XdndActionCopy = XInternAtom(_glfw.x11.display, "XdndActionCopy", True); - _glfw.x11.XdndDrop = XInternAtom(_glfw.x11.display, "XdndDrop", True); - _glfw.x11.XdndLeave = XInternAtom(_glfw.x11.display, "XdndLeave", True); - _glfw.x11.XdndFinished = XInternAtom(_glfw.x11.display, "XdndFinished", True); - _glfw.x11.XdndSelection = XInternAtom(_glfw.x11.display, "XdndSelection", True); - return GL_TRUE; } -// Create a blank cursor for hidden and disabled cursor modes +// Create a blank cursor (for locked mouse mode) // static Cursor createNULLCursor(void) { - unsigned char pixels[16 * 16 * 4]; - GLFWimage image = { 16, 16, pixels }; + Pixmap cursormask; + XGCValues xgc; + GC gc; + XColor col; + Cursor cursor; - memset(pixels, 0, sizeof(pixels)); + _glfwGrabXErrorHandler(); - return _glfwCreateCursor(&image, 0, 0); + cursormask = XCreatePixmap(_glfw.x11.display, _glfw.x11.root, 1, 1, 1); + xgc.function = GXclear; + gc = XCreateGC(_glfw.x11.display, cursormask, GCFunction, &xgc); + XFillRectangle(_glfw.x11.display, cursormask, gc, 0, 0, 1, 1); + col.pixel = 0; + col.red = 0; + col.flags = 4; + cursor = XCreatePixmapCursor(_glfw.x11.display, + cursormask, cursormask, + &col, &col, 0, 0); + XFreePixmap(_glfw.x11.display, cursormask); + XFreeGC(_glfw.x11.display, gc); + + _glfwReleaseXErrorHandler(); + + if (cursor == None) + { + _glfwInputXError(GLFW_PLATFORM_ERROR, + "X11: Failed to create null cursor"); + } + + return cursor; +} + +// Terminate X11 display +// +static void terminateDisplay(void) +{ + if (_glfw.x11.display) + { + XCloseDisplay(_glfw.x11.display); + _glfw.x11.display = NULL; + } } // X error handler @@ -652,7 +600,7 @@ static int errorHandler(Display *display, XErrorEvent* event) ////// GLFW internal API ////// ////////////////////////////////////////////////////////////////////////// -// Sets the X error handler callback +// Install the X error handler // void _glfwGrabXErrorHandler(void) { @@ -660,7 +608,7 @@ void _glfwGrabXErrorHandler(void) XSetErrorHandler(errorHandler); } -// Clears the X error handler callback +// Remove the X error handler // void _glfwReleaseXErrorHandler(void) { @@ -669,7 +617,7 @@ void _glfwReleaseXErrorHandler(void) XSetErrorHandler(NULL); } -// Reports the specified error, appending information about the last X error +// Report X error // void _glfwInputXError(int error, const char* message) { @@ -680,37 +628,6 @@ void _glfwInputXError(int error, const char* message) _glfwInputError(error, "%s: %s", message, buffer); } -// Creates a native cursor object from the specified image and hotspot -// -Cursor _glfwCreateCursor(const GLFWimage* image, int xhot, int yhot) -{ - int i; - Cursor cursor; - - XcursorImage* native = XcursorImageCreate(image->width, image->height); - if (native == NULL) - return None; - - native->xhot = xhot; - native->yhot = yhot; - - unsigned char* source = (unsigned char*) image->pixels; - XcursorPixel* target = native->pixels; - - for (i = 0; i < image->width * image->height; i++, target++, source += 4) - { - *target = (source[3] << 24) | - (source[0] << 16) | - (source[1] << 8) | - source[2]; - } - - cursor = XcursorImageLoadCursor(_glfw.x11.display, native); - XcursorImageDestroy(native); - - return cursor; -} - ////////////////////////////////////////////////////////////////////////// ////// GLFW platform API ////// @@ -736,26 +653,12 @@ int _glfwPlatformInit(void) _glfw.x11.cursor = createNULLCursor(); - if (XSupportsLocale()) - { - XSetLocaleModifiers(""); - - _glfw.x11.im = XOpenIM(_glfw.x11.display, 0, 0, 0); - if (_glfw.x11.im) - { - if (!hasUsableInputMethodStyle()) - { - XCloseIM(_glfw.x11.im); - _glfw.x11.im = NULL; - } - } - } - if (!_glfwInitContextAPI()) return GL_FALSE; _glfwInitTimer(); _glfwInitJoysticks(); + _glfwInitGammaRamp(); return GL_TRUE; } @@ -768,27 +671,16 @@ void _glfwPlatformTerminate(void) _glfw.x11.cursor = (Cursor) 0; } - free(_glfw.x11.clipboardString); - - if (_glfw.x11.im) - { - XCloseIM(_glfw.x11.im); - _glfw.x11.im = NULL; - } + free(_glfw.x11.selection.string); _glfwTerminateJoysticks(); _glfwTerminateContextAPI(); - - if (_glfw.x11.display) - { - XCloseDisplay(_glfw.x11.display); - _glfw.x11.display = NULL; - } + terminateDisplay(); } const char* _glfwPlatformGetVersionString(void) { - const char* version = _GLFW_VERSION_NUMBER " X11" + const char* version = _GLFW_VERSION_FULL " X11" #if defined(_GLFW_GLX) " GLX" #elif defined(_GLFW_EGL) diff --git a/extern/glfw/src/linux_joystick.c b/extern/glfw/src/x11_joystick.c similarity index 72% rename from extern/glfw/src/linux_joystick.c rename to extern/glfw/src/x11_joystick.c index 136a8c3..5aaa09a 100644 --- a/extern/glfw/src/linux_joystick.c +++ b/extern/glfw/src/x11_joystick.c @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 Linux - www.glfw.org +// GLFW 3.0 X11 - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -39,7 +39,6 @@ #include #include #include -#include #endif // __linux__ @@ -56,7 +55,7 @@ static int openJoystickDevice(int joy, const char* path) if (fd == -1) return GL_FALSE; - _glfw.linux_js[joy].fd = fd; + _glfw.x11.joystick[joy].fd = fd; // Verify that the joystick driver version is at least 1.0 ioctl(fd, JSIOCGVERSION, &version); @@ -70,18 +69,18 @@ static int openJoystickDevice(int joy, const char* path) if (ioctl(fd, JSIOCGNAME(sizeof(name)), name) < 0) strncpy(name, "Unknown", sizeof(name)); - _glfw.linux_js[joy].name = strdup(name); + _glfw.x11.joystick[joy].name = strdup(name); ioctl(fd, JSIOCGAXES, &axisCount); - _glfw.linux_js[joy].axisCount = (int) axisCount; + _glfw.x11.joystick[joy].axisCount = (int) axisCount; ioctl(fd, JSIOCGBUTTONS, &buttonCount); - _glfw.linux_js[joy].buttonCount = (int) buttonCount; + _glfw.x11.joystick[joy].buttonCount = (int) buttonCount; - _glfw.linux_js[joy].axes = calloc(axisCount, sizeof(float)); - _glfw.linux_js[joy].buttons = calloc(buttonCount, 1); + _glfw.x11.joystick[joy].axes = calloc(axisCount, sizeof(float)); + _glfw.x11.joystick[joy].buttons = calloc(buttonCount, 1); - _glfw.linux_js[joy].present = GL_TRUE; + _glfw.x11.joystick[joy].present = GL_TRUE; #endif // __linux__ return GL_TRUE; @@ -93,45 +92,52 @@ static void pollJoystickEvents(void) { #ifdef __linux__ int i; + ssize_t result; struct js_event e; for (i = 0; i <= GLFW_JOYSTICK_LAST; i++) { - if (!_glfw.linux_js[i].present) + if (!_glfw.x11.joystick[i].present) continue; // Read all queued events (non-blocking) for (;;) { errno = 0; - if (read(_glfw.linux_js[i].fd, &e, sizeof(e)) < 0) + result = read(_glfw.x11.joystick[i].fd, &e, sizeof(e)); + + if (errno == ENODEV) { - if (errno == ENODEV) - { - // The joystick was disconnected - - free(_glfw.linux_js[i].axes); - free(_glfw.linux_js[i].buttons); - free(_glfw.linux_js[i].name); - - memset(&_glfw.linux_js[i], 0, sizeof(_glfw.linux_js[i])); - } - - break; + free(_glfw.x11.joystick[i].axes); + free(_glfw.x11.joystick[i].buttons); + free(_glfw.x11.joystick[i].name); + _glfw.x11.joystick[i].present = GL_FALSE; } + if (result == -1) + break; + // We don't care if it's an init event or not e.type &= ~JS_EVENT_INIT; switch (e.type) { case JS_EVENT_AXIS: - _glfw.linux_js[i].axes[e.number] = + _glfw.x11.joystick[i].axes[e.number] = (float) e.value / 32767.0f; + + // We need to change the sign for the Y axes, so that + // positive = up/forward, according to the GLFW spec. + if (e.number & 1) + { + _glfw.x11.joystick[i].axes[e.number] = + -_glfw.x11.joystick[i].axes[e.number]; + } + break; case JS_EVENT_BUTTON: - _glfw.linux_js[i].buttons[e.number] = + _glfw.x11.joystick[i].buttons[e.number] = e.value ? GLFW_PRESS : GLFW_RELEASE; break; @@ -206,12 +212,14 @@ void _glfwTerminateJoysticks(void) for (i = 0; i <= GLFW_JOYSTICK_LAST; i++) { - if (_glfw.linux_js[i].present) + if (_glfw.x11.joystick[i].present) { - close(_glfw.linux_js[i].fd); - free(_glfw.linux_js[i].axes); - free(_glfw.linux_js[i].buttons); - free(_glfw.linux_js[i].name); + close(_glfw.x11.joystick[i].fd); + free(_glfw.x11.joystick[i].axes); + free(_glfw.x11.joystick[i].buttons); + free(_glfw.x11.joystick[i].name); + + _glfw.x11.joystick[i].present = GL_FALSE; } } #endif // __linux__ @@ -226,29 +234,35 @@ int _glfwPlatformJoystickPresent(int joy) { pollJoystickEvents(); - return _glfw.linux_js[joy].present; + return _glfw.x11.joystick[joy].present; } const float* _glfwPlatformGetJoystickAxes(int joy, int* count) { pollJoystickEvents(); - *count = _glfw.linux_js[joy].axisCount; - return _glfw.linux_js[joy].axes; + if (!_glfw.x11.joystick[joy].present) + return NULL; + + *count = _glfw.x11.joystick[joy].axisCount; + return _glfw.x11.joystick[joy].axes; } const unsigned char* _glfwPlatformGetJoystickButtons(int joy, int* count) { pollJoystickEvents(); - *count = _glfw.linux_js[joy].buttonCount; - return _glfw.linux_js[joy].buttons; + if (!_glfw.x11.joystick[joy].present) + return NULL; + + *count = _glfw.x11.joystick[joy].buttonCount; + return _glfw.x11.joystick[joy].buttons; } const char* _glfwPlatformGetJoystickName(int joy) { pollJoystickEvents(); - return _glfw.linux_js[joy].name; + return _glfw.x11.joystick[joy].name; } diff --git a/extern/glfw/src/x11_monitor.c b/extern/glfw/src/x11_monitor.c index fb6b0ef..de3287c 100644 --- a/extern/glfw/src/x11_monitor.c +++ b/extern/glfw/src/x11_monitor.c @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 X11 - www.glfw.org +// GLFW 3.0 X11 - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -32,25 +32,14 @@ #include -// Check whether the display mode should be included in enumeration -// -static GLboolean modeIsGood(const XRRModeInfo* mi) -{ - return (mi->modeFlags & RR_Interlace) == 0; -} - -// Calculates the refresh rate, in Hz, from the specified RandR mode info -// static int calculateRefreshRate(const XRRModeInfo* mi) { - if (mi->hTotal && mi->vTotal) - return (int) ((double) mi->dotClock / ((double) mi->hTotal * (double) mi->vTotal)); - else + if (!mi->hTotal || !mi->vTotal) return 0; + + return (int) ((double) mi->dotClock / ((double) mi->hTotal * (double) mi->vTotal)); } -// Returns the mode info for a RandR mode XID -// static const XRRModeInfo* getModeInfo(const XRRScreenResources* sr, RRMode id) { int i; @@ -64,32 +53,6 @@ static const XRRModeInfo* getModeInfo(const XRRScreenResources* sr, RRMode id) return NULL; } -// Convert RandR mode info to GLFW video mode -// -static GLFWvidmode vidmodeFromModeInfo(const XRRModeInfo* mi, - const XRRCrtcInfo* ci) -{ - GLFWvidmode mode; - - if (ci->rotation == RR_Rotate_90 || ci->rotation == RR_Rotate_270) - { - mode.width = mi->height; - mode.height = mi->width; - } - else - { - mode.width = mi->width; - mode.height = mi->height; - } - - mode.refreshRate = calculateRefreshRate(mi); - - _glfwSplitBPP(DefaultDepth(_glfw.x11.display, _glfw.x11.screen), - &mode.redBits, &mode.greenBits, &mode.blueBits); - - return mode; -} - ////////////////////////////////////////////////////////////////////////// ////// GLFW internal API ////// @@ -97,76 +60,80 @@ static GLFWvidmode vidmodeFromModeInfo(const XRRModeInfo* mi, // Set the current video mode for the specified monitor // -GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired) +void _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired) { - if (_glfw.x11.randr.available && !_glfw.x11.randr.monitorBroken) + if (_glfw.x11.randr.available) { + int i, j; XRRScreenResources* sr; XRRCrtcInfo* ci; XRROutputInfo* oi; - GLFWvidmode current; - const GLFWvidmode* best; - RRMode native = None; - int i; - - best = _glfwChooseVideoMode(monitor, desired); - _glfwPlatformGetVideoMode(monitor, ¤t); - if (_glfwCompareVideoModes(¤t, best) == 0) - return GL_TRUE; + RRMode bestMode = 0; + unsigned int sizeDiff, leastSizeDiff = UINT_MAX; + unsigned int rateDiff, leastRateDiff = UINT_MAX; sr = XRRGetScreenResources(_glfw.x11.display, _glfw.x11.root); ci = XRRGetCrtcInfo(_glfw.x11.display, sr, monitor->x11.crtc); oi = XRRGetOutputInfo(_glfw.x11.display, sr, monitor->x11.output); - for (i = 0; i < oi->nmode; i++) + for (i = 0; i < sr->nmode; i++) { - const XRRModeInfo* mi = getModeInfo(sr, oi->modes[i]); - if (!modeIsGood(mi)) + const XRRModeInfo* mi = sr->modes + i; + + if (mi->modeFlags & RR_Interlace) continue; - const GLFWvidmode mode = vidmodeFromModeInfo(mi, ci); - if (_glfwCompareVideoModes(best, &mode) == 0) + for (j = 0; j < oi->nmode; j++) { - native = mi->id; - break; + if (oi->modes[j] == mi->id) + break; + } + + if (j == oi->nmode) + continue; + + sizeDiff = (mi->width - desired->width) * + (mi->width - desired->width) + + (mi->height - desired->height) * + (mi->height - desired->height); + + if (desired->refreshRate) + rateDiff = abs(calculateRefreshRate(mi) - desired->refreshRate); + else + rateDiff = UINT_MAX - calculateRefreshRate(mi); + + if ((sizeDiff < leastSizeDiff) || + (sizeDiff == leastSizeDiff && rateDiff < leastRateDiff)) + { + bestMode = mi->id; + leastSizeDiff = sizeDiff; + leastRateDiff = rateDiff; } } - if (native) - { - if (monitor->x11.oldMode == None) - monitor->x11.oldMode = ci->mode; + if (monitor->x11.oldMode == None) + monitor->x11.oldMode = ci->mode; - XRRSetCrtcConfig(_glfw.x11.display, - sr, monitor->x11.crtc, - CurrentTime, - ci->x, ci->y, - native, - ci->rotation, - ci->outputs, - ci->noutput); - } + XRRSetCrtcConfig(_glfw.x11.display, + sr, monitor->x11.crtc, + CurrentTime, + ci->x, ci->y, + bestMode, + ci->rotation, + ci->outputs, + ci->noutput); XRRFreeOutputInfo(oi); XRRFreeCrtcInfo(ci); XRRFreeScreenResources(sr); - - if (!native) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "X11: Monitor mode list changed"); - return GL_FALSE; - } } - - return GL_TRUE; } // Restore the saved (original) video mode for the specified monitor // void _glfwRestoreVideoMode(_GLFWmonitor* monitor) { - if (_glfw.x11.randr.available && !_glfw.x11.randr.monitorBroken) + if (_glfw.x11.randr.available) { XRRScreenResources* sr; XRRCrtcInfo* ci; @@ -200,99 +167,98 @@ void _glfwRestoreVideoMode(_GLFWmonitor* monitor) _GLFWmonitor** _glfwPlatformGetMonitors(int* count) { - int i, j, k, size = 0, found = 0; _GLFWmonitor** monitors = NULL; *count = 0; if (_glfw.x11.randr.available) { - int screenCount = 0; - XineramaScreenInfo* screens = NULL; - XRRScreenResources* sr = XRRGetScreenResources(_glfw.x11.display, - _glfw.x11.root); - RROutput primary = XRRGetOutputPrimary(_glfw.x11.display, - _glfw.x11.root); + int i, found = 0; + RROutput primary; + XRRScreenResources* sr; - if (_glfw.x11.xinerama.available) - screens = XineramaQueryScreens(_glfw.x11.display, &screenCount); + sr = XRRGetScreenResources(_glfw.x11.display, _glfw.x11.root); + primary = XRRGetOutputPrimary(_glfw.x11.display, _glfw.x11.root); + + monitors = calloc(sr->ncrtc, sizeof(_GLFWmonitor*)); for (i = 0; i < sr->ncrtc; i++) { - XRRCrtcInfo* ci = XRRGetCrtcInfo(_glfw.x11.display, - sr, sr->crtcs[i]); + int j; + XRROutputInfo* oi; + XRRCrtcInfo* ci; + RROutput output; + + ci = XRRGetCrtcInfo(_glfw.x11.display, sr, sr->crtcs[i]); + if (ci->noutput == 0) + { + XRRFreeCrtcInfo(ci); + continue; + } + + output = ci->outputs[0]; for (j = 0; j < ci->noutput; j++) { - XRROutputInfo* oi = XRRGetOutputInfo(_glfw.x11.display, - sr, ci->outputs[j]); - if (oi->connection != RR_Connected) - { - XRRFreeOutputInfo(oi); - continue; - } - - if (found == size) - { - size += 4; - monitors = realloc(monitors, sizeof(_GLFWmonitor*) * size); - } - - monitors[found] = _glfwAllocMonitor(oi->name, - oi->mm_width, - oi->mm_height); - - monitors[found]->x11.output = ci->outputs[j]; - monitors[found]->x11.crtc = oi->crtc; - - for (k = 0; k < screenCount; k++) - { - if (screens[k].x_org == ci->x && - screens[k].y_org == ci->y && - screens[k].width == ci->width && - screens[k].height == ci->height) - { - monitors[found]->x11.index = k; - break; - } - } - - XRRFreeOutputInfo(oi); - if (ci->outputs[j] == primary) - _GLFW_SWAP_POINTERS(monitors[0], monitors[found]); - - found++; + { + output = primary; + break; + } } + oi = XRRGetOutputInfo(_glfw.x11.display, sr, output); + if (oi->connection != RR_Connected) + { + XRRFreeOutputInfo(oi); + XRRFreeCrtcInfo(ci); + continue; + } + + monitors[found] = _glfwCreateMonitor(oi->name, + oi->mm_width, oi->mm_height); + + monitors[found]->x11.output = output; + monitors[found]->x11.crtc = oi->crtc; + + XRRFreeOutputInfo(oi); XRRFreeCrtcInfo(ci); + + found++; } XRRFreeScreenResources(sr); - if (screens) - XFree(screens); + for (i = 0; i < found; i++) + { + if (monitors[i]->x11.output == primary) + { + _GLFWmonitor* temp = monitors[0]; + monitors[0] = monitors[i]; + monitors[i] = temp; + break; + } + } if (found == 0) { - _glfwInputError(GLFW_PLATFORM_ERROR, - "X11: RandR monitor support seems broken"); - _glfw.x11.randr.monitorBroken = GL_TRUE; + free(monitors); + monitors = NULL; } - } - if (!monitors) + *count = found; + } + else { monitors = calloc(1, sizeof(_GLFWmonitor*)); - monitors[0] = _glfwAllocMonitor("Display", - DisplayWidthMM(_glfw.x11.display, - _glfw.x11.screen), - DisplayHeightMM(_glfw.x11.display, - _glfw.x11.screen)); - found = 1; + monitors[0] = _glfwCreateMonitor("Display", + DisplayWidthMM(_glfw.x11.display, + _glfw.x11.screen), + DisplayHeightMM(_glfw.x11.display, + _glfw.x11.screen)); + *count = 1; } - *count = found; return monitors; } @@ -303,12 +269,12 @@ GLboolean _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second) void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos) { - if (_glfw.x11.randr.available && !_glfw.x11.randr.monitorBroken) + if (_glfw.x11.randr.available) { XRRScreenResources* sr; XRRCrtcInfo* ci; - sr = XRRGetScreenResourcesCurrent(_glfw.x11.display, _glfw.x11.root); + sr = XRRGetScreenResources(_glfw.x11.display, _glfw.x11.root); ci = XRRGetCrtcInfo(_glfw.x11.display, sr, monitor->x11.crtc); if (xpos) @@ -319,41 +285,55 @@ void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos) XRRFreeCrtcInfo(ci); XRRFreeScreenResources(sr); } + else + { + if (xpos) + *xpos = 0; + if (ypos) + *ypos = 0; + } } GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found) { GLFWvidmode* result; + int depth, r, g, b; + + depth = DefaultDepth(_glfw.x11.display, _glfw.x11.screen); + _glfwSplitBPP(depth, &r, &g, &b); *found = 0; // Build array of available resolutions - if (_glfw.x11.randr.available && !_glfw.x11.randr.monitorBroken) + if (_glfw.x11.randr.available) { int i, j; XRRScreenResources* sr; - XRRCrtcInfo* ci; XRROutputInfo* oi; - sr = XRRGetScreenResourcesCurrent(_glfw.x11.display, _glfw.x11.root); - ci = XRRGetCrtcInfo(_glfw.x11.display, sr, monitor->x11.crtc); + sr = XRRGetScreenResources(_glfw.x11.display, _glfw.x11.root); oi = XRRGetOutputInfo(_glfw.x11.display, sr, monitor->x11.output); result = calloc(oi->nmode, sizeof(GLFWvidmode)); for (i = 0; i < oi->nmode; i++) { + GLFWvidmode mode; const XRRModeInfo* mi = getModeInfo(sr, oi->modes[i]); - if (!modeIsGood(mi)) - continue; - const GLFWvidmode mode = vidmodeFromModeInfo(mi, ci); + mode.width = mi->width; + mode.height = mi->height; + mode.refreshRate = calculateRefreshRate(mi); for (j = 0; j < *found; j++) { - if (_glfwCompareVideoModes(result + j, &mode) == 0) + if (result[j].width == mode.width && + result[j].height == mode.height && + result[j].refreshRate == mode.refreshRate) + { break; + } } if (j < *found) @@ -362,19 +342,29 @@ GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found) continue; } + mode.redBits = r; + mode.greenBits = g; + mode.blueBits = b; + result[*found] = mode; (*found)++; } XRRFreeOutputInfo(oi); - XRRFreeCrtcInfo(ci); XRRFreeScreenResources(sr); } else { *found = 1; + result = calloc(1, sizeof(GLFWvidmode)); - _glfwPlatformGetVideoMode(monitor, result); + + result[0].width = DisplayWidth(_glfw.x11.display, _glfw.x11.screen); + result[0].height = DisplayHeight(_glfw.x11.display, _glfw.x11.screen); + result[0].redBits = r; + result[0].greenBits = g; + result[0].blueBits = b; + result[0].refreshRate = 0; } return result; @@ -382,15 +372,18 @@ GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found) void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode) { - if (_glfw.x11.randr.available && !_glfw.x11.randr.monitorBroken) + if (_glfw.x11.randr.available) { XRRScreenResources* sr; XRRCrtcInfo* ci; - sr = XRRGetScreenResourcesCurrent(_glfw.x11.display, _glfw.x11.root); + sr = XRRGetScreenResources(_glfw.x11.display, _glfw.x11.root); ci = XRRGetCrtcInfo(_glfw.x11.display, sr, monitor->x11.crtc); - *mode = vidmodeFromModeInfo(getModeInfo(sr, ci->mode), ci); + mode->width = ci->width; + mode->height = ci->height; + + mode->refreshRate = calculateRefreshRate(getModeInfo(sr, ci->mode)); XRRFreeCrtcInfo(ci); XRRFreeScreenResources(sr); @@ -400,82 +393,9 @@ void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode) mode->width = DisplayWidth(_glfw.x11.display, _glfw.x11.screen); mode->height = DisplayHeight(_glfw.x11.display, _glfw.x11.screen); mode->refreshRate = 0; - - _glfwSplitBPP(DefaultDepth(_glfw.x11.display, _glfw.x11.screen), - &mode->redBits, &mode->greenBits, &mode->blueBits); } -} - -void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp) -{ - if (_glfw.x11.randr.available && !_glfw.x11.randr.gammaBroken) - { - const size_t size = XRRGetCrtcGammaSize(_glfw.x11.display, - monitor->x11.crtc); - XRRCrtcGamma* gamma = XRRGetCrtcGamma(_glfw.x11.display, - monitor->x11.crtc); - - _glfwAllocGammaArrays(ramp, size); - - memcpy(ramp->red, gamma->red, size * sizeof(unsigned short)); - memcpy(ramp->green, gamma->green, size * sizeof(unsigned short)); - memcpy(ramp->blue, gamma->blue, size * sizeof(unsigned short)); - - XRRFreeGamma(gamma); - } - else if (_glfw.x11.vidmode.available) - { - int size; - XF86VidModeGetGammaRampSize(_glfw.x11.display, _glfw.x11.screen, &size); - - _glfwAllocGammaArrays(ramp, size); - - XF86VidModeGetGammaRamp(_glfw.x11.display, - _glfw.x11.screen, - ramp->size, ramp->red, ramp->green, ramp->blue); - } -} - -void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp) -{ - if (_glfw.x11.randr.available && !_glfw.x11.randr.gammaBroken) - { - XRRCrtcGamma* gamma = XRRAllocGamma(ramp->size); - - memcpy(gamma->red, ramp->red, ramp->size * sizeof(unsigned short)); - memcpy(gamma->green, ramp->green, ramp->size * sizeof(unsigned short)); - memcpy(gamma->blue, ramp->blue, ramp->size * sizeof(unsigned short)); - - XRRSetCrtcGamma(_glfw.x11.display, monitor->x11.crtc, gamma); - XRRFreeGamma(gamma); - } - else if (_glfw.x11.vidmode.available) - { - XF86VidModeSetGammaRamp(_glfw.x11.display, - _glfw.x11.screen, - ramp->size, - (unsigned short*) ramp->red, - (unsigned short*) ramp->green, - (unsigned short*) ramp->blue); - } -} - - -////////////////////////////////////////////////////////////////////////// -////// GLFW native API ////// -////////////////////////////////////////////////////////////////////////// - -GLFWAPI RRCrtc glfwGetX11Adapter(GLFWmonitor* handle) -{ - _GLFWmonitor* monitor = (_GLFWmonitor*) handle; - _GLFW_REQUIRE_INIT_OR_RETURN(None); - return monitor->x11.crtc; -} - -GLFWAPI RROutput glfwGetX11Monitor(GLFWmonitor* handle) -{ - _GLFWmonitor* monitor = (_GLFWmonitor*) handle; - _GLFW_REQUIRE_INIT_OR_RETURN(None); - return monitor->x11.output; + + _glfwSplitBPP(DefaultDepth(_glfw.x11.display, _glfw.x11.screen), + &mode->redBits, &mode->greenBits, &mode->blueBits); } diff --git a/extern/glfw/src/x11_platform.h b/extern/glfw/src/x11_platform.h index bed461f..868429f 100644 --- a/extern/glfw/src/x11_platform.h +++ b/extern/glfw/src/x11_platform.h @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 X11 - www.glfw.org +// GLFW 3.0 X11 - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -34,7 +34,6 @@ #include #include #include -#include // The Xf86VidMode extension provides fallback gamma control #include @@ -48,42 +47,41 @@ // The Xkb extension provides improved keyboard support #include -// The Xinerama extension provides legacy monitor indices -#include - -#include "posix_tls.h" - #if defined(_GLFW_GLX) #define _GLFW_X11_CONTEXT_VISUAL window->glx.visual - #include "glx_context.h" + #include "glx_platform.h" #elif defined(_GLFW_EGL) #define _GLFW_X11_CONTEXT_VISUAL window->egl.visual #define _GLFW_EGL_NATIVE_WINDOW window->x11.handle #define _GLFW_EGL_NATIVE_DISPLAY _glfw.x11.display - #include "egl_context.h" + #include "egl_platform.h" #else #error "No supported context creation API selected" #endif -#include "posix_time.h" -#include "linux_joystick.h" -#include "xkb_unicode.h" - #define _GLFW_PLATFORM_WINDOW_STATE _GLFWwindowX11 x11 #define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE _GLFWlibraryX11 x11 #define _GLFW_PLATFORM_MONITOR_STATE _GLFWmonitorX11 x11 -#define _GLFW_PLATFORM_CURSOR_STATE _GLFWcursorX11 x11 -// X11-specific per-window data -// +//======================================================================== +// GLFW platform specific types +//======================================================================== + + +//------------------------------------------------------------------------ +// Platform-specific window structure +//------------------------------------------------------------------------ typedef struct _GLFWwindowX11 { - Colormap colormap; - Window handle; - XIC ic; + // Platform specific window resources + Colormap colormap; // Window colormap + Window handle; // Window handle - GLboolean overrideRedirect; + // Various platform specific internal variables + GLboolean overrideRedirect; // True if window is OverrideRedirect + GLboolean cursorGrabbed; // True if cursor is currently grabbed + GLboolean cursorHidden; // True if cursor is currently hidden // Cached position and size used to filter out duplicate events int width, height; @@ -97,8 +95,9 @@ typedef struct _GLFWwindowX11 } _GLFWwindowX11; -// X11-specific global data -// +//------------------------------------------------------------------------ +// Platform-specific library global data for X11 +//------------------------------------------------------------------------ typedef struct _GLFWlibraryX11 { Display* display; @@ -107,22 +106,9 @@ typedef struct _GLFWlibraryX11 // Invisible cursor for hidden cursor mode Cursor cursor; - // Context for mapping window XIDs to _GLFWwindow pointers XContext context; - // XIM input method - XIM im; - // True if window manager supports EWMH - GLboolean hasEWMH; - // Most recent error code received by X error handler - int errorCode; - // Clipboard string (while the selection is owned) - char* clipboardString; - - // LUT for mapping X11 key codes to GLFW key codes - int keyCodeLUT[256]; // Window manager atoms - Atom WM_PROTOCOLS; Atom WM_STATE; Atom WM_DELETE_WINDOW; Atom NET_WM_NAME; @@ -130,38 +116,27 @@ typedef struct _GLFWlibraryX11 Atom NET_WM_PID; Atom NET_WM_PING; Atom NET_WM_STATE; - Atom NET_WM_STATE_ABOVE; Atom NET_WM_STATE_FULLSCREEN; - Atom NET_WM_BYPASS_COMPOSITOR; - Atom NET_WM_FULLSCREEN_MONITORS; Atom NET_ACTIVE_WINDOW; - Atom NET_FRAME_EXTENTS; - Atom NET_REQUEST_FRAME_EXTENTS; Atom MOTIF_WM_HINTS; - // Xdnd (drag and drop) atoms - Atom XdndAware; - Atom XdndEnter; - Atom XdndPosition; - Atom XdndStatus; - Atom XdndActionCopy; - Atom XdndDrop; - Atom XdndLeave; - Atom XdndFinished; - Atom XdndSelection; - - // Selection (clipboard) atoms + // Selection atoms Atom TARGETS; Atom MULTIPLE; Atom CLIPBOARD; Atom CLIPBOARD_MANAGER; Atom SAVE_TARGETS; - Atom _NULL; Atom UTF8_STRING; Atom COMPOUND_STRING; Atom ATOM_PAIR; Atom GLFW_SELECTION; + // True if window manager supports EWMH + GLboolean hasEWMH; + + // Error code received by the X error handler + int errorCode; + struct { GLboolean available; int eventBase; @@ -175,12 +150,9 @@ typedef struct _GLFWlibraryX11 int versionMajor; int versionMinor; GLboolean gammaBroken; - GLboolean monitorBroken; } randr; struct { - GLboolean available; - GLboolean detectable; int majorOpcode; int eventBase; int errorBase; @@ -197,6 +169,9 @@ typedef struct _GLFWlibraryX11 int versionMinor; } xi; + // LUT for mapping X11 key codes to GLFW key codes + int keyCodeLUT[256]; + struct { int count; int timeout; @@ -206,52 +181,82 @@ typedef struct _GLFWlibraryX11 } saver; struct { - Window source; - } xdnd; + GLboolean monotonic; + double resolution; + uint64_t base; + } timer; struct { - GLboolean available; - int versionMajor; - int versionMinor; - } xinerama; + char* string; + } selection; + + struct { + int present; + int fd; + float* axes; + int axisCount; + unsigned char* buttons; + int buttonCount; + char* name; + } joystick[GLFW_JOYSTICK_LAST + 1]; } _GLFWlibraryX11; -// X11-specific per-monitor data -// +//------------------------------------------------------------------------ +// Platform-specific monitor structure +//------------------------------------------------------------------------ typedef struct _GLFWmonitorX11 { RROutput output; RRCrtc crtc; RRMode oldMode; - // Index of corresponding Xinerama screen, - // for EWMH full screen window placement - int index; - } _GLFWmonitorX11; -// X11-specific per-cursor data -// -typedef struct _GLFWcursorX11 -{ - Cursor handle; +//======================================================================== +// Prototypes for platform specific internal functions +//======================================================================== -} _GLFWcursorX11; +// Time +void _glfwInitTimer(void); +// Gamma +void _glfwInitGammaRamp(void); -GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired); +// OpenGL support +int _glfwInitContextAPI(void); +void _glfwTerminateContextAPI(void); +int _glfwCreateContext(_GLFWwindow* window, + const _GLFWwndconfig* wndconfig, + const _GLFWfbconfig* fbconfig); +void _glfwDestroyContext(_GLFWwindow* window); + +// Fullscreen support +void _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired); void _glfwRestoreVideoMode(_GLFWmonitor* monitor); -Cursor _glfwCreateCursor(const GLFWimage* image, int xhot, int yhot); +// Joystick input +void _glfwInitJoysticks(void); +void _glfwTerminateJoysticks(void); +// Unicode support +long _glfwKeySym2Unicode(KeySym keysym); + +// Clipboard handling +void _glfwHandleSelectionClear(XEvent* event); +void _glfwHandleSelectionRequest(XEvent* event); +void _glfwPushSelectionToManager(_GLFWwindow* window); + +// Window support +_GLFWwindow* _glfwFindWindowByHandle(Window handle); unsigned long _glfwGetWindowProperty(Window window, Atom property, Atom type, unsigned char** value); +// X11 error handler void _glfwGrabXErrorHandler(void); void _glfwReleaseXErrorHandler(void); void _glfwInputXError(int error, const char* message); diff --git a/extern/glfw/src/posix_time.c b/extern/glfw/src/x11_time.c similarity index 84% rename from extern/glfw/src/posix_time.c rename to extern/glfw/src/x11_time.c index 53ea794..d787d89 100644 --- a/extern/glfw/src/posix_time.c +++ b/extern/glfw/src/x11_time.c @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 POSIX - www.glfw.org +// GLFW 3.0 X11 - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -30,12 +30,13 @@ #include #include + // Return raw time // static uint64_t getRawTime(void) { #if defined(CLOCK_MONOTONIC) - if (_glfw.posix_time.monotonic) + if (_glfw.x11.timer.monotonic) { struct timespec ts; @@ -66,16 +67,16 @@ void _glfwInitTimer(void) if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) { - _glfw.posix_time.monotonic = GL_TRUE; - _glfw.posix_time.resolution = 1e-9; + _glfw.x11.timer.monotonic = GL_TRUE; + _glfw.x11.timer.resolution = 1e-9; } else #endif { - _glfw.posix_time.resolution = 1e-6; + _glfw.x11.timer.resolution = 1e-6; } - _glfw.posix_time.base = getRawTime(); + _glfw.x11.timer.base = getRawTime(); } @@ -85,13 +86,13 @@ void _glfwInitTimer(void) double _glfwPlatformGetTime(void) { - return (double) (getRawTime() - _glfw.posix_time.base) * - _glfw.posix_time.resolution; + return (double) (getRawTime() - _glfw.x11.timer.base) * + _glfw.x11.timer.resolution; } void _glfwPlatformSetTime(double time) { - _glfw.posix_time.base = getRawTime() - - (uint64_t) (time / _glfw.posix_time.resolution); + _glfw.x11.timer.base = getRawTime() - + (uint64_t) (time / _glfw.x11.timer.resolution); } diff --git a/extern/glfw/src/xkb_unicode.c b/extern/glfw/src/x11_unicode.c similarity index 96% rename from extern/glfw/src/xkb_unicode.c rename to extern/glfw/src/x11_unicode.c index fbc25a2..b847e0f 100644 --- a/extern/glfw/src/xkb_unicode.c +++ b/extern/glfw/src/x11_unicode.c @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 X11 - www.glfw.org +// GLFW 3.0 X11 - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -64,7 +64,7 @@ //**** KeySym to Unicode mapping table **** //************************************************************************ -static const struct codepair { +static struct codepair { unsigned short keysym; unsigned short ucs; } keysymtab[] = { @@ -852,38 +852,40 @@ static const struct codepair { ////// GLFW internal API ////// ////////////////////////////////////////////////////////////////////////// -// Convert XKB KeySym to Unicode +// Convert X11 KeySym to Unicode // -long _glfwKeySym2Unicode(unsigned int keysym) +long _glfwKeySym2Unicode( KeySym keysym ) { int min = 0; int max = sizeof(keysymtab) / sizeof(struct codepair) - 1; int mid; - // First check for Latin-1 characters (1:1 mapping) - if ((keysym >= 0x0020 && keysym <= 0x007e) || - (keysym >= 0x00a0 && keysym <= 0x00ff)) - { - return keysym; + /* First check for Latin-1 characters (1:1 mapping) */ + if( (keysym >= 0x0020 && keysym <= 0x007e) || + (keysym >= 0x00a0 && keysym <= 0x00ff) ) + { return keysym; } - // Also check for directly encoded 24-bit UCS characters - if ((keysym & 0xff000000) == 0x01000000) + /* Also check for directly encoded 24-bit UCS characters */ + if( (keysym & 0xff000000) == 0x01000000 ) return keysym & 0x00ffffff; - // Binary search in table - while (max >= min) + /* Binary search in table */ + while( max >= min ) { mid = (min + max) / 2; - if (keysymtab[mid].keysym < keysym) + if( keysymtab[mid].keysym < keysym ) min = mid + 1; - else if (keysymtab[mid].keysym > keysym) + else if( keysymtab[mid].keysym > keysym ) max = mid - 1; else + { + /* Found it! */ return keysymtab[mid].ucs; + } } - // No matching Unicode value found + /* No matching Unicode value found */ return -1; } diff --git a/extern/glfw/src/x11_window.c b/extern/glfw/src/x11_window.c index a3ff88d..33c4b8e 100644 --- a/extern/glfw/src/x11_window.c +++ b/extern/glfw/src/x11_window.c @@ -1,5 +1,5 @@ //======================================================================== -// GLFW 3.1 X11 - www.glfw.org +// GLFW 3.0 X11 - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2002-2006 Marcus Geelnard // Copyright (c) 2006-2010 Camilla Berglund @@ -45,27 +45,16 @@ typedef struct { - unsigned long flags; - unsigned long functions; - unsigned long decorations; - long input_mode; - unsigned long status; + unsigned long flags; + unsigned long functions; + unsigned long decorations; + long input_mode; + unsigned long status; } MotifWmHints; #define MWM_HINTS_DECORATIONS (1L << 1) -// Returns whether the event is a selection event -// -static Bool isFrameExtentsEvent(Display* display, XEvent* event, XPointer pointer) -{ - _GLFWwindow* window = (_GLFWwindow*) pointer; - return event->type == PropertyNotify && - event->xproperty.state == PropertyNewValue && - event->xproperty.window == window->x11.handle && - event->xproperty.atom == _glfw.x11.NET_FRAME_EXTENTS; -} - // Translates an X event modifier state mask // static int translateState(int state) @@ -89,95 +78,23 @@ static int translateState(int state) static int translateKey(int keycode) { // Use the pre-filled LUT (see updateKeyCodeLUT() in x11_init.c) - if (keycode < 0 || keycode > 255) - return GLFW_KEY_UNKNOWN; + if ((keycode >= 0) && (keycode < 256)) + return _glfw.x11.keyCodeLUT[keycode]; - return _glfw.x11.keyCodeLUT[keycode]; + return GLFW_KEY_UNKNOWN; } -// Return the GLFW window corresponding to the specified X11 window +// Translates an X Window event to Unicode // -static _GLFWwindow* findWindowByHandle(Window handle) +static int translateChar(XKeyEvent* event) { - _GLFWwindow* window; + KeySym keysym; - if (XFindContext(_glfw.x11.display, - handle, - _glfw.x11.context, - (XPointer*) &window) != 0) - { - return NULL; - } + // Get X11 keysym + XLookupString(event, NULL, 0, &keysym, NULL); - return window; -} - -// Adds or removes an EWMH state to a window -// -static void changeWindowState(_GLFWwindow* window, Atom state, int action) -{ - XEvent event; - memset(&event, 0, sizeof(event)); - - event.type = ClientMessage; - event.xclient.window = window->x11.handle; - event.xclient.format = 32; // Data is 32-bit longs - event.xclient.message_type = _glfw.x11.NET_WM_STATE; - event.xclient.data.l[0] = action; - event.xclient.data.l[1] = state; - event.xclient.data.l[2] = 0; // No secondary property - event.xclient.data.l[3] = 1; // Sender is a normal application - - XSendEvent(_glfw.x11.display, - _glfw.x11.root, - False, - SubstructureNotifyMask | SubstructureRedirectMask, - &event); -} - -// Splits and translates a text/uri-list into separate file paths -// -static char** parseUriList(char* text, int* count) -{ - const char* prefix = "file://"; - char** names = NULL; - char* line; - - *count = 0; - - while ((line = strtok(text, "\r\n"))) - { - text = NULL; - - if (*line == '#') - continue; - - if (strncmp(line, prefix, strlen(prefix)) == 0) - line += strlen(prefix); - - (*count)++; - - char* name = calloc(strlen(line) + 1, 1); - names = realloc(names, *count * sizeof(char*)); - names[*count - 1] = name; - - while (*line) - { - if (line[0] == '%' && line[1] && line[2]) - { - const char digits[3] = { line[1], line[2], '\0' }; - *name = strtol(digits, NULL, 16); - line += 2; - } - else - *name = *line; - - name++; - line++; - } - } - - return names; + // Convert to Unicode (see x11_unicode.c) + return (int) _glfwKeySym2Unicode(keysym); } // Create the X11 window (and its colormap) @@ -209,7 +126,15 @@ static GLboolean createWindow(_GLFWwindow* window, ExposureMask | FocusChangeMask | VisibilityChangeMask | EnterWindowMask | LeaveWindowMask | PropertyChangeMask; - _glfwGrabXErrorHandler(); + if (wndconfig->monitor == NULL) + { + // HACK: This is a workaround for windows without a background pixel + // not getting any decorations on certain older versions of Compiz + // running on Intel hardware + wa.background_pixel = BlackPixel(_glfw.x11.display, + _glfw.x11.screen); + wamask |= CWBackPixel; + } window->x11.handle = XCreateWindow(_glfw.x11.display, _glfw.x11.root, @@ -222,12 +147,12 @@ static GLboolean createWindow(_GLFWwindow* window, wamask, &wa); - _glfwReleaseXErrorHandler(); - if (!window->x11.handle) { - _glfwInputXError(GLFW_PLATFORM_ERROR, - "X11: Failed to create window"); + // TODO: Handle all the various error codes here and translate them + // to GLFW errors + + _glfwInputError(GLFW_PLATFORM_ERROR, "X11: Failed to create window"); return GL_FALSE; } @@ -278,13 +203,13 @@ static GLboolean createWindow(_GLFWwindow* window, // The WM_DELETE_WINDOW ICCCM protocol // Basic window close notification protocol - if (_glfw.x11.WM_DELETE_WINDOW) + if (_glfw.x11.WM_DELETE_WINDOW != None) protocols[count++] = _glfw.x11.WM_DELETE_WINDOW; // The _NET_WM_PING EWMH protocol // Tells the WM to ping the GLFW window and flag the application as // unresponsive if the WM doesn't get a reply within a few seconds - if (_glfw.x11.NET_WM_PING) + if (_glfw.x11.NET_WM_PING != None) protocols[count++] = _glfw.x11.NET_WM_PING; if (count > 0) @@ -294,7 +219,7 @@ static GLboolean createWindow(_GLFWwindow* window, } } - if (_glfw.x11.NET_WM_PID) + if (_glfw.x11.NET_WM_PID != None) { const pid_t pid = getpid(); @@ -331,14 +256,6 @@ static GLboolean createWindow(_GLFWwindow* window, hints->flags |= PPosition; _glfwPlatformGetMonitorPos(wndconfig->monitor, &hints->x, &hints->y); } - else - { - // HACK: Explicitly setting PPosition to any value causes some WMs, - // notably Compiz and Metacity, to honor the position of - // unmapped windows set by XMoveWindow - hints->flags |= PPosition; - hints->x = hints->y = 0; - } if (!wndconfig->resizable) { @@ -351,19 +268,6 @@ static GLboolean createWindow(_GLFWwindow* window, XFree(hints); } - // Set ICCCM WM_CLASS property - // HACK: Until a mechanism for specifying the application name is added, the - // initial window title is used as the window class name - if (strlen(wndconfig->title)) - { - XClassHint* hint = XAllocClassHint(); - hint->res_name = (char*) wndconfig->title; - hint->res_class = (char*) wndconfig->title; - - XSetClassHint(_glfw.x11.display, window->x11.handle, hint); - XFree(hint); - } - if (_glfw.x11.xi.available) { // Select for XInput2 events @@ -379,308 +283,74 @@ static GLboolean createWindow(_GLFWwindow* window, XISelectEvents(_glfw.x11.display, window->x11.handle, &eventmask, 1); } - if (_glfw.x11.XdndAware) - { - // Announce support for Xdnd (drag and drop) - const Atom version = 5; - XChangeProperty(_glfw.x11.display, window->x11.handle, - _glfw.x11.XdndAware, XA_ATOM, 32, - PropModeReplace, (unsigned char*) &version, 1); - } - - if (_glfw.x11.NET_REQUEST_FRAME_EXTENTS) - { - // Ensure _NET_FRAME_EXTENTS is set, allowing glfwGetWindowFrameSize to - // function before the window is mapped - - XEvent event; - memset(&event, 0, sizeof(event)); - - event.type = ClientMessage; - event.xclient.window = window->x11.handle; - event.xclient.format = 32; // Data is 32-bit longs - event.xclient.message_type = _glfw.x11.NET_REQUEST_FRAME_EXTENTS; - - XSendEvent(_glfw.x11.display, - _glfw.x11.root, - False, - SubstructureNotifyMask | SubstructureRedirectMask, - &event); - XIfEvent(_glfw.x11.display, &event, isFrameExtentsEvent, (XPointer) window); - } - - if (wndconfig->floating && !wndconfig->monitor) - { - if (_glfw.x11.NET_WM_STATE && _glfw.x11.NET_WM_STATE_ABOVE) - { - changeWindowState(window, - _glfw.x11.NET_WM_STATE_ABOVE, - _NET_WM_STATE_ADD); - } - } - _glfwPlatformSetWindowTitle(window, wndconfig->title); XRRSelectInput(_glfw.x11.display, window->x11.handle, RRScreenChangeNotifyMask); - if (_glfw.x11.im) - { - window->x11.ic = XCreateIC(_glfw.x11.im, - XNInputStyle, - XIMPreeditNothing | XIMStatusNothing, - XNClientWindow, - window->x11.handle, - XNFocusWindow, - window->x11.handle, - NULL); - } - _glfwPlatformGetWindowPos(window, &window->x11.xpos, &window->x11.ypos); _glfwPlatformGetWindowSize(window, &window->x11.width, &window->x11.height); return GL_TRUE; } -// Hide the mouse cursor +// Hide cursor // static void hideCursor(_GLFWwindow* window) { - XUngrabPointer(_glfw.x11.display, CurrentTime); - XDefineCursor(_glfw.x11.display, window->x11.handle, _glfw.x11.cursor); -} - -// Disable the mouse cursor -// -static void disableCursor(_GLFWwindow* window) -{ - XGrabPointer(_glfw.x11.display, window->x11.handle, True, - ButtonPressMask | ButtonReleaseMask | PointerMotionMask, - GrabModeAsync, GrabModeAsync, - window->x11.handle, _glfw.x11.cursor, CurrentTime); -} - -// Restores the mouse cursor -// -static void restoreCursor(_GLFWwindow* window) -{ - XUngrabPointer(_glfw.x11.display, CurrentTime); - - if (window->cursor) + // Un-grab cursor (in windowed mode only; in fullscreen mode we still + // want the cursor grabbed in order to confine the cursor to the window + // area) + if (window->x11.cursorGrabbed && window->monitor == NULL) { - XDefineCursor(_glfw.x11.display, window->x11.handle, - window->cursor->x11.handle); + XUngrabPointer(_glfw.x11.display, CurrentTime); + window->x11.cursorGrabbed = GL_FALSE; } - else + + if (!window->x11.cursorHidden) + { + XDefineCursor(_glfw.x11.display, window->x11.handle, _glfw.x11.cursor); + window->x11.cursorHidden = GL_TRUE; + } +} + +// Capture cursor +// +static void captureCursor(_GLFWwindow* window) +{ + hideCursor(window); + + if (!window->x11.cursorGrabbed) + { + if (XGrabPointer(_glfw.x11.display, window->x11.handle, True, + ButtonPressMask | ButtonReleaseMask | + PointerMotionMask, GrabModeAsync, GrabModeAsync, + window->x11.handle, None, CurrentTime) == + GrabSuccess) + { + window->x11.cursorGrabbed = GL_TRUE; + } + } +} + +// Show cursor +// +static void showCursor(_GLFWwindow* window) +{ + // Un-grab cursor (in windowed mode only; in fullscreen mode we still + // want the cursor grabbed in order to confine the cursor to the window + // area) + if (window->x11.cursorGrabbed && window->monitor == NULL) + { + XUngrabPointer(_glfw.x11.display, CurrentTime); + window->x11.cursorGrabbed = GL_FALSE; + } + + // Show cursor + if (window->x11.cursorHidden) + { XUndefineCursor(_glfw.x11.display, window->x11.handle); -} - -// Returns whether the event is a selection event -// -static Bool isSelectionEvent(Display* display, XEvent* event, XPointer pointer) -{ - return event->type == SelectionRequest || - event->type == SelectionNotify || - event->type == SelectionClear; -} - -// Set the specified property to the selection converted to the requested target -// -static Atom writeTargetToProperty(const XSelectionRequestEvent* request) -{ - int i; - const Atom formats[] = { _glfw.x11.UTF8_STRING, - _glfw.x11.COMPOUND_STRING, - XA_STRING }; - const int formatCount = sizeof(formats) / sizeof(formats[0]); - - if (request->property == None) - { - // The requestor is a legacy client (ICCCM section 2.2) - // We don't support legacy clients, so fail here - return None; - } - - if (request->target == _glfw.x11.TARGETS) - { - // The list of supported targets was requested - - const Atom targets[] = { _glfw.x11.TARGETS, - _glfw.x11.MULTIPLE, - _glfw.x11.UTF8_STRING, - _glfw.x11.COMPOUND_STRING, - XA_STRING }; - - XChangeProperty(_glfw.x11.display, - request->requestor, - request->property, - XA_ATOM, - 32, - PropModeReplace, - (unsigned char*) targets, - sizeof(targets) / sizeof(targets[0])); - - return request->property; - } - - if (request->target == _glfw.x11.MULTIPLE) - { - // Multiple conversions were requested - - Atom* targets; - unsigned long i, count; - - count = _glfwGetWindowProperty(request->requestor, - request->property, - _glfw.x11.ATOM_PAIR, - (unsigned char**) &targets); - - for (i = 0; i < count; i += 2) - { - int j; - - for (j = 0; j < formatCount; j++) - { - if (targets[i] == formats[j]) - break; - } - - if (j < formatCount) - { - XChangeProperty(_glfw.x11.display, - request->requestor, - targets[i + 1], - targets[i], - 8, - PropModeReplace, - (unsigned char*) _glfw.x11.clipboardString, - strlen(_glfw.x11.clipboardString)); - } - else - targets[i + 1] = None; - } - - XChangeProperty(_glfw.x11.display, - request->requestor, - request->property, - _glfw.x11.ATOM_PAIR, - 32, - PropModeReplace, - (unsigned char*) targets, - count); - - XFree(targets); - - return request->property; - } - - if (request->target == _glfw.x11.SAVE_TARGETS) - { - // The request is a check whether we support SAVE_TARGETS - // It should be handled as a no-op side effect target - - XChangeProperty(_glfw.x11.display, - request->requestor, - request->property, - _glfw.x11._NULL, - 32, - PropModeReplace, - NULL, - 0); - - return request->property; - } - - // Conversion to a data target was requested - - for (i = 0; i < formatCount; i++) - { - if (request->target == formats[i]) - { - // The requested target is one we support - - XChangeProperty(_glfw.x11.display, - request->requestor, - request->property, - request->target, - 8, - PropModeReplace, - (unsigned char*) _glfw.x11.clipboardString, - strlen(_glfw.x11.clipboardString)); - - return request->property; - } - } - - // The requested target is not supported - - return None; -} - -static void handleSelectionClear(XEvent* event) -{ - free(_glfw.x11.clipboardString); - _glfw.x11.clipboardString = NULL; -} - -static void handleSelectionRequest(XEvent* event) -{ - const XSelectionRequestEvent* request = &event->xselectionrequest; - - XEvent response; - memset(&response, 0, sizeof(response)); - - response.xselection.property = writeTargetToProperty(request); - response.xselection.type = SelectionNotify; - response.xselection.display = request->display; - response.xselection.requestor = request->requestor; - response.xselection.selection = request->selection; - response.xselection.target = request->target; - response.xselection.time = request->time; - - XSendEvent(_glfw.x11.display, request->requestor, False, 0, &response); -} - -static void pushSelectionToManager(_GLFWwindow* window) -{ - XConvertSelection(_glfw.x11.display, - _glfw.x11.CLIPBOARD_MANAGER, - _glfw.x11.SAVE_TARGETS, - None, - window->x11.handle, - CurrentTime); - - for (;;) - { - XEvent event; - - if (!XCheckIfEvent(_glfw.x11.display, &event, isSelectionEvent, NULL)) - continue; - - switch (event.type) - { - case SelectionRequest: - handleSelectionRequest(&event); - break; - - case SelectionClear: - handleSelectionClear(&event); - break; - - case SelectionNotify: - { - if (event.xselection.target == _glfw.x11.SAVE_TARGETS) - { - // This means one of two things; either the selection was - // not owned, which means there is no clipboard manager, or - // the transfer to the clipboard manager has completed - // In either case, it means we are done here - return; - } - - break; - } - } + window->x11.cursorHidden = GL_FALSE; } } @@ -706,43 +376,15 @@ static void enterFullscreenMode(_GLFWwindow* window) _glfwSetVideoMode(window->monitor, &window->videoMode); - if (_glfw.x11.NET_WM_BYPASS_COMPOSITOR) - { - const unsigned long value = 1; - - XChangeProperty(_glfw.x11.display, window->x11.handle, - _glfw.x11.NET_WM_BYPASS_COMPOSITOR, XA_CARDINAL, 32, - PropModeReplace, (unsigned char*) &value, 1); - } - - if (_glfw.x11.xinerama.available && _glfw.x11.NET_WM_FULLSCREEN_MONITORS) - { - XEvent event; - memset(&event, 0, sizeof(event)); - - event.type = ClientMessage; - event.xclient.window = window->x11.handle; - event.xclient.format = 32; // Data is 32-bit longs - event.xclient.message_type = _glfw.x11.NET_WM_FULLSCREEN_MONITORS; - event.xclient.data.l[0] = window->monitor->x11.index; - event.xclient.data.l[1] = window->monitor->x11.index; - event.xclient.data.l[2] = window->monitor->x11.index; - event.xclient.data.l[3] = window->monitor->x11.index; - - XSendEvent(_glfw.x11.display, - _glfw.x11.root, - False, - SubstructureNotifyMask | SubstructureRedirectMask, - &event); - } - - if (_glfw.x11.NET_WM_STATE && _glfw.x11.NET_WM_STATE_FULLSCREEN) + if (_glfw.x11.hasEWMH && + _glfw.x11.NET_WM_STATE != None && + _glfw.x11.NET_WM_STATE_FULLSCREEN != None) { int x, y; _glfwPlatformGetMonitorPos(window->monitor, &x, &y); _glfwPlatformSetWindowPos(window, x, y); - if (_glfw.x11.NET_ACTIVE_WINDOW) + if (_glfw.x11.NET_ACTIVE_WINDOW != None) { // Ask the window manager to raise and focus the GLFW window // Only focused windows with the _NET_WM_STATE_FULLSCREEN state end @@ -769,24 +411,36 @@ static void enterFullscreenMode(_GLFWwindow* window) // Fullscreen windows are undecorated and, when focused, are kept // on top of all other windows - changeWindowState(window, - _glfw.x11.NET_WM_STATE_FULLSCREEN, - _NET_WM_STATE_ADD); + XEvent event; + memset(&event, 0, sizeof(event)); + + event.type = ClientMessage; + event.xclient.window = window->x11.handle; + event.xclient.format = 32; // Data is 32-bit longs + event.xclient.message_type = _glfw.x11.NET_WM_STATE; + event.xclient.data.l[0] = _NET_WM_STATE_ADD; + event.xclient.data.l[1] = _glfw.x11.NET_WM_STATE_FULLSCREEN; + event.xclient.data.l[2] = 0; // No secondary property + event.xclient.data.l[3] = 1; // Sender is a normal application + + XSendEvent(_glfw.x11.display, + _glfw.x11.root, + False, + SubstructureNotifyMask | SubstructureRedirectMask, + &event); } else if (window->x11.overrideRedirect) { // In override-redirect mode we have divorced ourselves from the // window manager, so we need to do everything manually - int xpos, ypos; - GLFWvidmode mode; - _glfwPlatformGetMonitorPos(window->monitor, &xpos, &ypos); + GLFWvidmode mode; _glfwPlatformGetVideoMode(window->monitor, &mode); XRaiseWindow(_glfw.x11.display, window->x11.handle); XSetInputFocus(_glfw.x11.display, window->x11.handle, RevertToParent, CurrentTime); - XMoveWindow(_glfw.x11.display, window->x11.handle, xpos, ypos); + XMoveWindow(_glfw.x11.display, window->x11.handle, 0, 0); XResizeWindow(_glfw.x11.display, window->x11.handle, mode.width, mode.height); } @@ -810,23 +464,30 @@ static void leaveFullscreenMode(_GLFWwindow* window) _glfw.x11.saver.exposure); } - if (_glfw.x11.NET_WM_BYPASS_COMPOSITOR) - { - const unsigned long value = 0; - - XChangeProperty(_glfw.x11.display, window->x11.handle, - _glfw.x11.NET_WM_BYPASS_COMPOSITOR, XA_CARDINAL, 32, - PropModeReplace, (unsigned char*) &value, 1); - } - - if (_glfw.x11.NET_WM_STATE && _glfw.x11.NET_WM_STATE_FULLSCREEN) + if (_glfw.x11.hasEWMH && + _glfw.x11.NET_WM_STATE != None && + _glfw.x11.NET_WM_STATE_FULLSCREEN != None) { // Ask the window manager to make the GLFW window a normal window // Normal windows usually have frames and other decorations - changeWindowState(window, - _glfw.x11.NET_WM_STATE_FULLSCREEN, - _NET_WM_STATE_REMOVE); + XEvent event; + memset(&event, 0, sizeof(event)); + + event.type = ClientMessage; + event.xclient.window = window->x11.handle; + event.xclient.format = 32; // Data is 32-bit longs + event.xclient.message_type = _glfw.x11.NET_WM_STATE; + event.xclient.data.l[0] = _NET_WM_STATE_REMOVE; + event.xclient.data.l[1] = _glfw.x11.NET_WM_STATE_FULLSCREEN; + event.xclient.data.l[2] = 0; // No secondary property + event.xclient.data.l[3] = 1; // Sender is a normal application + + XSendEvent(_glfw.x11.display, + _glfw.x11.root, + False, + SubstructureNotifyMask | SubstructureRedirectMask, + &event); } } @@ -838,7 +499,7 @@ static void processEvent(XEvent *event) if (event->type != GenericEvent) { - window = findWindowByHandle(event->xany.window); + window = _glfwFindWindowByHandle(event->xany.window); if (window == NULL) { // This is an event for a window that has already been destroyed @@ -852,44 +513,12 @@ static void processEvent(XEvent *event) { const int key = translateKey(event->xkey.keycode); const int mods = translateState(event->xkey.state); - const int plain = !(mods & (GLFW_MOD_CONTROL | GLFW_MOD_ALT)); + const int character = translateChar(&event->xkey); - if (event->xkey.keycode) - _glfwInputKey(window, key, event->xkey.keycode, GLFW_PRESS, mods); + _glfwInputKey(window, key, event->xkey.keycode, GLFW_PRESS, mods); - if (window->x11.ic) - { - // Translate keys to characters with XIM input context - - int i; - Status status; - wchar_t buffer[16]; - - if (XFilterEvent(event, None)) - { - // Discard intermediary (dead key) events for character input - break; - } - - const int count = XwcLookupString(window->x11.ic, - &event->xkey, - buffer, sizeof(buffer), - NULL, &status); - - for (i = 0; i < count; i++) - _glfwInputChar(window, buffer[i], mods, plain); - } - else - { - // Translate keys to characters with fallback lookup table - - KeySym keysym; - XLookupString(&event->xkey, NULL, 0, &keysym, NULL); - - const long character = _glfwKeySym2Unicode(keysym); - if (character != -1) - _glfwInputChar(window, character, mods, plain); - } + if (character != -1) + _glfwInputChar(window, character); break; } @@ -899,37 +528,6 @@ static void processEvent(XEvent *event) const int key = translateKey(event->xkey.keycode); const int mods = translateState(event->xkey.state); - if (!_glfw.x11.xkb.detectable) - { - // HACK: Key repeat events will arrive as KeyRelease/KeyPress - // pairs with similar or identical time stamps - // The key repeat logic in _glfwInputKey expectes only key - // presses to repeat, so detect and discard release events - if (XEventsQueued(_glfw.x11.display, QueuedAfterReading)) - { - XEvent nextEvent; - XPeekEvent(_glfw.x11.display, &nextEvent); - - if (nextEvent.type == KeyPress && - nextEvent.xkey.window == event->xkey.window && - nextEvent.xkey.keycode == event->xkey.keycode) - { - // HACK: Repeat events sometimes leak through due to - // some sort of time drift, so add an epsilon - // Toshiyuki Takahashi can press a button 16 times - // per second so it's fairly safe to assume that - // no human is pressing the key 50 times per - // second (value is ms) - if ((nextEvent.xkey.time - event->xkey.time) < 20) - { - // This is very likely a server-generated key repeat - // event, so ignore it - break; - } - } - } - } - _glfwInputKey(window, key, event->xkey.keycode, GLFW_RELEASE, mods); break; } @@ -951,19 +549,9 @@ static void processEvent(XEvent *event) else if (event->xbutton.button == Button5) _glfwInputScroll(window, 0.0, -1.0); else if (event->xbutton.button == Button6) - _glfwInputScroll(window, 1.0, 0.0); - else if (event->xbutton.button == Button7) _glfwInputScroll(window, -1.0, 0.0); - - else - { - // Additional buttons after 7 are treated as regular buttons - // We subtract 4 to fill the gap left by scroll input above - _glfwInputMouseClick(window, - event->xbutton.button - 4, - GLFW_PRESS, - mods); - } + else if (event->xbutton.button == Button7) + _glfwInputScroll(window, 1.0, 0.0); break; } @@ -993,26 +581,23 @@ static void processEvent(XEvent *event) GLFW_RELEASE, mods); } - else if (event->xbutton.button > Button7) - { - // Additional buttons after 7 are treated as regular buttons - // We subtract 4 to fill the gap left by scroll input above - _glfwInputMouseClick(window, - event->xbutton.button - 4, - GLFW_RELEASE, - mods); - } break; } case EnterNotify: { + if (window->cursorMode == GLFW_CURSOR_HIDDEN) + hideCursor(window); + _glfwInputCursorEnter(window, GL_TRUE); break; } case LeaveNotify: { + if (window->cursorMode == GLFW_CURSOR_HIDDEN) + showCursor(window); + _glfwInputCursorEnter(window, GL_FALSE); break; } @@ -1083,122 +668,25 @@ static void processEvent(XEvent *event) { // Custom client message, probably from the window manager - if (event->xclient.message_type == None) - break; - - if (event->xclient.message_type == _glfw.x11.WM_PROTOCOLS) + if ((Atom) event->xclient.data.l[0] == _glfw.x11.WM_DELETE_WINDOW) { - if (_glfw.x11.WM_DELETE_WINDOW && - (Atom) event->xclient.data.l[0] == _glfw.x11.WM_DELETE_WINDOW) - { - // The window manager was asked to close the window, for example by - // the user pressing a 'close' window decoration button + // The window manager was asked to close the window, for example by + // the user pressing a 'close' window decoration button - _glfwInputWindowCloseRequest(window); - } - else if (_glfw.x11.NET_WM_PING && - (Atom) event->xclient.data.l[0] == _glfw.x11.NET_WM_PING) - { - // The window manager is pinging the application to ensure it's - // still responding to events - - event->xclient.window = _glfw.x11.root; - XSendEvent(_glfw.x11.display, - event->xclient.window, - False, - SubstructureNotifyMask | SubstructureRedirectMask, - event); - } + _glfwInputWindowCloseRequest(window); } - else if (event->xclient.message_type == _glfw.x11.XdndEnter) + else if (_glfw.x11.NET_WM_PING != None && + (Atom) event->xclient.data.l[0] == _glfw.x11.NET_WM_PING) { - // A drag operation has entered the window - // TODO: Check if UTF-8 string is supported by the source - } - else if (event->xclient.message_type == _glfw.x11.XdndDrop) - { - // The drag operation has finished dropping on - // the window, ask to convert it to a UTF-8 string - _glfw.x11.xdnd.source = event->xclient.data.l[0]; - XConvertSelection(_glfw.x11.display, - _glfw.x11.XdndSelection, - _glfw.x11.UTF8_STRING, - _glfw.x11.XdndSelection, - window->x11.handle, CurrentTime); - } - else if (event->xclient.message_type == _glfw.x11.XdndPosition) - { - // The drag operation has moved over the window - const int absX = (event->xclient.data.l[2] >> 16) & 0xFFFF; - const int absY = (event->xclient.data.l[2]) & 0xFFFF; - int x, y; + // The window manager is pinging the application to ensure it's + // still responding to events - _glfwPlatformGetWindowPos(window, &x, &y); - _glfwInputCursorMotion(window, absX - x, absY - y); - - // Reply that we are ready to copy the dragged data - XEvent reply; - memset(&reply, 0, sizeof(reply)); - - reply.type = ClientMessage; - reply.xclient.window = event->xclient.data.l[0]; - reply.xclient.message_type = _glfw.x11.XdndStatus; - reply.xclient.format = 32; - reply.xclient.data.l[0] = window->x11.handle; - reply.xclient.data.l[1] = 1; // Always accept the dnd with no rectangle - reply.xclient.data.l[2] = 0; // Specify an empty rectangle - reply.xclient.data.l[3] = 0; - reply.xclient.data.l[4] = _glfw.x11.XdndActionCopy; - - XSendEvent(_glfw.x11.display, event->xclient.data.l[0], - False, NoEventMask, &reply); - XFlush(_glfw.x11.display); - } - - break; - } - - case SelectionNotify: - { - if (event->xselection.property) - { - // The converted data from the drag operation has arrived - char* data; - const int result = - _glfwGetWindowProperty(event->xselection.requestor, - event->xselection.property, - event->xselection.target, - (unsigned char**) &data); - - if (result) - { - int i, count; - char** names = parseUriList(data, &count); - - _glfwInputDrop(window, count, (const char**) names); - - for (i = 0; i < count; i++) - free(names[i]); - free(names); - } - - XFree(data); - - XEvent reply; - memset(&reply, 0, sizeof(reply)); - - reply.type = ClientMessage; - reply.xclient.window = _glfw.x11.xdnd.source; - reply.xclient.message_type = _glfw.x11.XdndFinished; - reply.xclient.format = 32; - reply.xclient.data.l[0] = window->x11.handle; - reply.xclient.data.l[1] = result; - reply.xclient.data.l[2] = _glfw.x11.XdndActionCopy; - - // Reply that all is well - XSendEvent(_glfw.x11.display, _glfw.x11.xdnd.source, - False, NoEventMask, &reply); - XFlush(_glfw.x11.display); + event->xclient.window = _glfw.x11.root; + XSendEvent(_glfw.x11.display, + event->xclient.window, + False, + SubstructureNotifyMask | SubstructureRedirectMask, + event); } break; @@ -1218,26 +706,20 @@ static void processEvent(XEvent *event) case FocusIn: { - if (event->xfocus.mode == NotifyNormal) - { - _glfwInputWindowFocus(window, GL_TRUE); + _glfwInputWindowFocus(window, GL_TRUE); - if (window->cursorMode == GLFW_CURSOR_DISABLED) - disableCursor(window); - } + if (window->cursorMode == GLFW_CURSOR_DISABLED) + captureCursor(window); break; } case FocusOut: { - if (event->xfocus.mode == NotifyNormal) - { - _glfwInputWindowFocus(window, GL_FALSE); + _glfwInputWindowFocus(window, GL_FALSE); - if (window->cursorMode == GLFW_CURSOR_DISABLED) - restoreCursor(window); - } + if (window->cursorMode == GLFW_CURSOR_DISABLED) + showCursor(window); break; } @@ -1277,13 +759,13 @@ static void processEvent(XEvent *event) case SelectionClear: { - handleSelectionClear(event); + _glfwHandleSelectionClear(event); break; } case SelectionRequest: { - handleSelectionRequest(event); + _glfwHandleSelectionRequest(event); break; } @@ -1299,7 +781,7 @@ static void processEvent(XEvent *event) { XIDeviceEvent* data = (XIDeviceEvent*) event->xcookie.data; - window = findWindowByHandle(data->event); + window = _glfwFindWindowByHandle(data->event); if (window) { if (data->event_x != window->x11.warpPosX || @@ -1357,6 +839,23 @@ static void processEvent(XEvent *event) ////// GLFW internal API ////// ////////////////////////////////////////////////////////////////////////// +// Return the GLFW window corresponding to the specified X11 window +// +_GLFWwindow* _glfwFindWindowByHandle(Window handle) +{ + _GLFWwindow* window; + + if (XFindContext(_glfw.x11.display, + handle, + _glfw.x11.context, + (XPointer*) &window) != 0) + { + return NULL; + } + + return window; +} + // Retrieve a single window property of the specified type // Inspired by fghGetWindowProperty from freeglut // @@ -1382,7 +881,7 @@ unsigned long _glfwGetWindowProperty(Window window, &bytesAfter, value); - if (type != AnyPropertyType && actualType != type) + if (actualType != type) return 0; return itemCount; @@ -1395,10 +894,9 @@ unsigned long _glfwGetWindowProperty(Window window, int _glfwPlatformCreateWindow(_GLFWwindow* window, const _GLFWwndconfig* wndconfig, - const _GLFWctxconfig* ctxconfig, const _GLFWfbconfig* fbconfig) { - if (!_glfwCreateContext(window, ctxconfig, fbconfig)) + if (!_glfwCreateContext(window, wndconfig, fbconfig)) return GL_FALSE; if (!createWindow(window, wndconfig)) @@ -1418,12 +916,6 @@ void _glfwPlatformDestroyWindow(_GLFWwindow* window) if (window->monitor) leaveFullscreenMode(window); - if (window->x11.ic) - { - XDestroyIC(window->x11.ic); - window->x11.ic = NULL; - } - _glfwDestroyContext(window); if (window->x11.handle) @@ -1431,7 +923,7 @@ void _glfwPlatformDestroyWindow(_GLFWwindow* window) if (window->x11.handle == XGetSelectionOwner(_glfw.x11.display, _glfw.x11.CLIPBOARD)) { - pushSelectionToManager(window); + _glfwPushSelectionToManager(window); } XDeleteContext(_glfw.x11.display, window->x11.handle, _glfw.x11.context); @@ -1445,8 +937,6 @@ void _glfwPlatformDestroyWindow(_GLFWwindow* window) XFreeColormap(_glfw.x11.display, window->x11.colormap); window->x11.colormap = (Colormap) 0; } - - XFlush(_glfw.x11.display); } void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title) @@ -1467,7 +957,7 @@ void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title) NULL, NULL, NULL); #endif - if (_glfw.x11.NET_WM_NAME) + if (_glfw.x11.NET_WM_NAME != None) { XChangeProperty(_glfw.x11.display, window->x11.handle, _glfw.x11.NET_WM_NAME, _glfw.x11.UTF8_STRING, 8, @@ -1475,15 +965,13 @@ void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title) (unsigned char*) title, strlen(title)); } - if (_glfw.x11.NET_WM_ICON_NAME) + if (_glfw.x11.NET_WM_ICON_NAME != None) { XChangeProperty(_glfw.x11.display, window->x11.handle, _glfw.x11.NET_WM_ICON_NAME, _glfw.x11.UTF8_STRING, 8, PropModeReplace, (unsigned char*) title, strlen(title)); } - - XFlush(_glfw.x11.display); } void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos) @@ -1494,9 +982,10 @@ void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos) XTranslateCoordinates(_glfw.x11.display, window->x11.handle, _glfw.x11.root, 0, 0, &x, &y, &child); - if (child) + if (child != None) { int left, top; + XTranslateCoordinates(_glfw.x11.display, window->x11.handle, child, 0, 0, &left, &top, &child); @@ -1568,48 +1057,16 @@ void _glfwPlatformGetFramebufferSize(_GLFWwindow* window, int* width, int* heigh _glfwPlatformGetWindowSize(window, width, height); } -void _glfwPlatformGetWindowFrameSize(_GLFWwindow* window, - int* left, int* top, - int* right, int* bottom) -{ - long* extents = NULL; - - if (_glfw.x11.NET_FRAME_EXTENTS == None) - return; - - if (_glfwGetWindowProperty(window->x11.handle, - _glfw.x11.NET_FRAME_EXTENTS, - XA_CARDINAL, - (unsigned char**) &extents) == 4) - { - if (left) - *left = extents[0]; - if (top) - *top = extents[2]; - if (right) - *right = extents[1]; - if (bottom) - *bottom = extents[3]; - } - - if (extents) - XFree(extents); -} - void _glfwPlatformIconifyWindow(_GLFWwindow* window) { if (window->x11.overrideRedirect) { // Override-redirect windows cannot be iconified or restored, as those // tasks are performed by the window manager - _glfwInputError(GLFW_API_UNAVAILABLE, - "X11: Iconification of full screen windows requires " - "a WM that supports EWMH"); return; } XIconifyWindow(_glfw.x11.display, window->x11.handle, _glfw.x11.screen); - XFlush(_glfw.x11.display); } void _glfwPlatformRestoreWindow(_GLFWwindow* window) @@ -1618,14 +1075,10 @@ void _glfwPlatformRestoreWindow(_GLFWwindow* window) { // Override-redirect windows cannot be iconified or restored, as those // tasks are performed by the window manager - _glfwInputError(GLFW_API_UNAVAILABLE, - "X11: Iconification of full screen windows requires " - "a WM that supports EWMH"); return; } XMapWindow(_glfw.x11.display, window->x11.handle); - XFlush(_glfw.x11.display); } void _glfwPlatformShowWindow(_GLFWwindow* window) @@ -1634,12 +1087,6 @@ void _glfwPlatformShowWindow(_GLFWwindow* window) XFlush(_glfw.x11.display); } -void _glfwPlatformUnhideWindow(_GLFWwindow* window) -{ - XMapWindow(_glfw.x11.display, window->x11.handle); - XFlush(_glfw.x11.display); -} - void _glfwPlatformHideWindow(_GLFWwindow* window) { XUnmapWindow(_glfw.x11.display, window->x11.handle); @@ -1669,8 +1116,10 @@ void _glfwPlatformWaitEvents(void) { if (!XPending(_glfw.x11.display)) { + int fd; fd_set fds; - const int fd = ConnectionNumber(_glfw.x11.display); + + fd = ConnectionNumber(_glfw.x11.display); FD_ZERO(&fds); FD_SET(fd, &fds); @@ -1685,21 +1134,6 @@ void _glfwPlatformWaitEvents(void) _glfwPlatformPollEvents(); } -void _glfwPlatformPostEmptyEvent(void) -{ - XEvent event; - _GLFWwindow* window = _glfw.windowListHead; - - memset(&event, 0, sizeof(event)); - event.type = ClientMessage; - event.xclient.window = window->x11.handle; - event.xclient.format = 32; // Data is 32-bit longs - event.xclient.message_type = _glfw.x11._NULL; - - XSendEvent(_glfw.x11.display, window->x11.handle, False, 0, &event); - XFlush(_glfw.x11.display); -} - void _glfwPlatformSetCursorPos(_GLFWwindow* window, double x, double y) { // Store the new position so it can be recognized later @@ -1710,134 +1144,22 @@ void _glfwPlatformSetCursorPos(_GLFWwindow* window, double x, double y) 0,0,0,0, (int) x, (int) y); } -void _glfwPlatformApplyCursorMode(_GLFWwindow* window) +void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode) { - switch (window->cursorMode) + switch (mode) { case GLFW_CURSOR_NORMAL: - restoreCursor(window); + showCursor(window); break; case GLFW_CURSOR_HIDDEN: hideCursor(window); break; case GLFW_CURSOR_DISABLED: - disableCursor(window); + captureCursor(window); break; } } -int _glfwPlatformCreateCursor(_GLFWcursor* cursor, - const GLFWimage* image, - int xhot, int yhot) -{ - cursor->x11.handle = _glfwCreateCursor(image, xhot, yhot); - if (cursor->x11.handle == None) - return GL_FALSE; - - return GL_TRUE; -} - -void _glfwPlatformDestroyCursor(_GLFWcursor* cursor) -{ - if (cursor->x11.handle) - XFreeCursor(_glfw.x11.display, cursor->x11.handle); -} - -void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor) -{ - if (window->cursorMode == GLFW_CURSOR_NORMAL) - { - if (cursor) - XDefineCursor(_glfw.x11.display, window->x11.handle, cursor->x11.handle); - else - XUndefineCursor(_glfw.x11.display, window->x11.handle); - - XFlush(_glfw.x11.display); - } -} - -void _glfwPlatformSetClipboardString(_GLFWwindow* window, const char* string) -{ - free(_glfw.x11.clipboardString); - _glfw.x11.clipboardString = strdup(string); - - XSetSelectionOwner(_glfw.x11.display, - _glfw.x11.CLIPBOARD, - window->x11.handle, CurrentTime); - - if (XGetSelectionOwner(_glfw.x11.display, _glfw.x11.CLIPBOARD) != - window->x11.handle) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "X11: Failed to become owner of the clipboard selection"); - } -} - -const char* _glfwPlatformGetClipboardString(_GLFWwindow* window) -{ - size_t i; - const Atom formats[] = { _glfw.x11.UTF8_STRING, - _glfw.x11.COMPOUND_STRING, - XA_STRING }; - const size_t formatCount = sizeof(formats) / sizeof(formats[0]); - - if (findWindowByHandle(XGetSelectionOwner(_glfw.x11.display, - _glfw.x11.CLIPBOARD))) - { - // Instead of doing a large number of X round-trips just to put this - // string into a window property and then read it back, just return it - return _glfw.x11.clipboardString; - } - - free(_glfw.x11.clipboardString); - _glfw.x11.clipboardString = NULL; - - for (i = 0; i < formatCount; i++) - { - char* data; - XEvent event; - - XConvertSelection(_glfw.x11.display, - _glfw.x11.CLIPBOARD, - formats[i], - _glfw.x11.GLFW_SELECTION, - window->x11.handle, CurrentTime); - - // XCheckTypedEvent is used instead of XIfEvent in order not to lock - // other threads out from the display during the entire wait period - while (!XCheckTypedEvent(_glfw.x11.display, SelectionNotify, &event)) - ; - - if (event.xselection.property == None) - continue; - - if (_glfwGetWindowProperty(event.xselection.requestor, - event.xselection.property, - event.xselection.target, - (unsigned char**) &data)) - { - _glfw.x11.clipboardString = strdup(data); - } - - XFree(data); - - XDeleteProperty(_glfw.x11.display, - event.xselection.requestor, - event.xselection.property); - - if (_glfw.x11.clipboardString) - break; - } - - if (_glfw.x11.clipboardString == NULL) - { - _glfwInputError(GLFW_FORMAT_UNAVAILABLE, - "X11: Failed to convert selection to string"); - } - - return _glfw.x11.clipboardString; -} - ////////////////////////////////////////////////////////////////////////// ////// GLFW native API ////// diff --git a/extern/glfw/src/xkb_unicode.h b/extern/glfw/src/xkb_unicode.h deleted file mode 100644 index 9772901..0000000 --- a/extern/glfw/src/xkb_unicode.h +++ /dev/null @@ -1,33 +0,0 @@ -//======================================================================== -// GLFW 3.1 Linux - www.glfw.org -//------------------------------------------------------------------------ -// Copyright (c) 2014 Jonas Ådahl -// -// 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 _xkb_unicode_h_ -#define _xkb_unicode_h_ - - -long _glfwKeySym2Unicode(unsigned int keysym); - -#endif // _xkb_unicode_h_ diff --git a/extern/glfw/tests/CMakeLists.txt b/extern/glfw/tests/CMakeLists.txt deleted file mode 100644 index c327eb2..0000000 --- a/extern/glfw/tests/CMakeLists.txt +++ /dev/null @@ -1,78 +0,0 @@ - -link_libraries(glfw "${OPENGL_glu_LIBRARY}") - -if (BUILD_SHARED_LIBS) - add_definitions(-DGLFW_DLL) - link_libraries("${OPENGL_gl_LIBRARY}" "${MATH_LIBRARY}") -else() - link_libraries(${glfw_LIBRARIES}) -endif() - -include_directories("${GLFW_SOURCE_DIR}/include" - "${GLFW_SOURCE_DIR}/deps") - -if ("${OPENGL_INCLUDE_DIR}") - include_directories("${OPENGL_INCLUDE_DIR}") -endif() - -set(GETOPT "${GLFW_SOURCE_DIR}/deps/getopt.h" - "${GLFW_SOURCE_DIR}/deps/getopt.c") -set(TINYCTHREAD "${GLFW_SOURCE_DIR}/deps/tinycthread.h" - "${GLFW_SOURCE_DIR}/deps/tinycthread.c") - -add_executable(clipboard clipboard.c ${GETOPT}) -add_executable(defaults defaults.c) -add_executable(events events.c ${GETOPT}) -add_executable(fsaa fsaa.c ${GETOPT}) -add_executable(gamma gamma.c ${GETOPT}) -add_executable(glfwinfo glfwinfo.c ${GETOPT}) -add_executable(iconify iconify.c ${GETOPT}) -add_executable(joysticks joysticks.c) -add_executable(modes modes.c ${GETOPT}) -add_executable(peter peter.c) -add_executable(reopen reopen.c) -add_executable(cursor cursor.c) - -add_executable(cursoranim WIN32 MACOSX_BUNDLE cursoranim.c) -set_target_properties(cursoranim PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Cursor animation") - -add_executable(accuracy WIN32 MACOSX_BUNDLE accuracy.c) -set_target_properties(accuracy PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Accuracy") - -add_executable(empty WIN32 MACOSX_BUNDLE empty.c ${TINYCTHREAD}) -set_target_properties(empty PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Empty Event") - -add_executable(sharing WIN32 MACOSX_BUNDLE sharing.c) -set_target_properties(sharing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Sharing") - -add_executable(tearing WIN32 MACOSX_BUNDLE tearing.c) -set_target_properties(tearing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Tearing") - -add_executable(threads WIN32 MACOSX_BUNDLE threads.c ${TINYCTHREAD}) -set_target_properties(threads PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Threads") - -add_executable(title WIN32 MACOSX_BUNDLE title.c) -set_target_properties(title PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Title") - -add_executable(windows WIN32 MACOSX_BUNDLE windows.c) -set_target_properties(windows PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Windows") - -target_link_libraries(empty "${CMAKE_THREAD_LIBS_INIT}" "${RT_LIBRARY}") -target_link_libraries(threads "${CMAKE_THREAD_LIBS_INIT}" "${RT_LIBRARY}") - -set(WINDOWS_BINARIES accuracy empty sharing tearing threads title windows cursoranim) -set(CONSOLE_BINARIES clipboard defaults events fsaa gamma glfwinfo - iconify joysticks modes peter reopen cursor) - -if (MSVC) - # Tell MSVC to use main instead of WinMain for Windows subsystem executables - set_target_properties(${WINDOWS_BINARIES} ${CONSOLE_BINARIES} PROPERTIES - LINK_FLAGS "/ENTRY:mainCRTStartup") -endif() - -if (APPLE) - set_target_properties(${WINDOWS_BINARIES} ${CONSOLE_BINARIES} PROPERTIES - MACOSX_BUNDLE_SHORT_VERSION_STRING ${GLFW_VERSION} - MACOSX_BUNDLE_LONG_VERSION_STRING ${GLFW_VERSION_FULL}) -endif() - diff --git a/extern/glfw/tests/accuracy.c b/extern/glfw/tests/accuracy.c deleted file mode 100644 index 6a63c88..0000000 --- a/extern/glfw/tests/accuracy.c +++ /dev/null @@ -1,128 +0,0 @@ -//======================================================================== -// Mouse cursor accuracy test -// Copyright (c) Camilla Berglund -// -// 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. -// -//======================================================================== -// -// This test came about as the result of bug #1867804 -// -// No sign of said bug has so far been detected -// -//======================================================================== - -#include - -#include -#include - -static double cursor_x = 0.0, cursor_y = 0.0; -static int window_width = 640, window_height = 480; -static int swap_interval = 1; - -static void set_swap_interval(GLFWwindow* window, int interval) -{ - char title[256]; - - swap_interval = interval; - glfwSwapInterval(swap_interval); - - sprintf(title, "Cursor Inaccuracy Detector (interval %i)", swap_interval); - - glfwSetWindowTitle(window, title); -} - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - window_width = width; - window_height = height; - - glViewport(0, 0, window_width, window_height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(0.f, window_width, 0.f, window_height, 0.f, 1.f); -} - -static void cursor_position_callback(GLFWwindow* window, double x, double y) -{ - cursor_x = x; - cursor_y = y; -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key == GLFW_KEY_SPACE && action == GLFW_PRESS) - set_swap_interval(window, 1 - swap_interval); -} - -int main(void) -{ - GLFWwindow* window; - int width, height; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - window = glfwCreateWindow(window_width, window_height, "", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwSetCursorPosCallback(window, cursor_position_callback); - glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); - glfwSetKeyCallback(window, key_callback); - - glfwMakeContextCurrent(window); - - glfwGetFramebufferSize(window, &width, &height); - framebuffer_size_callback(window, width, height); - - set_swap_interval(window, swap_interval); - - while (!glfwWindowShouldClose(window)) - { - glClear(GL_COLOR_BUFFER_BIT); - - glBegin(GL_LINES); - glVertex2f(0.f, (GLfloat) (window_height - cursor_y)); - glVertex2f((GLfloat) window_width, (GLfloat) (window_height - cursor_y)); - glVertex2f((GLfloat) cursor_x, 0.f); - glVertex2f((GLfloat) cursor_x, (GLfloat) window_height); - glEnd(); - - glfwSwapBuffers(window); - glfwPollEvents(); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/extern/glfw/tests/clipboard.c b/extern/glfw/tests/clipboard.c deleted file mode 100644 index 4342284..0000000 --- a/extern/glfw/tests/clipboard.c +++ /dev/null @@ -1,149 +0,0 @@ -//======================================================================== -// Clipboard test program -// Copyright (c) Camilla Berglund -// -// 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. -// -//======================================================================== -// -// This program is used to test the clipboard functionality. -// -//======================================================================== - -#include - -#include -#include - -#include "getopt.h" - -static void usage(void) -{ - printf("Usage: clipboard [-h]\n"); -} - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_ESCAPE: - glfwSetWindowShouldClose(window, GL_TRUE); - break; - - case GLFW_KEY_V: - if (mods == GLFW_MOD_CONTROL) - { - const char* string; - - string = glfwGetClipboardString(window); - if (string) - printf("Clipboard contains \"%s\"\n", string); - else - printf("Clipboard does not contain a string\n"); - } - break; - - case GLFW_KEY_C: - if (mods == GLFW_MOD_CONTROL) - { - const char* string = "Hello GLFW World!"; - glfwSetClipboardString(window, string); - printf("Setting clipboard to \"%s\"\n", string); - } - break; - } -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - glViewport(0, 0, width, height); -} - -int main(int argc, char** argv) -{ - int ch; - GLFWwindow* window; - - while ((ch = getopt(argc, argv, "h")) != -1) - { - switch (ch) - { - case 'h': - usage(); - exit(EXIT_SUCCESS); - - default: - usage(); - exit(EXIT_FAILURE); - } - } - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - { - fprintf(stderr, "Failed to initialize GLFW\n"); - exit(EXIT_FAILURE); - } - - window = glfwCreateWindow(200, 200, "Clipboard Test", NULL, NULL); - if (!window) - { - glfwTerminate(); - - fprintf(stderr, "Failed to open GLFW window\n"); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - glfwSetKeyCallback(window, key_callback); - glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); - - glMatrixMode(GL_PROJECTION); - glOrtho(-1.f, 1.f, -1.f, 1.f, -1.f, 1.f); - glMatrixMode(GL_MODELVIEW); - - glClearColor(0.5f, 0.5f, 0.5f, 0); - - while (!glfwWindowShouldClose(window)) - { - glClear(GL_COLOR_BUFFER_BIT); - - glColor3f(0.8f, 0.2f, 0.4f); - glRectf(-0.5f, -0.5f, 0.5f, 0.5f); - - glfwSwapBuffers(window); - glfwWaitEvents(); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/extern/glfw/tests/cursor.c b/extern/glfw/tests/cursor.c deleted file mode 100644 index 9b89926..0000000 --- a/extern/glfw/tests/cursor.c +++ /dev/null @@ -1,289 +0,0 @@ -//======================================================================== -// Cursor & input mode tests -// Copyright (c) Camilla Berglund -// -// 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. -// -//======================================================================== -// -// System cursors and input modes tests. -// -//======================================================================== - -#define GLFW_INCLUDE_GLU -#include - -#include -#include - -static int W = 640; -static int H = 480; -static int delay = 0; - -static GLFWwindow* windows[2] = { NULL, NULL }; -static GLFWwindow* activeWindow = NULL; -static GLFWcursor* cursor = NULL; - -static struct -{ - int key; - double time; -} commands[] = { - {GLFW_KEY_H, 0}, - {GLFW_KEY_C, 0}, - {GLFW_KEY_D, 0}, - {GLFW_KEY_S, 0}, - {GLFW_KEY_N, 0}, - {GLFW_KEY_1, 0}, - {GLFW_KEY_2, 0}, - {GLFW_KEY_3, 0} -}; - -static int CommandCount = sizeof(commands) / sizeof(commands[0]); - -static struct -{ - int w, h; -} cursorSize[] = { - { 24, 24 }, { 13, 37 }, { 5, 53 }, { 43, 64 }, { 300, 300 } -}; - -static int SizeCount = sizeof(cursorSize) / sizeof(cursorSize[0]); -static int currentSize = 0; - -static void command_callback(int key) -{ - switch (key) - { - case GLFW_KEY_H: - { - printf("H: show this help\n"); - printf("C: call glfwCreateCursor()\n"); - printf("D: call glfwDestroyCursor()\n"); - printf("S: call glfwSetCursor()\n"); - printf("N: call glfwSetCursor() with NULL\n"); - printf("1: set GLFW_CURSOR_NORMAL\n"); - printf("2: set GLFW_CURSOR_HIDDEN\n"); - printf("3: set GLFW_CURSOR_DISABLED\n"); - printf("T: enable 3s delay for all previous commands\n"); - } - break; - - case GLFW_KEY_C: - { - int x, y; - GLFWimage image; - unsigned char* pixels; - - if (cursor) - break; - - image.width = cursorSize[currentSize].w; - image.height = cursorSize[currentSize].h; - - pixels = malloc(4 * image.width * image.height); - image.pixels = pixels; - - for (y = 0; y < image.height; y++) - { - for (x = 0; x < image.width; x++) - { - *pixels++ = 0xff; - *pixels++ = 0; - *pixels++ = 255 * y / image.height; - *pixels++ = 255 * x / image.width; - } - } - - cursor = glfwCreateCursor(&image, image.width / 2, image.height / 2); - currentSize = (currentSize + 1) % SizeCount; - free(image.pixels); - break; - } - - case GLFW_KEY_D: - { - if (cursor != NULL) - { - glfwDestroyCursor(cursor); - cursor = NULL; - } - - break; - } - - case GLFW_KEY_S: - { - if (cursor != NULL) - glfwSetCursor(activeWindow, cursor); - else - printf("The cursor is not created\n"); - - break; - } - - case GLFW_KEY_N: - glfwSetCursor(activeWindow, NULL); - break; - - case GLFW_KEY_1: - glfwSetInputMode(activeWindow, GLFW_CURSOR, GLFW_CURSOR_NORMAL); - break; - - case GLFW_KEY_2: - glfwSetInputMode(activeWindow, GLFW_CURSOR, GLFW_CURSOR_HIDDEN); - break; - - case GLFW_KEY_3: - glfwSetInputMode(activeWindow, GLFW_CURSOR, GLFW_CURSOR_DISABLED); - break; - } -} - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - W = width; - H = height; - - glViewport(0, 0, W, H); -} - -static void refresh_callback(GLFWwindow* window) -{ - glfwMakeContextCurrent(window); - glClearColor(0.0f, window == activeWindow ? 0.8f : 0.0f, 0.0f, 1.0f); - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(window); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_ESCAPE: - glfwSetWindowShouldClose(window, GL_TRUE); - break; - - case GLFW_KEY_T: - delay = !delay; - printf("Delay %s.\n", delay ? "enabled" : "disabled"); - break; - - default: - { - if (delay) - { - int i = 0; - - while (i < CommandCount && commands[i].key != key) - i++; - - if (i < CommandCount) - commands[i].time = glfwGetTime(); - } - else - { - command_callback(key); - } - } - break; - } -} - -static void focus_callback(GLFWwindow* window, int focused) -{ - if (focused) - { - activeWindow = window; - refresh_callback(windows[0]); - refresh_callback(windows[1]); - } -} - -int main(void) -{ - int i; - GLboolean running = GL_TRUE; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - for (i = 0; i < 2; i++) - { - windows[i] = glfwCreateWindow(W, H, "Cursor testing", NULL, NULL); - - if (!windows[i]) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwSetWindowPos(windows[i], 100 + (i & 1) * (W + 50), 100); - - glfwSetWindowRefreshCallback(windows[i], refresh_callback); - glfwSetFramebufferSizeCallback(windows[i], framebuffer_size_callback); - glfwSetKeyCallback(windows[i], key_callback); - glfwSetWindowFocusCallback(windows[i], focus_callback); - - glfwMakeContextCurrent(windows[i]); - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(windows[i]); - } - - activeWindow = windows[0]; - - key_callback(NULL, GLFW_KEY_H, 0, GLFW_PRESS, 0); - - while (running) - { - if (delay) - { - int i; - double t = glfwGetTime(); - - for (i = 0; i < CommandCount; i++) - { - if (commands[i].time != 0 && t - commands[i].time >= 3.0) - { - command_callback(commands[i].key); - commands[i].time = 0; - } - } - } - - running = !(glfwWindowShouldClose(windows[0]) || glfwWindowShouldClose(windows[1])); - - glfwPollEvents(); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/extern/glfw/tests/cursoranim.c b/extern/glfw/tests/cursoranim.c deleted file mode 100644 index 39a229c..0000000 --- a/extern/glfw/tests/cursoranim.c +++ /dev/null @@ -1,135 +0,0 @@ -//======================================================================== -// Cursor animation -// Copyright (c) Camilla Berglund -// -// 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. -// -//======================================================================== -// -// Cursor animation test. -// -//======================================================================== - -#include - -#include -#include - -#ifdef min - #undef min -#endif -#ifdef max - #undef max -#endif - -#define SIZE 64 // cursor size (width & height) -#define N 60 // number of frames - -unsigned char buffer[4 * SIZE * SIZE]; - -static float max(float a, float b) { return a > b ? a : b; } -static float min(float a, float b) { return a < b ? a : b; } - -static float star(int x, int y, float t) -{ - float c = SIZE / 2.0f; - - float i = (0.25f * (float)sin(2.0f * 3.1415926f * t) + 0.75f); - float k = SIZE * 0.046875f * i; - - float dist = (float)sqrt((x - c) * (x - c) + (y - c) * (y - c)); - - float salpha = 1.0f - dist / c; - float xalpha = (float)x == c ? c : k / (float)fabs(x - c); - float yalpha = (float)y == c ? c : k / (float)fabs(y - c); - - return max(0.0f, min(1.0f, i * salpha * 0.2f + salpha * xalpha * yalpha)); -} - -static GLFWcursor* load_frame(float t) -{ - int i = 0, x, y; - const GLFWimage image = { SIZE, SIZE, buffer }; - - for (y = 0; y < image.width; y++) - { - for (x = 0; x < image.height; x++) - { - buffer[i++] = 255; - buffer[i++] = 255; - buffer[i++] = 255; - buffer[i++] = (unsigned char)(255 * star(x, y, t)); - } - } - - return glfwCreateCursor(&image, image.width / 2, image.height / 2); -} - -int main(void) -{ - int i; - double t0, t1, frameTime = 0.0; - - GLFWwindow* window; - GLFWcursor* frames[N]; - - if (!glfwInit()) - exit(EXIT_FAILURE); - - window = glfwCreateWindow(640, 480, "Cursor animation", NULL, NULL); - - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - for (i = 0; i < N; i++) - frames[i] = load_frame(i / (float)N); - - i = 0; - - t0 = glfwGetTime(); - - while (!glfwWindowShouldClose(window)) - { - glClear(GL_COLOR_BUFFER_BIT); - glfwSetCursor(window, frames[i]); - glfwSwapBuffers(window); - glfwPollEvents(); - - t1 = glfwGetTime(); - frameTime += t1 - t0; - t0 = t1; - - while (frameTime > 1.0 / (double)N) - { - i = (i + 1) % N; - frameTime -= 1.0 / (double)N; - } - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/extern/glfw/tests/defaults.c b/extern/glfw/tests/defaults.c deleted file mode 100644 index 07ba5a4..0000000 --- a/extern/glfw/tests/defaults.c +++ /dev/null @@ -1,131 +0,0 @@ -//======================================================================== -// Default window/context test -// Copyright (c) Camilla Berglund -// -// 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. -// -//======================================================================== -// -// This test creates a windowed mode window with all window hints set to -// default values and then reports the actual attributes of the created -// window and context -// -//======================================================================== - -#define GLFW_INCLUDE_GLEXT -#include - -#include -#include - -typedef struct -{ - int attrib; - const char* ext; - const char* name; -} AttribGL; - -typedef struct -{ - int attrib; - const char* name; -} AttribGLFW; - -static AttribGL gl_attribs[] = -{ - { GL_RED_BITS, NULL, "red bits" }, - { GL_GREEN_BITS, NULL, "green bits" }, - { GL_BLUE_BITS, NULL, "blue bits" }, - { GL_ALPHA_BITS, NULL, "alpha bits" }, - { GL_DEPTH_BITS, NULL, "depth bits" }, - { GL_STENCIL_BITS, NULL, "stencil bits" }, - { GL_STEREO, NULL, "stereo" }, - { GL_SAMPLES_ARB, "GL_ARB_multisample", "FSAA samples" }, - { 0, NULL, NULL } -}; - -static AttribGLFW glfw_attribs[] = -{ - { GLFW_CONTEXT_VERSION_MAJOR, "Context version major" }, - { GLFW_CONTEXT_VERSION_MINOR, "Context version minor" }, - { GLFW_OPENGL_FORWARD_COMPAT, "OpenGL forward compatible" }, - { GLFW_OPENGL_DEBUG_CONTEXT, "OpenGL debug context" }, - { GLFW_OPENGL_PROFILE, "OpenGL profile" }, - { 0, NULL } -}; - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -int main(void) -{ - int i, width, height; - GLFWwindow* window; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - glfwWindowHint(GLFW_VISIBLE, GL_FALSE); - - window = glfwCreateWindow(640, 480, "Defaults", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - glfwGetFramebufferSize(window, &width, &height); - - printf("framebuffer size: %ix%i\n", width, height); - - for (i = 0; glfw_attribs[i].name; i++) - { - printf("%s: %i\n", - glfw_attribs[i].name, - glfwGetWindowAttrib(window, glfw_attribs[i].attrib)); - } - - for (i = 0; gl_attribs[i].name; i++) - { - GLint value = 0; - - if (gl_attribs[i].ext) - { - if (!glfwExtensionSupported(gl_attribs[i].ext)) - continue; - } - - glGetIntegerv(gl_attribs[i].attrib, &value); - - printf("%s: %i\n", gl_attribs[i].name, value); - } - - glfwDestroyWindow(window); - window = NULL; - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/extern/glfw/tests/empty.c b/extern/glfw/tests/empty.c deleted file mode 100644 index a4534ae..0000000 --- a/extern/glfw/tests/empty.c +++ /dev/null @@ -1,129 +0,0 @@ -//======================================================================== -// Empty event test -// Copyright (c) Camilla Berglund -// -// 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. -// -//======================================================================== -// -// This test is intended to verify that posting of empty events works -// -//======================================================================== - -#include "tinycthread.h" - -#include - -#include -#include -#include - -static volatile GLboolean running = GL_TRUE; - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static int thread_main(void* data) -{ - struct timespec time; - - while (running) - { - clock_gettime(CLOCK_REALTIME, &time); - time.tv_sec += 1; - thrd_sleep(&time, NULL); - - glfwPostEmptyEvent(); - } - - return 0; -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) - glfwSetWindowShouldClose(window, GL_TRUE); -} - -static float nrand(void) -{ - return (float) rand() / (float) RAND_MAX; -} - -int main(void) -{ - int result; - thrd_t thread; - GLFWwindow* window; - - srand((unsigned int) time(NULL)); - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - window = glfwCreateWindow(640, 480, "Empty Event Test", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - glfwSetKeyCallback(window, key_callback); - - if (thrd_create(&thread, thread_main, NULL) != thrd_success) - { - fprintf(stderr, "Failed to create secondary thread\n"); - - glfwTerminate(); - exit(EXIT_FAILURE); - } - - while (running) - { - int width, height; - float r = nrand(), g = nrand(), b = nrand(); - float l = (float) sqrt(r * r + g * g + b * b); - - glfwGetFramebufferSize(window, &width, &height); - - glViewport(0, 0, width, height); - glClearColor(r / l, g / l, b / l, 1.f); - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(window); - - glfwWaitEvents(); - - if (glfwWindowShouldClose(window)) - running = GL_FALSE; - } - - glfwHideWindow(window); - thrd_join(thread, &result); - glfwDestroyWindow(window); - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/extern/glfw/tests/events.c b/extern/glfw/tests/events.c deleted file mode 100644 index fda6816..0000000 --- a/extern/glfw/tests/events.c +++ /dev/null @@ -1,581 +0,0 @@ -//======================================================================== -// Event linter (event spewer) -// Copyright (c) Camilla Berglund -// -// 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. -// -//======================================================================== -// -// This test hooks every available callback and outputs their arguments -// -// Log messages go to stdout, error messages to stderr -// -// Every event also gets a (sequential) number to aid discussion of logs -// -//======================================================================== - -#include - -#include -#include -#include -#include -#include - -#include "getopt.h" - -// Event index -static unsigned int counter = 0; - -typedef struct -{ - GLFWwindow* window; - int number; - int closeable; -} Slot; - -static void usage(void) -{ - printf("Usage: events [-f] [-h] [-n WINDOWS]\n"); - printf("Options:\n"); - printf(" -f use full screen\n"); - printf(" -h show this help\n"); - printf(" -n the number of windows to create\n"); -} - -static const char* get_key_name(int key) -{ - switch (key) - { - // Printable keys - case GLFW_KEY_A: return "A"; - case GLFW_KEY_B: return "B"; - case GLFW_KEY_C: return "C"; - case GLFW_KEY_D: return "D"; - case GLFW_KEY_E: return "E"; - case GLFW_KEY_F: return "F"; - case GLFW_KEY_G: return "G"; - case GLFW_KEY_H: return "H"; - case GLFW_KEY_I: return "I"; - case GLFW_KEY_J: return "J"; - case GLFW_KEY_K: return "K"; - case GLFW_KEY_L: return "L"; - case GLFW_KEY_M: return "M"; - case GLFW_KEY_N: return "N"; - case GLFW_KEY_O: return "O"; - case GLFW_KEY_P: return "P"; - case GLFW_KEY_Q: return "Q"; - case GLFW_KEY_R: return "R"; - case GLFW_KEY_S: return "S"; - case GLFW_KEY_T: return "T"; - case GLFW_KEY_U: return "U"; - case GLFW_KEY_V: return "V"; - case GLFW_KEY_W: return "W"; - case GLFW_KEY_X: return "X"; - case GLFW_KEY_Y: return "Y"; - case GLFW_KEY_Z: return "Z"; - case GLFW_KEY_1: return "1"; - case GLFW_KEY_2: return "2"; - case GLFW_KEY_3: return "3"; - case GLFW_KEY_4: return "4"; - case GLFW_KEY_5: return "5"; - case GLFW_KEY_6: return "6"; - case GLFW_KEY_7: return "7"; - case GLFW_KEY_8: return "8"; - case GLFW_KEY_9: return "9"; - case GLFW_KEY_0: return "0"; - case GLFW_KEY_SPACE: return "SPACE"; - case GLFW_KEY_MINUS: return "MINUS"; - case GLFW_KEY_EQUAL: return "EQUAL"; - case GLFW_KEY_LEFT_BRACKET: return "LEFT BRACKET"; - case GLFW_KEY_RIGHT_BRACKET: return "RIGHT BRACKET"; - case GLFW_KEY_BACKSLASH: return "BACKSLASH"; - case GLFW_KEY_SEMICOLON: return "SEMICOLON"; - case GLFW_KEY_APOSTROPHE: return "APOSTROPHE"; - case GLFW_KEY_GRAVE_ACCENT: return "GRAVE ACCENT"; - case GLFW_KEY_COMMA: return "COMMA"; - case GLFW_KEY_PERIOD: return "PERIOD"; - case GLFW_KEY_SLASH: return "SLASH"; - case GLFW_KEY_WORLD_1: return "WORLD 1"; - case GLFW_KEY_WORLD_2: return "WORLD 2"; - - // Function keys - case GLFW_KEY_ESCAPE: return "ESCAPE"; - case GLFW_KEY_F1: return "F1"; - case GLFW_KEY_F2: return "F2"; - case GLFW_KEY_F3: return "F3"; - case GLFW_KEY_F4: return "F4"; - case GLFW_KEY_F5: return "F5"; - case GLFW_KEY_F6: return "F6"; - case GLFW_KEY_F7: return "F7"; - case GLFW_KEY_F8: return "F8"; - case GLFW_KEY_F9: return "F9"; - case GLFW_KEY_F10: return "F10"; - case GLFW_KEY_F11: return "F11"; - case GLFW_KEY_F12: return "F12"; - case GLFW_KEY_F13: return "F13"; - case GLFW_KEY_F14: return "F14"; - case GLFW_KEY_F15: return "F15"; - case GLFW_KEY_F16: return "F16"; - case GLFW_KEY_F17: return "F17"; - case GLFW_KEY_F18: return "F18"; - case GLFW_KEY_F19: return "F19"; - case GLFW_KEY_F20: return "F20"; - case GLFW_KEY_F21: return "F21"; - case GLFW_KEY_F22: return "F22"; - case GLFW_KEY_F23: return "F23"; - case GLFW_KEY_F24: return "F24"; - case GLFW_KEY_F25: return "F25"; - case GLFW_KEY_UP: return "UP"; - case GLFW_KEY_DOWN: return "DOWN"; - case GLFW_KEY_LEFT: return "LEFT"; - case GLFW_KEY_RIGHT: return "RIGHT"; - case GLFW_KEY_LEFT_SHIFT: return "LEFT SHIFT"; - case GLFW_KEY_RIGHT_SHIFT: return "RIGHT SHIFT"; - case GLFW_KEY_LEFT_CONTROL: return "LEFT CONTROL"; - case GLFW_KEY_RIGHT_CONTROL: return "RIGHT CONTROL"; - case GLFW_KEY_LEFT_ALT: return "LEFT ALT"; - case GLFW_KEY_RIGHT_ALT: return "RIGHT ALT"; - case GLFW_KEY_TAB: return "TAB"; - case GLFW_KEY_ENTER: return "ENTER"; - case GLFW_KEY_BACKSPACE: return "BACKSPACE"; - case GLFW_KEY_INSERT: return "INSERT"; - case GLFW_KEY_DELETE: return "DELETE"; - case GLFW_KEY_PAGE_UP: return "PAGE UP"; - case GLFW_KEY_PAGE_DOWN: return "PAGE DOWN"; - case GLFW_KEY_HOME: return "HOME"; - case GLFW_KEY_END: return "END"; - case GLFW_KEY_KP_0: return "KEYPAD 0"; - case GLFW_KEY_KP_1: return "KEYPAD 1"; - case GLFW_KEY_KP_2: return "KEYPAD 2"; - case GLFW_KEY_KP_3: return "KEYPAD 3"; - case GLFW_KEY_KP_4: return "KEYPAD 4"; - case GLFW_KEY_KP_5: return "KEYPAD 5"; - case GLFW_KEY_KP_6: return "KEYPAD 6"; - case GLFW_KEY_KP_7: return "KEYPAD 7"; - case GLFW_KEY_KP_8: return "KEYPAD 8"; - case GLFW_KEY_KP_9: return "KEYPAD 9"; - case GLFW_KEY_KP_DIVIDE: return "KEYPAD DIVIDE"; - case GLFW_KEY_KP_MULTIPLY: return "KEYPAD MULTPLY"; - case GLFW_KEY_KP_SUBTRACT: return "KEYPAD SUBTRACT"; - case GLFW_KEY_KP_ADD: return "KEYPAD ADD"; - case GLFW_KEY_KP_DECIMAL: return "KEYPAD DECIMAL"; - case GLFW_KEY_KP_EQUAL: return "KEYPAD EQUAL"; - case GLFW_KEY_KP_ENTER: return "KEYPAD ENTER"; - case GLFW_KEY_PRINT_SCREEN: return "PRINT SCREEN"; - case GLFW_KEY_NUM_LOCK: return "NUM LOCK"; - case GLFW_KEY_CAPS_LOCK: return "CAPS LOCK"; - case GLFW_KEY_SCROLL_LOCK: return "SCROLL LOCK"; - case GLFW_KEY_PAUSE: return "PAUSE"; - case GLFW_KEY_LEFT_SUPER: return "LEFT SUPER"; - case GLFW_KEY_RIGHT_SUPER: return "RIGHT SUPER"; - case GLFW_KEY_MENU: return "MENU"; - - default: return "UNKNOWN"; - } -} - -static const char* get_action_name(int action) -{ - switch (action) - { - case GLFW_PRESS: - return "pressed"; - case GLFW_RELEASE: - return "released"; - case GLFW_REPEAT: - return "repeated"; - } - - return "caused unknown action"; -} - -static const char* get_button_name(int button) -{ - switch (button) - { - case GLFW_MOUSE_BUTTON_LEFT: - return "left"; - case GLFW_MOUSE_BUTTON_RIGHT: - return "right"; - case GLFW_MOUSE_BUTTON_MIDDLE: - return "middle"; - default: - { - static char name[16]; - sprintf(name, "%i", button); - return name; - } - } -} - -static const char* get_mods_name(int mods) -{ - static char name[512]; - - if (mods == 0) - return " no mods"; - - name[0] = '\0'; - - if (mods & GLFW_MOD_SHIFT) - strcat(name, " shift"); - if (mods & GLFW_MOD_CONTROL) - strcat(name, " control"); - if (mods & GLFW_MOD_ALT) - strcat(name, " alt"); - if (mods & GLFW_MOD_SUPER) - strcat(name, " super"); - - return name; -} - -static const char* get_character_string(int codepoint) -{ - // This assumes UTF-8, which is stupid - static char result[6 + 1]; - - int length = wctomb(result, codepoint); - if (length == -1) - length = 0; - - result[length] = '\0'; - return result; -} - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void window_pos_callback(GLFWwindow* window, int x, int y) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Window position: %i %i\n", - counter++, slot->number, glfwGetTime(), x, y); -} - -static void window_size_callback(GLFWwindow* window, int width, int height) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Window size: %i %i\n", - counter++, slot->number, glfwGetTime(), width, height); -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Framebuffer size: %i %i\n", - counter++, slot->number, glfwGetTime(), width, height); - - glViewport(0, 0, width, height); -} - -static void window_close_callback(GLFWwindow* window) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Window close\n", - counter++, slot->number, glfwGetTime()); - - glfwSetWindowShouldClose(window, slot->closeable); -} - -static void window_refresh_callback(GLFWwindow* window) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Window refresh\n", - counter++, slot->number, glfwGetTime()); - - glfwMakeContextCurrent(window); - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(window); -} - -static void window_focus_callback(GLFWwindow* window, int focused) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Window %s\n", - counter++, slot->number, glfwGetTime(), - focused ? "focused" : "defocused"); -} - -static void window_iconify_callback(GLFWwindow* window, int iconified) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Window was %s\n", - counter++, slot->number, glfwGetTime(), - iconified ? "iconified" : "restored"); -} - -static void mouse_button_callback(GLFWwindow* window, int button, int action, int mods) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Mouse button %i (%s) (with%s) was %s\n", - counter++, slot->number, glfwGetTime(), button, - get_button_name(button), - get_mods_name(mods), - get_action_name(action)); -} - -static void cursor_position_callback(GLFWwindow* window, double x, double y) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Cursor position: %f %f\n", - counter++, slot->number, glfwGetTime(), x, y); -} - -static void cursor_enter_callback(GLFWwindow* window, int entered) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Cursor %s window\n", - counter++, slot->number, glfwGetTime(), - entered ? "entered" : "left"); -} - -static void scroll_callback(GLFWwindow* window, double x, double y) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Scroll: %0.3f %0.3f\n", - counter++, slot->number, glfwGetTime(), x, y); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - Slot* slot = glfwGetWindowUserPointer(window); - - printf("%08x to %i at %0.3f: Key 0x%04x Scancode 0x%04x (%s) (with%s) was %s\n", - counter++, slot->number, glfwGetTime(), key, scancode, - get_key_name(key), - get_mods_name(mods), - get_action_name(action)); - - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_C: - { - slot->closeable = !slot->closeable; - - printf("(( closing %s ))\n", slot->closeable ? "enabled" : "disabled"); - break; - } - } -} - -static void char_callback(GLFWwindow* window, unsigned int codepoint) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Character 0x%08x (%s) input\n", - counter++, slot->number, glfwGetTime(), codepoint, - get_character_string(codepoint)); -} - -static void char_mods_callback(GLFWwindow* window, unsigned int codepoint, int mods) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Character 0x%08x (%s) with modifiers (with%s) input\n", - counter++, slot->number, glfwGetTime(), codepoint, - get_character_string(codepoint), - get_mods_name(mods)); -} - -static void drop_callback(GLFWwindow* window, int count, const char** names) -{ - int i; - Slot* slot = glfwGetWindowUserPointer(window); - - printf("%08x to %i at %0.3f: Drop input\n", - counter++, slot->number, glfwGetTime()); - - for (i = 0; i < count; i++) - printf(" %i: \"%s\"\n", i, names[i]); -} - -static void monitor_callback(GLFWmonitor* monitor, int event) -{ - if (event == GLFW_CONNECTED) - { - int x, y, widthMM, heightMM; - const GLFWvidmode* mode = glfwGetVideoMode(monitor); - - glfwGetMonitorPos(monitor, &x, &y); - glfwGetMonitorPhysicalSize(monitor, &widthMM, &heightMM); - - printf("%08x at %0.3f: Monitor %s (%ix%i at %ix%i, %ix%i mm) was connected\n", - counter++, - glfwGetTime(), - glfwGetMonitorName(monitor), - mode->width, mode->height, - x, y, - widthMM, heightMM); - } - else - { - printf("%08x at %0.3f: Monitor %s was disconnected\n", - counter++, - glfwGetTime(), - glfwGetMonitorName(monitor)); - } -} - -int main(int argc, char** argv) -{ - Slot* slots; - GLFWmonitor* monitor = NULL; - int ch, i, width, height, count = 1; - - setlocale(LC_ALL, ""); - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - printf("Library initialized\n"); - - glfwSetMonitorCallback(monitor_callback); - - while ((ch = getopt(argc, argv, "hfn:")) != -1) - { - switch (ch) - { - case 'h': - usage(); - exit(EXIT_SUCCESS); - - case 'f': - monitor = glfwGetPrimaryMonitor(); - break; - - case 'n': - count = (int) strtol(optarg, NULL, 10); - break; - - default: - usage(); - exit(EXIT_FAILURE); - } - } - - if (monitor) - { - const GLFWvidmode* mode = glfwGetVideoMode(monitor); - - glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate); - glfwWindowHint(GLFW_RED_BITS, mode->redBits); - glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits); - glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits); - - width = mode->width; - height = mode->height; - } - else - { - width = 640; - height = 480; - } - - if (!count) - { - fprintf(stderr, "Invalid user\n"); - exit(EXIT_FAILURE); - } - - slots = calloc(count, sizeof(Slot)); - - for (i = 0; i < count; i++) - { - char title[128]; - - slots[i].closeable = GL_TRUE; - slots[i].number = i + 1; - - sprintf(title, "Event Linter (Window %i)", slots[i].number); - - if (monitor) - { - printf("Creating full screen window %i (%ix%i on %s)\n", - slots[i].number, - width, height, - glfwGetMonitorName(monitor)); - } - else - { - printf("Creating windowed mode window %i (%ix%i)\n", - slots[i].number, - width, height); - } - - slots[i].window = glfwCreateWindow(width, height, title, monitor, NULL); - if (!slots[i].window) - { - free(slots); - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwSetWindowUserPointer(slots[i].window, slots + i); - - glfwSetWindowPosCallback(slots[i].window, window_pos_callback); - glfwSetWindowSizeCallback(slots[i].window, window_size_callback); - glfwSetFramebufferSizeCallback(slots[i].window, framebuffer_size_callback); - glfwSetWindowCloseCallback(slots[i].window, window_close_callback); - glfwSetWindowRefreshCallback(slots[i].window, window_refresh_callback); - glfwSetWindowFocusCallback(slots[i].window, window_focus_callback); - glfwSetWindowIconifyCallback(slots[i].window, window_iconify_callback); - glfwSetMouseButtonCallback(slots[i].window, mouse_button_callback); - glfwSetCursorPosCallback(slots[i].window, cursor_position_callback); - glfwSetCursorEnterCallback(slots[i].window, cursor_enter_callback); - glfwSetScrollCallback(slots[i].window, scroll_callback); - glfwSetKeyCallback(slots[i].window, key_callback); - glfwSetCharCallback(slots[i].window, char_callback); - glfwSetCharModsCallback(slots[i].window, char_mods_callback); - glfwSetDropCallback(slots[i].window, drop_callback); - - glfwMakeContextCurrent(slots[i].window); - glfwSwapInterval(1); - } - - printf("Main loop starting\n"); - - for (;;) - { - for (i = 0; i < count; i++) - { - if (glfwWindowShouldClose(slots[i].window)) - break; - } - - if (i < count) - break; - - glfwWaitEvents(); - - // Workaround for an issue with msvcrt and mintty - fflush(stdout); - } - - free(slots); - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/extern/glfw/tests/fsaa.c b/extern/glfw/tests/fsaa.c deleted file mode 100644 index ef78439..0000000 --- a/extern/glfw/tests/fsaa.c +++ /dev/null @@ -1,157 +0,0 @@ -//======================================================================== -// Fullscreen anti-aliasing test -// Copyright (c) Camilla Berglund -// -// 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. -// -//======================================================================== -// -// This test renders two high contrast, slowly rotating quads, one aliased -// and one (hopefully) anti-aliased, thus allowing for visual verification -// of whether FSAA is indeed enabled -// -//======================================================================== - -#define GLFW_INCLUDE_GLEXT -#include - -#include -#include - -#include "getopt.h" - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - glViewport(0, 0, width, height); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_SPACE: - glfwSetTime(0.0); - break; - } -} - -static void usage(void) -{ - printf("Usage: fsaa [-h] [-s SAMPLES]\n"); -} - -int main(int argc, char** argv) -{ - int ch, samples = 4; - GLFWwindow* window; - - while ((ch = getopt(argc, argv, "hs:")) != -1) - { - switch (ch) - { - case 'h': - usage(); - exit(EXIT_SUCCESS); - case 's': - samples = atoi(optarg); - break; - default: - usage(); - exit(EXIT_FAILURE); - } - } - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - if (samples) - printf("Requesting FSAA with %i samples\n", samples); - else - printf("Requesting that FSAA not be available\n"); - - glfwWindowHint(GLFW_SAMPLES, samples); - - window = glfwCreateWindow(800, 400, "Aliasing Detector", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwSetKeyCallback(window, key_callback); - glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - if (!glfwExtensionSupported("GL_ARB_multisample")) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glGetIntegerv(GL_SAMPLES_ARB, &samples); - if (samples) - printf("Context reports FSAA is available with %i samples\n", samples); - else - printf("Context reports FSAA is unavailable\n"); - - glMatrixMode(GL_PROJECTION); - glOrtho(0.f, 1.f, 0.f, 0.5f, 0.f, 1.f); - glMatrixMode(GL_MODELVIEW); - - while (!glfwWindowShouldClose(window)) - { - GLfloat time = (GLfloat) glfwGetTime(); - - glClear(GL_COLOR_BUFFER_BIT); - - glLoadIdentity(); - glTranslatef(0.25f, 0.25f, 0.f); - glRotatef(time, 0.f, 0.f, 1.f); - - glDisable(GL_MULTISAMPLE_ARB); - glRectf(-0.15f, -0.15f, 0.15f, 0.15f); - - glLoadIdentity(); - glTranslatef(0.75f, 0.25f, 0.f); - glRotatef(time, 0.f, 0.f, 1.f); - - glEnable(GL_MULTISAMPLE_ARB); - glRectf(-0.15f, -0.15f, 0.15f, 0.15f); - - glfwSwapBuffers(window); - glfwPollEvents(); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/extern/glfw/tests/gamma.c b/extern/glfw/tests/gamma.c deleted file mode 100644 index c67e128..0000000 --- a/extern/glfw/tests/gamma.c +++ /dev/null @@ -1,181 +0,0 @@ -//======================================================================== -// Gamma correction test program -// Copyright (c) Camilla Berglund -// -// 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. -// -//======================================================================== -// -// This program is used to test the gamma correction functionality for -// both fullscreen and windowed mode windows -// -//======================================================================== - -#include - -#include -#include - -#include "getopt.h" - -#define STEP_SIZE 0.1f - -static GLfloat gamma_value = 1.0f; - -static void usage(void) -{ - printf("Usage: gamma [-h] [-f]\n"); -} - -static void set_gamma(GLFWwindow* window, float value) -{ - GLFWmonitor* monitor = glfwGetWindowMonitor(window); - if (!monitor) - monitor = glfwGetPrimaryMonitor(); - - gamma_value = value; - printf("Gamma: %f\n", gamma_value); - glfwSetGamma(monitor, gamma_value); -} - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_ESCAPE: - { - glfwSetWindowShouldClose(window, GL_TRUE); - break; - } - - case GLFW_KEY_KP_ADD: - case GLFW_KEY_Q: - { - set_gamma(window, gamma_value + STEP_SIZE); - break; - } - - case GLFW_KEY_KP_SUBTRACT: - case GLFW_KEY_W: - { - if (gamma_value - STEP_SIZE > 0.f) - set_gamma(window, gamma_value - STEP_SIZE); - - break; - } - } -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - glViewport(0, 0, width, height); -} - -int main(int argc, char** argv) -{ - int width, height, ch; - GLFWmonitor* monitor = NULL; - GLFWwindow* window; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - while ((ch = getopt(argc, argv, "fh")) != -1) - { - switch (ch) - { - case 'h': - usage(); - exit(EXIT_SUCCESS); - - case 'f': - monitor = glfwGetPrimaryMonitor(); - break; - - default: - usage(); - exit(EXIT_FAILURE); - } - } - - if (monitor) - { - const GLFWvidmode* mode = glfwGetVideoMode(monitor); - - glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate); - glfwWindowHint(GLFW_RED_BITS, mode->redBits); - glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits); - glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits); - - width = mode->width; - height = mode->height; - } - else - { - width = 200; - height = 200; - } - - window = glfwCreateWindow(width, height, "Gamma Test", monitor, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - set_gamma(window, 1.f); - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - glfwSetKeyCallback(window, key_callback); - glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); - - glMatrixMode(GL_PROJECTION); - glOrtho(-1.f, 1.f, -1.f, 1.f, -1.f, 1.f); - glMatrixMode(GL_MODELVIEW); - - glClearColor(0.5f, 0.5f, 0.5f, 0); - - while (!glfwWindowShouldClose(window)) - { - glClear(GL_COLOR_BUFFER_BIT); - - glColor3f(0.8f, 0.2f, 0.4f); - glRectf(-0.5f, -0.5f, 0.5f, 0.5f); - - glfwSwapBuffers(window); - glfwWaitEvents(); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/extern/glfw/tests/glfwinfo.c b/extern/glfw/tests/glfwinfo.c deleted file mode 100644 index dcf5353..0000000 --- a/extern/glfw/tests/glfwinfo.c +++ /dev/null @@ -1,429 +0,0 @@ -//======================================================================== -// Version information dumper -// Copyright (c) Camilla Berglund -// -// 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. -// -//======================================================================== -// -// This test is a pale imitation of glxinfo(1), except not really -// -// It dumps GLFW and OpenGL version information -// -//======================================================================== - -#include -#include - -#include -#include -#include - -#include "getopt.h" - -#ifdef _MSC_VER -#define strcasecmp(x, y) _stricmp(x, y) -#endif - -#define API_OPENGL "gl" -#define API_OPENGL_ES "es" - -#define PROFILE_NAME_CORE "core" -#define PROFILE_NAME_COMPAT "compat" - -#define STRATEGY_NAME_NONE "none" -#define STRATEGY_NAME_LOSE "lose" - -#define BEHAVIOR_NAME_NONE "none" -#define BEHAVIOR_NAME_FLUSH "flush" - -static void usage(void) -{ - printf("Usage: glfwinfo [-h] [-a API] [-m MAJOR] [-n MINOR] [-d] [-l] [-f] [-p PROFILE] [-s STRATEGY] [-b BEHAVIOR]\n"); - printf("Options:\n"); - printf(" -a the client API to use (" API_OPENGL " or " API_OPENGL_ES ")\n"); - printf(" -b the release behavior to use (" BEHAVIOR_NAME_NONE " or " BEHAVIOR_NAME_FLUSH ")\n"); - printf(" -d request a debug context\n"); - printf(" -f require a forward-compatible context\n"); - printf(" -h show this help\n"); - printf(" -l list all client API extensions after context creation\n"); - printf(" -m the major number of the requred client API version\n"); - printf(" -n the minor number of the requred client API version\n"); - printf(" -p the OpenGL profile to use (" PROFILE_NAME_CORE " or " PROFILE_NAME_COMPAT ")\n"); - printf(" -s the robustness strategy to use (" STRATEGY_NAME_NONE " or " STRATEGY_NAME_LOSE ")\n"); -} - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static const char* get_client_api_name(int api) -{ - if (api == GLFW_OPENGL_API) - return "OpenGL"; - else if (api == GLFW_OPENGL_ES_API) - return "OpenGL ES"; - - return "Unknown API"; -} - -static const char* get_profile_name_gl(GLint mask) -{ - if (mask & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT) - return PROFILE_NAME_COMPAT; - if (mask & GL_CONTEXT_CORE_PROFILE_BIT) - return PROFILE_NAME_CORE; - - return "unknown"; -} - -static const char* get_profile_name_glfw(int profile) -{ - if (profile == GLFW_OPENGL_COMPAT_PROFILE) - return PROFILE_NAME_COMPAT; - if (profile == GLFW_OPENGL_CORE_PROFILE) - return PROFILE_NAME_CORE; - - return "unknown"; -} - -static const char* get_strategy_name_gl(GLint strategy) -{ - if (strategy == GL_LOSE_CONTEXT_ON_RESET_ARB) - return STRATEGY_NAME_LOSE; - if (strategy == GL_NO_RESET_NOTIFICATION_ARB) - return STRATEGY_NAME_NONE; - - return "unknown"; -} - -static const char* get_strategy_name_glfw(int strategy) -{ - if (strategy == GLFW_LOSE_CONTEXT_ON_RESET) - return STRATEGY_NAME_LOSE; - if (strategy == GLFW_NO_RESET_NOTIFICATION) - return STRATEGY_NAME_NONE; - - return "unknown"; -} - -static void list_extensions(int api, int major, int minor) -{ - int i; - GLint count; - const GLubyte* extensions; - - printf("%s context supported extensions:\n", get_client_api_name(api)); - - if (api == GLFW_OPENGL_API && major > 2) - { - PFNGLGETSTRINGIPROC glGetStringi = (PFNGLGETSTRINGIPROC) glfwGetProcAddress("glGetStringi"); - if (!glGetStringi) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glGetIntegerv(GL_NUM_EXTENSIONS, &count); - - for (i = 0; i < count; i++) - puts((const char*) glGetStringi(GL_EXTENSIONS, i)); - } - else - { - extensions = glGetString(GL_EXTENSIONS); - while (*extensions != '\0') - { - if (*extensions == ' ') - putchar('\n'); - else - putchar(*extensions); - - extensions++; - } - } - - putchar('\n'); -} - -static GLboolean valid_version(void) -{ - int major, minor, revision; - - glfwGetVersion(&major, &minor, &revision); - - printf("GLFW header version: %u.%u.%u\n", - GLFW_VERSION_MAJOR, - GLFW_VERSION_MINOR, - GLFW_VERSION_REVISION); - - printf("GLFW library version: %u.%u.%u\n", major, minor, revision); - - if (major != GLFW_VERSION_MAJOR) - { - printf("*** ERROR: GLFW major version mismatch! ***\n"); - return GL_FALSE; - } - - if (minor != GLFW_VERSION_MINOR || revision != GLFW_VERSION_REVISION) - printf("*** WARNING: GLFW version mismatch! ***\n"); - - printf("GLFW library version string: \"%s\"\n", glfwGetVersionString()); - return GL_TRUE; -} - -int main(int argc, char** argv) -{ - int ch, api = 0, profile = 0, strategy = 0, behavior = 0, major = 1, minor = 0, revision; - GLboolean debug = GL_FALSE, forward = GL_FALSE, list = GL_FALSE; - GLint flags, mask; - GLFWwindow* window; - - while ((ch = getopt(argc, argv, "a:b:dfhlm:n:p:s:")) != -1) - { - switch (ch) - { - case 'a': - if (strcasecmp(optarg, API_OPENGL) == 0) - api = GLFW_OPENGL_API; - else if (strcasecmp(optarg, API_OPENGL_ES) == 0) - api = GLFW_OPENGL_ES_API; - else - { - usage(); - exit(EXIT_FAILURE); - } - break; - case 'b': - if (strcasecmp(optarg, BEHAVIOR_NAME_NONE) == 0) - behavior = GLFW_RELEASE_BEHAVIOR_NONE; - else if (strcasecmp(optarg, BEHAVIOR_NAME_FLUSH) == 0) - behavior = GLFW_RELEASE_BEHAVIOR_FLUSH; - else - { - usage(); - exit(EXIT_FAILURE); - } - break; - case 'd': - debug = GL_TRUE; - break; - case 'f': - forward = GL_TRUE; - break; - case 'h': - usage(); - exit(EXIT_SUCCESS); - case 'l': - list = GL_TRUE; - break; - case 'm': - major = atoi(optarg); - break; - case 'n': - minor = atoi(optarg); - break; - case 'p': - if (strcasecmp(optarg, PROFILE_NAME_CORE) == 0) - profile = GLFW_OPENGL_CORE_PROFILE; - else if (strcasecmp(optarg, PROFILE_NAME_COMPAT) == 0) - profile = GLFW_OPENGL_COMPAT_PROFILE; - else - { - usage(); - exit(EXIT_FAILURE); - } - break; - case 's': - if (strcasecmp(optarg, STRATEGY_NAME_NONE) == 0) - strategy = GLFW_NO_RESET_NOTIFICATION; - else if (strcasecmp(optarg, STRATEGY_NAME_LOSE) == 0) - strategy = GLFW_LOSE_CONTEXT_ON_RESET; - else - { - usage(); - exit(EXIT_FAILURE); - } - break; - default: - usage(); - exit(EXIT_FAILURE); - } - } - - // Initialize GLFW and create window - - if (!valid_version()) - exit(EXIT_FAILURE); - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - if (major != 1 || minor != 0) - { - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, major); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, minor); - } - - if (api != 0) - glfwWindowHint(GLFW_CLIENT_API, api); - - if (debug) - glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE); - - if (forward) - glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); - - if (profile != 0) - glfwWindowHint(GLFW_OPENGL_PROFILE, profile); - - if (strategy) - glfwWindowHint(GLFW_CONTEXT_ROBUSTNESS, strategy); - - if (behavior) - glfwWindowHint(GLFW_CONTEXT_RELEASE_BEHAVIOR, behavior); - - glfwWindowHint(GLFW_RED_BITS, GLFW_DONT_CARE); - glfwWindowHint(GLFW_GREEN_BITS, GLFW_DONT_CARE); - glfwWindowHint(GLFW_BLUE_BITS, GLFW_DONT_CARE); - glfwWindowHint(GLFW_ALPHA_BITS, GLFW_DONT_CARE); - glfwWindowHint(GLFW_DEPTH_BITS, GLFW_DONT_CARE); - glfwWindowHint(GLFW_STENCIL_BITS, GLFW_DONT_CARE); - glfwWindowHint(GLFW_ACCUM_RED_BITS, GLFW_DONT_CARE); - glfwWindowHint(GLFW_ACCUM_GREEN_BITS, GLFW_DONT_CARE); - glfwWindowHint(GLFW_ACCUM_BLUE_BITS, GLFW_DONT_CARE); - glfwWindowHint(GLFW_ACCUM_ALPHA_BITS, GLFW_DONT_CARE); - glfwWindowHint(GLFW_AUX_BUFFERS, GLFW_DONT_CARE); - glfwWindowHint(GLFW_SAMPLES, GLFW_DONT_CARE); - glfwWindowHint(GLFW_SRGB_CAPABLE, GLFW_DONT_CARE); - - glfwWindowHint(GLFW_VISIBLE, GL_FALSE); - - window = glfwCreateWindow(200, 200, "Version", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - - // Report client API version - - api = glfwGetWindowAttrib(window, GLFW_CLIENT_API); - major = glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MAJOR); - minor = glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MINOR); - revision = glfwGetWindowAttrib(window, GLFW_CONTEXT_REVISION); - - printf("%s context version string: \"%s\"\n", - get_client_api_name(api), - glGetString(GL_VERSION)); - - printf("%s context version parsed by GLFW: %u.%u.%u\n", - get_client_api_name(api), - major, minor, revision); - - // Report client API context properties - - if (api == GLFW_OPENGL_API) - { - if (major >= 3) - { - glGetIntegerv(GL_CONTEXT_FLAGS, &flags); - printf("%s context flags (0x%08x):", get_client_api_name(api), flags); - - if (flags & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT) - printf(" forward-compatible"); - if (flags & GL_CONTEXT_FLAG_DEBUG_BIT) - printf(" debug"); - if (flags & GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB) - printf(" robustness"); - putchar('\n'); - - printf("%s context flags parsed by GLFW:", get_client_api_name(api)); - - if (glfwGetWindowAttrib(window, GLFW_OPENGL_FORWARD_COMPAT)) - printf(" forward-compatible"); - if (glfwGetWindowAttrib(window, GLFW_OPENGL_DEBUG_CONTEXT)) - printf(" debug"); - if (glfwGetWindowAttrib(window, GLFW_CONTEXT_ROBUSTNESS) != GLFW_NO_ROBUSTNESS) - printf(" robustness"); - putchar('\n'); - } - - if (major > 3 || (major == 3 && minor >= 2)) - { - int profile = glfwGetWindowAttrib(window, GLFW_OPENGL_PROFILE); - - glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &mask); - printf("%s profile mask (0x%08x): %s\n", - get_client_api_name(api), - mask, - get_profile_name_gl(mask)); - - printf("%s profile mask parsed by GLFW: %s\n", - get_client_api_name(api), - get_profile_name_glfw(profile)); - } - - if (glfwExtensionSupported("GL_ARB_robustness")) - { - int robustness; - GLint strategy; - glGetIntegerv(GL_RESET_NOTIFICATION_STRATEGY_ARB, &strategy); - - printf("%s robustness strategy (0x%08x): %s\n", - get_client_api_name(api), - strategy, - get_strategy_name_gl(strategy)); - - robustness = glfwGetWindowAttrib(window, GLFW_CONTEXT_ROBUSTNESS); - - printf("%s robustness strategy parsed by GLFW: %s\n", - get_client_api_name(api), - get_strategy_name_glfw(robustness)); - } - } - - printf("%s context renderer string: \"%s\"\n", - get_client_api_name(api), - glGetString(GL_RENDERER)); - printf("%s context vendor string: \"%s\"\n", - get_client_api_name(api), - glGetString(GL_VENDOR)); - - if (major > 1) - { - printf("%s context shading language version: \"%s\"\n", - get_client_api_name(api), - glGetString(GL_SHADING_LANGUAGE_VERSION)); - } - - // Report client API extensions - if (list) - list_extensions(api, major, minor); - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/extern/glfw/tests/iconify.c b/extern/glfw/tests/iconify.c deleted file mode 100644 index 3cdfd07..0000000 --- a/extern/glfw/tests/iconify.c +++ /dev/null @@ -1,182 +0,0 @@ -//======================================================================== -// Iconify/restore test program -// Copyright (c) Camilla Berglund -// -// 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. -// -//======================================================================== -// -// This program is used to test the iconify/restore functionality for -// both fullscreen and windowed mode windows -// -//======================================================================== - -#include - -#include -#include - -#include "getopt.h" - -static void usage(void) -{ - printf("Usage: iconify [-h] [-f]\n"); -} - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - printf("%0.2f Key %s\n", - glfwGetTime(), - action == GLFW_PRESS ? "pressed" : "released"); - - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_SPACE: - glfwIconifyWindow(window); - break; - case GLFW_KEY_ESCAPE: - glfwSetWindowShouldClose(window, GL_TRUE); - break; - } -} - -static void window_size_callback(GLFWwindow* window, int width, int height) -{ - printf("%0.2f Window resized to %ix%i\n", glfwGetTime(), width, height); -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - printf("%0.2f Framebuffer resized to %ix%i\n", glfwGetTime(), width, height); - - glViewport(0, 0, width, height); -} - -static void window_focus_callback(GLFWwindow* window, int focused) -{ - printf("%0.2f Window %s\n", - glfwGetTime(), - focused ? "focused" : "defocused"); -} - -static void window_iconify_callback(GLFWwindow* window, int iconified) -{ - printf("%0.2f Window %s\n", - glfwGetTime(), - iconified ? "iconified" : "restored"); -} - -int main(int argc, char** argv) -{ - int width, height, ch; - GLFWmonitor* monitor = NULL; - GLFWwindow* window; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - while ((ch = getopt(argc, argv, "fh")) != -1) - { - switch (ch) - { - case 'h': - usage(); - exit(EXIT_SUCCESS); - - case 'f': - monitor = glfwGetPrimaryMonitor(); - break; - - default: - usage(); - exit(EXIT_FAILURE); - } - } - - if (monitor) - { - const GLFWvidmode* mode = glfwGetVideoMode(monitor); - - glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate); - glfwWindowHint(GLFW_RED_BITS, mode->redBits); - glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits); - glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits); - - width = mode->width; - height = mode->height; - } - else - { - width = 640; - height = 480; - } - - window = glfwCreateWindow(width, height, "Iconify", monitor, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - glfwSetKeyCallback(window, key_callback); - glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); - glfwSetWindowSizeCallback(window, window_size_callback); - glfwSetWindowFocusCallback(window, window_focus_callback); - glfwSetWindowIconifyCallback(window, window_iconify_callback); - - printf("Window is %s and %s\n", - glfwGetWindowAttrib(window, GLFW_ICONIFIED) ? "iconified" : "restored", - glfwGetWindowAttrib(window, GLFW_FOCUSED) ? "focused" : "defocused"); - - glEnable(GL_SCISSOR_TEST); - - while (!glfwWindowShouldClose(window)) - { - glfwGetFramebufferSize(window, &width, &height); - - glScissor(0, 0, width, height); - glClearColor(0, 0, 0, 0); - glClear(GL_COLOR_BUFFER_BIT); - - glScissor(0, 0, 640, 480); - glClearColor(1, 1, 1, 0); - glClear(GL_COLOR_BUFFER_BIT); - - glfwSwapBuffers(window); - glfwPollEvents(); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/extern/glfw/tests/joysticks.c b/extern/glfw/tests/joysticks.c deleted file mode 100644 index a3a5cd7..0000000 --- a/extern/glfw/tests/joysticks.c +++ /dev/null @@ -1,234 +0,0 @@ -//======================================================================== -// Joystick input test -// Copyright (c) Camilla Berglund -// -// 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. -// -//======================================================================== -// -// This test displays the state of every button and axis of every connected -// joystick and/or gamepad -// -//======================================================================== - -#include - -#include -#include -#include - -#ifdef _MSC_VER -#define strdup(x) _strdup(x) -#endif - -typedef struct Joystick -{ - GLboolean present; - char* name; - float* axes; - unsigned char* buttons; - int axis_count; - int button_count; -} Joystick; - -static Joystick joysticks[GLFW_JOYSTICK_LAST - GLFW_JOYSTICK_1 + 1]; -static int joystick_count = 0; - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - glViewport(0, 0, width, height); -} - -static void draw_joystick(Joystick* j, int x, int y, int width, int height) -{ - int i; - const int axis_height = 3 * height / 4; - const int button_height = height / 4; - - if (j->axis_count) - { - const int axis_width = width / j->axis_count; - - for (i = 0; i < j->axis_count; i++) - { - float value = j->axes[i] / 2.f + 0.5f; - - glColor3f(0.3f, 0.3f, 0.3f); - glRecti(x + i * axis_width, - y, - x + (i + 1) * axis_width, - y + axis_height); - - glColor3f(1.f, 1.f, 1.f); - glRecti(x + i * axis_width, - y + (int) (value * (axis_height - 5)), - x + (i + 1) * axis_width, - y + 5 + (int) (value * (axis_height - 5))); - } - } - - if (j->button_count) - { - const int button_width = width / j->button_count; - - for (i = 0; i < j->button_count; i++) - { - if (j->buttons[i]) - glColor3f(1.f, 1.f, 1.f); - else - glColor3f(0.3f, 0.3f, 0.3f); - - glRecti(x + i * button_width, - y + axis_height, - x + (i + 1) * button_width, - y + axis_height + button_height); - } - } -} - -static void draw_joysticks(GLFWwindow* window) -{ - int i, width, height; - - glfwGetFramebufferSize(window, &width, &height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(0.f, width, height, 0.f, 1.f, -1.f); - glMatrixMode(GL_MODELVIEW); - - for (i = 0; i < sizeof(joysticks) / sizeof(Joystick); i++) - { - Joystick* j = joysticks + i; - - if (j->present) - { - draw_joystick(j, - 0, i * height / joystick_count, - width, height / joystick_count); - } - } -} - -static void refresh_joysticks(void) -{ - int i; - - for (i = 0; i < sizeof(joysticks) / sizeof(Joystick); i++) - { - Joystick* j = joysticks + i; - - if (glfwJoystickPresent(GLFW_JOYSTICK_1 + i)) - { - const float* axes; - const unsigned char* buttons; - int axis_count, button_count; - - free(j->name); - j->name = strdup(glfwGetJoystickName(GLFW_JOYSTICK_1 + i)); - - axes = glfwGetJoystickAxes(GLFW_JOYSTICK_1 + i, &axis_count); - if (axis_count != j->axis_count) - { - j->axis_count = axis_count; - j->axes = realloc(j->axes, j->axis_count * sizeof(float)); - } - - memcpy(j->axes, axes, axis_count * sizeof(float)); - - buttons = glfwGetJoystickButtons(GLFW_JOYSTICK_1 + i, &button_count); - if (button_count != j->button_count) - { - j->button_count = button_count; - j->buttons = realloc(j->buttons, j->button_count); - } - - memcpy(j->buttons, buttons, button_count * sizeof(unsigned char)); - - if (!j->present) - { - printf("Found joystick %i named \'%s\' with %i axes, %i buttons\n", - i + 1, j->name, j->axis_count, j->button_count); - - joystick_count++; - } - - j->present = GL_TRUE; - } - else - { - if (j->present) - { - printf("Lost joystick %i named \'%s\'\n", i + 1, j->name); - - free(j->name); - free(j->axes); - free(j->buttons); - memset(j, 0, sizeof(Joystick)); - - joystick_count--; - } - } - } -} - -int main(void) -{ - GLFWwindow* window; - - memset(joysticks, 0, sizeof(joysticks)); - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - window = glfwCreateWindow(640, 480, "Joystick Test", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - while (!glfwWindowShouldClose(window)) - { - glClear(GL_COLOR_BUFFER_BIT); - - refresh_joysticks(); - draw_joysticks(window); - - glfwSwapBuffers(window); - glfwPollEvents(); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/extern/glfw/tests/modes.c b/extern/glfw/tests/modes.c deleted file mode 100644 index 58067e3..0000000 --- a/extern/glfw/tests/modes.c +++ /dev/null @@ -1,240 +0,0 @@ -//======================================================================== -// Video mode test -// Copyright (c) Camilla Berglund -// -// 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. -// -//======================================================================== -// -// This test enumerates or verifies video modes -// -//======================================================================== - -#include - -#include -#include -#include - -#include "getopt.h" - -enum Mode -{ - LIST_MODE, - TEST_MODE -}; - -static void usage(void) -{ - printf("Usage: modes [-t]\n"); - printf(" modes -h\n"); -} - -static const char* format_mode(const GLFWvidmode* mode) -{ - static char buffer[512]; - - sprintf(buffer, - "%i x %i x %i (%i %i %i) %i Hz", - mode->width, mode->height, - mode->redBits + mode->greenBits + mode->blueBits, - mode->redBits, mode->greenBits, mode->blueBits, - mode->refreshRate); - - buffer[sizeof(buffer) - 1] = '\0'; - return buffer; -} - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - printf("Framebuffer resized to %ix%i\n", width, height); - - glViewport(0, 0, width, height); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key == GLFW_KEY_ESCAPE) - glfwSetWindowShouldClose(window, GL_TRUE); -} - -static void list_modes(GLFWmonitor* monitor) -{ - int count, x, y, widthMM, heightMM, dpi, i; - const GLFWvidmode* mode = glfwGetVideoMode(monitor); - const GLFWvidmode* modes = glfwGetVideoModes(monitor, &count); - - glfwGetMonitorPos(monitor, &x, &y); - glfwGetMonitorPhysicalSize(monitor, &widthMM, &heightMM); - - printf("Name: %s (%s)\n", - glfwGetMonitorName(monitor), - glfwGetPrimaryMonitor() == monitor ? "primary" : "secondary"); - printf("Current mode: %s\n", format_mode(mode)); - printf("Virtual position: %i %i\n", x, y); - - dpi = (int) ((float) mode->width * 25.4f / (float) widthMM); - printf("Physical size: %i x %i mm (%i dpi)\n", widthMM, heightMM, dpi); - - printf("Modes:\n"); - - for (i = 0; i < count; i++) - { - printf("%3u: %s", (unsigned int) i, format_mode(modes + i)); - - if (memcmp(mode, modes + i, sizeof(GLFWvidmode)) == 0) - printf(" (current mode)"); - - putchar('\n'); - } -} - -static void test_modes(GLFWmonitor* monitor) -{ - int i, count; - GLFWwindow* window; - const GLFWvidmode* modes = glfwGetVideoModes(monitor, &count); - - for (i = 0; i < count; i++) - { - const GLFWvidmode* mode = modes + i; - GLFWvidmode current; - - glfwWindowHint(GLFW_RED_BITS, mode->redBits); - glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits); - glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits); - glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate); - - printf("Testing mode %u on monitor %s: %s\n", - (unsigned int) i, - glfwGetMonitorName(monitor), - format_mode(mode)); - - window = glfwCreateWindow(mode->width, mode->height, - "Video Mode Test", - glfwGetPrimaryMonitor(), - NULL); - if (!window) - { - printf("Failed to enter mode %u: %s\n", - (unsigned int) i, - format_mode(mode)); - continue; - } - - glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); - glfwSetKeyCallback(window, key_callback); - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - glfwSetTime(0.0); - - while (glfwGetTime() < 5.0) - { - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(window); - glfwPollEvents(); - - if (glfwWindowShouldClose(window)) - { - printf("User terminated program\n"); - - glfwTerminate(); - exit(EXIT_SUCCESS); - } - } - - glGetIntegerv(GL_RED_BITS, ¤t.redBits); - glGetIntegerv(GL_GREEN_BITS, ¤t.greenBits); - glGetIntegerv(GL_BLUE_BITS, ¤t.blueBits); - - glfwGetWindowSize(window, ¤t.width, ¤t.height); - - if (current.redBits != mode->redBits || - current.greenBits != mode->greenBits || - current.blueBits != mode->blueBits) - { - printf("*** Color bit mismatch: (%i %i %i) instead of (%i %i %i)\n", - current.redBits, current.greenBits, current.blueBits, - mode->redBits, mode->greenBits, mode->blueBits); - } - - if (current.width != mode->width || current.height != mode->height) - { - printf("*** Size mismatch: %ix%i instead of %ix%i\n", - current.width, current.height, - mode->width, mode->height); - } - - printf("Closing window\n"); - - glfwDestroyWindow(window); - window = NULL; - - glfwPollEvents(); - } -} - -int main(int argc, char** argv) -{ - int ch, i, count, mode = LIST_MODE; - GLFWmonitor** monitors; - - while ((ch = getopt(argc, argv, "th")) != -1) - { - switch (ch) - { - case 'h': - usage(); - exit(EXIT_SUCCESS); - case 't': - mode = TEST_MODE; - break; - default: - usage(); - exit(EXIT_FAILURE); - } - } - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - monitors = glfwGetMonitors(&count); - - for (i = 0; i < count; i++) - { - if (mode == LIST_MODE) - list_modes(monitors[i]); - else if (mode == TEST_MODE) - test_modes(monitors[i]); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/extern/glfw/tests/peter.c b/extern/glfw/tests/peter.c deleted file mode 100644 index 4eab10f..0000000 --- a/extern/glfw/tests/peter.c +++ /dev/null @@ -1,145 +0,0 @@ -//======================================================================== -// Cursor mode test -// Copyright (c) Camilla Berglund -// -// 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. -// -//======================================================================== -// -// This test allows you to switch between the various cursor modes -// -//======================================================================== - -#include - -#include -#include - -static GLboolean reopen = GL_FALSE; -static double cursor_x; -static double cursor_y; - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void cursor_position_callback(GLFWwindow* window, double x, double y) -{ - printf("%0.3f: Cursor position: %f %f (%f %f)\n", - glfwGetTime(), - x, y, x - cursor_x, y - cursor_y); - - cursor_x = x; - cursor_y = y; -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_D: - glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED); - break; - - case GLFW_KEY_H: - glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_HIDDEN); - break; - - case GLFW_KEY_N: - glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL); - break; - - case GLFW_KEY_R: - reopen = GL_TRUE; - break; - } -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - glViewport(0, 0, width, height); -} - -static GLFWwindow* open_window(void) -{ - GLFWwindow* window = glfwCreateWindow(640, 480, "Peter Detector", NULL, NULL); - if (!window) - return NULL; - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - glfwGetCursorPos(window, &cursor_x, &cursor_y); - printf("Cursor position: %f %f\n", cursor_x, cursor_y); - - glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); - glfwSetCursorPosCallback(window, cursor_position_callback); - glfwSetKeyCallback(window, key_callback); - - return window; -} - -int main(void) -{ - GLFWwindow* window; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - window = open_window(); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glClearColor(0.f, 0.f, 0.f, 0.f); - - while (!glfwWindowShouldClose(window)) - { - glClear(GL_COLOR_BUFFER_BIT); - - glfwSwapBuffers(window); - glfwWaitEvents(); - - if (reopen) - { - glfwDestroyWindow(window); - window = open_window(); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - reopen = GL_FALSE; - } - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/extern/glfw/tests/reopen.c b/extern/glfw/tests/reopen.c deleted file mode 100644 index ca79eed..0000000 --- a/extern/glfw/tests/reopen.c +++ /dev/null @@ -1,177 +0,0 @@ -//======================================================================== -// Window re-opener (open/close stress test) -// Copyright (c) Camilla Berglund -// -// 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. -// -//======================================================================== -// -// This test came about as the result of bug #1262773 -// -// It closes and re-opens the GLFW window every five seconds, alternating -// between windowed and fullscreen mode -// -// It also times and logs opening and closing actions and attempts to separate -// user initiated window closing from its own -// -//======================================================================== - -#include - -#include -#include -#include - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - glViewport(0, 0, width, height); -} - -static void window_close_callback(GLFWwindow* window) -{ - printf("Close callback triggered\n"); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_Q: - case GLFW_KEY_ESCAPE: - glfwSetWindowShouldClose(window, GL_TRUE); - break; - } -} - -static GLFWwindow* open_window(int width, int height, GLFWmonitor* monitor) -{ - double base; - GLFWwindow* window; - - base = glfwGetTime(); - - window = glfwCreateWindow(width, height, "Window Re-opener", monitor, NULL); - if (!window) - return NULL; - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); - glfwSetWindowCloseCallback(window, window_close_callback); - glfwSetKeyCallback(window, key_callback); - - if (monitor) - { - printf("Opening full screen window on monitor %s took %0.3f seconds\n", - glfwGetMonitorName(monitor), - glfwGetTime() - base); - } - else - { - printf("Opening regular window took %0.3f seconds\n", - glfwGetTime() - base); - } - - return window; -} - -static void close_window(GLFWwindow* window) -{ - double base = glfwGetTime(); - glfwDestroyWindow(window); - printf("Closing window took %0.3f seconds\n", glfwGetTime() - base); -} - -int main(int argc, char** argv) -{ - int count = 0; - GLFWwindow* window; - - srand((unsigned int) time(NULL)); - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - for (;;) - { - GLFWmonitor* monitor = NULL; - - if (count % 2 == 0) - { - int monitorCount; - GLFWmonitor** monitors = glfwGetMonitors(&monitorCount); - monitor = monitors[rand() % monitorCount]; - } - - window = open_window(640, 480, monitor); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glMatrixMode(GL_PROJECTION); - glOrtho(-1.f, 1.f, -1.f, 1.f, 1.f, -1.f); - glMatrixMode(GL_MODELVIEW); - - glfwSetTime(0.0); - - while (glfwGetTime() < 5.0) - { - glClear(GL_COLOR_BUFFER_BIT); - - glPushMatrix(); - glRotatef((GLfloat) glfwGetTime() * 100.f, 0.f, 0.f, 1.f); - glRectf(-0.5f, -0.5f, 1.f, 1.f); - glPopMatrix(); - - glfwSwapBuffers(window); - glfwPollEvents(); - - if (glfwWindowShouldClose(window)) - { - close_window(window); - printf("User closed window\n"); - - glfwTerminate(); - exit(EXIT_SUCCESS); - } - } - - printf("Closing window\n"); - close_window(window); - - count++; - } - - glfwTerminate(); -} - diff --git a/extern/glfw/tests/sharing.c b/extern/glfw/tests/sharing.c deleted file mode 100644 index 54b15c8..0000000 --- a/extern/glfw/tests/sharing.c +++ /dev/null @@ -1,184 +0,0 @@ -//======================================================================== -// Context sharing test program -// Copyright (c) Camilla Berglund -// -// 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. -// -//======================================================================== -// -// This program is used to test sharing of objects between contexts -// -//======================================================================== - -#include - -#include -#include - -#define WIDTH 400 -#define HEIGHT 400 -#define OFFSET 50 - -static GLFWwindow* windows[2]; - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action == GLFW_PRESS && key == GLFW_KEY_ESCAPE) - glfwSetWindowShouldClose(window, GL_TRUE); -} - -static GLFWwindow* open_window(const char* title, GLFWwindow* share, int posX, int posY) -{ - GLFWwindow* window; - - glfwWindowHint(GLFW_VISIBLE, GL_FALSE); - window = glfwCreateWindow(WIDTH, HEIGHT, title, NULL, share); - if (!window) - return NULL; - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - glfwSetWindowPos(window, posX, posY); - glfwShowWindow(window); - - glfwSetKeyCallback(window, key_callback); - - return window; -} - -static GLuint create_texture(void) -{ - int x, y; - char pixels[256 * 256]; - GLuint texture; - - glGenTextures(1, &texture); - glBindTexture(GL_TEXTURE_2D, texture); - - for (y = 0; y < 256; y++) - { - for (x = 0; x < 256; x++) - pixels[y * 256 + x] = rand() % 256; - } - - glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, 256, 256, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, pixels); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - - return texture; -} - -static void draw_quad(GLuint texture) -{ - int width, height; - glfwGetFramebufferSize(glfwGetCurrentContext(), &width, &height); - - glViewport(0, 0, width, height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(0.f, 1.f, 0.f, 1.f, 0.f, 1.f); - - glEnable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, texture); - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - - glBegin(GL_QUADS); - - glTexCoord2f(0.f, 0.f); - glVertex2f(0.f, 0.f); - - glTexCoord2f(1.f, 0.f); - glVertex2f(1.f, 0.f); - - glTexCoord2f(1.f, 1.f); - glVertex2f(1.f, 1.f); - - glTexCoord2f(0.f, 1.f); - glVertex2f(0.f, 1.f); - - glEnd(); -} - -int main(int argc, char** argv) -{ - int x, y, width; - GLuint texture; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - windows[0] = open_window("First", NULL, OFFSET, OFFSET); - if (!windows[0]) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - // This is the one and only time we create a texture - // It is created inside the first context, created above - // It will then be shared with the second context, created below - texture = create_texture(); - - glfwGetWindowPos(windows[0], &x, &y); - glfwGetWindowSize(windows[0], &width, NULL); - - // Put the second window to the right of the first one - windows[1] = open_window("Second", windows[0], x + width + OFFSET, y); - if (!windows[1]) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - // Set drawing color for both contexts - glfwMakeContextCurrent(windows[0]); - glColor3f(0.6f, 0.f, 0.6f); - glfwMakeContextCurrent(windows[1]); - glColor3f(0.6f, 0.6f, 0.f); - - glfwMakeContextCurrent(windows[0]); - - while (!glfwWindowShouldClose(windows[0]) && - !glfwWindowShouldClose(windows[1])) - { - glfwMakeContextCurrent(windows[0]); - draw_quad(texture); - - glfwMakeContextCurrent(windows[1]); - draw_quad(texture); - - glfwSwapBuffers(windows[0]); - glfwSwapBuffers(windows[1]); - - glfwWaitEvents(); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/extern/glfw/tests/tearing.c b/extern/glfw/tests/tearing.c deleted file mode 100644 index 94865fa..0000000 --- a/extern/glfw/tests/tearing.c +++ /dev/null @@ -1,130 +0,0 @@ -//======================================================================== -// Vsync enabling test -// Copyright (c) Camilla Berglund -// -// 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. -// -//======================================================================== -// -// This test renders a high contrast, horizontally moving bar, allowing for -// visual verification of whether the set swap interval is indeed obeyed -// -//======================================================================== - -#include - -#include -#include -#include - -static int swap_interval; -static double frame_rate; - -static void update_window_title(GLFWwindow* window) -{ - char title[256]; - - sprintf(title, "Tearing detector (interval %i, %0.1f Hz)", - swap_interval, frame_rate); - - glfwSetWindowTitle(window, title); -} - -static void set_swap_interval(GLFWwindow* window, int interval) -{ - swap_interval = interval; - glfwSwapInterval(swap_interval); - update_window_title(window); -} - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - glViewport(0, 0, width, height); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key == GLFW_KEY_SPACE && action == GLFW_PRESS) - set_swap_interval(window, 1 - swap_interval); -} - -int main(void) -{ - float position; - unsigned long frame_count = 0; - double last_time, current_time; - GLFWwindow* window; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - window = glfwCreateWindow(640, 480, "", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - set_swap_interval(window, 0); - - last_time = glfwGetTime(); - frame_rate = 0.0; - - glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); - glfwSetKeyCallback(window, key_callback); - - glMatrixMode(GL_PROJECTION); - glOrtho(-1.f, 1.f, -1.f, 1.f, 1.f, -1.f); - glMatrixMode(GL_MODELVIEW); - - while (!glfwWindowShouldClose(window)) - { - glClear(GL_COLOR_BUFFER_BIT); - - position = cosf((float) glfwGetTime() * 4.f) * 0.75f; - glRectf(position - 0.25f, -1.f, position + 0.25f, 1.f); - - glfwSwapBuffers(window); - glfwPollEvents(); - - frame_count++; - - current_time = glfwGetTime(); - if (current_time - last_time > 1.0) - { - frame_rate = frame_count / (current_time - last_time); - frame_count = 0; - last_time = current_time; - update_window_title(window); - } - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/extern/glfw/tests/threads.c b/extern/glfw/tests/threads.c deleted file mode 100644 index 78519c7..0000000 --- a/extern/glfw/tests/threads.c +++ /dev/null @@ -1,135 +0,0 @@ -//======================================================================== -// Multithreading test -// Copyright (c) Camilla Berglund -// -// 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. -// -//======================================================================== -// -// This test is intended to verify whether the OpenGL context part of -// the GLFW API is able to be used from multiple threads -// -//======================================================================== - -#include "tinycthread.h" - -#include - -#include -#include -#include - -typedef struct -{ - GLFWwindow* window; - const char* title; - float r, g, b; - thrd_t id; -} Thread; - -static volatile GLboolean running = GL_TRUE; - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static int thread_main(void* data) -{ - const Thread* thread = data; - - glfwMakeContextCurrent(thread->window); - glfwSwapInterval(1); - - while (running) - { - const float v = (float) fabs(sin(glfwGetTime() * 2.f)); - glClearColor(thread->r * v, thread->g * v, thread->b * v, 0.f); - - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(thread->window); - } - - glfwMakeContextCurrent(NULL); - return 0; -} - -int main(void) -{ - int i, result; - Thread threads[] = - { - { NULL, "Red", 1.f, 0.f, 0.f, 0 }, - { NULL, "Green", 0.f, 1.f, 0.f, 0 }, - { NULL, "Blue", 0.f, 0.f, 1.f, 0 } - }; - const int count = sizeof(threads) / sizeof(Thread); - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - glfwWindowHint(GLFW_VISIBLE, GL_FALSE); - - for (i = 0; i < count; i++) - { - threads[i].window = glfwCreateWindow(200, 200, - threads[i].title, - NULL, NULL); - if (!threads[i].window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwSetWindowPos(threads[i].window, 200 + 250 * i, 200); - glfwShowWindow(threads[i].window); - - if (thrd_create(&threads[i].id, thread_main, threads + i) != - thrd_success) - { - fprintf(stderr, "Failed to create secondary thread\n"); - - glfwTerminate(); - exit(EXIT_FAILURE); - } - } - - while (running) - { - glfwWaitEvents(); - - for (i = 0; i < count; i++) - { - if (glfwWindowShouldClose(threads[i].window)) - running = GL_FALSE; - } - } - - for (i = 0; i < count; i++) - glfwHideWindow(threads[i].window); - - for (i = 0; i < count; i++) - thrd_join(threads[i].id, &result); - - exit(EXIT_SUCCESS); -} - diff --git a/extern/glfw/tests/title.c b/extern/glfw/tests/title.c deleted file mode 100644 index 15ddb83..0000000 --- a/extern/glfw/tests/title.c +++ /dev/null @@ -1,76 +0,0 @@ -//======================================================================== -// UTF-8 window title test -// Copyright (c) Camilla Berglund -// -// 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. -// -//======================================================================== -// -// This test sets a UTF-8 window title -// -//======================================================================== - -#include - -#include -#include - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - glViewport(0, 0, width, height); -} - -int main(void) -{ - GLFWwindow* window; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - window = glfwCreateWindow(400, 400, "English 日本語 русский язык 官話", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - glfwSwapInterval(1); - - glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); - - while (!glfwWindowShouldClose(window)) - { - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(window); - glfwWaitEvents(); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/extern/glfw/tests/windows.c b/extern/glfw/tests/windows.c deleted file mode 100644 index 164a298..0000000 --- a/extern/glfw/tests/windows.c +++ /dev/null @@ -1,117 +0,0 @@ -//======================================================================== -// Simple multi-window test -// Copyright (c) Camilla Berglund -// -// 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. -// -//======================================================================== -// -// This test creates four windows and clears each in a different color -// -//======================================================================== - -#include - -#include -#include - -static const char* titles[4] = -{ - "Foo", - "Bar", - "Baz", - "Quux" -}; - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key == GLFW_KEY_SPACE && action == GLFW_PRESS) - { - int xpos, ypos; - glfwGetWindowPos(window, &xpos, &ypos); - glfwSetWindowPos(window, xpos, ypos); - } -} - -int main(void) -{ - int i; - GLboolean running = GL_TRUE; - GLFWwindow* windows[4]; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - glfwWindowHint(GLFW_VISIBLE, GL_FALSE); - - for (i = 0; i < 4; i++) - { - int left, top, right, bottom; - - windows[i] = glfwCreateWindow(200, 200, titles[i], NULL, NULL); - if (!windows[i]) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwSetKeyCallback(windows[i], key_callback); - - glfwMakeContextCurrent(windows[i]); - glClearColor((GLclampf) (i & 1), - (GLclampf) (i >> 1), - i ? 0.f : 1.f, - 0.f); - - glfwGetWindowFrameSize(windows[i], &left, &top, &right, &bottom); - glfwSetWindowPos(windows[i], - 100 + (i & 1) * (200 + left + right), - 100 + (i >> 1) * (200 + top + bottom)); - } - - for (i = 0; i < 4; i++) - glfwShowWindow(windows[i]); - - while (running) - { - for (i = 0; i < 4; i++) - { - glfwMakeContextCurrent(windows[i]); - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(windows[i]); - - if (glfwWindowShouldClose(windows[i])) - running = GL_FALSE; - } - - glfwPollEvents(); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} -