Disabled external gits
This commit is contained in:
		
							
								
								
									
										17
									
								
								cs440-acg/ext/nanogui/.appveyor.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								cs440-acg/ext/nanogui/.appveyor.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
			
		||||
version: 1.0.{build}
 | 
			
		||||
os: Visual Studio 2015
 | 
			
		||||
test: off
 | 
			
		||||
clone_folder: C:\projects\nanogui
 | 
			
		||||
branches:
 | 
			
		||||
  only:
 | 
			
		||||
    - master
 | 
			
		||||
install:
 | 
			
		||||
  - git submodule update --init --recursive
 | 
			
		||||
  - cinstall: python
 | 
			
		||||
build_script:
 | 
			
		||||
  - echo Running cmake...
 | 
			
		||||
  - cd c:\projects\nanogui
 | 
			
		||||
  - cmake -G "Visual Studio 14 2015 Win64" -DPYTHON_EXECUTABLE:FILEPATH=C:/Python34-x64/python.exe .
 | 
			
		||||
  - set MSBuildLogger="C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
 | 
			
		||||
  - set MSBuildOptions=/v:m /p:Configuration=Release /logger:%MSBuildLogger%
 | 
			
		||||
  - msbuild %MSBuildOptions% nanogui.sln
 | 
			
		||||
							
								
								
									
										49
									
								
								cs440-acg/ext/nanogui/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								cs440-acg/ext/nanogui/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,49 @@
 | 
			
		||||
*.exe
 | 
			
		||||
*.lib
 | 
			
		||||
*.cmake
 | 
			
		||||
.DS_Store
 | 
			
		||||
ext_build
 | 
			
		||||
nanogui_resources.*
 | 
			
		||||
build
 | 
			
		||||
CMakeCache.txt
 | 
			
		||||
CMakeFiles
 | 
			
		||||
.ninja_deps
 | 
			
		||||
.ninja_log
 | 
			
		||||
build.ninja
 | 
			
		||||
rules.ninja
 | 
			
		||||
Makefile
 | 
			
		||||
bin2c
 | 
			
		||||
example[1-9]
 | 
			
		||||
example[1-9].bc
 | 
			
		||||
example[1-9].wasm
 | 
			
		||||
example[1-9].js
 | 
			
		||||
example[1-9].exe
 | 
			
		||||
example_icons
 | 
			
		||||
example_icons.bc
 | 
			
		||||
example_icons.js
 | 
			
		||||
example_icons.wasm
 | 
			
		||||
example_icons.exe
 | 
			
		||||
icons
 | 
			
		||||
*~
 | 
			
		||||
nanogui*.so
 | 
			
		||||
nanogui*.pyd
 | 
			
		||||
libnanogui.so
 | 
			
		||||
libnanogui.a
 | 
			
		||||
libnanogui.bc
 | 
			
		||||
libnanogui.dylib
 | 
			
		||||
*.metallib
 | 
			
		||||
.vscode/
 | 
			
		||||
# html documentation specific
 | 
			
		||||
*.pyc
 | 
			
		||||
docs/_build
 | 
			
		||||
docs/doxyoutput
 | 
			
		||||
docs/api
 | 
			
		||||
 | 
			
		||||
# entypo update generation
 | 
			
		||||
# this is it's own repo: https://github.com/svenevs/nanogui-entypo
 | 
			
		||||
# should not ever be needed again unless there are new
 | 
			
		||||
# icons added :)
 | 
			
		||||
resources/nanogui-entypo
 | 
			
		||||
 | 
			
		||||
compile_commands.json
 | 
			
		||||
.clangd
 | 
			
		||||
							
								
								
									
										12
									
								
								cs440-acg/ext/nanogui/.gitmodules
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								cs440-acg/ext/nanogui/.gitmodules
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
			
		||||
[submodule "ext/nanovg"]
 | 
			
		||||
    path = ext/nanovg
 | 
			
		||||
    url = https://github.com/wjakob/nanovg
 | 
			
		||||
[submodule "ext/nanovg_metal"]
 | 
			
		||||
    path = ext/nanovg_metal
 | 
			
		||||
    url = https://github.com/wjakob/nanovg_metal
 | 
			
		||||
[submodule "ext/glfw"]
 | 
			
		||||
    path = ext/glfw
 | 
			
		||||
    url = https://github.com/wjakob/glfw
 | 
			
		||||
[submodule "ext/pybind11"]
 | 
			
		||||
	path = ext/pybind11
 | 
			
		||||
	url = https://github.com/pybind/pybind11
 | 
			
		||||
							
								
								
									
										47
									
								
								cs440-acg/ext/nanogui/.travis.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								cs440-acg/ext/nanogui/.travis.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,47 @@
 | 
			
		||||
language: cpp
 | 
			
		||||
dist: trusty
 | 
			
		||||
sudo: false
 | 
			
		||||
 | 
			
		||||
# Only build master branch, other branches will have a Pull Request build.
 | 
			
		||||
branches:
 | 
			
		||||
  only:
 | 
			
		||||
    - master
 | 
			
		||||
 | 
			
		||||
matrix:
 | 
			
		||||
  include:
 | 
			
		||||
    - os: linux
 | 
			
		||||
      compiler: gcc-4.8
 | 
			
		||||
      addons:
 | 
			
		||||
        apt:
 | 
			
		||||
          sources:
 | 
			
		||||
            - ubuntu-toolchain-r-test
 | 
			
		||||
            - deadsnakes
 | 
			
		||||
            - kubuntu-backports
 | 
			
		||||
          packages:
 | 
			
		||||
            - g++-4.8
 | 
			
		||||
            - python3.5
 | 
			
		||||
            - python3.5-dev
 | 
			
		||||
            - python3.5-venv
 | 
			
		||||
            - libglu1-mesa-dev
 | 
			
		||||
            - libxxf86vm-dev
 | 
			
		||||
            - libxrandr-dev
 | 
			
		||||
            - libxinerama-dev
 | 
			
		||||
            - libxcursor-dev
 | 
			
		||||
            - libxi-dev
 | 
			
		||||
            - libx11-dev
 | 
			
		||||
            - cmake
 | 
			
		||||
      script:
 | 
			
		||||
        - cmake --version
 | 
			
		||||
        - cmake -DNANOGUI_USE_GLAD=ON -DNANOGUI_PYTHON_VERSION=3.5 -DPYTHON_INCLUDE_DIRS:PATH=/usr/include/python3.5m -DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.5m.so -DCMAKE_CXX_COMPILER=g++-4.8 -DCMAKE_C_COMPILER=gcc-4.8
 | 
			
		||||
        - make -j 2
 | 
			
		||||
    - os: osx
 | 
			
		||||
      compiler: clang
 | 
			
		||||
      script:
 | 
			
		||||
        - cmake --version
 | 
			
		||||
        - cmake -DNANOGUI_PYTHON_VERSION=2.7
 | 
			
		||||
        - make -j 2
 | 
			
		||||
    - os: linux
 | 
			
		||||
      language: docs
 | 
			
		||||
      env: STYLE
 | 
			
		||||
      script:
 | 
			
		||||
      - resources/check-style.sh
 | 
			
		||||
							
								
								
									
										533
									
								
								cs440-acg/ext/nanogui/CMakeLists.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										533
									
								
								cs440-acg/ext/nanogui/CMakeLists.txt
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,533 @@
 | 
			
		||||
cmake_minimum_required (VERSION 3.13..3.18)
 | 
			
		||||
 | 
			
		||||
project(nanogui
 | 
			
		||||
  DESCRIPTION
 | 
			
		||||
    "NanoGUI"
 | 
			
		||||
  LANGUAGES
 | 
			
		||||
    CXX C
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
if (NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/ext/glfw/src")
 | 
			
		||||
  message(FATAL_ERROR "The NanoGUI dependency repositories (GLFW, etc.) are missing! "
 | 
			
		||||
    "You probably did not clone the project with --recursive. It is possible to recover "
 | 
			
		||||
    "by calling \"git submodule update --init --recursive\"")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
 | 
			
		||||
  message(STATUS "Setting build type to 'Release' as none was specified.")
 | 
			
		||||
  set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
 | 
			
		||||
  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
 | 
			
		||||
    "MinSizeRel" "RelWithDebInfo")
 | 
			
		||||
endif()
 | 
			
		||||
string(TOUPPER "${CMAKE_BUILD_TYPE}" U_CMAKE_BUILD_TYPE)
 | 
			
		||||
 | 
			
		||||
set(NANOGUI_MASTER_PROJECT OFF)
 | 
			
		||||
if (${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
 | 
			
		||||
  set(NANOGUI_MASTER_PROJECT ON)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (WIN32)
 | 
			
		||||
  set(NANOGUI_BUILD_GLAD_DEFAULT ON)
 | 
			
		||||
else()
 | 
			
		||||
  set(NANOGUI_BUILD_GLAD_DEFAULT OFF)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
set(NANOGUI_BUILD_SHARED_DEFAULT ON)
 | 
			
		||||
set(NANOGUI_BUILD_PYTHON_DEFAULT ON)
 | 
			
		||||
set(NANOGUI_BUILD_GLFW_DEFAULT ON)
 | 
			
		||||
 | 
			
		||||
if (CMAKE_CXX_COMPILER MATCHES "/em\\+\\+(-[a-zA-Z0-9.])?$")
 | 
			
		||||
  set(CMAKE_CXX_COMPILER_ID "Emscripten")
 | 
			
		||||
  set(NANOGUI_BUILD_SHARED_DEFAULT OFF)
 | 
			
		||||
  set(NANOGUI_BUILD_PYTHON_DEFAULT OFF)
 | 
			
		||||
  set(NANOGUI_BUILD_GLAD_DEFAULT   OFF)
 | 
			
		||||
  set(NANOGUI_BUILD_GLFW_DEFAULT   OFF)
 | 
			
		||||
 | 
			
		||||
  set(CMAKE_STATIC_LIBRARY_SUFFIX ".bc")
 | 
			
		||||
  set(CMAKE_EXECUTABLE_SUFFIX ".bc")
 | 
			
		||||
  set(CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_CXX_COMPILER> -o <TARGET> <LINK_FLAGS> <OBJECTS>")
 | 
			
		||||
  if (U_CMAKE_BUILD_TYPE MATCHES REL)
 | 
			
		||||
    add_compile_options(-O3 -DNDEBUG)
 | 
			
		||||
  endif()
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
option(NANOGUI_BUILD_EXAMPLES            "Build NanoGUI example application?" ON)
 | 
			
		||||
option(NANOGUI_BUILD_SHARED              "Build NanoGUI as a shared library?" ${NANOGUI_BUILD_SHARED_DEFAULT})
 | 
			
		||||
option(NANOGUI_BUILD_PYTHON              "Build a Python plugin for NanoGUI?" ${NANOGUI_BUILD_PYTHON_DEFAULT})
 | 
			
		||||
option(NANOGUI_BUILD_GLAD                "Build GLAD OpenGL loader library? (needed on Windows)" ${NANOGUI_BUILD_GLAD_DEFAULT})
 | 
			
		||||
option(NANOGUI_BUILD_GLFW                "Build GLFW?" ${NANOGUI_BUILD_GLFW_DEFAULT})
 | 
			
		||||
option(NANOGUI_INSTALL                   "Install NanoGUI on `make install`?" ON)
 | 
			
		||||
 | 
			
		||||
if (NOT NANOGUI_BACKEND)
 | 
			
		||||
  if (CMAKE_SYSTEM_PROCESSOR MATCHES "armv7" OR
 | 
			
		||||
      CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" OR
 | 
			
		||||
      CMAKE_CXX_COMPILER MATCHES "/em\\+\\+(-[a-zA-Z0-9.])?$")
 | 
			
		||||
    set(NANOGUI_BACKEND_DEFAULT "GLES 2")
 | 
			
		||||
  elseif (APPLE)
 | 
			
		||||
    set(NANOGUI_BACKEND_DEFAULT "Metal")
 | 
			
		||||
  else()
 | 
			
		||||
    set(NANOGUI_BACKEND_DEFAULT "OpenGL")
 | 
			
		||||
  endif()
 | 
			
		||||
 | 
			
		||||
  set(NANOGUI_BACKEND ${NANOGUI_BACKEND_DEFAULT} CACHE STRING "Choose the backend used for rendering (OpenGL/GLES 2/GLES 3/Metal)" FORCE)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
set_property(CACHE NANOGUI_BACKEND PROPERTY STRINGS "OpenGL" "GLES 2" "GLES 3" "Metal")
 | 
			
		||||
 | 
			
		||||
# Required libraries, flags, and include files for compiling and linking against nanogui (all targets)
 | 
			
		||||
set(NANOGUI_EXTRA_INCS "")
 | 
			
		||||
 | 
			
		||||
include(CheckCXXCompilerFlag)
 | 
			
		||||
include(CheckCXXSourceRuns)
 | 
			
		||||
 | 
			
		||||
macro(CHECK_CXX_COMPILER_AND_LINKER_FLAGS _RESULT _CXX_FLAGS _LINKER_FLAGS)
 | 
			
		||||
  set(CMAKE_REQUIRED_FLAGS ${_CXX_FLAGS})
 | 
			
		||||
  set(CMAKE_REQUIRED_LIBRARIES ${_LINKER_FLAGS})
 | 
			
		||||
  set(CMAKE_REQUIRED_QUIET TRUE)
 | 
			
		||||
  check_cxx_source_runs("#include <iostream>\nint main(int argc, char **argv) { std::cout << \"test\"; return 0; }" ${_RESULT})
 | 
			
		||||
  set(CMAKE_REQUIRED_FLAGS "")
 | 
			
		||||
  set(CMAKE_REQUIRED_LIBRARIES "")
 | 
			
		||||
endmacro()
 | 
			
		||||
 | 
			
		||||
if (NANOGUI_BACKEND MATCHES "(OpenGL|GLES 2|GLES 3)")
 | 
			
		||||
  list(APPEND NANOGUI_EXTRA
 | 
			
		||||
    src/texture_gl.cpp src/shader_gl.cpp
 | 
			
		||||
    src/renderpass_gl.cpp src/opengl.cpp
 | 
			
		||||
    src/opengl_check.h
 | 
			
		||||
  )
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (NANOGUI_BACKEND STREQUAL "OpenGL")
 | 
			
		||||
  set(NANOGUI_BACKEND_DEFS -DNANOGUI_USE_OPENGL)
 | 
			
		||||
  set(NANOGUI_GLOB "resources/*.gl")
 | 
			
		||||
  message(STATUS "NanoGUI: using OpenGL backend.")
 | 
			
		||||
elseif (NANOGUI_BACKEND STREQUAL "GLES 2")
 | 
			
		||||
  set(NANOGUI_BACKEND_DEFS -DNANOGUI_USE_GLES -DNANOGUI_GLES_VERSION=2)
 | 
			
		||||
  set(NANOGUI_GLOB "resources/*.gles")
 | 
			
		||||
  message(STATUS "NanoGUI: using GLES 2 backend.")
 | 
			
		||||
elseif (NANOGUI_BACKEND STREQUAL "GLES 3")
 | 
			
		||||
  set(NANOGUI_BACKEND_DEFS -DNANOGUI_USE_GLES -DNANOGUI_GLES_VERSION=3)
 | 
			
		||||
  set(NANOGUI_GLOB "resources/*.gles")
 | 
			
		||||
  message(STATUS "NanoGUI: using GLES 3 backend.")
 | 
			
		||||
elseif (NANOGUI_BACKEND STREQUAL "Metal")
 | 
			
		||||
  set(NANOGUI_BACKEND_DEFS -DNANOGUI_USE_METAL)
 | 
			
		||||
  list(APPEND NANOGUI_EXTRA
 | 
			
		||||
    ext/nanovg_metal/src/nanovg_mtl.m ext/nanovg_metal/src/nanovg_mtl.h
 | 
			
		||||
    src/texture_metal.mm src/shader_metal.mm src/renderpass_metal.mm
 | 
			
		||||
  )
 | 
			
		||||
  set(NANOGUI_GLOB "resources/*.metal")
 | 
			
		||||
  include_directories(ext/nanovg_metal/src)
 | 
			
		||||
  message(STATUS "NanoGUI: using Metal backend.")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
# Shared library mode: add dllimport/dllexport flags to all symbols
 | 
			
		||||
if (NANOGUI_BUILD_SHARED)
 | 
			
		||||
  message(STATUS "NanoGUI: building shared library.")
 | 
			
		||||
else()
 | 
			
		||||
  message(STATUS "NanoGUI: building static library.")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (MSVC)
 | 
			
		||||
  # Disable annoying MSVC warnings (all targets)
 | 
			
		||||
  add_definitions(/D "_CRT_SECURE_NO_WARNINGS")
 | 
			
		||||
 | 
			
		||||
  # Parallel build on MSVC (all targets)
 | 
			
		||||
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
# Compile with compiler warnings turned on
 | 
			
		||||
if (MSVC)
 | 
			
		||||
  if (CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
 | 
			
		||||
    string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
 | 
			
		||||
  else()
 | 
			
		||||
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
 | 
			
		||||
  endif()
 | 
			
		||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
 | 
			
		||||
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
# Use C++17, visibility=hidden by default, interprocedural optimization
 | 
			
		||||
set(CMAKE_CXX_STANDARD 17)
 | 
			
		||||
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
 | 
			
		||||
 | 
			
		||||
# Prefer libc++ in conjunction with Clang
 | 
			
		||||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT CMAKE_CXX_FLAGS MATCHES "-stdlib=libc\\+\\+")
 | 
			
		||||
  CHECK_CXX_COMPILER_AND_LINKER_FLAGS(HAS_LIBCPP "-stdlib=libc++" "-stdlib=libc++")
 | 
			
		||||
  if (HAS_LIBCPP)
 | 
			
		||||
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -D_LIBCPP_VERSION")
 | 
			
		||||
    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++")
 | 
			
		||||
    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -stdlib=libc++")
 | 
			
		||||
    message(STATUS "NanoGUI: using libc++.")
 | 
			
		||||
  else()
 | 
			
		||||
    CHECK_CXX_COMPILER_AND_LINKER_FLAGS(HAS_LIBCPP_AND_CPPABI "-stdlib=libc++" "-stdlib=libc++ -lc++abi")
 | 
			
		||||
    if (HAS_LIBCPP_AND_CPPABI)
 | 
			
		||||
      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -D_LIBCPP_VERSION")
 | 
			
		||||
      set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -lc++abi")
 | 
			
		||||
      set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -stdlib=libc++ -lc++abi")
 | 
			
		||||
      message(STATUS "NanoGUI: using libc++ and libc++abi.")
 | 
			
		||||
    else()
 | 
			
		||||
      message(FATAL_ERROR "When Clang is used to compile NanoGUI, libc++ must be available -- GCC's libstdc++ is not supported! (please insteall the libc++ development headers, provided e.g. by the packages 'libc++-dev' and 'libc++abi-dev' on Debian/Ubuntu).")
 | 
			
		||||
    endif()
 | 
			
		||||
  endif()
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
# Compile GLFW
 | 
			
		||||
if (NANOGUI_BUILD_GLFW)
 | 
			
		||||
  set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL " " FORCE)
 | 
			
		||||
  set(GLFW_BUILD_TESTS OFF CACHE BOOL " " FORCE)
 | 
			
		||||
  set(GLFW_BUILD_DOCS OFF CACHE BOOL " " FORCE)
 | 
			
		||||
  set(GLFW_BUILD_INSTALL OFF CACHE BOOL " " FORCE)
 | 
			
		||||
  set(GLFW_INSTALL OFF CACHE BOOL " " FORCE)
 | 
			
		||||
  set(GLFW_USE_CHDIR OFF CACHE BOOL " " FORCE)
 | 
			
		||||
  set(BUILD_SHARED_LIBS ${NANOGUI_BUILD_SHARED} CACHE BOOL " " FORCE)
 | 
			
		||||
 | 
			
		||||
  if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
 | 
			
		||||
    # Quench annoying deprecation warnings when compiling GLFW on OSX
 | 
			
		||||
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations")
 | 
			
		||||
  endif()
 | 
			
		||||
 | 
			
		||||
  add_subdirectory(ext/glfw)
 | 
			
		||||
 | 
			
		||||
  # Two targets have now been defined: `glfw_objects`, which will be merged into
 | 
			
		||||
  # NanoGUI at the end, and `glfw`.  The `glfw` target is the library itself
 | 
			
		||||
  # (e.g., libglfw.so), but can be skipped as we do not need to link against it
 | 
			
		||||
  # (because we merge `glfw_objects` into NanoGUI).  Skipping is required for
 | 
			
		||||
  # XCode, but preferable for all build systems (reduces build artifacts).
 | 
			
		||||
  set_target_properties(glfw PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1)
 | 
			
		||||
 | 
			
		||||
  mark_as_advanced(
 | 
			
		||||
    GLFW_BUILD_DOCS GLFW_BUILD_EXAMPLES GLFW_BUILD_INSTALL GLFW_BUILD_TESTS
 | 
			
		||||
    GLFW_DOCUMENT_INTERNALS GLFW_INSTALL GLFW_USE_CHDIR GLFW_USE_MENUBAR
 | 
			
		||||
    GLFW_USE_OSMESA GLFW_VULKAN_STATIC GLFW_USE_RETINA GLFW_USE_MIR
 | 
			
		||||
    BUILD_SHARED_LIBS USE_MSVC_RUNTIME_LIBRARY_DLL)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (NANOGUI_BUILD_GLAD)
 | 
			
		||||
  # Build and include GLAD on Windows
 | 
			
		||||
  list(APPEND NANOGUI_EXTRA
 | 
			
		||||
    ext/glad/src/glad.c
 | 
			
		||||
    ext/glad/include/glad/glad.h
 | 
			
		||||
    ext/glad/include/KHR/khrplatform.h)
 | 
			
		||||
  if (MSVC)
 | 
			
		||||
    set_source_files_properties(ext/glad/src/glad.c
 | 
			
		||||
      PROPERTIES COMPILE_FLAGS /wd4055)
 | 
			
		||||
  endif()
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (${CMAKE_SYSTEM_NAME} MATCHES "BSD")
 | 
			
		||||
  include_directories(/usr/local/include)
 | 
			
		||||
  link_directories(/usr/local/lib)
 | 
			
		||||
  if (${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
 | 
			
		||||
    include_directories(/usr/X11R6/include/)
 | 
			
		||||
    link_directories(/usr/X11R6/lib)
 | 
			
		||||
  endif()
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
# Required core libraries on various platforms
 | 
			
		||||
if (${CMAKE_CXX_COMPILER_ID} MATCHES "Emscripten")
 | 
			
		||||
  # No dependencies
 | 
			
		||||
elseif (WIN32)
 | 
			
		||||
  list(APPEND NANOGUI_LIBS opengl32)
 | 
			
		||||
elseif (APPLE)
 | 
			
		||||
  find_library(cocoa_library Cocoa)
 | 
			
		||||
  find_library(iokit_library IOKit)
 | 
			
		||||
  list(APPEND NANOGUI_LIBS ${cocoa_library} ${iokit_library})
 | 
			
		||||
  mark_as_advanced(cocoa_library iokit_library)
 | 
			
		||||
 | 
			
		||||
  if (NANOGUI_BACKEND STREQUAL "OpenGL")
 | 
			
		||||
    find_library(corevideo_library CoreVideo)
 | 
			
		||||
    find_library(opengl_library OpenGL)
 | 
			
		||||
 | 
			
		||||
    # Disable OpenGL deprecation warnings
 | 
			
		||||
    add_definitions(-DGL_SILENCE_DEPRECATION)
 | 
			
		||||
    list(APPEND NANOGUI_LIBS ${opengl_library} ${corevideo_library})
 | 
			
		||||
    mark_as_advanced(opengl_library corevideo_library)
 | 
			
		||||
  else()
 | 
			
		||||
    find_library(metal_library Metal)
 | 
			
		||||
    find_library(quartzcore_library QuartzCore)
 | 
			
		||||
    list(APPEND NANOGUI_LIBS ${metal_library} ${quartzcore_library})
 | 
			
		||||
    mark_as_advanced(metal_library quartzcore_library)
 | 
			
		||||
  endif()
 | 
			
		||||
  list(APPEND NANOGUI_EXTRA src/darwin.mm)
 | 
			
		||||
elseif (CMAKE_SYSTEM MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "BSD")
 | 
			
		||||
  list(APPEND NANOGUI_LIBS X11 pthread)
 | 
			
		||||
  if (NANOGUI_BACKEND STREQUAL "OpenGL")
 | 
			
		||||
    list(APPEND NANOGUI_LIBS GL)
 | 
			
		||||
  elseif (NANOGUI_BACKEND STREQUAL "GLES 2")
 | 
			
		||||
    list(APPEND NANOGUI_LIBS GLESv2)
 | 
			
		||||
  elseif (NANOGUI_BACKEND STREQUAL "GLES 3")
 | 
			
		||||
    list(APPEND NANOGUI_LIBS GLESv3)
 | 
			
		||||
  endif()
 | 
			
		||||
  if (NOT CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
 | 
			
		||||
    list(APPEND NANOGUI_LIBS rt)
 | 
			
		||||
  endif()
 | 
			
		||||
  if (CMAKE_SYSTEM MATCHES "Linux")
 | 
			
		||||
    list(APPEND NANOGUI_LIBS dl)
 | 
			
		||||
  endif()
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
# Run simple cmake converter to put font files into the data segment
 | 
			
		||||
 | 
			
		||||
# Glob up resource files
 | 
			
		||||
file(GLOB resources
 | 
			
		||||
  "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.ttf"
 | 
			
		||||
  "${NANOGUI_GLOB}")
 | 
			
		||||
 | 
			
		||||
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/resources")
 | 
			
		||||
 | 
			
		||||
# Precompile .metal shaders to .metallib files
 | 
			
		||||
foreach(fname_in IN LISTS resources)
 | 
			
		||||
  if (NANOGUI_BACKEND STREQUAL "Metal" AND fname_in MATCHES "\\.metal")
 | 
			
		||||
    get_filename_component(fname_out ${fname_in} NAME)
 | 
			
		||||
    set(fname_out "${CMAKE_CURRENT_BINARY_DIR}/resources/${fname_out}lib")
 | 
			
		||||
    add_custom_command(
 | 
			
		||||
        OUTPUT ${fname_out}
 | 
			
		||||
        DEPENDS ${fname_in}
 | 
			
		||||
        COMMAND xcrun -sdk macosx metal -std=osx-metal2.0 -O3 "${fname_in}" -o "${fname_out}"
 | 
			
		||||
        VERBATIM
 | 
			
		||||
    )
 | 
			
		||||
  else()
 | 
			
		||||
    set(fname_out "${fname_in}")
 | 
			
		||||
  endif()
 | 
			
		||||
  list(APPEND resources_processed ${fname_out})
 | 
			
		||||
endforeach()
 | 
			
		||||
 | 
			
		||||
# Concatenate resource files into a comma separated string
 | 
			
		||||
string(REGEX REPLACE "([^\\]|^);" "\\1," resources_string "${resources_processed}")
 | 
			
		||||
string(REGEX REPLACE "[\\](.)" "\\1" resources_string "${resources_string}")
 | 
			
		||||
 | 
			
		||||
# Create command line for running bin2c cmake script
 | 
			
		||||
set(bin2c_cmdline
 | 
			
		||||
  -DOUTPUT_C=nanogui_resources.cpp
 | 
			
		||||
  -DOUTPUT_H=nanogui_resources.h
 | 
			
		||||
  "-DINPUT_FILES=${resources_string}"
 | 
			
		||||
  -P "${CMAKE_CURRENT_SOURCE_DIR}/resources/bin2c.cmake")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Run bin2c on resource files
 | 
			
		||||
add_custom_command(
 | 
			
		||||
  OUTPUT nanogui_resources.cpp nanogui_resources.h
 | 
			
		||||
  COMMAND ${CMAKE_COMMAND} ARGS ${bin2c_cmdline}
 | 
			
		||||
  DEPENDS ${resources} ${resources_processed}
 | 
			
		||||
  COMMENT "Running bin2c"
 | 
			
		||||
  PRE_BUILD VERBATIM)
 | 
			
		||||
 | 
			
		||||
# Needed to generated files
 | 
			
		||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
 | 
			
		||||
 | 
			
		||||
# Set library type
 | 
			
		||||
if (NANOGUI_BUILD_SHARED)
 | 
			
		||||
  set(NANOGUI_LIBRARY_TYPE "SHARED")
 | 
			
		||||
else()
 | 
			
		||||
  set(NANOGUI_LIBRARY_TYPE "STATIC")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
 | 
			
		||||
  # Use automatic reference counting for Objective-C portions
 | 
			
		||||
  add_compile_options(-fobjc-arc)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (NANOGUI_BUILD_GLFW)
 | 
			
		||||
  list(APPEND NANOGUI_EXTRA $<TARGET_OBJECTS:glfw_objects>)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
# Compile main NanoGUI library
 | 
			
		||||
add_library(nanogui ${NANOGUI_LIBRARY_TYPE} 
 | 
			
		||||
  # Merge NanoVG into the NanoGUI library
 | 
			
		||||
  ext/nanovg/src/nanovg.c
 | 
			
		||||
  ext/nanovg/src/stb_image.h
 | 
			
		||||
 | 
			
		||||
  # Merge GLAD into the NanoGUI library (only if needed)
 | 
			
		||||
  ${NANOGUI_EXTRA}
 | 
			
		||||
 | 
			
		||||
  # Fonts etc.
 | 
			
		||||
  nanogui_resources.cpp
 | 
			
		||||
  include/nanogui/common.h src/common.cpp
 | 
			
		||||
  include/nanogui/widget.h src/widget.cpp
 | 
			
		||||
  include/nanogui/theme.h src/theme.cpp
 | 
			
		||||
  include/nanogui/layout.h src/layout.cpp
 | 
			
		||||
  include/nanogui/screen.h src/screen.cpp
 | 
			
		||||
  include/nanogui/label.h src/label.cpp
 | 
			
		||||
  include/nanogui/window.h src/window.cpp
 | 
			
		||||
  include/nanogui/popup.h src/popup.cpp
 | 
			
		||||
  include/nanogui/checkbox.h src/checkbox.cpp
 | 
			
		||||
  include/nanogui/button.h src/button.cpp
 | 
			
		||||
  include/nanogui/popupbutton.h src/popupbutton.cpp
 | 
			
		||||
  include/nanogui/combobox.h src/combobox.cpp
 | 
			
		||||
  include/nanogui/progressbar.h src/progressbar.cpp
 | 
			
		||||
  include/nanogui/slider.h src/slider.cpp
 | 
			
		||||
  include/nanogui/messagedialog.h src/messagedialog.cpp
 | 
			
		||||
  include/nanogui/textbox.h src/textbox.cpp
 | 
			
		||||
  include/nanogui/textarea.h src/textarea.cpp
 | 
			
		||||
  include/nanogui/imagepanel.h src/imagepanel.cpp
 | 
			
		||||
  include/nanogui/vscrollpanel.h src/vscrollpanel.cpp
 | 
			
		||||
  include/nanogui/colorwheel.h src/colorwheel.cpp
 | 
			
		||||
  include/nanogui/colorpicker.h src/colorpicker.cpp
 | 
			
		||||
  include/nanogui/graph.h src/graph.cpp
 | 
			
		||||
  include/nanogui/tabwidget.h src/tabwidget.cpp
 | 
			
		||||
  include/nanogui/canvas.h src/canvas.cpp
 | 
			
		||||
  include/nanogui/texture.h src/texture.cpp
 | 
			
		||||
  include/nanogui/shader.h src/shader.cpp
 | 
			
		||||
  include/nanogui/imageview.h src/imageview.cpp
 | 
			
		||||
  include/nanogui/traits.h src/traits.cpp
 | 
			
		||||
  include/nanogui/renderpass.h
 | 
			
		||||
  include/nanogui/formhelper.h
 | 
			
		||||
  include/nanogui/icons.h
 | 
			
		||||
  include/nanogui/toolbutton.h
 | 
			
		||||
  include/nanogui/opengl.h
 | 
			
		||||
  include/nanogui/nanogui.h
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
target_compile_definitions(nanogui
 | 
			
		||||
  PUBLIC
 | 
			
		||||
    ${NANOGUI_BACKEND_DEFS}
 | 
			
		||||
 | 
			
		||||
  PRIVATE
 | 
			
		||||
    -DNANOGUI_BUILD
 | 
			
		||||
    -DNVG_STB_IMAGE_IMPLEMENTATION
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
target_include_directories(nanogui
 | 
			
		||||
  PUBLIC
 | 
			
		||||
    ${CMAKE_CURRENT_SOURCE_DIR}/include
 | 
			
		||||
 | 
			
		||||
  PRIVATE
 | 
			
		||||
    ext/nanovg/src
 | 
			
		||||
    ${CMAKE_CURRENT_BINARY_DIR}
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
if (NANOGUI_BUILD_SHARED)
 | 
			
		||||
  target_compile_definitions(nanogui
 | 
			
		||||
    PUBLIC
 | 
			
		||||
      -DNANOGUI_SHARED -DNVG_SHARED
 | 
			
		||||
    PRIVATE
 | 
			
		||||
      -DNVG_BUILD
 | 
			
		||||
  )
 | 
			
		||||
 | 
			
		||||
  if (NANOGUI_BUILD_GLAD)
 | 
			
		||||
    target_compile_definitions(nanogui
 | 
			
		||||
      PUBLIC
 | 
			
		||||
        -DGLAD_GLAPI_EXPORT
 | 
			
		||||
      PRIVATE
 | 
			
		||||
        -DGLAD_GLAPI_EXPORT_BUILD
 | 
			
		||||
    )
 | 
			
		||||
  endif()
 | 
			
		||||
 | 
			
		||||
  if (NANOGUI_BUILD_GLFW)
 | 
			
		||||
    target_compile_definitions(nanogui PRIVATE _GLFW_BUILD_DLL)
 | 
			
		||||
  endif()
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
target_include_directories(nanogui PUBLIC
 | 
			
		||||
  "${CMAKE_CURRENT_SOURCE_DIR}/ext/nanovg/src")
 | 
			
		||||
 | 
			
		||||
if (NANOGUI_BUILD_GLAD)
 | 
			
		||||
  target_compile_definitions(nanogui PUBLIC -DNANOGUI_GLAD)
 | 
			
		||||
  target_include_directories(nanogui
 | 
			
		||||
    PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/ext/glad/include")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (NANOGUI_BUILD_GLFW)
 | 
			
		||||
  target_include_directories(nanogui
 | 
			
		||||
    PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/ext/glfw/include")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (NANOGUI_BUILD_SHARED)
 | 
			
		||||
  target_link_libraries(nanogui PRIVATE ${NANOGUI_LIBS})
 | 
			
		||||
  set_property(TARGET nanogui PROPERTY INTERPROCEDURAL_OPTIMIZATION ON)
 | 
			
		||||
  set_property(TARGET nanogui PROPERTY DEFINE_SYMBOL "")
 | 
			
		||||
else()
 | 
			
		||||
  target_link_libraries(nanogui PUBLIC ${NANOGUI_LIBS})
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
# Auto-detect GLES include directory on Raspberry PI
 | 
			
		||||
if (EXISTS /opt/vc/include)
 | 
			
		||||
  target_include_directories(nanogui PUBLIC /opt/vc/include)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (NANOGUI_INSTALL)
 | 
			
		||||
  install(TARGETS nanogui
 | 
			
		||||
          LIBRARY DESTINATION lib
 | 
			
		||||
          ARCHIVE DESTINATION lib)
 | 
			
		||||
 | 
			
		||||
  install(DIRECTORY include/nanogui DESTINATION include
 | 
			
		||||
          FILES_MATCHING PATTERN "*.h")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
# Quench warnings while compiling NanoVG
 | 
			
		||||
if (CMAKE_COMPILER_IS_GNUCC)
 | 
			
		||||
  set_source_files_properties(ext/nanovg/src/nanovg.c PROPERTIES COMPILE_FLAGS -Wno-unused-result)
 | 
			
		||||
elseif(MSVC)
 | 
			
		||||
  set_source_files_properties(ext/nanovg/src/nanovg.c PROPERTIES COMPILE_FLAGS "/wd4005 /wd4456 /wd4457")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
# Build example application if desired
 | 
			
		||||
if (NANOGUI_BUILD_EXAMPLES)
 | 
			
		||||
  add_executable(example1      src/example1.cpp)
 | 
			
		||||
  add_executable(example2      src/example2.cpp)
 | 
			
		||||
  add_executable(example3      src/example3.cpp)
 | 
			
		||||
  add_executable(example4      src/example4.cpp)
 | 
			
		||||
  add_executable(example_icons src/example_icons.cpp)
 | 
			
		||||
 | 
			
		||||
  target_link_libraries(example1      nanogui)
 | 
			
		||||
  target_link_libraries(example2      nanogui)
 | 
			
		||||
  target_link_libraries(example3      nanogui ${NANOGUI_LIBS}) # For OpenGL
 | 
			
		||||
  target_link_libraries(example4      nanogui)
 | 
			
		||||
  target_link_libraries(example_icons nanogui)
 | 
			
		||||
 | 
			
		||||
  # Copy icons for example application
 | 
			
		||||
  file(COPY resources/icons DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (NANOGUI_BUILD_PYTHON)
 | 
			
		||||
  message(STATUS "NanoGUI: building the Python plugin.")
 | 
			
		||||
  if (NOT TARGET pybind11::module)
 | 
			
		||||
    find_package(Python COMPONENTS Interpreter Development REQUIRED)
 | 
			
		||||
 | 
			
		||||
    # Allow overriding the pybind11 library used to compile NanoGUI
 | 
			
		||||
    set(NANOGUI_PYBIND11_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ext/pybind11"
 | 
			
		||||
      CACHE STRING "Path containing the 'pybind11' library used to compile nanogui.")
 | 
			
		||||
 | 
			
		||||
    add_subdirectory(${NANOGUI_PYBIND11_DIR} ext/pybind11)
 | 
			
		||||
 | 
			
		||||
    mark_as_advanced(
 | 
			
		||||
      USE_PYTHON_INCLUDE_DIR PYBIND11_INSTALL PYBIND11_TEST PYBIND11_NOPYTHON
 | 
			
		||||
      PYBIND11_FINDPYTHON PYBIND11_PYTHON_VERSION PYBIND11_WERROR
 | 
			
		||||
      NANOGUI_PYBIND11_DIR
 | 
			
		||||
    )
 | 
			
		||||
  endif()
 | 
			
		||||
 | 
			
		||||
  add_subdirectory(python)
 | 
			
		||||
else()
 | 
			
		||||
  message(STATUS "NanoGUI: not building the Python plugin.")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (NANOGUI_BUILD_PYTHON AND NANOGUI_MASTER_PROJECT)
 | 
			
		||||
  # Create documentation for python plugin (optional target for developers)
 | 
			
		||||
  string(REPLACE " " ";" MKDOC_CXX_FLAGS ${CMAKE_CXX_FLAGS})
 | 
			
		||||
  get_property(MKDOC_INCLUDE_DIRECTORIES DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
 | 
			
		||||
  get_property(MKDOC_COMPILE_DEFINITIONS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY COMPILE_DEFINITIONS)
 | 
			
		||||
 | 
			
		||||
  foreach (value ${MKDOC_INCLUDE_DIRECTORIES})
 | 
			
		||||
    list(APPEND MKDOC_CXX_FLAGS -I${value})
 | 
			
		||||
  endforeach()
 | 
			
		||||
 | 
			
		||||
  # Make sure platform specific code gets kept in py_doc.h (specifically __doc_nanogui_chdir_to_bundle_parent)
 | 
			
		||||
  list(APPEND MKDOC_COMPILE_DEFINITIONS "DOXYGEN_DOCUMENTATION_BUILD")
 | 
			
		||||
  foreach (value ${MKDOC_COMPILE_DEFINITIONS})
 | 
			
		||||
    list(APPEND MKDOC_CXX_FLAGS -D${value})
 | 
			
		||||
  endforeach()
 | 
			
		||||
 | 
			
		||||
  add_custom_target(docstrings USES_TERMINAL COMMAND
 | 
			
		||||
    ${Python_EXECUTABLE} -m pybind11_mkdoc -std=c++17 -stdlib=libc++
 | 
			
		||||
    ${MKDOC_CXXFLAGS}
 | 
			
		||||
    ${NANOGUI_BACKEND_DEFS}
 | 
			
		||||
    -I${PROJECT_SOURCE_DIR}/include
 | 
			
		||||
    -I${PROJECT_SOURCE_DIR}/ext/glfw/include
 | 
			
		||||
    -I${PROJECT_SOURCE_DIR}/ext/nanovg/src
 | 
			
		||||
    ${PROJECT_SOURCE_DIR}/include/nanogui/*.h
 | 
			
		||||
    -o ${CMAKE_CURRENT_SOURCE_DIR}/python/py_doc.h
 | 
			
		||||
  )
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
# vim: set et ts=2 sw=2 ft=cmake nospell:
 | 
			
		||||
							
								
								
									
										48
									
								
								cs440-acg/ext/nanogui/CONTRIBUTING.rst
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								cs440-acg/ext/nanogui/CONTRIBUTING.rst
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,48 @@
 | 
			
		||||
Contributing
 | 
			
		||||
========================================================================================
 | 
			
		||||
 | 
			
		||||
Thank you for your interest in this project! Please refer to the following sections on
 | 
			
		||||
how to contribute code and bug reports.
 | 
			
		||||
 | 
			
		||||
Reporting bugs
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
At the moment, this project is run in the spare time of a single person
 | 
			
		||||
(`Wenzel Jakob <http://rgl.epfl.ch/people/wjakob>`_) with very limited resources for
 | 
			
		||||
issue tracker tickets. Thus, before submitting a question or bug report, please take a
 | 
			
		||||
moment of your time and ensure that your issue isn't already discussed in the project
 | 
			
		||||
documentation elsewhere on this site.
 | 
			
		||||
 | 
			
		||||
Feature requests are generally closed unless they come with a pull request
 | 
			
		||||
that implements the desired functionality.
 | 
			
		||||
 | 
			
		||||
Assuming that you have identified a previously unknown problem or an important question,
 | 
			
		||||
it's essential that you submit a self-contained and minimal piece of code that
 | 
			
		||||
reproduces the problem. In other words: no external dependencies, isolate the
 | 
			
		||||
function(s) that cause breakage, submit matched and complete C++ or Python snippets
 | 
			
		||||
(depending on how you are using NanoGUI) that can be easily compiled and run on my end.
 | 
			
		||||
 | 
			
		||||
Pull requests
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
Contributions are submitted, reviewed, and accepted using Github pull requests. Please
 | 
			
		||||
refer to `this article <https://help.github.com/articles/using-pull-requests>`_ for
 | 
			
		||||
details and adhere to the following rules to make the process as smooth as possible:
 | 
			
		||||
 | 
			
		||||
- Make a new branch for every feature you're working on.
 | 
			
		||||
- Make small and clean pull requests that are easy to review but make sure they do add
 | 
			
		||||
  value by themselves.
 | 
			
		||||
- Make sure you have tested any new functionality (e.g. if you made a new Widget).
 | 
			
		||||
- This project has a strong focus on providing general solutions using a minimal amount
 | 
			
		||||
  of code, thus small pull requests are greatly preferred.
 | 
			
		||||
- Read the remainder of this document, adhering to the bindings and documentation
 | 
			
		||||
  requirements.
 | 
			
		||||
- If making a purely documentation PR, please prefix the commit with ``[docs]``
 | 
			
		||||
 | 
			
		||||
  - E.g. ``[docs] Adding documentation for class X.``
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Specific activities for contributions
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
For a list of specific parts of nanogui which would benefit from outside contributions,
 | 
			
		||||
refer to the bottom part of `this page <https://github.com/wjakob/nanogui/blob/master/docs/contributing.rst>`_.
 | 
			
		||||
							
								
								
									
										36
									
								
								cs440-acg/ext/nanogui/LICENSE.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								cs440-acg/ext/nanogui/LICENSE.txt
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,36 @@
 | 
			
		||||
Copyright (c) 2017 Wenzel Jakob <wenzel.jakob@epfl.ch>, All rights reserved.
 | 
			
		||||
 | 
			
		||||
Redistribution and use in source and binary forms, with or without
 | 
			
		||||
modification, are permitted provided that the following conditions are met:
 | 
			
		||||
 | 
			
		||||
1. Redistributions of source code must retain the above copyright notice, this
 | 
			
		||||
   list of conditions and the following disclaimer.
 | 
			
		||||
 | 
			
		||||
2. Redistributions in binary form must reproduce the above copyright notice,
 | 
			
		||||
   this list of conditions and the following disclaimer in the documentation
 | 
			
		||||
   and/or other materials provided with the distribution.
 | 
			
		||||
 | 
			
		||||
3. Neither the name of the copyright holder 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 HOLDER 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.
 | 
			
		||||
 | 
			
		||||
You are under no obligation whatsoever to provide any bug fixes, patches, or
 | 
			
		||||
upgrades to the features, functionality or performance of the source code
 | 
			
		||||
("Enhancements") to anyone; however, if you choose to make your Enhancements
 | 
			
		||||
available either publicly, or directly to the author of this software, without
 | 
			
		||||
imposing a separate written license agreement for such Enhancements, then you
 | 
			
		||||
hereby grant the following license: a non-exclusive, royalty-free perpetual
 | 
			
		||||
license to install, use, modify, prepare derivative works, incorporate into
 | 
			
		||||
other computer software, distribute, and sublicense such enhancements or
 | 
			
		||||
derivative works thereof, in binary and source code form.
 | 
			
		||||
							
								
								
									
										7
									
								
								cs440-acg/ext/nanogui/MANIFEST.in
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								cs440-acg/ext/nanogui/MANIFEST.in
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
			
		||||
include README.md LICENSE.txt
 | 
			
		||||
global-include CMakeLists.txt *.cmake
 | 
			
		||||
recursive-include src *.cpp
 | 
			
		||||
recursive-include include *.h
 | 
			
		||||
recursive-include python *.cpp *.h
 | 
			
		||||
recursive-include resources *.ttf
 | 
			
		||||
recursive-include ext *.h *.c *.cpp *.pc.in *.h.in *.cmake.in
 | 
			
		||||
							
								
								
									
										259
									
								
								cs440-acg/ext/nanogui/README.rst
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										259
									
								
								cs440-acg/ext/nanogui/README.rst
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,259 @@
 | 
			
		||||
NanoGUI
 | 
			
		||||
========================================================================================
 | 
			
		||||
|docs| |travis| |appveyor|
 | 
			
		||||
 | 
			
		||||
.. |docs| image:: https://readthedocs.org/projects/nanogui/badge/?version=latest
 | 
			
		||||
    :target: http://nanogui.readthedocs.org/en/latest/?badge=latest
 | 
			
		||||
    :alt: Docs
 | 
			
		||||
 | 
			
		||||
.. |travis| image:: https://travis-ci.org/wjakob/nanogui.svg?branch=master
 | 
			
		||||
   :target: https://travis-ci.org/wjakob/nanogui
 | 
			
		||||
   :alt: Travis Build Status
 | 
			
		||||
 | 
			
		||||
.. |appveyor| image:: https://ci.appveyor.com/api/projects/status/m8h3uyvdb4ej2i02/branch/master?svg=true
 | 
			
		||||
   :target: https://ci.appveyor.com/project/wjakob/nanogui/branch/master
 | 
			
		||||
   :alt: Appveyor Build Status
 | 
			
		||||
 | 
			
		||||
.. begin_brief_description
 | 
			
		||||
 | 
			
		||||
NanoGUI is a minimalistic cross-platform widget library for OpenGL 3+, GLES
 | 
			
		||||
2/3, and Metal. It supports automatic layout generation, stateful C++ lambdas
 | 
			
		||||
callbacks, a variety of useful widget types and Retina-capable rendering on
 | 
			
		||||
Apple devices thanks to NanoVG_ by Mikko Mononen. Python bindings of all
 | 
			
		||||
functionality are provided using pybind11_.
 | 
			
		||||
 | 
			
		||||
**Note**: This repository contains an improved port of the original NanoGUI_.
 | 
			
		||||
The most visible change to developers is that it no longer relies on Eigen or
 | 
			
		||||
Enoki and ships with its own (absolutely minimal) vector library. Additionally,
 | 
			
		||||
the the repository here incorporates the following changes:
 | 
			
		||||
 | 
			
		||||
1. A different set of naming conventions is used for function and variable
 | 
			
		||||
   names that feels more natural in a mixed C++ & Python environment.
 | 
			
		||||
   (specifically, ``underscore_case`` for methods and variables rather than
 | 
			
		||||
   ``camelCase``).
 | 
			
		||||
 | 
			
		||||
2. GUI Rendering now provides backends for OpenGL 3+, GLES 2/3, and Metal. GLES
 | 
			
		||||
   2 support allows NanoGUI to run on ARM devices including the Raspberry Pi
 | 
			
		||||
   and in browsers via WebGL. The Metal backend supports modern Macs, iPhones,
 | 
			
		||||
   etc.
 | 
			
		||||
 | 
			
		||||
   NanoGUI includes generic wrappers around shaders and textures that work for
 | 
			
		||||
   all of these frameworks.
 | 
			
		||||
 | 
			
		||||
3. The event loop is much more conservative by default and only issues redraw
 | 
			
		||||
   calls when explicitly requested by an event callback.
 | 
			
		||||
 | 
			
		||||
4. Python integration: the library comes with a ``pip``-compatible ``setup.py``
 | 
			
		||||
   installation script.
 | 
			
		||||
 | 
			
		||||
5. WebAssembly code generation works out of the box (requires Emscripten),
 | 
			
		||||
   enabling powerful UI development for the web. See Tekari_ for an example of
 | 
			
		||||
   such an application.
 | 
			
		||||
 | 
			
		||||
6. Significantly revamped tab widget (supports right-click context menus,
 | 
			
		||||
   draggable, and closeable tabs) and image view widget.
 | 
			
		||||
 | 
			
		||||
7. The Entypo_ icon font has been replaced by FontAwesome_ (v5.10.1).
 | 
			
		||||
 | 
			
		||||
.. _NanoVG: https://github.com/memononen/NanoVG
 | 
			
		||||
.. _pybind11: https://github.com/wjakob/pybind11
 | 
			
		||||
.. _NanoGUI: https://github.com/wjakob/nanogui
 | 
			
		||||
.. _Tekari: https://rgl.epfl.ch/tekari?url=%2F%2Frgl.s3.eu-central-1.amazonaws.com%2Fmedia%2Fuploads%2Fwjakob%2F2018%2F08%2F27%2Firidescent-paper.txt&log=1
 | 
			
		||||
.. _Entypo: http://www.entypo.com
 | 
			
		||||
.. _FontAwesome: https://github.com/FortAwesome/Font-Awesome
 | 
			
		||||
 | 
			
		||||
.. end_brief_description
 | 
			
		||||
 | 
			
		||||
- `Documentation <https://nanogui.readthedocs.io>`_
 | 
			
		||||
 | 
			
		||||
.. contents:: Contents
 | 
			
		||||
   :local:
 | 
			
		||||
   :backlinks: none
 | 
			
		||||
 | 
			
		||||
Example screenshot
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
.. image:: https://github.com/wjakob/nanogui/raw/master/resources/screenshot.png
 | 
			
		||||
   :alt: Screenshot of Example 1.
 | 
			
		||||
   :align: center
 | 
			
		||||
 | 
			
		||||
Description
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
.. begin_long_description
 | 
			
		||||
 | 
			
		||||
NanoGUI builds on GLFW_ for cross-platform context creation and event handling,
 | 
			
		||||
GLAD_ to access OpenGL functionality on Windows, and NanoVG_/MetalNanoVG_ to
 | 
			
		||||
draw 2D primitives.
 | 
			
		||||
 | 
			
		||||
Note that the dependency library NanoVG already includes some basic example code to draw
 | 
			
		||||
good-looking static widgets; what NanoGUI does is to flesh it out into a complete GUI
 | 
			
		||||
toolkit with event handling, layout generation, etc.
 | 
			
		||||
 | 
			
		||||
NanoGUI currently works on Mac OS X (Clang) Linux (GCC or Clang) and Windows (Visual
 | 
			
		||||
Studio ≥ 2017); it requires a recent C++17 capable compiler. All dependencies are
 | 
			
		||||
jointly built using a CMake-based build system.
 | 
			
		||||
 | 
			
		||||
.. _GLFW: http://www.glfw.org/
 | 
			
		||||
.. _GLAD: https://github.com/Dav1dde/glad
 | 
			
		||||
.. _MetalNanoVG: https://github.com/ollix/MetalNanoVG
 | 
			
		||||
 | 
			
		||||
.. end_long_description
 | 
			
		||||
 | 
			
		||||
Creating widgets
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
NanoGUI makes it easy to instantiate widgets, set layout constraints, and
 | 
			
		||||
register event callbacks using high-level C++17 code. For instance, the
 | 
			
		||||
following two lines from the included example application add a new button to
 | 
			
		||||
an existing window `window` and register an event callback.
 | 
			
		||||
 | 
			
		||||
.. code-block:: cpp
 | 
			
		||||
 | 
			
		||||
   Button *b = new Button(window, "Plain button");
 | 
			
		||||
   b->set_callback([] { cout << "pushed!" << endl; });
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
The following lines from the example application create the coupled
 | 
			
		||||
slider and text box on the bottom of the second window (see the screenshot).
 | 
			
		||||
 | 
			
		||||
.. code-block:: cpp
 | 
			
		||||
 | 
			
		||||
   /* Create an empty panel with a horizontal layout */
 | 
			
		||||
   Widget *panel = new Widget(window);
 | 
			
		||||
   panel->set_layout(new BoxLayout(BoxLayout::Horizontal, BoxLayout::Middle, 0, 20));
 | 
			
		||||
 | 
			
		||||
   /* Add a slider and set defaults */
 | 
			
		||||
   Slider *slider = new Slider(panel);
 | 
			
		||||
   slider->set_value(0.5f);
 | 
			
		||||
   slider->set_fixed_width(80);
 | 
			
		||||
 | 
			
		||||
   /* Add a textbox and set defaults */
 | 
			
		||||
   TextBox *tb = new TextBox(panel);
 | 
			
		||||
   tb->set_fixed_size(Vector2i(60, 25));
 | 
			
		||||
   tb->set_value("50");
 | 
			
		||||
   tb->set_units("%");
 | 
			
		||||
 | 
			
		||||
   /* Propagate slider changes to the text box */
 | 
			
		||||
   slider->set_callback([tb](float value) {
 | 
			
		||||
       tb->set_value(std::to_string((int) (value * 100)));
 | 
			
		||||
   });
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
The Python version of this same piece of code looks like this:
 | 
			
		||||
 | 
			
		||||
.. code-block:: py
 | 
			
		||||
 | 
			
		||||
   # Create an empty panel with a horizontal layout
 | 
			
		||||
   panel = Widget(window)
 | 
			
		||||
   panel.set_layout(BoxLayout(BoxLayout.Horizontal, BoxLayout.Middle, 0, 20))
 | 
			
		||||
 | 
			
		||||
   # Add a slider and set defaults
 | 
			
		||||
   slider = Slider(panel)
 | 
			
		||||
   slider.set_value(0.5)
 | 
			
		||||
   slider.set_fixed_width(80)
 | 
			
		||||
 | 
			
		||||
   # Add a textbox and set defaults
 | 
			
		||||
   tb = TextBox(panel)
 | 
			
		||||
   tb.set_fixed_size(Vector2i(60, 25))
 | 
			
		||||
   tb.set_value("50")
 | 
			
		||||
   tb.set_units("%")
 | 
			
		||||
 | 
			
		||||
   # Propagate slider changes to the text box
 | 
			
		||||
   def cb(value):
 | 
			
		||||
       tb.set_value("%i" % int(value * 100))
 | 
			
		||||
   slider.set_callback(cb)
 | 
			
		||||
 | 
			
		||||
"Simple mode"
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
Christian Schüller contributed a convenience class that makes it possible to
 | 
			
		||||
create AntTweakBar-style variable manipulators using just a few lines of code.
 | 
			
		||||
For instance, the source code below was used to create the following example
 | 
			
		||||
application.
 | 
			
		||||
 | 
			
		||||
.. image:: https://github.com/wjakob/nanogui/raw/master/resources/screenshot2.png
 | 
			
		||||
   :alt: Screenshot
 | 
			
		||||
   :align: center
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
.. code-block:: cpp
 | 
			
		||||
 | 
			
		||||
   /// dvar, bar, strvar, etc. are double/bool/string/.. variables
 | 
			
		||||
 | 
			
		||||
   FormHelper *gui = new FormHelper(screen);
 | 
			
		||||
   ref<Window> window = gui->add_window(Vector2i(10, 10), "Form helper example");
 | 
			
		||||
   gui->add_group("Basic types");
 | 
			
		||||
   gui->add_variable("bool", bvar);
 | 
			
		||||
   gui->add_variable("string", strvar);
 | 
			
		||||
 | 
			
		||||
   gui->add_group("Validating fields");
 | 
			
		||||
   gui->add_variable("int", ivar);
 | 
			
		||||
   gui->add_variable("float", fvar);
 | 
			
		||||
   gui->add_variable("double", dvar);
 | 
			
		||||
 | 
			
		||||
   gui->add_group("Complex types");
 | 
			
		||||
   gui->add_variable("Enumeration", enumval, enabled)
 | 
			
		||||
      ->setItems({"Item 1", "Item 2", "Item 3"});
 | 
			
		||||
   gui->add_variable("Color", colval);
 | 
			
		||||
 | 
			
		||||
   gui->add_group("Other widgets");
 | 
			
		||||
   gui->add_button("A button", [](){ std::cout << "Button pressed." << std::endl; });
 | 
			
		||||
 | 
			
		||||
   screen->set_visible(true);
 | 
			
		||||
   screen->perform_layout();
 | 
			
		||||
   window->center();
 | 
			
		||||
 | 
			
		||||
Compiling
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
Clone the repository and all dependencies (with ``git clone --recursive``),
 | 
			
		||||
run CMake to generate Makefiles or CMake/Visual Studio project files, and
 | 
			
		||||
the rest should just work automatically.
 | 
			
		||||
 | 
			
		||||
On Debian/Ubuntu, make sure that you have installed the following packages
 | 
			
		||||
 | 
			
		||||
.. code-block:: bash
 | 
			
		||||
 | 
			
		||||
   $ apt-get install cmake xorg-dev libglu1-mesa-dev
 | 
			
		||||
 | 
			
		||||
To also get the Python bindings, you'll need to run
 | 
			
		||||
 | 
			
		||||
.. code-block:: bash
 | 
			
		||||
 | 
			
		||||
   $ apt-get install python-dev
 | 
			
		||||
 | 
			
		||||
On RedHat/Fedora, make sure that you have installed the following packages
 | 
			
		||||
 | 
			
		||||
.. code-block:: bash
 | 
			
		||||
 | 
			
		||||
   $ sudo dnf install cmake mesa-libGLU-devel libXi-devel libXcursor-devel libXinerama-devel libXrandr-devel xorg-x11-server-devel
 | 
			
		||||
 | 
			
		||||
To also get the Python bindings, you'll need to run
 | 
			
		||||
 | 
			
		||||
.. code-block:: bash
 | 
			
		||||
 | 
			
		||||
   $ sudo dnf install python3-devel
 | 
			
		||||
 | 
			
		||||
License
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
.. begin_license
 | 
			
		||||
 | 
			
		||||
NanoGUI is provided under a BSD-style license that can be found in the LICENSE_
 | 
			
		||||
file. By using, distributing, or contributing to this project, you agree to the
 | 
			
		||||
terms and conditions of this license.
 | 
			
		||||
 | 
			
		||||
.. _LICENSE: https://github.com/wjakob/nanogui/blob/master/LICENSE.txt
 | 
			
		||||
 | 
			
		||||
Note that NanoGUI ships with several fonts that use different (though similarly
 | 
			
		||||
unencumbered) licenses, in particular `Roboto
 | 
			
		||||
<https://github.com/google/roboto/>`_, `Inconsolata
 | 
			
		||||
<https://github.com/googlefonts/Inconsolata>`_, and the free version of the
 | 
			
		||||
`Font Awesome icon font <https://github.com/FortAwesome/Font-Awesome>`_
 | 
			
		||||
(v5.10.1). The latter two are distributed under the `SIL Open Font License
 | 
			
		||||
Version 1.1 <https://opensource.org/licenses/OFL-1.1>`_, while Roboto is
 | 
			
		||||
distributed under the `Apache 2.0
 | 
			
		||||
<https://opensource.org/licenses/Apache-2.0>`_ license.
 | 
			
		||||
 | 
			
		||||
.. end_license
 | 
			
		||||
							
								
								
									
										862
									
								
								cs440-acg/ext/nanogui/docs/_static/entypo.css
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										862
									
								
								cs440-acg/ext/nanogui/docs/_static/entypo.css
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,862 @@
 | 
			
		||||
/*
 | 
			
		||||
  Icon Font: entypo
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
@font-face {
 | 
			
		||||
  font-family: "entypo";
 | 
			
		||||
  src: url("./entypo.eot");
 | 
			
		||||
  src: url("./entypo.eot?#iefix") format("embedded-opentype"),
 | 
			
		||||
       url("./entypo.woff2") format("woff2"),
 | 
			
		||||
       url("./entypo.woff") format("woff"),
 | 
			
		||||
       url("./entypo.ttf") format("truetype"),
 | 
			
		||||
       url("./entypo.svg#entypo") format("svg");
 | 
			
		||||
  font-weight: normal;
 | 
			
		||||
  font-style: normal;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@media screen and (-webkit-min-device-pixel-ratio:0) {
 | 
			
		||||
  @font-face {
 | 
			
		||||
    font-family: "entypo";
 | 
			
		||||
    src: url("./entypo.svg#entypo") format("svg");
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
[data-icon]:before { content: attr(data-icon); }
 | 
			
		||||
 | 
			
		||||
[data-icon]:before,
 | 
			
		||||
.entypo-icon-500px:before,
 | 
			
		||||
.entypo-icon-500px-with-circle:before,
 | 
			
		||||
.entypo-icon-add-to-list:before,
 | 
			
		||||
.entypo-icon-add-user:before,
 | 
			
		||||
.entypo-icon-address:before,
 | 
			
		||||
.entypo-icon-adjust:before,
 | 
			
		||||
.entypo-icon-air:before,
 | 
			
		||||
.entypo-icon-aircraft:before,
 | 
			
		||||
.entypo-icon-aircraft-landing:before,
 | 
			
		||||
.entypo-icon-aircraft-take-off:before,
 | 
			
		||||
.entypo-icon-align-bottom:before,
 | 
			
		||||
.entypo-icon-align-horizontal-middle:before,
 | 
			
		||||
.entypo-icon-align-left:before,
 | 
			
		||||
.entypo-icon-align-right:before,
 | 
			
		||||
.entypo-icon-align-top:before,
 | 
			
		||||
.entypo-icon-align-vertical-middle:before,
 | 
			
		||||
.entypo-icon-app-store:before,
 | 
			
		||||
.entypo-icon-archive:before,
 | 
			
		||||
.entypo-icon-area-graph:before,
 | 
			
		||||
.entypo-icon-arrow-bold-down:before,
 | 
			
		||||
.entypo-icon-arrow-bold-left:before,
 | 
			
		||||
.entypo-icon-arrow-bold-right:before,
 | 
			
		||||
.entypo-icon-arrow-bold-up:before,
 | 
			
		||||
.entypo-icon-arrow-down:before,
 | 
			
		||||
.entypo-icon-arrow-left:before,
 | 
			
		||||
.entypo-icon-arrow-long-down:before,
 | 
			
		||||
.entypo-icon-arrow-long-left:before,
 | 
			
		||||
.entypo-icon-arrow-long-right:before,
 | 
			
		||||
.entypo-icon-arrow-long-up:before,
 | 
			
		||||
.entypo-icon-arrow-right:before,
 | 
			
		||||
.entypo-icon-arrow-up:before,
 | 
			
		||||
.entypo-icon-arrow-with-circle-down:before,
 | 
			
		||||
.entypo-icon-arrow-with-circle-left:before,
 | 
			
		||||
.entypo-icon-arrow-with-circle-right:before,
 | 
			
		||||
.entypo-icon-arrow-with-circle-up:before,
 | 
			
		||||
.entypo-icon-attachment:before,
 | 
			
		||||
.entypo-icon-awareness-ribbon:before,
 | 
			
		||||
.entypo-icon-back:before,
 | 
			
		||||
.entypo-icon-back-in-time:before,
 | 
			
		||||
.entypo-icon-baidu:before,
 | 
			
		||||
.entypo-icon-bar-graph:before,
 | 
			
		||||
.entypo-icon-basecamp:before,
 | 
			
		||||
.entypo-icon-battery:before,
 | 
			
		||||
.entypo-icon-beamed-note:before,
 | 
			
		||||
.entypo-icon-behance:before,
 | 
			
		||||
.entypo-icon-bell:before,
 | 
			
		||||
.entypo-icon-blackboard:before,
 | 
			
		||||
.entypo-icon-block:before,
 | 
			
		||||
.entypo-icon-book:before,
 | 
			
		||||
.entypo-icon-bookmark:before,
 | 
			
		||||
.entypo-icon-bookmarks:before,
 | 
			
		||||
.entypo-icon-bowl:before,
 | 
			
		||||
.entypo-icon-box:before,
 | 
			
		||||
.entypo-icon-briefcase:before,
 | 
			
		||||
.entypo-icon-browser:before,
 | 
			
		||||
.entypo-icon-brush:before,
 | 
			
		||||
.entypo-icon-bucket:before,
 | 
			
		||||
.entypo-icon-bug:before,
 | 
			
		||||
.entypo-icon-cake:before,
 | 
			
		||||
.entypo-icon-calculator:before,
 | 
			
		||||
.entypo-icon-calendar:before,
 | 
			
		||||
.entypo-icon-camera:before,
 | 
			
		||||
.entypo-icon-ccw:before,
 | 
			
		||||
.entypo-icon-chat:before,
 | 
			
		||||
.entypo-icon-check:before,
 | 
			
		||||
.entypo-icon-chevron-down:before,
 | 
			
		||||
.entypo-icon-chevron-left:before,
 | 
			
		||||
.entypo-icon-chevron-right:before,
 | 
			
		||||
.entypo-icon-chevron-small-down:before,
 | 
			
		||||
.entypo-icon-chevron-small-left:before,
 | 
			
		||||
.entypo-icon-chevron-small-right:before,
 | 
			
		||||
.entypo-icon-chevron-small-up:before,
 | 
			
		||||
.entypo-icon-chevron-thin-down:before,
 | 
			
		||||
.entypo-icon-chevron-thin-left:before,
 | 
			
		||||
.entypo-icon-chevron-thin-right:before,
 | 
			
		||||
.entypo-icon-chevron-thin-up:before,
 | 
			
		||||
.entypo-icon-chevron-up:before,
 | 
			
		||||
.entypo-icon-chevron-with-circle-down:before,
 | 
			
		||||
.entypo-icon-chevron-with-circle-left:before,
 | 
			
		||||
.entypo-icon-chevron-with-circle-right:before,
 | 
			
		||||
.entypo-icon-chevron-with-circle-up:before,
 | 
			
		||||
.entypo-icon-circle:before,
 | 
			
		||||
.entypo-icon-circle-with-cross:before,
 | 
			
		||||
.entypo-icon-circle-with-minus:before,
 | 
			
		||||
.entypo-icon-circle-with-plus:before,
 | 
			
		||||
.entypo-icon-circular-graph:before,
 | 
			
		||||
.entypo-icon-clapperboard:before,
 | 
			
		||||
.entypo-icon-classic-computer:before,
 | 
			
		||||
.entypo-icon-clipboard:before,
 | 
			
		||||
.entypo-icon-clock:before,
 | 
			
		||||
.entypo-icon-cloud:before,
 | 
			
		||||
.entypo-icon-code:before,
 | 
			
		||||
.entypo-icon-cog:before,
 | 
			
		||||
.entypo-icon-colours:before,
 | 
			
		||||
.entypo-icon-compass:before,
 | 
			
		||||
.entypo-icon-controller-fast-backward:before,
 | 
			
		||||
.entypo-icon-controller-fast-forward:before,
 | 
			
		||||
.entypo-icon-controller-jump-to-start:before,
 | 
			
		||||
.entypo-icon-controller-next:before,
 | 
			
		||||
.entypo-icon-controller-paus:before,
 | 
			
		||||
.entypo-icon-controller-play:before,
 | 
			
		||||
.entypo-icon-controller-record:before,
 | 
			
		||||
.entypo-icon-controller-stop:before,
 | 
			
		||||
.entypo-icon-controller-volume:before,
 | 
			
		||||
.entypo-icon-copy:before,
 | 
			
		||||
.entypo-icon-creative-cloud:before,
 | 
			
		||||
.entypo-icon-creative-commons:before,
 | 
			
		||||
.entypo-icon-creative-commons-attribution:before,
 | 
			
		||||
.entypo-icon-creative-commons-noderivs:before,
 | 
			
		||||
.entypo-icon-creative-commons-noncommercial-eu:before,
 | 
			
		||||
.entypo-icon-creative-commons-noncommercial-us:before,
 | 
			
		||||
.entypo-icon-creative-commons-public-domain:before,
 | 
			
		||||
.entypo-icon-creative-commons-remix:before,
 | 
			
		||||
.entypo-icon-creative-commons-share:before,
 | 
			
		||||
.entypo-icon-creative-commons-sharealike:before,
 | 
			
		||||
.entypo-icon-credit:before,
 | 
			
		||||
.entypo-icon-credit-card:before,
 | 
			
		||||
.entypo-icon-crop:before,
 | 
			
		||||
.entypo-icon-cross:before,
 | 
			
		||||
.entypo-icon-cup:before,
 | 
			
		||||
.entypo-icon-cw:before,
 | 
			
		||||
.entypo-icon-cycle:before,
 | 
			
		||||
.entypo-icon-database:before,
 | 
			
		||||
.entypo-icon-dial-pad:before,
 | 
			
		||||
.entypo-icon-direction:before,
 | 
			
		||||
.entypo-icon-document:before,
 | 
			
		||||
.entypo-icon-document-landscape:before,
 | 
			
		||||
.entypo-icon-documents:before,
 | 
			
		||||
.entypo-icon-dot-single:before,
 | 
			
		||||
.entypo-icon-dots-three-horizontal:before,
 | 
			
		||||
.entypo-icon-dots-three-vertical:before,
 | 
			
		||||
.entypo-icon-dots-two-horizontal:before,
 | 
			
		||||
.entypo-icon-dots-two-vertical:before,
 | 
			
		||||
.entypo-icon-download:before,
 | 
			
		||||
.entypo-icon-dribbble:before,
 | 
			
		||||
.entypo-icon-dribbble-with-circle:before,
 | 
			
		||||
.entypo-icon-drink:before,
 | 
			
		||||
.entypo-icon-drive:before,
 | 
			
		||||
.entypo-icon-drop:before,
 | 
			
		||||
.entypo-icon-dropbox:before,
 | 
			
		||||
.entypo-icon-edit:before,
 | 
			
		||||
.entypo-icon-email:before,
 | 
			
		||||
.entypo-icon-emoji-flirt:before,
 | 
			
		||||
.entypo-icon-emoji-happy:before,
 | 
			
		||||
.entypo-icon-emoji-neutral:before,
 | 
			
		||||
.entypo-icon-emoji-sad:before,
 | 
			
		||||
.entypo-icon-erase:before,
 | 
			
		||||
.entypo-icon-eraser:before,
 | 
			
		||||
.entypo-icon-evernote:before,
 | 
			
		||||
.entypo-icon-export:before,
 | 
			
		||||
.entypo-icon-eye:before,
 | 
			
		||||
.entypo-icon-eye-with-line:before,
 | 
			
		||||
.entypo-icon-facebook:before,
 | 
			
		||||
.entypo-icon-facebook-with-circle:before,
 | 
			
		||||
.entypo-icon-feather:before,
 | 
			
		||||
.entypo-icon-fingerprint:before,
 | 
			
		||||
.entypo-icon-flag:before,
 | 
			
		||||
.entypo-icon-flash:before,
 | 
			
		||||
.entypo-icon-flashlight:before,
 | 
			
		||||
.entypo-icon-flat-brush:before,
 | 
			
		||||
.entypo-icon-flattr:before,
 | 
			
		||||
.entypo-icon-flickr:before,
 | 
			
		||||
.entypo-icon-flickr-with-circle:before,
 | 
			
		||||
.entypo-icon-flow-branch:before,
 | 
			
		||||
.entypo-icon-flow-cascade:before,
 | 
			
		||||
.entypo-icon-flow-line:before,
 | 
			
		||||
.entypo-icon-flow-parallel:before,
 | 
			
		||||
.entypo-icon-flow-tree:before,
 | 
			
		||||
.entypo-icon-flower:before,
 | 
			
		||||
.entypo-icon-folder:before,
 | 
			
		||||
.entypo-icon-folder-images:before,
 | 
			
		||||
.entypo-icon-folder-music:before,
 | 
			
		||||
.entypo-icon-folder-video:before,
 | 
			
		||||
.entypo-icon-forward:before,
 | 
			
		||||
.entypo-icon-foursquare:before,
 | 
			
		||||
.entypo-icon-funnel:before,
 | 
			
		||||
.entypo-icon-game-controller:before,
 | 
			
		||||
.entypo-icon-gauge:before,
 | 
			
		||||
.entypo-icon-github:before,
 | 
			
		||||
.entypo-icon-github-with-circle:before,
 | 
			
		||||
.entypo-icon-globe:before,
 | 
			
		||||
.entypo-icon-google-drive:before,
 | 
			
		||||
.entypo-icon-google-hangouts:before,
 | 
			
		||||
.entypo-icon-google-play:before,
 | 
			
		||||
.entypo-icon-google-plus:before,
 | 
			
		||||
.entypo-icon-google-plus-with-circle:before,
 | 
			
		||||
.entypo-icon-graduation-cap:before,
 | 
			
		||||
.entypo-icon-grid:before,
 | 
			
		||||
.entypo-icon-grooveshark:before,
 | 
			
		||||
.entypo-icon-hair-cross:before,
 | 
			
		||||
.entypo-icon-hand:before,
 | 
			
		||||
.entypo-icon-heart:before,
 | 
			
		||||
.entypo-icon-heart-outlined:before,
 | 
			
		||||
.entypo-icon-help:before,
 | 
			
		||||
.entypo-icon-help-with-circle:before,
 | 
			
		||||
.entypo-icon-home:before,
 | 
			
		||||
.entypo-icon-hour-glass:before,
 | 
			
		||||
.entypo-icon-houzz:before,
 | 
			
		||||
.entypo-icon-icloud:before,
 | 
			
		||||
.entypo-icon-image:before,
 | 
			
		||||
.entypo-icon-image-inverted:before,
 | 
			
		||||
.entypo-icon-images:before,
 | 
			
		||||
.entypo-icon-inbox:before,
 | 
			
		||||
.entypo-icon-infinity:before,
 | 
			
		||||
.entypo-icon-info:before,
 | 
			
		||||
.entypo-icon-info-with-circle:before,
 | 
			
		||||
.entypo-icon-instagram:before,
 | 
			
		||||
.entypo-icon-instagram-with-circle:before,
 | 
			
		||||
.entypo-icon-install:before,
 | 
			
		||||
.entypo-icon-key:before,
 | 
			
		||||
.entypo-icon-keyboard:before,
 | 
			
		||||
.entypo-icon-lab-flask:before,
 | 
			
		||||
.entypo-icon-landline:before,
 | 
			
		||||
.entypo-icon-language:before,
 | 
			
		||||
.entypo-icon-laptop:before,
 | 
			
		||||
.entypo-icon-lastfm:before,
 | 
			
		||||
.entypo-icon-lastfm-with-circle:before,
 | 
			
		||||
.entypo-icon-layers:before,
 | 
			
		||||
.entypo-icon-leaf:before,
 | 
			
		||||
.entypo-icon-level-down:before,
 | 
			
		||||
.entypo-icon-level-up:before,
 | 
			
		||||
.entypo-icon-lifebuoy:before,
 | 
			
		||||
.entypo-icon-light-bulb:before,
 | 
			
		||||
.entypo-icon-light-down:before,
 | 
			
		||||
.entypo-icon-light-up:before,
 | 
			
		||||
.entypo-icon-line-graph:before,
 | 
			
		||||
.entypo-icon-link:before,
 | 
			
		||||
.entypo-icon-linkedin:before,
 | 
			
		||||
.entypo-icon-linkedin-with-circle:before,
 | 
			
		||||
.entypo-icon-list:before,
 | 
			
		||||
.entypo-icon-location:before,
 | 
			
		||||
.entypo-icon-location-pin:before,
 | 
			
		||||
.entypo-icon-lock:before,
 | 
			
		||||
.entypo-icon-lock-open:before,
 | 
			
		||||
.entypo-icon-log-out:before,
 | 
			
		||||
.entypo-icon-login:before,
 | 
			
		||||
.entypo-icon-loop:before,
 | 
			
		||||
.entypo-icon-magnet:before,
 | 
			
		||||
.entypo-icon-magnifying-glass:before,
 | 
			
		||||
.entypo-icon-mail:before,
 | 
			
		||||
.entypo-icon-mail-with-circle:before,
 | 
			
		||||
.entypo-icon-man:before,
 | 
			
		||||
.entypo-icon-map:before,
 | 
			
		||||
.entypo-icon-mask:before,
 | 
			
		||||
.entypo-icon-medal:before,
 | 
			
		||||
.entypo-icon-medium:before,
 | 
			
		||||
.entypo-icon-medium-with-circle:before,
 | 
			
		||||
.entypo-icon-megaphone:before,
 | 
			
		||||
.entypo-icon-menu:before,
 | 
			
		||||
.entypo-icon-merge:before,
 | 
			
		||||
.entypo-icon-message:before,
 | 
			
		||||
.entypo-icon-mic:before,
 | 
			
		||||
.entypo-icon-minus:before,
 | 
			
		||||
.entypo-icon-mixi:before,
 | 
			
		||||
.entypo-icon-mobile:before,
 | 
			
		||||
.entypo-icon-modern-mic:before,
 | 
			
		||||
.entypo-icon-moon:before,
 | 
			
		||||
.entypo-icon-mouse:before,
 | 
			
		||||
.entypo-icon-mouse-pointer:before,
 | 
			
		||||
.entypo-icon-music:before,
 | 
			
		||||
.entypo-icon-network:before,
 | 
			
		||||
.entypo-icon-new:before,
 | 
			
		||||
.entypo-icon-new-message:before,
 | 
			
		||||
.entypo-icon-news:before,
 | 
			
		||||
.entypo-icon-newsletter:before,
 | 
			
		||||
.entypo-icon-note:before,
 | 
			
		||||
.entypo-icon-notification:before,
 | 
			
		||||
.entypo-icon-notifications-off:before,
 | 
			
		||||
.entypo-icon-old-mobile:before,
 | 
			
		||||
.entypo-icon-old-phone:before,
 | 
			
		||||
.entypo-icon-onedrive:before,
 | 
			
		||||
.entypo-icon-open-book:before,
 | 
			
		||||
.entypo-icon-palette:before,
 | 
			
		||||
.entypo-icon-paper-plane:before,
 | 
			
		||||
.entypo-icon-paypal:before,
 | 
			
		||||
.entypo-icon-pencil:before,
 | 
			
		||||
.entypo-icon-phone:before,
 | 
			
		||||
.entypo-icon-picasa:before,
 | 
			
		||||
.entypo-icon-pie-chart:before,
 | 
			
		||||
.entypo-icon-pin:before,
 | 
			
		||||
.entypo-icon-pinterest:before,
 | 
			
		||||
.entypo-icon-pinterest-with-circle:before,
 | 
			
		||||
.entypo-icon-plus:before,
 | 
			
		||||
.entypo-icon-popup:before,
 | 
			
		||||
.entypo-icon-power-plug:before,
 | 
			
		||||
.entypo-icon-price-ribbon:before,
 | 
			
		||||
.entypo-icon-price-tag:before,
 | 
			
		||||
.entypo-icon-print:before,
 | 
			
		||||
.entypo-icon-progress-empty:before,
 | 
			
		||||
.entypo-icon-progress-full:before,
 | 
			
		||||
.entypo-icon-progress-one:before,
 | 
			
		||||
.entypo-icon-progress-two:before,
 | 
			
		||||
.entypo-icon-publish:before,
 | 
			
		||||
.entypo-icon-qq:before,
 | 
			
		||||
.entypo-icon-qq-with-circle:before,
 | 
			
		||||
.entypo-icon-quote:before,
 | 
			
		||||
.entypo-icon-radio:before,
 | 
			
		||||
.entypo-icon-raft:before,
 | 
			
		||||
.entypo-icon-raft-with-circle:before,
 | 
			
		||||
.entypo-icon-rainbow:before,
 | 
			
		||||
.entypo-icon-rdio:before,
 | 
			
		||||
.entypo-icon-rdio-with-circle:before,
 | 
			
		||||
.entypo-icon-remove-user:before,
 | 
			
		||||
.entypo-icon-renren:before,
 | 
			
		||||
.entypo-icon-reply:before,
 | 
			
		||||
.entypo-icon-reply-all:before,
 | 
			
		||||
.entypo-icon-resize-100-percent:before,
 | 
			
		||||
.entypo-icon-resize-full-screen:before,
 | 
			
		||||
.entypo-icon-retweet:before,
 | 
			
		||||
.entypo-icon-rocket:before,
 | 
			
		||||
.entypo-icon-round-brush:before,
 | 
			
		||||
.entypo-icon-rss:before,
 | 
			
		||||
.entypo-icon-ruler:before,
 | 
			
		||||
.entypo-icon-save:before,
 | 
			
		||||
.entypo-icon-scissors:before,
 | 
			
		||||
.entypo-icon-scribd:before,
 | 
			
		||||
.entypo-icon-select-arrows:before,
 | 
			
		||||
.entypo-icon-share:before,
 | 
			
		||||
.entypo-icon-share-alternative:before,
 | 
			
		||||
.entypo-icon-shareable:before,
 | 
			
		||||
.entypo-icon-shield:before,
 | 
			
		||||
.entypo-icon-shop:before,
 | 
			
		||||
.entypo-icon-shopping-bag:before,
 | 
			
		||||
.entypo-icon-shopping-basket:before,
 | 
			
		||||
.entypo-icon-shopping-cart:before,
 | 
			
		||||
.entypo-icon-shuffle:before,
 | 
			
		||||
.entypo-icon-signal:before,
 | 
			
		||||
.entypo-icon-sina-weibo:before,
 | 
			
		||||
.entypo-icon-skype:before,
 | 
			
		||||
.entypo-icon-skype-with-circle:before,
 | 
			
		||||
.entypo-icon-slideshare:before,
 | 
			
		||||
.entypo-icon-smashing:before,
 | 
			
		||||
.entypo-icon-sound:before,
 | 
			
		||||
.entypo-icon-sound-mix:before,
 | 
			
		||||
.entypo-icon-sound-mute:before,
 | 
			
		||||
.entypo-icon-soundcloud:before,
 | 
			
		||||
.entypo-icon-sports-club:before,
 | 
			
		||||
.entypo-icon-spotify:before,
 | 
			
		||||
.entypo-icon-spotify-with-circle:before,
 | 
			
		||||
.entypo-icon-spreadsheet:before,
 | 
			
		||||
.entypo-icon-squared-cross:before,
 | 
			
		||||
.entypo-icon-squared-minus:before,
 | 
			
		||||
.entypo-icon-squared-plus:before,
 | 
			
		||||
.entypo-icon-star:before,
 | 
			
		||||
.entypo-icon-star-outlined:before,
 | 
			
		||||
.entypo-icon-stopwatch:before,
 | 
			
		||||
.entypo-icon-stumbleupon:before,
 | 
			
		||||
.entypo-icon-stumbleupon-with-circle:before,
 | 
			
		||||
.entypo-icon-suitcase:before,
 | 
			
		||||
.entypo-icon-swap:before,
 | 
			
		||||
.entypo-icon-swarm:before,
 | 
			
		||||
.entypo-icon-sweden:before,
 | 
			
		||||
.entypo-icon-switch:before,
 | 
			
		||||
.entypo-icon-tablet:before,
 | 
			
		||||
.entypo-icon-tablet-mobile-combo:before,
 | 
			
		||||
.entypo-icon-tag:before,
 | 
			
		||||
.entypo-icon-text:before,
 | 
			
		||||
.entypo-icon-text-document:before,
 | 
			
		||||
.entypo-icon-text-document-inverted:before,
 | 
			
		||||
.entypo-icon-thermometer:before,
 | 
			
		||||
.entypo-icon-thumbs-down:before,
 | 
			
		||||
.entypo-icon-thumbs-up:before,
 | 
			
		||||
.entypo-icon-thunder-cloud:before,
 | 
			
		||||
.entypo-icon-ticket:before,
 | 
			
		||||
.entypo-icon-time-slot:before,
 | 
			
		||||
.entypo-icon-tools:before,
 | 
			
		||||
.entypo-icon-traffic-cone:before,
 | 
			
		||||
.entypo-icon-trash:before,
 | 
			
		||||
.entypo-icon-tree:before,
 | 
			
		||||
.entypo-icon-triangle-down:before,
 | 
			
		||||
.entypo-icon-triangle-left:before,
 | 
			
		||||
.entypo-icon-triangle-right:before,
 | 
			
		||||
.entypo-icon-triangle-up:before,
 | 
			
		||||
.entypo-icon-tripadvisor:before,
 | 
			
		||||
.entypo-icon-trophy:before,
 | 
			
		||||
.entypo-icon-tumblr:before,
 | 
			
		||||
.entypo-icon-tumblr-with-circle:before,
 | 
			
		||||
.entypo-icon-tv:before,
 | 
			
		||||
.entypo-icon-twitter:before,
 | 
			
		||||
.entypo-icon-twitter-with-circle:before,
 | 
			
		||||
.entypo-icon-typing:before,
 | 
			
		||||
.entypo-icon-uninstall:before,
 | 
			
		||||
.entypo-icon-unread:before,
 | 
			
		||||
.entypo-icon-untag:before,
 | 
			
		||||
.entypo-icon-upload:before,
 | 
			
		||||
.entypo-icon-upload-to-cloud:before,
 | 
			
		||||
.entypo-icon-user:before,
 | 
			
		||||
.entypo-icon-users:before,
 | 
			
		||||
.entypo-icon-v-card:before,
 | 
			
		||||
.entypo-icon-video:before,
 | 
			
		||||
.entypo-icon-video-camera:before,
 | 
			
		||||
.entypo-icon-vimeo:before,
 | 
			
		||||
.entypo-icon-vimeo-with-circle:before,
 | 
			
		||||
.entypo-icon-vine:before,
 | 
			
		||||
.entypo-icon-vine-with-circle:before,
 | 
			
		||||
.entypo-icon-vinyl:before,
 | 
			
		||||
.entypo-icon-vk:before,
 | 
			
		||||
.entypo-icon-vk-alternitive:before,
 | 
			
		||||
.entypo-icon-vk-with-circle:before,
 | 
			
		||||
.entypo-icon-voicemail:before,
 | 
			
		||||
.entypo-icon-wallet:before,
 | 
			
		||||
.entypo-icon-warning:before,
 | 
			
		||||
.entypo-icon-water:before,
 | 
			
		||||
.entypo-icon-windows-store:before,
 | 
			
		||||
.entypo-icon-xing:before,
 | 
			
		||||
.entypo-icon-xing-with-circle:before,
 | 
			
		||||
.entypo-icon-yelp:before,
 | 
			
		||||
.entypo-icon-youko:before,
 | 
			
		||||
.entypo-icon-youko-with-circle:before,
 | 
			
		||||
.entypo-icon-youtube:before,
 | 
			
		||||
.entypo-icon-youtube-with-circle:before {
 | 
			
		||||
  display: inline-block;
 | 
			
		||||
  font-family: "entypo";
 | 
			
		||||
  font-style: normal;
 | 
			
		||||
  font-weight: normal;
 | 
			
		||||
  font-variant: normal;
 | 
			
		||||
  line-height: 1;
 | 
			
		||||
  text-decoration: inherit;
 | 
			
		||||
  text-rendering: optimizeLegibility;
 | 
			
		||||
  text-transform: none;
 | 
			
		||||
  -moz-osx-font-smoothing: grayscale;
 | 
			
		||||
  -webkit-font-smoothing: antialiased;
 | 
			
		||||
  font-smoothing: antialiased;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.entypo-icon-500px:before { content: "\f100"; }
 | 
			
		||||
.entypo-icon-500px-with-circle:before { content: "\f101"; }
 | 
			
		||||
.entypo-icon-add-to-list:before { content: "\f102"; }
 | 
			
		||||
.entypo-icon-add-user:before { content: "\f103"; }
 | 
			
		||||
.entypo-icon-address:before { content: "\f104"; }
 | 
			
		||||
.entypo-icon-adjust:before { content: "\f105"; }
 | 
			
		||||
.entypo-icon-air:before { content: "\f106"; }
 | 
			
		||||
.entypo-icon-aircraft:before { content: "\f107"; }
 | 
			
		||||
.entypo-icon-aircraft-landing:before { content: "\f108"; }
 | 
			
		||||
.entypo-icon-aircraft-take-off:before { content: "\f109"; }
 | 
			
		||||
.entypo-icon-align-bottom:before { content: "\f10a"; }
 | 
			
		||||
.entypo-icon-align-horizontal-middle:before { content: "\f10b"; }
 | 
			
		||||
.entypo-icon-align-left:before { content: "\f10c"; }
 | 
			
		||||
.entypo-icon-align-right:before { content: "\f10d"; }
 | 
			
		||||
.entypo-icon-align-top:before { content: "\f10e"; }
 | 
			
		||||
.entypo-icon-align-vertical-middle:before { content: "\f10f"; }
 | 
			
		||||
.entypo-icon-app-store:before { content: "\f110"; }
 | 
			
		||||
.entypo-icon-archive:before { content: "\f111"; }
 | 
			
		||||
.entypo-icon-area-graph:before { content: "\f112"; }
 | 
			
		||||
.entypo-icon-arrow-bold-down:before { content: "\f113"; }
 | 
			
		||||
.entypo-icon-arrow-bold-left:before { content: "\f114"; }
 | 
			
		||||
.entypo-icon-arrow-bold-right:before { content: "\f115"; }
 | 
			
		||||
.entypo-icon-arrow-bold-up:before { content: "\f116"; }
 | 
			
		||||
.entypo-icon-arrow-down:before { content: "\f117"; }
 | 
			
		||||
.entypo-icon-arrow-left:before { content: "\f118"; }
 | 
			
		||||
.entypo-icon-arrow-long-down:before { content: "\f119"; }
 | 
			
		||||
.entypo-icon-arrow-long-left:before { content: "\f11a"; }
 | 
			
		||||
.entypo-icon-arrow-long-right:before { content: "\f11b"; }
 | 
			
		||||
.entypo-icon-arrow-long-up:before { content: "\f11c"; }
 | 
			
		||||
.entypo-icon-arrow-right:before { content: "\f11d"; }
 | 
			
		||||
.entypo-icon-arrow-up:before { content: "\f11e"; }
 | 
			
		||||
.entypo-icon-arrow-with-circle-down:before { content: "\f11f"; }
 | 
			
		||||
.entypo-icon-arrow-with-circle-left:before { content: "\f120"; }
 | 
			
		||||
.entypo-icon-arrow-with-circle-right:before { content: "\f121"; }
 | 
			
		||||
.entypo-icon-arrow-with-circle-up:before { content: "\f122"; }
 | 
			
		||||
.entypo-icon-attachment:before { content: "\f123"; }
 | 
			
		||||
.entypo-icon-awareness-ribbon:before { content: "\f124"; }
 | 
			
		||||
.entypo-icon-back:before { content: "\f125"; }
 | 
			
		||||
.entypo-icon-back-in-time:before { content: "\f126"; }
 | 
			
		||||
.entypo-icon-baidu:before { content: "\f127"; }
 | 
			
		||||
.entypo-icon-bar-graph:before { content: "\f128"; }
 | 
			
		||||
.entypo-icon-basecamp:before { content: "\f129"; }
 | 
			
		||||
.entypo-icon-battery:before { content: "\f12a"; }
 | 
			
		||||
.entypo-icon-beamed-note:before { content: "\f12b"; }
 | 
			
		||||
.entypo-icon-behance:before { content: "\f12c"; }
 | 
			
		||||
.entypo-icon-bell:before { content: "\f12d"; }
 | 
			
		||||
.entypo-icon-blackboard:before { content: "\f12e"; }
 | 
			
		||||
.entypo-icon-block:before { content: "\f12f"; }
 | 
			
		||||
.entypo-icon-book:before { content: "\f130"; }
 | 
			
		||||
.entypo-icon-bookmark:before { content: "\f131"; }
 | 
			
		||||
.entypo-icon-bookmarks:before { content: "\f132"; }
 | 
			
		||||
.entypo-icon-bowl:before { content: "\f133"; }
 | 
			
		||||
.entypo-icon-box:before { content: "\f134"; }
 | 
			
		||||
.entypo-icon-briefcase:before { content: "\f135"; }
 | 
			
		||||
.entypo-icon-browser:before { content: "\f136"; }
 | 
			
		||||
.entypo-icon-brush:before { content: "\f137"; }
 | 
			
		||||
.entypo-icon-bucket:before { content: "\f138"; }
 | 
			
		||||
.entypo-icon-bug:before { content: "\f139"; }
 | 
			
		||||
.entypo-icon-cake:before { content: "\f13a"; }
 | 
			
		||||
.entypo-icon-calculator:before { content: "\f13b"; }
 | 
			
		||||
.entypo-icon-calendar:before { content: "\f13c"; }
 | 
			
		||||
.entypo-icon-camera:before { content: "\f13d"; }
 | 
			
		||||
.entypo-icon-ccw:before { content: "\f13e"; }
 | 
			
		||||
.entypo-icon-chat:before { content: "\f13f"; }
 | 
			
		||||
.entypo-icon-check:before { content: "\f140"; }
 | 
			
		||||
.entypo-icon-chevron-down:before { content: "\f141"; }
 | 
			
		||||
.entypo-icon-chevron-left:before { content: "\f142"; }
 | 
			
		||||
.entypo-icon-chevron-right:before { content: "\f143"; }
 | 
			
		||||
.entypo-icon-chevron-small-down:before { content: "\f144"; }
 | 
			
		||||
.entypo-icon-chevron-small-left:before { content: "\f145"; }
 | 
			
		||||
.entypo-icon-chevron-small-right:before { content: "\f146"; }
 | 
			
		||||
.entypo-icon-chevron-small-up:before { content: "\f147"; }
 | 
			
		||||
.entypo-icon-chevron-thin-down:before { content: "\f148"; }
 | 
			
		||||
.entypo-icon-chevron-thin-left:before { content: "\f149"; }
 | 
			
		||||
.entypo-icon-chevron-thin-right:before { content: "\f14a"; }
 | 
			
		||||
.entypo-icon-chevron-thin-up:before { content: "\f14b"; }
 | 
			
		||||
.entypo-icon-chevron-up:before { content: "\f14c"; }
 | 
			
		||||
.entypo-icon-chevron-with-circle-down:before { content: "\f14d"; }
 | 
			
		||||
.entypo-icon-chevron-with-circle-left:before { content: "\f14e"; }
 | 
			
		||||
.entypo-icon-chevron-with-circle-right:before { content: "\f14f"; }
 | 
			
		||||
.entypo-icon-chevron-with-circle-up:before { content: "\f150"; }
 | 
			
		||||
.entypo-icon-circle:before { content: "\f151"; }
 | 
			
		||||
.entypo-icon-circle-with-cross:before { content: "\f152"; }
 | 
			
		||||
.entypo-icon-circle-with-minus:before { content: "\f153"; }
 | 
			
		||||
.entypo-icon-circle-with-plus:before { content: "\f154"; }
 | 
			
		||||
.entypo-icon-circular-graph:before { content: "\f155"; }
 | 
			
		||||
.entypo-icon-clapperboard:before { content: "\f156"; }
 | 
			
		||||
.entypo-icon-classic-computer:before { content: "\f157"; }
 | 
			
		||||
.entypo-icon-clipboard:before { content: "\f158"; }
 | 
			
		||||
.entypo-icon-clock:before { content: "\f159"; }
 | 
			
		||||
.entypo-icon-cloud:before { content: "\f15a"; }
 | 
			
		||||
.entypo-icon-code:before { content: "\f15b"; }
 | 
			
		||||
.entypo-icon-cog:before { content: "\f15c"; }
 | 
			
		||||
.entypo-icon-colours:before { content: "\f15d"; }
 | 
			
		||||
.entypo-icon-compass:before { content: "\f15e"; }
 | 
			
		||||
.entypo-icon-controller-fast-backward:before { content: "\f15f"; }
 | 
			
		||||
.entypo-icon-controller-fast-forward:before { content: "\f160"; }
 | 
			
		||||
.entypo-icon-controller-jump-to-start:before { content: "\f161"; }
 | 
			
		||||
.entypo-icon-controller-next:before { content: "\f162"; }
 | 
			
		||||
.entypo-icon-controller-paus:before { content: "\f163"; }
 | 
			
		||||
.entypo-icon-controller-play:before { content: "\f164"; }
 | 
			
		||||
.entypo-icon-controller-record:before { content: "\f165"; }
 | 
			
		||||
.entypo-icon-controller-stop:before { content: "\f166"; }
 | 
			
		||||
.entypo-icon-controller-volume:before { content: "\f167"; }
 | 
			
		||||
.entypo-icon-copy:before { content: "\f168"; }
 | 
			
		||||
.entypo-icon-creative-cloud:before { content: "\f169"; }
 | 
			
		||||
.entypo-icon-creative-commons:before { content: "\f16a"; }
 | 
			
		||||
.entypo-icon-creative-commons-attribution:before { content: "\f16b"; }
 | 
			
		||||
.entypo-icon-creative-commons-noderivs:before { content: "\f16c"; }
 | 
			
		||||
.entypo-icon-creative-commons-noncommercial-eu:before { content: "\f16d"; }
 | 
			
		||||
.entypo-icon-creative-commons-noncommercial-us:before { content: "\f16e"; }
 | 
			
		||||
.entypo-icon-creative-commons-public-domain:before { content: "\f16f"; }
 | 
			
		||||
.entypo-icon-creative-commons-remix:before { content: "\f170"; }
 | 
			
		||||
.entypo-icon-creative-commons-share:before { content: "\f171"; }
 | 
			
		||||
.entypo-icon-creative-commons-sharealike:before { content: "\f172"; }
 | 
			
		||||
.entypo-icon-credit:before { content: "\f173"; }
 | 
			
		||||
.entypo-icon-credit-card:before { content: "\f174"; }
 | 
			
		||||
.entypo-icon-crop:before { content: "\f175"; }
 | 
			
		||||
.entypo-icon-cross:before { content: "\f176"; }
 | 
			
		||||
.entypo-icon-cup:before { content: "\f177"; }
 | 
			
		||||
.entypo-icon-cw:before { content: "\f178"; }
 | 
			
		||||
.entypo-icon-cycle:before { content: "\f179"; }
 | 
			
		||||
.entypo-icon-database:before { content: "\f17a"; }
 | 
			
		||||
.entypo-icon-dial-pad:before { content: "\f17b"; }
 | 
			
		||||
.entypo-icon-direction:before { content: "\f17c"; }
 | 
			
		||||
.entypo-icon-document:before { content: "\f17d"; }
 | 
			
		||||
.entypo-icon-document-landscape:before { content: "\f17e"; }
 | 
			
		||||
.entypo-icon-documents:before { content: "\f17f"; }
 | 
			
		||||
.entypo-icon-dot-single:before { content: "\f180"; }
 | 
			
		||||
.entypo-icon-dots-three-horizontal:before { content: "\f181"; }
 | 
			
		||||
.entypo-icon-dots-three-vertical:before { content: "\f182"; }
 | 
			
		||||
.entypo-icon-dots-two-horizontal:before { content: "\f183"; }
 | 
			
		||||
.entypo-icon-dots-two-vertical:before { content: "\f184"; }
 | 
			
		||||
.entypo-icon-download:before { content: "\f185"; }
 | 
			
		||||
.entypo-icon-dribbble:before { content: "\f186"; }
 | 
			
		||||
.entypo-icon-dribbble-with-circle:before { content: "\f187"; }
 | 
			
		||||
.entypo-icon-drink:before { content: "\f188"; }
 | 
			
		||||
.entypo-icon-drive:before { content: "\f189"; }
 | 
			
		||||
.entypo-icon-drop:before { content: "\f18a"; }
 | 
			
		||||
.entypo-icon-dropbox:before { content: "\f18b"; }
 | 
			
		||||
.entypo-icon-edit:before { content: "\f18c"; }
 | 
			
		||||
.entypo-icon-email:before { content: "\f18d"; }
 | 
			
		||||
.entypo-icon-emoji-flirt:before { content: "\f18e"; }
 | 
			
		||||
.entypo-icon-emoji-happy:before { content: "\f18f"; }
 | 
			
		||||
.entypo-icon-emoji-neutral:before { content: "\f190"; }
 | 
			
		||||
.entypo-icon-emoji-sad:before { content: "\f191"; }
 | 
			
		||||
.entypo-icon-erase:before { content: "\f192"; }
 | 
			
		||||
.entypo-icon-eraser:before { content: "\f193"; }
 | 
			
		||||
.entypo-icon-evernote:before { content: "\f194"; }
 | 
			
		||||
.entypo-icon-export:before { content: "\f195"; }
 | 
			
		||||
.entypo-icon-eye:before { content: "\f196"; }
 | 
			
		||||
.entypo-icon-eye-with-line:before { content: "\f197"; }
 | 
			
		||||
.entypo-icon-facebook:before { content: "\f198"; }
 | 
			
		||||
.entypo-icon-facebook-with-circle:before { content: "\f199"; }
 | 
			
		||||
.entypo-icon-feather:before { content: "\f19a"; }
 | 
			
		||||
.entypo-icon-fingerprint:before { content: "\f19b"; }
 | 
			
		||||
.entypo-icon-flag:before { content: "\f19c"; }
 | 
			
		||||
.entypo-icon-flash:before { content: "\f19d"; }
 | 
			
		||||
.entypo-icon-flashlight:before { content: "\f19e"; }
 | 
			
		||||
.entypo-icon-flat-brush:before { content: "\f19f"; }
 | 
			
		||||
.entypo-icon-flattr:before { content: "\f1a0"; }
 | 
			
		||||
.entypo-icon-flickr:before { content: "\f1a1"; }
 | 
			
		||||
.entypo-icon-flickr-with-circle:before { content: "\f1a2"; }
 | 
			
		||||
.entypo-icon-flow-branch:before { content: "\f1a3"; }
 | 
			
		||||
.entypo-icon-flow-cascade:before { content: "\f1a4"; }
 | 
			
		||||
.entypo-icon-flow-line:before { content: "\f1a5"; }
 | 
			
		||||
.entypo-icon-flow-parallel:before { content: "\f1a6"; }
 | 
			
		||||
.entypo-icon-flow-tree:before { content: "\f1a7"; }
 | 
			
		||||
.entypo-icon-flower:before { content: "\f1a8"; }
 | 
			
		||||
.entypo-icon-folder:before { content: "\f1a9"; }
 | 
			
		||||
.entypo-icon-folder-images:before { content: "\f1aa"; }
 | 
			
		||||
.entypo-icon-folder-music:before { content: "\f1ab"; }
 | 
			
		||||
.entypo-icon-folder-video:before { content: "\f1ac"; }
 | 
			
		||||
.entypo-icon-forward:before { content: "\f1ad"; }
 | 
			
		||||
.entypo-icon-foursquare:before { content: "\f1ae"; }
 | 
			
		||||
.entypo-icon-funnel:before { content: "\f1af"; }
 | 
			
		||||
.entypo-icon-game-controller:before { content: "\f1b0"; }
 | 
			
		||||
.entypo-icon-gauge:before { content: "\f1b1"; }
 | 
			
		||||
.entypo-icon-github:before { content: "\f1b2"; }
 | 
			
		||||
.entypo-icon-github-with-circle:before { content: "\f1b3"; }
 | 
			
		||||
.entypo-icon-globe:before { content: "\f1b4"; }
 | 
			
		||||
.entypo-icon-google-drive:before { content: "\f1b5"; }
 | 
			
		||||
.entypo-icon-google-hangouts:before { content: "\f1b6"; }
 | 
			
		||||
.entypo-icon-google-play:before { content: "\f1b7"; }
 | 
			
		||||
.entypo-icon-google-plus:before { content: "\f1b8"; }
 | 
			
		||||
.entypo-icon-google-plus-with-circle:before { content: "\f1b9"; }
 | 
			
		||||
.entypo-icon-graduation-cap:before { content: "\f1ba"; }
 | 
			
		||||
.entypo-icon-grid:before { content: "\f1bb"; }
 | 
			
		||||
.entypo-icon-grooveshark:before { content: "\f1bc"; }
 | 
			
		||||
.entypo-icon-hair-cross:before { content: "\f1bd"; }
 | 
			
		||||
.entypo-icon-hand:before { content: "\f1be"; }
 | 
			
		||||
.entypo-icon-heart:before { content: "\f1bf"; }
 | 
			
		||||
.entypo-icon-heart-outlined:before { content: "\f1c0"; }
 | 
			
		||||
.entypo-icon-help:before { content: "\f1c1"; }
 | 
			
		||||
.entypo-icon-help-with-circle:before { content: "\f1c2"; }
 | 
			
		||||
.entypo-icon-home:before { content: "\f1c3"; }
 | 
			
		||||
.entypo-icon-hour-glass:before { content: "\f1c4"; }
 | 
			
		||||
.entypo-icon-houzz:before { content: "\f1c5"; }
 | 
			
		||||
.entypo-icon-icloud:before { content: "\f1c6"; }
 | 
			
		||||
.entypo-icon-image:before { content: "\f1c7"; }
 | 
			
		||||
.entypo-icon-image-inverted:before { content: "\f1c8"; }
 | 
			
		||||
.entypo-icon-images:before { content: "\f1c9"; }
 | 
			
		||||
.entypo-icon-inbox:before { content: "\f1ca"; }
 | 
			
		||||
.entypo-icon-infinity:before { content: "\f1cb"; }
 | 
			
		||||
.entypo-icon-info:before { content: "\f1cc"; }
 | 
			
		||||
.entypo-icon-info-with-circle:before { content: "\f1cd"; }
 | 
			
		||||
.entypo-icon-instagram:before { content: "\f1ce"; }
 | 
			
		||||
.entypo-icon-instagram-with-circle:before { content: "\f1cf"; }
 | 
			
		||||
.entypo-icon-install:before { content: "\f1d0"; }
 | 
			
		||||
.entypo-icon-key:before { content: "\f1d1"; }
 | 
			
		||||
.entypo-icon-keyboard:before { content: "\f1d2"; }
 | 
			
		||||
.entypo-icon-lab-flask:before { content: "\f1d3"; }
 | 
			
		||||
.entypo-icon-landline:before { content: "\f1d4"; }
 | 
			
		||||
.entypo-icon-language:before { content: "\f1d5"; }
 | 
			
		||||
.entypo-icon-laptop:before { content: "\f1d6"; }
 | 
			
		||||
.entypo-icon-lastfm:before { content: "\f1d7"; }
 | 
			
		||||
.entypo-icon-lastfm-with-circle:before { content: "\f1d8"; }
 | 
			
		||||
.entypo-icon-layers:before { content: "\f1d9"; }
 | 
			
		||||
.entypo-icon-leaf:before { content: "\f1da"; }
 | 
			
		||||
.entypo-icon-level-down:before { content: "\f1db"; }
 | 
			
		||||
.entypo-icon-level-up:before { content: "\f1dc"; }
 | 
			
		||||
.entypo-icon-lifebuoy:before { content: "\f1dd"; }
 | 
			
		||||
.entypo-icon-light-bulb:before { content: "\f1de"; }
 | 
			
		||||
.entypo-icon-light-down:before { content: "\f1df"; }
 | 
			
		||||
.entypo-icon-light-up:before { content: "\f1e0"; }
 | 
			
		||||
.entypo-icon-line-graph:before { content: "\f1e1"; }
 | 
			
		||||
.entypo-icon-link:before { content: "\f1e2"; }
 | 
			
		||||
.entypo-icon-linkedin:before { content: "\f1e3"; }
 | 
			
		||||
.entypo-icon-linkedin-with-circle:before { content: "\f1e4"; }
 | 
			
		||||
.entypo-icon-list:before { content: "\f1e5"; }
 | 
			
		||||
.entypo-icon-location:before { content: "\f1e6"; }
 | 
			
		||||
.entypo-icon-location-pin:before { content: "\f1e7"; }
 | 
			
		||||
.entypo-icon-lock:before { content: "\f1e8"; }
 | 
			
		||||
.entypo-icon-lock-open:before { content: "\f1e9"; }
 | 
			
		||||
.entypo-icon-log-out:before { content: "\f1ea"; }
 | 
			
		||||
.entypo-icon-login:before { content: "\f1eb"; }
 | 
			
		||||
.entypo-icon-loop:before { content: "\f1ec"; }
 | 
			
		||||
.entypo-icon-magnet:before { content: "\f1ed"; }
 | 
			
		||||
.entypo-icon-magnifying-glass:before { content: "\f1ee"; }
 | 
			
		||||
.entypo-icon-mail:before { content: "\f1ef"; }
 | 
			
		||||
.entypo-icon-mail-with-circle:before { content: "\f1f0"; }
 | 
			
		||||
.entypo-icon-man:before { content: "\f1f1"; }
 | 
			
		||||
.entypo-icon-map:before { content: "\f1f2"; }
 | 
			
		||||
.entypo-icon-mask:before { content: "\f1f3"; }
 | 
			
		||||
.entypo-icon-medal:before { content: "\f1f4"; }
 | 
			
		||||
.entypo-icon-medium:before { content: "\f1f5"; }
 | 
			
		||||
.entypo-icon-medium-with-circle:before { content: "\f1f6"; }
 | 
			
		||||
.entypo-icon-megaphone:before { content: "\f1f7"; }
 | 
			
		||||
.entypo-icon-menu:before { content: "\f1f8"; }
 | 
			
		||||
.entypo-icon-merge:before { content: "\f1f9"; }
 | 
			
		||||
.entypo-icon-message:before { content: "\f1fa"; }
 | 
			
		||||
.entypo-icon-mic:before { content: "\f1fb"; }
 | 
			
		||||
.entypo-icon-minus:before { content: "\f1fc"; }
 | 
			
		||||
.entypo-icon-mixi:before { content: "\f1fd"; }
 | 
			
		||||
.entypo-icon-mobile:before { content: "\f1fe"; }
 | 
			
		||||
.entypo-icon-modern-mic:before { content: "\f1ff"; }
 | 
			
		||||
.entypo-icon-moon:before { content: "\f200"; }
 | 
			
		||||
.entypo-icon-mouse:before { content: "\f201"; }
 | 
			
		||||
.entypo-icon-mouse-pointer:before { content: "\f202"; }
 | 
			
		||||
.entypo-icon-music:before { content: "\f203"; }
 | 
			
		||||
.entypo-icon-network:before { content: "\f204"; }
 | 
			
		||||
.entypo-icon-new:before { content: "\f205"; }
 | 
			
		||||
.entypo-icon-new-message:before { content: "\f206"; }
 | 
			
		||||
.entypo-icon-news:before { content: "\f207"; }
 | 
			
		||||
.entypo-icon-newsletter:before { content: "\f208"; }
 | 
			
		||||
.entypo-icon-note:before { content: "\f209"; }
 | 
			
		||||
.entypo-icon-notification:before { content: "\f20a"; }
 | 
			
		||||
.entypo-icon-notifications-off:before { content: "\f20b"; }
 | 
			
		||||
.entypo-icon-old-mobile:before { content: "\f20c"; }
 | 
			
		||||
.entypo-icon-old-phone:before { content: "\f20d"; }
 | 
			
		||||
.entypo-icon-onedrive:before { content: "\f20e"; }
 | 
			
		||||
.entypo-icon-open-book:before { content: "\f20f"; }
 | 
			
		||||
.entypo-icon-palette:before { content: "\f210"; }
 | 
			
		||||
.entypo-icon-paper-plane:before { content: "\f211"; }
 | 
			
		||||
.entypo-icon-paypal:before { content: "\f212"; }
 | 
			
		||||
.entypo-icon-pencil:before { content: "\f213"; }
 | 
			
		||||
.entypo-icon-phone:before { content: "\f214"; }
 | 
			
		||||
.entypo-icon-picasa:before { content: "\f215"; }
 | 
			
		||||
.entypo-icon-pie-chart:before { content: "\f216"; }
 | 
			
		||||
.entypo-icon-pin:before { content: "\f217"; }
 | 
			
		||||
.entypo-icon-pinterest:before { content: "\f218"; }
 | 
			
		||||
.entypo-icon-pinterest-with-circle:before { content: "\f219"; }
 | 
			
		||||
.entypo-icon-plus:before { content: "\f21a"; }
 | 
			
		||||
.entypo-icon-popup:before { content: "\f21b"; }
 | 
			
		||||
.entypo-icon-power-plug:before { content: "\f21c"; }
 | 
			
		||||
.entypo-icon-price-ribbon:before { content: "\f21d"; }
 | 
			
		||||
.entypo-icon-price-tag:before { content: "\f21e"; }
 | 
			
		||||
.entypo-icon-print:before { content: "\f21f"; }
 | 
			
		||||
.entypo-icon-progress-empty:before { content: "\f220"; }
 | 
			
		||||
.entypo-icon-progress-full:before { content: "\f221"; }
 | 
			
		||||
.entypo-icon-progress-one:before { content: "\f222"; }
 | 
			
		||||
.entypo-icon-progress-two:before { content: "\f223"; }
 | 
			
		||||
.entypo-icon-publish:before { content: "\f224"; }
 | 
			
		||||
.entypo-icon-qq:before { content: "\f225"; }
 | 
			
		||||
.entypo-icon-qq-with-circle:before { content: "\f226"; }
 | 
			
		||||
.entypo-icon-quote:before { content: "\f227"; }
 | 
			
		||||
.entypo-icon-radio:before { content: "\f228"; }
 | 
			
		||||
.entypo-icon-raft:before { content: "\f229"; }
 | 
			
		||||
.entypo-icon-raft-with-circle:before { content: "\f22a"; }
 | 
			
		||||
.entypo-icon-rainbow:before { content: "\f22b"; }
 | 
			
		||||
.entypo-icon-rdio:before { content: "\f22c"; }
 | 
			
		||||
.entypo-icon-rdio-with-circle:before { content: "\f22d"; }
 | 
			
		||||
.entypo-icon-remove-user:before { content: "\f22e"; }
 | 
			
		||||
.entypo-icon-renren:before { content: "\f22f"; }
 | 
			
		||||
.entypo-icon-reply:before { content: "\f230"; }
 | 
			
		||||
.entypo-icon-reply-all:before { content: "\f231"; }
 | 
			
		||||
.entypo-icon-resize-100-percent:before { content: "\f232"; }
 | 
			
		||||
.entypo-icon-resize-full-screen:before { content: "\f233"; }
 | 
			
		||||
.entypo-icon-retweet:before { content: "\f234"; }
 | 
			
		||||
.entypo-icon-rocket:before { content: "\f235"; }
 | 
			
		||||
.entypo-icon-round-brush:before { content: "\f236"; }
 | 
			
		||||
.entypo-icon-rss:before { content: "\f237"; }
 | 
			
		||||
.entypo-icon-ruler:before { content: "\f238"; }
 | 
			
		||||
.entypo-icon-save:before { content: "\f239"; }
 | 
			
		||||
.entypo-icon-scissors:before { content: "\f23a"; }
 | 
			
		||||
.entypo-icon-scribd:before { content: "\f23b"; }
 | 
			
		||||
.entypo-icon-select-arrows:before { content: "\f23c"; }
 | 
			
		||||
.entypo-icon-share:before { content: "\f23d"; }
 | 
			
		||||
.entypo-icon-share-alternative:before { content: "\f23e"; }
 | 
			
		||||
.entypo-icon-shareable:before { content: "\f23f"; }
 | 
			
		||||
.entypo-icon-shield:before { content: "\f240"; }
 | 
			
		||||
.entypo-icon-shop:before { content: "\f241"; }
 | 
			
		||||
.entypo-icon-shopping-bag:before { content: "\f242"; }
 | 
			
		||||
.entypo-icon-shopping-basket:before { content: "\f243"; }
 | 
			
		||||
.entypo-icon-shopping-cart:before { content: "\f244"; }
 | 
			
		||||
.entypo-icon-shuffle:before { content: "\f245"; }
 | 
			
		||||
.entypo-icon-signal:before { content: "\f246"; }
 | 
			
		||||
.entypo-icon-sina-weibo:before { content: "\f247"; }
 | 
			
		||||
.entypo-icon-skype:before { content: "\f248"; }
 | 
			
		||||
.entypo-icon-skype-with-circle:before { content: "\f249"; }
 | 
			
		||||
.entypo-icon-slideshare:before { content: "\f24a"; }
 | 
			
		||||
.entypo-icon-smashing:before { content: "\f24b"; }
 | 
			
		||||
.entypo-icon-sound:before { content: "\f24c"; }
 | 
			
		||||
.entypo-icon-sound-mix:before { content: "\f24d"; }
 | 
			
		||||
.entypo-icon-sound-mute:before { content: "\f24e"; }
 | 
			
		||||
.entypo-icon-soundcloud:before { content: "\f24f"; }
 | 
			
		||||
.entypo-icon-sports-club:before { content: "\f250"; }
 | 
			
		||||
.entypo-icon-spotify:before { content: "\f251"; }
 | 
			
		||||
.entypo-icon-spotify-with-circle:before { content: "\f252"; }
 | 
			
		||||
.entypo-icon-spreadsheet:before { content: "\f253"; }
 | 
			
		||||
.entypo-icon-squared-cross:before { content: "\f254"; }
 | 
			
		||||
.entypo-icon-squared-minus:before { content: "\f255"; }
 | 
			
		||||
.entypo-icon-squared-plus:before { content: "\f256"; }
 | 
			
		||||
.entypo-icon-star:before { content: "\f257"; }
 | 
			
		||||
.entypo-icon-star-outlined:before { content: "\f258"; }
 | 
			
		||||
.entypo-icon-stopwatch:before { content: "\f259"; }
 | 
			
		||||
.entypo-icon-stumbleupon:before { content: "\f25a"; }
 | 
			
		||||
.entypo-icon-stumbleupon-with-circle:before { content: "\f25b"; }
 | 
			
		||||
.entypo-icon-suitcase:before { content: "\f25c"; }
 | 
			
		||||
.entypo-icon-swap:before { content: "\f25d"; }
 | 
			
		||||
.entypo-icon-swarm:before { content: "\f25e"; }
 | 
			
		||||
.entypo-icon-sweden:before { content: "\f25f"; }
 | 
			
		||||
.entypo-icon-switch:before { content: "\f260"; }
 | 
			
		||||
.entypo-icon-tablet:before { content: "\f261"; }
 | 
			
		||||
.entypo-icon-tablet-mobile-combo:before { content: "\f262"; }
 | 
			
		||||
.entypo-icon-tag:before { content: "\f263"; }
 | 
			
		||||
.entypo-icon-text:before { content: "\f264"; }
 | 
			
		||||
.entypo-icon-text-document:before { content: "\f265"; }
 | 
			
		||||
.entypo-icon-text-document-inverted:before { content: "\f266"; }
 | 
			
		||||
.entypo-icon-thermometer:before { content: "\f267"; }
 | 
			
		||||
.entypo-icon-thumbs-down:before { content: "\f268"; }
 | 
			
		||||
.entypo-icon-thumbs-up:before { content: "\f269"; }
 | 
			
		||||
.entypo-icon-thunder-cloud:before { content: "\f26a"; }
 | 
			
		||||
.entypo-icon-ticket:before { content: "\f26b"; }
 | 
			
		||||
.entypo-icon-time-slot:before { content: "\f26c"; }
 | 
			
		||||
.entypo-icon-tools:before { content: "\f26d"; }
 | 
			
		||||
.entypo-icon-traffic-cone:before { content: "\f26e"; }
 | 
			
		||||
.entypo-icon-trash:before { content: "\f26f"; }
 | 
			
		||||
.entypo-icon-tree:before { content: "\f270"; }
 | 
			
		||||
.entypo-icon-triangle-down:before { content: "\f271"; }
 | 
			
		||||
.entypo-icon-triangle-left:before { content: "\f272"; }
 | 
			
		||||
.entypo-icon-triangle-right:before { content: "\f273"; }
 | 
			
		||||
.entypo-icon-triangle-up:before { content: "\f274"; }
 | 
			
		||||
.entypo-icon-tripadvisor:before { content: "\f275"; }
 | 
			
		||||
.entypo-icon-trophy:before { content: "\f276"; }
 | 
			
		||||
.entypo-icon-tumblr:before { content: "\f277"; }
 | 
			
		||||
.entypo-icon-tumblr-with-circle:before { content: "\f278"; }
 | 
			
		||||
.entypo-icon-tv:before { content: "\f279"; }
 | 
			
		||||
.entypo-icon-twitter:before { content: "\f27a"; }
 | 
			
		||||
.entypo-icon-twitter-with-circle:before { content: "\f27b"; }
 | 
			
		||||
.entypo-icon-typing:before { content: "\f27c"; }
 | 
			
		||||
.entypo-icon-uninstall:before { content: "\f27d"; }
 | 
			
		||||
.entypo-icon-unread:before { content: "\f27e"; }
 | 
			
		||||
.entypo-icon-untag:before { content: "\f27f"; }
 | 
			
		||||
.entypo-icon-upload:before { content: "\f280"; }
 | 
			
		||||
.entypo-icon-upload-to-cloud:before { content: "\f281"; }
 | 
			
		||||
.entypo-icon-user:before { content: "\f282"; }
 | 
			
		||||
.entypo-icon-users:before { content: "\f283"; }
 | 
			
		||||
.entypo-icon-v-card:before { content: "\f284"; }
 | 
			
		||||
.entypo-icon-video:before { content: "\f285"; }
 | 
			
		||||
.entypo-icon-video-camera:before { content: "\f286"; }
 | 
			
		||||
.entypo-icon-vimeo:before { content: "\f287"; }
 | 
			
		||||
.entypo-icon-vimeo-with-circle:before { content: "\f288"; }
 | 
			
		||||
.entypo-icon-vine:before { content: "\f289"; }
 | 
			
		||||
.entypo-icon-vine-with-circle:before { content: "\f28a"; }
 | 
			
		||||
.entypo-icon-vinyl:before { content: "\f28b"; }
 | 
			
		||||
.entypo-icon-vk:before { content: "\f28c"; }
 | 
			
		||||
.entypo-icon-vk-alternitive:before { content: "\f28d"; }
 | 
			
		||||
.entypo-icon-vk-with-circle:before { content: "\f28e"; }
 | 
			
		||||
.entypo-icon-voicemail:before { content: "\f28f"; }
 | 
			
		||||
.entypo-icon-wallet:before { content: "\f290"; }
 | 
			
		||||
.entypo-icon-warning:before { content: "\f291"; }
 | 
			
		||||
.entypo-icon-water:before { content: "\f292"; }
 | 
			
		||||
.entypo-icon-windows-store:before { content: "\f293"; }
 | 
			
		||||
.entypo-icon-xing:before { content: "\f294"; }
 | 
			
		||||
.entypo-icon-xing-with-circle:before { content: "\f295"; }
 | 
			
		||||
.entypo-icon-yelp:before { content: "\f296"; }
 | 
			
		||||
.entypo-icon-youko:before { content: "\f297"; }
 | 
			
		||||
.entypo-icon-youko-with-circle:before { content: "\f298"; }
 | 
			
		||||
.entypo-icon-youtube:before { content: "\f299"; }
 | 
			
		||||
.entypo-icon-youtube-with-circle:before { content: "\f29a"; }
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								cs440-acg/ext/nanogui/docs/_static/entypo.eot
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								cs440-acg/ext/nanogui/docs/_static/entypo.eot
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										2003
									
								
								cs440-acg/ext/nanogui/docs/_static/entypo.svg
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										2003
									
								
								cs440-acg/ext/nanogui/docs/_static/entypo.svg
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| 
		 After Width: | Height: | Size: 340 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								cs440-acg/ext/nanogui/docs/_static/entypo.ttf
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								cs440-acg/ext/nanogui/docs/_static/entypo.ttf
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								cs440-acg/ext/nanogui/docs/_static/entypo.woff
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								cs440-acg/ext/nanogui/docs/_static/entypo.woff
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								cs440-acg/ext/nanogui/docs/_static/entypo.woff2
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								cs440-acg/ext/nanogui/docs/_static/entypo.woff2
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										330
									
								
								cs440-acg/ext/nanogui/docs/compilation.rst
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										330
									
								
								cs440-acg/ext/nanogui/docs/compilation.rst
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,330 @@
 | 
			
		||||
Compilation
 | 
			
		||||
========================================================================================
 | 
			
		||||
 | 
			
		||||
NanoGUI uses a CMake build system to ensure portability. All dependencies are
 | 
			
		||||
cloned and compiled in one batch, which should generally reduce the amount of
 | 
			
		||||
configuration effort to zero. Assuming that NanoGUI was cloned into the current
 | 
			
		||||
working directory, the following commands need to be executed:
 | 
			
		||||
 | 
			
		||||
.. code-block:: bash
 | 
			
		||||
 | 
			
		||||
   # enter the top-level NanoGUI directory
 | 
			
		||||
   $ cd nanogui
 | 
			
		||||
 | 
			
		||||
   # make a build directory and enter that
 | 
			
		||||
   $ mkdir build
 | 
			
		||||
   $ cd build
 | 
			
		||||
 | 
			
		||||
   # generate your Makefile
 | 
			
		||||
   $ cmake ..
 | 
			
		||||
 | 
			
		||||
   # now that you have a Makefile, use that to build
 | 
			
		||||
   $ make -j 4
 | 
			
		||||
 | 
			
		||||
For Windows, the process is nearly the same:
 | 
			
		||||
 | 
			
		||||
.. code-block:: bash
 | 
			
		||||
 | 
			
		||||
   # enter the top-level NanoGUI directory
 | 
			
		||||
   $ cd nanogui
 | 
			
		||||
 | 
			
		||||
   # make a build directory and enter that
 | 
			
		||||
   $ mkdir build
 | 
			
		||||
   $ cd build
 | 
			
		||||
 | 
			
		||||
   # Specify VS Version AND 64bit, otherwise it defaults to 32.
 | 
			
		||||
   # The version number and year may be different for you, Win64
 | 
			
		||||
   # can be appended to any of them.  Execute `cmake -G` to get
 | 
			
		||||
   # a listing of the available generators.
 | 
			
		||||
   #
 | 
			
		||||
   # 32 bit Windows builds are /not/ supported
 | 
			
		||||
   $ cmake -G "Visual Studio 14 2015 Win64" ..
 | 
			
		||||
 | 
			
		||||
   # Either open the .sln with Visual Studio, or run
 | 
			
		||||
   $ cmake --build . --config Release
 | 
			
		||||
 | 
			
		||||
Default Configurations
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
By default, NanoGUI will
 | 
			
		||||
 | 
			
		||||
+---------------------------------+---------------------------+
 | 
			
		||||
| Impact / effect                 | CMake Option              |
 | 
			
		||||
+=================================+===========================+
 | 
			
		||||
| Build the example programs.     | ``NANOGUI_BUILD_EXAMPLE`` |
 | 
			
		||||
+---------------------------------+---------------------------+
 | 
			
		||||
| Build as a *shared* library.    | ``NANOGUI_BUILD_SHARED``  |
 | 
			
		||||
+---------------------------------+---------------------------+
 | 
			
		||||
| Build the Python plugins.       | ``NANOGUI_BUILD_PYTHON``  |
 | 
			
		||||
+---------------------------------+---------------------------+
 | 
			
		||||
| Use GLAD if on Windows.         | ``NANOGUI_USE_GLAD``      |
 | 
			
		||||
+---------------------------------+---------------------------+
 | 
			
		||||
| Generate an ``install`` target. | ``NANOGUI_INSTALL``       |
 | 
			
		||||
+---------------------------------+---------------------------+
 | 
			
		||||
 | 
			
		||||
Users developing projects that reference NanoGUI as a ``git submodule`` (this
 | 
			
		||||
is **strongly** encouraged) can set up the parent project's CMake configuration
 | 
			
		||||
file as follows (this assumes that ``nanogui`` lives in the directory
 | 
			
		||||
``ext/nanogui`` relative to the parent project):
 | 
			
		||||
 | 
			
		||||
.. code-block:: cmake
 | 
			
		||||
 | 
			
		||||
    # Disable building extras we won't need (pure C++ project)
 | 
			
		||||
    set(NANOGUI_BUILD_EXAMPLE OFF CACHE BOOL " " FORCE)
 | 
			
		||||
    set(NANOGUI_BUILD_PYTHON  OFF CACHE BOOL " " FORCE)
 | 
			
		||||
    set(NANOGUI_INSTALL       OFF CACHE BOOL " " FORCE)
 | 
			
		||||
 | 
			
		||||
    # Add the configurations from nanogui
 | 
			
		||||
    add_subdirectory(ext/nanogui)
 | 
			
		||||
 | 
			
		||||
    # For reliability of parallel build, make the NanoGUI targets dependencies
 | 
			
		||||
    set_property(TARGET glfw glfw_objects nanogui PROPERTY FOLDER "dependencies")
 | 
			
		||||
 | 
			
		||||
Required Variables Exposed
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
Due to the nature of building an OpenGL application for different platforms, three
 | 
			
		||||
variables are populated to allow for easy incorporation with your CMake build.  After
 | 
			
		||||
you have executed ``add_subdirectory`` as shown above, you will need to add the
 | 
			
		||||
following (assuming the target you are building is called ``myTarget``):
 | 
			
		||||
 | 
			
		||||
.. code-block:: cmake
 | 
			
		||||
 | 
			
		||||
   # Various preprocessor definitions have been generated by NanoGUI
 | 
			
		||||
   add_definitions(${NANOGUI_EXTRA_DEFS})
 | 
			
		||||
 | 
			
		||||
   # On top of adding the path to nanogui/include, you may need extras
 | 
			
		||||
   include_directories(${NANOGUI_EXTRA_INCS})
 | 
			
		||||
 | 
			
		||||
   # Compile a target using NanoGUI
 | 
			
		||||
   add_executable(myTarget myTarget.cpp)
 | 
			
		||||
 | 
			
		||||
   # Lastly, additional libraries may have been built for you.  In addition to linking
 | 
			
		||||
   # against NanoGUI, we need to link against those as well.
 | 
			
		||||
   target_link_libraries(myTarget nanogui ${NANOGUI_EXTRA_LIBS})
 | 
			
		||||
 | 
			
		||||
Advanced Compilation Details
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
NanoGUI and Python
 | 
			
		||||
****************************************************************************************
 | 
			
		||||
 | 
			
		||||
Although it is |year|, you may still for example wish to build the Python bindings for
 | 
			
		||||
Python 2.7.  The variable you would set **before** ``add_subdirectory`` is
 | 
			
		||||
``NANOGUI_PYTHON_VERSION``.  For example,
 | 
			
		||||
 | 
			
		||||
.. code-block:: cmake
 | 
			
		||||
 | 
			
		||||
   set(NANOGUI_PYTHON_VERSION "2.7")
 | 
			
		||||
   # can also use minor versions
 | 
			
		||||
   set(NANOGUI_PYTHON_VERSION "3.6.2")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
NanoGUI and Eigen
 | 
			
		||||
****************************************************************************************
 | 
			
		||||
 | 
			
		||||
NanoGUI uses Eigen_ internally for various vector types.  Eigen is an advanced header
 | 
			
		||||
only template library, which NanoGUI vendors in the ``ext`` folder.  It is important to
 | 
			
		||||
understand the implication of Eigen being header only: **only one version of Eigen can
 | 
			
		||||
be included**.
 | 
			
		||||
 | 
			
		||||
There is a CMake bypass variable available in NanoGUI: ``NANOGUI_EIGEN_INCLUDE_DIR``.
 | 
			
		||||
You would set this variable **before** ``add_subdirectory``.  Since you will want to
 | 
			
		||||
provide the same kind of bypass for users of your library, the following snippet is a
 | 
			
		||||
good starting point.  For this example code:
 | 
			
		||||
 | 
			
		||||
1. The parent CMake project is called ``myproj``.  A good CMake practice to adopt is to
 | 
			
		||||
   prefix your project's name to any variables you intend to expose.  This allows parent
 | 
			
		||||
   projects to know where the variable came from, and avoids name collisions.
 | 
			
		||||
2. First ``find_package`` is used to try and find Eigen.  The philosophy is that the
 | 
			
		||||
   user is responsible for ensuring that the version of Eigen they want to use will be
 | 
			
		||||
   found.
 | 
			
		||||
3. Since NanoGUI needs to remain self-contained, the side-effect is that even if the
 | 
			
		||||
   user does *not* have Eigen installed, you can fallback and use the one vendored with
 | 
			
		||||
   NanoGUI.
 | 
			
		||||
4. The following directory structure:
 | 
			
		||||
 | 
			
		||||
   .. code-block:: none
 | 
			
		||||
 | 
			
		||||
      myproj/
 | 
			
		||||
          CMakeLists.txt         <- Where this example code is
 | 
			
		||||
          ext/
 | 
			
		||||
              nanogui/
 | 
			
		||||
                  CMakeLists.txt <- NanoGUI's build system
 | 
			
		||||
                  ext/
 | 
			
		||||
                      eigen/     <- NanoGUI's internal copy of Eigen
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
.. code-block:: cmake
 | 
			
		||||
 | 
			
		||||
   # `if NOT` is what enables the same bypass for your project
 | 
			
		||||
   if(NOT MYPROJ_EIGEN3_INCLUDE_DIR)
 | 
			
		||||
     # Grab or find the Eigen3 include directory.
 | 
			
		||||
     find_package(Eigen3 QUIET)
 | 
			
		||||
     if(EIGEN3_INCLUDE_DIR)
 | 
			
		||||
       set(MYPROJ_EIGEN3_INCLUDE_DIR ${EIGEN3_INCLUDE_DIR})
 | 
			
		||||
     else()
 | 
			
		||||
       # use the internal NanoGUI copy of Eigen
 | 
			
		||||
       set(MYPROJ_EIGEN3_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/nanogui/ext/eigen)
 | 
			
		||||
     endif()
 | 
			
		||||
   endif()
 | 
			
		||||
 | 
			
		||||
   message(STATUS "Using Eigen3 from directory: ${MYPROJ_EIGEN3_INCLUDE_DIR}")
 | 
			
		||||
   set(NANOGUI_EIGEN_INCLUDE_DIR ${EIGEN3_INCLUDE_DIR} CACHE BOOL " " FORCE)
 | 
			
		||||
   # set any other NanoGUI specific variables you need (shown in above sections)
 | 
			
		||||
   add_subdirectory(ext/nanogui)
 | 
			
		||||
 | 
			
		||||
   # include it for your project as well (or append to a list
 | 
			
		||||
   # and include that list later, depending on your setup)
 | 
			
		||||
   include_directories(${MYPROJ_EIGEN3_INCLUDE_DIR})
 | 
			
		||||
 | 
			
		||||
.. _Eigen: https://eigen.tuxfamily.org/dox/
 | 
			
		||||
 | 
			
		||||
NanoGUI, GLFW, and Other Projects
 | 
			
		||||
****************************************************************************************
 | 
			
		||||
 | 
			
		||||
Suppose you want to use NanoGUI as your GUI toolkit, but you also have another library
 | 
			
		||||
you want to use that depends on ``glfw``.  Call the second library Foo.  Generally
 | 
			
		||||
speaking, it is unlikely that library Foo will provide you with mechanisms to explicitly
 | 
			
		||||
specify where ``glfw`` comes from.  You could try to work on a patch with the developers
 | 
			
		||||
of library Foo to allow this to be overridden, but you may need to maintain your own
 | 
			
		||||
fork of library Foo.  There is just as much justification to allow the bypass as there
 | 
			
		||||
is to not want it in a build system.
 | 
			
		||||
 | 
			
		||||
Since NanoGUI merges the ``glfw`` objects into the library being built, you can actually
 | 
			
		||||
just specify ``nanogui`` as the ``glfw`` dependency directly.  So lets suppose that
 | 
			
		||||
library Foo was looking for ``glfw`` like this:
 | 
			
		||||
 | 
			
		||||
.. code-block:: cmake
 | 
			
		||||
 | 
			
		||||
   find_package(GLFW3)
 | 
			
		||||
   if(GLFW3_FOUND)
 | 
			
		||||
     include_directories(${GLFW3_INCLUDE_DIRS})
 | 
			
		||||
     target_link_libraries(foo ${GLFW3_LIBRARIES})
 | 
			
		||||
   endif()
 | 
			
		||||
 | 
			
		||||
You can cheat around this pretty easily.  For the modification to library Foo's build
 | 
			
		||||
system, all we do is wrap ``find_package``:
 | 
			
		||||
 | 
			
		||||
.. code-block:: diff
 | 
			
		||||
 | 
			
		||||
   + if(NOT GLFW3_FOUND)
 | 
			
		||||
       find_package(GLFW3)
 | 
			
		||||
   + endif()
 | 
			
		||||
     if(GLFW3_FOUND)
 | 
			
		||||
       include_directories(${GLFW3_INCLUDE_DIRS})
 | 
			
		||||
       target_link_libraries(foo ${GLFW3_LIBRARIES})
 | 
			
		||||
     endif()
 | 
			
		||||
 | 
			
		||||
Now that ``find_package`` will only execute if ``NOT GLFW3_FOUND``, in your build system
 | 
			
		||||
you make sure to set all three ``glfw`` variables (found, include, and libraries).  It
 | 
			
		||||
might look something like this:
 | 
			
		||||
 | 
			
		||||
.. code-block:: cmake
 | 
			
		||||
 | 
			
		||||
   # ... any other nanogui configs ...
 | 
			
		||||
   # same directory structure as Eigen example
 | 
			
		||||
   add_subdirectory(ext/nanogui)
 | 
			
		||||
 | 
			
		||||
   # nanogui needs to be added first so the 'nanogui' target is defined
 | 
			
		||||
   # and can be used in the generator expression for the libraries
 | 
			
		||||
   set(GLFW3_FOUND ON)
 | 
			
		||||
   set(GLFW3_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/ext/nanogui/ext/glfw/include)
 | 
			
		||||
   set(GLFW3_LIBRARIES $<TARGET_FILE:nanogui>)
 | 
			
		||||
 | 
			
		||||
   add_subdirectory(ext/foo)
 | 
			
		||||
 | 
			
		||||
   # IMPORTANT! You need to force NanoGUI to build first
 | 
			
		||||
   # Assuming their library target is called 'foo'
 | 
			
		||||
   add_dependencies(foo nanogui)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Depending on what you need to do, the above may not be sufficient.  But it is at least
 | 
			
		||||
a starting point to being able to "share" NanoGUI as the vendor of ``glfw``.
 | 
			
		||||
 | 
			
		||||
.. _nanogui_including_custom_fonts:
 | 
			
		||||
 | 
			
		||||
Including Custom Fonts
 | 
			
		||||
****************************************************************************************
 | 
			
		||||
 | 
			
		||||
NanoGUI uses the Roboto_ font for text, and Entypo_ font for icons.  If you wish to add
 | 
			
		||||
your own custom font, all you need is a True Type file (a ``.ttf`` extension).  NanoGUI
 | 
			
		||||
will glob all fonts found in ``resources`` by expanding ``resources/*.ttf``.  So if you
 | 
			
		||||
had the directory structure
 | 
			
		||||
 | 
			
		||||
.. code-block:: none
 | 
			
		||||
 | 
			
		||||
   myproject/
 | 
			
		||||
       CMakeLists.txt      <- where this code is
 | 
			
		||||
       fonts/
 | 
			
		||||
           superfont.ttf
 | 
			
		||||
       ext/
 | 
			
		||||
           nanogui/
 | 
			
		||||
               resources/
 | 
			
		||||
 | 
			
		||||
You simply need to copy the ``superfont.ttf`` to NanoGUI's resources directory:
 | 
			
		||||
 | 
			
		||||
.. code-block:: cmake
 | 
			
		||||
 | 
			
		||||
   file(
 | 
			
		||||
     COPY ${CMAKE_CURRENT_SOURCE_DIR}/fonts/superfont.ttf
 | 
			
		||||
     DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/ext/nanogui/resources/superfont.ttf
 | 
			
		||||
   )
 | 
			
		||||
 | 
			
		||||
When you build the code, there should be a file ``nanogui_resources.h`` generated.  If
 | 
			
		||||
everything worked, your new font should have been included.
 | 
			
		||||
 | 
			
		||||
.. note::
 | 
			
		||||
 | 
			
		||||
   Since NanoGUI can support images as icons, you will want to make sure that the
 | 
			
		||||
   *codepoint* for any *icon* fonts you create is greater than ``1024``.  See
 | 
			
		||||
   :func:`nanogui::nvgIsImageIcon`.
 | 
			
		||||
 | 
			
		||||
.. tip::
 | 
			
		||||
 | 
			
		||||
   Some widgets allow you to set fonts directly, but if you want to apply the font
 | 
			
		||||
   globally, you should create a sub-class of :class:`nanogui::Theme` and explicitly
 | 
			
		||||
   call :func:`nanogui::Widget::setTheme` for each widget you create.
 | 
			
		||||
 | 
			
		||||
.. _Roboto: https://fonts.google.com/specimen/Roboto
 | 
			
		||||
 | 
			
		||||
.. _Entypo: http://www.entypo.com
 | 
			
		||||
 | 
			
		||||
.. _utf8: http://www.utf8-chartable.de/
 | 
			
		||||
 | 
			
		||||
.. _nanogui_compiling_the_docs:
 | 
			
		||||
 | 
			
		||||
Compiling the Documentation
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
The documentation system relies on 'Doxygen', 'Sphinx', 'Breathe', and
 | 
			
		||||
'Exhale'.  It uses the 'Read the Docs' theme for the layout of the generated
 | 
			
		||||
html.  So you will need to first
 | 
			
		||||
 | 
			
		||||
1. Install Doxygen for your operating system.  On Unix based systems, this
 | 
			
		||||
   should be available through your package manager (apt-get, brew, dnf, etc).
 | 
			
		||||
 | 
			
		||||
2. Install Sphinx, Breathe, Exhale, and the theme:
 | 
			
		||||
 | 
			
		||||
   .. code-block:: py
 | 
			
		||||
 | 
			
		||||
      pip3 install -r <path/to/nanogui>/docs/requirements.txt
 | 
			
		||||
 | 
			
		||||
Now that you have the relevant tools, you can build the documentation with
 | 
			
		||||
 | 
			
		||||
.. code-block:: bash
 | 
			
		||||
 | 
			
		||||
   # Enter the documentation directory
 | 
			
		||||
   $ cd <path/to/nanogui>/docs
 | 
			
		||||
 | 
			
		||||
   # Build the documentation
 | 
			
		||||
   $ make html
 | 
			
		||||
 | 
			
		||||
The output will be generated in ``_build``, the root html document is located
 | 
			
		||||
at ``_build/html/index.html``.
 | 
			
		||||
 | 
			
		||||
.. note::
 | 
			
		||||
 | 
			
		||||
   When building the documentation locally, there can be subtle differences in
 | 
			
		||||
   the rendered pages than what is hosted online.  You should largely be able
 | 
			
		||||
   to ignore this.
 | 
			
		||||
							
								
								
									
										372
									
								
								cs440-acg/ext/nanogui/docs/conf.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										372
									
								
								cs440-acg/ext/nanogui/docs/conf.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,372 @@
 | 
			
		||||
# -*- coding: utf-8 -*-
 | 
			
		||||
#
 | 
			
		||||
# NanoGUI documentation build configuration file, created by
 | 
			
		||||
# sphinx-quickstart on Mon Aug 22 20:05:54 2016.
 | 
			
		||||
#
 | 
			
		||||
# This file is execfile()d with the current directory set to its
 | 
			
		||||
# containing dir.
 | 
			
		||||
#
 | 
			
		||||
# Note that not all possible configuration values are present in this
 | 
			
		||||
# autogenerated file.
 | 
			
		||||
#
 | 
			
		||||
# All configuration values have a default; values that are commented out
 | 
			
		||||
# serve to show the default.
 | 
			
		||||
 | 
			
		||||
import sys
 | 
			
		||||
import os
 | 
			
		||||
import shlex
 | 
			
		||||
import textwrap
 | 
			
		||||
 | 
			
		||||
# If extensions (or modules to document with autodoc) are in another directory,
 | 
			
		||||
# add these directories to sys.path here. If the directory is relative to the
 | 
			
		||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
 | 
			
		||||
# sys.path.insert(0, os.path.abspath('.'))
 | 
			
		||||
 | 
			
		||||
# -- General configuration ------------------------------------------------
 | 
			
		||||
 | 
			
		||||
# If your documentation needs a minimal Sphinx version, state it here.
 | 
			
		||||
needs_sphinx = '1.0'
 | 
			
		||||
 | 
			
		||||
# Add any Sphinx extension module names here, as strings. They can be
 | 
			
		||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
 | 
			
		||||
# ones.
 | 
			
		||||
extensions = [
 | 
			
		||||
    'sphinx.ext.ifconfig',
 | 
			
		||||
    'breathe',
 | 
			
		||||
    'exhale'
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
# Setup the `breathe` extension
 | 
			
		||||
breathe_projects = { "NanoGUI": "./doxyoutput/xml" }
 | 
			
		||||
breathe_default_project = "NanoGUI"
 | 
			
		||||
 | 
			
		||||
# Setup the `exhale` extension
 | 
			
		||||
exhale_args = {
 | 
			
		||||
    ############################################################################
 | 
			
		||||
    # These arguments are required.                                            #
 | 
			
		||||
    ############################################################################
 | 
			
		||||
    "containmentFolder":     "./api",
 | 
			
		||||
    "rootFileName":          "library_root.rst",
 | 
			
		||||
    "rootFileTitle":         "Library API",
 | 
			
		||||
    "doxygenStripFromPath":  "../include",
 | 
			
		||||
    ############################################################################
 | 
			
		||||
    # Suggested optional arguments.                                            #
 | 
			
		||||
    ############################################################################
 | 
			
		||||
    "createTreeView":        True,
 | 
			
		||||
    "exhaleExecutesDoxygen": True,
 | 
			
		||||
    "exhaleDoxygenStdin": textwrap.dedent('''
 | 
			
		||||
        # Tell Doxygen where the source code is (yours may be different).
 | 
			
		||||
        INPUT                  = ../include
 | 
			
		||||
        # Doxygen chokes on `NAMESPACE_BEGIN`, predfine all of these
 | 
			
		||||
        PREDEFINED            += NAMESPACE_BEGIN(nanogui)="namespace nanogui {"
 | 
			
		||||
        PREDEFINED            += NAMESPACE_END(nanogui)="}"
 | 
			
		||||
        PREDEFINED            += NAMESPACE_BEGIN(detail)="namespace detail {"
 | 
			
		||||
        PREDEFINED            += NAMESPACE_END(detail)="}"
 | 
			
		||||
        PREDEFINED            += DOXYGEN_SHOULD_SKIP_THIS
 | 
			
		||||
        PREDEFINED            += DOXYGEN_DOCUMENTATION_BUILD
 | 
			
		||||
        PREDEFINED            += NANOGUI_EXPORT
 | 
			
		||||
    '''),
 | 
			
		||||
    ############################################################################
 | 
			
		||||
    # HTML Theme specific configurations.                                      #
 | 
			
		||||
    ############################################################################
 | 
			
		||||
    # Fix broken Sphinx RTD Theme 'Edit on GitHub' links
 | 
			
		||||
    # Search for 'Edit on GitHub' on the FAQ:
 | 
			
		||||
    #     http://exhale.readthedocs.io/en/latest/faq.html
 | 
			
		||||
    "pageLevelConfigMeta": ":github_url: https://github.com/wjakob/nanogui",
 | 
			
		||||
    ############################################################################
 | 
			
		||||
    # Main library page layout example configuration.                          #
 | 
			
		||||
    ############################################################################
 | 
			
		||||
    "afterTitleDescription": textwrap.dedent(u'''
 | 
			
		||||
        Welcome to the developer reference to NanoGUI.  The documentation is
 | 
			
		||||
        actively being developed / updated.  If you would like to help document
 | 
			
		||||
        any part of the project you may be familiar with, please refer to the
 | 
			
		||||
        :ref:`developer_contribution` page.
 | 
			
		||||
 | 
			
		||||
        .. note::
 | 
			
		||||
 | 
			
		||||
           Presented below is only the C++ API. If you are using the Python API,
 | 
			
		||||
           the contents below are still applicable for understanding what
 | 
			
		||||
           methods are available.  While the documentation for the C++ API is
 | 
			
		||||
           useful as a reference for understanding what a given class does, the
 | 
			
		||||
           Python API does differ.  Please refer to the more concise
 | 
			
		||||
           :ref:`nanogui_example_2` for comparing the differences between the
 | 
			
		||||
           C++ and Python interfaces.
 | 
			
		||||
    '''),
 | 
			
		||||
    ############################################################################
 | 
			
		||||
    # Individual page layout example configuration.                            #
 | 
			
		||||
    ############################################################################
 | 
			
		||||
    # Example of adding contents directives on custom kinds with custom title
 | 
			
		||||
    "contentsTitle": "Page Contents",
 | 
			
		||||
    "kindsWithContentsDirectives": ["class", "file", "namespace", "struct"],
 | 
			
		||||
    ############################################################################
 | 
			
		||||
    # useful to see ;)
 | 
			
		||||
    # "verboseBuild": True
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# Tell sphinx what the primary language being documented is.
 | 
			
		||||
primary_domain = 'cpp'
 | 
			
		||||
 | 
			
		||||
# Tell sphinx what the pygments highlight language should be.
 | 
			
		||||
highlight_language = 'cpp'
 | 
			
		||||
 | 
			
		||||
# Add any paths that contain templates here, relative to this directory.
 | 
			
		||||
# templates_path = ['_templates']
 | 
			
		||||
 | 
			
		||||
# The suffix(es) of source filenames.
 | 
			
		||||
# You can specify multiple suffix as a list of string:
 | 
			
		||||
# source_suffix = ['.rst', '.md']
 | 
			
		||||
source_suffix = '.rst'
 | 
			
		||||
 | 
			
		||||
# The encoding of source files.
 | 
			
		||||
#source_encoding = 'utf-8-sig'
 | 
			
		||||
 | 
			
		||||
# The master toctree document.
 | 
			
		||||
master_doc = 'index'
 | 
			
		||||
 | 
			
		||||
# General information about the project.
 | 
			
		||||
project = u'NanoGUI'
 | 
			
		||||
copyright = u'2017, Wenzel Jakob'
 | 
			
		||||
author = u'Wenzel Jakob'
 | 
			
		||||
 | 
			
		||||
# The version info for the project you're documenting, acts as replacement for
 | 
			
		||||
# |version| and |release|, also used in various other places throughout the
 | 
			
		||||
# built documents.
 | 
			
		||||
#
 | 
			
		||||
# The short X.Y version.
 | 
			
		||||
version = '0.1.0'
 | 
			
		||||
# The full version, including alpha/beta/rc tags.
 | 
			
		||||
release = '0.1.0'
 | 
			
		||||
 | 
			
		||||
# The language for content autogenerated by Sphinx. Refer to documentation
 | 
			
		||||
# for a list of supported languages.
 | 
			
		||||
#
 | 
			
		||||
# This is also used if you do content translation via gettext catalogs.
 | 
			
		||||
# Usually you set "language" from the command line for these cases.
 | 
			
		||||
language = None
 | 
			
		||||
 | 
			
		||||
# There are two options for replacing |today|: either, you set today to some
 | 
			
		||||
# non-false value, then it is used:
 | 
			
		||||
#today = ''
 | 
			
		||||
# Else, today_fmt is used as the format for a strftime call.
 | 
			
		||||
#today_fmt = '%B %d, %Y'
 | 
			
		||||
 | 
			
		||||
# List of patterns, relative to source directory, that match files and
 | 
			
		||||
# directories to ignore when looking for source files.
 | 
			
		||||
exclude_patterns = ['_build']
 | 
			
		||||
 | 
			
		||||
# The reST default role (used for this markup: `text`) to use for all
 | 
			
		||||
# documents.
 | 
			
		||||
#default_role = None
 | 
			
		||||
 | 
			
		||||
# If true, '()' will be appended to :func: etc. cross-reference text.
 | 
			
		||||
#add_function_parentheses = True
 | 
			
		||||
 | 
			
		||||
# If true, the current module name will be prepended to all description
 | 
			
		||||
# unit titles (such as .. function::).
 | 
			
		||||
#add_module_names = True
 | 
			
		||||
 | 
			
		||||
# If true, sectionauthor and moduleauthor directives will be shown in the
 | 
			
		||||
# output. They are ignored by default.
 | 
			
		||||
#show_authors = False
 | 
			
		||||
 | 
			
		||||
# The name of the Pygments (syntax highlighting) style to use.
 | 
			
		||||
pygments_style = 'sphinx'
 | 
			
		||||
 | 
			
		||||
# A list of ignored prefixes for module index sorting.
 | 
			
		||||
#modindex_common_prefix = []
 | 
			
		||||
 | 
			
		||||
# If true, keep warnings as "system message" paragraphs in the built documents.
 | 
			
		||||
#keep_warnings = False
 | 
			
		||||
 | 
			
		||||
# If true, `todo` and `todoList` produce output, else they produce nothing.
 | 
			
		||||
todo_include_todos = False
 | 
			
		||||
 | 
			
		||||
# -- Options for HTML output ----------------------------------------------
 | 
			
		||||
 | 
			
		||||
# The theme to use for HTML and HTML Help pages.  See the documentation for
 | 
			
		||||
# a list of builtin themes.
 | 
			
		||||
html_theme = 'sphinx_rtd_theme'
 | 
			
		||||
 | 
			
		||||
# Theme options are theme-specific and customize the look and feel of a theme
 | 
			
		||||
# further.  For a list of options available for each theme, see the
 | 
			
		||||
# documentation.
 | 
			
		||||
#html_theme_options = {}
 | 
			
		||||
 | 
			
		||||
# Add any paths that contain custom themes here, relative to this directory.
 | 
			
		||||
#html_theme_path = []
 | 
			
		||||
 | 
			
		||||
# The name for this set of Sphinx documents.  If None, it defaults to
 | 
			
		||||
# "<project> v<release> documentation".
 | 
			
		||||
#html_title = None
 | 
			
		||||
 | 
			
		||||
# A shorter title for the navigation bar.  Default is the same as html_title.
 | 
			
		||||
#html_short_title = None
 | 
			
		||||
 | 
			
		||||
# The name of an image file (relative to this directory) to place at the top
 | 
			
		||||
# of the sidebar.
 | 
			
		||||
#html_logo = None
 | 
			
		||||
 | 
			
		||||
# The name of an image file (within the static path) to use as favicon of the
 | 
			
		||||
# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
 | 
			
		||||
# pixels large.
 | 
			
		||||
html_favicon = '../resources/icons/icon6.ico'
 | 
			
		||||
 | 
			
		||||
# Add any paths that contain custom static files (such as style sheets) here,
 | 
			
		||||
# relative to this directory. They are copied after the builtin static files,
 | 
			
		||||
# so a file named "default.css" will overwrite the builtin "default.css".
 | 
			
		||||
html_static_path = ['_static']
 | 
			
		||||
 | 
			
		||||
# Add any extra paths that contain custom files (such as robots.txt or
 | 
			
		||||
# .htaccess) here, relative to this directory. These files are copied
 | 
			
		||||
# directly to the root of the documentation.
 | 
			
		||||
#html_extra_path = []
 | 
			
		||||
 | 
			
		||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
 | 
			
		||||
# using the given strftime format.
 | 
			
		||||
#html_last_updated_fmt = '%b %d, %Y'
 | 
			
		||||
 | 
			
		||||
# If true, SmartyPants will be used to convert quotes and dashes to
 | 
			
		||||
# typographically correct entities.
 | 
			
		||||
#html_use_smartypants = True
 | 
			
		||||
 | 
			
		||||
# Custom sidebar templates, maps document names to template names.
 | 
			
		||||
#html_sidebars = {}
 | 
			
		||||
 | 
			
		||||
# Additional templates that should be rendered to pages, maps page names to
 | 
			
		||||
# template names.
 | 
			
		||||
#html_additional_pages = {}
 | 
			
		||||
 | 
			
		||||
# If false, no module index is generated.
 | 
			
		||||
#html_domain_indices = True
 | 
			
		||||
 | 
			
		||||
# If false, no index is generated.
 | 
			
		||||
#html_use_index = True
 | 
			
		||||
 | 
			
		||||
# If true, the index is split into individual pages for each letter.
 | 
			
		||||
#html_split_index = False
 | 
			
		||||
 | 
			
		||||
# If true, links to the reST sources are added to the pages.
 | 
			
		||||
#html_show_sourcelink = True
 | 
			
		||||
 | 
			
		||||
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
 | 
			
		||||
#html_show_sphinx = True
 | 
			
		||||
 | 
			
		||||
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
 | 
			
		||||
#html_show_copyright = True
 | 
			
		||||
 | 
			
		||||
# If true, an OpenSearch description file will be output, and all pages will
 | 
			
		||||
# contain a <link> tag referring to it.  The value of this option must be the
 | 
			
		||||
# base URL from which the finished HTML is served.
 | 
			
		||||
#html_use_opensearch = ''
 | 
			
		||||
 | 
			
		||||
# This is the file name suffix for HTML files (e.g. ".xhtml").
 | 
			
		||||
#html_file_suffix = None
 | 
			
		||||
 | 
			
		||||
# Language to be used for generating the HTML full-text search index.
 | 
			
		||||
# Sphinx supports the following languages:
 | 
			
		||||
#   'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
 | 
			
		||||
#   'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr'
 | 
			
		||||
#html_search_language = 'en'
 | 
			
		||||
 | 
			
		||||
# A dictionary with options for the search language support, empty by default.
 | 
			
		||||
# Now only 'ja' uses this config value
 | 
			
		||||
#html_search_options = {'type': 'default'}
 | 
			
		||||
 | 
			
		||||
# The name of a javascript file (relative to the configuration directory) that
 | 
			
		||||
# implements a search results scorer. If empty, the default will be used.
 | 
			
		||||
#html_search_scorer = 'scorer.js'
 | 
			
		||||
 | 
			
		||||
# Output file base name for HTML help builder.
 | 
			
		||||
htmlhelp_basename = 'NanoGUIdoc'
 | 
			
		||||
 | 
			
		||||
# -- Options for LaTeX output ---------------------------------------------
 | 
			
		||||
 | 
			
		||||
latex_elements = {
 | 
			
		||||
# The paper size ('letterpaper' or 'a4paper').
 | 
			
		||||
#'papersize': 'letterpaper',
 | 
			
		||||
 | 
			
		||||
# The font size ('10pt', '11pt' or '12pt').
 | 
			
		||||
#'pointsize': '10pt',
 | 
			
		||||
 | 
			
		||||
# Additional stuff for the LaTeX preamble.
 | 
			
		||||
#'preamble': '',
 | 
			
		||||
 | 
			
		||||
# Latex figure (float) alignment
 | 
			
		||||
#'figure_align': 'htbp',
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# Grouping the document tree into LaTeX files. List of tuples
 | 
			
		||||
# (source start file, target name, title,
 | 
			
		||||
#  author, documentclass [howto, manual, or own class]).
 | 
			
		||||
latex_documents = [
 | 
			
		||||
  (master_doc, 'NanoGUI.tex', u'NanoGUI Documentation',
 | 
			
		||||
   u'Wenzel Jakob', 'manual'),
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
# The name of an image file (relative to this directory) to place at the top of
 | 
			
		||||
# the title page.
 | 
			
		||||
#latex_logo = None
 | 
			
		||||
 | 
			
		||||
# For "manual" documents, if this is true, then toplevel headings are parts,
 | 
			
		||||
# not chapters.
 | 
			
		||||
#latex_use_parts = False
 | 
			
		||||
 | 
			
		||||
# If true, show page references after internal links.
 | 
			
		||||
#latex_show_pagerefs = False
 | 
			
		||||
 | 
			
		||||
# If true, show URL addresses after external links.
 | 
			
		||||
#latex_show_urls = False
 | 
			
		||||
 | 
			
		||||
# Documents to append as an appendix to all manuals.
 | 
			
		||||
#latex_appendices = []
 | 
			
		||||
 | 
			
		||||
# If false, no module index is generated.
 | 
			
		||||
#latex_domain_indices = True
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# -- Options for manual page output ---------------------------------------
 | 
			
		||||
 | 
			
		||||
# One entry per manual page. List of tuples
 | 
			
		||||
# (source start file, name, description, authors, manual section).
 | 
			
		||||
man_pages = [
 | 
			
		||||
    (master_doc, 'nanogui', u'NanoGUI Documentation',
 | 
			
		||||
     [author], 1)
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
# If true, show URL addresses after external links.
 | 
			
		||||
#man_show_urls = False
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# -- Options for Texinfo output -------------------------------------------
 | 
			
		||||
 | 
			
		||||
# Grouping the document tree into Texinfo files. List of tuples
 | 
			
		||||
# (source start file, target name, title, author,
 | 
			
		||||
#  dir menu entry, description, category)
 | 
			
		||||
texinfo_documents = [
 | 
			
		||||
  (master_doc, 'NanoGUI', u'NanoGUI Documentation',
 | 
			
		||||
   author, 'NanoGUI', 'One line description of project.',
 | 
			
		||||
   'Miscellaneous'),
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
# Documents to append as an appendix to all manuals.
 | 
			
		||||
#texinfo_appendices = []
 | 
			
		||||
 | 
			
		||||
# If false, no module index is generated.
 | 
			
		||||
#texinfo_domain_indices = True
 | 
			
		||||
 | 
			
		||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
 | 
			
		||||
#texinfo_show_urls = 'footnote'
 | 
			
		||||
 | 
			
		||||
# If true, do not generate a @detailmenu in the "Top" node's menu.
 | 
			
		||||
#texinfo_no_detailmenu = False
 | 
			
		||||
import datetime
 | 
			
		||||
rst_epilog = textwrap.dedent('''
 | 
			
		||||
    .. |year| replace:: {year}
 | 
			
		||||
'''.format(
 | 
			
		||||
    year=datetime.datetime.now().year
 | 
			
		||||
))
 | 
			
		||||
 | 
			
		||||
# auto-magically called by sphinx-build
 | 
			
		||||
def setup(app):
 | 
			
		||||
    # this looks in html_static_path (_static directory as set above)
 | 
			
		||||
    app.add_stylesheet("entypo.css")
 | 
			
		||||
							
								
								
									
										346
									
								
								cs440-acg/ext/nanogui/docs/contributing.rst
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										346
									
								
								cs440-acg/ext/nanogui/docs/contributing.rst
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,346 @@
 | 
			
		||||
.. _developer_contribution:
 | 
			
		||||
 | 
			
		||||
Contributing
 | 
			
		||||
========================================================================================
 | 
			
		||||
 | 
			
		||||
Thank you for your interest in this project! Please refer to the following sections on
 | 
			
		||||
how to contribute code and bug reports.
 | 
			
		||||
 | 
			
		||||
Reporting bugs
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
At the moment, this project is run in the spare time of a single person
 | 
			
		||||
(`Wenzel Jakob <http://rgl.epfl.ch/people/wjakob>`_) with very limited resources for
 | 
			
		||||
issue tracker tickets. Thus, before submitting a question or bug report, please take a
 | 
			
		||||
moment of your time and ensure that your issue isn't already discussed in the project
 | 
			
		||||
documentation elsewhere on this site.
 | 
			
		||||
 | 
			
		||||
Feature requests are generally closed unless they come with a pull request
 | 
			
		||||
that implements the desired functionality.
 | 
			
		||||
 | 
			
		||||
Assuming that you have identified a previously unknown problem or an important question,
 | 
			
		||||
it's essential that you submit a self-contained and minimal piece of code that
 | 
			
		||||
reproduces the problem. In other words: no external dependencies, isolate the
 | 
			
		||||
function(s) that cause breakage, submit matched and complete C++ or Python snippets
 | 
			
		||||
(depending on how you are using NanoGUI) that can be easily compiled and run on my end.
 | 
			
		||||
 | 
			
		||||
Pull requests
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
Contributions are submitted, reviewed, and accepted using Github pull requests. Please
 | 
			
		||||
refer to `this article <https://help.github.com/articles/using-pull-requests>`_ for
 | 
			
		||||
details and adhere to the following rules to make the process as smooth as possible:
 | 
			
		||||
 | 
			
		||||
- Make a new branch for every feature you're working on.
 | 
			
		||||
- Make small and clean pull requests that are easy to review but make sure they do add
 | 
			
		||||
  value by themselves.
 | 
			
		||||
- Make sure you have tested any new functionality (e.g. if you made a new Widget).
 | 
			
		||||
- This project has a strong focus on providing general solutions using a minimal amount
 | 
			
		||||
  of code, thus small pull requests are greatly preferred.
 | 
			
		||||
- Read the remainder of this document, adhering to the bindings and documentation
 | 
			
		||||
  requirements.
 | 
			
		||||
- If making a purely documentation PR, please prefix the commit with ``[docs]``
 | 
			
		||||
 | 
			
		||||
  - E.g. ``[docs] Adding documentation for class X.``
 | 
			
		||||
 | 
			
		||||
Python Binding Requirements
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
Since NanoGUI builds for both C++, as well as produces Python bindings, you **must**
 | 
			
		||||
account for both sides of the API regardless of how you use the project.  If you are
 | 
			
		||||
adding a new method, class, etc (not fixing an existing one), you must write the code
 | 
			
		||||
to produce the relevant binding in ``python/python.cpp``.
 | 
			
		||||
 | 
			
		||||
Code Style Requirements
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
- Tabs are 4 spaces -- please do not submit PRs with *tab* characters.
 | 
			
		||||
- Most code follows an 80 column ruler, wherever reasonable.
 | 
			
		||||
- Pointers and references have modifiers next to variable name, not the type:
 | 
			
		||||
 | 
			
		||||
  - **Yes**: ``void *p``, **No**: ``void* p``
 | 
			
		||||
  - **Yes**: ``Color &c``, **No**: ``Color& c``
 | 
			
		||||
 | 
			
		||||
- Template classes / functions: ``template <typename T> method()``
 | 
			
		||||
 | 
			
		||||
  - Space between template and ``<``, on same line where reasonable
 | 
			
		||||
 | 
			
		||||
- Opening curly braces for definitions / loops / ifs are on the same line as the statement
 | 
			
		||||
 | 
			
		||||
  - **Yes**:
 | 
			
		||||
 | 
			
		||||
    .. code-block:: cpp
 | 
			
		||||
 | 
			
		||||
       for (auto &&c : myVec) {
 | 
			
		||||
           // ... computation ...
 | 
			
		||||
       }
 | 
			
		||||
  - **No**:
 | 
			
		||||
 | 
			
		||||
    .. code-block:: cpp
 | 
			
		||||
 | 
			
		||||
       for(auto &&c : myVec)
 | 
			
		||||
       {
 | 
			
		||||
           // ... computation ...
 | 
			
		||||
       }
 | 
			
		||||
 | 
			
		||||
Code Documentation Requirements
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
When adding new classes, methods, etc please provide meaningful and well formatted
 | 
			
		||||
documentation of the new functionality.  We use Doxygen comments to document the code,
 | 
			
		||||
using the "JavaDoc" style.  For consistency, please do not use the QT or other formats.
 | 
			
		||||
 | 
			
		||||
If you are familiar with how to use Doxygen-style comments:
 | 
			
		||||
 | 
			
		||||
- You should indent by four spaces for things like ``param``, etc.
 | 
			
		||||
- ``\brief``: a brief description.
 | 
			
		||||
- ``\tparam``: a template parameter.
 | 
			
		||||
- ``\param``: a parameter.
 | 
			
		||||
- ``\return``: what the return value represents (where applicable).
 | 
			
		||||
 | 
			
		||||
For a quick crash-course on documenting using Doxygen:
 | 
			
		||||
 | 
			
		||||
1. If you are adding a new file, please include the disclaimer at the top **immediately**
 | 
			
		||||
   followed by ``/** \file */``.  So if you are creating the file ``nanogui/file.h``
 | 
			
		||||
 | 
			
		||||
   .. code-block:: cpp
 | 
			
		||||
 | 
			
		||||
      /*
 | 
			
		||||
       nanogui/file.h -- A brief description of what the file contains.
 | 
			
		||||
 | 
			
		||||
       NanoGUI was developed by Wenzel Jakob <wenzel.jakob@epfl.ch>.
 | 
			
		||||
       The widget drawing code is based on the NanoVG demo application
 | 
			
		||||
       by Mikko Mononen.
 | 
			
		||||
 | 
			
		||||
       All rights reserved. Use of this source code is governed by a
 | 
			
		||||
       BSD-style license that can be found in the LICENSE.txt file.
 | 
			
		||||
      */
 | 
			
		||||
      /** \file */
 | 
			
		||||
 | 
			
		||||
   changing the first line to the right name / description of your file.
 | 
			
		||||
 | 
			
		||||
2. Documenting a newly added Struct or Class requires special attention.  If you are
 | 
			
		||||
   adding a class ``Thing`` in file ``nanogui/thing.h``, the class level documentation
 | 
			
		||||
   needs to explicitly declare the location for Doxygen to parse everything correctly.
 | 
			
		||||
 | 
			
		||||
   .. code-block:: cpp
 | 
			
		||||
 | 
			
		||||
      /**
 | 
			
		||||
       * \class Thing thing.h nanogui/thing.h
 | 
			
		||||
       *
 | 
			
		||||
       * This is the actual documentation for the thing.
 | 
			
		||||
       */
 | 
			
		||||
      class Thing { ... };
 | 
			
		||||
 | 
			
		||||
   This simply tells Doxygen how to format the various ``include`` directives.  If you
 | 
			
		||||
   are writing a Struct, replace ``\class`` with ``\struct``.
 | 
			
		||||
 | 
			
		||||
3. Please fully document all parameters, template parameters, and return types where
 | 
			
		||||
   applicable.  In some cases it is sufficient to include just a brief one-line
 | 
			
		||||
   documentation string, e.g. the for the :func:`nanogui::Screen::caption` method, it
 | 
			
		||||
   is simple enough that the following is sufficient (note the **three** ``///``):
 | 
			
		||||
 | 
			
		||||
   .. code-block:: cpp
 | 
			
		||||
 | 
			
		||||
      /// Get the window title bar caption
 | 
			
		||||
      const std::string &caption() const { return mCaption; }
 | 
			
		||||
 | 
			
		||||
   However, more complicated methods should be thoroughly documented.  As an example,
 | 
			
		||||
   this method demonstrates template parameters, parameters, and return value documentation:
 | 
			
		||||
 | 
			
		||||
   .. code-block:: cpp
 | 
			
		||||
 | 
			
		||||
      /**
 | 
			
		||||
       * \brief A useless function for getting sizes.
 | 
			
		||||
       *
 | 
			
		||||
       * This method has specific things that must be pointed out, but they
 | 
			
		||||
       * were too long to include in the 'brief' documentation.
 | 
			
		||||
       *
 | 
			
		||||
       * \tparam T
 | 
			
		||||
       *     The type we are evaluating the size of.
 | 
			
		||||
       *
 | 
			
		||||
       * \param returnFake
 | 
			
		||||
       *     If set to true, a random positive number will be returned. This
 | 
			
		||||
       *     comment is a bit longer and can span multiple lines, making sure
 | 
			
		||||
       *     to indent each new line.
 | 
			
		||||
       *
 | 
			
		||||
       *     Warning: this had an empty line before it and will NOT appear in
 | 
			
		||||
       *     the documentation of this parameter, but instead it will appear
 | 
			
		||||
       *     in the documentation of the method!
 | 
			
		||||
       *
 | 
			
		||||
       * \return
 | 
			
		||||
       *     The result of ``sizeof(T)``.
 | 
			
		||||
       */
 | 
			
		||||
      template <typename T>
 | 
			
		||||
      size_t exampleTemplateFunction(bool returnFake = false) { ... }
 | 
			
		||||
 | 
			
		||||
Styling the Code
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
Since we are using both Doxygen and Sphinx, we have access to a wealth of interesting
 | 
			
		||||
documentation styling.
 | 
			
		||||
 | 
			
		||||
:From Doxygen:
 | 
			
		||||
    You can use things like ``\throws``, ``\remark``, and even ``\ref`` to generate html
 | 
			
		||||
    links to other items.
 | 
			
		||||
 | 
			
		||||
:From Sphinx:
 | 
			
		||||
    On the Sphinx side, you now have access to full reStructuredText syntax.  This
 | 
			
		||||
    includes:
 | 
			
		||||
 | 
			
		||||
    - ``**bold**`` to make **bold** text
 | 
			
		||||
    - ``*italics*`` for *italics*
 | 
			
		||||
    - ````teletype```` for ``teletype`` text.
 | 
			
		||||
 | 
			
		||||
    You can additionally include more complex reStructuredText such as grid tables, as
 | 
			
		||||
    well as Sphinx directives.  You will need to use the ``\rst`` and ``\endrst``
 | 
			
		||||
    commands for these:
 | 
			
		||||
 | 
			
		||||
    .. code-block:: cpp
 | 
			
		||||
 | 
			
		||||
       /**
 | 
			
		||||
        * \brief Some method you are documenting.
 | 
			
		||||
        *
 | 
			
		||||
        * \rst
 | 
			
		||||
        * I am now in a verbatim reStructuredText environment, and can create a grid table.
 | 
			
		||||
        *
 | 
			
		||||
        * I could create a python code listing using
 | 
			
		||||
        *
 | 
			
		||||
        * .. code-block:: py
 | 
			
		||||
        *
 | 
			
		||||
        *    print("Some python code.")
 | 
			
		||||
        *
 | 
			
		||||
        * You can also use the note or warning directives to highlight important concepts:
 | 
			
		||||
        *
 | 
			
		||||
        * .. note::
 | 
			
		||||
        *    You may or may not segfault.
 | 
			
		||||
        *
 | 
			
		||||
        * .. warning::
 | 
			
		||||
        *    I guarantee you will segfault.
 | 
			
		||||
        * \endrst
 | 
			
		||||
        */
 | 
			
		||||
 | 
			
		||||
    .. warning::
 | 
			
		||||
       In normal reStructuredText, if you simply indent a block of code by four spaces
 | 
			
		||||
       it will render as a code listing.  While this will build as expected for the
 | 
			
		||||
       C++ documentation on RTD, it will **fail** to build ``py_doc.h`` correctly.
 | 
			
		||||
 | 
			
		||||
       For code listings, **always** begin an ``\rst`` section and use ``.. code-block``
 | 
			
		||||
       as shown above.
 | 
			
		||||
 | 
			
		||||
TODO
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
Documentation Completion
 | 
			
		||||
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 | 
			
		||||
 | 
			
		||||
Already familiar with NanoGUI or a subset of its classes?  The documentation for the
 | 
			
		||||
following files is incomplete, waiting for your PR.  Document a whole class, or even
 | 
			
		||||
just a method of a given class.
 | 
			
		||||
 | 
			
		||||
If you make progress on / complete an item with your PR, please update / remove it from
 | 
			
		||||
the table on this page (``docs/contributing.rst``).
 | 
			
		||||
 | 
			
		||||
.. note::
 | 
			
		||||
   The NanoGUI documentation hosted online does not include ``private`` methods or
 | 
			
		||||
   member variables at this time.  However, documentation for these is welcome!
 | 
			
		||||
 | 
			
		||||
.. warning::
 | 
			
		||||
   In some of these files, you will see preprocessor blocks like
 | 
			
		||||
 | 
			
		||||
   .. code-block:: cpp
 | 
			
		||||
 | 
			
		||||
      #ifndef DOXYGEN_SHOULD_SKIP_THIS
 | 
			
		||||
      ... code that the breaks the documentation ...
 | 
			
		||||
      #endif // DOXYGEN_SHOULD_SKIP_THIS
 | 
			
		||||
 | 
			
		||||
   Please take care not to remove these!
 | 
			
		||||
 | 
			
		||||
+-----------------+------------------------------------------------------------+
 | 
			
		||||
| Filename        | Action Item                                                |
 | 
			
		||||
+=================+============================================================+
 | 
			
		||||
| button.h        | - Most member methods.                                     |
 | 
			
		||||
|                 | - All member variables.                                    |
 | 
			
		||||
+-----------------+------------------------------------------------------------+
 | 
			
		||||
| checkbox.h      | - All member methods and variables.                        |
 | 
			
		||||
+-----------------+------------------------------------------------------------+
 | 
			
		||||
| colorpicker.h   | - Constructor and callback.                                |
 | 
			
		||||
|                 | - All member variables.                                    |
 | 
			
		||||
+-----------------+------------------------------------------------------------+
 | 
			
		||||
| colorwheel.h    | - Most methods and member variables.                       |
 | 
			
		||||
+-----------------+------------------------------------------------------------+
 | 
			
		||||
| combobox.h      | - Most member methods and variables.                       |
 | 
			
		||||
+-----------------+------------------------------------------------------------+
 | 
			
		||||
| formhelper.h    | - More detailed documentation explaining parameters        |
 | 
			
		||||
|                 |   for ``FormHelper`` methods.                              |
 | 
			
		||||
|                 | - Most member variables.                                   |
 | 
			
		||||
+-----------------+------------------------------------------------------------+
 | 
			
		||||
| graph.h         | - All member methods and variables.                        |
 | 
			
		||||
+-----------------+------------------------------------------------------------+
 | 
			
		||||
| imagepanel.h    | - All member methods and variables.                        |
 | 
			
		||||
+-----------------+------------------------------------------------------------+
 | 
			
		||||
| imageview.h     | - Most member methods.                                     |
 | 
			
		||||
+-----------------+------------------------------------------------------------+
 | 
			
		||||
| label.h         | - Some member methods and variables.                       |
 | 
			
		||||
+-----------------+------------------------------------------------------------+
 | 
			
		||||
| layout.h        | - Nearly everything.                                       |
 | 
			
		||||
+-----------------+------------------------------------------------------------+
 | 
			
		||||
| popup.h         | - Some member methods and variables.                       |
 | 
			
		||||
|                 | - Explicit parameter documentation would be very useful.   |
 | 
			
		||||
+-----------------+------------------------------------------------------------+
 | 
			
		||||
| popupbutton.h   | - Almost everything.                                       |
 | 
			
		||||
+-----------------+------------------------------------------------------------+
 | 
			
		||||
| progressbar.h   | - Almost everything.                                       |
 | 
			
		||||
+-----------------+------------------------------------------------------------+
 | 
			
		||||
| screen.h        | - Documentation for the manual GLFW API.                   |
 | 
			
		||||
|                 | - All member variables.                                    |
 | 
			
		||||
+-----------------+------------------------------------------------------------+
 | 
			
		||||
| slider.h        | - Almost everything.                                       |
 | 
			
		||||
+-----------------+------------------------------------------------------------+
 | 
			
		||||
| stackedwidget.h | - Almost everything.                                       |
 | 
			
		||||
+-----------------+------------------------------------------------------------+
 | 
			
		||||
| tabheader.h     | - Some member methods.                                     |
 | 
			
		||||
|                 | - Some reformatting of existing documentation to           |
 | 
			
		||||
|                 |   use ``\param`` or ``\return`` etc.                       |
 | 
			
		||||
+-----------------+------------------------------------------------------------+
 | 
			
		||||
| tabwidget.h     | - Some member methods.                                     |
 | 
			
		||||
|                 | - Some reformatting of existing documentation to           |
 | 
			
		||||
|                 |   use ``\param`` or ``\return`` etc.                       |
 | 
			
		||||
+-----------------+------------------------------------------------------------+
 | 
			
		||||
| textbox.h       | - Almost everything.                                       |
 | 
			
		||||
+-----------------+------------------------------------------------------------+
 | 
			
		||||
| theme.h         | - Explicit documentation for what these all represent.     |
 | 
			
		||||
+-----------------+------------------------------------------------------------+
 | 
			
		||||
| toolbutton.h    | - Documentation of the constructor explaining the range of |
 | 
			
		||||
|                 |   values that can be used for ``icon``.  Or at least where |
 | 
			
		||||
|                 |   to look for that?                                        |
 | 
			
		||||
+-----------------+------------------------------------------------------------+
 | 
			
		||||
| vscrollpanel.h  | - Almost everything.                                       |
 | 
			
		||||
+-----------------+------------------------------------------------------------+
 | 
			
		||||
| widget.h        | - Member variables.                                        |
 | 
			
		||||
+-----------------+------------------------------------------------------------+
 | 
			
		||||
| window.h        | - Some member methods.                                     |
 | 
			
		||||
|                 | - All member variables.                                    |
 | 
			
		||||
+-----------------+------------------------------------------------------------+
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Advanced Contribution Opportunity
 | 
			
		||||
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 | 
			
		||||
 | 
			
		||||
Currently, all partial and full template specializations are skipped.  Specifically,
 | 
			
		||||
nearly everything in ``include/nanogui/serializer/*``.  According to the
 | 
			
		||||
`Breathe documentation <https://breathe.readthedocs.io/en/latest/doxygen.html#template>`_
 | 
			
		||||
this should be possible.  The likely cause of this issue is that the version of Breathe
 | 
			
		||||
packaged for use with ``pip`` is not up to date.  Your task would be to find a way
 | 
			
		||||
to use ``docs/requirements.txt`` to install the **current source** from the master
 | 
			
		||||
branch of Breathe instead of using PyPi.
 | 
			
		||||
 | 
			
		||||
You can test locally by making sure you do not have Breathe installed with ``pip``, and
 | 
			
		||||
compiling it yourself (make sure you add it to your ``PATH`` so you can use it in
 | 
			
		||||
Python).
 | 
			
		||||
 | 
			
		||||
Then try moving the ``#ifndef DOXYGEN_SHOULD_SKIP_THIS`` to expose a single template
 | 
			
		||||
specialization in a file of your choice, and try and get the documentation to build.
 | 
			
		||||
If you succeed with this, the next step will be to find a way to get Read the Docs to
 | 
			
		||||
build the current source of Breathe rather than using PyPi.
 | 
			
		||||
 | 
			
		||||
In theory, all of these are possible.
 | 
			
		||||
							
								
								
									
										88
									
								
								cs440-acg/ext/nanogui/docs/examples.rst
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										88
									
								
								cs440-acg/ext/nanogui/docs/examples.rst
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,88 @@
 | 
			
		||||
.. _nanogui_example_programs:
 | 
			
		||||
 | 
			
		||||
Examples
 | 
			
		||||
========================================================================================
 | 
			
		||||
 | 
			
		||||
There are example programs available for you to play with / understand how the different
 | 
			
		||||
pieces fit together.  The C++ examples are in ``nanogui/src/``, and the equivalent
 | 
			
		||||
Python examples are in ``nanogui/python``.
 | 
			
		||||
 | 
			
		||||
.. _nanogui_example_1:
 | 
			
		||||
 | 
			
		||||
Example 1
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
.. image:: ../resources/screenshot.png
 | 
			
		||||
   :alt: Screenshot of Example 1.
 | 
			
		||||
   :align: center
 | 
			
		||||
 | 
			
		||||
The first example program is rather long, but not altogether complicated.  It
 | 
			
		||||
is effectively an enumeration of how one would go about adding various different kinds
 | 
			
		||||
of Widgets to the window being displayed.
 | 
			
		||||
 | 
			
		||||
- `Example 1 in C++ <https://github.com/wjakob/nanogui/blob/master/src/example1.cpp>`_
 | 
			
		||||
- `Example 1 in Python <https://github.com/wjakob/nanogui/blob/master/python/example1.py>`_
 | 
			
		||||
 | 
			
		||||
.. _nanogui_example_2:
 | 
			
		||||
 | 
			
		||||
Example 2
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
.. image:: ../resources/screenshot2.png
 | 
			
		||||
   :alt: Screenshot of Example 2.
 | 
			
		||||
   :align: center
 | 
			
		||||
 | 
			
		||||
The second program demonstrates how simple label/editor widget-type layouts can
 | 
			
		||||
be written in a very concise manner.
 | 
			
		||||
 | 
			
		||||
- `Example 2 in C++ <https://github.com/wjakob/nanogui/blob/master/src/example2.cpp>`_
 | 
			
		||||
- `Example 2 in Python <https://github.com/wjakob/nanogui/blob/master/python/example2.py>`_
 | 
			
		||||
 | 
			
		||||
.. _nanogui_example_3:
 | 
			
		||||
 | 
			
		||||
Example 3
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
The third example program demonstrates how to manage OpenGL / GLFW on your own for the
 | 
			
		||||
C++ side, and how to detach the NanoGUI ``mainloop()`` on the Python side.
 | 
			
		||||
 | 
			
		||||
- `Example 3 in C++ <https://github.com/wjakob/nanogui/blob/master/src/example3.cpp>`_
 | 
			
		||||
- `Example 3 in Python <https://github.com/wjakob/nanogui/blob/master/python/example3.py>`_
 | 
			
		||||
 | 
			
		||||
.. _nanogui_example_4:
 | 
			
		||||
 | 
			
		||||
Example 4
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
The fourth example program demonstrates the GLCanvas widget, which renders an
 | 
			
		||||
arbitrary sequence of OpenGL commands into a NanoGUI widget.
 | 
			
		||||
 | 
			
		||||
- `Example 4 in C++ <https://github.com/wjakob/nanogui/blob/master/src/example4.cpp>`_
 | 
			
		||||
- `Example 4 in Python <https://github.com/wjakob/nanogui/blob/master/python/example4.py>`_
 | 
			
		||||
 | 
			
		||||
.. _nanogui_example_icons:
 | 
			
		||||
 | 
			
		||||
Example Icons
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
NanoGUI includes various icons made available from :ref:`file_nanogui_entypo.h`,
 | 
			
		||||
courtesy of `Daniel Bruce's Entypo <http://www.entypo.com/>`_ glyphs.  The file level
 | 
			
		||||
documentation is useful as a reference for selecting an icon, but the web rendering may
 | 
			
		||||
be misleading --- NanoGUI uses a dark background for widgets by default.
 | 
			
		||||
 | 
			
		||||
Run the ``exampleIcon`` executable to see what the icons look like in NanoGUI.  The
 | 
			
		||||
setup of this file may also be helpful in understanding how to control the
 | 
			
		||||
:class:`nanogui::VScrollPanel`.
 | 
			
		||||
 | 
			
		||||
- `Example Icons in C++ <https://github.com/wjakob/nanogui/blob/master/src/example_icons.cpp>`_
 | 
			
		||||
- `Example Icons in Python <https://github.com/wjakob/nanogui/blob/master/python/example_icons.py>`_
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
.. _nanogui_example_repository:
 | 
			
		||||
 | 
			
		||||
Example Repository
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
Darren Mothersele has put together a compact and informative example repository that
 | 
			
		||||
demonstrates how easy it is to include NanoGUI into your project.  You download / browse
 | 
			
		||||
the source on `GitHub <https://github.com/darrenmothersele/nanogui-test.git>`_.
 | 
			
		||||
							
								
								
									
										63
									
								
								cs440-acg/ext/nanogui/docs/index.rst
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								cs440-acg/ext/nanogui/docs/index.rst
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,63 @@
 | 
			
		||||
NanoGUI
 | 
			
		||||
========================================================================================
 | 
			
		||||
 | 
			
		||||
.. include:: ../README.rst
 | 
			
		||||
   :start-after: begin_brief_description
 | 
			
		||||
   :end-before:  end_brief_description
 | 
			
		||||
 | 
			
		||||
Example Screenshot
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
.. image:: ../resources/screenshot.png
 | 
			
		||||
   :alt: Screenshot of Example 1.
 | 
			
		||||
   :align: center
 | 
			
		||||
 | 
			
		||||
Description
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
.. include:: ../README.rst
 | 
			
		||||
   :start-after: begin_long_description
 | 
			
		||||
   :end-before:  end_long_description
 | 
			
		||||
 | 
			
		||||
"Simple mode"
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
Christian Schüller contributed a convenience class that makes it possible to create
 | 
			
		||||
AntTweakBar-style variable manipulators using just a few lines of code. Refer to
 | 
			
		||||
:ref:`nanogui_example_2` for how to create the image below.
 | 
			
		||||
 | 
			
		||||
.. image:: ../resources/screenshot2.png
 | 
			
		||||
   :alt: Screenshot of Example 2.
 | 
			
		||||
   :align: center
 | 
			
		||||
 | 
			
		||||
License
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
.. include:: ../README.rst
 | 
			
		||||
   :start-after: begin_license
 | 
			
		||||
   :end-before:  end_license
 | 
			
		||||
 | 
			
		||||
.. note::
 | 
			
		||||
 | 
			
		||||
   The CC BY-SA 4.0 license should not be an issue for most projects.  However, you can
 | 
			
		||||
   adopt a different font for icons if you need.  See :ref:`nanogui_including_custom_fonts`.
 | 
			
		||||
 | 
			
		||||
Contents
 | 
			
		||||
========================================================================================
 | 
			
		||||
 | 
			
		||||
.. toctree::
 | 
			
		||||
   :maxdepth: 2
 | 
			
		||||
 | 
			
		||||
   usage
 | 
			
		||||
   compilation
 | 
			
		||||
   examples
 | 
			
		||||
   api/library_root
 | 
			
		||||
   contributing
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Indices and tables
 | 
			
		||||
==================
 | 
			
		||||
 | 
			
		||||
* :ref:`genindex`
 | 
			
		||||
* :ref:`modindex`
 | 
			
		||||
* :ref:`search`
 | 
			
		||||
							
								
								
									
										36
									
								
								cs440-acg/ext/nanogui/docs/make.bat
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								cs440-acg/ext/nanogui/docs/make.bat
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,36 @@
 | 
			
		||||
@ECHO OFF
 | 
			
		||||
 | 
			
		||||
pushd %~dp0
 | 
			
		||||
 | 
			
		||||
REM Command file for Sphinx documentation
 | 
			
		||||
 | 
			
		||||
if "%SPHINXBUILD%" == "" (
 | 
			
		||||
	set SPHINXBUILD=python -msphinx
 | 
			
		||||
)
 | 
			
		||||
set SOURCEDIR=.
 | 
			
		||||
set BUILDDIR=_build
 | 
			
		||||
set SPHINXPROJ=NanoGUI
 | 
			
		||||
 | 
			
		||||
if "%1" == "" goto help
 | 
			
		||||
 | 
			
		||||
%SPHINXBUILD% >NUL 2>NUL
 | 
			
		||||
if errorlevel 9009 (
 | 
			
		||||
	echo.
 | 
			
		||||
	echo.The Sphinx module was not found. Make sure you have Sphinx installed,
 | 
			
		||||
	echo.then set the SPHINXBUILD environment variable to point to the full
 | 
			
		||||
	echo.path of the 'sphinx-build' executable. Alternatively you may add the
 | 
			
		||||
	echo.Sphinx directory to PATH.
 | 
			
		||||
	echo.
 | 
			
		||||
	echo.If you don't have Sphinx installed, grab it from
 | 
			
		||||
	echo.http://sphinx-doc.org/
 | 
			
		||||
	exit /b 1
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
 | 
			
		||||
goto end
 | 
			
		||||
 | 
			
		||||
:help
 | 
			
		||||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
 | 
			
		||||
 | 
			
		||||
:end
 | 
			
		||||
popd
 | 
			
		||||
							
								
								
									
										4
									
								
								cs440-acg/ext/nanogui/docs/requirements.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								cs440-acg/ext/nanogui/docs/requirements.txt
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
			
		||||
# Breathe and Sphinx 2.x are incompatible at this time
 | 
			
		||||
Sphinx==1.8.5
 | 
			
		||||
exhale
 | 
			
		||||
sphinx_rtd_theme
 | 
			
		||||
							
								
								
									
										49
									
								
								cs440-acg/ext/nanogui/docs/usage.rst
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								cs440-acg/ext/nanogui/docs/usage.rst
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,49 @@
 | 
			
		||||
Usage
 | 
			
		||||
========================================================================================
 | 
			
		||||
 | 
			
		||||
C++
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
There are effectively two ways that you can use NanoGUI in C++: have NanoGUI initialize
 | 
			
		||||
and manage the OpenGL context (and GLFW), or you do it manually.
 | 
			
		||||
 | 
			
		||||
1. If you are letting NanoGUI take over, you **must** call :ref:`function_nanogui__init`
 | 
			
		||||
   before trying to do anything else.  If you are managing OpenGL / GLFW yourself, make
 | 
			
		||||
   sure you **avoid** calling this method.
 | 
			
		||||
 | 
			
		||||
2. Create an instance of :ref:`class_nanogui__Screen` (or a derivative class you have
 | 
			
		||||
   written).
 | 
			
		||||
 | 
			
		||||
   - NanoGUI managed OpenGL: call the explicit constructor.
 | 
			
		||||
   - Self managed OpenGL: call the empty constructor.
 | 
			
		||||
       - You must call the :func:`nanogui::Screen::initialize` method.
 | 
			
		||||
 | 
			
		||||
3. Add any Widgets, Buttons, etc. you want to the screen instance, and call the
 | 
			
		||||
   :func:`nanogui::Screen::setVisible` and :func:`nanogui::Screen::performLayout`
 | 
			
		||||
   methods of your instance.
 | 
			
		||||
 | 
			
		||||
4. Now that everything is ready, call :ref:`function_nanogui__mainloop`.
 | 
			
		||||
 | 
			
		||||
5. When all windows are closed, this function will exit, and you should follow it up
 | 
			
		||||
   with a call to :ref:`function_nanogui__shutdown`.
 | 
			
		||||
 | 
			
		||||
:NanoGUI Managed OpenGL / GLFW:
 | 
			
		||||
    Refer to :ref:`nanogui_example_2` for a concise example of what that all looks like.
 | 
			
		||||
 | 
			
		||||
:Self Managed OpenGL / GLFW:
 | 
			
		||||
    Refer to :ref:`nanogui_example_3` for an as concise as possible example of what you
 | 
			
		||||
    will need to do to get the :ref:`class_nanogui__Screen` to work.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Python
 | 
			
		||||
----------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
The Python interface is very similar to the C++ API.  When you build NanoGUI with CMake,
 | 
			
		||||
a ``python`` folder is created with the library you ``import nanogui`` from.  Though
 | 
			
		||||
there are implementation details that differ greatly, the documentation and build
 | 
			
		||||
process for the Python side is roughly the same.  Refer to the
 | 
			
		||||
:ref:`nanogui_example_programs` and compare the source code for the two.
 | 
			
		||||
 | 
			
		||||
:ref:`nanogui_example_3` highlights the more notable differences between the APIs.
 | 
			
		||||
Specifically, that managing GLFW from Python has no meaning, as well as the main loop
 | 
			
		||||
for Python can easily be detached.
 | 
			
		||||
							
								
								
									
										26
									
								
								cs440-acg/ext/nanogui/ext/coro/LICENSE
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								cs440-acg/ext/nanogui/ext/coro/LICENSE
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
			
		||||
Copyright (c) 2000-2009 Marc Alexander Lehmann <schmorp@schmorp.de>
 | 
			
		||||
 | 
			
		||||
Redistribution and use in source and binary forms, with or without modifica-
 | 
			
		||||
tion, are permitted provided that the following conditions are met:
 | 
			
		||||
 | 
			
		||||
  1.  Redistributions of source code must retain the above copyright notice,
 | 
			
		||||
      this list of conditions and the following disclaimer.
 | 
			
		||||
 | 
			
		||||
  2.  Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
      notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
      documentation and/or other materials provided with the distribution.
 | 
			
		||||
 | 
			
		||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
 | 
			
		||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER-
 | 
			
		||||
CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
 | 
			
		||||
EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE-
 | 
			
		||||
CIAL, 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 OTH-
 | 
			
		||||
ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 | 
			
		||||
OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 | 
			
		||||
Alternatively, the following files carry an additional notice that
 | 
			
		||||
explicitly allows relicensing under the GPLv2: coro.c, coro.h.
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										6
									
								
								cs440-acg/ext/nanogui/ext/coro/README
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								cs440-acg/ext/nanogui/ext/coro/README
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
			
		||||
Configuration, documentation etc. is provided in the coro.h file.  Please
 | 
			
		||||
note that the file conftest.c in this distribution is under the GPL. It is
 | 
			
		||||
not needed for proper operation of this library though, for that, coro.h
 | 
			
		||||
and coro.c suffice.
 | 
			
		||||
 | 
			
		||||
Marc Lehmann <schmorp@schmorp.de>
 | 
			
		||||
							
								
								
									
										803
									
								
								cs440-acg/ext/nanogui/ext/coro/coro.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										803
									
								
								cs440-acg/ext/nanogui/ext/coro/coro.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,803 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2001-2011 Marc Alexander Lehmann <schmorp@schmorp.de>
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without modifica-
 | 
			
		||||
 * tion, are permitted provided that the following conditions are met:
 | 
			
		||||
 *
 | 
			
		||||
 *   1.  Redistributions of source code must retain the above copyright notice,
 | 
			
		||||
 *       this list of conditions and the following disclaimer.
 | 
			
		||||
 *
 | 
			
		||||
 *   2.  Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *       notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *       documentation and/or other materials provided with the distribution.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
 | 
			
		||||
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER-
 | 
			
		||||
 * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
 | 
			
		||||
 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE-
 | 
			
		||||
 * CIAL, 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 OTH-
 | 
			
		||||
 * ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 | 
			
		||||
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 * Alternatively, the contents of this file may be used under the terms of
 | 
			
		||||
 * the GNU General Public License ("GPL") version 2 or any later version,
 | 
			
		||||
 * in which case the provisions of the GPL are applicable instead of
 | 
			
		||||
 * the above. If you wish to allow the use of your version of this file
 | 
			
		||||
 * only under the terms of the GPL and not to allow others to use your
 | 
			
		||||
 * version of this file under the BSD license, indicate your decision
 | 
			
		||||
 * by deleting the provisions above and replace them with the notice
 | 
			
		||||
 * and other provisions required by the GPL. If you do not delete the
 | 
			
		||||
 * provisions above, a recipient may use your version of this file under
 | 
			
		||||
 * either the BSD or the GPL.
 | 
			
		||||
 *
 | 
			
		||||
 * This library is modelled strictly after Ralf S. Engelschalls article at
 | 
			
		||||
 * http://www.gnu.org/software/pth/rse-pmt.ps. So most of the credit must
 | 
			
		||||
 * go to Ralf S. Engelschall <rse@engelschall.com>.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "coro.h"
 | 
			
		||||
 | 
			
		||||
#include <stddef.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
 | 
			
		||||
/*****************************************************************************/
 | 
			
		||||
/* ucontext/setjmp/asm backends                                              */
 | 
			
		||||
/*****************************************************************************/
 | 
			
		||||
#if CORO_UCONTEXT || CORO_SJLJ || CORO_LOSER || CORO_LINUX || CORO_IRIX || CORO_ASM
 | 
			
		||||
 | 
			
		||||
# if CORO_UCONTEXT
 | 
			
		||||
#  include <stddef.h>
 | 
			
		||||
# endif
 | 
			
		||||
 | 
			
		||||
# if !defined(STACK_ADJUST_PTR)
 | 
			
		||||
#  if __sgi
 | 
			
		||||
/* IRIX is decidedly NON-unix */
 | 
			
		||||
#   define STACK_ADJUST_PTR(sp,ss) ((char *)(sp) + (ss) - 8)
 | 
			
		||||
#   define STACK_ADJUST_SIZE(sp,ss) ((ss) - 8)
 | 
			
		||||
#  elif (__i386__ && CORO_LINUX) || (_M_IX86 && CORO_LOSER)
 | 
			
		||||
#   define STACK_ADJUST_PTR(sp,ss) ((char *)(sp) + (ss))
 | 
			
		||||
#   define STACK_ADJUST_SIZE(sp,ss) (ss)
 | 
			
		||||
#  elif (__amd64__ && CORO_LINUX) || ((_M_AMD64 || _M_IA64) && CORO_LOSER)
 | 
			
		||||
#   define STACK_ADJUST_PTR(sp,ss) ((char *)(sp) + (ss) - 8)
 | 
			
		||||
#   define STACK_ADJUST_SIZE(sp,ss) (ss)
 | 
			
		||||
#  else
 | 
			
		||||
#   define STACK_ADJUST_PTR(sp,ss) (sp)
 | 
			
		||||
#   define STACK_ADJUST_SIZE(sp,ss) (ss)
 | 
			
		||||
#  endif
 | 
			
		||||
# endif
 | 
			
		||||
 | 
			
		||||
# include <stdlib.h>
 | 
			
		||||
 | 
			
		||||
# if CORO_SJLJ
 | 
			
		||||
#  include <stdio.h>
 | 
			
		||||
#  include <signal.h>
 | 
			
		||||
#  include <unistd.h>
 | 
			
		||||
# endif
 | 
			
		||||
 | 
			
		||||
static coro_func coro_init_func;
 | 
			
		||||
static void *coro_init_arg;
 | 
			
		||||
static coro_context *new_coro, *create_coro;
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
coro_init (void)
 | 
			
		||||
{
 | 
			
		||||
  volatile coro_func func = coro_init_func;
 | 
			
		||||
  volatile void *arg = coro_init_arg;
 | 
			
		||||
 | 
			
		||||
  coro_transfer (new_coro, create_coro);
 | 
			
		||||
 | 
			
		||||
#if __GCC_HAVE_DWARF2_CFI_ASM && __amd64
 | 
			
		||||
  asm (".cfi_undefined rip");
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  func ((void *)arg);
 | 
			
		||||
 | 
			
		||||
  /* the new coro returned. bad. just abort() for now */
 | 
			
		||||
  abort ();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# if CORO_SJLJ
 | 
			
		||||
 | 
			
		||||
static volatile int trampoline_done;
 | 
			
		||||
 | 
			
		||||
/* trampoline signal handler */
 | 
			
		||||
static void
 | 
			
		||||
trampoline (int sig)
 | 
			
		||||
{
 | 
			
		||||
  if (coro_setjmp (new_coro->env))
 | 
			
		||||
    coro_init (); /* start it */
 | 
			
		||||
  else
 | 
			
		||||
    trampoline_done = 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# endif
 | 
			
		||||
 | 
			
		||||
# if CORO_ASM
 | 
			
		||||
 | 
			
		||||
  #if __arm__ && \
 | 
			
		||||
      (defined __ARM_ARCH_7__  || defined __ARM_ARCH_7A__ \
 | 
			
		||||
    || defined __ARM_ARCH_7R__ || defined __ARM_ARCH_7M__ \
 | 
			
		||||
    || __ARCH_ARCH == 7)
 | 
			
		||||
    #define CORO_ARM 1
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
  #if _WIN32 || __CYGWIN__
 | 
			
		||||
    #define CORO_WIN_TIB 1
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
  asm (
 | 
			
		||||
       "\t.text\n"
 | 
			
		||||
       #if _WIN32 || __CYGWIN__
 | 
			
		||||
       "\t.globl _coro_transfer\n"
 | 
			
		||||
       "_coro_transfer:\n"
 | 
			
		||||
       #else
 | 
			
		||||
       "\t.globl coro_transfer\n"
 | 
			
		||||
       "coro_transfer:\n"
 | 
			
		||||
       #endif
 | 
			
		||||
       /* windows, of course, gives a shit on the amd64 ABI and uses different registers */
 | 
			
		||||
       /* http://blogs.msdn.com/freik/archive/2005/03/17/398200.aspx */
 | 
			
		||||
       #if __amd64
 | 
			
		||||
 | 
			
		||||
         #if _WIN32 || __CYGWIN__
 | 
			
		||||
           #define NUM_SAVED 29
 | 
			
		||||
           "\tsubq $168, %rsp\t" /* one dummy qword to improve alignment */
 | 
			
		||||
           "\tmovaps %xmm6, (%rsp)\n"
 | 
			
		||||
           "\tmovaps %xmm7, 16(%rsp)\n"
 | 
			
		||||
           "\tmovaps %xmm8, 32(%rsp)\n"
 | 
			
		||||
           "\tmovaps %xmm9, 48(%rsp)\n"
 | 
			
		||||
           "\tmovaps %xmm10, 64(%rsp)\n"
 | 
			
		||||
           "\tmovaps %xmm11, 80(%rsp)\n"
 | 
			
		||||
           "\tmovaps %xmm12, 96(%rsp)\n"
 | 
			
		||||
           "\tmovaps %xmm13, 112(%rsp)\n"
 | 
			
		||||
           "\tmovaps %xmm14, 128(%rsp)\n"
 | 
			
		||||
           "\tmovaps %xmm15, 144(%rsp)\n"
 | 
			
		||||
           "\tpushq %rsi\n"
 | 
			
		||||
           "\tpushq %rdi\n"
 | 
			
		||||
           "\tpushq %rbp\n"
 | 
			
		||||
           "\tpushq %rbx\n"
 | 
			
		||||
           "\tpushq %r12\n"
 | 
			
		||||
           "\tpushq %r13\n"
 | 
			
		||||
           "\tpushq %r14\n"
 | 
			
		||||
           "\tpushq %r15\n"
 | 
			
		||||
           #if CORO_WIN_TIB
 | 
			
		||||
             "\tpushq %fs:0x0\n"
 | 
			
		||||
             "\tpushq %fs:0x8\n"
 | 
			
		||||
             "\tpushq %fs:0xc\n"
 | 
			
		||||
           #endif
 | 
			
		||||
           "\tmovq %rsp, (%rcx)\n"
 | 
			
		||||
           "\tmovq (%rdx), %rsp\n"
 | 
			
		||||
           #if CORO_WIN_TIB
 | 
			
		||||
             "\tpopq %fs:0xc\n"
 | 
			
		||||
             "\tpopq %fs:0x8\n"
 | 
			
		||||
             "\tpopq %fs:0x0\n"
 | 
			
		||||
           #endif
 | 
			
		||||
           "\tpopq %r15\n"
 | 
			
		||||
           "\tpopq %r14\n"
 | 
			
		||||
           "\tpopq %r13\n"
 | 
			
		||||
           "\tpopq %r12\n"
 | 
			
		||||
           "\tpopq %rbx\n"
 | 
			
		||||
           "\tpopq %rbp\n"
 | 
			
		||||
           "\tpopq %rdi\n"
 | 
			
		||||
           "\tpopq %rsi\n"
 | 
			
		||||
           "\tmovaps (%rsp), %xmm6\n"
 | 
			
		||||
           "\tmovaps 16(%rsp), %xmm7\n"
 | 
			
		||||
           "\tmovaps 32(%rsp), %xmm8\n"
 | 
			
		||||
           "\tmovaps 48(%rsp), %xmm9\n"
 | 
			
		||||
           "\tmovaps 64(%rsp), %xmm10\n"
 | 
			
		||||
           "\tmovaps 80(%rsp), %xmm11\n"
 | 
			
		||||
           "\tmovaps 96(%rsp), %xmm12\n"
 | 
			
		||||
           "\tmovaps 112(%rsp), %xmm13\n"
 | 
			
		||||
           "\tmovaps 128(%rsp), %xmm14\n"
 | 
			
		||||
           "\tmovaps 144(%rsp), %xmm15\n"
 | 
			
		||||
           "\taddq $168, %rsp\n"
 | 
			
		||||
         #else
 | 
			
		||||
           #define NUM_SAVED 6
 | 
			
		||||
           "\tpushq %rbp\n"
 | 
			
		||||
           "\tpushq %rbx\n"
 | 
			
		||||
           "\tpushq %r12\n"
 | 
			
		||||
           "\tpushq %r13\n"
 | 
			
		||||
           "\tpushq %r14\n"
 | 
			
		||||
           "\tpushq %r15\n"
 | 
			
		||||
           "\tmovq %rsp, (%rdi)\n"
 | 
			
		||||
           "\tmovq (%rsi), %rsp\n"
 | 
			
		||||
           "\tpopq %r15\n"
 | 
			
		||||
           "\tpopq %r14\n"
 | 
			
		||||
           "\tpopq %r13\n"
 | 
			
		||||
           "\tpopq %r12\n"
 | 
			
		||||
           "\tpopq %rbx\n"
 | 
			
		||||
           "\tpopq %rbp\n"
 | 
			
		||||
         #endif
 | 
			
		||||
         "\tpopq %rcx\n"
 | 
			
		||||
         "\tjmpq *%rcx\n"
 | 
			
		||||
 | 
			
		||||
       #elif __i386__
 | 
			
		||||
 | 
			
		||||
         #define NUM_SAVED 4
 | 
			
		||||
         "\tpushl %ebp\n"
 | 
			
		||||
         "\tpushl %ebx\n"
 | 
			
		||||
         "\tpushl %esi\n"
 | 
			
		||||
         "\tpushl %edi\n"
 | 
			
		||||
         #if CORO_WIN_TIB
 | 
			
		||||
           #undef NUM_SAVED
 | 
			
		||||
           #define NUM_SAVED 7
 | 
			
		||||
           "\tpushl %fs:0\n"
 | 
			
		||||
           "\tpushl %fs:4\n"
 | 
			
		||||
           "\tpushl %fs:8\n"
 | 
			
		||||
         #endif
 | 
			
		||||
         "\tmovl %esp, (%eax)\n"
 | 
			
		||||
         "\tmovl (%edx), %esp\n"
 | 
			
		||||
         #if CORO_WIN_TIB
 | 
			
		||||
           "\tpopl %fs:8\n"
 | 
			
		||||
           "\tpopl %fs:4\n"
 | 
			
		||||
           "\tpopl %fs:0\n"
 | 
			
		||||
         #endif
 | 
			
		||||
         "\tpopl %edi\n"
 | 
			
		||||
         "\tpopl %esi\n"
 | 
			
		||||
         "\tpopl %ebx\n"
 | 
			
		||||
         "\tpopl %ebp\n"
 | 
			
		||||
         "\tpopl %ecx\n"
 | 
			
		||||
         "\tjmpl *%ecx\n"
 | 
			
		||||
 | 
			
		||||
       #elif CORO_ARM /* untested, what about thumb, neon, iwmmxt? */
 | 
			
		||||
 | 
			
		||||
         #if __ARM_PCS_VFP
 | 
			
		||||
           "\tvpush {d8-d15}\n"
 | 
			
		||||
           #define NUM_SAVED (9 + 8 * 2)
 | 
			
		||||
         #else
 | 
			
		||||
           #define NUM_SAVED 9
 | 
			
		||||
         #endif
 | 
			
		||||
         "\tpush {r4-r11,lr}\n"
 | 
			
		||||
         "\tstr sp, [r0]\n"
 | 
			
		||||
         "\tldr sp, [r1]\n"
 | 
			
		||||
         "\tpop {r4-r11,lr}\n"
 | 
			
		||||
         #if __ARM_PCS_VFP
 | 
			
		||||
           "\tvpop {d8-d15}\n"
 | 
			
		||||
         #endif
 | 
			
		||||
         "\tmov r15, lr\n"
 | 
			
		||||
 | 
			
		||||
       #elif __mips__ && 0 /* untested, 32 bit only */
 | 
			
		||||
 | 
			
		||||
        #define NUM_SAVED (12 + 8 * 2)
 | 
			
		||||
         /* TODO: n64/o64, lw=>ld */
 | 
			
		||||
 | 
			
		||||
         "\t.set    nomips16\n"
 | 
			
		||||
         "\t.frame  $sp,112,$31\n"
 | 
			
		||||
         #if __mips_soft_float
 | 
			
		||||
           "\taddiu   $sp,$sp,-44\n"
 | 
			
		||||
         #else
 | 
			
		||||
           "\taddiu   $sp,$sp,-112\n"
 | 
			
		||||
           "\ts.d     $f30,88($sp)\n"
 | 
			
		||||
           "\ts.d     $f28,80($sp)\n"
 | 
			
		||||
           "\ts.d     $f26,72($sp)\n"
 | 
			
		||||
           "\ts.d     $f24,64($sp)\n"
 | 
			
		||||
           "\ts.d     $f22,56($sp)\n"
 | 
			
		||||
           "\ts.d     $f20,48($sp)\n"
 | 
			
		||||
         #endif
 | 
			
		||||
         "\tsw      $28,40($sp)\n"
 | 
			
		||||
         "\tsw      $31,36($sp)\n"
 | 
			
		||||
         "\tsw      $fp,32($sp)\n"
 | 
			
		||||
         "\tsw      $23,28($sp)\n"
 | 
			
		||||
         "\tsw      $22,24($sp)\n"
 | 
			
		||||
         "\tsw      $21,20($sp)\n"
 | 
			
		||||
         "\tsw      $20,16($sp)\n"
 | 
			
		||||
         "\tsw      $19,12($sp)\n"
 | 
			
		||||
         "\tsw      $18,8($sp)\n"
 | 
			
		||||
         "\tsw      $17,4($sp)\n"
 | 
			
		||||
         "\tsw      $16,0($sp)\n"
 | 
			
		||||
         "\tsw      $sp,0($4)\n"
 | 
			
		||||
         "\tlw      $sp,0($5)\n"
 | 
			
		||||
         #if !__mips_soft_float
 | 
			
		||||
           "\tl.d     $f30,88($sp)\n"
 | 
			
		||||
           "\tl.d     $f28,80($sp)\n"
 | 
			
		||||
           "\tl.d     $f26,72($sp)\n"
 | 
			
		||||
           "\tl.d     $f24,64($sp)\n"
 | 
			
		||||
           "\tl.d     $f22,56($sp)\n"
 | 
			
		||||
           "\tl.d     $f20,48($sp)\n"
 | 
			
		||||
         #endif
 | 
			
		||||
         "\tlw      $28,40($sp)\n"
 | 
			
		||||
         "\tlw      $31,36($sp)\n"
 | 
			
		||||
         "\tlw      $fp,32($sp)\n"
 | 
			
		||||
         "\tlw      $23,28($sp)\n"
 | 
			
		||||
         "\tlw      $22,24($sp)\n"
 | 
			
		||||
         "\tlw      $21,20($sp)\n"
 | 
			
		||||
         "\tlw      $20,16($sp)\n"
 | 
			
		||||
         "\tlw      $19,12($sp)\n"
 | 
			
		||||
         "\tlw      $18,8($sp)\n"
 | 
			
		||||
         "\tlw      $17,4($sp)\n"
 | 
			
		||||
         "\tlw      $16,0($sp)\n"
 | 
			
		||||
         "\tj       $31\n"
 | 
			
		||||
         #if __mips_soft_float
 | 
			
		||||
           "\taddiu   $sp,$sp,44\n"
 | 
			
		||||
         #else
 | 
			
		||||
           "\taddiu   $sp,$sp,112\n"
 | 
			
		||||
         #endif
 | 
			
		||||
 | 
			
		||||
       #else
 | 
			
		||||
         #error unsupported architecture
 | 
			
		||||
       #endif
 | 
			
		||||
  );
 | 
			
		||||
 | 
			
		||||
# endif
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
coro_create (coro_context *ctx, coro_func coro, void *arg, void *sptr, size_t ssize)
 | 
			
		||||
{
 | 
			
		||||
  coro_context nctx;
 | 
			
		||||
# if CORO_SJLJ
 | 
			
		||||
  stack_t ostk, nstk;
 | 
			
		||||
  struct sigaction osa, nsa;
 | 
			
		||||
  sigset_t nsig, osig;
 | 
			
		||||
# endif
 | 
			
		||||
 | 
			
		||||
  if (!coro)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  coro_init_func = coro;
 | 
			
		||||
  coro_init_arg  = arg;
 | 
			
		||||
 | 
			
		||||
  new_coro    = ctx;
 | 
			
		||||
  create_coro = &nctx;
 | 
			
		||||
 | 
			
		||||
# if CORO_SJLJ
 | 
			
		||||
  /* we use SIGUSR2. first block it, then fiddle with it. */
 | 
			
		||||
 | 
			
		||||
  sigemptyset (&nsig);
 | 
			
		||||
  sigaddset (&nsig, SIGUSR2);
 | 
			
		||||
  sigprocmask (SIG_BLOCK, &nsig, &osig);
 | 
			
		||||
 | 
			
		||||
  nsa.sa_handler = trampoline;
 | 
			
		||||
  sigemptyset (&nsa.sa_mask);
 | 
			
		||||
  nsa.sa_flags = SA_ONSTACK;
 | 
			
		||||
 | 
			
		||||
  if (sigaction (SIGUSR2, &nsa, &osa))
 | 
			
		||||
    {
 | 
			
		||||
      perror ("sigaction");
 | 
			
		||||
      abort ();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  /* set the new stack */
 | 
			
		||||
  nstk.ss_sp    = STACK_ADJUST_PTR (sptr, ssize); /* yes, some platforms (IRIX) get this wrong. */
 | 
			
		||||
  nstk.ss_size  = STACK_ADJUST_SIZE (sptr, ssize);
 | 
			
		||||
  nstk.ss_flags = 0;
 | 
			
		||||
 | 
			
		||||
  if (sigaltstack (&nstk, &ostk) < 0)
 | 
			
		||||
    {
 | 
			
		||||
      perror ("sigaltstack");
 | 
			
		||||
      abort ();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  trampoline_done = 0;
 | 
			
		||||
  kill (getpid (), SIGUSR2);
 | 
			
		||||
  sigfillset (&nsig); sigdelset (&nsig, SIGUSR2);
 | 
			
		||||
 | 
			
		||||
  while (!trampoline_done)
 | 
			
		||||
    sigsuspend (&nsig);
 | 
			
		||||
 | 
			
		||||
  sigaltstack (0, &nstk);
 | 
			
		||||
  nstk.ss_flags = SS_DISABLE;
 | 
			
		||||
  if (sigaltstack (&nstk, 0) < 0)
 | 
			
		||||
    perror ("sigaltstack");
 | 
			
		||||
 | 
			
		||||
  sigaltstack (0, &nstk);
 | 
			
		||||
  if (~nstk.ss_flags & SS_DISABLE)
 | 
			
		||||
    abort ();
 | 
			
		||||
 | 
			
		||||
  if (~ostk.ss_flags & SS_DISABLE)
 | 
			
		||||
    sigaltstack (&ostk, 0);
 | 
			
		||||
 | 
			
		||||
  sigaction (SIGUSR2, &osa, 0);
 | 
			
		||||
  sigprocmask (SIG_SETMASK, &osig, 0);
 | 
			
		||||
 | 
			
		||||
# elif CORO_LOSER
 | 
			
		||||
 | 
			
		||||
  coro_setjmp (ctx->env);
 | 
			
		||||
  #if __CYGWIN__ && __i386__
 | 
			
		||||
    ctx->env[8]                        = (long)    coro_init;
 | 
			
		||||
    ctx->env[7]                        = (long)    ((char *)sptr + ssize)         - sizeof (long);
 | 
			
		||||
  #elif __CYGWIN__ && __x86_64__
 | 
			
		||||
    ctx->env[7]                        = (long)    coro_init;
 | 
			
		||||
    ctx->env[6]                        = (long)    ((char *)sptr + ssize)         - sizeof (long);
 | 
			
		||||
  #elif defined __MINGW32__
 | 
			
		||||
    ctx->env[5]                        = (long)    coro_init;
 | 
			
		||||
    ctx->env[4]                        = (long)    ((char *)sptr + ssize)         - sizeof (long);
 | 
			
		||||
  #elif defined _M_IX86
 | 
			
		||||
    ((_JUMP_BUFFER *)&ctx->env)->Eip   = (long)    coro_init;
 | 
			
		||||
    ((_JUMP_BUFFER *)&ctx->env)->Esp   = (long)    STACK_ADJUST_PTR (sptr, ssize) - sizeof (long);
 | 
			
		||||
  #elif defined _M_AMD64
 | 
			
		||||
    ((_JUMP_BUFFER *)&ctx->env)->Rip   = (__int64) coro_init;
 | 
			
		||||
    ((_JUMP_BUFFER *)&ctx->env)->Rsp   = (__int64) STACK_ADJUST_PTR (sptr, ssize) - sizeof (__int64);
 | 
			
		||||
  #elif defined _M_IA64
 | 
			
		||||
    ((_JUMP_BUFFER *)&ctx->env)->StIIP = (__int64) coro_init;
 | 
			
		||||
    ((_JUMP_BUFFER *)&ctx->env)->IntSp = (__int64) STACK_ADJUST_PTR (sptr, ssize) - sizeof (__int64);
 | 
			
		||||
  #else
 | 
			
		||||
    #error "microsoft libc or architecture not supported"
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
# elif CORO_LINUX
 | 
			
		||||
 | 
			
		||||
  coro_setjmp (ctx->env);
 | 
			
		||||
  #if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 0 && defined (JB_PC) && defined (JB_SP)
 | 
			
		||||
    ctx->env[0].__jmpbuf[JB_PC]        = (long)    coro_init;
 | 
			
		||||
    ctx->env[0].__jmpbuf[JB_SP]        = (long)    STACK_ADJUST_PTR (sptr, ssize) - sizeof (long);
 | 
			
		||||
  #elif __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 0 && defined (__mc68000__)
 | 
			
		||||
    ctx->env[0].__jmpbuf[0].__aregs[0] = (long int)coro_init;
 | 
			
		||||
    ctx->env[0].__jmpbuf[0].__sp       = (int *)   ((char *)sptr + ssize)         - sizeof (long);
 | 
			
		||||
  #elif defined (__GNU_LIBRARY__) && defined (__i386__)
 | 
			
		||||
    ctx->env[0].__jmpbuf[0].__pc       = (char *)  coro_init;
 | 
			
		||||
    ctx->env[0].__jmpbuf[0].__sp       = (void *)  ((char *)sptr + ssize)         - sizeof (long);
 | 
			
		||||
  #elif defined (__GNU_LIBRARY__) && defined (__x86_64__)
 | 
			
		||||
    ctx->env[0].__jmpbuf[JB_PC]        = (long)    coro_init;
 | 
			
		||||
    ctx->env[0].__jmpbuf[0].__sp       = (void *)  ((char *)sptr + ssize)         - sizeof (long);
 | 
			
		||||
  #else
 | 
			
		||||
    #error "linux libc or architecture not supported"
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
# elif CORO_IRIX
 | 
			
		||||
 | 
			
		||||
  coro_setjmp (ctx->env, 0);
 | 
			
		||||
  ctx->env[JB_PC]                      = (__uint64_t)coro_init;
 | 
			
		||||
  ctx->env[JB_SP]                      = (__uint64_t)STACK_ADJUST_PTR (sptr, ssize) - sizeof (long);
 | 
			
		||||
 | 
			
		||||
# elif CORO_ASM
 | 
			
		||||
 | 
			
		||||
  #if __i386__ || __x86_64__
 | 
			
		||||
    ctx->sp = (void **)(ssize + (char *)sptr);
 | 
			
		||||
    *--ctx->sp = (void *)abort; /* needed for alignment only */
 | 
			
		||||
    *--ctx->sp = (void *)coro_init;
 | 
			
		||||
    #if CORO_WIN_TIB
 | 
			
		||||
      *--ctx->sp = 0;                    /* ExceptionList */
 | 
			
		||||
      *--ctx->sp = (char *)sptr + ssize; /* StackBase */
 | 
			
		||||
      *--ctx->sp = sptr;                 /* StackLimit */
 | 
			
		||||
    #endif
 | 
			
		||||
  #elif CORO_ARM
 | 
			
		||||
    /* return address stored in lr register, don't push anything */
 | 
			
		||||
  #else
 | 
			
		||||
    #error unsupported architecture
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
  ctx->sp -= NUM_SAVED;
 | 
			
		||||
  memset (ctx->sp, 0, sizeof (*ctx->sp) * NUM_SAVED);
 | 
			
		||||
 | 
			
		||||
  #if __i386__ || __x86_64__
 | 
			
		||||
    /* done already */
 | 
			
		||||
  #elif CORO_ARM
 | 
			
		||||
    ctx->sp[0] = coro; /* r4 */
 | 
			
		||||
    ctx->sp[1] = arg;  /* r5 */
 | 
			
		||||
    ctx->sp[8] = (char *)coro_init; /* lr */
 | 
			
		||||
  #else
 | 
			
		||||
    #error unsupported architecture
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
# elif CORO_UCONTEXT
 | 
			
		||||
 | 
			
		||||
  getcontext (&(ctx->uc));
 | 
			
		||||
 | 
			
		||||
  ctx->uc.uc_link           =  0;
 | 
			
		||||
  ctx->uc.uc_stack.ss_sp    = sptr;
 | 
			
		||||
  ctx->uc.uc_stack.ss_size  = (size_t)ssize;
 | 
			
		||||
  ctx->uc.uc_stack.ss_flags = 0;
 | 
			
		||||
 | 
			
		||||
  makecontext (&(ctx->uc), (void (*)())coro_init, 0);
 | 
			
		||||
 | 
			
		||||
# endif
 | 
			
		||||
 | 
			
		||||
  coro_transfer (create_coro, new_coro);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*****************************************************************************/
 | 
			
		||||
/* pthread backend                                                           */
 | 
			
		||||
/*****************************************************************************/
 | 
			
		||||
#elif CORO_PTHREAD
 | 
			
		||||
 | 
			
		||||
/* this mutex will be locked by the running coroutine */
 | 
			
		||||
pthread_mutex_t coro_mutex = PTHREAD_MUTEX_INITIALIZER;
 | 
			
		||||
 | 
			
		||||
struct coro_init_args
 | 
			
		||||
{
 | 
			
		||||
  coro_func func;
 | 
			
		||||
  void *arg;
 | 
			
		||||
  coro_context *self, *main;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static pthread_t null_tid;
 | 
			
		||||
 | 
			
		||||
/* I'd so love to cast pthread_mutex_unlock to void (*)(void *)... */
 | 
			
		||||
static void
 | 
			
		||||
mutex_unlock_wrapper (void *arg)
 | 
			
		||||
{
 | 
			
		||||
  pthread_mutex_unlock ((pthread_mutex_t *)arg);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void *
 | 
			
		||||
coro_init (void *args_)
 | 
			
		||||
{
 | 
			
		||||
  struct coro_init_args *args = (struct coro_init_args *)args_;
 | 
			
		||||
  coro_func func = args->func;
 | 
			
		||||
  void *arg = args->arg;
 | 
			
		||||
 | 
			
		||||
  pthread_mutex_lock (&coro_mutex);
 | 
			
		||||
 | 
			
		||||
  /* we try to be good citizens and use deferred cancellation and cleanup handlers */
 | 
			
		||||
  pthread_cleanup_push (mutex_unlock_wrapper, &coro_mutex);
 | 
			
		||||
    coro_transfer (args->self, args->main);
 | 
			
		||||
    func (arg);
 | 
			
		||||
  pthread_cleanup_pop (1);
 | 
			
		||||
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
coro_transfer (coro_context *prev, coro_context *next)
 | 
			
		||||
{
 | 
			
		||||
  pthread_cond_signal (&next->cv);
 | 
			
		||||
  pthread_cond_wait (&prev->cv, &coro_mutex);
 | 
			
		||||
#if __FreeBSD__ /* freebsd is of course broken and needs manual testcancel calls... yay... */
 | 
			
		||||
  pthread_testcancel ();
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
coro_create (coro_context *ctx, coro_func coro, void *arg, void *sptr, size_t ssize)
 | 
			
		||||
{
 | 
			
		||||
  static coro_context nctx;
 | 
			
		||||
  static int once;
 | 
			
		||||
 | 
			
		||||
  if (!once)
 | 
			
		||||
    {
 | 
			
		||||
      once = 1;
 | 
			
		||||
 | 
			
		||||
      pthread_mutex_lock (&coro_mutex);
 | 
			
		||||
      pthread_cond_init (&nctx.cv, 0);
 | 
			
		||||
      null_tid = pthread_self ();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  pthread_cond_init (&ctx->cv, 0);
 | 
			
		||||
 | 
			
		||||
  if (coro)
 | 
			
		||||
    {
 | 
			
		||||
      pthread_attr_t attr;
 | 
			
		||||
      struct coro_init_args args;
 | 
			
		||||
 | 
			
		||||
      args.func = coro;
 | 
			
		||||
      args.arg  = arg;
 | 
			
		||||
      args.self = ctx;
 | 
			
		||||
      args.main = &nctx;
 | 
			
		||||
 | 
			
		||||
      pthread_attr_init (&attr);
 | 
			
		||||
#if __UCLIBC__
 | 
			
		||||
      /* exists, but is borked */
 | 
			
		||||
      /*pthread_attr_setstacksize (&attr, (size_t)ssize);*/
 | 
			
		||||
#elif __CYGWIN__
 | 
			
		||||
      /* POSIX, not here */
 | 
			
		||||
      pthread_attr_setstacksize (&attr, (size_t)ssize);
 | 
			
		||||
#else
 | 
			
		||||
      pthread_attr_setstack (&attr, sptr, (size_t)ssize);
 | 
			
		||||
#endif
 | 
			
		||||
      pthread_attr_setscope (&attr, PTHREAD_SCOPE_PROCESS);
 | 
			
		||||
      pthread_create (&ctx->id, &attr, coro_init, &args);
 | 
			
		||||
 | 
			
		||||
      coro_transfer (args.main, args.self);
 | 
			
		||||
    }
 | 
			
		||||
  else
 | 
			
		||||
    ctx->id = null_tid;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
coro_destroy (coro_context *ctx)
 | 
			
		||||
{
 | 
			
		||||
  if (!pthread_equal (ctx->id, null_tid))
 | 
			
		||||
    {
 | 
			
		||||
      pthread_cancel (ctx->id);
 | 
			
		||||
      pthread_mutex_unlock (&coro_mutex);
 | 
			
		||||
      pthread_join (ctx->id, 0);
 | 
			
		||||
      pthread_mutex_lock (&coro_mutex);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  pthread_cond_destroy (&ctx->cv);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*****************************************************************************/
 | 
			
		||||
/* fiber backend                                                             */
 | 
			
		||||
/*****************************************************************************/
 | 
			
		||||
#elif CORO_FIBER
 | 
			
		||||
 | 
			
		||||
#define WIN32_LEAN_AND_MEAN
 | 
			
		||||
#if _WIN32_WINNT < 0x0400
 | 
			
		||||
  #undef _WIN32_WINNT
 | 
			
		||||
  #define _WIN32_WINNT 0x0400
 | 
			
		||||
#endif
 | 
			
		||||
#include <windows.h>
 | 
			
		||||
 | 
			
		||||
VOID CALLBACK
 | 
			
		||||
coro_init (PVOID arg)
 | 
			
		||||
{
 | 
			
		||||
  coro_context *ctx = (coro_context *)arg;
 | 
			
		||||
 | 
			
		||||
  ctx->coro (ctx->arg);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
coro_transfer (coro_context *prev, coro_context *next)
 | 
			
		||||
{
 | 
			
		||||
  if (!prev->fiber)
 | 
			
		||||
    {
 | 
			
		||||
      prev->fiber = GetCurrentFiber ();
 | 
			
		||||
 | 
			
		||||
      if (prev->fiber == 0 || prev->fiber == (void *)0x1e00)
 | 
			
		||||
        prev->fiber = ConvertThreadToFiber (0);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  SwitchToFiber (next->fiber);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
coro_create (coro_context *ctx, coro_func coro, void *arg, void *sptr, size_t ssize)
 | 
			
		||||
{
 | 
			
		||||
  ctx->fiber = 0;
 | 
			
		||||
  ctx->coro  = coro;
 | 
			
		||||
  ctx->arg   = arg;
 | 
			
		||||
 | 
			
		||||
  if (!coro)
 | 
			
		||||
    return;
 | 
			
		||||
 | 
			
		||||
  ctx->fiber = CreateFiber (ssize, coro_init, ctx);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
coro_destroy (coro_context *ctx)
 | 
			
		||||
{
 | 
			
		||||
  DeleteFiber (ctx->fiber);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#else
 | 
			
		||||
  #error unsupported backend
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*****************************************************************************/
 | 
			
		||||
/* stack management                                                          */
 | 
			
		||||
/*****************************************************************************/
 | 
			
		||||
#if CORO_STACKALLOC
 | 
			
		||||
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
 | 
			
		||||
#ifndef _WIN32
 | 
			
		||||
# include <unistd.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if CORO_USE_VALGRIND
 | 
			
		||||
# include <valgrind/valgrind.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if _POSIX_MAPPED_FILES
 | 
			
		||||
# include <sys/mman.h>
 | 
			
		||||
# define CORO_MMAP 1
 | 
			
		||||
# ifndef MAP_ANONYMOUS
 | 
			
		||||
#  ifdef MAP_ANON
 | 
			
		||||
#   define MAP_ANONYMOUS MAP_ANON
 | 
			
		||||
#  else
 | 
			
		||||
#   undef CORO_MMAP
 | 
			
		||||
#  endif
 | 
			
		||||
# endif
 | 
			
		||||
# include <limits.h>
 | 
			
		||||
#else
 | 
			
		||||
# undef CORO_MMAP
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if _POSIX_MEMORY_PROTECTION
 | 
			
		||||
# ifndef CORO_GUARDPAGES
 | 
			
		||||
#  define CORO_GUARDPAGES 4
 | 
			
		||||
# endif
 | 
			
		||||
#else
 | 
			
		||||
# undef CORO_GUARDPAGES
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !CORO_MMAP
 | 
			
		||||
# undef CORO_GUARDPAGES
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !__i386__ && !__x86_64__ && !__powerpc__ && !__arm__ && !__aarch64__ && !__m68k__ && !__alpha__ && !__mips__ && !__sparc64__
 | 
			
		||||
# undef CORO_GUARDPAGES
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef CORO_GUARDPAGES
 | 
			
		||||
# define CORO_GUARDPAGES 0
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !PAGESIZE
 | 
			
		||||
  #if !CORO_MMAP
 | 
			
		||||
    #define PAGESIZE 4096
 | 
			
		||||
  #else
 | 
			
		||||
    static size_t
 | 
			
		||||
    coro_pagesize (void)
 | 
			
		||||
    {
 | 
			
		||||
      static size_t pagesize;
 | 
			
		||||
 | 
			
		||||
      if (!pagesize)
 | 
			
		||||
        pagesize = sysconf (_SC_PAGESIZE);
 | 
			
		||||
 | 
			
		||||
      return pagesize;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #define PAGESIZE coro_pagesize ()
 | 
			
		||||
  #endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
coro_stack_alloc (struct coro_stack *stack, unsigned int size)
 | 
			
		||||
{
 | 
			
		||||
  if (!size)
 | 
			
		||||
    size = 256 * 1024;
 | 
			
		||||
 | 
			
		||||
  stack->sptr = 0;
 | 
			
		||||
  stack->ssze = ((size_t)size * sizeof (void *) + PAGESIZE - 1) / PAGESIZE * PAGESIZE;
 | 
			
		||||
 | 
			
		||||
#if CORO_FIBER
 | 
			
		||||
 | 
			
		||||
  stack->sptr = (void *)stack;
 | 
			
		||||
  return 1;
 | 
			
		||||
 | 
			
		||||
#else
 | 
			
		||||
 | 
			
		||||
  size_t ssze = stack->ssze + CORO_GUARDPAGES * PAGESIZE;
 | 
			
		||||
  void *base;
 | 
			
		||||
 | 
			
		||||
  #if CORO_MMAP
 | 
			
		||||
    /* mmap supposedly does allocate-on-write for us */
 | 
			
		||||
    base = mmap (0, ssze, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
 | 
			
		||||
 | 
			
		||||
    if (base == (void *)-1)
 | 
			
		||||
      {
 | 
			
		||||
        /* some systems don't let us have executable heap */
 | 
			
		||||
        /* we assume they won't need executable stack in that case */
 | 
			
		||||
        base = mmap (0, ssze, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
 | 
			
		||||
 | 
			
		||||
        if (base == (void *)-1)
 | 
			
		||||
          return 0;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
    #if CORO_GUARDPAGES
 | 
			
		||||
      mprotect (base, CORO_GUARDPAGES * PAGESIZE, PROT_NONE);
 | 
			
		||||
    #endif
 | 
			
		||||
 | 
			
		||||
    base = (void*)((char *)base + CORO_GUARDPAGES * PAGESIZE);
 | 
			
		||||
  #else
 | 
			
		||||
    base = malloc (ssze);
 | 
			
		||||
    if (!base)
 | 
			
		||||
      return 0;
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
  #if CORO_USE_VALGRIND
 | 
			
		||||
    stack->valgrind_id = VALGRIND_STACK_REGISTER ((char *)base, ((char *)base) + ssze - CORO_GUARDPAGES * PAGESIZE);
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
  stack->sptr = base;
 | 
			
		||||
  return 1;
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
coro_stack_free (struct coro_stack *stack)
 | 
			
		||||
{
 | 
			
		||||
#if CORO_FIBER
 | 
			
		||||
  /* nop */
 | 
			
		||||
#else
 | 
			
		||||
  #if CORO_USE_VALGRIND
 | 
			
		||||
    VALGRIND_STACK_DEREGISTER (stack->valgrind_id);
 | 
			
		||||
  #endif
 | 
			
		||||
 | 
			
		||||
  #if CORO_MMAP
 | 
			
		||||
    if (stack->sptr)
 | 
			
		||||
      munmap ((void*)((char *)stack->sptr - CORO_GUARDPAGES * PAGESIZE),
 | 
			
		||||
              stack->ssze                 + CORO_GUARDPAGES * PAGESIZE);
 | 
			
		||||
  #else
 | 
			
		||||
    free (stack->sptr);
 | 
			
		||||
  #endif
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										425
									
								
								cs440-acg/ext/nanogui/ext/coro/coro.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										425
									
								
								cs440-acg/ext/nanogui/ext/coro/coro.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,425 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2001-2012,2015 Marc Alexander Lehmann <schmorp@schmorp.de>
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without modifica-
 | 
			
		||||
 * tion, are permitted provided that the following conditions are met:
 | 
			
		||||
 *
 | 
			
		||||
 *   1.  Redistributions of source code must retain the above copyright notice,
 | 
			
		||||
 *       this list of conditions and the following disclaimer.
 | 
			
		||||
 *
 | 
			
		||||
 *   2.  Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
 *       notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
 *       documentation and/or other materials provided with the distribution.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
 | 
			
		||||
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MER-
 | 
			
		||||
 * CHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
 | 
			
		||||
 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE-
 | 
			
		||||
 * CIAL, 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 OTH-
 | 
			
		||||
 * ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 | 
			
		||||
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 *
 | 
			
		||||
 * Alternatively, the contents of this file may be used under the terms of
 | 
			
		||||
 * the GNU General Public License ("GPL") version 2 or any later version,
 | 
			
		||||
 * in which case the provisions of the GPL are applicable instead of
 | 
			
		||||
 * the above. If you wish to allow the use of your version of this file
 | 
			
		||||
 * only under the terms of the GPL and not to allow others to use your
 | 
			
		||||
 * version of this file under the BSD license, indicate your decision
 | 
			
		||||
 * by deleting the provisions above and replace them with the notice
 | 
			
		||||
 * and other provisions required by the GPL. If you do not delete the
 | 
			
		||||
 * provisions above, a recipient may use your version of this file under
 | 
			
		||||
 * either the BSD or the GPL.
 | 
			
		||||
 *
 | 
			
		||||
 * This library is modelled strictly after Ralf S. Engelschalls article at
 | 
			
		||||
 * http://www.gnu.org/software/pth/rse-pmt.ps. So most of the credit must
 | 
			
		||||
 * go to Ralf S. Engelschall <rse@engelschall.com>.
 | 
			
		||||
 *
 | 
			
		||||
 * This coroutine library is very much stripped down. You should either
 | 
			
		||||
 * build your own process abstraction using it or - better - just use GNU
 | 
			
		||||
 * Portable Threads, http://www.gnu.org/software/pth/.
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * 2006-10-26 Include stddef.h on OS X to work around one of its bugs.
 | 
			
		||||
 *            Reported by Michael_G_Schwern.
 | 
			
		||||
 * 2006-11-26 Use _setjmp instead of setjmp on GNU/Linux.
 | 
			
		||||
 * 2007-04-27 Set unwind frame info if gcc 3+ and ELF is detected.
 | 
			
		||||
 *            Use _setjmp instead of setjmp on _XOPEN_SOURCE >= 600.
 | 
			
		||||
 * 2007-05-02 Add assembly versions for x86 and amd64 (to avoid reliance
 | 
			
		||||
 *            on SIGUSR2 and sigaltstack in Crossfire).
 | 
			
		||||
 * 2008-01-21 Disable CFI usage on anything but GNU/Linux.
 | 
			
		||||
 * 2008-03-02 Switched to 2-clause BSD license with GPL exception.
 | 
			
		||||
 * 2008-04-04 New (but highly unrecommended) pthreads backend.
 | 
			
		||||
 * 2008-04-24 Reinstate CORO_LOSER (had wrong stack adjustments).
 | 
			
		||||
 * 2008-10-30 Support assembly method on x86 with and without frame pointer.
 | 
			
		||||
 * 2008-11-03 Use a global asm statement for CORO_ASM, idea by pippijn.
 | 
			
		||||
 * 2008-11-05 Hopefully fix misaligned stacks with CORO_ASM/SETJMP.
 | 
			
		||||
 * 2008-11-07 rbp wasn't saved in CORO_ASM on x86_64.
 | 
			
		||||
 *            introduce coro_destroy, which is a nop except for pthreads.
 | 
			
		||||
 *            speed up CORO_PTHREAD. Do no longer leak threads either.
 | 
			
		||||
 *            coro_create now allows one to create source coro_contexts.
 | 
			
		||||
 *            do not rely on makecontext passing a void * correctly.
 | 
			
		||||
 *            try harder to get _setjmp/_longjmp.
 | 
			
		||||
 *            major code cleanup/restructuring.
 | 
			
		||||
 * 2008-11-10 the .cfi hacks are no longer needed.
 | 
			
		||||
 * 2008-11-16 work around a freebsd pthread bug.
 | 
			
		||||
 * 2008-11-19 define coro_*jmp symbols for easier porting.
 | 
			
		||||
 * 2009-06-23 tentative win32-backend support for mingw32 (Yasuhiro Matsumoto).
 | 
			
		||||
 * 2010-12-03 tentative support for uclibc (which lacks all sorts of things).
 | 
			
		||||
 * 2011-05-30 set initial callee-saved-registers to zero with CORO_ASM.
 | 
			
		||||
 *            use .cfi_undefined rip on linux-amd64 for better backtraces.
 | 
			
		||||
 * 2011-06-08 maybe properly implement weird windows amd64 calling conventions.
 | 
			
		||||
 * 2011-07-03 rely on __GCC_HAVE_DWARF2_CFI_ASM for cfi detection.
 | 
			
		||||
 * 2011-08-08 cygwin trashes stacks, use pthreads with double stack on cygwin.
 | 
			
		||||
 * 2012-12-04 reduce misprediction penalty for x86/amd64 assembly switcher.
 | 
			
		||||
 * 2012-12-05 experimental fiber backend (allocates stack twice).
 | 
			
		||||
 * 2012-12-07 API version 3 - add coro_stack_alloc/coro_stack_free.
 | 
			
		||||
 * 2012-12-21 valgrind stack registering was broken.
 | 
			
		||||
 * 2015-12-05 experimental asm be for arm7, based on a patch by Nick Zavaritsky.
 | 
			
		||||
 *            use __name__ for predefined symbols, as in libecb.
 | 
			
		||||
 *            enable guard pages on arm, aarch64 and mips.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef CORO_H
 | 
			
		||||
#define CORO_H
 | 
			
		||||
 | 
			
		||||
#if __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * This library consists of only three files
 | 
			
		||||
 * coro.h, coro.c and LICENSE (and optionally README)
 | 
			
		||||
 *
 | 
			
		||||
 * It implements what is known as coroutines, in a hopefully
 | 
			
		||||
 * portable way.
 | 
			
		||||
 *
 | 
			
		||||
 * All compiletime symbols must be defined both when including coro.h
 | 
			
		||||
 * (using libcoro) as well as when compiling coro.c (the implementation).
 | 
			
		||||
 *
 | 
			
		||||
 * You can manually specify which flavour you want. If you don't define
 | 
			
		||||
 * any of these, libcoro tries to choose a safe and fast default:
 | 
			
		||||
 *
 | 
			
		||||
 * -DCORO_UCONTEXT
 | 
			
		||||
 *
 | 
			
		||||
 *    This flavour uses SUSv2's get/set/swap/makecontext functions that
 | 
			
		||||
 *    unfortunately only some unices support, and is quite slow.
 | 
			
		||||
 *
 | 
			
		||||
 * -DCORO_SJLJ
 | 
			
		||||
 *
 | 
			
		||||
 *    This flavour uses SUSv2's setjmp/longjmp and sigaltstack functions to
 | 
			
		||||
 *    do it's job. Coroutine creation is much slower than UCONTEXT, but
 | 
			
		||||
 *    context switching is a bit cheaper. It should work on almost all unices.
 | 
			
		||||
 *
 | 
			
		||||
 * -DCORO_LINUX
 | 
			
		||||
 *
 | 
			
		||||
 *    CORO_SJLJ variant.
 | 
			
		||||
 *    Old GNU/Linux systems (<= glibc-2.1) only work with this implementation
 | 
			
		||||
 *    (it is very fast and therefore recommended over other methods, but
 | 
			
		||||
 *    doesn't work with anything newer).
 | 
			
		||||
 *
 | 
			
		||||
 * -DCORO_LOSER
 | 
			
		||||
 *
 | 
			
		||||
 *    CORO_SJLJ variant.
 | 
			
		||||
 *    Microsoft's highly proprietary platform doesn't support sigaltstack, and
 | 
			
		||||
 *    this selects a suitable workaround for this platform. It might not work
 | 
			
		||||
 *    with your compiler though - it has only been tested with MSVC 6.
 | 
			
		||||
 *
 | 
			
		||||
 * -DCORO_FIBER
 | 
			
		||||
 *
 | 
			
		||||
 *    Slower, but probably more portable variant for the Microsoft operating
 | 
			
		||||
 *    system, using fibers. Ignores the passed stack and allocates it internally.
 | 
			
		||||
 *    Also, due to bugs in cygwin, this does not work with cygwin.
 | 
			
		||||
 *
 | 
			
		||||
 * -DCORO_IRIX
 | 
			
		||||
 *
 | 
			
		||||
 *    CORO_SJLJ variant.
 | 
			
		||||
 *    For SGI's version of Microsoft's NT ;)
 | 
			
		||||
 *
 | 
			
		||||
 * -DCORO_ASM
 | 
			
		||||
 *
 | 
			
		||||
 *    Hand coded assembly, known to work only on a few architectures/ABI:
 | 
			
		||||
 *    GCC + arm7/x86/IA32/amd64/x86_64 + GNU/Linux and a few BSDs. Fastest
 | 
			
		||||
 *    choice, if it works.
 | 
			
		||||
 *
 | 
			
		||||
 * -DCORO_PTHREAD
 | 
			
		||||
 *
 | 
			
		||||
 *    Use the pthread API. You have to provide <pthread.h> and -lpthread.
 | 
			
		||||
 *    This is likely the slowest backend, and it also does not support fork(),
 | 
			
		||||
 *    so avoid it at all costs.
 | 
			
		||||
 *
 | 
			
		||||
 * If you define neither of these symbols, coro.h will try to autodetect
 | 
			
		||||
 * the best/safest model. To help with the autodetection, you should check
 | 
			
		||||
 * (e.g. using autoconf) and define the following symbols: HAVE_UCONTEXT_H
 | 
			
		||||
 * / HAVE_SETJMP_H / HAVE_SIGALTSTACK.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Changes when the API changes incompatibly.
 | 
			
		||||
 * This is ONLY the API version - there is no ABI compatibility between releases.
 | 
			
		||||
 *
 | 
			
		||||
 * Changes in API version 2:
 | 
			
		||||
 * replaced bogus -DCORO_LOOSE with grammatically more correct -DCORO_LOSER
 | 
			
		||||
 * Changes in API version 3:
 | 
			
		||||
 * introduced stack management (CORO_STACKALLOC)
 | 
			
		||||
 */
 | 
			
		||||
#define CORO_VERSION 3
 | 
			
		||||
 | 
			
		||||
#include <stddef.h>
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * This is the type for the initialization function of a new coroutine.
 | 
			
		||||
 */
 | 
			
		||||
typedef void (*coro_func)(void *);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * A coroutine state is saved in the following structure. Treat it as an
 | 
			
		||||
 * opaque type. errno and sigmask might be saved, but don't rely on it,
 | 
			
		||||
 * implement your own switching primitive if you need that.
 | 
			
		||||
 */
 | 
			
		||||
typedef struct coro_context coro_context;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * This function creates a new coroutine. Apart from a pointer to an
 | 
			
		||||
 * uninitialised coro_context, it expects a pointer to the entry function
 | 
			
		||||
 * and the single pointer value that is given to it as argument.
 | 
			
		||||
 *
 | 
			
		||||
 * Allocating/deallocating the stack is your own responsibility.
 | 
			
		||||
 *
 | 
			
		||||
 * As a special case, if coro, arg, sptr and ssze are all zero,
 | 
			
		||||
 * then an "empty" coro_context will be created that is suitable
 | 
			
		||||
 * as an initial source for coro_transfer.
 | 
			
		||||
 *
 | 
			
		||||
 * This function is not reentrant, but putting a mutex around it
 | 
			
		||||
 * will work.
 | 
			
		||||
 */
 | 
			
		||||
void coro_create (coro_context *ctx, /* an uninitialised coro_context */
 | 
			
		||||
                  coro_func coro,    /* the coroutine code to be executed */
 | 
			
		||||
                  void *arg,         /* a single pointer passed to the coro */
 | 
			
		||||
                  void *sptr,        /* start of stack area */
 | 
			
		||||
                  size_t ssze);      /* size of stack area in bytes */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * The following prototype defines the coroutine switching function. It is
 | 
			
		||||
 * sometimes implemented as a macro, so watch out.
 | 
			
		||||
 *
 | 
			
		||||
 * This function is thread-safe and reentrant.
 | 
			
		||||
 */
 | 
			
		||||
#if 0
 | 
			
		||||
void coro_transfer (coro_context *prev, coro_context *next);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * The following prototype defines the coroutine destroy function. It
 | 
			
		||||
 * is sometimes implemented as a macro, so watch out. It also serves no
 | 
			
		||||
 * purpose unless you want to use the CORO_PTHREAD backend, where it is
 | 
			
		||||
 * used to clean up the thread. You are responsible for freeing the stack
 | 
			
		||||
 * and the context itself.
 | 
			
		||||
 *
 | 
			
		||||
 * This function is thread-safe and reentrant.
 | 
			
		||||
 */
 | 
			
		||||
#if 0
 | 
			
		||||
void coro_destroy (coro_context *ctx);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*****************************************************************************/
 | 
			
		||||
/* optional stack management                                                 */
 | 
			
		||||
/*****************************************************************************/
 | 
			
		||||
/*
 | 
			
		||||
 * You can disable all of the stack management functions by
 | 
			
		||||
 * defining CORO_STACKALLOC to 0. Otherwise, they are enabled by default.
 | 
			
		||||
 *
 | 
			
		||||
 * If stack management is enabled, you can influence the implementation via these
 | 
			
		||||
 * symbols:
 | 
			
		||||
 *
 | 
			
		||||
 * -DCORO_USE_VALGRIND
 | 
			
		||||
 *
 | 
			
		||||
 *    If defined, then libcoro will include valgrind/valgrind.h and register
 | 
			
		||||
 *    and unregister stacks with valgrind.
 | 
			
		||||
 *
 | 
			
		||||
 * -DCORO_GUARDPAGES=n
 | 
			
		||||
 *
 | 
			
		||||
 *    libcoro will try to use the specified number of guard pages to protect against
 | 
			
		||||
 *    stack overflow. If n is 0, then the feature will be disabled. If it isn't
 | 
			
		||||
 *    defined, then libcoro will choose a suitable default. If guardpages are not
 | 
			
		||||
 *    supported on the platform, then the feature will be silently disabled.
 | 
			
		||||
 */
 | 
			
		||||
#ifndef CORO_STACKALLOC
 | 
			
		||||
# define CORO_STACKALLOC 1
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if CORO_STACKALLOC
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * The only allowed operations on these struct members is to read the
 | 
			
		||||
 * "sptr" and "ssze" members to pass it to coro_create, to read the "sptr"
 | 
			
		||||
 * member to see if it is false, in which case the stack isn't allocated,
 | 
			
		||||
 * and to set the "sptr" member to 0, to indicate to coro_stack_free to
 | 
			
		||||
 * not actually do anything.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
struct coro_stack
 | 
			
		||||
{
 | 
			
		||||
  void *sptr;
 | 
			
		||||
  size_t ssze;
 | 
			
		||||
#if CORO_USE_VALGRIND
 | 
			
		||||
  int valgrind_id;
 | 
			
		||||
#endif
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Try to allocate a stack of at least the given size and return true if
 | 
			
		||||
 * successful, or false otherwise.
 | 
			
		||||
 *
 | 
			
		||||
 * The size is *NOT* specified in bytes, but in units of sizeof (void *),
 | 
			
		||||
 * i.e. the stack is typically 4(8) times larger on 32 bit(64 bit) platforms
 | 
			
		||||
 * then the size passed in.
 | 
			
		||||
 *
 | 
			
		||||
 * If size is 0, then a "suitable" stack size is chosen (usually 1-2MB).
 | 
			
		||||
 */
 | 
			
		||||
int coro_stack_alloc (struct coro_stack *stack, unsigned int size);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Free the stack allocated by coro_stack_alloc again. It is safe to
 | 
			
		||||
 * call this function on the coro_stack structure even if coro_stack_alloc
 | 
			
		||||
 * failed.
 | 
			
		||||
 */
 | 
			
		||||
void coro_stack_free (struct coro_stack *stack);
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * That was it. No other user-serviceable parts below here.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/*****************************************************************************/
 | 
			
		||||
 | 
			
		||||
#if !defined CORO_LOSER      && !defined CORO_UCONTEXT \
 | 
			
		||||
    && !defined CORO_SJLJ    && !defined CORO_LINUX \
 | 
			
		||||
    && !defined CORO_IRIX    && !defined CORO_ASM \
 | 
			
		||||
    && !defined CORO_PTHREAD && !defined CORO_FIBER
 | 
			
		||||
# if defined WINDOWS && (defined __i386__ || (__x86_64__ || defined _M_IX86 || defined _M_AMD64))
 | 
			
		||||
#  define CORO_ASM 1
 | 
			
		||||
# elif defined WINDOWS || defined _WIN32
 | 
			
		||||
#  define CORO_LOSER 1 /* you don't win with windoze */
 | 
			
		||||
# elif __linux && (__i386__ || (__x86_64__ && !__ILP32__) || (__arm__ && __ARCH_ARCH == 7))
 | 
			
		||||
#  define CORO_ASM 1
 | 
			
		||||
# elif defined HAVE_UCONTEXT_H
 | 
			
		||||
#  define CORO_UCONTEXT 1
 | 
			
		||||
# elif defined HAVE_SETJMP_H && defined HAVE_SIGALTSTACK
 | 
			
		||||
#  define CORO_SJLJ 1
 | 
			
		||||
# else
 | 
			
		||||
error unknown or unsupported architecture
 | 
			
		||||
# endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*****************************************************************************/
 | 
			
		||||
 | 
			
		||||
#if CORO_UCONTEXT
 | 
			
		||||
 | 
			
		||||
# include <ucontext.h>
 | 
			
		||||
 | 
			
		||||
struct coro_context
 | 
			
		||||
{
 | 
			
		||||
  ucontext_t uc;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
# define coro_transfer(p,n) swapcontext (&((p)->uc), &((n)->uc))
 | 
			
		||||
# define coro_destroy(ctx) (void *)(ctx)
 | 
			
		||||
 | 
			
		||||
#elif CORO_SJLJ || CORO_LOSER || CORO_LINUX || CORO_IRIX
 | 
			
		||||
 | 
			
		||||
# if defined(CORO_LINUX) && !defined(_GNU_SOURCE)
 | 
			
		||||
#  define _GNU_SOURCE /* for glibc */
 | 
			
		||||
# endif
 | 
			
		||||
 | 
			
		||||
# if !CORO_LOSER
 | 
			
		||||
#  include <unistd.h>
 | 
			
		||||
# endif
 | 
			
		||||
 | 
			
		||||
/* solaris is hopelessly borked, it expands _XOPEN_UNIX to nothing */
 | 
			
		||||
# if __sun
 | 
			
		||||
#  undef _XOPEN_UNIX
 | 
			
		||||
#  define _XOPEN_UNIX 1
 | 
			
		||||
# endif
 | 
			
		||||
 | 
			
		||||
# include <setjmp.h>
 | 
			
		||||
 | 
			
		||||
# if _XOPEN_UNIX > 0 || defined (_setjmp)
 | 
			
		||||
#  define coro_jmp_buf      jmp_buf
 | 
			
		||||
#  define coro_setjmp(env)  _setjmp (env)
 | 
			
		||||
#  define coro_longjmp(env) _longjmp ((env), 1)
 | 
			
		||||
# elif CORO_LOSER
 | 
			
		||||
#  define coro_jmp_buf      jmp_buf
 | 
			
		||||
#  define coro_setjmp(env)  setjmp (env)
 | 
			
		||||
#  define coro_longjmp(env) longjmp ((env), 1)
 | 
			
		||||
# else
 | 
			
		||||
#  define coro_jmp_buf      sigjmp_buf
 | 
			
		||||
#  define coro_setjmp(env)  sigsetjmp (env, 0)
 | 
			
		||||
#  define coro_longjmp(env) siglongjmp ((env), 1)
 | 
			
		||||
# endif
 | 
			
		||||
 | 
			
		||||
struct coro_context
 | 
			
		||||
{
 | 
			
		||||
  coro_jmp_buf env;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
# define coro_transfer(p,n) do { if (!coro_setjmp ((p)->env)) coro_longjmp ((n)->env); } while (0)
 | 
			
		||||
# define coro_destroy(ctx) (void *)(ctx)
 | 
			
		||||
 | 
			
		||||
#elif CORO_ASM
 | 
			
		||||
 | 
			
		||||
struct coro_context
 | 
			
		||||
{
 | 
			
		||||
  void **sp; /* must be at offset 0 */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#if __i386__ || __x86_64__
 | 
			
		||||
void __attribute__ ((__noinline__, __regparm__(2)))
 | 
			
		||||
#else
 | 
			
		||||
void __attribute__ ((__noinline__))
 | 
			
		||||
#endif
 | 
			
		||||
coro_transfer (coro_context *prev, coro_context *next);
 | 
			
		||||
 | 
			
		||||
# define coro_destroy(ctx) (void *)(ctx)
 | 
			
		||||
 | 
			
		||||
#elif CORO_PTHREAD
 | 
			
		||||
 | 
			
		||||
# include <pthread.h>
 | 
			
		||||
 | 
			
		||||
extern pthread_mutex_t coro_mutex;
 | 
			
		||||
 | 
			
		||||
struct coro_context
 | 
			
		||||
{
 | 
			
		||||
  pthread_cond_t cv;
 | 
			
		||||
  pthread_t id;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
void coro_transfer (coro_context *prev, coro_context *next);
 | 
			
		||||
void coro_destroy (coro_context *ctx);
 | 
			
		||||
 | 
			
		||||
#elif CORO_FIBER
 | 
			
		||||
 | 
			
		||||
struct coro_context
 | 
			
		||||
{
 | 
			
		||||
  void *fiber;
 | 
			
		||||
  /* only used for initialisation */
 | 
			
		||||
  coro_func coro;
 | 
			
		||||
  void *arg;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
void coro_transfer (coro_context *prev, coro_context *next);
 | 
			
		||||
void coro_destroy (coro_context *ctx);
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										282
									
								
								cs440-acg/ext/nanogui/ext/glad/include/KHR/khrplatform.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										282
									
								
								cs440-acg/ext/nanogui/ext/glad/include/KHR/khrplatform.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,282 @@
 | 
			
		||||
#ifndef __khrplatform_h_
 | 
			
		||||
#define __khrplatform_h_
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
** Copyright (c) 2008-2018 The Khronos Group Inc.
 | 
			
		||||
**
 | 
			
		||||
** Permission is hereby granted, free of charge, to any person obtaining a
 | 
			
		||||
** copy of this software and/or associated documentation files (the
 | 
			
		||||
** "Materials"), to deal in the Materials without restriction, including
 | 
			
		||||
** without limitation the rights to use, copy, modify, merge, publish,
 | 
			
		||||
** distribute, sublicense, and/or sell copies of the Materials, and to
 | 
			
		||||
** permit persons to whom the Materials are furnished to do so, subject to
 | 
			
		||||
** the following conditions:
 | 
			
		||||
**
 | 
			
		||||
** The above copyright notice and this permission notice shall be included
 | 
			
		||||
** in all copies or substantial portions of the Materials.
 | 
			
		||||
**
 | 
			
		||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 | 
			
		||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 | 
			
		||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 | 
			
		||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 | 
			
		||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 | 
			
		||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 | 
			
		||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/* Khronos platform-specific types and definitions.
 | 
			
		||||
 *
 | 
			
		||||
 * The master copy of khrplatform.h is maintained in the Khronos EGL
 | 
			
		||||
 * Registry repository at https://github.com/KhronosGroup/EGL-Registry
 | 
			
		||||
 * The last semantic modification to khrplatform.h was at commit ID:
 | 
			
		||||
 *      67a3e0864c2d75ea5287b9f3d2eb74a745936692
 | 
			
		||||
 *
 | 
			
		||||
 * Adopters may modify this file to suit their platform. Adopters are
 | 
			
		||||
 * encouraged to submit platform specific modifications to the Khronos
 | 
			
		||||
 * group so that they can be included in future versions of this file.
 | 
			
		||||
 * Please submit changes by filing pull requests or issues on
 | 
			
		||||
 * the EGL Registry repository linked above.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * See the Implementer's Guidelines for information about where this file
 | 
			
		||||
 * should be located on your system and for more details of its use:
 | 
			
		||||
 *    http://www.khronos.org/registry/implementers_guide.pdf
 | 
			
		||||
 *
 | 
			
		||||
 * This file should be included as
 | 
			
		||||
 *        #include <KHR/khrplatform.h>
 | 
			
		||||
 * by Khronos client API header files that use its types and defines.
 | 
			
		||||
 *
 | 
			
		||||
 * The types in khrplatform.h should only be used to define API-specific types.
 | 
			
		||||
 *
 | 
			
		||||
 * Types defined in khrplatform.h:
 | 
			
		||||
 *    khronos_int8_t              signed   8  bit
 | 
			
		||||
 *    khronos_uint8_t             unsigned 8  bit
 | 
			
		||||
 *    khronos_int16_t             signed   16 bit
 | 
			
		||||
 *    khronos_uint16_t            unsigned 16 bit
 | 
			
		||||
 *    khronos_int32_t             signed   32 bit
 | 
			
		||||
 *    khronos_uint32_t            unsigned 32 bit
 | 
			
		||||
 *    khronos_int64_t             signed   64 bit
 | 
			
		||||
 *    khronos_uint64_t            unsigned 64 bit
 | 
			
		||||
 *    khronos_intptr_t            signed   same number of bits as a pointer
 | 
			
		||||
 *    khronos_uintptr_t           unsigned same number of bits as a pointer
 | 
			
		||||
 *    khronos_ssize_t             signed   size
 | 
			
		||||
 *    khronos_usize_t             unsigned size
 | 
			
		||||
 *    khronos_float_t             signed   32 bit floating point
 | 
			
		||||
 *    khronos_time_ns_t           unsigned 64 bit time in nanoseconds
 | 
			
		||||
 *    khronos_utime_nanoseconds_t unsigned time interval or absolute time in
 | 
			
		||||
 *                                         nanoseconds
 | 
			
		||||
 *    khronos_stime_nanoseconds_t signed time interval in nanoseconds
 | 
			
		||||
 *    khronos_boolean_enum_t      enumerated boolean type. This should
 | 
			
		||||
 *      only be used as a base type when a client API's boolean type is
 | 
			
		||||
 *      an enum. Client APIs which use an integer or other type for
 | 
			
		||||
 *      booleans cannot use this as the base type for their boolean.
 | 
			
		||||
 *
 | 
			
		||||
 * Tokens defined in khrplatform.h:
 | 
			
		||||
 *
 | 
			
		||||
 *    KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
 | 
			
		||||
 *
 | 
			
		||||
 *    KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
 | 
			
		||||
 *    KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
 | 
			
		||||
 *
 | 
			
		||||
 * Calling convention macros defined in this file:
 | 
			
		||||
 *    KHRONOS_APICALL
 | 
			
		||||
 *    KHRONOS_APIENTRY
 | 
			
		||||
 *    KHRONOS_APIATTRIBUTES
 | 
			
		||||
 *
 | 
			
		||||
 * These may be used in function prototypes as:
 | 
			
		||||
 *
 | 
			
		||||
 *      KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
 | 
			
		||||
 *                                  int arg1,
 | 
			
		||||
 *                                  int arg2) KHRONOS_APIATTRIBUTES;
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 * Definition of KHRONOS_APICALL
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 * This precedes the return type of the function in the function prototype.
 | 
			
		||||
 */
 | 
			
		||||
#if defined(_WIN32) && !defined(__SCITECH_SNAP__)
 | 
			
		||||
#   define KHRONOS_APICALL __declspec(dllimport)
 | 
			
		||||
#elif defined (__SYMBIAN32__)
 | 
			
		||||
#   define KHRONOS_APICALL IMPORT_C
 | 
			
		||||
#elif defined(__ANDROID__)
 | 
			
		||||
#   define KHRONOS_APICALL __attribute__((visibility("default")))
 | 
			
		||||
#else
 | 
			
		||||
#   define KHRONOS_APICALL
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 * Definition of KHRONOS_APIENTRY
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 * This follows the return type of the function  and precedes the function
 | 
			
		||||
 * name in the function prototype.
 | 
			
		||||
 */
 | 
			
		||||
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
 | 
			
		||||
    /* Win32 but not WinCE */
 | 
			
		||||
#   define KHRONOS_APIENTRY __stdcall
 | 
			
		||||
#else
 | 
			
		||||
#   define KHRONOS_APIENTRY
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 * Definition of KHRONOS_APIATTRIBUTES
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 * This follows the closing parenthesis of the function prototype arguments.
 | 
			
		||||
 */
 | 
			
		||||
#if defined (__ARMCC_2__)
 | 
			
		||||
#define KHRONOS_APIATTRIBUTES __softfp
 | 
			
		||||
#else
 | 
			
		||||
#define KHRONOS_APIATTRIBUTES
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 * basic type definitions
 | 
			
		||||
 *-----------------------------------------------------------------------*/
 | 
			
		||||
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Using <stdint.h>
 | 
			
		||||
 */
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
typedef int32_t                 khronos_int32_t;
 | 
			
		||||
typedef uint32_t                khronos_uint32_t;
 | 
			
		||||
typedef int64_t                 khronos_int64_t;
 | 
			
		||||
typedef uint64_t                khronos_uint64_t;
 | 
			
		||||
#define KHRONOS_SUPPORT_INT64   1
 | 
			
		||||
#define KHRONOS_SUPPORT_FLOAT   1
 | 
			
		||||
 | 
			
		||||
#elif defined(__VMS ) || defined(__sgi)
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Using <inttypes.h>
 | 
			
		||||
 */
 | 
			
		||||
#include <inttypes.h>
 | 
			
		||||
typedef int32_t                 khronos_int32_t;
 | 
			
		||||
typedef uint32_t                khronos_uint32_t;
 | 
			
		||||
typedef int64_t                 khronos_int64_t;
 | 
			
		||||
typedef uint64_t                khronos_uint64_t;
 | 
			
		||||
#define KHRONOS_SUPPORT_INT64   1
 | 
			
		||||
#define KHRONOS_SUPPORT_FLOAT   1
 | 
			
		||||
 | 
			
		||||
#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Win32
 | 
			
		||||
 */
 | 
			
		||||
typedef __int32                 khronos_int32_t;
 | 
			
		||||
typedef unsigned __int32        khronos_uint32_t;
 | 
			
		||||
typedef __int64                 khronos_int64_t;
 | 
			
		||||
typedef unsigned __int64        khronos_uint64_t;
 | 
			
		||||
#define KHRONOS_SUPPORT_INT64   1
 | 
			
		||||
#define KHRONOS_SUPPORT_FLOAT   1
 | 
			
		||||
 | 
			
		||||
#elif defined(__sun__) || defined(__digital__)
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Sun or Digital
 | 
			
		||||
 */
 | 
			
		||||
typedef int                     khronos_int32_t;
 | 
			
		||||
typedef unsigned int            khronos_uint32_t;
 | 
			
		||||
#if defined(__arch64__) || defined(_LP64)
 | 
			
		||||
typedef long int                khronos_int64_t;
 | 
			
		||||
typedef unsigned long int       khronos_uint64_t;
 | 
			
		||||
#else
 | 
			
		||||
typedef long long int           khronos_int64_t;
 | 
			
		||||
typedef unsigned long long int  khronos_uint64_t;
 | 
			
		||||
#endif /* __arch64__ */
 | 
			
		||||
#define KHRONOS_SUPPORT_INT64   1
 | 
			
		||||
#define KHRONOS_SUPPORT_FLOAT   1
 | 
			
		||||
 | 
			
		||||
#elif 0
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Hypothetical platform with no float or int64 support
 | 
			
		||||
 */
 | 
			
		||||
typedef int                     khronos_int32_t;
 | 
			
		||||
typedef unsigned int            khronos_uint32_t;
 | 
			
		||||
#define KHRONOS_SUPPORT_INT64   0
 | 
			
		||||
#define KHRONOS_SUPPORT_FLOAT   0
 | 
			
		||||
 | 
			
		||||
#else
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Generic fallback
 | 
			
		||||
 */
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
typedef int32_t                 khronos_int32_t;
 | 
			
		||||
typedef uint32_t                khronos_uint32_t;
 | 
			
		||||
typedef int64_t                 khronos_int64_t;
 | 
			
		||||
typedef uint64_t                khronos_uint64_t;
 | 
			
		||||
#define KHRONOS_SUPPORT_INT64   1
 | 
			
		||||
#define KHRONOS_SUPPORT_FLOAT   1
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Types that are (so far) the same on all platforms
 | 
			
		||||
 */
 | 
			
		||||
typedef signed   char          khronos_int8_t;
 | 
			
		||||
typedef unsigned char          khronos_uint8_t;
 | 
			
		||||
typedef signed   short int     khronos_int16_t;
 | 
			
		||||
typedef unsigned short int     khronos_uint16_t;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Types that differ between LLP64 and LP64 architectures - in LLP64,
 | 
			
		||||
 * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
 | 
			
		||||
 * to be the only LLP64 architecture in current use.
 | 
			
		||||
 */
 | 
			
		||||
#ifdef _WIN64
 | 
			
		||||
typedef signed   long long int khronos_intptr_t;
 | 
			
		||||
typedef unsigned long long int khronos_uintptr_t;
 | 
			
		||||
typedef signed   long long int khronos_ssize_t;
 | 
			
		||||
typedef unsigned long long int khronos_usize_t;
 | 
			
		||||
#else
 | 
			
		||||
typedef signed   long  int     khronos_intptr_t;
 | 
			
		||||
typedef unsigned long  int     khronos_uintptr_t;
 | 
			
		||||
typedef signed   long  int     khronos_ssize_t;
 | 
			
		||||
typedef unsigned long  int     khronos_usize_t;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if KHRONOS_SUPPORT_FLOAT
 | 
			
		||||
/*
 | 
			
		||||
 * Float type
 | 
			
		||||
 */
 | 
			
		||||
typedef          float         khronos_float_t;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if KHRONOS_SUPPORT_INT64
 | 
			
		||||
/* Time types
 | 
			
		||||
 *
 | 
			
		||||
 * These types can be used to represent a time interval in nanoseconds or
 | 
			
		||||
 * an absolute Unadjusted System Time.  Unadjusted System Time is the number
 | 
			
		||||
 * of nanoseconds since some arbitrary system event (e.g. since the last
 | 
			
		||||
 * time the system booted).  The Unadjusted System Time is an unsigned
 | 
			
		||||
 * 64 bit value that wraps back to 0 every 584 years.  Time intervals
 | 
			
		||||
 * may be either signed or unsigned.
 | 
			
		||||
 */
 | 
			
		||||
typedef khronos_uint64_t       khronos_utime_nanoseconds_t;
 | 
			
		||||
typedef khronos_int64_t        khronos_stime_nanoseconds_t;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Dummy value used to pad enum types to 32 bits.
 | 
			
		||||
 */
 | 
			
		||||
#ifndef KHRONOS_MAX_ENUM
 | 
			
		||||
#define KHRONOS_MAX_ENUM 0x7FFFFFFF
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Enumerated boolean type
 | 
			
		||||
 *
 | 
			
		||||
 * Values other than zero should be considered to be true.  Therefore
 | 
			
		||||
 * comparisons should not be made against KHRONOS_TRUE.
 | 
			
		||||
 */
 | 
			
		||||
typedef enum {
 | 
			
		||||
    KHRONOS_FALSE = 0,
 | 
			
		||||
    KHRONOS_TRUE  = 1,
 | 
			
		||||
    KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
 | 
			
		||||
} khronos_boolean_enum_t;
 | 
			
		||||
 | 
			
		||||
#endif /* __khrplatform_h_ */
 | 
			
		||||
							
								
								
									
										3685
									
								
								cs440-acg/ext/nanogui/ext/glad/include/glad/glad.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3685
									
								
								cs440-acg/ext/nanogui/ext/glad/include/glad/glad.h
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										1701
									
								
								cs440-acg/ext/nanogui/ext/glad/src/glad.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1701
									
								
								cs440-acg/ext/nanogui/ext/glad/src/glad.c
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										23
									
								
								cs440-acg/ext/nanogui/ext/glfw/.appveyor.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								cs440-acg/ext/nanogui/ext/glfw/.appveyor.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,23 @@
 | 
			
		||||
branches:
 | 
			
		||||
    only:
 | 
			
		||||
        - ci
 | 
			
		||||
        - master
 | 
			
		||||
skip_tags: true
 | 
			
		||||
environment:
 | 
			
		||||
    CFLAGS: /WX
 | 
			
		||||
    matrix:
 | 
			
		||||
        - BUILD_SHARED_LIBS: ON
 | 
			
		||||
        - BUILD_SHARED_LIBS: OFF
 | 
			
		||||
matrix:
 | 
			
		||||
    fast_finish: true
 | 
			
		||||
build_script:
 | 
			
		||||
    - mkdir build
 | 
			
		||||
    - cd build
 | 
			
		||||
    - cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_SHARED_LIBS=%BUILD_SHARED_LIBS% ..
 | 
			
		||||
    - cmake --build .
 | 
			
		||||
notifications:
 | 
			
		||||
    - provider: Email
 | 
			
		||||
      to:
 | 
			
		||||
        - ci@glfw.org
 | 
			
		||||
      on_build_failure: true
 | 
			
		||||
      on_build_success: false
 | 
			
		||||
							
								
								
									
										5
									
								
								cs440-acg/ext/nanogui/ext/glfw/.gitattributes
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								cs440-acg/ext/nanogui/ext/glfw/.gitattributes
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
*.m linguist-language=Objective-C
 | 
			
		||||
.gitignore export-ignore
 | 
			
		||||
.gitattributes export-ignore
 | 
			
		||||
.travis.yml export-ignore
 | 
			
		||||
.appveyor.yml export-ignore
 | 
			
		||||
							
								
								
									
										89
									
								
								cs440-acg/ext/nanogui/ext/glfw/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										89
									
								
								cs440-acg/ext/nanogui/ext/glfw/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,89 @@
 | 
			
		||||
# External junk
 | 
			
		||||
.DS_Store
 | 
			
		||||
_ReSharper*
 | 
			
		||||
*.opensdf
 | 
			
		||||
*.sdf
 | 
			
		||||
*.suo
 | 
			
		||||
*.dir
 | 
			
		||||
*.vcxproj*
 | 
			
		||||
*.sln
 | 
			
		||||
.vs/
 | 
			
		||||
Win32
 | 
			
		||||
x64
 | 
			
		||||
Debug
 | 
			
		||||
Release
 | 
			
		||||
MinSizeRel
 | 
			
		||||
RelWithDebInfo
 | 
			
		||||
*.xcodeproj
 | 
			
		||||
 | 
			
		||||
# CMake files
 | 
			
		||||
Makefile
 | 
			
		||||
CMakeCache.txt
 | 
			
		||||
CMakeFiles
 | 
			
		||||
CMakeScripts
 | 
			
		||||
cmake_install.cmake
 | 
			
		||||
cmake_uninstall.cmake
 | 
			
		||||
 | 
			
		||||
# Generated files
 | 
			
		||||
docs/Doxyfile
 | 
			
		||||
docs/html
 | 
			
		||||
docs/warnings.txt
 | 
			
		||||
docs/doxygen_sqlite3.db
 | 
			
		||||
src/glfw_config.h
 | 
			
		||||
src/glfw3.pc
 | 
			
		||||
src/glfw3Config.cmake
 | 
			
		||||
src/glfw3ConfigVersion.cmake
 | 
			
		||||
src/wayland-pointer-constraints-unstable-v1-client-protocol.h
 | 
			
		||||
src/wayland-pointer-constraints-unstable-v1-protocol.c
 | 
			
		||||
src/wayland-relative-pointer-unstable-v1-client-protocol.h
 | 
			
		||||
src/wayland-relative-pointer-unstable-v1-protocol.c
 | 
			
		||||
 | 
			
		||||
# Compiled binaries
 | 
			
		||||
src/libglfw.so
 | 
			
		||||
src/libglfw.so.3
 | 
			
		||||
src/libglfw.so.3.3
 | 
			
		||||
src/libglfw.dylib
 | 
			
		||||
src/libglfw.dylib
 | 
			
		||||
src/libglfw.3.dylib
 | 
			
		||||
src/libglfw.3.3.dylib
 | 
			
		||||
src/libglfw3.a
 | 
			
		||||
src/glfw3.lib
 | 
			
		||||
src/glfw3.dll
 | 
			
		||||
src/glfw3dll.lib
 | 
			
		||||
src/libglfw3dll.a
 | 
			
		||||
examples/*.app
 | 
			
		||||
examples/*.exe
 | 
			
		||||
examples/boing
 | 
			
		||||
examples/gears
 | 
			
		||||
examples/heightmap
 | 
			
		||||
examples/offscreen
 | 
			
		||||
examples/particles
 | 
			
		||||
examples/splitview
 | 
			
		||||
examples/sharing
 | 
			
		||||
examples/simple
 | 
			
		||||
examples/wave
 | 
			
		||||
tests/*.app
 | 
			
		||||
tests/*.exe
 | 
			
		||||
tests/clipboard
 | 
			
		||||
tests/cursor
 | 
			
		||||
tests/empty
 | 
			
		||||
tests/events
 | 
			
		||||
tests/gamma
 | 
			
		||||
tests/glfwinfo
 | 
			
		||||
tests/icon
 | 
			
		||||
tests/iconify
 | 
			
		||||
tests/joysticks
 | 
			
		||||
tests/monitors
 | 
			
		||||
tests/msaa
 | 
			
		||||
tests/reopen
 | 
			
		||||
tests/tearing
 | 
			
		||||
tests/threads
 | 
			
		||||
tests/timeout
 | 
			
		||||
tests/title
 | 
			
		||||
tests/vulkan
 | 
			
		||||
tests/windows
 | 
			
		||||
 | 
			
		||||
# Ninja build system
 | 
			
		||||
.ninja_deps
 | 
			
		||||
.ninja_log
 | 
			
		||||
*.ninja
 | 
			
		||||
							
								
								
									
										78
									
								
								cs440-acg/ext/nanogui/ext/glfw/.travis.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										78
									
								
								cs440-acg/ext/nanogui/ext/glfw/.travis.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,78 @@
 | 
			
		||||
language: c
 | 
			
		||||
compiler: clang
 | 
			
		||||
branches:
 | 
			
		||||
    only:
 | 
			
		||||
        - ci
 | 
			
		||||
        - master
 | 
			
		||||
sudo: false
 | 
			
		||||
dist: trusty
 | 
			
		||||
addons:
 | 
			
		||||
    apt:
 | 
			
		||||
        packages:
 | 
			
		||||
            - cmake
 | 
			
		||||
            - libxrandr-dev
 | 
			
		||||
            - libxinerama-dev
 | 
			
		||||
            - libxcursor-dev
 | 
			
		||||
            - libxi-dev
 | 
			
		||||
matrix:
 | 
			
		||||
    include:
 | 
			
		||||
        - os: linux
 | 
			
		||||
          env:
 | 
			
		||||
              - BUILD_SHARED_LIBS=ON
 | 
			
		||||
              - CFLAGS=-Werror
 | 
			
		||||
        - os: linux
 | 
			
		||||
          env:
 | 
			
		||||
              - BUILD_SHARED_LIBS=OFF
 | 
			
		||||
              - CFLAGS=-Werror
 | 
			
		||||
        - os: linux
 | 
			
		||||
          sudo: required
 | 
			
		||||
          addons:
 | 
			
		||||
              apt:
 | 
			
		||||
                  packages:
 | 
			
		||||
                      - libwayland-dev
 | 
			
		||||
                      - libxkbcommon-dev
 | 
			
		||||
                      - libegl1-mesa-dev
 | 
			
		||||
          env:
 | 
			
		||||
              - USE_WAYLAND=ON
 | 
			
		||||
              - BUILD_SHARED_LIBS=ON
 | 
			
		||||
              - CFLAGS=-Werror
 | 
			
		||||
        - os: linux
 | 
			
		||||
          sudo: required
 | 
			
		||||
          addons:
 | 
			
		||||
              apt:
 | 
			
		||||
                  packages:
 | 
			
		||||
                      - libwayland-dev
 | 
			
		||||
                      - libxkbcommon-dev
 | 
			
		||||
                      - libegl1-mesa-dev
 | 
			
		||||
          env:
 | 
			
		||||
              - USE_WAYLAND=ON
 | 
			
		||||
              - BUILD_SHARED_LIBS=OFF
 | 
			
		||||
              - CFLAGS=-Werror
 | 
			
		||||
        - os: osx
 | 
			
		||||
          env:
 | 
			
		||||
              - BUILD_SHARED_LIBS=ON
 | 
			
		||||
              - CFLAGS=-Werror
 | 
			
		||||
        - os: osx
 | 
			
		||||
          env:
 | 
			
		||||
              - BUILD_SHARED_LIBS=OFF
 | 
			
		||||
              - CFLAGS=-Werror
 | 
			
		||||
script:
 | 
			
		||||
    - if grep -Inr '\s$' src include docs tests examples CMake *.md .gitattributes .gitignore; then echo Trailing whitespace found, aborting.; exit 1; fi
 | 
			
		||||
    - mkdir build
 | 
			
		||||
    - cd build
 | 
			
		||||
    - if test -n "${USE_WAYLAND}";
 | 
			
		||||
          then wget https://mirrors.kernel.org/ubuntu/pool/universe/e/extra-cmake-modules/extra-cmake-modules_5.38.0a-0ubuntu1_amd64.deb;
 | 
			
		||||
          sudo dpkg -i extra-cmake-modules_5.38.0a-0ubuntu1_amd64.deb;
 | 
			
		||||
          git clone git://anongit.freedesktop.org/wayland/wayland-protocols;
 | 
			
		||||
          pushd wayland-protocols;
 | 
			
		||||
          git checkout 1.15 && ./autogen.sh --prefix=/usr && make && sudo make install;
 | 
			
		||||
          popd;
 | 
			
		||||
      fi
 | 
			
		||||
    - cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} -DGLFW_USE_WAYLAND=${USE_WAYLAND} ..
 | 
			
		||||
    - cmake --build .
 | 
			
		||||
notifications:
 | 
			
		||||
    email:
 | 
			
		||||
        recipients:
 | 
			
		||||
            - ci@glfw.org
 | 
			
		||||
    on_success: never
 | 
			
		||||
    on_failure: always
 | 
			
		||||
@@ -0,0 +1,38 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 | 
			
		||||
<plist version="1.0">
 | 
			
		||||
<dict>
 | 
			
		||||
	<key>CFBundleDevelopmentRegion</key>
 | 
			
		||||
	<string>English</string>
 | 
			
		||||
	<key>CFBundleExecutable</key>
 | 
			
		||||
	<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
 | 
			
		||||
	<key>CFBundleGetInfoString</key>
 | 
			
		||||
	<string>${MACOSX_BUNDLE_INFO_STRING}</string>
 | 
			
		||||
	<key>CFBundleIconFile</key>
 | 
			
		||||
	<string>${MACOSX_BUNDLE_ICON_FILE}</string>
 | 
			
		||||
	<key>CFBundleIdentifier</key>
 | 
			
		||||
	<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
 | 
			
		||||
	<key>CFBundleInfoDictionaryVersion</key>
 | 
			
		||||
	<string>6.0</string>
 | 
			
		||||
	<key>CFBundleLongVersionString</key>
 | 
			
		||||
	<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
 | 
			
		||||
	<key>CFBundleName</key>
 | 
			
		||||
	<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
 | 
			
		||||
	<key>CFBundlePackageType</key>
 | 
			
		||||
	<string>APPL</string>
 | 
			
		||||
	<key>CFBundleShortVersionString</key>
 | 
			
		||||
	<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
 | 
			
		||||
	<key>CFBundleSignature</key>
 | 
			
		||||
	<string>????</string>
 | 
			
		||||
	<key>CFBundleVersion</key>
 | 
			
		||||
	<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
 | 
			
		||||
	<key>CSResourcesFileMapped</key>
 | 
			
		||||
	<true/>
 | 
			
		||||
	<key>LSRequiresCarbon</key>
 | 
			
		||||
	<true/>
 | 
			
		||||
	<key>NSHumanReadableCopyright</key>
 | 
			
		||||
	<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
 | 
			
		||||
	<key>NSHighResolutionCapable</key>
 | 
			
		||||
	<true/>
 | 
			
		||||
</dict>
 | 
			
		||||
</plist>
 | 
			
		||||
							
								
								
									
										380
									
								
								cs440-acg/ext/nanogui/ext/glfw/CMakeLists.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										380
									
								
								cs440-acg/ext/nanogui/ext/glfw/CMakeLists.txt
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,380 @@
 | 
			
		||||
cmake_minimum_required (VERSION 3.13..3.18)
 | 
			
		||||
 | 
			
		||||
project(GLFW C)
 | 
			
		||||
 | 
			
		||||
set(CMAKE_LEGACY_CYGWIN_WIN32 OFF)
 | 
			
		||||
 | 
			
		||||
if (POLICY CMP0054)
 | 
			
		||||
    cmake_policy(SET CMP0054 NEW)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if(POLICY CMP0022)
 | 
			
		||||
  cmake_policy(SET CMP0022 NEW)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
set(GLFW_VERSION_MAJOR "3")
 | 
			
		||||
set(GLFW_VERSION_MINOR "3")
 | 
			
		||||
set(GLFW_VERSION_PATCH "1")
 | 
			
		||||
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_property(GLOBAL PROPERTY USE_FOLDERS ON)
 | 
			
		||||
 | 
			
		||||
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
 | 
			
		||||
option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" ON)
 | 
			
		||||
option(GLFW_BUILD_TESTS "Build the GLFW test programs" ON)
 | 
			
		||||
option(GLFW_BUILD_DOCS "Build the GLFW documentation" ON)
 | 
			
		||||
option(GLFW_INSTALL "Generate installation target" ON)
 | 
			
		||||
option(GLFW_VULKAN_STATIC "Assume the Vulkan loader is linked with the application" OFF)
 | 
			
		||||
 | 
			
		||||
include(GNUInstallDirs)
 | 
			
		||||
 | 
			
		||||
if (UNIX)
 | 
			
		||||
    option(GLFW_USE_OSMESA "Use OSMesa for offscreen context creation" OFF)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (WIN32)
 | 
			
		||||
    option(GLFW_USE_HYBRID_HPG "Force use of high-performance GPU on hybrid systems" OFF)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (UNIX AND NOT APPLE)
 | 
			
		||||
    option(GLFW_USE_WAYLAND "Use Wayland for window creation" OFF)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (MSVC)
 | 
			
		||||
    option(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC runtime library DLL" ON)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (BUILD_SHARED_LIBS)
 | 
			
		||||
    set(_GLFW_BUILD_DLL 1)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (BUILD_SHARED_LIBS AND UNIX)
 | 
			
		||||
    # On Unix-like systems, shared libraries can use the soname system.
 | 
			
		||||
    set(GLFW_LIB_NAME glfw)
 | 
			
		||||
else()
 | 
			
		||||
    set(GLFW_LIB_NAME glfw3)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (GLFW_VULKAN_STATIC)
 | 
			
		||||
    if (BUILD_SHARED_LIBS)
 | 
			
		||||
        # If you absolutely must do this, remove this line and add the Vulkan
 | 
			
		||||
        # loader static library via the CMAKE_SHARED_LINKER_FLAGS
 | 
			
		||||
        message(FATAL_ERROR "You are trying to link the Vulkan loader static library into the GLFW shared library")
 | 
			
		||||
    endif()
 | 
			
		||||
    set(_GLFW_VULKAN_STATIC 1)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
list(APPEND CMAKE_MODULE_PATH "${GLFW_SOURCE_DIR}/CMake/modules")
 | 
			
		||||
 | 
			
		||||
if (GLFW_BUILD_DOCS)
 | 
			
		||||
    set(DOXYGEN_SKIP_DOT TRUE)
 | 
			
		||||
    find_package(Doxygen)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
#--------------------------------------------------------------------
 | 
			
		||||
# Set compiler specific flags
 | 
			
		||||
#--------------------------------------------------------------------
 | 
			
		||||
if (MSVC)
 | 
			
		||||
    if (MSVC90)
 | 
			
		||||
        # Workaround for VS 2008 not shipping with the DirectX 9 SDK
 | 
			
		||||
        include(CheckIncludeFile)
 | 
			
		||||
        check_include_file(dinput.h DINPUT_H_FOUND)
 | 
			
		||||
        if (NOT DINPUT_H_FOUND)
 | 
			
		||||
            message(FATAL_ERROR "DirectX 9 SDK not found")
 | 
			
		||||
        endif()
 | 
			
		||||
        # Workaround for VS 2008 not shipping with stdint.h
 | 
			
		||||
        list(APPEND glfw_INCLUDE_DIRS "${GLFW_SOURCE_DIR}/deps/vs2008")
 | 
			
		||||
    endif()
 | 
			
		||||
 | 
			
		||||
    if (NOT USE_MSVC_RUNTIME_LIBRARY_DLL)
 | 
			
		||||
        foreach (flag CMAKE_C_FLAGS
 | 
			
		||||
                      CMAKE_C_FLAGS_DEBUG
 | 
			
		||||
                      CMAKE_C_FLAGS_RELEASE
 | 
			
		||||
                      CMAKE_C_FLAGS_MINSIZEREL
 | 
			
		||||
                      CMAKE_C_FLAGS_RELWITHDEBINFO)
 | 
			
		||||
 | 
			
		||||
            if (${flag} MATCHES "/MD")
 | 
			
		||||
                string(REGEX REPLACE "/MD" "/MT" ${flag} "${${flag}}")
 | 
			
		||||
            endif()
 | 
			
		||||
            if (${flag} MATCHES "/MDd")
 | 
			
		||||
                string(REGEX REPLACE "/MDd" "/MTd" ${flag} "${${flag}}")
 | 
			
		||||
            endif()
 | 
			
		||||
 | 
			
		||||
        endforeach()
 | 
			
		||||
    endif()
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (MINGW)
 | 
			
		||||
    # Workaround for legacy MinGW not providing XInput and DirectInput
 | 
			
		||||
    include(CheckIncludeFile)
 | 
			
		||||
 | 
			
		||||
    check_include_file(dinput.h DINPUT_H_FOUND)
 | 
			
		||||
    check_include_file(xinput.h XINPUT_H_FOUND)
 | 
			
		||||
    if (NOT DINPUT_H_FOUND OR NOT XINPUT_H_FOUND)
 | 
			
		||||
        list(APPEND glfw_INCLUDE_DIRS "${GLFW_SOURCE_DIR}/deps/mingw")
 | 
			
		||||
    endif()
 | 
			
		||||
 | 
			
		||||
    # Enable link-time exploit mitigation features enabled by default on MSVC
 | 
			
		||||
    include(CheckCCompilerFlag)
 | 
			
		||||
 | 
			
		||||
    # Compatibility with data execution prevention (DEP)
 | 
			
		||||
    set(CMAKE_REQUIRED_FLAGS "-Wl,--nxcompat")
 | 
			
		||||
    check_c_compiler_flag("" _GLFW_HAS_DEP)
 | 
			
		||||
    if (_GLFW_HAS_DEP)
 | 
			
		||||
        set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--nxcompat ${CMAKE_SHARED_LINKER_FLAGS}")
 | 
			
		||||
    endif()
 | 
			
		||||
 | 
			
		||||
    # Compatibility with address space layout randomization (ASLR)
 | 
			
		||||
    set(CMAKE_REQUIRED_FLAGS "-Wl,--dynamicbase")
 | 
			
		||||
    check_c_compiler_flag("" _GLFW_HAS_ASLR)
 | 
			
		||||
    if (_GLFW_HAS_ASLR)
 | 
			
		||||
        set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--dynamicbase ${CMAKE_SHARED_LINKER_FLAGS}")
 | 
			
		||||
    endif()
 | 
			
		||||
 | 
			
		||||
    # Compatibility with 64-bit address space layout randomization (ASLR)
 | 
			
		||||
    set(CMAKE_REQUIRED_FLAGS "-Wl,--high-entropy-va")
 | 
			
		||||
    check_c_compiler_flag("" _GLFW_HAS_64ASLR)
 | 
			
		||||
    if (_GLFW_HAS_64ASLR)
 | 
			
		||||
        set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--high-entropy-va ${CMAKE_SHARED_LINKER_FLAGS}")
 | 
			
		||||
    endif()
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
#--------------------------------------------------------------------
 | 
			
		||||
# Detect and select backend APIs
 | 
			
		||||
#--------------------------------------------------------------------
 | 
			
		||||
if (GLFW_USE_WAYLAND)
 | 
			
		||||
    set(_GLFW_WAYLAND 1)
 | 
			
		||||
    message(STATUS "Using Wayland for window creation")
 | 
			
		||||
elseif (GLFW_USE_OSMESA)
 | 
			
		||||
    set(_GLFW_OSMESA 1)
 | 
			
		||||
    message(STATUS "Using OSMesa for headless context creation")
 | 
			
		||||
elseif (WIN32)
 | 
			
		||||
    set(_GLFW_WIN32 1)
 | 
			
		||||
    message(STATUS "Using Win32 for window creation")
 | 
			
		||||
elseif (APPLE)
 | 
			
		||||
    set(_GLFW_COCOA 1)
 | 
			
		||||
    message(STATUS "Using Cocoa for window creation")
 | 
			
		||||
elseif (UNIX)
 | 
			
		||||
    set(_GLFW_X11 1)
 | 
			
		||||
    message(STATUS "Using X11 for window creation")
 | 
			
		||||
else()
 | 
			
		||||
    message(FATAL_ERROR "No supported platform was detected")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
#--------------------------------------------------------------------
 | 
			
		||||
# Find and add Unix math and time libraries
 | 
			
		||||
#--------------------------------------------------------------------
 | 
			
		||||
if (UNIX AND NOT APPLE)
 | 
			
		||||
    find_library(RT_LIBRARY rt)
 | 
			
		||||
    mark_as_advanced(RT_LIBRARY)
 | 
			
		||||
    if (RT_LIBRARY)
 | 
			
		||||
        list(APPEND glfw_LIBRARIES "${RT_LIBRARY}")
 | 
			
		||||
        list(APPEND glfw_PKG_LIBS "-lrt")
 | 
			
		||||
    endif()
 | 
			
		||||
 | 
			
		||||
    find_library(MATH_LIBRARY m)
 | 
			
		||||
    mark_as_advanced(MATH_LIBRARY)
 | 
			
		||||
    if (MATH_LIBRARY)
 | 
			
		||||
        list(APPEND glfw_LIBRARIES "${MATH_LIBRARY}")
 | 
			
		||||
        list(APPEND glfw_PKG_LIBS "-lm")
 | 
			
		||||
    endif()
 | 
			
		||||
 | 
			
		||||
    if (CMAKE_DL_LIBS)
 | 
			
		||||
        list(APPEND glfw_LIBRARIES "${CMAKE_DL_LIBS}")
 | 
			
		||||
        list(APPEND glfw_PKG_LIBS "-l${CMAKE_DL_LIBS}")
 | 
			
		||||
    endif()
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
#--------------------------------------------------------------------
 | 
			
		||||
# Use Win32 for window creation
 | 
			
		||||
#--------------------------------------------------------------------
 | 
			
		||||
if (_GLFW_WIN32)
 | 
			
		||||
 | 
			
		||||
    list(APPEND glfw_PKG_LIBS "-lgdi32")
 | 
			
		||||
 | 
			
		||||
    if (GLFW_USE_HYBRID_HPG)
 | 
			
		||||
        set(_GLFW_USE_HYBRID_HPG 1)
 | 
			
		||||
    endif()
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
#--------------------------------------------------------------------
 | 
			
		||||
# Use X11 for window creation
 | 
			
		||||
#--------------------------------------------------------------------
 | 
			
		||||
if (_GLFW_X11)
 | 
			
		||||
 | 
			
		||||
    find_package(X11 REQUIRED)
 | 
			
		||||
 | 
			
		||||
    list(APPEND glfw_PKG_DEPS "x11")
 | 
			
		||||
 | 
			
		||||
    # Set up library and include paths
 | 
			
		||||
    list(APPEND glfw_INCLUDE_DIRS "${X11_X11_INCLUDE_PATH}")
 | 
			
		||||
    list(APPEND glfw_LIBRARIES "${X11_X11_LIB}" "${CMAKE_THREAD_LIBS_INIT}")
 | 
			
		||||
 | 
			
		||||
    # Check for XRandR (modern resolution switching and gamma control)
 | 
			
		||||
    if (NOT X11_Xrandr_FOUND)
 | 
			
		||||
        message(FATAL_ERROR "The RandR headers were not found")
 | 
			
		||||
    endif()
 | 
			
		||||
 | 
			
		||||
    # Check for Xinerama (legacy multi-monitor support)
 | 
			
		||||
    if (NOT X11_Xinerama_FOUND)
 | 
			
		||||
        message(FATAL_ERROR "The Xinerama headers were not found")
 | 
			
		||||
    endif()
 | 
			
		||||
 | 
			
		||||
    # Check for Xkb (X keyboard extension)
 | 
			
		||||
    if (NOT X11_Xkb_FOUND)
 | 
			
		||||
        message(FATAL_ERROR "The X keyboard extension headers were not found")
 | 
			
		||||
    endif()
 | 
			
		||||
 | 
			
		||||
    # Check for Xcursor (cursor creation from RGBA images)
 | 
			
		||||
    if (NOT X11_Xcursor_FOUND)
 | 
			
		||||
        message(FATAL_ERROR "The Xcursor headers were not found")
 | 
			
		||||
    endif()
 | 
			
		||||
 | 
			
		||||
    list(APPEND glfw_INCLUDE_DIRS "${X11_Xrandr_INCLUDE_PATH}"
 | 
			
		||||
                                  "${X11_Xinerama_INCLUDE_PATH}"
 | 
			
		||||
                                  "${X11_Xkb_INCLUDE_PATH}"
 | 
			
		||||
                                  "${X11_Xcursor_INCLUDE_PATH}")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
#--------------------------------------------------------------------
 | 
			
		||||
# Use Wayland for window creation
 | 
			
		||||
#--------------------------------------------------------------------
 | 
			
		||||
if (_GLFW_WAYLAND)
 | 
			
		||||
    find_package(ECM REQUIRED NO_MODULE)
 | 
			
		||||
    list(APPEND CMAKE_MODULE_PATH "${ECM_MODULE_PATH}")
 | 
			
		||||
 | 
			
		||||
    find_package(Wayland REQUIRED Client Cursor Egl)
 | 
			
		||||
    find_package(WaylandScanner REQUIRED)
 | 
			
		||||
    find_package(WaylandProtocols 1.15 REQUIRED)
 | 
			
		||||
 | 
			
		||||
    list(APPEND glfw_PKG_DEPS "wayland-egl")
 | 
			
		||||
 | 
			
		||||
    list(APPEND glfw_INCLUDE_DIRS "${Wayland_INCLUDE_DIRS}")
 | 
			
		||||
    list(APPEND glfw_LIBRARIES "${Wayland_LIBRARIES}" "${CMAKE_THREAD_LIBS_INIT}")
 | 
			
		||||
 | 
			
		||||
    find_package(XKBCommon REQUIRED)
 | 
			
		||||
    list(APPEND glfw_INCLUDE_DIRS "${XKBCOMMON_INCLUDE_DIRS}")
 | 
			
		||||
 | 
			
		||||
    include(CheckIncludeFiles)
 | 
			
		||||
    include(CheckFunctionExists)
 | 
			
		||||
    check_include_files(xkbcommon/xkbcommon-compose.h HAVE_XKBCOMMON_COMPOSE_H)
 | 
			
		||||
    check_function_exists(memfd_create HAVE_MEMFD_CREATE)
 | 
			
		||||
 | 
			
		||||
    if (NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux"))
 | 
			
		||||
        find_package(EpollShim)
 | 
			
		||||
        if (EPOLLSHIM_FOUND)
 | 
			
		||||
            list(APPEND glfw_INCLUDE_DIRS "${EPOLLSHIM_INCLUDE_DIRS}")
 | 
			
		||||
            list(APPEND glfw_LIBRARIES "${EPOLLSHIM_LIBRARIES}")
 | 
			
		||||
        endif()
 | 
			
		||||
    endif()
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
#--------------------------------------------------------------------
 | 
			
		||||
# Use OSMesa for offscreen context creation
 | 
			
		||||
#--------------------------------------------------------------------
 | 
			
		||||
if (_GLFW_OSMESA)
 | 
			
		||||
    find_package(OSMesa REQUIRED)
 | 
			
		||||
    list(APPEND glfw_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
#--------------------------------------------------------------------
 | 
			
		||||
# Use Cocoa for window creation and NSOpenGL for context creation
 | 
			
		||||
#--------------------------------------------------------------------
 | 
			
		||||
if (_GLFW_COCOA)
 | 
			
		||||
 | 
			
		||||
    list(APPEND glfw_LIBRARIES
 | 
			
		||||
        "-framework Cocoa"
 | 
			
		||||
        "-framework IOKit"
 | 
			
		||||
        "-framework CoreFoundation"
 | 
			
		||||
        "-framework CoreVideo")
 | 
			
		||||
 | 
			
		||||
    set(glfw_PKG_DEPS "")
 | 
			
		||||
    set(glfw_PKG_LIBS "-framework Cocoa -framework IOKit -framework CoreFoundation -framework CoreVideo")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
#--------------------------------------------------------------------
 | 
			
		||||
# Add the Vulkan loader as a dependency if necessary
 | 
			
		||||
#--------------------------------------------------------------------
 | 
			
		||||
if (GLFW_VULKAN_STATIC)
 | 
			
		||||
    list(APPEND glfw_PKG_DEPS "vulkan")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
#--------------------------------------------------------------------
 | 
			
		||||
# Export GLFW library dependencies
 | 
			
		||||
#--------------------------------------------------------------------
 | 
			
		||||
foreach(arg ${glfw_PKG_DEPS})
 | 
			
		||||
    set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} ${arg}")
 | 
			
		||||
endforeach()
 | 
			
		||||
foreach(arg ${glfw_PKG_LIBS})
 | 
			
		||||
    set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} ${arg}")
 | 
			
		||||
endforeach()
 | 
			
		||||
 | 
			
		||||
#--------------------------------------------------------------------
 | 
			
		||||
# Create generated files
 | 
			
		||||
#--------------------------------------------------------------------
 | 
			
		||||
include(CMakePackageConfigHelpers)
 | 
			
		||||
 | 
			
		||||
set(GLFW_CONFIG_PATH "${CMAKE_INSTALL_LIBDIR}/cmake/glfw3")
 | 
			
		||||
 | 
			
		||||
configure_package_config_file(src/glfw3Config.cmake.in
 | 
			
		||||
                              src/glfw3Config.cmake
 | 
			
		||||
                              INSTALL_DESTINATION "${GLFW_CONFIG_PATH}"
 | 
			
		||||
                              NO_CHECK_REQUIRED_COMPONENTS_MACRO)
 | 
			
		||||
 | 
			
		||||
write_basic_package_version_file(src/glfw3ConfigVersion.cmake
 | 
			
		||||
                                 VERSION ${GLFW_VERSION_FULL}
 | 
			
		||||
                                 COMPATIBILITY SameMajorVersion)
 | 
			
		||||
 | 
			
		||||
configure_file(src/glfw_config.h.in src/glfw_config.h @ONLY)
 | 
			
		||||
 | 
			
		||||
configure_file(src/glfw3.pc.in src/glfw3.pc @ONLY)
 | 
			
		||||
 | 
			
		||||
#--------------------------------------------------------------------
 | 
			
		||||
# Add subdirectories
 | 
			
		||||
#--------------------------------------------------------------------
 | 
			
		||||
add_subdirectory(src)
 | 
			
		||||
 | 
			
		||||
if (GLFW_BUILD_EXAMPLES)
 | 
			
		||||
    add_subdirectory(examples)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (GLFW_BUILD_TESTS)
 | 
			
		||||
    add_subdirectory(tests)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (DOXYGEN_FOUND AND GLFW_BUILD_DOCS)
 | 
			
		||||
    add_subdirectory(docs)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
#--------------------------------------------------------------------
 | 
			
		||||
# Install files other than the library
 | 
			
		||||
# The library is installed by src/CMakeLists.txt
 | 
			
		||||
#--------------------------------------------------------------------
 | 
			
		||||
if (GLFW_INSTALL)
 | 
			
		||||
    install(DIRECTORY include/GLFW DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
 | 
			
		||||
            FILES_MATCHING PATTERN glfw3.h PATTERN glfw3native.h)
 | 
			
		||||
 | 
			
		||||
    install(FILES "${GLFW_BINARY_DIR}/src/glfw3Config.cmake"
 | 
			
		||||
                  "${GLFW_BINARY_DIR}/src/glfw3ConfigVersion.cmake"
 | 
			
		||||
            DESTINATION "${GLFW_CONFIG_PATH}")
 | 
			
		||||
 | 
			
		||||
    install(EXPORT glfwTargets FILE glfw3Targets.cmake
 | 
			
		||||
            EXPORT_LINK_INTERFACE_LIBRARIES
 | 
			
		||||
            DESTINATION "${GLFW_CONFIG_PATH}")
 | 
			
		||||
    install(FILES "${GLFW_BINARY_DIR}/src/glfw3.pc"
 | 
			
		||||
            DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
 | 
			
		||||
 | 
			
		||||
    # Only generate this target if no higher-level project already has
 | 
			
		||||
    if (NOT TARGET uninstall)
 | 
			
		||||
        configure_file(cmake_uninstall.cmake.in
 | 
			
		||||
                       cmake_uninstall.cmake IMMEDIATE @ONLY)
 | 
			
		||||
 | 
			
		||||
        add_custom_target(uninstall
 | 
			
		||||
                          "${CMAKE_COMMAND}" -P
 | 
			
		||||
                          "${GLFW_BINARY_DIR}/cmake_uninstall.cmake")
 | 
			
		||||
        set_target_properties(uninstall PROPERTIES FOLDER "GLFW3")
 | 
			
		||||
    endif()
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										22
									
								
								cs440-acg/ext/nanogui/ext/glfw/LICENSE.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								cs440-acg/ext/nanogui/ext/glfw/LICENSE.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,22 @@
 | 
			
		||||
Copyright (c) 2002-2006 Marcus Geelnard
 | 
			
		||||
Copyright (c) 2006-2016 Camilla Löwy <elmindreda@glfw.org>
 | 
			
		||||
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										318
									
								
								cs440-acg/ext/nanogui/ext/glfw/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										318
									
								
								cs440-acg/ext/nanogui/ext/glfw/README.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,318 @@
 | 
			
		||||
# GLFW
 | 
			
		||||
 | 
			
		||||
[](https://travis-ci.org/glfw/glfw)
 | 
			
		||||
[](https://ci.appveyor.com/project/elmindreda/glfw)
 | 
			
		||||
[](https://scan.coverity.com/projects/glfw-glfw)
 | 
			
		||||
 | 
			
		||||
## Introduction
 | 
			
		||||
 | 
			
		||||
GLFW is an Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan
 | 
			
		||||
application development.  It provides a simple, platform-independent API for
 | 
			
		||||
creating windows, contexts and surfaces, reading input, handling events, etc.
 | 
			
		||||
 | 
			
		||||
GLFW natively supports Windows, macOS and Linux and other Unix-like systems.  On
 | 
			
		||||
Linux both X11 and Wayland is supported.
 | 
			
		||||
 | 
			
		||||
GLFW is licensed under the [zlib/libpng
 | 
			
		||||
license](http://www.glfw.org/license.html).
 | 
			
		||||
 | 
			
		||||
You can [download](http://www.glfw.org/download.html) the latest stable release
 | 
			
		||||
as source or Windows binaries, or fetch the `latest` branch from GitHub.  Each
 | 
			
		||||
release starting with 3.0 also has a corresponding [annotated
 | 
			
		||||
tag](https://github.com/glfw/glfw/releases) with source and binary archives.
 | 
			
		||||
 | 
			
		||||
The [documentation](http://www.glfw.org/docs/latest/) is available online and is
 | 
			
		||||
included in all source and binary archives.  See the [release
 | 
			
		||||
notes](https://www.glfw.org/docs/latest/news.html) for new features, caveats and
 | 
			
		||||
deprecations in the latest release.  For more details see the [version
 | 
			
		||||
history](http://www.glfw.org/changelog.html).
 | 
			
		||||
 | 
			
		||||
The `master` branch is the stable integration branch and _should_ always compile
 | 
			
		||||
and run on all supported platforms, although details of newly added features may
 | 
			
		||||
change until they have been included in a release.  New features and many bug
 | 
			
		||||
fixes live in [other branches](https://github.com/glfw/glfw/branches/all) until
 | 
			
		||||
they are stable enough to merge.
 | 
			
		||||
 | 
			
		||||
If you are new to GLFW, you may find the
 | 
			
		||||
[tutorial](http://www.glfw.org/docs/latest/quick.html) for GLFW 3 useful.  If
 | 
			
		||||
you have used GLFW 2 in the past, there is a [transition
 | 
			
		||||
guide](http://www.glfw.org/docs/latest/moving.html) for moving to the GLFW
 | 
			
		||||
3 API.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## Compiling GLFW
 | 
			
		||||
 | 
			
		||||
GLFW itself requires only the headers and libraries for your OS and window
 | 
			
		||||
system.  It does not need the headers for any context creation API (WGL, GLX,
 | 
			
		||||
EGL, NSGL, OSMesa) or rendering API (OpenGL, OpenGL ES, Vulkan) to enable
 | 
			
		||||
support for them.
 | 
			
		||||
 | 
			
		||||
GLFW supports compilation on Windows with Visual C++ 2010 and later, MinGW and
 | 
			
		||||
MinGW-w64, on macOS with Clang and on Linux and other Unix-like systems with GCC
 | 
			
		||||
and Clang.  It will likely compile in other environments as well, but this is
 | 
			
		||||
not regularly tested.
 | 
			
		||||
 | 
			
		||||
There are [pre-compiled Windows binaries](http://www.glfw.org/download.html)
 | 
			
		||||
available for all supported compilers.
 | 
			
		||||
 | 
			
		||||
See the [compilation guide](http://www.glfw.org/docs/latest/compile.html) for
 | 
			
		||||
more information about how to compile GLFW yourself.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## Using GLFW
 | 
			
		||||
 | 
			
		||||
See the [documentation](http://www.glfw.org/docs/latest/) for tutorials, guides
 | 
			
		||||
and the API reference.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## Contributing to GLFW
 | 
			
		||||
 | 
			
		||||
See the [contribution
 | 
			
		||||
guide](https://github.com/glfw/glfw/blob/master/docs/CONTRIBUTING.md) for
 | 
			
		||||
more information.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## System requirements
 | 
			
		||||
 | 
			
		||||
GLFW supports Windows XP and later and macOS 10.8 and later.  Linux and other
 | 
			
		||||
Unix-like systems running the X Window System are supported even without
 | 
			
		||||
a desktop environment or modern extensions, although some features require
 | 
			
		||||
a running window or clipboard manager.  The OSMesa backend requires Mesa 6.3.
 | 
			
		||||
 | 
			
		||||
See the [compatibility guide](http://www.glfw.org/docs/latest/compat.html)
 | 
			
		||||
in the documentation for more information.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## Dependencies
 | 
			
		||||
 | 
			
		||||
GLFW itself depends only on the headers and libraries for your window system.
 | 
			
		||||
 | 
			
		||||
The (experimental) Wayland backend also depends on the `extra-cmake-modules`
 | 
			
		||||
package, which is used to generated Wayland protocol headers.
 | 
			
		||||
 | 
			
		||||
The examples and test programs depend on a number of tiny libraries.  These are
 | 
			
		||||
located in the `deps/` directory.
 | 
			
		||||
 | 
			
		||||
 - [getopt\_port](https://github.com/kimgr/getopt_port/) for examples
 | 
			
		||||
   with command-line options
 | 
			
		||||
 - [TinyCThread](https://github.com/tinycthread/tinycthread) for threaded
 | 
			
		||||
   examples
 | 
			
		||||
 - [glad2](https://github.com/Dav1dde/glad) for loading OpenGL and Vulkan
 | 
			
		||||
   functions
 | 
			
		||||
 - [linmath.h](https://github.com/datenwolf/linmath.h) for linear algebra in
 | 
			
		||||
   examples
 | 
			
		||||
 - [Nuklear](https://github.com/vurtun/nuklear) for test and example UI
 | 
			
		||||
 - [stb\_image\_write](https://github.com/nothings/stb) for writing images to disk
 | 
			
		||||
 | 
			
		||||
The documentation is generated with [Doxygen](http://doxygen.org/) if CMake can
 | 
			
		||||
find that tool.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## Reporting bugs
 | 
			
		||||
 | 
			
		||||
Bugs are reported to our [issue tracker](https://github.com/glfw/glfw/issues).
 | 
			
		||||
Please check the [contribution
 | 
			
		||||
guide](https://github.com/glfw/glfw/blob/master/docs/CONTRIBUTING.md) for
 | 
			
		||||
information on what to include when reporting a bug.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## Changelog
 | 
			
		||||
 | 
			
		||||
User-visible changes since the last release.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## Contact
 | 
			
		||||
 | 
			
		||||
On [glfw.org](http://www.glfw.org/) you can find the latest version of GLFW, as
 | 
			
		||||
well as news, documentation and other information about the project.
 | 
			
		||||
 | 
			
		||||
If you have questions related to the use of GLFW, we have a
 | 
			
		||||
[forum](http://discourse.glfw.org/), and the `#glfw` IRC channel on
 | 
			
		||||
[Freenode](http://freenode.net/).
 | 
			
		||||
 | 
			
		||||
If you have a bug to report, a patch to submit or a feature you'd like to
 | 
			
		||||
request, please file it in the
 | 
			
		||||
[issue tracker](https://github.com/glfw/glfw/issues) on GitHub.
 | 
			
		||||
 | 
			
		||||
Finally, if you're interested in helping out with the development of GLFW or
 | 
			
		||||
porting it to your favorite platform, join us on the forum, GitHub or IRC.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## Acknowledgements
 | 
			
		||||
 | 
			
		||||
GLFW exists because people around the world donated their time and lent their
 | 
			
		||||
skills.
 | 
			
		||||
 | 
			
		||||
 - Bobyshev Alexander
 | 
			
		||||
 - Matt Arsenault
 | 
			
		||||
 - David Avedissian
 | 
			
		||||
 - Keith Bauer
 | 
			
		||||
 - John Bartholomew
 | 
			
		||||
 - Coşku Baş
 | 
			
		||||
 - Niklas Behrens
 | 
			
		||||
 - Andrew Belt
 | 
			
		||||
 - Niklas Bergström
 | 
			
		||||
 - Denis Bernard
 | 
			
		||||
 - Doug Binks
 | 
			
		||||
 - blanco
 | 
			
		||||
 - Kyle Brenneman
 | 
			
		||||
 - Rok Breulj
 | 
			
		||||
 - Martin Capitanio
 | 
			
		||||
 - David Carlier
 | 
			
		||||
 - Arturo Castro
 | 
			
		||||
 - Chi-kwan Chan
 | 
			
		||||
 - Ian Clarkson
 | 
			
		||||
 - Michał Cichoń
 | 
			
		||||
 - Lambert Clara
 | 
			
		||||
 - Anna Clarke
 | 
			
		||||
 - Yaron Cohen-Tal
 | 
			
		||||
 - Omar Cornut
 | 
			
		||||
 - Andrew Corrigan
 | 
			
		||||
 - Bailey Cosier
 | 
			
		||||
 - Noel Cower
 | 
			
		||||
 - Jason Daly
 | 
			
		||||
 - Jarrod Davis
 | 
			
		||||
 - Olivier Delannoy
 | 
			
		||||
 - Paul R. Deppe
 | 
			
		||||
 - Michael Dickens
 | 
			
		||||
 - Роман Донченко
 | 
			
		||||
 - Mario Dorn
 | 
			
		||||
 - Wolfgang Draxinger
 | 
			
		||||
 - Jonathan Dummer
 | 
			
		||||
 - Ralph Eastwood
 | 
			
		||||
 - Fredrik Ehnbom
 | 
			
		||||
 - Robin Eklind
 | 
			
		||||
 - Siavash Eliasi
 | 
			
		||||
 - Felipe Ferreira
 | 
			
		||||
 - Michael Fogleman
 | 
			
		||||
 - Gerald Franz
 | 
			
		||||
 - Mário Freitas
 | 
			
		||||
 - GeO4d
 | 
			
		||||
 - Marcus Geelnard
 | 
			
		||||
 - Stephen Gowen
 | 
			
		||||
 - Kovid Goyal
 | 
			
		||||
 - Eloi Marín Gratacós
 | 
			
		||||
 - Stefan Gustavson
 | 
			
		||||
 - Jonathan Hale
 | 
			
		||||
 - Sylvain Hellegouarch
 | 
			
		||||
 - Matthew Henry
 | 
			
		||||
 - heromyth
 | 
			
		||||
 - Lucas Hinderberger
 | 
			
		||||
 - Paul Holden
 | 
			
		||||
 - Warren Hu
 | 
			
		||||
 - IntellectualKitty
 | 
			
		||||
 - Aaron Jacobs
 | 
			
		||||
 - Erik S. V. Jansson
 | 
			
		||||
 - Toni Jovanoski
 | 
			
		||||
 - Arseny Kapoulkine
 | 
			
		||||
 - Cem Karan
 | 
			
		||||
 - Osman Keskin
 | 
			
		||||
 - Josh Kilmer
 | 
			
		||||
 - Cameron King
 | 
			
		||||
 - Peter Knut
 | 
			
		||||
 - Christoph Kubisch
 | 
			
		||||
 - Yuri Kunde Schlesner
 | 
			
		||||
 - Konstantin Käfer
 | 
			
		||||
 - Eric Larson
 | 
			
		||||
 - Robin Leffmann
 | 
			
		||||
 - Glenn Lewis
 | 
			
		||||
 - Shane Liesegang
 | 
			
		||||
 - Eyal Lotem
 | 
			
		||||
 - Aaron Loucks
 | 
			
		||||
 - Tristam MacDonald
 | 
			
		||||
 - Hans Mackowiak
 | 
			
		||||
 - Дмитри Малышев
 | 
			
		||||
 - Zbigniew Mandziejewicz
 | 
			
		||||
 - Adam Marcus
 | 
			
		||||
 - Célestin Marot
 | 
			
		||||
 - Kyle McDonald
 | 
			
		||||
 - David Medlock
 | 
			
		||||
 - Bryce Mehring
 | 
			
		||||
 - Jonathan Mercier
 | 
			
		||||
 - Marcel Metz
 | 
			
		||||
 - Liam Middlebrook
 | 
			
		||||
 - Jonathan Miller
 | 
			
		||||
 - Kenneth Miller
 | 
			
		||||
 - Bruce Mitchener
 | 
			
		||||
 - Jack Moffitt
 | 
			
		||||
 - Jeff Molofee
 | 
			
		||||
 - Alexander Monakov
 | 
			
		||||
 - Pierre Morel
 | 
			
		||||
 - Jon Morton
 | 
			
		||||
 - Pierre Moulon
 | 
			
		||||
 - Martins Mozeiko
 | 
			
		||||
 - Julian Møller
 | 
			
		||||
 - ndogxj
 | 
			
		||||
 - Kristian Nielsen
 | 
			
		||||
 - Kamil Nowakowski
 | 
			
		||||
 - Denis Ovod
 | 
			
		||||
 - Ozzy
 | 
			
		||||
 - Andri Pálsson
 | 
			
		||||
 - Peoro
 | 
			
		||||
 - Braden Pellett
 | 
			
		||||
 - Christopher Pelloux
 | 
			
		||||
 - Arturo J. Pérez
 | 
			
		||||
 - Anthony Pesch
 | 
			
		||||
 - Orson Peters
 | 
			
		||||
 - Emmanuel Gil Peyrot
 | 
			
		||||
 - Cyril Pichard
 | 
			
		||||
 - Keith Pitt
 | 
			
		||||
 - Stanislav Podgorskiy
 | 
			
		||||
 - Nathan Poirier
 | 
			
		||||
 - Alexandre Pretyman
 | 
			
		||||
 - przemekmirek
 | 
			
		||||
 - Philip Rideout
 | 
			
		||||
 - Eddie Ringle
 | 
			
		||||
 - Max Risuhin
 | 
			
		||||
 - Jorge Rodriguez
 | 
			
		||||
 - Ed Ropple
 | 
			
		||||
 - Aleksey Rybalkin
 | 
			
		||||
 - Riku Salminen
 | 
			
		||||
 - Brandon Schaefer
 | 
			
		||||
 - Sebastian Schuberth
 | 
			
		||||
 - Christian Sdunek
 | 
			
		||||
 - Matt Sealey
 | 
			
		||||
 - Steve Sexton
 | 
			
		||||
 - Arkady Shapkin
 | 
			
		||||
 - Yoshiki Shibukawa
 | 
			
		||||
 - Dmitri Shuralyov
 | 
			
		||||
 - Daniel Skorupski
 | 
			
		||||
 - Bradley Smith
 | 
			
		||||
 - Cliff Smolinsky
 | 
			
		||||
 - Patrick Snape
 | 
			
		||||
 - Erlend Sogge Heggen
 | 
			
		||||
 - Julian Squires
 | 
			
		||||
 - Johannes Stein
 | 
			
		||||
 - Pontus Stenetorp
 | 
			
		||||
 - Michael Stocker
 | 
			
		||||
 - Justin Stoecker
 | 
			
		||||
 - Elviss Strazdins
 | 
			
		||||
 - Paul Sultana
 | 
			
		||||
 - Nathan Sweet
 | 
			
		||||
 - TTK-Bandit
 | 
			
		||||
 - Sergey Tikhomirov
 | 
			
		||||
 - Arthur Tombs
 | 
			
		||||
 - Ioannis Tsakpinis
 | 
			
		||||
 - Samuli Tuomola
 | 
			
		||||
 - Matthew Turner
 | 
			
		||||
 - urraka
 | 
			
		||||
 - Elias Vanderstuyft
 | 
			
		||||
 - Stef Velzel
 | 
			
		||||
 - Jari Vetoniemi
 | 
			
		||||
 - Ricardo Vieira
 | 
			
		||||
 - Nicholas Vitovitch
 | 
			
		||||
 - Simon Voordouw
 | 
			
		||||
 - Corentin Wallez
 | 
			
		||||
 - Torsten Walluhn
 | 
			
		||||
 - Patrick Walton
 | 
			
		||||
 - Xo Wang
 | 
			
		||||
 - Jay Weisskopf
 | 
			
		||||
 - Frank Wille
 | 
			
		||||
 - Ryogo Yoshimura
 | 
			
		||||
 - Andrey Zholos
 | 
			
		||||
 - Santi Zupancic
 | 
			
		||||
 - Jonas Ådahl
 | 
			
		||||
 - Lasse Öörni
 | 
			
		||||
 - All the unmentioned and anonymous contributors in the GLFW community, for bug
 | 
			
		||||
   reports, patches, feedback, testing and encouragement
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										29
									
								
								cs440-acg/ext/nanogui/ext/glfw/cmake_uninstall.cmake.in
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								cs440-acg/ext/nanogui/ext/glfw/cmake_uninstall.cmake.in
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,29 @@
 | 
			
		||||
 | 
			
		||||
if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
 | 
			
		||||
  message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
 | 
			
		||||
string(REGEX REPLACE "\n" ";" files "${files}")
 | 
			
		||||
 | 
			
		||||
foreach (file ${files})
 | 
			
		||||
  message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
 | 
			
		||||
  if (EXISTS "$ENV{DESTDIR}${file}")
 | 
			
		||||
    exec_program("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
 | 
			
		||||
                 OUTPUT_VARIABLE rm_out
 | 
			
		||||
                 RETURN_VALUE rm_retval)
 | 
			
		||||
    if (NOT "${rm_retval}" STREQUAL 0)
 | 
			
		||||
      MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
 | 
			
		||||
    endif()
 | 
			
		||||
  elseif (IS_SYMLINK "$ENV{DESTDIR}${file}")
 | 
			
		||||
    EXEC_PROGRAM("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
 | 
			
		||||
                 OUTPUT_VARIABLE rm_out
 | 
			
		||||
                 RETURN_VALUE rm_retval)
 | 
			
		||||
    if (NOT "${rm_retval}" STREQUAL 0)
 | 
			
		||||
      message(FATAL_ERROR "Problem when removing symlink \"$ENV{DESTDIR}${file}\"")
 | 
			
		||||
    endif()
 | 
			
		||||
  else()
 | 
			
		||||
    message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
 | 
			
		||||
  endif()
 | 
			
		||||
endforeach()
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										230
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/getopt.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										230
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/getopt.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,230 @@
 | 
			
		||||
/* Copyright (c) 2012, Kim Gräsman
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions are met:
 | 
			
		||||
 *  * Redistributions of source code must retain the above copyright notice,
 | 
			
		||||
 *    this list of conditions and the following disclaimer.
 | 
			
		||||
 *  * Redistributions in binary form must reproduce the above copyright notice,
 | 
			
		||||
 *    this list of conditions and the following disclaimer in the documentation
 | 
			
		||||
 *    and/or other materials provided with the distribution.
 | 
			
		||||
 *  * Neither the name of Kim Gräsman nor the names of contributors may be used
 | 
			
		||||
 *    to endorse or promote products derived from this software without specific
 | 
			
		||||
 *    prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 | 
			
		||||
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED. IN NO EVENT SHALL KIM GRÄSMAN BE LIABLE FOR ANY DIRECT,
 | 
			
		||||
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 | 
			
		||||
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 | 
			
		||||
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 | 
			
		||||
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 | 
			
		||||
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 | 
			
		||||
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "getopt.h"
 | 
			
		||||
 | 
			
		||||
#include <stddef.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
 | 
			
		||||
const int no_argument = 0;
 | 
			
		||||
const int required_argument = 1;
 | 
			
		||||
const int optional_argument = 2;
 | 
			
		||||
 | 
			
		||||
char* optarg;
 | 
			
		||||
int optopt;
 | 
			
		||||
/* The variable optind [...] shall be initialized to 1 by the system. */
 | 
			
		||||
int optind = 1;
 | 
			
		||||
int opterr;
 | 
			
		||||
 | 
			
		||||
static char* optcursor = NULL;
 | 
			
		||||
 | 
			
		||||
/* Implemented based on [1] and [2] for optional arguments.
 | 
			
		||||
   optopt is handled FreeBSD-style, per [3].
 | 
			
		||||
   Other GNU and FreeBSD extensions are purely accidental.
 | 
			
		||||
 | 
			
		||||
[1] http://pubs.opengroup.org/onlinepubs/000095399/functions/getopt.html
 | 
			
		||||
[2] http://www.kernel.org/doc/man-pages/online/pages/man3/getopt.3.html
 | 
			
		||||
[3] http://www.freebsd.org/cgi/man.cgi?query=getopt&sektion=3&manpath=FreeBSD+9.0-RELEASE
 | 
			
		||||
*/
 | 
			
		||||
int getopt(int argc, char* const argv[], const char* optstring) {
 | 
			
		||||
  int optchar = -1;
 | 
			
		||||
  const char* optdecl = NULL;
 | 
			
		||||
 | 
			
		||||
  optarg = NULL;
 | 
			
		||||
  opterr = 0;
 | 
			
		||||
  optopt = 0;
 | 
			
		||||
 | 
			
		||||
  /* Unspecified, but we need it to avoid overrunning the argv bounds. */
 | 
			
		||||
  if (optind >= argc)
 | 
			
		||||
    goto no_more_optchars;
 | 
			
		||||
 | 
			
		||||
  /* If, when getopt() is called argv[optind] is a null pointer, getopt()
 | 
			
		||||
     shall return -1 without changing optind. */
 | 
			
		||||
  if (argv[optind] == NULL)
 | 
			
		||||
    goto no_more_optchars;
 | 
			
		||||
 | 
			
		||||
  /* If, when getopt() is called *argv[optind]  is not the character '-',
 | 
			
		||||
     getopt() shall return -1 without changing optind. */
 | 
			
		||||
  if (*argv[optind] != '-')
 | 
			
		||||
    goto no_more_optchars;
 | 
			
		||||
 | 
			
		||||
  /* If, when getopt() is called argv[optind] points to the string "-",
 | 
			
		||||
     getopt() shall return -1 without changing optind. */
 | 
			
		||||
  if (strcmp(argv[optind], "-") == 0)
 | 
			
		||||
    goto no_more_optchars;
 | 
			
		||||
 | 
			
		||||
  /* If, when getopt() is called argv[optind] points to the string "--",
 | 
			
		||||
     getopt() shall return -1 after incrementing optind. */
 | 
			
		||||
  if (strcmp(argv[optind], "--") == 0) {
 | 
			
		||||
    ++optind;
 | 
			
		||||
    goto no_more_optchars;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (optcursor == NULL || *optcursor == '\0')
 | 
			
		||||
    optcursor = argv[optind] + 1;
 | 
			
		||||
 | 
			
		||||
  optchar = *optcursor;
 | 
			
		||||
 | 
			
		||||
  /* FreeBSD: The variable optopt saves the last known option character
 | 
			
		||||
     returned by getopt(). */
 | 
			
		||||
  optopt = optchar;
 | 
			
		||||
 | 
			
		||||
  /* The getopt() function shall return the next option character (if one is
 | 
			
		||||
     found) from argv that matches a character in optstring, if there is
 | 
			
		||||
     one that matches. */
 | 
			
		||||
  optdecl = strchr(optstring, optchar);
 | 
			
		||||
  if (optdecl) {
 | 
			
		||||
    /* [I]f a character is followed by a colon, the option takes an
 | 
			
		||||
       argument. */
 | 
			
		||||
    if (optdecl[1] == ':') {
 | 
			
		||||
      optarg = ++optcursor;
 | 
			
		||||
      if (*optarg == '\0') {
 | 
			
		||||
        /* GNU extension: Two colons mean an option takes an
 | 
			
		||||
           optional arg; if there is text in the current argv-element
 | 
			
		||||
           (i.e., in the same word as the option name itself, for example,
 | 
			
		||||
           "-oarg"), then it is returned in optarg, otherwise optarg is set
 | 
			
		||||
           to zero. */
 | 
			
		||||
        if (optdecl[2] != ':') {
 | 
			
		||||
          /* If the option was the last character in the string pointed to by
 | 
			
		||||
             an element of argv, then optarg shall contain the next element
 | 
			
		||||
             of argv, and optind shall be incremented by 2. If the resulting
 | 
			
		||||
             value of optind is greater than argc, this indicates a missing
 | 
			
		||||
             option-argument, and getopt() shall return an error indication.
 | 
			
		||||
 | 
			
		||||
             Otherwise, optarg shall point to the string following the
 | 
			
		||||
             option character in that element of argv, and optind shall be
 | 
			
		||||
             incremented by 1.
 | 
			
		||||
          */
 | 
			
		||||
          if (++optind < argc) {
 | 
			
		||||
            optarg = argv[optind];
 | 
			
		||||
          } else {
 | 
			
		||||
            /* If it detects a missing option-argument, it shall return the
 | 
			
		||||
               colon character ( ':' ) if the first character of optstring
 | 
			
		||||
               was a colon, or a question-mark character ( '?' ) otherwise.
 | 
			
		||||
            */
 | 
			
		||||
            optarg = NULL;
 | 
			
		||||
            optchar = (optstring[0] == ':') ? ':' : '?';
 | 
			
		||||
          }
 | 
			
		||||
        } else {
 | 
			
		||||
          optarg = NULL;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      optcursor = NULL;
 | 
			
		||||
    }
 | 
			
		||||
  } else {
 | 
			
		||||
    /* If getopt() encounters an option character that is not contained in
 | 
			
		||||
       optstring, it shall return the question-mark ( '?' ) character. */
 | 
			
		||||
    optchar = '?';
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (optcursor == NULL || *++optcursor == '\0')
 | 
			
		||||
    ++optind;
 | 
			
		||||
 | 
			
		||||
  return optchar;
 | 
			
		||||
 | 
			
		||||
no_more_optchars:
 | 
			
		||||
  optcursor = NULL;
 | 
			
		||||
  return -1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* Implementation based on [1].
 | 
			
		||||
 | 
			
		||||
[1] http://www.kernel.org/doc/man-pages/online/pages/man3/getopt.3.html
 | 
			
		||||
*/
 | 
			
		||||
int getopt_long(int argc, char* const argv[], const char* optstring,
 | 
			
		||||
  const struct option* longopts, int* longindex) {
 | 
			
		||||
  const struct option* o = longopts;
 | 
			
		||||
  const struct option* match = NULL;
 | 
			
		||||
  int num_matches = 0;
 | 
			
		||||
  size_t argument_name_length = 0;
 | 
			
		||||
  const char* current_argument = NULL;
 | 
			
		||||
  int retval = -1;
 | 
			
		||||
 | 
			
		||||
  optarg = NULL;
 | 
			
		||||
  optopt = 0;
 | 
			
		||||
 | 
			
		||||
  if (optind >= argc)
 | 
			
		||||
    return -1;
 | 
			
		||||
 | 
			
		||||
  if (strlen(argv[optind]) < 3 || strncmp(argv[optind], "--", 2) != 0)
 | 
			
		||||
    return getopt(argc, argv, optstring);
 | 
			
		||||
 | 
			
		||||
  /* It's an option; starts with -- and is longer than two chars. */
 | 
			
		||||
  current_argument = argv[optind] + 2;
 | 
			
		||||
  argument_name_length = strcspn(current_argument, "=");
 | 
			
		||||
  for (; o->name; ++o) {
 | 
			
		||||
    if (strncmp(o->name, current_argument, argument_name_length) == 0) {
 | 
			
		||||
      match = o;
 | 
			
		||||
      ++num_matches;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (num_matches == 1) {
 | 
			
		||||
    /* If longindex is not NULL, it points to a variable which is set to the
 | 
			
		||||
       index of the long option relative to longopts. */
 | 
			
		||||
    if (longindex)
 | 
			
		||||
      *longindex = (int) (match - longopts);
 | 
			
		||||
 | 
			
		||||
    /* If flag is NULL, then getopt_long() shall return val.
 | 
			
		||||
       Otherwise, getopt_long() returns 0, and flag shall point to a variable
 | 
			
		||||
       which shall be set to val if the option is found, but left unchanged if
 | 
			
		||||
       the option is not found. */
 | 
			
		||||
    if (match->flag)
 | 
			
		||||
      *(match->flag) = match->val;
 | 
			
		||||
 | 
			
		||||
    retval = match->flag ? 0 : match->val;
 | 
			
		||||
 | 
			
		||||
    if (match->has_arg != no_argument) {
 | 
			
		||||
      optarg = strchr(argv[optind], '=');
 | 
			
		||||
      if (optarg != NULL)
 | 
			
		||||
        ++optarg;
 | 
			
		||||
 | 
			
		||||
      if (match->has_arg == required_argument) {
 | 
			
		||||
        /* Only scan the next argv for required arguments. Behavior is not
 | 
			
		||||
           specified, but has been observed with Ubuntu and Mac OSX. */
 | 
			
		||||
        if (optarg == NULL && ++optind < argc) {
 | 
			
		||||
          optarg = argv[optind];
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (optarg == NULL)
 | 
			
		||||
          retval = ':';
 | 
			
		||||
      }
 | 
			
		||||
    } else if (strchr(argv[optind], '=')) {
 | 
			
		||||
      /* An argument was provided to a non-argument option.
 | 
			
		||||
         I haven't seen this specified explicitly, but both GNU and BSD-based
 | 
			
		||||
         implementations show this behavior.
 | 
			
		||||
      */
 | 
			
		||||
      retval = '?';
 | 
			
		||||
    }
 | 
			
		||||
  } else {
 | 
			
		||||
    /* Unknown option or ambiguous match. */
 | 
			
		||||
    retval = '?';
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  ++optind;
 | 
			
		||||
  return retval;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										57
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/getopt.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										57
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/getopt.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,57 @@
 | 
			
		||||
/* Copyright (c) 2012, Kim Gräsman
 | 
			
		||||
 * All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions are met:
 | 
			
		||||
 *  * Redistributions of source code must retain the above copyright notice,
 | 
			
		||||
 *    this list of conditions and the following disclaimer.
 | 
			
		||||
 *  * Redistributions in binary form must reproduce the above copyright notice,
 | 
			
		||||
 *    this list of conditions and the following disclaimer in the documentation
 | 
			
		||||
 *    and/or other materials provided with the distribution.
 | 
			
		||||
 *  * Neither the name of Kim Gräsman nor the names of contributors may be used
 | 
			
		||||
 *    to endorse or promote products derived from this software without specific
 | 
			
		||||
 *    prior written permission.
 | 
			
		||||
 *
 | 
			
		||||
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 | 
			
		||||
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
 * ARE DISCLAIMED. IN NO EVENT SHALL KIM GRÄSMAN BE LIABLE FOR ANY DIRECT,
 | 
			
		||||
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 | 
			
		||||
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 | 
			
		||||
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 | 
			
		||||
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 | 
			
		||||
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 | 
			
		||||
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef INCLUDED_GETOPT_PORT_H
 | 
			
		||||
#define INCLUDED_GETOPT_PORT_H
 | 
			
		||||
 | 
			
		||||
#if defined(__cplusplus)
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
extern const int no_argument;
 | 
			
		||||
extern const int required_argument;
 | 
			
		||||
extern const int optional_argument;
 | 
			
		||||
 | 
			
		||||
extern char* optarg;
 | 
			
		||||
extern int optind, opterr, optopt;
 | 
			
		||||
 | 
			
		||||
struct option {
 | 
			
		||||
  const char* name;
 | 
			
		||||
  int has_arg;
 | 
			
		||||
  int* flag;
 | 
			
		||||
  int val;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
int getopt(int argc, char* const argv[], const char* optstring);
 | 
			
		||||
 | 
			
		||||
int getopt_long(int argc, char* const argv[],
 | 
			
		||||
  const char* optstring, const struct option* longopts, int* longindex);
 | 
			
		||||
 | 
			
		||||
#if defined(__cplusplus)
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif // INCLUDED_GETOPT_PORT_H
 | 
			
		||||
							
								
								
									
										3840
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/glad/gl.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3840
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/glad/gl.h
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										282
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/glad/khrplatform.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										282
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/glad/khrplatform.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,282 @@
 | 
			
		||||
#ifndef __khrplatform_h_
 | 
			
		||||
#define __khrplatform_h_
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
** Copyright (c) 2008-2018 The Khronos Group Inc.
 | 
			
		||||
**
 | 
			
		||||
** Permission is hereby granted, free of charge, to any person obtaining a
 | 
			
		||||
** copy of this software and/or associated documentation files (the
 | 
			
		||||
** "Materials"), to deal in the Materials without restriction, including
 | 
			
		||||
** without limitation the rights to use, copy, modify, merge, publish,
 | 
			
		||||
** distribute, sublicense, and/or sell copies of the Materials, and to
 | 
			
		||||
** permit persons to whom the Materials are furnished to do so, subject to
 | 
			
		||||
** the following conditions:
 | 
			
		||||
**
 | 
			
		||||
** The above copyright notice and this permission notice shall be included
 | 
			
		||||
** in all copies or substantial portions of the Materials.
 | 
			
		||||
**
 | 
			
		||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 | 
			
		||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 | 
			
		||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 | 
			
		||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 | 
			
		||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 | 
			
		||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 | 
			
		||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/* Khronos platform-specific types and definitions.
 | 
			
		||||
 *
 | 
			
		||||
 * The master copy of khrplatform.h is maintained in the Khronos EGL
 | 
			
		||||
 * Registry repository at https://github.com/KhronosGroup/EGL-Registry
 | 
			
		||||
 * The last semantic modification to khrplatform.h was at commit ID:
 | 
			
		||||
 *      67a3e0864c2d75ea5287b9f3d2eb74a745936692
 | 
			
		||||
 *
 | 
			
		||||
 * Adopters may modify this file to suit their platform. Adopters are
 | 
			
		||||
 * encouraged to submit platform specific modifications to the Khronos
 | 
			
		||||
 * group so that they can be included in future versions of this file.
 | 
			
		||||
 * Please submit changes by filing pull requests or issues on
 | 
			
		||||
 * the EGL Registry repository linked above.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * See the Implementer's Guidelines for information about where this file
 | 
			
		||||
 * should be located on your system and for more details of its use:
 | 
			
		||||
 *    http://www.khronos.org/registry/implementers_guide.pdf
 | 
			
		||||
 *
 | 
			
		||||
 * This file should be included as
 | 
			
		||||
 *        #include <KHR/khrplatform.h>
 | 
			
		||||
 * by Khronos client API header files that use its types and defines.
 | 
			
		||||
 *
 | 
			
		||||
 * The types in khrplatform.h should only be used to define API-specific types.
 | 
			
		||||
 *
 | 
			
		||||
 * Types defined in khrplatform.h:
 | 
			
		||||
 *    khronos_int8_t              signed   8  bit
 | 
			
		||||
 *    khronos_uint8_t             unsigned 8  bit
 | 
			
		||||
 *    khronos_int16_t             signed   16 bit
 | 
			
		||||
 *    khronos_uint16_t            unsigned 16 bit
 | 
			
		||||
 *    khronos_int32_t             signed   32 bit
 | 
			
		||||
 *    khronos_uint32_t            unsigned 32 bit
 | 
			
		||||
 *    khronos_int64_t             signed   64 bit
 | 
			
		||||
 *    khronos_uint64_t            unsigned 64 bit
 | 
			
		||||
 *    khronos_intptr_t            signed   same number of bits as a pointer
 | 
			
		||||
 *    khronos_uintptr_t           unsigned same number of bits as a pointer
 | 
			
		||||
 *    khronos_ssize_t             signed   size
 | 
			
		||||
 *    khronos_usize_t             unsigned size
 | 
			
		||||
 *    khronos_float_t             signed   32 bit floating point
 | 
			
		||||
 *    khronos_time_ns_t           unsigned 64 bit time in nanoseconds
 | 
			
		||||
 *    khronos_utime_nanoseconds_t unsigned time interval or absolute time in
 | 
			
		||||
 *                                         nanoseconds
 | 
			
		||||
 *    khronos_stime_nanoseconds_t signed time interval in nanoseconds
 | 
			
		||||
 *    khronos_boolean_enum_t      enumerated boolean type. This should
 | 
			
		||||
 *      only be used as a base type when a client API's boolean type is
 | 
			
		||||
 *      an enum. Client APIs which use an integer or other type for
 | 
			
		||||
 *      booleans cannot use this as the base type for their boolean.
 | 
			
		||||
 *
 | 
			
		||||
 * Tokens defined in khrplatform.h:
 | 
			
		||||
 *
 | 
			
		||||
 *    KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
 | 
			
		||||
 *
 | 
			
		||||
 *    KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
 | 
			
		||||
 *    KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
 | 
			
		||||
 *
 | 
			
		||||
 * Calling convention macros defined in this file:
 | 
			
		||||
 *    KHRONOS_APICALL
 | 
			
		||||
 *    KHRONOS_APIENTRY
 | 
			
		||||
 *    KHRONOS_APIATTRIBUTES
 | 
			
		||||
 *
 | 
			
		||||
 * These may be used in function prototypes as:
 | 
			
		||||
 *
 | 
			
		||||
 *      KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
 | 
			
		||||
 *                                  int arg1,
 | 
			
		||||
 *                                  int arg2) KHRONOS_APIATTRIBUTES;
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 * Definition of KHRONOS_APICALL
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 * This precedes the return type of the function in the function prototype.
 | 
			
		||||
 */
 | 
			
		||||
#if defined(_WIN32) && !defined(__SCITECH_SNAP__)
 | 
			
		||||
#   define KHRONOS_APICALL __declspec(dllimport)
 | 
			
		||||
#elif defined (__SYMBIAN32__)
 | 
			
		||||
#   define KHRONOS_APICALL IMPORT_C
 | 
			
		||||
#elif defined(__ANDROID__)
 | 
			
		||||
#   define KHRONOS_APICALL __attribute__((visibility("default")))
 | 
			
		||||
#else
 | 
			
		||||
#   define KHRONOS_APICALL
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 * Definition of KHRONOS_APIENTRY
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 * This follows the return type of the function  and precedes the function
 | 
			
		||||
 * name in the function prototype.
 | 
			
		||||
 */
 | 
			
		||||
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
 | 
			
		||||
    /* Win32 but not WinCE */
 | 
			
		||||
#   define KHRONOS_APIENTRY __stdcall
 | 
			
		||||
#else
 | 
			
		||||
#   define KHRONOS_APIENTRY
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 * Definition of KHRONOS_APIATTRIBUTES
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 * This follows the closing parenthesis of the function prototype arguments.
 | 
			
		||||
 */
 | 
			
		||||
#if defined (__ARMCC_2__)
 | 
			
		||||
#define KHRONOS_APIATTRIBUTES __softfp
 | 
			
		||||
#else
 | 
			
		||||
#define KHRONOS_APIATTRIBUTES
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 * basic type definitions
 | 
			
		||||
 *-----------------------------------------------------------------------*/
 | 
			
		||||
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Using <stdint.h>
 | 
			
		||||
 */
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
typedef int32_t                 khronos_int32_t;
 | 
			
		||||
typedef uint32_t                khronos_uint32_t;
 | 
			
		||||
typedef int64_t                 khronos_int64_t;
 | 
			
		||||
typedef uint64_t                khronos_uint64_t;
 | 
			
		||||
#define KHRONOS_SUPPORT_INT64   1
 | 
			
		||||
#define KHRONOS_SUPPORT_FLOAT   1
 | 
			
		||||
 | 
			
		||||
#elif defined(__VMS ) || defined(__sgi)
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Using <inttypes.h>
 | 
			
		||||
 */
 | 
			
		||||
#include <inttypes.h>
 | 
			
		||||
typedef int32_t                 khronos_int32_t;
 | 
			
		||||
typedef uint32_t                khronos_uint32_t;
 | 
			
		||||
typedef int64_t                 khronos_int64_t;
 | 
			
		||||
typedef uint64_t                khronos_uint64_t;
 | 
			
		||||
#define KHRONOS_SUPPORT_INT64   1
 | 
			
		||||
#define KHRONOS_SUPPORT_FLOAT   1
 | 
			
		||||
 | 
			
		||||
#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Win32
 | 
			
		||||
 */
 | 
			
		||||
typedef __int32                 khronos_int32_t;
 | 
			
		||||
typedef unsigned __int32        khronos_uint32_t;
 | 
			
		||||
typedef __int64                 khronos_int64_t;
 | 
			
		||||
typedef unsigned __int64        khronos_uint64_t;
 | 
			
		||||
#define KHRONOS_SUPPORT_INT64   1
 | 
			
		||||
#define KHRONOS_SUPPORT_FLOAT   1
 | 
			
		||||
 | 
			
		||||
#elif defined(__sun__) || defined(__digital__)
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Sun or Digital
 | 
			
		||||
 */
 | 
			
		||||
typedef int                     khronos_int32_t;
 | 
			
		||||
typedef unsigned int            khronos_uint32_t;
 | 
			
		||||
#if defined(__arch64__) || defined(_LP64)
 | 
			
		||||
typedef long int                khronos_int64_t;
 | 
			
		||||
typedef unsigned long int       khronos_uint64_t;
 | 
			
		||||
#else
 | 
			
		||||
typedef long long int           khronos_int64_t;
 | 
			
		||||
typedef unsigned long long int  khronos_uint64_t;
 | 
			
		||||
#endif /* __arch64__ */
 | 
			
		||||
#define KHRONOS_SUPPORT_INT64   1
 | 
			
		||||
#define KHRONOS_SUPPORT_FLOAT   1
 | 
			
		||||
 | 
			
		||||
#elif 0
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Hypothetical platform with no float or int64 support
 | 
			
		||||
 */
 | 
			
		||||
typedef int                     khronos_int32_t;
 | 
			
		||||
typedef unsigned int            khronos_uint32_t;
 | 
			
		||||
#define KHRONOS_SUPPORT_INT64   0
 | 
			
		||||
#define KHRONOS_SUPPORT_FLOAT   0
 | 
			
		||||
 | 
			
		||||
#else
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Generic fallback
 | 
			
		||||
 */
 | 
			
		||||
#include <stdint.h>
 | 
			
		||||
typedef int32_t                 khronos_int32_t;
 | 
			
		||||
typedef uint32_t                khronos_uint32_t;
 | 
			
		||||
typedef int64_t                 khronos_int64_t;
 | 
			
		||||
typedef uint64_t                khronos_uint64_t;
 | 
			
		||||
#define KHRONOS_SUPPORT_INT64   1
 | 
			
		||||
#define KHRONOS_SUPPORT_FLOAT   1
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Types that are (so far) the same on all platforms
 | 
			
		||||
 */
 | 
			
		||||
typedef signed   char          khronos_int8_t;
 | 
			
		||||
typedef unsigned char          khronos_uint8_t;
 | 
			
		||||
typedef signed   short int     khronos_int16_t;
 | 
			
		||||
typedef unsigned short int     khronos_uint16_t;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Types that differ between LLP64 and LP64 architectures - in LLP64,
 | 
			
		||||
 * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
 | 
			
		||||
 * to be the only LLP64 architecture in current use.
 | 
			
		||||
 */
 | 
			
		||||
#ifdef _WIN64
 | 
			
		||||
typedef signed   long long int khronos_intptr_t;
 | 
			
		||||
typedef unsigned long long int khronos_uintptr_t;
 | 
			
		||||
typedef signed   long long int khronos_ssize_t;
 | 
			
		||||
typedef unsigned long long int khronos_usize_t;
 | 
			
		||||
#else
 | 
			
		||||
typedef signed   long  int     khronos_intptr_t;
 | 
			
		||||
typedef unsigned long  int     khronos_uintptr_t;
 | 
			
		||||
typedef signed   long  int     khronos_ssize_t;
 | 
			
		||||
typedef unsigned long  int     khronos_usize_t;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if KHRONOS_SUPPORT_FLOAT
 | 
			
		||||
/*
 | 
			
		||||
 * Float type
 | 
			
		||||
 */
 | 
			
		||||
typedef          float         khronos_float_t;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if KHRONOS_SUPPORT_INT64
 | 
			
		||||
/* Time types
 | 
			
		||||
 *
 | 
			
		||||
 * These types can be used to represent a time interval in nanoseconds or
 | 
			
		||||
 * an absolute Unadjusted System Time.  Unadjusted System Time is the number
 | 
			
		||||
 * of nanoseconds since some arbitrary system event (e.g. since the last
 | 
			
		||||
 * time the system booted).  The Unadjusted System Time is an unsigned
 | 
			
		||||
 * 64 bit value that wraps back to 0 every 584 years.  Time intervals
 | 
			
		||||
 * may be either signed or unsigned.
 | 
			
		||||
 */
 | 
			
		||||
typedef khronos_uint64_t       khronos_utime_nanoseconds_t;
 | 
			
		||||
typedef khronos_int64_t        khronos_stime_nanoseconds_t;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Dummy value used to pad enum types to 32 bits.
 | 
			
		||||
 */
 | 
			
		||||
#ifndef KHRONOS_MAX_ENUM
 | 
			
		||||
#define KHRONOS_MAX_ENUM 0x7FFFFFFF
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Enumerated boolean type
 | 
			
		||||
 *
 | 
			
		||||
 * Values other than zero should be considered to be true.  Therefore
 | 
			
		||||
 * comparisons should not be made against KHRONOS_TRUE.
 | 
			
		||||
 */
 | 
			
		||||
typedef enum {
 | 
			
		||||
    KHRONOS_FALSE = 0,
 | 
			
		||||
    KHRONOS_TRUE  = 1,
 | 
			
		||||
    KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
 | 
			
		||||
} khronos_boolean_enum_t;
 | 
			
		||||
 | 
			
		||||
#endif /* __khrplatform_h_ */
 | 
			
		||||
							
								
								
									
										92
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/glad/vk_platform.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										92
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/glad/vk_platform.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,92 @@
 | 
			
		||||
/* */
 | 
			
		||||
/* File: vk_platform.h */
 | 
			
		||||
/* */
 | 
			
		||||
/*
 | 
			
		||||
** Copyright (c) 2014-2017 The Khronos Group Inc.
 | 
			
		||||
**
 | 
			
		||||
** Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
** you may not use this file except in compliance with the License.
 | 
			
		||||
** You may obtain a copy of the License at
 | 
			
		||||
**
 | 
			
		||||
**     http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
**
 | 
			
		||||
** Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
** distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
** See the License for the specific language governing permissions and
 | 
			
		||||
** limitations under the License.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifndef VK_PLATFORM_H_
 | 
			
		||||
#define VK_PLATFORM_H_
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
extern "C"
 | 
			
		||||
{
 | 
			
		||||
#endif /* __cplusplus */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
***************************************************************************************************
 | 
			
		||||
*   Platform-specific directives and type declarations
 | 
			
		||||
***************************************************************************************************
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/* Platform-specific calling convention macros.
 | 
			
		||||
 *
 | 
			
		||||
 * Platforms should define these so that Vulkan clients call Vulkan commands
 | 
			
		||||
 * with the same calling conventions that the Vulkan implementation expects.
 | 
			
		||||
 *
 | 
			
		||||
 * VKAPI_ATTR - Placed before the return type in function declarations.
 | 
			
		||||
 *              Useful for C++11 and GCC/Clang-style function attribute syntax.
 | 
			
		||||
 * VKAPI_CALL - Placed after the return type in function declarations.
 | 
			
		||||
 *              Useful for MSVC-style calling convention syntax.
 | 
			
		||||
 * VKAPI_PTR  - Placed between the '(' and '*' in function pointer types.
 | 
			
		||||
 *
 | 
			
		||||
 * Function declaration:  VKAPI_ATTR void VKAPI_CALL vkCommand(void);
 | 
			
		||||
 * Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void);
 | 
			
		||||
 */
 | 
			
		||||
#if defined(_WIN32)
 | 
			
		||||
    /* On Windows, Vulkan commands use the stdcall convention */
 | 
			
		||||
    #define VKAPI_ATTR
 | 
			
		||||
    #define VKAPI_CALL __stdcall
 | 
			
		||||
    #define VKAPI_PTR  VKAPI_CALL
 | 
			
		||||
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7
 | 
			
		||||
    #error "Vulkan isn't supported for the 'armeabi' NDK ABI"
 | 
			
		||||
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE)
 | 
			
		||||
    /* On Android 32-bit ARM targets, Vulkan functions use the "hardfloat" */
 | 
			
		||||
    /* calling convention, i.e. float parameters are passed in registers. This */
 | 
			
		||||
    /* is true even if the rest of the application passes floats on the stack, */
 | 
			
		||||
    /* as it does by default when compiling for the armeabi-v7a NDK ABI. */
 | 
			
		||||
    #define VKAPI_ATTR __attribute__((pcs("aapcs-vfp")))
 | 
			
		||||
    #define VKAPI_CALL
 | 
			
		||||
    #define VKAPI_PTR  VKAPI_ATTR
 | 
			
		||||
#else
 | 
			
		||||
    /* On other platforms, use the default calling convention */
 | 
			
		||||
    #define VKAPI_ATTR
 | 
			
		||||
    #define VKAPI_CALL
 | 
			
		||||
    #define VKAPI_PTR
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <stddef.h>
 | 
			
		||||
 | 
			
		||||
#if !defined(VK_NO_STDINT_H)
 | 
			
		||||
    #if defined(_MSC_VER) && (_MSC_VER < 1600)
 | 
			
		||||
        typedef signed   __int8  int8_t;
 | 
			
		||||
        typedef unsigned __int8  uint8_t;
 | 
			
		||||
        typedef signed   __int16 int16_t;
 | 
			
		||||
        typedef unsigned __int16 uint16_t;
 | 
			
		||||
        typedef signed   __int32 int32_t;
 | 
			
		||||
        typedef unsigned __int32 uint32_t;
 | 
			
		||||
        typedef signed   __int64 int64_t;
 | 
			
		||||
        typedef unsigned __int64 uint64_t;
 | 
			
		||||
    #else
 | 
			
		||||
        #include <stdint.h>
 | 
			
		||||
    #endif
 | 
			
		||||
#endif /* !defined(VK_NO_STDINT_H) */
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
} /* extern "C" */
 | 
			
		||||
#endif /* __cplusplus */
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
							
								
								
									
										3480
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/glad/vulkan.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3480
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/glad/vulkan.h
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										1791
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/glad_gl.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1791
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/glad_gl.c
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										593
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/glad_vulkan.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										593
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/glad_vulkan.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,593 @@
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <glad/vulkan.h>
 | 
			
		||||
 | 
			
		||||
#ifndef GLAD_IMPL_UTIL_C_
 | 
			
		||||
#define GLAD_IMPL_UTIL_C_
 | 
			
		||||
 | 
			
		||||
#ifdef _MSC_VER
 | 
			
		||||
#define GLAD_IMPL_UTIL_SSCANF sscanf_s
 | 
			
		||||
#else
 | 
			
		||||
#define GLAD_IMPL_UTIL_SSCANF sscanf
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* GLAD_IMPL_UTIL_C_ */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
int GLAD_VK_VERSION_1_0 = 0;
 | 
			
		||||
int GLAD_VK_VERSION_1_1 = 0;
 | 
			
		||||
int GLAD_VK_EXT_debug_report = 0;
 | 
			
		||||
int GLAD_VK_KHR_surface = 0;
 | 
			
		||||
int GLAD_VK_KHR_swapchain = 0;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
PFN_vkAcquireNextImage2KHR glad_vkAcquireNextImage2KHR = NULL;
 | 
			
		||||
PFN_vkAcquireNextImageKHR glad_vkAcquireNextImageKHR = NULL;
 | 
			
		||||
PFN_vkAllocateCommandBuffers glad_vkAllocateCommandBuffers = NULL;
 | 
			
		||||
PFN_vkAllocateDescriptorSets glad_vkAllocateDescriptorSets = NULL;
 | 
			
		||||
PFN_vkAllocateMemory glad_vkAllocateMemory = NULL;
 | 
			
		||||
PFN_vkBeginCommandBuffer glad_vkBeginCommandBuffer = NULL;
 | 
			
		||||
PFN_vkBindBufferMemory glad_vkBindBufferMemory = NULL;
 | 
			
		||||
PFN_vkBindBufferMemory2 glad_vkBindBufferMemory2 = NULL;
 | 
			
		||||
PFN_vkBindImageMemory glad_vkBindImageMemory = NULL;
 | 
			
		||||
PFN_vkBindImageMemory2 glad_vkBindImageMemory2 = NULL;
 | 
			
		||||
PFN_vkCmdBeginQuery glad_vkCmdBeginQuery = NULL;
 | 
			
		||||
PFN_vkCmdBeginRenderPass glad_vkCmdBeginRenderPass = NULL;
 | 
			
		||||
PFN_vkCmdBindDescriptorSets glad_vkCmdBindDescriptorSets = NULL;
 | 
			
		||||
PFN_vkCmdBindIndexBuffer glad_vkCmdBindIndexBuffer = NULL;
 | 
			
		||||
PFN_vkCmdBindPipeline glad_vkCmdBindPipeline = NULL;
 | 
			
		||||
PFN_vkCmdBindVertexBuffers glad_vkCmdBindVertexBuffers = NULL;
 | 
			
		||||
PFN_vkCmdBlitImage glad_vkCmdBlitImage = NULL;
 | 
			
		||||
PFN_vkCmdClearAttachments glad_vkCmdClearAttachments = NULL;
 | 
			
		||||
PFN_vkCmdClearColorImage glad_vkCmdClearColorImage = NULL;
 | 
			
		||||
PFN_vkCmdClearDepthStencilImage glad_vkCmdClearDepthStencilImage = NULL;
 | 
			
		||||
PFN_vkCmdCopyBuffer glad_vkCmdCopyBuffer = NULL;
 | 
			
		||||
PFN_vkCmdCopyBufferToImage glad_vkCmdCopyBufferToImage = NULL;
 | 
			
		||||
PFN_vkCmdCopyImage glad_vkCmdCopyImage = NULL;
 | 
			
		||||
PFN_vkCmdCopyImageToBuffer glad_vkCmdCopyImageToBuffer = NULL;
 | 
			
		||||
PFN_vkCmdCopyQueryPoolResults glad_vkCmdCopyQueryPoolResults = NULL;
 | 
			
		||||
PFN_vkCmdDispatch glad_vkCmdDispatch = NULL;
 | 
			
		||||
PFN_vkCmdDispatchBase glad_vkCmdDispatchBase = NULL;
 | 
			
		||||
PFN_vkCmdDispatchIndirect glad_vkCmdDispatchIndirect = NULL;
 | 
			
		||||
PFN_vkCmdDraw glad_vkCmdDraw = NULL;
 | 
			
		||||
PFN_vkCmdDrawIndexed glad_vkCmdDrawIndexed = NULL;
 | 
			
		||||
PFN_vkCmdDrawIndexedIndirect glad_vkCmdDrawIndexedIndirect = NULL;
 | 
			
		||||
PFN_vkCmdDrawIndirect glad_vkCmdDrawIndirect = NULL;
 | 
			
		||||
PFN_vkCmdEndQuery glad_vkCmdEndQuery = NULL;
 | 
			
		||||
PFN_vkCmdEndRenderPass glad_vkCmdEndRenderPass = NULL;
 | 
			
		||||
PFN_vkCmdExecuteCommands glad_vkCmdExecuteCommands = NULL;
 | 
			
		||||
PFN_vkCmdFillBuffer glad_vkCmdFillBuffer = NULL;
 | 
			
		||||
PFN_vkCmdNextSubpass glad_vkCmdNextSubpass = NULL;
 | 
			
		||||
PFN_vkCmdPipelineBarrier glad_vkCmdPipelineBarrier = NULL;
 | 
			
		||||
PFN_vkCmdPushConstants glad_vkCmdPushConstants = NULL;
 | 
			
		||||
PFN_vkCmdResetEvent glad_vkCmdResetEvent = NULL;
 | 
			
		||||
PFN_vkCmdResetQueryPool glad_vkCmdResetQueryPool = NULL;
 | 
			
		||||
PFN_vkCmdResolveImage glad_vkCmdResolveImage = NULL;
 | 
			
		||||
PFN_vkCmdSetBlendConstants glad_vkCmdSetBlendConstants = NULL;
 | 
			
		||||
PFN_vkCmdSetDepthBias glad_vkCmdSetDepthBias = NULL;
 | 
			
		||||
PFN_vkCmdSetDepthBounds glad_vkCmdSetDepthBounds = NULL;
 | 
			
		||||
PFN_vkCmdSetDeviceMask glad_vkCmdSetDeviceMask = NULL;
 | 
			
		||||
PFN_vkCmdSetEvent glad_vkCmdSetEvent = NULL;
 | 
			
		||||
PFN_vkCmdSetLineWidth glad_vkCmdSetLineWidth = NULL;
 | 
			
		||||
PFN_vkCmdSetScissor glad_vkCmdSetScissor = NULL;
 | 
			
		||||
PFN_vkCmdSetStencilCompareMask glad_vkCmdSetStencilCompareMask = NULL;
 | 
			
		||||
PFN_vkCmdSetStencilReference glad_vkCmdSetStencilReference = NULL;
 | 
			
		||||
PFN_vkCmdSetStencilWriteMask glad_vkCmdSetStencilWriteMask = NULL;
 | 
			
		||||
PFN_vkCmdSetViewport glad_vkCmdSetViewport = NULL;
 | 
			
		||||
PFN_vkCmdUpdateBuffer glad_vkCmdUpdateBuffer = NULL;
 | 
			
		||||
PFN_vkCmdWaitEvents glad_vkCmdWaitEvents = NULL;
 | 
			
		||||
PFN_vkCmdWriteTimestamp glad_vkCmdWriteTimestamp = NULL;
 | 
			
		||||
PFN_vkCreateBuffer glad_vkCreateBuffer = NULL;
 | 
			
		||||
PFN_vkCreateBufferView glad_vkCreateBufferView = NULL;
 | 
			
		||||
PFN_vkCreateCommandPool glad_vkCreateCommandPool = NULL;
 | 
			
		||||
PFN_vkCreateComputePipelines glad_vkCreateComputePipelines = NULL;
 | 
			
		||||
PFN_vkCreateDebugReportCallbackEXT glad_vkCreateDebugReportCallbackEXT = NULL;
 | 
			
		||||
PFN_vkCreateDescriptorPool glad_vkCreateDescriptorPool = NULL;
 | 
			
		||||
PFN_vkCreateDescriptorSetLayout glad_vkCreateDescriptorSetLayout = NULL;
 | 
			
		||||
PFN_vkCreateDescriptorUpdateTemplate glad_vkCreateDescriptorUpdateTemplate = NULL;
 | 
			
		||||
PFN_vkCreateDevice glad_vkCreateDevice = NULL;
 | 
			
		||||
PFN_vkCreateEvent glad_vkCreateEvent = NULL;
 | 
			
		||||
PFN_vkCreateFence glad_vkCreateFence = NULL;
 | 
			
		||||
PFN_vkCreateFramebuffer glad_vkCreateFramebuffer = NULL;
 | 
			
		||||
PFN_vkCreateGraphicsPipelines glad_vkCreateGraphicsPipelines = NULL;
 | 
			
		||||
PFN_vkCreateImage glad_vkCreateImage = NULL;
 | 
			
		||||
PFN_vkCreateImageView glad_vkCreateImageView = NULL;
 | 
			
		||||
PFN_vkCreateInstance glad_vkCreateInstance = NULL;
 | 
			
		||||
PFN_vkCreatePipelineCache glad_vkCreatePipelineCache = NULL;
 | 
			
		||||
PFN_vkCreatePipelineLayout glad_vkCreatePipelineLayout = NULL;
 | 
			
		||||
PFN_vkCreateQueryPool glad_vkCreateQueryPool = NULL;
 | 
			
		||||
PFN_vkCreateRenderPass glad_vkCreateRenderPass = NULL;
 | 
			
		||||
PFN_vkCreateSampler glad_vkCreateSampler = NULL;
 | 
			
		||||
PFN_vkCreateSamplerYcbcrConversion glad_vkCreateSamplerYcbcrConversion = NULL;
 | 
			
		||||
PFN_vkCreateSemaphore glad_vkCreateSemaphore = NULL;
 | 
			
		||||
PFN_vkCreateShaderModule glad_vkCreateShaderModule = NULL;
 | 
			
		||||
PFN_vkCreateSwapchainKHR glad_vkCreateSwapchainKHR = NULL;
 | 
			
		||||
PFN_vkDebugReportMessageEXT glad_vkDebugReportMessageEXT = NULL;
 | 
			
		||||
PFN_vkDestroyBuffer glad_vkDestroyBuffer = NULL;
 | 
			
		||||
PFN_vkDestroyBufferView glad_vkDestroyBufferView = NULL;
 | 
			
		||||
PFN_vkDestroyCommandPool glad_vkDestroyCommandPool = NULL;
 | 
			
		||||
PFN_vkDestroyDebugReportCallbackEXT glad_vkDestroyDebugReportCallbackEXT = NULL;
 | 
			
		||||
PFN_vkDestroyDescriptorPool glad_vkDestroyDescriptorPool = NULL;
 | 
			
		||||
PFN_vkDestroyDescriptorSetLayout glad_vkDestroyDescriptorSetLayout = NULL;
 | 
			
		||||
PFN_vkDestroyDescriptorUpdateTemplate glad_vkDestroyDescriptorUpdateTemplate = NULL;
 | 
			
		||||
PFN_vkDestroyDevice glad_vkDestroyDevice = NULL;
 | 
			
		||||
PFN_vkDestroyEvent glad_vkDestroyEvent = NULL;
 | 
			
		||||
PFN_vkDestroyFence glad_vkDestroyFence = NULL;
 | 
			
		||||
PFN_vkDestroyFramebuffer glad_vkDestroyFramebuffer = NULL;
 | 
			
		||||
PFN_vkDestroyImage glad_vkDestroyImage = NULL;
 | 
			
		||||
PFN_vkDestroyImageView glad_vkDestroyImageView = NULL;
 | 
			
		||||
PFN_vkDestroyInstance glad_vkDestroyInstance = NULL;
 | 
			
		||||
PFN_vkDestroyPipeline glad_vkDestroyPipeline = NULL;
 | 
			
		||||
PFN_vkDestroyPipelineCache glad_vkDestroyPipelineCache = NULL;
 | 
			
		||||
PFN_vkDestroyPipelineLayout glad_vkDestroyPipelineLayout = NULL;
 | 
			
		||||
PFN_vkDestroyQueryPool glad_vkDestroyQueryPool = NULL;
 | 
			
		||||
PFN_vkDestroyRenderPass glad_vkDestroyRenderPass = NULL;
 | 
			
		||||
PFN_vkDestroySampler glad_vkDestroySampler = NULL;
 | 
			
		||||
PFN_vkDestroySamplerYcbcrConversion glad_vkDestroySamplerYcbcrConversion = NULL;
 | 
			
		||||
PFN_vkDestroySemaphore glad_vkDestroySemaphore = NULL;
 | 
			
		||||
PFN_vkDestroyShaderModule glad_vkDestroyShaderModule = NULL;
 | 
			
		||||
PFN_vkDestroySurfaceKHR glad_vkDestroySurfaceKHR = NULL;
 | 
			
		||||
PFN_vkDestroySwapchainKHR glad_vkDestroySwapchainKHR = NULL;
 | 
			
		||||
PFN_vkDeviceWaitIdle glad_vkDeviceWaitIdle = NULL;
 | 
			
		||||
PFN_vkEndCommandBuffer glad_vkEndCommandBuffer = NULL;
 | 
			
		||||
PFN_vkEnumerateDeviceExtensionProperties glad_vkEnumerateDeviceExtensionProperties = NULL;
 | 
			
		||||
PFN_vkEnumerateDeviceLayerProperties glad_vkEnumerateDeviceLayerProperties = NULL;
 | 
			
		||||
PFN_vkEnumerateInstanceExtensionProperties glad_vkEnumerateInstanceExtensionProperties = NULL;
 | 
			
		||||
PFN_vkEnumerateInstanceLayerProperties glad_vkEnumerateInstanceLayerProperties = NULL;
 | 
			
		||||
PFN_vkEnumerateInstanceVersion glad_vkEnumerateInstanceVersion = NULL;
 | 
			
		||||
PFN_vkEnumeratePhysicalDeviceGroups glad_vkEnumeratePhysicalDeviceGroups = NULL;
 | 
			
		||||
PFN_vkEnumeratePhysicalDevices glad_vkEnumeratePhysicalDevices = NULL;
 | 
			
		||||
PFN_vkFlushMappedMemoryRanges glad_vkFlushMappedMemoryRanges = NULL;
 | 
			
		||||
PFN_vkFreeCommandBuffers glad_vkFreeCommandBuffers = NULL;
 | 
			
		||||
PFN_vkFreeDescriptorSets glad_vkFreeDescriptorSets = NULL;
 | 
			
		||||
PFN_vkFreeMemory glad_vkFreeMemory = NULL;
 | 
			
		||||
PFN_vkGetBufferMemoryRequirements glad_vkGetBufferMemoryRequirements = NULL;
 | 
			
		||||
PFN_vkGetBufferMemoryRequirements2 glad_vkGetBufferMemoryRequirements2 = NULL;
 | 
			
		||||
PFN_vkGetDescriptorSetLayoutSupport glad_vkGetDescriptorSetLayoutSupport = NULL;
 | 
			
		||||
PFN_vkGetDeviceGroupPeerMemoryFeatures glad_vkGetDeviceGroupPeerMemoryFeatures = NULL;
 | 
			
		||||
PFN_vkGetDeviceGroupPresentCapabilitiesKHR glad_vkGetDeviceGroupPresentCapabilitiesKHR = NULL;
 | 
			
		||||
PFN_vkGetDeviceGroupSurfacePresentModesKHR glad_vkGetDeviceGroupSurfacePresentModesKHR = NULL;
 | 
			
		||||
PFN_vkGetDeviceMemoryCommitment glad_vkGetDeviceMemoryCommitment = NULL;
 | 
			
		||||
PFN_vkGetDeviceProcAddr glad_vkGetDeviceProcAddr = NULL;
 | 
			
		||||
PFN_vkGetDeviceQueue glad_vkGetDeviceQueue = NULL;
 | 
			
		||||
PFN_vkGetDeviceQueue2 glad_vkGetDeviceQueue2 = NULL;
 | 
			
		||||
PFN_vkGetEventStatus glad_vkGetEventStatus = NULL;
 | 
			
		||||
PFN_vkGetFenceStatus glad_vkGetFenceStatus = NULL;
 | 
			
		||||
PFN_vkGetImageMemoryRequirements glad_vkGetImageMemoryRequirements = NULL;
 | 
			
		||||
PFN_vkGetImageMemoryRequirements2 glad_vkGetImageMemoryRequirements2 = NULL;
 | 
			
		||||
PFN_vkGetImageSparseMemoryRequirements glad_vkGetImageSparseMemoryRequirements = NULL;
 | 
			
		||||
PFN_vkGetImageSparseMemoryRequirements2 glad_vkGetImageSparseMemoryRequirements2 = NULL;
 | 
			
		||||
PFN_vkGetImageSubresourceLayout glad_vkGetImageSubresourceLayout = NULL;
 | 
			
		||||
PFN_vkGetInstanceProcAddr glad_vkGetInstanceProcAddr = NULL;
 | 
			
		||||
PFN_vkGetPhysicalDeviceExternalBufferProperties glad_vkGetPhysicalDeviceExternalBufferProperties = NULL;
 | 
			
		||||
PFN_vkGetPhysicalDeviceExternalFenceProperties glad_vkGetPhysicalDeviceExternalFenceProperties = NULL;
 | 
			
		||||
PFN_vkGetPhysicalDeviceExternalSemaphoreProperties glad_vkGetPhysicalDeviceExternalSemaphoreProperties = NULL;
 | 
			
		||||
PFN_vkGetPhysicalDeviceFeatures glad_vkGetPhysicalDeviceFeatures = NULL;
 | 
			
		||||
PFN_vkGetPhysicalDeviceFeatures2 glad_vkGetPhysicalDeviceFeatures2 = NULL;
 | 
			
		||||
PFN_vkGetPhysicalDeviceFormatProperties glad_vkGetPhysicalDeviceFormatProperties = NULL;
 | 
			
		||||
PFN_vkGetPhysicalDeviceFormatProperties2 glad_vkGetPhysicalDeviceFormatProperties2 = NULL;
 | 
			
		||||
PFN_vkGetPhysicalDeviceImageFormatProperties glad_vkGetPhysicalDeviceImageFormatProperties = NULL;
 | 
			
		||||
PFN_vkGetPhysicalDeviceImageFormatProperties2 glad_vkGetPhysicalDeviceImageFormatProperties2 = NULL;
 | 
			
		||||
PFN_vkGetPhysicalDeviceMemoryProperties glad_vkGetPhysicalDeviceMemoryProperties = NULL;
 | 
			
		||||
PFN_vkGetPhysicalDeviceMemoryProperties2 glad_vkGetPhysicalDeviceMemoryProperties2 = NULL;
 | 
			
		||||
PFN_vkGetPhysicalDevicePresentRectanglesKHR glad_vkGetPhysicalDevicePresentRectanglesKHR = NULL;
 | 
			
		||||
PFN_vkGetPhysicalDeviceProperties glad_vkGetPhysicalDeviceProperties = NULL;
 | 
			
		||||
PFN_vkGetPhysicalDeviceProperties2 glad_vkGetPhysicalDeviceProperties2 = NULL;
 | 
			
		||||
PFN_vkGetPhysicalDeviceQueueFamilyProperties glad_vkGetPhysicalDeviceQueueFamilyProperties = NULL;
 | 
			
		||||
PFN_vkGetPhysicalDeviceQueueFamilyProperties2 glad_vkGetPhysicalDeviceQueueFamilyProperties2 = NULL;
 | 
			
		||||
PFN_vkGetPhysicalDeviceSparseImageFormatProperties glad_vkGetPhysicalDeviceSparseImageFormatProperties = NULL;
 | 
			
		||||
PFN_vkGetPhysicalDeviceSparseImageFormatProperties2 glad_vkGetPhysicalDeviceSparseImageFormatProperties2 = NULL;
 | 
			
		||||
PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR glad_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = NULL;
 | 
			
		||||
PFN_vkGetPhysicalDeviceSurfaceFormatsKHR glad_vkGetPhysicalDeviceSurfaceFormatsKHR = NULL;
 | 
			
		||||
PFN_vkGetPhysicalDeviceSurfacePresentModesKHR glad_vkGetPhysicalDeviceSurfacePresentModesKHR = NULL;
 | 
			
		||||
PFN_vkGetPhysicalDeviceSurfaceSupportKHR glad_vkGetPhysicalDeviceSurfaceSupportKHR = NULL;
 | 
			
		||||
PFN_vkGetPipelineCacheData glad_vkGetPipelineCacheData = NULL;
 | 
			
		||||
PFN_vkGetQueryPoolResults glad_vkGetQueryPoolResults = NULL;
 | 
			
		||||
PFN_vkGetRenderAreaGranularity glad_vkGetRenderAreaGranularity = NULL;
 | 
			
		||||
PFN_vkGetSwapchainImagesKHR glad_vkGetSwapchainImagesKHR = NULL;
 | 
			
		||||
PFN_vkInvalidateMappedMemoryRanges glad_vkInvalidateMappedMemoryRanges = NULL;
 | 
			
		||||
PFN_vkMapMemory glad_vkMapMemory = NULL;
 | 
			
		||||
PFN_vkMergePipelineCaches glad_vkMergePipelineCaches = NULL;
 | 
			
		||||
PFN_vkQueueBindSparse glad_vkQueueBindSparse = NULL;
 | 
			
		||||
PFN_vkQueuePresentKHR glad_vkQueuePresentKHR = NULL;
 | 
			
		||||
PFN_vkQueueSubmit glad_vkQueueSubmit = NULL;
 | 
			
		||||
PFN_vkQueueWaitIdle glad_vkQueueWaitIdle = NULL;
 | 
			
		||||
PFN_vkResetCommandBuffer glad_vkResetCommandBuffer = NULL;
 | 
			
		||||
PFN_vkResetCommandPool glad_vkResetCommandPool = NULL;
 | 
			
		||||
PFN_vkResetDescriptorPool glad_vkResetDescriptorPool = NULL;
 | 
			
		||||
PFN_vkResetEvent glad_vkResetEvent = NULL;
 | 
			
		||||
PFN_vkResetFences glad_vkResetFences = NULL;
 | 
			
		||||
PFN_vkSetEvent glad_vkSetEvent = NULL;
 | 
			
		||||
PFN_vkTrimCommandPool glad_vkTrimCommandPool = NULL;
 | 
			
		||||
PFN_vkUnmapMemory glad_vkUnmapMemory = NULL;
 | 
			
		||||
PFN_vkUpdateDescriptorSetWithTemplate glad_vkUpdateDescriptorSetWithTemplate = NULL;
 | 
			
		||||
PFN_vkUpdateDescriptorSets glad_vkUpdateDescriptorSets = NULL;
 | 
			
		||||
PFN_vkWaitForFences glad_vkWaitForFences = NULL;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static void glad_vk_load_VK_VERSION_1_0( GLADuserptrloadfunc load, void* userptr) {
 | 
			
		||||
    if(!GLAD_VK_VERSION_1_0) return;
 | 
			
		||||
    vkAllocateCommandBuffers = (PFN_vkAllocateCommandBuffers) load("vkAllocateCommandBuffers", userptr);
 | 
			
		||||
    vkAllocateDescriptorSets = (PFN_vkAllocateDescriptorSets) load("vkAllocateDescriptorSets", userptr);
 | 
			
		||||
    vkAllocateMemory = (PFN_vkAllocateMemory) load("vkAllocateMemory", userptr);
 | 
			
		||||
    vkBeginCommandBuffer = (PFN_vkBeginCommandBuffer) load("vkBeginCommandBuffer", userptr);
 | 
			
		||||
    vkBindBufferMemory = (PFN_vkBindBufferMemory) load("vkBindBufferMemory", userptr);
 | 
			
		||||
    vkBindImageMemory = (PFN_vkBindImageMemory) load("vkBindImageMemory", userptr);
 | 
			
		||||
    vkCmdBeginQuery = (PFN_vkCmdBeginQuery) load("vkCmdBeginQuery", userptr);
 | 
			
		||||
    vkCmdBeginRenderPass = (PFN_vkCmdBeginRenderPass) load("vkCmdBeginRenderPass", userptr);
 | 
			
		||||
    vkCmdBindDescriptorSets = (PFN_vkCmdBindDescriptorSets) load("vkCmdBindDescriptorSets", userptr);
 | 
			
		||||
    vkCmdBindIndexBuffer = (PFN_vkCmdBindIndexBuffer) load("vkCmdBindIndexBuffer", userptr);
 | 
			
		||||
    vkCmdBindPipeline = (PFN_vkCmdBindPipeline) load("vkCmdBindPipeline", userptr);
 | 
			
		||||
    vkCmdBindVertexBuffers = (PFN_vkCmdBindVertexBuffers) load("vkCmdBindVertexBuffers", userptr);
 | 
			
		||||
    vkCmdBlitImage = (PFN_vkCmdBlitImage) load("vkCmdBlitImage", userptr);
 | 
			
		||||
    vkCmdClearAttachments = (PFN_vkCmdClearAttachments) load("vkCmdClearAttachments", userptr);
 | 
			
		||||
    vkCmdClearColorImage = (PFN_vkCmdClearColorImage) load("vkCmdClearColorImage", userptr);
 | 
			
		||||
    vkCmdClearDepthStencilImage = (PFN_vkCmdClearDepthStencilImage) load("vkCmdClearDepthStencilImage", userptr);
 | 
			
		||||
    vkCmdCopyBuffer = (PFN_vkCmdCopyBuffer) load("vkCmdCopyBuffer", userptr);
 | 
			
		||||
    vkCmdCopyBufferToImage = (PFN_vkCmdCopyBufferToImage) load("vkCmdCopyBufferToImage", userptr);
 | 
			
		||||
    vkCmdCopyImage = (PFN_vkCmdCopyImage) load("vkCmdCopyImage", userptr);
 | 
			
		||||
    vkCmdCopyImageToBuffer = (PFN_vkCmdCopyImageToBuffer) load("vkCmdCopyImageToBuffer", userptr);
 | 
			
		||||
    vkCmdCopyQueryPoolResults = (PFN_vkCmdCopyQueryPoolResults) load("vkCmdCopyQueryPoolResults", userptr);
 | 
			
		||||
    vkCmdDispatch = (PFN_vkCmdDispatch) load("vkCmdDispatch", userptr);
 | 
			
		||||
    vkCmdDispatchIndirect = (PFN_vkCmdDispatchIndirect) load("vkCmdDispatchIndirect", userptr);
 | 
			
		||||
    vkCmdDraw = (PFN_vkCmdDraw) load("vkCmdDraw", userptr);
 | 
			
		||||
    vkCmdDrawIndexed = (PFN_vkCmdDrawIndexed) load("vkCmdDrawIndexed", userptr);
 | 
			
		||||
    vkCmdDrawIndexedIndirect = (PFN_vkCmdDrawIndexedIndirect) load("vkCmdDrawIndexedIndirect", userptr);
 | 
			
		||||
    vkCmdDrawIndirect = (PFN_vkCmdDrawIndirect) load("vkCmdDrawIndirect", userptr);
 | 
			
		||||
    vkCmdEndQuery = (PFN_vkCmdEndQuery) load("vkCmdEndQuery", userptr);
 | 
			
		||||
    vkCmdEndRenderPass = (PFN_vkCmdEndRenderPass) load("vkCmdEndRenderPass", userptr);
 | 
			
		||||
    vkCmdExecuteCommands = (PFN_vkCmdExecuteCommands) load("vkCmdExecuteCommands", userptr);
 | 
			
		||||
    vkCmdFillBuffer = (PFN_vkCmdFillBuffer) load("vkCmdFillBuffer", userptr);
 | 
			
		||||
    vkCmdNextSubpass = (PFN_vkCmdNextSubpass) load("vkCmdNextSubpass", userptr);
 | 
			
		||||
    vkCmdPipelineBarrier = (PFN_vkCmdPipelineBarrier) load("vkCmdPipelineBarrier", userptr);
 | 
			
		||||
    vkCmdPushConstants = (PFN_vkCmdPushConstants) load("vkCmdPushConstants", userptr);
 | 
			
		||||
    vkCmdResetEvent = (PFN_vkCmdResetEvent) load("vkCmdResetEvent", userptr);
 | 
			
		||||
    vkCmdResetQueryPool = (PFN_vkCmdResetQueryPool) load("vkCmdResetQueryPool", userptr);
 | 
			
		||||
    vkCmdResolveImage = (PFN_vkCmdResolveImage) load("vkCmdResolveImage", userptr);
 | 
			
		||||
    vkCmdSetBlendConstants = (PFN_vkCmdSetBlendConstants) load("vkCmdSetBlendConstants", userptr);
 | 
			
		||||
    vkCmdSetDepthBias = (PFN_vkCmdSetDepthBias) load("vkCmdSetDepthBias", userptr);
 | 
			
		||||
    vkCmdSetDepthBounds = (PFN_vkCmdSetDepthBounds) load("vkCmdSetDepthBounds", userptr);
 | 
			
		||||
    vkCmdSetEvent = (PFN_vkCmdSetEvent) load("vkCmdSetEvent", userptr);
 | 
			
		||||
    vkCmdSetLineWidth = (PFN_vkCmdSetLineWidth) load("vkCmdSetLineWidth", userptr);
 | 
			
		||||
    vkCmdSetScissor = (PFN_vkCmdSetScissor) load("vkCmdSetScissor", userptr);
 | 
			
		||||
    vkCmdSetStencilCompareMask = (PFN_vkCmdSetStencilCompareMask) load("vkCmdSetStencilCompareMask", userptr);
 | 
			
		||||
    vkCmdSetStencilReference = (PFN_vkCmdSetStencilReference) load("vkCmdSetStencilReference", userptr);
 | 
			
		||||
    vkCmdSetStencilWriteMask = (PFN_vkCmdSetStencilWriteMask) load("vkCmdSetStencilWriteMask", userptr);
 | 
			
		||||
    vkCmdSetViewport = (PFN_vkCmdSetViewport) load("vkCmdSetViewport", userptr);
 | 
			
		||||
    vkCmdUpdateBuffer = (PFN_vkCmdUpdateBuffer) load("vkCmdUpdateBuffer", userptr);
 | 
			
		||||
    vkCmdWaitEvents = (PFN_vkCmdWaitEvents) load("vkCmdWaitEvents", userptr);
 | 
			
		||||
    vkCmdWriteTimestamp = (PFN_vkCmdWriteTimestamp) load("vkCmdWriteTimestamp", userptr);
 | 
			
		||||
    vkCreateBuffer = (PFN_vkCreateBuffer) load("vkCreateBuffer", userptr);
 | 
			
		||||
    vkCreateBufferView = (PFN_vkCreateBufferView) load("vkCreateBufferView", userptr);
 | 
			
		||||
    vkCreateCommandPool = (PFN_vkCreateCommandPool) load("vkCreateCommandPool", userptr);
 | 
			
		||||
    vkCreateComputePipelines = (PFN_vkCreateComputePipelines) load("vkCreateComputePipelines", userptr);
 | 
			
		||||
    vkCreateDescriptorPool = (PFN_vkCreateDescriptorPool) load("vkCreateDescriptorPool", userptr);
 | 
			
		||||
    vkCreateDescriptorSetLayout = (PFN_vkCreateDescriptorSetLayout) load("vkCreateDescriptorSetLayout", userptr);
 | 
			
		||||
    vkCreateDevice = (PFN_vkCreateDevice) load("vkCreateDevice", userptr);
 | 
			
		||||
    vkCreateEvent = (PFN_vkCreateEvent) load("vkCreateEvent", userptr);
 | 
			
		||||
    vkCreateFence = (PFN_vkCreateFence) load("vkCreateFence", userptr);
 | 
			
		||||
    vkCreateFramebuffer = (PFN_vkCreateFramebuffer) load("vkCreateFramebuffer", userptr);
 | 
			
		||||
    vkCreateGraphicsPipelines = (PFN_vkCreateGraphicsPipelines) load("vkCreateGraphicsPipelines", userptr);
 | 
			
		||||
    vkCreateImage = (PFN_vkCreateImage) load("vkCreateImage", userptr);
 | 
			
		||||
    vkCreateImageView = (PFN_vkCreateImageView) load("vkCreateImageView", userptr);
 | 
			
		||||
    vkCreateInstance = (PFN_vkCreateInstance) load("vkCreateInstance", userptr);
 | 
			
		||||
    vkCreatePipelineCache = (PFN_vkCreatePipelineCache) load("vkCreatePipelineCache", userptr);
 | 
			
		||||
    vkCreatePipelineLayout = (PFN_vkCreatePipelineLayout) load("vkCreatePipelineLayout", userptr);
 | 
			
		||||
    vkCreateQueryPool = (PFN_vkCreateQueryPool) load("vkCreateQueryPool", userptr);
 | 
			
		||||
    vkCreateRenderPass = (PFN_vkCreateRenderPass) load("vkCreateRenderPass", userptr);
 | 
			
		||||
    vkCreateSampler = (PFN_vkCreateSampler) load("vkCreateSampler", userptr);
 | 
			
		||||
    vkCreateSemaphore = (PFN_vkCreateSemaphore) load("vkCreateSemaphore", userptr);
 | 
			
		||||
    vkCreateShaderModule = (PFN_vkCreateShaderModule) load("vkCreateShaderModule", userptr);
 | 
			
		||||
    vkDestroyBuffer = (PFN_vkDestroyBuffer) load("vkDestroyBuffer", userptr);
 | 
			
		||||
    vkDestroyBufferView = (PFN_vkDestroyBufferView) load("vkDestroyBufferView", userptr);
 | 
			
		||||
    vkDestroyCommandPool = (PFN_vkDestroyCommandPool) load("vkDestroyCommandPool", userptr);
 | 
			
		||||
    vkDestroyDescriptorPool = (PFN_vkDestroyDescriptorPool) load("vkDestroyDescriptorPool", userptr);
 | 
			
		||||
    vkDestroyDescriptorSetLayout = (PFN_vkDestroyDescriptorSetLayout) load("vkDestroyDescriptorSetLayout", userptr);
 | 
			
		||||
    vkDestroyDevice = (PFN_vkDestroyDevice) load("vkDestroyDevice", userptr);
 | 
			
		||||
    vkDestroyEvent = (PFN_vkDestroyEvent) load("vkDestroyEvent", userptr);
 | 
			
		||||
    vkDestroyFence = (PFN_vkDestroyFence) load("vkDestroyFence", userptr);
 | 
			
		||||
    vkDestroyFramebuffer = (PFN_vkDestroyFramebuffer) load("vkDestroyFramebuffer", userptr);
 | 
			
		||||
    vkDestroyImage = (PFN_vkDestroyImage) load("vkDestroyImage", userptr);
 | 
			
		||||
    vkDestroyImageView = (PFN_vkDestroyImageView) load("vkDestroyImageView", userptr);
 | 
			
		||||
    vkDestroyInstance = (PFN_vkDestroyInstance) load("vkDestroyInstance", userptr);
 | 
			
		||||
    vkDestroyPipeline = (PFN_vkDestroyPipeline) load("vkDestroyPipeline", userptr);
 | 
			
		||||
    vkDestroyPipelineCache = (PFN_vkDestroyPipelineCache) load("vkDestroyPipelineCache", userptr);
 | 
			
		||||
    vkDestroyPipelineLayout = (PFN_vkDestroyPipelineLayout) load("vkDestroyPipelineLayout", userptr);
 | 
			
		||||
    vkDestroyQueryPool = (PFN_vkDestroyQueryPool) load("vkDestroyQueryPool", userptr);
 | 
			
		||||
    vkDestroyRenderPass = (PFN_vkDestroyRenderPass) load("vkDestroyRenderPass", userptr);
 | 
			
		||||
    vkDestroySampler = (PFN_vkDestroySampler) load("vkDestroySampler", userptr);
 | 
			
		||||
    vkDestroySemaphore = (PFN_vkDestroySemaphore) load("vkDestroySemaphore", userptr);
 | 
			
		||||
    vkDestroyShaderModule = (PFN_vkDestroyShaderModule) load("vkDestroyShaderModule", userptr);
 | 
			
		||||
    vkDeviceWaitIdle = (PFN_vkDeviceWaitIdle) load("vkDeviceWaitIdle", userptr);
 | 
			
		||||
    vkEndCommandBuffer = (PFN_vkEndCommandBuffer) load("vkEndCommandBuffer", userptr);
 | 
			
		||||
    vkEnumerateDeviceExtensionProperties = (PFN_vkEnumerateDeviceExtensionProperties) load("vkEnumerateDeviceExtensionProperties", userptr);
 | 
			
		||||
    vkEnumerateDeviceLayerProperties = (PFN_vkEnumerateDeviceLayerProperties) load("vkEnumerateDeviceLayerProperties", userptr);
 | 
			
		||||
    vkEnumerateInstanceExtensionProperties = (PFN_vkEnumerateInstanceExtensionProperties) load("vkEnumerateInstanceExtensionProperties", userptr);
 | 
			
		||||
    vkEnumerateInstanceLayerProperties = (PFN_vkEnumerateInstanceLayerProperties) load("vkEnumerateInstanceLayerProperties", userptr);
 | 
			
		||||
    vkEnumeratePhysicalDevices = (PFN_vkEnumeratePhysicalDevices) load("vkEnumeratePhysicalDevices", userptr);
 | 
			
		||||
    vkFlushMappedMemoryRanges = (PFN_vkFlushMappedMemoryRanges) load("vkFlushMappedMemoryRanges", userptr);
 | 
			
		||||
    vkFreeCommandBuffers = (PFN_vkFreeCommandBuffers) load("vkFreeCommandBuffers", userptr);
 | 
			
		||||
    vkFreeDescriptorSets = (PFN_vkFreeDescriptorSets) load("vkFreeDescriptorSets", userptr);
 | 
			
		||||
    vkFreeMemory = (PFN_vkFreeMemory) load("vkFreeMemory", userptr);
 | 
			
		||||
    vkGetBufferMemoryRequirements = (PFN_vkGetBufferMemoryRequirements) load("vkGetBufferMemoryRequirements", userptr);
 | 
			
		||||
    vkGetDeviceMemoryCommitment = (PFN_vkGetDeviceMemoryCommitment) load("vkGetDeviceMemoryCommitment", userptr);
 | 
			
		||||
    vkGetDeviceProcAddr = (PFN_vkGetDeviceProcAddr) load("vkGetDeviceProcAddr", userptr);
 | 
			
		||||
    vkGetDeviceQueue = (PFN_vkGetDeviceQueue) load("vkGetDeviceQueue", userptr);
 | 
			
		||||
    vkGetEventStatus = (PFN_vkGetEventStatus) load("vkGetEventStatus", userptr);
 | 
			
		||||
    vkGetFenceStatus = (PFN_vkGetFenceStatus) load("vkGetFenceStatus", userptr);
 | 
			
		||||
    vkGetImageMemoryRequirements = (PFN_vkGetImageMemoryRequirements) load("vkGetImageMemoryRequirements", userptr);
 | 
			
		||||
    vkGetImageSparseMemoryRequirements = (PFN_vkGetImageSparseMemoryRequirements) load("vkGetImageSparseMemoryRequirements", userptr);
 | 
			
		||||
    vkGetImageSubresourceLayout = (PFN_vkGetImageSubresourceLayout) load("vkGetImageSubresourceLayout", userptr);
 | 
			
		||||
    vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr) load("vkGetInstanceProcAddr", userptr);
 | 
			
		||||
    vkGetPhysicalDeviceFeatures = (PFN_vkGetPhysicalDeviceFeatures) load("vkGetPhysicalDeviceFeatures", userptr);
 | 
			
		||||
    vkGetPhysicalDeviceFormatProperties = (PFN_vkGetPhysicalDeviceFormatProperties) load("vkGetPhysicalDeviceFormatProperties", userptr);
 | 
			
		||||
    vkGetPhysicalDeviceImageFormatProperties = (PFN_vkGetPhysicalDeviceImageFormatProperties) load("vkGetPhysicalDeviceImageFormatProperties", userptr);
 | 
			
		||||
    vkGetPhysicalDeviceMemoryProperties = (PFN_vkGetPhysicalDeviceMemoryProperties) load("vkGetPhysicalDeviceMemoryProperties", userptr);
 | 
			
		||||
    vkGetPhysicalDeviceProperties = (PFN_vkGetPhysicalDeviceProperties) load("vkGetPhysicalDeviceProperties", userptr);
 | 
			
		||||
    vkGetPhysicalDeviceQueueFamilyProperties = (PFN_vkGetPhysicalDeviceQueueFamilyProperties) load("vkGetPhysicalDeviceQueueFamilyProperties", userptr);
 | 
			
		||||
    vkGetPhysicalDeviceSparseImageFormatProperties = (PFN_vkGetPhysicalDeviceSparseImageFormatProperties) load("vkGetPhysicalDeviceSparseImageFormatProperties", userptr);
 | 
			
		||||
    vkGetPipelineCacheData = (PFN_vkGetPipelineCacheData) load("vkGetPipelineCacheData", userptr);
 | 
			
		||||
    vkGetQueryPoolResults = (PFN_vkGetQueryPoolResults) load("vkGetQueryPoolResults", userptr);
 | 
			
		||||
    vkGetRenderAreaGranularity = (PFN_vkGetRenderAreaGranularity) load("vkGetRenderAreaGranularity", userptr);
 | 
			
		||||
    vkInvalidateMappedMemoryRanges = (PFN_vkInvalidateMappedMemoryRanges) load("vkInvalidateMappedMemoryRanges", userptr);
 | 
			
		||||
    vkMapMemory = (PFN_vkMapMemory) load("vkMapMemory", userptr);
 | 
			
		||||
    vkMergePipelineCaches = (PFN_vkMergePipelineCaches) load("vkMergePipelineCaches", userptr);
 | 
			
		||||
    vkQueueBindSparse = (PFN_vkQueueBindSparse) load("vkQueueBindSparse", userptr);
 | 
			
		||||
    vkQueueSubmit = (PFN_vkQueueSubmit) load("vkQueueSubmit", userptr);
 | 
			
		||||
    vkQueueWaitIdle = (PFN_vkQueueWaitIdle) load("vkQueueWaitIdle", userptr);
 | 
			
		||||
    vkResetCommandBuffer = (PFN_vkResetCommandBuffer) load("vkResetCommandBuffer", userptr);
 | 
			
		||||
    vkResetCommandPool = (PFN_vkResetCommandPool) load("vkResetCommandPool", userptr);
 | 
			
		||||
    vkResetDescriptorPool = (PFN_vkResetDescriptorPool) load("vkResetDescriptorPool", userptr);
 | 
			
		||||
    vkResetEvent = (PFN_vkResetEvent) load("vkResetEvent", userptr);
 | 
			
		||||
    vkResetFences = (PFN_vkResetFences) load("vkResetFences", userptr);
 | 
			
		||||
    vkSetEvent = (PFN_vkSetEvent) load("vkSetEvent", userptr);
 | 
			
		||||
    vkUnmapMemory = (PFN_vkUnmapMemory) load("vkUnmapMemory", userptr);
 | 
			
		||||
    vkUpdateDescriptorSets = (PFN_vkUpdateDescriptorSets) load("vkUpdateDescriptorSets", userptr);
 | 
			
		||||
    vkWaitForFences = (PFN_vkWaitForFences) load("vkWaitForFences", userptr);
 | 
			
		||||
}
 | 
			
		||||
static void glad_vk_load_VK_VERSION_1_1( GLADuserptrloadfunc load, void* userptr) {
 | 
			
		||||
    if(!GLAD_VK_VERSION_1_1) return;
 | 
			
		||||
    vkBindBufferMemory2 = (PFN_vkBindBufferMemory2) load("vkBindBufferMemory2", userptr);
 | 
			
		||||
    vkBindImageMemory2 = (PFN_vkBindImageMemory2) load("vkBindImageMemory2", userptr);
 | 
			
		||||
    vkCmdDispatchBase = (PFN_vkCmdDispatchBase) load("vkCmdDispatchBase", userptr);
 | 
			
		||||
    vkCmdSetDeviceMask = (PFN_vkCmdSetDeviceMask) load("vkCmdSetDeviceMask", userptr);
 | 
			
		||||
    vkCreateDescriptorUpdateTemplate = (PFN_vkCreateDescriptorUpdateTemplate) load("vkCreateDescriptorUpdateTemplate", userptr);
 | 
			
		||||
    vkCreateSamplerYcbcrConversion = (PFN_vkCreateSamplerYcbcrConversion) load("vkCreateSamplerYcbcrConversion", userptr);
 | 
			
		||||
    vkDestroyDescriptorUpdateTemplate = (PFN_vkDestroyDescriptorUpdateTemplate) load("vkDestroyDescriptorUpdateTemplate", userptr);
 | 
			
		||||
    vkDestroySamplerYcbcrConversion = (PFN_vkDestroySamplerYcbcrConversion) load("vkDestroySamplerYcbcrConversion", userptr);
 | 
			
		||||
    vkEnumerateInstanceVersion = (PFN_vkEnumerateInstanceVersion) load("vkEnumerateInstanceVersion", userptr);
 | 
			
		||||
    vkEnumeratePhysicalDeviceGroups = (PFN_vkEnumeratePhysicalDeviceGroups) load("vkEnumeratePhysicalDeviceGroups", userptr);
 | 
			
		||||
    vkGetBufferMemoryRequirements2 = (PFN_vkGetBufferMemoryRequirements2) load("vkGetBufferMemoryRequirements2", userptr);
 | 
			
		||||
    vkGetDescriptorSetLayoutSupport = (PFN_vkGetDescriptorSetLayoutSupport) load("vkGetDescriptorSetLayoutSupport", userptr);
 | 
			
		||||
    vkGetDeviceGroupPeerMemoryFeatures = (PFN_vkGetDeviceGroupPeerMemoryFeatures) load("vkGetDeviceGroupPeerMemoryFeatures", userptr);
 | 
			
		||||
    vkGetDeviceQueue2 = (PFN_vkGetDeviceQueue2) load("vkGetDeviceQueue2", userptr);
 | 
			
		||||
    vkGetImageMemoryRequirements2 = (PFN_vkGetImageMemoryRequirements2) load("vkGetImageMemoryRequirements2", userptr);
 | 
			
		||||
    vkGetImageSparseMemoryRequirements2 = (PFN_vkGetImageSparseMemoryRequirements2) load("vkGetImageSparseMemoryRequirements2", userptr);
 | 
			
		||||
    vkGetPhysicalDeviceExternalBufferProperties = (PFN_vkGetPhysicalDeviceExternalBufferProperties) load("vkGetPhysicalDeviceExternalBufferProperties", userptr);
 | 
			
		||||
    vkGetPhysicalDeviceExternalFenceProperties = (PFN_vkGetPhysicalDeviceExternalFenceProperties) load("vkGetPhysicalDeviceExternalFenceProperties", userptr);
 | 
			
		||||
    vkGetPhysicalDeviceExternalSemaphoreProperties = (PFN_vkGetPhysicalDeviceExternalSemaphoreProperties) load("vkGetPhysicalDeviceExternalSemaphoreProperties", userptr);
 | 
			
		||||
    vkGetPhysicalDeviceFeatures2 = (PFN_vkGetPhysicalDeviceFeatures2) load("vkGetPhysicalDeviceFeatures2", userptr);
 | 
			
		||||
    vkGetPhysicalDeviceFormatProperties2 = (PFN_vkGetPhysicalDeviceFormatProperties2) load("vkGetPhysicalDeviceFormatProperties2", userptr);
 | 
			
		||||
    vkGetPhysicalDeviceImageFormatProperties2 = (PFN_vkGetPhysicalDeviceImageFormatProperties2) load("vkGetPhysicalDeviceImageFormatProperties2", userptr);
 | 
			
		||||
    vkGetPhysicalDeviceMemoryProperties2 = (PFN_vkGetPhysicalDeviceMemoryProperties2) load("vkGetPhysicalDeviceMemoryProperties2", userptr);
 | 
			
		||||
    vkGetPhysicalDeviceProperties2 = (PFN_vkGetPhysicalDeviceProperties2) load("vkGetPhysicalDeviceProperties2", userptr);
 | 
			
		||||
    vkGetPhysicalDeviceQueueFamilyProperties2 = (PFN_vkGetPhysicalDeviceQueueFamilyProperties2) load("vkGetPhysicalDeviceQueueFamilyProperties2", userptr);
 | 
			
		||||
    vkGetPhysicalDeviceSparseImageFormatProperties2 = (PFN_vkGetPhysicalDeviceSparseImageFormatProperties2) load("vkGetPhysicalDeviceSparseImageFormatProperties2", userptr);
 | 
			
		||||
    vkTrimCommandPool = (PFN_vkTrimCommandPool) load("vkTrimCommandPool", userptr);
 | 
			
		||||
    vkUpdateDescriptorSetWithTemplate = (PFN_vkUpdateDescriptorSetWithTemplate) load("vkUpdateDescriptorSetWithTemplate", userptr);
 | 
			
		||||
}
 | 
			
		||||
static void glad_vk_load_VK_EXT_debug_report( GLADuserptrloadfunc load, void* userptr) {
 | 
			
		||||
    if(!GLAD_VK_EXT_debug_report) return;
 | 
			
		||||
    vkCreateDebugReportCallbackEXT = (PFN_vkCreateDebugReportCallbackEXT) load("vkCreateDebugReportCallbackEXT", userptr);
 | 
			
		||||
    vkDebugReportMessageEXT = (PFN_vkDebugReportMessageEXT) load("vkDebugReportMessageEXT", userptr);
 | 
			
		||||
    vkDestroyDebugReportCallbackEXT = (PFN_vkDestroyDebugReportCallbackEXT) load("vkDestroyDebugReportCallbackEXT", userptr);
 | 
			
		||||
}
 | 
			
		||||
static void glad_vk_load_VK_KHR_surface( GLADuserptrloadfunc load, void* userptr) {
 | 
			
		||||
    if(!GLAD_VK_KHR_surface) return;
 | 
			
		||||
    vkDestroySurfaceKHR = (PFN_vkDestroySurfaceKHR) load("vkDestroySurfaceKHR", userptr);
 | 
			
		||||
    vkGetPhysicalDeviceSurfaceCapabilitiesKHR = (PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR) load("vkGetPhysicalDeviceSurfaceCapabilitiesKHR", userptr);
 | 
			
		||||
    vkGetPhysicalDeviceSurfaceFormatsKHR = (PFN_vkGetPhysicalDeviceSurfaceFormatsKHR) load("vkGetPhysicalDeviceSurfaceFormatsKHR", userptr);
 | 
			
		||||
    vkGetPhysicalDeviceSurfacePresentModesKHR = (PFN_vkGetPhysicalDeviceSurfacePresentModesKHR) load("vkGetPhysicalDeviceSurfacePresentModesKHR", userptr);
 | 
			
		||||
    vkGetPhysicalDeviceSurfaceSupportKHR = (PFN_vkGetPhysicalDeviceSurfaceSupportKHR) load("vkGetPhysicalDeviceSurfaceSupportKHR", userptr);
 | 
			
		||||
}
 | 
			
		||||
static void glad_vk_load_VK_KHR_swapchain( GLADuserptrloadfunc load, void* userptr) {
 | 
			
		||||
    if(!GLAD_VK_KHR_swapchain) return;
 | 
			
		||||
    vkAcquireNextImage2KHR = (PFN_vkAcquireNextImage2KHR) load("vkAcquireNextImage2KHR", userptr);
 | 
			
		||||
    vkAcquireNextImageKHR = (PFN_vkAcquireNextImageKHR) load("vkAcquireNextImageKHR", userptr);
 | 
			
		||||
    vkCreateSwapchainKHR = (PFN_vkCreateSwapchainKHR) load("vkCreateSwapchainKHR", userptr);
 | 
			
		||||
    vkDestroySwapchainKHR = (PFN_vkDestroySwapchainKHR) load("vkDestroySwapchainKHR", userptr);
 | 
			
		||||
    vkGetDeviceGroupPresentCapabilitiesKHR = (PFN_vkGetDeviceGroupPresentCapabilitiesKHR) load("vkGetDeviceGroupPresentCapabilitiesKHR", userptr);
 | 
			
		||||
    vkGetDeviceGroupSurfacePresentModesKHR = (PFN_vkGetDeviceGroupSurfacePresentModesKHR) load("vkGetDeviceGroupSurfacePresentModesKHR", userptr);
 | 
			
		||||
    vkGetPhysicalDevicePresentRectanglesKHR = (PFN_vkGetPhysicalDevicePresentRectanglesKHR) load("vkGetPhysicalDevicePresentRectanglesKHR", userptr);
 | 
			
		||||
    vkGetSwapchainImagesKHR = (PFN_vkGetSwapchainImagesKHR) load("vkGetSwapchainImagesKHR", userptr);
 | 
			
		||||
    vkQueuePresentKHR = (PFN_vkQueuePresentKHR) load("vkQueuePresentKHR", userptr);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static int glad_vk_get_extensions( VkPhysicalDevice physical_device, uint32_t *out_extension_count, char ***out_extensions) {
 | 
			
		||||
    uint32_t i;
 | 
			
		||||
    uint32_t instance_extension_count = 0;
 | 
			
		||||
    uint32_t device_extension_count = 0;
 | 
			
		||||
    uint32_t max_extension_count;
 | 
			
		||||
    uint32_t total_extension_count;
 | 
			
		||||
    char **extensions;
 | 
			
		||||
    VkExtensionProperties *ext_properties;
 | 
			
		||||
    VkResult result;
 | 
			
		||||
 | 
			
		||||
    if (vkEnumerateInstanceExtensionProperties == NULL || (physical_device != NULL && vkEnumerateDeviceExtensionProperties == NULL)) {
 | 
			
		||||
        return 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    result = vkEnumerateInstanceExtensionProperties(NULL, &instance_extension_count, NULL);
 | 
			
		||||
    if (result != VK_SUCCESS) {
 | 
			
		||||
        return 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (physical_device != NULL) {
 | 
			
		||||
        result = vkEnumerateDeviceExtensionProperties(physical_device, NULL, &device_extension_count, NULL);
 | 
			
		||||
        if (result != VK_SUCCESS) {
 | 
			
		||||
            return 0;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    total_extension_count = instance_extension_count + device_extension_count;
 | 
			
		||||
    max_extension_count = instance_extension_count > device_extension_count
 | 
			
		||||
        ? instance_extension_count : device_extension_count;
 | 
			
		||||
 | 
			
		||||
    ext_properties = (VkExtensionProperties*) malloc(max_extension_count * sizeof(VkExtensionProperties));
 | 
			
		||||
    if (ext_properties == NULL) {
 | 
			
		||||
        return 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    result = vkEnumerateInstanceExtensionProperties(NULL, &instance_extension_count, ext_properties);
 | 
			
		||||
    if (result != VK_SUCCESS) {
 | 
			
		||||
        free((void*) ext_properties);
 | 
			
		||||
        return 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    extensions = (char**) calloc(total_extension_count, sizeof(char*));
 | 
			
		||||
    if (extensions == NULL) {
 | 
			
		||||
        free((void*) ext_properties);
 | 
			
		||||
        return 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    for (i = 0; i < instance_extension_count; ++i) {
 | 
			
		||||
        VkExtensionProperties ext = ext_properties[i];
 | 
			
		||||
 | 
			
		||||
        size_t extension_name_length = strlen(ext.extensionName) + 1;
 | 
			
		||||
        extensions[i] = (char*) malloc(extension_name_length * sizeof(char));
 | 
			
		||||
        memcpy(extensions[i], ext.extensionName, extension_name_length * sizeof(char));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (physical_device != NULL) {
 | 
			
		||||
        result = vkEnumerateDeviceExtensionProperties(physical_device, NULL, &device_extension_count, ext_properties);
 | 
			
		||||
        if (result != VK_SUCCESS) {
 | 
			
		||||
            for (i = 0; i < instance_extension_count; ++i) {
 | 
			
		||||
                free((void*) extensions[i]);
 | 
			
		||||
            }
 | 
			
		||||
            free(extensions);
 | 
			
		||||
            return 0;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        for (i = 0; i < device_extension_count; ++i) {
 | 
			
		||||
            VkExtensionProperties ext = ext_properties[i];
 | 
			
		||||
 | 
			
		||||
            size_t extension_name_length = strlen(ext.extensionName) + 1;
 | 
			
		||||
            extensions[instance_extension_count + i] = (char*) malloc(extension_name_length * sizeof(char));
 | 
			
		||||
            memcpy(extensions[instance_extension_count + i], ext.extensionName, extension_name_length * sizeof(char));
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    free((void*) ext_properties);
 | 
			
		||||
 | 
			
		||||
    *out_extension_count = total_extension_count;
 | 
			
		||||
    *out_extensions = extensions;
 | 
			
		||||
 | 
			
		||||
    return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void glad_vk_free_extensions(uint32_t extension_count, char **extensions) {
 | 
			
		||||
    uint32_t i;
 | 
			
		||||
 | 
			
		||||
    for(i = 0; i < extension_count ; ++i) {
 | 
			
		||||
        free((void*) (extensions[i]));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    free((void*) extensions);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int glad_vk_has_extension(const char *name, uint32_t extension_count, char **extensions) {
 | 
			
		||||
    uint32_t i;
 | 
			
		||||
 | 
			
		||||
    for (i = 0; i < extension_count; ++i) {
 | 
			
		||||
        if(strcmp(name, extensions[i]) == 0) {
 | 
			
		||||
            return 1;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static GLADapiproc glad_vk_get_proc_from_userptr(const char* name, void *userptr) {
 | 
			
		||||
    return (GLAD_GNUC_EXTENSION (GLADapiproc (*)(const char *name)) userptr)(name);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int glad_vk_find_extensions_vulkan( VkPhysicalDevice physical_device) {
 | 
			
		||||
    uint32_t extension_count = 0;
 | 
			
		||||
    char **extensions = NULL;
 | 
			
		||||
    if (!glad_vk_get_extensions(physical_device, &extension_count, &extensions)) return 0;
 | 
			
		||||
 | 
			
		||||
    GLAD_VK_EXT_debug_report = glad_vk_has_extension("VK_EXT_debug_report", extension_count, extensions);
 | 
			
		||||
    GLAD_VK_KHR_surface = glad_vk_has_extension("VK_KHR_surface", extension_count, extensions);
 | 
			
		||||
    GLAD_VK_KHR_swapchain = glad_vk_has_extension("VK_KHR_swapchain", extension_count, extensions);
 | 
			
		||||
 | 
			
		||||
    glad_vk_free_extensions(extension_count, extensions);
 | 
			
		||||
 | 
			
		||||
    return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int glad_vk_find_core_vulkan( VkPhysicalDevice physical_device) {
 | 
			
		||||
    int major = 1;
 | 
			
		||||
    int minor = 0;
 | 
			
		||||
 | 
			
		||||
#ifdef VK_VERSION_1_1
 | 
			
		||||
    if (vkEnumerateInstanceVersion  != NULL) {
 | 
			
		||||
        uint32_t version;
 | 
			
		||||
        VkResult result;
 | 
			
		||||
 | 
			
		||||
        result = vkEnumerateInstanceVersion(&version);
 | 
			
		||||
        if (result == VK_SUCCESS) {
 | 
			
		||||
            major = (int) VK_VERSION_MAJOR(version);
 | 
			
		||||
            minor = (int) VK_VERSION_MINOR(version);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    if (physical_device != NULL && vkGetPhysicalDeviceProperties  != NULL) {
 | 
			
		||||
        VkPhysicalDeviceProperties properties;
 | 
			
		||||
        vkGetPhysicalDeviceProperties(physical_device, &properties);
 | 
			
		||||
 | 
			
		||||
        major = (int) VK_VERSION_MAJOR(properties.apiVersion);
 | 
			
		||||
        minor = (int) VK_VERSION_MINOR(properties.apiVersion);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    GLAD_VK_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1;
 | 
			
		||||
    GLAD_VK_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1;
 | 
			
		||||
 | 
			
		||||
    return GLAD_MAKE_VERSION(major, minor);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int gladLoadVulkanUserPtr( VkPhysicalDevice physical_device, GLADuserptrloadfunc load, void *userptr) {
 | 
			
		||||
    int version;
 | 
			
		||||
 | 
			
		||||
#ifdef VK_VERSION_1_1
 | 
			
		||||
    vkEnumerateInstanceVersion  = (PFN_vkEnumerateInstanceVersion) load("vkEnumerateInstanceVersion", userptr);
 | 
			
		||||
#endif
 | 
			
		||||
    version = glad_vk_find_core_vulkan( physical_device);
 | 
			
		||||
    if (!version) {
 | 
			
		||||
        return 0;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    glad_vk_load_VK_VERSION_1_0(load, userptr);
 | 
			
		||||
    glad_vk_load_VK_VERSION_1_1(load, userptr);
 | 
			
		||||
 | 
			
		||||
    if (!glad_vk_find_extensions_vulkan( physical_device)) return 0;
 | 
			
		||||
    glad_vk_load_VK_EXT_debug_report(load, userptr);
 | 
			
		||||
    glad_vk_load_VK_KHR_surface(load, userptr);
 | 
			
		||||
    glad_vk_load_VK_KHR_swapchain(load, userptr);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    return version;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
int gladLoadVulkan( VkPhysicalDevice physical_device, GLADloadfunc load) {
 | 
			
		||||
    return gladLoadVulkanUserPtr( physical_device, glad_vk_get_proc_from_userptr, GLAD_GNUC_EXTENSION (void*) load);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										574
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/linmath.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										574
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/linmath.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,574 @@
 | 
			
		||||
#ifndef LINMATH_H
 | 
			
		||||
#define LINMATH_H
 | 
			
		||||
 | 
			
		||||
#include <math.h>
 | 
			
		||||
 | 
			
		||||
#ifdef _MSC_VER
 | 
			
		||||
#define inline __inline
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define LINMATH_H_DEFINE_VEC(n) \
 | 
			
		||||
typedef float vec##n[n]; \
 | 
			
		||||
static inline void vec##n##_add(vec##n r, vec##n const a, vec##n const b) \
 | 
			
		||||
{ \
 | 
			
		||||
	int i; \
 | 
			
		||||
	for(i=0; i<n; ++i) \
 | 
			
		||||
		r[i] = a[i] + b[i]; \
 | 
			
		||||
} \
 | 
			
		||||
static inline void vec##n##_sub(vec##n r, vec##n const a, vec##n const b) \
 | 
			
		||||
{ \
 | 
			
		||||
	int i; \
 | 
			
		||||
	for(i=0; i<n; ++i) \
 | 
			
		||||
		r[i] = a[i] - b[i]; \
 | 
			
		||||
} \
 | 
			
		||||
static inline void vec##n##_scale(vec##n r, vec##n const v, float const s) \
 | 
			
		||||
{ \
 | 
			
		||||
	int i; \
 | 
			
		||||
	for(i=0; i<n; ++i) \
 | 
			
		||||
		r[i] = v[i] * s; \
 | 
			
		||||
} \
 | 
			
		||||
static inline float vec##n##_mul_inner(vec##n const a, vec##n const b) \
 | 
			
		||||
{ \
 | 
			
		||||
	float p = 0.; \
 | 
			
		||||
	int i; \
 | 
			
		||||
	for(i=0; i<n; ++i) \
 | 
			
		||||
		p += b[i]*a[i]; \
 | 
			
		||||
	return p; \
 | 
			
		||||
} \
 | 
			
		||||
static inline float vec##n##_len(vec##n const v) \
 | 
			
		||||
{ \
 | 
			
		||||
	return (float) sqrt(vec##n##_mul_inner(v,v)); \
 | 
			
		||||
} \
 | 
			
		||||
static inline void vec##n##_norm(vec##n r, vec##n const v) \
 | 
			
		||||
{ \
 | 
			
		||||
	float k = 1.f / vec##n##_len(v); \
 | 
			
		||||
	vec##n##_scale(r, v, k); \
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
LINMATH_H_DEFINE_VEC(2)
 | 
			
		||||
LINMATH_H_DEFINE_VEC(3)
 | 
			
		||||
LINMATH_H_DEFINE_VEC(4)
 | 
			
		||||
 | 
			
		||||
static inline void vec3_mul_cross(vec3 r, vec3 const a, vec3 const b)
 | 
			
		||||
{
 | 
			
		||||
	r[0] = a[1]*b[2] - a[2]*b[1];
 | 
			
		||||
	r[1] = a[2]*b[0] - a[0]*b[2];
 | 
			
		||||
	r[2] = a[0]*b[1] - a[1]*b[0];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static inline void vec3_reflect(vec3 r, vec3 const v, vec3 const n)
 | 
			
		||||
{
 | 
			
		||||
	float p  = 2.f*vec3_mul_inner(v, n);
 | 
			
		||||
	int i;
 | 
			
		||||
	for(i=0;i<3;++i)
 | 
			
		||||
		r[i] = v[i] - p*n[i];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static inline void vec4_mul_cross(vec4 r, vec4 a, vec4 b)
 | 
			
		||||
{
 | 
			
		||||
	r[0] = a[1]*b[2] - a[2]*b[1];
 | 
			
		||||
	r[1] = a[2]*b[0] - a[0]*b[2];
 | 
			
		||||
	r[2] = a[0]*b[1] - a[1]*b[0];
 | 
			
		||||
	r[3] = 1.f;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static inline void vec4_reflect(vec4 r, vec4 v, vec4 n)
 | 
			
		||||
{
 | 
			
		||||
	float p  = 2.f*vec4_mul_inner(v, n);
 | 
			
		||||
	int i;
 | 
			
		||||
	for(i=0;i<4;++i)
 | 
			
		||||
		r[i] = v[i] - p*n[i];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
typedef vec4 mat4x4[4];
 | 
			
		||||
static inline void mat4x4_identity(mat4x4 M)
 | 
			
		||||
{
 | 
			
		||||
	int i, j;
 | 
			
		||||
	for(i=0; i<4; ++i)
 | 
			
		||||
		for(j=0; j<4; ++j)
 | 
			
		||||
			M[i][j] = i==j ? 1.f : 0.f;
 | 
			
		||||
}
 | 
			
		||||
static inline void mat4x4_dup(mat4x4 M, mat4x4 N)
 | 
			
		||||
{
 | 
			
		||||
	int i, j;
 | 
			
		||||
	for(i=0; i<4; ++i)
 | 
			
		||||
		for(j=0; j<4; ++j)
 | 
			
		||||
			M[i][j] = N[i][j];
 | 
			
		||||
}
 | 
			
		||||
static inline void mat4x4_row(vec4 r, mat4x4 M, int i)
 | 
			
		||||
{
 | 
			
		||||
	int k;
 | 
			
		||||
	for(k=0; k<4; ++k)
 | 
			
		||||
		r[k] = M[k][i];
 | 
			
		||||
}
 | 
			
		||||
static inline void mat4x4_col(vec4 r, mat4x4 M, int i)
 | 
			
		||||
{
 | 
			
		||||
	int k;
 | 
			
		||||
	for(k=0; k<4; ++k)
 | 
			
		||||
		r[k] = M[i][k];
 | 
			
		||||
}
 | 
			
		||||
static inline void mat4x4_transpose(mat4x4 M, mat4x4 N)
 | 
			
		||||
{
 | 
			
		||||
	int i, j;
 | 
			
		||||
	for(j=0; j<4; ++j)
 | 
			
		||||
		for(i=0; i<4; ++i)
 | 
			
		||||
			M[i][j] = N[j][i];
 | 
			
		||||
}
 | 
			
		||||
static inline void mat4x4_add(mat4x4 M, mat4x4 a, mat4x4 b)
 | 
			
		||||
{
 | 
			
		||||
	int i;
 | 
			
		||||
	for(i=0; i<4; ++i)
 | 
			
		||||
		vec4_add(M[i], a[i], b[i]);
 | 
			
		||||
}
 | 
			
		||||
static inline void mat4x4_sub(mat4x4 M, mat4x4 a, mat4x4 b)
 | 
			
		||||
{
 | 
			
		||||
	int i;
 | 
			
		||||
	for(i=0; i<4; ++i)
 | 
			
		||||
		vec4_sub(M[i], a[i], b[i]);
 | 
			
		||||
}
 | 
			
		||||
static inline void mat4x4_scale(mat4x4 M, mat4x4 a, float k)
 | 
			
		||||
{
 | 
			
		||||
	int i;
 | 
			
		||||
	for(i=0; i<4; ++i)
 | 
			
		||||
		vec4_scale(M[i], a[i], k);
 | 
			
		||||
}
 | 
			
		||||
static inline void mat4x4_scale_aniso(mat4x4 M, mat4x4 a, float x, float y, float z)
 | 
			
		||||
{
 | 
			
		||||
	int i;
 | 
			
		||||
	vec4_scale(M[0], a[0], x);
 | 
			
		||||
	vec4_scale(M[1], a[1], y);
 | 
			
		||||
	vec4_scale(M[2], a[2], z);
 | 
			
		||||
	for(i = 0; i < 4; ++i) {
 | 
			
		||||
		M[3][i] = a[3][i];
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
static inline void mat4x4_mul(mat4x4 M, mat4x4 a, mat4x4 b)
 | 
			
		||||
{
 | 
			
		||||
	mat4x4 temp;
 | 
			
		||||
	int k, r, c;
 | 
			
		||||
	for(c=0; c<4; ++c) for(r=0; r<4; ++r) {
 | 
			
		||||
		temp[c][r] = 0.f;
 | 
			
		||||
		for(k=0; k<4; ++k)
 | 
			
		||||
			temp[c][r] += a[k][r] * b[c][k];
 | 
			
		||||
	}
 | 
			
		||||
	mat4x4_dup(M, temp);
 | 
			
		||||
}
 | 
			
		||||
static inline void mat4x4_mul_vec4(vec4 r, mat4x4 M, vec4 v)
 | 
			
		||||
{
 | 
			
		||||
	int i, j;
 | 
			
		||||
	for(j=0; j<4; ++j) {
 | 
			
		||||
		r[j] = 0.f;
 | 
			
		||||
		for(i=0; i<4; ++i)
 | 
			
		||||
			r[j] += M[i][j] * v[i];
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
static inline void mat4x4_translate(mat4x4 T, float x, float y, float z)
 | 
			
		||||
{
 | 
			
		||||
	mat4x4_identity(T);
 | 
			
		||||
	T[3][0] = x;
 | 
			
		||||
	T[3][1] = y;
 | 
			
		||||
	T[3][2] = z;
 | 
			
		||||
}
 | 
			
		||||
static inline void mat4x4_translate_in_place(mat4x4 M, float x, float y, float z)
 | 
			
		||||
{
 | 
			
		||||
	vec4 t = {x, y, z, 0};
 | 
			
		||||
	vec4 r;
 | 
			
		||||
	int i;
 | 
			
		||||
	for (i = 0; i < 4; ++i) {
 | 
			
		||||
		mat4x4_row(r, M, i);
 | 
			
		||||
		M[3][i] += vec4_mul_inner(r, t);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
static inline void mat4x4_from_vec3_mul_outer(mat4x4 M, vec3 a, vec3 b)
 | 
			
		||||
{
 | 
			
		||||
	int i, j;
 | 
			
		||||
	for(i=0; i<4; ++i) for(j=0; j<4; ++j)
 | 
			
		||||
		M[i][j] = i<3 && j<3 ? a[i] * b[j] : 0.f;
 | 
			
		||||
}
 | 
			
		||||
static inline void mat4x4_rotate(mat4x4 R, mat4x4 M, float x, float y, float z, float angle)
 | 
			
		||||
{
 | 
			
		||||
	float s = sinf(angle);
 | 
			
		||||
	float c = cosf(angle);
 | 
			
		||||
	vec3 u = {x, y, z};
 | 
			
		||||
 | 
			
		||||
	if(vec3_len(u) > 1e-4) {
 | 
			
		||||
		mat4x4 T, C, S = {{0}};
 | 
			
		||||
 | 
			
		||||
		vec3_norm(u, u);
 | 
			
		||||
		mat4x4_from_vec3_mul_outer(T, u, u);
 | 
			
		||||
 | 
			
		||||
		S[1][2] =  u[0];
 | 
			
		||||
		S[2][1] = -u[0];
 | 
			
		||||
		S[2][0] =  u[1];
 | 
			
		||||
		S[0][2] = -u[1];
 | 
			
		||||
		S[0][1] =  u[2];
 | 
			
		||||
		S[1][0] = -u[2];
 | 
			
		||||
 | 
			
		||||
		mat4x4_scale(S, S, s);
 | 
			
		||||
 | 
			
		||||
		mat4x4_identity(C);
 | 
			
		||||
		mat4x4_sub(C, C, T);
 | 
			
		||||
 | 
			
		||||
		mat4x4_scale(C, C, c);
 | 
			
		||||
 | 
			
		||||
		mat4x4_add(T, T, C);
 | 
			
		||||
		mat4x4_add(T, T, S);
 | 
			
		||||
 | 
			
		||||
		T[3][3] = 1.;
 | 
			
		||||
		mat4x4_mul(R, M, T);
 | 
			
		||||
	} else {
 | 
			
		||||
		mat4x4_dup(R, M);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
static inline void mat4x4_rotate_X(mat4x4 Q, mat4x4 M, float angle)
 | 
			
		||||
{
 | 
			
		||||
	float s = sinf(angle);
 | 
			
		||||
	float c = cosf(angle);
 | 
			
		||||
	mat4x4 R = {
 | 
			
		||||
		{1.f, 0.f, 0.f, 0.f},
 | 
			
		||||
		{0.f,   c,   s, 0.f},
 | 
			
		||||
		{0.f,  -s,   c, 0.f},
 | 
			
		||||
		{0.f, 0.f, 0.f, 1.f}
 | 
			
		||||
	};
 | 
			
		||||
	mat4x4_mul(Q, M, R);
 | 
			
		||||
}
 | 
			
		||||
static inline void mat4x4_rotate_Y(mat4x4 Q, mat4x4 M, float angle)
 | 
			
		||||
{
 | 
			
		||||
	float s = sinf(angle);
 | 
			
		||||
	float c = cosf(angle);
 | 
			
		||||
	mat4x4 R = {
 | 
			
		||||
		{   c, 0.f,   s, 0.f},
 | 
			
		||||
		{ 0.f, 1.f, 0.f, 0.f},
 | 
			
		||||
		{  -s, 0.f,   c, 0.f},
 | 
			
		||||
		{ 0.f, 0.f, 0.f, 1.f}
 | 
			
		||||
	};
 | 
			
		||||
	mat4x4_mul(Q, M, R);
 | 
			
		||||
}
 | 
			
		||||
static inline void mat4x4_rotate_Z(mat4x4 Q, mat4x4 M, float angle)
 | 
			
		||||
{
 | 
			
		||||
	float s = sinf(angle);
 | 
			
		||||
	float c = cosf(angle);
 | 
			
		||||
	mat4x4 R = {
 | 
			
		||||
		{   c,   s, 0.f, 0.f},
 | 
			
		||||
		{  -s,   c, 0.f, 0.f},
 | 
			
		||||
		{ 0.f, 0.f, 1.f, 0.f},
 | 
			
		||||
		{ 0.f, 0.f, 0.f, 1.f}
 | 
			
		||||
	};
 | 
			
		||||
	mat4x4_mul(Q, M, R);
 | 
			
		||||
}
 | 
			
		||||
static inline void mat4x4_invert(mat4x4 T, mat4x4 M)
 | 
			
		||||
{
 | 
			
		||||
	float idet;
 | 
			
		||||
	float s[6];
 | 
			
		||||
	float c[6];
 | 
			
		||||
	s[0] = M[0][0]*M[1][1] - M[1][0]*M[0][1];
 | 
			
		||||
	s[1] = M[0][0]*M[1][2] - M[1][0]*M[0][2];
 | 
			
		||||
	s[2] = M[0][0]*M[1][3] - M[1][0]*M[0][3];
 | 
			
		||||
	s[3] = M[0][1]*M[1][2] - M[1][1]*M[0][2];
 | 
			
		||||
	s[4] = M[0][1]*M[1][3] - M[1][1]*M[0][3];
 | 
			
		||||
	s[5] = M[0][2]*M[1][3] - M[1][2]*M[0][3];
 | 
			
		||||
 | 
			
		||||
	c[0] = M[2][0]*M[3][1] - M[3][0]*M[2][1];
 | 
			
		||||
	c[1] = M[2][0]*M[3][2] - M[3][0]*M[2][2];
 | 
			
		||||
	c[2] = M[2][0]*M[3][3] - M[3][0]*M[2][3];
 | 
			
		||||
	c[3] = M[2][1]*M[3][2] - M[3][1]*M[2][2];
 | 
			
		||||
	c[4] = M[2][1]*M[3][3] - M[3][1]*M[2][3];
 | 
			
		||||
	c[5] = M[2][2]*M[3][3] - M[3][2]*M[2][3];
 | 
			
		||||
 | 
			
		||||
	/* Assumes it is invertible */
 | 
			
		||||
	idet = 1.0f/( s[0]*c[5]-s[1]*c[4]+s[2]*c[3]+s[3]*c[2]-s[4]*c[1]+s[5]*c[0] );
 | 
			
		||||
 | 
			
		||||
	T[0][0] = ( M[1][1] * c[5] - M[1][2] * c[4] + M[1][3] * c[3]) * idet;
 | 
			
		||||
	T[0][1] = (-M[0][1] * c[5] + M[0][2] * c[4] - M[0][3] * c[3]) * idet;
 | 
			
		||||
	T[0][2] = ( M[3][1] * s[5] - M[3][2] * s[4] + M[3][3] * s[3]) * idet;
 | 
			
		||||
	T[0][3] = (-M[2][1] * s[5] + M[2][2] * s[4] - M[2][3] * s[3]) * idet;
 | 
			
		||||
 | 
			
		||||
	T[1][0] = (-M[1][0] * c[5] + M[1][2] * c[2] - M[1][3] * c[1]) * idet;
 | 
			
		||||
	T[1][1] = ( M[0][0] * c[5] - M[0][2] * c[2] + M[0][3] * c[1]) * idet;
 | 
			
		||||
	T[1][2] = (-M[3][0] * s[5] + M[3][2] * s[2] - M[3][3] * s[1]) * idet;
 | 
			
		||||
	T[1][3] = ( M[2][0] * s[5] - M[2][2] * s[2] + M[2][3] * s[1]) * idet;
 | 
			
		||||
 | 
			
		||||
	T[2][0] = ( M[1][0] * c[4] - M[1][1] * c[2] + M[1][3] * c[0]) * idet;
 | 
			
		||||
	T[2][1] = (-M[0][0] * c[4] + M[0][1] * c[2] - M[0][3] * c[0]) * idet;
 | 
			
		||||
	T[2][2] = ( M[3][0] * s[4] - M[3][1] * s[2] + M[3][3] * s[0]) * idet;
 | 
			
		||||
	T[2][3] = (-M[2][0] * s[4] + M[2][1] * s[2] - M[2][3] * s[0]) * idet;
 | 
			
		||||
 | 
			
		||||
	T[3][0] = (-M[1][0] * c[3] + M[1][1] * c[1] - M[1][2] * c[0]) * idet;
 | 
			
		||||
	T[3][1] = ( M[0][0] * c[3] - M[0][1] * c[1] + M[0][2] * c[0]) * idet;
 | 
			
		||||
	T[3][2] = (-M[3][0] * s[3] + M[3][1] * s[1] - M[3][2] * s[0]) * idet;
 | 
			
		||||
	T[3][3] = ( M[2][0] * s[3] - M[2][1] * s[1] + M[2][2] * s[0]) * idet;
 | 
			
		||||
}
 | 
			
		||||
static inline void mat4x4_orthonormalize(mat4x4 R, mat4x4 M)
 | 
			
		||||
{
 | 
			
		||||
	float s = 1.;
 | 
			
		||||
	vec3 h;
 | 
			
		||||
 | 
			
		||||
	mat4x4_dup(R, M);
 | 
			
		||||
	vec3_norm(R[2], R[2]);
 | 
			
		||||
 | 
			
		||||
	s = vec3_mul_inner(R[1], R[2]);
 | 
			
		||||
	vec3_scale(h, R[2], s);
 | 
			
		||||
	vec3_sub(R[1], R[1], h);
 | 
			
		||||
	vec3_norm(R[2], R[2]);
 | 
			
		||||
 | 
			
		||||
	s = vec3_mul_inner(R[1], R[2]);
 | 
			
		||||
	vec3_scale(h, R[2], s);
 | 
			
		||||
	vec3_sub(R[1], R[1], h);
 | 
			
		||||
	vec3_norm(R[1], R[1]);
 | 
			
		||||
 | 
			
		||||
	s = vec3_mul_inner(R[0], R[1]);
 | 
			
		||||
	vec3_scale(h, R[1], s);
 | 
			
		||||
	vec3_sub(R[0], R[0], h);
 | 
			
		||||
	vec3_norm(R[0], R[0]);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static inline void mat4x4_frustum(mat4x4 M, float l, float r, float b, float t, float n, float f)
 | 
			
		||||
{
 | 
			
		||||
	M[0][0] = 2.f*n/(r-l);
 | 
			
		||||
	M[0][1] = M[0][2] = M[0][3] = 0.f;
 | 
			
		||||
 | 
			
		||||
	M[1][1] = 2.f*n/(t-b);
 | 
			
		||||
	M[1][0] = M[1][2] = M[1][3] = 0.f;
 | 
			
		||||
 | 
			
		||||
	M[2][0] = (r+l)/(r-l);
 | 
			
		||||
	M[2][1] = (t+b)/(t-b);
 | 
			
		||||
	M[2][2] = -(f+n)/(f-n);
 | 
			
		||||
	M[2][3] = -1.f;
 | 
			
		||||
 | 
			
		||||
	M[3][2] = -2.f*(f*n)/(f-n);
 | 
			
		||||
	M[3][0] = M[3][1] = M[3][3] = 0.f;
 | 
			
		||||
}
 | 
			
		||||
static inline void mat4x4_ortho(mat4x4 M, float l, float r, float b, float t, float n, float f)
 | 
			
		||||
{
 | 
			
		||||
	M[0][0] = 2.f/(r-l);
 | 
			
		||||
	M[0][1] = M[0][2] = M[0][3] = 0.f;
 | 
			
		||||
 | 
			
		||||
	M[1][1] = 2.f/(t-b);
 | 
			
		||||
	M[1][0] = M[1][2] = M[1][3] = 0.f;
 | 
			
		||||
 | 
			
		||||
	M[2][2] = -2.f/(f-n);
 | 
			
		||||
	M[2][0] = M[2][1] = M[2][3] = 0.f;
 | 
			
		||||
 | 
			
		||||
	M[3][0] = -(r+l)/(r-l);
 | 
			
		||||
	M[3][1] = -(t+b)/(t-b);
 | 
			
		||||
	M[3][2] = -(f+n)/(f-n);
 | 
			
		||||
	M[3][3] = 1.f;
 | 
			
		||||
}
 | 
			
		||||
static inline void mat4x4_perspective(mat4x4 m, float y_fov, float aspect, float n, float f)
 | 
			
		||||
{
 | 
			
		||||
	/* NOTE: Degrees are an unhandy unit to work with.
 | 
			
		||||
	 * linmath.h uses radians for everything! */
 | 
			
		||||
	float const a = 1.f / (float) tan(y_fov / 2.f);
 | 
			
		||||
 | 
			
		||||
	m[0][0] = a / aspect;
 | 
			
		||||
	m[0][1] = 0.f;
 | 
			
		||||
	m[0][2] = 0.f;
 | 
			
		||||
	m[0][3] = 0.f;
 | 
			
		||||
 | 
			
		||||
	m[1][0] = 0.f;
 | 
			
		||||
	m[1][1] = a;
 | 
			
		||||
	m[1][2] = 0.f;
 | 
			
		||||
	m[1][3] = 0.f;
 | 
			
		||||
 | 
			
		||||
	m[2][0] = 0.f;
 | 
			
		||||
	m[2][1] = 0.f;
 | 
			
		||||
	m[2][2] = -((f + n) / (f - n));
 | 
			
		||||
	m[2][3] = -1.f;
 | 
			
		||||
 | 
			
		||||
	m[3][0] = 0.f;
 | 
			
		||||
	m[3][1] = 0.f;
 | 
			
		||||
	m[3][2] = -((2.f * f * n) / (f - n));
 | 
			
		||||
	m[3][3] = 0.f;
 | 
			
		||||
}
 | 
			
		||||
static inline void mat4x4_look_at(mat4x4 m, vec3 eye, vec3 center, vec3 up)
 | 
			
		||||
{
 | 
			
		||||
	/* Adapted from Android's OpenGL Matrix.java.                        */
 | 
			
		||||
	/* See the OpenGL GLUT documentation for gluLookAt for a description */
 | 
			
		||||
	/* of the algorithm. We implement it in a straightforward way:       */
 | 
			
		||||
 | 
			
		||||
	/* TODO: The negation of of can be spared by swapping the order of
 | 
			
		||||
	 *       operands in the following cross products in the right way. */
 | 
			
		||||
	vec3 f;
 | 
			
		||||
	vec3 s;
 | 
			
		||||
	vec3 t;
 | 
			
		||||
 | 
			
		||||
	vec3_sub(f, center, eye);
 | 
			
		||||
	vec3_norm(f, f);
 | 
			
		||||
 | 
			
		||||
	vec3_mul_cross(s, f, up);
 | 
			
		||||
	vec3_norm(s, s);
 | 
			
		||||
 | 
			
		||||
	vec3_mul_cross(t, s, f);
 | 
			
		||||
 | 
			
		||||
	m[0][0] =  s[0];
 | 
			
		||||
	m[0][1] =  t[0];
 | 
			
		||||
	m[0][2] = -f[0];
 | 
			
		||||
	m[0][3] =   0.f;
 | 
			
		||||
 | 
			
		||||
	m[1][0] =  s[1];
 | 
			
		||||
	m[1][1] =  t[1];
 | 
			
		||||
	m[1][2] = -f[1];
 | 
			
		||||
	m[1][3] =   0.f;
 | 
			
		||||
 | 
			
		||||
	m[2][0] =  s[2];
 | 
			
		||||
	m[2][1] =  t[2];
 | 
			
		||||
	m[2][2] = -f[2];
 | 
			
		||||
	m[2][3] =   0.f;
 | 
			
		||||
 | 
			
		||||
	m[3][0] =  0.f;
 | 
			
		||||
	m[3][1] =  0.f;
 | 
			
		||||
	m[3][2] =  0.f;
 | 
			
		||||
	m[3][3] =  1.f;
 | 
			
		||||
 | 
			
		||||
	mat4x4_translate_in_place(m, -eye[0], -eye[1], -eye[2]);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
typedef float quat[4];
 | 
			
		||||
static inline void quat_identity(quat q)
 | 
			
		||||
{
 | 
			
		||||
	q[0] = q[1] = q[2] = 0.f;
 | 
			
		||||
	q[3] = 1.f;
 | 
			
		||||
}
 | 
			
		||||
static inline void quat_add(quat r, quat a, quat b)
 | 
			
		||||
{
 | 
			
		||||
	int i;
 | 
			
		||||
	for(i=0; i<4; ++i)
 | 
			
		||||
		r[i] = a[i] + b[i];
 | 
			
		||||
}
 | 
			
		||||
static inline void quat_sub(quat r, quat a, quat b)
 | 
			
		||||
{
 | 
			
		||||
	int i;
 | 
			
		||||
	for(i=0; i<4; ++i)
 | 
			
		||||
		r[i] = a[i] - b[i];
 | 
			
		||||
}
 | 
			
		||||
static inline void quat_mul(quat r, quat p, quat q)
 | 
			
		||||
{
 | 
			
		||||
	vec3 w;
 | 
			
		||||
	vec3_mul_cross(r, p, q);
 | 
			
		||||
	vec3_scale(w, p, q[3]);
 | 
			
		||||
	vec3_add(r, r, w);
 | 
			
		||||
	vec3_scale(w, q, p[3]);
 | 
			
		||||
	vec3_add(r, r, w);
 | 
			
		||||
	r[3] = p[3]*q[3] - vec3_mul_inner(p, q);
 | 
			
		||||
}
 | 
			
		||||
static inline void quat_scale(quat r, quat v, float s)
 | 
			
		||||
{
 | 
			
		||||
	int i;
 | 
			
		||||
	for(i=0; i<4; ++i)
 | 
			
		||||
		r[i] = v[i] * s;
 | 
			
		||||
}
 | 
			
		||||
static inline float quat_inner_product(quat a, quat b)
 | 
			
		||||
{
 | 
			
		||||
	float p = 0.f;
 | 
			
		||||
	int i;
 | 
			
		||||
	for(i=0; i<4; ++i)
 | 
			
		||||
		p += b[i]*a[i];
 | 
			
		||||
	return p;
 | 
			
		||||
}
 | 
			
		||||
static inline void quat_conj(quat r, quat q)
 | 
			
		||||
{
 | 
			
		||||
	int i;
 | 
			
		||||
	for(i=0; i<3; ++i)
 | 
			
		||||
		r[i] = -q[i];
 | 
			
		||||
	r[3] = q[3];
 | 
			
		||||
}
 | 
			
		||||
static inline void quat_rotate(quat r, float angle, vec3 axis) {
 | 
			
		||||
	int i;
 | 
			
		||||
	vec3 v;
 | 
			
		||||
	vec3_scale(v, axis, sinf(angle / 2));
 | 
			
		||||
	for(i=0; i<3; ++i)
 | 
			
		||||
		r[i] = v[i];
 | 
			
		||||
	r[3] = cosf(angle / 2);
 | 
			
		||||
}
 | 
			
		||||
#define quat_norm vec4_norm
 | 
			
		||||
static inline void quat_mul_vec3(vec3 r, quat q, vec3 v)
 | 
			
		||||
{
 | 
			
		||||
/*
 | 
			
		||||
 * Method by Fabian 'ryg' Giessen (of Farbrausch)
 | 
			
		||||
t = 2 * cross(q.xyz, v)
 | 
			
		||||
v' = v + q.w * t + cross(q.xyz, t)
 | 
			
		||||
 */
 | 
			
		||||
	vec3 t = {q[0], q[1], q[2]};
 | 
			
		||||
	vec3 u = {q[0], q[1], q[2]};
 | 
			
		||||
 | 
			
		||||
	vec3_mul_cross(t, t, v);
 | 
			
		||||
	vec3_scale(t, t, 2);
 | 
			
		||||
 | 
			
		||||
	vec3_mul_cross(u, u, t);
 | 
			
		||||
	vec3_scale(t, t, q[3]);
 | 
			
		||||
 | 
			
		||||
	vec3_add(r, v, t);
 | 
			
		||||
	vec3_add(r, r, u);
 | 
			
		||||
}
 | 
			
		||||
static inline void mat4x4_from_quat(mat4x4 M, quat q)
 | 
			
		||||
{
 | 
			
		||||
	float a = q[3];
 | 
			
		||||
	float b = q[0];
 | 
			
		||||
	float c = q[1];
 | 
			
		||||
	float d = q[2];
 | 
			
		||||
	float a2 = a*a;
 | 
			
		||||
	float b2 = b*b;
 | 
			
		||||
	float c2 = c*c;
 | 
			
		||||
	float d2 = d*d;
 | 
			
		||||
 | 
			
		||||
	M[0][0] = a2 + b2 - c2 - d2;
 | 
			
		||||
	M[0][1] = 2.f*(b*c + a*d);
 | 
			
		||||
	M[0][2] = 2.f*(b*d - a*c);
 | 
			
		||||
	M[0][3] = 0.f;
 | 
			
		||||
 | 
			
		||||
	M[1][0] = 2*(b*c - a*d);
 | 
			
		||||
	M[1][1] = a2 - b2 + c2 - d2;
 | 
			
		||||
	M[1][2] = 2.f*(c*d + a*b);
 | 
			
		||||
	M[1][3] = 0.f;
 | 
			
		||||
 | 
			
		||||
	M[2][0] = 2.f*(b*d + a*c);
 | 
			
		||||
	M[2][1] = 2.f*(c*d - a*b);
 | 
			
		||||
	M[2][2] = a2 - b2 - c2 + d2;
 | 
			
		||||
	M[2][3] = 0.f;
 | 
			
		||||
 | 
			
		||||
	M[3][0] = M[3][1] = M[3][2] = 0.f;
 | 
			
		||||
	M[3][3] = 1.f;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static inline void mat4x4o_mul_quat(mat4x4 R, mat4x4 M, quat q)
 | 
			
		||||
{
 | 
			
		||||
/*  XXX: The way this is written only works for othogonal matrices. */
 | 
			
		||||
/* TODO: Take care of non-orthogonal case. */
 | 
			
		||||
	quat_mul_vec3(R[0], q, M[0]);
 | 
			
		||||
	quat_mul_vec3(R[1], q, M[1]);
 | 
			
		||||
	quat_mul_vec3(R[2], q, M[2]);
 | 
			
		||||
 | 
			
		||||
	R[3][0] = R[3][1] = R[3][2] = 0.f;
 | 
			
		||||
	R[3][3] = 1.f;
 | 
			
		||||
}
 | 
			
		||||
static inline void quat_from_mat4x4(quat q, mat4x4 M)
 | 
			
		||||
{
 | 
			
		||||
	float r=0.f;
 | 
			
		||||
	int i;
 | 
			
		||||
 | 
			
		||||
	int perm[] = { 0, 1, 2, 0, 1 };
 | 
			
		||||
	int *p = perm;
 | 
			
		||||
 | 
			
		||||
	for(i = 0; i<3; i++) {
 | 
			
		||||
		float m = M[i][i];
 | 
			
		||||
		if( m < r )
 | 
			
		||||
			continue;
 | 
			
		||||
		m = r;
 | 
			
		||||
		p = &perm[i];
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	r = (float) sqrt(1.f + M[p[0]][p[0]] - M[p[1]][p[1]] - M[p[2]][p[2]] );
 | 
			
		||||
 | 
			
		||||
	if(r < 1e-6) {
 | 
			
		||||
		q[0] = 1.f;
 | 
			
		||||
		q[1] = q[2] = q[3] = 0.f;
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	q[0] = r/2.f;
 | 
			
		||||
	q[1] = (M[p[0]][p[1]] - M[p[1]][p[0]])/(2.f*r);
 | 
			
		||||
	q[2] = (M[p[2]][p[0]] - M[p[0]][p[2]])/(2.f*r);
 | 
			
		||||
	q[3] = (M[p[2]][p[1]] - M[p[1]][p[2]])/(2.f*r);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
							
								
								
									
										117
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/mingw/_mingw_dxhelper.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										117
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/mingw/_mingw_dxhelper.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,117 @@
 | 
			
		||||
/**
 | 
			
		||||
 * This file has no copyright assigned and is placed in the Public Domain.
 | 
			
		||||
 * This file is part of the mingw-w64 runtime package.
 | 
			
		||||
 * No warranty is given; refer to the file DISCLAIMER within this package.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS)
 | 
			
		||||
#define NONAMELESSUNION		1
 | 
			
		||||
#endif
 | 
			
		||||
#if defined(NONAMELESSSTRUCT) && \
 | 
			
		||||
   !defined(NONAMELESSUNION)
 | 
			
		||||
#define NONAMELESSUNION		1
 | 
			
		||||
#endif
 | 
			
		||||
#if defined(NONAMELESSUNION)  && \
 | 
			
		||||
   !defined(NONAMELESSSTRUCT)
 | 
			
		||||
#define NONAMELESSSTRUCT	1
 | 
			
		||||
#endif
 | 
			
		||||
#if !defined(__GNU_EXTENSION)
 | 
			
		||||
#if defined(__GNUC__) || defined(__GNUG__)
 | 
			
		||||
#define __GNU_EXTENSION		__extension__
 | 
			
		||||
#else
 | 
			
		||||
#define __GNU_EXTENSION
 | 
			
		||||
#endif
 | 
			
		||||
#endif /* __extension__ */
 | 
			
		||||
 | 
			
		||||
#ifndef __ANONYMOUS_DEFINED
 | 
			
		||||
#define __ANONYMOUS_DEFINED
 | 
			
		||||
#if defined(__GNUC__) || defined(__GNUG__)
 | 
			
		||||
#define _ANONYMOUS_UNION	__extension__
 | 
			
		||||
#define _ANONYMOUS_STRUCT	__extension__
 | 
			
		||||
#else
 | 
			
		||||
#define _ANONYMOUS_UNION
 | 
			
		||||
#define _ANONYMOUS_STRUCT
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef NONAMELESSUNION
 | 
			
		||||
#define _UNION_NAME(x)
 | 
			
		||||
#define _STRUCT_NAME(x)
 | 
			
		||||
#else /* NONAMELESSUNION */
 | 
			
		||||
#define _UNION_NAME(x)  x
 | 
			
		||||
#define _STRUCT_NAME(x) x
 | 
			
		||||
#endif
 | 
			
		||||
#endif	/* __ANONYMOUS_DEFINED */
 | 
			
		||||
 | 
			
		||||
#ifndef DUMMYUNIONNAME
 | 
			
		||||
# ifdef NONAMELESSUNION
 | 
			
		||||
#  define DUMMYUNIONNAME  u
 | 
			
		||||
#  define DUMMYUNIONNAME1 u1	/* Wine uses this variant */
 | 
			
		||||
#  define DUMMYUNIONNAME2 u2
 | 
			
		||||
#  define DUMMYUNIONNAME3 u3
 | 
			
		||||
#  define DUMMYUNIONNAME4 u4
 | 
			
		||||
#  define DUMMYUNIONNAME5 u5
 | 
			
		||||
#  define DUMMYUNIONNAME6 u6
 | 
			
		||||
#  define DUMMYUNIONNAME7 u7
 | 
			
		||||
#  define DUMMYUNIONNAME8 u8
 | 
			
		||||
#  define DUMMYUNIONNAME9 u9
 | 
			
		||||
# else /* NONAMELESSUNION */
 | 
			
		||||
#  define DUMMYUNIONNAME
 | 
			
		||||
#  define DUMMYUNIONNAME1	/* Wine uses this variant */
 | 
			
		||||
#  define DUMMYUNIONNAME2
 | 
			
		||||
#  define DUMMYUNIONNAME3
 | 
			
		||||
#  define DUMMYUNIONNAME4
 | 
			
		||||
#  define DUMMYUNIONNAME5
 | 
			
		||||
#  define DUMMYUNIONNAME6
 | 
			
		||||
#  define DUMMYUNIONNAME7
 | 
			
		||||
#  define DUMMYUNIONNAME8
 | 
			
		||||
#  define DUMMYUNIONNAME9
 | 
			
		||||
# endif
 | 
			
		||||
#endif	/* DUMMYUNIONNAME */
 | 
			
		||||
 | 
			
		||||
#if !defined(DUMMYUNIONNAME1)	/* MinGW does not define this one */
 | 
			
		||||
# ifdef NONAMELESSUNION
 | 
			
		||||
#  define DUMMYUNIONNAME1 u1	/* Wine uses this variant */
 | 
			
		||||
# else
 | 
			
		||||
#  define DUMMYUNIONNAME1	/* Wine uses this variant */
 | 
			
		||||
# endif
 | 
			
		||||
#endif	/* DUMMYUNIONNAME1 */
 | 
			
		||||
 | 
			
		||||
#ifndef DUMMYSTRUCTNAME
 | 
			
		||||
# ifdef NONAMELESSUNION
 | 
			
		||||
#  define DUMMYSTRUCTNAME  s
 | 
			
		||||
#  define DUMMYSTRUCTNAME1 s1	/* Wine uses this variant */
 | 
			
		||||
#  define DUMMYSTRUCTNAME2 s2
 | 
			
		||||
#  define DUMMYSTRUCTNAME3 s3
 | 
			
		||||
#  define DUMMYSTRUCTNAME4 s4
 | 
			
		||||
#  define DUMMYSTRUCTNAME5 s5
 | 
			
		||||
# else
 | 
			
		||||
#  define DUMMYSTRUCTNAME
 | 
			
		||||
#  define DUMMYSTRUCTNAME1	/* Wine uses this variant */
 | 
			
		||||
#  define DUMMYSTRUCTNAME2
 | 
			
		||||
#  define DUMMYSTRUCTNAME3
 | 
			
		||||
#  define DUMMYSTRUCTNAME4
 | 
			
		||||
#  define DUMMYSTRUCTNAME5
 | 
			
		||||
# endif
 | 
			
		||||
#endif /* DUMMYSTRUCTNAME */
 | 
			
		||||
 | 
			
		||||
/* These are for compatibility with the Wine source tree */
 | 
			
		||||
 | 
			
		||||
#ifndef WINELIB_NAME_AW
 | 
			
		||||
# ifdef __MINGW_NAME_AW
 | 
			
		||||
#   define WINELIB_NAME_AW  __MINGW_NAME_AW
 | 
			
		||||
# else
 | 
			
		||||
#  ifdef UNICODE
 | 
			
		||||
#   define WINELIB_NAME_AW(func) func##W
 | 
			
		||||
#  else
 | 
			
		||||
#   define WINELIB_NAME_AW(func) func##A
 | 
			
		||||
#  endif
 | 
			
		||||
# endif
 | 
			
		||||
#endif	/* WINELIB_NAME_AW */
 | 
			
		||||
 | 
			
		||||
#ifndef DECL_WINELIB_TYPE_AW
 | 
			
		||||
# ifdef __MINGW_TYPEDEF_AW
 | 
			
		||||
#  define DECL_WINELIB_TYPE_AW  __MINGW_TYPEDEF_AW
 | 
			
		||||
# else
 | 
			
		||||
#  define DECL_WINELIB_TYPE_AW(type)  typedef WINELIB_NAME_AW(type) type;
 | 
			
		||||
# endif
 | 
			
		||||
#endif	/* DECL_WINELIB_TYPE_AW */
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2467
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/mingw/dinput.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2467
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/mingw/dinput.h
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										239
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/mingw/xinput.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										239
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/mingw/xinput.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,239 @@
 | 
			
		||||
/*
 | 
			
		||||
 * The Wine project - Xinput Joystick Library
 | 
			
		||||
 * Copyright 2008 Andrew Fenn
 | 
			
		||||
 *
 | 
			
		||||
 * This library is free software; you can redistribute it and/or
 | 
			
		||||
 * modify it under the terms of the GNU Lesser General Public
 | 
			
		||||
 * License as published by the Free Software Foundation; either
 | 
			
		||||
 * version 2.1 of the License, or (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 * This library is distributed in the hope that it will be useful,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 | 
			
		||||
 * Lesser General Public License for more details.
 | 
			
		||||
 *
 | 
			
		||||
 * You should have received a copy of the GNU Lesser General Public
 | 
			
		||||
 * License along with this library; if not, write to the Free Software
 | 
			
		||||
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef __WINE_XINPUT_H
 | 
			
		||||
#define __WINE_XINPUT_H
 | 
			
		||||
 | 
			
		||||
#include <windef.h>
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Bitmasks for the joysticks buttons, determines what has
 | 
			
		||||
 * been pressed on the joystick, these need to be mapped
 | 
			
		||||
 * to whatever device you're using instead of an xbox 360
 | 
			
		||||
 * joystick
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define XINPUT_GAMEPAD_DPAD_UP          0x0001
 | 
			
		||||
#define XINPUT_GAMEPAD_DPAD_DOWN        0x0002
 | 
			
		||||
#define XINPUT_GAMEPAD_DPAD_LEFT        0x0004
 | 
			
		||||
#define XINPUT_GAMEPAD_DPAD_RIGHT       0x0008
 | 
			
		||||
#define XINPUT_GAMEPAD_START            0x0010
 | 
			
		||||
#define XINPUT_GAMEPAD_BACK             0x0020
 | 
			
		||||
#define XINPUT_GAMEPAD_LEFT_THUMB       0x0040
 | 
			
		||||
#define XINPUT_GAMEPAD_RIGHT_THUMB      0x0080
 | 
			
		||||
#define XINPUT_GAMEPAD_LEFT_SHOULDER    0x0100
 | 
			
		||||
#define XINPUT_GAMEPAD_RIGHT_SHOULDER   0x0200
 | 
			
		||||
#define XINPUT_GAMEPAD_A                0x1000
 | 
			
		||||
#define XINPUT_GAMEPAD_B                0x2000
 | 
			
		||||
#define XINPUT_GAMEPAD_X                0x4000
 | 
			
		||||
#define XINPUT_GAMEPAD_Y                0x8000
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Defines the flags used to determine if the user is pushing
 | 
			
		||||
 * down on a button, not holding a button, etc
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define XINPUT_KEYSTROKE_KEYDOWN        0x0001
 | 
			
		||||
#define XINPUT_KEYSTROKE_KEYUP          0x0002
 | 
			
		||||
#define XINPUT_KEYSTROKE_REPEAT         0x0004
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Defines the codes which are returned by XInputGetKeystroke
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define VK_PAD_A                        0x5800
 | 
			
		||||
#define VK_PAD_B                        0x5801
 | 
			
		||||
#define VK_PAD_X                        0x5802
 | 
			
		||||
#define VK_PAD_Y                        0x5803
 | 
			
		||||
#define VK_PAD_RSHOULDER                0x5804
 | 
			
		||||
#define VK_PAD_LSHOULDER                0x5805
 | 
			
		||||
#define VK_PAD_LTRIGGER                 0x5806
 | 
			
		||||
#define VK_PAD_RTRIGGER                 0x5807
 | 
			
		||||
#define VK_PAD_DPAD_UP                  0x5810
 | 
			
		||||
#define VK_PAD_DPAD_DOWN                0x5811
 | 
			
		||||
#define VK_PAD_DPAD_LEFT                0x5812
 | 
			
		||||
#define VK_PAD_DPAD_RIGHT               0x5813
 | 
			
		||||
#define VK_PAD_START                    0x5814
 | 
			
		||||
#define VK_PAD_BACK                     0x5815
 | 
			
		||||
#define VK_PAD_LTHUMB_PRESS             0x5816
 | 
			
		||||
#define VK_PAD_RTHUMB_PRESS             0x5817
 | 
			
		||||
#define VK_PAD_LTHUMB_UP                0x5820
 | 
			
		||||
#define VK_PAD_LTHUMB_DOWN              0x5821
 | 
			
		||||
#define VK_PAD_LTHUMB_RIGHT             0x5822
 | 
			
		||||
#define VK_PAD_LTHUMB_LEFT              0x5823
 | 
			
		||||
#define VK_PAD_LTHUMB_UPLEFT            0x5824
 | 
			
		||||
#define VK_PAD_LTHUMB_UPRIGHT           0x5825
 | 
			
		||||
#define VK_PAD_LTHUMB_DOWNRIGHT         0x5826
 | 
			
		||||
#define VK_PAD_LTHUMB_DOWNLEFT          0x5827
 | 
			
		||||
#define VK_PAD_RTHUMB_UP                0x5830
 | 
			
		||||
#define VK_PAD_RTHUMB_DOWN              0x5831
 | 
			
		||||
#define VK_PAD_RTHUMB_RIGHT             0x5832
 | 
			
		||||
#define VK_PAD_RTHUMB_LEFT              0x5833
 | 
			
		||||
#define VK_PAD_RTHUMB_UPLEFT            0x5834
 | 
			
		||||
#define VK_PAD_RTHUMB_UPRIGHT           0x5835
 | 
			
		||||
#define VK_PAD_RTHUMB_DOWNRIGHT         0x5836
 | 
			
		||||
#define VK_PAD_RTHUMB_DOWNLEFT          0x5837
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Deadzones are for analogue joystick controls on the joypad
 | 
			
		||||
 * which determine when input should be assumed to be in the
 | 
			
		||||
 * middle of the pad. This is a threshold to stop a joypad
 | 
			
		||||
 * controlling the game when the player isn't touching the
 | 
			
		||||
 * controls.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE  7849
 | 
			
		||||
#define XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE 8689
 | 
			
		||||
#define XINPUT_GAMEPAD_TRIGGER_THRESHOLD    30
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Defines what type of abilities the type of joystick has
 | 
			
		||||
 * DEVTYPE_GAMEPAD is available for all joysticks, however
 | 
			
		||||
 * there may be more specific identifiers for other joysticks
 | 
			
		||||
 * which are being used.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define XINPUT_DEVTYPE_GAMEPAD          0x01
 | 
			
		||||
#define XINPUT_DEVSUBTYPE_GAMEPAD       0x01
 | 
			
		||||
#define XINPUT_DEVSUBTYPE_WHEEL         0x02
 | 
			
		||||
#define XINPUT_DEVSUBTYPE_ARCADE_STICK  0x03
 | 
			
		||||
#define XINPUT_DEVSUBTYPE_FLIGHT_SICK   0x04
 | 
			
		||||
#define XINPUT_DEVSUBTYPE_DANCE_PAD     0x05
 | 
			
		||||
#define XINPUT_DEVSUBTYPE_GUITAR        0x06
 | 
			
		||||
#define XINPUT_DEVSUBTYPE_DRUM_KIT      0x08
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * These are used with the XInputGetCapabilities function to
 | 
			
		||||
 * determine the abilities to the joystick which has been
 | 
			
		||||
 * plugged in.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define XINPUT_CAPS_VOICE_SUPPORTED     0x0004
 | 
			
		||||
#define XINPUT_FLAG_GAMEPAD             0x00000001
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Defines the status of the battery if one is used in the
 | 
			
		||||
 * attached joystick. The first two define if the joystick
 | 
			
		||||
 * supports a battery. Disconnected means that the joystick
 | 
			
		||||
 * isn't connected. Wired shows that the joystick is a wired
 | 
			
		||||
 * joystick.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define BATTERY_DEVTYPE_GAMEPAD         0x00
 | 
			
		||||
#define BATTERY_DEVTYPE_HEADSET         0x01
 | 
			
		||||
#define BATTERY_TYPE_DISCONNECTED       0x00
 | 
			
		||||
#define BATTERY_TYPE_WIRED              0x01
 | 
			
		||||
#define BATTERY_TYPE_ALKALINE           0x02
 | 
			
		||||
#define BATTERY_TYPE_NIMH               0x03
 | 
			
		||||
#define BATTERY_TYPE_UNKNOWN            0xFF
 | 
			
		||||
#define BATTERY_LEVEL_EMPTY             0x00
 | 
			
		||||
#define BATTERY_LEVEL_LOW               0x01
 | 
			
		||||
#define BATTERY_LEVEL_MEDIUM            0x02
 | 
			
		||||
#define BATTERY_LEVEL_FULL              0x03
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * How many joysticks can be used with this library. Games that
 | 
			
		||||
 * use the xinput library will not go over this number.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define XUSER_MAX_COUNT                 4
 | 
			
		||||
#define XUSER_INDEX_ANY                 0x000000FF
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Defines the structure of an xbox 360 joystick.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
typedef struct _XINPUT_GAMEPAD {
 | 
			
		||||
    WORD wButtons;
 | 
			
		||||
    BYTE bLeftTrigger;
 | 
			
		||||
    BYTE bRightTrigger;
 | 
			
		||||
    SHORT sThumbLX;
 | 
			
		||||
    SHORT sThumbLY;
 | 
			
		||||
    SHORT sThumbRX;
 | 
			
		||||
    SHORT sThumbRY;
 | 
			
		||||
} XINPUT_GAMEPAD, *PXINPUT_GAMEPAD;
 | 
			
		||||
 | 
			
		||||
typedef struct _XINPUT_STATE {
 | 
			
		||||
    DWORD dwPacketNumber;
 | 
			
		||||
    XINPUT_GAMEPAD Gamepad;
 | 
			
		||||
} XINPUT_STATE, *PXINPUT_STATE;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Defines the structure of how much vibration is set on both the
 | 
			
		||||
 * right and left motors in a joystick. If you're not using a 360
 | 
			
		||||
 * joystick you will have to map these to your device.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
typedef struct _XINPUT_VIBRATION {
 | 
			
		||||
    WORD wLeftMotorSpeed;
 | 
			
		||||
    WORD wRightMotorSpeed;
 | 
			
		||||
} XINPUT_VIBRATION, *PXINPUT_VIBRATION;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Defines the structure for what kind of abilities the joystick has
 | 
			
		||||
 * such abilities are things such as if the joystick has the ability
 | 
			
		||||
 * to send and receive audio, if the joystick is in fact a driving
 | 
			
		||||
 * wheel or perhaps if the joystick is some kind of dance pad or
 | 
			
		||||
 * guitar.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
typedef struct _XINPUT_CAPABILITIES {
 | 
			
		||||
    BYTE Type;
 | 
			
		||||
    BYTE SubType;
 | 
			
		||||
    WORD Flags;
 | 
			
		||||
    XINPUT_GAMEPAD Gamepad;
 | 
			
		||||
    XINPUT_VIBRATION Vibration;
 | 
			
		||||
} XINPUT_CAPABILITIES, *PXINPUT_CAPABILITIES;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Defines the structure for a joystick input event which is
 | 
			
		||||
 * retrieved using the function XInputGetKeystroke
 | 
			
		||||
 */
 | 
			
		||||
typedef struct _XINPUT_KEYSTROKE {
 | 
			
		||||
    WORD VirtualKey;
 | 
			
		||||
    WCHAR Unicode;
 | 
			
		||||
    WORD Flags;
 | 
			
		||||
    BYTE UserIndex;
 | 
			
		||||
    BYTE HidCode;
 | 
			
		||||
} XINPUT_KEYSTROKE, *PXINPUT_KEYSTROKE;
 | 
			
		||||
 | 
			
		||||
typedef struct _XINPUT_BATTERY_INFORMATION
 | 
			
		||||
{
 | 
			
		||||
    BYTE BatteryType;
 | 
			
		||||
    BYTE BatteryLevel;
 | 
			
		||||
} XINPUT_BATTERY_INFORMATION, *PXINPUT_BATTERY_INFORMATION;
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
void WINAPI XInputEnable(WINBOOL);
 | 
			
		||||
DWORD WINAPI XInputSetState(DWORD, XINPUT_VIBRATION*);
 | 
			
		||||
DWORD WINAPI XInputGetState(DWORD, XINPUT_STATE*);
 | 
			
		||||
DWORD WINAPI XInputGetKeystroke(DWORD, DWORD, PXINPUT_KEYSTROKE);
 | 
			
		||||
DWORD WINAPI XInputGetCapabilities(DWORD, DWORD, XINPUT_CAPABILITIES*);
 | 
			
		||||
DWORD WINAPI XInputGetDSoundAudioDeviceGuids(DWORD, GUID*, GUID*);
 | 
			
		||||
DWORD WINAPI XInputGetBatteryInformation(DWORD, BYTE, XINPUT_BATTERY_INFORMATION*);
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* __WINE_XINPUT_H */
 | 
			
		||||
							
								
								
									
										25539
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/nuklear.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25539
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/nuklear.h
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										381
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/nuklear_glfw_gl2.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										381
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/nuklear_glfw_gl2.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,381 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Nuklear - v1.32.0 - public domain
 | 
			
		||||
 * no warrenty implied; use at your own risk.
 | 
			
		||||
 * authored from 2015-2017 by Micha Mettke
 | 
			
		||||
 */
 | 
			
		||||
/*
 | 
			
		||||
 * ==============================================================
 | 
			
		||||
 *
 | 
			
		||||
 *                              API
 | 
			
		||||
 *
 | 
			
		||||
 * ===============================================================
 | 
			
		||||
 */
 | 
			
		||||
#ifndef NK_GLFW_GL2_H_
 | 
			
		||||
#define NK_GLFW_GL2_H_
 | 
			
		||||
 | 
			
		||||
#include <GLFW/glfw3.h>
 | 
			
		||||
 | 
			
		||||
enum nk_glfw_init_state{
 | 
			
		||||
    NK_GLFW3_DEFAULT = 0,
 | 
			
		||||
    NK_GLFW3_INSTALL_CALLBACKS
 | 
			
		||||
};
 | 
			
		||||
NK_API struct nk_context*   nk_glfw3_init(GLFWwindow *win, enum nk_glfw_init_state);
 | 
			
		||||
NK_API void                 nk_glfw3_font_stash_begin(struct nk_font_atlas **atlas);
 | 
			
		||||
NK_API void                 nk_glfw3_font_stash_end(void);
 | 
			
		||||
 | 
			
		||||
NK_API void                 nk_glfw3_new_frame(void);
 | 
			
		||||
NK_API void                 nk_glfw3_render(enum nk_anti_aliasing);
 | 
			
		||||
NK_API void                 nk_glfw3_shutdown(void);
 | 
			
		||||
 | 
			
		||||
NK_API void                 nk_glfw3_char_callback(GLFWwindow *win, unsigned int codepoint);
 | 
			
		||||
NK_API void                 nk_gflw3_scroll_callback(GLFWwindow *win, double xoff, double yoff);
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * ==============================================================
 | 
			
		||||
 *
 | 
			
		||||
 *                          IMPLEMENTATION
 | 
			
		||||
 *
 | 
			
		||||
 * ===============================================================
 | 
			
		||||
 */
 | 
			
		||||
#ifdef NK_GLFW_GL2_IMPLEMENTATION
 | 
			
		||||
 | 
			
		||||
#ifndef NK_GLFW_TEXT_MAX
 | 
			
		||||
#define NK_GLFW_TEXT_MAX 256
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef NK_GLFW_DOUBLE_CLICK_LO
 | 
			
		||||
#define NK_GLFW_DOUBLE_CLICK_LO 0.02
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef NK_GLFW_DOUBLE_CLICK_HI
 | 
			
		||||
#define NK_GLFW_DOUBLE_CLICK_HI 0.2
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
struct nk_glfw_device {
 | 
			
		||||
    struct nk_buffer cmds;
 | 
			
		||||
    struct nk_draw_null_texture null;
 | 
			
		||||
    GLuint font_tex;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct nk_glfw_vertex {
 | 
			
		||||
    float position[2];
 | 
			
		||||
    float uv[2];
 | 
			
		||||
    nk_byte col[4];
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static struct nk_glfw {
 | 
			
		||||
    GLFWwindow *win;
 | 
			
		||||
    int width, height;
 | 
			
		||||
    int display_width, display_height;
 | 
			
		||||
    struct nk_glfw_device ogl;
 | 
			
		||||
    struct nk_context ctx;
 | 
			
		||||
    struct nk_font_atlas atlas;
 | 
			
		||||
    struct nk_vec2 fb_scale;
 | 
			
		||||
    unsigned int text[NK_GLFW_TEXT_MAX];
 | 
			
		||||
    int text_len;
 | 
			
		||||
    struct nk_vec2 scroll;
 | 
			
		||||
    double last_button_click;
 | 
			
		||||
    int is_double_click_down;
 | 
			
		||||
    struct nk_vec2 double_click_pos;
 | 
			
		||||
} glfw;
 | 
			
		||||
 | 
			
		||||
NK_INTERN void
 | 
			
		||||
nk_glfw3_device_upload_atlas(const void *image, int width, int height)
 | 
			
		||||
{
 | 
			
		||||
    struct nk_glfw_device *dev = &glfw.ogl;
 | 
			
		||||
    glGenTextures(1, &dev->font_tex);
 | 
			
		||||
    glBindTexture(GL_TEXTURE_2D, dev->font_tex);
 | 
			
		||||
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
 | 
			
		||||
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
 | 
			
		||||
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, (GLsizei)width, (GLsizei)height, 0,
 | 
			
		||||
                GL_RGBA, GL_UNSIGNED_BYTE, image);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NK_API void
 | 
			
		||||
nk_glfw3_render(enum nk_anti_aliasing AA)
 | 
			
		||||
{
 | 
			
		||||
    /* setup global state */
 | 
			
		||||
    struct nk_glfw_device *dev = &glfw.ogl;
 | 
			
		||||
    glPushAttrib(GL_ENABLE_BIT|GL_COLOR_BUFFER_BIT|GL_TRANSFORM_BIT);
 | 
			
		||||
    glDisable(GL_CULL_FACE);
 | 
			
		||||
    glDisable(GL_DEPTH_TEST);
 | 
			
		||||
    glEnable(GL_SCISSOR_TEST);
 | 
			
		||||
    glEnable(GL_BLEND);
 | 
			
		||||
    glEnable(GL_TEXTURE_2D);
 | 
			
		||||
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 | 
			
		||||
 | 
			
		||||
    /* setup viewport/project */
 | 
			
		||||
    glViewport(0,0,(GLsizei)glfw.display_width,(GLsizei)glfw.display_height);
 | 
			
		||||
    glMatrixMode(GL_PROJECTION);
 | 
			
		||||
    glPushMatrix();
 | 
			
		||||
    glLoadIdentity();
 | 
			
		||||
    glOrtho(0.0f, glfw.width, glfw.height, 0.0f, -1.0f, 1.0f);
 | 
			
		||||
    glMatrixMode(GL_MODELVIEW);
 | 
			
		||||
    glPushMatrix();
 | 
			
		||||
    glLoadIdentity();
 | 
			
		||||
 | 
			
		||||
    glEnableClientState(GL_VERTEX_ARRAY);
 | 
			
		||||
    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
 | 
			
		||||
    glEnableClientState(GL_COLOR_ARRAY);
 | 
			
		||||
    {
 | 
			
		||||
        GLsizei vs = sizeof(struct nk_glfw_vertex);
 | 
			
		||||
        size_t vp = offsetof(struct nk_glfw_vertex, position);
 | 
			
		||||
        size_t vt = offsetof(struct nk_glfw_vertex, uv);
 | 
			
		||||
        size_t vc = offsetof(struct nk_glfw_vertex, col);
 | 
			
		||||
 | 
			
		||||
        /* convert from command queue into draw list and draw to screen */
 | 
			
		||||
        const struct nk_draw_command *cmd;
 | 
			
		||||
        const nk_draw_index *offset = NULL;
 | 
			
		||||
        struct nk_buffer vbuf, ebuf;
 | 
			
		||||
 | 
			
		||||
        /* fill convert configuration */
 | 
			
		||||
        struct nk_convert_config config;
 | 
			
		||||
        static const struct nk_draw_vertex_layout_element vertex_layout[] = {
 | 
			
		||||
            {NK_VERTEX_POSITION, NK_FORMAT_FLOAT, NK_OFFSETOF(struct nk_glfw_vertex, position)},
 | 
			
		||||
            {NK_VERTEX_TEXCOORD, NK_FORMAT_FLOAT, NK_OFFSETOF(struct nk_glfw_vertex, uv)},
 | 
			
		||||
            {NK_VERTEX_COLOR, NK_FORMAT_R8G8B8A8, NK_OFFSETOF(struct nk_glfw_vertex, col)},
 | 
			
		||||
            {NK_VERTEX_LAYOUT_END}
 | 
			
		||||
        };
 | 
			
		||||
        NK_MEMSET(&config, 0, sizeof(config));
 | 
			
		||||
        config.vertex_layout = vertex_layout;
 | 
			
		||||
        config.vertex_size = sizeof(struct nk_glfw_vertex);
 | 
			
		||||
        config.vertex_alignment = NK_ALIGNOF(struct nk_glfw_vertex);
 | 
			
		||||
        config.null = dev->null;
 | 
			
		||||
        config.circle_segment_count = 22;
 | 
			
		||||
        config.curve_segment_count = 22;
 | 
			
		||||
        config.arc_segment_count = 22;
 | 
			
		||||
        config.global_alpha = 1.0f;
 | 
			
		||||
        config.shape_AA = AA;
 | 
			
		||||
        config.line_AA = AA;
 | 
			
		||||
 | 
			
		||||
        /* convert shapes into vertexes */
 | 
			
		||||
        nk_buffer_init_default(&vbuf);
 | 
			
		||||
        nk_buffer_init_default(&ebuf);
 | 
			
		||||
        nk_convert(&glfw.ctx, &dev->cmds, &vbuf, &ebuf, &config);
 | 
			
		||||
 | 
			
		||||
        /* setup vertex buffer pointer */
 | 
			
		||||
        {const void *vertices = nk_buffer_memory_const(&vbuf);
 | 
			
		||||
        glVertexPointer(2, GL_FLOAT, vs, (const void*)((const nk_byte*)vertices + vp));
 | 
			
		||||
        glTexCoordPointer(2, GL_FLOAT, vs, (const void*)((const nk_byte*)vertices + vt));
 | 
			
		||||
        glColorPointer(4, GL_UNSIGNED_BYTE, vs, (const void*)((const nk_byte*)vertices + vc));}
 | 
			
		||||
 | 
			
		||||
        /* iterate over and execute each draw command */
 | 
			
		||||
        offset = (const nk_draw_index*)nk_buffer_memory_const(&ebuf);
 | 
			
		||||
        nk_draw_foreach(cmd, &glfw.ctx, &dev->cmds)
 | 
			
		||||
        {
 | 
			
		||||
            if (!cmd->elem_count) continue;
 | 
			
		||||
            glBindTexture(GL_TEXTURE_2D, (GLuint)cmd->texture.id);
 | 
			
		||||
            glScissor(
 | 
			
		||||
                (GLint)(cmd->clip_rect.x * glfw.fb_scale.x),
 | 
			
		||||
                (GLint)((glfw.height - (GLint)(cmd->clip_rect.y + cmd->clip_rect.h)) * glfw.fb_scale.y),
 | 
			
		||||
                (GLint)(cmd->clip_rect.w * glfw.fb_scale.x),
 | 
			
		||||
                (GLint)(cmd->clip_rect.h * glfw.fb_scale.y));
 | 
			
		||||
            glDrawElements(GL_TRIANGLES, (GLsizei)cmd->elem_count, GL_UNSIGNED_SHORT, offset);
 | 
			
		||||
            offset += cmd->elem_count;
 | 
			
		||||
        }
 | 
			
		||||
        nk_clear(&glfw.ctx);
 | 
			
		||||
        nk_buffer_free(&vbuf);
 | 
			
		||||
        nk_buffer_free(&ebuf);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* default OpenGL state */
 | 
			
		||||
    glDisableClientState(GL_VERTEX_ARRAY);
 | 
			
		||||
    glDisableClientState(GL_TEXTURE_COORD_ARRAY);
 | 
			
		||||
    glDisableClientState(GL_COLOR_ARRAY);
 | 
			
		||||
 | 
			
		||||
    glDisable(GL_CULL_FACE);
 | 
			
		||||
    glDisable(GL_DEPTH_TEST);
 | 
			
		||||
    glDisable(GL_SCISSOR_TEST);
 | 
			
		||||
    glDisable(GL_BLEND);
 | 
			
		||||
    glDisable(GL_TEXTURE_2D);
 | 
			
		||||
 | 
			
		||||
    glBindTexture(GL_TEXTURE_2D, 0);
 | 
			
		||||
    glMatrixMode(GL_MODELVIEW);
 | 
			
		||||
    glPopMatrix();
 | 
			
		||||
    glMatrixMode(GL_PROJECTION);
 | 
			
		||||
    glPopMatrix();
 | 
			
		||||
    glPopAttrib();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NK_API void
 | 
			
		||||
nk_glfw3_char_callback(GLFWwindow *win, unsigned int codepoint)
 | 
			
		||||
{
 | 
			
		||||
    (void)win;
 | 
			
		||||
    if (glfw.text_len < NK_GLFW_TEXT_MAX)
 | 
			
		||||
        glfw.text[glfw.text_len++] = codepoint;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NK_API void
 | 
			
		||||
nk_gflw3_scroll_callback(GLFWwindow *win, double xoff, double yoff)
 | 
			
		||||
{
 | 
			
		||||
    (void)win; (void)xoff;
 | 
			
		||||
    glfw.scroll.x += (float)xoff;
 | 
			
		||||
    glfw.scroll.y += (float)yoff;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NK_API void
 | 
			
		||||
nk_glfw3_mouse_button_callback(GLFWwindow* window, int button, int action, int mods)
 | 
			
		||||
{
 | 
			
		||||
    double x, y;
 | 
			
		||||
    if (button != GLFW_MOUSE_BUTTON_LEFT) return;
 | 
			
		||||
    glfwGetCursorPos(window, &x, &y);
 | 
			
		||||
    if (action == GLFW_PRESS)  {
 | 
			
		||||
        double dt = glfwGetTime() - glfw.last_button_click;
 | 
			
		||||
        if (dt > NK_GLFW_DOUBLE_CLICK_LO && dt < NK_GLFW_DOUBLE_CLICK_HI) {
 | 
			
		||||
            glfw.is_double_click_down = nk_true;
 | 
			
		||||
            glfw.double_click_pos = nk_vec2((float)x, (float)y);
 | 
			
		||||
        }
 | 
			
		||||
        glfw.last_button_click = glfwGetTime();
 | 
			
		||||
    } else glfw.is_double_click_down = nk_false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NK_INTERN void
 | 
			
		||||
nk_glfw3_clipbard_paste(nk_handle usr, struct nk_text_edit *edit)
 | 
			
		||||
{
 | 
			
		||||
    const char *text = glfwGetClipboardString(glfw.win);
 | 
			
		||||
    if (text) nk_textedit_paste(edit, text, nk_strlen(text));
 | 
			
		||||
    (void)usr;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NK_INTERN void
 | 
			
		||||
nk_glfw3_clipbard_copy(nk_handle usr, const char *text, int len)
 | 
			
		||||
{
 | 
			
		||||
    char *str = 0;
 | 
			
		||||
    (void)usr;
 | 
			
		||||
    if (!len) return;
 | 
			
		||||
    str = (char*)malloc((size_t)len+1);
 | 
			
		||||
    if (!str) return;
 | 
			
		||||
    NK_MEMCPY(str, text, (size_t)len);
 | 
			
		||||
    str[len] = '\0';
 | 
			
		||||
    glfwSetClipboardString(glfw.win, str);
 | 
			
		||||
    free(str);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NK_API struct nk_context*
 | 
			
		||||
nk_glfw3_init(GLFWwindow *win, enum nk_glfw_init_state init_state)
 | 
			
		||||
{
 | 
			
		||||
    glfw.win = win;
 | 
			
		||||
    if (init_state == NK_GLFW3_INSTALL_CALLBACKS) {
 | 
			
		||||
        glfwSetScrollCallback(win, nk_gflw3_scroll_callback);
 | 
			
		||||
        glfwSetCharCallback(win, nk_glfw3_char_callback);
 | 
			
		||||
        glfwSetMouseButtonCallback(win, nk_glfw3_mouse_button_callback);
 | 
			
		||||
    }
 | 
			
		||||
    nk_init_default(&glfw.ctx, 0);
 | 
			
		||||
    glfw.ctx.clip.copy = nk_glfw3_clipbard_copy;
 | 
			
		||||
    glfw.ctx.clip.paste = nk_glfw3_clipbard_paste;
 | 
			
		||||
    glfw.ctx.clip.userdata = nk_handle_ptr(0);
 | 
			
		||||
    nk_buffer_init_default(&glfw.ogl.cmds);
 | 
			
		||||
 | 
			
		||||
    glfw.is_double_click_down = nk_false;
 | 
			
		||||
    glfw.double_click_pos = nk_vec2(0, 0);
 | 
			
		||||
 | 
			
		||||
    return &glfw.ctx;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NK_API void
 | 
			
		||||
nk_glfw3_font_stash_begin(struct nk_font_atlas **atlas)
 | 
			
		||||
{
 | 
			
		||||
    nk_font_atlas_init_default(&glfw.atlas);
 | 
			
		||||
    nk_font_atlas_begin(&glfw.atlas);
 | 
			
		||||
    *atlas = &glfw.atlas;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NK_API void
 | 
			
		||||
nk_glfw3_font_stash_end(void)
 | 
			
		||||
{
 | 
			
		||||
    const void *image; int w, h;
 | 
			
		||||
    image = nk_font_atlas_bake(&glfw.atlas, &w, &h, NK_FONT_ATLAS_RGBA32);
 | 
			
		||||
    nk_glfw3_device_upload_atlas(image, w, h);
 | 
			
		||||
    nk_font_atlas_end(&glfw.atlas, nk_handle_id((int)glfw.ogl.font_tex), &glfw.ogl.null);
 | 
			
		||||
    if (glfw.atlas.default_font)
 | 
			
		||||
        nk_style_set_font(&glfw.ctx, &glfw.atlas.default_font->handle);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NK_API void
 | 
			
		||||
nk_glfw3_new_frame(void)
 | 
			
		||||
{
 | 
			
		||||
    int i;
 | 
			
		||||
    double x, y;
 | 
			
		||||
    struct nk_context *ctx = &glfw.ctx;
 | 
			
		||||
    struct GLFWwindow *win = glfw.win;
 | 
			
		||||
 | 
			
		||||
    glfwGetWindowSize(win, &glfw.width, &glfw.height);
 | 
			
		||||
    glfwGetFramebufferSize(win, &glfw.display_width, &glfw.display_height);
 | 
			
		||||
    glfw.fb_scale.x = (float)glfw.display_width/(float)glfw.width;
 | 
			
		||||
    glfw.fb_scale.y = (float)glfw.display_height/(float)glfw.height;
 | 
			
		||||
 | 
			
		||||
    nk_input_begin(ctx);
 | 
			
		||||
    for (i = 0; i < glfw.text_len; ++i)
 | 
			
		||||
        nk_input_unicode(ctx, glfw.text[i]);
 | 
			
		||||
 | 
			
		||||
    /* optional grabbing behavior */
 | 
			
		||||
    if (ctx->input.mouse.grab)
 | 
			
		||||
        glfwSetInputMode(glfw.win, GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
 | 
			
		||||
    else if (ctx->input.mouse.ungrab)
 | 
			
		||||
        glfwSetInputMode(glfw.win, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
 | 
			
		||||
 | 
			
		||||
    nk_input_key(ctx, NK_KEY_DEL, glfwGetKey(win, GLFW_KEY_DELETE) == GLFW_PRESS);
 | 
			
		||||
    nk_input_key(ctx, NK_KEY_ENTER, glfwGetKey(win, GLFW_KEY_ENTER) == GLFW_PRESS);
 | 
			
		||||
    nk_input_key(ctx, NK_KEY_TAB, glfwGetKey(win, GLFW_KEY_TAB) == GLFW_PRESS);
 | 
			
		||||
    nk_input_key(ctx, NK_KEY_BACKSPACE, glfwGetKey(win, GLFW_KEY_BACKSPACE) == GLFW_PRESS);
 | 
			
		||||
    nk_input_key(ctx, NK_KEY_UP, glfwGetKey(win, GLFW_KEY_UP) == GLFW_PRESS);
 | 
			
		||||
    nk_input_key(ctx, NK_KEY_DOWN, glfwGetKey(win, GLFW_KEY_DOWN) == GLFW_PRESS);
 | 
			
		||||
    nk_input_key(ctx, NK_KEY_TEXT_START, glfwGetKey(win, GLFW_KEY_HOME) == GLFW_PRESS);
 | 
			
		||||
    nk_input_key(ctx, NK_KEY_TEXT_END, glfwGetKey(win, GLFW_KEY_END) == GLFW_PRESS);
 | 
			
		||||
    nk_input_key(ctx, NK_KEY_SCROLL_START, glfwGetKey(win, GLFW_KEY_HOME) == GLFW_PRESS);
 | 
			
		||||
    nk_input_key(ctx, NK_KEY_SCROLL_END, glfwGetKey(win, GLFW_KEY_END) == GLFW_PRESS);
 | 
			
		||||
    nk_input_key(ctx, NK_KEY_SCROLL_DOWN, glfwGetKey(win, GLFW_KEY_PAGE_DOWN) == GLFW_PRESS);
 | 
			
		||||
    nk_input_key(ctx, NK_KEY_SCROLL_UP, glfwGetKey(win, GLFW_KEY_PAGE_UP) == GLFW_PRESS);
 | 
			
		||||
    nk_input_key(ctx, NK_KEY_SHIFT, glfwGetKey(win, GLFW_KEY_LEFT_SHIFT) == GLFW_PRESS||
 | 
			
		||||
                                    glfwGetKey(win, GLFW_KEY_RIGHT_SHIFT) == GLFW_PRESS);
 | 
			
		||||
 | 
			
		||||
    if (glfwGetKey(win, GLFW_KEY_LEFT_CONTROL) == GLFW_PRESS ||
 | 
			
		||||
        glfwGetKey(win, GLFW_KEY_RIGHT_CONTROL) == GLFW_PRESS) {
 | 
			
		||||
        nk_input_key(ctx, NK_KEY_COPY, glfwGetKey(win, GLFW_KEY_C) == GLFW_PRESS);
 | 
			
		||||
        nk_input_key(ctx, NK_KEY_PASTE, glfwGetKey(win, GLFW_KEY_V) == GLFW_PRESS);
 | 
			
		||||
        nk_input_key(ctx, NK_KEY_CUT, glfwGetKey(win, GLFW_KEY_X) == GLFW_PRESS);
 | 
			
		||||
        nk_input_key(ctx, NK_KEY_TEXT_UNDO, glfwGetKey(win, GLFW_KEY_Z) == GLFW_PRESS);
 | 
			
		||||
        nk_input_key(ctx, NK_KEY_TEXT_REDO, glfwGetKey(win, GLFW_KEY_R) == GLFW_PRESS);
 | 
			
		||||
        nk_input_key(ctx, NK_KEY_TEXT_WORD_LEFT, glfwGetKey(win, GLFW_KEY_LEFT) == GLFW_PRESS);
 | 
			
		||||
        nk_input_key(ctx, NK_KEY_TEXT_WORD_RIGHT, glfwGetKey(win, GLFW_KEY_RIGHT) == GLFW_PRESS);
 | 
			
		||||
        nk_input_key(ctx, NK_KEY_TEXT_LINE_START, glfwGetKey(win, GLFW_KEY_B) == GLFW_PRESS);
 | 
			
		||||
        nk_input_key(ctx, NK_KEY_TEXT_LINE_END, glfwGetKey(win, GLFW_KEY_E) == GLFW_PRESS);
 | 
			
		||||
    } else {
 | 
			
		||||
        nk_input_key(ctx, NK_KEY_LEFT, glfwGetKey(win, GLFW_KEY_LEFT) == GLFW_PRESS);
 | 
			
		||||
        nk_input_key(ctx, NK_KEY_RIGHT, glfwGetKey(win, GLFW_KEY_RIGHT) == GLFW_PRESS);
 | 
			
		||||
        nk_input_key(ctx, NK_KEY_COPY, 0);
 | 
			
		||||
        nk_input_key(ctx, NK_KEY_PASTE, 0);
 | 
			
		||||
        nk_input_key(ctx, NK_KEY_CUT, 0);
 | 
			
		||||
        nk_input_key(ctx, NK_KEY_SHIFT, 0);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    glfwGetCursorPos(win, &x, &y);
 | 
			
		||||
    nk_input_motion(ctx, (int)x, (int)y);
 | 
			
		||||
    if (ctx->input.mouse.grabbed) {
 | 
			
		||||
        glfwSetCursorPos(glfw.win, (double)ctx->input.mouse.prev.x, (double)ctx->input.mouse.prev.y);
 | 
			
		||||
        ctx->input.mouse.pos.x = ctx->input.mouse.prev.x;
 | 
			
		||||
        ctx->input.mouse.pos.y = ctx->input.mouse.prev.y;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    nk_input_button(ctx, NK_BUTTON_LEFT, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_LEFT) == GLFW_PRESS);
 | 
			
		||||
    nk_input_button(ctx, NK_BUTTON_MIDDLE, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_MIDDLE) == GLFW_PRESS);
 | 
			
		||||
    nk_input_button(ctx, NK_BUTTON_RIGHT, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_RIGHT) == GLFW_PRESS);
 | 
			
		||||
    nk_input_button(ctx, NK_BUTTON_DOUBLE, (int)glfw.double_click_pos.x, (int)glfw.double_click_pos.y, glfw.is_double_click_down);
 | 
			
		||||
    nk_input_scroll(ctx, glfw.scroll);
 | 
			
		||||
    nk_input_end(&glfw.ctx);
 | 
			
		||||
    glfw.text_len = 0;
 | 
			
		||||
    glfw.scroll = nk_vec2(0,0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
NK_API
 | 
			
		||||
void nk_glfw3_shutdown(void)
 | 
			
		||||
{
 | 
			
		||||
    struct nk_glfw_device *dev = &glfw.ogl;
 | 
			
		||||
    nk_font_atlas_clear(&glfw.atlas);
 | 
			
		||||
    nk_free(&glfw.ctx);
 | 
			
		||||
    glDeleteTextures(1, &dev->font_tex);
 | 
			
		||||
    nk_buffer_free(&dev->cmds);
 | 
			
		||||
    NK_MEMSET(&glfw, 0, sizeof(glfw));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
							
								
								
									
										1048
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/stb_image_write.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1048
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/stb_image_write.h
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										594
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/tinycthread.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										594
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/tinycthread.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,594 @@
 | 
			
		||||
/* -*- mode: c; tab-width: 2; indent-tabs-mode: nil; -*-
 | 
			
		||||
Copyright (c) 2012 Marcus Geelnard
 | 
			
		||||
 | 
			
		||||
This software is provided 'as-is', without any express or implied
 | 
			
		||||
warranty. In no event will the authors be held liable for any damages
 | 
			
		||||
arising from the use of this software.
 | 
			
		||||
 | 
			
		||||
Permission is granted to anyone to use this software for any purpose,
 | 
			
		||||
including commercial applications, and to alter it and redistribute it
 | 
			
		||||
freely, subject to the following restrictions:
 | 
			
		||||
 | 
			
		||||
    1. The origin of this software must not be misrepresented; you must not
 | 
			
		||||
    claim that you wrote the original software. If you use this software
 | 
			
		||||
    in a product, an acknowledgment in the product documentation would be
 | 
			
		||||
    appreciated but is not required.
 | 
			
		||||
 | 
			
		||||
    2. Altered source versions must be plainly marked as such, and must not be
 | 
			
		||||
    misrepresented as being the original software.
 | 
			
		||||
 | 
			
		||||
    3. This notice may not be removed or altered from any source
 | 
			
		||||
    distribution.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/* 2013-01-06 Camilla Löwy <elmindreda@glfw.org>
 | 
			
		||||
 *
 | 
			
		||||
 * Added casts from time_t to DWORD to avoid warnings on VC++.
 | 
			
		||||
 * Fixed time retrieval on POSIX systems.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "tinycthread.h"
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
 | 
			
		||||
/* Platform specific includes */
 | 
			
		||||
#if defined(_TTHREAD_POSIX_)
 | 
			
		||||
  #include <signal.h>
 | 
			
		||||
  #include <sched.h>
 | 
			
		||||
  #include <unistd.h>
 | 
			
		||||
  #include <sys/time.h>
 | 
			
		||||
  #include <errno.h>
 | 
			
		||||
#elif defined(_TTHREAD_WIN32_)
 | 
			
		||||
  #include <process.h>
 | 
			
		||||
  #include <sys/timeb.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Standard, good-to-have defines */
 | 
			
		||||
#ifndef NULL
 | 
			
		||||
  #define NULL (void*)0
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef TRUE
 | 
			
		||||
  #define TRUE 1
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef FALSE
 | 
			
		||||
  #define FALSE 0
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
int mtx_init(mtx_t *mtx, int type)
 | 
			
		||||
{
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
  mtx->mAlreadyLocked = FALSE;
 | 
			
		||||
  mtx->mRecursive = type & mtx_recursive;
 | 
			
		||||
  InitializeCriticalSection(&mtx->mHandle);
 | 
			
		||||
  return thrd_success;
 | 
			
		||||
#else
 | 
			
		||||
  int ret;
 | 
			
		||||
  pthread_mutexattr_t attr;
 | 
			
		||||
  pthread_mutexattr_init(&attr);
 | 
			
		||||
  if (type & mtx_recursive)
 | 
			
		||||
  {
 | 
			
		||||
    pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
 | 
			
		||||
  }
 | 
			
		||||
  ret = pthread_mutex_init(mtx, &attr);
 | 
			
		||||
  pthread_mutexattr_destroy(&attr);
 | 
			
		||||
  return ret == 0 ? thrd_success : thrd_error;
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void mtx_destroy(mtx_t *mtx)
 | 
			
		||||
{
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
  DeleteCriticalSection(&mtx->mHandle);
 | 
			
		||||
#else
 | 
			
		||||
  pthread_mutex_destroy(mtx);
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int mtx_lock(mtx_t *mtx)
 | 
			
		||||
{
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
  EnterCriticalSection(&mtx->mHandle);
 | 
			
		||||
  if (!mtx->mRecursive)
 | 
			
		||||
  {
 | 
			
		||||
    while(mtx->mAlreadyLocked) Sleep(1000); /* Simulate deadlock... */
 | 
			
		||||
    mtx->mAlreadyLocked = TRUE;
 | 
			
		||||
  }
 | 
			
		||||
  return thrd_success;
 | 
			
		||||
#else
 | 
			
		||||
  return pthread_mutex_lock(mtx) == 0 ? thrd_success : thrd_error;
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int mtx_timedlock(mtx_t *mtx, const struct timespec *ts)
 | 
			
		||||
{
 | 
			
		||||
  /* FIXME! */
 | 
			
		||||
  (void)mtx;
 | 
			
		||||
  (void)ts;
 | 
			
		||||
  return thrd_error;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int mtx_trylock(mtx_t *mtx)
 | 
			
		||||
{
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
  int ret = TryEnterCriticalSection(&mtx->mHandle) ? thrd_success : thrd_busy;
 | 
			
		||||
  if ((!mtx->mRecursive) && (ret == thrd_success) && mtx->mAlreadyLocked)
 | 
			
		||||
  {
 | 
			
		||||
    LeaveCriticalSection(&mtx->mHandle);
 | 
			
		||||
    ret = thrd_busy;
 | 
			
		||||
  }
 | 
			
		||||
  return ret;
 | 
			
		||||
#else
 | 
			
		||||
  return (pthread_mutex_trylock(mtx) == 0) ? thrd_success : thrd_busy;
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int mtx_unlock(mtx_t *mtx)
 | 
			
		||||
{
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
  mtx->mAlreadyLocked = FALSE;
 | 
			
		||||
  LeaveCriticalSection(&mtx->mHandle);
 | 
			
		||||
  return thrd_success;
 | 
			
		||||
#else
 | 
			
		||||
  return pthread_mutex_unlock(mtx) == 0 ? thrd_success : thrd_error;;
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
#define _CONDITION_EVENT_ONE 0
 | 
			
		||||
#define _CONDITION_EVENT_ALL 1
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
int cnd_init(cnd_t *cond)
 | 
			
		||||
{
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
  cond->mWaitersCount = 0;
 | 
			
		||||
 | 
			
		||||
  /* Init critical section */
 | 
			
		||||
  InitializeCriticalSection(&cond->mWaitersCountLock);
 | 
			
		||||
 | 
			
		||||
  /* Init events */
 | 
			
		||||
  cond->mEvents[_CONDITION_EVENT_ONE] = CreateEvent(NULL, FALSE, FALSE, NULL);
 | 
			
		||||
  if (cond->mEvents[_CONDITION_EVENT_ONE] == NULL)
 | 
			
		||||
  {
 | 
			
		||||
    cond->mEvents[_CONDITION_EVENT_ALL] = NULL;
 | 
			
		||||
    return thrd_error;
 | 
			
		||||
  }
 | 
			
		||||
  cond->mEvents[_CONDITION_EVENT_ALL] = CreateEvent(NULL, TRUE, FALSE, NULL);
 | 
			
		||||
  if (cond->mEvents[_CONDITION_EVENT_ALL] == NULL)
 | 
			
		||||
  {
 | 
			
		||||
    CloseHandle(cond->mEvents[_CONDITION_EVENT_ONE]);
 | 
			
		||||
    cond->mEvents[_CONDITION_EVENT_ONE] = NULL;
 | 
			
		||||
    return thrd_error;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return thrd_success;
 | 
			
		||||
#else
 | 
			
		||||
  return pthread_cond_init(cond, NULL) == 0 ? thrd_success : thrd_error;
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void cnd_destroy(cnd_t *cond)
 | 
			
		||||
{
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
  if (cond->mEvents[_CONDITION_EVENT_ONE] != NULL)
 | 
			
		||||
  {
 | 
			
		||||
    CloseHandle(cond->mEvents[_CONDITION_EVENT_ONE]);
 | 
			
		||||
  }
 | 
			
		||||
  if (cond->mEvents[_CONDITION_EVENT_ALL] != NULL)
 | 
			
		||||
  {
 | 
			
		||||
    CloseHandle(cond->mEvents[_CONDITION_EVENT_ALL]);
 | 
			
		||||
  }
 | 
			
		||||
  DeleteCriticalSection(&cond->mWaitersCountLock);
 | 
			
		||||
#else
 | 
			
		||||
  pthread_cond_destroy(cond);
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int cnd_signal(cnd_t *cond)
 | 
			
		||||
{
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
  int haveWaiters;
 | 
			
		||||
 | 
			
		||||
  /* Are there any waiters? */
 | 
			
		||||
  EnterCriticalSection(&cond->mWaitersCountLock);
 | 
			
		||||
  haveWaiters = (cond->mWaitersCount > 0);
 | 
			
		||||
  LeaveCriticalSection(&cond->mWaitersCountLock);
 | 
			
		||||
 | 
			
		||||
  /* If we have any waiting threads, send them a signal */
 | 
			
		||||
  if(haveWaiters)
 | 
			
		||||
  {
 | 
			
		||||
    if (SetEvent(cond->mEvents[_CONDITION_EVENT_ONE]) == 0)
 | 
			
		||||
    {
 | 
			
		||||
      return thrd_error;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return thrd_success;
 | 
			
		||||
#else
 | 
			
		||||
  return pthread_cond_signal(cond) == 0 ? thrd_success : thrd_error;
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int cnd_broadcast(cnd_t *cond)
 | 
			
		||||
{
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
  int haveWaiters;
 | 
			
		||||
 | 
			
		||||
  /* Are there any waiters? */
 | 
			
		||||
  EnterCriticalSection(&cond->mWaitersCountLock);
 | 
			
		||||
  haveWaiters = (cond->mWaitersCount > 0);
 | 
			
		||||
  LeaveCriticalSection(&cond->mWaitersCountLock);
 | 
			
		||||
 | 
			
		||||
  /* If we have any waiting threads, send them a signal */
 | 
			
		||||
  if(haveWaiters)
 | 
			
		||||
  {
 | 
			
		||||
    if (SetEvent(cond->mEvents[_CONDITION_EVENT_ALL]) == 0)
 | 
			
		||||
    {
 | 
			
		||||
      return thrd_error;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return thrd_success;
 | 
			
		||||
#else
 | 
			
		||||
  return pthread_cond_signal(cond) == 0 ? thrd_success : thrd_error;
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
static int _cnd_timedwait_win32(cnd_t *cond, mtx_t *mtx, DWORD timeout)
 | 
			
		||||
{
 | 
			
		||||
  int result, lastWaiter;
 | 
			
		||||
 | 
			
		||||
  /* Increment number of waiters */
 | 
			
		||||
  EnterCriticalSection(&cond->mWaitersCountLock);
 | 
			
		||||
  ++ cond->mWaitersCount;
 | 
			
		||||
  LeaveCriticalSection(&cond->mWaitersCountLock);
 | 
			
		||||
 | 
			
		||||
  /* Release the mutex while waiting for the condition (will decrease
 | 
			
		||||
     the number of waiters when done)... */
 | 
			
		||||
  mtx_unlock(mtx);
 | 
			
		||||
 | 
			
		||||
  /* Wait for either event to become signaled due to cnd_signal() or
 | 
			
		||||
     cnd_broadcast() being called */
 | 
			
		||||
  result = WaitForMultipleObjects(2, cond->mEvents, FALSE, timeout);
 | 
			
		||||
  if (result == WAIT_TIMEOUT)
 | 
			
		||||
  {
 | 
			
		||||
    return thrd_timeout;
 | 
			
		||||
  }
 | 
			
		||||
  else if (result == (int)WAIT_FAILED)
 | 
			
		||||
  {
 | 
			
		||||
    return thrd_error;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /* Check if we are the last waiter */
 | 
			
		||||
  EnterCriticalSection(&cond->mWaitersCountLock);
 | 
			
		||||
  -- cond->mWaitersCount;
 | 
			
		||||
  lastWaiter = (result == (WAIT_OBJECT_0 + _CONDITION_EVENT_ALL)) &&
 | 
			
		||||
               (cond->mWaitersCount == 0);
 | 
			
		||||
  LeaveCriticalSection(&cond->mWaitersCountLock);
 | 
			
		||||
 | 
			
		||||
  /* If we are the last waiter to be notified to stop waiting, reset the event */
 | 
			
		||||
  if (lastWaiter)
 | 
			
		||||
  {
 | 
			
		||||
    if (ResetEvent(cond->mEvents[_CONDITION_EVENT_ALL]) == 0)
 | 
			
		||||
    {
 | 
			
		||||
      return thrd_error;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /* Re-acquire the mutex */
 | 
			
		||||
  mtx_lock(mtx);
 | 
			
		||||
 | 
			
		||||
  return thrd_success;
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
int cnd_wait(cnd_t *cond, mtx_t *mtx)
 | 
			
		||||
{
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
  return _cnd_timedwait_win32(cond, mtx, INFINITE);
 | 
			
		||||
#else
 | 
			
		||||
  return pthread_cond_wait(cond, mtx) == 0 ? thrd_success : thrd_error;
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int cnd_timedwait(cnd_t *cond, mtx_t *mtx, const struct timespec *ts)
 | 
			
		||||
{
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
  struct timespec now;
 | 
			
		||||
  if (clock_gettime(CLOCK_REALTIME, &now) == 0)
 | 
			
		||||
  {
 | 
			
		||||
    DWORD delta = (DWORD) ((ts->tv_sec - now.tv_sec) * 1000 +
 | 
			
		||||
                           (ts->tv_nsec - now.tv_nsec + 500000) / 1000000);
 | 
			
		||||
    return _cnd_timedwait_win32(cond, mtx, delta);
 | 
			
		||||
  }
 | 
			
		||||
  else
 | 
			
		||||
    return thrd_error;
 | 
			
		||||
#else
 | 
			
		||||
  int ret;
 | 
			
		||||
  ret = pthread_cond_timedwait(cond, mtx, ts);
 | 
			
		||||
  if (ret == ETIMEDOUT)
 | 
			
		||||
  {
 | 
			
		||||
    return thrd_timeout;
 | 
			
		||||
  }
 | 
			
		||||
  return ret == 0 ? thrd_success : thrd_error;
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/** Information to pass to the new thread (what to run). */
 | 
			
		||||
typedef struct {
 | 
			
		||||
  thrd_start_t mFunction; /**< Pointer to the function to be executed. */
 | 
			
		||||
  void * mArg;            /**< Function argument for the thread function. */
 | 
			
		||||
} _thread_start_info;
 | 
			
		||||
 | 
			
		||||
/* Thread wrapper function. */
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
static unsigned WINAPI _thrd_wrapper_function(void * aArg)
 | 
			
		||||
#elif defined(_TTHREAD_POSIX_)
 | 
			
		||||
static void * _thrd_wrapper_function(void * aArg)
 | 
			
		||||
#endif
 | 
			
		||||
{
 | 
			
		||||
  thrd_start_t fun;
 | 
			
		||||
  void *arg;
 | 
			
		||||
  int  res;
 | 
			
		||||
#if defined(_TTHREAD_POSIX_)
 | 
			
		||||
  void *pres;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  /* Get thread startup information */
 | 
			
		||||
  _thread_start_info *ti = (_thread_start_info *) aArg;
 | 
			
		||||
  fun = ti->mFunction;
 | 
			
		||||
  arg = ti->mArg;
 | 
			
		||||
 | 
			
		||||
  /* The thread is responsible for freeing the startup information */
 | 
			
		||||
  free((void *)ti);
 | 
			
		||||
 | 
			
		||||
  /* Call the actual client thread function */
 | 
			
		||||
  res = fun(arg);
 | 
			
		||||
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
  return res;
 | 
			
		||||
#else
 | 
			
		||||
  pres = malloc(sizeof(int));
 | 
			
		||||
  if (pres != NULL)
 | 
			
		||||
  {
 | 
			
		||||
    *(int*)pres = res;
 | 
			
		||||
  }
 | 
			
		||||
  return pres;
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int thrd_create(thrd_t *thr, thrd_start_t func, void *arg)
 | 
			
		||||
{
 | 
			
		||||
  /* Fill out the thread startup information (passed to the thread wrapper,
 | 
			
		||||
     which will eventually free it) */
 | 
			
		||||
  _thread_start_info* ti = (_thread_start_info*)malloc(sizeof(_thread_start_info));
 | 
			
		||||
  if (ti == NULL)
 | 
			
		||||
  {
 | 
			
		||||
    return thrd_nomem;
 | 
			
		||||
  }
 | 
			
		||||
  ti->mFunction = func;
 | 
			
		||||
  ti->mArg = arg;
 | 
			
		||||
 | 
			
		||||
  /* Create the thread */
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
  *thr = (HANDLE)_beginthreadex(NULL, 0, _thrd_wrapper_function, (void *)ti, 0, NULL);
 | 
			
		||||
#elif defined(_TTHREAD_POSIX_)
 | 
			
		||||
  if(pthread_create(thr, NULL, _thrd_wrapper_function, (void *)ti) != 0)
 | 
			
		||||
  {
 | 
			
		||||
    *thr = 0;
 | 
			
		||||
  }
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  /* Did we fail to create the thread? */
 | 
			
		||||
  if(!*thr)
 | 
			
		||||
  {
 | 
			
		||||
    free(ti);
 | 
			
		||||
    return thrd_error;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return thrd_success;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
thrd_t thrd_current(void)
 | 
			
		||||
{
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
  return GetCurrentThread();
 | 
			
		||||
#else
 | 
			
		||||
  return pthread_self();
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int thrd_detach(thrd_t thr)
 | 
			
		||||
{
 | 
			
		||||
  /* FIXME! */
 | 
			
		||||
  (void)thr;
 | 
			
		||||
  return thrd_error;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int thrd_equal(thrd_t thr0, thrd_t thr1)
 | 
			
		||||
{
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
  return thr0 == thr1;
 | 
			
		||||
#else
 | 
			
		||||
  return pthread_equal(thr0, thr1);
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void thrd_exit(int res)
 | 
			
		||||
{
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
  ExitThread(res);
 | 
			
		||||
#else
 | 
			
		||||
  void *pres = malloc(sizeof(int));
 | 
			
		||||
  if (pres != NULL)
 | 
			
		||||
  {
 | 
			
		||||
    *(int*)pres = res;
 | 
			
		||||
  }
 | 
			
		||||
  pthread_exit(pres);
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int thrd_join(thrd_t thr, int *res)
 | 
			
		||||
{
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
  if (WaitForSingleObject(thr, INFINITE) == WAIT_FAILED)
 | 
			
		||||
  {
 | 
			
		||||
    return thrd_error;
 | 
			
		||||
  }
 | 
			
		||||
  if (res != NULL)
 | 
			
		||||
  {
 | 
			
		||||
    DWORD dwRes;
 | 
			
		||||
    GetExitCodeThread(thr, &dwRes);
 | 
			
		||||
    *res = dwRes;
 | 
			
		||||
  }
 | 
			
		||||
#elif defined(_TTHREAD_POSIX_)
 | 
			
		||||
  void *pres;
 | 
			
		||||
  int ires = 0;
 | 
			
		||||
  if (pthread_join(thr, &pres) != 0)
 | 
			
		||||
  {
 | 
			
		||||
    return thrd_error;
 | 
			
		||||
  }
 | 
			
		||||
  if (pres != NULL)
 | 
			
		||||
  {
 | 
			
		||||
    ires = *(int*)pres;
 | 
			
		||||
    free(pres);
 | 
			
		||||
  }
 | 
			
		||||
  if (res != NULL)
 | 
			
		||||
  {
 | 
			
		||||
    *res = ires;
 | 
			
		||||
  }
 | 
			
		||||
#endif
 | 
			
		||||
  return thrd_success;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int thrd_sleep(const struct timespec *time_point, struct timespec *remaining)
 | 
			
		||||
{
 | 
			
		||||
  struct timespec now;
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
  DWORD delta;
 | 
			
		||||
#else
 | 
			
		||||
  long delta;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  /* Get the current time */
 | 
			
		||||
  if (clock_gettime(CLOCK_REALTIME, &now) != 0)
 | 
			
		||||
    return -2;  // FIXME: Some specific error code?
 | 
			
		||||
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
  /* Delta in milliseconds */
 | 
			
		||||
  delta = (DWORD) ((time_point->tv_sec - now.tv_sec) * 1000 +
 | 
			
		||||
                   (time_point->tv_nsec - now.tv_nsec + 500000) / 1000000);
 | 
			
		||||
  if (delta > 0)
 | 
			
		||||
  {
 | 
			
		||||
    Sleep(delta);
 | 
			
		||||
  }
 | 
			
		||||
#else
 | 
			
		||||
  /* Delta in microseconds */
 | 
			
		||||
  delta = (time_point->tv_sec - now.tv_sec) * 1000000L +
 | 
			
		||||
          (time_point->tv_nsec - now.tv_nsec + 500L) / 1000L;
 | 
			
		||||
 | 
			
		||||
  /* On some systems, the usleep argument must be < 1000000 */
 | 
			
		||||
  while (delta > 999999L)
 | 
			
		||||
  {
 | 
			
		||||
    usleep(999999);
 | 
			
		||||
    delta -= 999999L;
 | 
			
		||||
  }
 | 
			
		||||
  if (delta > 0L)
 | 
			
		||||
  {
 | 
			
		||||
    usleep((useconds_t)delta);
 | 
			
		||||
  }
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  /* We don't support waking up prematurely (yet) */
 | 
			
		||||
  if (remaining)
 | 
			
		||||
  {
 | 
			
		||||
    remaining->tv_sec = 0;
 | 
			
		||||
    remaining->tv_nsec = 0;
 | 
			
		||||
  }
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void thrd_yield(void)
 | 
			
		||||
{
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
  Sleep(0);
 | 
			
		||||
#else
 | 
			
		||||
  sched_yield();
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int tss_create(tss_t *key, tss_dtor_t dtor)
 | 
			
		||||
{
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
  /* FIXME: The destructor function is not supported yet... */
 | 
			
		||||
  if (dtor != NULL)
 | 
			
		||||
  {
 | 
			
		||||
    return thrd_error;
 | 
			
		||||
  }
 | 
			
		||||
  *key = TlsAlloc();
 | 
			
		||||
  if (*key == TLS_OUT_OF_INDEXES)
 | 
			
		||||
  {
 | 
			
		||||
    return thrd_error;
 | 
			
		||||
  }
 | 
			
		||||
#else
 | 
			
		||||
  if (pthread_key_create(key, dtor) != 0)
 | 
			
		||||
  {
 | 
			
		||||
    return thrd_error;
 | 
			
		||||
  }
 | 
			
		||||
#endif
 | 
			
		||||
  return thrd_success;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void tss_delete(tss_t key)
 | 
			
		||||
{
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
  TlsFree(key);
 | 
			
		||||
#else
 | 
			
		||||
  pthread_key_delete(key);
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void *tss_get(tss_t key)
 | 
			
		||||
{
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
  return TlsGetValue(key);
 | 
			
		||||
#else
 | 
			
		||||
  return pthread_getspecific(key);
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int tss_set(tss_t key, void *val)
 | 
			
		||||
{
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
  if (TlsSetValue(key, val) == 0)
 | 
			
		||||
  {
 | 
			
		||||
    return thrd_error;
 | 
			
		||||
  }
 | 
			
		||||
#else
 | 
			
		||||
  if (pthread_setspecific(key, val) != 0)
 | 
			
		||||
  {
 | 
			
		||||
    return thrd_error;
 | 
			
		||||
  }
 | 
			
		||||
#endif
 | 
			
		||||
  return thrd_success;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if defined(_TTHREAD_EMULATE_CLOCK_GETTIME_)
 | 
			
		||||
int _tthread_clock_gettime(clockid_t clk_id, struct timespec *ts)
 | 
			
		||||
{
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
  struct _timeb tb;
 | 
			
		||||
  _ftime(&tb);
 | 
			
		||||
  ts->tv_sec = (time_t)tb.time;
 | 
			
		||||
  ts->tv_nsec = 1000000L * (long)tb.millitm;
 | 
			
		||||
#else
 | 
			
		||||
  struct timeval tv;
 | 
			
		||||
  gettimeofday(&tv, NULL);
 | 
			
		||||
  ts->tv_sec = (time_t)tv.tv_sec;
 | 
			
		||||
  ts->tv_nsec = 1000L * (long)tv.tv_usec;
 | 
			
		||||
#endif
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
#endif // _TTHREAD_EMULATE_CLOCK_GETTIME_
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										443
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/tinycthread.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										443
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/tinycthread.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,443 @@
 | 
			
		||||
/* -*- mode: c; tab-width: 2; indent-tabs-mode: nil; -*-
 | 
			
		||||
Copyright (c) 2012 Marcus Geelnard
 | 
			
		||||
 | 
			
		||||
This software is provided 'as-is', without any express or implied
 | 
			
		||||
warranty. In no event will the authors be held liable for any damages
 | 
			
		||||
arising from the use of this software.
 | 
			
		||||
 | 
			
		||||
Permission is granted to anyone to use this software for any purpose,
 | 
			
		||||
including commercial applications, and to alter it and redistribute it
 | 
			
		||||
freely, subject to the following restrictions:
 | 
			
		||||
 | 
			
		||||
    1. The origin of this software must not be misrepresented; you must not
 | 
			
		||||
    claim that you wrote the original software. If you use this software
 | 
			
		||||
    in a product, an acknowledgment in the product documentation would be
 | 
			
		||||
    appreciated but is not required.
 | 
			
		||||
 | 
			
		||||
    2. Altered source versions must be plainly marked as such, and must not be
 | 
			
		||||
    misrepresented as being the original software.
 | 
			
		||||
 | 
			
		||||
    3. This notice may not be removed or altered from any source
 | 
			
		||||
    distribution.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#ifndef _TINYCTHREAD_H_
 | 
			
		||||
#define _TINYCTHREAD_H_
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
* @file
 | 
			
		||||
* @mainpage TinyCThread API Reference
 | 
			
		||||
*
 | 
			
		||||
* @section intro_sec Introduction
 | 
			
		||||
* TinyCThread is a minimal, portable implementation of basic threading
 | 
			
		||||
* classes for C.
 | 
			
		||||
*
 | 
			
		||||
* They closely mimic the functionality and naming of the C11 standard, and
 | 
			
		||||
* should be easily replaceable with the corresponding standard variants.
 | 
			
		||||
*
 | 
			
		||||
* @section port_sec Portability
 | 
			
		||||
* The Win32 variant uses the native Win32 API for implementing the thread
 | 
			
		||||
* classes, while for other systems, the POSIX threads API (pthread) is used.
 | 
			
		||||
*
 | 
			
		||||
* @section misc_sec Miscellaneous
 | 
			
		||||
* The following special keywords are available: #_Thread_local.
 | 
			
		||||
*
 | 
			
		||||
* For more detailed information, browse the different sections of this
 | 
			
		||||
* documentation. A good place to start is:
 | 
			
		||||
* tinycthread.h.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/* Which platform are we on? */
 | 
			
		||||
#if !defined(_TTHREAD_PLATFORM_DEFINED_)
 | 
			
		||||
  #if defined(_WIN32) || defined(__WIN32__) || defined(__WINDOWS__)
 | 
			
		||||
    #define _TTHREAD_WIN32_
 | 
			
		||||
  #else
 | 
			
		||||
    #define _TTHREAD_POSIX_
 | 
			
		||||
  #endif
 | 
			
		||||
  #define _TTHREAD_PLATFORM_DEFINED_
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Activate some POSIX functionality (e.g. clock_gettime and recursive mutexes) */
 | 
			
		||||
#if defined(_TTHREAD_POSIX_)
 | 
			
		||||
  #undef _FEATURES_H
 | 
			
		||||
  #if !defined(_GNU_SOURCE)
 | 
			
		||||
    #define _GNU_SOURCE
 | 
			
		||||
  #endif
 | 
			
		||||
  #if !defined(_POSIX_C_SOURCE) || ((_POSIX_C_SOURCE - 0) < 199309L)
 | 
			
		||||
    #undef _POSIX_C_SOURCE
 | 
			
		||||
    #define _POSIX_C_SOURCE 199309L
 | 
			
		||||
  #endif
 | 
			
		||||
  #if !defined(_XOPEN_SOURCE) || ((_XOPEN_SOURCE - 0) < 500)
 | 
			
		||||
    #undef _XOPEN_SOURCE
 | 
			
		||||
    #define _XOPEN_SOURCE 500
 | 
			
		||||
  #endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Generic includes */
 | 
			
		||||
#include <time.h>
 | 
			
		||||
 | 
			
		||||
/* Platform specific includes */
 | 
			
		||||
#if defined(_TTHREAD_POSIX_)
 | 
			
		||||
  #include <sys/time.h>
 | 
			
		||||
  #include <pthread.h>
 | 
			
		||||
#elif defined(_TTHREAD_WIN32_)
 | 
			
		||||
  #ifndef WIN32_LEAN_AND_MEAN
 | 
			
		||||
    #define WIN32_LEAN_AND_MEAN
 | 
			
		||||
    #define __UNDEF_LEAN_AND_MEAN
 | 
			
		||||
  #endif
 | 
			
		||||
  #include <windows.h>
 | 
			
		||||
  #ifdef __UNDEF_LEAN_AND_MEAN
 | 
			
		||||
    #undef WIN32_LEAN_AND_MEAN
 | 
			
		||||
    #undef __UNDEF_LEAN_AND_MEAN
 | 
			
		||||
  #endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Workaround for missing TIME_UTC: If time.h doesn't provide TIME_UTC,
 | 
			
		||||
   it's quite likely that libc does not support it either. Hence, fall back to
 | 
			
		||||
   the only other supported time specifier: CLOCK_REALTIME (and if that fails,
 | 
			
		||||
   we're probably emulating clock_gettime anyway, so anything goes). */
 | 
			
		||||
#ifndef TIME_UTC
 | 
			
		||||
  #ifdef CLOCK_REALTIME
 | 
			
		||||
    #define TIME_UTC CLOCK_REALTIME
 | 
			
		||||
  #else
 | 
			
		||||
    #define TIME_UTC 0
 | 
			
		||||
  #endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Workaround for missing clock_gettime (most Windows compilers, afaik) */
 | 
			
		||||
#if defined(_TTHREAD_WIN32_) || defined(__APPLE_CC__)
 | 
			
		||||
#define _TTHREAD_EMULATE_CLOCK_GETTIME_
 | 
			
		||||
/* Emulate struct timespec */
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
struct _ttherad_timespec {
 | 
			
		||||
  time_t tv_sec;
 | 
			
		||||
  long   tv_nsec;
 | 
			
		||||
};
 | 
			
		||||
#define timespec _ttherad_timespec
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Emulate clockid_t */
 | 
			
		||||
typedef int _tthread_clockid_t;
 | 
			
		||||
#define clockid_t _tthread_clockid_t
 | 
			
		||||
 | 
			
		||||
/* Emulate clock_gettime */
 | 
			
		||||
int _tthread_clock_gettime(clockid_t clk_id, struct timespec *ts);
 | 
			
		||||
#define clock_gettime _tthread_clock_gettime
 | 
			
		||||
#ifndef CLOCK_REALTIME
 | 
			
		||||
  #define CLOCK_REALTIME 0
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/** TinyCThread version (major number). */
 | 
			
		||||
#define TINYCTHREAD_VERSION_MAJOR 1
 | 
			
		||||
/** TinyCThread version (minor number). */
 | 
			
		||||
#define TINYCTHREAD_VERSION_MINOR 1
 | 
			
		||||
/** TinyCThread version (full version). */
 | 
			
		||||
#define TINYCTHREAD_VERSION (TINYCTHREAD_VERSION_MAJOR * 100 + TINYCTHREAD_VERSION_MINOR)
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
* @def _Thread_local
 | 
			
		||||
* Thread local storage keyword.
 | 
			
		||||
* A variable that is declared with the @c _Thread_local keyword makes the
 | 
			
		||||
* value of the variable local to each thread (known as thread-local storage,
 | 
			
		||||
* or TLS). Example usage:
 | 
			
		||||
* @code
 | 
			
		||||
* // This variable is local to each thread.
 | 
			
		||||
* _Thread_local int variable;
 | 
			
		||||
* @endcode
 | 
			
		||||
* @note The @c _Thread_local keyword is a macro that maps to the corresponding
 | 
			
		||||
* compiler directive (e.g. @c __declspec(thread)).
 | 
			
		||||
* @note This directive is currently not supported on Mac OS X (it will give
 | 
			
		||||
* a compiler error), since compile-time TLS is not supported in the Mac OS X
 | 
			
		||||
* executable format. Also, some older versions of MinGW (before GCC 4.x) do
 | 
			
		||||
* not support this directive.
 | 
			
		||||
* @hideinitializer
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/* FIXME: Check for a PROPER value of __STDC_VERSION__ to know if we have C11 */
 | 
			
		||||
#if !(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201102L)) && !defined(_Thread_local)
 | 
			
		||||
 #if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
 | 
			
		||||
  #define _Thread_local __thread
 | 
			
		||||
 #else
 | 
			
		||||
  #define _Thread_local __declspec(thread)
 | 
			
		||||
 #endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Macros */
 | 
			
		||||
#define TSS_DTOR_ITERATIONS 0
 | 
			
		||||
 | 
			
		||||
/* Function return values */
 | 
			
		||||
#define thrd_error    0 /**< The requested operation failed */
 | 
			
		||||
#define thrd_success  1 /**< The requested operation succeeded */
 | 
			
		||||
#define thrd_timeout  2 /**< The time specified in the call was reached without acquiring the requested resource */
 | 
			
		||||
#define thrd_busy     3 /**< The requested operation failed because a tesource requested by a test and return function is already in use */
 | 
			
		||||
#define thrd_nomem    4 /**< The requested operation failed because it was unable to allocate memory */
 | 
			
		||||
 | 
			
		||||
/* Mutex types */
 | 
			
		||||
#define mtx_plain     1
 | 
			
		||||
#define mtx_timed     2
 | 
			
		||||
#define mtx_try       4
 | 
			
		||||
#define mtx_recursive 8
 | 
			
		||||
 | 
			
		||||
/* Mutex */
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
typedef struct {
 | 
			
		||||
  CRITICAL_SECTION mHandle;   /* Critical section handle */
 | 
			
		||||
  int mAlreadyLocked;         /* TRUE if the mutex is already locked */
 | 
			
		||||
  int mRecursive;             /* TRUE if the mutex is recursive */
 | 
			
		||||
} mtx_t;
 | 
			
		||||
#else
 | 
			
		||||
typedef pthread_mutex_t mtx_t;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/** Create a mutex object.
 | 
			
		||||
* @param mtx A mutex object.
 | 
			
		||||
* @param type Bit-mask that must have one of the following six values:
 | 
			
		||||
*   @li @c mtx_plain for a simple non-recursive mutex
 | 
			
		||||
*   @li @c mtx_timed for a non-recursive mutex that supports timeout
 | 
			
		||||
*   @li @c mtx_try for a non-recursive mutex that supports test and return
 | 
			
		||||
*   @li @c mtx_plain | @c mtx_recursive (same as @c mtx_plain, but recursive)
 | 
			
		||||
*   @li @c mtx_timed | @c mtx_recursive (same as @c mtx_timed, but recursive)
 | 
			
		||||
*   @li @c mtx_try | @c mtx_recursive (same as @c mtx_try, but recursive)
 | 
			
		||||
* @return @ref thrd_success on success, or @ref thrd_error if the request could
 | 
			
		||||
* not be honored.
 | 
			
		||||
*/
 | 
			
		||||
int mtx_init(mtx_t *mtx, int type);
 | 
			
		||||
 | 
			
		||||
/** Release any resources used by the given mutex.
 | 
			
		||||
* @param mtx A mutex object.
 | 
			
		||||
*/
 | 
			
		||||
void mtx_destroy(mtx_t *mtx);
 | 
			
		||||
 | 
			
		||||
/** Lock the given mutex.
 | 
			
		||||
* Blocks until the given mutex can be locked. If the mutex is non-recursive, and
 | 
			
		||||
* the calling thread already has a lock on the mutex, this call will block
 | 
			
		||||
* forever.
 | 
			
		||||
* @param mtx A mutex object.
 | 
			
		||||
* @return @ref thrd_success on success, or @ref thrd_error if the request could
 | 
			
		||||
* not be honored.
 | 
			
		||||
*/
 | 
			
		||||
int mtx_lock(mtx_t *mtx);
 | 
			
		||||
 | 
			
		||||
/** NOT YET IMPLEMENTED.
 | 
			
		||||
*/
 | 
			
		||||
int mtx_timedlock(mtx_t *mtx, const struct timespec *ts);
 | 
			
		||||
 | 
			
		||||
/** Try to lock the given mutex.
 | 
			
		||||
* The specified mutex shall support either test and return or timeout. If the
 | 
			
		||||
* mutex is already locked, the function returns without blocking.
 | 
			
		||||
* @param mtx A mutex object.
 | 
			
		||||
* @return @ref thrd_success on success, or @ref thrd_busy if the resource
 | 
			
		||||
* requested is already in use, or @ref thrd_error if the request could not be
 | 
			
		||||
* honored.
 | 
			
		||||
*/
 | 
			
		||||
int mtx_trylock(mtx_t *mtx);
 | 
			
		||||
 | 
			
		||||
/** Unlock the given mutex.
 | 
			
		||||
* @param mtx A mutex object.
 | 
			
		||||
* @return @ref thrd_success on success, or @ref thrd_error if the request could
 | 
			
		||||
* not be honored.
 | 
			
		||||
*/
 | 
			
		||||
int mtx_unlock(mtx_t *mtx);
 | 
			
		||||
 | 
			
		||||
/* Condition variable */
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
typedef struct {
 | 
			
		||||
  HANDLE mEvents[2];                  /* Signal and broadcast event HANDLEs. */
 | 
			
		||||
  unsigned int mWaitersCount;         /* Count of the number of waiters. */
 | 
			
		||||
  CRITICAL_SECTION mWaitersCountLock; /* Serialize access to mWaitersCount. */
 | 
			
		||||
} cnd_t;
 | 
			
		||||
#else
 | 
			
		||||
typedef pthread_cond_t cnd_t;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/** Create a condition variable object.
 | 
			
		||||
* @param cond A condition variable object.
 | 
			
		||||
* @return @ref thrd_success on success, or @ref thrd_error if the request could
 | 
			
		||||
* not be honored.
 | 
			
		||||
*/
 | 
			
		||||
int cnd_init(cnd_t *cond);
 | 
			
		||||
 | 
			
		||||
/** Release any resources used by the given condition variable.
 | 
			
		||||
* @param cond A condition variable object.
 | 
			
		||||
*/
 | 
			
		||||
void cnd_destroy(cnd_t *cond);
 | 
			
		||||
 | 
			
		||||
/** Signal a condition variable.
 | 
			
		||||
* Unblocks one of the threads that are blocked on the given condition variable
 | 
			
		||||
* at the time of the call. If no threads are blocked on the condition variable
 | 
			
		||||
* at the time of the call, the function does nothing and return success.
 | 
			
		||||
* @param cond A condition variable object.
 | 
			
		||||
* @return @ref thrd_success on success, or @ref thrd_error if the request could
 | 
			
		||||
* not be honored.
 | 
			
		||||
*/
 | 
			
		||||
int cnd_signal(cnd_t *cond);
 | 
			
		||||
 | 
			
		||||
/** Broadcast a condition variable.
 | 
			
		||||
* Unblocks all of the threads that are blocked on the given condition variable
 | 
			
		||||
* at the time of the call. If no threads are blocked on the condition variable
 | 
			
		||||
* at the time of the call, the function does nothing and return success.
 | 
			
		||||
* @param cond A condition variable object.
 | 
			
		||||
* @return @ref thrd_success on success, or @ref thrd_error if the request could
 | 
			
		||||
* not be honored.
 | 
			
		||||
*/
 | 
			
		||||
int cnd_broadcast(cnd_t *cond);
 | 
			
		||||
 | 
			
		||||
/** Wait for a condition variable to become signaled.
 | 
			
		||||
* The function atomically unlocks the given mutex and endeavors to block until
 | 
			
		||||
* the given condition variable is signaled by a call to cnd_signal or to
 | 
			
		||||
* cnd_broadcast. When the calling thread becomes unblocked it locks the mutex
 | 
			
		||||
* before it returns.
 | 
			
		||||
* @param cond A condition variable object.
 | 
			
		||||
* @param mtx A mutex object.
 | 
			
		||||
* @return @ref thrd_success on success, or @ref thrd_error if the request could
 | 
			
		||||
* not be honored.
 | 
			
		||||
*/
 | 
			
		||||
int cnd_wait(cnd_t *cond, mtx_t *mtx);
 | 
			
		||||
 | 
			
		||||
/** Wait for a condition variable to become signaled.
 | 
			
		||||
* The function atomically unlocks the given mutex and endeavors to block until
 | 
			
		||||
* the given condition variable is signaled by a call to cnd_signal or to
 | 
			
		||||
* cnd_broadcast, or until after the specified time. When the calling thread
 | 
			
		||||
* becomes unblocked it locks the mutex before it returns.
 | 
			
		||||
* @param cond A condition variable object.
 | 
			
		||||
* @param mtx A mutex object.
 | 
			
		||||
* @param xt A point in time at which the request will time out (absolute time).
 | 
			
		||||
* @return @ref thrd_success upon success, or @ref thrd_timeout if the time
 | 
			
		||||
* specified in the call was reached without acquiring the requested resource, or
 | 
			
		||||
* @ref thrd_error if the request could not be honored.
 | 
			
		||||
*/
 | 
			
		||||
int cnd_timedwait(cnd_t *cond, mtx_t *mtx, const struct timespec *ts);
 | 
			
		||||
 | 
			
		||||
/* Thread */
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
typedef HANDLE thrd_t;
 | 
			
		||||
#else
 | 
			
		||||
typedef pthread_t thrd_t;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/** Thread start function.
 | 
			
		||||
* Any thread that is started with the @ref thrd_create() function must be
 | 
			
		||||
* started through a function of this type.
 | 
			
		||||
* @param arg The thread argument (the @c arg argument of the corresponding
 | 
			
		||||
*        @ref thrd_create() call).
 | 
			
		||||
* @return The thread return value, which can be obtained by another thread
 | 
			
		||||
* by using the @ref thrd_join() function.
 | 
			
		||||
*/
 | 
			
		||||
typedef int (*thrd_start_t)(void *arg);
 | 
			
		||||
 | 
			
		||||
/** Create a new thread.
 | 
			
		||||
* @param thr Identifier of the newly created thread.
 | 
			
		||||
* @param func A function pointer to the function that will be executed in
 | 
			
		||||
*        the new thread.
 | 
			
		||||
* @param arg An argument to the thread function.
 | 
			
		||||
* @return @ref thrd_success on success, or @ref thrd_nomem if no memory could
 | 
			
		||||
* be allocated for the thread requested, or @ref thrd_error if the request
 | 
			
		||||
* could not be honored.
 | 
			
		||||
* @note A thread’s identifier may be reused for a different thread once the
 | 
			
		||||
* original thread has exited and either been detached or joined to another
 | 
			
		||||
* thread.
 | 
			
		||||
*/
 | 
			
		||||
int thrd_create(thrd_t *thr, thrd_start_t func, void *arg);
 | 
			
		||||
 | 
			
		||||
/** Identify the calling thread.
 | 
			
		||||
* @return The identifier of the calling thread.
 | 
			
		||||
*/
 | 
			
		||||
thrd_t thrd_current(void);
 | 
			
		||||
 | 
			
		||||
/** NOT YET IMPLEMENTED.
 | 
			
		||||
*/
 | 
			
		||||
int thrd_detach(thrd_t thr);
 | 
			
		||||
 | 
			
		||||
/** Compare two thread identifiers.
 | 
			
		||||
* The function determines if two thread identifiers refer to the same thread.
 | 
			
		||||
* @return Zero if the two thread identifiers refer to different threads.
 | 
			
		||||
* Otherwise a nonzero value is returned.
 | 
			
		||||
*/
 | 
			
		||||
int thrd_equal(thrd_t thr0, thrd_t thr1);
 | 
			
		||||
 | 
			
		||||
/** Terminate execution of the calling thread.
 | 
			
		||||
* @param res Result code of the calling thread.
 | 
			
		||||
*/
 | 
			
		||||
void thrd_exit(int res);
 | 
			
		||||
 | 
			
		||||
/** Wait for a thread to terminate.
 | 
			
		||||
* The function joins the given thread with the current thread by blocking
 | 
			
		||||
* until the other thread has terminated.
 | 
			
		||||
* @param thr The thread to join with.
 | 
			
		||||
* @param res If this pointer is not NULL, the function will store the result
 | 
			
		||||
*        code of the given thread in the integer pointed to by @c res.
 | 
			
		||||
* @return @ref thrd_success on success, or @ref thrd_error if the request could
 | 
			
		||||
* not be honored.
 | 
			
		||||
*/
 | 
			
		||||
int thrd_join(thrd_t thr, int *res);
 | 
			
		||||
 | 
			
		||||
/** Put the calling thread to sleep.
 | 
			
		||||
* Suspend execution of the calling thread.
 | 
			
		||||
* @param time_point A point in time at which the thread will resume (absolute time).
 | 
			
		||||
* @param remaining If non-NULL, this parameter will hold the remaining time until
 | 
			
		||||
*                  time_point upon return. This will typically be zero, but if
 | 
			
		||||
*                  the thread was woken up by a signal that is not ignored before
 | 
			
		||||
*                  time_point was reached @c remaining will hold a positive
 | 
			
		||||
*                  time.
 | 
			
		||||
* @return 0 (zero) on successful sleep, or -1 if an interrupt occurred.
 | 
			
		||||
*/
 | 
			
		||||
int thrd_sleep(const struct timespec *time_point, struct timespec *remaining);
 | 
			
		||||
 | 
			
		||||
/** Yield execution to another thread.
 | 
			
		||||
* Permit other threads to run, even if the current thread would ordinarily
 | 
			
		||||
* continue to run.
 | 
			
		||||
*/
 | 
			
		||||
void thrd_yield(void);
 | 
			
		||||
 | 
			
		||||
/* Thread local storage */
 | 
			
		||||
#if defined(_TTHREAD_WIN32_)
 | 
			
		||||
typedef DWORD tss_t;
 | 
			
		||||
#else
 | 
			
		||||
typedef pthread_key_t tss_t;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/** Destructor function for a thread-specific storage.
 | 
			
		||||
* @param val The value of the destructed thread-specific storage.
 | 
			
		||||
*/
 | 
			
		||||
typedef void (*tss_dtor_t)(void *val);
 | 
			
		||||
 | 
			
		||||
/** Create a thread-specific storage.
 | 
			
		||||
* @param key The unique key identifier that will be set if the function is
 | 
			
		||||
*        successful.
 | 
			
		||||
* @param dtor Destructor function. This can be NULL.
 | 
			
		||||
* @return @ref thrd_success on success, or @ref thrd_error if the request could
 | 
			
		||||
* not be honored.
 | 
			
		||||
* @note The destructor function is not supported under Windows. If @c dtor is
 | 
			
		||||
* not NULL when calling this function under Windows, the function will fail
 | 
			
		||||
* and return @ref thrd_error.
 | 
			
		||||
*/
 | 
			
		||||
int tss_create(tss_t *key, tss_dtor_t dtor);
 | 
			
		||||
 | 
			
		||||
/** Delete a thread-specific storage.
 | 
			
		||||
* The function releases any resources used by the given thread-specific
 | 
			
		||||
* storage.
 | 
			
		||||
* @param key The key that shall be deleted.
 | 
			
		||||
*/
 | 
			
		||||
void tss_delete(tss_t key);
 | 
			
		||||
 | 
			
		||||
/** Get the value for a thread-specific storage.
 | 
			
		||||
* @param key The thread-specific storage identifier.
 | 
			
		||||
* @return The value for the current thread held in the given thread-specific
 | 
			
		||||
* storage.
 | 
			
		||||
*/
 | 
			
		||||
void *tss_get(tss_t key);
 | 
			
		||||
 | 
			
		||||
/** Set the value for a thread-specific storage.
 | 
			
		||||
* @param key The thread-specific storage identifier.
 | 
			
		||||
* @param val The value of the thread-specific storage to set for the current
 | 
			
		||||
*        thread.
 | 
			
		||||
* @return @ref thrd_success on success, or @ref thrd_error if the request could
 | 
			
		||||
* not be honored.
 | 
			
		||||
*/
 | 
			
		||||
int tss_set(tss_t key, void *val);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif /* _TINYTHREAD_H_ */
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										247
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/vs2008/stdint.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										247
									
								
								cs440-acg/ext/nanogui/ext/glfw/deps/vs2008/stdint.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,247 @@
 | 
			
		||||
// ISO C9x  compliant stdint.h for Microsoft Visual Studio
 | 
			
		||||
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 
 | 
			
		||||
// 
 | 
			
		||||
//  Copyright (c) 2006-2008 Alexander Chemeris
 | 
			
		||||
// 
 | 
			
		||||
// Redistribution and use in source and binary forms, with or without
 | 
			
		||||
// modification, are permitted provided that the following conditions are met:
 | 
			
		||||
// 
 | 
			
		||||
//   1. Redistributions of source code must retain the above copyright notice,
 | 
			
		||||
//      this list of conditions and the following disclaimer.
 | 
			
		||||
// 
 | 
			
		||||
//   2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
//      notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
//      documentation and/or other materials provided with the distribution.
 | 
			
		||||
// 
 | 
			
		||||
//   3. The name of the author may be used to endorse or promote products
 | 
			
		||||
//      derived from this software without specific prior written permission.
 | 
			
		||||
// 
 | 
			
		||||
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
 | 
			
		||||
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 | 
			
		||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
 | 
			
		||||
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 | 
			
		||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 | 
			
		||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 | 
			
		||||
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
 | 
			
		||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 | 
			
		||||
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 | 
			
		||||
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
// 
 | 
			
		||||
///////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
#ifndef _MSC_VER // [
 | 
			
		||||
#error "Use this header only with Microsoft Visual C++ compilers!"
 | 
			
		||||
#endif // _MSC_VER ]
 | 
			
		||||
 | 
			
		||||
#ifndef _MSC_STDINT_H_ // [
 | 
			
		||||
#define _MSC_STDINT_H_
 | 
			
		||||
 | 
			
		||||
#if _MSC_VER > 1000
 | 
			
		||||
#pragma once
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <limits.h>
 | 
			
		||||
 | 
			
		||||
// For Visual Studio 6 in C++ mode and for many Visual Studio versions when
 | 
			
		||||
// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'
 | 
			
		||||
// or compiler give many errors like this:
 | 
			
		||||
//   error C2733: second C linkage of overloaded function 'wmemchr' not allowed
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
#  include <wchar.h>
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Define _W64 macros to mark types changing their size, like intptr_t.
 | 
			
		||||
#ifndef _W64
 | 
			
		||||
#  if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
 | 
			
		||||
#     define _W64 __w64
 | 
			
		||||
#  else
 | 
			
		||||
#     define _W64
 | 
			
		||||
#  endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// 7.18.1 Integer types
 | 
			
		||||
 | 
			
		||||
// 7.18.1.1 Exact-width integer types
 | 
			
		||||
 | 
			
		||||
// Visual Studio 6 and Embedded Visual C++ 4 doesn't
 | 
			
		||||
// realize that, e.g. char has the same size as __int8
 | 
			
		||||
// so we give up on __intX for them.
 | 
			
		||||
#if (_MSC_VER < 1300)
 | 
			
		||||
   typedef signed char       int8_t;
 | 
			
		||||
   typedef signed short      int16_t;
 | 
			
		||||
   typedef signed int        int32_t;
 | 
			
		||||
   typedef unsigned char     uint8_t;
 | 
			
		||||
   typedef unsigned short    uint16_t;
 | 
			
		||||
   typedef unsigned int      uint32_t;
 | 
			
		||||
#else
 | 
			
		||||
   typedef signed __int8     int8_t;
 | 
			
		||||
   typedef signed __int16    int16_t;
 | 
			
		||||
   typedef signed __int32    int32_t;
 | 
			
		||||
   typedef unsigned __int8   uint8_t;
 | 
			
		||||
   typedef unsigned __int16  uint16_t;
 | 
			
		||||
   typedef unsigned __int32  uint32_t;
 | 
			
		||||
#endif
 | 
			
		||||
typedef signed __int64       int64_t;
 | 
			
		||||
typedef unsigned __int64     uint64_t;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// 7.18.1.2 Minimum-width integer types
 | 
			
		||||
typedef int8_t    int_least8_t;
 | 
			
		||||
typedef int16_t   int_least16_t;
 | 
			
		||||
typedef int32_t   int_least32_t;
 | 
			
		||||
typedef int64_t   int_least64_t;
 | 
			
		||||
typedef uint8_t   uint_least8_t;
 | 
			
		||||
typedef uint16_t  uint_least16_t;
 | 
			
		||||
typedef uint32_t  uint_least32_t;
 | 
			
		||||
typedef uint64_t  uint_least64_t;
 | 
			
		||||
 | 
			
		||||
// 7.18.1.3 Fastest minimum-width integer types
 | 
			
		||||
typedef int8_t    int_fast8_t;
 | 
			
		||||
typedef int16_t   int_fast16_t;
 | 
			
		||||
typedef int32_t   int_fast32_t;
 | 
			
		||||
typedef int64_t   int_fast64_t;
 | 
			
		||||
typedef uint8_t   uint_fast8_t;
 | 
			
		||||
typedef uint16_t  uint_fast16_t;
 | 
			
		||||
typedef uint32_t  uint_fast32_t;
 | 
			
		||||
typedef uint64_t  uint_fast64_t;
 | 
			
		||||
 | 
			
		||||
// 7.18.1.4 Integer types capable of holding object pointers
 | 
			
		||||
#ifdef _WIN64 // [
 | 
			
		||||
   typedef signed __int64    intptr_t;
 | 
			
		||||
   typedef unsigned __int64  uintptr_t;
 | 
			
		||||
#else // _WIN64 ][
 | 
			
		||||
   typedef _W64 signed int   intptr_t;
 | 
			
		||||
   typedef _W64 unsigned int uintptr_t;
 | 
			
		||||
#endif // _WIN64 ]
 | 
			
		||||
 | 
			
		||||
// 7.18.1.5 Greatest-width integer types
 | 
			
		||||
typedef int64_t   intmax_t;
 | 
			
		||||
typedef uint64_t  uintmax_t;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// 7.18.2 Limits of specified-width integer types
 | 
			
		||||
 | 
			
		||||
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [   See footnote 220 at page 257 and footnote 221 at page 259
 | 
			
		||||
 | 
			
		||||
// 7.18.2.1 Limits of exact-width integer types
 | 
			
		||||
#define INT8_MIN     ((int8_t)_I8_MIN)
 | 
			
		||||
#define INT8_MAX     _I8_MAX
 | 
			
		||||
#define INT16_MIN    ((int16_t)_I16_MIN)
 | 
			
		||||
#define INT16_MAX    _I16_MAX
 | 
			
		||||
#define INT32_MIN    ((int32_t)_I32_MIN)
 | 
			
		||||
#define INT32_MAX    _I32_MAX
 | 
			
		||||
#define INT64_MIN    ((int64_t)_I64_MIN)
 | 
			
		||||
#define INT64_MAX    _I64_MAX
 | 
			
		||||
#define UINT8_MAX    _UI8_MAX
 | 
			
		||||
#define UINT16_MAX   _UI16_MAX
 | 
			
		||||
#define UINT32_MAX   _UI32_MAX
 | 
			
		||||
#define UINT64_MAX   _UI64_MAX
 | 
			
		||||
 | 
			
		||||
// 7.18.2.2 Limits of minimum-width integer types
 | 
			
		||||
#define INT_LEAST8_MIN    INT8_MIN
 | 
			
		||||
#define INT_LEAST8_MAX    INT8_MAX
 | 
			
		||||
#define INT_LEAST16_MIN   INT16_MIN
 | 
			
		||||
#define INT_LEAST16_MAX   INT16_MAX
 | 
			
		||||
#define INT_LEAST32_MIN   INT32_MIN
 | 
			
		||||
#define INT_LEAST32_MAX   INT32_MAX
 | 
			
		||||
#define INT_LEAST64_MIN   INT64_MIN
 | 
			
		||||
#define INT_LEAST64_MAX   INT64_MAX
 | 
			
		||||
#define UINT_LEAST8_MAX   UINT8_MAX
 | 
			
		||||
#define UINT_LEAST16_MAX  UINT16_MAX
 | 
			
		||||
#define UINT_LEAST32_MAX  UINT32_MAX
 | 
			
		||||
#define UINT_LEAST64_MAX  UINT64_MAX
 | 
			
		||||
 | 
			
		||||
// 7.18.2.3 Limits of fastest minimum-width integer types
 | 
			
		||||
#define INT_FAST8_MIN    INT8_MIN
 | 
			
		||||
#define INT_FAST8_MAX    INT8_MAX
 | 
			
		||||
#define INT_FAST16_MIN   INT16_MIN
 | 
			
		||||
#define INT_FAST16_MAX   INT16_MAX
 | 
			
		||||
#define INT_FAST32_MIN   INT32_MIN
 | 
			
		||||
#define INT_FAST32_MAX   INT32_MAX
 | 
			
		||||
#define INT_FAST64_MIN   INT64_MIN
 | 
			
		||||
#define INT_FAST64_MAX   INT64_MAX
 | 
			
		||||
#define UINT_FAST8_MAX   UINT8_MAX
 | 
			
		||||
#define UINT_FAST16_MAX  UINT16_MAX
 | 
			
		||||
#define UINT_FAST32_MAX  UINT32_MAX
 | 
			
		||||
#define UINT_FAST64_MAX  UINT64_MAX
 | 
			
		||||
 | 
			
		||||
// 7.18.2.4 Limits of integer types capable of holding object pointers
 | 
			
		||||
#ifdef _WIN64 // [
 | 
			
		||||
#  define INTPTR_MIN   INT64_MIN
 | 
			
		||||
#  define INTPTR_MAX   INT64_MAX
 | 
			
		||||
#  define UINTPTR_MAX  UINT64_MAX
 | 
			
		||||
#else // _WIN64 ][
 | 
			
		||||
#  define INTPTR_MIN   INT32_MIN
 | 
			
		||||
#  define INTPTR_MAX   INT32_MAX
 | 
			
		||||
#  define UINTPTR_MAX  UINT32_MAX
 | 
			
		||||
#endif // _WIN64 ]
 | 
			
		||||
 | 
			
		||||
// 7.18.2.5 Limits of greatest-width integer types
 | 
			
		||||
#define INTMAX_MIN   INT64_MIN
 | 
			
		||||
#define INTMAX_MAX   INT64_MAX
 | 
			
		||||
#define UINTMAX_MAX  UINT64_MAX
 | 
			
		||||
 | 
			
		||||
// 7.18.3 Limits of other integer types
 | 
			
		||||
 | 
			
		||||
#ifdef _WIN64 // [
 | 
			
		||||
#  define PTRDIFF_MIN  _I64_MIN
 | 
			
		||||
#  define PTRDIFF_MAX  _I64_MAX
 | 
			
		||||
#else  // _WIN64 ][
 | 
			
		||||
#  define PTRDIFF_MIN  _I32_MIN
 | 
			
		||||
#  define PTRDIFF_MAX  _I32_MAX
 | 
			
		||||
#endif  // _WIN64 ]
 | 
			
		||||
 | 
			
		||||
#define SIG_ATOMIC_MIN  INT_MIN
 | 
			
		||||
#define SIG_ATOMIC_MAX  INT_MAX
 | 
			
		||||
 | 
			
		||||
#ifndef SIZE_MAX // [
 | 
			
		||||
#  ifdef _WIN64 // [
 | 
			
		||||
#     define SIZE_MAX  _UI64_MAX
 | 
			
		||||
#  else // _WIN64 ][
 | 
			
		||||
#     define SIZE_MAX  _UI32_MAX
 | 
			
		||||
#  endif // _WIN64 ]
 | 
			
		||||
#endif // SIZE_MAX ]
 | 
			
		||||
 | 
			
		||||
// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
 | 
			
		||||
#ifndef WCHAR_MIN // [
 | 
			
		||||
#  define WCHAR_MIN  0
 | 
			
		||||
#endif  // WCHAR_MIN ]
 | 
			
		||||
#ifndef WCHAR_MAX // [
 | 
			
		||||
#  define WCHAR_MAX  _UI16_MAX
 | 
			
		||||
#endif  // WCHAR_MAX ]
 | 
			
		||||
 | 
			
		||||
#define WINT_MIN  0
 | 
			
		||||
#define WINT_MAX  _UI16_MAX
 | 
			
		||||
 | 
			
		||||
#endif // __STDC_LIMIT_MACROS ]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// 7.18.4 Limits of other integer types
 | 
			
		||||
 | 
			
		||||
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [   See footnote 224 at page 260
 | 
			
		||||
 | 
			
		||||
// 7.18.4.1 Macros for minimum-width integer constants
 | 
			
		||||
 | 
			
		||||
#define INT8_C(val)  val##i8
 | 
			
		||||
#define INT16_C(val) val##i16
 | 
			
		||||
#define INT32_C(val) val##i32
 | 
			
		||||
#define INT64_C(val) val##i64
 | 
			
		||||
 | 
			
		||||
#define UINT8_C(val)  val##ui8
 | 
			
		||||
#define UINT16_C(val) val##ui16
 | 
			
		||||
#define UINT32_C(val) val##ui32
 | 
			
		||||
#define UINT64_C(val) val##ui64
 | 
			
		||||
 | 
			
		||||
// 7.18.4.2 Macros for greatest-width integer constants
 | 
			
		||||
#define INTMAX_C   INT64_C
 | 
			
		||||
#define UINTMAX_C  UINT64_C
 | 
			
		||||
 | 
			
		||||
#endif // __STDC_CONSTANT_MACROS ]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif // _MSC_STDINT_H_ ]
 | 
			
		||||
							
								
								
									
										29
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/CMakeLists.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/CMakeLists.txt
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,29 @@
 | 
			
		||||
 | 
			
		||||
set(glfw_DOCS_SOURCES
 | 
			
		||||
    "${GLFW_SOURCE_DIR}/include/GLFW/glfw3.h"
 | 
			
		||||
    "${GLFW_SOURCE_DIR}/include/GLFW/glfw3native.h"
 | 
			
		||||
    "${GLFW_SOURCE_DIR}/docs/main.dox"
 | 
			
		||||
    "${GLFW_SOURCE_DIR}/docs/news.dox"
 | 
			
		||||
    "${GLFW_SOURCE_DIR}/docs/quick.dox"
 | 
			
		||||
    "${GLFW_SOURCE_DIR}/docs/moving.dox"
 | 
			
		||||
    "${GLFW_SOURCE_DIR}/docs/compile.dox"
 | 
			
		||||
    "${GLFW_SOURCE_DIR}/docs/build.dox"
 | 
			
		||||
    "${GLFW_SOURCE_DIR}/docs/intro.dox"
 | 
			
		||||
    "${GLFW_SOURCE_DIR}/docs/context.dox"
 | 
			
		||||
    "${GLFW_SOURCE_DIR}/docs/monitor.dox"
 | 
			
		||||
    "${GLFW_SOURCE_DIR}/docs/window.dox"
 | 
			
		||||
    "${GLFW_SOURCE_DIR}/docs/input.dox"
 | 
			
		||||
    "${GLFW_SOURCE_DIR}/docs/vulkan.dox"
 | 
			
		||||
    "${GLFW_SOURCE_DIR}/docs/compat.dox"
 | 
			
		||||
    "${GLFW_SOURCE_DIR}/docs/internal.dox")
 | 
			
		||||
 | 
			
		||||
foreach(arg ${glfw_DOCS_SOURCES})
 | 
			
		||||
    set(GLFW_DOCS_SOURCES "${GLFW_DOCS_SOURCES} \\\n\"${arg}\"")
 | 
			
		||||
endforeach()
 | 
			
		||||
 | 
			
		||||
configure_file(Doxyfile.in Doxyfile @ONLY)
 | 
			
		||||
 | 
			
		||||
add_custom_target(docs ALL "${DOXYGEN_EXECUTABLE}"
 | 
			
		||||
                  WORKING_DIRECTORY "${GLFW_BINARY_DIR}/docs"
 | 
			
		||||
                  COMMENT "Generating HTML documentation" VERBATIM)
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										391
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/CONTRIBUTING.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										391
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/CONTRIBUTING.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,391 @@
 | 
			
		||||
# Contribution Guide
 | 
			
		||||
 | 
			
		||||
## Contents
 | 
			
		||||
 | 
			
		||||
- [Asking a question](#asking-a-question)
 | 
			
		||||
- [Reporting a bug](#reporting-a-bug)
 | 
			
		||||
    - [Reporting a compile or link bug](#reporting-a-compile-or-link-bug)
 | 
			
		||||
    - [Reporting a segfault or other crash bug](#reporting-a-segfault-or-other-crash-bug)
 | 
			
		||||
    - [Reporting a context creation bug](#reporting-a-context-creation-bug)
 | 
			
		||||
    - [Reporting a monitor or video mode bug](#reporting-a-monitor-or-video-mode-bug)
 | 
			
		||||
    - [Reporting a window, input or event bug](#reporting-a-window-input-or-event-bug)
 | 
			
		||||
    - [Reporting some other library bug](#reporting-some-other-library-bug)
 | 
			
		||||
    - [Reporting a documentation bug](#reporting-a-documentation-bug)
 | 
			
		||||
    - [Reporting a website bug](#reporting-a-website-bug)
 | 
			
		||||
- [Requesting a feature](#requesting-a-feature)
 | 
			
		||||
- [Contributing a bug fix](#contributing-a-bug-fix)
 | 
			
		||||
- [Contributing a feature](#contributing-a-feature)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## Asking a question
 | 
			
		||||
 | 
			
		||||
Questions about how to use GLFW should be asked either in the [support
 | 
			
		||||
section](http://discourse.glfw.org/c/support) of the forum, under the [Stack
 | 
			
		||||
Overflow tag](https://stackoverflow.com/questions/tagged/glfw) or [Game
 | 
			
		||||
Development tag](https://gamedev.stackexchange.com/questions/tagged/glfw) on
 | 
			
		||||
Stack Exchange or in the IRC channel `#glfw` on
 | 
			
		||||
[Freenode](http://freenode.net/).
 | 
			
		||||
 | 
			
		||||
Questions about the design or implementation of GLFW or about future plans
 | 
			
		||||
should be asked in the [dev section](http://discourse.glfw.org/c/dev) of the
 | 
			
		||||
forum or in the IRC channel.  Please don't open a GitHub issue to discuss design
 | 
			
		||||
questions without first checking with a maintainer.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## Reporting a bug
 | 
			
		||||
 | 
			
		||||
If GLFW is behaving unexpectedly at run-time, start by setting an [error
 | 
			
		||||
callback](https://www.glfw.org/docs/latest/intro_guide.html#error_handling).
 | 
			
		||||
GLFW will often tell you the cause of an error via this callback.  If it
 | 
			
		||||
doesn't, that might be a separate bug.
 | 
			
		||||
 | 
			
		||||
If GLFW is crashing or triggering asserts, make sure that all your object
 | 
			
		||||
handles and other pointers are valid.
 | 
			
		||||
 | 
			
		||||
For bugs where it makes sense, a short, self contained example is absolutely
 | 
			
		||||
invaluable.  Just put it inline in the body text.  Note that if the bug is
 | 
			
		||||
reproducible with one of the test programs that come with GLFW, just mention
 | 
			
		||||
that instead.
 | 
			
		||||
 | 
			
		||||
__Don't worry about adding too much information__.  Unimportant information can
 | 
			
		||||
be abbreviated or removed later, but missing information can stall bug fixing,
 | 
			
		||||
especially when your schedule doesn't align with that of the maintainer.
 | 
			
		||||
 | 
			
		||||
__Please provide text as text, not as images__.  This includes code, error
 | 
			
		||||
messages and any other text.  Text in images cannot be found by other users
 | 
			
		||||
searching for the same problem and may have to be re-typed by maintainers when
 | 
			
		||||
debugging.
 | 
			
		||||
 | 
			
		||||
You don't need to manually indent your code or other text to quote it with
 | 
			
		||||
GitHub Markdown; just surround it with triple backticks:
 | 
			
		||||
 | 
			
		||||
    ```
 | 
			
		||||
    Some quoted text.
 | 
			
		||||
    ```
 | 
			
		||||
 | 
			
		||||
You can also add syntax highlighting by appending the common file extension:
 | 
			
		||||
 | 
			
		||||
    ```c
 | 
			
		||||
    int five(void)
 | 
			
		||||
    {
 | 
			
		||||
        return 5;
 | 
			
		||||
    }
 | 
			
		||||
    ```
 | 
			
		||||
 | 
			
		||||
There are issue labels for both platforms and GPU manufacturers, so there is no
 | 
			
		||||
need to mention these in the subject line.  If you do, it will be removed when
 | 
			
		||||
the issue is labeled.
 | 
			
		||||
 | 
			
		||||
If your bug is already reported, please add any new information you have, or if
 | 
			
		||||
it already has everything, give it a :+1:.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### Reporting a compile or link bug
 | 
			
		||||
 | 
			
		||||
__Note:__ GLFW needs many system APIs to do its job, which on some platforms
 | 
			
		||||
means linking to many system libraries.  If you are using GLFW as a static
 | 
			
		||||
library, that means your application needs to link to these in addition to GLFW.
 | 
			
		||||
 | 
			
		||||
__Note:__ Check the [Compiling
 | 
			
		||||
GLFW](https://www.glfw.org/docs/latest/compile.html) guide and or [Building
 | 
			
		||||
applications](https://www.glfw.org/docs/latest/build.html) guide for before
 | 
			
		||||
opening an issue of this kind.  Most issues are caused by a missing package or
 | 
			
		||||
linker flag.
 | 
			
		||||
 | 
			
		||||
Always include the __operating system name and version__ (e.g. `Windows
 | 
			
		||||
7 64-bit` or `Ubuntu 15.10`) and the __compiler name and version__ (e.g. `Visual
 | 
			
		||||
C++ 2015 Update 2`).  If you are using an official release of GLFW,
 | 
			
		||||
include the __GLFW release version__ (e.g. `3.1.2`), otherwise include the
 | 
			
		||||
__GLFW commit ID__ (e.g.  `3795d78b14ef06008889cc422a1fb8d642597751`) from Git.
 | 
			
		||||
 | 
			
		||||
Please also include the __complete build log__ from your compiler and linker,
 | 
			
		||||
even if it's long.  It can always be shortened later, if necessary.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#### Quick template
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
OS and version:
 | 
			
		||||
Compiler version:
 | 
			
		||||
Release or commit:
 | 
			
		||||
Build log:
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### Reporting a segfault or other crash bug
 | 
			
		||||
 | 
			
		||||
Always include the __operating system name and version__ (e.g. `Windows
 | 
			
		||||
7 64-bit` or `Ubuntu 15.10`).  If you are using an official release of GLFW,
 | 
			
		||||
include the __GLFW release version__ (e.g. `3.1.2`), otherwise include the
 | 
			
		||||
__GLFW commit ID__ (e.g.  `3795d78b14ef06008889cc422a1fb8d642597751`) from Git.
 | 
			
		||||
 | 
			
		||||
Please also include any __error messages__ provided to your application via the
 | 
			
		||||
[error
 | 
			
		||||
callback](https://www.glfw.org/docs/latest/intro_guide.html#error_handling) and
 | 
			
		||||
the __full call stack__ of the crash, or if the crash does not occur in debug
 | 
			
		||||
mode, mention that instead.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#### Quick template
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
OS and version:
 | 
			
		||||
Release or commit:
 | 
			
		||||
Error messages:
 | 
			
		||||
Call stack:
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### Reporting a context creation bug
 | 
			
		||||
 | 
			
		||||
__Note:__ Windows ships with graphics drivers that do not support OpenGL.  If
 | 
			
		||||
GLFW says that your machine lacks support for OpenGL, it very likely does.
 | 
			
		||||
Install drivers from the computer manufacturer or graphics card manufacturer
 | 
			
		||||
([Nvidia](https://www.geforce.com/drivers),
 | 
			
		||||
[AMD](https://www.amd.com/en/support),
 | 
			
		||||
[Intel](https://www-ssl.intel.com/content/www/us/en/support/detect.html)) to
 | 
			
		||||
fix this.
 | 
			
		||||
 | 
			
		||||
__Note:__ AMD only supports OpenGL ES on Windows via EGL.  See the
 | 
			
		||||
[GLFW\_CONTEXT\_CREATION\_API](https://www.glfw.org/docs/latest/window_guide.html#window_hints_ctx)
 | 
			
		||||
hint for how to select EGL.
 | 
			
		||||
 | 
			
		||||
Please verify that context creation also fails with the `glfwinfo` tool before
 | 
			
		||||
reporting it as a bug.  This tool is included in the GLFW source tree as
 | 
			
		||||
`tests/glfwinfo.c` and is built along with the library.  It has switches for all
 | 
			
		||||
GLFW context and framebuffer hints.  Run `glfwinfo -h` for a complete list.
 | 
			
		||||
 | 
			
		||||
Always include the __operating system name and version__ (e.g. `Windows
 | 
			
		||||
7 64-bit` or `Ubuntu 15.10`).  If you are using an official release of GLFW,
 | 
			
		||||
include the __GLFW release version__ (e.g. `3.1.2`), otherwise include the
 | 
			
		||||
__GLFW commit ID__ (e.g.  `3795d78b14ef06008889cc422a1fb8d642597751`) from Git.
 | 
			
		||||
 | 
			
		||||
If you are running your program in a virtual machine, please mention this and
 | 
			
		||||
include the __VM name and version__ (e.g. `VirtualBox 5.1`).
 | 
			
		||||
 | 
			
		||||
Please also include the __GLFW version string__ (`3.2.0 X11 EGL clock_gettime
 | 
			
		||||
/dev/js`), as described
 | 
			
		||||
[here](https://www.glfw.org/docs/latest/intro.html#intro_version_string), the
 | 
			
		||||
__GPU model and driver version__ (e.g. `GeForce GTX660 with 352.79`), and the
 | 
			
		||||
__output of `glfwinfo`__ (with switches matching any hints you set in your
 | 
			
		||||
code) when reporting this kind of bug.  If this tool doesn't run on the machine,
 | 
			
		||||
mention that instead.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#### Quick template
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
OS and version:
 | 
			
		||||
GPU and driver:
 | 
			
		||||
Release or commit:
 | 
			
		||||
Version string:
 | 
			
		||||
glfwinfo output:
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### Reporting a monitor or video mode bug
 | 
			
		||||
 | 
			
		||||
__Note:__ On headless systems on some platforms, no monitors are reported.  This
 | 
			
		||||
causes glfwGetPrimaryMonitor to return `NULL`, which not all applications are
 | 
			
		||||
prepared for.
 | 
			
		||||
 | 
			
		||||
__Note:__ Some third-party tools report more video modes than are approved of
 | 
			
		||||
by the OS.  For safety and compatibility, GLFW only reports video modes the OS
 | 
			
		||||
wants programs to use.  This is not a bug.
 | 
			
		||||
 | 
			
		||||
The `monitors` tool is included in the GLFW source tree as `tests/monitors.c`
 | 
			
		||||
and is built along with the library.  It lists all information GLFW provides
 | 
			
		||||
about monitors it detects.
 | 
			
		||||
 | 
			
		||||
Always include the __operating system name and version__ (e.g. `Windows
 | 
			
		||||
7 64-bit` or `Ubuntu 15.10`).  If you are using an official release of GLFW,
 | 
			
		||||
include the __GLFW release version__ (e.g. `3.1.2`), otherwise include the
 | 
			
		||||
__GLFW commit ID__ (e.g.  `3795d78b14ef06008889cc422a1fb8d642597751`) from Git.
 | 
			
		||||
 | 
			
		||||
If you are running your program in a virtual machine, please mention this and
 | 
			
		||||
include the __VM name and version__ (e.g. `VirtualBox 5.1`).
 | 
			
		||||
 | 
			
		||||
Please also include any __error messages__ provided to your application via the
 | 
			
		||||
[error
 | 
			
		||||
callback](https://www.glfw.org/docs/latest/intro_guide.html#error_handling) and
 | 
			
		||||
the __output of `monitors`__ when reporting this kind of bug.  If this tool
 | 
			
		||||
doesn't run on the machine, mention this instead.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#### Quick template
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
OS and version:
 | 
			
		||||
Release or commit:
 | 
			
		||||
Error messages:
 | 
			
		||||
monitors output:
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### Reporting a window, input or event bug
 | 
			
		||||
 | 
			
		||||
__Note:__ The exact ordering of related window events will sometimes differ.
 | 
			
		||||
 | 
			
		||||
__Note:__ Window moving and resizing (by the user) will block the main thread on
 | 
			
		||||
some platforms.  This is not a bug.  Set a [refresh
 | 
			
		||||
callback](https://www.glfw.org/docs/latest/window.html#window_refresh) if you
 | 
			
		||||
want to keep the window contents updated during a move or size operation.
 | 
			
		||||
 | 
			
		||||
The `events` tool is included in the GLFW source tree as `tests/events.c` and is
 | 
			
		||||
built along with the library.  It prints all information provided to every
 | 
			
		||||
callback supported by GLFW as events occur.  Each event is listed with the time
 | 
			
		||||
and a unique number to make discussions about event logs easier.  The tool has
 | 
			
		||||
command-line options for creating multiple windows and full screen windows.
 | 
			
		||||
 | 
			
		||||
Always include the __operating system name and version__ (e.g. `Windows
 | 
			
		||||
7 64-bit` or `Ubuntu 15.10`).  If you are using an official release of GLFW,
 | 
			
		||||
include the __GLFW release version__ (e.g. `3.1.2`), otherwise include the
 | 
			
		||||
__GLFW commit ID__ (e.g.  `3795d78b14ef06008889cc422a1fb8d642597751`) from Git.
 | 
			
		||||
 | 
			
		||||
If you are running your program in a virtual machine, please mention this and
 | 
			
		||||
include the __VM name and version__ (e.g. `VirtualBox 5.1`).
 | 
			
		||||
 | 
			
		||||
Please also include any __error messages__ provided to your application via the
 | 
			
		||||
[error
 | 
			
		||||
callback](https://www.glfw.org/docs/latest/intro_guide.html#error_handling) and
 | 
			
		||||
if relevant, the __output of `events`__ when reporting this kind of bug.  If
 | 
			
		||||
this tool doesn't run on the machine, mention this instead.
 | 
			
		||||
 | 
			
		||||
__X11:__ If possible, please include what desktop environment (e.g. GNOME,
 | 
			
		||||
Unity, KDE) and/or window manager (e.g. Openbox, dwm, Window Maker) you are
 | 
			
		||||
running.  If the bug is related to keyboard input, please include any input
 | 
			
		||||
method (e.g. ibus, SCIM) you are using.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#### Quick template
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
OS and version:
 | 
			
		||||
Release or commit:
 | 
			
		||||
Error messages:
 | 
			
		||||
events output:
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### Reporting some other library bug
 | 
			
		||||
 | 
			
		||||
Always include the __operating system name and version__ (e.g. `Windows
 | 
			
		||||
7 64-bit` or `Ubuntu 15.10`).  If you are using an official release of GLFW,
 | 
			
		||||
include the __GLFW release version__ (e.g. `3.1.2`), otherwise include the
 | 
			
		||||
__GLFW commit ID__ (e.g.  `3795d78b14ef06008889cc422a1fb8d642597751`) from Git.
 | 
			
		||||
 | 
			
		||||
Please also include any __error messages__ provided to your application via the
 | 
			
		||||
[error
 | 
			
		||||
callback](https://www.glfw.org/docs/latest/intro_guide.html#error_handling), if
 | 
			
		||||
relevant.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#### Quick template
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
OS and version:
 | 
			
		||||
Release or commit:
 | 
			
		||||
Error messages:
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### Reporting a documentation bug
 | 
			
		||||
 | 
			
		||||
If you found a bug in the documentation, including this file, then it's fine to
 | 
			
		||||
just link to that web page or mention that source file.  You don't need to match
 | 
			
		||||
the source to the output or vice versa.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### Reporting a website bug
 | 
			
		||||
 | 
			
		||||
If the bug is in the documentation (anything under `/docs/`) then please see the
 | 
			
		||||
section above.  Bugs in the rest of the site are reported to the [website
 | 
			
		||||
source repository](https://github.com/glfw/website/issues).
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## Requesting a feature
 | 
			
		||||
 | 
			
		||||
Please explain why you need the feature and how you intend to use it.  If you
 | 
			
		||||
have a specific API design in mind, please add that as well.  If you have or are
 | 
			
		||||
planning to write code for the feature, see the section below.
 | 
			
		||||
 | 
			
		||||
If there already is a request for the feature you need, add your specific use
 | 
			
		||||
case unless it is already mentioned.  If it is, give it a :+1:.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## Contributing a bug fix
 | 
			
		||||
 | 
			
		||||
__Note:__ You must have all necessary [intellectual
 | 
			
		||||
property rights](https://en.wikipedia.org/wiki/Intellectual_property) to any
 | 
			
		||||
code you contribute.  If you did not write the code yourself, you must explain
 | 
			
		||||
where it came from and under what license you received it.  Even code using the
 | 
			
		||||
same license as GLFW may not be copied without attribution.
 | 
			
		||||
 | 
			
		||||
__There is no preferred patch size__.  A one character fix is just as welcome as
 | 
			
		||||
a thousand line one, if that is the appropriate size for the fix.
 | 
			
		||||
 | 
			
		||||
In addition to the code, a complete bug fix includes:
 | 
			
		||||
 | 
			
		||||
- Change log entry in `README.md`, describing the incorrect behavior
 | 
			
		||||
- Credits entries for all authors of the bug fix
 | 
			
		||||
 | 
			
		||||
Bug fixes will not be rejected because they don't include all the above parts,
 | 
			
		||||
but please keep in mind that maintainer time is finite and that there are many
 | 
			
		||||
other bugs and features to work on.
 | 
			
		||||
 | 
			
		||||
If the patch fixes a bug introduced after the last release, it should not get
 | 
			
		||||
a change log entry.
 | 
			
		||||
 | 
			
		||||
If you haven't already, read the excellent article [How to Write a Git Commit
 | 
			
		||||
Message](https://chris.beams.io/posts/git-commit/).
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## Contributing a feature
 | 
			
		||||
 | 
			
		||||
__Note:__ You must have all necessary rights to any code you contribute.  If you
 | 
			
		||||
did not write the code yourself, you must explain where it came from and under
 | 
			
		||||
what license.  Even code using the same license as GLFW may not be copied
 | 
			
		||||
without attribution.
 | 
			
		||||
 | 
			
		||||
__Note:__ If you haven't already implemented the feature, check first if there
 | 
			
		||||
already is an open issue for it and if it's already being developed in an
 | 
			
		||||
[experimental branch](https://github.com/glfw/glfw/branches/all).
 | 
			
		||||
 | 
			
		||||
__There is no preferred patch size__.  A one character change is just as welcome
 | 
			
		||||
as one adding a thousand line one, if that is the appropriate size for the
 | 
			
		||||
feature.
 | 
			
		||||
 | 
			
		||||
In addition to the code, a complete feature includes:
 | 
			
		||||
 | 
			
		||||
- Change log entry in `README.md`, listing all new symbols
 | 
			
		||||
- News page entry, briefly describing the feature
 | 
			
		||||
- Guide documentation, with minimal examples, in the relevant guide
 | 
			
		||||
- Reference documentation, with all applicable tags
 | 
			
		||||
- Cross-references and mentions in appropriate places
 | 
			
		||||
- Credits entries for all authors of the feature
 | 
			
		||||
 | 
			
		||||
If the feature requires platform-specific code, at minimum stubs must be added
 | 
			
		||||
for the new platform function to all supported and experimental platforms.
 | 
			
		||||
 | 
			
		||||
If it adds a new callback, support for it must be added to `tests/event.c`.
 | 
			
		||||
 | 
			
		||||
If it adds a new monitor property, support for it must be added to
 | 
			
		||||
`tests/monitor.c`.
 | 
			
		||||
 | 
			
		||||
If it adds a new OpenGL, OpenGL ES or Vulkan option or extension, support
 | 
			
		||||
for it must be added to `tests/glfwinfo.c` and the behavior of the library when
 | 
			
		||||
the extension is missing documented in `docs/compat.dox`.
 | 
			
		||||
 | 
			
		||||
If you haven't already, read the excellent article [How to Write a Git Commit
 | 
			
		||||
Message](https://chris.beams.io/posts/git-commit/).
 | 
			
		||||
 | 
			
		||||
Features will not be rejected because they don't include all the above parts,
 | 
			
		||||
but please keep in mind that maintainer time is finite and that there are many
 | 
			
		||||
other features and bugs to work on.
 | 
			
		||||
 | 
			
		||||
Please also keep in mind that any part of the public API that has been included
 | 
			
		||||
in a release cannot be changed until the next _major_ version.  Features can be
 | 
			
		||||
added and existing parts can sometimes be overloaded (in the general sense of
 | 
			
		||||
doing more things, not in the C++ sense), but code written to the API of one
 | 
			
		||||
minor release should both compile and run on subsequent minor releases.
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										1861
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/Doxyfile.in
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1861
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/Doxyfile.in
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										71
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/DoxygenLayout.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										71
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/DoxygenLayout.xml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,71 @@
 | 
			
		||||
<doxygenlayout version="1.0">
 | 
			
		||||
  <!-- Generated by doxygen 1.8.14 -->
 | 
			
		||||
  <!-- Navigation index tabs for HTML output -->
 | 
			
		||||
  <navindex>
 | 
			
		||||
    <tab type="mainpage" visible="yes" title="Introduction"/>
 | 
			
		||||
    <tab type="user" url="quick_guide.html" title="Tutorial"/>
 | 
			
		||||
    <tab type="pages" visible="yes" title="Guides" intro=""/>
 | 
			
		||||
    <tab type="modules" visible="yes" title="Reference" intro=""/>
 | 
			
		||||
    <tab type="filelist" visible="yes" title="Files"/>
 | 
			
		||||
  </navindex>
 | 
			
		||||
 | 
			
		||||
  <!-- Layout definition for a file page -->
 | 
			
		||||
  <file>
 | 
			
		||||
    <detaileddescription title="Description"/>
 | 
			
		||||
    <includes visible="$SHOW_INCLUDE_FILES"/>
 | 
			
		||||
    <sourcelink visible="yes"/>
 | 
			
		||||
    <memberdecl>
 | 
			
		||||
      <constantgroups visible="yes" title=""/>
 | 
			
		||||
      <defines title=""/>
 | 
			
		||||
      <typedefs title=""/>
 | 
			
		||||
      <enums title=""/>
 | 
			
		||||
      <functions title=""/>
 | 
			
		||||
      <variables title=""/>
 | 
			
		||||
      <membergroups visible="yes"/>
 | 
			
		||||
    </memberdecl>
 | 
			
		||||
    <memberdef>
 | 
			
		||||
      <defines title=""/>
 | 
			
		||||
      <typedefs title=""/>
 | 
			
		||||
      <enums title=""/>
 | 
			
		||||
      <functions title=""/>
 | 
			
		||||
      <variables title=""/>
 | 
			
		||||
    </memberdef>
 | 
			
		||||
    <authorsection/>
 | 
			
		||||
  </file>
 | 
			
		||||
 | 
			
		||||
  <!-- Layout definition for a group page -->
 | 
			
		||||
  <group>
 | 
			
		||||
    <detaileddescription title="Description"/>
 | 
			
		||||
    <memberdecl>
 | 
			
		||||
      <nestedgroups visible="yes" title=""/>
 | 
			
		||||
      <dirs visible="yes" title=""/>
 | 
			
		||||
      <files visible="yes" title=""/>
 | 
			
		||||
      <defines title=""/>
 | 
			
		||||
      <typedefs title=""/>
 | 
			
		||||
      <enums title=""/>
 | 
			
		||||
      <enumvalues title=""/>
 | 
			
		||||
      <functions title=""/>
 | 
			
		||||
      <variables title=""/>
 | 
			
		||||
    </memberdecl>
 | 
			
		||||
    <memberdef>
 | 
			
		||||
      <pagedocs/>
 | 
			
		||||
      <defines title=""/>
 | 
			
		||||
      <typedefs title=""/>
 | 
			
		||||
      <enums title=""/>
 | 
			
		||||
      <enumvalues title=""/>
 | 
			
		||||
      <functions title=""/>
 | 
			
		||||
      <variables title=""/>
 | 
			
		||||
    </memberdef>
 | 
			
		||||
    <authorsection visible="yes"/>
 | 
			
		||||
  </group>
 | 
			
		||||
 | 
			
		||||
  <!-- Layout definition for a directory page -->
 | 
			
		||||
  <directory>
 | 
			
		||||
    <briefdescription visible="yes"/>
 | 
			
		||||
    <memberdecl>
 | 
			
		||||
      <dirs visible="yes"/>
 | 
			
		||||
      <files visible="yes"/>
 | 
			
		||||
    </memberdecl>
 | 
			
		||||
    <detaileddescription title=""/>
 | 
			
		||||
  </directory>
 | 
			
		||||
</doxygenlayout>
 | 
			
		||||
							
								
								
									
										386
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/build.dox
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										386
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/build.dox
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,386 @@
 | 
			
		||||
/*!
 | 
			
		||||
 | 
			
		||||
@page build_guide Building applications
 | 
			
		||||
 | 
			
		||||
@tableofcontents
 | 
			
		||||
 | 
			
		||||
This is about compiling and linking applications that use GLFW.  For information on
 | 
			
		||||
how to write such applications, start with the
 | 
			
		||||
[introductory tutorial](@ref quick_guide).  For information on how to compile
 | 
			
		||||
the GLFW library itself, see @ref compile_guide.
 | 
			
		||||
 | 
			
		||||
This is not a tutorial on compilation or linking.  It assumes basic
 | 
			
		||||
understanding of how to compile and link a C program as well as how to use the
 | 
			
		||||
specific compiler of your chosen development environment.  The compilation
 | 
			
		||||
and linking process should be explained in your C programming material and in
 | 
			
		||||
the documentation for your development environment.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section build_include Including the GLFW header file
 | 
			
		||||
 | 
			
		||||
You should include the GLFW header in the source files where you use OpenGL or
 | 
			
		||||
GLFW.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
#include <GLFW/glfw3.h>
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
This header declares the GLFW API and by default also includes the OpenGL header
 | 
			
		||||
from your development environment.  See below for how to control this.
 | 
			
		||||
 | 
			
		||||
The GLFW header also defines any platform-specific macros needed by your OpenGL
 | 
			
		||||
header, so it can be included without needing any window system headers.
 | 
			
		||||
 | 
			
		||||
For example, under Windows you are normally required to include `windows.h`
 | 
			
		||||
before the OpenGL header, which would bring in the whole Win32 API.  The GLFW
 | 
			
		||||
header duplicates the small number of macros needed.
 | 
			
		||||
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
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
 | 
			
		||||
   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 are using an OpenGL extension loading library such as
 | 
			
		||||
[glad](https://github.com/Dav1dde/glad), the extension loader header should
 | 
			
		||||
be included _before_ the GLFW one.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
#include <glad/gl.h>
 | 
			
		||||
#include <GLFW/glfw3.h>
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
Alternatively the @ref GLFW_INCLUDE_NONE macro (described below) can be used to
 | 
			
		||||
prevent the GLFW header from including the OpenGL header.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
#define GLFW_INCLUDE_NONE
 | 
			
		||||
#include <GLFW/glfw3.h>
 | 
			
		||||
#include <glad/gl.h>
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection build_macros GLFW header option macros
 | 
			
		||||
 | 
			
		||||
These macros may be defined before the inclusion of the GLFW header and affect
 | 
			
		||||
its behavior.
 | 
			
		||||
 | 
			
		||||
@anchor GLFW_DLL
 | 
			
		||||
__GLFW_DLL__ is required on Windows when using the GLFW DLL, to tell the
 | 
			
		||||
compiler that the GLFW functions are defined in a DLL.
 | 
			
		||||
 | 
			
		||||
The following macros control which OpenGL or OpenGL ES API header is included.
 | 
			
		||||
Only one of these may be defined at a time.
 | 
			
		||||
 | 
			
		||||
@anchor GLFW_INCLUDE_GLCOREARB
 | 
			
		||||
__GLFW_INCLUDE_GLCOREARB__ makes the GLFW header include the modern
 | 
			
		||||
`GL/glcorearb.h` header (`OpenGL/gl3.h` on macOS) instead of the regular OpenGL
 | 
			
		||||
header.
 | 
			
		||||
 | 
			
		||||
@anchor GLFW_INCLUDE_ES1
 | 
			
		||||
__GLFW_INCLUDE_ES1__ makes the GLFW header include the OpenGL ES 1.x `GLES/gl.h`
 | 
			
		||||
header instead of the regular OpenGL header.
 | 
			
		||||
 | 
			
		||||
@anchor GLFW_INCLUDE_ES2
 | 
			
		||||
__GLFW_INCLUDE_ES2__ makes the GLFW header include the OpenGL ES 2.0
 | 
			
		||||
`GLES2/gl2.h` header instead of the regular OpenGL header.
 | 
			
		||||
 | 
			
		||||
@anchor GLFW_INCLUDE_ES3
 | 
			
		||||
__GLFW_INCLUDE_ES3__ makes the GLFW header include the OpenGL ES 3.0
 | 
			
		||||
`GLES3/gl3.h` header instead of the regular OpenGL header.
 | 
			
		||||
 | 
			
		||||
@anchor GLFW_INCLUDE_ES31
 | 
			
		||||
__GLFW_INCLUDE_ES31__ makes the GLFW header include the OpenGL ES 3.1
 | 
			
		||||
`GLES3/gl31.h` header instead of the regular OpenGL header.
 | 
			
		||||
 | 
			
		||||
@anchor GLFW_INCLUDE_ES32
 | 
			
		||||
__GLFW_INCLUDE_ES31__ makes the GLFW header include the OpenGL ES 3.2
 | 
			
		||||
`GLES3/gl32.h` header instead of the regular OpenGL header.
 | 
			
		||||
 | 
			
		||||
@anchor GLFW_INCLUDE_NONE
 | 
			
		||||
__GLFW_INCLUDE_NONE__ makes the GLFW header not include any OpenGL or OpenGL ES
 | 
			
		||||
API header.  This is useful in combination with an extension loading library.
 | 
			
		||||
 | 
			
		||||
If none of the above inclusion macros are defined, the standard OpenGL `GL/gl.h`
 | 
			
		||||
header (`OpenGL/gl.h` on macOS) is included.
 | 
			
		||||
 | 
			
		||||
The following macros control the inclusion of additional API headers.  Any
 | 
			
		||||
number of these may be defined simultaneously, and/or together with one of the
 | 
			
		||||
above macros.
 | 
			
		||||
 | 
			
		||||
@anchor GLFW_INCLUDE_VULKAN
 | 
			
		||||
__GLFW_INCLUDE_VULKAN__ makes the GLFW header include the Vulkan
 | 
			
		||||
`vulkan/vulkan.h` header in addition to any selected OpenGL or OpenGL ES header.
 | 
			
		||||
 | 
			
		||||
@anchor GLFW_INCLUDE_GLEXT
 | 
			
		||||
__GLFW_INCLUDE_GLEXT__ makes the GLFW header include the appropriate extension
 | 
			
		||||
header for the OpenGL or OpenGL ES header selected above after and in addition
 | 
			
		||||
to that header.
 | 
			
		||||
 | 
			
		||||
@anchor GLFW_INCLUDE_GLU
 | 
			
		||||
__GLFW_INCLUDE_GLU__ makes the header include the GLU header in addition to the
 | 
			
		||||
header selected above.  This should only be used with the standard OpenGL header
 | 
			
		||||
and only for compatibility with legacy code.  GLU has been deprecated and should
 | 
			
		||||
not be used in new code.
 | 
			
		||||
 | 
			
		||||
@note GLFW does not provide any of the API headers mentioned above.  They must
 | 
			
		||||
be provided by your development environment or your OpenGL, OpenGL ES or Vulkan
 | 
			
		||||
SDK.
 | 
			
		||||
 | 
			
		||||
@note None of these macros may be defined during the compilation of GLFW itself.
 | 
			
		||||
If your build includes GLFW and you define any these in your build files, make
 | 
			
		||||
sure they are not applied to the GLFW sources.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section build_link Link with the right libraries
 | 
			
		||||
 | 
			
		||||
GLFW is essentially a wrapper of various platform-specific APIs and therefore
 | 
			
		||||
needs to link against many different system libraries.  If you are using GLFW as
 | 
			
		||||
a shared library / dynamic library / DLL then it takes care of these links.
 | 
			
		||||
However, if you are using GLFW as a static library then your executable will
 | 
			
		||||
need to link against these libraries.
 | 
			
		||||
 | 
			
		||||
On Windows and macOS, the list of system libraries is static and can be
 | 
			
		||||
hard-coded into your build environment.  See the section for your development
 | 
			
		||||
environment below.  On Linux and other Unix-like operating systems, the list
 | 
			
		||||
varies but can be retrieved in various ways as described below.
 | 
			
		||||
 | 
			
		||||
A good general introduction to linking is
 | 
			
		||||
[Beginner's Guide to Linkers](https://www.lurklurk.org/linkers/linkers.html) by
 | 
			
		||||
David Drysdale.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection build_link_win32 With MinGW or Visual C++ on Windows
 | 
			
		||||
 | 
			
		||||
The static version of the GLFW library is named `glfw3`.  When using this
 | 
			
		||||
version, it is also necessary to link with some libraries that GLFW uses.
 | 
			
		||||
 | 
			
		||||
When using MinGW to link an application with the static version of GLFW, you
 | 
			
		||||
must also explicitly link with `gdi32`. Other toolchains including MinGW-w64
 | 
			
		||||
include it in the set of default libraries along with other dependencies like
 | 
			
		||||
`user32` and `kernel32`.
 | 
			
		||||
 | 
			
		||||
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 @ref
 | 
			
		||||
GLFW_DLL macro _before_ any inclusion of the GLFW header.  This can be done
 | 
			
		||||
either with a compiler switch or by defining it in your source code.
 | 
			
		||||
 | 
			
		||||
An application using the GLFW DLL does not need to link against any of its
 | 
			
		||||
dependencies, but you still have to link against `glu32` if it uses GLU.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection build_link_cmake_source With CMake and GLFW source
 | 
			
		||||
 | 
			
		||||
This section is about using CMake to compile and link GLFW along with your
 | 
			
		||||
application.  If you want to use an installed binary instead, see @ref
 | 
			
		||||
build_link_cmake_package.
 | 
			
		||||
 | 
			
		||||
With a few changes to your `CMakeLists.txt` you can have the GLFW source tree
 | 
			
		||||
built along with your application.
 | 
			
		||||
 | 
			
		||||
When including GLFW as part of your build, you probably don't want to build the
 | 
			
		||||
GLFW tests, examples and documentation.  To disable these, set the corresponding
 | 
			
		||||
cache variables before adding the GLFW source tree.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
 | 
			
		||||
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
 | 
			
		||||
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
Then 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
 | 
			
		||||
 | 
			
		||||
Once GLFW has been added to the project, link against it with the `glfw` target.
 | 
			
		||||
This adds all link-time dependencies of GLFW as it is currently configured,
 | 
			
		||||
the include directory for the GLFW header and, when applicable, the @ref
 | 
			
		||||
GLFW_DLL macro.
 | 
			
		||||
 | 
			
		||||
@code{.cmake}
 | 
			
		||||
target_link_libraries(myapp glfw)
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
Note that the dependencies do not include OpenGL or GLU, as GLFW loads any
 | 
			
		||||
OpenGL, OpenGL ES or Vulkan libraries it needs at runtime and does not use GLU.
 | 
			
		||||
If your application calls OpenGL directly, instead of using a modern
 | 
			
		||||
[extension loader library](@ref context_glext_auto) you can find it by requiring
 | 
			
		||||
the OpenGL package.
 | 
			
		||||
 | 
			
		||||
@code{.cmake}
 | 
			
		||||
find_package(OpenGL REQUIRED)
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
If OpenGL is found, the `OPENGL_FOUND` variable is true and the
 | 
			
		||||
`OPENGL_INCLUDE_DIR` and `OPENGL_gl_LIBRARY` cache variables can be used.
 | 
			
		||||
 | 
			
		||||
@code{.cmake}
 | 
			
		||||
target_include_directories(myapp PUBLIC ${OPENGL_INCLUDE_DIR})
 | 
			
		||||
target_link_libraries(myapp ${OPENGL_gl_LIBRARY})
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
The OpenGL CMake package also looks for GLU.  If GLU is found, the
 | 
			
		||||
`OPENGL_GLU_FOUND` variable is true and the `OPENGL_INCLUDE_DIR` and
 | 
			
		||||
`OPENGL_glu_LIBRARY` cache variables can be used.
 | 
			
		||||
 | 
			
		||||
@code{.cmake}
 | 
			
		||||
target_link_libraries(myapp ${OPENGL_glu_LIBRARY})
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
@note GLU has been deprecated and should not be used in new code, but some
 | 
			
		||||
legacy code requires it.  See the [section on GLU](@ref moving_glu) in the
 | 
			
		||||
transition guide for suggested replacements.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection build_link_cmake_package With CMake and installed GLFW binaries
 | 
			
		||||
 | 
			
		||||
This section is about using CMake to link GLFW after it has been built and
 | 
			
		||||
installed.  If you want to build it along with your application instead, see
 | 
			
		||||
@ref build_link_cmake_source.
 | 
			
		||||
 | 
			
		||||
With a few changes to your `CMakeLists.txt` you can locate the package and
 | 
			
		||||
target files generated when GLFW is installed.
 | 
			
		||||
 | 
			
		||||
@code{.cmake}
 | 
			
		||||
find_package(glfw3 3.3 REQUIRED)
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
Once GLFW has been added to the project, link against it with the `glfw` target.
 | 
			
		||||
This adds all link-time dependencies of GLFW as it is currently configured,
 | 
			
		||||
the include directory for the GLFW header and, when applicable, the @ref
 | 
			
		||||
GLFW_DLL macro.
 | 
			
		||||
 | 
			
		||||
@code{.cmake}
 | 
			
		||||
target_link_libraries(myapp glfw)
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
Note that the dependencies do not include OpenGL or GLU, as GLFW loads any
 | 
			
		||||
OpenGL, OpenGL ES or Vulkan libraries it needs at runtime and does not use GLU.
 | 
			
		||||
If your application calls OpenGL directly, instead of using a modern
 | 
			
		||||
[extension loader library](@ref context_glext_auto) you can find it by requiring
 | 
			
		||||
the OpenGL package.
 | 
			
		||||
 | 
			
		||||
@code{.cmake}
 | 
			
		||||
find_package(OpenGL REQUIRED)
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
If OpenGL is found, the `OPENGL_FOUND` variable is true and the
 | 
			
		||||
`OPENGL_INCLUDE_DIR` and `OPENGL_gl_LIBRARY` cache variables can be used.
 | 
			
		||||
 | 
			
		||||
@code{.cmake}
 | 
			
		||||
target_include_directories(myapp PUBLIC ${OPENGL_INCLUDE_DIR})
 | 
			
		||||
target_link_libraries(myapp ${OPENGL_gl_LIBRARY})
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
The OpenGL CMake package also looks for GLU.  If GLU is found, the
 | 
			
		||||
`OPENGL_GLU_FOUND` variable is true and the `OPENGL_INCLUDE_DIR` and
 | 
			
		||||
`OPENGL_glu_LIBRARY` cache variables can be used.
 | 
			
		||||
 | 
			
		||||
@code{.cmake}
 | 
			
		||||
target_link_libraries(myapp ${OPENGL_glu_LIBRARY})
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
@note GLU has been deprecated and should not be used in new code, but some
 | 
			
		||||
legacy code requires it.  See the [section on GLU](@ref moving_glu) in the
 | 
			
		||||
transition guide for suggested replacements.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection build_link_pkgconfig With makefiles and pkg-config on Unix
 | 
			
		||||
 | 
			
		||||
GLFW supports [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/),
 | 
			
		||||
and the `glfw3.pc` pkg-config file is generated when the GLFW library is built
 | 
			
		||||
and is installed along with it.  A pkg-config file describes all necessary
 | 
			
		||||
compile-time and link-time flags and dependencies needed to use a library.  When
 | 
			
		||||
they are updated or if they differ between systems, you will get the correct
 | 
			
		||||
ones automatically.
 | 
			
		||||
 | 
			
		||||
A typical compile and link command-line when using the static version of the
 | 
			
		||||
GLFW library may look like this:
 | 
			
		||||
 | 
			
		||||
@code{.sh}
 | 
			
		||||
cc `pkg-config --cflags glfw3` -o myprog myprog.c `pkg-config --static --libs glfw3`
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
If you are using the shared version of the GLFW library, omit the `--static`
 | 
			
		||||
flag.
 | 
			
		||||
 | 
			
		||||
@code{.sh}
 | 
			
		||||
cc `pkg-config --cflags glfw3` -o myprog myprog.c `pkg-config --libs glfw3`
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
You can also use the `glfw3.pc` file without installing it first, by using the
 | 
			
		||||
`PKG_CONFIG_PATH` environment variable.
 | 
			
		||||
 | 
			
		||||
@code{.sh}
 | 
			
		||||
env PKG_CONFIG_PATH=path/to/glfw/src cc `pkg-config --cflags glfw3` -o myprog myprog.c `pkg-config --libs glfw3`
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
The dependencies do not include OpenGL or GLU, as GLFW loads any OpenGL, OpenGL
 | 
			
		||||
ES or Vulkan libraries it needs at runtime and does not use GLU.  On macOS, 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 package.
 | 
			
		||||
 | 
			
		||||
@code{.sh}
 | 
			
		||||
cc `pkg-config --cflags glfw3 glu` -o myprog myprog.c `pkg-config --libs glfw3 glu`
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
@note GLU has been deprecated and should not be used in new code, but some
 | 
			
		||||
legacy code requires it.  See the [section on GLU](@ref moving_glu) in the
 | 
			
		||||
transition guide for suggested replacements.
 | 
			
		||||
 | 
			
		||||
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
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection build_link_xcode With Xcode on macOS
 | 
			
		||||
 | 
			
		||||
If you are using the dynamic library version of GLFW, add it to the project
 | 
			
		||||
dependencies.
 | 
			
		||||
 | 
			
		||||
If you are using the static library version of GLFW, add it and the Cocoa,
 | 
			
		||||
OpenGL, IOKit and CoreVideo frameworks to the project as dependencies.  They can
 | 
			
		||||
all be found in `/System/Library/Frameworks`.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection build_link_osx With command-line on macOS
 | 
			
		||||
 | 
			
		||||
It is recommended that you use [pkg-config](@ref build_link_pkgconfig) when
 | 
			
		||||
building from the command line on macOS.  That way you will get any new
 | 
			
		||||
dependencies added automatically.  If you still wish to build manually, you need
 | 
			
		||||
to add the required frameworks and libraries to your command-line yourself using
 | 
			
		||||
the `-l` and `-framework` switches.
 | 
			
		||||
 | 
			
		||||
If you are using the dynamic GLFW library, which is named `libglfw.3.dylib`, do:
 | 
			
		||||
 | 
			
		||||
@code{.sh}
 | 
			
		||||
cc -o myprog myprog.c -lglfw -framework Cocoa -framework OpenGL -framework IOKit -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.
 | 
			
		||||
 | 
			
		||||
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 macOS native version of GLFW.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
							
								
								
									
										285
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/compat.dox
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										285
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/compat.dox
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,285 @@
 | 
			
		||||
/*!
 | 
			
		||||
 | 
			
		||||
@page compat_guide Standards conformance
 | 
			
		||||
 | 
			
		||||
@tableofcontents
 | 
			
		||||
 | 
			
		||||
This guide describes the various API extensions used by this version of GLFW.
 | 
			
		||||
It lists what are essentially implementation details, but which are nonetheless
 | 
			
		||||
vital knowledge for developers intending to deploy their applications on a wide
 | 
			
		||||
range of machines.
 | 
			
		||||
 | 
			
		||||
The information in this guide is not a part of GLFW API, but merely
 | 
			
		||||
preconditions for some parts of the library to function on a given machine.  Any
 | 
			
		||||
part of this information may change in future versions of GLFW and that will not
 | 
			
		||||
be considered a breaking API change.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section compat_x11 X11 extensions, protocols and IPC standards
 | 
			
		||||
 | 
			
		||||
As GLFW uses Xlib directly, without any intervening toolkit
 | 
			
		||||
library, it has sole responsibility for interacting well with the many and
 | 
			
		||||
varied window managers in use on Unix-like systems.  In order for applications
 | 
			
		||||
and window managers to work well together, a number of standards and
 | 
			
		||||
conventions have been developed that regulate behavior outside the scope of the
 | 
			
		||||
X11 API; most importantly the
 | 
			
		||||
[Inter-Client Communication Conventions Manual](https://www.tronche.com/gui/x/icccm/)
 | 
			
		||||
(ICCCM) and
 | 
			
		||||
[Extended Window Manager Hints](https://standards.freedesktop.org/wm-spec/wm-spec-latest.html)
 | 
			
		||||
(EWMH) standards.
 | 
			
		||||
 | 
			
		||||
GLFW uses the `_MOTIF_WM_HINTS` window property to support borderless windows.
 | 
			
		||||
If the running window manager does not support this property, the
 | 
			
		||||
`GLFW_DECORATED` hint will have no effect.
 | 
			
		||||
 | 
			
		||||
GLFW uses the ICCCM `WM_DELETE_WINDOW` protocol to intercept the user
 | 
			
		||||
attempting to close the GLFW window.  If the running window manager does not
 | 
			
		||||
support this protocol, the close callback will never be called.
 | 
			
		||||
 | 
			
		||||
GLFW uses the EWMH `_NET_WM_PING` protocol, allowing the window manager notify
 | 
			
		||||
the user when the application has stopped responding, i.e. when it has ceased to
 | 
			
		||||
process events.  If the running window manager does not support this protocol,
 | 
			
		||||
the user will not be notified if the application locks up.
 | 
			
		||||
 | 
			
		||||
GLFW uses the EWMH `_NET_WM_STATE_FULLSCREEN` window state to tell the window
 | 
			
		||||
manager to make the GLFW window full screen.  If the running window manager does
 | 
			
		||||
not support this state, full screen windows may not work properly.  GLFW has
 | 
			
		||||
a fallback code path in case this state is unavailable, but every window manager
 | 
			
		||||
behaves slightly differently in this regard.
 | 
			
		||||
 | 
			
		||||
GLFW uses the EWMH `_NET_WM_BYPASS_COMPOSITOR` window property to tell a
 | 
			
		||||
compositing window manager to un-redirect full screen GLFW windows.  If the
 | 
			
		||||
running window manager uses compositing but does not support this property then
 | 
			
		||||
additional copying may be performed for each buffer swap of full screen windows.
 | 
			
		||||
 | 
			
		||||
GLFW uses the
 | 
			
		||||
[clipboard manager protocol](https://www.freedesktop.org/wiki/ClipboardManager/)
 | 
			
		||||
to push a clipboard string (i.e. selection) owned by a GLFW window about to be
 | 
			
		||||
destroyed to the clipboard manager.  If there is no running clipboard manager,
 | 
			
		||||
the clipboard string will be unavailable once the window has been destroyed.
 | 
			
		||||
 | 
			
		||||
GLFW uses the
 | 
			
		||||
[X drag-and-drop protocol](https://www.freedesktop.org/wiki/Specifications/XDND/)
 | 
			
		||||
to provide file drop events.  If the application originating the drag does not
 | 
			
		||||
support this protocol, drag and drop will not work.
 | 
			
		||||
 | 
			
		||||
GLFW uses the XRandR 1.3 extension to provide multi-monitor support.  If the
 | 
			
		||||
running X server does not support this version of this extension, multi-monitor
 | 
			
		||||
support will not function and only a single, desktop-spanning monitor will be
 | 
			
		||||
reported.
 | 
			
		||||
 | 
			
		||||
GLFW uses the XRandR 1.3 and Xf86vidmode extensions to provide gamma ramp
 | 
			
		||||
support.  If the running X server does not support either or both of these
 | 
			
		||||
extensions, gamma ramp support will not function.
 | 
			
		||||
 | 
			
		||||
GLFW uses the Xkb extension and detectable auto-repeat to provide keyboard
 | 
			
		||||
input.  If the running X server does not support this extension, a non-Xkb
 | 
			
		||||
fallback path is used.
 | 
			
		||||
 | 
			
		||||
GLFW uses the XInput2 extension to provide raw, non-accelerated mouse motion
 | 
			
		||||
when the cursor is disabled.  If the running X server does not support this
 | 
			
		||||
extension, regular accelerated mouse motion will be used.
 | 
			
		||||
 | 
			
		||||
GLFW uses both the XRender extension and the compositing manager to support
 | 
			
		||||
transparent window framebuffers.  If the running X server does not support this
 | 
			
		||||
extension or there is no running compositing manager, the
 | 
			
		||||
`GLFW_TRANSPARENT_FRAMEBUFFER` framebuffer hint will have no effect.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section compat_wayland Wayland protocols and IPC standards
 | 
			
		||||
 | 
			
		||||
As GLFW uses libwayland directly, without any intervening toolkit library, it
 | 
			
		||||
has sole responsibility for interacting well with every compositor in use on
 | 
			
		||||
Unix-like systems.  Most of the features are provided by the core protocol,
 | 
			
		||||
while cursor support is provided by the libwayland-cursor helper library, EGL
 | 
			
		||||
integration by libwayland-egl, and keyboard handling by
 | 
			
		||||
[libxkbcommon](https://xkbcommon.org/).  In addition, GLFW uses some protocols
 | 
			
		||||
from wayland-protocols to provide additional features if the compositor
 | 
			
		||||
supports them.
 | 
			
		||||
 | 
			
		||||
GLFW uses xkbcommon 0.5.0 to provide compose key support.  When it has been
 | 
			
		||||
built against an older xkbcommon, the compose key will be disabled even if it
 | 
			
		||||
has been configured in the compositor.
 | 
			
		||||
 | 
			
		||||
GLFW uses the [xdg-shell
 | 
			
		||||
protocol](https://cgit.freedesktop.org/wayland/wayland-protocols/tree/stable/xdg-shell/xdg-shell.xml)
 | 
			
		||||
to provide better window management.  This protocol is part of
 | 
			
		||||
wayland-protocols 1.12, and mandatory at build time.  If the running compositor
 | 
			
		||||
does not support this protocol, the older [wl_shell
 | 
			
		||||
interface](https://cgit.freedesktop.org/wayland/wayland/tree/protocol/wayland.xml#n972)
 | 
			
		||||
will be used instead.  This will result in a worse integration with the
 | 
			
		||||
desktop, especially on tiling compositors.
 | 
			
		||||
 | 
			
		||||
GLFW uses the [relative pointer
 | 
			
		||||
protocol](https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/relative-pointer/relative-pointer-unstable-v1.xml)
 | 
			
		||||
alongside the [pointer constraints
 | 
			
		||||
protocol](https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml)
 | 
			
		||||
to implement disabled cursor.  These two protocols are part of
 | 
			
		||||
wayland-protocols 1.1, and mandatory at build time.  If the running compositor
 | 
			
		||||
does not support both of these protocols, disabling the cursor will have no
 | 
			
		||||
effect.
 | 
			
		||||
 | 
			
		||||
GLFW uses the [idle inhibit
 | 
			
		||||
protocol](https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml)
 | 
			
		||||
to prohibit the screensaver from starting.  This protocol is part of
 | 
			
		||||
wayland-protocols 1.6, and mandatory at build time.  If the running compositor
 | 
			
		||||
does not support this protocol, the screensaver may start even for full screen
 | 
			
		||||
windows.
 | 
			
		||||
 | 
			
		||||
GLFW uses the [xdg-decoration
 | 
			
		||||
protocol](https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml)
 | 
			
		||||
to request decorations to be drawn around its windows.  This protocol is part
 | 
			
		||||
of wayland-protocols 1.15, and mandatory at build time.  If the running
 | 
			
		||||
compositor does not support this protocol, a very simple frame will be drawn by
 | 
			
		||||
GLFW itself, using the [viewporter
 | 
			
		||||
protocol](https://cgit.freedesktop.org/wayland/wayland-protocols/tree/stable/viewporter/viewporter.xml)
 | 
			
		||||
alongside
 | 
			
		||||
[subsurfaces](https://cgit.freedesktop.org/wayland/wayland/tree/protocol/wayland.xml#n2598).
 | 
			
		||||
This protocol is part of wayland-protocols 1.4, and mandatory at build time.
 | 
			
		||||
If the running compositor does not support this protocol either, no decorations
 | 
			
		||||
will be drawn around windows.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section compat_glx GLX extensions
 | 
			
		||||
 | 
			
		||||
The GLX API is the default API used to create OpenGL contexts on Unix-like
 | 
			
		||||
systems using the X Window System.
 | 
			
		||||
 | 
			
		||||
GLFW uses the GLX 1.3 `GLXFBConfig` functions to enumerate and select framebuffer pixel
 | 
			
		||||
formats.  If GLX 1.3 is not supported, @ref glfwInit will fail.
 | 
			
		||||
 | 
			
		||||
GLFW uses the `GLX_MESA_swap_control,` `GLX_EXT_swap_control` and
 | 
			
		||||
`GLX_SGI_swap_control` extensions to provide vertical retrace synchronization
 | 
			
		||||
(or _vsync_), in that order of preference.  Where none of these extension are
 | 
			
		||||
available, calling @ref glfwSwapInterval will have no effect.
 | 
			
		||||
 | 
			
		||||
GLFW uses the `GLX_ARB_multisample` extension to create contexts with
 | 
			
		||||
multisampling anti-aliasing.  Where this extension is unavailable, the
 | 
			
		||||
`GLFW_SAMPLES` hint will have no effect.
 | 
			
		||||
 | 
			
		||||
GLFW uses the `GLX_ARB_create_context` extension when available, even when
 | 
			
		||||
creating OpenGL contexts of version 2.1 and below.  Where this extension is
 | 
			
		||||
unavailable, the `GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR`
 | 
			
		||||
hints will only be partially supported, the `GLFW_OPENGL_DEBUG_CONTEXT` hint
 | 
			
		||||
will have no effect, and setting the `GLFW_OPENGL_PROFILE` or
 | 
			
		||||
`GLFW_OPENGL_FORWARD_COMPAT` hints to `GLFW_TRUE` will cause @ref
 | 
			
		||||
glfwCreateWindow to fail.
 | 
			
		||||
 | 
			
		||||
GLFW uses the `GLX_ARB_create_context_profile` extension to provide support for
 | 
			
		||||
context profiles.  Where this extension is unavailable, setting the
 | 
			
		||||
`GLFW_OPENGL_PROFILE` hint to anything but `GLFW_OPENGL_ANY_PROFILE`, or setting
 | 
			
		||||
`GLFW_CLIENT_API` to anything but `GLFW_OPENGL_API` or `GLFW_NO_API` will cause
 | 
			
		||||
@ref glfwCreateWindow to fail.
 | 
			
		||||
 | 
			
		||||
GLFW uses the `GLX_ARB_context_flush_control` extension to provide control over
 | 
			
		||||
whether a context is flushed when it is released (made non-current).  Where this
 | 
			
		||||
extension is unavailable, the `GLFW_CONTEXT_RELEASE_BEHAVIOR` hint will have no
 | 
			
		||||
effect and the context will always be flushed when released.
 | 
			
		||||
 | 
			
		||||
GLFW uses the `GLX_ARB_framebuffer_sRGB` and `GLX_EXT_framebuffer_sRGB`
 | 
			
		||||
extensions to provide support for sRGB framebuffers.  Where both of these
 | 
			
		||||
extensions are unavailable, the `GLFW_SRGB_CAPABLE` hint will have no effect.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section compat_wgl WGL extensions
 | 
			
		||||
 | 
			
		||||
The WGL API is used to create OpenGL contexts on Microsoft Windows and other
 | 
			
		||||
implementations of the Win32 API, such as Wine.
 | 
			
		||||
 | 
			
		||||
GLFW uses either the `WGL_EXT_extension_string` or the
 | 
			
		||||
`WGL_ARB_extension_string` extension to check for the presence of all other WGL
 | 
			
		||||
extensions listed below.  If both are available, the EXT one is preferred.  If
 | 
			
		||||
neither is available, no other extensions are used and many GLFW features
 | 
			
		||||
related to context creation will have no effect or cause errors when used.
 | 
			
		||||
 | 
			
		||||
GLFW uses the `WGL_EXT_swap_control` extension to provide vertical retrace
 | 
			
		||||
synchronization (or _vsync_).  Where this extension is unavailable, calling @ref
 | 
			
		||||
glfwSwapInterval will have no effect.
 | 
			
		||||
 | 
			
		||||
GLFW uses the `WGL_ARB_pixel_format` and `WGL_ARB_multisample` extensions to
 | 
			
		||||
create contexts with multisampling anti-aliasing.  Where these extensions are
 | 
			
		||||
unavailable, the `GLFW_SAMPLES` hint will have no effect.
 | 
			
		||||
 | 
			
		||||
GLFW uses the `WGL_ARB_create_context` extension when available, even when
 | 
			
		||||
creating OpenGL contexts of version 2.1 and below.  Where this extension is
 | 
			
		||||
unavailable, the `GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR`
 | 
			
		||||
hints will only be partially supported, the `GLFW_OPENGL_DEBUG_CONTEXT` hint
 | 
			
		||||
will have no effect, and setting the `GLFW_OPENGL_PROFILE` or
 | 
			
		||||
`GLFW_OPENGL_FORWARD_COMPAT` hints to `GLFW_TRUE` will cause @ref
 | 
			
		||||
glfwCreateWindow to fail.
 | 
			
		||||
 | 
			
		||||
GLFW uses the `WGL_ARB_create_context_profile` extension to provide support for
 | 
			
		||||
context profiles.  Where this extension is unavailable, setting the
 | 
			
		||||
`GLFW_OPENGL_PROFILE` hint to anything but `GLFW_OPENGL_ANY_PROFILE` will cause
 | 
			
		||||
@ref glfwCreateWindow to fail.
 | 
			
		||||
 | 
			
		||||
GLFW uses the `WGL_ARB_context_flush_control` extension to provide control over
 | 
			
		||||
whether a context is flushed when it is released (made non-current).  Where this
 | 
			
		||||
extension is unavailable, the `GLFW_CONTEXT_RELEASE_BEHAVIOR` hint will have no
 | 
			
		||||
effect and the context will always be flushed when released.
 | 
			
		||||
 | 
			
		||||
GLFW uses the `WGL_ARB_framebuffer_sRGB` and `WGL_EXT_framebuffer_sRGB`
 | 
			
		||||
extensions to provide support for sRGB framebuffers.  Where both of these
 | 
			
		||||
extension are unavailable, the `GLFW_SRGB_CAPABLE` hint will have no effect.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section compat_osx OpenGL on macOS
 | 
			
		||||
 | 
			
		||||
Support for OpenGL 3.2 and above was introduced with OS X 10.7 and even then
 | 
			
		||||
only forward-compatible, core profile contexts are supported.  Support for
 | 
			
		||||
OpenGL 4.1 was introduced with OS X 10.9, also limited to forward-compatible,
 | 
			
		||||
core profile contexts.  There is also still no mechanism for requesting debug
 | 
			
		||||
contexts or no-error contexts.  Versions of Mac OS X earlier than 10.7 support
 | 
			
		||||
at most OpenGL version 2.1.
 | 
			
		||||
 | 
			
		||||
Because of this, on OS X 10.7 and later, the `GLFW_CONTEXT_VERSION_MAJOR` and
 | 
			
		||||
`GLFW_CONTEXT_VERSION_MINOR` hints will cause @ref glfwCreateWindow to fail if
 | 
			
		||||
given version 3.0 or 3.1.  The `GLFW_OPENGL_FORWARD_COMPAT` hint must be set to
 | 
			
		||||
`GLFW_TRUE` and the `GLFW_OPENGL_PROFILE` hint must be set to
 | 
			
		||||
`GLFW_OPENGL_CORE_PROFILE` when creating OpenGL 3.2 and later contexts.  The
 | 
			
		||||
`GLFW_OPENGL_DEBUG_CONTEXT` and `GLFW_CONTEXT_NO_ERROR` hints are ignored.
 | 
			
		||||
 | 
			
		||||
Also, on Mac OS X 10.6 and below, the `GLFW_CONTEXT_VERSION_MAJOR` and
 | 
			
		||||
`GLFW_CONTEXT_VERSION_MINOR` hints will fail if given a version above 2.1,
 | 
			
		||||
setting the `GLFW_OPENGL_PROFILE` or `GLFW_OPENGL_FORWARD_COMPAT` hints to
 | 
			
		||||
a non-default value will cause @ref glfwCreateWindow to fail and the
 | 
			
		||||
`GLFW_OPENGL_DEBUG_CONTEXT` hint is ignored.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section compat_vulkan Vulkan loader and API
 | 
			
		||||
 | 
			
		||||
By default, GLFW uses the standard system-wide Vulkan loader to access the
 | 
			
		||||
Vulkan API on all platforms except macOS.  This is installed by both graphics
 | 
			
		||||
drivers and Vulkan SDKs.  If either the loader or at least one minimally
 | 
			
		||||
functional ICD is missing, @ref glfwVulkanSupported will return `GLFW_FALSE` and
 | 
			
		||||
all other Vulkan-related functions will fail with an @ref GLFW_API_UNAVAILABLE
 | 
			
		||||
error.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section compat_wsi Vulkan WSI extensions
 | 
			
		||||
 | 
			
		||||
The Vulkan WSI extensions are used to create Vulkan surfaces for GLFW windows on
 | 
			
		||||
all supported platforms.
 | 
			
		||||
 | 
			
		||||
GLFW uses the `VK_KHR_surface` and `VK_KHR_win32_surface` extensions to create
 | 
			
		||||
surfaces on Microsoft Windows.  If any of these extensions are not available,
 | 
			
		||||
@ref glfwGetRequiredInstanceExtensions will return an empty list and window
 | 
			
		||||
surface creation will fail.
 | 
			
		||||
 | 
			
		||||
GLFW uses the `VK_KHR_surface` and `VK_MVK_macos_surface` extensions to create
 | 
			
		||||
surfaces on macOS.  If any of these extensions are not available, @ref
 | 
			
		||||
glfwGetRequiredInstanceExtensions will return an empty list and window surface
 | 
			
		||||
creation will fail.
 | 
			
		||||
 | 
			
		||||
GLFW uses the `VK_KHR_surface` and either the `VK_KHR_xlib_surface` or
 | 
			
		||||
`VK_KHR_xcb_surface` extensions to create surfaces on X11.  If `VK_KHR_surface`
 | 
			
		||||
or both `VK_KHR_xlib_surface` and `VK_KHR_xcb_surface` are not available, @ref
 | 
			
		||||
glfwGetRequiredInstanceExtensions will return an empty list and window surface
 | 
			
		||||
creation will fail.
 | 
			
		||||
 | 
			
		||||
GLFW uses the `VK_KHR_surface` and `VK_KHR_wayland_surface` extensions to create
 | 
			
		||||
surfaces on Wayland.  If any of these extensions are not available, @ref
 | 
			
		||||
glfwGetRequiredInstanceExtensions will return an empty list and window surface
 | 
			
		||||
creation will fail.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
							
								
								
									
										290
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/compile.dox
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										290
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/compile.dox
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,290 @@
 | 
			
		||||
/*!
 | 
			
		||||
 | 
			
		||||
@page compile_guide Compiling GLFW
 | 
			
		||||
 | 
			
		||||
@tableofcontents
 | 
			
		||||
 | 
			
		||||
This is about compiling the GLFW library itself.  For information on how to
 | 
			
		||||
build applications that use GLFW, see @ref build_guide.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section compile_cmake Using CMake
 | 
			
		||||
 | 
			
		||||
GLFW uses [CMake](https://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 install its CMake package.  If not, you can download
 | 
			
		||||
installers for Windows and macOS from the
 | 
			
		||||
[CMake website](https://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 for your
 | 
			
		||||
chosen development environment and then use them 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 Windows SDK bundled 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 set up
 | 
			
		||||
cross-compilation of Windows binaries.  To use these files you add an option
 | 
			
		||||
when running `cmake` to generate the project files or makefiles:
 | 
			
		||||
 | 
			
		||||
@code{.sh}
 | 
			
		||||
cmake -DCMAKE_TOOLCHAIN_FILE=<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](https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/CrossCompiling) on
 | 
			
		||||
the CMake wiki.
 | 
			
		||||
 | 
			
		||||
Once you have this set up, move on to @ref compile_generate.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection compile_deps_xcode Dependencies for Xcode on macOS
 | 
			
		||||
 | 
			
		||||
Xcode comes with all necessary tools except for CMake.  The required headers
 | 
			
		||||
and libraries are included in the core macOS 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 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`
 | 
			
		||||
package, which pulls in all X.org header packages.
 | 
			
		||||
 | 
			
		||||
Once you have installed the necessary packages, move on to @ref
 | 
			
		||||
compile_generate.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection compile_deps_wayland Dependencies for Linux and Wayland
 | 
			
		||||
 | 
			
		||||
To compile GLFW for Wayland, you need to have the Wayland 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 `libwayland-dev` package, which contains all Wayland headers and pulls in
 | 
			
		||||
wayland-scanner, as well as the `wayland-protocols` and `extra-cmake-modules`
 | 
			
		||||
packages.
 | 
			
		||||
 | 
			
		||||
Once you have installed the necessary packages, move on to @ref
 | 
			
		||||
compile_generate.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection compile_deps_osmesa Dependencies for Linux and OSMesa
 | 
			
		||||
 | 
			
		||||
To compile GLFW for OSMesa, you need to install the OSMesa library and header
 | 
			
		||||
packages.  For example, on Ubuntu and other distributions based on Debian
 | 
			
		||||
GNU/Linux, you need to install the `libosmesa6-dev` package.  The OSMesa library
 | 
			
		||||
is required at runtime for context creation and is loaded on demand.
 | 
			
		||||
 | 
			
		||||
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 <glfw-root-dir>
 | 
			
		||||
cmake .
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
To make an out-of-tree build, make a directory outside of the source tree, enter
 | 
			
		||||
it and run CMake with the (relative or absolute) path to the root of the source
 | 
			
		||||
tree as an argument.
 | 
			
		||||
 | 
			
		||||
@code{.sh}
 | 
			
		||||
mkdir glfw-build
 | 
			
		||||
cd glfw-build
 | 
			
		||||
cmake <glfw-root-dir>
 | 
			
		||||
@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 @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 of CMake you can use the
 | 
			
		||||
`ccmake` ncurses GUI to set options.  Some package systems like Ubuntu and other
 | 
			
		||||
distributions based on Debian GNU/Linux have this tool in a separate
 | 
			
		||||
`cmake-curses-gui` package.
 | 
			
		||||
 | 
			
		||||
Finally, if you don't want to use any GUI, you can set options from the `cmake`
 | 
			
		||||
command-line with the `-D` flag.
 | 
			
		||||
 | 
			
		||||
@code{.sh}
 | 
			
		||||
cmake -DBUILD_SHARED_LIBS=ON .
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection compile_options_shared Shared CMake options
 | 
			
		||||
 | 
			
		||||
@anchor BUILD_SHARED_LIBS
 | 
			
		||||
__BUILD_SHARED_LIBS__ determines whether GLFW is built as a static
 | 
			
		||||
library or as a DLL / shared library / dynamic library.
 | 
			
		||||
 | 
			
		||||
@anchor GLFW_BUILD_EXAMPLES
 | 
			
		||||
__GLFW_BUILD_EXAMPLES__ determines whether the GLFW examples are built
 | 
			
		||||
along with the library.
 | 
			
		||||
 | 
			
		||||
@anchor GLFW_BUILD_TESTS
 | 
			
		||||
__GLFW_BUILD_TESTS__ determines whether the GLFW test programs are
 | 
			
		||||
built along with the library.
 | 
			
		||||
 | 
			
		||||
@anchor GLFW_BUILD_DOCS
 | 
			
		||||
__GLFW_BUILD_DOCS__ determines whether the GLFW documentation is built along
 | 
			
		||||
with the library.
 | 
			
		||||
 | 
			
		||||
@anchor GLFW_VULKAN_STATIC
 | 
			
		||||
__GLFW_VULKAN_STATIC__ determines whether to use the Vulkan loader linked
 | 
			
		||||
directly with the application.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection compile_options_win32 Windows specific CMake options
 | 
			
		||||
 | 
			
		||||
@anchor USE_MSVC_RUNTIME_LIBRARY_DLL
 | 
			
		||||
__USE_MSVC_RUNTIME_LIBRARY_DLL__ determines whether to use the DLL version or the
 | 
			
		||||
static library version of the Visual C++ runtime library.  If set to `ON`, the
 | 
			
		||||
DLL version of the Visual C++ library is used.
 | 
			
		||||
 | 
			
		||||
@anchor GLFW_USE_HYBRID_HPG
 | 
			
		||||
__GLFW_USE_HYBRID_HPG__ determines whether to export the `NvOptimusEnablement` and
 | 
			
		||||
`AmdPowerXpressRequestHighPerformance` symbols, which force the use of the
 | 
			
		||||
high-performance GPU on Nvidia Optimus and AMD PowerXpress systems.  These symbols
 | 
			
		||||
need to be exported by the EXE to be detected by the driver, so the override
 | 
			
		||||
will not work if GLFW is built as a DLL.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section compile_manual Compiling GLFW manually
 | 
			
		||||
 | 
			
		||||
If you wish to compile GLFW without its CMake build environment then you will
 | 
			
		||||
have to do at least some of the platform detection yourself.  GLFW needs
 | 
			
		||||
a configuration macro to be defined in order to know what window system it's
 | 
			
		||||
being compiled for and also has optional, platform-specific ones for various
 | 
			
		||||
features.
 | 
			
		||||
 | 
			
		||||
When building with CMake, the `glfw_config.h` configuration header is generated
 | 
			
		||||
based on the current platform and CMake options.  The GLFW CMake environment
 | 
			
		||||
defines @b GLFW_USE_CONFIG_H, which causes this header to be included by
 | 
			
		||||
`internal.h`.  Without this macro, GLFW will expect the necessary configuration
 | 
			
		||||
macros to be defined on the command-line.
 | 
			
		||||
 | 
			
		||||
The window creation API is used to create windows, handle input, monitors, gamma
 | 
			
		||||
ramps and clipboard.  The options are:
 | 
			
		||||
 | 
			
		||||
 - @b _GLFW_COCOA to use the Cocoa frameworks
 | 
			
		||||
 - @b _GLFW_WIN32 to use the Win32 API
 | 
			
		||||
 - @b _GLFW_X11 to use the X Window System
 | 
			
		||||
 - @b _GLFW_WAYLAND to use the Wayland API (experimental and incomplete)
 | 
			
		||||
 - @b _GLFW_OSMESA to use the OSMesa API (headless and non-interactive)
 | 
			
		||||
 | 
			
		||||
If you are building GLFW as a shared library / dynamic library / DLL then you
 | 
			
		||||
must also define @b _GLFW_BUILD_DLL.  Otherwise, you must not define it.
 | 
			
		||||
 | 
			
		||||
If you are linking the Vulkan loader directly with your application then you
 | 
			
		||||
must also define @b _GLFW_VULKAN_STATIC.  Otherwise, GLFW will attempt to use the
 | 
			
		||||
external version.
 | 
			
		||||
 | 
			
		||||
If you are using a custom name for the Vulkan, EGL, GLX, OSMesa, OpenGL, GLESv1
 | 
			
		||||
or GLESv2 library, you can override the default names by defining those you need
 | 
			
		||||
of @b _GLFW_VULKAN_LIBRARY, @b _GLFW_EGL_LIBRARY, @b _GLFW_GLX_LIBRARY, @b
 | 
			
		||||
_GLFW_OSMESA_LIBRARY, @b _GLFW_OPENGL_LIBRARY, @b _GLFW_GLESV1_LIBRARY and @b
 | 
			
		||||
_GLFW_GLESV2_LIBRARY.  Otherwise, GLFW will use the built-in default names.
 | 
			
		||||
 | 
			
		||||
For the EGL context creation API, the following options are available:
 | 
			
		||||
 | 
			
		||||
 - @b _GLFW_USE_EGLPLATFORM_H to use an existing `EGL/eglplatform.h` header file
 | 
			
		||||
   for native handle types (fallback)
 | 
			
		||||
 | 
			
		||||
@note None of the @ref build_macros may be defined during the compilation of
 | 
			
		||||
GLFW.  If you define any of these in your build files, make sure they are not
 | 
			
		||||
applied to the GLFW sources.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
							
								
								
									
										346
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/context.dox
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										346
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/context.dox
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,346 @@
 | 
			
		||||
/*!
 | 
			
		||||
 | 
			
		||||
@page context_guide Context guide
 | 
			
		||||
 | 
			
		||||
@tableofcontents
 | 
			
		||||
 | 
			
		||||
This guide introduces the OpenGL and OpenGL ES context related functions of
 | 
			
		||||
GLFW.  For details on a specific function in this category, see the @ref
 | 
			
		||||
context.  There are also guides for the other areas of the GLFW API.
 | 
			
		||||
 | 
			
		||||
 - @ref intro_guide
 | 
			
		||||
 - @ref window_guide
 | 
			
		||||
 - @ref vulkan_guide
 | 
			
		||||
 - @ref monitor_guide
 | 
			
		||||
 - @ref input_guide
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section context_object Context objects
 | 
			
		||||
 | 
			
		||||
A window object encapsulates both a top-level window and an OpenGL or OpenGL ES
 | 
			
		||||
context.  It is created with @ref glfwCreateWindow and destroyed with @ref
 | 
			
		||||
glfwDestroyWindow or @ref glfwTerminate.  See @ref window_creation for more
 | 
			
		||||
information.
 | 
			
		||||
 | 
			
		||||
As the window and context are inseparably linked, the window object also serves
 | 
			
		||||
as the context handle.
 | 
			
		||||
 | 
			
		||||
To test the creation of various kinds of contexts and see their properties, run
 | 
			
		||||
the `glfwinfo` test program.
 | 
			
		||||
 | 
			
		||||
@note Vulkan does not have a context and the Vulkan instance is created via the
 | 
			
		||||
Vulkan API itself.  If you will be using Vulkan to render to a window, disable
 | 
			
		||||
context creation by setting the [GLFW_CLIENT_API](@ref GLFW_CLIENT_API_hint)
 | 
			
		||||
hint to `GLFW_NO_API`.  For more information, see the @ref vulkan_guide.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection context_hints Context creation hints
 | 
			
		||||
 | 
			
		||||
There are a number of hints, specified using @ref glfwWindowHint, related to
 | 
			
		||||
what kind of context is created.  See
 | 
			
		||||
[context related hints](@ref window_hints_ctx) in the window guide.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection context_sharing Context object sharing
 | 
			
		||||
 | 
			
		||||
When creating a window and its OpenGL or OpenGL ES context with @ref
 | 
			
		||||
glfwCreateWindow, you can specify another window whose context the new one
 | 
			
		||||
should share its objects (textures, vertex and element buffers, etc.) with.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
GLFWwindow* second_window = glfwCreateWindow(640, 480, "Second Window", NULL, first_window);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
Object sharing is implemented by the operating system and graphics driver.  On
 | 
			
		||||
platforms where it is possible to choose which types of objects are shared, GLFW
 | 
			
		||||
requests that all types are shared.
 | 
			
		||||
 | 
			
		||||
See the relevant chapter of the [OpenGL](https://www.opengl.org/registry/) or
 | 
			
		||||
[OpenGL ES](https://www.khronos.org/opengles/) reference documents for more
 | 
			
		||||
information.  The name and number of this chapter unfortunately varies between
 | 
			
		||||
versions and APIs, but has at times been named _Shared Objects and Multiple
 | 
			
		||||
Contexts_.
 | 
			
		||||
 | 
			
		||||
GLFW comes with a barebones object sharing example program called `sharing`.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection context_offscreen Offscreen contexts
 | 
			
		||||
 | 
			
		||||
GLFW doesn't support creating contexts without an associated window.  However,
 | 
			
		||||
contexts with hidden windows can be created with the
 | 
			
		||||
[GLFW_VISIBLE](@ref GLFW_VISIBLE_hint) window hint.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
 | 
			
		||||
 | 
			
		||||
GLFWwindow* offscreen_context = glfwCreateWindow(640, 480, "", NULL, NULL);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
The window never needs to be shown and its context can be used as a plain
 | 
			
		||||
offscreen context.  Depending on the window manager, the size of a hidden
 | 
			
		||||
window's framebuffer may not be usable or modifiable, so framebuffer
 | 
			
		||||
objects are recommended for rendering with such contexts.
 | 
			
		||||
 | 
			
		||||
You should still [process events](@ref events) as long as you have at least one
 | 
			
		||||
window, even if none of them are visible.
 | 
			
		||||
 | 
			
		||||
@macos The first time a window is created the menu bar is created.  This is not
 | 
			
		||||
desirable for example when writing a command-line only application.  Menu bar
 | 
			
		||||
creation can be disabled with the @ref GLFW_COCOA_MENUBAR init hint.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection context_less Windows without contexts
 | 
			
		||||
 | 
			
		||||
You can disable context creation by setting the
 | 
			
		||||
[GLFW_CLIENT_API](@ref GLFW_CLIENT_API_hint) hint to `GLFW_NO_API`.  Windows
 | 
			
		||||
without contexts must not be passed to @ref glfwMakeContextCurrent or @ref
 | 
			
		||||
glfwSwapBuffers.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section context_current Current context
 | 
			
		||||
 | 
			
		||||
Before you can make OpenGL or OpenGL ES calls, you need to have a current
 | 
			
		||||
context of the correct type.  A context can only be current for a single thread
 | 
			
		||||
at a time, and a thread can only have a single context current at a time.
 | 
			
		||||
 | 
			
		||||
When moving a context between threads, you must make it non-current on the old
 | 
			
		||||
thread before making it current on the new one.
 | 
			
		||||
 | 
			
		||||
The context of a window is made current with @ref glfwMakeContextCurrent.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
glfwMakeContextCurrent(window);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
The window of the current context is returned by @ref glfwGetCurrentContext.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
GLFWwindow* window = glfwGetCurrentContext();
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
The following GLFW functions require a context to be current.  Calling any these
 | 
			
		||||
functions without a current context will generate a @ref GLFW_NO_CURRENT_CONTEXT
 | 
			
		||||
error.
 | 
			
		||||
 | 
			
		||||
 - @ref glfwSwapInterval
 | 
			
		||||
 - @ref glfwExtensionSupported
 | 
			
		||||
 - @ref glfwGetProcAddress
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section context_swap Buffer swapping
 | 
			
		||||
 | 
			
		||||
See @ref buffer_swap in the window guide.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section context_glext OpenGL and OpenGL ES extensions
 | 
			
		||||
 | 
			
		||||
One of the benefits of OpenGL and OpenGL ES is their extensibility.
 | 
			
		||||
Hardware vendors may include extensions in their implementations that extend the
 | 
			
		||||
API before that functionality is included in a new version of the OpenGL or
 | 
			
		||||
OpenGL ES specification, and some extensions are never included and remain
 | 
			
		||||
as extensions until they become obsolete.
 | 
			
		||||
 | 
			
		||||
An extension is defined by:
 | 
			
		||||
 | 
			
		||||
- An extension name (e.g. `GL_ARB_debug_output`)
 | 
			
		||||
- New OpenGL tokens (e.g. `GL_DEBUG_SEVERITY_HIGH_ARB`)
 | 
			
		||||
- 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](https://www.opengl.org/registry/) and
 | 
			
		||||
[OpenGL ES Registry](https://www.khronos.org/registry/gles/).
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection context_glext_auto Loading extension with a loader library
 | 
			
		||||
 | 
			
		||||
An extension loader library is the easiest and best way to access both OpenGL and
 | 
			
		||||
OpenGL ES extensions and modern versions of the core OpenGL or OpenGL ES APIs.
 | 
			
		||||
They will take care of all the details of declaring and loading everything you
 | 
			
		||||
need.  One such library is [glad](https://github.com/Dav1dde/glad) and there are
 | 
			
		||||
several others.
 | 
			
		||||
 | 
			
		||||
The following example will use glad but all extension loader libraries work
 | 
			
		||||
similarly.
 | 
			
		||||
 | 
			
		||||
First you need to generate the source files using the glad Python script.  This
 | 
			
		||||
example generates a loader for any version of OpenGL, which is the default for
 | 
			
		||||
both GLFW and glad, but loaders for OpenGL ES, as well as loaders for specific
 | 
			
		||||
API versions and extension sets can be generated.  The generated files are
 | 
			
		||||
written to the `output` directory.
 | 
			
		||||
 | 
			
		||||
@code{.sh}
 | 
			
		||||
python main.py --generator c --no-loader --out-path output
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
The `--no-loader` option is added because GLFW already provides a function for
 | 
			
		||||
loading OpenGL and OpenGL ES function pointers, one that automatically uses the
 | 
			
		||||
selected context creation API, and glad can call this instead of having to
 | 
			
		||||
implement its own.  There are several other command-line options as well.  See
 | 
			
		||||
the glad documentation for details.
 | 
			
		||||
 | 
			
		||||
Add the generated `output/src/glad.c`, `output/include/glad/glad.h` and
 | 
			
		||||
`output/include/KHR/khrplatform.h` files to your build.  Then you need to
 | 
			
		||||
include the glad header file, which will replace the OpenGL header of your
 | 
			
		||||
development environment.  By including the glad header before the GLFW header,
 | 
			
		||||
it suppresses the development environment's OpenGL or OpenGL ES header.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
#include <glad/glad.h>
 | 
			
		||||
#include <GLFW/glfw3.h>
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
Finally you need to initialize glad once you have a suitable current context.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
window = glfwCreateWindow(640, 480, "My Window", NULL, NULL);
 | 
			
		||||
if (!window)
 | 
			
		||||
{
 | 
			
		||||
    ...
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
glfwMakeContextCurrent(window);
 | 
			
		||||
 | 
			
		||||
gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
Once glad has been loaded, you have access to all OpenGL core and extension
 | 
			
		||||
functions supported by both the context you created and the glad loader you
 | 
			
		||||
generated and you are ready to start rendering.
 | 
			
		||||
 | 
			
		||||
You can specify a minimum required OpenGL or OpenGL ES version with
 | 
			
		||||
[context hints](@ref window_hints_ctx).  If your needs are more complex, you can
 | 
			
		||||
check the actual OpenGL or OpenGL ES version with
 | 
			
		||||
[context attributes](@ref window_attribs_ctx), or you can check whether
 | 
			
		||||
a specific version is supported by the current context with the
 | 
			
		||||
`GLAD_GL_VERSION_x_x` booleans.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
if (GLAD_GL_VERSION_3_2)
 | 
			
		||||
{
 | 
			
		||||
    // Call OpenGL 3.2+ specific code
 | 
			
		||||
}
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
To check whether a specific extension is supported, use the `GLAD_GL_xxx`
 | 
			
		||||
booleans.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
if (GLAD_GL_ARB_debug_output)
 | 
			
		||||
{
 | 
			
		||||
    // Use GL_ARB_debug_output
 | 
			
		||||
}
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection context_glext_manual Loading extensions manually
 | 
			
		||||
 | 
			
		||||
__Do not use this technique__ unless it is absolutely necessary.  An
 | 
			
		||||
[extension loader library](@ref context_glext_auto) will save you a ton of
 | 
			
		||||
tedious, repetitive, error prone work.
 | 
			
		||||
 | 
			
		||||
To use a certain extension, you must first check whether the context supports
 | 
			
		||||
that extension and then, if it introduces new functions, retrieve the pointers
 | 
			
		||||
to those functions.  GLFW provides @ref glfwExtensionSupported and @ref
 | 
			
		||||
glfwGetProcAddress for manual loading of extensions and new API functions.
 | 
			
		||||
 | 
			
		||||
This section will demonstrate manual loading of OpenGL extensions.  The loading
 | 
			
		||||
of OpenGL ES extensions is identical except for the name of the extension header.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection context_glext_header The glext.h header
 | 
			
		||||
 | 
			
		||||
The `glext.h` extension header is a continually updated file that defines the
 | 
			
		||||
interfaces for all OpenGL extensions.  The latest version of this can always be
 | 
			
		||||
found at the [OpenGL Registry](https://www.opengl.org/registry/).  There are also
 | 
			
		||||
extension headers for the various versions of OpenGL ES at the
 | 
			
		||||
[OpenGL ES Registry](https://www.khronos.org/registry/gles/).  It it strongly
 | 
			
		||||
recommended that you use your own copy of the extension header, as the one
 | 
			
		||||
included in your development environment may be several years out of date and
 | 
			
		||||
may not include the extensions you wish to use.
 | 
			
		||||
 | 
			
		||||
The header defines function pointer types for all functions of all extensions it
 | 
			
		||||
supports.  These have names like `PFNGLGETDEBUGMESSAGELOGARBPROC` (for
 | 
			
		||||
`glGetDebugMessageLogARB`), i.e. the name is made uppercase and `PFN` (pointer
 | 
			
		||||
to function) and `PROC` (procedure) are added to the ends.
 | 
			
		||||
 | 
			
		||||
To include the extension header, define @ref GLFW_INCLUDE_GLEXT before including
 | 
			
		||||
the GLFW header.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
#define GLFW_INCLUDE_GLEXT
 | 
			
		||||
#include <GLFW/glfw3.h>
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection context_glext_string Checking for extensions
 | 
			
		||||
 | 
			
		||||
A given machine may not actually support the extension (it may have older
 | 
			
		||||
drivers or a graphics card that lacks the necessary hardware features), so it
 | 
			
		||||
is necessary to check at run-time whether the context supports the extension.
 | 
			
		||||
This is done with @ref glfwExtensionSupported.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
if (glfwExtensionSupported("GL_ARB_debug_output"))
 | 
			
		||||
{
 | 
			
		||||
    // The extension is supported by the current context
 | 
			
		||||
}
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
The argument is a null terminated ASCII string with the extension name.  If the
 | 
			
		||||
extension is supported, @ref glfwExtensionSupported returns `GLFW_TRUE`,
 | 
			
		||||
otherwise it returns `GLFW_FALSE`.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection context_glext_proc Fetching function pointers
 | 
			
		||||
 | 
			
		||||
Many extensions, though not all, require the use of new OpenGL functions.
 | 
			
		||||
These functions often do not have entry points in the client API libraries of
 | 
			
		||||
your operating system, making it necessary to fetch them at run time.  You can
 | 
			
		||||
retrieve pointers to these functions with @ref glfwGetProcAddress.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
PFNGLGETDEBUGMESSAGELOGARBPROC pfnGetDebugMessageLog = glfwGetProcAddress("glGetDebugMessageLogARB");
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
In general, you should avoid giving the function pointer variables the (exact)
 | 
			
		||||
same name as the function, as this may confuse your linker.  Instead, you can
 | 
			
		||||
use a different prefix, like above, or some other naming scheme.
 | 
			
		||||
 | 
			
		||||
Now that all the pieces have been introduced, here is what they might look like
 | 
			
		||||
when used together.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
#define GLFW_INCLUDE_GLEXT
 | 
			
		||||
#include <GLFW/glfw3.h>
 | 
			
		||||
 | 
			
		||||
#define glGetDebugMessageLogARB pfnGetDebugMessageLog
 | 
			
		||||
PFNGLGETDEBUGMESSAGELOGARBPROC pfnGetDebugMessageLog;
 | 
			
		||||
 | 
			
		||||
// Flag indicating whether the extension is supported
 | 
			
		||||
int has_ARB_debug_output = 0;
 | 
			
		||||
 | 
			
		||||
void load_extensions(void)
 | 
			
		||||
{
 | 
			
		||||
    if (glfwExtensionSupported("GL_ARB_debug_output"))
 | 
			
		||||
    {
 | 
			
		||||
        pfnGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGARBPROC)
 | 
			
		||||
            glfwGetProcAddress("glGetDebugMessageLogARB");
 | 
			
		||||
        has_ARB_debug_output = 1;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void some_function(void)
 | 
			
		||||
{
 | 
			
		||||
    if (has_ARB_debug_output)
 | 
			
		||||
    {
 | 
			
		||||
        // Now the extension function can be called as usual
 | 
			
		||||
        glGetDebugMessageLogARB(...);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
							
								
								
									
										1
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/extra.css
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/extra.css
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										414
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/extra.less
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										414
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/extra.less
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,414 @@
 | 
			
		||||
// 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%);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.sm-dox,.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted,.sm-dox ul a:hover {
 | 
			
		||||
    background:none;
 | 
			
		||||
    text-shadow:none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.sm-dox a span.sub-arrow {
 | 
			
		||||
	border-color:@navbar-link-color transparent transparent transparent;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.sm-dox a span.sub-arrow:active,.sm-dox a span.sub-arrow:focus,.sm-dox a span.sub-arrow:hover,.sm-dox a:hover span.sub-arrow {
 | 
			
		||||
	border-color:@default-link-color transparent transparent transparent;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.sm-dox ul a span.sub-arrow:active,.sm-dox ul a span.sub-arrow:focus,.sm-dox ul a span.sub-arrow:hover,.sm-dox ul a:hover span.sub-arrow {
 | 
			
		||||
	border-color:transparent transparent transparent @default-link-color;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.sm-dox ul a:hover {
 | 
			
		||||
    background:@header-footer-link-color;
 | 
			
		||||
    text-shadow:none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.sm-dox ul.sm-nowrap a {
 | 
			
		||||
	color:@default-text-color;
 | 
			
		||||
    text-shadow:none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#main-nav,#main-menu,#main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li,.memdoc,dl.reflist dd,div.toc li,.ah,span.lineno,span.lineno a,span.lineno a:hover,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,.doxtable code,.markdownTable code {
 | 
			
		||||
	background:none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#titlearea,.footer,.contents,div.header,.memdoc,table.doxtable td,table.doxtable th,table.markdownTable td,table.markdownTable th,hr,.memSeparator {
 | 
			
		||||
	border:none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li,.reflist dt a.el,.levels span,.directory .levels span {
 | 
			
		||||
	text-shadow:none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.memdoc,dl.reflist dd {
 | 
			
		||||
	box-shadow:none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
div.headertitle,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,table.doxtable code,table.markdownTable code {
 | 
			
		||||
	padding:0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#nav-path,.directory .levels,span.lineno {
 | 
			
		||||
	display:none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
html,#titlearea,.footer,tr.even,.directory tr.even,.doxtable tr:nth-child(even),tr.markdownTableBody:nth-child(even),.mdescLeft,.mdescRight,.memItemLeft,.memItemRight,code,.markdownTableRowEven {
 | 
			
		||||
	background:@header-footer-background-color;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
body {
 | 
			
		||||
	color:@default-text-color;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
h1,h2,h2.groupheader,h3,div.toc h3,h4,h5,h6,strong,em {
 | 
			
		||||
	color:@heading-color;
 | 
			
		||||
	border-bottom:none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
h1 {
 | 
			
		||||
  padding-top:0.5em;
 | 
			
		||||
  font-size:180%;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
h2 {
 | 
			
		||||
  padding-top:0.5em;
 | 
			
		||||
  margin-bottom:0;
 | 
			
		||||
  font-size:140%;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
h3 {
 | 
			
		||||
  padding-top:0.5em;
 | 
			
		||||
  margin-bottom:0;
 | 
			
		||||
  font-size:110%;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.glfwheader {
 | 
			
		||||
	font-size:16px;
 | 
			
		||||
	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("https://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;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#main-nav {
 | 
			
		||||
	max-width:960px;
 | 
			
		||||
	min-width:800px;
 | 
			
		||||
	margin:0 auto;
 | 
			
		||||
	font-size:13px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#main-menu {
 | 
			
		||||
	max-width:920px;
 | 
			
		||||
	min-width:800px;
 | 
			
		||||
	margin:0 auto;
 | 
			
		||||
	font-size:13px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.memtitle {
 | 
			
		||||
    display:none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.memproto,.memname {
 | 
			
		||||
    font-weight:bold;
 | 
			
		||||
    text-shadow:none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#main-menu {
 | 
			
		||||
	height:36px;
 | 
			
		||||
	display:block;
 | 
			
		||||
	position:relative;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li {
 | 
			
		||||
	color:@navbar-link-color;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#main-menu li ul.sm-nowrap li a {
 | 
			
		||||
	color:@default-text-color;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#main-menu li ul.sm-nowrap li a:hover {
 | 
			
		||||
	color:@default-link-color;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.contents {
 | 
			
		||||
	min-height:590px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
div.contents,div.header {
 | 
			
		||||
	max-width:920px;
 | 
			
		||||
	margin:0 auto;
 | 
			
		||||
	padding:0 32px;
 | 
			
		||||
	background:@content-background-color none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
table.doxtable th,table.markdownTable th,dl.reflist dt {
 | 
			
		||||
	background:linear-gradient(to bottom,@table-background-color2 0%,@table-background-color1 100%);
 | 
			
		||||
	box-shadow:inset 0 0 32px @table-background-color1;
 | 
			
		||||
	text-shadow:0 -1px 1px darken(@table-background-color1, 15%);
 | 
			
		||||
	text-align:left;
 | 
			
		||||
	color:@table-text-color;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
dl.reflist dt a.el {
 | 
			
		||||
	color:@default-link-color;
 | 
			
		||||
	padding:.2em;
 | 
			
		||||
	border-radius:4px;
 | 
			
		||||
	background-color:lighten(@default-link-color, 40%);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
div.toc {
 | 
			
		||||
	float:none;
 | 
			
		||||
	width:auto;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
div.toc h3 {
 | 
			
		||||
	font-size:1.17em;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
div.toc ul {
 | 
			
		||||
	padding-left:1.5em;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
div.toc li {
 | 
			
		||||
	font-size:1em;
 | 
			
		||||
	padding-left:0;
 | 
			
		||||
	list-style-type:disc;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
div.toc,.memproto,div.qindex,div.ah {
 | 
			
		||||
	background:linear-gradient(to bottom,@toc-background-color2 0%,@toc-background-color1 100%);
 | 
			
		||||
	box-shadow:inset 0 0 32px @toc-background-color1;
 | 
			
		||||
	text-shadow:0 1px 1px lighten(@toc-background-color2, 10%);
 | 
			
		||||
	color:@heading-color;
 | 
			
		||||
	border:2px solid @toc-background-color1;
 | 
			
		||||
	border-radius:4px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.paramname {
 | 
			
		||||
	color:@prototype-param-color;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
dl.reflist dt {
 | 
			
		||||
	border:2px solid @default-border-color;
 | 
			
		||||
	border-top-left-radius:4px;
 | 
			
		||||
	border-top-right-radius:4px;
 | 
			
		||||
	border-bottom:none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
dl.reflist dd {
 | 
			
		||||
	border:2px solid @default-border-color;
 | 
			
		||||
	border-bottom-right-radius:4px;
 | 
			
		||||
	border-bottom-left-radius:4px;
 | 
			
		||||
	border-top:none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
table.doxtable,table.markdownTable {
 | 
			
		||||
	border-collapse:inherit;
 | 
			
		||||
	border-spacing:0;
 | 
			
		||||
	border:2px solid @default-border-color;
 | 
			
		||||
	border-radius:4px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
a,a:hover,a:visited,a:visited:hover,.contents a:visited,.el,a.el:visited,#glfwhome:hover,#main-menu a:hover,span.lineno a:hover {
 | 
			
		||||
	color:@default-link-color;
 | 
			
		||||
	text-decoration:none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
div.directory {
 | 
			
		||||
	border-collapse:inherit;
 | 
			
		||||
	border-spacing:0;
 | 
			
		||||
	border:2px solid @default-border-color;
 | 
			
		||||
	border-radius:4px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
hr,.memSeparator {
 | 
			
		||||
	height:2px;
 | 
			
		||||
	background:linear-gradient(to right,@def-separator-color 0%,darken(@def-separator-color, 10%) 50%,@def-separator-color 100%);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
dl.note,dl.pre,dl.post,dl.invariant {
 | 
			
		||||
	.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;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										7
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/footer.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/footer.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
			
		||||
<address class="footer">
 | 
			
		||||
<p>
 | 
			
		||||
Last update on $date for $projectname $projectnumber
 | 
			
		||||
</p>
 | 
			
		||||
</address>
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
							
								
								
									
										33
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/header.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/header.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,33 @@
 | 
			
		||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 | 
			
		||||
<html xmlns="http://www.w3.org/1999/xhtml">
 | 
			
		||||
<head>
 | 
			
		||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
 | 
			
		||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
 | 
			
		||||
<meta name="generator" content="Doxygen $doxygenversion"/>
 | 
			
		||||
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
 | 
			
		||||
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
 | 
			
		||||
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
 | 
			
		||||
<script type="text/javascript" src="$relpath^jquery.js"></script>
 | 
			
		||||
<script type="text/javascript" src="$relpath^dynsections.js"></script>
 | 
			
		||||
$treeview
 | 
			
		||||
$search
 | 
			
		||||
$mathjax
 | 
			
		||||
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
 | 
			
		||||
$extrastylesheet
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
 | 
			
		||||
 | 
			
		||||
<!--BEGIN TITLEAREA-->
 | 
			
		||||
<div id="titlearea">
 | 
			
		||||
	<div class="glfwheader">
 | 
			
		||||
		<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
 | 
			
		||||
		<ul class="glfwnavbar">
 | 
			
		||||
			<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
 | 
			
		||||
			<li><a href="https://www.glfw.org/download.html">Download</a></li>
 | 
			
		||||
			<li><a href="https://www.glfw.org/community.html">Community</a></li>
 | 
			
		||||
		</ul>
 | 
			
		||||
	</div>
 | 
			
		||||
</div>
 | 
			
		||||
<!--END TITLEAREA-->
 | 
			
		||||
<!-- end header part -->
 | 
			
		||||
							
								
								
									
										944
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/input.dox
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										944
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/input.dox
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,944 @@
 | 
			
		||||
/*!
 | 
			
		||||
 | 
			
		||||
@page input_guide Input guide
 | 
			
		||||
 | 
			
		||||
@tableofcontents
 | 
			
		||||
 | 
			
		||||
This guide introduces the input related functions of GLFW.  For details on
 | 
			
		||||
a specific function in this category, see the @ref input.  There are also guides
 | 
			
		||||
for the other areas of GLFW.
 | 
			
		||||
 | 
			
		||||
 - @ref intro_guide
 | 
			
		||||
 - @ref window_guide
 | 
			
		||||
 - @ref context_guide
 | 
			
		||||
 - @ref vulkan_guide
 | 
			
		||||
 - @ref monitor_guide
 | 
			
		||||
 | 
			
		||||
GLFW provides many kinds of input.  While some can only be polled, like time, or
 | 
			
		||||
only received via callbacks, like scrolling, many provide both callbacks and
 | 
			
		||||
polling.  Callbacks are more work to use than polling but is less CPU intensive
 | 
			
		||||
and guarantees that you do not miss state changes.
 | 
			
		||||
 | 
			
		||||
All input callbacks receive a window handle.  By using the
 | 
			
		||||
[window user pointer](@ref window_userptr), you can access non-global structures
 | 
			
		||||
or objects from your callbacks.
 | 
			
		||||
 | 
			
		||||
To get a better feel for how the various events callbacks behave, run the
 | 
			
		||||
`events` test program.  It register every callback supported by GLFW and prints
 | 
			
		||||
out all arguments provided for every event, along with time and sequence
 | 
			
		||||
information.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section events Event processing
 | 
			
		||||
 | 
			
		||||
GLFW needs to poll the window system for events both to provide input to the
 | 
			
		||||
application and to prove to the window system that the application hasn't locked
 | 
			
		||||
up.  Event processing is normally done each frame after
 | 
			
		||||
[buffer swapping](@ref buffer_swap).  Even when you have no windows, event
 | 
			
		||||
polling needs to be done in order to receive monitor and joystick connection
 | 
			
		||||
events.
 | 
			
		||||
 | 
			
		||||
There are three functions for processing pending events.  @ref glfwPollEvents,
 | 
			
		||||
processes only those events that have already been received and then returns
 | 
			
		||||
immediately.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
glfwPollEvents();
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
This is the best choice when rendering continuously, like most games do.
 | 
			
		||||
 | 
			
		||||
If you only need to update the contents of the window when you receive new
 | 
			
		||||
input, @ref glfwWaitEvents is a better choice.
 | 
			
		||||
 | 
			
		||||
@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.
 | 
			
		||||
 | 
			
		||||
If you want to wait for events but have UI elements or other tasks that need
 | 
			
		||||
periodic updates, @ref glfwWaitEventsTimeout lets you specify a timeout.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
glfwWaitEventsTimeout(0.7);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
It puts the thread to sleep until at least one event has been received, or until
 | 
			
		||||
the specified number of seconds have elapsed.  It then processes any received
 | 
			
		||||
events.
 | 
			
		||||
 | 
			
		||||
If the main thread is sleeping in @ref glfwWaitEvents, you can wake it from
 | 
			
		||||
another thread by posting an empty event to the event queue with @ref
 | 
			
		||||
glfwPostEmptyEvent.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
glfwPostEmptyEvent();
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
Do not assume that callbacks will _only_ be called in response to the above
 | 
			
		||||
functions.  While it is necessary to process events in one or more of the ways
 | 
			
		||||
above, window systems that require GLFW to register callbacks of its own can
 | 
			
		||||
pass events to GLFW in response to many window system function calls.  GLFW will
 | 
			
		||||
pass those events on to the application callbacks before returning.
 | 
			
		||||
 | 
			
		||||
For example, on Windows the system function that @ref glfwSetWindowSize is
 | 
			
		||||
implemented with will send window size events directly to the event callback
 | 
			
		||||
that every window has and that GLFW implements for its windows.  If you have set
 | 
			
		||||
a [window size callback](@ref window_size) GLFW will call it in turn with the
 | 
			
		||||
new size before everything returns back out of the @ref glfwSetWindowSize call.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@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, for example
 | 
			
		||||
_E-mail_ and _Play_ keys.
 | 
			
		||||
 | 
			
		||||
The scancode is unique for every key, regardless of whether it has a key token.
 | 
			
		||||
Scancodes are platform-specific but consistent over time, so keys will have
 | 
			
		||||
different scancodes depending on the platform but they are safe to save to disk.
 | 
			
		||||
You can query the scancode for any [named key](@ref keys) on the current
 | 
			
		||||
platform with @ref glfwGetKeyScancode.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
const int scancode = glfwGetKeyScancode(GLFW_KEY_X);
 | 
			
		||||
set_key_mapping(scancode, swap_weapons);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
The last reported state for every [named key](@ref keys) is 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 physical state of the key.
 | 
			
		||||
 | 
			
		||||
@anchor GLFW_STICKY_KEYS
 | 
			
		||||
Whenever you poll state, you risk missing the state change you are looking for.
 | 
			
		||||
If a pressed key is released again before you poll its state, you will have
 | 
			
		||||
missed the key press.  The recommended solution for this is to use a
 | 
			
		||||
key callback, but there is also the `GLFW_STICKY_KEYS` input mode.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
glfwSetInputMode(window, GLFW_STICKY_KEYS, GLFW_TRUE);
 | 
			
		||||
@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`.
 | 
			
		||||
 | 
			
		||||
@anchor GLFW_LOCK_KEY_MODS
 | 
			
		||||
If you wish to know what the state of the Caps Lock and Num Lock keys was when
 | 
			
		||||
input events were generated, set the `GLFW_LOCK_KEY_MODS` input mode.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
glfwSetInputMode(window, GLFW_LOCK_KEY_MODS, GLFW_TRUE);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
When this input mode is enabled, any callback that receives
 | 
			
		||||
[modifier bits](@ref mods) will have the @ref GLFW_MOD_CAPS_LOCK bit set if Caps
 | 
			
		||||
Lock was on when the event occurred and the @ref GLFW_MOD_NUM_LOCK bit set if
 | 
			
		||||
Num Lock was on.
 | 
			
		||||
 | 
			
		||||
The `GLFW_KEY_LAST` constant holds the highest value of any
 | 
			
		||||
[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 or any other encoding you prefer.
 | 
			
		||||
 | 
			
		||||
Because an `unsigned int` is 32 bits long on all platforms supported by GLFW,
 | 
			
		||||
you can treat the code point argument as native endian UTF-32.
 | 
			
		||||
 | 
			
		||||
If you wish to offer regular text input, set a character callback.
 | 
			
		||||
 | 
			
		||||
@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
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection input_key_name Key names
 | 
			
		||||
 | 
			
		||||
If you wish to refer to keys by name, you can query the keyboard layout
 | 
			
		||||
dependent name of printable keys with @ref glfwGetKeyName.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
const char* key_name = glfwGetKeyName(GLFW_KEY_W, 0);
 | 
			
		||||
show_tutorial_hint("Press %s to move forward", key_name);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
This function can handle both [keys and scancodes](@ref input_key).  If the
 | 
			
		||||
specified key is `GLFW_KEY_UNKNOWN` then the scancode is used, otherwise it is
 | 
			
		||||
ignored.  This matches the behavior of the key callback, meaning the callback
 | 
			
		||||
arguments can always be passed unmodified to this function.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section input_mouse Mouse input
 | 
			
		||||
 | 
			
		||||
Mouse input comes in many forms, including mouse motion, button presses and
 | 
			
		||||
scrolling offsets.  The cursor appearance can also be changed, either to
 | 
			
		||||
a custom image or a standard cursor shape from the system theme.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection cursor_pos Cursor position
 | 
			
		||||
 | 
			
		||||
If you wish to be notified when the cursor moves over the window, set a cursor
 | 
			
		||||
position callback.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
glfwSetCursorPosCallback(window, cursor_position_callback);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
The callback functions receives the cursor position, measured in screen
 | 
			
		||||
coordinates but relative to the top-left corner of the window content area.  On
 | 
			
		||||
platforms that provide it, the full sub-pixel cursor position is passed on.
 | 
			
		||||
 | 
			
		||||
@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
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection cursor_mode Cursor mode
 | 
			
		||||
 | 
			
		||||
@anchor GLFW_CURSOR
 | 
			
		||||
The `GLFW_CURSOR` input mode provides several cursor modes for special forms of
 | 
			
		||||
mouse motion input.  By default, the cursor mode is `GLFW_CURSOR_NORMAL`,
 | 
			
		||||
meaning the regular arrow cursor (or another cursor set with @ref glfwSetCursor)
 | 
			
		||||
is used and cursor motion is not limited.
 | 
			
		||||
 | 
			
		||||
If you wish to implement mouse motion based camera controls or other input
 | 
			
		||||
schemes that require unlimited mouse movement, set the cursor mode to
 | 
			
		||||
`GLFW_CURSOR_DISABLED`.
 | 
			
		||||
 | 
			
		||||
@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 via both the cursor position callback and through polling.
 | 
			
		||||
 | 
			
		||||
@note You should not implement your own version of this functionality using
 | 
			
		||||
other features of GLFW.  It is not supported and will not work as robustly as
 | 
			
		||||
`GLFW_CURSOR_DISABLED`.
 | 
			
		||||
 | 
			
		||||
If you only wish the cursor to become hidden when it is over a window but still
 | 
			
		||||
want it to behave normally, set the cursor mode to `GLFW_CURSOR_HIDDEN`.
 | 
			
		||||
 | 
			
		||||
@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
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@anchor GLFW_RAW_MOUSE_MOTION
 | 
			
		||||
@subsection raw_mouse_motion Raw mouse motion
 | 
			
		||||
 | 
			
		||||
When the cursor is disabled, raw (unscaled and unaccelerated) mouse motion can
 | 
			
		||||
be enabled if available.
 | 
			
		||||
 | 
			
		||||
Raw mouse motion is closer to the actual motion of the mouse across a surface.
 | 
			
		||||
It is not affected by the scaling and acceleration applied to the motion of the
 | 
			
		||||
desktop cursor.  That processing is suitable for a cursor while raw motion is
 | 
			
		||||
better for controlling for example a 3D camera.  Because of this, raw mouse
 | 
			
		||||
motion is only provided when the cursor is disabled.
 | 
			
		||||
 | 
			
		||||
Call @ref glfwRawMouseMotionSupported to check if the current machine provides
 | 
			
		||||
raw motion and set the `GLFW_RAW_MOUSE_MOTION` input mode to enable it.  It is
 | 
			
		||||
disabled by default.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
if (glfwRawMouseMotionSupported())
 | 
			
		||||
    glfwSetInputMode(window, GLFW_RAW_MOUSE_MOTION, GLFW_TRUE);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
If supported, raw mouse motion can be enabled or disabled per-window and at any
 | 
			
		||||
time but it will only be provided when the cursor is disabled.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection cursor_object Cursor objects
 | 
			
		||||
 | 
			
		||||
GLFW supports creating both custom and system theme cursor images, encapsulated
 | 
			
		||||
as @ref GLFWcursor objects.  They are created with @ref glfwCreateCursor or @ref
 | 
			
		||||
glfwCreateStandardCursor and destroyed with @ref glfwDestroyCursor, or @ref
 | 
			
		||||
glfwTerminate, if any remain.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection cursor_custom Custom cursor creation
 | 
			
		||||
 | 
			
		||||
A custom cursor is created with @ref glfwCreateCursor, which returns a handle to
 | 
			
		||||
the created cursor object.  For example, this creates a 16x16 white square
 | 
			
		||||
cursor with the hot-spot in the upper-left corner:
 | 
			
		||||
 | 
			
		||||
@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, little-endian, non-premultiplied RGBA, i.e. eight bits
 | 
			
		||||
per channel with the red channel first.  The pixels are arranged canonically as
 | 
			
		||||
sequential rows, starting from the top-left corner.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection cursor_standard Standard cursor creation
 | 
			
		||||
 | 
			
		||||
A cursor with a [standard shape](@ref shapes) from the current system cursor
 | 
			
		||||
theme can be can be created with @ref glfwCreateStandardCursor.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
GLFWcursor* cursor = glfwCreateStandardCursor(GLFW_HRESIZE_CURSOR);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
These cursor objects behave in the exact same way as those created with @ref
 | 
			
		||||
glfwCreateCursor except that the system cursor theme provides the actual image.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection cursor_destruction Cursor destruction
 | 
			
		||||
 | 
			
		||||
When a cursor is no longer needed, destroy it with @ref glfwDestroyCursor.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
glfwDestroyCursor(cursor);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
Cursor destruction always succeeds.  If the cursor is current for any window,
 | 
			
		||||
that window will revert to the default cursor.  This does not affect the cursor
 | 
			
		||||
mode.  All remaining cursors are destroyed when @ref glfwTerminate is called.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection 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
 | 
			
		||||
content area of the window and the [cursor mode](@ref cursor_mode) is set
 | 
			
		||||
to `GLFW_CURSOR_NORMAL`.
 | 
			
		||||
 | 
			
		||||
A single cursor may be set for any number of windows.
 | 
			
		||||
 | 
			
		||||
To revert to the default cursor, set the cursor of that window to `NULL`.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
glfwSetCursor(window, NULL);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
When a cursor is destroyed, any window that has it set will revert to the
 | 
			
		||||
default cursor.  This does not affect the cursor mode.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection cursor_enter Cursor enter/leave events
 | 
			
		||||
 | 
			
		||||
If you wish to be notified when the cursor enters or leaves the content 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 content area of the window
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
    {
 | 
			
		||||
        // The cursor left the content area of the window
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
You can query whether the cursor is currently inside the content area of the
 | 
			
		||||
window with the [GLFW_HOVERED](@ref GLFW_HOVERED_attrib) window attribute.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
if (glfwGetWindowAttrib(window, GLFW_HOVERED))
 | 
			
		||||
{
 | 
			
		||||
    highlight_interface();
 | 
			
		||||
}
 | 
			
		||||
@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.
 | 
			
		||||
 | 
			
		||||
@anchor GLFW_STICKY_MOUSE_BUTTONS
 | 
			
		||||
Whenever you poll state, you risk missing the state change you are looking for.
 | 
			
		||||
If a pressed mouse button is released again before you poll its state, you will have
 | 
			
		||||
missed the button press.  The recommended solution for this is to use a
 | 
			
		||||
mouse button callback, but there is also the `GLFW_STICKY_MOUSE_BUTTONS`
 | 
			
		||||
input mode.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
glfwSetInputMode(window, GLFW_STICKY_MOUSE_BUTTONS, GLFW_TRUE);
 | 
			
		||||
@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 scrolling 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 normal mouse wheel, being vertical, provides offsets along the Y-axis.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section joystick 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 and including `GLFW_JOYSTICK_16` or
 | 
			
		||||
`GLFW_JOYSTICK_LAST`.  You can test whether a [joystick](@ref joysticks) is
 | 
			
		||||
present with @ref glfwJoystickPresent.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
int present = glfwJoystickPresent(GLFW_JOYSTICK_1);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
Each joystick has zero or more axes, zero or more buttons, zero or more hats,
 | 
			
		||||
a human-readable name, a user pointer and an SDL compatible GUID.
 | 
			
		||||
 | 
			
		||||
When GLFW is initialized, detected joysticks are added to the beginning of
 | 
			
		||||
the array.  Once a joystick is detected, it keeps its assigned ID until it is
 | 
			
		||||
disconnected or the library is terminated, so as joysticks are connected and
 | 
			
		||||
disconnected, there may appear gaps in the IDs.
 | 
			
		||||
 | 
			
		||||
Joystick axis, button and hat state is updated when polled and does not require
 | 
			
		||||
a window to be created or events to be processed.  However, if you want joystick
 | 
			
		||||
connection and disconnection events reliably delivered to the
 | 
			
		||||
[joystick callback](@ref joystick_event) then you must
 | 
			
		||||
[process events](@ref events).
 | 
			
		||||
 | 
			
		||||
To see all the properties of all connected joysticks in real-time, run the
 | 
			
		||||
`joysticks` test program.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection joystick_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_5, &count);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
Each element in the returned array is a value between -1.0 and 1.0.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection joystick_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* buttons = glfwGetJoystickButtons(GLFW_JOYSTICK_3, &count);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
Each element in the returned array is either `GLFW_PRESS` or `GLFW_RELEASE`.
 | 
			
		||||
 | 
			
		||||
For backward compatibility with earlier versions that did not have @ref
 | 
			
		||||
glfwGetJoystickHats, the button array by default also includes all hats.  See
 | 
			
		||||
the reference documentation for @ref glfwGetJoystickButtons for details.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection joystick_hat Joystick hat states
 | 
			
		||||
 | 
			
		||||
The states of all hats are returned by @ref glfwGetJoystickHats.  See the
 | 
			
		||||
reference documentation for the lifetime of the returned array.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
int count;
 | 
			
		||||
const unsigned char* hats = glfwGetJoystickHats(GLFW_JOYSTICK_7, &count);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
Each element in the returned array is one of the following:
 | 
			
		||||
 | 
			
		||||
Name                  | Value
 | 
			
		||||
----                  | -----
 | 
			
		||||
`GLFW_HAT_CENTERED`   | 0
 | 
			
		||||
`GLFW_HAT_UP`         | 1
 | 
			
		||||
`GLFW_HAT_RIGHT`      | 2
 | 
			
		||||
`GLFW_HAT_DOWN`       | 4
 | 
			
		||||
`GLFW_HAT_LEFT`       | 8
 | 
			
		||||
`GLFW_HAT_RIGHT_UP`   | `GLFW_HAT_RIGHT` \| `GLFW_HAT_UP`
 | 
			
		||||
`GLFW_HAT_RIGHT_DOWN` | `GLFW_HAT_RIGHT` \| `GLFW_HAT_DOWN`
 | 
			
		||||
`GLFW_HAT_LEFT_UP`    | `GLFW_HAT_LEFT` \| `GLFW_HAT_UP`
 | 
			
		||||
`GLFW_HAT_LEFT_DOWN`  | `GLFW_HAT_LEFT` \| `GLFW_HAT_DOWN`
 | 
			
		||||
 | 
			
		||||
The diagonal directions are bitwise combinations of the primary (up, right, down
 | 
			
		||||
and left) directions and you can test for these individually by ANDing it with
 | 
			
		||||
the corresponding direction.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
if (hats[2] & GLFW_HAT_RIGHT)
 | 
			
		||||
{
 | 
			
		||||
    // State of hat 2 could be right-up, right or right-down
 | 
			
		||||
}
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
For backward compatibility with earlier versions that did not have @ref
 | 
			
		||||
glfwGetJoystickHats, all hats are by default also included in the button array.
 | 
			
		||||
See the reference documentation for @ref glfwGetJoystickButtons for details.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection joystick_name Joystick name
 | 
			
		||||
 | 
			
		||||
The human-readable, UTF-8 encoded name of a joystick is returned by @ref
 | 
			
		||||
glfwGetJoystickName.  See the reference documentation for the lifetime of the
 | 
			
		||||
returned string.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
const char* name = glfwGetJoystickName(GLFW_JOYSTICK_4);
 | 
			
		||||
@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.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection joystick_userptr Joystick user pointer
 | 
			
		||||
 | 
			
		||||
Each joystick has a user pointer that can be set with @ref
 | 
			
		||||
glfwSetJoystickUserPointer and queried with @ref glfwGetJoystickUserPointer.
 | 
			
		||||
This can be used for any purpose you need and will not be modified by GLFW.  The
 | 
			
		||||
value will be kept until the joystick is disconnected or until the library is
 | 
			
		||||
terminated.
 | 
			
		||||
 | 
			
		||||
The initial value of the pointer is `NULL`.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection joystick_event Joystick configuration changes
 | 
			
		||||
 | 
			
		||||
If you wish to be notified when a joystick is connected or disconnected, set
 | 
			
		||||
a joystick callback.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
glfwSetJoystickCallback(joystick_callback);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
The callback function receives the ID of the joystick that has been connected
 | 
			
		||||
and disconnected and the event that occurred.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
void joystick_callback(int jid, int event)
 | 
			
		||||
{
 | 
			
		||||
    if (event == GLFW_CONNECTED)
 | 
			
		||||
    {
 | 
			
		||||
        // The joystick was connected
 | 
			
		||||
    }
 | 
			
		||||
    else if (event == GLFW_DISCONNECTED)
 | 
			
		||||
    {
 | 
			
		||||
        // The joystick was disconnected
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
For joystick connection and disconnection events to be delivered on all
 | 
			
		||||
platforms, you need to call one of the [event processing](@ref events)
 | 
			
		||||
functions.  Joystick disconnection may also be detected and the callback
 | 
			
		||||
called by joystick functions.  The function will then return whatever it
 | 
			
		||||
returns for a disconnected joystick.
 | 
			
		||||
 | 
			
		||||
Only @ref glfwGetJoystickName and @ref glfwGetJoystickUserPointer will return
 | 
			
		||||
useful values for a disconnected joystick and only before the monitor callback
 | 
			
		||||
returns.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection gamepad Gamepad input
 | 
			
		||||
 | 
			
		||||
The joystick functions provide unlabeled axes, buttons and hats, with no
 | 
			
		||||
indication of where they are located on the device.  Their order may also vary
 | 
			
		||||
between platforms even with the same device.
 | 
			
		||||
 | 
			
		||||
To solve this problem the SDL community crowdsourced the
 | 
			
		||||
[SDL_GameControllerDB](https://github.com/gabomdq/SDL_GameControllerDB) project,
 | 
			
		||||
a database of mappings from many different devices to an Xbox-like gamepad.
 | 
			
		||||
 | 
			
		||||
GLFW supports this mapping format and contains a copy of the mappings
 | 
			
		||||
available at the time of release.  See @ref gamepad_mapping for how to update
 | 
			
		||||
this at runtime.  Mappings will be assigned to joysticks automatically any time
 | 
			
		||||
a joystick is connected or the mappings are updated.
 | 
			
		||||
 | 
			
		||||
You can check whether a joystick is both present and has a gamepad mapping with
 | 
			
		||||
@ref glfwJoystickIsGamepad.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
if (glfwJoystickIsGamepad(GLFW_JOYSTICK_2))
 | 
			
		||||
{
 | 
			
		||||
    // Use as gamepad
 | 
			
		||||
}
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
If you are only interested in gamepad input you can use this function instead of
 | 
			
		||||
@ref glfwJoystickPresent.
 | 
			
		||||
 | 
			
		||||
You can query the human-readable name provided by the gamepad mapping with @ref
 | 
			
		||||
glfwGetGamepadName.  This may or may not be the same as the
 | 
			
		||||
[joystick name](@ref joystick_name).
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
const char* name = glfwGetGamepadName(GLFW_JOYSTICK_7);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
To retrieve the gamepad state of a joystick, call @ref glfwGetGamepadState.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
GLFWgamepadstate state;
 | 
			
		||||
 | 
			
		||||
if (glfwGetGamepadState(GLFW_JOYSTICK_3, &state))
 | 
			
		||||
{
 | 
			
		||||
    if (state.buttons[GLFW_GAMEPAD_BUTTON_A])
 | 
			
		||||
    {
 | 
			
		||||
        input_jump();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    input_speed(state.axes[GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER]);
 | 
			
		||||
}
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
The @ref GLFWgamepadstate struct has two arrays; one for button states and one
 | 
			
		||||
for axis states.  The values for each button and axis are the same as for the
 | 
			
		||||
@ref glfwGetJoystickButtons and @ref glfwGetJoystickAxes functions, i.e.
 | 
			
		||||
`GLFW_PRESS` or `GLFW_RELEASE` for buttons and -1.0 to 1.0 inclusive for axes.
 | 
			
		||||
 | 
			
		||||
The sizes of the arrays and the positions within each array are fixed.
 | 
			
		||||
 | 
			
		||||
The [button indices](@ref gamepad_buttons) are `GLFW_GAMEPAD_BUTTON_A`,
 | 
			
		||||
`GLFW_GAMEPAD_BUTTON_B`, `GLFW_GAMEPAD_BUTTON_X`, `GLFW_GAMEPAD_BUTTON_Y`,
 | 
			
		||||
`GLFW_GAMEPAD_BUTTON_LEFT_BUMPER`, `GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER`,
 | 
			
		||||
`GLFW_GAMEPAD_BUTTON_BACK`, `GLFW_GAMEPAD_BUTTON_START`,
 | 
			
		||||
`GLFW_GAMEPAD_BUTTON_GUIDE`, `GLFW_GAMEPAD_BUTTON_LEFT_THUMB`,
 | 
			
		||||
`GLFW_GAMEPAD_BUTTON_RIGHT_THUMB`, `GLFW_GAMEPAD_BUTTON_DPAD_UP`,
 | 
			
		||||
`GLFW_GAMEPAD_BUTTON_DPAD_RIGHT`, `GLFW_GAMEPAD_BUTTON_DPAD_DOWN` and
 | 
			
		||||
`GLFW_GAMEPAD_BUTTON_DPAD_LEFT`.
 | 
			
		||||
 | 
			
		||||
For those who prefer, there are also the `GLFW_GAMEPAD_BUTTON_CROSS`,
 | 
			
		||||
`GLFW_GAMEPAD_BUTTON_CIRCLE`, `GLFW_GAMEPAD_BUTTON_SQUARE` and
 | 
			
		||||
`GLFW_GAMEPAD_BUTTON_TRIANGLE` aliases for the A, B, X and Y button indices.
 | 
			
		||||
 | 
			
		||||
The [axis indices](@ref gamepad_axes) are `GLFW_GAMEPAD_AXIS_LEFT_X`,
 | 
			
		||||
`GLFW_GAMEPAD_AXIS_LEFT_Y`, `GLFW_GAMEPAD_AXIS_RIGHT_X`,
 | 
			
		||||
`GLFW_GAMEPAD_AXIS_RIGHT_Y`, `GLFW_GAMEPAD_AXIS_LEFT_TRIGGER` and
 | 
			
		||||
`GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER`.
 | 
			
		||||
 | 
			
		||||
The `GLFW_GAMEPAD_BUTTON_LAST` and `GLFW_GAMEPAD_AXIS_LAST` constants equal
 | 
			
		||||
the largest available index for each array.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection gamepad_mapping Gamepad mappings
 | 
			
		||||
 | 
			
		||||
GLFW contains a copy of the mappings available in
 | 
			
		||||
[SDL_GameControllerDB](https://github.com/gabomdq/SDL_GameControllerDB) at the
 | 
			
		||||
time of release.  Newer ones can be added at runtime with @ref
 | 
			
		||||
glfwUpdateGamepadMappings.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
const char* mappings = load_file_contents("game/data/gamecontrollerdb.txt");
 | 
			
		||||
 | 
			
		||||
glfwUpdateGamepadMappings(mappings);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
This function supports everything from single lines up to and including the
 | 
			
		||||
unmodified contents of the whole `gamecontrollerdb.txt` file.
 | 
			
		||||
 | 
			
		||||
Below is a description of the mapping format.  Please keep in mind that __this
 | 
			
		||||
description is not authoritative__.  The format is defined by the SDL and
 | 
			
		||||
SDL_GameControllerDB projects and their documentation and code takes precedence.
 | 
			
		||||
 | 
			
		||||
Each mapping is a single line of comma-separated values describing the GUID,
 | 
			
		||||
name and layout of the gamepad.  Lines that do not begin with a hexadecimal
 | 
			
		||||
digit are ignored.
 | 
			
		||||
 | 
			
		||||
The first value is always the gamepad GUID, a 32 character long hexadecimal
 | 
			
		||||
string that typically identifies its make, model, revision and the type of
 | 
			
		||||
connection to the computer.  When this information is not available, the GUID is
 | 
			
		||||
generated using the gamepad name.  GLFW uses the SDL 2.0.5+ GUID format but can
 | 
			
		||||
convert from the older formats.
 | 
			
		||||
 | 
			
		||||
The second value is always the human-readable name of the gamepad.
 | 
			
		||||
 | 
			
		||||
All subsequent values are in the form `<field>:<value>` and describe the layout
 | 
			
		||||
of the mapping.  These fields may not all be present and may occur in any order.
 | 
			
		||||
 | 
			
		||||
The button fields are `a`, `b`, `c`, `d`, `back`, `start`, `guide`, `dpup`,
 | 
			
		||||
`dpright`, `dpdown`, `dpleft`, `leftshoulder`, `rightshoulder`, `leftstick` and
 | 
			
		||||
`rightstick`.
 | 
			
		||||
 | 
			
		||||
The axis fields are `leftx`, `lefty`, `rightx`, `righty`, `lefttrigger` and
 | 
			
		||||
`righttrigger`.
 | 
			
		||||
 | 
			
		||||
The value of an axis or button field can be a joystick button, a joystick axis,
 | 
			
		||||
a hat bitmask or empty.  Joystick buttons are specified as `bN`, for example
 | 
			
		||||
`b2` for the third button.  Joystick axes are specified as `aN`, for example
 | 
			
		||||
`a7` for the eighth button.  Joystick hat bit masks are specified as `hN.N`, for
 | 
			
		||||
example `h0.8` for left on the first hat.  More than one bit may be set in the
 | 
			
		||||
mask.
 | 
			
		||||
 | 
			
		||||
Before an axis there may be a `+` or `-` range modifier, for example `+a3` for
 | 
			
		||||
the positive half of the fourth axis.  This restricts input to only the positive
 | 
			
		||||
or negative halves of the joystick axis.  After an axis or half-axis there may
 | 
			
		||||
be the `~` inversion modifier, for example `a2~` or `-a7~`.  This negates the
 | 
			
		||||
values of the gamepad axis.
 | 
			
		||||
 | 
			
		||||
The hat bit mask match the [hat states](@ref hat_state) in the joystick
 | 
			
		||||
functions.
 | 
			
		||||
 | 
			
		||||
There is also the special `platform` field that specifies which platform the
 | 
			
		||||
mapping is valid for.  Possible values are `Windows`, `Mac OS X` and `Linux`.
 | 
			
		||||
 | 
			
		||||
Below is an example of what a gamepad mapping might look like.  It is the
 | 
			
		||||
one built into GLFW for Xbox controllers accessed via the XInput API on Windows.
 | 
			
		||||
This example has been broken into several lines to fit on the page, but real
 | 
			
		||||
gamepad mappings must be a single line.
 | 
			
		||||
 | 
			
		||||
@code{.unparsed}
 | 
			
		||||
78696e70757401000000000000000000,XInput Gamepad (GLFW),platform:Windows,a:b0,
 | 
			
		||||
b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,leftstick:b8,
 | 
			
		||||
rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,
 | 
			
		||||
righttrigger:a5,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
@note GLFW does not yet support the output range and modifiers `+` and `-` that
 | 
			
		||||
were recently added to SDL.  The input modifiers `+`, `-` and `~` are supported
 | 
			
		||||
and described above.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section 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.
 | 
			
		||||
 | 
			
		||||
You can also access the raw timer value, measured in 1 / frequency
 | 
			
		||||
seconds, with @ref glfwGetTimerValue.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
uint64_t value = glfwGetTimerValue();
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
The frequency of the raw timer varies depending on what time sources are
 | 
			
		||||
available on the machine.  You can query its frequency, in Hz, with @ref
 | 
			
		||||
glfwGetTimerFrequency.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
uint64_t freqency = glfwGetTimerFrequency();
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section 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* text = glfwGetClipboardString(NULL);
 | 
			
		||||
if (text)
 | 
			
		||||
{
 | 
			
		||||
    insert_text(text);
 | 
			
		||||
}
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
If the clipboard is empty or if its contents could not be converted, `NULL` is
 | 
			
		||||
returned.
 | 
			
		||||
 | 
			
		||||
The contents of the system clipboard can be set to a UTF-8 encoded string with
 | 
			
		||||
@ref glfwSetClipboardString.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
glfwSetClipboardString(NULL, "A string with words in it");
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section path_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.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
							
								
								
									
										115
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/internal.dox
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										115
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/internal.dox
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,115 @@
 | 
			
		||||
/*!
 | 
			
		||||
 | 
			
		||||
@page internals_guide Internal structure
 | 
			
		||||
 | 
			
		||||
@tableofcontents
 | 
			
		||||
 | 
			
		||||
There are several interfaces inside GLFW.  Each interface has its own area of
 | 
			
		||||
responsibility and its own naming conventions.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section internals_public Public interface
 | 
			
		||||
 | 
			
		||||
The most well-known is the public interface, described in the glfw3.h header
 | 
			
		||||
file.  This is implemented in source files shared by all platforms and these
 | 
			
		||||
files contain no platform-specific code.  This code usually ends up calling the
 | 
			
		||||
platform and internal interfaces to do the actual work.
 | 
			
		||||
 | 
			
		||||
The public interface uses the OpenGL naming conventions except with GLFW and
 | 
			
		||||
glfw instead of GL and gl.  For struct members, where OpenGL sets no precedent,
 | 
			
		||||
it use headless camel case.
 | 
			
		||||
 | 
			
		||||
Examples: `glfwCreateWindow`, `GLFWwindow`, `GLFW_RED_BITS`
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section internals_native Native interface
 | 
			
		||||
 | 
			
		||||
The [native interface](@ref native) is a small set of publicly available
 | 
			
		||||
but platform-specific functions, described in the glfw3native.h header file and
 | 
			
		||||
used to gain access to the underlying window, context and (on some platforms)
 | 
			
		||||
display handles used by the platform interface.
 | 
			
		||||
 | 
			
		||||
The function names of the native interface are similar to those of the public
 | 
			
		||||
interface, but embeds the name of the interface that the returned handle is
 | 
			
		||||
from.
 | 
			
		||||
 | 
			
		||||
Examples: `glfwGetX11Window`, `glfwGetWGLContext`
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section internals_internal Internal interface
 | 
			
		||||
 | 
			
		||||
The internal interface consists of utility functions used by all other
 | 
			
		||||
interfaces.  It is shared code implemented in the same shared source files as
 | 
			
		||||
the public and event interfaces.  The internal interface is described in the
 | 
			
		||||
internal.h header file.
 | 
			
		||||
 | 
			
		||||
The internal interface is in charge of GLFW's global data, which it stores in
 | 
			
		||||
a `_GLFWlibrary` struct named `_glfw`.
 | 
			
		||||
 | 
			
		||||
The internal interface uses the same style as the public interface, except all
 | 
			
		||||
global names have a leading underscore.
 | 
			
		||||
 | 
			
		||||
Examples: `_glfwIsValidContextConfig`, `_GLFWwindow`, `_glfw.monitorCount`
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section internals_platform Platform interface
 | 
			
		||||
 | 
			
		||||
The platform interface implements all platform-specific operations as a service
 | 
			
		||||
to the public interface.  This includes event processing.  The platform
 | 
			
		||||
interface is never directly called by application code and never directly calls
 | 
			
		||||
application-provided callbacks.  It is also prohibited from modifying the
 | 
			
		||||
platform-independent part of the internal structs.  Instead, it calls the event
 | 
			
		||||
interface when events interesting to GLFW are received.
 | 
			
		||||
 | 
			
		||||
The platform interface mirrors those parts of the public interface that needs to
 | 
			
		||||
perform platform-specific operations on some or all platforms.  The are also
 | 
			
		||||
named the same except that the glfw function prefix is replaced by
 | 
			
		||||
_glfwPlatform.
 | 
			
		||||
 | 
			
		||||
Examples: `_glfwPlatformCreateWindow`
 | 
			
		||||
 | 
			
		||||
The platform interface also defines structs that contain platform-specific
 | 
			
		||||
global and per-object state.  Their names mirror those of the internal
 | 
			
		||||
interface, except that an interface-specific suffix is added.
 | 
			
		||||
 | 
			
		||||
Examples: `_GLFWwindowX11`, `_GLFWcontextWGL`
 | 
			
		||||
 | 
			
		||||
These structs are incorporated as members into the internal interface structs
 | 
			
		||||
using special macros that name them after the specific interface used.  This
 | 
			
		||||
prevents shared code from accidentally using these members.
 | 
			
		||||
 | 
			
		||||
Examples: `window->win32.handle`, `_glfw.x11.display`
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@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.
 | 
			
		||||
 | 
			
		||||
The function names of the event interface use a `_glfwInput` prefix and the
 | 
			
		||||
ObjectEvent pattern.
 | 
			
		||||
 | 
			
		||||
Examples: `_glfwInputWindowFocus`, `_glfwInputCursorPos`
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section internals_static Static functions
 | 
			
		||||
 | 
			
		||||
Static functions may be used by any interface and have no prefixes or suffixes.
 | 
			
		||||
These use headless camel case.
 | 
			
		||||
 | 
			
		||||
Examples: `isValidElementForJoystick`
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@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.
 | 
			
		||||
 | 
			
		||||
Configuration macros the same style as tokens in the public interface, except
 | 
			
		||||
with a leading underscore.
 | 
			
		||||
 | 
			
		||||
Examples: `_GLFW_WIN32`, `_GLFW_BUILD_DLL`
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
							
								
								
									
										454
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/intro.dox
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										454
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/intro.dox
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,454 @@
 | 
			
		||||
/*!
 | 
			
		||||
 | 
			
		||||
@page intro_guide 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_guide instead.  For details on a specific function in
 | 
			
		||||
this category, see the @ref init.
 | 
			
		||||
 | 
			
		||||
There are also guides for the other areas of GLFW.
 | 
			
		||||
 | 
			
		||||
 - @ref window_guide
 | 
			
		||||
 - @ref context_guide
 | 
			
		||||
 - @ref vulkan_guide
 | 
			
		||||
 - @ref monitor_guide
 | 
			
		||||
 - @ref input_guide
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@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 glfwGetError
 | 
			
		||||
 - @ref glfwSetErrorCallback
 | 
			
		||||
 - @ref glfwInitHint
 | 
			
		||||
 - @ref glfwInit
 | 
			
		||||
 - @ref glfwTerminate
 | 
			
		||||
 | 
			
		||||
Calling any other function before successful initialization will cause a @ref
 | 
			
		||||
GLFW_NOT_INITIALIZED error.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection intro_init_init Initializing GLFW
 | 
			
		||||
 | 
			
		||||
The library is initialized with @ref glfwInit, which returns `GLFW_FALSE` if an
 | 
			
		||||
error occurred.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
if (!glfwInit())
 | 
			
		||||
{
 | 
			
		||||
    // Handle initialization failure
 | 
			
		||||
}
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
If any part of initialization fails, any parts that succeeded are terminated as
 | 
			
		||||
if @ref glfwTerminate had been called.  The library only needs to be initialized
 | 
			
		||||
once and additional calls to an already initialized library will return
 | 
			
		||||
`GLFW_TRUE` immediately.
 | 
			
		||||
 | 
			
		||||
Once the library has been successfully initialized, it should be terminated
 | 
			
		||||
before the application exits.  Modern systems are very good at freeing resources
 | 
			
		||||
allocated by programs that exit, but GLFW sometimes has to change global system
 | 
			
		||||
settings and these might not be restored without termination.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection init_hints Initialization hints
 | 
			
		||||
 | 
			
		||||
Initialization hints are set before @ref glfwInit and affect how the library
 | 
			
		||||
behaves until termination.  Hints are set with @ref glfwInitHint.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
glfwInitHint(GLFW_JOYSTICK_HAT_BUTTONS, GLFW_FALSE);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
The values you set hints to are never reset by GLFW, but they only take effect
 | 
			
		||||
during initialization.  Once GLFW has been initialized, any values you set will
 | 
			
		||||
be ignored until the library is terminated and initialized again.
 | 
			
		||||
 | 
			
		||||
Some hints are platform specific.  These may be set on any platform but they
 | 
			
		||||
will only affect their specific platform.  Other platforms will ignore them.
 | 
			
		||||
Setting these hints requires no platform specific headers or functions.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection init_hints_shared Shared init hints
 | 
			
		||||
 | 
			
		||||
@anchor GLFW_JOYSTICK_HAT_BUTTONS
 | 
			
		||||
__GLFW_JOYSTICK_HAT_BUTTONS__ specifies whether to also expose joystick hats as
 | 
			
		||||
buttons, for compatibility with earlier versions of GLFW that did not have @ref
 | 
			
		||||
glfwGetJoystickHats.  Set this with @ref glfwInitHint.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection init_hints_osx macOS specific init hints
 | 
			
		||||
 | 
			
		||||
@anchor GLFW_COCOA_CHDIR_RESOURCES_hint
 | 
			
		||||
__GLFW_COCOA_CHDIR_RESOURCES__ specifies whether to set the current directory to
 | 
			
		||||
the application to the `Contents/Resources` subdirectory of the application's
 | 
			
		||||
bundle, if present.  Set this with @ref glfwInitHint.
 | 
			
		||||
 | 
			
		||||
@anchor GLFW_COCOA_MENUBAR_hint
 | 
			
		||||
__GLFW_COCOA_MENUBAR__ specifies whether to create a basic menu bar, either from
 | 
			
		||||
a nib or manually, when the first window is created, which is when AppKit is
 | 
			
		||||
initialized.  Set this with @ref glfwInitHint.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection init_hints_values Supported and default values
 | 
			
		||||
 | 
			
		||||
Initialization hint             | Default value | Supported values
 | 
			
		||||
------------------------------- | ------------- | ----------------
 | 
			
		||||
@ref GLFW_JOYSTICK_HAT_BUTTONS  | `GLFW_TRUE`   | `GLFW_TRUE` or `GLFW_FALSE`
 | 
			
		||||
@ref GLFW_COCOA_CHDIR_RESOURCES | `GLFW_TRUE`   | `GLFW_TRUE` or `GLFW_FALSE`
 | 
			
		||||
@ref GLFW_COCOA_MENUBAR         | `GLFW_TRUE`   | `GLFW_TRUE` or `GLFW_FALSE`
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@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 other 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 what happened or why it occurred.
 | 
			
		||||
Other functions have no return value reserved for errors, so error notification
 | 
			
		||||
needs a separate channel.  Finally, far from all GLFW functions have return
 | 
			
		||||
values.
 | 
			
		||||
 | 
			
		||||
The last [error code](@ref errors) for the calling thread can be queried at any
 | 
			
		||||
time with @ref glfwGetError.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
int code = glfwGetError(NULL);
 | 
			
		||||
 | 
			
		||||
if (code != GLFW_NO_ERROR)
 | 
			
		||||
    handle_error(code);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
If no error has occurred since the last call, @ref GLFW_NO_ERROR (zero) is
 | 
			
		||||
returned.  The error is cleared before the function returns.
 | 
			
		||||
 | 
			
		||||
The error code indicates the general category of the error.  Some error codes,
 | 
			
		||||
such as @ref GLFW_NOT_INITIALIZED has only a single meaning, whereas others like
 | 
			
		||||
@ref GLFW_PLATFORM_ERROR are used for many different errors.
 | 
			
		||||
 | 
			
		||||
GLFW often has more information about an error than its general category.  You
 | 
			
		||||
can retrieve a UTF-8 encoded human-readable description along with the error
 | 
			
		||||
code.  If no error has occurred since the last call, the description is set to
 | 
			
		||||
`NULL`.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
const char* description;
 | 
			
		||||
int code = glfwGetError(&description);
 | 
			
		||||
 | 
			
		||||
if (description)
 | 
			
		||||
    display_error_message(code, description);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
The retrieved description string is only valid until the next error occurs.
 | 
			
		||||
This means you must make a copy of it if you want to keep it.
 | 
			
		||||
 | 
			
		||||
You can also set an error callback, which will be called each time an error
 | 
			
		||||
occurs.  It is set with @ref glfwSetErrorCallback.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
glfwSetErrorCallback(error_callback);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
The error callback receives the same error code and human-readable description
 | 
			
		||||
returned by @ref glfwGetError.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
void error_callback(int code, const char* description)
 | 
			
		||||
{
 | 
			
		||||
    display_error_message(code, description);
 | 
			
		||||
}
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
The error callback is called after the error is stored, so calling @ref
 | 
			
		||||
glfwGetError from within the error callback returns the same values as the
 | 
			
		||||
callback argument.
 | 
			
		||||
 | 
			
		||||
The description string passed to the callback is only valid until the error
 | 
			
		||||
callback returns.  This means you must make a copy of it if you want to keep it.
 | 
			
		||||
 | 
			
		||||
__Reported errors are never fatal.__  As long as GLFW was successfully
 | 
			
		||||
initialized, it will remain initialized and in a safe state until terminated
 | 
			
		||||
regardless of how many errors occur.  If an error occurs during initialization
 | 
			
		||||
that causes @ref glfwInit to fail, any part of the library that was initialized
 | 
			
		||||
will be safely terminated.
 | 
			
		||||
 | 
			
		||||
Do not rely on a currently invalid call to generate a specific error, as in the
 | 
			
		||||
future that same call may generate a different error or become valid.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section coordinate_systems Coordinate systems
 | 
			
		||||
 | 
			
		||||
GLFW has two primary coordinate systems: the _virtual screen_ and the window
 | 
			
		||||
_content area_ or _content area_.  Both use the same unit: _virtual screen
 | 
			
		||||
coordinates_, or just _screen coordinates_, which don't necessarily correspond
 | 
			
		||||
to pixels.
 | 
			
		||||
 | 
			
		||||
<img src="spaces.svg" width="90%" />
 | 
			
		||||
 | 
			
		||||
Both the virtual screen and the content area coordinate systems have the X-axis
 | 
			
		||||
pointing to the right and the Y-axis pointing down.
 | 
			
		||||
 | 
			
		||||
Window and monitor positions are specified as the position of the upper-left
 | 
			
		||||
corners of their content areas relative to the virtual screen, while cursor
 | 
			
		||||
positions are specified relative to a window's content area.
 | 
			
		||||
 | 
			
		||||
Because the origin of the window's content area coordinate system is also the
 | 
			
		||||
point from which the window position is specified, you can translate content
 | 
			
		||||
area coordinates to the virtual screen by adding the window position.  The
 | 
			
		||||
window frame, when present, extends out from the content area but does not
 | 
			
		||||
affect the window position.
 | 
			
		||||
 | 
			
		||||
Almost all positions and sizes in GLFW are measured in screen coordinates
 | 
			
		||||
relative to one of the two origins above.  This includes cursor positions,
 | 
			
		||||
window positions and sizes, window frame sizes, monitor positions and video mode
 | 
			
		||||
resolutions.
 | 
			
		||||
 | 
			
		||||
Two exceptions are the [monitor physical size](@ref monitor_size), which is
 | 
			
		||||
measured in millimetres, and [framebuffer size](@ref window_fbsize), which is
 | 
			
		||||
measured in pixels.
 | 
			
		||||
 | 
			
		||||
Pixels and screen coordinates may map 1:1 on your machine, but they won't on
 | 
			
		||||
every other machine, for example on a Mac with a Retina display.  The ratio
 | 
			
		||||
between screen coordinates and pixels may also change at run-time depending on
 | 
			
		||||
which monitor the window is currently considered to be on.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section guarantees_limitations Guarantees and limitations
 | 
			
		||||
 | 
			
		||||
This section describes the conditions under which GLFW can be expected to
 | 
			
		||||
function, barring bugs in the operating system or drivers.  Use of GLFW outside
 | 
			
		||||
of these limits may work on some platforms, or on some machines, or some of the
 | 
			
		||||
time, or on some versions of GLFW, but it may break at any time and this will
 | 
			
		||||
not be considered a bug.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@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,
 | 
			
		||||
it is copied before the function returns.
 | 
			
		||||
 | 
			
		||||
Pointer lifetimes are guaranteed not to be shortened in future minor or patch
 | 
			
		||||
releases.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection reentrancy Reentrancy
 | 
			
		||||
 | 
			
		||||
GLFW event processing and object destruction are not reentrant.  This means that
 | 
			
		||||
the following functions must not be called from any callback function:
 | 
			
		||||
 | 
			
		||||
 - @ref glfwDestroyWindow
 | 
			
		||||
 - @ref glfwDestroyCursor
 | 
			
		||||
 - @ref glfwPollEvents
 | 
			
		||||
 - @ref glfwWaitEvents
 | 
			
		||||
 - @ref glfwWaitEventsTimeout
 | 
			
		||||
 - @ref glfwTerminate
 | 
			
		||||
 | 
			
		||||
These functions may be made reentrant in future minor or patch releases, but
 | 
			
		||||
functions not on this list will not be made non-reentrant.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection thread_safety Thread safety
 | 
			
		||||
 | 
			
		||||
Most GLFW functions must only be called from the main thread (the thread that
 | 
			
		||||
calls main), but some may be called from any thread once the library has been
 | 
			
		||||
initialized.  Before initialization the whole library is thread-unsafe.
 | 
			
		||||
 | 
			
		||||
The reference documentation for every GLFW function states whether it is limited
 | 
			
		||||
to the main thread.
 | 
			
		||||
 | 
			
		||||
Initialization, termination, event processing and the creation and
 | 
			
		||||
destruction of windows, cursors and OpenGL and OpenGL ES contexts are all
 | 
			
		||||
restricted to the main thread due to limitations of one or several platforms.
 | 
			
		||||
 | 
			
		||||
Because event processing must be performed on the main thread, all callbacks
 | 
			
		||||
except for the error callback will only be called on that thread.  The error
 | 
			
		||||
callback may be called on any thread, as any GLFW function may generate errors.
 | 
			
		||||
 | 
			
		||||
The error code and description may be queried from any thread.
 | 
			
		||||
 | 
			
		||||
 - @ref glfwGetError
 | 
			
		||||
 | 
			
		||||
Empty events may be posted from any thread.
 | 
			
		||||
 | 
			
		||||
 - @ref glfwPostEmptyEvent
 | 
			
		||||
 | 
			
		||||
The window user pointer and close flag may be read and written from any thread,
 | 
			
		||||
but this is not synchronized by GLFW.
 | 
			
		||||
 | 
			
		||||
 - @ref glfwGetWindowUserPointer
 | 
			
		||||
 - @ref glfwSetWindowUserPointer
 | 
			
		||||
 - @ref glfwWindowShouldClose
 | 
			
		||||
 - @ref glfwSetWindowShouldClose
 | 
			
		||||
 | 
			
		||||
These functions for working with OpenGL and OpenGL ES contexts may be called
 | 
			
		||||
from any thread, but the window object is not synchronized by GLFW.
 | 
			
		||||
 | 
			
		||||
 - @ref glfwMakeContextCurrent
 | 
			
		||||
 - @ref glfwGetCurrentContext
 | 
			
		||||
 - @ref glfwSwapBuffers
 | 
			
		||||
 - @ref glfwSwapInterval
 | 
			
		||||
 - @ref glfwExtensionSupported
 | 
			
		||||
 - @ref glfwGetProcAddress
 | 
			
		||||
 | 
			
		||||
The raw timer functions may be called from any thread.
 | 
			
		||||
 | 
			
		||||
 - @ref glfwGetTimerFrequency
 | 
			
		||||
 - @ref glfwGetTimerValue
 | 
			
		||||
 | 
			
		||||
The regular timer may be used from any thread, but reading and writing the timer
 | 
			
		||||
offset is not synchronized by GLFW.
 | 
			
		||||
 | 
			
		||||
 - @ref glfwGetTime
 | 
			
		||||
 - @ref glfwSetTime
 | 
			
		||||
 | 
			
		||||
Library version information may be queried from any thread.
 | 
			
		||||
 | 
			
		||||
 - @ref glfwGetVersion
 | 
			
		||||
 - @ref glfwGetVersionString
 | 
			
		||||
 | 
			
		||||
All Vulkan related functions may be called from any thread.
 | 
			
		||||
 | 
			
		||||
 - @ref glfwVulkanSupported
 | 
			
		||||
 - @ref glfwGetRequiredInstanceExtensions
 | 
			
		||||
 - @ref glfwGetInstanceProcAddress
 | 
			
		||||
 - @ref glfwGetPhysicalDevicePresentationSupport
 | 
			
		||||
 - @ref glfwCreateWindowSurface
 | 
			
		||||
 | 
			
		||||
GLFW uses synchronization objects internally only to manage the per-thread
 | 
			
		||||
context and error states.  Additional synchronization is left to the
 | 
			
		||||
application.
 | 
			
		||||
 | 
			
		||||
Functions that may currently be called from any thread will always remain so,
 | 
			
		||||
but functions that are currently limited to the main thread may be updated to
 | 
			
		||||
allow calls from any thread in future releases.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection compatibility Version compatibility
 | 
			
		||||
 | 
			
		||||
GLFW uses [Semantic Versioning](https://semver.org/).  This guarantees source
 | 
			
		||||
and binary backward compatibility with earlier minor versions of the API.  This
 | 
			
		||||
means that you can drop in a newer version of the library and existing programs
 | 
			
		||||
will continue to compile and existing binaries will continue to run.
 | 
			
		||||
 | 
			
		||||
Once a function or constant has been added, the signature of that function or
 | 
			
		||||
value of that constant will remain unchanged until the next major version of
 | 
			
		||||
GLFW.  No compatibility of any kind is guaranteed between major versions.
 | 
			
		||||
 | 
			
		||||
Undocumented behavior, i.e. behavior that is not described in the documentation,
 | 
			
		||||
may change at any time until it is documented.
 | 
			
		||||
 | 
			
		||||
If the reference documentation and the implementation differ, the reference
 | 
			
		||||
documentation will almost always take precedence and the implementation will be
 | 
			
		||||
fixed in the next release.  The reference documentation will also take
 | 
			
		||||
precedence over anything stated in a guide.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@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.
 | 
			
		||||
 | 
			
		||||
__Do not use the version string__ to parse the GLFW library version.  The @ref
 | 
			
		||||
glfwGetVersion function already provides the version of the running library
 | 
			
		||||
binary.
 | 
			
		||||
 | 
			
		||||
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
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
							
								
								
									
										46
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/main.dox
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/main.dox
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,46 @@
 | 
			
		||||
/*!
 | 
			
		||||
 | 
			
		||||
@mainpage notitle
 | 
			
		||||
 | 
			
		||||
@section main_intro Introduction
 | 
			
		||||
 | 
			
		||||
GLFW is a free, Open Source, multi-platform library for OpenGL, OpenGL ES and
 | 
			
		||||
Vulkan application development.  It provides a simple, platform-independent API
 | 
			
		||||
for creating windows, contexts and surfaces, reading input, handling events, etc.
 | 
			
		||||
 | 
			
		||||
@ref news_33 list new features, caveats and deprecations.
 | 
			
		||||
 | 
			
		||||
@ref quick_guide is a guide for users new to GLFW.  It takes you through how to
 | 
			
		||||
write a small but complete program.
 | 
			
		||||
 | 
			
		||||
There are guides for each section of the API:
 | 
			
		||||
 | 
			
		||||
 - @ref intro_guide – initialization, error handling and high-level design
 | 
			
		||||
 - @ref window_guide – creating and working with windows and framebuffers
 | 
			
		||||
 - @ref context_guide – working with OpenGL and OpenGL ES contexts
 | 
			
		||||
 - @ref vulkan_guide - working with Vulkan objects and extensions
 | 
			
		||||
 - @ref monitor_guide – enumerating and working with monitors and video modes
 | 
			
		||||
 - @ref input_guide – receiving events, polling and processing input
 | 
			
		||||
 | 
			
		||||
Once you have written a program, see @ref compile_guide and @ref build_guide.
 | 
			
		||||
 | 
			
		||||
The [reference documentation](modules.html) provides more detailed information
 | 
			
		||||
about specific functions.
 | 
			
		||||
 | 
			
		||||
@ref moving_guide explains what has changed and how to update existing code to
 | 
			
		||||
use the new API.
 | 
			
		||||
 | 
			
		||||
There is a section on @ref guarantees_limitations for pointer lifetimes,
 | 
			
		||||
reentrancy, thread safety, event order and backward and forward compatibility.
 | 
			
		||||
 | 
			
		||||
The [FAQ](https://www.glfw.org/faq.html) answers many common questions about the
 | 
			
		||||
design, implementation and use of GLFW.
 | 
			
		||||
 | 
			
		||||
Finally, @ref compat_guide explains what APIs, standards and protocols GLFW uses
 | 
			
		||||
and what happens when they are not present on a given machine.
 | 
			
		||||
 | 
			
		||||
This documentation was generated with Doxygen.  The sources for it are available
 | 
			
		||||
in both the [source distribution](https://www.glfw.org/download.html) and
 | 
			
		||||
[GitHub repository](https://github.com/glfw/glfw).
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
							
								
								
									
										268
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/monitor.dox
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										268
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/monitor.dox
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,268 @@
 | 
			
		||||
/*!
 | 
			
		||||
 | 
			
		||||
@page monitor_guide Monitor guide
 | 
			
		||||
 | 
			
		||||
@tableofcontents
 | 
			
		||||
 | 
			
		||||
This guide introduces the monitor related functions of GLFW.  For details on
 | 
			
		||||
a specific function in this category, see the @ref monitor.  There are also
 | 
			
		||||
guides for the other areas of GLFW.
 | 
			
		||||
 | 
			
		||||
 - @ref intro_guide
 | 
			
		||||
 - @ref window_guide
 | 
			
		||||
 - @ref context_guide
 | 
			
		||||
 - @ref vulkan_guide
 | 
			
		||||
 - @ref input_guide
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section monitor_object 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.
 | 
			
		||||
 | 
			
		||||
To see how GLFW views your monitor setup and its available video modes, run the
 | 
			
		||||
`monitors` test program.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection 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
 | 
			
		||||
or menu bar.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@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 the event that occurred.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
void monitor_callback(GLFWmonitor* monitor, int event)
 | 
			
		||||
{
 | 
			
		||||
    if (event == GLFW_CONNECTED)
 | 
			
		||||
    {
 | 
			
		||||
        // The monitor was connected
 | 
			
		||||
    }
 | 
			
		||||
    else if (event == GLFW_DISCONNECTED)
 | 
			
		||||
    {
 | 
			
		||||
        // The monitor was disconnected
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
If a monitor is disconnected, all windows that are full screen on it will be
 | 
			
		||||
switched to windowed mode before the callback is called.  Only @ref
 | 
			
		||||
glfwGetMonitorName and @ref glfwGetMonitorUserPointer will return useful values
 | 
			
		||||
for a disconnected monitor and only before the monitor callback returns.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@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, a user pointer, 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, change its video mode or make a windowed one full
 | 
			
		||||
screen, but it is sometimes useful to know exactly which video modes are
 | 
			
		||||
supported.
 | 
			
		||||
 | 
			
		||||
Video modes are represented as @ref GLFWvidmode structures.  You can get an
 | 
			
		||||
array of the video modes supported by a monitor with @ref glfwGetVideoModes.
 | 
			
		||||
See the reference documentation for the lifetime of the returned array.
 | 
			
		||||
 | 
			
		||||
@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.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
const GLFWvidmode* mode = glfwGetVideoMode(monitor);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
The resolution of a video mode is specified in
 | 
			
		||||
[screen coordinates](@ref coordinate_systems), not pixels.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@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).
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
int width_mm, height_mm;
 | 
			
		||||
glfwGetMonitorPhysicalSize(monitor, &width_mm, &height_mm);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
While this can be used to calculate the raw DPI of a monitor, this is often not
 | 
			
		||||
useful.  Instead use the [monitor content scale](@ref monitor_scale) and
 | 
			
		||||
[window content scale](@ref window_scale) to scale your content.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection monitor_scale Content scale
 | 
			
		||||
 | 
			
		||||
The content scale for a monitor can be retrieved with @ref
 | 
			
		||||
glfwGetMonitorContentScale.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
float xscale, yscale;
 | 
			
		||||
glfwGetMonitorContentScale(monitor, &xscale, &yscale);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
The content scale is the ratio between the current DPI and the platform's
 | 
			
		||||
default DPI.  This is especially important for text and any UI elements.  If the
 | 
			
		||||
pixel dimensions of your UI scaled by this look appropriate on your machine then
 | 
			
		||||
it should appear at a reasonable size on other machines regardless of their DPI
 | 
			
		||||
and scaling settings.  This relies on the system DPI and scaling settings being
 | 
			
		||||
somewhat correct.
 | 
			
		||||
 | 
			
		||||
The content scale may depend on both the monitor resolution and pixel density
 | 
			
		||||
and on user settings.  It may be very different from the raw DPI calculated from
 | 
			
		||||
the physical size and current resolution.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection monitor_pos Virtual position
 | 
			
		||||
 | 
			
		||||
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_workarea Work area
 | 
			
		||||
 | 
			
		||||
The area of a monitor not occupied by global task bars or menu bars is the work
 | 
			
		||||
area.  This is specified in [screen coordinates](@ref coordinate_systems) and
 | 
			
		||||
can be retrieved with @ref glfwGetMonitorWorkarea.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
int xpos, ypos, width, height;
 | 
			
		||||
glfwGetMonitorWorkarea(monitor, &xpos, &ypos, &width, &height);
 | 
			
		||||
@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.
 | 
			
		||||
 | 
			
		||||
@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.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection monitor_userptr User pointer
 | 
			
		||||
 | 
			
		||||
Each monitor has a user pointer that can be set with @ref
 | 
			
		||||
glfwSetMonitorUserPointer and queried with @ref glfwGetMonitorUserPointer.  This
 | 
			
		||||
can be used for any purpose you need and will not be modified by GLFW.  The
 | 
			
		||||
value will be kept until the monitor is disconnected or until the library is
 | 
			
		||||
terminated.
 | 
			
		||||
 | 
			
		||||
The initial value of the pointer is `NULL`.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection monitor_gamma 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.
 | 
			
		||||
 | 
			
		||||
It is recommended that your gamma ramp have the same size as the current gamma
 | 
			
		||||
ramp for that monitor.
 | 
			
		||||
 | 
			
		||||
The current gamma ramp for a monitor is returned by @ref glfwGetGammaRamp.  See
 | 
			
		||||
the reference documentation for the lifetime of the returned structure.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
const GLFWgammaramp* ramp = glfwGetGammaRamp(monitor);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
If you wish to set a regular gamma ramp, you can have GLFW calculate it for you
 | 
			
		||||
from the desired exponent with @ref glfwSetGamma, which in turn calls @ref
 | 
			
		||||
glfwSetGammaRamp with the resulting ramp.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
glfwSetGamma(monitor, 1.0);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
To experiment with gamma correction via the @ref glfwSetGamma function, run the
 | 
			
		||||
`gamma` test program.
 | 
			
		||||
 | 
			
		||||
@note The software controlled gamma ramp is applied _in addition_ to the
 | 
			
		||||
hardware gamma correction, which today is usually an approximation of sRGB
 | 
			
		||||
gamma.  This means that setting a perfectly linear ramp, or gamma 1.0, will
 | 
			
		||||
produce the default (usually sRGB-like) behavior.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
							
								
								
									
										513
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/moving.dox
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										513
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/moving.dox
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,513 @@
 | 
			
		||||
/*!
 | 
			
		||||
 | 
			
		||||
@page moving_guide Moving from GLFW 2 to 3
 | 
			
		||||
 | 
			
		||||
@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
 | 
			
		||||
[new features](@ref news) unless they are required when moving an existing code
 | 
			
		||||
base onto the new API.  For example, the new multi-monitor functions are
 | 
			
		||||
required to create full screen windows with GLFW 3.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section moving_removed Changed and removed features
 | 
			
		||||
 | 
			
		||||
@subsection moving_renamed_files Renamed 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`.
 | 
			
		||||
 | 
			
		||||
@par Old syntax
 | 
			
		||||
@code
 | 
			
		||||
#include <GL/glfw.h>
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
@par New syntax
 | 
			
		||||
@code
 | 
			
		||||
#include <GLFW/glfw3.h>
 | 
			
		||||
@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](https://en.cppreference.com/w/cpp/thread) and
 | 
			
		||||
[C11](https://en.cppreference.com/w/c/thread), 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
 | 
			
		||||
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 must 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`.
 | 
			
		||||
 | 
			
		||||
@par Removed types
 | 
			
		||||
`GLFWthreadfun`
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection moving_image Removal of 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
 | 
			
		||||
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`.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection moving_stdcall Removal of GLFWCALL macro
 | 
			
		||||
 | 
			
		||||
The `GLFWCALL` macro, which made callback functions use
 | 
			
		||||
[__stdcall](https://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_guide).  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 in @ref glfwSwapBuffers, meaning
 | 
			
		||||
you need to call @ref glfwPollEvents or @ref glfwWaitEvents yourself.  Unlike
 | 
			
		||||
buffer swap, which acts on a single window, the event processing functions act
 | 
			
		||||
on all windows at once.
 | 
			
		||||
 | 
			
		||||
@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
 | 
			
		||||
`GLFW_TRUE` when the user attempts to close that window.  By default, nothing else
 | 
			
		||||
happens and the window stays visible.  It is then up to you to either destroy
 | 
			
		||||
the window, take some other action or ignore the request.
 | 
			
		||||
 | 
			
		||||
You can query the close flag at any time with @ref glfwWindowShouldClose and set
 | 
			
		||||
it at any time with @ref glfwSetWindowShouldClose.
 | 
			
		||||
 | 
			
		||||
@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 `GLFW_FALSE`, meaning you can use it
 | 
			
		||||
for other reasons to close the window as well, for example the user choosing
 | 
			
		||||
Quit from an in-game menu.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@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
 | 
			
		||||
 | 
			
		||||
The action parameter of the [character callback](@ref GLFWcharfun) has been
 | 
			
		||||
removed.  This was an artefact of the origin of GLFW, i.e. being developed in
 | 
			
		||||
English by a Swede.  However, many keyboard layouts require more than one key to
 | 
			
		||||
produce characters with diacritical marks. Even the Swedish keyboard layout
 | 
			
		||||
requires this for uncommon cases like ü.
 | 
			
		||||
 | 
			
		||||
@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
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection moving_cursorpos Cursor position changes
 | 
			
		||||
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection moving_wheel Wheel position replaced by scroll offsets
 | 
			
		||||
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection moving_mbcs Win32 MBCS support
 | 
			
		||||
 | 
			
		||||
The Win32 port of GLFW 3 will not compile in
 | 
			
		||||
[MBCS mode](https://msdn.microsoft.com/en-us/library/5z097dxa.aspx).
 | 
			
		||||
However, because the use of the Unicode version of the Win32 API doesn't affect
 | 
			
		||||
the process as a whole, but only those windows created using it, it's perfectly
 | 
			
		||||
possible to call MBCS functions from other parts of the same application.
 | 
			
		||||
Therefore, even if an application using GLFW has MBCS mode code, there's no need
 | 
			
		||||
for GLFW itself to support it.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection moving_windows Support for versions of Windows older than XP
 | 
			
		||||
 | 
			
		||||
All explicit support for version of Windows older than XP has been removed.
 | 
			
		||||
There is no code that actively prevents GLFW 3 from running on these earlier
 | 
			
		||||
versions, but it uses Win32 functions that those versions lack.
 | 
			
		||||
 | 
			
		||||
Windows XP was released in 2001, and by now (January 2015) it has not only
 | 
			
		||||
replaced almost all earlier versions of Windows, but is itself rapidly being
 | 
			
		||||
replaced by Windows 7 and 8.  The MSDN library doesn't even provide
 | 
			
		||||
documentation for version older than Windows 2000, making it difficult to
 | 
			
		||||
maintain compatibility with these versions even if it was deemed worth the
 | 
			
		||||
effort.
 | 
			
		||||
 | 
			
		||||
The Win32 API has also not stood still, and GLFW 3 uses many functions only
 | 
			
		||||
present on Windows XP or later.  Even supporting an OS as new as XP (new
 | 
			
		||||
from the perspective of GLFW 2, which still supports Windows 95) requires
 | 
			
		||||
runtime checking for a number of functions that are present only on modern
 | 
			
		||||
version of Windows.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection moving_syskeys Capture of system-wide hotkeys
 | 
			
		||||
 | 
			
		||||
The ability to disable and capture system-wide hotkeys like Alt+Tab has been
 | 
			
		||||
removed.  Modern applications, whether they're games, scientific visualisations
 | 
			
		||||
or something else, are nowadays expected to be good desktop citizens and allow
 | 
			
		||||
these hotkeys to function even when running in full screen mode.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@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 must only be
 | 
			
		||||
called from the main thread.
 | 
			
		||||
 | 
			
		||||
To release all resources allocated by GLFW, you should call @ref glfwTerminate
 | 
			
		||||
yourself, from the main thread, before the program terminates.  Note that this
 | 
			
		||||
destroys all windows not already destroyed with @ref glfwDestroyWindow,
 | 
			
		||||
invalidating any window handles you may still have.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@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 not use GLU__, but if you need it for legacy code that
 | 
			
		||||
has been moved to GLFW 3, you can request that the GLFW header includes it by
 | 
			
		||||
defining @ref GLFW_INCLUDE_GLU before the inclusion of the GLFW header.
 | 
			
		||||
 | 
			
		||||
@par Old syntax
 | 
			
		||||
@code
 | 
			
		||||
#include <GL/glfw.h>
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
@par New syntax
 | 
			
		||||
@code
 | 
			
		||||
#define GLFW_INCLUDE_GLU
 | 
			
		||||
#include <GLFW/glfw3.h>
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
There are many libraries that offer replacements for the functionality offered
 | 
			
		||||
by GLU.  For the matrix helper functions, see math libraries like
 | 
			
		||||
[GLM](https://github.com/g-truc/glm) (for C++),
 | 
			
		||||
[linmath.h](https://github.com/datenwolf/linmath.h) (for C) and others.  For the
 | 
			
		||||
tessellation functions, see for example
 | 
			
		||||
[libtess2](https://github.com/memononen/libtess2).
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section moving_tables Name change tables
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection moving_renamed_functions Renamed functions
 | 
			
		||||
 | 
			
		||||
| GLFW 2                      | GLFW 3                        | Notes |
 | 
			
		||||
| --------------------------- | ----------------------------- | ----- |
 | 
			
		||||
| `glfwOpenWindow`            | @ref glfwCreateWindow         | All channel bit depths are now hints
 | 
			
		||||
| `glfwCloseWindow`           | @ref glfwDestroyWindow        |       |
 | 
			
		||||
| `glfwOpenWindowHint`        | @ref glfwWindowHint           | Now accepts all `GLFW_*_BITS` tokens |
 | 
			
		||||
| `glfwEnable`                | @ref glfwSetInputMode         |       |
 | 
			
		||||
| `glfwDisable`               | @ref glfwSetInputMode         |       |
 | 
			
		||||
| `glfwGetMousePos`           | @ref glfwGetCursorPos         |       |
 | 
			
		||||
| `glfwSetMousePos`           | @ref glfwSetCursorPos         |       |
 | 
			
		||||
| `glfwSetMousePosCallback`   | @ref glfwSetCursorPosCallback |       |
 | 
			
		||||
| `glfwSetMouseWheelCallback` | @ref glfwSetScrollCallback    | Accepts two-dimensional scroll offsets as doubles |
 | 
			
		||||
| `glfwGetJoystickPos`        | @ref glfwGetJoystickAxes      |       |
 | 
			
		||||
| `glfwGetWindowParam`        | @ref glfwGetWindowAttrib      |       |
 | 
			
		||||
| `glfwGetGLVersion`          | @ref glfwGetWindowAttrib      | Use `GLFW_CONTEXT_VERSION_MAJOR`, `GLFW_CONTEXT_VERSION_MINOR` and `GLFW_CONTEXT_REVISION` |
 | 
			
		||||
| `glfwGetDesktopMode`        | @ref glfwGetVideoMode         | Returns the current mode of a monitor |
 | 
			
		||||
| `glfwGetJoystickParam`      | @ref glfwJoystickPresent      | The axis and button counts are provided by @ref glfwGetJoystickAxes and @ref glfwGetJoystickButtons |
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection moving_renamed_types Renamed types
 | 
			
		||||
 | 
			
		||||
| GLFW 2              | GLFW 3                | Notes |
 | 
			
		||||
| ------------------- | --------------------- |       |
 | 
			
		||||
| `GLFWmousewheelfun` | @ref GLFWscrollfun    |       |
 | 
			
		||||
| `GLFWmouseposfun`   | @ref GLFWcursorposfun |       |
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection moving_renamed_tokens Renamed tokens
 | 
			
		||||
 | 
			
		||||
| GLFW 2                      | GLFW 3                       | Notes |
 | 
			
		||||
| --------------------------- | ---------------------------- | ----- |
 | 
			
		||||
| `GLFW_OPENGL_VERSION_MAJOR` | `GLFW_CONTEXT_VERSION_MAJOR` | Renamed as it applies to OpenGL ES as well |
 | 
			
		||||
| `GLFW_OPENGL_VERSION_MINOR` | `GLFW_CONTEXT_VERSION_MINOR` | Renamed as it applies to OpenGL ES as well |
 | 
			
		||||
| `GLFW_FSAA_SAMPLES`         | `GLFW_SAMPLES`               | Renamed to match the OpenGL API |
 | 
			
		||||
| `GLFW_ACTIVE`               | `GLFW_FOCUSED`               | Renamed to match the window focus callback |
 | 
			
		||||
| `GLFW_WINDOW_NO_RESIZE`     | `GLFW_RESIZABLE`             | The default has been inverted |
 | 
			
		||||
| `GLFW_MOUSE_CURSOR`         | `GLFW_CURSOR`                | Used with @ref glfwSetInputMode |
 | 
			
		||||
| `GLFW_KEY_ESC`              | `GLFW_KEY_ESCAPE`            |       |
 | 
			
		||||
| `GLFW_KEY_DEL`              | `GLFW_KEY_DELETE`            |       |
 | 
			
		||||
| `GLFW_KEY_PAGEUP`           | `GLFW_KEY_PAGE_UP`           |       |
 | 
			
		||||
| `GLFW_KEY_PAGEDOWN`         | `GLFW_KEY_PAGE_DOWN`         |       |
 | 
			
		||||
| `GLFW_KEY_KP_NUM_LOCK`      | `GLFW_KEY_NUM_LOCK`          |       |
 | 
			
		||||
| `GLFW_KEY_LCTRL`            | `GLFW_KEY_LEFT_CONTROL`      |       |
 | 
			
		||||
| `GLFW_KEY_LSHIFT`           | `GLFW_KEY_LEFT_SHIFT`        |       |
 | 
			
		||||
| `GLFW_KEY_LALT`             | `GLFW_KEY_LEFT_ALT`          |       |
 | 
			
		||||
| `GLFW_KEY_LSUPER`           | `GLFW_KEY_LEFT_SUPER`        |       |
 | 
			
		||||
| `GLFW_KEY_RCTRL`            | `GLFW_KEY_RIGHT_CONTROL`     |       |
 | 
			
		||||
| `GLFW_KEY_RSHIFT`           | `GLFW_KEY_RIGHT_SHIFT`       |       |
 | 
			
		||||
| `GLFW_KEY_RALT`             | `GLFW_KEY_RIGHT_ALT`         |       |
 | 
			
		||||
| `GLFW_KEY_RSUPER`           | `GLFW_KEY_RIGHT_SUPER`       |       |
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
							
								
								
									
										856
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/news.dox
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										856
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/news.dox
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,856 @@
 | 
			
		||||
/*!
 | 
			
		||||
 | 
			
		||||
@page news Release notes
 | 
			
		||||
 | 
			
		||||
@tableofcontents
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section news_33 Release notes for version 3.3
 | 
			
		||||
 | 
			
		||||
These are the release notes for version 3.3.  For a more detailed view including
 | 
			
		||||
all fixed bugs see the [version history](https://www.glfw.org/changelog.html).
 | 
			
		||||
 | 
			
		||||
Please review the caveats, deprecations and removals if your project was written
 | 
			
		||||
against an earlier version of GLFW 3.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection features_33 New features in version 3.3
 | 
			
		||||
 | 
			
		||||
@subsubsection gamepad_33 Gamepad input via SDL_GameControllerDB
 | 
			
		||||
 | 
			
		||||
GLFW can now remap game controllers to a standard Xbox-like layout using
 | 
			
		||||
a built-in copy of SDL_GameControllerDB.  Call @ref glfwJoystickIsGamepad to
 | 
			
		||||
check if a joystick has a mapping, @ref glfwGetGamepadState to retrieve its
 | 
			
		||||
input state, @ref glfwUpdateGamepadMappings to add newer mappings and @ref
 | 
			
		||||
glfwGetGamepadName and @ref glfwGetJoystickGUID for mapping related information.
 | 
			
		||||
 | 
			
		||||
For more information see @ref gamepad.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection moltenvk_33 Support for Vulkan on macOS via MoltenVK
 | 
			
		||||
 | 
			
		||||
GLFW now supports [MoltenVK](https://moltengl.com/moltenvk/), a Vulkan
 | 
			
		||||
implementation on top of the Metal API, and its `VK_MVK_macos_surface` window
 | 
			
		||||
surface creation extension.  MoltenVK is included in the [macOS Vulkan
 | 
			
		||||
SDK](https://vulkan.lunarg.com/).
 | 
			
		||||
 | 
			
		||||
For more information see @ref vulkan_guide.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection content_scale_33 Content scale queries for DPI-aware rendering
 | 
			
		||||
 | 
			
		||||
GLFW now provides content scales for windows and monitors, i.e. the ratio
 | 
			
		||||
between their current DPI and the platform's default DPI, with @ref
 | 
			
		||||
glfwGetWindowContentScale and @ref glfwGetMonitorContentScale.
 | 
			
		||||
 | 
			
		||||
Changes of the content scale of a window can be received with the window content
 | 
			
		||||
scale callback, set with @ref glfwSetWindowContentScaleCallback.
 | 
			
		||||
 | 
			
		||||
The @ref GLFW_SCALE_TO_MONITOR window hint enables automatic resizing of a
 | 
			
		||||
window by the content scale of the monitor it is placed, on platforms like
 | 
			
		||||
Windows where this is necessary.  This takes effect both on creation and when
 | 
			
		||||
the window is moved between monitors.  It is related to but different from
 | 
			
		||||
[GLFW_COCOA_RETINA_FRAMEBUFFER](@ref GLFW_COCOA_RETINA_FRAMEBUFFER_hint).
 | 
			
		||||
 | 
			
		||||
For more information see @ref window_scale.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection setwindowattrib_33 Support for updating window attributes
 | 
			
		||||
 | 
			
		||||
GLFW now supports changing the [GLFW_DECORATED](@ref GLFW_DECORATED_attrib),
 | 
			
		||||
[GLFW_RESIZABLE](@ref GLFW_RESIZABLE_attrib),
 | 
			
		||||
[GLFW_FLOATING](@ref GLFW_FLOATING_attrib),
 | 
			
		||||
[GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_attrib) and
 | 
			
		||||
[GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_attrib) attributes for existing
 | 
			
		||||
windows with @ref glfwSetWindowAttrib.
 | 
			
		||||
 | 
			
		||||
For more information see @ref window_attribs.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection raw_motion_33 Support for raw mouse motion
 | 
			
		||||
 | 
			
		||||
GLFW now supports raw (unscaled and unaccelerated) mouse motion in disabled
 | 
			
		||||
cursor mode with the [GLFW_RAW_MOUSE_MOTION](@ref GLFW_RAW_MOUSE_MOTION) input
 | 
			
		||||
mode.  Raw mouse motion input is not yet implemented on macOS.  Call @ref
 | 
			
		||||
glfwRawMouseMotionSupported to check if GLFW can provide raw mouse motion on the
 | 
			
		||||
current system.
 | 
			
		||||
 | 
			
		||||
For more information see @ref raw_mouse_motion.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection joysticks_33 Joystick hats
 | 
			
		||||
 | 
			
		||||
GLFW can now return the state of hats (i.e. POVs or D-pads) of a joystick with
 | 
			
		||||
@ref glfwGetJoystickHats.  For compatibility, hats are also exposed as buttons.
 | 
			
		||||
This can be disabled with the @ref GLFW_JOYSTICK_HAT_BUTTONS initialization
 | 
			
		||||
hint.
 | 
			
		||||
 | 
			
		||||
For more information see @ref joystick_hat.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection geterror_33 Error query
 | 
			
		||||
 | 
			
		||||
GLFW now supports querying the last error code for the calling thread and its
 | 
			
		||||
human-readable description with @ref glfwGetError.  This can be used instead of
 | 
			
		||||
or together with the error callback.
 | 
			
		||||
 | 
			
		||||
For more information see @ref error_handling.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection init_hints_33 Support for initialization hints
 | 
			
		||||
 | 
			
		||||
GLFW now supports setting library initialization hints with @ref glfwInitHint.
 | 
			
		||||
These must be set before initialization to take effect.  Some of these hints are
 | 
			
		||||
platform specific but are safe to set on any platform.
 | 
			
		||||
 | 
			
		||||
For more information see @ref init_hints.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection attention_33 User attention request
 | 
			
		||||
 | 
			
		||||
GLFW now supports requesting user attention with @ref
 | 
			
		||||
glfwRequestWindowAttention.  Where possible this calls attention to the
 | 
			
		||||
specified window.  On platforms like macOS it calls attention to the whole
 | 
			
		||||
application.
 | 
			
		||||
 | 
			
		||||
For more information see @ref window_attention.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection maximize_33 Window maximization callback
 | 
			
		||||
 | 
			
		||||
GLFW now supports notifying the application that the window has been maximized
 | 
			
		||||
@ref glfwSetWindowMaximizeCallback.  This is called both when the window was
 | 
			
		||||
maximized by the user and when it was done with @ref glfwMaximizeWindow.
 | 
			
		||||
 | 
			
		||||
For more information see @ref window_maximize.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection workarea_33 Query for the monitor work area
 | 
			
		||||
 | 
			
		||||
GLFW now supports querying the work area of a monitor, i.e. the area not
 | 
			
		||||
occupied by task bars or global menu bars, with @ref glfwGetMonitorWorkarea.  On
 | 
			
		||||
platforms that lack this concept, the whole area of the monitor is returned.
 | 
			
		||||
 | 
			
		||||
For more information see @ref monitor_workarea.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection transparency_33 Transparent windows and framebuffers
 | 
			
		||||
 | 
			
		||||
GLFW now supports the creation of windows with transparent framebuffers on
 | 
			
		||||
systems with desktop compositing enabled with the @ref
 | 
			
		||||
GLFW_TRANSPARENT_FRAMEBUFFER window hint and attribute.  This hint must be set
 | 
			
		||||
before window creation and leaves any window decorations opaque.
 | 
			
		||||
 | 
			
		||||
GLFW now also supports whole window transparency with @ref glfwGetWindowOpacity
 | 
			
		||||
and @ref glfwSetWindowOpacity.  This value controls the opacity of the whole
 | 
			
		||||
window including decorations and unlike framebuffer transparency can be changed
 | 
			
		||||
at any time after window creation.
 | 
			
		||||
 | 
			
		||||
For more information see @ref window_transparency.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection key_scancode_33 Query for the scancode of a key
 | 
			
		||||
 | 
			
		||||
GLFW now supports querying the platform dependent scancode of any physical key
 | 
			
		||||
with @ref glfwGetKeyScancode.
 | 
			
		||||
 | 
			
		||||
For more information see @ref input_key.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection center_cursor_33 Cursor centering window hint
 | 
			
		||||
 | 
			
		||||
GLFW now supports controlling whether the cursor is centered over newly created
 | 
			
		||||
full screen windows with the [GLFW_CENTER_CURSOR](@ref GLFW_CENTER_CURSOR_hint)
 | 
			
		||||
window hint.  It is enabled by default.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection cursor_hover_33 Mouse cursor hover window attribute
 | 
			
		||||
 | 
			
		||||
GLFW now supports polling whether the cursor is hovering over the window content
 | 
			
		||||
area with the [GLFW_HOVERED](@ref GLFW_HOVERED_attrib) window attribute.  This
 | 
			
		||||
attribute corresponds to the [cursor enter/leave](@ref cursor_enter) event.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection focusonshow_33 Window hint and attribute for input focus on show
 | 
			
		||||
 | 
			
		||||
GLFW now has the [GLFW_FOCUS_ON_SHOW](@ref GLFW_DECORATED_hint) window hint and
 | 
			
		||||
attribute for controlling whether a window gets input focus when shown.  It is
 | 
			
		||||
enabled by default.  It applies both when creating an visible window with @ref
 | 
			
		||||
glfwCreateWindow and when showing it with @ref glfwShowWindow.
 | 
			
		||||
 | 
			
		||||
This is a workaround for GLFW 3.0 lacking @ref glfwFocusWindow and will be
 | 
			
		||||
corrected in the next major version.
 | 
			
		||||
 | 
			
		||||
For more information see @ref window_hide.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection device_userptr_33 Monitor and joystick user pointers
 | 
			
		||||
 | 
			
		||||
GLFW now supports setting and querying user pointers for connected monitors and
 | 
			
		||||
joysticks with @ref glfwSetMonitorUserPointer, @ref glfwGetMonitorUserPointer,
 | 
			
		||||
@ref glfwSetJoystickUserPointer and @ref glfwGetJoystickUserPointer.
 | 
			
		||||
 | 
			
		||||
For more information see @ref monitor_userptr and @ref joystick_userptr.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection macos_nib_33 macOS menu bar from nib file
 | 
			
		||||
 | 
			
		||||
GLFW will now load a `MainMenu.nib` file if found in the `Contents/Resources`
 | 
			
		||||
directory of the application bundle, as a way to replace the GLFW menu bar
 | 
			
		||||
without recompiling GLFW.  This behavior can be disabled with the
 | 
			
		||||
[GLFW_COCOA_MENUBAR](@ref GLFW_COCOA_MENUBAR_hint) initialization hint.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection glext_33 Support for more context creation extensions
 | 
			
		||||
 | 
			
		||||
The context hint @ref GLFW_SRGB_CAPABLE now supports OpenGL ES via
 | 
			
		||||
`WGL_EXT_colorspace`, the context hint @ref GLFW_CONTEXT_NO_ERROR now supports
 | 
			
		||||
`WGL_ARB_create_context_no_error` and `GLX_ARB_create_context_no_error`, the
 | 
			
		||||
context hint @ref GLFW_CONTEXT_RELEASE_BEHAVIOR now supports
 | 
			
		||||
`EGL_KHR_context_flush_control` and @ref glfwGetProcAddress now supports
 | 
			
		||||
`EGL_KHR_get_all_proc_addresses`.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection osmesa_33 OSMesa off-screen context creation support
 | 
			
		||||
 | 
			
		||||
GLFW now supports creating off-screen OpenGL contexts using
 | 
			
		||||
[OSMesa](https://www.mesa3d.org/osmesa.html) by setting
 | 
			
		||||
[GLFW_CONTEXT_CREATION_API](@ref GLFW_CONTEXT_CREATION_API_hint) to
 | 
			
		||||
`GLFW_OSMESA_CONTEXT_API`.  Native access function have been added to retrieve
 | 
			
		||||
the OSMesa color and depth buffers.
 | 
			
		||||
 | 
			
		||||
There is also a new null backend that uses OSMesa as its native context
 | 
			
		||||
creation API, intended for automated testing.  This backend does not provide
 | 
			
		||||
input.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection caveats_33 Caveats for version 3.3
 | 
			
		||||
 | 
			
		||||
@subsubsection joystick_layout_33 Layout of joysticks have changed
 | 
			
		||||
 | 
			
		||||
The way joystick elements are arranged have changed to match SDL2 in order to
 | 
			
		||||
support SDL_GameControllerDB mappings.  The layout of joysticks may
 | 
			
		||||
change again if required for compatibility with SDL2.  If you need a known and
 | 
			
		||||
stable layout for game controllers, see if you can switch to @ref gamepad.
 | 
			
		||||
 | 
			
		||||
Existing code that depends on a specific joystick layout will likely have to be
 | 
			
		||||
updated.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection wait_events_33 No window required to wait for events
 | 
			
		||||
 | 
			
		||||
The @ref glfwWaitEvents and @ref glfwWaitEventsTimeout functions no longer need
 | 
			
		||||
a window to be created to wait for events.  Before version 3.3 these functions
 | 
			
		||||
would return immediately if there were no user-created windows.  On platforms
 | 
			
		||||
where only windows can receive events, an internal helper window is used.
 | 
			
		||||
 | 
			
		||||
Existing code that depends on the earlier behavior will likely have to be
 | 
			
		||||
updated.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection gamma_ramp_size_33 Gamma ramp size of 256 may be rejected
 | 
			
		||||
 | 
			
		||||
The documentation for versions before 3.3 stated that a gamma ramp size of 256
 | 
			
		||||
would always be accepted.  This was never the case on X11 and could lead to
 | 
			
		||||
artifacts on macOS.  The @ref glfwSetGamma function has been updated to always
 | 
			
		||||
generate a ramp of the correct size.
 | 
			
		||||
 | 
			
		||||
Existing code that hardcodes a size of 256 should be updated to use the size of
 | 
			
		||||
the current ramp of a monitor when setting a new ramp for that monitor.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection xinput_deadzone_33 Windows XInput deadzone removed
 | 
			
		||||
 | 
			
		||||
GLFW no longer applies any deadzone to the input state received from the XInput
 | 
			
		||||
API.  This was never done for any other platform joystick API so this change
 | 
			
		||||
makes the behavior more consistent but you will need to apply your own deadzone
 | 
			
		||||
if desired.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection x11_clipboard_33 X11 clipboard transfer limits
 | 
			
		||||
 | 
			
		||||
GLFW now supports reading clipboard text via the `INCR` method, which removes
 | 
			
		||||
the limit on how much text can be read with @ref glfwGetClipboardString.
 | 
			
		||||
However, writing via this method is not yet supported, so you may not be able to
 | 
			
		||||
write a very large string with @ref glfwSetClipboardString even if you read it
 | 
			
		||||
from the clipboard earlier.
 | 
			
		||||
 | 
			
		||||
The exact size limit for writing to the clipboard is negotiated with each
 | 
			
		||||
receiving application but is at least several tens of kilobytes.  Note that only
 | 
			
		||||
the read limit has changed.  Any string that could be written before still can
 | 
			
		||||
be.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection x11_linking_33 X11 extension libraries are loaded dynamically
 | 
			
		||||
 | 
			
		||||
GLFW now loads all X11 extension libraries at initialization.  The only X11
 | 
			
		||||
library you need to link against is `libX11`.  The header files for the
 | 
			
		||||
extension libraries are still required for compilation.
 | 
			
		||||
 | 
			
		||||
Existing projects and makefiles that link GLFW directly against the extension
 | 
			
		||||
libraries should still build correctly but will add these libraries as load-time
 | 
			
		||||
dependencies.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection cmake_version_33 CMake 3.0 or later is required
 | 
			
		||||
 | 
			
		||||
The minimum CMake version has been raised from 2.8.12 to 3.0.  This is only
 | 
			
		||||
a requirement of the GLFW CMake files.  The GLFW source files do not depend on
 | 
			
		||||
CMake.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection deprecations_33 Deprecations in version 3.3
 | 
			
		||||
 | 
			
		||||
@subsubsection charmods_callback_33 Character with modifiers callback
 | 
			
		||||
 | 
			
		||||
The character with modifiers callback set with @ref glfwSetCharModsCallback has
 | 
			
		||||
been deprecated and should if possible not be used.
 | 
			
		||||
 | 
			
		||||
Existing code should still work but further bug fixes will likely not be made.
 | 
			
		||||
The callback will be removed in the next major version.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection clipboard_window_33 Window parameter to clipboard functions
 | 
			
		||||
 | 
			
		||||
The window parameter of the clipboard functions @ref glfwGetClipboardString and
 | 
			
		||||
@ref glfwSetClipboardString has been deprecated and is no longer used on any
 | 
			
		||||
platform.  On platforms where the clipboard must be owned by a specific window,
 | 
			
		||||
an internal helper window is used.
 | 
			
		||||
 | 
			
		||||
Existing code should still work unless it depends on a specific window owning
 | 
			
		||||
the clipboard.  New code may pass `NULL` as the window argument.  The parameter
 | 
			
		||||
will be removed in a future release.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection removals_33 Removals in 3.3
 | 
			
		||||
 | 
			
		||||
@subsubsection macos_options_33 macOS specific CMake options and macros
 | 
			
		||||
 | 
			
		||||
The `GLFW_USE_RETINA`, `GLFW_USE_CHDIR` and `GLFW_USE_MENUBAR` CMake options and
 | 
			
		||||
the `_GLFW_USE_RETINA`, `_GLFW_USE_CHDIR` and `_GLFW_USE_MENUBAR` compile-time
 | 
			
		||||
macros have been removed.
 | 
			
		||||
 | 
			
		||||
These options and macros are replaced by the window hint
 | 
			
		||||
[GLFW_COCOA_RETINA_FRAMEBUFFER](@ref GLFW_COCOA_RETINA_FRAMEBUFFER_hint)
 | 
			
		||||
and the init hints
 | 
			
		||||
[GLFW_COCOA_CHDIR_RESOURCES](@ref GLFW_COCOA_CHDIR_RESOURCES_hint) and
 | 
			
		||||
[GLFW_COCOA_MENUBAR](@ref GLFW_COCOA_MENUBAR_hint).
 | 
			
		||||
 | 
			
		||||
Existing projects and makefiles that set these options or define these macros
 | 
			
		||||
during compilation of GLFW will still build but it will have no effect and the
 | 
			
		||||
default behaviors will be used.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection vulkan_sdk_33 LunarG Vulkan SDK dependency
 | 
			
		||||
 | 
			
		||||
The GLFW test programs that previously depended on the LunarG Vulkan SDK now
 | 
			
		||||
instead uses a Vulkan loader generated by
 | 
			
		||||
[glad2](https://github.com/Dav1dde/glad).  This means the GLFW CMake files no
 | 
			
		||||
longer look for the Vulkan SDK.
 | 
			
		||||
 | 
			
		||||
Existing CMake projects that depended on the Vulkan SDK cache variables from
 | 
			
		||||
GLFW will need to call `find_package(Vulkan)` themselves.  CMake 3.7 and later
 | 
			
		||||
already comes with a
 | 
			
		||||
[Vulkan find module](https://cmake.org/cmake/help/latest/module/FindVulkan.html)
 | 
			
		||||
similar to the one GLFW previously included.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection lib_suffix_33 CMake option LIB_SUFFIX
 | 
			
		||||
 | 
			
		||||
The `LIB_SUFFIX` CMake option has been removed.  GLFW now uses the
 | 
			
		||||
GNUInstallDirs CMake package to handle platform specific details like the
 | 
			
		||||
library directory suffix and the `LIB_SUFFIX` CMake option has been removed.
 | 
			
		||||
 | 
			
		||||
Existing projects and makefiles that set the `LIB_SUFFIX` option will use the
 | 
			
		||||
suffix chosen by the GNUInstallDirs package and the option will be ignored.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection mir_removed_33 Mir support
 | 
			
		||||
 | 
			
		||||
The experimental Mir support has been completely removed as the Mir project has
 | 
			
		||||
implemented support for the Wayland protocol and is recommending that
 | 
			
		||||
applications use that instead.
 | 
			
		||||
 | 
			
		||||
Existing projects and makefiles that select Mir when compiling GLFW will fail.
 | 
			
		||||
Use Wayland or X11 instead.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection symbols_33 New symbols in version 3.3
 | 
			
		||||
 | 
			
		||||
@subsubsection functions_33 New functions in version 3.3
 | 
			
		||||
 | 
			
		||||
 - @ref glfwInitHint
 | 
			
		||||
 - @ref glfwGetError
 | 
			
		||||
 - @ref glfwGetMonitorWorkarea
 | 
			
		||||
 - @ref glfwGetMonitorContentScale
 | 
			
		||||
 - @ref glfwGetMonitorUserPointer
 | 
			
		||||
 - @ref glfwSetMonitorUserPointer
 | 
			
		||||
 - @ref glfwWindowHintString
 | 
			
		||||
 - @ref glfwGetWindowContentScale
 | 
			
		||||
 - @ref glfwGetWindowOpacity
 | 
			
		||||
 - @ref glfwSetWindowOpacity
 | 
			
		||||
 - @ref glfwRequestWindowAttention
 | 
			
		||||
 - @ref glfwSetWindowAttrib
 | 
			
		||||
 - @ref glfwSetWindowMaximizeCallback
 | 
			
		||||
 - @ref glfwSetWindowContentScaleCallback
 | 
			
		||||
 - @ref glfwRawMouseMotionSupported
 | 
			
		||||
 - @ref glfwGetKeyScancode
 | 
			
		||||
 - @ref glfwGetJoystickHats
 | 
			
		||||
 - @ref glfwGetJoystickGUID
 | 
			
		||||
 - @ref glfwGetJoystickUserPointer
 | 
			
		||||
 - @ref glfwSetJoystickUserPointer
 | 
			
		||||
 - @ref glfwJoystickIsGamepad
 | 
			
		||||
 - @ref glfwUpdateGamepadMappings
 | 
			
		||||
 - @ref glfwGetGamepadName
 | 
			
		||||
 - @ref glfwGetGamepadState
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection types_33 New types in version 3.3
 | 
			
		||||
 | 
			
		||||
 - @ref GLFWwindowmaximizefun
 | 
			
		||||
 - @ref GLFWwindowcontentscalefun
 | 
			
		||||
 - @ref GLFWgamepadstate
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection constants_33 New constants in version 3.3
 | 
			
		||||
 | 
			
		||||
 - @ref GLFW_NO_ERROR
 | 
			
		||||
 - @ref GLFW_JOYSTICK_HAT_BUTTONS
 | 
			
		||||
 - @ref GLFW_COCOA_CHDIR_RESOURCES
 | 
			
		||||
 - @ref GLFW_COCOA_MENUBAR
 | 
			
		||||
 - @ref GLFW_CENTER_CURSOR
 | 
			
		||||
 - @ref GLFW_TRANSPARENT_FRAMEBUFFER
 | 
			
		||||
 - @ref GLFW_HOVERED
 | 
			
		||||
 - @ref GLFW_FOCUS_ON_SHOW
 | 
			
		||||
 - @ref GLFW_SCALE_TO_MONITOR
 | 
			
		||||
 - @ref GLFW_COCOA_RETINA_FRAMEBUFFER
 | 
			
		||||
 - @ref GLFW_COCOA_FRAME_NAME
 | 
			
		||||
 - @ref GLFW_COCOA_GRAPHICS_SWITCHING
 | 
			
		||||
 - @ref GLFW_X11_CLASS_NAME
 | 
			
		||||
 - @ref GLFW_X11_INSTANCE_NAME
 | 
			
		||||
 - @ref GLFW_OSMESA_CONTEXT_API
 | 
			
		||||
 - @ref GLFW_HAT_CENTERED
 | 
			
		||||
 - @ref GLFW_HAT_UP
 | 
			
		||||
 - @ref GLFW_HAT_RIGHT
 | 
			
		||||
 - @ref GLFW_HAT_DOWN
 | 
			
		||||
 - @ref GLFW_HAT_LEFT
 | 
			
		||||
 - @ref GLFW_HAT_RIGHT_UP
 | 
			
		||||
 - @ref GLFW_HAT_RIGHT_DOWN
 | 
			
		||||
 - @ref GLFW_HAT_LEFT_UP
 | 
			
		||||
 - @ref GLFW_HAT_LEFT_DOWN
 | 
			
		||||
 - @ref GLFW_MOD_CAPS_LOCK
 | 
			
		||||
 - @ref GLFW_MOD_NUM_LOCK
 | 
			
		||||
 - @ref GLFW_LOCK_KEY_MODS
 | 
			
		||||
 - @ref GLFW_RAW_MOUSE_MOTION
 | 
			
		||||
 - @ref GLFW_GAMEPAD_BUTTON_A
 | 
			
		||||
 - @ref GLFW_GAMEPAD_BUTTON_B
 | 
			
		||||
 - @ref GLFW_GAMEPAD_BUTTON_X
 | 
			
		||||
 - @ref GLFW_GAMEPAD_BUTTON_Y
 | 
			
		||||
 - @ref GLFW_GAMEPAD_BUTTON_LEFT_BUMPER
 | 
			
		||||
 - @ref GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER
 | 
			
		||||
 - @ref GLFW_GAMEPAD_BUTTON_BACK
 | 
			
		||||
 - @ref GLFW_GAMEPAD_BUTTON_START
 | 
			
		||||
 - @ref GLFW_GAMEPAD_BUTTON_GUIDE
 | 
			
		||||
 - @ref GLFW_GAMEPAD_BUTTON_LEFT_THUMB
 | 
			
		||||
 - @ref GLFW_GAMEPAD_BUTTON_RIGHT_THUMB
 | 
			
		||||
 - @ref GLFW_GAMEPAD_BUTTON_DPAD_UP
 | 
			
		||||
 - @ref GLFW_GAMEPAD_BUTTON_DPAD_RIGHT
 | 
			
		||||
 - @ref GLFW_GAMEPAD_BUTTON_DPAD_DOWN
 | 
			
		||||
 - @ref GLFW_GAMEPAD_BUTTON_DPAD_LEFT
 | 
			
		||||
 - @ref GLFW_GAMEPAD_BUTTON_LAST
 | 
			
		||||
 - @ref GLFW_GAMEPAD_BUTTON_CROSS
 | 
			
		||||
 - @ref GLFW_GAMEPAD_BUTTON_CIRCLE
 | 
			
		||||
 - @ref GLFW_GAMEPAD_BUTTON_SQUARE
 | 
			
		||||
 - @ref GLFW_GAMEPAD_BUTTON_TRIANGLE
 | 
			
		||||
 - @ref GLFW_GAMEPAD_AXIS_LEFT_X
 | 
			
		||||
 - @ref GLFW_GAMEPAD_AXIS_LEFT_Y
 | 
			
		||||
 - @ref GLFW_GAMEPAD_AXIS_RIGHT_X
 | 
			
		||||
 - @ref GLFW_GAMEPAD_AXIS_RIGHT_Y
 | 
			
		||||
 - @ref GLFW_GAMEPAD_AXIS_LEFT_TRIGGER
 | 
			
		||||
 - @ref GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER
 | 
			
		||||
 - @ref GLFW_GAMEPAD_AXIS_LAST
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section news_32 Release notes for 3.2
 | 
			
		||||
 | 
			
		||||
These are the release notes for version 3.2.  For a more detailed view including
 | 
			
		||||
all fixed bugs see the [version history](https://www.glfw.org/changelog.html).
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection features_32 New features in version 3.2
 | 
			
		||||
 | 
			
		||||
@subsubsection news_32_vulkan Support for Vulkan
 | 
			
		||||
 | 
			
		||||
GLFW now supports basic integration with Vulkan with @ref glfwVulkanSupported,
 | 
			
		||||
@ref glfwGetRequiredInstanceExtensions, @ref glfwGetInstanceProcAddress, @ref
 | 
			
		||||
glfwGetPhysicalDevicePresentationSupport and @ref glfwCreateWindowSurface.
 | 
			
		||||
Vulkan header inclusion can be selected with
 | 
			
		||||
@ref GLFW_INCLUDE_VULKAN.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_32_setwindowmonitor Window mode switching
 | 
			
		||||
 | 
			
		||||
GLFW now supports switching between windowed and full screen modes and updating
 | 
			
		||||
the monitor and desired resolution and refresh rate of full screen windows with
 | 
			
		||||
@ref glfwSetWindowMonitor.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_32_maximize Window maxmimization support
 | 
			
		||||
 | 
			
		||||
GLFW now supports window maximization with @ref glfwMaximizeWindow and the
 | 
			
		||||
@ref GLFW_MAXIMIZED window hint and attribute.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_32_focus Window input focus control
 | 
			
		||||
 | 
			
		||||
GLFW now supports giving windows input focus with @ref glfwFocusWindow.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_32_sizelimits Window size limit support
 | 
			
		||||
 | 
			
		||||
GLFW now supports setting both absolute and relative window size limits with
 | 
			
		||||
@ref glfwSetWindowSizeLimits and @ref glfwSetWindowAspectRatio.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_32_keyname Localized key names
 | 
			
		||||
 | 
			
		||||
GLFW now supports querying the localized name of printable keys with @ref
 | 
			
		||||
glfwGetKeyName, either by key token or by scancode.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_32_waittimeout Wait for events with timeout
 | 
			
		||||
 | 
			
		||||
GLFW now supports waiting for events for a set amount of time with @ref
 | 
			
		||||
glfwWaitEventsTimeout.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_32_icon Window icon support
 | 
			
		||||
 | 
			
		||||
GLFW now supports setting the icon of windows with @ref glfwSetWindowIcon.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_32_timer Raw timer access
 | 
			
		||||
 | 
			
		||||
GLFW now supports raw timer values with @ref glfwGetTimerValue and @ref
 | 
			
		||||
glfwGetTimerFrequency.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_32_joystick Joystick connection callback
 | 
			
		||||
 | 
			
		||||
GLFW now supports notifying when a joystick has been connected or disconnected
 | 
			
		||||
with @ref glfwSetJoystickCallback.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_32_noapi Context-less windows
 | 
			
		||||
 | 
			
		||||
GLFW now supports creating windows without a OpenGL or OpenGL ES context by
 | 
			
		||||
setting the [GLFW_CLIENT_API](@ref GLFW_CLIENT_API_hint) hint to `GLFW_NO_API`.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_32_contextapi Run-time context creation API selection
 | 
			
		||||
 | 
			
		||||
GLFW now supports selecting and querying the context creation API at run-time
 | 
			
		||||
with the @ref GLFW_CONTEXT_CREATION_API hint and attribute.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_32_noerror Error-free context creation
 | 
			
		||||
 | 
			
		||||
GLFW now supports creating and querying OpenGL and OpenGL ES contexts that do
 | 
			
		||||
not emit errors with the @ref GLFW_CONTEXT_NO_ERROR hint, provided the machine
 | 
			
		||||
supports the `GL_KHR_no_error` extension.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_32_cmake CMake config-file package support
 | 
			
		||||
 | 
			
		||||
GLFW now supports being used as a
 | 
			
		||||
[config-file package](@ref build_link_cmake_package) from other projects for
 | 
			
		||||
easy linking with the library and its dependencies.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section news_31 Release notes for 3.1
 | 
			
		||||
 | 
			
		||||
These are the release notes for version 3.1.  For a more detailed view including
 | 
			
		||||
all fixed bugs see the [version history](https://www.glfw.org/changelog.html).
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection features_31 New features in version 3.1
 | 
			
		||||
 | 
			
		||||
@subsubsection news_31_cursor Custom mouse cursor images
 | 
			
		||||
 | 
			
		||||
GLFW now supports creating and setting both custom cursor images and standard
 | 
			
		||||
cursor shapes.  They are created with @ref glfwCreateCursor or @ref
 | 
			
		||||
glfwCreateStandardCursor, set with @ref glfwSetCursor and destroyed with @ref
 | 
			
		||||
glfwDestroyCursor.
 | 
			
		||||
 | 
			
		||||
@see @ref cursor_object
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_31_drop Path drop event
 | 
			
		||||
 | 
			
		||||
GLFW now provides a callback for receiving the paths of files and directories
 | 
			
		||||
dropped onto GLFW windows.  The callback is set with @ref glfwSetDropCallback.
 | 
			
		||||
 | 
			
		||||
@see @ref path_drop
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_31_emptyevent Main thread wake-up
 | 
			
		||||
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
@see @ref events
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_31_framesize Window frame size query
 | 
			
		||||
 | 
			
		||||
GLFW now supports querying the size, on each side, of the frame around the
 | 
			
		||||
content area of a window, with @ref glfwGetWindowFrameSize.
 | 
			
		||||
 | 
			
		||||
@see [Window size](@ref window_size)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_31_autoiconify Simultaneous multi-monitor rendering
 | 
			
		||||
 | 
			
		||||
GLFW now supports disabling auto-iconification of full screen windows with
 | 
			
		||||
the [GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_hint) window hint.  This is
 | 
			
		||||
intended for people building multi-monitor installations, where you need windows
 | 
			
		||||
to stay in full screen despite losing input focus.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_31_floating Floating windows
 | 
			
		||||
 | 
			
		||||
GLFW now supports floating windows, also called topmost or always on top, for
 | 
			
		||||
easier debugging with the @ref GLFW_FLOATING window hint and attribute.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection 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 GLFW_FOCUSED_hint) window hint.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_31_direct Direct access for window attributes and cursor position
 | 
			
		||||
 | 
			
		||||
GLFW now queries the window input focus, visibility and iconification attributes
 | 
			
		||||
and the cursor position directly instead of returning cached data.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection 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.
 | 
			
		||||
 | 
			
		||||
@see @ref input_char
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_31_single Single buffered framebuffers
 | 
			
		||||
 | 
			
		||||
GLFW now supports the creation of single buffered windows, with the @ref
 | 
			
		||||
GLFW_DOUBLEBUFFER hint.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_31_glext Macro for including extension header
 | 
			
		||||
 | 
			
		||||
GLFW now includes the extension header appropriate for the chosen OpenGL or
 | 
			
		||||
OpenGL ES header when @ref GLFW_INCLUDE_GLEXT is defined.  GLFW does not provide
 | 
			
		||||
these headers.  They must be provided by your development environment or your
 | 
			
		||||
OpenGL or OpenGL ES SDK.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_31_release Context release behaviors
 | 
			
		||||
 | 
			
		||||
GLFW now supports controlling and querying whether the pipeline is flushed when
 | 
			
		||||
a context is made non-current, with the @ref GLFW_CONTEXT_RELEASE_BEHAVIOR hint
 | 
			
		||||
and attribute, provided the machine supports the `GL_KHR_context_flush_control`
 | 
			
		||||
extension.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_31_wayland (Experimental) Wayland support
 | 
			
		||||
 | 
			
		||||
GLFW now has an _experimental_ Wayland display protocol backend that can be
 | 
			
		||||
selected on Linux with a CMake option.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_31_mir (Experimental) Mir support
 | 
			
		||||
 | 
			
		||||
GLFW now has an _experimental_ Mir display server backend that can be selected
 | 
			
		||||
on Linux with a CMake option.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section news_30 Release notes for 3.0
 | 
			
		||||
 | 
			
		||||
These are the release notes for version 3.0.  For a more detailed view including
 | 
			
		||||
all fixed bugs see the [version history](https://www.glfw.org/changelog.html).
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection features_30 New features in version 3.0
 | 
			
		||||
 | 
			
		||||
@subsubsection news_30_cmake CMake build system
 | 
			
		||||
 | 
			
		||||
GLFW now uses the CMake build system instead of the various makefiles and
 | 
			
		||||
project files used by earlier versions.  CMake is available for all platforms
 | 
			
		||||
supported by GLFW, is present in most package systems and can generate
 | 
			
		||||
makefiles and/or project files for most popular development environments.
 | 
			
		||||
 | 
			
		||||
For more information on how to use CMake, see the
 | 
			
		||||
[CMake manual](https://cmake.org/cmake/help/documentation.html).
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_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
 | 
			
		||||
callbacks are now per-window and are provided with the handle of the window that
 | 
			
		||||
received the event.  The @ref glfwMakeContextCurrent function has been added to
 | 
			
		||||
select which context is current on a given thread.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_30_multimon Multi-monitor support
 | 
			
		||||
 | 
			
		||||
GLFW now explicitly supports multiple monitors.  They can be enumerated with
 | 
			
		||||
@ref glfwGetMonitors, queried with @ref glfwGetVideoModes, @ref
 | 
			
		||||
glfwGetMonitorPos, @ref glfwGetMonitorName and @ref glfwGetMonitorPhysicalSize,
 | 
			
		||||
and specified at window creation to make the newly created window full screen on
 | 
			
		||||
that specific monitor.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_30_unicode Unicode support
 | 
			
		||||
 | 
			
		||||
All string arguments to GLFW functions and all strings returned by GLFW now use
 | 
			
		||||
the UTF-8 encoding.  This includes the window title, error string, clipboard
 | 
			
		||||
text, monitor and joystick names as well as the extension function arguments (as
 | 
			
		||||
ASCII is a subset of UTF-8).
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_30_clipboard Clipboard text I/O
 | 
			
		||||
 | 
			
		||||
GLFW now supports reading and writing plain text to and from the system
 | 
			
		||||
clipboard, with the @ref glfwGetClipboardString and @ref glfwSetClipboardString
 | 
			
		||||
functions.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_30_gamma Gamma ramp support
 | 
			
		||||
 | 
			
		||||
GLFW now supports setting and reading back the gamma ramp of monitors, with the
 | 
			
		||||
@ref glfwGetGammaRamp and @ref glfwSetGammaRamp functions.  There is also @ref
 | 
			
		||||
glfwSetGamma, which generates a ramp from a gamma value and then sets it.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_30_gles OpenGL ES support
 | 
			
		||||
 | 
			
		||||
GLFW now supports the creation of OpenGL ES contexts, by setting the
 | 
			
		||||
[GLFW_CLIENT_API](@ref GLFW_CLIENT_API_hint) hint to `GLFW_OPENGL_ES_API`, where
 | 
			
		||||
creation of such 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.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_30_egl (Experimental) EGL support
 | 
			
		||||
 | 
			
		||||
GLFW now has an experimental EGL context creation back end that can be selected
 | 
			
		||||
through CMake options.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_30_hidpi High-DPI support
 | 
			
		||||
 | 
			
		||||
GLFW now supports high-DPI monitors on both Windows and macOS, 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.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_30_error Error callback
 | 
			
		||||
 | 
			
		||||
GLFW now has an error callback, which can provide your application with much
 | 
			
		||||
more detailed diagnostics than was previously possible.  The callback is passed
 | 
			
		||||
an error code and a description string.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_30_wndptr Per-window user pointer
 | 
			
		||||
 | 
			
		||||
Each window now has a user-defined pointer, retrieved with @ref
 | 
			
		||||
glfwGetWindowUserPointer and set with @ref glfwSetWindowUserPointer, to make it
 | 
			
		||||
easier to integrate GLFW into C++ code.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_30_iconifyfun Window iconification callback
 | 
			
		||||
 | 
			
		||||
Each window now has a callback for iconification and restoration events,
 | 
			
		||||
which is set with @ref glfwSetWindowIconifyCallback.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_30_wndposfun Window position callback
 | 
			
		||||
 | 
			
		||||
Each window now has a callback for position events, which is set with @ref
 | 
			
		||||
glfwSetWindowPosCallback.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_30_wndpos Window position query
 | 
			
		||||
 | 
			
		||||
The position of a window can now be retrieved using @ref glfwGetWindowPos.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_30_focusfun Window focus callback
 | 
			
		||||
 | 
			
		||||
Each windows now has a callback for focus events, which is set with @ref
 | 
			
		||||
glfwSetWindowFocusCallback.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_30_enterleave Cursor enter/leave callback
 | 
			
		||||
 | 
			
		||||
Each window now has a callback for when the mouse cursor enters or leaves its
 | 
			
		||||
content area, which is set with @ref glfwSetCursorEnterCallback.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_30_wndtitle Initial window title
 | 
			
		||||
 | 
			
		||||
The title of a window is now specified at creation time, as one of the arguments
 | 
			
		||||
to @ref glfwCreateWindow.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_30_hidden Hidden windows
 | 
			
		||||
 | 
			
		||||
Windows can now be hidden with @ref glfwHideWindow, shown using @ref
 | 
			
		||||
glfwShowWindow and created initially hidden with the @ref GLFW_VISIBLE window
 | 
			
		||||
hint and attribute.  This allows for off-screen rendering in a way compatible
 | 
			
		||||
with most drivers, as well as moving a window to a specific position before
 | 
			
		||||
showing it.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_30_undecorated Undecorated windows
 | 
			
		||||
 | 
			
		||||
Windowed mode windows can now be created without decorations, e.g. things like
 | 
			
		||||
a frame, a title bar, with the @ref GLFW_DECORATED window hint and attribute.
 | 
			
		||||
This allows for the creation of things like splash screens.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_30_keymods Modifier key bit masks
 | 
			
		||||
 | 
			
		||||
[Modifier key bit mask](@ref mods) parameters have been added to the
 | 
			
		||||
[mouse button](@ref GLFWmousebuttonfun) and [key](@ref GLFWkeyfun) callbacks.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_30_scancode Platform-specific scancodes
 | 
			
		||||
 | 
			
		||||
A scancode parameter has been added to the [key callback](@ref GLFWkeyfun). Keys
 | 
			
		||||
that don't have a [key token](@ref keys) still get passed on with the key
 | 
			
		||||
parameter set to `GLFW_KEY_UNKNOWN`.  These scancodes will vary between machines
 | 
			
		||||
and are intended to be used for key bindings.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_30_jsname Joystick names
 | 
			
		||||
 | 
			
		||||
The name of a joystick can now be retrieved using @ref glfwGetJoystickName.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsubsection news_30_doxygen Doxygen documentation
 | 
			
		||||
 | 
			
		||||
You are reading it.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
							
								
								
									
										362
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/quick.dox
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										362
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/quick.dox
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,362 @@
 | 
			
		||||
/*!
 | 
			
		||||
 | 
			
		||||
@page quick_guide Getting started
 | 
			
		||||
 | 
			
		||||
@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 assumes no experience with earlier versions of GLFW.  If you
 | 
			
		||||
have used GLFW 2 in the past, read @ref moving_guide, as some functions
 | 
			
		||||
behave differently in GLFW 3.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section quick_steps Step by step
 | 
			
		||||
 | 
			
		||||
@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.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
#include <GLFW/glfw3.h>
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
This defines all the constants, types and function prototypes of the GLFW API.
 | 
			
		||||
It also includes the OpenGL header from your development environment and
 | 
			
		||||
defines all the constants and types necessary for it to work on your platform
 | 
			
		||||
without including any platform-specific headers.
 | 
			
		||||
 | 
			
		||||
In other words:
 | 
			
		||||
 | 
			
		||||
- Do _not_ include the OpenGL header yourself, as GLFW does this for you in
 | 
			
		||||
  a platform-independent way
 | 
			
		||||
- Do _not_ include `windows.h` or other platform-specific headers unless
 | 
			
		||||
  you plan on using those APIs yourself
 | 
			
		||||
- If you _do_ need to include such headers, include them _before_ the GLFW
 | 
			
		||||
  header and it will detect this
 | 
			
		||||
 | 
			
		||||
On some platforms supported by GLFW the OpenGL header and link library only
 | 
			
		||||
expose older versions of OpenGL.  The most extreme case is Windows, which only
 | 
			
		||||
exposes OpenGL 1.2.  The easiest way to work around this is to use an
 | 
			
		||||
[extension loader library](@ref context_glext_auto).
 | 
			
		||||
 | 
			
		||||
If you are using such a library then you should include its header _before_ the
 | 
			
		||||
GLFW header.  This lets it replace the OpenGL header included by GLFW without
 | 
			
		||||
conflicts.  This example uses
 | 
			
		||||
[glad2](https://github.com/Dav1dde/glad), but the same rule applies to all such
 | 
			
		||||
libraries.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
#include <glad/gl.h>
 | 
			
		||||
#include <GLFW/glfw3.h>
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection quick_init_term Initializing and terminating GLFW
 | 
			
		||||
 | 
			
		||||
Before you can use most GLFW functions, the library must be initialized.  On
 | 
			
		||||
successful initialization, `GLFW_TRUE` is returned.  If an error occurred,
 | 
			
		||||
`GLFW_FALSE` is returned.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
if (!glfwInit())
 | 
			
		||||
{
 | 
			
		||||
    // Initialization failed
 | 
			
		||||
}
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
Note that `GLFW_TRUE` and `GLFW_FALSE` are and will always be one and zero.
 | 
			
		||||
 | 
			
		||||
When you are done using GLFW, typically just before the application exits, you
 | 
			
		||||
need to terminate GLFW.
 | 
			
		||||
 | 
			
		||||
@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
 | 
			
		||||
functions that require it.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection 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 C functions (or
 | 
			
		||||
C++ static methods) that are called by GLFW with arguments describing the event.
 | 
			
		||||
 | 
			
		||||
In case a GLFW function fails, an error is reported to the GLFW error callback.
 | 
			
		||||
You can receive these reports with an error callback.  This function must have
 | 
			
		||||
the signature below but may do anything permitted in other callbacks.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
void error_callback(int error, const char* description)
 | 
			
		||||
{
 | 
			
		||||
    fprintf(stderr, "Error: %s\n", 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.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
glfwSetErrorCallback(error_callback);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection quick_create_window Creating a window and context
 | 
			
		||||
 | 
			
		||||
The window and its OpenGL context are created with a single call to @ref
 | 
			
		||||
glfwCreateWindow, which returns a handle to the created combined window and
 | 
			
		||||
context object
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", NULL, NULL);
 | 
			
		||||
if (!window)
 | 
			
		||||
{
 | 
			
		||||
    // Window or OpenGL context creation failed
 | 
			
		||||
}
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
This creates a 640 by 480 windowed mode window with an OpenGL context.  If
 | 
			
		||||
window or OpenGL context creation fails, `NULL` will be returned.  You should
 | 
			
		||||
always check the return value.  While window creation rarely fails, context
 | 
			
		||||
creation depends on properly installed drivers and may fail even on machines
 | 
			
		||||
with the necessary hardware.
 | 
			
		||||
 | 
			
		||||
By default, the OpenGL context GLFW creates may have any version.  You can
 | 
			
		||||
require a minimum OpenGL version by setting the `GLFW_CONTEXT_VERSION_MAJOR` and
 | 
			
		||||
`GLFW_CONTEXT_VERSION_MINOR` hints _before_ creation.  If the required minimum
 | 
			
		||||
version is not supported on the machine, context (and window) creation fails.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
 | 
			
		||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
 | 
			
		||||
GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", NULL, NULL);
 | 
			
		||||
if (!window)
 | 
			
		||||
{
 | 
			
		||||
    // Window or context creation failed
 | 
			
		||||
}
 | 
			
		||||
@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.
 | 
			
		||||
 | 
			
		||||
When a window and context is no longer needed, destroy it.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
glfwDestroyWindow(window);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
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
 | 
			
		||||
 | 
			
		||||
Before you can use the OpenGL API, you must have a current OpenGL context.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
glfwMakeContextCurrent(window);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
The context will remain current until you make another context current or until
 | 
			
		||||
the window owning the current context is destroyed.
 | 
			
		||||
 | 
			
		||||
If you are using an [extension loader library](@ref context_glext_auto) to
 | 
			
		||||
access modern OpenGL then this is when to initialize it, as the loader needs
 | 
			
		||||
a current context to load from.  This example uses
 | 
			
		||||
[glad](https://github.com/Dav1dde/glad), but the same rule applies to all such
 | 
			
		||||
libraries.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
gladLoadGL(glfwGetProcAddress);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection quick_window_close Checking the window close flag
 | 
			
		||||
 | 
			
		||||
Each window has a flag indicating whether the window should be closed.
 | 
			
		||||
 | 
			
		||||
When the user attempts to close the window, either by pressing the close widget
 | 
			
		||||
in the title bar or using a key combination like Alt+F4, this flag is set to 1.
 | 
			
		||||
Note that __the window isn't actually closed__, so you are expected to monitor
 | 
			
		||||
this flag and either destroy the window or give some kind of feedback to the
 | 
			
		||||
user.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
while (!glfwWindowShouldClose(window))
 | 
			
		||||
{
 | 
			
		||||
    // Keep running
 | 
			
		||||
}
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
You can be notified when the user is attempting to close the window by setting
 | 
			
		||||
a close callback with @ref glfwSetWindowCloseCallback.  The callback will be
 | 
			
		||||
called immediately after the close flag has been set.
 | 
			
		||||
 | 
			
		||||
You can also set it yourself with @ref glfwSetWindowShouldClose.  This can be
 | 
			
		||||
useful if you want to interpret other kinds of input as closing the window, like
 | 
			
		||||
for example pressing the _Escape_ key.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection 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.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
 | 
			
		||||
{
 | 
			
		||||
    if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
 | 
			
		||||
        glfwSetWindowShouldClose(window, GLFW_TRUE);
 | 
			
		||||
}
 | 
			
		||||
@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.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection 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`.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
int width, height;
 | 
			
		||||
glfwGetFramebufferSize(window, &width, &height);
 | 
			
		||||
glViewport(0, 0, width, height);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
You can also set a framebuffer size callback using @ref
 | 
			
		||||
glfwSetFramebufferSizeCallback and be notified when the size changes.
 | 
			
		||||
 | 
			
		||||
Actual rendering with OpenGL is outside the scope of this tutorial, but there
 | 
			
		||||
are [many](https://open.gl/) [excellent](https://learnopengl.com/)
 | 
			
		||||
[tutorial](http://openglbook.com/) [sites](http://ogldev.atspace.co.uk/) that
 | 
			
		||||
teach modern OpenGL.  Some of them use GLFW to create the context and window
 | 
			
		||||
while others use GLUT or SDL, but remember that OpenGL itself always works the
 | 
			
		||||
same.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@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.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
double time = glfwGetTime();
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection 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.
 | 
			
		||||
 | 
			
		||||
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.
 | 
			
		||||
 | 
			
		||||
@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
 | 
			
		||||
 | 
			
		||||
GLFW needs to communicate regularly with the window system both in order to
 | 
			
		||||
receive events and to show that the application hasn't locked up.  Event
 | 
			
		||||
processing must be done regularly while you have visible windows and is normally
 | 
			
		||||
done each frame after buffer swapping.
 | 
			
		||||
 | 
			
		||||
There are two methods for processing pending events; polling and waiting.  This
 | 
			
		||||
example will use event polling, which processes only those events that have
 | 
			
		||||
already been received and then returns immediately.
 | 
			
		||||
 | 
			
		||||
@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.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section quick_example Putting it together
 | 
			
		||||
 | 
			
		||||
Now that you know how to initialize GLFW, create a window and poll for
 | 
			
		||||
keyboard input, it's possible to create a simple program.
 | 
			
		||||
 | 
			
		||||
This program creates a 640 by 480 windowed mode window and starts a loop that
 | 
			
		||||
clears the screen, renders a triangle and processes events until the user either
 | 
			
		||||
presses _Escape_ or closes the window.
 | 
			
		||||
 | 
			
		||||
@snippet simple.c code
 | 
			
		||||
 | 
			
		||||
The program above can be found in the
 | 
			
		||||
[source package](https://www.glfw.org/download.html) as `examples/simple.c`
 | 
			
		||||
and is compiled along with all other examples when you build GLFW.  If you
 | 
			
		||||
built GLFW from the source package then already have this as `simple.exe` on
 | 
			
		||||
Windows, `simple` on Linux or `simple.app` on macOS.
 | 
			
		||||
 | 
			
		||||
This tutorial used only a few of the many functions GLFW provides.  There are
 | 
			
		||||
guides for each of the areas covered by GLFW.  Each guide will introduce all the
 | 
			
		||||
functions for that category.
 | 
			
		||||
 | 
			
		||||
 - @ref intro_guide
 | 
			
		||||
 - @ref window_guide
 | 
			
		||||
 - @ref context_guide
 | 
			
		||||
 - @ref monitor_guide
 | 
			
		||||
 - @ref input_guide
 | 
			
		||||
 | 
			
		||||
You can access reference documentation for any GLFW function by clicking it and
 | 
			
		||||
the reference for each function links to related functions and guide sections.
 | 
			
		||||
 | 
			
		||||
The tutorial ends here.  Once you have written a program that uses GLFW, you
 | 
			
		||||
will need to compile and link it.  How to do that depends on the development
 | 
			
		||||
environment you are using and is best explained by the documentation for that
 | 
			
		||||
environment.  To learn about the details that are specific to GLFW, see
 | 
			
		||||
@ref build_guide.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
							
								
								
									
										877
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/spaces.svg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										877
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/spaces.svg
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,877 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
 | 
			
		||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
 | 
			
		||||
 | 
			
		||||
<svg
 | 
			
		||||
   xmlns:dc="http://purl.org/dc/elements/1.1/"
 | 
			
		||||
   xmlns:cc="http://creativecommons.org/ns#"
 | 
			
		||||
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 | 
			
		||||
   xmlns:svg="http://www.w3.org/2000/svg"
 | 
			
		||||
   xmlns="http://www.w3.org/2000/svg"
 | 
			
		||||
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
 | 
			
		||||
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
 | 
			
		||||
   width="688.48718"
 | 
			
		||||
   height="327.98221"
 | 
			
		||||
   id="svg2"
 | 
			
		||||
   version="1.1"
 | 
			
		||||
   inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
 | 
			
		||||
   sodipodi:docname="spaces.svg">
 | 
			
		||||
  <defs
 | 
			
		||||
     id="defs4">
 | 
			
		||||
    <marker
 | 
			
		||||
       inkscape:stockid="Arrow2Lend"
 | 
			
		||||
       orient="auto"
 | 
			
		||||
       refY="0.0"
 | 
			
		||||
       refX="0.0"
 | 
			
		||||
       id="Arrow2Lend"
 | 
			
		||||
       style="overflow:visible;">
 | 
			
		||||
      <path
 | 
			
		||||
         id="path3888"
 | 
			
		||||
         style="fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;"
 | 
			
		||||
         d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
 | 
			
		||||
         transform="scale(1.1) rotate(180) translate(1,0)" />
 | 
			
		||||
    </marker>
 | 
			
		||||
  </defs>
 | 
			
		||||
  <sodipodi:namedview
 | 
			
		||||
     id="base"
 | 
			
		||||
     pagecolor="#ffffff"
 | 
			
		||||
     bordercolor="#666666"
 | 
			
		||||
     borderopacity="1.0"
 | 
			
		||||
     inkscape:pageopacity="0.0"
 | 
			
		||||
     inkscape:pageshadow="2"
 | 
			
		||||
     inkscape:zoom="1.8110012"
 | 
			
		||||
     inkscape:cx="320.68941"
 | 
			
		||||
     inkscape:cy="159.80509"
 | 
			
		||||
     inkscape:document-units="px"
 | 
			
		||||
     inkscape:current-layer="layer1"
 | 
			
		||||
     showgrid="false"
 | 
			
		||||
     inkscape:window-width="1920"
 | 
			
		||||
     inkscape:window-height="1021"
 | 
			
		||||
     inkscape:window-x="0"
 | 
			
		||||
     inkscape:window-y="30"
 | 
			
		||||
     inkscape:window-maximized="1"
 | 
			
		||||
     fit-margin-top="0"
 | 
			
		||||
     fit-margin-left="0"
 | 
			
		||||
     fit-margin-right="0"
 | 
			
		||||
     fit-margin-bottom="0"
 | 
			
		||||
     units="px"
 | 
			
		||||
     showborder="false"
 | 
			
		||||
     inkscape:showpageshadow="false" />
 | 
			
		||||
  <metadata
 | 
			
		||||
     id="metadata7">
 | 
			
		||||
    <rdf:RDF>
 | 
			
		||||
      <cc:Work
 | 
			
		||||
         rdf:about="">
 | 
			
		||||
        <dc:format>image/svg+xml</dc:format>
 | 
			
		||||
        <dc:type
 | 
			
		||||
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
 | 
			
		||||
        <dc:title />
 | 
			
		||||
      </cc:Work>
 | 
			
		||||
    </rdf:RDF>
 | 
			
		||||
  </metadata>
 | 
			
		||||
  <g
 | 
			
		||||
     inkscape:label="Layer 1"
 | 
			
		||||
     inkscape:groupmode="layer"
 | 
			
		||||
     id="layer1"
 | 
			
		||||
     transform="translate(-12.627039,-339.86462)">
 | 
			
		||||
    <rect
 | 
			
		||||
       style="fill:#ffffff;fill-opacity:1;stroke:#0000ff;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:3,3;stroke-dashoffset:0"
 | 
			
		||||
       id="rect2985"
 | 
			
		||||
       width="687.36469"
 | 
			
		||||
       height="326.85971"
 | 
			
		||||
       x="13.188287"
 | 
			
		||||
       y="340.42587"
 | 
			
		||||
       inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
 | 
			
		||||
       inkscape:export-xdpi="109.89113"
 | 
			
		||||
       inkscape:export-ydpi="109.89113" />
 | 
			
		||||
    <rect
 | 
			
		||||
       style="fill:#f3fff3;fill-opacity:1;stroke:#00b800;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
 | 
			
		||||
       id="rect3757"
 | 
			
		||||
       width="318.05698"
 | 
			
		||||
       height="277.04684"
 | 
			
		||||
       x="38.315689"
 | 
			
		||||
       y="366.05841"
 | 
			
		||||
       inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
 | 
			
		||||
       inkscape:export-xdpi="109.89113"
 | 
			
		||||
       inkscape:export-ydpi="109.89113" />
 | 
			
		||||
    <rect
 | 
			
		||||
       style="fill:#f3fff3;fill-opacity:1;stroke:#00b800;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
 | 
			
		||||
       id="rect3767"
 | 
			
		||||
       width="319.01456"
 | 
			
		||||
       height="198.09369"
 | 
			
		||||
       x="356.36722"
 | 
			
		||||
       y="366.01291"
 | 
			
		||||
       inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
 | 
			
		||||
       inkscape:export-xdpi="109.89113"
 | 
			
		||||
       inkscape:export-ydpi="109.89113" />
 | 
			
		||||
    <g
 | 
			
		||||
       style="font-size:12px;font-style:normal;font-weight:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
 | 
			
		||||
       id="text3769">
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 365.3732,374.63632 0,2.73926 1.24023,0 c 0.45898,0 0.8138,-0.11881 1.06446,-0.35645 0.25064,-0.23762 0.37597,-0.57616 0.37597,-1.01562 0,-0.43619 -0.12533,-0.77311 -0.37597,-1.01074 -0.25066,-0.23763 -0.60548,-0.35644 -1.06446,-0.35645 l -1.24023,0 m -0.98633,-0.81054 2.22656,0 c 0.81706,0 1.43392,0.18555 1.85059,0.55664 0.41992,0.36784 0.62988,0.9082 0.62988,1.62109 0,0.7194 -0.20996,1.26302 -0.62988,1.63086 -0.41667,0.36784 -1.03353,0.55176 -1.85059,0.55176 l -1.24023,0 0,2.92968 -0.98633,0 0,-7.29003"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3281" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 373.37613,376.48691 c -0.10092,-0.0586 -0.21159,-0.10091 -0.33203,-0.12696 -0.11719,-0.0293 -0.2474,-0.0439 -0.39063,-0.0439 -0.50781,0 -0.89844,0.16602 -1.17187,0.49805 -0.27019,0.32878 -0.40528,0.80241 -0.40528,1.42089 l 0,2.88086 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.1888,-0.33202 0.43457,-0.57779 0.73731,-0.7373 0.30273,-0.16276 0.67057,-0.24414 1.10351,-0.24414 0.0618,0 0.13021,0.005 0.20508,0.0147 0.0749,0.007 0.15788,0.0179 0.24903,0.0342 l 0.005,0.92285"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3283" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 374.32828,375.64706 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3285" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 381.35953,376.69687 c 0.2246,-0.40364 0.49316,-0.70149 0.80566,-0.89356 0.3125,-0.19205 0.68033,-0.28808 1.10352,-0.28808 0.56965,0 1.0091,0.2002 1.31836,0.60058 0.30923,0.39714 0.46385,0.96355 0.46386,1.69922 l 0,3.30078 -0.90332,0 0,-3.27148 c 0,-0.52408 -0.0928,-0.91308 -0.27832,-1.16699 -0.18555,-0.2539 -0.46875,-0.38086 -0.84961,-0.38086 -0.4655,0 -0.83334,0.15463 -1.10351,0.46387 -0.27019,0.30924 -0.40528,0.73079 -0.40528,1.26464 l 0,3.09082 -0.90332,0 0,-3.27148 c 0,-0.52734 -0.0928,-0.91634 -0.27832,-1.16699 -0.18555,-0.2539 -0.472,-0.38086 -0.85937,-0.38086 -0.45899,0 -0.82357,0.15625 -1.09375,0.46875 -0.27019,0.30925 -0.40528,0.72917 -0.40527,1.25976 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.20507,-0.33528 0.45084,-0.58267 0.7373,-0.74218 0.28646,-0.1595 0.62662,-0.23926 1.02051,-0.23926 0.39713,0 0.73404,0.10092 1.01074,0.30273 0.27994,0.20183 0.48665,0.4948 0.62012,0.87891"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3287" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 389.33316,378.36679 c -0.72591,0 -1.22884,0.083 -1.50879,0.24902 -0.27995,0.16602 -0.41992,0.44923 -0.41992,0.84961 0,0.31902 0.10416,0.57292 0.3125,0.76172 0.21159,0.18555 0.49804,0.27832 0.85937,0.27832 0.49805,0 0.89681,-0.17578 1.19629,-0.52734 0.30273,-0.35482 0.4541,-0.82519 0.45411,-1.41113 l 0,-0.2002 -0.89356,0 m 1.79199,-0.37109 0,3.12011 -0.89843,0 0,-0.83007 c -0.20509,0.33203 -0.46062,0.5778 -0.76661,0.7373 -0.30599,0.15625 -0.68034,0.23438 -1.12304,0.23438 -0.5599,0 -1.00586,-0.15625 -1.33789,-0.46875 -0.32878,-0.31576 -0.49317,-0.73731 -0.49317,-1.26465 0,-0.61523 0.20508,-1.0791 0.61524,-1.3916 0.41341,-0.3125 1.02864,-0.46875 1.8457,-0.46875 l 1.25977,0 0,-0.0879 c -10e-6,-0.41341 -0.13673,-0.73242 -0.41016,-0.95704 -0.27019,-0.22786 -0.65105,-0.34179 -1.14258,-0.34179 -0.3125,0 -0.61686,0.0374 -0.91309,0.1123 -0.29622,0.0749 -0.58105,0.18718 -0.85449,0.33692 l 0,-0.83008 c 0.32878,-0.12695 0.64779,-0.22135 0.95703,-0.28321 0.30925,-0.0651 0.61035,-0.0977 0.90332,-0.0977 0.79102,0 1.38184,0.20508 1.77247,0.61523 0.39062,0.41016 0.58593,1.03191 0.58593,1.86524"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3289" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 396.14957,376.48691 c -0.10092,-0.0586 -0.2116,-0.10091 -0.33203,-0.12696 -0.1172,-0.0293 -0.2474,-0.0439 -0.39063,-0.0439 -0.50781,0 -0.89844,0.16602 -1.17187,0.49805 -0.27019,0.32878 -0.40528,0.80241 -0.40528,1.42089 l 0,2.88086 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.1888,-0.33202 0.43457,-0.57779 0.73731,-0.7373 0.30273,-0.16276 0.67057,-0.24414 1.10351,-0.24414 0.0618,0 0.13021,0.005 0.20508,0.0147 0.0749,0.007 0.15787,0.0179 0.24902,0.0342 l 0.005,0.92285"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3291" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 399.37711,381.62363 c -0.25391,0.65104 -0.50131,1.07584 -0.74219,1.27441 -0.24089,0.19857 -0.56315,0.29785 -0.9668,0.29785 l -0.71777,0 0,-0.75195 0.52734,0 c 0.2474,0 0.43945,-0.0586 0.57617,-0.17578 0.13672,-0.11719 0.28809,-0.39388 0.45411,-0.83008 l 0.16113,-0.41016 -2.21192,-5.38086 0.95215,0 1.70899,4.27735 1.70898,-4.27735 0.95215,0 -2.40234,5.97657"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3293" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 410.46109,376.69687 c 0.2246,-0.40364 0.49316,-0.70149 0.80566,-0.89356 0.3125,-0.19205 0.68034,-0.28808 1.10352,-0.28808 0.56965,0 1.00911,0.2002 1.31836,0.60058 0.30924,0.39714 0.46386,0.96355 0.46387,1.69922 l 0,3.30078 -0.90332,0 0,-3.27148 c -1e-5,-0.52408 -0.0928,-0.91308 -0.27832,-1.16699 -0.18556,-0.2539 -0.46876,-0.38086 -0.84961,-0.38086 -0.4655,0 -0.83334,0.15463 -1.10352,0.46387 -0.27019,0.30924 -0.40528,0.73079 -0.40527,1.26464 l 0,3.09082 -0.90332,0 0,-3.27148 c -10e-6,-0.52734 -0.0928,-0.91634 -0.27832,-1.16699 -0.18555,-0.2539 -0.47201,-0.38086 -0.85938,-0.38086 -0.45899,0 -0.82357,0.15625 -1.09375,0.46875 -0.27018,0.30925 -0.40527,0.72917 -0.40527,1.25976 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.20507,-0.33528 0.45084,-0.58267 0.7373,-0.74218 0.28646,-0.1595 0.62663,-0.23926 1.02051,-0.23926 0.39713,0 0.73405,0.10092 1.01074,0.30273 0.27995,0.20183 0.48665,0.4948 0.62012,0.87891"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3295" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 418.06851,376.27695 c -0.48177,0 -0.86263,0.1888 -1.14258,0.5664 -0.27995,0.37436 -0.41992,0.88868 -0.41992,1.54297 0,0.6543 0.13835,1.17025 0.41504,1.54785 0.27995,0.37435 0.66243,0.56153 1.14746,0.56153 0.47851,0 0.85775,-0.1888 1.1377,-0.56641 0.27994,-0.3776 0.41991,-0.89192 0.41992,-1.54297 -10e-6,-0.64778 -0.13998,-1.16048 -0.41992,-1.53808 -0.27995,-0.38086 -0.65919,-0.57129 -1.1377,-0.57129 m 0,-0.76172 c 0.78125,0 1.39485,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66895,2.10937 -1e-5,0.89519 -0.22299,1.59831 -0.66895,2.10938 -0.44597,0.50781 -1.05957,0.76172 -1.84082,0.76172 -0.78451,0 -1.39974,-0.25391 -1.8457,-0.76172 -0.44271,-0.51107 -0.66406,-1.21419 -0.66406,-2.10938 0,-0.89843 0.22135,-1.60156 0.66406,-2.10937 0.44596,-0.50781 1.06119,-0.76172 1.8457,-0.76172"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3297" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 426.60855,377.81503 0,3.30078 -0.89844,0 0,-3.27148 c 0,-0.51757 -0.10091,-0.90494 -0.30273,-1.16211 -0.20183,-0.25716 -0.50456,-0.38574 -0.9082,-0.38574 -0.48503,0 -0.86752,0.15463 -1.14746,0.46387 -0.27995,0.30924 -0.41993,0.73079 -0.41993,1.26464 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.21484,-0.32877 0.46712,-0.57454 0.75684,-0.7373 0.29297,-0.16276 0.62988,-0.24414 1.01074,-0.24414 0.62825,0 1.10351,0.19532 1.42578,0.58594 0.32226,0.38737 0.4834,0.95866 0.4834,1.71386"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3299" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 428.41031,375.64706 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3301" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 432.07242,374.09433 0,1.55273 1.85058,0 0,0.69825 -1.85058,0 0,2.96875 c 0,0.44596 0.0602,0.73242 0.18066,0.85937 0.1237,0.12696 0.37272,0.19043 0.74707,0.19043 l 0.92285,0 0,0.75195 -0.92285,0 c -0.69336,0 -1.17187,-0.12858 -1.43554,-0.38574 -0.26368,-0.26041 -0.39551,-0.73242 -0.39551,-1.41601 l 0,-2.96875 -0.65918,0 0,-0.69825 0.65918,0 0,-1.55273 0.90332,0"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3303" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 437.22867,376.27695 c -0.48178,0 -0.86263,0.1888 -1.14258,0.5664 -0.27995,0.37436 -0.41992,0.88868 -0.41992,1.54297 0,0.6543 0.13834,1.17025 0.41504,1.54785 0.27994,0.37435 0.66243,0.56153 1.14746,0.56153 0.47851,0 0.85774,-0.1888 1.13769,-0.56641 0.27995,-0.3776 0.41992,-0.89192 0.41993,-1.54297 -1e-5,-0.64778 -0.13998,-1.16048 -0.41993,-1.53808 -0.27995,-0.38086 -0.65918,-0.57129 -1.13769,-0.57129 m 0,-0.76172 c 0.78124,0 1.39485,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66894,2.10937 0,0.89519 -0.22298,1.59831 -0.66894,2.10938 -0.44597,0.50781 -1.05958,0.76172 -1.84082,0.76172 -0.78451,0 -1.39974,-0.25391 -1.8457,-0.76172 -0.44271,-0.51107 -0.66407,-1.21419 -0.66407,-2.10938 0,-0.89843 0.22136,-1.60156 0.66407,-2.10937 0.44596,-0.50781 1.06119,-0.76172 1.8457,-0.76172"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3305" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 444.39175,376.48691 c -0.10091,-0.0586 -0.21159,-0.10091 -0.33203,-0.12696 -0.11719,-0.0293 -0.2474,-0.0439 -0.39062,-0.0439 -0.50782,0 -0.89844,0.16602 -1.17188,0.49805 -0.27018,0.32878 -0.40527,0.80241 -0.40527,1.42089 l 0,2.88086 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.1888,-0.33202 0.43457,-0.57779 0.7373,-0.7373 0.30274,-0.16276 0.67057,-0.24414 1.10352,-0.24414 0.0618,0 0.1302,0.005 0.20508,0.0147 0.0749,0.007 0.15787,0.0179 0.24902,0.0342 l 0.005,0.92285"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3307" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 449.39664,380.2955 0,2.90039 -0.90332,0 0,-7.54883 0.90332,0 0,0.83008 c 0.1888,-0.32551 0.42643,-0.5664 0.71289,-0.72265 0.28971,-0.1595 0.63476,-0.23926 1.03515,-0.23926 0.66406,0 1.2028,0.26368 1.61621,0.79101 0.41667,0.52735 0.625,1.22071 0.625,2.08008 0,0.85938 -0.20833,1.55274 -0.625,2.08008 -0.41341,0.52734 -0.95215,0.79102 -1.61621,0.79102 -0.40039,0 -0.74544,-0.0781 -1.03515,-0.23438 -0.28646,-0.1595 -0.52409,-0.40202 -0.71289,-0.72754 m 3.05664,-1.90918 c -1e-5,-0.6608 -0.13673,-1.17838 -0.41016,-1.55273 -0.27019,-0.3776 -0.64291,-0.5664 -1.11816,-0.56641 -0.47527,1e-5 -0.84961,0.18881 -1.12305,0.56641 -0.27018,0.37435 -0.40527,0.89193 -0.40527,1.55273 0,0.66081 0.13509,1.18002 0.40527,1.55762 0.27344,0.37435 0.64778,0.56152 1.12305,0.56152 0.47525,0 0.84797,-0.18717 1.11816,-0.56152 0.27343,-0.3776 0.41015,-0.89681 0.41016,-1.55762"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3309" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 456.99429,376.27695 c -0.48177,0 -0.86263,0.1888 -1.14257,0.5664 -0.27995,0.37436 -0.41993,0.88868 -0.41993,1.54297 0,0.6543 0.13835,1.17025 0.41504,1.54785 0.27995,0.37435 0.66243,0.56153 1.14746,0.56153 0.47852,0 0.85775,-0.1888 1.1377,-0.56641 0.27994,-0.3776 0.41992,-0.89192 0.41992,-1.54297 0,-0.64778 -0.13998,-1.16048 -0.41992,-1.53808 -0.27995,-0.38086 -0.65918,-0.57129 -1.1377,-0.57129 m 0,-0.76172 c 0.78125,0 1.39486,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66895,2.10937 -10e-6,0.89519 -0.22299,1.59831 -0.66895,2.10938 -0.44596,0.50781 -1.05957,0.76172 -1.84082,0.76172 -0.7845,0 -1.39974,-0.25391 -1.8457,-0.76172 -0.44271,-0.51107 -0.66406,-1.21419 -0.66406,-2.10938 0,-0.89843 0.22135,-1.60156 0.66406,-2.10937 0.44596,-0.50781 1.0612,-0.76172 1.8457,-0.76172"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3311" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 464.47476,375.8082 0,0.84961 c -0.25391,-0.13021 -0.51758,-0.22786 -0.79101,-0.29297 -0.27344,-0.0651 -0.55665,-0.0976 -0.84961,-0.0977 -0.44597,1e-5 -0.78126,0.0684 -1.00586,0.20508 -0.22136,0.13672 -0.33204,0.3418 -0.33203,0.61523 -10e-6,0.20834 0.0798,0.37273 0.23925,0.49317 0.15951,0.11719 0.48015,0.22949 0.96192,0.33691 l 0.30762,0.0684 c 0.63801,0.13672 1.09049,0.33041 1.35742,0.58106 0.27017,0.24739 0.40527,0.59407 0.40527,1.04004 0,0.50781 -0.20183,0.90983 -0.60547,1.20605 -0.40039,0.29622 -0.95215,0.44434 -1.65527,0.44434 -0.29297,0 -0.59896,-0.0293 -0.91797,-0.0879 -0.31576,-0.0553 -0.64942,-0.13998 -1.00098,-0.25391 l 0,-0.92774 c 0.33203,0.17253 0.65918,0.30274 0.98145,0.39063 0.32226,0.0846 0.64127,0.12695 0.95703,0.12695 0.42317,0 0.74869,-0.0716 0.97656,-0.21484 0.22786,-0.14648 0.3418,-0.35156 0.3418,-0.61524 0,-0.24413 -0.083,-0.43131 -0.24902,-0.56152 -0.16277,-0.13021 -0.52247,-0.25553 -1.07911,-0.37598 l -0.3125,-0.0732 c -0.55664,-0.11718 -0.95866,-0.29622 -1.20605,-0.53711 -0.2474,-0.24413 -0.37109,-0.57779 -0.37109,-1.00097 0,-0.51432 0.18229,-0.91146 0.54687,-1.19141 0.36458,-0.27994 0.88216,-0.41992 1.55274,-0.41992 0.33202,0 0.64452,0.0244 0.9375,0.0732 0.29296,0.0488 0.56314,0.12208 0.81054,0.21973"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3313" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 466.20328,375.64706 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3315" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 469.86539,374.09433 0,1.55273 1.85058,0 0,0.69825 -1.85058,0 0,2.96875 c 0,0.44596 0.0602,0.73242 0.18066,0.85937 0.1237,0.12696 0.37272,0.19043 0.74707,0.19043 l 0.92285,0 0,0.75195 -0.92285,0 c -0.69336,0 -1.17188,-0.12858 -1.43555,-0.38574 -0.26367,-0.26041 -0.3955,-0.73242 -0.3955,-1.41601 l 0,-2.96875 -0.65918,0 0,-0.69825 0.65918,0 0,-1.55273 0.90332,0"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3317" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 472.9025,375.64706 0.89843,0 0,5.46875 -0.89843,0 0,-5.46875 m 0,-2.1289 0.89843,0 0,1.13769 -0.89843,0 0,-1.13769"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3319" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 477.79507,376.27695 c -0.48177,0 -0.86263,0.1888 -1.14257,0.5664 -0.27995,0.37436 -0.41993,0.88868 -0.41993,1.54297 0,0.6543 0.13835,1.17025 0.41504,1.54785 0.27995,0.37435 0.66244,0.56153 1.14746,0.56153 0.47852,0 0.85775,-0.1888 1.1377,-0.56641 0.27994,-0.3776 0.41992,-0.89192 0.41992,-1.54297 0,-0.64778 -0.13998,-1.16048 -0.41992,-1.53808 -0.27995,-0.38086 -0.65918,-0.57129 -1.1377,-0.57129 m 0,-0.76172 c 0.78125,0 1.39486,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66895,2.10937 -1e-5,0.89519 -0.22299,1.59831 -0.66895,2.10938 -0.44596,0.50781 -1.05957,0.76172 -1.84082,0.76172 -0.7845,0 -1.39974,-0.25391 -1.8457,-0.76172 -0.44271,-0.51107 -0.66406,-1.21419 -0.66406,-2.10938 0,-0.89843 0.22135,-1.60156 0.66406,-2.10937 0.44596,-0.50781 1.0612,-0.76172 1.8457,-0.76172"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3321" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 486.33511,377.81503 0,3.30078 -0.89843,0 0,-3.27148 c -1e-5,-0.51757 -0.10092,-0.90494 -0.30274,-1.16211 -0.20183,-0.25716 -0.50456,-0.38574 -0.9082,-0.38574 -0.48503,0 -0.86752,0.15463 -1.14746,0.46387 -0.27995,0.30924 -0.41993,0.73079 -0.41992,1.26464 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.21484,-0.32877 0.46712,-0.57454 0.75683,-0.7373 0.29297,-0.16276 0.62988,-0.24414 1.01074,-0.24414 0.62825,0 1.10351,0.19532 1.42579,0.58594 0.32226,0.38737 0.48339,0.95866 0.48339,1.71386"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3323" />
 | 
			
		||||
    </g>
 | 
			
		||||
    <g
 | 
			
		||||
       style="font-size:12px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#00b800;fill-opacity:1;stroke:none;font-family:Sans"
 | 
			
		||||
       id="text3773">
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 242.85294,625.22699 0,1.1543 c -0.44923,-0.21484 -0.87306,-0.375 -1.27149,-0.48047 -0.39844,-0.10546 -0.78321,-0.1582 -1.1543,-0.15821 -0.64453,10e-6 -1.14258,0.12501 -1.49414,0.375 -0.34765,0.25001 -0.52148,0.60548 -0.52148,1.06641 0,0.38673 0.11523,0.67969 0.3457,0.87891 0.23438,0.19532 0.67578,0.35352 1.32422,0.47461 l 0.71485,0.14648 c 0.8828,0.16797 1.53319,0.46485 1.95117,0.89063 0.42187,0.42187 0.6328,0.98828 0.63281,1.69921 -1e-5,0.84766 -0.28516,1.49024 -0.85547,1.92774 -0.56641,0.4375 -1.39844,0.65625 -2.49609,0.65625 -0.41407,0 -0.85547,-0.0469 -1.32422,-0.14063 -0.46485,-0.0937 -0.94727,-0.23242 -1.44727,-0.41601 l 0,-1.21875 c 0.48047,0.26953 0.95117,0.47266 1.41211,0.60937 0.46094,0.13672 0.91406,0.20508 1.35938,0.20508 0.67577,0 1.19726,-0.13281 1.56445,-0.39844 0.36718,-0.26562 0.55078,-0.64453 0.55078,-1.13671 0,-0.42969 -0.13282,-0.76563 -0.39844,-1.00782 -0.26172,-0.24218 -0.69336,-0.42382 -1.29492,-0.54492 l -0.7207,-0.14062 c -0.88282,-0.17578 -1.52149,-0.45117 -1.91602,-0.82618 -0.39453,-0.37499 -0.59179,-0.89647 -0.59179,-1.56445 0,-0.77343 0.27148,-1.3828 0.81445,-1.82812 0.54687,-0.44531 1.29882,-0.66796 2.25586,-0.66797 0.41015,10e-6 0.82812,0.0371 1.25391,0.11133 0.42577,0.0742 0.86132,0.18555 1.30664,0.33398"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3355" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 250.79239,630.13715 0,0.52734 -4.95703,0 c 0.0469,0.74219 0.26953,1.3086 0.66797,1.69922 0.40234,0.38672 0.96093,0.58008 1.67578,0.58008 0.41406,0 0.81445,-0.0508 1.20117,-0.15235 0.39062,-0.10156 0.77734,-0.2539 1.16016,-0.45703 l 0,1.01953 c -0.38673,0.16407 -0.78321,0.28907 -1.18946,0.375 -0.40625,0.0859 -0.81836,0.12891 -1.23633,0.12891 -1.04687,0 -1.87695,-0.30469 -2.49023,-0.91406 -0.60938,-0.60938 -0.91406,-1.43359 -0.91406,-2.47266 0,-1.07421 0.28906,-1.92578 0.86719,-2.55469 0.58202,-0.6328 1.36523,-0.94921 2.3496,-0.94922 0.88281,10e-6 1.58008,0.28517 2.0918,0.85547 0.51562,0.56641 0.77343,1.3379 0.77344,2.31446 m -1.07813,-0.31641 c -0.008,-0.58984 -0.17383,-1.06054 -0.49804,-1.41211 -0.32032,-0.35156 -0.7461,-0.52734 -1.27735,-0.52734 -0.60156,0 -1.08398,0.16992 -1.44726,0.50976 -0.35938,0.33985 -0.56641,0.81837 -0.6211,1.43555 l 3.84375,-0.006"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3357" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 257.28458,627.37738 0,1.00781 c -0.3047,-0.16796 -0.61134,-0.29296 -0.91993,-0.375 -0.30469,-0.0859 -0.61328,-0.1289 -0.92578,-0.1289 -0.69922,0 -1.24219,0.22266 -1.6289,0.66797 -0.38672,0.44141 -0.58008,1.0625 -0.58008,1.86328 0,0.80078 0.19336,1.42383 0.58008,1.86914 0.38671,0.4414 0.92968,0.66211 1.6289,0.66211 0.3125,0 0.62109,-0.041 0.92578,-0.12305 0.30859,-0.0859 0.61523,-0.21289 0.91993,-0.38086 l 0,0.99609 c -0.30079,0.14063 -0.61329,0.2461 -0.9375,0.31641 -0.32032,0.0703 -0.66212,0.10547 -1.02539,0.10547 -0.98829,0 -1.77344,-0.31055 -2.35547,-0.93164 -0.58204,-0.62109 -0.87305,-1.45898 -0.87305,-2.51367 0,-1.07031 0.29297,-1.91211 0.87891,-2.52539 0.58984,-0.61328 1.39648,-0.91992 2.41992,-0.91993 0.33203,10e-6 0.65624,0.0352 0.97265,0.10547 0.31641,0.0664 0.62305,0.16798 0.91993,0.30469"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3359" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 261.71426,627.88129 c -0.57812,0 -1.03515,0.22656 -1.37109,0.67968 -0.33594,0.44923 -0.50391,1.06641 -0.50391,1.85157 0,0.78516 0.16602,1.4043 0.49805,1.85742 0.33594,0.44922 0.79492,0.67383 1.37695,0.67383 0.57422,0 1.0293,-0.22656 1.36524,-0.67969 0.33593,-0.45312 0.5039,-1.07031 0.5039,-1.85156 0,-0.77734 -0.16797,-1.39258 -0.5039,-1.84571 -0.33594,-0.45702 -0.79102,-0.68554 -1.36524,-0.68554 m 0,-0.91407 c 0.9375,10e-6 1.67383,0.3047 2.20899,0.91407 0.53515,0.60938 0.80273,1.45313 0.80273,2.53125 0,1.07422 -0.26758,1.91797 -0.80273,2.53125 -0.53516,0.60937 -1.27149,0.91406 -2.20899,0.91406 -0.94141,0 -1.67969,-0.30469 -2.21484,-0.91406 -0.53125,-0.61328 -0.79688,-1.45703 -0.79687,-2.53125 -10e-6,-1.07812 0.26562,-1.92187 0.79687,-2.53125 0.53515,-0.60937 1.27343,-0.91406 2.21484,-0.91407"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3361" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 271.96231,629.72699 0,3.96094 -1.07812,0 0,-3.92578 c -10e-6,-0.62109 -0.1211,-1.08594 -0.36329,-1.39454 -0.24219,-0.30858 -0.60547,-0.46288 -1.08984,-0.46289 -0.58203,10e-6 -1.04102,0.18556 -1.37695,0.55664 -0.33594,0.3711 -0.50391,0.87696 -0.50391,1.51758 l 0,3.70899 -1.08398,0 0,-6.5625 1.08398,0 0,1.01953 c 0.25781,-0.39453 0.56055,-0.68945 0.9082,-0.88477 0.35156,-0.1953 0.75586,-0.29296 1.2129,-0.29297 0.7539,10e-6 1.32421,0.23439 1.71093,0.70313 0.38672,0.46485 0.58007,1.15039 0.58008,2.05664"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3363" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 278.44278,628.12152 0,-3.55078 1.07812,0 0,9.11719 -1.07812,0 0,-0.98438 c -0.22657,0.39063 -0.51368,0.68164 -0.86133,0.87305 -0.34375,0.1875 -0.75781,0.28125 -1.24219,0.28125 -0.79297,0 -1.43945,-0.31641 -1.93945,-0.94922 -0.49609,-0.63281 -0.74414,-1.46484 -0.74414,-2.49609 0,-1.03125 0.24805,-1.86328 0.74414,-2.4961 0.5,-0.6328 1.14648,-0.94921 1.93945,-0.94922 0.48438,10e-6 0.89844,0.0957 1.24219,0.28711 0.34765,0.18751 0.63476,0.47657 0.86133,0.86719 m -3.67383,2.29102 c 0,0.79297 0.16211,1.41601 0.48633,1.86914 0.32812,0.44922 0.77734,0.67383 1.34766,0.67383 0.5703,0 1.01952,-0.22461 1.34765,-0.67383 0.32812,-0.45313 0.49218,-1.07617 0.49219,-1.86914 -1e-5,-0.79297 -0.16407,-1.41406 -0.49219,-1.86328 -0.32813,-0.45312 -0.77735,-0.67969 -1.34765,-0.67969 -0.57032,0 -1.01954,0.22657 -1.34766,0.67969 -0.32422,0.44922 -0.48633,1.07031 -0.48633,1.86328"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3365" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 284.72403,630.3891 c -0.8711,0 -1.47461,0.0996 -1.81055,0.29883 -0.33594,0.19922 -0.50391,0.53906 -0.5039,1.01953 -1e-5,0.38281 0.12499,0.6875 0.375,0.91406 0.2539,0.22266 0.59765,0.33399 1.03125,0.33399 0.59765,0 1.07616,-0.21094 1.43554,-0.63282 0.36328,-0.42578 0.54492,-0.99023 0.54493,-1.69336 l 0,-0.24023 -1.07227,0 m 2.15039,-0.44531 0,3.74414 -1.07812,0 0,-0.9961 c -0.2461,0.39844 -0.55274,0.69336 -0.91993,0.88477 -0.36719,0.1875 -0.81641,0.28125 -1.34765,0.28125 -0.67188,0 -1.20704,-0.1875 -1.60547,-0.5625 -0.39453,-0.37891 -0.5918,-0.88477 -0.5918,-1.51758 0,-0.73828 0.24609,-1.29492 0.73828,-1.66992 0.49609,-0.375 1.23437,-0.5625 2.21485,-0.5625 l 1.51172,0 0,-0.10547 c -10e-6,-0.49609 -0.16407,-0.8789 -0.49219,-1.14844 -0.32423,-0.27343 -0.78126,-0.41015 -1.3711,-0.41015 -0.375,0 -0.74023,0.0449 -1.0957,0.13476 -0.35547,0.0899 -0.69727,0.22462 -1.02539,0.4043 l 0,-0.99609 c 0.39453,-0.15234 0.77734,-0.26562 1.14844,-0.33985 0.37109,-0.0781 0.73242,-0.11718 1.08398,-0.11719 0.94922,10e-6 1.6582,0.2461 2.12696,0.73829 0.46874,0.49219 0.70311,1.23828 0.70312,2.23828"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3367" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 292.90372,628.13324 c -0.1211,-0.0703 -0.25391,-0.12109 -0.39844,-0.15234 -0.14063,-0.0352 -0.29688,-0.0527 -0.46875,-0.0527 -0.60938,10e-6 -1.07813,0.19923 -1.40625,0.59766 -0.32422,0.39453 -0.48633,0.96289 -0.48633,1.70508 l 0,3.45703 -1.08398,0 0,-6.5625 1.08398,0 0,1.01953 c 0.22656,-0.39843 0.52148,-0.69335 0.88477,-0.88477 0.36327,-0.1953 0.80468,-0.29296 1.32422,-0.29297 0.0742,10e-6 0.15624,0.006 0.24609,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10742"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3369" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 296.77676,634.2973 c -0.30469,0.78125 -0.60156,1.29102 -0.89062,1.5293 -0.28907,0.23828 -0.67578,0.35742 -1.16016,0.35742 l -0.86133,0 0,-0.90234 0.63282,0 c 0.29687,0 0.52734,-0.0703 0.6914,-0.21094 0.16406,-0.14063 0.3457,-0.47266 0.54493,-0.99609 l 0.19335,-0.49219 -2.65429,-6.45703 1.14258,0 2.05078,5.13281 2.05078,-5.13281 1.14258,0 -2.88282,7.17187"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3371" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 305.01505,624.93988 1.76367,0 2.23242,5.95313 2.24414,-5.95313 1.76367,0 0,8.74805 -1.1543,0 0,-7.68164 -2.25585,6 -1.18946,0 -2.25586,-6 0,7.68164 -1.14843,0 0,-8.74805"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3373" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 317.87051,627.88129 c -0.57812,0 -1.03515,0.22656 -1.37109,0.67968 -0.33594,0.44923 -0.50391,1.06641 -0.50391,1.85157 0,0.78516 0.16602,1.4043 0.49805,1.85742 0.33594,0.44922 0.79492,0.67383 1.37695,0.67383 0.57422,0 1.0293,-0.22656 1.36524,-0.67969 0.33593,-0.45312 0.5039,-1.07031 0.5039,-1.85156 0,-0.77734 -0.16797,-1.39258 -0.5039,-1.84571 -0.33594,-0.45702 -0.79102,-0.68554 -1.36524,-0.68554 m 0,-0.91407 c 0.9375,10e-6 1.67383,0.3047 2.20899,0.91407 0.53515,0.60938 0.80273,1.45313 0.80273,2.53125 0,1.07422 -0.26758,1.91797 -0.80273,2.53125 -0.53516,0.60937 -1.27149,0.91406 -2.20899,0.91406 -0.94141,0 -1.67969,-0.30469 -2.21484,-0.91406 -0.53125,-0.61328 -0.79688,-1.45703 -0.79687,-2.53125 -10e-6,-1.07812 0.26562,-1.92187 0.79687,-2.53125 0.53515,-0.60937 1.27343,-0.91406 2.21484,-0.91407"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3375" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 328.11856,629.72699 0,3.96094 -1.07812,0 0,-3.92578 c -10e-6,-0.62109 -0.1211,-1.08594 -0.36329,-1.39454 -0.24219,-0.30858 -0.60547,-0.46288 -1.08984,-0.46289 -0.58203,10e-6 -1.04102,0.18556 -1.37695,0.55664 -0.33594,0.3711 -0.50391,0.87696 -0.50391,1.51758 l 0,3.70899 -1.08398,0 0,-6.5625 1.08398,0 0,1.01953 c 0.25781,-0.39453 0.56055,-0.68945 0.9082,-0.88477 0.35156,-0.1953 0.75586,-0.29296 1.2129,-0.29297 0.7539,10e-6 1.32421,0.23439 1.71093,0.70313 0.38672,0.46485 0.58007,1.15039 0.58008,2.05664"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3377" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 330.28067,627.12543 1.07813,0 0,6.5625 -1.07813,0 0,-6.5625 m 0,-2.55469 1.07813,0 0,1.36523 -1.07813,0 0,-1.36523"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3379" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 334.6752,625.26215 0,1.86328 2.2207,0 0,0.83789 -2.2207,0 0,3.5625 c 0,0.53516 0.0723,0.87891 0.2168,1.03125 0.14843,0.15234 0.44726,0.22851 0.89648,0.22851 l 1.10742,0 0,0.90235 -1.10742,0 c -0.83203,0 -1.40625,-0.1543 -1.72265,-0.46289 -0.31641,-0.3125 -0.47461,-0.87891 -0.47461,-1.69922 l 0,-3.5625 -0.79102,0 0,-0.83789 0.79102,0 0,-1.86328 1.08398,0"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3381" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 340.8627,627.88129 c -0.57813,0 -1.03516,0.22656 -1.37109,0.67968 -0.33594,0.44923 -0.50391,1.06641 -0.50391,1.85157 0,0.78516 0.16602,1.4043 0.49805,1.85742 0.33593,0.44922 0.79492,0.67383 1.37695,0.67383 0.57422,0 1.02929,-0.22656 1.36524,-0.67969 0.33593,-0.45312 0.5039,-1.07031 0.5039,-1.85156 0,-0.77734 -0.16797,-1.39258 -0.5039,-1.84571 -0.33595,-0.45702 -0.79102,-0.68554 -1.36524,-0.68554 m 0,-0.91407 c 0.9375,10e-6 1.67382,0.3047 2.20899,0.91407 0.53515,0.60938 0.80272,1.45313 0.80273,2.53125 -10e-6,1.07422 -0.26758,1.91797 -0.80273,2.53125 -0.53517,0.60937 -1.27149,0.91406 -2.20899,0.91406 -0.94141,0 -1.67969,-0.30469 -2.21484,-0.91406 -0.53125,-0.61328 -0.79688,-1.45703 -0.79688,-2.53125 0,-1.07812 0.26563,-1.92187 0.79688,-2.53125 0.53515,-0.60937 1.27343,-0.91406 2.21484,-0.91407"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3383" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 349.4584,628.13324 c -0.12109,-0.0703 -0.25391,-0.12109 -0.39843,-0.15234 -0.14063,-0.0352 -0.29688,-0.0527 -0.46875,-0.0527 -0.60938,10e-6 -1.07813,0.19923 -1.40625,0.59766 -0.32422,0.39453 -0.48633,0.96289 -0.48633,1.70508 l 0,3.45703 -1.08399,0 0,-6.5625 1.08399,0 0,1.01953 c 0.22656,-0.39843 0.52148,-0.69335 0.88476,-0.88477 0.36328,-0.1953 0.80469,-0.29296 1.32422,-0.29297 0.0742,10e-6 0.15625,0.006 0.2461,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10742"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3385" />
 | 
			
		||||
    </g>
 | 
			
		||||
    <g
 | 
			
		||||
       style="font-size:12px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#00b800;fill-opacity:1;stroke:none;font-family:Sans"
 | 
			
		||||
       id="text3777">
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 575.27002,547.52673 0,3.28711 1.48828,0 c 0.55078,10e-6 0.97656,-0.14257 1.27734,-0.42773 0.30078,-0.28515 0.45117,-0.6914 0.45118,-1.21875 -10e-6,-0.52343 -0.1504,-0.92773 -0.45118,-1.21289 -0.30078,-0.28515 -0.72656,-0.42773 -1.27734,-0.42774 l -1.48828,0 m -1.18359,-0.97265 2.67187,0 c 0.98046,10e-6 1.7207,0.22266 2.2207,0.66797 0.5039,0.44141 0.75586,1.08985 0.75586,1.94531 0,0.86328 -0.25196,1.51563 -0.75586,1.95703 -0.5,0.44141 -1.24024,0.66211 -2.2207,0.66211 l -1.48828,0 0,3.51562 -1.18359,0 0,-8.74804"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3326" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 584.87354,549.74744 c -0.1211,-0.0703 -0.25392,-0.12109 -0.39844,-0.15235 -0.14063,-0.0352 -0.29688,-0.0527 -0.46875,-0.0527 -0.60938,0 -1.07813,0.19922 -1.40625,0.59765 -0.32422,0.39454 -0.48633,0.9629 -0.48633,1.70508 l 0,3.45703 -1.08398,0 0,-6.5625 1.08398,0 0,1.01954 c 0.22656,-0.39844 0.52148,-0.69336 0.88477,-0.88477 0.36327,-0.19531 0.80468,-0.29296 1.32421,-0.29297 0.0742,10e-6 0.15625,0.006 0.2461,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10743"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3328" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 586.01611,548.73962 1.07813,0 0,6.5625 -1.07813,0 0,-6.5625 m 0,-2.55468 1.07813,0 0,1.36523 -1.07813,0 0,-1.36523"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3330" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 594.45361,549.99939 c 0.26953,-0.48437 0.59179,-0.84179 0.9668,-1.07227 0.37499,-0.23046 0.8164,-0.34569 1.32422,-0.3457 0.68358,10e-6 1.21093,0.24024 1.58203,0.7207 0.37108,0.47657 0.55663,1.15626 0.55664,2.03907 l 0,3.96093 -1.08398,0 0,-3.92578 c -10e-6,-0.6289 -0.11134,-1.0957 -0.33399,-1.40039 -0.22266,-0.30468 -0.56251,-0.45702 -1.01953,-0.45703 -0.5586,10e-6 -1.00001,0.18555 -1.32422,0.55664 -0.32422,0.3711 -0.48633,0.87696 -0.48633,1.51758 l 0,3.70898 -1.08398,0 0,-3.92578 c -1e-5,-0.63281 -0.11133,-1.0996 -0.33398,-1.40039 -0.22267,-0.30468 -0.56642,-0.45702 -1.03125,-0.45703 -0.55079,10e-6 -0.98829,0.18751 -1.3125,0.5625 -0.32423,0.3711 -0.48634,0.87501 -0.48633,1.51172 l 0,3.70898 -1.08399,0 0,-6.5625 1.08399,0 0,1.01954 c 0.24609,-0.40234 0.54101,-0.69922 0.88476,-0.89063 0.34375,-0.1914 0.75195,-0.2871 1.22461,-0.28711 0.47656,10e-6 0.88086,0.1211 1.21289,0.36328 0.33593,0.2422 0.58398,0.59376 0.74414,1.05469"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3332" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 604.02197,552.0033 c -0.87109,0 -1.47461,0.0996 -1.81054,0.29882 -0.33594,0.19923 -0.50391,0.53907 -0.50391,1.01954 0,0.38281 0.125,0.6875 0.375,0.91406 0.2539,0.22265 0.59765,0.33398 1.03125,0.33398 0.59765,0 1.07617,-0.21093 1.43555,-0.63281 0.36327,-0.42578 0.54491,-0.99023 0.54492,-1.69336 l 0,-0.24023 -1.07227,0 m 2.15039,-0.44532 0,3.74414 -1.07812,0 0,-0.99609 c -0.2461,0.39844 -0.55274,0.69336 -0.91992,0.88477 -0.36719,0.1875 -0.81641,0.28125 -1.34766,0.28125 -0.67188,0 -1.20703,-0.1875 -1.60547,-0.5625 -0.39453,-0.37891 -0.5918,-0.88477 -0.5918,-1.51758 0,-0.73828 0.2461,-1.29492 0.73829,-1.66992 0.49609,-0.375 1.23437,-0.5625 2.21484,-0.5625 l 1.51172,0 0,-0.10547 c -10e-6,-0.49609 -0.16407,-0.8789 -0.49219,-1.14844 -0.32422,-0.27343 -0.78125,-0.41015 -1.37109,-0.41016 -0.37501,10e-6 -0.74024,0.0449 -1.09571,0.13477 -0.35547,0.0898 -0.69726,0.22461 -1.02539,0.4043 l 0,-0.9961 c 0.39453,-0.15234 0.77735,-0.26562 1.14844,-0.33984 0.37109,-0.0781 0.73242,-0.11718 1.08399,-0.11719 0.94921,10e-6 1.65819,0.2461 2.12695,0.73828 0.46874,0.4922 0.70312,1.23829 0.70312,2.23828"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3334" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 612.20166,549.74744 c -0.1211,-0.0703 -0.25391,-0.12109 -0.39844,-0.15235 -0.14063,-0.0352 -0.29688,-0.0527 -0.46875,-0.0527 -0.60938,0 -1.07813,0.19922 -1.40625,0.59765 -0.32422,0.39454 -0.48633,0.9629 -0.48633,1.70508 l 0,3.45703 -1.08398,0 0,-6.5625 1.08398,0 0,1.01954 c 0.22656,-0.39844 0.52149,-0.69336 0.88477,-0.88477 0.36328,-0.19531 0.80468,-0.29296 1.32422,-0.29297 0.0742,10e-6 0.15624,0.006 0.24609,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10743"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3336" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 616.07471,555.9115 c -0.30469,0.78125 -0.60157,1.29101 -0.89063,1.5293 -0.28906,0.23827 -0.67578,0.35742 -1.16015,0.35742 l -0.86133,0 0,-0.90235 0.63281,0 c 0.29687,0 0.52734,-0.0703 0.69141,-0.21093 0.16406,-0.14063 0.3457,-0.47266 0.54492,-0.9961 l 0.19336,-0.49218 -2.6543,-6.45704 1.14258,0 2.05078,5.13282 2.05078,-5.13282 1.14258,0 -2.88281,7.17188"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3338" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 624.31299,546.55408 1.76367,0 2.23242,5.95312 2.24414,-5.95312 1.76367,0 0,8.74804 -1.15429,0 0,-7.68164 -2.25586,6 -1.18945,0 -2.25586,-6 0,7.68164 -1.14844,0 0,-8.74804"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3340" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 637.16846,549.49548 c -0.57813,10e-6 -1.03516,0.22657 -1.3711,0.67969 -0.33594,0.44922 -0.5039,1.06641 -0.5039,1.85156 0,0.78516 0.16601,1.4043 0.49804,1.85743 0.33594,0.44921 0.79492,0.67382 1.37696,0.67382 0.57421,0 1.02929,-0.22656 1.36523,-0.67968 0.33593,-0.45313 0.5039,-1.07031 0.50391,-1.85157 -10e-6,-0.77734 -0.16798,-1.39257 -0.50391,-1.8457 -0.33594,-0.45703 -0.79102,-0.68554 -1.36523,-0.68555 m 0,-0.91406 c 0.93749,10e-6 1.67382,0.30469 2.20898,0.91406 0.53515,0.60938 0.80273,1.45313 0.80274,2.53125 -10e-6,1.07422 -0.26759,1.91797 -0.80274,2.53125 -0.53516,0.60938 -1.27149,0.91407 -2.20898,0.91407 -0.94141,0 -1.67969,-0.30469 -2.21485,-0.91407 -0.53125,-0.61328 -0.79687,-1.45703 -0.79687,-2.53125 0,-1.07812 0.26562,-1.92187 0.79687,-2.53125 0.53516,-0.60937 1.27344,-0.91405 2.21485,-0.91406"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3342" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 647.4165,551.34119 0,3.96093 -1.07812,0 0,-3.92578 c -10e-6,-0.62109 -0.1211,-1.08593 -0.36328,-1.39453 -0.24219,-0.30859 -0.60548,-0.46288 -1.08985,-0.46289 -0.58203,10e-6 -1.04101,0.18555 -1.37695,0.55664 -0.33594,0.3711 -0.50391,0.87696 -0.50391,1.51758 l 0,3.70898 -1.08398,0 0,-6.5625 1.08398,0 0,1.01954 c 0.25781,-0.39453 0.56055,-0.68945 0.90821,-0.88477 0.35156,-0.19531 0.75585,-0.29296 1.21289,-0.29297 0.7539,10e-6 1.32421,0.23438 1.71094,0.70313 0.38671,0.46485 0.58007,1.15039 0.58007,2.05664"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3344" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 649.57861,548.73962 1.07813,0 0,6.5625 -1.07813,0 0,-6.5625 m 0,-2.55468 1.07813,0 0,1.36523 -1.07813,0 0,-1.36523"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3346" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 653.97314,546.87634 0,1.86328 2.22071,0 0,0.83789 -2.22071,0 0,3.5625 c 0,0.53516 0.0723,0.87891 0.2168,1.03125 0.14844,0.15235 0.44726,0.22852 0.89649,0.22852 l 1.10742,0 0,0.90234 -1.10742,0 c -0.83204,0 -1.40626,-0.15429 -1.72266,-0.46289 -0.31641,-0.3125 -0.47461,-0.8789 -0.47461,-1.69922 l 0,-3.5625 -0.79102,0 0,-0.83789 0.79102,0 0,-1.86328 1.08398,0"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3348" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 660.16064,549.49548 c -0.57812,10e-6 -1.03515,0.22657 -1.37109,0.67969 -0.33594,0.44922 -0.50391,1.06641 -0.50391,1.85156 0,0.78516 0.16602,1.4043 0.49805,1.85743 0.33594,0.44921 0.79492,0.67382 1.37695,0.67382 0.57422,0 1.0293,-0.22656 1.36524,-0.67968 0.33593,-0.45313 0.5039,-1.07031 0.50391,-1.85157 -1e-5,-0.77734 -0.16798,-1.39257 -0.50391,-1.8457 -0.33594,-0.45703 -0.79102,-0.68554 -1.36524,-0.68555 m 0,-0.91406 c 0.9375,10e-6 1.67383,0.30469 2.20899,0.91406 0.53515,0.60938 0.80273,1.45313 0.80273,2.53125 0,1.07422 -0.26758,1.91797 -0.80273,2.53125 -0.53516,0.60938 -1.27149,0.91407 -2.20899,0.91407 -0.9414,0 -1.67968,-0.30469 -2.21484,-0.91407 -0.53125,-0.61328 -0.79687,-1.45703 -0.79687,-2.53125 0,-1.07812 0.26562,-1.92187 0.79687,-2.53125 0.53516,-0.60937 1.27344,-0.91405 2.21484,-0.91406"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3350" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 668.75635,549.74744 c -0.1211,-0.0703 -0.25391,-0.12109 -0.39844,-0.15235 -0.14063,-0.0352 -0.29688,-0.0527 -0.46875,-0.0527 -0.60938,0 -1.07813,0.19922 -1.40625,0.59765 -0.32422,0.39454 -0.48633,0.9629 -0.48633,1.70508 l 0,3.45703 -1.08398,0 0,-6.5625 1.08398,0 0,1.01954 c 0.22656,-0.39844 0.52148,-0.69336 0.88477,-0.88477 0.36328,-0.19531 0.80468,-0.29296 1.32422,-0.29297 0.0742,10e-6 0.15624,0.006 0.24609,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10743"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3352" />
 | 
			
		||||
    </g>
 | 
			
		||||
    <g
 | 
			
		||||
       style="font-size:12px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#0000ff;fill-opacity:1;stroke:none;font-family:Sans"
 | 
			
		||||
       id="text3781">
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 612.64136,657.77118 -3.33985,-8.74805 1.23633,0 2.77149,7.36524 2.77734,-7.36524 1.23047,0 -3.33399,8.74805 -1.34179,0"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3401" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 618.28394,651.20868 1.07812,0 0,6.5625 -1.07812,0 0,-6.5625 m 0,-2.55469 1.07812,0 0,1.36524 -1.07812,0 0,-1.36524"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3403" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 625.41479,652.21649 c -0.12109,-0.0703 -0.25391,-0.12109 -0.39843,-0.15234 -0.14063,-0.0352 -0.29688,-0.0527 -0.46875,-0.0527 -0.60938,1e-5 -1.07813,0.19923 -1.40625,0.59766 -0.32422,0.39454 -0.48633,0.96289 -0.48633,1.70508 l 0,3.45703 -1.08399,0 0,-6.5625 1.08399,0 0,1.01953 c 0.22656,-0.39843 0.52148,-0.69335 0.88476,-0.88477 0.36328,-0.1953 0.80469,-0.29296 1.32422,-0.29296 0.0742,0 0.15625,0.006 0.2461,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10742"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3405" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 627.62378,649.3454 0,1.86328 2.2207,0 0,0.83789 -2.2207,0 0,3.5625 c 0,0.53516 0.0723,0.87891 0.2168,1.03125 0.14843,0.15234 0.44726,0.22852 0.89648,0.22852 l 1.10742,0 0,0.90234 -1.10742,0 c -0.83203,0 -1.40625,-0.1543 -1.72266,-0.46289 -0.3164,-0.3125 -0.47461,-0.87891 -0.47461,-1.69922 l 0,-3.5625 -0.79101,0 0,-0.83789 0.79101,0 0,-1.86328 1.08399,0"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3407" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 631.15698,655.18134 0,-3.97266 1.07813,0 0,3.93164 c 0,0.6211 0.12109,1.08789 0.36328,1.40039 0.24218,0.3086 0.60546,0.46289 1.08984,0.46289 0.58203,0 1.04101,-0.18554 1.37696,-0.55664 0.33983,-0.37109 0.50976,-0.87695 0.50976,-1.51758 l 0,-3.7207 1.07813,0 0,6.5625 -1.07813,0 0,-1.00781 c -0.26172,0.39843 -0.56641,0.69531 -0.91406,0.89062 -0.34376,0.19141 -0.74415,0.28711 -1.20117,0.28711 -0.75391,0 -1.32618,-0.23437 -1.7168,-0.70312 -0.39063,-0.46875 -0.58594,-1.1543 -0.58594,-2.05664 m 2.71289,-4.13086 0,0"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3409" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 641.86792,654.47235 c -0.8711,0 -1.47461,0.0996 -1.81055,0.29883 -0.33594,0.19922 -0.50391,0.53906 -0.5039,1.01953 -10e-6,0.38281 0.12499,0.6875 0.375,0.91406 0.2539,0.22266 0.59765,0.33399 1.03125,0.33399 0.59765,0 1.07616,-0.21094 1.43554,-0.63282 0.36328,-0.42577 0.54492,-0.99023 0.54493,-1.69335 l 0,-0.24024 -1.07227,0 m 2.15039,-0.44531 0,3.74414 -1.07812,0 0,-0.99609 c -0.2461,0.39843 -0.55274,0.69336 -0.91993,0.88476 -0.36719,0.1875 -0.81641,0.28125 -1.34765,0.28125 -0.67188,0 -1.20704,-0.1875 -1.60547,-0.5625 -0.39453,-0.3789 -0.5918,-0.88476 -0.5918,-1.51758 0,-0.73828 0.24609,-1.29492 0.73828,-1.66992 0.49609,-0.37499 1.23438,-0.56249 2.21485,-0.5625 l 1.51172,0 0,-0.10547 c -10e-6,-0.49609 -0.16407,-0.8789 -0.49219,-1.14844 -0.32423,-0.27343 -0.78126,-0.41015 -1.3711,-0.41015 -0.375,0 -0.74023,0.0449 -1.0957,0.13476 -0.35547,0.0899 -0.69727,0.22462 -1.02539,0.4043 l 0,-0.99609 c 0.39453,-0.15234 0.77734,-0.26562 1.14844,-0.33985 0.37109,-0.0781 0.73242,-0.11718 1.08398,-0.11718 0.94922,0 1.6582,0.2461 2.12696,0.73828 0.46874,0.49219 0.70311,1.23828 0.70312,2.23828"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3411" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 646.24487,648.65399 1.07813,0 0,9.11719 -1.07813,0 0,-9.11719"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3413" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 658.68433,649.31024 0,1.1543 c -0.44923,-0.21484 -0.87306,-0.37499 -1.27149,-0.48047 -0.39844,-0.10546 -0.78321,-0.1582 -1.1543,-0.1582 -0.64453,0 -1.14258,0.125 -1.49414,0.375 -0.34765,0.25 -0.52148,0.60547 -0.52148,1.0664 0,0.38673 0.11523,0.6797 0.3457,0.87891 0.23438,0.19532 0.67578,0.35352 1.32422,0.47461 l 0.71485,0.14648 c 0.8828,0.16798 1.53319,0.46485 1.95117,0.89063 0.42187,0.42188 0.6328,0.98828 0.63281,1.69922 -10e-6,0.84765 -0.28516,1.49023 -0.85547,1.92773 -0.56641,0.4375 -1.39844,0.65625 -2.49609,0.65625 -0.41407,0 -0.85547,-0.0469 -1.32422,-0.14062 -0.46485,-0.0937 -0.94727,-0.23243 -1.44727,-0.41602 l 0,-1.21875 c 0.48047,0.26953 0.95117,0.47266 1.41211,0.60938 0.46094,0.13672 0.91406,0.20507 1.35938,0.20507 0.67577,0 1.19726,-0.13281 1.56445,-0.39843 0.36718,-0.26563 0.55078,-0.64453 0.55078,-1.13672 0,-0.42969 -0.13282,-0.76562 -0.39844,-1.00782 -0.26172,-0.24218 -0.69336,-0.42382 -1.29492,-0.54492 l -0.7207,-0.14062 c -0.88282,-0.17578 -1.52149,-0.45117 -1.91602,-0.82617 -0.39453,-0.375 -0.59179,-0.89648 -0.59179,-1.56446 0,-0.77343 0.27148,-1.3828 0.81445,-1.82812 0.54687,-0.44531 1.29883,-0.66796 2.25586,-0.66797 0.41015,1e-5 0.82812,0.0371 1.25391,0.11133 0.42577,0.0742 0.86132,0.18555 1.30664,0.33398"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3415" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 665.73315,651.46063 0,1.00781 c -0.30469,-0.16796 -0.61133,-0.29296 -0.91992,-0.375 -0.30469,-0.0859 -0.61328,-0.1289 -0.92578,-0.1289 -0.69922,0 -1.24219,0.22266 -1.62891,0.66797 -0.38672,0.44141 -0.58008,1.0625 -0.58007,1.86328 -10e-6,0.80078 0.19335,1.42383 0.58007,1.86914 0.38672,0.44141 0.92969,0.66211 1.62891,0.66211 0.3125,0 0.62109,-0.041 0.92578,-0.12305 0.30859,-0.0859 0.61523,-0.21289 0.91992,-0.38086 l 0,0.9961 c -0.30078,0.14062 -0.61328,0.24609 -0.9375,0.3164 -0.32031,0.0703 -0.66211,0.10547 -1.02539,0.10547 -0.98828,0 -1.77344,-0.31055 -2.35547,-0.93164 -0.58203,-0.62109 -0.87304,-1.45898 -0.87304,-2.51367 0,-1.07031 0.29297,-1.91211 0.8789,-2.52539 0.58985,-0.61328 1.39649,-0.91992 2.41993,-0.91992 0.33202,0 0.65624,0.0352 0.97265,0.10546 0.3164,0.0664 0.62304,0.16798 0.91992,0.30469"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3417" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 671.42261,652.21649 c -0.1211,-0.0703 -0.25391,-0.12109 -0.39844,-0.15234 -0.14063,-0.0352 -0.29688,-0.0527 -0.46875,-0.0527 -0.60938,1e-5 -1.07813,0.19923 -1.40625,0.59766 -0.32422,0.39454 -0.48633,0.96289 -0.48633,1.70508 l 0,3.45703 -1.08398,0 0,-6.5625 1.08398,0 0,1.01953 c 0.22656,-0.39843 0.52148,-0.69335 0.88477,-0.88477 0.36328,-0.1953 0.80468,-0.29296 1.32422,-0.29296 0.0742,0 0.15624,0.006 0.24609,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10742"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3419" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 677.92065,654.2204 0,0.52734 -4.95703,0 c 0.0469,0.74219 0.26953,1.3086 0.66797,1.69922 0.40234,0.38672 0.96094,0.58008 1.67578,0.58008 0.41406,0 0.81445,-0.0508 1.20117,-0.15235 0.39062,-0.10156 0.77734,-0.2539 1.16016,-0.45703 l 0,1.01953 c -0.38672,0.16407 -0.78321,0.28907 -1.18945,0.375 -0.40626,0.0859 -0.81837,0.12891 -1.23633,0.12891 -1.04688,0 -1.87696,-0.30469 -2.49023,-0.91406 -0.60938,-0.60938 -0.91407,-1.43359 -0.91407,-2.47266 0,-1.07421 0.28906,-1.92577 0.86719,-2.55469 0.58203,-0.6328 1.36523,-0.94921 2.34961,-0.94921 0.88281,0 1.58007,0.28516 2.0918,0.85546 0.51562,0.56642 0.77343,1.3379 0.77343,2.31446 m -1.07812,-0.31641 c -0.008,-0.58984 -0.17383,-1.06054 -0.49805,-1.41211 -0.32031,-0.35155 -0.7461,-0.52734 -1.27734,-0.52734 -0.60157,0 -1.08399,0.16993 -1.44727,0.50976 -0.35937,0.33985 -0.56641,0.81837 -0.62109,1.43555 l 3.84375,-0.006"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3421" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 685.30347,654.2204 0,0.52734 -4.95703,0 c 0.0469,0.74219 0.26952,1.3086 0.66796,1.69922 0.40235,0.38672 0.96094,0.58008 1.67579,0.58008 0.41405,0 0.81444,-0.0508 1.20117,-0.15235 0.39062,-0.10156 0.77734,-0.2539 1.16015,-0.45703 l 0,1.01953 c -0.38672,0.16407 -0.78321,0.28907 -1.18945,0.375 -0.40625,0.0859 -0.81836,0.12891 -1.23633,0.12891 -1.04688,0 -1.87695,-0.30469 -2.49023,-0.91406 -0.60938,-0.60938 -0.91407,-1.43359 -0.91406,-2.47266 -10e-6,-1.07421 0.28906,-1.92577 0.86718,-2.55469 0.58203,-0.6328 1.36523,-0.94921 2.34961,-0.94921 0.88281,0 1.58008,0.28516 2.0918,0.85546 0.51562,0.56642 0.77343,1.3379 0.77344,2.31446 m -1.07813,-0.31641 c -0.008,-0.58984 -0.17383,-1.06054 -0.49805,-1.41211 -0.32031,-0.35155 -0.74609,-0.52734 -1.27734,-0.52734 -0.60156,0 -1.08399,0.16993 -1.44726,0.50976 -0.35938,0.33985 -0.56641,0.81837 -0.6211,1.43555 l 3.84375,-0.006"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3423" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 692.52808,653.81024 0,3.96094 -1.07813,0 0,-3.92578 c 0,-0.62109 -0.1211,-1.08593 -0.36328,-1.39453 -0.24219,-0.30859 -0.60547,-0.46289 -1.08984,-0.46289 -0.58204,0 -1.04102,0.18555 -1.37696,0.55664 -0.33594,0.3711 -0.50391,0.87695 -0.5039,1.51757 l 0,3.70899 -1.08399,0 0,-6.5625 1.08399,0 0,1.01953 c 0.25781,-0.39452 0.56054,-0.68945 0.9082,-0.88477 0.35156,-0.1953 0.75586,-0.29296 1.21289,-0.29296 0.7539,0 1.32421,0.23438 1.71094,0.70312 0.38671,0.46485 0.58007,1.1504 0.58008,2.05664"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3425" />
 | 
			
		||||
    </g>
 | 
			
		||||
    <rect
 | 
			
		||||
       style="fill:#b8b8b8;fill-opacity:1;stroke:#b8b8b8;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
 | 
			
		||||
       id="rect5577"
 | 
			
		||||
       width="173.25098"
 | 
			
		||||
       height="141.43118"
 | 
			
		||||
       x="157.75581"
 | 
			
		||||
       y="436.97159" />
 | 
			
		||||
    <rect
 | 
			
		||||
       style="fill:#ededed;fill-opacity:1;stroke:#ededed;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
 | 
			
		||||
       id="rect3789"
 | 
			
		||||
       width="168.99611"
 | 
			
		||||
       height="136.87178"
 | 
			
		||||
       x="159.87543"
 | 
			
		||||
       y="439.39697"
 | 
			
		||||
       inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
 | 
			
		||||
       inkscape:export-xdpi="109.89113"
 | 
			
		||||
       inkscape:export-ydpi="109.89113" />
 | 
			
		||||
    <g
 | 
			
		||||
       style="font-size:12px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#454545;fill-opacity:1;stroke:none;font-family:Sans"
 | 
			
		||||
       id="text3791">
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 274.28683,558.98682 1.19532,0 1.83984,7.39453 1.83399,-7.39453 1.33007,0 1.83985,7.39453 1.83398,-7.39453 1.20117,0 -2.19726,8.74804 -1.48828,0 -1.84571,-7.59375 -1.86328,7.59375 -1.48828,0 -2.19141,-8.74804"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3388" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 286.62082,561.17236 1.07812,0 0,6.5625 -1.07812,0 0,-6.5625 m 0,-2.55468 1.07812,0 0,1.36523 -1.07812,0 0,-1.36523"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3390" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 295.40402,563.77393 0,3.96093 -1.07812,0 0,-3.92578 c -10e-6,-0.62109 -0.1211,-1.08593 -0.36328,-1.39453 -0.2422,-0.30859 -0.60548,-0.46288 -1.08985,-0.46289 -0.58203,1e-5 -1.04102,0.18555 -1.37695,0.55664 -0.33594,0.3711 -0.50391,0.87696 -0.50391,1.51758 l 0,3.70898 -1.08398,0 0,-6.5625 1.08398,0 0,1.01953 c 0.25781,-0.39452 0.56055,-0.68944 0.90821,-0.88476 0.35156,-0.19531 0.75585,-0.29296 1.21289,-0.29297 0.7539,1e-5 1.32421,0.23438 1.71093,0.70313 0.38672,0.46484 0.58008,1.15039 0.58008,2.05664"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3392" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 301.88449,562.16846 0,-3.55078 1.07813,0 0,9.11718 -1.07813,0 0,-0.98437 c -0.22657,0.39062 -0.51368,0.68164 -0.86133,0.87305 -0.34375,0.1875 -0.75781,0.28124 -1.24218,0.28125 -0.79298,-1e-5 -1.43946,-0.31641 -1.93946,-0.94922 -0.49609,-0.63281 -0.74414,-1.46485 -0.74414,-2.4961 0,-1.03124 0.24805,-1.86327 0.74414,-2.49609 0.5,-0.63281 1.14648,-0.94921 1.93946,-0.94922 0.48437,1e-5 0.89843,0.0957 1.24218,0.28711 0.34765,0.18751 0.63476,0.47657 0.86133,0.86719 m -3.67383,2.29101 c 0,0.79297 0.16211,1.41602 0.48633,1.86914 0.32812,0.44922 0.77734,0.67383 1.34766,0.67383 0.57031,0 1.01952,-0.22461 1.34765,-0.67383 0.32812,-0.45312 0.49219,-1.07617 0.49219,-1.86914 0,-0.79296 -0.16407,-1.41406 -0.49219,-1.86328 -0.32813,-0.45312 -0.77734,-0.67968 -1.34765,-0.67969 -0.57032,10e-6 -1.01954,0.22657 -1.34766,0.67969 -0.32422,0.44922 -0.48633,1.07032 -0.48633,1.86328"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3394" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 307.72629,561.92822 c -0.57813,10e-6 -1.03516,0.22657 -1.3711,0.67969 -0.33594,0.44922 -0.5039,1.06641 -0.5039,1.85156 0,0.78516 0.16601,1.4043 0.49804,1.85742 0.33594,0.44922 0.79492,0.67383 1.37696,0.67383 0.57421,0 1.02929,-0.22656 1.36523,-0.67968 0.33593,-0.45313 0.5039,-1.07031 0.50391,-1.85157 -1e-5,-0.77734 -0.16798,-1.39257 -0.50391,-1.8457 -0.33594,-0.45703 -0.79102,-0.68554 -1.36523,-0.68555 m 0,-0.91406 c 0.93749,1e-5 1.67382,0.30469 2.20898,0.91406 0.53515,0.60938 0.80273,1.45313 0.80274,2.53125 -10e-6,1.07422 -0.26759,1.91797 -0.80274,2.53125 -0.53516,0.60938 -1.27149,0.91406 -2.20898,0.91407 -0.94141,-1e-5 -1.67969,-0.30469 -2.21485,-0.91407 -0.53125,-0.61328 -0.79687,-1.45703 -0.79687,-2.53125 0,-1.07812 0.26562,-1.92187 0.79687,-2.53125 0.53516,-0.60937 1.27344,-0.91405 2.21485,-0.91406"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3396" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 311.8923,561.17236 1.07813,0 1.34765,5.1211 1.3418,-5.1211 1.27149,0 1.34765,5.1211 1.3418,-5.1211 1.07812,0 -1.71679,6.5625 -1.27149,0 -1.41211,-5.3789 -1.41797,5.3789 -1.27148,0 -1.7168,-6.5625"
 | 
			
		||||
         style=""
 | 
			
		||||
         id="path3398" />
 | 
			
		||||
    </g>
 | 
			
		||||
    <rect
 | 
			
		||||
       y="439.39581"
 | 
			
		||||
       x="159.87428"
 | 
			
		||||
       height="8.8251209"
 | 
			
		||||
       width="168.99841"
 | 
			
		||||
       id="rect3795"
 | 
			
		||||
       style="fill:#7b7bff;fill-opacity:1;stroke:#7b7bff;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
 | 
			
		||||
       inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
 | 
			
		||||
       inkscape:export-xdpi="109.89113"
 | 
			
		||||
       inkscape:export-ydpi="109.89113" />
 | 
			
		||||
    <path
 | 
			
		||||
       sodipodi:type="arc"
 | 
			
		||||
       style="fill:#000000;fill-opacity:1;stroke:none"
 | 
			
		||||
       id="path3797"
 | 
			
		||||
       sodipodi:cx="352.54324"
 | 
			
		||||
       sodipodi:cy="373.03461"
 | 
			
		||||
       sodipodi:rx="2.5253813"
 | 
			
		||||
       sodipodi:ry="2.5253813"
 | 
			
		||||
       d="m 355.06862,373.03461 c 0,1.39473 -1.13065,2.52538 -2.52538,2.52538 -1.39473,0 -2.52538,-1.13065 -2.52538,-2.52538 0,-1.39473 1.13065,-2.52538 2.52538,-2.52538 1.39473,0 2.52538,1.13065 2.52538,2.52538 z"
 | 
			
		||||
       transform="matrix(0.66107369,0,0,0.66107369,123.32145,119.41326)"
 | 
			
		||||
       inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
 | 
			
		||||
       inkscape:export-xdpi="109.89113"
 | 
			
		||||
       inkscape:export-ydpi="109.89113" />
 | 
			
		||||
    <path
 | 
			
		||||
       transform="matrix(0.66107369,0,0,0.66107369,-194.73594,119.44704)"
 | 
			
		||||
       d="m 355.06862,373.03461 c 0,1.39473 -1.13065,2.52538 -2.52538,2.52538 -1.39473,0 -2.52538,-1.13065 -2.52538,-2.52538 0,-1.39473 1.13065,-2.52538 2.52538,-2.52538 1.39473,0 2.52538,1.13065 2.52538,2.52538 z"
 | 
			
		||||
       sodipodi:ry="2.5253813"
 | 
			
		||||
       sodipodi:rx="2.5253813"
 | 
			
		||||
       sodipodi:cy="373.03461"
 | 
			
		||||
       sodipodi:cx="352.54324"
 | 
			
		||||
       id="path3799"
 | 
			
		||||
       style="fill:#000000;fill-opacity:1;stroke:none"
 | 
			
		||||
       sodipodi:type="arc"
 | 
			
		||||
       inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
 | 
			
		||||
       inkscape:export-xdpi="109.89113"
 | 
			
		||||
       inkscape:export-ydpi="109.89113" />
 | 
			
		||||
    <path
 | 
			
		||||
       sodipodi:type="arc"
 | 
			
		||||
       style="fill:#000000;fill-opacity:1;stroke:none"
 | 
			
		||||
       id="path3801"
 | 
			
		||||
       sodipodi:cx="352.54324"
 | 
			
		||||
       sodipodi:cy="373.03461"
 | 
			
		||||
       sodipodi:rx="2.5253813"
 | 
			
		||||
       sodipodi:ry="2.5253813"
 | 
			
		||||
       d="m 355.06862,373.03461 c 0,1.39473 -1.13065,2.52538 -2.52538,2.52538 -1.39473,0 -2.52538,-1.13065 -2.52538,-2.52538 0,-1.39473 1.13065,-2.52538 2.52538,-2.52538 1.39473,0 2.52538,1.13065 2.52538,2.52538 z"
 | 
			
		||||
       transform="matrix(0.66107369,0,0,0.66107369,-73.218648,201.61091)"
 | 
			
		||||
       inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
 | 
			
		||||
       inkscape:export-xdpi="109.89113"
 | 
			
		||||
       inkscape:export-ydpi="109.89113" />
 | 
			
		||||
    <text
 | 
			
		||||
       xml:space="preserve"
 | 
			
		||||
       style="font-style:normal;font-weight:normal;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none"
 | 
			
		||||
       x="21.213203"
 | 
			
		||||
       y="340.20465"
 | 
			
		||||
       id="text3803"
 | 
			
		||||
       inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
 | 
			
		||||
       inkscape:export-xdpi="109.89113"
 | 
			
		||||
       inkscape:export-ydpi="109.89113"><tspan
 | 
			
		||||
         sodipodi:role="line"
 | 
			
		||||
         id="tspan3805"
 | 
			
		||||
         x="21.213203"
 | 
			
		||||
         y="340.20465"
 | 
			
		||||
         style="font-size:12px;line-height:1.25;font-family:sans-serif"> </tspan></text>
 | 
			
		||||
    <g
 | 
			
		||||
       style="font-size:12px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
 | 
			
		||||
       id="text3807">
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 71.179893,455.55557 0.996094,0 1.533203,6.16211 1.528321,-6.16211 1.108398,0 1.533203,6.16211 1.528321,-6.16211 1.000976,0 -1.831055,7.29004 -1.240234,0 -1.538086,-6.32812 -1.552734,6.32812 -1.240235,0 -1.826172,-7.29004"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3164" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 81.458214,457.37686 0.898437,0 0,5.46875 -0.898437,0 0,-5.46875 m 0,-2.1289 0.898437,0 0,1.13769 -0.898437,0 0,-1.13769"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3166" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 88.77755,459.54483 0,3.30078 -0.898438,0 0,-3.27148 c -4e-6,-0.51758 -0.100916,-0.90495 -0.302734,-1.16211 -0.201827,-0.25716 -0.504561,-0.38574 -0.908203,-0.38574 -0.485029,0 -0.867516,0.15462 -1.147461,0.46386 -0.27995,0.30925 -0.419924,0.7308 -0.419922,1.26465 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.214842,-0.32877 0.46712,-0.57454 0.756836,-0.7373 0.292966,-0.16276 0.629879,-0.24414 1.010742,-0.24414 0.628251,0 1.103511,0.19531 1.425781,0.58593 0.322261,0.38738 0.483393,0.95867 0.483399,1.71387"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3168" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 94.17794,458.20694 0,-2.95898 0.898438,0 0,7.59765 -0.898438,0 0,-0.82031 c -0.188806,0.32552 -0.428064,0.56803 -0.717773,0.72754 -0.286462,0.15625 -0.631514,0.23437 -1.035156,0.23437 -0.66081,0 -1.199546,-0.26367 -1.616211,-0.79101 -0.413412,-0.52735 -0.620118,-1.2207 -0.620117,-2.08008 -10e-7,-0.85937 0.206705,-1.55273 0.620117,-2.08008 0.416665,-0.52734 0.955401,-0.79101 1.616211,-0.79101 0.403642,0 0.748694,0.0797 1.035156,0.23925 0.289709,0.15626 0.528967,0.39714 0.717773,0.72266 m -3.061523,1.90918 c -2e-6,0.66081 0.135089,1.18001 0.405273,1.55762 0.273436,0.37435 0.647784,0.56152 1.123047,0.56152 0.475257,0 0.849606,-0.18717 1.123047,-0.56152 0.273433,-0.37761 0.410152,-0.89681 0.410156,-1.55762 -4e-6,-0.6608 -0.136723,-1.17838 -0.410156,-1.55273 -0.273441,-0.3776 -0.64779,-0.56641 -1.123047,-0.56641 -0.475263,0 -0.849611,0.18881 -1.123047,0.56641 -0.270184,0.37435 -0.405275,0.89193 -0.405273,1.55273"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3170" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 99.046104,458.00674 c -0.481773,1e-5 -0.862632,0.18881 -1.142578,0.56641 -0.279949,0.37435 -0.419923,0.88868 -0.419922,1.54297 -10e-7,0.6543 0.138345,1.17025 0.415039,1.54785 0.279946,0.37435 0.662433,0.56153 1.147461,0.56152 0.478513,1e-5 0.857744,-0.1888 1.137696,-0.5664 0.27994,-0.3776 0.41992,-0.89193 0.41992,-1.54297 0,-0.64778 -0.13998,-1.16048 -0.41992,-1.53809 -0.279952,-0.38085 -0.659183,-0.57128 -1.137696,-0.57129 m 0,-0.76171 c 0.781247,0 1.394856,0.25391 1.840816,0.76171 0.44596,0.50782 0.66894,1.21095 0.66895,2.10938 -1e-5,0.89518 -0.22299,1.59831 -0.66895,2.10937 -0.44596,0.50782 -1.059569,0.76172 -1.840816,0.76172 -0.784507,0 -1.399741,-0.2539 -1.845703,-0.76172 -0.442709,-0.51106 -0.664063,-1.21419 -0.664062,-2.10937 -10e-7,-0.89843 0.221353,-1.60156 0.664062,-2.10938 0.445962,-0.5078 1.061196,-0.76171 1.845703,-0.76171"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3172" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 102.51778,457.37686 0.89844,0 1.12305,4.26758 1.11816,-4.26758 1.05957,0 1.12305,4.26758 1.11816,-4.26758 0.89844,0 -1.43066,5.46875 -1.05957,0 -1.17676,-4.48242 -1.18164,4.48242 -1.05957,0 -1.43067,-5.46875"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3174" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 115.27657,462.0253 0,2.90039 -0.90332,0 0,-7.54883 0.90332,0 0,0.83008 c 0.1888,-0.32552 0.42643,-0.5664 0.71289,-0.72266 0.28971,-0.1595 0.63477,-0.23925 1.03516,-0.23925 0.66406,0 1.20279,0.26367 1.61621,0.79101 0.41666,0.52735 0.625,1.22071 0.625,2.08008 0,0.85938 -0.20834,1.55273 -0.625,2.08008 -0.41342,0.52734 -0.95215,0.79101 -1.61621,0.79101 -0.40039,0 -0.74545,-0.0781 -1.03516,-0.23437 -0.28646,-0.15951 -0.52409,-0.40202 -0.71289,-0.72754 m 3.05664,-1.90918 c 0,-0.6608 -0.13672,-1.17838 -0.41015,-1.55273 -0.27019,-0.3776 -0.64291,-0.56641 -1.11817,-0.56641 -0.47526,0 -0.84961,0.18881 -1.12304,0.56641 -0.27019,0.37435 -0.40528,0.89193 -0.40528,1.55273 0,0.66081 0.13509,1.18001 0.40528,1.55762 0.27343,0.37435 0.64778,0.56152 1.12304,0.56152 0.47526,0 0.84798,-0.18717 1.11817,-0.56152 0.27343,-0.37761 0.41015,-0.89681 0.41015,-1.55762"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3176" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 122.87423,458.00674 c -0.48177,1e-5 -0.86263,0.18881 -1.14258,0.56641 -0.27995,0.37435 -0.41992,0.88868 -0.41992,1.54297 0,0.6543 0.13834,1.17025 0.41504,1.54785 0.27994,0.37435 0.66243,0.56153 1.14746,0.56152 0.47851,1e-5 0.85774,-0.1888 1.13769,-0.5664 0.27995,-0.3776 0.41992,-0.89193 0.41993,-1.54297 -1e-5,-0.64778 -0.13998,-1.16048 -0.41993,-1.53809 -0.27995,-0.38085 -0.65918,-0.57128 -1.13769,-0.57129 m 0,-0.76171 c 0.78125,0 1.39485,0.25391 1.84082,0.76171 0.44596,0.50782 0.66894,1.21095 0.66895,2.10938 -1e-5,0.89518 -0.22299,1.59831 -0.66895,2.10937 -0.44597,0.50782 -1.05957,0.76172 -1.84082,0.76172 -0.78451,0 -1.39974,-0.2539 -1.8457,-0.76172 -0.44271,-0.51106 -0.66407,-1.21419 -0.66407,-2.10937 0,-0.89843 0.22136,-1.60156 0.66407,-2.10938 0.44596,-0.5078 1.06119,-0.76171 1.8457,-0.76171"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3178" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 130.3547,457.53799 0,0.84961 c -0.25391,-0.1302 -0.51758,-0.22786 -0.79102,-0.29296 -0.27344,-0.0651 -0.55664,-0.0977 -0.84961,-0.0977 -0.44596,0 -0.78125,0.0684 -1.00586,0.20508 -0.22135,0.13672 -0.33203,0.3418 -0.33203,0.61523 0,0.20834 0.0797,0.37273 0.23926,0.49317 0.1595,0.11719 0.48014,0.22949 0.96191,0.33691 l 0.30762,0.0684 c 0.63802,0.13672 1.09049,0.33041 1.35742,0.58105 0.27018,0.2474 0.40527,0.59408 0.40528,1.04004 -1e-5,0.50782 -0.20183,0.90983 -0.60547,1.20606 -0.4004,0.29622 -0.95215,0.44433 -1.65528,0.44433 -0.29297,0 -0.59896,-0.0293 -0.91796,-0.0879 -0.31576,-0.0553 -0.64942,-0.13997 -1.00098,-0.2539 l 0,-0.92774 c 0.33203,0.17253 0.65918,0.30274 0.98144,0.39063 0.32227,0.0846 0.64128,0.12695 0.95704,0.12695 0.42317,0 0.74869,-0.0716 0.97656,-0.21484 0.22786,-0.14649 0.34179,-0.35157 0.3418,-0.61524 -1e-5,-0.24414 -0.083,-0.43131 -0.24903,-0.56152 -0.16276,-0.13021 -0.52246,-0.25553 -1.0791,-0.37598 l -0.3125,-0.0732 c -0.55664,-0.11719 -0.95866,-0.29622 -1.20605,-0.53711 -0.2474,-0.24414 -0.3711,-0.5778 -0.3711,-1.00098 0,-0.51431 0.18229,-0.91145 0.54688,-1.1914 0.36458,-0.27994 0.88216,-0.41992 1.55273,-0.41992 0.33203,0 0.64453,0.0244 0.9375,0.0732 0.29297,0.0488 0.56315,0.12207 0.81055,0.21972"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3180" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 132.08321,457.37686 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3182" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 135.74532,455.82413 0,1.55273 1.85059,0 0,0.69824 -1.85059,0 0,2.96875 c 0,0.44597 0.0602,0.73243 0.18067,0.85938 0.12369,0.12695 0.37272,0.19043 0.74707,0.19043 l 0.92285,0 0,0.75195 -0.92285,0 c -0.69336,0 -1.17188,-0.12858 -1.43555,-0.38574 -0.26367,-0.26042 -0.39551,-0.73242 -0.39551,-1.41602 l 0,-2.96875 -0.65918,0 0,-0.69824 0.65918,0 0,-1.55273 0.90332,0"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3184" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 138.78243,457.37686 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3186" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 143.67501,458.00674 c -0.48177,1e-5 -0.86263,0.18881 -1.14258,0.56641 -0.27995,0.37435 -0.41992,0.88868 -0.41992,1.54297 0,0.6543 0.13835,1.17025 0.41504,1.54785 0.27995,0.37435 0.66243,0.56153 1.14746,0.56152 0.47851,1e-5 0.85774,-0.1888 1.1377,-0.5664 0.27994,-0.3776 0.41991,-0.89193 0.41992,-1.54297 -1e-5,-0.64778 -0.13998,-1.16048 -0.41992,-1.53809 -0.27996,-0.38085 -0.65919,-0.57128 -1.1377,-0.57129 m 0,-0.76171 c 0.78125,0 1.39485,0.25391 1.84082,0.76171 0.44596,0.50782 0.66894,1.21095 0.66895,2.10938 -1e-5,0.89518 -0.22299,1.59831 -0.66895,2.10937 -0.44597,0.50782 -1.05957,0.76172 -1.84082,0.76172 -0.78451,0 -1.39974,-0.2539 -1.8457,-0.76172 -0.44271,-0.51106 -0.66407,-1.21419 -0.66406,-2.10937 -10e-6,-0.89843 0.22135,-1.60156 0.66406,-2.10938 0.44596,-0.5078 1.06119,-0.76171 1.8457,-0.76171"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3188" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 152.21505,459.54483 0,3.30078 -0.89844,0 0,-3.27148 c 0,-0.51758 -0.10091,-0.90495 -0.30273,-1.16211 -0.20183,-0.25716 -0.50456,-0.38574 -0.90821,-0.38574 -0.48502,0 -0.86751,0.15462 -1.14746,0.46386 -0.27995,0.30925 -0.41992,0.7308 -0.41992,1.26465 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.21484,-0.32877 0.46712,-0.57454 0.75684,-0.7373 0.29296,-0.16276 0.62988,-0.24414 1.01074,-0.24414 0.62825,0 1.10351,0.19531 1.42578,0.58593 0.32226,0.38738 0.48339,0.95867 0.4834,1.71387"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3190" />
 | 
			
		||||
    </g>
 | 
			
		||||
    <g
 | 
			
		||||
       style="font-size:12px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
 | 
			
		||||
       id="text3817">
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 49.798271,374.06503 0,0.96192 c -0.374354,-0.17903 -0.727544,-0.3125 -1.05957,-0.40039 -0.332035,-0.0879 -0.652673,-0.13183 -0.961914,-0.13184 -0.537112,1e-5 -0.952151,0.10417 -1.245117,0.3125 -0.289716,0.20834 -0.434572,0.50456 -0.434571,0.88867 -10e-7,0.32227 0.09603,0.56641 0.288086,0.73242 0.195311,0.16277 0.563149,0.2946 1.103516,0.39551 l 0.595703,0.12207 c 0.735673,0.13998 1.277664,0.38738 1.625977,0.74219 0.351556,0.35157 0.527338,0.82357 0.527343,1.41602 -5e-6,0.70638 -0.237635,1.24186 -0.71289,1.60644 -0.47201,0.36458 -1.165369,0.54688 -2.080078,0.54688 -0.345055,0 -0.712893,-0.0391 -1.103516,-0.11719 -0.387371,-0.0781 -0.789389,-0.19369 -1.206055,-0.34668 l 0,-1.01563 c 0.40039,0.22461 0.792642,0.39388 1.176758,0.50782 0.384112,0.11393 0.761716,0.1709 1.132813,0.17089 0.563147,10e-6 0.997717,-0.11067 1.30371,-0.33203 0.305985,-0.22135 0.45898,-0.5371 0.458985,-0.94726 -5e-6,-0.35807 -0.110682,-0.63802 -0.332031,-0.83985 -0.218104,-0.20182 -0.577804,-0.35318 -1.079102,-0.4541 l -0.600586,-0.11719 c -0.735679,-0.14648 -1.267905,-0.37597 -1.59668,-0.68847 -0.328776,-0.3125 -0.493164,-0.74707 -0.493164,-1.30371 0,-0.64453 0.226236,-1.15234 0.678711,-1.52344 0.455728,-0.37109 1.082355,-0.55663 1.879883,-0.55664 0.341793,10e-6 0.6901,0.0309 1.044922,0.0928 0.354813,0.0619 0.717768,0.15463 1.088867,0.27832"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3193" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 56.414482,378.15683 0,0.43945 -4.130859,0 c 0.03906,0.61849 0.224607,1.0905 0.55664,1.41602 0.335284,0.32226 0.800779,0.4834 1.396485,0.4834 0.345048,0 0.678707,-0.0423 1.000976,-0.12696 0.325516,-0.0846 0.647782,-0.21158 0.966797,-0.38086 l 0,0.84961 c -0.322271,0.13672 -0.652674,0.24089 -0.991211,0.3125 -0.338546,0.0716 -0.68197,0.10743 -1.030273,0.10743 -0.872399,0 -1.56413,-0.25391 -2.075196,-0.76172 -0.507813,-0.50781 -0.761719,-1.19466 -0.761718,-2.06055 -10e-7,-0.89518 0.240884,-1.60481 0.722656,-2.12891 0.485024,-0.52733 1.137693,-0.79101 1.958008,-0.79101 0.735673,0 1.316727,0.23763 1.743164,0.71289 0.429682,0.47201 0.644525,1.11491 0.644531,1.92871 m -0.898437,-0.26367 c -0.0065,-0.49153 -0.144862,-0.88379 -0.415039,-1.17676 -0.266932,-0.29296 -0.621749,-0.43945 -1.064454,-0.43945 -0.501304,0 -0.903322,0.1416 -1.206054,0.4248 -0.299481,0.28321 -0.472007,0.68197 -0.517578,1.19629 l 3.203125,-0.005"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3195" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 61.824638,375.85703 0,0.83984 c -0.253911,-0.13997 -0.509444,-0.24414 -0.766601,-0.3125 -0.25391,-0.0716 -0.511072,-0.10742 -0.771485,-0.10742 -0.582685,0 -1.035158,0.18555 -1.357421,0.55664 -0.322268,0.36784 -0.4834,0.88542 -0.483399,1.55273 -10e-7,0.66732 0.161131,1.18653 0.483399,1.55762 0.322263,0.36784 0.774736,0.55176 1.357421,0.55176 0.260413,0 0.517575,-0.0342 0.771485,-0.10254 0.257157,-0.0716 0.51269,-0.17741 0.766601,-0.31738 l 0,0.83007 c -0.250655,0.11719 -0.511072,0.20508 -0.78125,0.26368 -0.266931,0.0586 -0.551761,0.0879 -0.854492,0.0879 -0.82357,0 -1.477866,-0.25879 -1.96289,-0.77637 -0.485027,-0.51758 -0.72754,-1.21582 -0.72754,-2.09473 0,-0.89192 0.24414,-1.59342 0.732422,-2.10449 0.491535,-0.51106 1.163735,-0.7666 2.016602,-0.7666 0.276689,0 0.546871,0.0293 0.810547,0.0879 0.263667,0.0553 0.519201,0.13998 0.766601,0.25391"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3197" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 65.516045,376.27695 c -0.481774,0 -0.862633,0.1888 -1.142579,0.5664 -0.279949,0.37436 -0.419923,0.88868 -0.419921,1.54297 -2e-6,0.6543 0.138344,1.17025 0.415039,1.54785 0.279945,0.37435 0.662432,0.56153 1.147461,0.56153 0.478512,0 0.857743,-0.1888 1.137695,-0.56641 0.279943,-0.3776 0.419917,-0.89192 0.419922,-1.54297 -5e-6,-0.64778 -0.139979,-1.16048 -0.419922,-1.53808 -0.279952,-0.38086 -0.659183,-0.57129 -1.137695,-0.57129 m 0,-0.76172 c 0.781246,0 1.394852,0.25391 1.84082,0.76172 0.445958,0.50781 0.66894,1.21094 0.668945,2.10937 -5e-6,0.89519 -0.222987,1.59831 -0.668945,2.10938 -0.445968,0.50781 -1.059574,0.76172 -1.84082,0.76172 -0.784508,0 -1.399742,-0.25391 -1.845704,-0.76172 -0.442709,-0.51107 -0.664063,-1.21419 -0.664062,-2.10938 -10e-7,-0.89843 0.221353,-1.60156 0.664062,-2.10937 0.445962,-0.50781 1.061196,-0.76172 1.845704,-0.76172"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3199" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 74.056084,377.81503 0,3.30078 -0.898438,0 0,-3.27148 c -4e-6,-0.51757 -0.100916,-0.90494 -0.302734,-1.16211 -0.201827,-0.25716 -0.504561,-0.38574 -0.908203,-0.38574 -0.485029,0 -0.867516,0.15463 -1.147461,0.46387 -0.27995,0.30924 -0.419924,0.73079 -0.419922,1.26464 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.214842,-0.32877 0.46712,-0.57454 0.756836,-0.7373 0.292966,-0.16276 0.629879,-0.24414 1.010742,-0.24414 0.628251,0 1.103511,0.19532 1.425781,0.58594 0.322261,0.38737 0.483393,0.95866 0.483399,1.71386"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3201" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 79.456474,376.47714 0,-2.95898 0.898438,0 0,7.59765 -0.898438,0 0,-0.82031 c -0.188806,0.32552 -0.428064,0.56804 -0.717773,0.72754 -0.286462,0.15625 -0.631514,0.23438 -1.035156,0.23438 -0.66081,0 -1.199546,-0.26368 -1.616211,-0.79102 -0.413413,-0.52734 -0.620118,-1.2207 -0.620118,-2.08008 0,-0.85937 0.206705,-1.55273 0.620118,-2.08008 0.416665,-0.52733 0.955401,-0.79101 1.616211,-0.79101 0.403642,0 0.748694,0.0798 1.035156,0.23926 0.289709,0.15625 0.528967,0.39714 0.717773,0.72265 m -3.061523,1.90918 c -2e-6,0.66081 0.135089,1.18002 0.405273,1.55762 0.273436,0.37435 0.647784,0.56152 1.123047,0.56152 0.475257,0 0.849606,-0.18717 1.123047,-0.56152 0.273433,-0.3776 0.410152,-0.89681 0.410156,-1.55762 -4e-6,-0.6608 -0.136723,-1.17838 -0.410156,-1.55273 -0.273441,-0.3776 -0.64779,-0.5664 -1.123047,-0.56641 -0.475263,1e-5 -0.849611,0.18881 -1.123047,0.56641 -0.270184,0.37435 -0.405275,0.89193 -0.405273,1.55273"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3203" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 84.690849,378.36679 c -0.725914,0 -1.228843,0.083 -1.508789,0.24902 -0.279949,0.16602 -0.419923,0.44923 -0.419922,0.84961 -10e-7,0.31902 0.104165,0.57292 0.3125,0.76172 0.211587,0.18555 0.498045,0.27832 0.859375,0.27832 0.498044,0 0.896807,-0.17578 1.196289,-0.52734 0.302731,-0.35482 0.454098,-0.82519 0.454102,-1.41113 l 0,-0.2002 -0.893555,0 m 1.791992,-0.37109 0,3.12011 -0.898437,0 0,-0.83007 c -0.205082,0.33203 -0.460616,0.5778 -0.766602,0.7373 -0.305992,0.15625 -0.680341,0.23438 -1.123046,0.23438 -0.559898,0 -1.005861,-0.15625 -1.337891,-0.46875 -0.328777,-0.31576 -0.493165,-0.73731 -0.493164,-1.26465 -1e-6,-0.61523 0.205077,-1.0791 0.615234,-1.3916 0.41341,-0.3125 1.028644,-0.46875 1.845703,-0.46875 l 1.259766,0 0,-0.0879 c -4e-6,-0.41341 -0.136723,-0.73242 -0.410156,-0.95704 -0.270186,-0.22786 -0.651045,-0.34179 -1.142578,-0.34179 -0.312503,0 -0.616865,0.0374 -0.913086,0.1123 -0.296226,0.0749 -0.581056,0.18718 -0.854493,0.33692 l 0,-0.83008 c 0.328775,-0.12695 0.647785,-0.22135 0.957032,-0.28321 0.309242,-0.0651 0.610349,-0.0977 0.90332,-0.0977 0.791012,0 1.381832,0.20508 1.772461,0.61523 0.39062,0.41016 0.585932,1.03191 0.585937,1.86524"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3205" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 91.507256,376.48691 c -0.100916,-0.0586 -0.211593,-0.10091 -0.332032,-0.12696 -0.117191,-0.0293 -0.247399,-0.0439 -0.390625,-0.0439 -0.507815,0 -0.89844,0.16602 -1.171875,0.49805 -0.270184,0.32878 -0.405275,0.80241 -0.405273,1.42089 l 0,2.88086 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.1888,-0.33202 0.434568,-0.57779 0.737305,-0.7373 0.302731,-0.16276 0.670569,-0.24414 1.103515,-0.24414 0.06185,0 0.130205,0.005 0.205078,0.0147 0.07487,0.007 0.157874,0.0179 0.249024,0.0342 l 0.0049,0.92285"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3207" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 94.734795,381.62363 c -0.25391,0.65104 -0.501305,1.07584 -0.742188,1.27441 -0.240888,0.19857 -0.563153,0.29785 -0.966797,0.29785 l -0.717773,0 0,-0.75195 0.527344,0 c 0.247394,0 0.439451,-0.0586 0.576171,-0.17578 0.136717,-0.11719 0.288084,-0.39388 0.454102,-0.83008 l 0.161133,-0.41016 -2.211914,-5.38086 0.952148,0 1.708985,4.27735 1.708984,-4.27735 0.952148,0 -2.402343,5.97657"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3209" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 105.81878,376.69687 c 0.2246,-0.40364 0.49316,-0.70149 0.80566,-0.89356 0.3125,-0.19205 0.68033,-0.28808 1.10352,-0.28808 0.56965,0 1.00911,0.2002 1.31836,0.60058 0.30923,0.39714 0.46386,0.96355 0.46387,1.69922 l 0,3.30078 -0.90333,0 0,-3.27148 c 0,-0.52408 -0.0928,-0.91308 -0.27832,-1.16699 -0.18555,-0.2539 -0.46875,-0.38086 -0.8496,-0.38086 -0.46551,0 -0.83334,0.15463 -1.10352,0.46387 -0.27019,0.30924 -0.40528,0.73079 -0.40527,1.26464 l 0,3.09082 -0.90332,0 0,-3.27148 c -10e-6,-0.52734 -0.0928,-0.91634 -0.27832,-1.16699 -0.18556,-0.2539 -0.47201,-0.38086 -0.85938,-0.38086 -0.45899,0 -0.82357,0.15625 -1.09375,0.46875 -0.27018,0.30925 -0.40527,0.72917 -0.40527,1.25976 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.20507,-0.33528 0.45084,-0.58267 0.7373,-0.74218 0.28646,-0.1595 0.62663,-0.23926 1.02051,-0.23926 0.39713,0 0.73404,0.10092 1.01074,0.30273 0.27994,0.20183 0.48665,0.4948 0.62012,0.87891"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3211" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 113.4262,376.27695 c -0.48177,0 -0.86263,0.1888 -1.14258,0.5664 -0.27995,0.37436 -0.41992,0.88868 -0.41992,1.54297 0,0.6543 0.13835,1.17025 0.41504,1.54785 0.27995,0.37435 0.66243,0.56153 1.14746,0.56153 0.47851,0 0.85774,-0.1888 1.1377,-0.56641 0.27994,-0.3776 0.41991,-0.89192 0.41992,-1.54297 -10e-6,-0.64778 -0.13998,-1.16048 -0.41992,-1.53808 -0.27996,-0.38086 -0.65919,-0.57129 -1.1377,-0.57129 m 0,-0.76172 c 0.78125,0 1.39485,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66895,2.10937 -1e-5,0.89519 -0.22299,1.59831 -0.66895,2.10938 -0.44597,0.50781 -1.05957,0.76172 -1.84082,0.76172 -0.78451,0 -1.39974,-0.25391 -1.8457,-0.76172 -0.44271,-0.51107 -0.66407,-1.21419 -0.66406,-2.10938 -10e-6,-0.89843 0.22135,-1.60156 0.66406,-2.10937 0.44596,-0.50781 1.06119,-0.76172 1.8457,-0.76172"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3213" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 121.96624,377.81503 0,3.30078 -0.89844,0 0,-3.27148 c 0,-0.51757 -0.10091,-0.90494 -0.30273,-1.16211 -0.20183,-0.25716 -0.50456,-0.38574 -0.90821,-0.38574 -0.48502,0 -0.86751,0.15463 -1.14746,0.46387 -0.27995,0.30924 -0.41992,0.73079 -0.41992,1.26464 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.21484,-0.32877 0.46712,-0.57454 0.75684,-0.7373 0.29296,-0.16276 0.62988,-0.24414 1.01074,-0.24414 0.62825,0 1.10351,0.19532 1.42578,0.58594 0.32226,0.38737 0.48339,0.95866 0.4834,1.71386"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3215" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 123.768,375.64706 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3217" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 127.43011,374.09433 0,1.55273 1.85058,0 0,0.69825 -1.85058,0 0,2.96875 c 0,0.44596 0.0602,0.73242 0.18066,0.85937 0.1237,0.12696 0.37272,0.19043 0.74707,0.19043 l 0.92285,0 0,0.75195 -0.92285,0 c -0.69336,0 -1.17188,-0.12858 -1.43555,-0.38574 -0.26367,-0.26041 -0.3955,-0.73242 -0.3955,-1.41601 l 0,-2.96875 -0.65918,0 0,-0.69825 0.65918,0 0,-1.55273 0.90332,0"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3219" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 132.58636,376.27695 c -0.48178,0 -0.86264,0.1888 -1.14258,0.5664 -0.27995,0.37436 -0.41992,0.88868 -0.41992,1.54297 0,0.6543 0.13834,1.17025 0.41504,1.54785 0.27994,0.37435 0.66243,0.56153 1.14746,0.56153 0.47851,0 0.85774,-0.1888 1.13769,-0.56641 0.27995,-0.3776 0.41992,-0.89192 0.41992,-1.54297 0,-0.64778 -0.13997,-1.16048 -0.41992,-1.53808 -0.27995,-0.38086 -0.65918,-0.57129 -1.13769,-0.57129 m 0,-0.76172 c 0.78124,0 1.39485,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66894,2.10937 0,0.89519 -0.22298,1.59831 -0.66894,2.10938 -0.44597,0.50781 -1.05958,0.76172 -1.84082,0.76172 -0.78451,0 -1.39974,-0.25391 -1.84571,-0.76172 -0.44271,-0.51107 -0.66406,-1.21419 -0.66406,-2.10938 0,-0.89843 0.22135,-1.60156 0.66406,-2.10937 0.44597,-0.50781 1.0612,-0.76172 1.84571,-0.76172"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3221" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 139.74944,376.48691 c -0.10091,-0.0586 -0.21159,-0.10091 -0.33203,-0.12696 -0.11719,-0.0293 -0.2474,-0.0439 -0.39062,-0.0439 -0.50782,0 -0.89844,0.16602 -1.17188,0.49805 -0.27018,0.32878 -0.40527,0.80241 -0.40527,1.42089 l 0,2.88086 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.1888,-0.33202 0.43457,-0.57779 0.7373,-0.7373 0.30273,-0.16276 0.67057,-0.24414 1.10352,-0.24414 0.0618,0 0.1302,0.005 0.20508,0.0147 0.0749,0.007 0.15787,0.0179 0.24902,0.0342 l 0.005,0.92285"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3223" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 144.75433,380.2955 0,2.90039 -0.90332,0 0,-7.54883 0.90332,0 0,0.83008 c 0.1888,-0.32551 0.42643,-0.5664 0.71289,-0.72265 0.28971,-0.1595 0.63476,-0.23926 1.03515,-0.23926 0.66406,0 1.2028,0.26368 1.61621,0.79101 0.41666,0.52735 0.625,1.22071 0.625,2.08008 0,0.85938 -0.20834,1.55274 -0.625,2.08008 -0.41341,0.52734 -0.95215,0.79102 -1.61621,0.79102 -0.40039,0 -0.74544,-0.0781 -1.03515,-0.23438 -0.28646,-0.1595 -0.52409,-0.40202 -0.71289,-0.72754 m 3.05664,-1.90918 c -1e-5,-0.6608 -0.13673,-1.17838 -0.41016,-1.55273 -0.27019,-0.3776 -0.64291,-0.5664 -1.11816,-0.56641 -0.47527,1e-5 -0.84962,0.18881 -1.12305,0.56641 -0.27018,0.37435 -0.40528,0.89193 -0.40527,1.55273 -1e-5,0.66081 0.13509,1.18002 0.40527,1.55762 0.27343,0.37435 0.64778,0.56152 1.12305,0.56152 0.47525,0 0.84797,-0.18717 1.11816,-0.56152 0.27343,-0.3776 0.41015,-0.89681 0.41016,-1.55762"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3225" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 152.35198,376.27695 c -0.48177,0 -0.86263,0.1888 -1.14258,0.5664 -0.27995,0.37436 -0.41992,0.88868 -0.41992,1.54297 0,0.6543 0.13835,1.17025 0.41504,1.54785 0.27995,0.37435 0.66243,0.56153 1.14746,0.56153 0.47851,0 0.85775,-0.1888 1.1377,-0.56641 0.27994,-0.3776 0.41991,-0.89192 0.41992,-1.54297 -1e-5,-0.64778 -0.13998,-1.16048 -0.41992,-1.53808 -0.27995,-0.38086 -0.65919,-0.57129 -1.1377,-0.57129 m 0,-0.76172 c 0.78125,0 1.39485,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66895,2.10937 -1e-5,0.89519 -0.22299,1.59831 -0.66895,2.10938 -0.44597,0.50781 -1.05957,0.76172 -1.84082,0.76172 -0.78451,0 -1.39974,-0.25391 -1.8457,-0.76172 -0.44271,-0.51107 -0.66406,-1.21419 -0.66406,-2.10938 0,-0.89843 0.22135,-1.60156 0.66406,-2.10937 0.44596,-0.50781 1.06119,-0.76172 1.8457,-0.76172"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3227" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 159.83245,375.8082 0,0.84961 c -0.25391,-0.13021 -0.51758,-0.22786 -0.79101,-0.29297 -0.27345,-0.0651 -0.55665,-0.0976 -0.84961,-0.0977 -0.44597,1e-5 -0.78126,0.0684 -1.00586,0.20508 -0.22136,0.13672 -0.33204,0.3418 -0.33203,0.61523 -1e-5,0.20834 0.0798,0.37273 0.23925,0.49317 0.15951,0.11719 0.48014,0.22949 0.96192,0.33691 l 0.30761,0.0684 c 0.63802,0.13672 1.0905,0.33041 1.35743,0.58106 0.27017,0.24739 0.40526,0.59407 0.40527,1.04004 -1e-5,0.50781 -0.20183,0.90983 -0.60547,1.20605 -0.40039,0.29622 -0.95215,0.44434 -1.65527,0.44434 -0.29297,0 -0.59896,-0.0293 -0.91797,-0.0879 -0.31576,-0.0553 -0.64942,-0.13998 -1.00098,-0.25391 l 0,-0.92774 c 0.33203,0.17253 0.65918,0.30274 0.98145,0.39063 0.32226,0.0846 0.64127,0.12695 0.95703,0.12695 0.42317,0 0.74869,-0.0716 0.97656,-0.21484 0.22786,-0.14648 0.34179,-0.35156 0.3418,-0.61524 -1e-5,-0.24413 -0.083,-0.43131 -0.24903,-0.56152 -0.16276,-0.13021 -0.52246,-0.25553 -1.0791,-0.37598 l -0.3125,-0.0732 c -0.55664,-0.11718 -0.95866,-0.29622 -1.20605,-0.53711 -0.2474,-0.24413 -0.3711,-0.57779 -0.3711,-1.00097 0,-0.51432 0.1823,-0.91146 0.54688,-1.19141 0.36458,-0.27994 0.88216,-0.41992 1.55273,-0.41992 0.33203,0 0.64453,0.0244 0.9375,0.0732 0.29297,0.0488 0.56315,0.12208 0.81055,0.21973"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3229" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 161.56097,375.64706 0.89843,0 0,5.46875 -0.89843,0 0,-5.46875 m 0,-2.1289 0.89843,0 0,1.13769 -0.89843,0 0,-1.13769"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3231" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 165.22308,374.09433 0,1.55273 1.85058,0 0,0.69825 -1.85058,0 0,2.96875 c -1e-5,0.44596 0.0602,0.73242 0.18066,0.85937 0.1237,0.12696 0.37272,0.19043 0.74707,0.19043 l 0.92285,0 0,0.75195 -0.92285,0 c -0.69336,0 -1.17188,-0.12858 -1.43555,-0.38574 -0.26367,-0.26041 -0.39551,-0.73242 -0.3955,-1.41601 l 0,-2.96875 -0.65918,0 0,-0.69825 0.65918,0 0,-1.55273 0.90332,0"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3233" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 168.26019,375.64706 0.89843,0 0,5.46875 -0.89843,0 0,-5.46875 m 0,-2.1289 0.89843,0 0,1.13769 -0.89843,0 0,-1.13769"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3235" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 173.15276,376.27695 c -0.48177,0 -0.86263,0.1888 -1.14257,0.5664 -0.27995,0.37436 -0.41993,0.88868 -0.41993,1.54297 0,0.6543 0.13835,1.17025 0.41504,1.54785 0.27995,0.37435 0.66243,0.56153 1.14746,0.56153 0.47852,0 0.85775,-0.1888 1.1377,-0.56641 0.27994,-0.3776 0.41992,-0.89192 0.41992,-1.54297 0,-0.64778 -0.13998,-1.16048 -0.41992,-1.53808 -0.27995,-0.38086 -0.65918,-0.57129 -1.1377,-0.57129 m 0,-0.76172 c 0.78125,0 1.39486,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66895,2.10937 -1e-5,0.89519 -0.22299,1.59831 -0.66895,2.10938 -0.44596,0.50781 -1.05957,0.76172 -1.84082,0.76172 -0.7845,0 -1.39974,-0.25391 -1.8457,-0.76172 -0.44271,-0.51107 -0.66406,-1.21419 -0.66406,-2.10938 0,-0.89843 0.22135,-1.60156 0.66406,-2.10937 0.44596,-0.50781 1.0612,-0.76172 1.8457,-0.76172"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3237" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 181.6928,377.81503 0,3.30078 -0.89844,0 0,-3.27148 c 0,-0.51757 -0.10091,-0.90494 -0.30273,-1.16211 -0.20183,-0.25716 -0.50456,-0.38574 -0.9082,-0.38574 -0.48503,0 -0.86752,0.15463 -1.14746,0.46387 -0.27995,0.30924 -0.41993,0.73079 -0.41993,1.26464 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.21485,-0.32877 0.46712,-0.57454 0.75684,-0.7373 0.29297,-0.16276 0.62988,-0.24414 1.01074,-0.24414 0.62825,0 1.10351,0.19532 1.42578,0.58594 0.32226,0.38737 0.4834,0.95866 0.4834,1.71386"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3239" />
 | 
			
		||||
    </g>
 | 
			
		||||
    <g
 | 
			
		||||
       style="font-size:12px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
 | 
			
		||||
       id="text3017">
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 367.17007,356.71783 -2.7832,-7.29003 1.03027,0 2.30958,6.13769 2.31445,-6.13769 1.02539,0 -2.77832,7.29003 -1.11817,0"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3242" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 371.87222,351.24908 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3244" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 377.81461,352.08893 c -0.10092,-0.0586 -0.2116,-0.10091 -0.33204,-0.12695 -0.11719,-0.0293 -0.24739,-0.0439 -0.39062,-0.0439 -0.50782,0 -0.89844,0.16602 -1.17188,0.49805 -0.27018,0.32878 -0.40527,0.80241 -0.40527,1.4209 l 0,2.88085 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.1888,-0.33202 0.43457,-0.57779 0.73731,-0.7373 0.30273,-0.16276 0.67057,-0.24414 1.10351,-0.24414 0.0618,0 0.13021,0.005 0.20508,0.0146 0.0749,0.007 0.15787,0.0179 0.24902,0.0342 l 0.005,0.92285"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3246" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 379.65543,349.69635 0,1.55273 1.85058,0 0,0.69825 -1.85058,0 0,2.96875 c -1e-5,0.44596 0.0602,0.73242 0.18066,0.85937 0.1237,0.12696 0.37272,0.19043 0.74707,0.19043 l 0.92285,0 0,0.75195 -0.92285,0 c -0.69336,0 -1.17188,-0.12858 -1.43555,-0.38574 -0.26367,-0.26041 -0.39551,-0.73242 -0.3955,-1.41601 l 0,-2.96875 -0.65918,0 0,-0.69825 0.65918,0 0,-1.55273 0.90332,0"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3248" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 382.59976,354.55963 0,-3.31055 0.89844,0 0,3.27637 c 0,0.51758 0.10091,0.90658 0.30273,1.16699 0.20182,0.25717 0.50456,0.38575 0.90821,0.38575 0.48502,0 0.86751,-0.15463 1.14746,-0.46387 0.2832,-0.30924 0.4248,-0.73079 0.4248,-1.26465 l 0,-3.10059 0.89844,0 0,5.46875 -0.89844,0 0,-0.83984 c -0.2181,0.33203 -0.47201,0.57943 -0.76172,0.74219 -0.28646,0.1595 -0.62012,0.23926 -1.00097,0.23926 -0.62826,0 -1.10515,-0.19532 -1.43067,-0.58594 -0.32552,-0.39063 -0.48828,-0.96191 -0.48828,-1.71387 m 2.26074,-3.44238 0,0"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3250" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 391.52554,353.96881 c -0.72591,0 -1.22884,0.083 -1.50879,0.24902 -0.27995,0.16602 -0.41992,0.44923 -0.41992,0.84961 0,0.31902 0.10417,0.57292 0.3125,0.76172 0.21159,0.18555 0.49805,0.27832 0.85938,0.27832 0.49804,0 0.8968,-0.17578 1.19629,-0.52734 0.30273,-0.35482 0.45409,-0.82519 0.4541,-1.41113 l 0,-0.2002 -0.89356,0 m 1.792,-0.37109 0,3.12011 -0.89844,0 0,-0.83007 c -0.20508,0.33203 -0.46062,0.5778 -0.7666,0.7373 -0.306,0.15625 -0.68035,0.23438 -1.12305,0.23438 -0.5599,0 -1.00586,-0.15625 -1.33789,-0.46875 -0.32878,-0.31576 -0.49317,-0.73731 -0.49317,-1.26465 0,-0.61523 0.20508,-1.0791 0.61524,-1.3916 0.41341,-0.3125 1.02864,-0.46875 1.8457,-0.46875 l 1.25977,0 0,-0.0879 c -1e-5,-0.41341 -0.13673,-0.73242 -0.41016,-0.95704 -0.27018,-0.22786 -0.65104,-0.34179 -1.14258,-0.34179 -0.3125,0 -0.61686,0.0374 -0.91308,0.1123 -0.29623,0.0749 -0.58106,0.18718 -0.85449,0.33692 l 0,-0.83008 c 0.32877,-0.12695 0.64778,-0.22135 0.95703,-0.28321 0.30924,-0.0651 0.61035,-0.0976 0.90332,-0.0976 0.79101,0 1.38183,0.20508 1.77246,0.61523 0.39062,0.41016 0.58593,1.03191 0.58594,1.86524"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3252" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 395.173,349.12018 0.89844,0 0,7.59765 -0.89844,0 0,-7.59765"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3254" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 404.61636,351.41022 0,0.84961 c -0.25391,-0.13021 -0.51758,-0.22786 -0.79101,-0.29297 -0.27344,-0.0651 -0.55665,-0.0976 -0.84961,-0.0977 -0.44597,1e-5 -0.78125,0.0684 -1.00586,0.20508 -0.22136,0.13672 -0.33203,0.3418 -0.33203,0.61523 0,0.20834 0.0797,0.37273 0.23926,0.49317 0.1595,0.11719 0.48014,0.22949 0.96191,0.33691 l 0.30762,0.0684 c 0.63801,0.13672 1.09049,0.33041 1.35742,0.58106 0.27018,0.24739 0.40527,0.59407 0.40527,1.04004 0,0.50781 -0.20183,0.90983 -0.60547,1.20605 -0.40039,0.29622 -0.95215,0.44434 -1.65527,0.44434 -0.29297,0 -0.59896,-0.0293 -0.91797,-0.0879 -0.31576,-0.0553 -0.64941,-0.13998 -1.00098,-0.25391 l 0,-0.92774 c 0.33204,0.17253 0.65918,0.30274 0.98145,0.39063 0.32226,0.0846 0.64127,0.12695 0.95703,0.12695 0.42318,0 0.7487,-0.0716 0.97656,-0.21484 0.22786,-0.14648 0.3418,-0.35156 0.3418,-0.61524 0,-0.24413 -0.083,-0.43131 -0.24902,-0.56152 -0.16277,-0.1302 -0.52247,-0.25553 -1.0791,-0.37598 l -0.3125,-0.0732 c -0.55665,-0.11718 -0.95866,-0.29622 -1.20606,-0.53711 -0.2474,-0.24413 -0.37109,-0.57779 -0.37109,-1.00097 0,-0.51432 0.18229,-0.91146 0.54687,-1.19141 0.36458,-0.27994 0.88216,-0.41992 1.55274,-0.41992 0.33202,0 0.64452,0.0244 0.9375,0.0732 0.29296,0.0488 0.56314,0.12208 0.81054,0.21973"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3256" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 410.28043,351.45905 0,0.83984 c -0.25391,-0.13997 -0.50945,-0.24414 -0.76661,-0.3125 -0.25391,-0.0716 -0.51107,-0.10742 -0.77148,-0.10742 -0.58268,0 -1.03516,0.18555 -1.35742,0.55664 -0.32227,0.36784 -0.4834,0.88542 -0.4834,1.55273 0,0.66732 0.16113,1.18653 0.4834,1.55762 0.32226,0.36784 0.77474,0.55176 1.35742,0.55176 0.26041,0 0.51757,-0.0342 0.77148,-0.10254 0.25716,-0.0716 0.5127,-0.17741 0.76661,-0.31738 l 0,0.83007 c -0.25066,0.11719 -0.51108,0.20508 -0.78125,0.26368 -0.26693,0.0586 -0.55177,0.0879 -0.8545,0.0879 -0.82357,0 -1.47786,-0.25879 -1.96289,-0.77637 -0.48502,-0.51758 -0.72754,-1.21582 -0.72754,-2.09473 0,-0.89192 0.24414,-1.59342 0.73243,-2.10449 0.49153,-0.51106 1.16373,-0.7666 2.0166,-0.7666 0.27669,0 0.54687,0.0293 0.81054,0.0879 0.26367,0.0553 0.51921,0.13998 0.76661,0.25391"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3258" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 415.02164,352.08893 c -0.10092,-0.0586 -0.2116,-0.10091 -0.33203,-0.12695 -0.1172,-0.0293 -0.2474,-0.0439 -0.39063,-0.0439 -0.50781,0 -0.89844,0.16602 -1.17187,0.49805 -0.27019,0.32878 -0.40528,0.80241 -0.40528,1.4209 l 0,2.88085 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.1888,-0.33202 0.43457,-0.57779 0.73731,-0.7373 0.30273,-0.16276 0.67057,-0.24414 1.10351,-0.24414 0.0618,0 0.13021,0.005 0.20508,0.0146 0.0749,0.007 0.15787,0.0179 0.24902,0.0342 l 0.005,0.92285"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3260" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 420.43668,353.75885 0,0.43945 -4.13086,0 c 0.0391,0.61849 0.2246,1.0905 0.55664,1.41602 0.33528,0.32227 0.80078,0.4834 1.39648,0.4834 0.34505,0 0.67871,-0.0423 1.00098,-0.12696 0.32551,-0.0846 0.64778,-0.21158 0.9668,-0.38086 l 0,0.84961 c -0.32228,0.13672 -0.65268,0.24089 -0.99122,0.3125 -0.33854,0.0716 -0.68197,0.10743 -1.03027,0.10743 -0.8724,0 -1.56413,-0.25391 -2.07519,-0.76172 -0.50782,-0.50781 -0.76172,-1.19466 -0.76172,-2.06055 0,-0.89518 0.24088,-1.60481 0.72265,-2.12891 0.48503,-0.52733 1.1377,-0.79101 1.95801,-0.79101 0.73567,0 1.31673,0.23763 1.74316,0.71289 0.42969,0.47201 0.64453,1.11491 0.64454,1.92871 m -0.89844,-0.26367 c -0.007,-0.49153 -0.14486,-0.88379 -0.41504,-1.17676 -0.26693,-0.29296 -0.62175,-0.43945 -1.06445,-0.43945 -0.50131,0 -0.90333,0.1416 -1.20606,0.4248 -0.29948,0.28321 -0.47201,0.68197 -0.51758,1.19629 l 3.20313,-0.005"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3262" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 426.58902,353.75885 0,0.43945 -4.13086,0 c 0.0391,0.61849 0.22461,1.0905 0.55664,1.41602 0.33529,0.32227 0.80078,0.4834 1.39649,0.4834 0.34504,0 0.6787,-0.0423 1.00097,-0.12696 0.32552,-0.0846 0.64778,-0.21158 0.9668,-0.38086 l 0,0.84961 c -0.32227,0.13672 -0.65268,0.24089 -0.99121,0.3125 -0.33855,0.0716 -0.68197,0.10743 -1.03028,0.10743 -0.87239,0 -1.56412,-0.25391 -2.07519,-0.76172 -0.50781,-0.50781 -0.76172,-1.19466 -0.76172,-2.06055 0,-0.89518 0.24089,-1.60481 0.72266,-2.12891 0.48502,-0.52733 1.13769,-0.79101 1.958,-0.79101 0.73568,0 1.31673,0.23763 1.74317,0.71289 0.42968,0.47201 0.64452,1.11491 0.64453,1.92871 m -0.89844,-0.26367 c -0.007,-0.49153 -0.14486,-0.88379 -0.41504,-1.17676 -0.26693,-0.29296 -0.62175,-0.43945 -1.06445,-0.43945 -0.5013,0 -0.90332,0.1416 -1.20605,0.4248 -0.29949,0.28321 -0.47201,0.68197 -0.51758,1.19629 l 3.20312,-0.005"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3264" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 432.60953,353.41705 0,3.30078 -0.89844,0 0,-3.27148 c 0,-0.51757 -0.10092,-0.90494 -0.30273,-1.16211 -0.20183,-0.25716 -0.50457,-0.38574 -0.90821,-0.38574 -0.48503,0 -0.86751,0.15463 -1.14746,0.46387 -0.27995,0.30924 -0.41992,0.73079 -0.41992,1.26464 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.21484,-0.32877 0.46712,-0.57454 0.75684,-0.7373 0.29296,-0.16276 0.62988,-0.24414 1.01074,-0.24414 0.62825,0 1.10351,0.19532 1.42578,0.58594 0.32226,0.38737 0.48339,0.95866 0.4834,1.71386"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3266" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 439.71402,351.87897 c -0.48177,0 -0.86263,0.1888 -1.14258,0.5664 -0.27995,0.37436 -0.41992,0.88868 -0.41992,1.54297 0,0.6543 0.13834,1.17025 0.41504,1.54785 0.27994,0.37435 0.66243,0.56153 1.14746,0.56153 0.47851,0 0.85774,-0.1888 1.1377,-0.56641 0.27994,-0.3776 0.41991,-0.89192 0.41992,-1.54297 -10e-6,-0.64778 -0.13998,-1.16048 -0.41992,-1.53808 -0.27996,-0.38086 -0.65919,-0.57129 -1.1377,-0.57129 m 0,-0.76172 c 0.78125,0 1.39485,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66895,2.10937 -1e-5,0.89519 -0.22299,1.59831 -0.66895,2.10938 -0.44597,0.50781 -1.05957,0.76172 -1.84082,0.76172 -0.78451,0 -1.39974,-0.25391 -1.8457,-0.76172 -0.44271,-0.51107 -0.66407,-1.21419 -0.66407,-2.10938 0,-0.89843 0.22136,-1.60156 0.66407,-2.10937 0.44596,-0.50781 1.06119,-0.76172 1.8457,-0.76172"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3268" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 446.87711,352.08893 c -0.10092,-0.0586 -0.2116,-0.10091 -0.33204,-0.12695 -0.11719,-0.0293 -0.24739,-0.0439 -0.39062,-0.0439 -0.50782,0 -0.89844,0.16602 -1.17188,0.49805 -0.27018,0.32878 -0.40527,0.80241 -0.40527,1.4209 l 0,2.88085 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.1888,-0.33202 0.43457,-0.57779 0.73731,-0.7373 0.30273,-0.16276 0.67057,-0.24414 1.10351,-0.24414 0.0618,0 0.13021,0.005 0.20508,0.0146 0.0749,0.007 0.15787,0.0179 0.24902,0.0342 l 0.005,0.92285"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3270" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 447.82925,351.24908 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3272" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 454.20132,353.91998 c 0,-0.65104 -0.13509,-1.15559 -0.40527,-1.51367 -0.26693,-0.35807 -0.64291,-0.5371 -1.12793,-0.53711 -0.48177,1e-5 -0.85775,0.17904 -1.12793,0.53711 -0.26693,0.35808 -0.40039,0.86263 -0.40039,1.51367 0,0.64779 0.13346,1.15072 0.40039,1.50879 0.27018,0.35808 0.64616,0.53711 1.12793,0.53711 0.48502,0 0.861,-0.17903 1.12793,-0.53711 0.27018,-0.35807 0.40527,-0.861 0.40527,-1.50879 m 0.89844,2.11914 c 0,0.93099 -0.20671,1.62272 -0.62012,2.0752 -0.41341,0.45573 -1.04655,0.68359 -1.89941,0.68359 -0.31576,0 -0.61361,-0.0244 -0.89355,-0.0732 -0.27995,-0.0456 -0.55176,-0.11719 -0.81543,-0.21484 l 0,-0.87403 c 0.26367,0.14323 0.52408,0.24903 0.78125,0.31739 0.25716,0.0684 0.5192,0.10253 0.78613,0.10254 0.58919,-10e-6 1.03027,-0.15463 1.32324,-0.46387 0.29297,-0.30599 0.43945,-0.76986 0.43945,-1.3916 l 0,-0.44434 c -0.18555,0.32227 -0.42318,0.56315 -0.71289,0.72266 -0.28971,0.1595 -0.63639,0.23925 -1.04004,0.23925 -0.67057,0 -1.21093,-0.25553 -1.62109,-0.7666 -0.41016,-0.51106 -0.61523,-1.18815 -0.61523,-2.03125 0,-0.84635 0.20507,-1.52506 0.61523,-2.03613 0.41016,-0.51106 0.95052,-0.7666 1.62109,-0.7666 0.40365,0 0.75033,0.0798 1.04004,0.23926 0.28971,0.15951 0.52734,0.40039 0.71289,0.72265 l 0,-0.83008 0.89844,0 0,4.79004"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3274" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 456.95035,351.24908 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3276" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 464.26968,353.41705 0,3.30078 -0.89843,0 0,-3.27148 c -10e-6,-0.51757 -0.10092,-0.90494 -0.30274,-1.16211 -0.20183,-0.25716 -0.50456,-0.38574 -0.9082,-0.38574 -0.48503,0 -0.86752,0.15463 -1.14746,0.46387 -0.27995,0.30924 -0.41993,0.73079 -0.41992,1.26464 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.21484,-0.32877 0.46712,-0.57454 0.75683,-0.7373 0.29297,-0.16276 0.62988,-0.24414 1.01074,-0.24414 0.62826,0 1.10352,0.19532 1.42579,0.58594 0.32226,0.38737 0.48339,0.95866 0.48339,1.71386"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path3278" />
 | 
			
		||||
    </g>
 | 
			
		||||
    <path
 | 
			
		||||
       style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Lend)"
 | 
			
		||||
       d="m 343.73692,26.224389 0.01,294.941191"
 | 
			
		||||
       id="path3861"
 | 
			
		||||
       inkscape:connector-curvature="0"
 | 
			
		||||
       sodipodi:nodetypes="cc"
 | 
			
		||||
       transform="translate(12.627039,339.86462)" />
 | 
			
		||||
    <path
 | 
			
		||||
       sodipodi:nodetypes="cc"
 | 
			
		||||
       inkscape:connector-curvature="0"
 | 
			
		||||
       id="path4307"
 | 
			
		||||
       d="m 356.48533,366.00457 336.31202,-0.0196"
 | 
			
		||||
       style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Lend);stroke-miterlimit:4;stroke-dasharray:none" />
 | 
			
		||||
    <path
 | 
			
		||||
       sodipodi:nodetypes="cc"
 | 
			
		||||
       inkscape:connector-curvature="0"
 | 
			
		||||
       id="path4309"
 | 
			
		||||
       d="m 159.89916,447.6257 -0.0625,145.00422"
 | 
			
		||||
       style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Lend)" />
 | 
			
		||||
    <path
 | 
			
		||||
       style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Lend)"
 | 
			
		||||
       d="m 160.03997,448.23877 184.95568,-0.0159"
 | 
			
		||||
       id="path4493"
 | 
			
		||||
       inkscape:connector-curvature="0"
 | 
			
		||||
       sodipodi:nodetypes="cc" />
 | 
			
		||||
    <g
 | 
			
		||||
       style="font-size:12px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
 | 
			
		||||
       id="text4495">
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 228.57881,442.02737 0.49805,0 0.7666,3.08106 0.76416,-3.08106 0.5542,0 0.7666,3.08106 0.76416,-3.08106 0.50049,0 -0.91553,3.64502 -0.62012,0 -0.76904,-3.16406 -0.77637,3.16406 -0.62011,0 -0.91309,-3.64502"
 | 
			
		||||
         style="font-size:5px"
 | 
			
		||||
         id="path3141" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 233.71797,442.93802 0.44922,0 0,2.73437 -0.44922,0 0,-2.73437 m 0,-1.06445 0.44922,0 0,0.56884 -0.44922,0 0,-0.56884"
 | 
			
		||||
         style="font-size:5px"
 | 
			
		||||
         id="path3143" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 237.37764,444.022 0,1.65039 -0.44922,0 0,-1.63574 c 0,-0.25879 -0.0505,-0.45247 -0.15137,-0.58105 -0.10091,-0.12858 -0.25228,-0.19287 -0.4541,-0.19287 -0.24251,0 -0.43376,0.0773 -0.57373,0.23193 -0.13997,0.15462 -0.20996,0.3654 -0.20996,0.63232 l 0,1.54541 -0.45166,0 0,-2.73437 0.45166,0 0,0.4248 c 0.10742,-0.16438 0.23356,-0.28727 0.37842,-0.36865 0.14648,-0.0814 0.31494,-0.12207 0.50537,-0.12207 0.31413,0 0.55176,0.0977 0.71289,0.29297 0.16113,0.19369 0.2417,0.47933 0.2417,0.85693"
 | 
			
		||||
         style="font-size:5px"
 | 
			
		||||
         id="path3145" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 240.07784,443.35306 0,-1.47949 0.44921,0 0,3.79882 -0.44921,0 0,-0.41015 c -0.0944,0.16276 -0.21404,0.28401 -0.35889,0.36377 -0.14323,0.0781 -0.31576,0.11718 -0.51758,0.11718 -0.3304,0 -0.59977,-0.13183 -0.80811,-0.3955 -0.2067,-0.26367 -0.31005,-0.61035 -0.31005,-1.04004 0,-0.42969 0.10335,-0.77637 0.31005,-1.04004 0.20834,-0.26367 0.47771,-0.39551 0.80811,-0.39551 0.20182,0 0.37435,0.0399 0.51758,0.11963 0.14485,0.0781 0.26448,0.19857 0.35889,0.36133 m -1.53077,0.95459 c 0,0.3304 0.0676,0.59 0.20264,0.77881 0.13672,0.18717 0.32389,0.28076 0.56152,0.28076 0.23763,0 0.42481,-0.0936 0.56153,-0.28076 0.13671,-0.18881 0.20507,-0.44841 0.20508,-0.77881 -1e-5,-0.3304 -0.0684,-0.58919 -0.20508,-0.77637 -0.13672,-0.1888 -0.3239,-0.2832 -0.56153,-0.2832 -0.23763,0 -0.4248,0.0944 -0.56152,0.2832 -0.13509,0.18718 -0.20264,0.44597 -0.20264,0.77637"
 | 
			
		||||
         style="font-size:5px"
 | 
			
		||||
         id="path3147" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 242.51192,443.25296 c -0.24089,0 -0.43132,0.0944 -0.57129,0.2832 -0.13998,0.18718 -0.20996,0.44434 -0.20996,0.77149 0,0.32715 0.0692,0.58512 0.20752,0.77392 0.13997,0.18718 0.33121,0.28077 0.57373,0.28077 0.23925,0 0.42887,-0.0944 0.56884,-0.28321 0.13998,-0.1888 0.20996,-0.44596 0.20997,-0.77148 -1e-5,-0.32389 -0.07,-0.58024 -0.20997,-0.76905 -0.13997,-0.19042 -0.32959,-0.28564 -0.56884,-0.28564 m 0,-0.38086 c 0.39062,0 0.69742,0.12696 0.92041,0.38086 0.22298,0.25391 0.33447,0.60547 0.33447,1.05469 0,0.44759 -0.11149,0.79915 -0.33447,1.05469 -0.22299,0.2539 -0.52979,0.38085 -0.92041,0.38085 -0.39226,0 -0.69987,-0.12695 -0.92285,-0.38085 -0.22136,-0.25554 -0.33204,-0.6071 -0.33204,-1.05469 0,-0.44922 0.11068,-0.80078 0.33204,-1.05469 0.22298,-0.2539 0.53059,-0.38086 0.92285,-0.38086"
 | 
			
		||||
         style="font-size:5px"
 | 
			
		||||
         id="path3149" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 244.24776,442.93802 0.44922,0 0.56152,2.13379 0.55908,-2.13379 0.52979,0 0.56152,2.13379 0.55908,-2.13379 0.44922,0 -0.71533,2.73437 -0.52979,0 -0.58838,-2.24121 -0.59082,2.24121 -0.52978,0 -0.71533,-2.73437"
 | 
			
		||||
         style="font-size:5px"
 | 
			
		||||
         id="path3151" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 249.70674,442.02737 3.0835,0 0,0.41504 -1.29395,0 0,3.22998 -0.4956,0 0,-3.22998 -1.29395,0 0,-0.41504"
 | 
			
		||||
         style="font-size:5px"
 | 
			
		||||
         id="path3153" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 253.09297,442.93802 0.44922,0 0,2.73437 -0.44922,0 0,-2.73437 m 0,-1.06445 0.44922,0 0,0.56884 -0.44922,0 0,-0.56884"
 | 
			
		||||
         style="font-size:5px"
 | 
			
		||||
         id="path3155" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 254.92403,442.16165 0,0.77637 0.92529,0 0,0.34912 -0.92529,0 0,1.48437 c 0,0.22299 0.0301,0.36622 0.0903,0.42969 0.0618,0.0635 0.18636,0.0952 0.37353,0.0952 l 0.46143,0 0,0.37597 -0.46143,0 c -0.34668,0 -0.58593,-0.0643 -0.71777,-0.19287 -0.13184,-0.13021 -0.19775,-0.36621 -0.19775,-0.70801 l 0,-1.48437 -0.32959,0 0,-0.34912 0.32959,0 0,-0.77637 0.45166,0"
 | 
			
		||||
         style="font-size:5px"
 | 
			
		||||
         id="path3157" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 256.44258,441.87357 0.44922,0 0,3.79882 -0.44922,0 0,-3.79882"
 | 
			
		||||
         style="font-size:5px"
 | 
			
		||||
         id="path3159" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 260.16817,444.1929 0,0.21973 -2.06543,0 c 0.0195,0.30924 0.1123,0.54525 0.27832,0.70801 0.16764,0.16113 0.40039,0.2417 0.69824,0.2417 0.17252,0 0.33935,-0.0212 0.50049,-0.0635 0.16276,-0.0423 0.32389,-0.1058 0.4834,-0.19043 l 0,0.4248 c -0.16114,0.0684 -0.32634,0.12045 -0.49561,0.15625 -0.16927,0.0358 -0.34098,0.0537 -0.51514,0.0537 -0.43619,0 -0.78206,-0.12695 -1.03759,-0.38085 -0.25391,-0.25391 -0.38086,-0.59733 -0.38086,-1.03028 0,-0.44759 0.12044,-0.8024 0.36133,-1.06445 0.24251,-0.26367 0.56884,-0.39551 0.979,-0.39551 0.36784,0 0.65836,0.11882 0.87158,0.35645 0.21484,0.236 0.32226,0.55745 0.32227,0.96435 m -0.44922,-0.13183 c -0.003,-0.24577 -0.0724,-0.4419 -0.20752,-0.58838 -0.13347,-0.14649 -0.31088,-0.21973 -0.53223,-0.21973 -0.25065,0 -0.45166,0.0708 -0.60303,0.2124 -0.14974,0.14161 -0.236,0.34099 -0.25878,0.59815 l 1.60156,-0.002"
 | 
			
		||||
         style="font-size:5px"
 | 
			
		||||
         id="path3161" />
 | 
			
		||||
    </g>
 | 
			
		||||
    <g
 | 
			
		||||
       aria-label="Content area origin"
 | 
			
		||||
       style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none"
 | 
			
		||||
       id="text4089">
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 172.21587,456.09125 v 1.04004 q -0.49805,-0.46387 -1.06446,-0.69336 -0.56152,-0.22949 -1.19629,-0.22949 -1.25,0 -1.91406,0.7666 -0.66406,0.76172 -0.66406,2.20703 0,1.44043 0.66406,2.20703 0.66406,0.76172 1.91406,0.76172 0.63477,0 1.19629,-0.22949 0.56641,-0.2295 1.06446,-0.69336 v 1.03027 q -0.51758,0.35156 -1.09864,0.52734 -0.57617,0.17578 -1.2207,0.17578 -1.65527,0 -2.60742,-1.01074 -0.95215,-1.01562 -0.95215,-2.76855 0,-1.75781 0.95215,-2.76856 0.95215,-1.01562 2.60742,-1.01562 0.6543,0 1.23047,0.17578 0.58105,0.1709 1.08887,0.51758 z"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path4091" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 175.82915,457.9809 q -0.72266,0 -1.14258,0.5664 -0.41992,0.56153 -0.41992,1.54297 0,0.98145 0.41504,1.54785 0.41992,0.56153 1.14746,0.56153 0.71777,0 1.13769,-0.56641 0.41992,-0.56641 0.41992,-1.54297 0,-0.97168 -0.41992,-1.53808 -0.41992,-0.57129 -1.13769,-0.57129 z m 0,-0.76172 q 1.17187,0 1.84082,0.76172 0.66894,0.76171 0.66894,2.10937 0,1.34277 -0.66894,2.10938 -0.66895,0.76171 -1.84082,0.76171 -1.17676,0 -1.84571,-0.76171 -0.66406,-0.76661 -0.66406,-2.10938 0,-1.34766 0.66406,-2.10937 0.66895,-0.76172 1.84571,-0.76172 z"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path4093" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 184.36919,459.51898 v 3.30078 h -0.89844 v -3.27148 q 0,-0.77637 -0.30274,-1.16211 -0.30273,-0.38574 -0.9082,-0.38574 -0.72754,0 -1.14746,0.46386 -0.41992,0.46387 -0.41992,1.26465 v 3.09082 h -0.90332 v -5.46875 h 0.90332 v 0.84961 q 0.32226,-0.49316 0.75683,-0.7373 0.43946,-0.24414 1.01075,-0.24414 0.94238,0 1.42578,0.58593 0.4834,0.58106 0.4834,1.71387 z"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path4095" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 187.05962,455.79828 v 1.55273 h 1.85058 v 0.69825 h -1.85058 v 2.96875 q 0,0.66894 0.18066,0.85937 0.18555,0.19043 0.74707,0.19043 h 0.92285 v 0.75195 h -0.92285 q -1.04004,0 -1.43555,-0.38574 -0.3955,-0.39062 -0.3955,-1.41601 v -2.96875 h -0.65918 v -0.69825 h 0.65918 v -1.55273 z"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path4097" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 194.77446,459.86078 v 0.43945 h -4.13086 q 0.0586,0.92774 0.55664,1.41602 0.50293,0.4834 1.39649,0.4834 0.51757,0 1.00097,-0.12696 0.48828,-0.12695 0.9668,-0.38086 v 0.84961 q -0.4834,0.20508 -0.99121,0.3125 -0.50781,0.10742 -1.03028,0.10742 -1.30859,0 -2.07519,-0.76171 -0.76172,-0.76172 -0.76172,-2.06055 0,-1.34277 0.72266,-2.12891 0.72754,-0.79101 1.958,-0.79101 1.10352,0 1.74317,0.71289 0.64453,0.70801 0.64453,1.92871 z m -0.89844,-0.26367 q -0.01,-0.73731 -0.41504,-1.17676 -0.40039,-0.43945 -1.06445,-0.43945 -0.75195,0 -1.20605,0.4248 -0.44922,0.42481 -0.51758,1.19629 z"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path4099" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 200.79497,459.51898 v 3.30078 h -0.89844 v -3.27148 q 0,-0.77637 -0.30273,-1.16211 -0.30274,-0.38574 -0.90821,-0.38574 -0.72754,0 -1.14746,0.46386 -0.41992,0.46387 -0.41992,1.26465 v 3.09082 h -0.90332 v -5.46875 h 0.90332 v 0.84961 q 0.32227,-0.49316 0.75684,-0.7373 0.43945,-0.24414 1.01074,-0.24414 0.94238,0 1.42578,0.58593 0.4834,0.58106 0.4834,1.71387 z"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path4101" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 203.4854,455.79828 v 1.55273 h 1.85058 v 0.69825 h -1.85058 v 2.96875 q 0,0.66894 0.18066,0.85937 0.18555,0.19043 0.74707,0.19043 h 0.92285 v 0.75195 h -0.92285 q -1.04004,0 -1.43555,-0.38574 -0.3955,-0.39062 -0.3955,-1.41601 v -2.96875 h -0.65918 v -0.69825 h 0.65918 v -1.55273 z"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path4103" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 212.19145,460.07074 q -1.08887,0 -1.50879,0.24902 -0.41992,0.24903 -0.41992,0.84961 0,0.47852 0.3125,0.76172 0.31738,0.27832 0.85938,0.27832 0.74707,0 1.19629,-0.52734 0.4541,-0.53223 0.4541,-1.41113 v -0.2002 z m 1.79199,-0.37109 v 3.12011 h -0.89843 v -0.83007 q -0.30762,0.49804 -0.7666,0.7373 -0.45899,0.23437 -1.12305,0.23437 -0.83985,0 -1.33789,-0.46875 -0.49317,-0.47363 -0.49317,-1.26464 0,-0.92286 0.61524,-1.39161 0.62012,-0.46875 1.8457,-0.46875 h 1.25977 v -0.0879 q 0,-0.62011 -0.41016,-0.95703 -0.40527,-0.34179 -1.14258,-0.34179 -0.46875,0 -0.91308,0.1123 -0.44434,0.11231 -0.8545,0.33691 v -0.83007 q 0.49317,-0.19043 0.95704,-0.28321 0.46386,-0.0976 0.90332,-0.0976 1.18652,0 1.77246,0.61523 0.58593,0.61524 0.58593,1.86524 z"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path4105" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 219.00786,458.19086 q -0.15137,-0.0879 -0.33203,-0.12696 -0.17578,-0.0439 -0.39063,-0.0439 -0.76172,0 -1.17187,0.49805 -0.40528,0.49316 -0.40528,1.42089 v 2.88086 h -0.90332 v -5.46875 h 0.90332 v 0.84961 q 0.28321,-0.49804 0.73731,-0.7373 0.4541,-0.24414 1.10351,-0.24414 0.0928,0 0.20508,0.0147 0.11231,0.01 0.24903,0.0342 z"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path4107" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 224.4229,459.86078 v 0.43945 h -4.13086 q 0.0586,0.92774 0.55664,1.41602 0.50293,0.4834 1.39648,0.4834 0.51758,0 1.00098,-0.12696 0.48828,-0.12695 0.9668,-0.38086 v 0.84961 q -0.4834,0.20508 -0.99121,0.3125 -0.50782,0.10742 -1.03028,0.10742 -1.30859,0 -2.07519,-0.76171 -0.76172,-0.76172 -0.76172,-2.06055 0,-1.34277 0.72265,-2.12891 0.72754,-0.79101 1.95801,-0.79101 1.10352,0 1.74317,0.71289 0.64453,0.70801 0.64453,1.92871 z m -0.89844,-0.26367 q -0.01,-0.73731 -0.41504,-1.17676 -0.40039,-0.43945 -1.06445,-0.43945 -0.75196,0 -1.20606,0.4248 -0.44922,0.42481 -0.51758,1.19629 z"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path4109" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 228.38286,460.07074 q -1.08887,0 -1.50879,0.24902 -0.41992,0.24903 -0.41992,0.84961 0,0.47852 0.3125,0.76172 0.31738,0.27832 0.85937,0.27832 0.74707,0 1.19629,-0.52734 0.4541,-0.53223 0.4541,-1.41113 v -0.2002 z m 1.79199,-0.37109 v 3.12011 h -0.89844 v -0.83007 q -0.30761,0.49804 -0.7666,0.7373 -0.45898,0.23437 -1.12305,0.23437 -0.83984,0 -1.33789,-0.46875 -0.49316,-0.47363 -0.49316,-1.26464 0,-0.92286 0.61523,-1.39161 0.62012,-0.46875 1.84571,-0.46875 h 1.25976 v -0.0879 q 0,-0.62011 -0.41015,-0.95703 -0.40528,-0.34179 -1.14258,-0.34179 -0.46875,0 -0.91309,0.1123 -0.44433,0.11231 -0.85449,0.33691 v -0.83007 q 0.49316,-0.19043 0.95703,-0.28321 0.46387,-0.0976 0.90332,-0.0976 1.18653,0 1.77246,0.61523 0.58594,0.61524 0.58594,1.86524 z"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path4111" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 237.33305,457.9809 q -0.72265,0 -1.14257,0.5664 -0.41993,0.56153 -0.41993,1.54297 0,0.98145 0.41504,1.54785 0.41992,0.56153 1.14746,0.56153 0.71778,0 1.1377,-0.56641 0.41992,-0.56641 0.41992,-1.54297 0,-0.97168 -0.41992,-1.53808 -0.41992,-0.57129 -1.1377,-0.57129 z m 0,-0.76172 q 1.17188,0 1.84082,0.76172 0.66895,0.76171 0.66895,2.10937 0,1.34277 -0.66895,2.10938 -0.66894,0.76171 -1.84082,0.76171 -1.17675,0 -1.8457,-0.76171 -0.66406,-0.76661 -0.66406,-2.10938 0,-1.34766 0.66406,-2.10937 0.66895,-0.76172 1.8457,-0.76172 z"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path4113" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 244.49614,458.19086 q -0.15137,-0.0879 -0.33203,-0.12696 -0.17578,-0.0439 -0.39063,-0.0439 -0.76172,0 -1.17187,0.49805 -0.40528,0.49316 -0.40528,1.42089 v 2.88086 h -0.90332 v -5.46875 h 0.90332 v 0.84961 q 0.28321,-0.49804 0.73731,-0.7373 0.4541,-0.24414 1.10352,-0.24414 0.0928,0 0.20507,0.0147 0.11231,0.01 0.24903,0.0342 z"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path4115" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 245.44829,457.35101 h 0.89844 v 5.46875 h -0.89844 z m 0,-2.1289 h 0.89844 v 1.13769 h -0.89844 z"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path4117" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 251.82036,460.02191 q 0,-0.97656 -0.40528,-1.51367 -0.40039,-0.53711 -1.12792,-0.53711 -0.72266,0 -1.12793,0.53711 -0.4004,0.53711 -0.4004,1.51367 0,0.97168 0.4004,1.50879 0.40527,0.53711 1.12793,0.53711 0.72753,0 1.12792,-0.53711 0.40528,-0.53711 0.40528,-1.50879 z m 0.89844,2.11914 q 0,1.39649 -0.62012,2.0752 -0.62012,0.68359 -1.89942,0.68359 -0.47363,0 -0.89355,-0.0732 -0.41992,-0.0684 -0.81543,-0.21484 v -0.87403 q 0.39551,0.21485 0.78125,0.31738 0.38574,0.10254 0.78613,0.10254 0.88379,0 1.32325,-0.46386 0.43945,-0.45899 0.43945,-1.3916 v -0.44434 q -0.27832,0.4834 -0.71289,0.72266 -0.43457,0.23925 -1.04004,0.23925 -1.00586,0 -1.6211,-0.7666 -0.61523,-0.7666 -0.61523,-2.03125 0,-1.26953 0.61523,-2.03613 0.61524,-0.7666 1.6211,-0.7666 0.60547,0 1.04004,0.23926 0.43457,0.23925 0.71289,0.72265 v -0.83008 h 0.89844 z"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path4119" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 254.56938,457.35101 h 0.89844 v 5.46875 h -0.89844 z m 0,-2.1289 h 0.89844 v 1.13769 h -0.89844 z"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path4121" />
 | 
			
		||||
      <path
 | 
			
		||||
         d="m 261.88872,459.51898 v 3.30078 h -0.89844 v -3.27148 q 0,-0.77637 -0.30273,-1.16211 -0.30274,-0.38574 -0.90821,-0.38574 -0.72754,0 -1.14746,0.46386 -0.41992,0.46387 -0.41992,1.26465 v 3.09082 h -0.90332 v -5.46875 h 0.90332 v 0.84961 q 0.32227,-0.49316 0.75684,-0.7373 0.43945,-0.24414 1.01074,-0.24414 0.94238,0 1.42578,0.58593 0.4834,0.58106 0.4834,1.71387 z"
 | 
			
		||||
         style="font-size:10px"
 | 
			
		||||
         id="path4123" />
 | 
			
		||||
    </g>
 | 
			
		||||
  </g>
 | 
			
		||||
</svg>
 | 
			
		||||
| 
		 After Width: | Height: | Size: 108 KiB  | 
							
								
								
									
										230
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/vulkan.dox
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										230
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/vulkan.dox
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,230 @@
 | 
			
		||||
/*!
 | 
			
		||||
 | 
			
		||||
@page vulkan_guide Vulkan guide
 | 
			
		||||
 | 
			
		||||
@tableofcontents
 | 
			
		||||
 | 
			
		||||
This guide is intended to fill the gaps between the [Vulkan
 | 
			
		||||
documentation](https://www.khronos.org/vulkan/) and the rest of the GLFW
 | 
			
		||||
documentation and is not a replacement for either.  It assumes some familiarity
 | 
			
		||||
with Vulkan concepts like loaders, devices, queues and surfaces and leaves it to
 | 
			
		||||
the Vulkan documentation to explain the details of Vulkan functions.
 | 
			
		||||
 | 
			
		||||
To develop for Vulkan you should download the [LunarG Vulkan
 | 
			
		||||
SDK](https://vulkan.lunarg.com/) for your platform.  Apart from headers and link
 | 
			
		||||
libraries, they also provide the validation layers necessary for development.
 | 
			
		||||
 | 
			
		||||
For details on a specific function in this category, see the @ref vulkan.  There
 | 
			
		||||
are also guides for the other areas of the GLFW API.
 | 
			
		||||
 | 
			
		||||
 - @ref intro_guide
 | 
			
		||||
 - @ref window_guide
 | 
			
		||||
 - @ref context_guide
 | 
			
		||||
 - @ref monitor_guide
 | 
			
		||||
 - @ref input_guide
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section vulkan_loader Linking against the Vulkan loader
 | 
			
		||||
 | 
			
		||||
By default, GLFW will look for the Vulkan loader on demand at runtime via its
 | 
			
		||||
standard name (`vulkan-1.dll` on Windows, `libvulkan.so.1` on Linux and other
 | 
			
		||||
Unix-like systems and `libvulkan.1.dylib` on macOS).  This means that GLFW does
 | 
			
		||||
not need to be linked against the loader.  However, it also means that if you
 | 
			
		||||
are using the static library form of the Vulkan loader GLFW will either fail to
 | 
			
		||||
find it or (worse) use the wrong one.
 | 
			
		||||
 | 
			
		||||
The @ref GLFW_VULKAN_STATIC CMake option makes GLFW call the Vulkan loader
 | 
			
		||||
directly instead of dynamically loading it at runtime.  Not linking against the
 | 
			
		||||
Vulkan loader will then be a compile-time error.
 | 
			
		||||
 | 
			
		||||
@macos Because the Vulkan loader and ICD are not installed globally on macOS,
 | 
			
		||||
you need to set up the application bundle according to the LunarG SDK
 | 
			
		||||
documentation.  This is explained in more detail in the
 | 
			
		||||
[SDK documentation for macOS](https://vulkan.lunarg.com/doc/sdk/latest/mac/getting_started.html).
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section vulkan_include Including the Vulkan and GLFW header files
 | 
			
		||||
 | 
			
		||||
To include the Vulkan header, define @ref GLFW_INCLUDE_VULKAN before including
 | 
			
		||||
the GLFW header.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
#define GLFW_INCLUDE_VULKAN
 | 
			
		||||
#include <GLFW/glfw3.h>
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
If you instead want to include the Vulkan header from a custom location or use
 | 
			
		||||
your own custom Vulkan header then do this before the GLFW header.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
#include <path/to/vulkan.h>
 | 
			
		||||
#include <GLFW/glfw3.h>
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
Unless a Vulkan header is included, either by the GLFW header or above it, any
 | 
			
		||||
GLFW functions that take or return Vulkan types will not be declared.
 | 
			
		||||
 | 
			
		||||
The `VK_USE_PLATFORM_*_KHR` macros do not need to be defined for the Vulkan part
 | 
			
		||||
of GLFW to work.  Define them only if you are using these extensions directly.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section vulkan_support Querying for Vulkan support
 | 
			
		||||
 | 
			
		||||
If you are linking directly against the Vulkan loader then you can skip this
 | 
			
		||||
section.  The canonical desktop loader library exports all Vulkan core and
 | 
			
		||||
Khronos extension functions, allowing them to be called directly.
 | 
			
		||||
 | 
			
		||||
If you are loading the Vulkan loader dynamically instead of linking directly
 | 
			
		||||
against it, you can check for the availability of a loader and ICD with @ref
 | 
			
		||||
glfwVulkanSupported.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
if (glfwVulkanSupported())
 | 
			
		||||
{
 | 
			
		||||
    // Vulkan is available, at least for compute
 | 
			
		||||
}
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
This function returns `GLFW_TRUE` if the Vulkan loader and any minimally
 | 
			
		||||
functional ICD was found.
 | 
			
		||||
 | 
			
		||||
If if one or both were not found, calling any other Vulkan related GLFW function
 | 
			
		||||
will generate a @ref GLFW_API_UNAVAILABLE error.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@subsection vulkan_proc Querying Vulkan function pointers
 | 
			
		||||
 | 
			
		||||
To load any Vulkan core or extension function from the found loader, call @ref
 | 
			
		||||
glfwGetInstanceProcAddress.  To load functions needed for instance creation,
 | 
			
		||||
pass `NULL` as the instance.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
PFN_vkCreateInstance pfnCreateInstance = (PFN_vkCreateInstance)
 | 
			
		||||
    glfwGetInstanceProcAddress(NULL, "vkCreateInstance");
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
Once you have created an instance, you can load from it all other Vulkan core
 | 
			
		||||
functions and functions from any instance extensions you enabled.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
PFN_vkCreateDevice pfnCreateDevice = (PFN_vkCreateDevice)
 | 
			
		||||
    glfwGetInstanceProcAddress(instance, "vkCreateDevice");
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
This function in turn calls `vkGetInstanceProcAddr`.  If that fails, the
 | 
			
		||||
function falls back to a platform-specific query of the Vulkan loader (i.e.
 | 
			
		||||
`dlsym` or `GetProcAddress`).  If that also fails, the function returns `NULL`.
 | 
			
		||||
For more information about `vkGetInstanceProcAddr`, see the Vulkan
 | 
			
		||||
documentation.
 | 
			
		||||
 | 
			
		||||
Vulkan also provides `vkGetDeviceProcAddr` for loading device-specific versions
 | 
			
		||||
of Vulkan function.  This function can be retrieved from an instance with @ref
 | 
			
		||||
glfwGetInstanceProcAddress.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
PFN_vkGetDeviceProcAddr pfnGetDeviceProcAddr = (PFN_vkGetDeviceProcAddr)
 | 
			
		||||
    glfwGetInstanceProcAddress(instance, "vkGetDeviceProcAddr");
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
Device-specific functions may execute a little bit faster, due to not having to
 | 
			
		||||
dispatch internally based on the device passed to them.  For more information
 | 
			
		||||
about `vkGetDeviceProcAddr`, see the Vulkan documentation.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section vulkan_ext Querying required Vulkan extensions
 | 
			
		||||
 | 
			
		||||
To do anything useful with Vulkan you need to create an instance.  If you want
 | 
			
		||||
to use Vulkan to render to a window, you must enable the instance extensions
 | 
			
		||||
GLFW requires to create Vulkan surfaces.
 | 
			
		||||
 | 
			
		||||
To query the instance extensions required, call @ref
 | 
			
		||||
glfwGetRequiredInstanceExtensions.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
uint32_t count;
 | 
			
		||||
const char** extensions = glfwGetRequiredInstanceExtensions(&count);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
These extensions must all be enabled when creating instances that are going to
 | 
			
		||||
be passed to @ref glfwGetPhysicalDevicePresentationSupport and @ref
 | 
			
		||||
glfwCreateWindowSurface.  The set of extensions will vary depending on platform
 | 
			
		||||
and may also vary depending on graphics drivers and other factors.
 | 
			
		||||
 | 
			
		||||
If it fails it will return `NULL` and GLFW will not be able to create Vulkan
 | 
			
		||||
window surfaces.  You can still use Vulkan for off-screen rendering and compute
 | 
			
		||||
work.
 | 
			
		||||
 | 
			
		||||
If successful the returned array will always include `VK_KHR_surface`, so if
 | 
			
		||||
you don't require any additional extensions you can pass this list directly to
 | 
			
		||||
the `VkInstanceCreateInfo` struct.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
VkInstanceCreateInfo ici;
 | 
			
		||||
 | 
			
		||||
memset(&ici, 0, sizeof(ici));
 | 
			
		||||
ici.enabledExtensionCount = count;
 | 
			
		||||
ici.ppEnabledExtensionNames = extensions;
 | 
			
		||||
...
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
Additional extensions may be required by future versions of GLFW.  You should
 | 
			
		||||
check whether any extensions you wish to enable are already in the returned
 | 
			
		||||
array, as it is an error to specify an extension more than once in the
 | 
			
		||||
`VkInstanceCreateInfo` struct.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section vulkan_present Querying for Vulkan presentation support
 | 
			
		||||
 | 
			
		||||
Not every queue family of every Vulkan device can present images to surfaces.
 | 
			
		||||
To check whether a specific queue family of a physical device supports image
 | 
			
		||||
presentation without first having to create a window and surface, call @ref
 | 
			
		||||
glfwGetPhysicalDevicePresentationSupport.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
if (glfwGetPhysicalDevicePresentationSupport(instance, physical_device, queue_family_index))
 | 
			
		||||
{
 | 
			
		||||
    // Queue family supports image presentation
 | 
			
		||||
}
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
The `VK_KHR_surface` extension additionally provides the
 | 
			
		||||
`vkGetPhysicalDeviceSurfaceSupportKHR` function, which performs the same test on
 | 
			
		||||
an existing Vulkan surface.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section vulkan_window Creating the window
 | 
			
		||||
 | 
			
		||||
Unless you will be using OpenGL or OpenGL ES with the same window as Vulkan,
 | 
			
		||||
there is no need to create a context.  You can disable context creation with the
 | 
			
		||||
[GLFW_CLIENT_API](@ref GLFW_CLIENT_API_hint) hint.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
 | 
			
		||||
GLFWwindow* window = glfwCreateWindow(640, 480, "Window Title", NULL, NULL);
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
See @ref context_less for more information.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@section vulkan_surface Creating a Vulkan window surface
 | 
			
		||||
 | 
			
		||||
You can create a Vulkan surface (as defined by the `VK_KHR_surface` extension)
 | 
			
		||||
for a GLFW window with @ref glfwCreateWindowSurface.
 | 
			
		||||
 | 
			
		||||
@code
 | 
			
		||||
VkSurfaceKHR surface;
 | 
			
		||||
VkResult err = glfwCreateWindowSurface(instance, window, NULL, &surface);
 | 
			
		||||
if (err)
 | 
			
		||||
{
 | 
			
		||||
    // Window surface creation failed
 | 
			
		||||
}
 | 
			
		||||
@endcode
 | 
			
		||||
 | 
			
		||||
If an OpenGL or OpenGL ES context was created on the window, the context has
 | 
			
		||||
ownership of the presentation on the window and a Vulkan surface cannot be
 | 
			
		||||
created.
 | 
			
		||||
 | 
			
		||||
It is your responsibility to destroy the surface.  GLFW does not destroy it for
 | 
			
		||||
you.  Call `vkDestroySurfaceKHR` function from the same extension to destroy it.
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
							
								
								
									
										1419
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/window.dox
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1419
									
								
								cs440-acg/ext/nanogui/ext/glfw/docs/window.dox
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										77
									
								
								cs440-acg/ext/nanogui/ext/glfw/examples/CMakeLists.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										77
									
								
								cs440-acg/ext/nanogui/ext/glfw/examples/CMakeLists.txt
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,77 @@
 | 
			
		||||
 | 
			
		||||
link_libraries(glfw)
 | 
			
		||||
 | 
			
		||||
include_directories(${glfw_INCLUDE_DIRS} "${GLFW_SOURCE_DIR}/deps")
 | 
			
		||||
 | 
			
		||||
if (MATH_LIBRARY)
 | 
			
		||||
    link_libraries("${MATH_LIBRARY}")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (MSVC)
 | 
			
		||||
    add_definitions(-D_CRT_SECURE_NO_WARNINGS)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (GLFW_USE_OSMESA)
 | 
			
		||||
    add_definitions(-DUSE_NATIVE_OSMESA)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (WIN32)
 | 
			
		||||
    set(ICON glfw.rc)
 | 
			
		||||
elseif (APPLE)
 | 
			
		||||
    set(ICON glfw.icns)
 | 
			
		||||
    set_source_files_properties(glfw.icns PROPERTIES
 | 
			
		||||
        MACOSX_PACKAGE_LOCATION "Resources")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
set(GLAD_GL "${GLFW_SOURCE_DIR}/deps/glad/gl.h"
 | 
			
		||||
            "${GLFW_SOURCE_DIR}/deps/glad_gl.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")
 | 
			
		||||
 | 
			
		||||
add_executable(boing WIN32 MACOSX_BUNDLE boing.c ${ICON} ${GLAD_GL})
 | 
			
		||||
add_executable(gears WIN32 MACOSX_BUNDLE gears.c ${ICON} ${GLAD_GL})
 | 
			
		||||
add_executable(heightmap WIN32 MACOSX_BUNDLE heightmap.c ${ICON} ${GLAD_GL})
 | 
			
		||||
add_executable(offscreen offscreen.c ${ICON} ${GLAD_GL})
 | 
			
		||||
add_executable(particles WIN32 MACOSX_BUNDLE particles.c ${ICON} ${TINYCTHREAD} ${GETOPT} ${GLAD_GL})
 | 
			
		||||
add_executable(sharing WIN32 MACOSX_BUNDLE sharing.c ${ICON} ${GLAD_GL})
 | 
			
		||||
add_executable(simple WIN32 MACOSX_BUNDLE simple.c ${ICON} ${GLAD_GL})
 | 
			
		||||
add_executable(splitview WIN32 MACOSX_BUNDLE splitview.c ${ICON} ${GLAD_GL})
 | 
			
		||||
add_executable(wave WIN32 MACOSX_BUNDLE wave.c ${ICON} ${GLAD_GL})
 | 
			
		||||
 | 
			
		||||
target_link_libraries(particles "${CMAKE_THREAD_LIBS_INIT}")
 | 
			
		||||
if (RT_LIBRARY)
 | 
			
		||||
    target_link_libraries(particles "${RT_LIBRARY}")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
set(WINDOWS_BINARIES boing gears heightmap particles sharing simple splitview wave)
 | 
			
		||||
set(CONSOLE_BINARIES offscreen)
 | 
			
		||||
 | 
			
		||||
set_target_properties(${WINDOWS_BINARIES} ${CONSOLE_BINARIES} PROPERTIES
 | 
			
		||||
                      FOLDER "GLFW3/Examples")
 | 
			
		||||
 | 
			
		||||
if (MSVC)
 | 
			
		||||
    # 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_target_properties(boing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Boing")
 | 
			
		||||
    set_target_properties(gears PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Gears")
 | 
			
		||||
    set_target_properties(heightmap PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Heightmap")
 | 
			
		||||
    set_target_properties(particles PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Particles")
 | 
			
		||||
    set_target_properties(sharing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Sharing")
 | 
			
		||||
    set_target_properties(simple PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Simple")
 | 
			
		||||
    set_target_properties(splitview PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "SplitView")
 | 
			
		||||
    set_target_properties(wave PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Wave")
 | 
			
		||||
 | 
			
		||||
    set_target_properties(${WINDOWS_BINARIES} PROPERTIES
 | 
			
		||||
                          RESOURCE glfw.icns
 | 
			
		||||
                          MACOSX_BUNDLE_SHORT_VERSION_STRING ${GLFW_VERSION}
 | 
			
		||||
                          MACOSX_BUNDLE_LONG_VERSION_STRING ${GLFW_VERSION_FULL}
 | 
			
		||||
                          MACOSX_BUNDLE_ICON_FILE glfw.icns
 | 
			
		||||
                          MACOSX_BUNDLE_INFO_PLIST "${GLFW_SOURCE_DIR}/CMake/MacOSXBundleInfo.plist.in")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										678
									
								
								cs440-acg/ext/nanogui/ext/glfw/examples/boing.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										678
									
								
								cs440-acg/ext/nanogui/ext/glfw/examples/boing.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,678 @@
 | 
			
		||||
/*****************************************************************************
 | 
			
		||||
 * Title:   GLBoing
 | 
			
		||||
 * Desc:    Tribute to Amiga Boing.
 | 
			
		||||
 * Author:  Jim Brooks  <gfx@jimbrooks.org>
 | 
			
		||||
 *          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.
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
 | 
			
		||||
#if defined(_MSC_VER)
 | 
			
		||||
 // Make MS math.h define M_PI
 | 
			
		||||
 #define _USE_MATH_DEFINES
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <math.h>
 | 
			
		||||
 | 
			
		||||
#include <glad/gl.h>
 | 
			
		||||
#include <GLFW/glfw3.h>
 | 
			
		||||
 | 
			
		||||
#include <linmath.h>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*****************************************************************************
 | 
			
		||||
 * 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 windowed_xpos, windowed_ypos, windowed_width, windowed_height;
 | 
			
		||||
int width, height;
 | 
			
		||||
GLfloat deg_rot_y       = 0.f;
 | 
			
		||||
GLfloat deg_rot_y_inc   = 2.f;
 | 
			
		||||
int override_pos        = GLFW_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
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*****************************************************************************
 | 
			
		||||
 * 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 * u3;
 | 
			
		||||
   n->y = u3 * v1 - v3 * u1;
 | 
			
		||||
   n->z = u1 * v2 - v1 * u2;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#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 )
 | 
			
		||||
{
 | 
			
		||||
   mat4x4 projection, view;
 | 
			
		||||
 | 
			
		||||
   glViewport( 0, 0, (GLsizei)w, (GLsizei)h );
 | 
			
		||||
 | 
			
		||||
   glMatrixMode( GL_PROJECTION );
 | 
			
		||||
   mat4x4_perspective( projection,
 | 
			
		||||
                       2.f * (float) atan2( RADIUS, 200.f ),
 | 
			
		||||
                       (float)w / (float)h,
 | 
			
		||||
                       1.f, VIEW_SCENE_DIST );
 | 
			
		||||
   glLoadMatrixf((const GLfloat*) projection);
 | 
			
		||||
 | 
			
		||||
   glMatrixMode( GL_MODELVIEW );
 | 
			
		||||
   {
 | 
			
		||||
      vec3 eye = { 0.f, 0.f, VIEW_SCENE_DIST };
 | 
			
		||||
      vec3 center = { 0.f, 0.f, 0.f };
 | 
			
		||||
      vec3 up = { 0.f, -1.f, 0.f };
 | 
			
		||||
      mat4x4_look_at( view, eye, center, up );
 | 
			
		||||
   }
 | 
			
		||||
   glLoadMatrixf((const GLfloat*) view);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void key_callback( GLFWwindow* window, int key, int scancode, int action, int mods )
 | 
			
		||||
{
 | 
			
		||||
    if (action != GLFW_PRESS)
 | 
			
		||||
        return;
 | 
			
		||||
 | 
			
		||||
    if (key == GLFW_KEY_ESCAPE && mods == 0)
 | 
			
		||||
        glfwSetWindowShouldClose(window, GLFW_TRUE);
 | 
			
		||||
    if ((key == GLFW_KEY_ENTER && mods == GLFW_MOD_ALT) ||
 | 
			
		||||
        (key == GLFW_KEY_F11 && mods == GLFW_MOD_ALT))
 | 
			
		||||
    {
 | 
			
		||||
        if (glfwGetWindowMonitor(window))
 | 
			
		||||
        {
 | 
			
		||||
            glfwSetWindowMonitor(window, NULL,
 | 
			
		||||
                                 windowed_xpos, windowed_ypos,
 | 
			
		||||
                                 windowed_width, windowed_height, 0);
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
            GLFWmonitor* monitor = glfwGetPrimaryMonitor();
 | 
			
		||||
            if (monitor)
 | 
			
		||||
            {
 | 
			
		||||
                const GLFWvidmode* mode = glfwGetVideoMode(monitor);
 | 
			
		||||
                glfwGetWindowPos(window, &windowed_xpos, &windowed_ypos);
 | 
			
		||||
                glfwGetWindowSize(window, &windowed_width, &windowed_height);
 | 
			
		||||
                glfwSetWindowMonitor(window, monitor, 0, 0, mode->width, mode->height, mode->refreshRate);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
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 = GLFW_TRUE;
 | 
			
		||||
      set_ball_pos(cursor_x, cursor_y);
 | 
			
		||||
   }
 | 
			
		||||
   else
 | 
			
		||||
   {
 | 
			
		||||
      override_pos = GLFW_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 noticeably 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 through 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 );
 | 
			
		||||
 | 
			
		||||
   window = glfwCreateWindow( 400, 400, "Boing (classic Amiga demo)", NULL, NULL );
 | 
			
		||||
   if (!window)
 | 
			
		||||
   {
 | 
			
		||||
       glfwTerminate();
 | 
			
		||||
       exit( EXIT_FAILURE );
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
   glfwSetWindowAspectRatio(window, 1, 1);
 | 
			
		||||
 | 
			
		||||
   glfwSetFramebufferSizeCallback(window, reshape);
 | 
			
		||||
   glfwSetKeyCallback(window, key_callback);
 | 
			
		||||
   glfwSetMouseButtonCallback(window, mouse_button_callback);
 | 
			
		||||
   glfwSetCursorPosCallback(window, cursor_position_callback);
 | 
			
		||||
 | 
			
		||||
   glfwMakeContextCurrent(window);
 | 
			
		||||
   gladLoadGL(glfwGetProcAddress);
 | 
			
		||||
   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 );
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										359
									
								
								cs440-acg/ext/nanogui/ext/glfw/examples/gears.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										359
									
								
								cs440-acg/ext/nanogui/ext/glfw/examples/gears.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,359 @@
 | 
			
		||||
/*
 | 
			
		||||
 * 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 Löwy:
 | 
			
		||||
 *   - Removed FPS counter (this is not a benchmark)
 | 
			
		||||
 *   - Added a few comments
 | 
			
		||||
 *   - Enabled vsync
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#if defined(_MSC_VER)
 | 
			
		||||
 // Make MS math.h define M_PI
 | 
			
		||||
 #define _USE_MATH_DEFINES
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <math.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
 | 
			
		||||
#include <glad/gl.h>
 | 
			
		||||
#include <GLFW/glfw3.h>
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 | 
			
		||||
  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)
 | 
			
		||||
{
 | 
			
		||||
  glClearColor(0.0, 0.0, 0.0, 0.0);
 | 
			
		||||
  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, GLFW_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(void)
 | 
			
		||||
{
 | 
			
		||||
  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};
 | 
			
		||||
 | 
			
		||||
  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);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* program entry */
 | 
			
		||||
int main(int argc, char *argv[])
 | 
			
		||||
{
 | 
			
		||||
    GLFWwindow* window;
 | 
			
		||||
    int width, height;
 | 
			
		||||
 | 
			
		||||
    if( !glfwInit() )
 | 
			
		||||
    {
 | 
			
		||||
        fprintf( stderr, "Failed to initialize GLFW\n" );
 | 
			
		||||
        exit( EXIT_FAILURE );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    glfwWindowHint(GLFW_DEPTH_BITS, 16);
 | 
			
		||||
    glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE);
 | 
			
		||||
 | 
			
		||||
    window = glfwCreateWindow( 300, 300, "Gears", NULL, NULL );
 | 
			
		||||
    if (!window)
 | 
			
		||||
    {
 | 
			
		||||
        fprintf( stderr, "Failed to open GLFW window\n" );
 | 
			
		||||
        glfwTerminate();
 | 
			
		||||
        exit( EXIT_FAILURE );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Set callback functions
 | 
			
		||||
    glfwSetFramebufferSizeCallback(window, reshape);
 | 
			
		||||
    glfwSetKeyCallback(window, key);
 | 
			
		||||
 | 
			
		||||
    glfwMakeContextCurrent(window);
 | 
			
		||||
    gladLoadGL(glfwGetProcAddress);
 | 
			
		||||
    glfwSwapInterval( 1 );
 | 
			
		||||
 | 
			
		||||
    glfwGetFramebufferSize(window, &width, &height);
 | 
			
		||||
    reshape(window, width, height);
 | 
			
		||||
 | 
			
		||||
    // Parse command-line options
 | 
			
		||||
    init();
 | 
			
		||||
 | 
			
		||||
    // Main loop
 | 
			
		||||
    while( !glfwWindowShouldClose(window) )
 | 
			
		||||
    {
 | 
			
		||||
        // Draw gears
 | 
			
		||||
        draw();
 | 
			
		||||
 | 
			
		||||
        // Update animation
 | 
			
		||||
        animate();
 | 
			
		||||
 | 
			
		||||
        // Swap buffers
 | 
			
		||||
        glfwSwapBuffers(window);
 | 
			
		||||
        glfwPollEvents();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Terminate GLFW
 | 
			
		||||
    glfwTerminate();
 | 
			
		||||
 | 
			
		||||
    // Exit program
 | 
			
		||||
    exit( EXIT_SUCCESS );
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								cs440-acg/ext/nanogui/ext/glfw/examples/glfw.icns
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								cs440-acg/ext/nanogui/ext/glfw/examples/glfw.icns
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								cs440-acg/ext/nanogui/ext/glfw/examples/glfw.ico
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								cs440-acg/ext/nanogui/ext/glfw/examples/glfw.ico
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 21 KiB  | 
							
								
								
									
										3
									
								
								cs440-acg/ext/nanogui/ext/glfw/examples/glfw.rc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								cs440-acg/ext/nanogui/ext/glfw/examples/glfw.rc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
 | 
			
		||||
GLFW_ICON               ICON            "glfw.ico"
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										511
									
								
								cs440-acg/ext/nanogui/ext/glfw/examples/heightmap.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										511
									
								
								cs440-acg/ext/nanogui/ext/glfw/examples/heightmap.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,511 @@
 | 
			
		||||
//========================================================================
 | 
			
		||||
// Heightmap example program using OpenGL 3 core profile
 | 
			
		||||
// Copyright (c) 2010 Olivier Delannoy
 | 
			
		||||
//
 | 
			
		||||
// 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 <stdlib.h>
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <math.h>
 | 
			
		||||
#include <assert.h>
 | 
			
		||||
#include <stddef.h>
 | 
			
		||||
 | 
			
		||||
#include <glad/gl.h>
 | 
			
		||||
#include <GLFW/glfw3.h>
 | 
			
		||||
 | 
			
		||||
/* 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* vertex_shader_text =
 | 
			
		||||
"#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* fragment_shader_text =
 | 
			
		||||
"#version 150\n"
 | 
			
		||||
"out vec4 color;\n"
 | 
			
		||||
"void main()\n"
 | 
			
		||||
"{\n"
 | 
			
		||||
"    color = 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
 | 
			
		||||
 *********************************************************************/
 | 
			
		||||
 | 
			
		||||
/* Creates a shader object of the specified type using the specified text
 | 
			
		||||
 */
 | 
			
		||||
static GLuint make_shader(GLenum type, const char* text)
 | 
			
		||||
{
 | 
			
		||||
    GLuint shader;
 | 
			
		||||
    GLint shader_ok;
 | 
			
		||||
    GLsizei log_length;
 | 
			
		||||
    char info_log[8192];
 | 
			
		||||
 | 
			
		||||
    shader = glCreateShader(type);
 | 
			
		||||
    if (shader != 0)
 | 
			
		||||
    {
 | 
			
		||||
        glShaderSource(shader, 1, (const GLchar**)&text, 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* vs_text, const char* fs_text)
 | 
			
		||||
{
 | 
			
		||||
    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, vs_text);
 | 
			
		||||
    if (vertex_shader != 0u)
 | 
			
		||||
    {
 | 
			
		||||
        fragment_shader = make_shader(GL_FRAGMENT_SHADER, fs_text);
 | 
			
		||||
        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 * (float) sqrt((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, GLFW_TRUE);
 | 
			
		||||
            break;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void error_callback(int error, const char* description)
 | 
			
		||||
{
 | 
			
		||||
    fprintf(stderr, "Error: %s\n", description);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int main(int argc, char** argv)
 | 
			
		||||
{
 | 
			
		||||
    GLFWwindow* window;
 | 
			
		||||
    int iter;
 | 
			
		||||
    double dt;
 | 
			
		||||
    double last_update_time;
 | 
			
		||||
    int frame;
 | 
			
		||||
    float f;
 | 
			
		||||
    GLint uloc_modelview;
 | 
			
		||||
    GLint uloc_project;
 | 
			
		||||
    int width, height;
 | 
			
		||||
 | 
			
		||||
    GLuint shader_program;
 | 
			
		||||
 | 
			
		||||
    glfwSetErrorCallback(error_callback);
 | 
			
		||||
 | 
			
		||||
    if (!glfwInit())
 | 
			
		||||
        exit(EXIT_FAILURE);
 | 
			
		||||
 | 
			
		||||
    glfwWindowHint(GLFW_RESIZABLE, GLFW_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, GLFW_TRUE);
 | 
			
		||||
 | 
			
		||||
    window = glfwCreateWindow(800, 600, "GLFW OpenGL3 Heightmap demo", NULL, NULL);
 | 
			
		||||
    if (! window )
 | 
			
		||||
    {
 | 
			
		||||
        glfwTerminate();
 | 
			
		||||
        exit(EXIT_FAILURE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /* Register events callback */
 | 
			
		||||
    glfwSetKeyCallback(window, key_callback);
 | 
			
		||||
 | 
			
		||||
    glfwMakeContextCurrent(window);
 | 
			
		||||
    gladLoadGL(glfwGetProcAddress);
 | 
			
		||||
 | 
			
		||||
    /* Prepare opengl resources for rendering */
 | 
			
		||||
    shader_program = make_shader_program(vertex_shader_text, fragment_shader_text);
 | 
			
		||||
 | 
			
		||||
    if (shader_program == 0u)
 | 
			
		||||
    {
 | 
			
		||||
        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 */
 | 
			
		||||
    glfwGetFramebufferSize(window, &width, &height);
 | 
			
		||||
    glViewport(0, 0, width, height);
 | 
			
		||||
    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);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										175
									
								
								cs440-acg/ext/nanogui/ext/glfw/examples/offscreen.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										175
									
								
								cs440-acg/ext/nanogui/ext/glfw/examples/offscreen.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,175 @@
 | 
			
		||||
//========================================================================
 | 
			
		||||
// Offscreen rendering example
 | 
			
		||||
// Copyright (c) Camilla Löwy <elmindreda@glfw.org>
 | 
			
		||||
//
 | 
			
		||||
// 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 <glad/gl.h>
 | 
			
		||||
#include <GLFW/glfw3.h>
 | 
			
		||||
 | 
			
		||||
#if USE_NATIVE_OSMESA
 | 
			
		||||
 #define GLFW_EXPOSE_NATIVE_OSMESA
 | 
			
		||||
 #include <GLFW/glfw3native.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include "linmath.h"
 | 
			
		||||
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
 | 
			
		||||
#define STB_IMAGE_WRITE_IMPLEMENTATION
 | 
			
		||||
#include <stb_image_write.h>
 | 
			
		||||
 | 
			
		||||
static const struct
 | 
			
		||||
{
 | 
			
		||||
    float x, y;
 | 
			
		||||
    float r, g, b;
 | 
			
		||||
} vertices[3] =
 | 
			
		||||
{
 | 
			
		||||
    { -0.6f, -0.4f, 1.f, 0.f, 0.f },
 | 
			
		||||
    {  0.6f, -0.4f, 0.f, 1.f, 0.f },
 | 
			
		||||
    {   0.f,  0.6f, 0.f, 0.f, 1.f }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static const char* vertex_shader_text =
 | 
			
		||||
"#version 110\n"
 | 
			
		||||
"uniform mat4 MVP;\n"
 | 
			
		||||
"attribute vec3 vCol;\n"
 | 
			
		||||
"attribute vec2 vPos;\n"
 | 
			
		||||
"varying vec3 color;\n"
 | 
			
		||||
"void main()\n"
 | 
			
		||||
"{\n"
 | 
			
		||||
"    gl_Position = MVP * vec4(vPos, 0.0, 1.0);\n"
 | 
			
		||||
"    color = vCol;\n"
 | 
			
		||||
"}\n";
 | 
			
		||||
 | 
			
		||||
static const char* fragment_shader_text =
 | 
			
		||||
"#version 110\n"
 | 
			
		||||
"varying vec3 color;\n"
 | 
			
		||||
"void main()\n"
 | 
			
		||||
"{\n"
 | 
			
		||||
"    gl_FragColor = vec4(color, 1.0);\n"
 | 
			
		||||
"}\n";
 | 
			
		||||
 | 
			
		||||
static void error_callback(int error, const char* description)
 | 
			
		||||
{
 | 
			
		||||
    fprintf(stderr, "Error: %s\n", description);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int main(void)
 | 
			
		||||
{
 | 
			
		||||
    GLFWwindow* window;
 | 
			
		||||
    GLuint vertex_buffer, vertex_shader, fragment_shader, program;
 | 
			
		||||
    GLint mvp_location, vpos_location, vcol_location;
 | 
			
		||||
    float ratio;
 | 
			
		||||
    int width, height;
 | 
			
		||||
    mat4x4 mvp;
 | 
			
		||||
    char* buffer;
 | 
			
		||||
 | 
			
		||||
    glfwSetErrorCallback(error_callback);
 | 
			
		||||
 | 
			
		||||
    glfwInitHint(GLFW_COCOA_MENUBAR, GLFW_FALSE);
 | 
			
		||||
 | 
			
		||||
    if (!glfwInit())
 | 
			
		||||
        exit(EXIT_FAILURE);
 | 
			
		||||
 | 
			
		||||
    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
 | 
			
		||||
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
 | 
			
		||||
    glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
 | 
			
		||||
 | 
			
		||||
    window = glfwCreateWindow(640, 480, "Simple example", NULL, NULL);
 | 
			
		||||
    if (!window)
 | 
			
		||||
    {
 | 
			
		||||
        glfwTerminate();
 | 
			
		||||
        exit(EXIT_FAILURE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    glfwMakeContextCurrent(window);
 | 
			
		||||
    gladLoadGL(glfwGetProcAddress);
 | 
			
		||||
 | 
			
		||||
    // NOTE: OpenGL error checks have been omitted for brevity
 | 
			
		||||
 | 
			
		||||
    glGenBuffers(1, &vertex_buffer);
 | 
			
		||||
    glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer);
 | 
			
		||||
    glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
 | 
			
		||||
 | 
			
		||||
    vertex_shader = glCreateShader(GL_VERTEX_SHADER);
 | 
			
		||||
    glShaderSource(vertex_shader, 1, &vertex_shader_text, NULL);
 | 
			
		||||
    glCompileShader(vertex_shader);
 | 
			
		||||
 | 
			
		||||
    fragment_shader = glCreateShader(GL_FRAGMENT_SHADER);
 | 
			
		||||
    glShaderSource(fragment_shader, 1, &fragment_shader_text, NULL);
 | 
			
		||||
    glCompileShader(fragment_shader);
 | 
			
		||||
 | 
			
		||||
    program = glCreateProgram();
 | 
			
		||||
    glAttachShader(program, vertex_shader);
 | 
			
		||||
    glAttachShader(program, fragment_shader);
 | 
			
		||||
    glLinkProgram(program);
 | 
			
		||||
 | 
			
		||||
    mvp_location = glGetUniformLocation(program, "MVP");
 | 
			
		||||
    vpos_location = glGetAttribLocation(program, "vPos");
 | 
			
		||||
    vcol_location = glGetAttribLocation(program, "vCol");
 | 
			
		||||
 | 
			
		||||
    glEnableVertexAttribArray(vpos_location);
 | 
			
		||||
    glVertexAttribPointer(vpos_location, 2, GL_FLOAT, GL_FALSE,
 | 
			
		||||
                          sizeof(vertices[0]), (void*) 0);
 | 
			
		||||
    glEnableVertexAttribArray(vcol_location);
 | 
			
		||||
    glVertexAttribPointer(vcol_location, 3, GL_FLOAT, GL_FALSE,
 | 
			
		||||
                          sizeof(vertices[0]), (void*) (sizeof(float) * 2));
 | 
			
		||||
 | 
			
		||||
    glfwGetFramebufferSize(window, &width, &height);
 | 
			
		||||
    ratio = width / (float) height;
 | 
			
		||||
 | 
			
		||||
    glViewport(0, 0, width, height);
 | 
			
		||||
    glClear(GL_COLOR_BUFFER_BIT);
 | 
			
		||||
 | 
			
		||||
    mat4x4_ortho(mvp, -ratio, ratio, -1.f, 1.f, 1.f, -1.f);
 | 
			
		||||
 | 
			
		||||
    glUseProgram(program);
 | 
			
		||||
    glUniformMatrix4fv(mvp_location, 1, GL_FALSE, (const GLfloat*) mvp);
 | 
			
		||||
    glDrawArrays(GL_TRIANGLES, 0, 3);
 | 
			
		||||
 | 
			
		||||
#if USE_NATIVE_OSMESA
 | 
			
		||||
    glfwGetOSMesaColorBuffer(window, &width, &height, NULL, (void**) &buffer);
 | 
			
		||||
#else
 | 
			
		||||
    buffer = calloc(4, width * height);
 | 
			
		||||
    glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    // Write image Y-flipped because OpenGL
 | 
			
		||||
    stbi_write_png("offscreen.png",
 | 
			
		||||
                   width, height, 4,
 | 
			
		||||
                   buffer + (width * 4 * (height - 1)),
 | 
			
		||||
                   -width * 4);
 | 
			
		||||
 | 
			
		||||
#if USE_NATIVE_OSMESA
 | 
			
		||||
    // Here is where there's nothing
 | 
			
		||||
#else
 | 
			
		||||
    free(buffer);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    glfwDestroyWindow(window);
 | 
			
		||||
 | 
			
		||||
    glfwTerminate();
 | 
			
		||||
    exit(EXIT_SUCCESS);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										1072
									
								
								cs440-acg/ext/nanogui/ext/glfw/examples/particles.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1072
									
								
								cs440-acg/ext/nanogui/ext/glfw/examples/particles.c
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										233
									
								
								cs440-acg/ext/nanogui/ext/glfw/examples/sharing.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										233
									
								
								cs440-acg/ext/nanogui/ext/glfw/examples/sharing.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,233 @@
 | 
			
		||||
//========================================================================
 | 
			
		||||
// Context sharing example
 | 
			
		||||
// Copyright (c) Camilla Löwy <elmindreda@glfw.org>
 | 
			
		||||
//
 | 
			
		||||
// 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 <glad/gl.h>
 | 
			
		||||
#include <GLFW/glfw3.h>
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
 | 
			
		||||
#include "getopt.h"
 | 
			
		||||
#include "linmath.h"
 | 
			
		||||
 | 
			
		||||
static const char* vertex_shader_text =
 | 
			
		||||
"#version 110\n"
 | 
			
		||||
"uniform mat4 MVP;\n"
 | 
			
		||||
"attribute vec2 vPos;\n"
 | 
			
		||||
"varying vec2 texcoord;\n"
 | 
			
		||||
"void main()\n"
 | 
			
		||||
"{\n"
 | 
			
		||||
"    gl_Position = MVP * vec4(vPos, 0.0, 1.0);\n"
 | 
			
		||||
"    texcoord = vPos;\n"
 | 
			
		||||
"}\n";
 | 
			
		||||
 | 
			
		||||
static const char* fragment_shader_text =
 | 
			
		||||
"#version 110\n"
 | 
			
		||||
"uniform sampler2D texture;\n"
 | 
			
		||||
"uniform vec3 color;\n"
 | 
			
		||||
"varying vec2 texcoord;\n"
 | 
			
		||||
"void main()\n"
 | 
			
		||||
"{\n"
 | 
			
		||||
"    gl_FragColor = vec4(color * texture2D(texture, texcoord).rgb, 1.0);\n"
 | 
			
		||||
"}\n";
 | 
			
		||||
 | 
			
		||||
static const vec2 vertices[4] =
 | 
			
		||||
{
 | 
			
		||||
    { 0.f, 0.f },
 | 
			
		||||
    { 1.f, 0.f },
 | 
			
		||||
    { 1.f, 1.f },
 | 
			
		||||
    { 0.f, 1.f }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static void error_callback(int error, const char* description)
 | 
			
		||||
{
 | 
			
		||||
    fprintf(stderr, "Error: %s\n", description);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
 | 
			
		||||
{
 | 
			
		||||
    if (action == GLFW_PRESS && key == GLFW_KEY_ESCAPE)
 | 
			
		||||
        glfwSetWindowShouldClose(window, GLFW_TRUE);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int main(int argc, char** argv)
 | 
			
		||||
{
 | 
			
		||||
    GLFWwindow* windows[2];
 | 
			
		||||
    GLuint texture, program, vertex_buffer;
 | 
			
		||||
    GLint mvp_location, vpos_location, color_location, texture_location;
 | 
			
		||||
 | 
			
		||||
    glfwSetErrorCallback(error_callback);
 | 
			
		||||
 | 
			
		||||
    if (!glfwInit())
 | 
			
		||||
        exit(EXIT_FAILURE);
 | 
			
		||||
 | 
			
		||||
    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
 | 
			
		||||
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
 | 
			
		||||
 | 
			
		||||
    windows[0] = glfwCreateWindow(400, 400, "First", NULL, NULL);
 | 
			
		||||
    if (!windows[0])
 | 
			
		||||
    {
 | 
			
		||||
        glfwTerminate();
 | 
			
		||||
        exit(EXIT_FAILURE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    glfwSetKeyCallback(windows[0], key_callback);
 | 
			
		||||
 | 
			
		||||
    glfwMakeContextCurrent(windows[0]);
 | 
			
		||||
 | 
			
		||||
    // Only enable vsync for the first of the windows to be swapped to
 | 
			
		||||
    // avoid waiting out the interval for each window
 | 
			
		||||
    glfwSwapInterval(1);
 | 
			
		||||
 | 
			
		||||
    // The contexts are created with the same APIs so the function
 | 
			
		||||
    // pointers should be re-usable between them
 | 
			
		||||
    gladLoadGL(glfwGetProcAddress);
 | 
			
		||||
 | 
			
		||||
    // Create the OpenGL objects inside the first context, created above
 | 
			
		||||
    // All objects will be shared with the second context, created below
 | 
			
		||||
    {
 | 
			
		||||
        int x, y;
 | 
			
		||||
        char pixels[16 * 16];
 | 
			
		||||
        GLuint vertex_shader, fragment_shader;
 | 
			
		||||
 | 
			
		||||
        glGenTextures(1, &texture);
 | 
			
		||||
        glBindTexture(GL_TEXTURE_2D, texture);
 | 
			
		||||
 | 
			
		||||
        srand((unsigned int) glfwGetTimerValue());
 | 
			
		||||
 | 
			
		||||
        for (y = 0;  y < 16;  y++)
 | 
			
		||||
        {
 | 
			
		||||
            for (x = 0;  x < 16;  x++)
 | 
			
		||||
                pixels[y * 16 + x] = rand() % 256;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, 16, 16, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, pixels);
 | 
			
		||||
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 | 
			
		||||
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 | 
			
		||||
 | 
			
		||||
        vertex_shader = glCreateShader(GL_VERTEX_SHADER);
 | 
			
		||||
        glShaderSource(vertex_shader, 1, &vertex_shader_text, NULL);
 | 
			
		||||
        glCompileShader(vertex_shader);
 | 
			
		||||
 | 
			
		||||
        fragment_shader = glCreateShader(GL_FRAGMENT_SHADER);
 | 
			
		||||
        glShaderSource(fragment_shader, 1, &fragment_shader_text, NULL);
 | 
			
		||||
        glCompileShader(fragment_shader);
 | 
			
		||||
 | 
			
		||||
        program = glCreateProgram();
 | 
			
		||||
        glAttachShader(program, vertex_shader);
 | 
			
		||||
        glAttachShader(program, fragment_shader);
 | 
			
		||||
        glLinkProgram(program);
 | 
			
		||||
 | 
			
		||||
        mvp_location = glGetUniformLocation(program, "MVP");
 | 
			
		||||
        color_location = glGetUniformLocation(program, "color");
 | 
			
		||||
        texture_location = glGetUniformLocation(program, "texture");
 | 
			
		||||
        vpos_location = glGetAttribLocation(program, "vPos");
 | 
			
		||||
 | 
			
		||||
        glGenBuffers(1, &vertex_buffer);
 | 
			
		||||
        glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer);
 | 
			
		||||
        glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    glUseProgram(program);
 | 
			
		||||
    glUniform1i(texture_location, 0);
 | 
			
		||||
 | 
			
		||||
    glEnable(GL_TEXTURE_2D);
 | 
			
		||||
    glBindTexture(GL_TEXTURE_2D, texture);
 | 
			
		||||
 | 
			
		||||
    glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer);
 | 
			
		||||
    glEnableVertexAttribArray(vpos_location);
 | 
			
		||||
    glVertexAttribPointer(vpos_location, 2, GL_FLOAT, GL_FALSE,
 | 
			
		||||
                          sizeof(vertices[0]), (void*) 0);
 | 
			
		||||
 | 
			
		||||
    windows[1] = glfwCreateWindow(400, 400, "Second", NULL, windows[0]);
 | 
			
		||||
    if (!windows[1])
 | 
			
		||||
    {
 | 
			
		||||
        glfwTerminate();
 | 
			
		||||
        exit(EXIT_FAILURE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Place the second window to the right of the first
 | 
			
		||||
    {
 | 
			
		||||
        int xpos, ypos, left, right, width;
 | 
			
		||||
 | 
			
		||||
        glfwGetWindowSize(windows[0], &width, NULL);
 | 
			
		||||
        glfwGetWindowFrameSize(windows[0], &left, NULL, &right, NULL);
 | 
			
		||||
        glfwGetWindowPos(windows[0], &xpos, &ypos);
 | 
			
		||||
 | 
			
		||||
        glfwSetWindowPos(windows[1], xpos + width + left + right, ypos);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    glfwSetKeyCallback(windows[1], key_callback);
 | 
			
		||||
 | 
			
		||||
    glfwMakeContextCurrent(windows[1]);
 | 
			
		||||
 | 
			
		||||
    // While objects are shared, the global context state is not and will
 | 
			
		||||
    // need to be set up for each context
 | 
			
		||||
 | 
			
		||||
    glUseProgram(program);
 | 
			
		||||
 | 
			
		||||
    glEnable(GL_TEXTURE_2D);
 | 
			
		||||
    glBindTexture(GL_TEXTURE_2D, texture);
 | 
			
		||||
 | 
			
		||||
    glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer);
 | 
			
		||||
    glEnableVertexAttribArray(vpos_location);
 | 
			
		||||
    glVertexAttribPointer(vpos_location, 2, GL_FLOAT, GL_FALSE,
 | 
			
		||||
                          sizeof(vertices[0]), (void*) 0);
 | 
			
		||||
 | 
			
		||||
    while (!glfwWindowShouldClose(windows[0]) &&
 | 
			
		||||
           !glfwWindowShouldClose(windows[1]))
 | 
			
		||||
    {
 | 
			
		||||
        int i;
 | 
			
		||||
        const vec3 colors[2] =
 | 
			
		||||
        {
 | 
			
		||||
            { 0.8f, 0.4f, 1.f },
 | 
			
		||||
            { 0.3f, 0.4f, 1.f }
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        for (i = 0;  i < 2;  i++)
 | 
			
		||||
        {
 | 
			
		||||
            int width, height;
 | 
			
		||||
            mat4x4 mvp;
 | 
			
		||||
 | 
			
		||||
            glfwGetFramebufferSize(windows[i], &width, &height);
 | 
			
		||||
            glfwMakeContextCurrent(windows[i]);
 | 
			
		||||
 | 
			
		||||
            glViewport(0, 0, width, height);
 | 
			
		||||
 | 
			
		||||
            mat4x4_ortho(mvp, 0.f, 1.f, 0.f, 1.f, 0.f, 1.f);
 | 
			
		||||
            glUniformMatrix4fv(mvp_location, 1, GL_FALSE, (const GLfloat*) mvp);
 | 
			
		||||
            glUniform3fv(color_location, 1, colors[i]);
 | 
			
		||||
            glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
 | 
			
		||||
 | 
			
		||||
            glfwSwapBuffers(windows[i]);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        glfwWaitEvents();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    glfwTerminate();
 | 
			
		||||
    exit(EXIT_SUCCESS);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										165
									
								
								cs440-acg/ext/nanogui/ext/glfw/examples/simple.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										165
									
								
								cs440-acg/ext/nanogui/ext/glfw/examples/simple.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,165 @@
 | 
			
		||||
//========================================================================
 | 
			
		||||
// Simple GLFW example
 | 
			
		||||
// Copyright (c) Camilla Löwy <elmindreda@glfw.org>
 | 
			
		||||
//
 | 
			
		||||
// 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 <glad/gl.h>
 | 
			
		||||
#include <GLFW/glfw3.h>
 | 
			
		||||
 | 
			
		||||
#include "linmath.h"
 | 
			
		||||
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
 | 
			
		||||
static const struct
 | 
			
		||||
{
 | 
			
		||||
    float x, y;
 | 
			
		||||
    float r, g, b;
 | 
			
		||||
} vertices[3] =
 | 
			
		||||
{
 | 
			
		||||
    { -0.6f, -0.4f, 1.f, 0.f, 0.f },
 | 
			
		||||
    {  0.6f, -0.4f, 0.f, 1.f, 0.f },
 | 
			
		||||
    {   0.f,  0.6f, 0.f, 0.f, 1.f }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static const char* vertex_shader_text =
 | 
			
		||||
"#version 110\n"
 | 
			
		||||
"uniform mat4 MVP;\n"
 | 
			
		||||
"attribute vec3 vCol;\n"
 | 
			
		||||
"attribute vec2 vPos;\n"
 | 
			
		||||
"varying vec3 color;\n"
 | 
			
		||||
"void main()\n"
 | 
			
		||||
"{\n"
 | 
			
		||||
"    gl_Position = MVP * vec4(vPos, 0.0, 1.0);\n"
 | 
			
		||||
"    color = vCol;\n"
 | 
			
		||||
"}\n";
 | 
			
		||||
 | 
			
		||||
static const char* fragment_shader_text =
 | 
			
		||||
"#version 110\n"
 | 
			
		||||
"varying vec3 color;\n"
 | 
			
		||||
"void main()\n"
 | 
			
		||||
"{\n"
 | 
			
		||||
"    gl_FragColor = vec4(color, 1.0);\n"
 | 
			
		||||
"}\n";
 | 
			
		||||
 | 
			
		||||
static void error_callback(int error, const char* description)
 | 
			
		||||
{
 | 
			
		||||
    fprintf(stderr, "Error: %s\n", description);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
 | 
			
		||||
{
 | 
			
		||||
    if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
 | 
			
		||||
        glfwSetWindowShouldClose(window, GLFW_TRUE);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int main(void)
 | 
			
		||||
{
 | 
			
		||||
    GLFWwindow* window;
 | 
			
		||||
    GLuint vertex_buffer, vertex_shader, fragment_shader, program;
 | 
			
		||||
    GLint mvp_location, vpos_location, vcol_location;
 | 
			
		||||
 | 
			
		||||
    glfwSetErrorCallback(error_callback);
 | 
			
		||||
 | 
			
		||||
    if (!glfwInit())
 | 
			
		||||
        exit(EXIT_FAILURE);
 | 
			
		||||
 | 
			
		||||
    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
 | 
			
		||||
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
 | 
			
		||||
 | 
			
		||||
    window = glfwCreateWindow(640, 480, "Simple example", NULL, NULL);
 | 
			
		||||
    if (!window)
 | 
			
		||||
    {
 | 
			
		||||
        glfwTerminate();
 | 
			
		||||
        exit(EXIT_FAILURE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    glfwSetKeyCallback(window, key_callback);
 | 
			
		||||
 | 
			
		||||
    glfwMakeContextCurrent(window);
 | 
			
		||||
    gladLoadGL(glfwGetProcAddress);
 | 
			
		||||
    glfwSwapInterval(1);
 | 
			
		||||
 | 
			
		||||
    // NOTE: OpenGL error checks have been omitted for brevity
 | 
			
		||||
 | 
			
		||||
    glGenBuffers(1, &vertex_buffer);
 | 
			
		||||
    glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer);
 | 
			
		||||
    glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
 | 
			
		||||
 | 
			
		||||
    vertex_shader = glCreateShader(GL_VERTEX_SHADER);
 | 
			
		||||
    glShaderSource(vertex_shader, 1, &vertex_shader_text, NULL);
 | 
			
		||||
    glCompileShader(vertex_shader);
 | 
			
		||||
 | 
			
		||||
    fragment_shader = glCreateShader(GL_FRAGMENT_SHADER);
 | 
			
		||||
    glShaderSource(fragment_shader, 1, &fragment_shader_text, NULL);
 | 
			
		||||
    glCompileShader(fragment_shader);
 | 
			
		||||
 | 
			
		||||
    program = glCreateProgram();
 | 
			
		||||
    glAttachShader(program, vertex_shader);
 | 
			
		||||
    glAttachShader(program, fragment_shader);
 | 
			
		||||
    glLinkProgram(program);
 | 
			
		||||
 | 
			
		||||
    mvp_location = glGetUniformLocation(program, "MVP");
 | 
			
		||||
    vpos_location = glGetAttribLocation(program, "vPos");
 | 
			
		||||
    vcol_location = glGetAttribLocation(program, "vCol");
 | 
			
		||||
 | 
			
		||||
    glEnableVertexAttribArray(vpos_location);
 | 
			
		||||
    glVertexAttribPointer(vpos_location, 2, GL_FLOAT, GL_FALSE,
 | 
			
		||||
                          sizeof(vertices[0]), (void*) 0);
 | 
			
		||||
    glEnableVertexAttribArray(vcol_location);
 | 
			
		||||
    glVertexAttribPointer(vcol_location, 3, GL_FLOAT, GL_FALSE,
 | 
			
		||||
                          sizeof(vertices[0]), (void*) (sizeof(float) * 2));
 | 
			
		||||
 | 
			
		||||
    while (!glfwWindowShouldClose(window))
 | 
			
		||||
    {
 | 
			
		||||
        float ratio;
 | 
			
		||||
        int width, height;
 | 
			
		||||
        mat4x4 m, p, mvp;
 | 
			
		||||
 | 
			
		||||
        glfwGetFramebufferSize(window, &width, &height);
 | 
			
		||||
        ratio = width / (float) height;
 | 
			
		||||
 | 
			
		||||
        glViewport(0, 0, width, height);
 | 
			
		||||
        glClear(GL_COLOR_BUFFER_BIT);
 | 
			
		||||
 | 
			
		||||
        mat4x4_identity(m);
 | 
			
		||||
        mat4x4_rotate_Z(m, m, (float) glfwGetTime());
 | 
			
		||||
        mat4x4_ortho(p, -ratio, ratio, -1.f, 1.f, 1.f, -1.f);
 | 
			
		||||
        mat4x4_mul(mvp, p, m);
 | 
			
		||||
 | 
			
		||||
        glUseProgram(program);
 | 
			
		||||
        glUniformMatrix4fv(mvp_location, 1, GL_FALSE, (const GLfloat*) mvp);
 | 
			
		||||
        glDrawArrays(GL_TRIANGLES, 0, 3);
 | 
			
		||||
 | 
			
		||||
        glfwSwapBuffers(window);
 | 
			
		||||
        glfwPollEvents();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    glfwDestroyWindow(window);
 | 
			
		||||
 | 
			
		||||
    glfwTerminate();
 | 
			
		||||
    exit(EXIT_SUCCESS);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//! [code]
 | 
			
		||||
							
								
								
									
										545
									
								
								cs440-acg/ext/nanogui/ext/glfw/examples/splitview.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										545
									
								
								cs440-acg/ext/nanogui/ext/glfw/examples/splitview.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,545 @@
 | 
			
		||||
//========================================================================
 | 
			
		||||
// 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)
 | 
			
		||||
//========================================================================
 | 
			
		||||
 | 
			
		||||
#include <glad/gl.h>
 | 
			
		||||
#include <GLFW/glfw3.h>
 | 
			
		||||
 | 
			
		||||
#if defined(_MSC_VER)
 | 
			
		||||
 // Make MS math.h define M_PI
 | 
			
		||||
 #define _USE_MATH_DEFINES
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <math.h>
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
 | 
			
		||||
#include <linmath.h>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
//========================================================================
 | 
			
		||||
// 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;
 | 
			
		||||
    mat4x4 view;
 | 
			
		||||
 | 
			
		||||
    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)
 | 
			
		||||
    {
 | 
			
		||||
        vec3 eye = { 0.f, 0.f, 1.f };
 | 
			
		||||
        vec3 center = { 0.f, 0.f, 0.f };
 | 
			
		||||
        vec3 up = { 0.f, 1.f, 0.f };
 | 
			
		||||
        mat4x4_look_at(view, eye, center, up);
 | 
			
		||||
    }
 | 
			
		||||
    glLoadMatrixf((const GLfloat*) view);
 | 
			
		||||
 | 
			
		||||
    // 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};
 | 
			
		||||
    float aspect;
 | 
			
		||||
    mat4x4 view, projection;
 | 
			
		||||
 | 
			
		||||
    // Calculate aspect of window
 | 
			
		||||
    if (height > 0)
 | 
			
		||||
        aspect = (float) width / (float) height;
 | 
			
		||||
    else
 | 
			
		||||
        aspect = 1.f;
 | 
			
		||||
 | 
			
		||||
    // 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);
 | 
			
		||||
    {
 | 
			
		||||
        vec3 eye = { 0.f, 10.f, 1e-3f };
 | 
			
		||||
        vec3 center = { 0.f, 0.f, 0.f };
 | 
			
		||||
        vec3 up = { 0.f, 1.f, 0.f };
 | 
			
		||||
        mat4x4_look_at( view, eye, center, up );
 | 
			
		||||
    }
 | 
			
		||||
    glLoadMatrixf((const GLfloat*) view);
 | 
			
		||||
    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);
 | 
			
		||||
    {
 | 
			
		||||
        vec3 eye = { 0.f, 0.f, 10.f };
 | 
			
		||||
        vec3 center = { 0.f, 0.f, 0.f };
 | 
			
		||||
        vec3 up = { 0.f, 1.f, 0.f };
 | 
			
		||||
        mat4x4_look_at( view, eye, center, up );
 | 
			
		||||
    }
 | 
			
		||||
    glLoadMatrixf((const GLfloat*) view);
 | 
			
		||||
    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);
 | 
			
		||||
    {
 | 
			
		||||
        vec3 eye = { 10.f, 0.f, 0.f };
 | 
			
		||||
        vec3 center = { 0.f, 0.f, 0.f };
 | 
			
		||||
        vec3 up = { 0.f, 1.f, 0.f };
 | 
			
		||||
        mat4x4_look_at( view, eye, center, up );
 | 
			
		||||
    }
 | 
			
		||||
    glLoadMatrixf((const GLfloat*) view);
 | 
			
		||||
    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);
 | 
			
		||||
    mat4x4_perspective(projection,
 | 
			
		||||
                       65.f * (float) M_PI / 180.f,
 | 
			
		||||
                       aspect,
 | 
			
		||||
                       1.f, 50.f);
 | 
			
		||||
    glLoadMatrixf((const GLfloat*) projection);
 | 
			
		||||
 | 
			
		||||
    // 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);
 | 
			
		||||
    {
 | 
			
		||||
        vec3 eye = { 3.f, 1.5f, 3.f };
 | 
			
		||||
        vec3 center = { 0.f, 0.f, 0.f };
 | 
			
		||||
        vec3 up = { 0.f, 1.f, 0.f };
 | 
			
		||||
        mat4x4_look_at( view, eye, center, up );
 | 
			
		||||
    }
 | 
			
		||||
    glLoadMatrixf((const GLfloat*) view);
 | 
			
		||||
 | 
			
		||||
    // 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)
 | 
			
		||||
{
 | 
			
		||||
    drawAllViews();
 | 
			
		||||
    glfwSwapBuffers(window);
 | 
			
		||||
    do_redraw = 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
//========================================================================
 | 
			
		||||
// Mouse position callback function
 | 
			
		||||
//========================================================================
 | 
			
		||||
 | 
			
		||||
static void cursorPosFun(GLFWwindow* window, double x, double y)
 | 
			
		||||
{
 | 
			
		||||
    int wnd_width, wnd_height, fb_width, fb_height;
 | 
			
		||||
    double scale;
 | 
			
		||||
 | 
			
		||||
    glfwGetWindowSize(window, &wnd_width, &wnd_height);
 | 
			
		||||
    glfwGetFramebufferSize(window, &fb_width, &fb_height);
 | 
			
		||||
 | 
			
		||||
    scale = (double) fb_width / (double) wnd_width;
 | 
			
		||||
 | 
			
		||||
    x *= scale;
 | 
			
		||||
    y *= scale;
 | 
			
		||||
 | 
			
		||||
    // 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, GLFW_TRUE);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
//========================================================================
 | 
			
		||||
// main
 | 
			
		||||
//========================================================================
 | 
			
		||||
 | 
			
		||||
int main(void)
 | 
			
		||||
{
 | 
			
		||||
    GLFWwindow* window;
 | 
			
		||||
 | 
			
		||||
    // Initialise GLFW
 | 
			
		||||
    if (!glfwInit())
 | 
			
		||||
    {
 | 
			
		||||
        fprintf(stderr, "Failed to initialize GLFW\n");
 | 
			
		||||
        exit(EXIT_FAILURE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    glfwWindowHint(GLFW_SAMPLES, 4);
 | 
			
		||||
 | 
			
		||||
    // 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);
 | 
			
		||||
    gladLoadGL(glfwGetProcAddress);
 | 
			
		||||
    glfwSwapInterval(1);
 | 
			
		||||
 | 
			
		||||
    if (GLAD_GL_ARB_multisample || GLAD_GL_VERSION_1_3)
 | 
			
		||||
        glEnable(GL_MULTISAMPLE_ARB);
 | 
			
		||||
 | 
			
		||||
    glfwGetFramebufferSize(window, &width, &height);
 | 
			
		||||
    framebufferSizeFun(window, width, height);
 | 
			
		||||
 | 
			
		||||
    // Main loop
 | 
			
		||||
    for (;;)
 | 
			
		||||
    {
 | 
			
		||||
        // Only redraw if we need to
 | 
			
		||||
        if (do_redraw)
 | 
			
		||||
            windowRefreshFun(window);
 | 
			
		||||
 | 
			
		||||
        // 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);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										461
									
								
								cs440-acg/ext/nanogui/ext/glfw/examples/wave.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										461
									
								
								cs440-acg/ext/nanogui/ext/glfw/examples/wave.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,461 @@
 | 
			
		||||
/*****************************************************************************
 | 
			
		||||
 * 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 Löwy
 | 
			
		||||
 *****************************************************************************/
 | 
			
		||||
 | 
			
		||||
#if defined(_MSC_VER)
 | 
			
		||||
 // Make MS math.h define M_PI
 | 
			
		||||
 #define _USE_MATH_DEFINES
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <math.h>
 | 
			
		||||
 | 
			
		||||
#include <glad/gl.h>
 | 
			
		||||
#include <GLFW/glfw3.h>
 | 
			
		||||
 | 
			
		||||
#include <linmath.h>
 | 
			
		||||
 | 
			
		||||
// 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;
 | 
			
		||||
 | 
			
		||||
double cursorX;
 | 
			
		||||
double 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, GLFW_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);
 | 
			
		||||
        glfwGetCursorPos(window, &cursorX, &cursorY);
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
        glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
//========================================================================
 | 
			
		||||
// Callback function for cursor motion events
 | 
			
		||||
//========================================================================
 | 
			
		||||
 | 
			
		||||
void cursor_position_callback(GLFWwindow* window, double x, double y)
 | 
			
		||||
{
 | 
			
		||||
    if (glfwGetInputMode(window, GLFW_CURSOR) == GLFW_CURSOR_DISABLED)
 | 
			
		||||
    {
 | 
			
		||||
        alpha += (GLfloat) (x - cursorX) / 10.f;
 | 
			
		||||
        beta += (GLfloat) (y - cursorY) / 10.f;
 | 
			
		||||
 | 
			
		||||
        cursorX = x;
 | 
			
		||||
        cursorY = 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;
 | 
			
		||||
    mat4x4 projection;
 | 
			
		||||
 | 
			
		||||
    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);
 | 
			
		||||
    mat4x4_perspective(projection,
 | 
			
		||||
                       60.f * (float) M_PI / 180.f,
 | 
			
		||||
                       ratio,
 | 
			
		||||
                       1.f, 1024.f);
 | 
			
		||||
    glLoadMatrixf((const GLfloat*) projection);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
//========================================================================
 | 
			
		||||
// 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);
 | 
			
		||||
    gladLoadGL(glfwGetProcAddress);
 | 
			
		||||
    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();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    glfwTerminate();
 | 
			
		||||
    exit(EXIT_SUCCESS);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										5643
									
								
								cs440-acg/ext/nanogui/ext/glfw/include/GLFW/glfw3.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5643
									
								
								cs440-acg/ext/nanogui/ext/glfw/include/GLFW/glfw3.h
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										525
									
								
								cs440-acg/ext/nanogui/ext/glfw/include/GLFW/glfw3native.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										525
									
								
								cs440-acg/ext/nanogui/ext/glfw/include/GLFW/glfw3native.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,525 @@
 | 
			
		||||
/*************************************************************************
 | 
			
		||||
 * GLFW 3.3 - www.glfw.org
 | 
			
		||||
 * A library for OpenGL, window and input
 | 
			
		||||
 *------------------------------------------------------------------------
 | 
			
		||||
 * Copyright (c) 2002-2006 Marcus Geelnard
 | 
			
		||||
 * Copyright (c) 2006-2018 Camilla Löwy <elmindreda@glfw.org>
 | 
			
		||||
 *
 | 
			
		||||
 * 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 _glfw3_native_h_
 | 
			
		||||
#define _glfw3_native_h_
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*************************************************************************
 | 
			
		||||
 * Doxygen documentation
 | 
			
		||||
 *************************************************************************/
 | 
			
		||||
 | 
			
		||||
/*! @file glfw3native.h
 | 
			
		||||
 *  @brief The header of the native access functions.
 | 
			
		||||
 *
 | 
			
		||||
 *  This is the header file of the native access functions.  See @ref native for
 | 
			
		||||
 *  more information.
 | 
			
		||||
 */
 | 
			
		||||
/*! @defgroup native Native access
 | 
			
		||||
 *  @brief Functions related to accessing native handles.
 | 
			
		||||
 *
 | 
			
		||||
 *  **By using the native access functions you assert that you know what you're
 | 
			
		||||
 *  doing and how to fix problems caused by using them.  If you don't, you
 | 
			
		||||
 *  shouldn't be using them.**
 | 
			
		||||
 *
 | 
			
		||||
 *  Before the inclusion of @ref glfw3native.h, you may define zero or more
 | 
			
		||||
 *  window system API macro and zero or more context creation API macros.
 | 
			
		||||
 *
 | 
			
		||||
 *  The chosen backends must match those the library was compiled for.  Failure
 | 
			
		||||
 *  to do this will cause a link-time error.
 | 
			
		||||
 *
 | 
			
		||||
 *  The available window API macros are:
 | 
			
		||||
 *  * `GLFW_EXPOSE_NATIVE_WIN32`
 | 
			
		||||
 *  * `GLFW_EXPOSE_NATIVE_COCOA`
 | 
			
		||||
 *  * `GLFW_EXPOSE_NATIVE_X11`
 | 
			
		||||
 *  * `GLFW_EXPOSE_NATIVE_WAYLAND`
 | 
			
		||||
 *
 | 
			
		||||
 *  The available context API macros are:
 | 
			
		||||
 *  * `GLFW_EXPOSE_NATIVE_WGL`
 | 
			
		||||
 *  * `GLFW_EXPOSE_NATIVE_NSGL`
 | 
			
		||||
 *  * `GLFW_EXPOSE_NATIVE_GLX`
 | 
			
		||||
 *  * `GLFW_EXPOSE_NATIVE_EGL`
 | 
			
		||||
 *  * `GLFW_EXPOSE_NATIVE_OSMESA`
 | 
			
		||||
 *
 | 
			
		||||
 *  These macros select which of the native access functions that are declared
 | 
			
		||||
 *  and which platform-specific headers to include.  It is then up your (by
 | 
			
		||||
 *  definition platform-specific) code to handle which of these should be
 | 
			
		||||
 *  defined.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*************************************************************************
 | 
			
		||||
 * System headers and types
 | 
			
		||||
 *************************************************************************/
 | 
			
		||||
 | 
			
		||||
#if defined(GLFW_EXPOSE_NATIVE_WIN32) || defined(GLFW_EXPOSE_NATIVE_WGL)
 | 
			
		||||
 // This is a workaround for the fact that glfw3.h needs to export APIENTRY (for
 | 
			
		||||
 // example to allow applications to correctly declare a GL_ARB_debug_output
 | 
			
		||||
 // callback) but windows.h assumes no one will define APIENTRY before it does
 | 
			
		||||
 #if defined(GLFW_APIENTRY_DEFINED)
 | 
			
		||||
  #undef APIENTRY
 | 
			
		||||
  #undef GLFW_APIENTRY_DEFINED
 | 
			
		||||
 #endif
 | 
			
		||||
 #include <windows.h>
 | 
			
		||||
#elif defined(GLFW_EXPOSE_NATIVE_COCOA) || defined(GLFW_EXPOSE_NATIVE_NSGL)
 | 
			
		||||
 #if defined(__OBJC__)
 | 
			
		||||
  #import <Cocoa/Cocoa.h>
 | 
			
		||||
 #else
 | 
			
		||||
  #include <ApplicationServices/ApplicationServices.h>
 | 
			
		||||
  typedef void* id;
 | 
			
		||||
 #endif
 | 
			
		||||
#elif defined(GLFW_EXPOSE_NATIVE_X11) || defined(GLFW_EXPOSE_NATIVE_GLX)
 | 
			
		||||
 #include <X11/Xlib.h>
 | 
			
		||||
 #include <X11/extensions/Xrandr.h>
 | 
			
		||||
#elif defined(GLFW_EXPOSE_NATIVE_WAYLAND)
 | 
			
		||||
 #include <wayland-client.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(GLFW_EXPOSE_NATIVE_WGL)
 | 
			
		||||
 /* WGL is declared by windows.h */
 | 
			
		||||
#endif
 | 
			
		||||
#if defined(GLFW_EXPOSE_NATIVE_NSGL)
 | 
			
		||||
 /* NSGL is declared by Cocoa.h */
 | 
			
		||||
#endif
 | 
			
		||||
#if defined(GLFW_EXPOSE_NATIVE_GLX)
 | 
			
		||||
 #include <GL/glx.h>
 | 
			
		||||
#endif
 | 
			
		||||
#if defined(GLFW_EXPOSE_NATIVE_EGL)
 | 
			
		||||
 #include <EGL/egl.h>
 | 
			
		||||
#endif
 | 
			
		||||
#if defined(GLFW_EXPOSE_NATIVE_OSMESA)
 | 
			
		||||
 #include <GL/osmesa.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*************************************************************************
 | 
			
		||||
 * Functions
 | 
			
		||||
 *************************************************************************/
 | 
			
		||||
 | 
			
		||||
#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.
 | 
			
		||||
 *
 | 
			
		||||
 *  @thread_safety This function may be called from any thread.  Access is not
 | 
			
		||||
 *  synchronized.
 | 
			
		||||
 *
 | 
			
		||||
 *  @since Added in version 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.
 | 
			
		||||
 *
 | 
			
		||||
 *  @thread_safety This function may be called from any thread.  Access is not
 | 
			
		||||
 *  synchronized.
 | 
			
		||||
 *
 | 
			
		||||
 *  @since Added in version 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.
 | 
			
		||||
 *
 | 
			
		||||
 *  @thread_safety This function may be called from any thread.  Access is not
 | 
			
		||||
 *  synchronized.
 | 
			
		||||
 *
 | 
			
		||||
 *  @since Added in version 3.0.
 | 
			
		||||
 *
 | 
			
		||||
 *  @ingroup native
 | 
			
		||||
 */
 | 
			
		||||
GLFWAPI HWND glfwGetWin32Window(GLFWwindow* window);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#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.
 | 
			
		||||
 *
 | 
			
		||||
 *  @thread_safety This function may be called from any thread.  Access is not
 | 
			
		||||
 *  synchronized.
 | 
			
		||||
 *
 | 
			
		||||
 *  @since Added in version 3.0.
 | 
			
		||||
 *
 | 
			
		||||
 *  @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.
 | 
			
		||||
 *
 | 
			
		||||
 *  @thread_safety This function may be called from any thread.  Access is not
 | 
			
		||||
 *  synchronized.
 | 
			
		||||
 *
 | 
			
		||||
 *  @since Added in version 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.
 | 
			
		||||
 *
 | 
			
		||||
 *  @thread_safety This function may be called from any thread.  Access is not
 | 
			
		||||
 *  synchronized.
 | 
			
		||||
 *
 | 
			
		||||
 *  @since Added in version 3.0.
 | 
			
		||||
 *
 | 
			
		||||
 *  @ingroup native
 | 
			
		||||
 */
 | 
			
		||||
GLFWAPI id glfwGetCocoaWindow(GLFWwindow* window);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#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.
 | 
			
		||||
 *
 | 
			
		||||
 *  @thread_safety This function may be called from any thread.  Access is not
 | 
			
		||||
 *  synchronized.
 | 
			
		||||
 *
 | 
			
		||||
 *  @since Added in version 3.0.
 | 
			
		||||
 *
 | 
			
		||||
 *  @ingroup native
 | 
			
		||||
 */
 | 
			
		||||
GLFWAPI id glfwGetNSGLContext(GLFWwindow* window);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#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.
 | 
			
		||||
 *
 | 
			
		||||
 *  @thread_safety This function may be called from any thread.  Access is not
 | 
			
		||||
 *  synchronized.
 | 
			
		||||
 *
 | 
			
		||||
 *  @since Added in version 3.0.
 | 
			
		||||
 *
 | 
			
		||||
 *  @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.
 | 
			
		||||
 *
 | 
			
		||||
 *  @thread_safety This function may be called from any thread.  Access is not
 | 
			
		||||
 *  synchronized.
 | 
			
		||||
 *
 | 
			
		||||
 *  @since Added in version 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.
 | 
			
		||||
 *
 | 
			
		||||
 *  @thread_safety This function may be called from any thread.  Access is not
 | 
			
		||||
 *  synchronized.
 | 
			
		||||
 *
 | 
			
		||||
 *  @since Added in version 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.
 | 
			
		||||
 *
 | 
			
		||||
 *  @thread_safety This function may be called from any thread.  Access is not
 | 
			
		||||
 *  synchronized.
 | 
			
		||||
 *
 | 
			
		||||
 *  @since Added in version 3.0.
 | 
			
		||||
 *
 | 
			
		||||
 *  @ingroup native
 | 
			
		||||
 */
 | 
			
		||||
GLFWAPI Window glfwGetX11Window(GLFWwindow* window);
 | 
			
		||||
 | 
			
		||||
/*! @brief Sets the current primary selection to the specified string.
 | 
			
		||||
 *
 | 
			
		||||
 *  @param[in] string A UTF-8 encoded string.
 | 
			
		||||
 *
 | 
			
		||||
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 | 
			
		||||
 *  GLFW_PLATFORM_ERROR.
 | 
			
		||||
 *
 | 
			
		||||
 *  @pointer_lifetime The specified string is copied before this function
 | 
			
		||||
 *  returns.
 | 
			
		||||
 *
 | 
			
		||||
 *  @thread_safety This function must only be called from the main thread.
 | 
			
		||||
 *
 | 
			
		||||
 *  @sa @ref clipboard
 | 
			
		||||
 *  @sa glfwGetX11SelectionString
 | 
			
		||||
 *  @sa glfwSetClipboardString
 | 
			
		||||
 *
 | 
			
		||||
 *  @since Added in version 3.3.
 | 
			
		||||
 *
 | 
			
		||||
 *  @ingroup native
 | 
			
		||||
 */
 | 
			
		||||
GLFWAPI void glfwSetX11SelectionString(const char* string);
 | 
			
		||||
 | 
			
		||||
/*! @brief Returns the contents of the current primary selection as a string.
 | 
			
		||||
 *
 | 
			
		||||
 *  If the selection is empty or if its contents cannot be converted, `NULL`
 | 
			
		||||
 *  is returned and a @ref GLFW_FORMAT_UNAVAILABLE error is generated.
 | 
			
		||||
 *
 | 
			
		||||
 *  @return The contents of the selection as a UTF-8 encoded string, or `NULL`
 | 
			
		||||
 *  if an [error](@ref error_handling) occurred.
 | 
			
		||||
 *
 | 
			
		||||
 *  @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
 | 
			
		||||
 *  GLFW_PLATFORM_ERROR.
 | 
			
		||||
 *
 | 
			
		||||
 *  @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
 | 
			
		||||
 *  glfwGetX11SelectionString or @ref glfwSetX11SelectionString, or until the
 | 
			
		||||
 *  library is terminated.
 | 
			
		||||
 *
 | 
			
		||||
 *  @thread_safety This function must only be called from the main thread.
 | 
			
		||||
 *
 | 
			
		||||
 *  @sa @ref clipboard
 | 
			
		||||
 *  @sa glfwSetX11SelectionString
 | 
			
		||||
 *  @sa glfwGetClipboardString
 | 
			
		||||
 *
 | 
			
		||||
 *  @since Added in version 3.3.
 | 
			
		||||
 *
 | 
			
		||||
 *  @ingroup native
 | 
			
		||||
 */
 | 
			
		||||
GLFWAPI const char* glfwGetX11SelectionString(void);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#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.
 | 
			
		||||
 *
 | 
			
		||||
 *  @thread_safety This function may be called from any thread.  Access is not
 | 
			
		||||
 *  synchronized.
 | 
			
		||||
 *
 | 
			
		||||
 *  @since Added in version 3.0.
 | 
			
		||||
 *
 | 
			
		||||
 *  @ingroup native
 | 
			
		||||
 */
 | 
			
		||||
GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* window);
 | 
			
		||||
 | 
			
		||||
/*! @brief Returns the `GLXWindow` of the specified window.
 | 
			
		||||
 *
 | 
			
		||||
 *  @return The `GLXWindow` of the specified window, or `None` if an
 | 
			
		||||
 *  [error](@ref error_handling) occurred.
 | 
			
		||||
 *
 | 
			
		||||
 *  @thread_safety This function may be called from any thread.  Access is not
 | 
			
		||||
 *  synchronized.
 | 
			
		||||
 *
 | 
			
		||||
 *  @since Added in version 3.2.
 | 
			
		||||
 *
 | 
			
		||||
 *  @ingroup native
 | 
			
		||||
 */
 | 
			
		||||
GLFWAPI GLXWindow glfwGetGLXWindow(GLFWwindow* window);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(GLFW_EXPOSE_NATIVE_WAYLAND)
 | 
			
		||||
/*! @brief Returns the `struct wl_display*` used by GLFW.
 | 
			
		||||
 *
 | 
			
		||||
 *  @return The `struct wl_display*` used by GLFW, or `NULL` if an
 | 
			
		||||
 *  [error](@ref error_handling) occurred.
 | 
			
		||||
 *
 | 
			
		||||
 *  @thread_safety This function may be called from any thread.  Access is not
 | 
			
		||||
 *  synchronized.
 | 
			
		||||
 *
 | 
			
		||||
 *  @since Added in version 3.2.
 | 
			
		||||
 *
 | 
			
		||||
 *  @ingroup native
 | 
			
		||||
 */
 | 
			
		||||
GLFWAPI struct wl_display* glfwGetWaylandDisplay(void);
 | 
			
		||||
 | 
			
		||||
/*! @brief Returns the `struct wl_output*` of the specified monitor.
 | 
			
		||||
 *
 | 
			
		||||
 *  @return The `struct wl_output*` of the specified monitor, or `NULL` if an
 | 
			
		||||
 *  [error](@ref error_handling) occurred.
 | 
			
		||||
 *
 | 
			
		||||
 *  @thread_safety This function may be called from any thread.  Access is not
 | 
			
		||||
 *  synchronized.
 | 
			
		||||
 *
 | 
			
		||||
 *  @since Added in version 3.2.
 | 
			
		||||
 *
 | 
			
		||||
 *  @ingroup native
 | 
			
		||||
 */
 | 
			
		||||
GLFWAPI struct wl_output* glfwGetWaylandMonitor(GLFWmonitor* monitor);
 | 
			
		||||
 | 
			
		||||
/*! @brief Returns the main `struct wl_surface*` of the specified window.
 | 
			
		||||
 *
 | 
			
		||||
 *  @return The main `struct wl_surface*` of the specified window, or `NULL` if
 | 
			
		||||
 *  an [error](@ref error_handling) occurred.
 | 
			
		||||
 *
 | 
			
		||||
 *  @thread_safety This function may be called from any thread.  Access is not
 | 
			
		||||
 *  synchronized.
 | 
			
		||||
 *
 | 
			
		||||
 *  @since Added in version 3.2.
 | 
			
		||||
 *
 | 
			
		||||
 *  @ingroup native
 | 
			
		||||
 */
 | 
			
		||||
GLFWAPI struct wl_surface* glfwGetWaylandWindow(GLFWwindow* window);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(GLFW_EXPOSE_NATIVE_EGL)
 | 
			
		||||
/*! @brief Returns the `EGLDisplay` used by GLFW.
 | 
			
		||||
 *
 | 
			
		||||
 *  @return The `EGLDisplay` used by GLFW, or `EGL_NO_DISPLAY` if an
 | 
			
		||||
 *  [error](@ref error_handling) occurred.
 | 
			
		||||
 *
 | 
			
		||||
 *  @thread_safety This function may be called from any thread.  Access is not
 | 
			
		||||
 *  synchronized.
 | 
			
		||||
 *
 | 
			
		||||
 *  @since Added in version 3.0.
 | 
			
		||||
 *
 | 
			
		||||
 *  @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.
 | 
			
		||||
 *
 | 
			
		||||
 *  @thread_safety This function may be called from any thread.  Access is not
 | 
			
		||||
 *  synchronized.
 | 
			
		||||
 *
 | 
			
		||||
 *  @since Added in version 3.0.
 | 
			
		||||
 *
 | 
			
		||||
 *  @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.
 | 
			
		||||
 *
 | 
			
		||||
 *  @thread_safety This function may be called from any thread.  Access is not
 | 
			
		||||
 *  synchronized.
 | 
			
		||||
 *
 | 
			
		||||
 *  @since Added in version 3.0.
 | 
			
		||||
 *
 | 
			
		||||
 *  @ingroup native
 | 
			
		||||
 */
 | 
			
		||||
GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* window);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(GLFW_EXPOSE_NATIVE_OSMESA)
 | 
			
		||||
/*! @brief Retrieves the color buffer associated with the specified window.
 | 
			
		||||
 *
 | 
			
		||||
 *  @param[in] window The window whose color buffer to retrieve.
 | 
			
		||||
 *  @param[out] width Where to store the width of the color buffer, or `NULL`.
 | 
			
		||||
 *  @param[out] height Where to store the height of the color buffer, or `NULL`.
 | 
			
		||||
 *  @param[out] format Where to store the OSMesa pixel format of the color
 | 
			
		||||
 *  buffer, or `NULL`.
 | 
			
		||||
 *  @param[out] buffer Where to store the address of the color buffer, or
 | 
			
		||||
 *  `NULL`.
 | 
			
		||||
 *  @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
 | 
			
		||||
 *  [error](@ref error_handling) occurred.
 | 
			
		||||
 *
 | 
			
		||||
 *  @thread_safety This function may be called from any thread.  Access is not
 | 
			
		||||
 *  synchronized.
 | 
			
		||||
 *
 | 
			
		||||
 *  @since Added in version 3.3.
 | 
			
		||||
 *
 | 
			
		||||
 *  @ingroup native
 | 
			
		||||
 */
 | 
			
		||||
GLFWAPI int glfwGetOSMesaColorBuffer(GLFWwindow* window, int* width, int* height, int* format, void** buffer);
 | 
			
		||||
 | 
			
		||||
/*! @brief Retrieves the depth buffer associated with the specified window.
 | 
			
		||||
 *
 | 
			
		||||
 *  @param[in] window The window whose depth buffer to retrieve.
 | 
			
		||||
 *  @param[out] width Where to store the width of the depth buffer, or `NULL`.
 | 
			
		||||
 *  @param[out] height Where to store the height of the depth buffer, or `NULL`.
 | 
			
		||||
 *  @param[out] bytesPerValue Where to store the number of bytes per depth
 | 
			
		||||
 *  buffer element, or `NULL`.
 | 
			
		||||
 *  @param[out] buffer Where to store the address of the depth buffer, or
 | 
			
		||||
 *  `NULL`.
 | 
			
		||||
 *  @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
 | 
			
		||||
 *  [error](@ref error_handling) occurred.
 | 
			
		||||
 *
 | 
			
		||||
 *  @thread_safety This function may be called from any thread.  Access is not
 | 
			
		||||
 *  synchronized.
 | 
			
		||||
 *
 | 
			
		||||
 *  @since Added in version 3.3.
 | 
			
		||||
 *
 | 
			
		||||
 *  @ingroup native
 | 
			
		||||
 */
 | 
			
		||||
GLFWAPI int glfwGetOSMesaDepthBuffer(GLFWwindow* window, int* width, int* height, int* bytesPerValue, void** buffer);
 | 
			
		||||
 | 
			
		||||
/*! @brief Returns the `OSMesaContext` of the specified window.
 | 
			
		||||
 *
 | 
			
		||||
 *  @return The `OSMesaContext` of the specified window, or `NULL` if an
 | 
			
		||||
 *  [error](@ref error_handling) occurred.
 | 
			
		||||
 *
 | 
			
		||||
 *  @thread_safety This function may be called from any thread.  Access is not
 | 
			
		||||
 *  synchronized.
 | 
			
		||||
 *
 | 
			
		||||
 *  @since Added in version 3.3.
 | 
			
		||||
 *
 | 
			
		||||
 *  @ingroup native
 | 
			
		||||
 */
 | 
			
		||||
GLFWAPI OSMesaContext glfwGetOSMesaContext(GLFWwindow* window);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* _glfw3_native_h_ */
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										186
									
								
								cs440-acg/ext/nanogui/ext/glfw/src/CMakeLists.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										186
									
								
								cs440-acg/ext/nanogui/ext/glfw/src/CMakeLists.txt
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,186 @@
 | 
			
		||||
 | 
			
		||||
set(common_HEADERS internal.h mappings.h
 | 
			
		||||
                   "${GLFW_BINARY_DIR}/src/glfw_config.h"
 | 
			
		||||
                   "${GLFW_SOURCE_DIR}/include/GLFW/glfw3.h"
 | 
			
		||||
                   "${GLFW_SOURCE_DIR}/include/GLFW/glfw3native.h")
 | 
			
		||||
set(common_SOURCES context.c init.c input.c monitor.c vulkan.c window.c)
 | 
			
		||||
 | 
			
		||||
if (_GLFW_COCOA)
 | 
			
		||||
    set(glfw_HEADERS ${common_HEADERS} cocoa_platform.h cocoa_joystick.h
 | 
			
		||||
                     posix_thread.h nsgl_context.h egl_context.h osmesa_context.h)
 | 
			
		||||
    set(glfw_SOURCES ${common_SOURCES} cocoa_init.m cocoa_joystick.m
 | 
			
		||||
                     cocoa_monitor.m cocoa_window.m cocoa_time.c posix_thread.c
 | 
			
		||||
                     nsgl_context.m egl_context.c osmesa_context.c)
 | 
			
		||||
elseif (_GLFW_WIN32)
 | 
			
		||||
    set(glfw_HEADERS ${common_HEADERS} win32_platform.h win32_joystick.h
 | 
			
		||||
                     wgl_context.h egl_context.h osmesa_context.h)
 | 
			
		||||
    set(glfw_SOURCES ${common_SOURCES} win32_init.c win32_joystick.c
 | 
			
		||||
                     win32_monitor.c win32_time.c win32_thread.c win32_window.c
 | 
			
		||||
                     wgl_context.c egl_context.c osmesa_context.c)
 | 
			
		||||
elseif (_GLFW_X11)
 | 
			
		||||
    set(glfw_HEADERS ${common_HEADERS} x11_platform.h xkb_unicode.h posix_time.h
 | 
			
		||||
                     posix_thread.h glx_context.h egl_context.h osmesa_context.h)
 | 
			
		||||
    set(glfw_SOURCES ${common_SOURCES} x11_init.c x11_monitor.c x11_window.c
 | 
			
		||||
                     xkb_unicode.c posix_time.c posix_thread.c glx_context.c
 | 
			
		||||
                     egl_context.c osmesa_context.c)
 | 
			
		||||
elseif (_GLFW_WAYLAND)
 | 
			
		||||
    set(glfw_HEADERS ${common_HEADERS} wl_platform.h
 | 
			
		||||
                     posix_time.h posix_thread.h xkb_unicode.h egl_context.h
 | 
			
		||||
                     osmesa_context.h)
 | 
			
		||||
    set(glfw_SOURCES ${common_SOURCES} wl_init.c wl_monitor.c wl_window.c
 | 
			
		||||
                     posix_time.c posix_thread.c xkb_unicode.c
 | 
			
		||||
                     egl_context.c osmesa_context.c)
 | 
			
		||||
 | 
			
		||||
    ecm_add_wayland_client_protocol(glfw_SOURCES
 | 
			
		||||
        PROTOCOL
 | 
			
		||||
        "${WAYLAND_PROTOCOLS_PKGDATADIR}/stable/xdg-shell/xdg-shell.xml"
 | 
			
		||||
        BASENAME xdg-shell)
 | 
			
		||||
    ecm_add_wayland_client_protocol(glfw_SOURCES
 | 
			
		||||
        PROTOCOL
 | 
			
		||||
        "${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml"
 | 
			
		||||
        BASENAME xdg-decoration)
 | 
			
		||||
    ecm_add_wayland_client_protocol(glfw_SOURCES
 | 
			
		||||
        PROTOCOL
 | 
			
		||||
        "${WAYLAND_PROTOCOLS_PKGDATADIR}/stable/viewporter/viewporter.xml"
 | 
			
		||||
        BASENAME viewporter)
 | 
			
		||||
    ecm_add_wayland_client_protocol(glfw_SOURCES
 | 
			
		||||
        PROTOCOL
 | 
			
		||||
        "${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/relative-pointer/relative-pointer-unstable-v1.xml"
 | 
			
		||||
        BASENAME relative-pointer-unstable-v1)
 | 
			
		||||
    ecm_add_wayland_client_protocol(glfw_SOURCES
 | 
			
		||||
        PROTOCOL
 | 
			
		||||
        "${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml"
 | 
			
		||||
        BASENAME pointer-constraints-unstable-v1)
 | 
			
		||||
    ecm_add_wayland_client_protocol(glfw_SOURCES
 | 
			
		||||
        PROTOCOL
 | 
			
		||||
        "${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml"
 | 
			
		||||
        BASENAME idle-inhibit-unstable-v1)
 | 
			
		||||
elseif (_GLFW_OSMESA)
 | 
			
		||||
    set(glfw_HEADERS ${common_HEADERS} null_platform.h null_joystick.h
 | 
			
		||||
                     posix_time.h posix_thread.h osmesa_context.h)
 | 
			
		||||
    set(glfw_SOURCES ${common_SOURCES} null_init.c null_monitor.c null_window.c
 | 
			
		||||
                     null_joystick.c posix_time.c posix_thread.c osmesa_context.c)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (_GLFW_X11 OR _GLFW_WAYLAND)
 | 
			
		||||
    if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
 | 
			
		||||
        set(glfw_HEADERS ${glfw_HEADERS} linux_joystick.h)
 | 
			
		||||
        set(glfw_SOURCES ${glfw_SOURCES} linux_joystick.c)
 | 
			
		||||
    else()
 | 
			
		||||
        set(glfw_HEADERS ${glfw_HEADERS} null_joystick.h)
 | 
			
		||||
        set(glfw_SOURCES ${glfw_SOURCES} null_joystick.c)
 | 
			
		||||
    endif()
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (APPLE)
 | 
			
		||||
    # For some reason, CMake doesn't know about .m
 | 
			
		||||
    set_source_files_properties(${glfw_SOURCES} PROPERTIES LANGUAGE C)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
# Make GCC and Clang warn about declarations that VS 2010 and 2012 won't accept
 | 
			
		||||
# for all source files that VS will build
 | 
			
		||||
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR
 | 
			
		||||
    "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR
 | 
			
		||||
    "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang")
 | 
			
		||||
 | 
			
		||||
    if (WIN32)
 | 
			
		||||
        set(windows_SOURCES ${glfw_SOURCES})
 | 
			
		||||
    else()
 | 
			
		||||
        set(windows_SOURCES ${common_SOURCES})
 | 
			
		||||
    endif()
 | 
			
		||||
    set_source_files_properties(${windows_SOURCES} PROPERTIES
 | 
			
		||||
        COMPILE_FLAGS -Wdeclaration-after-statement)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
# wenzel: changes begin
 | 
			
		||||
add_library(glfw_objects OBJECT ${glfw_SOURCES} ${glfw_HEADERS})
 | 
			
		||||
add_library(glfw $<TARGET_OBJECTS:glfw_objects>)
 | 
			
		||||
if (BUILD_SHARED_LIBS)
 | 
			
		||||
  set_target_properties(glfw_objects PROPERTIES POSITION_INDEPENDENT_CODE ON)
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
set_target_properties(glfw PROPERTIES
 | 
			
		||||
                      OUTPUT_NAME ${GLFW_LIB_NAME}
 | 
			
		||||
                      # VERSION ${GLFW_VERSION}
 | 
			
		||||
                      # SOVERSION ${GLFW_VERSION_MAJOR}
 | 
			
		||||
)
 | 
			
		||||
# wenzel : changes end
 | 
			
		||||
 | 
			
		||||
if (BUILD_SHARED_LIBS)
 | 
			
		||||
   set_target_properties(glfw PROPERTIES POSITION_INDEPENDENT_CODE ON
 | 
			
		||||
                         LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
# wenzel: changes begin
 | 
			
		||||
target_include_directories(glfw PUBLIC
 | 
			
		||||
                           "$<BUILD_INTERFACE:${GLFW_SOURCE_DIR}/include>"
 | 
			
		||||
                           "$<INSTALL_INTERFACE:${CMAKE_INSTALL_FULL_INCLUDEDIR}>")
 | 
			
		||||
target_include_directories(glfw_objects PUBLIC
 | 
			
		||||
                           "$<BUILD_INTERFACE:${GLFW_SOURCE_DIR}/include>"
 | 
			
		||||
                           "$<INSTALL_INTERFACE:${CMAKE_INSTALL_FULL_INCLUDEDIR}>")
 | 
			
		||||
target_compile_definitions(glfw_objects PRIVATE _GLFW_USE_CONFIG_H)
 | 
			
		||||
target_include_directories(glfw_objects PRIVATE
 | 
			
		||||
                           "${GLFW_SOURCE_DIR}/src"
 | 
			
		||||
                           "${GLFW_BINARY_DIR}/src"
 | 
			
		||||
                           ${glfw_INCLUDE_DIRS})
 | 
			
		||||
 | 
			
		||||
# HACK: When building on MinGW, WINVER and UNICODE need to be defined before
 | 
			
		||||
# the inclusion of stddef.h (by glfw3.h), which is itself included before
 | 
			
		||||
# win32_platform.h.  We define them here until a saner solution can be found
 | 
			
		||||
# NOTE: MinGW-w64 and Visual C++ do /not/ need this hack.
 | 
			
		||||
target_compile_definitions(glfw_objects PRIVATE
 | 
			
		||||
                           "$<$<BOOL:${MINGW}>:UNICODE;WINVER=0x0501>")
 | 
			
		||||
 | 
			
		||||
# Enable a reasonable set of warnings (no, -Wextra is not reasonable)
 | 
			
		||||
target_compile_options(glfw_objects PRIVATE
 | 
			
		||||
                       "$<$<C_COMPILER_ID:Clang>:-Wall>"
 | 
			
		||||
                       "$<$<C_COMPILER_ID:Clang>:-Wno-deprecated-declarations>"
 | 
			
		||||
                       "$<$<C_COMPILER_ID:GNU>:-Wall>")
 | 
			
		||||
# wenzel: changes end
 | 
			
		||||
 | 
			
		||||
if (BUILD_SHARED_LIBS)
 | 
			
		||||
    if (WIN32)
 | 
			
		||||
        if (MINGW)
 | 
			
		||||
            # Remove the lib prefix on the DLL (but not the import library)
 | 
			
		||||
            set_target_properties(glfw PROPERTIES PREFIX "")
 | 
			
		||||
 | 
			
		||||
            # Add a suffix to the import library to avoid naming conflicts
 | 
			
		||||
            set_target_properties(glfw PROPERTIES IMPORT_SUFFIX "dll.a")
 | 
			
		||||
        else()
 | 
			
		||||
            # Add a suffix to the import library to avoid naming conflicts
 | 
			
		||||
            set_target_properties(glfw PROPERTIES IMPORT_SUFFIX "dll.lib")
 | 
			
		||||
        endif()
 | 
			
		||||
    elseif (APPLE)
 | 
			
		||||
        # Add -fno-common to work around a bug in Apple's GCC
 | 
			
		||||
        # wenzel : changes begin
 | 
			
		||||
        target_compile_options(glfw_objects PRIVATE "-fno-common")
 | 
			
		||||
        set_target_properties(glfw PROPERTIES
 | 
			
		||||
                              INSTALL_NAME_DIR "${CMAKE_INSTALL_LIBDIR}")
 | 
			
		||||
        # wenzel : changes end
 | 
			
		||||
    elseif (UNIX)
 | 
			
		||||
        # Hide symbols not explicitly tagged for export from the shared library
 | 
			
		||||
        # wenzel : changes begin
 | 
			
		||||
        target_compile_options(glfw_objects PRIVATE "-fvisibility=hidden")
 | 
			
		||||
        # wenzel: changes end
 | 
			
		||||
    endif()
 | 
			
		||||
 | 
			
		||||
    target_compile_definitions(glfw INTERFACE GLFW_DLL)
 | 
			
		||||
    target_link_libraries(glfw PRIVATE ${glfw_LIBRARIES})
 | 
			
		||||
else()
 | 
			
		||||
    target_link_libraries(glfw INTERFACE ${glfw_LIBRARIES})
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (MSVC)
 | 
			
		||||
    # wenzel: changes begin
 | 
			
		||||
    target_compile_definitions(glfw_objects PRIVATE _CRT_SECURE_NO_WARNINGS)
 | 
			
		||||
    # wenzel: changes end
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
if (GLFW_INSTALL)
 | 
			
		||||
    install(TARGETS glfw
 | 
			
		||||
            EXPORT glfwTargets
 | 
			
		||||
            RUNTIME DESTINATION "bin"
 | 
			
		||||
            ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
 | 
			
		||||
            LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
 | 
			
		||||
endif()
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										594
									
								
								cs440-acg/ext/nanogui/ext/glfw/src/cocoa_init.m
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										594
									
								
								cs440-acg/ext/nanogui/ext/glfw/src/cocoa_init.m
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,594 @@
 | 
			
		||||
//========================================================================
 | 
			
		||||
// GLFW 3.3 macOS - www.glfw.org
 | 
			
		||||
//------------------------------------------------------------------------
 | 
			
		||||
// Copyright (c) 2009-2019 Camilla Löwy <elmindreda@glfw.org>
 | 
			
		||||
//
 | 
			
		||||
// 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 <sys/param.h> // For MAXPATHLEN
 | 
			
		||||
 | 
			
		||||
// Needed for _NSGetProgname
 | 
			
		||||
#include <crt_externs.h>
 | 
			
		||||
 | 
			
		||||
// Change to our application bundle's resources directory, if present
 | 
			
		||||
//
 | 
			
		||||
static void changeToResourcesDirectory(void)
 | 
			
		||||
{
 | 
			
		||||
    char resourcesPath[MAXPATHLEN];
 | 
			
		||||
 | 
			
		||||
    CFBundleRef bundle = CFBundleGetMainBundle();
 | 
			
		||||
    if (!bundle)
 | 
			
		||||
        return;
 | 
			
		||||
 | 
			
		||||
    CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(bundle);
 | 
			
		||||
 | 
			
		||||
    CFStringRef last = CFURLCopyLastPathComponent(resourcesURL);
 | 
			
		||||
    if (CFStringCompare(CFSTR("Resources"), last, 0) != kCFCompareEqualTo)
 | 
			
		||||
    {
 | 
			
		||||
        CFRelease(last);
 | 
			
		||||
        CFRelease(resourcesURL);
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    CFRelease(last);
 | 
			
		||||
 | 
			
		||||
    if (!CFURLGetFileSystemRepresentation(resourcesURL,
 | 
			
		||||
                                          true,
 | 
			
		||||
                                          (UInt8*) resourcesPath,
 | 
			
		||||
                                          MAXPATHLEN))
 | 
			
		||||
    {
 | 
			
		||||
        CFRelease(resourcesURL);
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    CFRelease(resourcesURL);
 | 
			
		||||
 | 
			
		||||
    chdir(resourcesPath);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Set up the menu bar (manually)
 | 
			
		||||
// This is nasty, nasty stuff -- calls to undocumented semi-private APIs that
 | 
			
		||||
// could go away at any moment, lots of stuff that really should be
 | 
			
		||||
// localize(d|able), etc.  Add a nib to save us this horror.
 | 
			
		||||
//
 | 
			
		||||
static void createMenuBar(void)
 | 
			
		||||
{
 | 
			
		||||
    size_t i;
 | 
			
		||||
    NSString* appName = nil;
 | 
			
		||||
    NSDictionary* bundleInfo = [[NSBundle mainBundle] infoDictionary];
 | 
			
		||||
    NSString* nameKeys[] =
 | 
			
		||||
    {
 | 
			
		||||
        @"CFBundleDisplayName",
 | 
			
		||||
        @"CFBundleName",
 | 
			
		||||
        @"CFBundleExecutable",
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    // Try to figure out what the calling application is called
 | 
			
		||||
 | 
			
		||||
    for (i = 0;  i < sizeof(nameKeys) / sizeof(nameKeys[0]);  i++)
 | 
			
		||||
    {
 | 
			
		||||
        id name = bundleInfo[nameKeys[i]];
 | 
			
		||||
        if (name &&
 | 
			
		||||
            [name isKindOfClass:[NSString class]] &&
 | 
			
		||||
            ![name isEqualToString:@""])
 | 
			
		||||
        {
 | 
			
		||||
            appName = name;
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!appName)
 | 
			
		||||
    {
 | 
			
		||||
        char** progname = _NSGetProgname();
 | 
			
		||||
        if (progname && *progname)
 | 
			
		||||
            appName = @(*progname);
 | 
			
		||||
        else
 | 
			
		||||
            appName = @"GLFW Application";
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    NSMenu* bar = [[NSMenu alloc] init];
 | 
			
		||||
    [NSApp setMainMenu:bar];
 | 
			
		||||
 | 
			
		||||
    NSMenuItem* appMenuItem =
 | 
			
		||||
        [bar addItemWithTitle:@"" action:NULL keyEquivalent:@""];
 | 
			
		||||
    NSMenu* appMenu = [[NSMenu alloc] init];
 | 
			
		||||
    [appMenuItem setSubmenu:appMenu];
 | 
			
		||||
 | 
			
		||||
    [appMenu addItemWithTitle:[NSString stringWithFormat:@"About %@", appName]
 | 
			
		||||
                       action:@selector(orderFrontStandardAboutPanel:)
 | 
			
		||||
                keyEquivalent:@""];
 | 
			
		||||
    [appMenu addItem:[NSMenuItem separatorItem]];
 | 
			
		||||
    NSMenu* servicesMenu = [[NSMenu alloc] init];
 | 
			
		||||
    [NSApp setServicesMenu:servicesMenu];
 | 
			
		||||
    [[appMenu addItemWithTitle:@"Services"
 | 
			
		||||
                       action:NULL
 | 
			
		||||
                keyEquivalent:@""] setSubmenu:servicesMenu];
 | 
			
		||||
    [servicesMenu release];
 | 
			
		||||
    [appMenu addItem:[NSMenuItem separatorItem]];
 | 
			
		||||
    [appMenu addItemWithTitle:[NSString stringWithFormat:@"Hide %@", appName]
 | 
			
		||||
                       action:@selector(hide:)
 | 
			
		||||
                keyEquivalent:@"h"];
 | 
			
		||||
    [[appMenu addItemWithTitle:@"Hide Others"
 | 
			
		||||
                       action:@selector(hideOtherApplications:)
 | 
			
		||||
                keyEquivalent:@"h"]
 | 
			
		||||
        setKeyEquivalentModifierMask:NSEventModifierFlagOption | NSEventModifierFlagCommand];
 | 
			
		||||
    [appMenu addItemWithTitle:@"Show All"
 | 
			
		||||
                       action:@selector(unhideAllApplications:)
 | 
			
		||||
                keyEquivalent:@""];
 | 
			
		||||
    [appMenu addItem:[NSMenuItem separatorItem]];
 | 
			
		||||
    [appMenu addItemWithTitle:[NSString stringWithFormat:@"Quit %@", appName]
 | 
			
		||||
                       action:@selector(terminate:)
 | 
			
		||||
                keyEquivalent:@"q"];
 | 
			
		||||
 | 
			
		||||
    NSMenuItem* windowMenuItem =
 | 
			
		||||
        [bar addItemWithTitle:@"" action:NULL keyEquivalent:@""];
 | 
			
		||||
    [bar release];
 | 
			
		||||
    NSMenu* windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
 | 
			
		||||
    [NSApp setWindowsMenu:windowMenu];
 | 
			
		||||
    [windowMenuItem setSubmenu:windowMenu];
 | 
			
		||||
 | 
			
		||||
    [windowMenu addItemWithTitle:@"Minimize"
 | 
			
		||||
                          action:@selector(performMiniaturize:)
 | 
			
		||||
                   keyEquivalent:@"m"];
 | 
			
		||||
    [windowMenu addItemWithTitle:@"Zoom"
 | 
			
		||||
                          action:@selector(performZoom:)
 | 
			
		||||
                   keyEquivalent:@""];
 | 
			
		||||
    [windowMenu addItem:[NSMenuItem separatorItem]];
 | 
			
		||||
    [windowMenu addItemWithTitle:@"Bring All to Front"
 | 
			
		||||
                          action:@selector(arrangeInFront:)
 | 
			
		||||
                   keyEquivalent:@""];
 | 
			
		||||
 | 
			
		||||
    // TODO: Make this appear at the bottom of the menu (for consistency)
 | 
			
		||||
    [windowMenu addItem:[NSMenuItem separatorItem]];
 | 
			
		||||
    [[windowMenu addItemWithTitle:@"Enter Full Screen"
 | 
			
		||||
                           action:@selector(toggleFullScreen:)
 | 
			
		||||
                    keyEquivalent:@"f"]
 | 
			
		||||
     setKeyEquivalentModifierMask:NSEventModifierFlagControl | NSEventModifierFlagCommand];
 | 
			
		||||
 | 
			
		||||
    // Prior to Snow Leopard, we need to use this oddly-named semi-private API
 | 
			
		||||
    // to get the application menu working properly.
 | 
			
		||||
    SEL setAppleMenuSelector = NSSelectorFromString(@"setAppleMenu:");
 | 
			
		||||
    [NSApp performSelector:setAppleMenuSelector withObject:appMenu];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Create key code translation tables
 | 
			
		||||
//
 | 
			
		||||
static void createKeyTables(void)
 | 
			
		||||
{
 | 
			
		||||
    int scancode;
 | 
			
		||||
 | 
			
		||||
    memset(_glfw.ns.keycodes, -1, sizeof(_glfw.ns.keycodes));
 | 
			
		||||
    memset(_glfw.ns.scancodes, -1, sizeof(_glfw.ns.scancodes));
 | 
			
		||||
 | 
			
		||||
    _glfw.ns.keycodes[0x1D] = GLFW_KEY_0;
 | 
			
		||||
    _glfw.ns.keycodes[0x12] = GLFW_KEY_1;
 | 
			
		||||
    _glfw.ns.keycodes[0x13] = GLFW_KEY_2;
 | 
			
		||||
    _glfw.ns.keycodes[0x14] = GLFW_KEY_3;
 | 
			
		||||
    _glfw.ns.keycodes[0x15] = GLFW_KEY_4;
 | 
			
		||||
    _glfw.ns.keycodes[0x17] = GLFW_KEY_5;
 | 
			
		||||
    _glfw.ns.keycodes[0x16] = GLFW_KEY_6;
 | 
			
		||||
    _glfw.ns.keycodes[0x1A] = GLFW_KEY_7;
 | 
			
		||||
    _glfw.ns.keycodes[0x1C] = GLFW_KEY_8;
 | 
			
		||||
    _glfw.ns.keycodes[0x19] = GLFW_KEY_9;
 | 
			
		||||
    _glfw.ns.keycodes[0x00] = GLFW_KEY_A;
 | 
			
		||||
    _glfw.ns.keycodes[0x0B] = GLFW_KEY_B;
 | 
			
		||||
    _glfw.ns.keycodes[0x08] = GLFW_KEY_C;
 | 
			
		||||
    _glfw.ns.keycodes[0x02] = GLFW_KEY_D;
 | 
			
		||||
    _glfw.ns.keycodes[0x0E] = GLFW_KEY_E;
 | 
			
		||||
    _glfw.ns.keycodes[0x03] = GLFW_KEY_F;
 | 
			
		||||
    _glfw.ns.keycodes[0x05] = GLFW_KEY_G;
 | 
			
		||||
    _glfw.ns.keycodes[0x04] = GLFW_KEY_H;
 | 
			
		||||
    _glfw.ns.keycodes[0x22] = GLFW_KEY_I;
 | 
			
		||||
    _glfw.ns.keycodes[0x26] = GLFW_KEY_J;
 | 
			
		||||
    _glfw.ns.keycodes[0x28] = GLFW_KEY_K;
 | 
			
		||||
    _glfw.ns.keycodes[0x25] = GLFW_KEY_L;
 | 
			
		||||
    _glfw.ns.keycodes[0x2E] = GLFW_KEY_M;
 | 
			
		||||
    _glfw.ns.keycodes[0x2D] = GLFW_KEY_N;
 | 
			
		||||
    _glfw.ns.keycodes[0x1F] = GLFW_KEY_O;
 | 
			
		||||
    _glfw.ns.keycodes[0x23] = GLFW_KEY_P;
 | 
			
		||||
    _glfw.ns.keycodes[0x0C] = GLFW_KEY_Q;
 | 
			
		||||
    _glfw.ns.keycodes[0x0F] = GLFW_KEY_R;
 | 
			
		||||
    _glfw.ns.keycodes[0x01] = GLFW_KEY_S;
 | 
			
		||||
    _glfw.ns.keycodes[0x11] = GLFW_KEY_T;
 | 
			
		||||
    _glfw.ns.keycodes[0x20] = GLFW_KEY_U;
 | 
			
		||||
    _glfw.ns.keycodes[0x09] = GLFW_KEY_V;
 | 
			
		||||
    _glfw.ns.keycodes[0x0D] = GLFW_KEY_W;
 | 
			
		||||
    _glfw.ns.keycodes[0x07] = GLFW_KEY_X;
 | 
			
		||||
    _glfw.ns.keycodes[0x10] = GLFW_KEY_Y;
 | 
			
		||||
    _glfw.ns.keycodes[0x06] = GLFW_KEY_Z;
 | 
			
		||||
 | 
			
		||||
    _glfw.ns.keycodes[0x27] = GLFW_KEY_APOSTROPHE;
 | 
			
		||||
    _glfw.ns.keycodes[0x2A] = GLFW_KEY_BACKSLASH;
 | 
			
		||||
    _glfw.ns.keycodes[0x2B] = GLFW_KEY_COMMA;
 | 
			
		||||
    _glfw.ns.keycodes[0x18] = GLFW_KEY_EQUAL;
 | 
			
		||||
    _glfw.ns.keycodes[0x32] = GLFW_KEY_GRAVE_ACCENT;
 | 
			
		||||
    _glfw.ns.keycodes[0x21] = GLFW_KEY_LEFT_BRACKET;
 | 
			
		||||
    _glfw.ns.keycodes[0x1B] = GLFW_KEY_MINUS;
 | 
			
		||||
    _glfw.ns.keycodes[0x2F] = GLFW_KEY_PERIOD;
 | 
			
		||||
    _glfw.ns.keycodes[0x1E] = GLFW_KEY_RIGHT_BRACKET;
 | 
			
		||||
    _glfw.ns.keycodes[0x29] = GLFW_KEY_SEMICOLON;
 | 
			
		||||
    _glfw.ns.keycodes[0x2C] = GLFW_KEY_SLASH;
 | 
			
		||||
    _glfw.ns.keycodes[0x0A] = GLFW_KEY_WORLD_1;
 | 
			
		||||
 | 
			
		||||
    _glfw.ns.keycodes[0x33] = GLFW_KEY_BACKSPACE;
 | 
			
		||||
    _glfw.ns.keycodes[0x39] = GLFW_KEY_CAPS_LOCK;
 | 
			
		||||
    _glfw.ns.keycodes[0x75] = GLFW_KEY_DELETE;
 | 
			
		||||
    _glfw.ns.keycodes[0x7D] = GLFW_KEY_DOWN;
 | 
			
		||||
    _glfw.ns.keycodes[0x77] = GLFW_KEY_END;
 | 
			
		||||
    _glfw.ns.keycodes[0x24] = GLFW_KEY_ENTER;
 | 
			
		||||
    _glfw.ns.keycodes[0x35] = GLFW_KEY_ESCAPE;
 | 
			
		||||
    _glfw.ns.keycodes[0x7A] = GLFW_KEY_F1;
 | 
			
		||||
    _glfw.ns.keycodes[0x78] = GLFW_KEY_F2;
 | 
			
		||||
    _glfw.ns.keycodes[0x63] = GLFW_KEY_F3;
 | 
			
		||||
    _glfw.ns.keycodes[0x76] = GLFW_KEY_F4;
 | 
			
		||||
    _glfw.ns.keycodes[0x60] = GLFW_KEY_F5;
 | 
			
		||||
    _glfw.ns.keycodes[0x61] = GLFW_KEY_F6;
 | 
			
		||||
    _glfw.ns.keycodes[0x62] = GLFW_KEY_F7;
 | 
			
		||||
    _glfw.ns.keycodes[0x64] = GLFW_KEY_F8;
 | 
			
		||||
    _glfw.ns.keycodes[0x65] = GLFW_KEY_F9;
 | 
			
		||||
    _glfw.ns.keycodes[0x6D] = GLFW_KEY_F10;
 | 
			
		||||
    _glfw.ns.keycodes[0x67] = GLFW_KEY_F11;
 | 
			
		||||
    _glfw.ns.keycodes[0x6F] = GLFW_KEY_F12;
 | 
			
		||||
    _glfw.ns.keycodes[0x69] = GLFW_KEY_F13;
 | 
			
		||||
    _glfw.ns.keycodes[0x6B] = GLFW_KEY_F14;
 | 
			
		||||
    _glfw.ns.keycodes[0x71] = GLFW_KEY_F15;
 | 
			
		||||
    _glfw.ns.keycodes[0x6A] = GLFW_KEY_F16;
 | 
			
		||||
    _glfw.ns.keycodes[0x40] = GLFW_KEY_F17;
 | 
			
		||||
    _glfw.ns.keycodes[0x4F] = GLFW_KEY_F18;
 | 
			
		||||
    _glfw.ns.keycodes[0x50] = GLFW_KEY_F19;
 | 
			
		||||
    _glfw.ns.keycodes[0x5A] = GLFW_KEY_F20;
 | 
			
		||||
    _glfw.ns.keycodes[0x73] = GLFW_KEY_HOME;
 | 
			
		||||
    _glfw.ns.keycodes[0x72] = GLFW_KEY_INSERT;
 | 
			
		||||
    _glfw.ns.keycodes[0x7B] = GLFW_KEY_LEFT;
 | 
			
		||||
    _glfw.ns.keycodes[0x3A] = GLFW_KEY_LEFT_ALT;
 | 
			
		||||
    _glfw.ns.keycodes[0x3B] = GLFW_KEY_LEFT_CONTROL;
 | 
			
		||||
    _glfw.ns.keycodes[0x38] = GLFW_KEY_LEFT_SHIFT;
 | 
			
		||||
    _glfw.ns.keycodes[0x37] = GLFW_KEY_LEFT_SUPER;
 | 
			
		||||
    _glfw.ns.keycodes[0x6E] = GLFW_KEY_MENU;
 | 
			
		||||
    _glfw.ns.keycodes[0x47] = GLFW_KEY_NUM_LOCK;
 | 
			
		||||
    _glfw.ns.keycodes[0x79] = GLFW_KEY_PAGE_DOWN;
 | 
			
		||||
    _glfw.ns.keycodes[0x74] = GLFW_KEY_PAGE_UP;
 | 
			
		||||
    _glfw.ns.keycodes[0x7C] = GLFW_KEY_RIGHT;
 | 
			
		||||
    _glfw.ns.keycodes[0x3D] = GLFW_KEY_RIGHT_ALT;
 | 
			
		||||
    _glfw.ns.keycodes[0x3E] = GLFW_KEY_RIGHT_CONTROL;
 | 
			
		||||
    _glfw.ns.keycodes[0x3C] = GLFW_KEY_RIGHT_SHIFT;
 | 
			
		||||
    _glfw.ns.keycodes[0x36] = GLFW_KEY_RIGHT_SUPER;
 | 
			
		||||
    _glfw.ns.keycodes[0x31] = GLFW_KEY_SPACE;
 | 
			
		||||
    _glfw.ns.keycodes[0x30] = GLFW_KEY_TAB;
 | 
			
		||||
    _glfw.ns.keycodes[0x7E] = GLFW_KEY_UP;
 | 
			
		||||
 | 
			
		||||
    _glfw.ns.keycodes[0x52] = GLFW_KEY_KP_0;
 | 
			
		||||
    _glfw.ns.keycodes[0x53] = GLFW_KEY_KP_1;
 | 
			
		||||
    _glfw.ns.keycodes[0x54] = GLFW_KEY_KP_2;
 | 
			
		||||
    _glfw.ns.keycodes[0x55] = GLFW_KEY_KP_3;
 | 
			
		||||
    _glfw.ns.keycodes[0x56] = GLFW_KEY_KP_4;
 | 
			
		||||
    _glfw.ns.keycodes[0x57] = GLFW_KEY_KP_5;
 | 
			
		||||
    _glfw.ns.keycodes[0x58] = GLFW_KEY_KP_6;
 | 
			
		||||
    _glfw.ns.keycodes[0x59] = GLFW_KEY_KP_7;
 | 
			
		||||
    _glfw.ns.keycodes[0x5B] = GLFW_KEY_KP_8;
 | 
			
		||||
    _glfw.ns.keycodes[0x5C] = GLFW_KEY_KP_9;
 | 
			
		||||
    _glfw.ns.keycodes[0x45] = GLFW_KEY_KP_ADD;
 | 
			
		||||
    _glfw.ns.keycodes[0x41] = GLFW_KEY_KP_DECIMAL;
 | 
			
		||||
    _glfw.ns.keycodes[0x4B] = GLFW_KEY_KP_DIVIDE;
 | 
			
		||||
    _glfw.ns.keycodes[0x4C] = GLFW_KEY_KP_ENTER;
 | 
			
		||||
    _glfw.ns.keycodes[0x51] = GLFW_KEY_KP_EQUAL;
 | 
			
		||||
    _glfw.ns.keycodes[0x43] = GLFW_KEY_KP_MULTIPLY;
 | 
			
		||||
    _glfw.ns.keycodes[0x4E] = GLFW_KEY_KP_SUBTRACT;
 | 
			
		||||
 | 
			
		||||
    for (scancode = 0;  scancode < 256;  scancode++)
 | 
			
		||||
    {
 | 
			
		||||
        // Store the reverse translation for faster key name lookup
 | 
			
		||||
        if (_glfw.ns.keycodes[scancode] >= 0)
 | 
			
		||||
            _glfw.ns.scancodes[_glfw.ns.keycodes[scancode]] = scancode;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Retrieve Unicode data for the current keyboard layout
 | 
			
		||||
//
 | 
			
		||||
static GLFWbool updateUnicodeDataNS(void)
 | 
			
		||||
{
 | 
			
		||||
    if (_glfw.ns.inputSource)
 | 
			
		||||
    {
 | 
			
		||||
        CFRelease(_glfw.ns.inputSource);
 | 
			
		||||
        _glfw.ns.inputSource = NULL;
 | 
			
		||||
        _glfw.ns.unicodeData = nil;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    _glfw.ns.inputSource = TISCopyCurrentKeyboardLayoutInputSource();
 | 
			
		||||
    if (!_glfw.ns.inputSource)
 | 
			
		||||
    {
 | 
			
		||||
        _glfwInputError(GLFW_PLATFORM_ERROR,
 | 
			
		||||
                        "Cocoa: Failed to retrieve keyboard layout input source");
 | 
			
		||||
        return GLFW_FALSE;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    _glfw.ns.unicodeData =
 | 
			
		||||
        TISGetInputSourceProperty(_glfw.ns.inputSource,
 | 
			
		||||
                                  kTISPropertyUnicodeKeyLayoutData);
 | 
			
		||||
    if (!_glfw.ns.unicodeData)
 | 
			
		||||
    {
 | 
			
		||||
        _glfwInputError(GLFW_PLATFORM_ERROR,
 | 
			
		||||
                        "Cocoa: Failed to retrieve keyboard layout Unicode data");
 | 
			
		||||
        return GLFW_FALSE;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return GLFW_TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Load HIToolbox.framework and the TIS symbols we need from it
 | 
			
		||||
//
 | 
			
		||||
static GLFWbool initializeTIS(void)
 | 
			
		||||
{
 | 
			
		||||
    // This works only because Cocoa has already loaded it properly
 | 
			
		||||
    _glfw.ns.tis.bundle =
 | 
			
		||||
        CFBundleGetBundleWithIdentifier(CFSTR("com.apple.HIToolbox"));
 | 
			
		||||
    if (!_glfw.ns.tis.bundle)
 | 
			
		||||
    {
 | 
			
		||||
        _glfwInputError(GLFW_PLATFORM_ERROR,
 | 
			
		||||
                        "Cocoa: Failed to load HIToolbox.framework");
 | 
			
		||||
        return GLFW_FALSE;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    CFStringRef* kPropertyUnicodeKeyLayoutData =
 | 
			
		||||
        CFBundleGetDataPointerForName(_glfw.ns.tis.bundle,
 | 
			
		||||
                                      CFSTR("kTISPropertyUnicodeKeyLayoutData"));
 | 
			
		||||
    _glfw.ns.tis.CopyCurrentKeyboardLayoutInputSource =
 | 
			
		||||
        CFBundleGetFunctionPointerForName(_glfw.ns.tis.bundle,
 | 
			
		||||
                                          CFSTR("TISCopyCurrentKeyboardLayoutInputSource"));
 | 
			
		||||
    _glfw.ns.tis.GetInputSourceProperty =
 | 
			
		||||
        CFBundleGetFunctionPointerForName(_glfw.ns.tis.bundle,
 | 
			
		||||
                                          CFSTR("TISGetInputSourceProperty"));
 | 
			
		||||
    _glfw.ns.tis.GetKbdType =
 | 
			
		||||
        CFBundleGetFunctionPointerForName(_glfw.ns.tis.bundle,
 | 
			
		||||
                                          CFSTR("LMGetKbdType"));
 | 
			
		||||
 | 
			
		||||
    if (!kPropertyUnicodeKeyLayoutData ||
 | 
			
		||||
        !TISCopyCurrentKeyboardLayoutInputSource ||
 | 
			
		||||
        !TISGetInputSourceProperty ||
 | 
			
		||||
        !LMGetKbdType)
 | 
			
		||||
    {
 | 
			
		||||
        _glfwInputError(GLFW_PLATFORM_ERROR,
 | 
			
		||||
                        "Cocoa: Failed to load TIS API symbols");
 | 
			
		||||
        return GLFW_FALSE;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    _glfw.ns.tis.kPropertyUnicodeKeyLayoutData =
 | 
			
		||||
        *kPropertyUnicodeKeyLayoutData;
 | 
			
		||||
 | 
			
		||||
    return updateUnicodeDataNS();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@interface GLFWHelper : NSObject
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@implementation GLFWHelper
 | 
			
		||||
 | 
			
		||||
- (void)selectedKeyboardInputSourceChanged:(NSObject* )object
 | 
			
		||||
{
 | 
			
		||||
    updateUnicodeDataNS();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
- (void)doNothing:(id)object
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@end // GLFWHelper
 | 
			
		||||
 | 
			
		||||
@interface GLFWApplicationDelegate : NSObject <NSApplicationDelegate>
 | 
			
		||||
@end
 | 
			
		||||
 | 
			
		||||
@implementation GLFWApplicationDelegate
 | 
			
		||||
 | 
			
		||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
 | 
			
		||||
{
 | 
			
		||||
    _GLFWwindow* window;
 | 
			
		||||
 | 
			
		||||
    for (window = _glfw.windowListHead;  window;  window = window->next)
 | 
			
		||||
        _glfwInputWindowCloseRequest(window);
 | 
			
		||||
 | 
			
		||||
    return NSTerminateCancel;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
- (void)applicationDidChangeScreenParameters:(NSNotification *) notification
 | 
			
		||||
{
 | 
			
		||||
    _GLFWwindow* window;
 | 
			
		||||
 | 
			
		||||
    for (window = _glfw.windowListHead;  window;  window = window->next)
 | 
			
		||||
    {
 | 
			
		||||
        if (window->context.client != GLFW_NO_API)
 | 
			
		||||
            [window->context.nsgl.object update];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    _glfwPollMonitorsNS();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
- (void)applicationWillFinishLaunching:(NSNotification *)notification
 | 
			
		||||
{
 | 
			
		||||
    if (_glfw.hints.init.ns.menubar)
 | 
			
		||||
    {
 | 
			
		||||
        // In case we are unbundled, make us a proper UI application
 | 
			
		||||
        [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
 | 
			
		||||
 | 
			
		||||
        // Menu bar setup must go between sharedApplication above and
 | 
			
		||||
        // finishLaunching below, in order to properly emulate the behavior
 | 
			
		||||
        // of NSApplicationMain
 | 
			
		||||
 | 
			
		||||
        if ([[NSBundle mainBundle] pathForResource:@"MainMenu" ofType:@"nib"])
 | 
			
		||||
        {
 | 
			
		||||
            [[NSBundle mainBundle] loadNibNamed:@"MainMenu"
 | 
			
		||||
                                          owner:NSApp
 | 
			
		||||
                                topLevelObjects:&_glfw.ns.nibObjects];
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
            createMenuBar();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
- (void)applicationDidFinishLaunching:(NSNotification *)notification
 | 
			
		||||
{
 | 
			
		||||
    [NSApp stop:nil];
 | 
			
		||||
 | 
			
		||||
    _glfwPlatformPostEmptyEvent();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
- (void)applicationDidHide:(NSNotification *)notification
 | 
			
		||||
{
 | 
			
		||||
    int i;
 | 
			
		||||
 | 
			
		||||
    for (i = 0;  i < _glfw.monitorCount;  i++)
 | 
			
		||||
        _glfwRestoreVideoModeNS(_glfw.monitors[i]);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@end // GLFWApplicationDelegate
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
//////////////////////////////////////////////////////////////////////////
 | 
			
		||||
//////                       GLFW platform API                      //////
 | 
			
		||||
//////////////////////////////////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
int _glfwPlatformInit(void)
 | 
			
		||||
{
 | 
			
		||||
    @autoreleasepool {
 | 
			
		||||
 | 
			
		||||
    _glfw.ns.helper = [[GLFWHelper alloc] init];
 | 
			
		||||
 | 
			
		||||
    [NSThread detachNewThreadSelector:@selector(doNothing:)
 | 
			
		||||
                             toTarget:_glfw.ns.helper
 | 
			
		||||
                           withObject:nil];
 | 
			
		||||
 | 
			
		||||
    if (NSApp)
 | 
			
		||||
        _glfw.ns.finishedLaunching = GLFW_TRUE;
 | 
			
		||||
 | 
			
		||||
    [NSApplication sharedApplication];
 | 
			
		||||
 | 
			
		||||
    _glfw.ns.delegate = [[GLFWApplicationDelegate alloc] init];
 | 
			
		||||
    if (_glfw.ns.delegate == nil)
 | 
			
		||||
    {
 | 
			
		||||
        _glfwInputError(GLFW_PLATFORM_ERROR,
 | 
			
		||||
                        "Cocoa: Failed to create application delegate");
 | 
			
		||||
        return GLFW_FALSE;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    [NSApp setDelegate:_glfw.ns.delegate];
 | 
			
		||||
 | 
			
		||||
    NSEvent* (^block)(NSEvent*) = ^ NSEvent* (NSEvent* event)
 | 
			
		||||
    {
 | 
			
		||||
        if ([event modifierFlags] & NSEventModifierFlagCommand)
 | 
			
		||||
            [[NSApp keyWindow] sendEvent:event];
 | 
			
		||||
 | 
			
		||||
        return event;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    _glfw.ns.keyUpMonitor =
 | 
			
		||||
        [NSEvent addLocalMonitorForEventsMatchingMask:NSEventMaskKeyUp
 | 
			
		||||
                                              handler:block];
 | 
			
		||||
 | 
			
		||||
    if (_glfw.hints.init.ns.chdir)
 | 
			
		||||
        changeToResourcesDirectory();
 | 
			
		||||
 | 
			
		||||
    // Press and Hold prevents some keys from emitting repeated characters
 | 
			
		||||
    NSDictionary* defaults = @{@"ApplePressAndHoldEnabled":@NO};
 | 
			
		||||
    [[NSUserDefaults standardUserDefaults] registerDefaults:defaults];
 | 
			
		||||
 | 
			
		||||
    [[NSNotificationCenter defaultCenter]
 | 
			
		||||
        addObserver:_glfw.ns.helper
 | 
			
		||||
           selector:@selector(selectedKeyboardInputSourceChanged:)
 | 
			
		||||
               name:NSTextInputContextKeyboardSelectionDidChangeNotification
 | 
			
		||||
             object:nil];
 | 
			
		||||
 | 
			
		||||
    createKeyTables();
 | 
			
		||||
 | 
			
		||||
    _glfw.ns.eventSource = CGEventSourceCreate(kCGEventSourceStateHIDSystemState);
 | 
			
		||||
    if (!_glfw.ns.eventSource)
 | 
			
		||||
        return GLFW_FALSE;
 | 
			
		||||
 | 
			
		||||
    CGEventSourceSetLocalEventsSuppressionInterval(_glfw.ns.eventSource, 0.0);
 | 
			
		||||
 | 
			
		||||
    if (!initializeTIS())
 | 
			
		||||
        return GLFW_FALSE;
 | 
			
		||||
 | 
			
		||||
    _glfwInitTimerNS();
 | 
			
		||||
    _glfwInitJoysticksNS();
 | 
			
		||||
 | 
			
		||||
    _glfwPollMonitorsNS();
 | 
			
		||||
    return GLFW_TRUE;
 | 
			
		||||
 | 
			
		||||
    } // autoreleasepool
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void _glfwPlatformTerminate(void)
 | 
			
		||||
{
 | 
			
		||||
    @autoreleasepool {
 | 
			
		||||
 | 
			
		||||
    if (_glfw.ns.inputSource)
 | 
			
		||||
    {
 | 
			
		||||
        CFRelease(_glfw.ns.inputSource);
 | 
			
		||||
        _glfw.ns.inputSource = NULL;
 | 
			
		||||
        _glfw.ns.unicodeData = nil;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (_glfw.ns.eventSource)
 | 
			
		||||
    {
 | 
			
		||||
        CFRelease(_glfw.ns.eventSource);
 | 
			
		||||
        _glfw.ns.eventSource = NULL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (_glfw.ns.delegate)
 | 
			
		||||
    {
 | 
			
		||||
        [NSApp setDelegate:nil];
 | 
			
		||||
        [_glfw.ns.delegate release];
 | 
			
		||||
        _glfw.ns.delegate = nil;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (_glfw.ns.helper)
 | 
			
		||||
    {
 | 
			
		||||
        [[NSNotificationCenter defaultCenter]
 | 
			
		||||
            removeObserver:_glfw.ns.helper
 | 
			
		||||
                      name:NSTextInputContextKeyboardSelectionDidChangeNotification
 | 
			
		||||
                    object:nil];
 | 
			
		||||
        [[NSNotificationCenter defaultCenter]
 | 
			
		||||
            removeObserver:_glfw.ns.helper];
 | 
			
		||||
        [_glfw.ns.helper release];
 | 
			
		||||
        _glfw.ns.helper = nil;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (_glfw.ns.keyUpMonitor)
 | 
			
		||||
        [NSEvent removeMonitor:_glfw.ns.keyUpMonitor];
 | 
			
		||||
 | 
			
		||||
    free(_glfw.ns.clipboardString);
 | 
			
		||||
 | 
			
		||||
    _glfwTerminateNSGL();
 | 
			
		||||
    _glfwTerminateJoysticksNS();
 | 
			
		||||
 | 
			
		||||
    } // autoreleasepool
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const char* _glfwPlatformGetVersionString(void)
 | 
			
		||||
{
 | 
			
		||||
    return _GLFW_VERSION_NUMBER " Cocoa NSGL EGL OSMesa"
 | 
			
		||||
#if defined(_GLFW_BUILD_DLL)
 | 
			
		||||
        " dynamic"
 | 
			
		||||
#endif
 | 
			
		||||
        ;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										50
									
								
								cs440-acg/ext/nanogui/ext/glfw/src/cocoa_joystick.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								cs440-acg/ext/nanogui/ext/glfw/src/cocoa_joystick.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,50 @@
 | 
			
		||||
//========================================================================
 | 
			
		||||
// GLFW 3.3 Cocoa - www.glfw.org
 | 
			
		||||
//------------------------------------------------------------------------
 | 
			
		||||
// Copyright (c) 2006-2017 Camilla Löwy <elmindreda@glfw.org>
 | 
			
		||||
//
 | 
			
		||||
// 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 <IOKit/IOKitLib.h>
 | 
			
		||||
#include <IOKit/IOCFPlugIn.h>
 | 
			
		||||
#include <IOKit/hid/IOHIDLib.h>
 | 
			
		||||
#include <IOKit/hid/IOHIDKeys.h>
 | 
			
		||||
 | 
			
		||||
#define _GLFW_PLATFORM_JOYSTICK_STATE         _GLFWjoystickNS ns
 | 
			
		||||
#define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE
 | 
			
		||||
 | 
			
		||||
#define _GLFW_PLATFORM_MAPPING_NAME "Mac OS X"
 | 
			
		||||
 | 
			
		||||
// Cocoa-specific per-joystick data
 | 
			
		||||
//
 | 
			
		||||
typedef struct _GLFWjoystickNS
 | 
			
		||||
{
 | 
			
		||||
    IOHIDDeviceRef      device;
 | 
			
		||||
    CFMutableArrayRef   axes;
 | 
			
		||||
    CFMutableArrayRef   buttons;
 | 
			
		||||
    CFMutableArrayRef   hats;
 | 
			
		||||
} _GLFWjoystickNS;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void _glfwInitJoysticksNS(void);
 | 
			
		||||
void _glfwTerminateJoysticksNS(void);
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										485
									
								
								cs440-acg/ext/nanogui/ext/glfw/src/cocoa_joystick.m
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										485
									
								
								cs440-acg/ext/nanogui/ext/glfw/src/cocoa_joystick.m
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,485 @@
 | 
			
		||||
//========================================================================
 | 
			
		||||
// GLFW 3.3 Cocoa - www.glfw.org
 | 
			
		||||
//------------------------------------------------------------------------
 | 
			
		||||
// Copyright (c) 2009-2019 Camilla Löwy <elmindreda@glfw.org>
 | 
			
		||||
// Copyright (c) 2012 Torsten Walluhn <tw@mad-cad.net>
 | 
			
		||||
//
 | 
			
		||||
// 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 <unistd.h>
 | 
			
		||||
#include <ctype.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
 | 
			
		||||
#include <mach/mach.h>
 | 
			
		||||
#include <mach/mach_error.h>
 | 
			
		||||
 | 
			
		||||
#include <CoreFoundation/CoreFoundation.h>
 | 
			
		||||
#include <Kernel/IOKit/hidsystem/IOHIDUsageTables.h>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Joystick element information
 | 
			
		||||
//
 | 
			
		||||
typedef struct _GLFWjoyelementNS
 | 
			
		||||
{
 | 
			
		||||
    IOHIDElementRef native;
 | 
			
		||||
    uint32_t        usage;
 | 
			
		||||
    int             index;
 | 
			
		||||
    long            minimum;
 | 
			
		||||
    long            maximum;
 | 
			
		||||
 | 
			
		||||
} _GLFWjoyelementNS;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Returns the value of the specified element of the specified joystick
 | 
			
		||||
//
 | 
			
		||||
static long getElementValue(_GLFWjoystick* js, _GLFWjoyelementNS* element)
 | 
			
		||||
{
 | 
			
		||||
    IOHIDValueRef valueRef;
 | 
			
		||||
    long value = 0;
 | 
			
		||||
 | 
			
		||||
    if (js->ns.device)
 | 
			
		||||
    {
 | 
			
		||||
        if (IOHIDDeviceGetValue(js->ns.device,
 | 
			
		||||
                                element->native,
 | 
			
		||||
                                &valueRef) == kIOReturnSuccess)
 | 
			
		||||
        {
 | 
			
		||||
            value = IOHIDValueGetIntegerValue(valueRef);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return value;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Comparison function for matching the SDL element order
 | 
			
		||||
//
 | 
			
		||||
static CFComparisonResult compareElements(const void* fp,
 | 
			
		||||
                                          const void* sp,
 | 
			
		||||
                                          void* user)
 | 
			
		||||
{
 | 
			
		||||
    const _GLFWjoyelementNS* fe = fp;
 | 
			
		||||
    const _GLFWjoyelementNS* se = sp;
 | 
			
		||||
    if (fe->usage < se->usage)
 | 
			
		||||
        return kCFCompareLessThan;
 | 
			
		||||
    if (fe->usage > se->usage)
 | 
			
		||||
        return kCFCompareGreaterThan;
 | 
			
		||||
    if (fe->index < se->index)
 | 
			
		||||
        return kCFCompareLessThan;
 | 
			
		||||
    if (fe->index > se->index)
 | 
			
		||||
        return kCFCompareGreaterThan;
 | 
			
		||||
    return kCFCompareEqualTo;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Removes the specified joystick
 | 
			
		||||
//
 | 
			
		||||
static void closeJoystick(_GLFWjoystick* js)
 | 
			
		||||
{
 | 
			
		||||
    int i;
 | 
			
		||||
 | 
			
		||||
    if (!js->present)
 | 
			
		||||
        return;
 | 
			
		||||
 | 
			
		||||
    for (i = 0;  i < CFArrayGetCount(js->ns.axes);  i++)
 | 
			
		||||
        free((void*) CFArrayGetValueAtIndex(js->ns.axes, i));
 | 
			
		||||
    CFRelease(js->ns.axes);
 | 
			
		||||
 | 
			
		||||
    for (i = 0;  i < CFArrayGetCount(js->ns.buttons);  i++)
 | 
			
		||||
        free((void*) CFArrayGetValueAtIndex(js->ns.buttons, i));
 | 
			
		||||
    CFRelease(js->ns.buttons);
 | 
			
		||||
 | 
			
		||||
    for (i = 0;  i < CFArrayGetCount(js->ns.hats);  i++)
 | 
			
		||||
        free((void*) CFArrayGetValueAtIndex(js->ns.hats, i));
 | 
			
		||||
    CFRelease(js->ns.hats);
 | 
			
		||||
 | 
			
		||||
    _glfwFreeJoystick(js);
 | 
			
		||||
    _glfwInputJoystick(js, GLFW_DISCONNECTED);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Callback for user-initiated joystick addition
 | 
			
		||||
//
 | 
			
		||||
static void matchCallback(void* context,
 | 
			
		||||
                          IOReturn result,
 | 
			
		||||
                          void* sender,
 | 
			
		||||
                          IOHIDDeviceRef device)
 | 
			
		||||
{
 | 
			
		||||
    int jid;
 | 
			
		||||
    char name[256];
 | 
			
		||||
    char guid[33];
 | 
			
		||||
    CFIndex i;
 | 
			
		||||
    CFTypeRef property;
 | 
			
		||||
    uint32_t vendor = 0, product = 0, version = 0;
 | 
			
		||||
    _GLFWjoystick* js;
 | 
			
		||||
    CFMutableArrayRef axes, buttons, hats;
 | 
			
		||||
 | 
			
		||||
    for (jid = 0;  jid <= GLFW_JOYSTICK_LAST;  jid++)
 | 
			
		||||
    {
 | 
			
		||||
        if (_glfw.joysticks[jid].ns.device == device)
 | 
			
		||||
            return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    axes    = CFArrayCreateMutable(NULL, 0, NULL);
 | 
			
		||||
    buttons = CFArrayCreateMutable(NULL, 0, NULL);
 | 
			
		||||
    hats    = CFArrayCreateMutable(NULL, 0, NULL);
 | 
			
		||||
 | 
			
		||||
    property = IOHIDDeviceGetProperty(device, CFSTR(kIOHIDProductKey));
 | 
			
		||||
    if (property)
 | 
			
		||||
    {
 | 
			
		||||
        CFStringGetCString(property,
 | 
			
		||||
                           name,
 | 
			
		||||
                           sizeof(name),
 | 
			
		||||
                           kCFStringEncodingUTF8);
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
        strncpy(name, "Unknown", sizeof(name));
 | 
			
		||||
 | 
			
		||||
    property = IOHIDDeviceGetProperty(device, CFSTR(kIOHIDVendorIDKey));
 | 
			
		||||
    if (property)
 | 
			
		||||
        CFNumberGetValue(property, kCFNumberSInt32Type, &vendor);
 | 
			
		||||
 | 
			
		||||
    property = IOHIDDeviceGetProperty(device, CFSTR(kIOHIDProductIDKey));
 | 
			
		||||
    if (property)
 | 
			
		||||
        CFNumberGetValue(property, kCFNumberSInt32Type, &product);
 | 
			
		||||
 | 
			
		||||
    property = IOHIDDeviceGetProperty(device, CFSTR(kIOHIDVersionNumberKey));
 | 
			
		||||
    if (property)
 | 
			
		||||
        CFNumberGetValue(property, kCFNumberSInt32Type, &version);
 | 
			
		||||
 | 
			
		||||
    // Generate a joystick GUID that matches the SDL 2.0.5+ one
 | 
			
		||||
    if (vendor && product)
 | 
			
		||||
    {
 | 
			
		||||
        sprintf(guid, "03000000%02x%02x0000%02x%02x0000%02x%02x0000",
 | 
			
		||||
                (uint8_t) vendor, (uint8_t) (vendor >> 8),
 | 
			
		||||
                (uint8_t) product, (uint8_t) (product >> 8),
 | 
			
		||||
                (uint8_t) version, (uint8_t) (version >> 8));
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
    {
 | 
			
		||||
        sprintf(guid, "05000000%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x00",
 | 
			
		||||
                name[0], name[1], name[2], name[3],
 | 
			
		||||
                name[4], name[5], name[6], name[7],
 | 
			
		||||
                name[8], name[9], name[10]);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    CFArrayRef elements =
 | 
			
		||||
        IOHIDDeviceCopyMatchingElements(device, NULL, kIOHIDOptionsTypeNone);
 | 
			
		||||
 | 
			
		||||
    for (i = 0;  i < CFArrayGetCount(elements);  i++)
 | 
			
		||||
    {
 | 
			
		||||
        IOHIDElementRef native = (IOHIDElementRef)
 | 
			
		||||
            CFArrayGetValueAtIndex(elements, i);
 | 
			
		||||
        if (CFGetTypeID(native) != IOHIDElementGetTypeID())
 | 
			
		||||
            continue;
 | 
			
		||||
 | 
			
		||||
        const IOHIDElementType type = IOHIDElementGetType(native);
 | 
			
		||||
        if ((type != kIOHIDElementTypeInput_Axis) &&
 | 
			
		||||
            (type != kIOHIDElementTypeInput_Button) &&
 | 
			
		||||
            (type != kIOHIDElementTypeInput_Misc))
 | 
			
		||||
        {
 | 
			
		||||
            continue;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        CFMutableArrayRef target = NULL;
 | 
			
		||||
 | 
			
		||||
        const uint32_t usage = IOHIDElementGetUsage(native);
 | 
			
		||||
        const uint32_t page = IOHIDElementGetUsagePage(native);
 | 
			
		||||
        if (page == kHIDPage_GenericDesktop)
 | 
			
		||||
        {
 | 
			
		||||
            switch (usage)
 | 
			
		||||
            {
 | 
			
		||||
                case kHIDUsage_GD_X:
 | 
			
		||||
                case kHIDUsage_GD_Y:
 | 
			
		||||
                case kHIDUsage_GD_Z:
 | 
			
		||||
                case kHIDUsage_GD_Rx:
 | 
			
		||||
                case kHIDUsage_GD_Ry:
 | 
			
		||||
                case kHIDUsage_GD_Rz:
 | 
			
		||||
                case kHIDUsage_GD_Slider:
 | 
			
		||||
                case kHIDUsage_GD_Dial:
 | 
			
		||||
                case kHIDUsage_GD_Wheel:
 | 
			
		||||
                    target = axes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case kHIDUsage_GD_Hatswitch:
 | 
			
		||||
                    target = hats;
 | 
			
		||||
                    break;
 | 
			
		||||
                case kHIDUsage_GD_DPadUp:
 | 
			
		||||
                case kHIDUsage_GD_DPadRight:
 | 
			
		||||
                case kHIDUsage_GD_DPadDown:
 | 
			
		||||
                case kHIDUsage_GD_DPadLeft:
 | 
			
		||||
                case kHIDUsage_GD_SystemMainMenu:
 | 
			
		||||
                case kHIDUsage_GD_Select:
 | 
			
		||||
                case kHIDUsage_GD_Start:
 | 
			
		||||
                    target = buttons;
 | 
			
		||||
                    break;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        else if (page == kHIDPage_Simulation)
 | 
			
		||||
        {
 | 
			
		||||
            switch (usage)
 | 
			
		||||
            {
 | 
			
		||||
                case kHIDUsage_Sim_Accelerator:
 | 
			
		||||
                case kHIDUsage_Sim_Brake:
 | 
			
		||||
                case kHIDUsage_Sim_Throttle:
 | 
			
		||||
                case kHIDUsage_Sim_Rudder:
 | 
			
		||||
                case kHIDUsage_Sim_Steering:
 | 
			
		||||
                    target = axes;
 | 
			
		||||
                    break;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        else if (page == kHIDPage_Button || page == kHIDPage_Consumer)
 | 
			
		||||
            target = buttons;
 | 
			
		||||
 | 
			
		||||
        if (target)
 | 
			
		||||
        {
 | 
			
		||||
            _GLFWjoyelementNS* element = calloc(1, sizeof(_GLFWjoyelementNS));
 | 
			
		||||
            element->native  = native;
 | 
			
		||||
            element->usage   = usage;
 | 
			
		||||
            element->index   = (int) CFArrayGetCount(target);
 | 
			
		||||
            element->minimum = IOHIDElementGetLogicalMin(native);
 | 
			
		||||
            element->maximum = IOHIDElementGetLogicalMax(native);
 | 
			
		||||
            CFArrayAppendValue(target, element);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    CFRelease(elements);
 | 
			
		||||
 | 
			
		||||
    CFArraySortValues(axes, CFRangeMake(0, CFArrayGetCount(axes)),
 | 
			
		||||
                      compareElements, NULL);
 | 
			
		||||
    CFArraySortValues(buttons, CFRangeMake(0, CFArrayGetCount(buttons)),
 | 
			
		||||
                      compareElements, NULL);
 | 
			
		||||
    CFArraySortValues(hats, CFRangeMake(0, CFArrayGetCount(hats)),
 | 
			
		||||
                      compareElements, NULL);
 | 
			
		||||
 | 
			
		||||
    js = _glfwAllocJoystick(name, guid,
 | 
			
		||||
                            (int) CFArrayGetCount(axes),
 | 
			
		||||
                            (int) CFArrayGetCount(buttons),
 | 
			
		||||
                            (int) CFArrayGetCount(hats));
 | 
			
		||||
 | 
			
		||||
    js->ns.device  = device;
 | 
			
		||||
    js->ns.axes    = axes;
 | 
			
		||||
    js->ns.buttons = buttons;
 | 
			
		||||
    js->ns.hats    = hats;
 | 
			
		||||
 | 
			
		||||
    _glfwInputJoystick(js, GLFW_CONNECTED);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Callback for user-initiated joystick removal
 | 
			
		||||
//
 | 
			
		||||
static void removeCallback(void* context,
 | 
			
		||||
                           IOReturn result,
 | 
			
		||||
                           void* sender,
 | 
			
		||||
                           IOHIDDeviceRef device)
 | 
			
		||||
{
 | 
			
		||||
    int jid;
 | 
			
		||||
 | 
			
		||||
    for (jid = 0;  jid <= GLFW_JOYSTICK_LAST;  jid++)
 | 
			
		||||
    {
 | 
			
		||||
        if (_glfw.joysticks[jid].ns.device == device)
 | 
			
		||||
        {
 | 
			
		||||
            closeJoystick(_glfw.joysticks + jid);
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
//////////////////////////////////////////////////////////////////////////
 | 
			
		||||
//////                       GLFW internal API                      //////
 | 
			
		||||
//////////////////////////////////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
// Initialize joystick interface
 | 
			
		||||
//
 | 
			
		||||
void _glfwInitJoysticksNS(void)
 | 
			
		||||
{
 | 
			
		||||
    CFMutableArrayRef matching;
 | 
			
		||||
    const long usages[] =
 | 
			
		||||
    {
 | 
			
		||||
        kHIDUsage_GD_Joystick,
 | 
			
		||||
        kHIDUsage_GD_GamePad,
 | 
			
		||||
        kHIDUsage_GD_MultiAxisController
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    _glfw.ns.hidManager = IOHIDManagerCreate(kCFAllocatorDefault,
 | 
			
		||||
                                             kIOHIDOptionsTypeNone);
 | 
			
		||||
 | 
			
		||||
    matching = CFArrayCreateMutable(kCFAllocatorDefault,
 | 
			
		||||
                                    0,
 | 
			
		||||
                                    &kCFTypeArrayCallBacks);
 | 
			
		||||
    if (!matching)
 | 
			
		||||
    {
 | 
			
		||||
        _glfwInputError(GLFW_PLATFORM_ERROR, "Cocoa: Failed to create array");
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    for (int i = 0;  i < sizeof(usages) / sizeof(long);  i++)
 | 
			
		||||
    {
 | 
			
		||||
        const long page = kHIDPage_GenericDesktop;
 | 
			
		||||
 | 
			
		||||
        CFMutableDictionaryRef dict =
 | 
			
		||||
            CFDictionaryCreateMutable(kCFAllocatorDefault,
 | 
			
		||||
                                      0,
 | 
			
		||||
                                      &kCFTypeDictionaryKeyCallBacks,
 | 
			
		||||
                                      &kCFTypeDictionaryValueCallBacks);
 | 
			
		||||
        if (!dict)
 | 
			
		||||
            continue;
 | 
			
		||||
 | 
			
		||||
        CFNumberRef pageRef = CFNumberCreate(kCFAllocatorDefault,
 | 
			
		||||
                                             kCFNumberLongType,
 | 
			
		||||
                                             &page);
 | 
			
		||||
        CFNumberRef usageRef = CFNumberCreate(kCFAllocatorDefault,
 | 
			
		||||
                                              kCFNumberLongType,
 | 
			
		||||
                                              &usages[i]);
 | 
			
		||||
        if (pageRef && usageRef)
 | 
			
		||||
        {
 | 
			
		||||
            CFDictionarySetValue(dict,
 | 
			
		||||
                                 CFSTR(kIOHIDDeviceUsagePageKey),
 | 
			
		||||
                                 pageRef);
 | 
			
		||||
            CFDictionarySetValue(dict,
 | 
			
		||||
                                 CFSTR(kIOHIDDeviceUsageKey),
 | 
			
		||||
                                 usageRef);
 | 
			
		||||
            CFArrayAppendValue(matching, dict);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (pageRef)
 | 
			
		||||
            CFRelease(pageRef);
 | 
			
		||||
        if (usageRef)
 | 
			
		||||
            CFRelease(usageRef);
 | 
			
		||||
 | 
			
		||||
        CFRelease(dict);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    IOHIDManagerSetDeviceMatchingMultiple(_glfw.ns.hidManager, matching);
 | 
			
		||||
    CFRelease(matching);
 | 
			
		||||
 | 
			
		||||
    IOHIDManagerRegisterDeviceMatchingCallback(_glfw.ns.hidManager,
 | 
			
		||||
                                               &matchCallback, NULL);
 | 
			
		||||
    IOHIDManagerRegisterDeviceRemovalCallback(_glfw.ns.hidManager,
 | 
			
		||||
                                              &removeCallback, NULL);
 | 
			
		||||
    IOHIDManagerScheduleWithRunLoop(_glfw.ns.hidManager,
 | 
			
		||||
                                    CFRunLoopGetMain(),
 | 
			
		||||
                                    kCFRunLoopDefaultMode);
 | 
			
		||||
    IOHIDManagerOpen(_glfw.ns.hidManager, kIOHIDOptionsTypeNone);
 | 
			
		||||
 | 
			
		||||
    // Execute the run loop once in order to register any initially-attached
 | 
			
		||||
    // joysticks
 | 
			
		||||
    CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Close all opened joystick handles
 | 
			
		||||
//
 | 
			
		||||
void _glfwTerminateJoysticksNS(void)
 | 
			
		||||
{
 | 
			
		||||
    int jid;
 | 
			
		||||
 | 
			
		||||
    for (jid = 0;  jid <= GLFW_JOYSTICK_LAST;  jid++)
 | 
			
		||||
        closeJoystick(_glfw.joysticks + jid);
 | 
			
		||||
 | 
			
		||||
    CFRelease(_glfw.ns.hidManager);
 | 
			
		||||
    _glfw.ns.hidManager = NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
//////////////////////////////////////////////////////////////////////////
 | 
			
		||||
//////                       GLFW platform API                      //////
 | 
			
		||||
//////////////////////////////////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
int _glfwPlatformPollJoystick(_GLFWjoystick* js, int mode)
 | 
			
		||||
{
 | 
			
		||||
    if (mode & _GLFW_POLL_AXES)
 | 
			
		||||
    {
 | 
			
		||||
        CFIndex i;
 | 
			
		||||
 | 
			
		||||
        for (i = 0;  i < CFArrayGetCount(js->ns.axes);  i++)
 | 
			
		||||
        {
 | 
			
		||||
            _GLFWjoyelementNS* axis = (_GLFWjoyelementNS*)
 | 
			
		||||
                CFArrayGetValueAtIndex(js->ns.axes, i);
 | 
			
		||||
 | 
			
		||||
            const long raw = getElementValue(js, axis);
 | 
			
		||||
            // Perform auto calibration
 | 
			
		||||
            if (raw < axis->minimum)
 | 
			
		||||
                axis->minimum = raw;
 | 
			
		||||
            if (raw > axis->maximum)
 | 
			
		||||
                axis->maximum = raw;
 | 
			
		||||
 | 
			
		||||
            const long size = axis->maximum - axis->minimum;
 | 
			
		||||
            if (size == 0)
 | 
			
		||||
                _glfwInputJoystickAxis(js, (int) i, 0.f);
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                const float value = (2.f * (raw - axis->minimum) / size) - 1.f;
 | 
			
		||||
                _glfwInputJoystickAxis(js, (int) i, value);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (mode & _GLFW_POLL_BUTTONS)
 | 
			
		||||
    {
 | 
			
		||||
        CFIndex i;
 | 
			
		||||
 | 
			
		||||
        for (i = 0;  i < CFArrayGetCount(js->ns.buttons);  i++)
 | 
			
		||||
        {
 | 
			
		||||
            _GLFWjoyelementNS* button = (_GLFWjoyelementNS*)
 | 
			
		||||
                CFArrayGetValueAtIndex(js->ns.buttons, i);
 | 
			
		||||
            const char value = getElementValue(js, button) - button->minimum;
 | 
			
		||||
            const int state = (value > 0) ? GLFW_PRESS : GLFW_RELEASE;
 | 
			
		||||
            _glfwInputJoystickButton(js, (int) i, state);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        for (i = 0;  i < CFArrayGetCount(js->ns.hats);  i++)
 | 
			
		||||
        {
 | 
			
		||||
            const int states[9] =
 | 
			
		||||
            {
 | 
			
		||||
                GLFW_HAT_UP,
 | 
			
		||||
                GLFW_HAT_RIGHT_UP,
 | 
			
		||||
                GLFW_HAT_RIGHT,
 | 
			
		||||
                GLFW_HAT_RIGHT_DOWN,
 | 
			
		||||
                GLFW_HAT_DOWN,
 | 
			
		||||
                GLFW_HAT_LEFT_DOWN,
 | 
			
		||||
                GLFW_HAT_LEFT,
 | 
			
		||||
                GLFW_HAT_LEFT_UP,
 | 
			
		||||
                GLFW_HAT_CENTERED
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            _GLFWjoyelementNS* hat = (_GLFWjoyelementNS*)
 | 
			
		||||
                CFArrayGetValueAtIndex(js->ns.hats, i);
 | 
			
		||||
            long state = getElementValue(js, hat) - hat->minimum;
 | 
			
		||||
            if (state < 0 || state > 8)
 | 
			
		||||
                state = 8;
 | 
			
		||||
 | 
			
		||||
            _glfwInputJoystickHat(js, (int) i, states[state]);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return js->present;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void _glfwPlatformUpdateGamepadGUID(char* guid)
 | 
			
		||||
{
 | 
			
		||||
    if ((strncmp(guid + 4, "000000000000", 12) == 0) &&
 | 
			
		||||
        (strncmp(guid + 20, "000000000000", 12) == 0))
 | 
			
		||||
    {
 | 
			
		||||
        char original[33];
 | 
			
		||||
        strncpy(original, guid, sizeof(original) - 1);
 | 
			
		||||
        sprintf(guid, "03000000%.4s0000%.4s000000000000",
 | 
			
		||||
                original, original + 16);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										571
									
								
								cs440-acg/ext/nanogui/ext/glfw/src/cocoa_monitor.m
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										571
									
								
								cs440-acg/ext/nanogui/ext/glfw/src/cocoa_monitor.m
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,571 @@
 | 
			
		||||
//========================================================================
 | 
			
		||||
// GLFW 3.3 macOS - www.glfw.org
 | 
			
		||||
//------------------------------------------------------------------------
 | 
			
		||||
// Copyright (c) 2002-2006 Marcus Geelnard
 | 
			
		||||
// Copyright (c) 2006-2019 Camilla Löwy <elmindreda@glfw.org>
 | 
			
		||||
//
 | 
			
		||||
// 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 <stdlib.h>
 | 
			
		||||
#include <limits.h>
 | 
			
		||||
#include <math.h>
 | 
			
		||||
 | 
			
		||||
#include <IOKit/graphics/IOGraphicsLib.h>
 | 
			
		||||
#include <ApplicationServices/ApplicationServices.h>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// Get the name of the specified display, or NULL
 | 
			
		||||
//
 | 
			
		||||
static char* getDisplayName(CGDirectDisplayID displayID)
 | 
			
		||||
{
 | 
			
		||||
    io_iterator_t it;
 | 
			
		||||
    io_service_t service;
 | 
			
		||||
    CFDictionaryRef info;
 | 
			
		||||
 | 
			
		||||
    if (IOServiceGetMatchingServices(kIOMasterPortDefault,
 | 
			
		||||
                                     IOServiceMatching("IODisplayConnect"),
 | 
			
		||||
                                     &it) != 0)
 | 
			
		||||
    {
 | 
			
		||||
        // This may happen if a desktop Mac is running headless
 | 
			
		||||
        return NULL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    while ((service = IOIteratorNext(it)) != 0)
 | 
			
		||||
    {
 | 
			
		||||
        info = IODisplayCreateInfoDictionary(service,
 | 
			
		||||
                                             kIODisplayOnlyPreferredName);
 | 
			
		||||
 | 
			
		||||
        CFNumberRef vendorIDRef =
 | 
			
		||||
            CFDictionaryGetValue(info, CFSTR(kDisplayVendorID));
 | 
			
		||||
        CFNumberRef productIDRef =
 | 
			
		||||
            CFDictionaryGetValue(info, CFSTR(kDisplayProductID));
 | 
			
		||||
        if (!vendorIDRef || !productIDRef)
 | 
			
		||||
        {
 | 
			
		||||
            CFRelease(info);
 | 
			
		||||
            continue;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        unsigned int vendorID, productID;
 | 
			
		||||
        CFNumberGetValue(vendorIDRef, kCFNumberIntType, &vendorID);
 | 
			
		||||
        CFNumberGetValue(productIDRef, kCFNumberIntType, &productID);
 | 
			
		||||
 | 
			
		||||
        if (CGDisplayVendorNumber(displayID) == vendorID &&
 | 
			
		||||
            CGDisplayModelNumber(displayID) == productID)
 | 
			
		||||
        {
 | 
			
		||||
            // Info dictionary is used and freed below
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        CFRelease(info);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    IOObjectRelease(it);
 | 
			
		||||
 | 
			
		||||
    if (!service)
 | 
			
		||||
    {
 | 
			
		||||
        _glfwInputError(GLFW_PLATFORM_ERROR,
 | 
			
		||||
                        "Cocoa: Failed to find service port for display");
 | 
			
		||||
        return NULL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    CFDictionaryRef names =
 | 
			
		||||
        CFDictionaryGetValue(info, CFSTR(kDisplayProductName));
 | 
			
		||||
 | 
			
		||||
    CFStringRef nameRef;
 | 
			
		||||
 | 
			
		||||
    if (!names || !CFDictionaryGetValueIfPresent(names, CFSTR("en_US"),
 | 
			
		||||
                                                 (const void**) &nameRef))
 | 
			
		||||
    {
 | 
			
		||||
        // This may happen if a desktop Mac is running headless
 | 
			
		||||
        CFRelease(info);
 | 
			
		||||
        return NULL;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const CFIndex size =
 | 
			
		||||
        CFStringGetMaximumSizeForEncoding(CFStringGetLength(nameRef),
 | 
			
		||||
                                          kCFStringEncodingUTF8);
 | 
			
		||||
    char* name = calloc(size + 1, 1);
 | 
			
		||||
    CFStringGetCString(nameRef, name, size, kCFStringEncodingUTF8);
 | 
			
		||||
 | 
			
		||||
    CFRelease(info);
 | 
			
		||||
    return name;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Check whether the display mode should be included in enumeration
 | 
			
		||||
//
 | 
			
		||||
static GLFWbool modeIsGood(CGDisplayModeRef mode)
 | 
			
		||||
{
 | 
			
		||||
    uint32_t flags = CGDisplayModeGetIOFlags(mode);
 | 
			
		||||
 | 
			
		||||
    if (!(flags & kDisplayModeValidFlag) || !(flags & kDisplayModeSafeFlag))
 | 
			
		||||
        return GLFW_FALSE;
 | 
			
		||||
    if (flags & kDisplayModeInterlacedFlag)
 | 
			
		||||
        return GLFW_FALSE;
 | 
			
		||||
    if (flags & kDisplayModeStretchedFlag)
 | 
			
		||||
        return GLFW_FALSE;
 | 
			
		||||
 | 
			
		||||
#if MAC_OS_X_VERSION_MAX_ALLOWED <= 101100
 | 
			
		||||
    CFStringRef format = CGDisplayModeCopyPixelEncoding(mode);
 | 
			
		||||
    if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) &&
 | 
			
		||||
        CFStringCompare(format, CFSTR(IO32BitDirectPixels), 0))
 | 
			
		||||
    {
 | 
			
		||||
        CFRelease(format);
 | 
			
		||||
        return GLFW_FALSE;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    CFRelease(format);
 | 
			
		||||
#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
 | 
			
		||||
    return GLFW_TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Convert Core Graphics display mode to GLFW video mode
 | 
			
		||||
//
 | 
			
		||||
static GLFWvidmode vidmodeFromCGDisplayMode(CGDisplayModeRef mode,
 | 
			
		||||
                                            CVDisplayLinkRef link)
 | 
			
		||||
{
 | 
			
		||||
    GLFWvidmode result;
 | 
			
		||||
    result.width = (int) CGDisplayModeGetWidth(mode);
 | 
			
		||||
    result.height = (int) CGDisplayModeGetHeight(mode);
 | 
			
		||||
    result.refreshRate = (int) round(CGDisplayModeGetRefreshRate(mode));
 | 
			
		||||
 | 
			
		||||
    if (result.refreshRate == 0)
 | 
			
		||||
    {
 | 
			
		||||
        const CVTime time = CVDisplayLinkGetNominalOutputVideoRefreshPeriod(link);
 | 
			
		||||
        if (!(time.flags & kCVTimeIsIndefinite))
 | 
			
		||||
            result.refreshRate = (int) (time.timeScale / (double) time.timeValue);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
#if MAC_OS_X_VERSION_MAX_ALLOWED <= 101100
 | 
			
		||||
    CFStringRef format = CGDisplayModeCopyPixelEncoding(mode);
 | 
			
		||||
    if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) == 0)
 | 
			
		||||
    {
 | 
			
		||||
        result.redBits = 5;
 | 
			
		||||
        result.greenBits = 5;
 | 
			
		||||
        result.blueBits = 5;
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
 | 
			
		||||
    {
 | 
			
		||||
        result.redBits = 8;
 | 
			
		||||
        result.greenBits = 8;
 | 
			
		||||
        result.blueBits = 8;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
#if MAC_OS_X_VERSION_MAX_ALLOWED <= 101100
 | 
			
		||||
    CFRelease(format);
 | 
			
		||||
#endif /* MAC_OS_X_VERSION_MAX_ALLOWED */
 | 
			
		||||
    return result;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Starts reservation for display fading
 | 
			
		||||
//
 | 
			
		||||
static CGDisplayFadeReservationToken beginFadeReservation(void)
 | 
			
		||||
{
 | 
			
		||||
    CGDisplayFadeReservationToken token = kCGDisplayFadeReservationInvalidToken;
 | 
			
		||||
 | 
			
		||||
    if (CGAcquireDisplayFadeReservation(5, &token) == kCGErrorSuccess)
 | 
			
		||||
    {
 | 
			
		||||
        CGDisplayFade(token, 0.3,
 | 
			
		||||
                      kCGDisplayBlendNormal,
 | 
			
		||||
                      kCGDisplayBlendSolidColor,
 | 
			
		||||
                      0.0, 0.0, 0.0,
 | 
			
		||||
                      TRUE);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return token;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Ends reservation for display fading
 | 
			
		||||
//
 | 
			
		||||
static void endFadeReservation(CGDisplayFadeReservationToken token)
 | 
			
		||||
{
 | 
			
		||||
    if (token != kCGDisplayFadeReservationInvalidToken)
 | 
			
		||||
    {
 | 
			
		||||
        CGDisplayFade(token, 0.5,
 | 
			
		||||
                      kCGDisplayBlendSolidColor,
 | 
			
		||||
                      kCGDisplayBlendNormal,
 | 
			
		||||
                      0.0, 0.0, 0.0,
 | 
			
		||||
                      FALSE);
 | 
			
		||||
        CGReleaseDisplayFadeReservation(token);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Finds and caches the NSScreen corresponding to the specified monitor
 | 
			
		||||
//
 | 
			
		||||
GLFWbool refreshMonitorScreen(_GLFWmonitor* monitor)
 | 
			
		||||
{
 | 
			
		||||
    if (monitor->ns.screen)
 | 
			
		||||
        return GLFW_TRUE;
 | 
			
		||||
 | 
			
		||||
    for (NSScreen* screen in [NSScreen screens])
 | 
			
		||||
    {
 | 
			
		||||
        NSNumber* displayID = [screen deviceDescription][@"NSScreenNumber"];
 | 
			
		||||
 | 
			
		||||
        // HACK: Compare unit numbers instead of display IDs to work around
 | 
			
		||||
        //       display replacement on machines with automatic graphics
 | 
			
		||||
        //       switching
 | 
			
		||||
        if (monitor->ns.unitNumber == CGDisplayUnitNumber([displayID unsignedIntValue]))
 | 
			
		||||
        {
 | 
			
		||||
            monitor->ns.screen = screen;
 | 
			
		||||
            return GLFW_TRUE;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    _glfwInputError(GLFW_PLATFORM_ERROR, "Cocoa: Failed to find a screen for monitor");
 | 
			
		||||
    return GLFW_FALSE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
//////////////////////////////////////////////////////////////////////////
 | 
			
		||||
//////                       GLFW internal API                      //////
 | 
			
		||||
//////////////////////////////////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
// Poll for changes in the set of connected monitors
 | 
			
		||||
//
 | 
			
		||||
void _glfwPollMonitorsNS(void)
 | 
			
		||||
{
 | 
			
		||||
    uint32_t i, j, displayCount, disconnectedCount;
 | 
			
		||||
    CGDirectDisplayID* displays;
 | 
			
		||||
    _GLFWmonitor** disconnected = NULL;
 | 
			
		||||
 | 
			
		||||
    CGGetOnlineDisplayList(0, NULL, &displayCount);
 | 
			
		||||
    displays = calloc(displayCount, sizeof(CGDirectDisplayID));
 | 
			
		||||
    CGGetOnlineDisplayList(displayCount, displays, &displayCount);
 | 
			
		||||
 | 
			
		||||
    for (i = 0;  i < _glfw.monitorCount;  i++)
 | 
			
		||||
        _glfw.monitors[i]->ns.screen = nil;
 | 
			
		||||
 | 
			
		||||
    disconnectedCount = _glfw.monitorCount;
 | 
			
		||||
    if (disconnectedCount)
 | 
			
		||||
    {
 | 
			
		||||
        disconnected = calloc(_glfw.monitorCount, sizeof(_GLFWmonitor*));
 | 
			
		||||
        memcpy(disconnected,
 | 
			
		||||
               _glfw.monitors,
 | 
			
		||||
               _glfw.monitorCount * sizeof(_GLFWmonitor*));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    for (i = 0;  i < displayCount;  i++)
 | 
			
		||||
    {
 | 
			
		||||
        _GLFWmonitor* monitor;
 | 
			
		||||
        const uint32_t unitNumber = CGDisplayUnitNumber(displays[i]);
 | 
			
		||||
 | 
			
		||||
        if (CGDisplayIsAsleep(displays[i]))
 | 
			
		||||
            continue;
 | 
			
		||||
 | 
			
		||||
        for (j = 0;  j < disconnectedCount;  j++)
 | 
			
		||||
        {
 | 
			
		||||
            // HACK: Compare unit numbers instead of display IDs to work around
 | 
			
		||||
            //       display replacement on machines with automatic graphics
 | 
			
		||||
            //       switching
 | 
			
		||||
            if (disconnected[j] && disconnected[j]->ns.unitNumber == unitNumber)
 | 
			
		||||
            {
 | 
			
		||||
                disconnected[j] = NULL;
 | 
			
		||||
                break;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        const CGSize size = CGDisplayScreenSize(displays[i]);
 | 
			
		||||
        char* name = getDisplayName(displays[i]);
 | 
			
		||||
        if (!name)
 | 
			
		||||
            name = _glfw_strdup("Unknown");
 | 
			
		||||
 | 
			
		||||
        monitor = _glfwAllocMonitor(name, size.width, size.height);
 | 
			
		||||
        monitor->ns.displayID  = displays[i];
 | 
			
		||||
        monitor->ns.unitNumber = unitNumber;
 | 
			
		||||
 | 
			
		||||
        free(name);
 | 
			
		||||
 | 
			
		||||
        _glfwInputMonitor(monitor, GLFW_CONNECTED, _GLFW_INSERT_LAST);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    for (i = 0;  i < disconnectedCount;  i++)
 | 
			
		||||
    {
 | 
			
		||||
        if (disconnected[i])
 | 
			
		||||
            _glfwInputMonitor(disconnected[i], GLFW_DISCONNECTED, 0);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    free(disconnected);
 | 
			
		||||
    free(displays);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Change the current video mode
 | 
			
		||||
//
 | 
			
		||||
void _glfwSetVideoModeNS(_GLFWmonitor* monitor, const GLFWvidmode* desired)
 | 
			
		||||
{
 | 
			
		||||
    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;
 | 
			
		||||
 | 
			
		||||
    CVDisplayLinkCreateWithCGDisplay(monitor->ns.displayID, &link);
 | 
			
		||||
 | 
			
		||||
    modes = CGDisplayCopyAllDisplayModes(monitor->ns.displayID, NULL);
 | 
			
		||||
    count = CFArrayGetCount(modes);
 | 
			
		||||
 | 
			
		||||
    for (i = 0;  i < count;  i++)
 | 
			
		||||
    {
 | 
			
		||||
        CGDisplayModeRef dm = (CGDisplayModeRef) CFArrayGetValueAtIndex(modes, i);
 | 
			
		||||
        if (!modeIsGood(dm))
 | 
			
		||||
            continue;
 | 
			
		||||
 | 
			
		||||
        const GLFWvidmode mode = vidmodeFromCGDisplayMode(dm, link);
 | 
			
		||||
        if (_glfwCompareVideoModes(best, &mode) == 0)
 | 
			
		||||
        {
 | 
			
		||||
            native = dm;
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (native)
 | 
			
		||||
    {
 | 
			
		||||
        if (monitor->ns.previousMode == NULL)
 | 
			
		||||
            monitor->ns.previousMode = CGDisplayCopyDisplayMode(monitor->ns.displayID);
 | 
			
		||||
 | 
			
		||||
        CGDisplayFadeReservationToken token = beginFadeReservation();
 | 
			
		||||
        CGDisplaySetDisplayMode(monitor->ns.displayID, native, NULL);
 | 
			
		||||
        endFadeReservation(token);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    CFRelease(modes);
 | 
			
		||||
    CVDisplayLinkRelease(link);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Restore the previously saved (original) video mode
 | 
			
		||||
//
 | 
			
		||||
void _glfwRestoreVideoModeNS(_GLFWmonitor* monitor)
 | 
			
		||||
{
 | 
			
		||||
    if (monitor->ns.previousMode)
 | 
			
		||||
    {
 | 
			
		||||
        CGDisplayFadeReservationToken token = beginFadeReservation();
 | 
			
		||||
        CGDisplaySetDisplayMode(monitor->ns.displayID,
 | 
			
		||||
                                monitor->ns.previousMode, NULL);
 | 
			
		||||
        endFadeReservation(token);
 | 
			
		||||
 | 
			
		||||
        CGDisplayModeRelease(monitor->ns.previousMode);
 | 
			
		||||
        monitor->ns.previousMode = NULL;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
//////////////////////////////////////////////////////////////////////////
 | 
			
		||||
//////                       GLFW platform API                      //////
 | 
			
		||||
//////////////////////////////////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
void _glfwPlatformFreeMonitor(_GLFWmonitor* monitor)
 | 
			
		||||
{
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos)
 | 
			
		||||
{
 | 
			
		||||
    @autoreleasepool {
 | 
			
		||||
 | 
			
		||||
    const CGRect bounds = CGDisplayBounds(monitor->ns.displayID);
 | 
			
		||||
 | 
			
		||||
    if (xpos)
 | 
			
		||||
        *xpos = (int) bounds.origin.x;
 | 
			
		||||
    if (ypos)
 | 
			
		||||
        *ypos = (int) bounds.origin.y;
 | 
			
		||||
 | 
			
		||||
    } // autoreleasepool
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor,
 | 
			
		||||
                                         float* xscale, float* yscale)
 | 
			
		||||
{
 | 
			
		||||
    @autoreleasepool {
 | 
			
		||||
 | 
			
		||||
    if (!refreshMonitorScreen(monitor))
 | 
			
		||||
        return;
 | 
			
		||||
 | 
			
		||||
    const NSRect points = [monitor->ns.screen frame];
 | 
			
		||||
    const NSRect pixels = [monitor->ns.screen convertRectToBacking:points];
 | 
			
		||||
 | 
			
		||||
    if (xscale)
 | 
			
		||||
        *xscale = (float) (pixels.size.width / points.size.width);
 | 
			
		||||
    if (yscale)
 | 
			
		||||
        *yscale = (float) (pixels.size.height / points.size.height);
 | 
			
		||||
 | 
			
		||||
    } // autoreleasepool
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor,
 | 
			
		||||
                                     int* xpos, int* ypos,
 | 
			
		||||
                                     int* width, int* height)
 | 
			
		||||
{
 | 
			
		||||
    @autoreleasepool {
 | 
			
		||||
 | 
			
		||||
    if (!refreshMonitorScreen(monitor))
 | 
			
		||||
        return;
 | 
			
		||||
 | 
			
		||||
    const NSRect frameRect = [monitor->ns.screen visibleFrame];
 | 
			
		||||
 | 
			
		||||
    if (xpos)
 | 
			
		||||
        *xpos = frameRect.origin.x;
 | 
			
		||||
    if (ypos)
 | 
			
		||||
        *ypos = _glfwTransformYNS(frameRect.origin.y + frameRect.size.height - 1);
 | 
			
		||||
    if (width)
 | 
			
		||||
        *width = frameRect.size.width;
 | 
			
		||||
    if (height)
 | 
			
		||||
        *height = frameRect.size.height;
 | 
			
		||||
 | 
			
		||||
    } // autoreleasepool
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count)
 | 
			
		||||
{
 | 
			
		||||
    @autoreleasepool {
 | 
			
		||||
 | 
			
		||||
    CFArrayRef modes;
 | 
			
		||||
    CFIndex found, i, j;
 | 
			
		||||
    GLFWvidmode* result;
 | 
			
		||||
    CVDisplayLinkRef link;
 | 
			
		||||
 | 
			
		||||
    *count = 0;
 | 
			
		||||
 | 
			
		||||
    CVDisplayLinkCreateWithCGDisplay(monitor->ns.displayID, &link);
 | 
			
		||||
 | 
			
		||||
    modes = CGDisplayCopyAllDisplayModes(monitor->ns.displayID, NULL);
 | 
			
		||||
    found = CFArrayGetCount(modes);
 | 
			
		||||
    result = calloc(found, sizeof(GLFWvidmode));
 | 
			
		||||
 | 
			
		||||
    for (i = 0;  i < found;  i++)
 | 
			
		||||
    {
 | 
			
		||||
        CGDisplayModeRef dm = (CGDisplayModeRef) CFArrayGetValueAtIndex(modes, i);
 | 
			
		||||
        if (!modeIsGood(dm))
 | 
			
		||||
            continue;
 | 
			
		||||
 | 
			
		||||
        const GLFWvidmode mode = vidmodeFromCGDisplayMode(dm, link);
 | 
			
		||||
 | 
			
		||||
        for (j = 0;  j < *count;  j++)
 | 
			
		||||
        {
 | 
			
		||||
            if (_glfwCompareVideoModes(result + j, &mode) == 0)
 | 
			
		||||
                break;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Skip duplicate modes
 | 
			
		||||
        if (i < *count)
 | 
			
		||||
            continue;
 | 
			
		||||
 | 
			
		||||
        (*count)++;
 | 
			
		||||
        result[*count - 1] = mode;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    CFRelease(modes);
 | 
			
		||||
    CVDisplayLinkRelease(link);
 | 
			
		||||
    return result;
 | 
			
		||||
 | 
			
		||||
    } // autoreleasepool
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode *mode)
 | 
			
		||||
{
 | 
			
		||||
    @autoreleasepool {
 | 
			
		||||
 | 
			
		||||
    CGDisplayModeRef displayMode;
 | 
			
		||||
    CVDisplayLinkRef link;
 | 
			
		||||
 | 
			
		||||
    CVDisplayLinkCreateWithCGDisplay(monitor->ns.displayID, &link);
 | 
			
		||||
 | 
			
		||||
    displayMode = CGDisplayCopyDisplayMode(monitor->ns.displayID);
 | 
			
		||||
    *mode = vidmodeFromCGDisplayMode(displayMode, link);
 | 
			
		||||
    CGDisplayModeRelease(displayMode);
 | 
			
		||||
 | 
			
		||||
    CVDisplayLinkRelease(link);
 | 
			
		||||
 | 
			
		||||
    } // autoreleasepool
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
GLFWbool _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp)
 | 
			
		||||
{
 | 
			
		||||
    @autoreleasepool {
 | 
			
		||||
 | 
			
		||||
    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);
 | 
			
		||||
    return GLFW_TRUE;
 | 
			
		||||
 | 
			
		||||
    } // autoreleasepool
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp)
 | 
			
		||||
{
 | 
			
		||||
    @autoreleasepool {
 | 
			
		||||
 | 
			
		||||
    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);
 | 
			
		||||
 | 
			
		||||
    } // autoreleasepool
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
//////////////////////////////////////////////////////////////////////////
 | 
			
		||||
//////                        GLFW native API                       //////
 | 
			
		||||
//////////////////////////////////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
GLFWAPI CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* handle)
 | 
			
		||||
{
 | 
			
		||||
    _GLFWmonitor* monitor = (_GLFWmonitor*) handle;
 | 
			
		||||
    _GLFW_REQUIRE_INIT_OR_RETURN(kCGNullDirectDisplay);
 | 
			
		||||
    return monitor->ns.displayID;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user