├── .gitignore ├── README.md ├── task01-window ├── CMakeLists.txt ├── ReadMe!!!!!!!!!!!!!!!!!!!!!!!!!!!.txt ├── external │ ├── glad │ │ ├── include │ │ │ └── glad │ │ │ │ └── glad.h │ │ └── src │ │ │ └── glad.c │ └── glfw │ │ ├── .appveyor.yml │ │ ├── .travis.yml │ │ ├── CMake │ │ ├── GenerateMappings.cmake │ │ ├── MacOSXBundleInfo.plist.in │ │ ├── amd64-mingw32msvc.cmake │ │ ├── i586-mingw32msvc.cmake │ │ ├── i686-pc-mingw32.cmake │ │ ├── i686-w64-mingw32.cmake │ │ ├── modules │ │ │ ├── FindMir.cmake │ │ │ ├── FindOSMesa.cmake │ │ │ ├── FindVulkan.cmake │ │ │ ├── FindWaylandProtocols.cmake │ │ │ └── FindXKBCommon.cmake │ │ └── x86_64-w64-mingw32.cmake │ │ ├── CMakeLists.txt │ │ ├── cmake_uninstall.cmake.in │ │ ├── deps │ │ ├── KHR │ │ │ └── khrplatform.h │ │ ├── getopt.c │ │ ├── getopt.h │ │ ├── glad.c │ │ ├── glad │ │ │ └── glad.h │ │ ├── linmath.h │ │ ├── mingw │ │ │ ├── _mingw_dxhelper.h │ │ │ ├── dinput.h │ │ │ └── xinput.h │ │ ├── nuklear.h │ │ ├── nuklear_glfw_gl2.h │ │ ├── stb_image_write.h │ │ ├── tinycthread.c │ │ ├── tinycthread.h │ │ ├── vs2008 │ │ │ └── stdint.h │ │ └── vulkan │ │ │ ├── vk_platform.h │ │ │ └── vulkan.h │ │ ├── include │ │ └── GLFW │ │ │ ├── glfw3.h │ │ │ └── glfw3native.h │ │ └── src │ │ ├── CMakeLists.txt │ │ ├── cocoa_init.m │ │ ├── cocoa_joystick.h │ │ ├── cocoa_joystick.m │ │ ├── cocoa_monitor.m │ │ ├── cocoa_platform.h │ │ ├── cocoa_time.c │ │ ├── cocoa_window.m │ │ ├── context.c │ │ ├── egl_context.c │ │ ├── egl_context.h │ │ ├── glfw3.pc.in │ │ ├── glfw3Config.cmake.in │ │ ├── glfw_config.h.in │ │ ├── glx_context.c │ │ ├── glx_context.h │ │ ├── init.c │ │ ├── input.c │ │ ├── internal.h │ │ ├── linux_joystick.c │ │ ├── linux_joystick.h │ │ ├── mappings.h │ │ ├── mappings.h.in │ │ ├── mir_init.c │ │ ├── mir_monitor.c │ │ ├── mir_platform.h │ │ ├── mir_window.c │ │ ├── monitor.c │ │ ├── nsgl_context.h │ │ ├── nsgl_context.m │ │ ├── null_init.c │ │ ├── null_joystick.c │ │ ├── null_joystick.h │ │ ├── null_monitor.c │ │ ├── null_platform.h │ │ ├── null_window.c │ │ ├── osmesa_context.c │ │ ├── osmesa_context.h │ │ ├── posix_thread.c │ │ ├── posix_thread.h │ │ ├── posix_time.c │ │ ├── posix_time.h │ │ ├── vulkan.c │ │ ├── wgl_context.c │ │ ├── wgl_context.h │ │ ├── win32_init.c │ │ ├── win32_joystick.c │ │ ├── win32_joystick.h │ │ ├── win32_monitor.c │ │ ├── win32_platform.h │ │ ├── win32_thread.c │ │ ├── win32_time.c │ │ ├── win32_window.c │ │ ├── window.c │ │ ├── wl_init.c │ │ ├── wl_monitor.c │ │ ├── wl_platform.h │ │ ├── wl_window.c │ │ ├── x11_init.c │ │ ├── x11_monitor.c │ │ ├── x11_platform.h │ │ ├── x11_window.c │ │ ├── xkb_unicode.c │ │ └── xkb_unicode.h └── src │ └── main.cpp └── task02-triangle ├── CMakeLists.txt ├── external ├── glad │ ├── include │ │ └── glad │ │ │ └── glad.h │ └── src │ │ └── glad.c └── glfw │ ├── .appveyor.yml │ ├── .travis.yml │ ├── CMake │ ├── GenerateMappings.cmake │ ├── MacOSXBundleInfo.plist.in │ ├── amd64-mingw32msvc.cmake │ ├── i586-mingw32msvc.cmake │ ├── i686-pc-mingw32.cmake │ ├── i686-w64-mingw32.cmake │ ├── modules │ │ ├── FindMir.cmake │ │ ├── FindOSMesa.cmake │ │ ├── FindVulkan.cmake │ │ ├── FindWaylandProtocols.cmake │ │ └── FindXKBCommon.cmake │ └── x86_64-w64-mingw32.cmake │ ├── CMakeLists.txt │ ├── cmake_uninstall.cmake.in │ ├── deps │ ├── KHR │ │ └── khrplatform.h │ ├── getopt.c │ ├── getopt.h │ ├── glad.c │ ├── glad │ │ └── glad.h │ ├── linmath.h │ ├── mingw │ │ ├── _mingw_dxhelper.h │ │ ├── dinput.h │ │ └── xinput.h │ ├── nuklear.h │ ├── nuklear_glfw_gl2.h │ ├── stb_image_write.h │ ├── tinycthread.c │ ├── tinycthread.h │ ├── vs2008 │ │ └── stdint.h │ └── vulkan │ │ ├── vk_platform.h │ │ └── vulkan.h │ ├── include │ └── GLFW │ │ ├── glfw3.h │ │ └── glfw3native.h │ └── src │ ├── CMakeLists.txt │ ├── cocoa_init.m │ ├── cocoa_joystick.h │ ├── cocoa_joystick.m │ ├── cocoa_monitor.m │ ├── cocoa_platform.h │ ├── cocoa_time.c │ ├── cocoa_window.m │ ├── context.c │ ├── egl_context.c │ ├── egl_context.h │ ├── glfw3.pc.in │ ├── glfw3Config.cmake.in │ ├── glfw_config.h.in │ ├── glx_context.c │ ├── glx_context.h │ ├── init.c │ ├── input.c │ ├── internal.h │ ├── linux_joystick.c │ ├── linux_joystick.h │ ├── mappings.h │ ├── mappings.h.in │ ├── mir_init.c │ ├── mir_monitor.c │ ├── mir_platform.h │ ├── mir_window.c │ ├── monitor.c │ ├── nsgl_context.h │ ├── nsgl_context.m │ ├── null_init.c │ ├── null_joystick.c │ ├── null_joystick.h │ ├── null_monitor.c │ ├── null_platform.h │ ├── null_window.c │ ├── osmesa_context.c │ ├── osmesa_context.h │ ├── posix_thread.c │ ├── posix_thread.h │ ├── posix_time.c │ ├── posix_time.h │ ├── vulkan.c │ ├── wgl_context.c │ ├── wgl_context.h │ ├── win32_init.c │ ├── win32_joystick.c │ ├── win32_joystick.h │ ├── win32_monitor.c │ ├── win32_platform.h │ ├── win32_thread.c │ ├── win32_time.c │ ├── win32_window.c │ ├── window.c │ ├── wl_init.c │ ├── wl_monitor.c │ ├── wl_platform.h │ ├── wl_window.c │ ├── x11_init.c │ ├── x11_monitor.c │ ├── x11_platform.h │ ├── x11_window.c │ ├── xkb_unicode.c │ └── xkb_unicode.h └── src └── main.cpp /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | .DS_Store 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # MSTest test Results 33 | [Tt]est[Rr]esult*/ 34 | [Bb]uild[Ll]og.* 35 | 36 | # NUNIT 37 | *.VisualState.xml 38 | TestResult.xml 39 | 40 | # Build Results of an ATL Project 41 | [Dd]ebugPS/ 42 | [Rr]eleasePS/ 43 | dlldata.c 44 | 45 | # DNX 46 | project.lock.json 47 | project.fragment.lock.json 48 | artifacts/ 49 | 50 | *_i.c 51 | *_p.c 52 | *_i.h 53 | *.ilk 54 | *.meta 55 | *.pch 56 | *.pdb 57 | *.pgc 58 | *.pgd 59 | *.rsp 60 | *.sbr 61 | *.tlb 62 | *.tli 63 | *.tlh 64 | *.tmp 65 | *.tmp_proj 66 | *.log 67 | *.vspscc 68 | *.vssscc 69 | .builds 70 | *.pidb 71 | *.svclog 72 | *.scc 73 | 74 | # Chutzpah Test files 75 | _Chutzpah* 76 | 77 | # Visual C++ cache files 78 | ipch/ 79 | *.aps 80 | *.ncb 81 | *.opendb 82 | *.opensdf 83 | *.sdf 84 | *.cachefile 85 | *.VC.db 86 | *.VC.VC.opendb 87 | 88 | # Visual Studio profiler 89 | *.psess 90 | *.vsp 91 | *.vspx 92 | *.sap 93 | 94 | # TFS 2012 Local Workspace 95 | $tf/ 96 | 97 | # Guidance Automation Toolkit 98 | *.gpState 99 | 100 | # ReSharper is a .NET coding add-in 101 | _ReSharper*/ 102 | *.[Rr]e[Ss]harper 103 | *.DotSettings.user 104 | 105 | # JustCode is a .NET coding add-in 106 | .JustCode 107 | 108 | # TeamCity is a build add-in 109 | _TeamCity* 110 | 111 | # DotCover is a Code Coverage Tool 112 | *.dotCover 113 | 114 | # NCrunch 115 | _NCrunch_* 116 | .*crunch*.local.xml 117 | nCrunchTemp_* 118 | 119 | # MightyMoose 120 | *.mm.* 121 | AutoTest.Net/ 122 | 123 | # Web workbench (sass) 124 | .sass-cache/ 125 | 126 | # Installshield output folder 127 | [Ee]xpress/ 128 | 129 | # DocProject is a documentation generator add-in 130 | DocProject/buildhelp/ 131 | DocProject/Help/*.HxT 132 | DocProject/Help/*.HxC 133 | DocProject/Help/*.hhc 134 | DocProject/Help/*.hhk 135 | DocProject/Help/*.hhp 136 | DocProject/Help/Html2 137 | DocProject/Help/html 138 | 139 | # Click-Once directory 140 | publish/ 141 | 142 | # Publish Web Output 143 | *.[Pp]ublish.xml 144 | *.azurePubxml 145 | # TODO: Comment the next line if you want to checkin your web deploy settings 146 | # but database connection strings (with potential passwords) will be unencrypted 147 | #*.pubxml 148 | *.publishproj 149 | 150 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 151 | # checkin your Azure Web App publish settings, but sensitive information contained 152 | # in these scripts will be unencrypted 153 | PublishScripts/ 154 | 155 | # NuGet Packages 156 | *.nupkg 157 | # The packages folder can be ignored because of Package Restore 158 | **/packages/* 159 | # except build/, which is used as an MSBuild target. 160 | !**/packages/build/ 161 | # Uncomment if necessary however generally it will be regenerated when needed 162 | #!**/packages/repositories.config 163 | # NuGet v3's project.json files produces more ignoreable files 164 | *.nuget.props 165 | *.nuget.targets 166 | 167 | # Microsoft Azure Build Output 168 | csx/ 169 | *.build.csdef 170 | 171 | # Microsoft Azure Emulator 172 | ecf/ 173 | rcf/ 174 | 175 | # Windows Store app package directories and files 176 | AppPackages/ 177 | BundleArtifacts/ 178 | Package.StoreAssociation.xml 179 | _pkginfo.txt 180 | 181 | # Visual Studio cache files 182 | # files ending in .cache can be ignored 183 | *.[Cc]ache 184 | # but keep track of directories ending in .cache 185 | !*.[Cc]ache/ 186 | 187 | # Others 188 | ClientBin/ 189 | ~$* 190 | *~ 191 | *.dbmdl 192 | *.dbproj.schemaview 193 | *.jfm 194 | *.pfx 195 | *.publishsettings 196 | node_modules/ 197 | orleans.codegen.cs 198 | 199 | # Since there are multiple workflows, uncomment next line to ignore bower_components 200 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 201 | #bower_components/ 202 | 203 | # RIA/Silverlight projects 204 | Generated_Code/ 205 | 206 | # Backup & report files from converting an old project file 207 | # to a newer Visual Studio version. Backup files are not needed, 208 | # because we have git ;-) 209 | _UpgradeReport_Files/ 210 | Backup*/ 211 | UpgradeLog*.XML 212 | UpgradeLog*.htm 213 | 214 | # SQL Server files 215 | *.mdf 216 | *.ldf 217 | 218 | # Business Intelligence projects 219 | *.rdl.data 220 | *.bim.layout 221 | *.bim_*.settings 222 | 223 | # Microsoft Fakes 224 | FakesAssemblies/ 225 | 226 | # GhostDoc plugin setting file 227 | *.GhostDoc.xml 228 | 229 | # Node.js Tools for Visual Studio 230 | .ntvs_analysis.dat 231 | 232 | # Visual Studio 6 build log 233 | *.plg 234 | 235 | # Visual Studio 6 workspace options file 236 | *.opt 237 | 238 | # Visual Studio LightSwitch build output 239 | **/*.HTMLClient/GeneratedArtifacts 240 | **/*.DesktopClient/GeneratedArtifacts 241 | **/*.DesktopClient/ModelManifest.xml 242 | **/*.Server/GeneratedArtifacts 243 | **/*.Server/ModelManifest.xml 244 | _Pvt_Extensions 245 | 246 | # Paket dependency manager 247 | .paket/paket.exe 248 | paket-files/ 249 | 250 | # FAKE - F# Make 251 | .fake/ 252 | 253 | # JetBrains Rider 254 | .idea/ 255 | *.sln.iml 256 | 257 | # CodeRush 258 | .cr/ 259 | 260 | # Python Tools for Visual Studio (PTVS) 261 | __pycache__/ 262 | *.pyc -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 计算机图形学配套实验 2 | ![](https://img.shields.io/badge/release-v1.0-yellowgreen.svg) ![](https://img.shields.io/badge/platform-windows-brightgreen.svg) ![](https://img.shields.io/badge/build-cmake-blue.svg) 3 | 4 | ### 原课程链接 5 | [中国大学Mooc视频课程--计算机图形学[万琳]](http://163.lu/klf3s0) 6 | 7 | ### 目前上线实验 8 | * 实验一:绘制窗体 9 | * 实验二:绘制三角形 10 | * 未完待续... 11 | 12 | ### 计算机图形学课程及实验勘误 13 | >各位同学,如果您在学习过程中发现任何错误,包括慕课的课程中或是实验中,例如某个重要概念的理解及描述错误等,请至本项目下提交一个Issues,您的反馈可能会对计算机图形学课程的质量有着较大帮助。非常感谢您的宝贵时间及支持! 14 | --- 15 | **Enjoy~** 16 | -------------------------------------------------------------------------------- /task01-window/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.0) 2 | 3 | project(Task-window) 4 | 5 | set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) 6 | set(CMAKE_SUPPRESS_REGENERATION ON) 7 | 8 | option(GLFW_BUILD_DOCS OFF) 9 | option(GLFW_BUILD_EXAMPLES OFF) 10 | option(GLFW_BUILD_TESTS OFF) 11 | option(GLFW_INSTALL OFF) 12 | add_subdirectory(external/glfw) 13 | 14 | if(MSVC) 15 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") 16 | else() 17 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -std=c++11") 18 | if(NOT WIN32) 19 | set(GLAD_LIBRARIES dl) 20 | endif() 21 | endif() 22 | 23 | include_directories(include/ 24 | external/glad/include/ 25 | external/glfw/include/ 26 | external/stb) 27 | 28 | file(GLOB EXTERNAL_SOURCES external/glad/src/glad.c 29 | external/stb/stb_image.cpp) 30 | file(GLOB PROJECT_HEADERS include/*.h) 31 | file(GLOB PROJECT_SOURCES src/*.cpp) 32 | 33 | source_group("Headers" FILES ${PROJECT_HEADERS}) 34 | source_group("Sources" FILES ${PROJECT_SOURCES}) 35 | source_group("Externals" FILES ${EXTERNAL_SOURCES}) 36 | 37 | add_definitions(-DGLFW_INCLUDE_NONE 38 | -DPROJECT_SOURCE_DIR=\"${PROJECT_SOURCE_DIR}\") 39 | add_executable(${PROJECT_NAME} ${PROJECT_SOURCES} ${PROJECT_HEADERS} 40 | ${EXTERNAL_SOURCES}) 41 | 42 | target_link_libraries(${PROJECT_NAME} glfw 43 | ${GLFW_LIBRARIES} ${GLAD_LIBRARIES}) 44 | set_target_properties(${PROJECT_NAME} PROPERTIES 45 | RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/${PROJECT_NAME}_Debug 46 | RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/${PROJECT_NAME}_Release) 47 | if(MSVC) 48 | set_target_properties(${PROJECT_NAME} PROPERTIES 49 | VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) 50 | endif() -------------------------------------------------------------------------------- /task01-window/ReadMe!!!!!!!!!!!!!!!!!!!!!!!!!!!.txt: -------------------------------------------------------------------------------- 1 | 请用CMake工具打开该工程,具体方法是: 2 | 1- 在该文件夹内新建一个build文件夹。 3 | 2- 在cmake的源码路径处填入该文件夹的路径。 4 | 3- 在cmake的编译输出路径处填入build的路径。 5 | 4- 同编译GLFW的方法一样,configure两次再generate(注意选择适合自己的IDE版本) 6 | 5- 打开build中编译好的文件,即可。(如,选择VS则打开*.sln) 7 | note: 8 | 编译目录不要有特殊字符。 -------------------------------------------------------------------------------- /task01-window/external/glfw/.appveyor.yml: -------------------------------------------------------------------------------- 1 | branches: 2 | only: 3 | - ci 4 | - master 5 | skip_tags: true 6 | environment: 7 | CFLAGS: /WX 8 | matrix: 9 | - BUILD_SHARED_LIBS: ON 10 | - BUILD_SHARED_LIBS: OFF 11 | matrix: 12 | fast_finish: true 13 | build_script: 14 | - mkdir build 15 | - cd build 16 | - cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_SHARED_LIBS=%BUILD_SHARED_LIBS% .. 17 | - cmake --build . 18 | notifications: 19 | - provider: Email 20 | to: 21 | - ci@glfw.org 22 | on_build_failure: true 23 | on_build_success: false 24 | -------------------------------------------------------------------------------- /task01-window/external/glfw/.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | compiler: clang 3 | branches: 4 | only: 5 | - ci 6 | - master 7 | sudo: false 8 | dist: trusty 9 | addons: 10 | apt: 11 | packages: 12 | - cmake 13 | - libxrandr-dev 14 | - libxinerama-dev 15 | - libxcursor-dev 16 | - libxi-dev 17 | matrix: 18 | include: 19 | - os: linux 20 | env: 21 | - BUILD_SHARED_LIBS=ON 22 | - CFLAGS=-Werror 23 | - os: linux 24 | env: 25 | - BUILD_SHARED_LIBS=OFF 26 | - CFLAGS=-Werror 27 | - os: linux 28 | sudo: required 29 | addons: 30 | apt: 31 | packages: 32 | - libwayland-dev 33 | - libxkbcommon-dev 34 | - libegl1-mesa-dev 35 | env: 36 | - USE_WAYLAND=ON 37 | - BUILD_SHARED_LIBS=ON 38 | - CFLAGS=-Werror 39 | - os: linux 40 | sudo: required 41 | addons: 42 | apt: 43 | packages: 44 | - libwayland-dev 45 | - libxkbcommon-dev 46 | - libegl1-mesa-dev 47 | env: 48 | - USE_WAYLAND=ON 49 | - BUILD_SHARED_LIBS=OFF 50 | - CFLAGS=-Werror 51 | - os: osx 52 | env: 53 | - BUILD_SHARED_LIBS=ON 54 | - CFLAGS=-Werror 55 | - os: osx 56 | env: 57 | - BUILD_SHARED_LIBS=OFF 58 | - CFLAGS=-Werror 59 | script: 60 | - if grep -Inr '\s$' src include docs tests examples CMake *.md .gitattributes .gitignore; then echo Trailing whitespace found, aborting.; exit 1; fi 61 | - mkdir build 62 | - cd build 63 | - if test -n "${USE_WAYLAND}"; 64 | then wget https://mirrors.kernel.org/ubuntu/pool/universe/e/extra-cmake-modules/extra-cmake-modules_5.38.0a-0ubuntu1_amd64.deb; 65 | sudo dpkg -i extra-cmake-modules_5.38.0a-0ubuntu1_amd64.deb; 66 | git clone git://anongit.freedesktop.org/wayland/wayland-protocols; 67 | pushd wayland-protocols; 68 | git checkout 1.12 && ./autogen.sh --prefix=/usr && make && sudo make install; 69 | popd; 70 | fi 71 | - cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} -DGLFW_USE_WAYLAND=${USE_WAYLAND} .. 72 | - cmake --build . 73 | notifications: 74 | email: 75 | recipients: 76 | - ci@glfw.org 77 | on_success: never 78 | on_failure: always 79 | -------------------------------------------------------------------------------- /task01-window/external/glfw/CMake/GenerateMappings.cmake: -------------------------------------------------------------------------------- 1 | # Usage: 2 | # cmake -P GenerateMappings.cmake 3 | 4 | set(source_url "https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt") 5 | set(source_path "${CMAKE_CURRENT_BINARY_DIR}/gamecontrollerdb.txt") 6 | set(template_path "${CMAKE_ARGV3}") 7 | set(target_path "${CMAKE_ARGV4}") 8 | 9 | if (NOT EXISTS "${template_path}") 10 | message(FATAL_ERROR "Failed to find template file ${template_path}") 11 | endif() 12 | 13 | file(DOWNLOAD "${source_url}" "${source_path}" 14 | STATUS download_status 15 | TLS_VERIFY on) 16 | 17 | list(GET download_status 0 status_code) 18 | list(GET download_status 1 status_message) 19 | 20 | if (status_code) 21 | message(FATAL_ERROR "Failed to download ${source_url}: ${status_message}") 22 | endif() 23 | 24 | file(STRINGS "${source_path}" lines) 25 | foreach(line ${lines}) 26 | if ("${line}" MATCHES "^[0-9a-fA-F].*$") 27 | set(GLFW_GAMEPAD_MAPPINGS "${GLFW_GAMEPAD_MAPPINGS}\"${line}\",\n") 28 | endif() 29 | endforeach() 30 | 31 | configure_file("${template_path}" "${target_path}" @ONLY NEWLINE_STYLE UNIX) 32 | file(REMOVE "${source_path}") 33 | 34 | -------------------------------------------------------------------------------- /task01-window/external/glfw/CMake/MacOSXBundleInfo.plist.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${MACOSX_BUNDLE_EXECUTABLE_NAME} 9 | CFBundleGetInfoString 10 | ${MACOSX_BUNDLE_INFO_STRING} 11 | CFBundleIconFile 12 | ${MACOSX_BUNDLE_ICON_FILE} 13 | CFBundleIdentifier 14 | ${MACOSX_BUNDLE_GUI_IDENTIFIER} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleLongVersionString 18 | ${MACOSX_BUNDLE_LONG_VERSION_STRING} 19 | CFBundleName 20 | ${MACOSX_BUNDLE_BUNDLE_NAME} 21 | CFBundlePackageType 22 | APPL 23 | CFBundleShortVersionString 24 | ${MACOSX_BUNDLE_SHORT_VERSION_STRING} 25 | CFBundleSignature 26 | ???? 27 | CFBundleVersion 28 | ${MACOSX_BUNDLE_BUNDLE_VERSION} 29 | CSResourcesFileMapped 30 | 31 | LSRequiresCarbon 32 | 33 | NSHumanReadableCopyright 34 | ${MACOSX_BUNDLE_COPYRIGHT} 35 | NSHighResolutionCapable 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /task01-window/external/glfw/CMake/amd64-mingw32msvc.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross compiling from Linux to Win64 2 | SET(CMAKE_SYSTEM_NAME Windows) 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "amd64-mingw32msvc-gcc") 5 | SET(CMAKE_CXX_COMPILER "amd64-mingw32msvc-g++") 6 | SET(CMAKE_RC_COMPILER "amd64-mingw32msvc-windres") 7 | SET(CMAKE_RANLIB "amd64-mingw32msvc-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/amd64-mingw32msvc") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /task01-window/external/glfw/CMake/i586-mingw32msvc.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross compiling from Linux to Win32 2 | SET(CMAKE_SYSTEM_NAME Windows) 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "i586-mingw32msvc-gcc") 5 | SET(CMAKE_CXX_COMPILER "i586-mingw32msvc-g++") 6 | SET(CMAKE_RC_COMPILER "i586-mingw32msvc-windres") 7 | SET(CMAKE_RANLIB "i586-mingw32msvc-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/i586-mingw32msvc") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /task01-window/external/glfw/CMake/i686-pc-mingw32.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross compiling from Linux to Win32 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "i686-pc-mingw32-gcc") 5 | SET(CMAKE_CXX_COMPILER "i686-pc-mingw32-g++") 6 | SET(CMAKE_RC_COMPILER "i686-pc-mingw32-windres") 7 | SET(CMAKE_RANLIB "i686-pc-mingw32-ranlib") 8 | 9 | #Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/opt/mingw/usr/i686-pc-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /task01-window/external/glfw/CMake/i686-w64-mingw32.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross compiling from Linux to Win32 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "i686-w64-mingw32-gcc") 5 | SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-g++") 6 | SET(CMAKE_RC_COMPILER "i686-w64-mingw32-windres") 7 | SET(CMAKE_RANLIB "i686-w64-mingw32-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /task01-window/external/glfw/CMake/modules/FindMir.cmake: -------------------------------------------------------------------------------- 1 | # FindMir 2 | # ------- 3 | # Finds the Mir library 4 | # 5 | # This will will define the following variables:: 6 | # 7 | # MIR_FOUND - the system has Mir 8 | # MIR_INCLUDE_DIRS - the Mir include directory 9 | # MIR_LIBRARIES - the Mir libraries 10 | # MIR_DEFINITIONS - the Mir definitions 11 | 12 | 13 | find_package (PkgConfig) 14 | if(PKG_CONFIG_FOUND) 15 | pkg_check_modules (PC_MIR mirclient>=0.26.2 QUIET) 16 | 17 | find_path(MIR_INCLUDE_DIR NAMES mir_toolkit/mir_client_library.h 18 | PATHS ${PC_MIR_INCLUDE_DIRS}) 19 | 20 | find_library(MIR_LIBRARY NAMES mirclient 21 | PATHS ${PC_MIR_LIBRARIES} ${PC_MIR_LIBRARY_DIRS}) 22 | 23 | include (FindPackageHandleStandardArgs) 24 | find_package_handle_standard_args (MIR 25 | REQUIRED_VARS MIR_LIBRARY MIR_INCLUDE_DIR) 26 | 27 | if (MIR_FOUND) 28 | set(MIR_LIBRARIES ${MIR_LIBRARY}) 29 | set(MIR_INCLUDE_DIRS ${PC_MIR_INCLUDE_DIRS}) 30 | set(MIR_DEFINITIONS -DHAVE_MIR=1) 31 | endif() 32 | 33 | mark_as_advanced (MIR_LIBRARY MIR_INCLUDE_DIR) 34 | endif() 35 | -------------------------------------------------------------------------------- /task01-window/external/glfw/CMake/modules/FindOSMesa.cmake: -------------------------------------------------------------------------------- 1 | # Try to find OSMesa on a Unix system 2 | # 3 | # This will define: 4 | # 5 | # OSMESA_LIBRARIES - Link these to use OSMesa 6 | # OSMESA_INCLUDE_DIR - Include directory for OSMesa 7 | # 8 | # Copyright (c) 2014 Brandon Schaefer 9 | 10 | if (NOT WIN32) 11 | 12 | find_package (PkgConfig) 13 | pkg_check_modules (PKG_OSMESA QUIET osmesa) 14 | 15 | set (OSMESA_INCLUDE_DIR ${PKG_OSMESA_INCLUDE_DIRS}) 16 | set (OSMESA_LIBRARIES ${PKG_OSMESA_LIBRARIES}) 17 | 18 | endif () 19 | -------------------------------------------------------------------------------- /task01-window/external/glfw/CMake/modules/FindVulkan.cmake: -------------------------------------------------------------------------------- 1 | # Find Vulkan 2 | # 3 | # VULKAN_INCLUDE_DIR 4 | # VULKAN_LIBRARY 5 | # VULKAN_FOUND 6 | 7 | if (WIN32) 8 | find_path(VULKAN_INCLUDE_DIR NAMES vulkan/vulkan.h HINTS 9 | "$ENV{VULKAN_SDK}/Include" 10 | "$ENV{VK_SDK_PATH}/Include") 11 | if (CMAKE_SIZEOF_VOID_P EQUAL 8) 12 | find_library(VULKAN_LIBRARY NAMES vulkan-1 HINTS 13 | "$ENV{VULKAN_SDK}/Lib" 14 | "$ENV{VULKAN_SDK}/Bin" 15 | "$ENV{VK_SDK_PATH}/Bin") 16 | find_library(VULKAN_STATIC_LIBRARY NAMES vkstatic.1 HINTS 17 | "$ENV{VULKAN_SDK}/Lib" 18 | "$ENV{VULKAN_SDK}/Bin" 19 | "$ENV{VK_SDK_PATH}/Bin") 20 | else() 21 | find_library(VULKAN_LIBRARY NAMES vulkan-1 HINTS 22 | "$ENV{VULKAN_SDK}/Lib32" 23 | "$ENV{VULKAN_SDK}/Bin32" 24 | "$ENV{VK_SDK_PATH}/Bin32") 25 | find_library(VULKAN_STATIC_LIBRARY NAMES vkstatic.1 HINTS 26 | "$ENV{VULKAN_SDK}/Lib32" 27 | "$ENV{VULKAN_SDK}/Bin32" 28 | "$ENV{VK_SDK_PATH}/Bin32") 29 | endif() 30 | elseif (APPLE) 31 | find_library(VULKAN_LIBRARY vulkan.1 HINTS 32 | "$ENV{VULKAN_SDK}/macOS/lib") 33 | find_path(VULKAN_INCLUDE_DIR NAMES vulkan/vulkan.h HINTS 34 | "$ENV{VULKAN_SDK}/macOS/include") 35 | else() 36 | find_path(VULKAN_INCLUDE_DIR NAMES vulkan/vulkan.h HINTS 37 | "$ENV{VULKAN_SDK}/include") 38 | find_library(VULKAN_LIBRARY NAMES vulkan HINTS 39 | "$ENV{VULKAN_SDK}/lib") 40 | endif() 41 | 42 | include(FindPackageHandleStandardArgs) 43 | find_package_handle_standard_args(Vulkan DEFAULT_MSG VULKAN_LIBRARY VULKAN_INCLUDE_DIR) 44 | 45 | mark_as_advanced(VULKAN_INCLUDE_DIR VULKAN_LIBRARY VULKAN_STATIC_LIBRARY) 46 | 47 | -------------------------------------------------------------------------------- /task01-window/external/glfw/CMake/modules/FindWaylandProtocols.cmake: -------------------------------------------------------------------------------- 1 | find_package(PkgConfig) 2 | 3 | pkg_check_modules(WaylandProtocols QUIET wayland-protocols>=${WaylandProtocols_FIND_VERSION}) 4 | 5 | execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir wayland-protocols 6 | OUTPUT_VARIABLE WaylandProtocols_PKGDATADIR 7 | RESULT_VARIABLE _pkgconfig_failed) 8 | if (_pkgconfig_failed) 9 | message(FATAL_ERROR "Missing wayland-protocols pkgdatadir") 10 | endif() 11 | 12 | string(REGEX REPLACE "[\r\n]" "" WaylandProtocols_PKGDATADIR "${WaylandProtocols_PKGDATADIR}") 13 | 14 | find_package_handle_standard_args(WaylandProtocols 15 | FOUND_VAR 16 | WaylandProtocols_FOUND 17 | REQUIRED_VARS 18 | WaylandProtocols_PKGDATADIR 19 | VERSION_VAR 20 | WaylandProtocols_VERSION 21 | HANDLE_COMPONENTS 22 | ) 23 | 24 | set(WAYLAND_PROTOCOLS_FOUND ${WaylandProtocols_FOUND}) 25 | set(WAYLAND_PROTOCOLS_PKGDATADIR ${WaylandProtocols_PKGDATADIR}) 26 | set(WAYLAND_PROTOCOLS_VERSION ${WaylandProtocols_VERSION}) 27 | -------------------------------------------------------------------------------- /task01-window/external/glfw/CMake/modules/FindXKBCommon.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find XKBCommon 2 | # Once done, this will define 3 | # 4 | # XKBCOMMON_FOUND - System has XKBCommon 5 | # XKBCOMMON_INCLUDE_DIRS - The XKBCommon include directories 6 | # XKBCOMMON_LIBRARIES - The libraries needed to use XKBCommon 7 | # XKBCOMMON_DEFINITIONS - Compiler switches required for using XKBCommon 8 | 9 | find_package(PkgConfig) 10 | pkg_check_modules(PC_XKBCOMMON QUIET xkbcommon) 11 | set(XKBCOMMON_DEFINITIONS ${PC_XKBCOMMON_CFLAGS_OTHER}) 12 | 13 | find_path(XKBCOMMON_INCLUDE_DIR 14 | NAMES xkbcommon/xkbcommon.h 15 | HINTS ${PC_XKBCOMMON_INCLUDE_DIR} ${PC_XKBCOMMON_INCLUDE_DIRS} 16 | ) 17 | 18 | find_library(XKBCOMMON_LIBRARY 19 | NAMES xkbcommon 20 | HINTS ${PC_XKBCOMMON_LIBRARY} ${PC_XKBCOMMON_LIBRARY_DIRS} 21 | ) 22 | 23 | set(XKBCOMMON_LIBRARIES ${XKBCOMMON_LIBRARY}) 24 | set(XKBCOMMON_LIBRARY_DIRS ${XKBCOMMON_LIBRARY_DIRS}) 25 | set(XKBCOMMON_INCLUDE_DIRS ${XKBCOMMON_INCLUDE_DIR}) 26 | 27 | include(FindPackageHandleStandardArgs) 28 | find_package_handle_standard_args(XKBCommon DEFAULT_MSG 29 | XKBCOMMON_LIBRARY 30 | XKBCOMMON_INCLUDE_DIR 31 | ) 32 | 33 | mark_as_advanced(XKBCOMMON_LIBRARY XKBCOMMON_INCLUDE_DIR) 34 | 35 | -------------------------------------------------------------------------------- /task01-window/external/glfw/CMake/x86_64-w64-mingw32.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross compiling from Linux to Win32 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-gcc") 5 | SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-g++") 6 | SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres") 7 | SET(CMAKE_RANLIB "x86_64-w64-mingw32-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /task01-window/external/glfw/cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | 2 | if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 3 | message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") 4 | endif() 5 | 6 | file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 7 | string(REGEX REPLACE "\n" ";" files "${files}") 8 | 9 | foreach (file ${files}) 10 | message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") 11 | if (EXISTS "$ENV{DESTDIR}${file}") 12 | exec_program("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 13 | OUTPUT_VARIABLE rm_out 14 | RETURN_VALUE rm_retval) 15 | if (NOT "${rm_retval}" STREQUAL 0) 16 | MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 17 | endif() 18 | elseif (IS_SYMLINK "$ENV{DESTDIR}${file}") 19 | EXEC_PROGRAM("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 20 | OUTPUT_VARIABLE rm_out 21 | RETURN_VALUE rm_retval) 22 | if (NOT "${rm_retval}" STREQUAL 0) 23 | message(FATAL_ERROR "Problem when removing symlink \"$ENV{DESTDIR}${file}\"") 24 | endif() 25 | else() 26 | message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") 27 | endif() 28 | endforeach() 29 | 30 | -------------------------------------------------------------------------------- /task01-window/external/glfw/deps/getopt.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, Kim Gräsman 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * * Redistributions of source code must retain the above copyright notice, 7 | * this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above copyright notice, 9 | * this list of conditions and the following disclaimer in the documentation 10 | * and/or other materials provided with the distribution. 11 | * * Neither the name of Kim Gräsman nor the names of contributors may be used 12 | * to endorse or promote products derived from this software without specific 13 | * prior written permission. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | * ARE DISCLAIMED. IN NO EVENT SHALL KIM GRÄSMAN BE LIABLE FOR ANY DIRECT, 19 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef INCLUDED_GETOPT_PORT_H 28 | #define INCLUDED_GETOPT_PORT_H 29 | 30 | #if defined(__cplusplus) 31 | extern "C" { 32 | #endif 33 | 34 | extern const int no_argument; 35 | extern const int required_argument; 36 | extern const int optional_argument; 37 | 38 | extern char* optarg; 39 | extern int optind, opterr, optopt; 40 | 41 | struct option { 42 | const char* name; 43 | int has_arg; 44 | int* flag; 45 | int val; 46 | }; 47 | 48 | int getopt(int argc, char* const argv[], const char* optstring); 49 | 50 | int getopt_long(int argc, char* const argv[], 51 | const char* optstring, const struct option* longopts, int* longindex); 52 | 53 | #if defined(__cplusplus) 54 | } 55 | #endif 56 | 57 | #endif // INCLUDED_GETOPT_PORT_H 58 | -------------------------------------------------------------------------------- /task01-window/external/glfw/deps/mingw/_mingw_dxhelper.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the mingw-w64 runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | 7 | #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS) 8 | #define NONAMELESSUNION 1 9 | #endif 10 | #if defined(NONAMELESSSTRUCT) && \ 11 | !defined(NONAMELESSUNION) 12 | #define NONAMELESSUNION 1 13 | #endif 14 | #if defined(NONAMELESSUNION) && \ 15 | !defined(NONAMELESSSTRUCT) 16 | #define NONAMELESSSTRUCT 1 17 | #endif 18 | #if !defined(__GNU_EXTENSION) 19 | #if defined(__GNUC__) || defined(__GNUG__) 20 | #define __GNU_EXTENSION __extension__ 21 | #else 22 | #define __GNU_EXTENSION 23 | #endif 24 | #endif /* __extension__ */ 25 | 26 | #ifndef __ANONYMOUS_DEFINED 27 | #define __ANONYMOUS_DEFINED 28 | #if defined(__GNUC__) || defined(__GNUG__) 29 | #define _ANONYMOUS_UNION __extension__ 30 | #define _ANONYMOUS_STRUCT __extension__ 31 | #else 32 | #define _ANONYMOUS_UNION 33 | #define _ANONYMOUS_STRUCT 34 | #endif 35 | #ifndef NONAMELESSUNION 36 | #define _UNION_NAME(x) 37 | #define _STRUCT_NAME(x) 38 | #else /* NONAMELESSUNION */ 39 | #define _UNION_NAME(x) x 40 | #define _STRUCT_NAME(x) x 41 | #endif 42 | #endif /* __ANONYMOUS_DEFINED */ 43 | 44 | #ifndef DUMMYUNIONNAME 45 | # ifdef NONAMELESSUNION 46 | # define DUMMYUNIONNAME u 47 | # define DUMMYUNIONNAME1 u1 /* Wine uses this variant */ 48 | # define DUMMYUNIONNAME2 u2 49 | # define DUMMYUNIONNAME3 u3 50 | # define DUMMYUNIONNAME4 u4 51 | # define DUMMYUNIONNAME5 u5 52 | # define DUMMYUNIONNAME6 u6 53 | # define DUMMYUNIONNAME7 u7 54 | # define DUMMYUNIONNAME8 u8 55 | # define DUMMYUNIONNAME9 u9 56 | # else /* NONAMELESSUNION */ 57 | # define DUMMYUNIONNAME 58 | # define DUMMYUNIONNAME1 /* Wine uses this variant */ 59 | # define DUMMYUNIONNAME2 60 | # define DUMMYUNIONNAME3 61 | # define DUMMYUNIONNAME4 62 | # define DUMMYUNIONNAME5 63 | # define DUMMYUNIONNAME6 64 | # define DUMMYUNIONNAME7 65 | # define DUMMYUNIONNAME8 66 | # define DUMMYUNIONNAME9 67 | # endif 68 | #endif /* DUMMYUNIONNAME */ 69 | 70 | #if !defined(DUMMYUNIONNAME1) /* MinGW does not define this one */ 71 | # ifdef NONAMELESSUNION 72 | # define DUMMYUNIONNAME1 u1 /* Wine uses this variant */ 73 | # else 74 | # define DUMMYUNIONNAME1 /* Wine uses this variant */ 75 | # endif 76 | #endif /* DUMMYUNIONNAME1 */ 77 | 78 | #ifndef DUMMYSTRUCTNAME 79 | # ifdef NONAMELESSUNION 80 | # define DUMMYSTRUCTNAME s 81 | # define DUMMYSTRUCTNAME1 s1 /* Wine uses this variant */ 82 | # define DUMMYSTRUCTNAME2 s2 83 | # define DUMMYSTRUCTNAME3 s3 84 | # define DUMMYSTRUCTNAME4 s4 85 | # define DUMMYSTRUCTNAME5 s5 86 | # else 87 | # define DUMMYSTRUCTNAME 88 | # define DUMMYSTRUCTNAME1 /* Wine uses this variant */ 89 | # define DUMMYSTRUCTNAME2 90 | # define DUMMYSTRUCTNAME3 91 | # define DUMMYSTRUCTNAME4 92 | # define DUMMYSTRUCTNAME5 93 | # endif 94 | #endif /* DUMMYSTRUCTNAME */ 95 | 96 | /* These are for compatibility with the Wine source tree */ 97 | 98 | #ifndef WINELIB_NAME_AW 99 | # ifdef __MINGW_NAME_AW 100 | # define WINELIB_NAME_AW __MINGW_NAME_AW 101 | # else 102 | # ifdef UNICODE 103 | # define WINELIB_NAME_AW(func) func##W 104 | # else 105 | # define WINELIB_NAME_AW(func) func##A 106 | # endif 107 | # endif 108 | #endif /* WINELIB_NAME_AW */ 109 | 110 | #ifndef DECL_WINELIB_TYPE_AW 111 | # ifdef __MINGW_TYPEDEF_AW 112 | # define DECL_WINELIB_TYPE_AW __MINGW_TYPEDEF_AW 113 | # else 114 | # define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type; 115 | # endif 116 | #endif /* DECL_WINELIB_TYPE_AW */ 117 | 118 | -------------------------------------------------------------------------------- /task01-window/external/glfw/deps/vulkan/vk_platform.h: -------------------------------------------------------------------------------- 1 | // 2 | // File: vk_platform.h 3 | // 4 | /* 5 | ** Copyright (c) 2014-2015 The Khronos Group Inc. 6 | ** 7 | ** Licensed under the Apache License, Version 2.0 (the "License"); 8 | ** you may not use this file except in compliance with the License. 9 | ** You may obtain a copy of the License at 10 | ** 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** 13 | ** Unless required by applicable law or agreed to in writing, software 14 | ** distributed under the License is distributed on an "AS IS" BASIS, 15 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | ** See the License for the specific language governing permissions and 17 | ** limitations under the License. 18 | */ 19 | 20 | 21 | #ifndef VK_PLATFORM_H_ 22 | #define VK_PLATFORM_H_ 23 | 24 | #ifdef __cplusplus 25 | extern "C" 26 | { 27 | #endif // __cplusplus 28 | 29 | /* 30 | *************************************************************************************************** 31 | * Platform-specific directives and type declarations 32 | *************************************************************************************************** 33 | */ 34 | 35 | /* Platform-specific calling convention macros. 36 | * 37 | * Platforms should define these so that Vulkan clients call Vulkan commands 38 | * with the same calling conventions that the Vulkan implementation expects. 39 | * 40 | * VKAPI_ATTR - Placed before the return type in function declarations. 41 | * Useful for C++11 and GCC/Clang-style function attribute syntax. 42 | * VKAPI_CALL - Placed after the return type in function declarations. 43 | * Useful for MSVC-style calling convention syntax. 44 | * VKAPI_PTR - Placed between the '(' and '*' in function pointer types. 45 | * 46 | * Function declaration: VKAPI_ATTR void VKAPI_CALL vkCommand(void); 47 | * Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void); 48 | */ 49 | #if defined(_WIN32) 50 | // On Windows, Vulkan commands use the stdcall convention 51 | #define VKAPI_ATTR 52 | #define VKAPI_CALL __stdcall 53 | #define VKAPI_PTR VKAPI_CALL 54 | #elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7 55 | #error "Vulkan isn't supported for the 'armeabi' NDK ABI" 56 | #elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE) 57 | // On Android 32-bit ARM targets, Vulkan functions use the "hardfloat" 58 | // calling convention, i.e. float parameters are passed in registers. This 59 | // is true even if the rest of the application passes floats on the stack, 60 | // as it does by default when compiling for the armeabi-v7a NDK ABI. 61 | #define VKAPI_ATTR __attribute__((pcs("aapcs-vfp"))) 62 | #define VKAPI_CALL 63 | #define VKAPI_PTR VKAPI_ATTR 64 | #else 65 | // On other platforms, use the default calling convention 66 | #define VKAPI_ATTR 67 | #define VKAPI_CALL 68 | #define VKAPI_PTR 69 | #endif 70 | 71 | #include 72 | 73 | #if !defined(VK_NO_STDINT_H) 74 | #if defined(_MSC_VER) && (_MSC_VER < 1600) 75 | typedef signed __int8 int8_t; 76 | typedef unsigned __int8 uint8_t; 77 | typedef signed __int16 int16_t; 78 | typedef unsigned __int16 uint16_t; 79 | typedef signed __int32 int32_t; 80 | typedef unsigned __int32 uint32_t; 81 | typedef signed __int64 int64_t; 82 | typedef unsigned __int64 uint64_t; 83 | #else 84 | #include 85 | #endif 86 | #endif // !defined(VK_NO_STDINT_H) 87 | 88 | #ifdef __cplusplus 89 | } // extern "C" 90 | #endif // __cplusplus 91 | 92 | // Platform-specific headers required by platform window system extensions. 93 | // These are enabled prior to #including "vulkan.h". The same enable then 94 | // controls inclusion of the extension interfaces in vulkan.h. 95 | 96 | #ifdef VK_USE_PLATFORM_ANDROID_KHR 97 | #include 98 | #endif 99 | 100 | #ifdef VK_USE_PLATFORM_MIR_KHR 101 | #include 102 | #endif 103 | 104 | #ifdef VK_USE_PLATFORM_WAYLAND_KHR 105 | #include 106 | #endif 107 | 108 | #ifdef VK_USE_PLATFORM_WIN32_KHR 109 | #include 110 | #endif 111 | 112 | #ifdef VK_USE_PLATFORM_XLIB_KHR 113 | #include 114 | #endif 115 | 116 | #ifdef VK_USE_PLATFORM_XCB_KHR 117 | #include 118 | #endif 119 | 120 | #endif 121 | -------------------------------------------------------------------------------- /task01-window/external/glfw/src/cocoa_joystick.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 Cocoa - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2006-2016 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #define _GLFW_PLATFORM_JOYSTICK_STATE _GLFWjoystickNS ns 33 | #define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE 34 | 35 | #define _GLFW_PLATFORM_MAPPING_NAME "Mac OS X" 36 | 37 | // Cocoa-specific per-joystick data 38 | // 39 | typedef struct _GLFWjoystickNS 40 | { 41 | IOHIDDeviceRef device; 42 | CFMutableArrayRef axes; 43 | CFMutableArrayRef buttons; 44 | CFMutableArrayRef hats; 45 | } _GLFWjoystickNS; 46 | 47 | 48 | void _glfwInitJoysticksNS(void); 49 | void _glfwTerminateJoysticksNS(void); 50 | 51 | -------------------------------------------------------------------------------- /task01-window/external/glfw/src/cocoa_platform.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 macOS - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2009-2016 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #include 28 | #include 29 | 30 | #if defined(__OBJC__) 31 | #import 32 | #import 33 | #else 34 | #include 35 | #include 36 | typedef void* id; 37 | #endif 38 | 39 | typedef VkFlags VkMacOSSurfaceCreateFlagsMVK; 40 | 41 | typedef struct VkMacOSSurfaceCreateInfoMVK 42 | { 43 | VkStructureType sType; 44 | const void* pNext; 45 | VkMacOSSurfaceCreateFlagsMVK flags; 46 | const void* pView; 47 | } VkMacOSSurfaceCreateInfoMVK; 48 | 49 | typedef VkResult (APIENTRY *PFN_vkCreateMacOSSurfaceMVK)(VkInstance,const VkMacOSSurfaceCreateInfoMVK*,const VkAllocationCallbacks*,VkSurfaceKHR*); 50 | 51 | #include "posix_thread.h" 52 | #include "cocoa_joystick.h" 53 | #include "nsgl_context.h" 54 | #include "egl_context.h" 55 | #include "osmesa_context.h" 56 | 57 | #define _glfw_dlopen(name) dlopen(name, RTLD_LAZY | RTLD_LOCAL) 58 | #define _glfw_dlclose(handle) dlclose(handle) 59 | #define _glfw_dlsym(handle, name) dlsym(handle, name) 60 | 61 | #define _GLFW_EGL_NATIVE_WINDOW ((EGLNativeWindowType) window->ns.view) 62 | #define _GLFW_EGL_NATIVE_DISPLAY EGL_DEFAULT_DISPLAY 63 | 64 | #define _GLFW_PLATFORM_WINDOW_STATE _GLFWwindowNS ns 65 | #define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE _GLFWlibraryNS ns 66 | #define _GLFW_PLATFORM_LIBRARY_TIMER_STATE _GLFWtimerNS ns 67 | #define _GLFW_PLATFORM_MONITOR_STATE _GLFWmonitorNS ns 68 | #define _GLFW_PLATFORM_CURSOR_STATE _GLFWcursorNS ns 69 | 70 | // HIToolbox.framework pointer typedefs 71 | #define kTISPropertyUnicodeKeyLayoutData _glfw.ns.tis.kPropertyUnicodeKeyLayoutData 72 | typedef TISInputSourceRef (*PFN_TISCopyCurrentKeyboardLayoutInputSource)(void); 73 | #define TISCopyCurrentKeyboardLayoutInputSource _glfw.ns.tis.CopyCurrentKeyboardLayoutInputSource 74 | typedef void* (*PFN_TISGetInputSourceProperty)(TISInputSourceRef,CFStringRef); 75 | #define TISGetInputSourceProperty _glfw.ns.tis.GetInputSourceProperty 76 | typedef UInt8 (*PFN_LMGetKbdType)(void); 77 | #define LMGetKbdType _glfw.ns.tis.GetKbdType 78 | 79 | 80 | // Cocoa-specific per-window data 81 | // 82 | typedef struct _GLFWwindowNS 83 | { 84 | id object; 85 | id delegate; 86 | id view; 87 | id layer; 88 | 89 | GLFWbool maximized; 90 | 91 | // Cached window properties to filter out duplicate events 92 | int width, height; 93 | int fbWidth, fbHeight; 94 | float xscale, yscale; 95 | 96 | // The total sum of the distances the cursor has been warped 97 | // since the last cursor motion event was processed 98 | // This is kept to counteract Cocoa doing the same internally 99 | double cursorWarpDeltaX, cursorWarpDeltaY; 100 | 101 | } _GLFWwindowNS; 102 | 103 | // Cocoa-specific global data 104 | // 105 | typedef struct _GLFWlibraryNS 106 | { 107 | CGEventSourceRef eventSource; 108 | id delegate; 109 | id autoreleasePool; 110 | GLFWbool cursorHidden; 111 | TISInputSourceRef inputSource; 112 | IOHIDManagerRef hidManager; 113 | id unicodeData; 114 | id listener; 115 | 116 | char keyName[64]; 117 | short int keycodes[256]; 118 | short int scancodes[GLFW_KEY_LAST + 1]; 119 | char* clipboardString; 120 | CGPoint cascadePoint; 121 | // Where to place the cursor when re-enabled 122 | double restoreCursorPosX, restoreCursorPosY; 123 | // The window whose disabled cursor mode is active 124 | _GLFWwindow* disabledCursorWindow; 125 | 126 | struct { 127 | CFBundleRef bundle; 128 | PFN_TISCopyCurrentKeyboardLayoutInputSource CopyCurrentKeyboardLayoutInputSource; 129 | PFN_TISGetInputSourceProperty GetInputSourceProperty; 130 | PFN_LMGetKbdType GetKbdType; 131 | CFStringRef kPropertyUnicodeKeyLayoutData; 132 | } tis; 133 | 134 | } _GLFWlibraryNS; 135 | 136 | // Cocoa-specific per-monitor data 137 | // 138 | typedef struct _GLFWmonitorNS 139 | { 140 | CGDirectDisplayID displayID; 141 | CGDisplayModeRef previousMode; 142 | uint32_t unitNumber; 143 | id screen; 144 | 145 | } _GLFWmonitorNS; 146 | 147 | // Cocoa-specific per-cursor data 148 | // 149 | typedef struct _GLFWcursorNS 150 | { 151 | id object; 152 | 153 | } _GLFWcursorNS; 154 | 155 | // Cocoa-specific global timer data 156 | // 157 | typedef struct _GLFWtimerNS 158 | { 159 | uint64_t frequency; 160 | 161 | } _GLFWtimerNS; 162 | 163 | 164 | void _glfwInitTimerNS(void); 165 | 166 | void _glfwPollMonitorsNS(void); 167 | void _glfwSetVideoModeNS(_GLFWmonitor* monitor, const GLFWvidmode* desired); 168 | void _glfwRestoreVideoModeNS(_GLFWmonitor* monitor); 169 | 170 | -------------------------------------------------------------------------------- /task01-window/external/glfw/src/cocoa_time.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 macOS - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2009-2016 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #include "internal.h" 28 | 29 | #include 30 | 31 | 32 | ////////////////////////////////////////////////////////////////////////// 33 | ////// GLFW internal API ////// 34 | ////////////////////////////////////////////////////////////////////////// 35 | 36 | // Initialise timer 37 | // 38 | void _glfwInitTimerNS(void) 39 | { 40 | mach_timebase_info_data_t info; 41 | mach_timebase_info(&info); 42 | 43 | _glfw.timer.ns.frequency = (info.denom * 1e9) / info.numer; 44 | } 45 | 46 | 47 | ////////////////////////////////////////////////////////////////////////// 48 | ////// GLFW platform API ////// 49 | ////////////////////////////////////////////////////////////////////////// 50 | 51 | uint64_t _glfwPlatformGetTimerValue(void) 52 | { 53 | return mach_absolute_time(); 54 | } 55 | 56 | uint64_t _glfwPlatformGetTimerFrequency(void) 57 | { 58 | return _glfw.timer.ns.frequency; 59 | } 60 | 61 | -------------------------------------------------------------------------------- /task01-window/external/glfw/src/glfw3.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | includedir=${prefix}/include 4 | libdir=${exec_prefix}/lib@LIB_SUFFIX@ 5 | 6 | Name: GLFW 7 | Description: A multi-platform library for OpenGL, window and input 8 | Version: @GLFW_VERSION_FULL@ 9 | URL: http://www.glfw.org/ 10 | Requires.private: @GLFW_PKG_DEPS@ 11 | Libs: -L${libdir} -l@GLFW_LIB_NAME@ 12 | Libs.private: @GLFW_PKG_LIBS@ 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /task01-window/external/glfw/src/glfw3Config.cmake.in: -------------------------------------------------------------------------------- 1 | include("${CMAKE_CURRENT_LIST_DIR}/glfw3Targets.cmake") 2 | -------------------------------------------------------------------------------- /task01-window/external/glfw/src/glfw_config.h.in: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2010-2016 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | // As glfw_config.h.in, this file is used by CMake to produce the 27 | // glfw_config.h configuration header file. If you are adding a feature 28 | // requiring conditional compilation, this is where to add the macro. 29 | //======================================================================== 30 | // As glfw_config.h, this file defines compile-time option macros for a 31 | // specific platform and development environment. If you are using the 32 | // GLFW CMake files, modify glfw_config.h.in instead of this file. If you 33 | // are using your own build system, make this file define the appropriate 34 | // macros in whatever way is suitable. 35 | //======================================================================== 36 | 37 | // Define this to 1 if building GLFW for X11 38 | #cmakedefine _GLFW_X11 39 | // Define this to 1 if building GLFW for Win32 40 | #cmakedefine _GLFW_WIN32 41 | // Define this to 1 if building GLFW for Cocoa 42 | #cmakedefine _GLFW_COCOA 43 | // Define this to 1 if building GLFW for Wayland 44 | #cmakedefine _GLFW_WAYLAND 45 | // Define this to 1 if building GLFW for Mir 46 | #cmakedefine _GLFW_MIR 47 | // Define this to 1 if building GLFW for OSMesa 48 | #cmakedefine _GLFW_OSMESA 49 | 50 | // Define this to 1 if building as a shared library / dynamic library / DLL 51 | #cmakedefine _GLFW_BUILD_DLL 52 | // Define this to 1 to use Vulkan loader linked statically into application 53 | #cmakedefine _GLFW_VULKAN_STATIC 54 | 55 | // Define this to 1 to force use of high-performance GPU on hybrid systems 56 | #cmakedefine _GLFW_USE_HYBRID_HPG 57 | 58 | // Define this to 1 if xkbcommon supports the compose key 59 | #cmakedefine HAVE_XKBCOMMON_COMPOSE_H 60 | 61 | -------------------------------------------------------------------------------- /task01-window/external/glfw/src/linux_joystick.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 Linux - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2014 Jonas Ådahl 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | #define _GLFW_PLATFORM_JOYSTICK_STATE _GLFWjoystickLinux linjs 32 | #define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE _GLFWlibraryLinux linjs 33 | 34 | #define _GLFW_PLATFORM_MAPPING_NAME "Linux" 35 | 36 | // Linux-specific joystick data 37 | // 38 | typedef struct _GLFWjoystickLinux 39 | { 40 | int fd; 41 | char path[PATH_MAX]; 42 | int keyMap[KEY_CNT - BTN_MISC]; 43 | int absMap[ABS_CNT]; 44 | struct input_absinfo absInfo[ABS_CNT]; 45 | int hats[4][2]; 46 | } _GLFWjoystickLinux; 47 | 48 | // Linux-specific joystick API data 49 | // 50 | typedef struct _GLFWlibraryLinux 51 | { 52 | int inotify; 53 | int watch; 54 | regex_t regex; 55 | GLFWbool dropped; 56 | } _GLFWlibraryLinux; 57 | 58 | 59 | GLFWbool _glfwInitJoysticksLinux(void); 60 | void _glfwTerminateJoysticksLinux(void); 61 | void _glfwDetectJoystickConnectionLinux(void); 62 | 63 | -------------------------------------------------------------------------------- /task01-window/external/glfw/src/mappings.h.in: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2006-2016 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | // As mappings.h.in, this file is used by CMake to produce the mappings.h 27 | // header file. If you are adding a GLFW specific gamepad mapping, this is 28 | // where to put it. 29 | //======================================================================== 30 | // As mappings.h, this provides all pre-defined gamepad mappings, including 31 | // all available in SDL_GameControllerDB. Do not edit this file. Any gamepad 32 | // mappings not specific to GLFW should be submitted to SDL_GameControllerDB. 33 | // This file can be re-generated from mappings.h.in and the upstream 34 | // gamecontrollerdb.txt with the GenerateMappings.cmake script. 35 | //======================================================================== 36 | 37 | // All gamepad mappings not labeled GLFW are copied from the 38 | // SDL_GameControllerDB project under the following license: 39 | // 40 | // Simple DirectMedia Layer 41 | // Copyright (C) 1997-2013 Sam Lantinga 42 | // 43 | // This software is provided 'as-is', without any express or implied warranty. 44 | // In no event will the authors be held liable for any damages arising from the 45 | // use of this software. 46 | // 47 | // Permission is granted to anyone to use this software for any purpose, 48 | // including commercial applications, and to alter it and redistribute it 49 | // freely, subject to the following restrictions: 50 | // 51 | // 1. The origin of this software must not be misrepresented; you must not 52 | // claim that you wrote the original software. If you use this software 53 | // in a product, an acknowledgment in the product documentation would 54 | // be appreciated but is not required. 55 | // 56 | // 2. Altered source versions must be plainly marked as such, and must not be 57 | // misrepresented as being the original software. 58 | // 59 | // 3. This notice may not be removed or altered from any source distribution. 60 | 61 | const char* _glfwDefaultMappings[] = 62 | { 63 | @GLFW_GAMEPAD_MAPPINGS@ 64 | "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,", 65 | "78696e70757402000000000000000000,XInput Wheel (GLFW),platform:Windows,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,", 66 | "78696e70757403000000000000000000,XInput Arcade Stick (GLFW),platform:Windows,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,", 67 | "78696e70757404000000000000000000,XInput Flight Stick (GLFW),platform:Windows,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,", 68 | "78696e70757405000000000000000000,XInput Dance Pad (GLFW),platform:Windows,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,", 69 | "78696e70757406000000000000000000,XInput Guitar (GLFW),platform:Windows,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,", 70 | "78696e70757408000000000000000000,XInput Drum Kit (GLFW),platform:Windows,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,", 71 | NULL 72 | }; 73 | 74 | -------------------------------------------------------------------------------- /task01-window/external/glfw/src/mir_platform.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 Mir - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2014-2017 Brandon Schaefer 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | #include 32 | 33 | typedef VkFlags VkMirWindowCreateFlagsKHR; 34 | 35 | typedef struct VkMirWindowCreateInfoKHR 36 | { 37 | VkStructureType sType; 38 | const void* pNext; 39 | VkMirWindowCreateFlagsKHR flags; 40 | MirConnection* connection; 41 | MirWindow* mirWindow; 42 | } VkMirWindowCreateInfoKHR; 43 | 44 | typedef VkResult (APIENTRY *PFN_vkCreateMirWindowKHR)(VkInstance,const VkMirWindowCreateInfoKHR*,const VkAllocationCallbacks*,VkSurfaceKHR*); 45 | typedef VkBool32 (APIENTRY *PFN_vkGetPhysicalDeviceMirPresentationSupportKHR)(VkPhysicalDevice,uint32_t,MirConnection*); 46 | 47 | #include "posix_thread.h" 48 | #include "posix_time.h" 49 | #include "linux_joystick.h" 50 | #include "xkb_unicode.h" 51 | #include "egl_context.h" 52 | #include "osmesa_context.h" 53 | 54 | #define _glfw_dlopen(name) dlopen(name, RTLD_LAZY | RTLD_LOCAL) 55 | #define _glfw_dlclose(handle) dlclose(handle) 56 | #define _glfw_dlsym(handle, name) dlsym(handle, name) 57 | 58 | #define _GLFW_EGL_NATIVE_WINDOW ((EGLNativeWindowType) window->mir.nativeWindow) 59 | #define _GLFW_EGL_NATIVE_DISPLAY ((EGLNativeDisplayType) _glfw.mir.display) 60 | 61 | #define _GLFW_PLATFORM_WINDOW_STATE _GLFWwindowMir mir 62 | #define _GLFW_PLATFORM_MONITOR_STATE _GLFWmonitorMir mir 63 | #define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE _GLFWlibraryMir mir 64 | #define _GLFW_PLATFORM_CURSOR_STATE _GLFWcursorMir mir 65 | 66 | #define _GLFW_PLATFORM_CONTEXT_STATE 67 | #define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE 68 | 69 | 70 | // Mir-specific Event Queue 71 | // 72 | typedef struct EventQueue 73 | { 74 | TAILQ_HEAD(, EventNode) head; 75 | } EventQueue; 76 | 77 | // Mir-specific per-window data 78 | // 79 | typedef struct _GLFWwindowMir 80 | { 81 | MirWindow* window; 82 | int width; 83 | int height; 84 | MirEGLNativeWindowType nativeWindow; 85 | _GLFWcursor* currentCursor; 86 | 87 | } _GLFWwindowMir; 88 | 89 | // Mir-specific per-monitor data 90 | // 91 | typedef struct _GLFWmonitorMir 92 | { 93 | int curMode; 94 | int outputId; 95 | int x; 96 | int y; 97 | 98 | } _GLFWmonitorMir; 99 | 100 | // Mir-specific global data 101 | // 102 | typedef struct _GLFWlibraryMir 103 | { 104 | MirConnection* connection; 105 | MirEGLNativeDisplayType display; 106 | EventQueue* eventQueue; 107 | 108 | short int keycodes[256]; 109 | short int scancodes[GLFW_KEY_LAST + 1]; 110 | 111 | pthread_mutex_t eventMutex; 112 | pthread_cond_t eventCond; 113 | 114 | // The window whose disabled cursor mode is active 115 | _GLFWwindow* disabledCursorWindow; 116 | 117 | } _GLFWlibraryMir; 118 | 119 | // Mir-specific per-cursor data 120 | // TODO: Only system cursors are implemented in Mir atm. Need to wait for support. 121 | // 122 | typedef struct _GLFWcursorMir 123 | { 124 | MirCursorConfiguration* conf; 125 | MirBufferStream* customCursor; 126 | char const* cursorName; // only needed for system cursors 127 | } _GLFWcursorMir; 128 | 129 | 130 | extern void _glfwPollMonitorsMir(void); 131 | extern void _glfwInitEventQueueMir(EventQueue* queue); 132 | extern void _glfwDeleteEventQueueMir(EventQueue* queue); 133 | 134 | -------------------------------------------------------------------------------- /task01-window/external/glfw/src/nsgl_context.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 macOS - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2009-2016 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextNSGL nsgl 28 | #define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE _GLFWlibraryNSGL nsgl 29 | 30 | 31 | // NSGL-specific per-context data 32 | // 33 | typedef struct _GLFWcontextNSGL 34 | { 35 | id pixelFormat; 36 | id object; 37 | 38 | } _GLFWcontextNSGL; 39 | 40 | // NSGL-specific global data 41 | // 42 | typedef struct _GLFWlibraryNSGL 43 | { 44 | // dlopen handle for OpenGL.framework (for glfwGetProcAddress) 45 | CFBundleRef framework; 46 | 47 | } _GLFWlibraryNSGL; 48 | 49 | 50 | GLFWbool _glfwInitNSGL(void); 51 | void _glfwTerminateNSGL(void); 52 | GLFWbool _glfwCreateContextNSGL(_GLFWwindow* window, 53 | const _GLFWctxconfig* ctxconfig, 54 | const _GLFWfbconfig* fbconfig); 55 | void _glfwDestroyContextNSGL(_GLFWwindow* window); 56 | 57 | -------------------------------------------------------------------------------- /task01-window/external/glfw/src/null_init.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2016 Google Inc. 5 | // Copyright (c) 2006-2016 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #include "internal.h" 29 | 30 | 31 | ////////////////////////////////////////////////////////////////////////// 32 | ////// GLFW platform API ////// 33 | ////////////////////////////////////////////////////////////////////////// 34 | 35 | int _glfwPlatformInit(void) 36 | { 37 | _glfwInitTimerPOSIX(); 38 | return GLFW_TRUE; 39 | } 40 | 41 | void _glfwPlatformTerminate(void) 42 | { 43 | _glfwTerminateOSMesa(); 44 | } 45 | 46 | const char* _glfwPlatformGetVersionString(void) 47 | { 48 | return _GLFW_VERSION_NUMBER " null OSMesa"; 49 | } 50 | 51 | -------------------------------------------------------------------------------- /task01-window/external/glfw/src/null_joystick.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2006-2016 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #include "internal.h" 28 | 29 | 30 | ////////////////////////////////////////////////////////////////////////// 31 | ////// GLFW platform API ////// 32 | ////////////////////////////////////////////////////////////////////////// 33 | 34 | int _glfwPlatformPollJoystick(_GLFWjoystick* js, int mode) 35 | { 36 | return GLFW_FALSE; 37 | } 38 | 39 | void _glfwPlatformUpdateGamepadGUID(char* guid) 40 | { 41 | } 42 | 43 | -------------------------------------------------------------------------------- /task01-window/external/glfw/src/null_joystick.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2006-2016 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #define _GLFW_PLATFORM_JOYSTICK_STATE int nulljs 28 | #define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE int nulljs 29 | 30 | #define _GLFW_PLATFORM_MAPPING_NAME "" 31 | 32 | -------------------------------------------------------------------------------- /task01-window/external/glfw/src/null_monitor.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2016 Google Inc. 5 | // Copyright (c) 2006-2016 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #include "internal.h" 29 | 30 | 31 | ////////////////////////////////////////////////////////////////////////// 32 | ////// GLFW platform API ////// 33 | ////////////////////////////////////////////////////////////////////////// 34 | 35 | void _glfwPlatformFreeMonitor(_GLFWmonitor* monitor) 36 | { 37 | } 38 | 39 | void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos) 40 | { 41 | } 42 | 43 | void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor, 44 | float* xscale, float* yscale) 45 | { 46 | if (xscale) 47 | *xscale = 1.f; 48 | if (yscale) 49 | *yscale = 1.f; 50 | } 51 | 52 | GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found) 53 | { 54 | return NULL; 55 | } 56 | 57 | void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode) 58 | { 59 | } 60 | 61 | void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp) 62 | { 63 | } 64 | 65 | void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp) 66 | { 67 | } 68 | 69 | -------------------------------------------------------------------------------- /task01-window/external/glfw/src/null_platform.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2016 Google Inc. 5 | // Copyright (c) 2006-2016 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #include 29 | 30 | #define _GLFW_PLATFORM_WINDOW_STATE _GLFWwindowNull null 31 | 32 | #define _GLFW_PLATFORM_CONTEXT_STATE 33 | #define _GLFW_PLATFORM_MONITOR_STATE 34 | #define _GLFW_PLATFORM_CURSOR_STATE 35 | #define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE 36 | #define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE 37 | #define _GLFW_EGL_CONTEXT_STATE 38 | #define _GLFW_EGL_LIBRARY_CONTEXT_STATE 39 | 40 | #include "osmesa_context.h" 41 | #include "posix_time.h" 42 | #include "posix_thread.h" 43 | #include "null_joystick.h" 44 | 45 | #if defined(_GLFW_WIN32) 46 | #define _glfw_dlopen(name) LoadLibraryA(name) 47 | #define _glfw_dlclose(handle) FreeLibrary((HMODULE) handle) 48 | #define _glfw_dlsym(handle, name) GetProcAddress((HMODULE) handle, name) 49 | #else 50 | #define _glfw_dlopen(name) dlopen(name, RTLD_LAZY | RTLD_LOCAL) 51 | #define _glfw_dlclose(handle) dlclose(handle) 52 | #define _glfw_dlsym(handle, name) dlsym(handle, name) 53 | #endif 54 | 55 | // Null-specific per-window data 56 | // 57 | typedef struct _GLFWwindowNull 58 | { 59 | int width; 60 | int height; 61 | } _GLFWwindowNull; 62 | 63 | -------------------------------------------------------------------------------- /task01-window/external/glfw/src/osmesa_context.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 OSMesa - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2016 Google Inc. 5 | // Copyright (c) 2006-2016 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #define OSMESA_RGBA 0x1908 29 | #define OSMESA_FORMAT 0x22 30 | #define OSMESA_DEPTH_BITS 0x30 31 | #define OSMESA_STENCIL_BITS 0x31 32 | #define OSMESA_ACCUM_BITS 0x32 33 | #define OSMESA_PROFILE 0x33 34 | #define OSMESA_CORE_PROFILE 0x34 35 | #define OSMESA_COMPAT_PROFILE 0x35 36 | #define OSMESA_CONTEXT_MAJOR_VERSION 0x36 37 | #define OSMESA_CONTEXT_MINOR_VERSION 0x37 38 | 39 | typedef void* OSMesaContext; 40 | typedef void (*OSMESAproc)(void); 41 | 42 | typedef OSMesaContext (GLAPIENTRY * PFN_OSMesaCreateContextExt)(GLenum,GLint,GLint,GLint,OSMesaContext); 43 | typedef OSMesaContext (GLAPIENTRY * PFN_OSMesaCreateContextAttribs)(const int*,OSMesaContext); 44 | typedef void (GLAPIENTRY * PFN_OSMesaDestroyContext)(OSMesaContext); 45 | typedef int (GLAPIENTRY * PFN_OSMesaMakeCurrent)(OSMesaContext,void*,int,int,int); 46 | typedef int (GLAPIENTRY * PFN_OSMesaGetColorBuffer)(OSMesaContext,int*,int*,int*,void**); 47 | typedef int (GLAPIENTRY * PFN_OSMesaGetDepthBuffer)(OSMesaContext,int*,int*,int*,void**); 48 | typedef GLFWglproc (GLAPIENTRY * PFN_OSMesaGetProcAddress)(const char*); 49 | #define OSMesaCreateContextExt _glfw.osmesa.CreateContextExt 50 | #define OSMesaCreateContextAttribs _glfw.osmesa.CreateContextAttribs 51 | #define OSMesaDestroyContext _glfw.osmesa.DestroyContext 52 | #define OSMesaMakeCurrent _glfw.osmesa.MakeCurrent 53 | #define OSMesaGetColorBuffer _glfw.osmesa.GetColorBuffer 54 | #define OSMesaGetDepthBuffer _glfw.osmesa.GetDepthBuffer 55 | #define OSMesaGetProcAddress _glfw.osmesa.GetProcAddress 56 | 57 | #define _GLFW_OSMESA_CONTEXT_STATE _GLFWcontextOSMesa osmesa 58 | #define _GLFW_OSMESA_LIBRARY_CONTEXT_STATE _GLFWlibraryOSMesa osmesa 59 | 60 | 61 | // OSMesa-specific per-context data 62 | // 63 | typedef struct _GLFWcontextOSMesa 64 | { 65 | OSMesaContext handle; 66 | int width; 67 | int height; 68 | void* buffer; 69 | 70 | } _GLFWcontextOSMesa; 71 | 72 | // OSMesa-specific global data 73 | // 74 | typedef struct _GLFWlibraryOSMesa 75 | { 76 | void* handle; 77 | 78 | PFN_OSMesaCreateContextExt CreateContextExt; 79 | PFN_OSMesaCreateContextAttribs CreateContextAttribs; 80 | PFN_OSMesaDestroyContext DestroyContext; 81 | PFN_OSMesaMakeCurrent MakeCurrent; 82 | PFN_OSMesaGetColorBuffer GetColorBuffer; 83 | PFN_OSMesaGetDepthBuffer GetDepthBuffer; 84 | PFN_OSMesaGetProcAddress GetProcAddress; 85 | 86 | } _GLFWlibraryOSMesa; 87 | 88 | 89 | GLFWbool _glfwInitOSMesa(void); 90 | void _glfwTerminateOSMesa(void); 91 | GLFWbool _glfwCreateContextOSMesa(_GLFWwindow* window, 92 | const _GLFWctxconfig* ctxconfig, 93 | const _GLFWfbconfig* fbconfig); 94 | 95 | -------------------------------------------------------------------------------- /task01-window/external/glfw/src/posix_thread.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 POSIX - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2016 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #include "internal.h" 29 | 30 | #include 31 | #include 32 | 33 | 34 | ////////////////////////////////////////////////////////////////////////// 35 | ////// GLFW platform API ////// 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | GLFWbool _glfwPlatformCreateTls(_GLFWtls* tls) 39 | { 40 | assert(tls->posix.allocated == GLFW_FALSE); 41 | 42 | if (pthread_key_create(&tls->posix.key, NULL) != 0) 43 | { 44 | _glfwInputError(GLFW_PLATFORM_ERROR, 45 | "POSIX: Failed to create context TLS"); 46 | return GLFW_FALSE; 47 | } 48 | 49 | tls->posix.allocated = GLFW_TRUE; 50 | return GLFW_TRUE; 51 | } 52 | 53 | void _glfwPlatformDestroyTls(_GLFWtls* tls) 54 | { 55 | if (tls->posix.allocated) 56 | pthread_key_delete(tls->posix.key); 57 | memset(tls, 0, sizeof(_GLFWtls)); 58 | } 59 | 60 | void* _glfwPlatformGetTls(_GLFWtls* tls) 61 | { 62 | assert(tls->posix.allocated == GLFW_TRUE); 63 | return pthread_getspecific(tls->posix.key); 64 | } 65 | 66 | void _glfwPlatformSetTls(_GLFWtls* tls, void* value) 67 | { 68 | assert(tls->posix.allocated == GLFW_TRUE); 69 | pthread_setspecific(tls->posix.key, value); 70 | } 71 | 72 | GLFWbool _glfwPlatformCreateMutex(_GLFWmutex* mutex) 73 | { 74 | assert(mutex->posix.allocated == GLFW_FALSE); 75 | 76 | if (pthread_mutex_init(&mutex->posix.handle, NULL) != 0) 77 | { 78 | _glfwInputError(GLFW_PLATFORM_ERROR, "POSIX: Failed to create mutex"); 79 | return GLFW_FALSE; 80 | } 81 | 82 | return mutex->posix.allocated = GLFW_TRUE; 83 | } 84 | 85 | void _glfwPlatformDestroyMutex(_GLFWmutex* mutex) 86 | { 87 | if (mutex->posix.allocated) 88 | pthread_mutex_destroy(&mutex->posix.handle); 89 | memset(mutex, 0, sizeof(_GLFWmutex)); 90 | } 91 | 92 | void _glfwPlatformLockMutex(_GLFWmutex* mutex) 93 | { 94 | assert(mutex->posix.allocated == GLFW_TRUE); 95 | pthread_mutex_lock(&mutex->posix.handle); 96 | } 97 | 98 | void _glfwPlatformUnlockMutex(_GLFWmutex* mutex) 99 | { 100 | assert(mutex->posix.allocated == GLFW_TRUE); 101 | pthread_mutex_unlock(&mutex->posix.handle); 102 | } 103 | 104 | -------------------------------------------------------------------------------- /task01-window/external/glfw/src/posix_thread.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 POSIX - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2016 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #include 29 | 30 | #define _GLFW_PLATFORM_TLS_STATE _GLFWtlsPOSIX posix 31 | #define _GLFW_PLATFORM_MUTEX_STATE _GLFWmutexPOSIX posix 32 | 33 | 34 | // POSIX-specific thread local storage data 35 | // 36 | typedef struct _GLFWtlsPOSIX 37 | { 38 | GLFWbool allocated; 39 | pthread_key_t key; 40 | 41 | } _GLFWtlsPOSIX; 42 | 43 | // POSIX-specific mutex data 44 | // 45 | typedef struct _GLFWmutexPOSIX 46 | { 47 | GLFWbool allocated; 48 | pthread_mutex_t handle; 49 | 50 | } _GLFWmutexPOSIX; 51 | 52 | -------------------------------------------------------------------------------- /task01-window/external/glfw/src/posix_time.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 POSIX - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2016 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #include "internal.h" 29 | 30 | #include 31 | #include 32 | 33 | 34 | ////////////////////////////////////////////////////////////////////////// 35 | ////// GLFW internal API ////// 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | // Initialise timer 39 | // 40 | void _glfwInitTimerPOSIX(void) 41 | { 42 | #if defined(CLOCK_MONOTONIC) 43 | struct timespec ts; 44 | 45 | if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) 46 | { 47 | _glfw.timer.posix.monotonic = GLFW_TRUE; 48 | _glfw.timer.posix.frequency = 1000000000; 49 | } 50 | else 51 | #endif 52 | { 53 | _glfw.timer.posix.monotonic = GLFW_FALSE; 54 | _glfw.timer.posix.frequency = 1000000; 55 | } 56 | } 57 | 58 | 59 | ////////////////////////////////////////////////////////////////////////// 60 | ////// GLFW platform API ////// 61 | ////////////////////////////////////////////////////////////////////////// 62 | 63 | uint64_t _glfwPlatformGetTimerValue(void) 64 | { 65 | #if defined(CLOCK_MONOTONIC) 66 | if (_glfw.timer.posix.monotonic) 67 | { 68 | struct timespec ts; 69 | clock_gettime(CLOCK_MONOTONIC, &ts); 70 | return (uint64_t) ts.tv_sec * (uint64_t) 1000000000 + (uint64_t) ts.tv_nsec; 71 | } 72 | else 73 | #endif 74 | { 75 | struct timeval tv; 76 | gettimeofday(&tv, NULL); 77 | return (uint64_t) tv.tv_sec * (uint64_t) 1000000 + (uint64_t) tv.tv_usec; 78 | } 79 | } 80 | 81 | uint64_t _glfwPlatformGetTimerFrequency(void) 82 | { 83 | return _glfw.timer.posix.frequency; 84 | } 85 | 86 | -------------------------------------------------------------------------------- /task01-window/external/glfw/src/posix_time.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 POSIX - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2016 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #define _GLFW_PLATFORM_LIBRARY_TIMER_STATE _GLFWtimerPOSIX posix 29 | 30 | #include 31 | 32 | 33 | // POSIX-specific global timer data 34 | // 35 | typedef struct _GLFWtimerPOSIX 36 | { 37 | GLFWbool monotonic; 38 | uint64_t frequency; 39 | 40 | } _GLFWtimerPOSIX; 41 | 42 | 43 | void _glfwInitTimerPOSIX(void); 44 | 45 | -------------------------------------------------------------------------------- /task01-window/external/glfw/src/wgl_context.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 WGL - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2016 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 29 | #define WGL_SUPPORT_OPENGL_ARB 0x2010 30 | #define WGL_DRAW_TO_WINDOW_ARB 0x2001 31 | #define WGL_PIXEL_TYPE_ARB 0x2013 32 | #define WGL_TYPE_RGBA_ARB 0x202b 33 | #define WGL_ACCELERATION_ARB 0x2003 34 | #define WGL_NO_ACCELERATION_ARB 0x2025 35 | #define WGL_RED_BITS_ARB 0x2015 36 | #define WGL_RED_SHIFT_ARB 0x2016 37 | #define WGL_GREEN_BITS_ARB 0x2017 38 | #define WGL_GREEN_SHIFT_ARB 0x2018 39 | #define WGL_BLUE_BITS_ARB 0x2019 40 | #define WGL_BLUE_SHIFT_ARB 0x201a 41 | #define WGL_ALPHA_BITS_ARB 0x201b 42 | #define WGL_ALPHA_SHIFT_ARB 0x201c 43 | #define WGL_ACCUM_BITS_ARB 0x201d 44 | #define WGL_ACCUM_RED_BITS_ARB 0x201e 45 | #define WGL_ACCUM_GREEN_BITS_ARB 0x201f 46 | #define WGL_ACCUM_BLUE_BITS_ARB 0x2020 47 | #define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 48 | #define WGL_DEPTH_BITS_ARB 0x2022 49 | #define WGL_STENCIL_BITS_ARB 0x2023 50 | #define WGL_AUX_BUFFERS_ARB 0x2024 51 | #define WGL_STEREO_ARB 0x2012 52 | #define WGL_DOUBLE_BUFFER_ARB 0x2011 53 | #define WGL_SAMPLES_ARB 0x2042 54 | #define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20a9 55 | #define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001 56 | #define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002 57 | #define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 58 | #define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 59 | #define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 60 | #define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 61 | #define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 62 | #define WGL_CONTEXT_FLAGS_ARB 0x2094 63 | #define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 64 | #define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 65 | #define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 66 | #define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 67 | #define WGL_NO_RESET_NOTIFICATION_ARB 0x8261 68 | #define WGL_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097 69 | #define WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0 70 | #define WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098 71 | #define WGL_CONTEXT_OPENGL_NO_ERROR_ARB 0x31b3 72 | #define WGL_COLORSPACE_EXT 0x309d 73 | #define WGL_COLORSPACE_SRGB_EXT 0x3089 74 | 75 | #define ERROR_INVALID_VERSION_ARB 0x2095 76 | #define ERROR_INVALID_PROFILE_ARB 0x2096 77 | #define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054 78 | 79 | typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC)(int); 80 | typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC)(HDC,int,int,UINT,const int*,int*); 81 | typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC)(void); 82 | typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC)(HDC); 83 | typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC)(HDC,HGLRC,const int*); 84 | 85 | typedef HGLRC (WINAPI * PFN_wglCreateContext)(HDC); 86 | typedef BOOL (WINAPI * PFN_wglDeleteContext)(HGLRC); 87 | typedef PROC (WINAPI * PFN_wglGetProcAddress)(LPCSTR); 88 | typedef HDC (WINAPI * PFN_wglGetCurrentDC)(void); 89 | typedef HGLRC (WINAPI * PFN_wglGetCurrentContext)(void); 90 | typedef BOOL (WINAPI * PFN_wglMakeCurrent)(HDC,HGLRC); 91 | typedef BOOL (WINAPI * PFN_wglShareLists)(HGLRC,HGLRC); 92 | 93 | // opengl32.dll function pointer typedefs 94 | #define wglCreateContext _glfw.wgl.CreateContext 95 | #define wglDeleteContext _glfw.wgl.DeleteContext 96 | #define wglGetProcAddress _glfw.wgl.GetProcAddress 97 | #define wglGetCurrentDC _glfw.wgl.GetCurrentDC 98 | #define wglGetCurrentContext _glfw.wgl.GetCurrentContext 99 | #define wglMakeCurrent _glfw.wgl.MakeCurrent 100 | #define wglShareLists _glfw.wgl.ShareLists 101 | 102 | #define _GLFW_RECREATION_NOT_NEEDED 0 103 | #define _GLFW_RECREATION_REQUIRED 1 104 | #define _GLFW_RECREATION_IMPOSSIBLE 2 105 | 106 | #define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextWGL wgl 107 | #define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE _GLFWlibraryWGL wgl 108 | 109 | 110 | // WGL-specific per-context data 111 | // 112 | typedef struct _GLFWcontextWGL 113 | { 114 | HDC dc; 115 | HGLRC handle; 116 | int interval; 117 | 118 | } _GLFWcontextWGL; 119 | 120 | // WGL-specific global data 121 | // 122 | typedef struct _GLFWlibraryWGL 123 | { 124 | HINSTANCE instance; 125 | PFN_wglCreateContext CreateContext; 126 | PFN_wglDeleteContext DeleteContext; 127 | PFN_wglGetProcAddress GetProcAddress; 128 | PFN_wglGetCurrentDC GetCurrentDC; 129 | PFN_wglGetCurrentContext GetCurrentContext; 130 | PFN_wglMakeCurrent MakeCurrent; 131 | PFN_wglShareLists ShareLists; 132 | 133 | PFNWGLSWAPINTERVALEXTPROC SwapIntervalEXT; 134 | PFNWGLGETPIXELFORMATATTRIBIVARBPROC GetPixelFormatAttribivARB; 135 | PFNWGLGETEXTENSIONSSTRINGEXTPROC GetExtensionsStringEXT; 136 | PFNWGLGETEXTENSIONSSTRINGARBPROC GetExtensionsStringARB; 137 | PFNWGLCREATECONTEXTATTRIBSARBPROC CreateContextAttribsARB; 138 | GLFWbool EXT_swap_control; 139 | GLFWbool EXT_colorspace; 140 | GLFWbool ARB_multisample; 141 | GLFWbool ARB_framebuffer_sRGB; 142 | GLFWbool EXT_framebuffer_sRGB; 143 | GLFWbool ARB_pixel_format; 144 | GLFWbool ARB_create_context; 145 | GLFWbool ARB_create_context_profile; 146 | GLFWbool EXT_create_context_es2_profile; 147 | GLFWbool ARB_create_context_robustness; 148 | GLFWbool ARB_create_context_no_error; 149 | GLFWbool ARB_context_flush_control; 150 | 151 | } _GLFWlibraryWGL; 152 | 153 | 154 | GLFWbool _glfwInitWGL(void); 155 | void _glfwTerminateWGL(void); 156 | GLFWbool _glfwCreateContextWGL(_GLFWwindow* window, 157 | const _GLFWctxconfig* ctxconfig, 158 | const _GLFWfbconfig* fbconfig); 159 | 160 | -------------------------------------------------------------------------------- /task01-window/external/glfw/src/win32_joystick.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 Win32 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2006-2016 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #define _GLFW_PLATFORM_JOYSTICK_STATE _GLFWjoystickWin32 win32 28 | #define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE int dummy 29 | 30 | #define _GLFW_PLATFORM_MAPPING_NAME "Windows" 31 | 32 | // Joystick element (axis, button or slider) 33 | // 34 | typedef struct _GLFWjoyobjectWin32 35 | { 36 | int offset; 37 | int type; 38 | } _GLFWjoyobjectWin32; 39 | 40 | // Win32-specific per-joystick data 41 | // 42 | typedef struct _GLFWjoystickWin32 43 | { 44 | _GLFWjoyobjectWin32* objects; 45 | int objectCount; 46 | IDirectInputDevice8W* device; 47 | DWORD index; 48 | GUID guid; 49 | } _GLFWjoystickWin32; 50 | 51 | 52 | void _glfwInitJoysticksWin32(void); 53 | void _glfwTerminateJoysticksWin32(void); 54 | void _glfwDetectJoystickConnectionWin32(void); 55 | void _glfwDetectJoystickDisconnectionWin32(void); 56 | 57 | -------------------------------------------------------------------------------- /task01-window/external/glfw/src/win32_thread.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 Win32 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2016 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #include "internal.h" 29 | 30 | #include 31 | 32 | 33 | ////////////////////////////////////////////////////////////////////////// 34 | ////// GLFW platform API ////// 35 | ////////////////////////////////////////////////////////////////////////// 36 | 37 | GLFWbool _glfwPlatformCreateTls(_GLFWtls* tls) 38 | { 39 | assert(tls->win32.allocated == GLFW_FALSE); 40 | 41 | tls->win32.index = TlsAlloc(); 42 | if (tls->win32.index == TLS_OUT_OF_INDEXES) 43 | { 44 | _glfwInputErrorWin32(GLFW_PLATFORM_ERROR, 45 | "Win32: Failed to allocate TLS index"); 46 | return GLFW_FALSE; 47 | } 48 | 49 | tls->win32.allocated = GLFW_TRUE; 50 | return GLFW_TRUE; 51 | } 52 | 53 | void _glfwPlatformDestroyTls(_GLFWtls* tls) 54 | { 55 | if (tls->win32.allocated) 56 | TlsFree(tls->win32.index); 57 | memset(tls, 0, sizeof(_GLFWtls)); 58 | } 59 | 60 | void* _glfwPlatformGetTls(_GLFWtls* tls) 61 | { 62 | assert(tls->win32.allocated == GLFW_TRUE); 63 | return TlsGetValue(tls->win32.index); 64 | } 65 | 66 | void _glfwPlatformSetTls(_GLFWtls* tls, void* value) 67 | { 68 | assert(tls->win32.allocated == GLFW_TRUE); 69 | TlsSetValue(tls->win32.index, value); 70 | } 71 | 72 | GLFWbool _glfwPlatformCreateMutex(_GLFWmutex* mutex) 73 | { 74 | assert(mutex->win32.allocated == GLFW_FALSE); 75 | InitializeCriticalSection(&mutex->win32.section); 76 | return mutex->win32.allocated = GLFW_TRUE; 77 | } 78 | 79 | void _glfwPlatformDestroyMutex(_GLFWmutex* mutex) 80 | { 81 | if (mutex->win32.allocated) 82 | DeleteCriticalSection(&mutex->win32.section); 83 | memset(mutex, 0, sizeof(_GLFWmutex)); 84 | } 85 | 86 | void _glfwPlatformLockMutex(_GLFWmutex* mutex) 87 | { 88 | assert(mutex->win32.allocated == GLFW_TRUE); 89 | EnterCriticalSection(&mutex->win32.section); 90 | } 91 | 92 | void _glfwPlatformUnlockMutex(_GLFWmutex* mutex) 93 | { 94 | assert(mutex->win32.allocated == GLFW_TRUE); 95 | LeaveCriticalSection(&mutex->win32.section); 96 | } 97 | 98 | -------------------------------------------------------------------------------- /task01-window/external/glfw/src/win32_time.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 Win32 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2016 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #include "internal.h" 29 | 30 | 31 | ////////////////////////////////////////////////////////////////////////// 32 | ////// GLFW internal API ////// 33 | ////////////////////////////////////////////////////////////////////////// 34 | 35 | // Initialise timer 36 | // 37 | void _glfwInitTimerWin32(void) 38 | { 39 | uint64_t frequency; 40 | 41 | if (QueryPerformanceFrequency((LARGE_INTEGER*) &frequency)) 42 | { 43 | _glfw.timer.win32.hasPC = GLFW_TRUE; 44 | _glfw.timer.win32.frequency = frequency; 45 | } 46 | else 47 | { 48 | _glfw.timer.win32.hasPC = GLFW_FALSE; 49 | _glfw.timer.win32.frequency = 1000; 50 | } 51 | } 52 | 53 | 54 | ////////////////////////////////////////////////////////////////////////// 55 | ////// GLFW platform API ////// 56 | ////////////////////////////////////////////////////////////////////////// 57 | 58 | uint64_t _glfwPlatformGetTimerValue(void) 59 | { 60 | if (_glfw.timer.win32.hasPC) 61 | { 62 | uint64_t value; 63 | QueryPerformanceCounter((LARGE_INTEGER*) &value); 64 | return value; 65 | } 66 | else 67 | return (uint64_t) timeGetTime(); 68 | } 69 | 70 | uint64_t _glfwPlatformGetTimerFrequency(void) 71 | { 72 | return _glfw.timer.win32.frequency; 73 | } 74 | 75 | -------------------------------------------------------------------------------- /task01-window/external/glfw/src/wl_monitor.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 Wayland - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2014 Jonas Ådahl 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #include "internal.h" 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | 35 | static void geometry(void* data, 36 | struct wl_output* output, 37 | int32_t x, 38 | int32_t y, 39 | int32_t physicalWidth, 40 | int32_t physicalHeight, 41 | int32_t subpixel, 42 | const char* make, 43 | const char* model, 44 | int32_t transform) 45 | { 46 | struct _GLFWmonitor *monitor = data; 47 | char name[1024]; 48 | 49 | monitor->wl.x = x; 50 | monitor->wl.y = y; 51 | monitor->widthMM = physicalWidth; 52 | monitor->heightMM = physicalHeight; 53 | 54 | snprintf(name, sizeof(name), "%s %s", make, model); 55 | monitor->name = _glfw_strdup(name); 56 | } 57 | 58 | static void mode(void* data, 59 | struct wl_output* output, 60 | uint32_t flags, 61 | int32_t width, 62 | int32_t height, 63 | int32_t refresh) 64 | { 65 | struct _GLFWmonitor *monitor = data; 66 | GLFWvidmode mode; 67 | 68 | mode.width = width; 69 | mode.height = height; 70 | mode.redBits = 8; 71 | mode.greenBits = 8; 72 | mode.blueBits = 8; 73 | mode.refreshRate = refresh / 1000; 74 | 75 | monitor->modeCount++; 76 | monitor->modes = 77 | realloc(monitor->modes, monitor->modeCount * sizeof(GLFWvidmode)); 78 | monitor->modes[monitor->modeCount - 1] = mode; 79 | 80 | if (flags & WL_OUTPUT_MODE_CURRENT) 81 | monitor->wl.currentMode = monitor->modeCount - 1; 82 | } 83 | 84 | static void done(void* data, struct wl_output* output) 85 | { 86 | struct _GLFWmonitor *monitor = data; 87 | 88 | _glfwInputMonitor(monitor, GLFW_CONNECTED, _GLFW_INSERT_LAST); 89 | } 90 | 91 | static void scale(void* data, 92 | struct wl_output* output, 93 | int32_t factor) 94 | { 95 | struct _GLFWmonitor *monitor = data; 96 | 97 | monitor->wl.scale = factor; 98 | } 99 | 100 | static const struct wl_output_listener outputListener = { 101 | geometry, 102 | mode, 103 | done, 104 | scale, 105 | }; 106 | 107 | 108 | ////////////////////////////////////////////////////////////////////////// 109 | ////// GLFW internal API ////// 110 | ////////////////////////////////////////////////////////////////////////// 111 | 112 | void _glfwAddOutputWayland(uint32_t name, uint32_t version) 113 | { 114 | _GLFWmonitor *monitor; 115 | struct wl_output *output; 116 | 117 | if (version < 2) 118 | { 119 | _glfwInputError(GLFW_PLATFORM_ERROR, 120 | "Wayland: Unsupported output interface version"); 121 | return; 122 | } 123 | 124 | // The actual name of this output will be set in the geometry handler. 125 | monitor = _glfwAllocMonitor(NULL, 0, 0); 126 | 127 | output = wl_registry_bind(_glfw.wl.registry, 128 | name, 129 | &wl_output_interface, 130 | 2); 131 | if (!output) 132 | { 133 | _glfwFreeMonitor(monitor); 134 | return; 135 | } 136 | 137 | monitor->wl.scale = 1; 138 | monitor->wl.output = output; 139 | monitor->wl.name = name; 140 | 141 | wl_output_add_listener(output, &outputListener, monitor); 142 | } 143 | 144 | 145 | ////////////////////////////////////////////////////////////////////////// 146 | ////// GLFW platform API ////// 147 | ////////////////////////////////////////////////////////////////////////// 148 | 149 | void _glfwPlatformFreeMonitor(_GLFWmonitor* monitor) 150 | { 151 | if (monitor->wl.output) 152 | wl_output_destroy(monitor->wl.output); 153 | } 154 | 155 | void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos) 156 | { 157 | if (xpos) 158 | *xpos = monitor->wl.x; 159 | if (ypos) 160 | *ypos = monitor->wl.y; 161 | } 162 | 163 | void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor, 164 | float* xscale, float* yscale) 165 | { 166 | if (xscale) 167 | *xscale = (float) monitor->wl.scale; 168 | if (yscale) 169 | *yscale = (float) monitor->wl.scale; 170 | } 171 | 172 | GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found) 173 | { 174 | *found = monitor->modeCount; 175 | return monitor->modes; 176 | } 177 | 178 | void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode) 179 | { 180 | *mode = monitor->modes[monitor->wl.currentMode]; 181 | } 182 | 183 | void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp) 184 | { 185 | // TODO 186 | _glfwInputError(GLFW_PLATFORM_ERROR, 187 | "Wayland: Gamma ramp getting not supported yet"); 188 | } 189 | 190 | void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp) 191 | { 192 | // TODO 193 | _glfwInputError(GLFW_PLATFORM_ERROR, 194 | "Wayland: Gamma ramp setting not supported yet"); 195 | } 196 | 197 | 198 | ////////////////////////////////////////////////////////////////////////// 199 | ////// GLFW native API ////// 200 | ////////////////////////////////////////////////////////////////////////// 201 | 202 | GLFWAPI struct wl_output* glfwGetWaylandMonitor(GLFWmonitor* handle) 203 | { 204 | _GLFWmonitor* monitor = (_GLFWmonitor*) handle; 205 | _GLFW_REQUIRE_INIT_OR_RETURN(NULL); 206 | return monitor->wl.output; 207 | } 208 | 209 | -------------------------------------------------------------------------------- /task01-window/external/glfw/src/xkb_unicode.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 Linux - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2014 Jonas Ådahl 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | long _glfwKeySym2Unicode(unsigned int keysym); 28 | 29 | -------------------------------------------------------------------------------- /task01-window/src/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JILLWONG/Computer_Graphics/0dba8273bc9f2f1fd67b565beb4c03a531594cd2/task01-window/src/main.cpp -------------------------------------------------------------------------------- /task02-triangle/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.0) 2 | 3 | project(Task-triangle) 4 | 5 | set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) 6 | set(CMAKE_SUPPRESS_REGENERATION ON) 7 | 8 | option(GLFW_BUILD_DOCS OFF) 9 | option(GLFW_BUILD_EXAMPLES OFF) 10 | option(GLFW_BUILD_TESTS OFF) 11 | option(GLFW_INSTALL OFF) 12 | add_subdirectory(external/glfw) 13 | 14 | if(MSVC) 15 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") 16 | else() 17 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -std=c++11") 18 | if(NOT WIN32) 19 | set(GLAD_LIBRARIES dl) 20 | endif() 21 | endif() 22 | 23 | include_directories(include/ 24 | external/glad/include/ 25 | external/glfw/include/ 26 | external/stb) 27 | 28 | file(GLOB EXTERNAL_SOURCES external/glad/src/glad.c 29 | external/stb/stb_image.cpp) 30 | file(GLOB PROJECT_HEADERS include/*.h) 31 | file(GLOB PROJECT_SOURCES src/*.cpp) 32 | 33 | source_group("Headers" FILES ${PROJECT_HEADERS}) 34 | source_group("Sources" FILES ${PROJECT_SOURCES}) 35 | source_group("Externals" FILES ${EXTERNAL_SOURCES}) 36 | 37 | add_definitions(-DGLFW_INCLUDE_NONE 38 | -DPROJECT_SOURCE_DIR=\"${PROJECT_SOURCE_DIR}\") 39 | add_executable(${PROJECT_NAME} ${PROJECT_SOURCES} ${PROJECT_HEADERS} 40 | ${EXTERNAL_SOURCES}) 41 | 42 | target_link_libraries(${PROJECT_NAME} glfw 43 | ${GLFW_LIBRARIES} ${GLAD_LIBRARIES}) 44 | set_target_properties(${PROJECT_NAME} PROPERTIES 45 | RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/${PROJECT_NAME}_Debug 46 | RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/${PROJECT_NAME}_Release) 47 | if(MSVC) 48 | set_target_properties(${PROJECT_NAME} PROPERTIES 49 | VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) 50 | endif() 51 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/.appveyor.yml: -------------------------------------------------------------------------------- 1 | branches: 2 | only: 3 | - ci 4 | - master 5 | skip_tags: true 6 | environment: 7 | CFLAGS: /WX 8 | matrix: 9 | - BUILD_SHARED_LIBS: ON 10 | - BUILD_SHARED_LIBS: OFF 11 | matrix: 12 | fast_finish: true 13 | build_script: 14 | - mkdir build 15 | - cd build 16 | - cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_SHARED_LIBS=%BUILD_SHARED_LIBS% .. 17 | - cmake --build . 18 | notifications: 19 | - provider: Email 20 | to: 21 | - ci@glfw.org 22 | on_build_failure: true 23 | on_build_success: false 24 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | compiler: clang 3 | branches: 4 | only: 5 | - ci 6 | - master 7 | sudo: false 8 | dist: trusty 9 | addons: 10 | apt: 11 | packages: 12 | - cmake 13 | - libxrandr-dev 14 | - libxinerama-dev 15 | - libxcursor-dev 16 | - libxi-dev 17 | matrix: 18 | include: 19 | - os: linux 20 | env: 21 | - BUILD_SHARED_LIBS=ON 22 | - CFLAGS=-Werror 23 | - os: linux 24 | env: 25 | - BUILD_SHARED_LIBS=OFF 26 | - CFLAGS=-Werror 27 | - os: linux 28 | sudo: required 29 | addons: 30 | apt: 31 | packages: 32 | - libwayland-dev 33 | - libxkbcommon-dev 34 | - libegl1-mesa-dev 35 | env: 36 | - USE_WAYLAND=ON 37 | - BUILD_SHARED_LIBS=ON 38 | - CFLAGS=-Werror 39 | - os: linux 40 | sudo: required 41 | addons: 42 | apt: 43 | packages: 44 | - libwayland-dev 45 | - libxkbcommon-dev 46 | - libegl1-mesa-dev 47 | env: 48 | - USE_WAYLAND=ON 49 | - BUILD_SHARED_LIBS=OFF 50 | - CFLAGS=-Werror 51 | - os: osx 52 | env: 53 | - BUILD_SHARED_LIBS=ON 54 | - CFLAGS=-Werror 55 | - os: osx 56 | env: 57 | - BUILD_SHARED_LIBS=OFF 58 | - CFLAGS=-Werror 59 | script: 60 | - if grep -Inr '\s$' src include docs tests examples CMake *.md .gitattributes .gitignore; then echo Trailing whitespace found, aborting.; exit 1; fi 61 | - mkdir build 62 | - cd build 63 | - if test -n "${USE_WAYLAND}"; 64 | then wget https://mirrors.kernel.org/ubuntu/pool/universe/e/extra-cmake-modules/extra-cmake-modules_5.38.0a-0ubuntu1_amd64.deb; 65 | sudo dpkg -i extra-cmake-modules_5.38.0a-0ubuntu1_amd64.deb; 66 | git clone git://anongit.freedesktop.org/wayland/wayland-protocols; 67 | pushd wayland-protocols; 68 | git checkout 1.12 && ./autogen.sh --prefix=/usr && make && sudo make install; 69 | popd; 70 | fi 71 | - cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} -DGLFW_USE_WAYLAND=${USE_WAYLAND} .. 72 | - cmake --build . 73 | notifications: 74 | email: 75 | recipients: 76 | - ci@glfw.org 77 | on_success: never 78 | on_failure: always 79 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/CMake/GenerateMappings.cmake: -------------------------------------------------------------------------------- 1 | # Usage: 2 | # cmake -P GenerateMappings.cmake 3 | 4 | set(source_url "https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt") 5 | set(source_path "${CMAKE_CURRENT_BINARY_DIR}/gamecontrollerdb.txt") 6 | set(template_path "${CMAKE_ARGV3}") 7 | set(target_path "${CMAKE_ARGV4}") 8 | 9 | if (NOT EXISTS "${template_path}") 10 | message(FATAL_ERROR "Failed to find template file ${template_path}") 11 | endif() 12 | 13 | file(DOWNLOAD "${source_url}" "${source_path}" 14 | STATUS download_status 15 | TLS_VERIFY on) 16 | 17 | list(GET download_status 0 status_code) 18 | list(GET download_status 1 status_message) 19 | 20 | if (status_code) 21 | message(FATAL_ERROR "Failed to download ${source_url}: ${status_message}") 22 | endif() 23 | 24 | file(STRINGS "${source_path}" lines) 25 | foreach(line ${lines}) 26 | if ("${line}" MATCHES "^[0-9a-fA-F].*$") 27 | set(GLFW_GAMEPAD_MAPPINGS "${GLFW_GAMEPAD_MAPPINGS}\"${line}\",\n") 28 | endif() 29 | endforeach() 30 | 31 | configure_file("${template_path}" "${target_path}" @ONLY NEWLINE_STYLE UNIX) 32 | file(REMOVE "${source_path}") 33 | 34 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/CMake/MacOSXBundleInfo.plist.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${MACOSX_BUNDLE_EXECUTABLE_NAME} 9 | CFBundleGetInfoString 10 | ${MACOSX_BUNDLE_INFO_STRING} 11 | CFBundleIconFile 12 | ${MACOSX_BUNDLE_ICON_FILE} 13 | CFBundleIdentifier 14 | ${MACOSX_BUNDLE_GUI_IDENTIFIER} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleLongVersionString 18 | ${MACOSX_BUNDLE_LONG_VERSION_STRING} 19 | CFBundleName 20 | ${MACOSX_BUNDLE_BUNDLE_NAME} 21 | CFBundlePackageType 22 | APPL 23 | CFBundleShortVersionString 24 | ${MACOSX_BUNDLE_SHORT_VERSION_STRING} 25 | CFBundleSignature 26 | ???? 27 | CFBundleVersion 28 | ${MACOSX_BUNDLE_BUNDLE_VERSION} 29 | CSResourcesFileMapped 30 | 31 | LSRequiresCarbon 32 | 33 | NSHumanReadableCopyright 34 | ${MACOSX_BUNDLE_COPYRIGHT} 35 | NSHighResolutionCapable 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/CMake/amd64-mingw32msvc.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross compiling from Linux to Win64 2 | SET(CMAKE_SYSTEM_NAME Windows) 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "amd64-mingw32msvc-gcc") 5 | SET(CMAKE_CXX_COMPILER "amd64-mingw32msvc-g++") 6 | SET(CMAKE_RC_COMPILER "amd64-mingw32msvc-windres") 7 | SET(CMAKE_RANLIB "amd64-mingw32msvc-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/amd64-mingw32msvc") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/CMake/i586-mingw32msvc.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross compiling from Linux to Win32 2 | SET(CMAKE_SYSTEM_NAME Windows) 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "i586-mingw32msvc-gcc") 5 | SET(CMAKE_CXX_COMPILER "i586-mingw32msvc-g++") 6 | SET(CMAKE_RC_COMPILER "i586-mingw32msvc-windres") 7 | SET(CMAKE_RANLIB "i586-mingw32msvc-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/i586-mingw32msvc") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/CMake/i686-pc-mingw32.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross compiling from Linux to Win32 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "i686-pc-mingw32-gcc") 5 | SET(CMAKE_CXX_COMPILER "i686-pc-mingw32-g++") 6 | SET(CMAKE_RC_COMPILER "i686-pc-mingw32-windres") 7 | SET(CMAKE_RANLIB "i686-pc-mingw32-ranlib") 8 | 9 | #Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/opt/mingw/usr/i686-pc-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/CMake/i686-w64-mingw32.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross compiling from Linux to Win32 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "i686-w64-mingw32-gcc") 5 | SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-g++") 6 | SET(CMAKE_RC_COMPILER "i686-w64-mingw32-windres") 7 | SET(CMAKE_RANLIB "i686-w64-mingw32-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/CMake/modules/FindMir.cmake: -------------------------------------------------------------------------------- 1 | # FindMir 2 | # ------- 3 | # Finds the Mir library 4 | # 5 | # This will will define the following variables:: 6 | # 7 | # MIR_FOUND - the system has Mir 8 | # MIR_INCLUDE_DIRS - the Mir include directory 9 | # MIR_LIBRARIES - the Mir libraries 10 | # MIR_DEFINITIONS - the Mir definitions 11 | 12 | 13 | find_package (PkgConfig) 14 | if(PKG_CONFIG_FOUND) 15 | pkg_check_modules (PC_MIR mirclient>=0.26.2 QUIET) 16 | 17 | find_path(MIR_INCLUDE_DIR NAMES mir_toolkit/mir_client_library.h 18 | PATHS ${PC_MIR_INCLUDE_DIRS}) 19 | 20 | find_library(MIR_LIBRARY NAMES mirclient 21 | PATHS ${PC_MIR_LIBRARIES} ${PC_MIR_LIBRARY_DIRS}) 22 | 23 | include (FindPackageHandleStandardArgs) 24 | find_package_handle_standard_args (MIR 25 | REQUIRED_VARS MIR_LIBRARY MIR_INCLUDE_DIR) 26 | 27 | if (MIR_FOUND) 28 | set(MIR_LIBRARIES ${MIR_LIBRARY}) 29 | set(MIR_INCLUDE_DIRS ${PC_MIR_INCLUDE_DIRS}) 30 | set(MIR_DEFINITIONS -DHAVE_MIR=1) 31 | endif() 32 | 33 | mark_as_advanced (MIR_LIBRARY MIR_INCLUDE_DIR) 34 | endif() 35 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/CMake/modules/FindOSMesa.cmake: -------------------------------------------------------------------------------- 1 | # Try to find OSMesa on a Unix system 2 | # 3 | # This will define: 4 | # 5 | # OSMESA_LIBRARIES - Link these to use OSMesa 6 | # OSMESA_INCLUDE_DIR - Include directory for OSMesa 7 | # 8 | # Copyright (c) 2014 Brandon Schaefer 9 | 10 | if (NOT WIN32) 11 | 12 | find_package (PkgConfig) 13 | pkg_check_modules (PKG_OSMESA QUIET osmesa) 14 | 15 | set (OSMESA_INCLUDE_DIR ${PKG_OSMESA_INCLUDE_DIRS}) 16 | set (OSMESA_LIBRARIES ${PKG_OSMESA_LIBRARIES}) 17 | 18 | endif () 19 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/CMake/modules/FindVulkan.cmake: -------------------------------------------------------------------------------- 1 | # Find Vulkan 2 | # 3 | # VULKAN_INCLUDE_DIR 4 | # VULKAN_LIBRARY 5 | # VULKAN_FOUND 6 | 7 | if (WIN32) 8 | find_path(VULKAN_INCLUDE_DIR NAMES vulkan/vulkan.h HINTS 9 | "$ENV{VULKAN_SDK}/Include" 10 | "$ENV{VK_SDK_PATH}/Include") 11 | if (CMAKE_SIZEOF_VOID_P EQUAL 8) 12 | find_library(VULKAN_LIBRARY NAMES vulkan-1 HINTS 13 | "$ENV{VULKAN_SDK}/Lib" 14 | "$ENV{VULKAN_SDK}/Bin" 15 | "$ENV{VK_SDK_PATH}/Bin") 16 | find_library(VULKAN_STATIC_LIBRARY NAMES vkstatic.1 HINTS 17 | "$ENV{VULKAN_SDK}/Lib" 18 | "$ENV{VULKAN_SDK}/Bin" 19 | "$ENV{VK_SDK_PATH}/Bin") 20 | else() 21 | find_library(VULKAN_LIBRARY NAMES vulkan-1 HINTS 22 | "$ENV{VULKAN_SDK}/Lib32" 23 | "$ENV{VULKAN_SDK}/Bin32" 24 | "$ENV{VK_SDK_PATH}/Bin32") 25 | find_library(VULKAN_STATIC_LIBRARY NAMES vkstatic.1 HINTS 26 | "$ENV{VULKAN_SDK}/Lib32" 27 | "$ENV{VULKAN_SDK}/Bin32" 28 | "$ENV{VK_SDK_PATH}/Bin32") 29 | endif() 30 | elseif (APPLE) 31 | find_library(VULKAN_LIBRARY vulkan.1 HINTS 32 | "$ENV{VULKAN_SDK}/macOS/lib") 33 | find_path(VULKAN_INCLUDE_DIR NAMES vulkan/vulkan.h HINTS 34 | "$ENV{VULKAN_SDK}/macOS/include") 35 | else() 36 | find_path(VULKAN_INCLUDE_DIR NAMES vulkan/vulkan.h HINTS 37 | "$ENV{VULKAN_SDK}/include") 38 | find_library(VULKAN_LIBRARY NAMES vulkan HINTS 39 | "$ENV{VULKAN_SDK}/lib") 40 | endif() 41 | 42 | include(FindPackageHandleStandardArgs) 43 | find_package_handle_standard_args(Vulkan DEFAULT_MSG VULKAN_LIBRARY VULKAN_INCLUDE_DIR) 44 | 45 | mark_as_advanced(VULKAN_INCLUDE_DIR VULKAN_LIBRARY VULKAN_STATIC_LIBRARY) 46 | 47 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/CMake/modules/FindWaylandProtocols.cmake: -------------------------------------------------------------------------------- 1 | find_package(PkgConfig) 2 | 3 | pkg_check_modules(WaylandProtocols QUIET wayland-protocols>=${WaylandProtocols_FIND_VERSION}) 4 | 5 | execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir wayland-protocols 6 | OUTPUT_VARIABLE WaylandProtocols_PKGDATADIR 7 | RESULT_VARIABLE _pkgconfig_failed) 8 | if (_pkgconfig_failed) 9 | message(FATAL_ERROR "Missing wayland-protocols pkgdatadir") 10 | endif() 11 | 12 | string(REGEX REPLACE "[\r\n]" "" WaylandProtocols_PKGDATADIR "${WaylandProtocols_PKGDATADIR}") 13 | 14 | find_package_handle_standard_args(WaylandProtocols 15 | FOUND_VAR 16 | WaylandProtocols_FOUND 17 | REQUIRED_VARS 18 | WaylandProtocols_PKGDATADIR 19 | VERSION_VAR 20 | WaylandProtocols_VERSION 21 | HANDLE_COMPONENTS 22 | ) 23 | 24 | set(WAYLAND_PROTOCOLS_FOUND ${WaylandProtocols_FOUND}) 25 | set(WAYLAND_PROTOCOLS_PKGDATADIR ${WaylandProtocols_PKGDATADIR}) 26 | set(WAYLAND_PROTOCOLS_VERSION ${WaylandProtocols_VERSION}) 27 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/CMake/modules/FindXKBCommon.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find XKBCommon 2 | # Once done, this will define 3 | # 4 | # XKBCOMMON_FOUND - System has XKBCommon 5 | # XKBCOMMON_INCLUDE_DIRS - The XKBCommon include directories 6 | # XKBCOMMON_LIBRARIES - The libraries needed to use XKBCommon 7 | # XKBCOMMON_DEFINITIONS - Compiler switches required for using XKBCommon 8 | 9 | find_package(PkgConfig) 10 | pkg_check_modules(PC_XKBCOMMON QUIET xkbcommon) 11 | set(XKBCOMMON_DEFINITIONS ${PC_XKBCOMMON_CFLAGS_OTHER}) 12 | 13 | find_path(XKBCOMMON_INCLUDE_DIR 14 | NAMES xkbcommon/xkbcommon.h 15 | HINTS ${PC_XKBCOMMON_INCLUDE_DIR} ${PC_XKBCOMMON_INCLUDE_DIRS} 16 | ) 17 | 18 | find_library(XKBCOMMON_LIBRARY 19 | NAMES xkbcommon 20 | HINTS ${PC_XKBCOMMON_LIBRARY} ${PC_XKBCOMMON_LIBRARY_DIRS} 21 | ) 22 | 23 | set(XKBCOMMON_LIBRARIES ${XKBCOMMON_LIBRARY}) 24 | set(XKBCOMMON_LIBRARY_DIRS ${XKBCOMMON_LIBRARY_DIRS}) 25 | set(XKBCOMMON_INCLUDE_DIRS ${XKBCOMMON_INCLUDE_DIR}) 26 | 27 | include(FindPackageHandleStandardArgs) 28 | find_package_handle_standard_args(XKBCommon DEFAULT_MSG 29 | XKBCOMMON_LIBRARY 30 | XKBCOMMON_INCLUDE_DIR 31 | ) 32 | 33 | mark_as_advanced(XKBCOMMON_LIBRARY XKBCOMMON_INCLUDE_DIR) 34 | 35 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/CMake/x86_64-w64-mingw32.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross compiling from Linux to Win32 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-gcc") 5 | SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-g++") 6 | SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres") 7 | SET(CMAKE_RANLIB "x86_64-w64-mingw32-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | 2 | if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 3 | message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") 4 | endif() 5 | 6 | file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 7 | string(REGEX REPLACE "\n" ";" files "${files}") 8 | 9 | foreach (file ${files}) 10 | message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") 11 | if (EXISTS "$ENV{DESTDIR}${file}") 12 | exec_program("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 13 | OUTPUT_VARIABLE rm_out 14 | RETURN_VALUE rm_retval) 15 | if (NOT "${rm_retval}" STREQUAL 0) 16 | MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 17 | endif() 18 | elseif (IS_SYMLINK "$ENV{DESTDIR}${file}") 19 | EXEC_PROGRAM("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 20 | OUTPUT_VARIABLE rm_out 21 | RETURN_VALUE rm_retval) 22 | if (NOT "${rm_retval}" STREQUAL 0) 23 | message(FATAL_ERROR "Problem when removing symlink \"$ENV{DESTDIR}${file}\"") 24 | endif() 25 | else() 26 | message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") 27 | endif() 28 | endforeach() 29 | 30 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/deps/getopt.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, Kim Gräsman 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * * Redistributions of source code must retain the above copyright notice, 7 | * this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above copyright notice, 9 | * this list of conditions and the following disclaimer in the documentation 10 | * and/or other materials provided with the distribution. 11 | * * Neither the name of Kim Gräsman nor the names of contributors may be used 12 | * to endorse or promote products derived from this software without specific 13 | * prior written permission. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | * ARE DISCLAIMED. IN NO EVENT SHALL KIM GRÄSMAN BE LIABLE FOR ANY DIRECT, 19 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef INCLUDED_GETOPT_PORT_H 28 | #define INCLUDED_GETOPT_PORT_H 29 | 30 | #if defined(__cplusplus) 31 | extern "C" { 32 | #endif 33 | 34 | extern const int no_argument; 35 | extern const int required_argument; 36 | extern const int optional_argument; 37 | 38 | extern char* optarg; 39 | extern int optind, opterr, optopt; 40 | 41 | struct option { 42 | const char* name; 43 | int has_arg; 44 | int* flag; 45 | int val; 46 | }; 47 | 48 | int getopt(int argc, char* const argv[], const char* optstring); 49 | 50 | int getopt_long(int argc, char* const argv[], 51 | const char* optstring, const struct option* longopts, int* longindex); 52 | 53 | #if defined(__cplusplus) 54 | } 55 | #endif 56 | 57 | #endif // INCLUDED_GETOPT_PORT_H 58 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/deps/mingw/_mingw_dxhelper.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the mingw-w64 runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | 7 | #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS) 8 | #define NONAMELESSUNION 1 9 | #endif 10 | #if defined(NONAMELESSSTRUCT) && \ 11 | !defined(NONAMELESSUNION) 12 | #define NONAMELESSUNION 1 13 | #endif 14 | #if defined(NONAMELESSUNION) && \ 15 | !defined(NONAMELESSSTRUCT) 16 | #define NONAMELESSSTRUCT 1 17 | #endif 18 | #if !defined(__GNU_EXTENSION) 19 | #if defined(__GNUC__) || defined(__GNUG__) 20 | #define __GNU_EXTENSION __extension__ 21 | #else 22 | #define __GNU_EXTENSION 23 | #endif 24 | #endif /* __extension__ */ 25 | 26 | #ifndef __ANONYMOUS_DEFINED 27 | #define __ANONYMOUS_DEFINED 28 | #if defined(__GNUC__) || defined(__GNUG__) 29 | #define _ANONYMOUS_UNION __extension__ 30 | #define _ANONYMOUS_STRUCT __extension__ 31 | #else 32 | #define _ANONYMOUS_UNION 33 | #define _ANONYMOUS_STRUCT 34 | #endif 35 | #ifndef NONAMELESSUNION 36 | #define _UNION_NAME(x) 37 | #define _STRUCT_NAME(x) 38 | #else /* NONAMELESSUNION */ 39 | #define _UNION_NAME(x) x 40 | #define _STRUCT_NAME(x) x 41 | #endif 42 | #endif /* __ANONYMOUS_DEFINED */ 43 | 44 | #ifndef DUMMYUNIONNAME 45 | # ifdef NONAMELESSUNION 46 | # define DUMMYUNIONNAME u 47 | # define DUMMYUNIONNAME1 u1 /* Wine uses this variant */ 48 | # define DUMMYUNIONNAME2 u2 49 | # define DUMMYUNIONNAME3 u3 50 | # define DUMMYUNIONNAME4 u4 51 | # define DUMMYUNIONNAME5 u5 52 | # define DUMMYUNIONNAME6 u6 53 | # define DUMMYUNIONNAME7 u7 54 | # define DUMMYUNIONNAME8 u8 55 | # define DUMMYUNIONNAME9 u9 56 | # else /* NONAMELESSUNION */ 57 | # define DUMMYUNIONNAME 58 | # define DUMMYUNIONNAME1 /* Wine uses this variant */ 59 | # define DUMMYUNIONNAME2 60 | # define DUMMYUNIONNAME3 61 | # define DUMMYUNIONNAME4 62 | # define DUMMYUNIONNAME5 63 | # define DUMMYUNIONNAME6 64 | # define DUMMYUNIONNAME7 65 | # define DUMMYUNIONNAME8 66 | # define DUMMYUNIONNAME9 67 | # endif 68 | #endif /* DUMMYUNIONNAME */ 69 | 70 | #if !defined(DUMMYUNIONNAME1) /* MinGW does not define this one */ 71 | # ifdef NONAMELESSUNION 72 | # define DUMMYUNIONNAME1 u1 /* Wine uses this variant */ 73 | # else 74 | # define DUMMYUNIONNAME1 /* Wine uses this variant */ 75 | # endif 76 | #endif /* DUMMYUNIONNAME1 */ 77 | 78 | #ifndef DUMMYSTRUCTNAME 79 | # ifdef NONAMELESSUNION 80 | # define DUMMYSTRUCTNAME s 81 | # define DUMMYSTRUCTNAME1 s1 /* Wine uses this variant */ 82 | # define DUMMYSTRUCTNAME2 s2 83 | # define DUMMYSTRUCTNAME3 s3 84 | # define DUMMYSTRUCTNAME4 s4 85 | # define DUMMYSTRUCTNAME5 s5 86 | # else 87 | # define DUMMYSTRUCTNAME 88 | # define DUMMYSTRUCTNAME1 /* Wine uses this variant */ 89 | # define DUMMYSTRUCTNAME2 90 | # define DUMMYSTRUCTNAME3 91 | # define DUMMYSTRUCTNAME4 92 | # define DUMMYSTRUCTNAME5 93 | # endif 94 | #endif /* DUMMYSTRUCTNAME */ 95 | 96 | /* These are for compatibility with the Wine source tree */ 97 | 98 | #ifndef WINELIB_NAME_AW 99 | # ifdef __MINGW_NAME_AW 100 | # define WINELIB_NAME_AW __MINGW_NAME_AW 101 | # else 102 | # ifdef UNICODE 103 | # define WINELIB_NAME_AW(func) func##W 104 | # else 105 | # define WINELIB_NAME_AW(func) func##A 106 | # endif 107 | # endif 108 | #endif /* WINELIB_NAME_AW */ 109 | 110 | #ifndef DECL_WINELIB_TYPE_AW 111 | # ifdef __MINGW_TYPEDEF_AW 112 | # define DECL_WINELIB_TYPE_AW __MINGW_TYPEDEF_AW 113 | # else 114 | # define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type; 115 | # endif 116 | #endif /* DECL_WINELIB_TYPE_AW */ 117 | 118 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/deps/vulkan/vk_platform.h: -------------------------------------------------------------------------------- 1 | // 2 | // File: vk_platform.h 3 | // 4 | /* 5 | ** Copyright (c) 2014-2015 The Khronos Group Inc. 6 | ** 7 | ** Licensed under the Apache License, Version 2.0 (the "License"); 8 | ** you may not use this file except in compliance with the License. 9 | ** You may obtain a copy of the License at 10 | ** 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** 13 | ** Unless required by applicable law or agreed to in writing, software 14 | ** distributed under the License is distributed on an "AS IS" BASIS, 15 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | ** See the License for the specific language governing permissions and 17 | ** limitations under the License. 18 | */ 19 | 20 | 21 | #ifndef VK_PLATFORM_H_ 22 | #define VK_PLATFORM_H_ 23 | 24 | #ifdef __cplusplus 25 | extern "C" 26 | { 27 | #endif // __cplusplus 28 | 29 | /* 30 | *************************************************************************************************** 31 | * Platform-specific directives and type declarations 32 | *************************************************************************************************** 33 | */ 34 | 35 | /* Platform-specific calling convention macros. 36 | * 37 | * Platforms should define these so that Vulkan clients call Vulkan commands 38 | * with the same calling conventions that the Vulkan implementation expects. 39 | * 40 | * VKAPI_ATTR - Placed before the return type in function declarations. 41 | * Useful for C++11 and GCC/Clang-style function attribute syntax. 42 | * VKAPI_CALL - Placed after the return type in function declarations. 43 | * Useful for MSVC-style calling convention syntax. 44 | * VKAPI_PTR - Placed between the '(' and '*' in function pointer types. 45 | * 46 | * Function declaration: VKAPI_ATTR void VKAPI_CALL vkCommand(void); 47 | * Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void); 48 | */ 49 | #if defined(_WIN32) 50 | // On Windows, Vulkan commands use the stdcall convention 51 | #define VKAPI_ATTR 52 | #define VKAPI_CALL __stdcall 53 | #define VKAPI_PTR VKAPI_CALL 54 | #elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7 55 | #error "Vulkan isn't supported for the 'armeabi' NDK ABI" 56 | #elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE) 57 | // On Android 32-bit ARM targets, Vulkan functions use the "hardfloat" 58 | // calling convention, i.e. float parameters are passed in registers. This 59 | // is true even if the rest of the application passes floats on the stack, 60 | // as it does by default when compiling for the armeabi-v7a NDK ABI. 61 | #define VKAPI_ATTR __attribute__((pcs("aapcs-vfp"))) 62 | #define VKAPI_CALL 63 | #define VKAPI_PTR VKAPI_ATTR 64 | #else 65 | // On other platforms, use the default calling convention 66 | #define VKAPI_ATTR 67 | #define VKAPI_CALL 68 | #define VKAPI_PTR 69 | #endif 70 | 71 | #include 72 | 73 | #if !defined(VK_NO_STDINT_H) 74 | #if defined(_MSC_VER) && (_MSC_VER < 1600) 75 | typedef signed __int8 int8_t; 76 | typedef unsigned __int8 uint8_t; 77 | typedef signed __int16 int16_t; 78 | typedef unsigned __int16 uint16_t; 79 | typedef signed __int32 int32_t; 80 | typedef unsigned __int32 uint32_t; 81 | typedef signed __int64 int64_t; 82 | typedef unsigned __int64 uint64_t; 83 | #else 84 | #include 85 | #endif 86 | #endif // !defined(VK_NO_STDINT_H) 87 | 88 | #ifdef __cplusplus 89 | } // extern "C" 90 | #endif // __cplusplus 91 | 92 | // Platform-specific headers required by platform window system extensions. 93 | // These are enabled prior to #including "vulkan.h". The same enable then 94 | // controls inclusion of the extension interfaces in vulkan.h. 95 | 96 | #ifdef VK_USE_PLATFORM_ANDROID_KHR 97 | #include 98 | #endif 99 | 100 | #ifdef VK_USE_PLATFORM_MIR_KHR 101 | #include 102 | #endif 103 | 104 | #ifdef VK_USE_PLATFORM_WAYLAND_KHR 105 | #include 106 | #endif 107 | 108 | #ifdef VK_USE_PLATFORM_WIN32_KHR 109 | #include 110 | #endif 111 | 112 | #ifdef VK_USE_PLATFORM_XLIB_KHR 113 | #include 114 | #endif 115 | 116 | #ifdef VK_USE_PLATFORM_XCB_KHR 117 | #include 118 | #endif 119 | 120 | #endif 121 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/src/cocoa_joystick.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 Cocoa - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2006-2016 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #define _GLFW_PLATFORM_JOYSTICK_STATE _GLFWjoystickNS ns 33 | #define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE 34 | 35 | #define _GLFW_PLATFORM_MAPPING_NAME "Mac OS X" 36 | 37 | // Cocoa-specific per-joystick data 38 | // 39 | typedef struct _GLFWjoystickNS 40 | { 41 | IOHIDDeviceRef device; 42 | CFMutableArrayRef axes; 43 | CFMutableArrayRef buttons; 44 | CFMutableArrayRef hats; 45 | } _GLFWjoystickNS; 46 | 47 | 48 | void _glfwInitJoysticksNS(void); 49 | void _glfwTerminateJoysticksNS(void); 50 | 51 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/src/cocoa_platform.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 macOS - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2009-2016 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #include 28 | #include 29 | 30 | #if defined(__OBJC__) 31 | #import 32 | #import 33 | #else 34 | #include 35 | #include 36 | typedef void* id; 37 | #endif 38 | 39 | typedef VkFlags VkMacOSSurfaceCreateFlagsMVK; 40 | 41 | typedef struct VkMacOSSurfaceCreateInfoMVK 42 | { 43 | VkStructureType sType; 44 | const void* pNext; 45 | VkMacOSSurfaceCreateFlagsMVK flags; 46 | const void* pView; 47 | } VkMacOSSurfaceCreateInfoMVK; 48 | 49 | typedef VkResult (APIENTRY *PFN_vkCreateMacOSSurfaceMVK)(VkInstance,const VkMacOSSurfaceCreateInfoMVK*,const VkAllocationCallbacks*,VkSurfaceKHR*); 50 | 51 | #include "posix_thread.h" 52 | #include "cocoa_joystick.h" 53 | #include "nsgl_context.h" 54 | #include "egl_context.h" 55 | #include "osmesa_context.h" 56 | 57 | #define _glfw_dlopen(name) dlopen(name, RTLD_LAZY | RTLD_LOCAL) 58 | #define _glfw_dlclose(handle) dlclose(handle) 59 | #define _glfw_dlsym(handle, name) dlsym(handle, name) 60 | 61 | #define _GLFW_EGL_NATIVE_WINDOW ((EGLNativeWindowType) window->ns.view) 62 | #define _GLFW_EGL_NATIVE_DISPLAY EGL_DEFAULT_DISPLAY 63 | 64 | #define _GLFW_PLATFORM_WINDOW_STATE _GLFWwindowNS ns 65 | #define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE _GLFWlibraryNS ns 66 | #define _GLFW_PLATFORM_LIBRARY_TIMER_STATE _GLFWtimerNS ns 67 | #define _GLFW_PLATFORM_MONITOR_STATE _GLFWmonitorNS ns 68 | #define _GLFW_PLATFORM_CURSOR_STATE _GLFWcursorNS ns 69 | 70 | // HIToolbox.framework pointer typedefs 71 | #define kTISPropertyUnicodeKeyLayoutData _glfw.ns.tis.kPropertyUnicodeKeyLayoutData 72 | typedef TISInputSourceRef (*PFN_TISCopyCurrentKeyboardLayoutInputSource)(void); 73 | #define TISCopyCurrentKeyboardLayoutInputSource _glfw.ns.tis.CopyCurrentKeyboardLayoutInputSource 74 | typedef void* (*PFN_TISGetInputSourceProperty)(TISInputSourceRef,CFStringRef); 75 | #define TISGetInputSourceProperty _glfw.ns.tis.GetInputSourceProperty 76 | typedef UInt8 (*PFN_LMGetKbdType)(void); 77 | #define LMGetKbdType _glfw.ns.tis.GetKbdType 78 | 79 | 80 | // Cocoa-specific per-window data 81 | // 82 | typedef struct _GLFWwindowNS 83 | { 84 | id object; 85 | id delegate; 86 | id view; 87 | id layer; 88 | 89 | GLFWbool maximized; 90 | 91 | // Cached window properties to filter out duplicate events 92 | int width, height; 93 | int fbWidth, fbHeight; 94 | float xscale, yscale; 95 | 96 | // The total sum of the distances the cursor has been warped 97 | // since the last cursor motion event was processed 98 | // This is kept to counteract Cocoa doing the same internally 99 | double cursorWarpDeltaX, cursorWarpDeltaY; 100 | 101 | } _GLFWwindowNS; 102 | 103 | // Cocoa-specific global data 104 | // 105 | typedef struct _GLFWlibraryNS 106 | { 107 | CGEventSourceRef eventSource; 108 | id delegate; 109 | id autoreleasePool; 110 | GLFWbool cursorHidden; 111 | TISInputSourceRef inputSource; 112 | IOHIDManagerRef hidManager; 113 | id unicodeData; 114 | id listener; 115 | 116 | char keyName[64]; 117 | short int keycodes[256]; 118 | short int scancodes[GLFW_KEY_LAST + 1]; 119 | char* clipboardString; 120 | CGPoint cascadePoint; 121 | // Where to place the cursor when re-enabled 122 | double restoreCursorPosX, restoreCursorPosY; 123 | // The window whose disabled cursor mode is active 124 | _GLFWwindow* disabledCursorWindow; 125 | 126 | struct { 127 | CFBundleRef bundle; 128 | PFN_TISCopyCurrentKeyboardLayoutInputSource CopyCurrentKeyboardLayoutInputSource; 129 | PFN_TISGetInputSourceProperty GetInputSourceProperty; 130 | PFN_LMGetKbdType GetKbdType; 131 | CFStringRef kPropertyUnicodeKeyLayoutData; 132 | } tis; 133 | 134 | } _GLFWlibraryNS; 135 | 136 | // Cocoa-specific per-monitor data 137 | // 138 | typedef struct _GLFWmonitorNS 139 | { 140 | CGDirectDisplayID displayID; 141 | CGDisplayModeRef previousMode; 142 | uint32_t unitNumber; 143 | id screen; 144 | 145 | } _GLFWmonitorNS; 146 | 147 | // Cocoa-specific per-cursor data 148 | // 149 | typedef struct _GLFWcursorNS 150 | { 151 | id object; 152 | 153 | } _GLFWcursorNS; 154 | 155 | // Cocoa-specific global timer data 156 | // 157 | typedef struct _GLFWtimerNS 158 | { 159 | uint64_t frequency; 160 | 161 | } _GLFWtimerNS; 162 | 163 | 164 | void _glfwInitTimerNS(void); 165 | 166 | void _glfwPollMonitorsNS(void); 167 | void _glfwSetVideoModeNS(_GLFWmonitor* monitor, const GLFWvidmode* desired); 168 | void _glfwRestoreVideoModeNS(_GLFWmonitor* monitor); 169 | 170 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/src/cocoa_time.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 macOS - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2009-2016 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #include "internal.h" 28 | 29 | #include 30 | 31 | 32 | ////////////////////////////////////////////////////////////////////////// 33 | ////// GLFW internal API ////// 34 | ////////////////////////////////////////////////////////////////////////// 35 | 36 | // Initialise timer 37 | // 38 | void _glfwInitTimerNS(void) 39 | { 40 | mach_timebase_info_data_t info; 41 | mach_timebase_info(&info); 42 | 43 | _glfw.timer.ns.frequency = (info.denom * 1e9) / info.numer; 44 | } 45 | 46 | 47 | ////////////////////////////////////////////////////////////////////////// 48 | ////// GLFW platform API ////// 49 | ////////////////////////////////////////////////////////////////////////// 50 | 51 | uint64_t _glfwPlatformGetTimerValue(void) 52 | { 53 | return mach_absolute_time(); 54 | } 55 | 56 | uint64_t _glfwPlatformGetTimerFrequency(void) 57 | { 58 | return _glfw.timer.ns.frequency; 59 | } 60 | 61 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/src/glfw3.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | includedir=${prefix}/include 4 | libdir=${exec_prefix}/lib@LIB_SUFFIX@ 5 | 6 | Name: GLFW 7 | Description: A multi-platform library for OpenGL, window and input 8 | Version: @GLFW_VERSION_FULL@ 9 | URL: http://www.glfw.org/ 10 | Requires.private: @GLFW_PKG_DEPS@ 11 | Libs: -L${libdir} -l@GLFW_LIB_NAME@ 12 | Libs.private: @GLFW_PKG_LIBS@ 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/src/glfw3Config.cmake.in: -------------------------------------------------------------------------------- 1 | include("${CMAKE_CURRENT_LIST_DIR}/glfw3Targets.cmake") 2 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/src/glfw_config.h.in: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2010-2016 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | // As glfw_config.h.in, this file is used by CMake to produce the 27 | // glfw_config.h configuration header file. If you are adding a feature 28 | // requiring conditional compilation, this is where to add the macro. 29 | //======================================================================== 30 | // As glfw_config.h, this file defines compile-time option macros for a 31 | // specific platform and development environment. If you are using the 32 | // GLFW CMake files, modify glfw_config.h.in instead of this file. If you 33 | // are using your own build system, make this file define the appropriate 34 | // macros in whatever way is suitable. 35 | //======================================================================== 36 | 37 | // Define this to 1 if building GLFW for X11 38 | #cmakedefine _GLFW_X11 39 | // Define this to 1 if building GLFW for Win32 40 | #cmakedefine _GLFW_WIN32 41 | // Define this to 1 if building GLFW for Cocoa 42 | #cmakedefine _GLFW_COCOA 43 | // Define this to 1 if building GLFW for Wayland 44 | #cmakedefine _GLFW_WAYLAND 45 | // Define this to 1 if building GLFW for Mir 46 | #cmakedefine _GLFW_MIR 47 | // Define this to 1 if building GLFW for OSMesa 48 | #cmakedefine _GLFW_OSMESA 49 | 50 | // Define this to 1 if building as a shared library / dynamic library / DLL 51 | #cmakedefine _GLFW_BUILD_DLL 52 | // Define this to 1 to use Vulkan loader linked statically into application 53 | #cmakedefine _GLFW_VULKAN_STATIC 54 | 55 | // Define this to 1 to force use of high-performance GPU on hybrid systems 56 | #cmakedefine _GLFW_USE_HYBRID_HPG 57 | 58 | // Define this to 1 if xkbcommon supports the compose key 59 | #cmakedefine HAVE_XKBCOMMON_COMPOSE_H 60 | 61 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/src/linux_joystick.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 Linux - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2014 Jonas Ådahl 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | #define _GLFW_PLATFORM_JOYSTICK_STATE _GLFWjoystickLinux linjs 32 | #define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE _GLFWlibraryLinux linjs 33 | 34 | #define _GLFW_PLATFORM_MAPPING_NAME "Linux" 35 | 36 | // Linux-specific joystick data 37 | // 38 | typedef struct _GLFWjoystickLinux 39 | { 40 | int fd; 41 | char path[PATH_MAX]; 42 | int keyMap[KEY_CNT - BTN_MISC]; 43 | int absMap[ABS_CNT]; 44 | struct input_absinfo absInfo[ABS_CNT]; 45 | int hats[4][2]; 46 | } _GLFWjoystickLinux; 47 | 48 | // Linux-specific joystick API data 49 | // 50 | typedef struct _GLFWlibraryLinux 51 | { 52 | int inotify; 53 | int watch; 54 | regex_t regex; 55 | GLFWbool dropped; 56 | } _GLFWlibraryLinux; 57 | 58 | 59 | GLFWbool _glfwInitJoysticksLinux(void); 60 | void _glfwTerminateJoysticksLinux(void); 61 | void _glfwDetectJoystickConnectionLinux(void); 62 | 63 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/src/mappings.h.in: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2006-2016 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | // As mappings.h.in, this file is used by CMake to produce the mappings.h 27 | // header file. If you are adding a GLFW specific gamepad mapping, this is 28 | // where to put it. 29 | //======================================================================== 30 | // As mappings.h, this provides all pre-defined gamepad mappings, including 31 | // all available in SDL_GameControllerDB. Do not edit this file. Any gamepad 32 | // mappings not specific to GLFW should be submitted to SDL_GameControllerDB. 33 | // This file can be re-generated from mappings.h.in and the upstream 34 | // gamecontrollerdb.txt with the GenerateMappings.cmake script. 35 | //======================================================================== 36 | 37 | // All gamepad mappings not labeled GLFW are copied from the 38 | // SDL_GameControllerDB project under the following license: 39 | // 40 | // Simple DirectMedia Layer 41 | // Copyright (C) 1997-2013 Sam Lantinga 42 | // 43 | // This software is provided 'as-is', without any express or implied warranty. 44 | // In no event will the authors be held liable for any damages arising from the 45 | // use of this software. 46 | // 47 | // Permission is granted to anyone to use this software for any purpose, 48 | // including commercial applications, and to alter it and redistribute it 49 | // freely, subject to the following restrictions: 50 | // 51 | // 1. The origin of this software must not be misrepresented; you must not 52 | // claim that you wrote the original software. If you use this software 53 | // in a product, an acknowledgment in the product documentation would 54 | // be appreciated but is not required. 55 | // 56 | // 2. Altered source versions must be plainly marked as such, and must not be 57 | // misrepresented as being the original software. 58 | // 59 | // 3. This notice may not be removed or altered from any source distribution. 60 | 61 | const char* _glfwDefaultMappings[] = 62 | { 63 | @GLFW_GAMEPAD_MAPPINGS@ 64 | "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,", 65 | "78696e70757402000000000000000000,XInput Wheel (GLFW),platform:Windows,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,", 66 | "78696e70757403000000000000000000,XInput Arcade Stick (GLFW),platform:Windows,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,", 67 | "78696e70757404000000000000000000,XInput Flight Stick (GLFW),platform:Windows,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,", 68 | "78696e70757405000000000000000000,XInput Dance Pad (GLFW),platform:Windows,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,", 69 | "78696e70757406000000000000000000,XInput Guitar (GLFW),platform:Windows,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,", 70 | "78696e70757408000000000000000000,XInput Drum Kit (GLFW),platform:Windows,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,", 71 | NULL 72 | }; 73 | 74 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/src/mir_platform.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 Mir - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2014-2017 Brandon Schaefer 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | #include 32 | 33 | typedef VkFlags VkMirWindowCreateFlagsKHR; 34 | 35 | typedef struct VkMirWindowCreateInfoKHR 36 | { 37 | VkStructureType sType; 38 | const void* pNext; 39 | VkMirWindowCreateFlagsKHR flags; 40 | MirConnection* connection; 41 | MirWindow* mirWindow; 42 | } VkMirWindowCreateInfoKHR; 43 | 44 | typedef VkResult (APIENTRY *PFN_vkCreateMirWindowKHR)(VkInstance,const VkMirWindowCreateInfoKHR*,const VkAllocationCallbacks*,VkSurfaceKHR*); 45 | typedef VkBool32 (APIENTRY *PFN_vkGetPhysicalDeviceMirPresentationSupportKHR)(VkPhysicalDevice,uint32_t,MirConnection*); 46 | 47 | #include "posix_thread.h" 48 | #include "posix_time.h" 49 | #include "linux_joystick.h" 50 | #include "xkb_unicode.h" 51 | #include "egl_context.h" 52 | #include "osmesa_context.h" 53 | 54 | #define _glfw_dlopen(name) dlopen(name, RTLD_LAZY | RTLD_LOCAL) 55 | #define _glfw_dlclose(handle) dlclose(handle) 56 | #define _glfw_dlsym(handle, name) dlsym(handle, name) 57 | 58 | #define _GLFW_EGL_NATIVE_WINDOW ((EGLNativeWindowType) window->mir.nativeWindow) 59 | #define _GLFW_EGL_NATIVE_DISPLAY ((EGLNativeDisplayType) _glfw.mir.display) 60 | 61 | #define _GLFW_PLATFORM_WINDOW_STATE _GLFWwindowMir mir 62 | #define _GLFW_PLATFORM_MONITOR_STATE _GLFWmonitorMir mir 63 | #define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE _GLFWlibraryMir mir 64 | #define _GLFW_PLATFORM_CURSOR_STATE _GLFWcursorMir mir 65 | 66 | #define _GLFW_PLATFORM_CONTEXT_STATE 67 | #define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE 68 | 69 | 70 | // Mir-specific Event Queue 71 | // 72 | typedef struct EventQueue 73 | { 74 | TAILQ_HEAD(, EventNode) head; 75 | } EventQueue; 76 | 77 | // Mir-specific per-window data 78 | // 79 | typedef struct _GLFWwindowMir 80 | { 81 | MirWindow* window; 82 | int width; 83 | int height; 84 | MirEGLNativeWindowType nativeWindow; 85 | _GLFWcursor* currentCursor; 86 | 87 | } _GLFWwindowMir; 88 | 89 | // Mir-specific per-monitor data 90 | // 91 | typedef struct _GLFWmonitorMir 92 | { 93 | int curMode; 94 | int outputId; 95 | int x; 96 | int y; 97 | 98 | } _GLFWmonitorMir; 99 | 100 | // Mir-specific global data 101 | // 102 | typedef struct _GLFWlibraryMir 103 | { 104 | MirConnection* connection; 105 | MirEGLNativeDisplayType display; 106 | EventQueue* eventQueue; 107 | 108 | short int keycodes[256]; 109 | short int scancodes[GLFW_KEY_LAST + 1]; 110 | 111 | pthread_mutex_t eventMutex; 112 | pthread_cond_t eventCond; 113 | 114 | // The window whose disabled cursor mode is active 115 | _GLFWwindow* disabledCursorWindow; 116 | 117 | } _GLFWlibraryMir; 118 | 119 | // Mir-specific per-cursor data 120 | // TODO: Only system cursors are implemented in Mir atm. Need to wait for support. 121 | // 122 | typedef struct _GLFWcursorMir 123 | { 124 | MirCursorConfiguration* conf; 125 | MirBufferStream* customCursor; 126 | char const* cursorName; // only needed for system cursors 127 | } _GLFWcursorMir; 128 | 129 | 130 | extern void _glfwPollMonitorsMir(void); 131 | extern void _glfwInitEventQueueMir(EventQueue* queue); 132 | extern void _glfwDeleteEventQueueMir(EventQueue* queue); 133 | 134 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/src/nsgl_context.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 macOS - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2009-2016 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextNSGL nsgl 28 | #define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE _GLFWlibraryNSGL nsgl 29 | 30 | 31 | // NSGL-specific per-context data 32 | // 33 | typedef struct _GLFWcontextNSGL 34 | { 35 | id pixelFormat; 36 | id object; 37 | 38 | } _GLFWcontextNSGL; 39 | 40 | // NSGL-specific global data 41 | // 42 | typedef struct _GLFWlibraryNSGL 43 | { 44 | // dlopen handle for OpenGL.framework (for glfwGetProcAddress) 45 | CFBundleRef framework; 46 | 47 | } _GLFWlibraryNSGL; 48 | 49 | 50 | GLFWbool _glfwInitNSGL(void); 51 | void _glfwTerminateNSGL(void); 52 | GLFWbool _glfwCreateContextNSGL(_GLFWwindow* window, 53 | const _GLFWctxconfig* ctxconfig, 54 | const _GLFWfbconfig* fbconfig); 55 | void _glfwDestroyContextNSGL(_GLFWwindow* window); 56 | 57 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/src/null_init.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2016 Google Inc. 5 | // Copyright (c) 2006-2016 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #include "internal.h" 29 | 30 | 31 | ////////////////////////////////////////////////////////////////////////// 32 | ////// GLFW platform API ////// 33 | ////////////////////////////////////////////////////////////////////////// 34 | 35 | int _glfwPlatformInit(void) 36 | { 37 | _glfwInitTimerPOSIX(); 38 | return GLFW_TRUE; 39 | } 40 | 41 | void _glfwPlatformTerminate(void) 42 | { 43 | _glfwTerminateOSMesa(); 44 | } 45 | 46 | const char* _glfwPlatformGetVersionString(void) 47 | { 48 | return _GLFW_VERSION_NUMBER " null OSMesa"; 49 | } 50 | 51 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/src/null_joystick.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2006-2016 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #include "internal.h" 28 | 29 | 30 | ////////////////////////////////////////////////////////////////////////// 31 | ////// GLFW platform API ////// 32 | ////////////////////////////////////////////////////////////////////////// 33 | 34 | int _glfwPlatformPollJoystick(_GLFWjoystick* js, int mode) 35 | { 36 | return GLFW_FALSE; 37 | } 38 | 39 | void _glfwPlatformUpdateGamepadGUID(char* guid) 40 | { 41 | } 42 | 43 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/src/null_joystick.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2006-2016 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #define _GLFW_PLATFORM_JOYSTICK_STATE int nulljs 28 | #define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE int nulljs 29 | 30 | #define _GLFW_PLATFORM_MAPPING_NAME "" 31 | 32 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/src/null_monitor.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2016 Google Inc. 5 | // Copyright (c) 2006-2016 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #include "internal.h" 29 | 30 | 31 | ////////////////////////////////////////////////////////////////////////// 32 | ////// GLFW platform API ////// 33 | ////////////////////////////////////////////////////////////////////////// 34 | 35 | void _glfwPlatformFreeMonitor(_GLFWmonitor* monitor) 36 | { 37 | } 38 | 39 | void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos) 40 | { 41 | } 42 | 43 | void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor, 44 | float* xscale, float* yscale) 45 | { 46 | if (xscale) 47 | *xscale = 1.f; 48 | if (yscale) 49 | *yscale = 1.f; 50 | } 51 | 52 | GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found) 53 | { 54 | return NULL; 55 | } 56 | 57 | void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode) 58 | { 59 | } 60 | 61 | void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp) 62 | { 63 | } 64 | 65 | void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp) 66 | { 67 | } 68 | 69 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/src/null_platform.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2016 Google Inc. 5 | // Copyright (c) 2006-2016 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #include 29 | 30 | #define _GLFW_PLATFORM_WINDOW_STATE _GLFWwindowNull null 31 | 32 | #define _GLFW_PLATFORM_CONTEXT_STATE 33 | #define _GLFW_PLATFORM_MONITOR_STATE 34 | #define _GLFW_PLATFORM_CURSOR_STATE 35 | #define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE 36 | #define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE 37 | #define _GLFW_EGL_CONTEXT_STATE 38 | #define _GLFW_EGL_LIBRARY_CONTEXT_STATE 39 | 40 | #include "osmesa_context.h" 41 | #include "posix_time.h" 42 | #include "posix_thread.h" 43 | #include "null_joystick.h" 44 | 45 | #if defined(_GLFW_WIN32) 46 | #define _glfw_dlopen(name) LoadLibraryA(name) 47 | #define _glfw_dlclose(handle) FreeLibrary((HMODULE) handle) 48 | #define _glfw_dlsym(handle, name) GetProcAddress((HMODULE) handle, name) 49 | #else 50 | #define _glfw_dlopen(name) dlopen(name, RTLD_LAZY | RTLD_LOCAL) 51 | #define _glfw_dlclose(handle) dlclose(handle) 52 | #define _glfw_dlsym(handle, name) dlsym(handle, name) 53 | #endif 54 | 55 | // Null-specific per-window data 56 | // 57 | typedef struct _GLFWwindowNull 58 | { 59 | int width; 60 | int height; 61 | } _GLFWwindowNull; 62 | 63 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/src/osmesa_context.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 OSMesa - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2016 Google Inc. 5 | // Copyright (c) 2006-2016 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #define OSMESA_RGBA 0x1908 29 | #define OSMESA_FORMAT 0x22 30 | #define OSMESA_DEPTH_BITS 0x30 31 | #define OSMESA_STENCIL_BITS 0x31 32 | #define OSMESA_ACCUM_BITS 0x32 33 | #define OSMESA_PROFILE 0x33 34 | #define OSMESA_CORE_PROFILE 0x34 35 | #define OSMESA_COMPAT_PROFILE 0x35 36 | #define OSMESA_CONTEXT_MAJOR_VERSION 0x36 37 | #define OSMESA_CONTEXT_MINOR_VERSION 0x37 38 | 39 | typedef void* OSMesaContext; 40 | typedef void (*OSMESAproc)(void); 41 | 42 | typedef OSMesaContext (GLAPIENTRY * PFN_OSMesaCreateContextExt)(GLenum,GLint,GLint,GLint,OSMesaContext); 43 | typedef OSMesaContext (GLAPIENTRY * PFN_OSMesaCreateContextAttribs)(const int*,OSMesaContext); 44 | typedef void (GLAPIENTRY * PFN_OSMesaDestroyContext)(OSMesaContext); 45 | typedef int (GLAPIENTRY * PFN_OSMesaMakeCurrent)(OSMesaContext,void*,int,int,int); 46 | typedef int (GLAPIENTRY * PFN_OSMesaGetColorBuffer)(OSMesaContext,int*,int*,int*,void**); 47 | typedef int (GLAPIENTRY * PFN_OSMesaGetDepthBuffer)(OSMesaContext,int*,int*,int*,void**); 48 | typedef GLFWglproc (GLAPIENTRY * PFN_OSMesaGetProcAddress)(const char*); 49 | #define OSMesaCreateContextExt _glfw.osmesa.CreateContextExt 50 | #define OSMesaCreateContextAttribs _glfw.osmesa.CreateContextAttribs 51 | #define OSMesaDestroyContext _glfw.osmesa.DestroyContext 52 | #define OSMesaMakeCurrent _glfw.osmesa.MakeCurrent 53 | #define OSMesaGetColorBuffer _glfw.osmesa.GetColorBuffer 54 | #define OSMesaGetDepthBuffer _glfw.osmesa.GetDepthBuffer 55 | #define OSMesaGetProcAddress _glfw.osmesa.GetProcAddress 56 | 57 | #define _GLFW_OSMESA_CONTEXT_STATE _GLFWcontextOSMesa osmesa 58 | #define _GLFW_OSMESA_LIBRARY_CONTEXT_STATE _GLFWlibraryOSMesa osmesa 59 | 60 | 61 | // OSMesa-specific per-context data 62 | // 63 | typedef struct _GLFWcontextOSMesa 64 | { 65 | OSMesaContext handle; 66 | int width; 67 | int height; 68 | void* buffer; 69 | 70 | } _GLFWcontextOSMesa; 71 | 72 | // OSMesa-specific global data 73 | // 74 | typedef struct _GLFWlibraryOSMesa 75 | { 76 | void* handle; 77 | 78 | PFN_OSMesaCreateContextExt CreateContextExt; 79 | PFN_OSMesaCreateContextAttribs CreateContextAttribs; 80 | PFN_OSMesaDestroyContext DestroyContext; 81 | PFN_OSMesaMakeCurrent MakeCurrent; 82 | PFN_OSMesaGetColorBuffer GetColorBuffer; 83 | PFN_OSMesaGetDepthBuffer GetDepthBuffer; 84 | PFN_OSMesaGetProcAddress GetProcAddress; 85 | 86 | } _GLFWlibraryOSMesa; 87 | 88 | 89 | GLFWbool _glfwInitOSMesa(void); 90 | void _glfwTerminateOSMesa(void); 91 | GLFWbool _glfwCreateContextOSMesa(_GLFWwindow* window, 92 | const _GLFWctxconfig* ctxconfig, 93 | const _GLFWfbconfig* fbconfig); 94 | 95 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/src/posix_thread.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 POSIX - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2016 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #include "internal.h" 29 | 30 | #include 31 | #include 32 | 33 | 34 | ////////////////////////////////////////////////////////////////////////// 35 | ////// GLFW platform API ////// 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | GLFWbool _glfwPlatformCreateTls(_GLFWtls* tls) 39 | { 40 | assert(tls->posix.allocated == GLFW_FALSE); 41 | 42 | if (pthread_key_create(&tls->posix.key, NULL) != 0) 43 | { 44 | _glfwInputError(GLFW_PLATFORM_ERROR, 45 | "POSIX: Failed to create context TLS"); 46 | return GLFW_FALSE; 47 | } 48 | 49 | tls->posix.allocated = GLFW_TRUE; 50 | return GLFW_TRUE; 51 | } 52 | 53 | void _glfwPlatformDestroyTls(_GLFWtls* tls) 54 | { 55 | if (tls->posix.allocated) 56 | pthread_key_delete(tls->posix.key); 57 | memset(tls, 0, sizeof(_GLFWtls)); 58 | } 59 | 60 | void* _glfwPlatformGetTls(_GLFWtls* tls) 61 | { 62 | assert(tls->posix.allocated == GLFW_TRUE); 63 | return pthread_getspecific(tls->posix.key); 64 | } 65 | 66 | void _glfwPlatformSetTls(_GLFWtls* tls, void* value) 67 | { 68 | assert(tls->posix.allocated == GLFW_TRUE); 69 | pthread_setspecific(tls->posix.key, value); 70 | } 71 | 72 | GLFWbool _glfwPlatformCreateMutex(_GLFWmutex* mutex) 73 | { 74 | assert(mutex->posix.allocated == GLFW_FALSE); 75 | 76 | if (pthread_mutex_init(&mutex->posix.handle, NULL) != 0) 77 | { 78 | _glfwInputError(GLFW_PLATFORM_ERROR, "POSIX: Failed to create mutex"); 79 | return GLFW_FALSE; 80 | } 81 | 82 | return mutex->posix.allocated = GLFW_TRUE; 83 | } 84 | 85 | void _glfwPlatformDestroyMutex(_GLFWmutex* mutex) 86 | { 87 | if (mutex->posix.allocated) 88 | pthread_mutex_destroy(&mutex->posix.handle); 89 | memset(mutex, 0, sizeof(_GLFWmutex)); 90 | } 91 | 92 | void _glfwPlatformLockMutex(_GLFWmutex* mutex) 93 | { 94 | assert(mutex->posix.allocated == GLFW_TRUE); 95 | pthread_mutex_lock(&mutex->posix.handle); 96 | } 97 | 98 | void _glfwPlatformUnlockMutex(_GLFWmutex* mutex) 99 | { 100 | assert(mutex->posix.allocated == GLFW_TRUE); 101 | pthread_mutex_unlock(&mutex->posix.handle); 102 | } 103 | 104 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/src/posix_thread.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 POSIX - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2016 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #include 29 | 30 | #define _GLFW_PLATFORM_TLS_STATE _GLFWtlsPOSIX posix 31 | #define _GLFW_PLATFORM_MUTEX_STATE _GLFWmutexPOSIX posix 32 | 33 | 34 | // POSIX-specific thread local storage data 35 | // 36 | typedef struct _GLFWtlsPOSIX 37 | { 38 | GLFWbool allocated; 39 | pthread_key_t key; 40 | 41 | } _GLFWtlsPOSIX; 42 | 43 | // POSIX-specific mutex data 44 | // 45 | typedef struct _GLFWmutexPOSIX 46 | { 47 | GLFWbool allocated; 48 | pthread_mutex_t handle; 49 | 50 | } _GLFWmutexPOSIX; 51 | 52 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/src/posix_time.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 POSIX - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2016 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #include "internal.h" 29 | 30 | #include 31 | #include 32 | 33 | 34 | ////////////////////////////////////////////////////////////////////////// 35 | ////// GLFW internal API ////// 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | // Initialise timer 39 | // 40 | void _glfwInitTimerPOSIX(void) 41 | { 42 | #if defined(CLOCK_MONOTONIC) 43 | struct timespec ts; 44 | 45 | if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) 46 | { 47 | _glfw.timer.posix.monotonic = GLFW_TRUE; 48 | _glfw.timer.posix.frequency = 1000000000; 49 | } 50 | else 51 | #endif 52 | { 53 | _glfw.timer.posix.monotonic = GLFW_FALSE; 54 | _glfw.timer.posix.frequency = 1000000; 55 | } 56 | } 57 | 58 | 59 | ////////////////////////////////////////////////////////////////////////// 60 | ////// GLFW platform API ////// 61 | ////////////////////////////////////////////////////////////////////////// 62 | 63 | uint64_t _glfwPlatformGetTimerValue(void) 64 | { 65 | #if defined(CLOCK_MONOTONIC) 66 | if (_glfw.timer.posix.monotonic) 67 | { 68 | struct timespec ts; 69 | clock_gettime(CLOCK_MONOTONIC, &ts); 70 | return (uint64_t) ts.tv_sec * (uint64_t) 1000000000 + (uint64_t) ts.tv_nsec; 71 | } 72 | else 73 | #endif 74 | { 75 | struct timeval tv; 76 | gettimeofday(&tv, NULL); 77 | return (uint64_t) tv.tv_sec * (uint64_t) 1000000 + (uint64_t) tv.tv_usec; 78 | } 79 | } 80 | 81 | uint64_t _glfwPlatformGetTimerFrequency(void) 82 | { 83 | return _glfw.timer.posix.frequency; 84 | } 85 | 86 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/src/posix_time.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 POSIX - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2016 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #define _GLFW_PLATFORM_LIBRARY_TIMER_STATE _GLFWtimerPOSIX posix 29 | 30 | #include 31 | 32 | 33 | // POSIX-specific global timer data 34 | // 35 | typedef struct _GLFWtimerPOSIX 36 | { 37 | GLFWbool monotonic; 38 | uint64_t frequency; 39 | 40 | } _GLFWtimerPOSIX; 41 | 42 | 43 | void _glfwInitTimerPOSIX(void); 44 | 45 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/src/wgl_context.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 WGL - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2016 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 29 | #define WGL_SUPPORT_OPENGL_ARB 0x2010 30 | #define WGL_DRAW_TO_WINDOW_ARB 0x2001 31 | #define WGL_PIXEL_TYPE_ARB 0x2013 32 | #define WGL_TYPE_RGBA_ARB 0x202b 33 | #define WGL_ACCELERATION_ARB 0x2003 34 | #define WGL_NO_ACCELERATION_ARB 0x2025 35 | #define WGL_RED_BITS_ARB 0x2015 36 | #define WGL_RED_SHIFT_ARB 0x2016 37 | #define WGL_GREEN_BITS_ARB 0x2017 38 | #define WGL_GREEN_SHIFT_ARB 0x2018 39 | #define WGL_BLUE_BITS_ARB 0x2019 40 | #define WGL_BLUE_SHIFT_ARB 0x201a 41 | #define WGL_ALPHA_BITS_ARB 0x201b 42 | #define WGL_ALPHA_SHIFT_ARB 0x201c 43 | #define WGL_ACCUM_BITS_ARB 0x201d 44 | #define WGL_ACCUM_RED_BITS_ARB 0x201e 45 | #define WGL_ACCUM_GREEN_BITS_ARB 0x201f 46 | #define WGL_ACCUM_BLUE_BITS_ARB 0x2020 47 | #define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 48 | #define WGL_DEPTH_BITS_ARB 0x2022 49 | #define WGL_STENCIL_BITS_ARB 0x2023 50 | #define WGL_AUX_BUFFERS_ARB 0x2024 51 | #define WGL_STEREO_ARB 0x2012 52 | #define WGL_DOUBLE_BUFFER_ARB 0x2011 53 | #define WGL_SAMPLES_ARB 0x2042 54 | #define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20a9 55 | #define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001 56 | #define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002 57 | #define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 58 | #define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 59 | #define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 60 | #define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 61 | #define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 62 | #define WGL_CONTEXT_FLAGS_ARB 0x2094 63 | #define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 64 | #define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 65 | #define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 66 | #define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 67 | #define WGL_NO_RESET_NOTIFICATION_ARB 0x8261 68 | #define WGL_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097 69 | #define WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0 70 | #define WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098 71 | #define WGL_CONTEXT_OPENGL_NO_ERROR_ARB 0x31b3 72 | #define WGL_COLORSPACE_EXT 0x309d 73 | #define WGL_COLORSPACE_SRGB_EXT 0x3089 74 | 75 | #define ERROR_INVALID_VERSION_ARB 0x2095 76 | #define ERROR_INVALID_PROFILE_ARB 0x2096 77 | #define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054 78 | 79 | typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC)(int); 80 | typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC)(HDC,int,int,UINT,const int*,int*); 81 | typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC)(void); 82 | typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC)(HDC); 83 | typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC)(HDC,HGLRC,const int*); 84 | 85 | typedef HGLRC (WINAPI * PFN_wglCreateContext)(HDC); 86 | typedef BOOL (WINAPI * PFN_wglDeleteContext)(HGLRC); 87 | typedef PROC (WINAPI * PFN_wglGetProcAddress)(LPCSTR); 88 | typedef HDC (WINAPI * PFN_wglGetCurrentDC)(void); 89 | typedef HGLRC (WINAPI * PFN_wglGetCurrentContext)(void); 90 | typedef BOOL (WINAPI * PFN_wglMakeCurrent)(HDC,HGLRC); 91 | typedef BOOL (WINAPI * PFN_wglShareLists)(HGLRC,HGLRC); 92 | 93 | // opengl32.dll function pointer typedefs 94 | #define wglCreateContext _glfw.wgl.CreateContext 95 | #define wglDeleteContext _glfw.wgl.DeleteContext 96 | #define wglGetProcAddress _glfw.wgl.GetProcAddress 97 | #define wglGetCurrentDC _glfw.wgl.GetCurrentDC 98 | #define wglGetCurrentContext _glfw.wgl.GetCurrentContext 99 | #define wglMakeCurrent _glfw.wgl.MakeCurrent 100 | #define wglShareLists _glfw.wgl.ShareLists 101 | 102 | #define _GLFW_RECREATION_NOT_NEEDED 0 103 | #define _GLFW_RECREATION_REQUIRED 1 104 | #define _GLFW_RECREATION_IMPOSSIBLE 2 105 | 106 | #define _GLFW_PLATFORM_CONTEXT_STATE _GLFWcontextWGL wgl 107 | #define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE _GLFWlibraryWGL wgl 108 | 109 | 110 | // WGL-specific per-context data 111 | // 112 | typedef struct _GLFWcontextWGL 113 | { 114 | HDC dc; 115 | HGLRC handle; 116 | int interval; 117 | 118 | } _GLFWcontextWGL; 119 | 120 | // WGL-specific global data 121 | // 122 | typedef struct _GLFWlibraryWGL 123 | { 124 | HINSTANCE instance; 125 | PFN_wglCreateContext CreateContext; 126 | PFN_wglDeleteContext DeleteContext; 127 | PFN_wglGetProcAddress GetProcAddress; 128 | PFN_wglGetCurrentDC GetCurrentDC; 129 | PFN_wglGetCurrentContext GetCurrentContext; 130 | PFN_wglMakeCurrent MakeCurrent; 131 | PFN_wglShareLists ShareLists; 132 | 133 | PFNWGLSWAPINTERVALEXTPROC SwapIntervalEXT; 134 | PFNWGLGETPIXELFORMATATTRIBIVARBPROC GetPixelFormatAttribivARB; 135 | PFNWGLGETEXTENSIONSSTRINGEXTPROC GetExtensionsStringEXT; 136 | PFNWGLGETEXTENSIONSSTRINGARBPROC GetExtensionsStringARB; 137 | PFNWGLCREATECONTEXTATTRIBSARBPROC CreateContextAttribsARB; 138 | GLFWbool EXT_swap_control; 139 | GLFWbool EXT_colorspace; 140 | GLFWbool ARB_multisample; 141 | GLFWbool ARB_framebuffer_sRGB; 142 | GLFWbool EXT_framebuffer_sRGB; 143 | GLFWbool ARB_pixel_format; 144 | GLFWbool ARB_create_context; 145 | GLFWbool ARB_create_context_profile; 146 | GLFWbool EXT_create_context_es2_profile; 147 | GLFWbool ARB_create_context_robustness; 148 | GLFWbool ARB_create_context_no_error; 149 | GLFWbool ARB_context_flush_control; 150 | 151 | } _GLFWlibraryWGL; 152 | 153 | 154 | GLFWbool _glfwInitWGL(void); 155 | void _glfwTerminateWGL(void); 156 | GLFWbool _glfwCreateContextWGL(_GLFWwindow* window, 157 | const _GLFWctxconfig* ctxconfig, 158 | const _GLFWfbconfig* fbconfig); 159 | 160 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/src/win32_joystick.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 Win32 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2006-2016 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #define _GLFW_PLATFORM_JOYSTICK_STATE _GLFWjoystickWin32 win32 28 | #define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE int dummy 29 | 30 | #define _GLFW_PLATFORM_MAPPING_NAME "Windows" 31 | 32 | // Joystick element (axis, button or slider) 33 | // 34 | typedef struct _GLFWjoyobjectWin32 35 | { 36 | int offset; 37 | int type; 38 | } _GLFWjoyobjectWin32; 39 | 40 | // Win32-specific per-joystick data 41 | // 42 | typedef struct _GLFWjoystickWin32 43 | { 44 | _GLFWjoyobjectWin32* objects; 45 | int objectCount; 46 | IDirectInputDevice8W* device; 47 | DWORD index; 48 | GUID guid; 49 | } _GLFWjoystickWin32; 50 | 51 | 52 | void _glfwInitJoysticksWin32(void); 53 | void _glfwTerminateJoysticksWin32(void); 54 | void _glfwDetectJoystickConnectionWin32(void); 55 | void _glfwDetectJoystickDisconnectionWin32(void); 56 | 57 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/src/win32_thread.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 Win32 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2016 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #include "internal.h" 29 | 30 | #include 31 | 32 | 33 | ////////////////////////////////////////////////////////////////////////// 34 | ////// GLFW platform API ////// 35 | ////////////////////////////////////////////////////////////////////////// 36 | 37 | GLFWbool _glfwPlatformCreateTls(_GLFWtls* tls) 38 | { 39 | assert(tls->win32.allocated == GLFW_FALSE); 40 | 41 | tls->win32.index = TlsAlloc(); 42 | if (tls->win32.index == TLS_OUT_OF_INDEXES) 43 | { 44 | _glfwInputErrorWin32(GLFW_PLATFORM_ERROR, 45 | "Win32: Failed to allocate TLS index"); 46 | return GLFW_FALSE; 47 | } 48 | 49 | tls->win32.allocated = GLFW_TRUE; 50 | return GLFW_TRUE; 51 | } 52 | 53 | void _glfwPlatformDestroyTls(_GLFWtls* tls) 54 | { 55 | if (tls->win32.allocated) 56 | TlsFree(tls->win32.index); 57 | memset(tls, 0, sizeof(_GLFWtls)); 58 | } 59 | 60 | void* _glfwPlatformGetTls(_GLFWtls* tls) 61 | { 62 | assert(tls->win32.allocated == GLFW_TRUE); 63 | return TlsGetValue(tls->win32.index); 64 | } 65 | 66 | void _glfwPlatformSetTls(_GLFWtls* tls, void* value) 67 | { 68 | assert(tls->win32.allocated == GLFW_TRUE); 69 | TlsSetValue(tls->win32.index, value); 70 | } 71 | 72 | GLFWbool _glfwPlatformCreateMutex(_GLFWmutex* mutex) 73 | { 74 | assert(mutex->win32.allocated == GLFW_FALSE); 75 | InitializeCriticalSection(&mutex->win32.section); 76 | return mutex->win32.allocated = GLFW_TRUE; 77 | } 78 | 79 | void _glfwPlatformDestroyMutex(_GLFWmutex* mutex) 80 | { 81 | if (mutex->win32.allocated) 82 | DeleteCriticalSection(&mutex->win32.section); 83 | memset(mutex, 0, sizeof(_GLFWmutex)); 84 | } 85 | 86 | void _glfwPlatformLockMutex(_GLFWmutex* mutex) 87 | { 88 | assert(mutex->win32.allocated == GLFW_TRUE); 89 | EnterCriticalSection(&mutex->win32.section); 90 | } 91 | 92 | void _glfwPlatformUnlockMutex(_GLFWmutex* mutex) 93 | { 94 | assert(mutex->win32.allocated == GLFW_TRUE); 95 | LeaveCriticalSection(&mutex->win32.section); 96 | } 97 | 98 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/src/win32_time.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 Win32 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2016 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #include "internal.h" 29 | 30 | 31 | ////////////////////////////////////////////////////////////////////////// 32 | ////// GLFW internal API ////// 33 | ////////////////////////////////////////////////////////////////////////// 34 | 35 | // Initialise timer 36 | // 37 | void _glfwInitTimerWin32(void) 38 | { 39 | uint64_t frequency; 40 | 41 | if (QueryPerformanceFrequency((LARGE_INTEGER*) &frequency)) 42 | { 43 | _glfw.timer.win32.hasPC = GLFW_TRUE; 44 | _glfw.timer.win32.frequency = frequency; 45 | } 46 | else 47 | { 48 | _glfw.timer.win32.hasPC = GLFW_FALSE; 49 | _glfw.timer.win32.frequency = 1000; 50 | } 51 | } 52 | 53 | 54 | ////////////////////////////////////////////////////////////////////////// 55 | ////// GLFW platform API ////// 56 | ////////////////////////////////////////////////////////////////////////// 57 | 58 | uint64_t _glfwPlatformGetTimerValue(void) 59 | { 60 | if (_glfw.timer.win32.hasPC) 61 | { 62 | uint64_t value; 63 | QueryPerformanceCounter((LARGE_INTEGER*) &value); 64 | return value; 65 | } 66 | else 67 | return (uint64_t) timeGetTime(); 68 | } 69 | 70 | uint64_t _glfwPlatformGetTimerFrequency(void) 71 | { 72 | return _glfw.timer.win32.frequency; 73 | } 74 | 75 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/src/wl_monitor.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 Wayland - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2014 Jonas Ådahl 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #include "internal.h" 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | 35 | static void geometry(void* data, 36 | struct wl_output* output, 37 | int32_t x, 38 | int32_t y, 39 | int32_t physicalWidth, 40 | int32_t physicalHeight, 41 | int32_t subpixel, 42 | const char* make, 43 | const char* model, 44 | int32_t transform) 45 | { 46 | struct _GLFWmonitor *monitor = data; 47 | char name[1024]; 48 | 49 | monitor->wl.x = x; 50 | monitor->wl.y = y; 51 | monitor->widthMM = physicalWidth; 52 | monitor->heightMM = physicalHeight; 53 | 54 | snprintf(name, sizeof(name), "%s %s", make, model); 55 | monitor->name = _glfw_strdup(name); 56 | } 57 | 58 | static void mode(void* data, 59 | struct wl_output* output, 60 | uint32_t flags, 61 | int32_t width, 62 | int32_t height, 63 | int32_t refresh) 64 | { 65 | struct _GLFWmonitor *monitor = data; 66 | GLFWvidmode mode; 67 | 68 | mode.width = width; 69 | mode.height = height; 70 | mode.redBits = 8; 71 | mode.greenBits = 8; 72 | mode.blueBits = 8; 73 | mode.refreshRate = refresh / 1000; 74 | 75 | monitor->modeCount++; 76 | monitor->modes = 77 | realloc(monitor->modes, monitor->modeCount * sizeof(GLFWvidmode)); 78 | monitor->modes[monitor->modeCount - 1] = mode; 79 | 80 | if (flags & WL_OUTPUT_MODE_CURRENT) 81 | monitor->wl.currentMode = monitor->modeCount - 1; 82 | } 83 | 84 | static void done(void* data, struct wl_output* output) 85 | { 86 | struct _GLFWmonitor *monitor = data; 87 | 88 | _glfwInputMonitor(monitor, GLFW_CONNECTED, _GLFW_INSERT_LAST); 89 | } 90 | 91 | static void scale(void* data, 92 | struct wl_output* output, 93 | int32_t factor) 94 | { 95 | struct _GLFWmonitor *monitor = data; 96 | 97 | monitor->wl.scale = factor; 98 | } 99 | 100 | static const struct wl_output_listener outputListener = { 101 | geometry, 102 | mode, 103 | done, 104 | scale, 105 | }; 106 | 107 | 108 | ////////////////////////////////////////////////////////////////////////// 109 | ////// GLFW internal API ////// 110 | ////////////////////////////////////////////////////////////////////////// 111 | 112 | void _glfwAddOutputWayland(uint32_t name, uint32_t version) 113 | { 114 | _GLFWmonitor *monitor; 115 | struct wl_output *output; 116 | 117 | if (version < 2) 118 | { 119 | _glfwInputError(GLFW_PLATFORM_ERROR, 120 | "Wayland: Unsupported output interface version"); 121 | return; 122 | } 123 | 124 | // The actual name of this output will be set in the geometry handler. 125 | monitor = _glfwAllocMonitor(NULL, 0, 0); 126 | 127 | output = wl_registry_bind(_glfw.wl.registry, 128 | name, 129 | &wl_output_interface, 130 | 2); 131 | if (!output) 132 | { 133 | _glfwFreeMonitor(monitor); 134 | return; 135 | } 136 | 137 | monitor->wl.scale = 1; 138 | monitor->wl.output = output; 139 | monitor->wl.name = name; 140 | 141 | wl_output_add_listener(output, &outputListener, monitor); 142 | } 143 | 144 | 145 | ////////////////////////////////////////////////////////////////////////// 146 | ////// GLFW platform API ////// 147 | ////////////////////////////////////////////////////////////////////////// 148 | 149 | void _glfwPlatformFreeMonitor(_GLFWmonitor* monitor) 150 | { 151 | if (monitor->wl.output) 152 | wl_output_destroy(monitor->wl.output); 153 | } 154 | 155 | void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos) 156 | { 157 | if (xpos) 158 | *xpos = monitor->wl.x; 159 | if (ypos) 160 | *ypos = monitor->wl.y; 161 | } 162 | 163 | void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor, 164 | float* xscale, float* yscale) 165 | { 166 | if (xscale) 167 | *xscale = (float) monitor->wl.scale; 168 | if (yscale) 169 | *yscale = (float) monitor->wl.scale; 170 | } 171 | 172 | GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found) 173 | { 174 | *found = monitor->modeCount; 175 | return monitor->modes; 176 | } 177 | 178 | void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode* mode) 179 | { 180 | *mode = monitor->modes[monitor->wl.currentMode]; 181 | } 182 | 183 | void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp) 184 | { 185 | // TODO 186 | _glfwInputError(GLFW_PLATFORM_ERROR, 187 | "Wayland: Gamma ramp getting not supported yet"); 188 | } 189 | 190 | void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp) 191 | { 192 | // TODO 193 | _glfwInputError(GLFW_PLATFORM_ERROR, 194 | "Wayland: Gamma ramp setting not supported yet"); 195 | } 196 | 197 | 198 | ////////////////////////////////////////////////////////////////////////// 199 | ////// GLFW native API ////// 200 | ////////////////////////////////////////////////////////////////////////// 201 | 202 | GLFWAPI struct wl_output* glfwGetWaylandMonitor(GLFWmonitor* handle) 203 | { 204 | _GLFWmonitor* monitor = (_GLFWmonitor*) handle; 205 | _GLFW_REQUIRE_INIT_OR_RETURN(NULL); 206 | return monitor->wl.output; 207 | } 208 | 209 | -------------------------------------------------------------------------------- /task02-triangle/external/glfw/src/xkb_unicode.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.3 Linux - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2014 Jonas Ådahl 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | long _glfwKeySym2Unicode(unsigned int keysym); 28 | 29 | -------------------------------------------------------------------------------- /task02-triangle/src/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JILLWONG/Computer_Graphics/0dba8273bc9f2f1fd67b565beb4c03a531594cd2/task02-triangle/src/main.cpp --------------------------------------------------------------------------------