From 047f294de1b4d385b811ac9f5afc393d81cc4ae9 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Sat, 16 Aug 2025 11:23:49 -0700 Subject: Copy changes from the no-history fork, generated back in 2023 Original commit message: > commit f138311d2d2e0cc9ba0496d523bb46f2c1c9fb73 > Author: rtk0c > Date: Wed Sep 20 23:58:58 2023 -0700 > > Copy from the PlasticSCM repo, replace vendored glm wtih conan In reality, this also introduced a few uncommitted changes in the original PlasticSCM repo. See the modified and new files in this patch. --- 3rdparty/glfw/source/.appveyor.yml | 47 - 3rdparty/glfw/source/.gitattributes | 5 - 3rdparty/glfw/source/.github/workflows/build.yml | 93 - 3rdparty/glfw/source/.mailmap | 10 - 3rdparty/glfw/source/CONTRIBUTORS.md | 246 - 3rdparty/glfw/source/LICENSE.md | 23 - 3rdparty/glfw/source/README.md | 345 - 3rdparty/glfw/source/deps/getopt.c | 230 - 3rdparty/glfw/source/deps/getopt.h | 57 - 3rdparty/glfw/source/deps/glad/gl.h | 5996 ----- 3rdparty/glfw/source/deps/glad/gles2.h | 1805 -- 3rdparty/glfw/source/deps/glad/vulkan.h | 4612 ---- 3rdparty/glfw/source/deps/linmath.h | 606 - 3rdparty/glfw/source/deps/mingw/_mingw_dxhelper.h | 117 - 3rdparty/glfw/source/deps/mingw/dinput.h | 2467 -- 3rdparty/glfw/source/deps/mingw/xinput.h | 239 - 3rdparty/glfw/source/deps/nuklear.h | 25778 ------------------- 3rdparty/glfw/source/deps/nuklear_glfw_gl2.h | 381 - 3rdparty/glfw/source/deps/stb_image_write.h | 1048 - 3rdparty/glfw/source/deps/tinycthread.c | 594 - 3rdparty/glfw/source/deps/tinycthread.h | 443 - 3rdparty/glfw/source/deps/vs2008/stdint.h | 247 - 3rdparty/glfw/source/docs/CMakeLists.txt | 46 - 3rdparty/glfw/source/docs/CODEOWNERS | 10 - 3rdparty/glfw/source/docs/CONTRIBUTING.md | 391 - 3rdparty/glfw/source/docs/Doxyfile.in | 2465 -- 3rdparty/glfw/source/docs/DoxygenLayout.xml | 71 - 3rdparty/glfw/source/docs/SUPPORT.md | 14 - 3rdparty/glfw/source/docs/build.dox | 338 - 3rdparty/glfw/source/docs/compat.dox | 284 - 3rdparty/glfw/source/docs/compile.dox | 394 - 3rdparty/glfw/source/docs/context.dox | 342 - 3rdparty/glfw/source/docs/extra.css | 2 - 3rdparty/glfw/source/docs/extra.css.map | 7 - 3rdparty/glfw/source/docs/extra.scss | 449 - 3rdparty/glfw/source/docs/footer.html | 7 - 3rdparty/glfw/source/docs/header.html | 34 - 3rdparty/glfw/source/docs/input.dox | 953 - 3rdparty/glfw/source/docs/internal.dox | 123 - 3rdparty/glfw/source/docs/intro.dox | 619 - 3rdparty/glfw/source/docs/main.dox | 46 - 3rdparty/glfw/source/docs/monitor.dox | 268 - 3rdparty/glfw/source/docs/moving.dox | 513 - 3rdparty/glfw/source/docs/news.dox | 240 - 3rdparty/glfw/source/docs/quick.dox | 371 - 3rdparty/glfw/source/docs/spaces.svg | 877 - 3rdparty/glfw/source/docs/vulkan.dox | 246 - 3rdparty/glfw/source/docs/window.dox | 1457 -- 3rdparty/glfw/source/examples/CMakeLists.txt | 88 - 3rdparty/glfw/source/examples/boing.c | 680 - 3rdparty/glfw/source/examples/gears.c | 361 - 3rdparty/glfw/source/examples/glfw.icns | Bin 27988 -> 0 bytes 3rdparty/glfw/source/examples/glfw.ico | Bin 21630 -> 0 bytes 3rdparty/glfw/source/examples/heightmap.c | 513 - 3rdparty/glfw/source/examples/offscreen.c | 178 - 3rdparty/glfw/source/examples/particles.c | 1074 - 3rdparty/glfw/source/examples/sharing.c | 235 - 3rdparty/glfw/source/examples/splitview.c | 547 - 3rdparty/glfw/source/examples/triangle-opengl.c | 171 - 3rdparty/glfw/source/examples/triangle-opengles.c | 170 - 3rdparty/glfw/source/examples/wave.c | 463 - 3rdparty/glfw/source/examples/windows.c | 110 - 3rdparty/glfw/source/tests/CMakeLists.txt | 86 - 3rdparty/glfw/source/tests/allocator.c | 142 - 3rdparty/glfw/source/tests/clipboard.c | 146 - 3rdparty/glfw/source/tests/cursor.c | 489 - 3rdparty/glfw/source/tests/empty.c | 133 - 3rdparty/glfw/source/tests/events.c | 692 - 3rdparty/glfw/source/tests/gamma.c | 187 - 3rdparty/glfw/source/tests/glfwinfo.c | 1061 - 3rdparty/glfw/source/tests/icon.c | 150 - 3rdparty/glfw/source/tests/iconify.c | 298 - 3rdparty/glfw/source/tests/inputlag.c | 310 - 3rdparty/glfw/source/tests/joysticks.c | 346 - 3rdparty/glfw/source/tests/monitors.c | 263 - 3rdparty/glfw/source/tests/msaa.c | 221 - 3rdparty/glfw/source/tests/reopen.c | 241 - 3rdparty/glfw/source/tests/tearing.c | 251 - 3rdparty/glfw/source/tests/threads.c | 153 - 3rdparty/glfw/source/tests/timeout.c | 99 - 3rdparty/glfw/source/tests/title.c | 73 - 3rdparty/glfw/source/tests/triangle-vulkan.c | 2129 -- 3rdparty/glfw/source/tests/window.c | 428 - 3rdparty/glm/CMakeLists.txt | 6 - 3rdparty/glm/README.md | 2 - 3rdparty/glm/glm.stamp | 2 - 3rdparty/glm/source/.appveyor.yml | 92 - 3rdparty/glm/source/.gitignore | 61 - 3rdparty/glm/source/.travis.yml | 388 - 3rdparty/glm/source/CMakeLists.txt | 45 - 3rdparty/glm/source/cmake/cmake_uninstall.cmake.in | 21 - 3rdparty/glm/source/copying.txt | 54 - 3rdparty/glm/source/glm/CMakeLists.txt | 78 - 3rdparty/glm/source/glm/common.hpp | 539 - 3rdparty/glm/source/glm/detail/_features.hpp | 394 - 3rdparty/glm/source/glm/detail/_fixes.hpp | 27 - 3rdparty/glm/source/glm/detail/_noise.hpp | 81 - 3rdparty/glm/source/glm/detail/_swizzle.hpp | 804 - 3rdparty/glm/source/glm/detail/_swizzle_func.hpp | 682 - 3rdparty/glm/source/glm/detail/_vectorize.hpp | 162 - 3rdparty/glm/source/glm/detail/compute_common.hpp | 50 - .../glm/detail/compute_vector_relational.hpp | 30 - 3rdparty/glm/source/glm/detail/func_common.inl | 792 - .../glm/source/glm/detail/func_common_simd.inl | 231 - .../glm/source/glm/detail/func_exponential.inl | 152 - .../source/glm/detail/func_exponential_simd.inl | 37 - 3rdparty/glm/source/glm/detail/func_geometric.inl | 243 - .../glm/source/glm/detail/func_geometric_simd.inl | 163 - 3rdparty/glm/source/glm/detail/func_integer.inl | 372 - .../glm/source/glm/detail/func_integer_simd.inl | 65 - 3rdparty/glm/source/glm/detail/func_matrix.inl | 443 - .../glm/source/glm/detail/func_matrix_simd.inl | 249 - 3rdparty/glm/source/glm/detail/func_packing.inl | 189 - .../glm/source/glm/detail/func_packing_simd.inl | 6 - .../glm/source/glm/detail/func_trigonometric.inl | 197 - .../source/glm/detail/func_trigonometric_simd.inl | 0 .../source/glm/detail/func_vector_relational.inl | 87 - .../glm/detail/func_vector_relational_simd.inl | 6 - 3rdparty/glm/source/glm/detail/glm.cpp | 263 - 3rdparty/glm/source/glm/detail/qualifier.hpp | 230 - 3rdparty/glm/source/glm/detail/setup.hpp | 1156 - 3rdparty/glm/source/glm/detail/type_float.hpp | 68 - 3rdparty/glm/source/glm/detail/type_half.hpp | 16 - 3rdparty/glm/source/glm/detail/type_half.inl | 241 - 3rdparty/glm/source/glm/detail/type_mat2x2.hpp | 177 - 3rdparty/glm/source/glm/detail/type_mat2x2.inl | 536 - 3rdparty/glm/source/glm/detail/type_mat2x3.hpp | 159 - 3rdparty/glm/source/glm/detail/type_mat2x3.inl | 510 - 3rdparty/glm/source/glm/detail/type_mat2x4.hpp | 161 - 3rdparty/glm/source/glm/detail/type_mat2x4.inl | 520 - 3rdparty/glm/source/glm/detail/type_mat3x2.hpp | 167 - 3rdparty/glm/source/glm/detail/type_mat3x2.inl | 532 - 3rdparty/glm/source/glm/detail/type_mat3x3.hpp | 184 - 3rdparty/glm/source/glm/detail/type_mat3x3.inl | 601 - 3rdparty/glm/source/glm/detail/type_mat3x4.hpp | 166 - 3rdparty/glm/source/glm/detail/type_mat3x4.inl | 578 - 3rdparty/glm/source/glm/detail/type_mat4x2.hpp | 171 - 3rdparty/glm/source/glm/detail/type_mat4x2.inl | 574 - 3rdparty/glm/source/glm/detail/type_mat4x3.hpp | 171 - 3rdparty/glm/source/glm/detail/type_mat4x3.inl | 598 - 3rdparty/glm/source/glm/detail/type_mat4x4.hpp | 189 - 3rdparty/glm/source/glm/detail/type_mat4x4.inl | 706 - .../glm/source/glm/detail/type_mat4x4_simd.inl | 6 - 3rdparty/glm/source/glm/detail/type_quat.hpp | 191 - 3rdparty/glm/source/glm/detail/type_quat.inl | 412 - 3rdparty/glm/source/glm/detail/type_quat_simd.inl | 188 - 3rdparty/glm/source/glm/detail/type_vec1.hpp | 308 - 3rdparty/glm/source/glm/detail/type_vec1.inl | 553 - 3rdparty/glm/source/glm/detail/type_vec2.hpp | 402 - 3rdparty/glm/source/glm/detail/type_vec2.inl | 915 - 3rdparty/glm/source/glm/detail/type_vec3.hpp | 435 - 3rdparty/glm/source/glm/detail/type_vec3.inl | 1070 - 3rdparty/glm/source/glm/detail/type_vec4.hpp | 508 - 3rdparty/glm/source/glm/detail/type_vec4.inl | 1142 - 3rdparty/glm/source/glm/detail/type_vec4_simd.inl | 775 - 3rdparty/glm/source/glm/exponential.hpp | 110 - 3rdparty/glm/source/glm/ext.hpp | 255 - 3rdparty/glm/source/glm/ext/matrix_clip_space.hpp | 522 - 3rdparty/glm/source/glm/ext/matrix_clip_space.inl | 555 - 3rdparty/glm/source/glm/ext/matrix_common.hpp | 36 - 3rdparty/glm/source/glm/ext/matrix_common.inl | 16 - 3rdparty/glm/source/glm/ext/matrix_double2x2.hpp | 23 - .../source/glm/ext/matrix_double2x2_precision.hpp | 49 - 3rdparty/glm/source/glm/ext/matrix_double2x3.hpp | 18 - .../source/glm/ext/matrix_double2x3_precision.hpp | 31 - 3rdparty/glm/source/glm/ext/matrix_double2x4.hpp | 18 - .../source/glm/ext/matrix_double2x4_precision.hpp | 31 - 3rdparty/glm/source/glm/ext/matrix_double3x2.hpp | 18 - .../source/glm/ext/matrix_double3x2_precision.hpp | 31 - 3rdparty/glm/source/glm/ext/matrix_double3x3.hpp | 23 - .../source/glm/ext/matrix_double3x3_precision.hpp | 49 - 3rdparty/glm/source/glm/ext/matrix_double3x4.hpp | 18 - .../source/glm/ext/matrix_double3x4_precision.hpp | 31 - 3rdparty/glm/source/glm/ext/matrix_double4x2.hpp | 18 - .../source/glm/ext/matrix_double4x2_precision.hpp | 31 - 3rdparty/glm/source/glm/ext/matrix_double4x3.hpp | 18 - .../source/glm/ext/matrix_double4x3_precision.hpp | 31 - 3rdparty/glm/source/glm/ext/matrix_double4x4.hpp | 23 - .../source/glm/ext/matrix_double4x4_precision.hpp | 49 - 3rdparty/glm/source/glm/ext/matrix_float2x2.hpp | 23 - .../source/glm/ext/matrix_float2x2_precision.hpp | 49 - 3rdparty/glm/source/glm/ext/matrix_float2x3.hpp | 18 - .../source/glm/ext/matrix_float2x3_precision.hpp | 31 - 3rdparty/glm/source/glm/ext/matrix_float2x4.hpp | 18 - .../source/glm/ext/matrix_float2x4_precision.hpp | 31 - 3rdparty/glm/source/glm/ext/matrix_float3x2.hpp | 18 - .../source/glm/ext/matrix_float3x2_precision.hpp | 31 - 3rdparty/glm/source/glm/ext/matrix_float3x3.hpp | 23 - .../source/glm/ext/matrix_float3x3_precision.hpp | 49 - 3rdparty/glm/source/glm/ext/matrix_float3x4.hpp | 18 - .../source/glm/ext/matrix_float3x4_precision.hpp | 31 - 3rdparty/glm/source/glm/ext/matrix_float4x2.hpp | 18 - .../source/glm/ext/matrix_float4x2_precision.hpp | 31 - 3rdparty/glm/source/glm/ext/matrix_float4x3.hpp | 18 - .../source/glm/ext/matrix_float4x3_precision.hpp | 31 - 3rdparty/glm/source/glm/ext/matrix_float4x4.hpp | 23 - .../source/glm/ext/matrix_float4x4_precision.hpp | 49 - 3rdparty/glm/source/glm/ext/matrix_int2x2.hpp | 38 - .../glm/source/glm/ext/matrix_int2x2_sized.hpp | 70 - 3rdparty/glm/source/glm/ext/matrix_int2x3.hpp | 33 - .../glm/source/glm/ext/matrix_int2x3_sized.hpp | 49 - 3rdparty/glm/source/glm/ext/matrix_int2x4.hpp | 33 - .../glm/source/glm/ext/matrix_int2x4_sized.hpp | 49 - 3rdparty/glm/source/glm/ext/matrix_int3x2.hpp | 33 - .../glm/source/glm/ext/matrix_int3x2_sized.hpp | 49 - 3rdparty/glm/source/glm/ext/matrix_int3x3.hpp | 38 - .../glm/source/glm/ext/matrix_int3x3_sized.hpp | 70 - 3rdparty/glm/source/glm/ext/matrix_int3x4.hpp | 33 - .../glm/source/glm/ext/matrix_int3x4_sized.hpp | 49 - 3rdparty/glm/source/glm/ext/matrix_int4x2.hpp | 33 - .../glm/source/glm/ext/matrix_int4x2_sized.hpp | 49 - 3rdparty/glm/source/glm/ext/matrix_int4x3.hpp | 33 - .../glm/source/glm/ext/matrix_int4x3_sized.hpp | 49 - 3rdparty/glm/source/glm/ext/matrix_int4x4.hpp | 38 - .../glm/source/glm/ext/matrix_int4x4_sized.hpp | 70 - 3rdparty/glm/source/glm/ext/matrix_integer.hpp | 91 - 3rdparty/glm/source/glm/ext/matrix_integer.inl | 38 - 3rdparty/glm/source/glm/ext/matrix_projection.hpp | 149 - 3rdparty/glm/source/glm/ext/matrix_projection.inl | 106 - 3rdparty/glm/source/glm/ext/matrix_relational.hpp | 132 - 3rdparty/glm/source/glm/ext/matrix_relational.inl | 88 - 3rdparty/glm/source/glm/ext/matrix_transform.hpp | 144 - 3rdparty/glm/source/glm/ext/matrix_transform.inl | 153 - 3rdparty/glm/source/glm/ext/matrix_uint2x2.hpp | 38 - .../glm/source/glm/ext/matrix_uint2x2_sized.hpp | 70 - 3rdparty/glm/source/glm/ext/matrix_uint2x3.hpp | 33 - .../glm/source/glm/ext/matrix_uint2x3_sized.hpp | 49 - 3rdparty/glm/source/glm/ext/matrix_uint2x4.hpp | 33 - .../glm/source/glm/ext/matrix_uint2x4_sized.hpp | 49 - 3rdparty/glm/source/glm/ext/matrix_uint3x2.hpp | 33 - .../glm/source/glm/ext/matrix_uint3x2_sized.hpp | 49 - 3rdparty/glm/source/glm/ext/matrix_uint3x3.hpp | 38 - .../glm/source/glm/ext/matrix_uint3x3_sized.hpp | 70 - 3rdparty/glm/source/glm/ext/matrix_uint3x4.hpp | 33 - .../glm/source/glm/ext/matrix_uint3x4_sized.hpp | 49 - 3rdparty/glm/source/glm/ext/matrix_uint4x2.hpp | 33 - .../glm/source/glm/ext/matrix_uint4x2_sized.hpp | 49 - 3rdparty/glm/source/glm/ext/matrix_uint4x3.hpp | 33 - .../glm/source/glm/ext/matrix_uint4x3_sized.hpp | 49 - 3rdparty/glm/source/glm/ext/matrix_uint4x4.hpp | 38 - .../glm/source/glm/ext/matrix_uint4x4_sized.hpp | 70 - 3rdparty/glm/source/glm/ext/quaternion_common.hpp | 135 - 3rdparty/glm/source/glm/ext/quaternion_common.inl | 144 - .../glm/source/glm/ext/quaternion_common_simd.inl | 18 - 3rdparty/glm/source/glm/ext/quaternion_double.hpp | 39 - .../source/glm/ext/quaternion_double_precision.hpp | 42 - .../glm/source/glm/ext/quaternion_exponential.hpp | 63 - .../glm/source/glm/ext/quaternion_exponential.inl | 89 - 3rdparty/glm/source/glm/ext/quaternion_float.hpp | 39 - .../source/glm/ext/quaternion_float_precision.hpp | 36 - .../glm/source/glm/ext/quaternion_geometric.hpp | 70 - .../glm/source/glm/ext/quaternion_geometric.inl | 36 - .../glm/source/glm/ext/quaternion_relational.hpp | 62 - .../glm/source/glm/ext/quaternion_relational.inl | 35 - .../glm/source/glm/ext/quaternion_transform.hpp | 47 - .../glm/source/glm/ext/quaternion_transform.inl | 24 - .../source/glm/ext/quaternion_trigonometric.hpp | 63 - .../source/glm/ext/quaternion_trigonometric.inl | 37 - 3rdparty/glm/source/glm/ext/scalar_common.hpp | 181 - 3rdparty/glm/source/glm/ext/scalar_common.inl | 170 - 3rdparty/glm/source/glm/ext/scalar_constants.hpp | 40 - 3rdparty/glm/source/glm/ext/scalar_constants.inl | 24 - 3rdparty/glm/source/glm/ext/scalar_int_sized.hpp | 70 - 3rdparty/glm/source/glm/ext/scalar_integer.hpp | 92 - 3rdparty/glm/source/glm/ext/scalar_integer.inl | 243 - 3rdparty/glm/source/glm/ext/scalar_packing.hpp | 32 - 3rdparty/glm/source/glm/ext/scalar_packing.inl | 0 3rdparty/glm/source/glm/ext/scalar_reciprocal.hpp | 135 - 3rdparty/glm/source/glm/ext/scalar_reciprocal.inl | 107 - 3rdparty/glm/source/glm/ext/scalar_relational.hpp | 65 - 3rdparty/glm/source/glm/ext/scalar_relational.inl | 40 - 3rdparty/glm/source/glm/ext/scalar_uint_sized.hpp | 70 - 3rdparty/glm/source/glm/ext/scalar_ulp.hpp | 74 - 3rdparty/glm/source/glm/ext/scalar_ulp.inl | 284 - 3rdparty/glm/source/glm/ext/vector_bool1.hpp | 30 - .../glm/source/glm/ext/vector_bool1_precision.hpp | 34 - 3rdparty/glm/source/glm/ext/vector_bool2.hpp | 18 - .../glm/source/glm/ext/vector_bool2_precision.hpp | 31 - 3rdparty/glm/source/glm/ext/vector_bool3.hpp | 18 - .../glm/source/glm/ext/vector_bool3_precision.hpp | 31 - 3rdparty/glm/source/glm/ext/vector_bool4.hpp | 18 - .../glm/source/glm/ext/vector_bool4_precision.hpp | 31 - 3rdparty/glm/source/glm/ext/vector_common.hpp | 228 - 3rdparty/glm/source/glm/ext/vector_common.inl | 147 - 3rdparty/glm/source/glm/ext/vector_double1.hpp | 31 - .../source/glm/ext/vector_double1_precision.hpp | 36 - 3rdparty/glm/source/glm/ext/vector_double2.hpp | 18 - .../source/glm/ext/vector_double2_precision.hpp | 31 - 3rdparty/glm/source/glm/ext/vector_double3.hpp | 18 - .../source/glm/ext/vector_double3_precision.hpp | 34 - 3rdparty/glm/source/glm/ext/vector_double4.hpp | 18 - .../source/glm/ext/vector_double4_precision.hpp | 35 - 3rdparty/glm/source/glm/ext/vector_float1.hpp | 31 - .../glm/source/glm/ext/vector_float1_precision.hpp | 36 - 3rdparty/glm/source/glm/ext/vector_float2.hpp | 18 - .../glm/source/glm/ext/vector_float2_precision.hpp | 31 - 3rdparty/glm/source/glm/ext/vector_float3.hpp | 18 - .../glm/source/glm/ext/vector_float3_precision.hpp | 31 - 3rdparty/glm/source/glm/ext/vector_float4.hpp | 18 - .../glm/source/glm/ext/vector_float4_precision.hpp | 31 - 3rdparty/glm/source/glm/ext/vector_int1.hpp | 32 - 3rdparty/glm/source/glm/ext/vector_int1_sized.hpp | 49 - 3rdparty/glm/source/glm/ext/vector_int2.hpp | 18 - 3rdparty/glm/source/glm/ext/vector_int2_sized.hpp | 49 - 3rdparty/glm/source/glm/ext/vector_int3.hpp | 18 - 3rdparty/glm/source/glm/ext/vector_int3_sized.hpp | 49 - 3rdparty/glm/source/glm/ext/vector_int4.hpp | 18 - 3rdparty/glm/source/glm/ext/vector_int4_sized.hpp | 49 - 3rdparty/glm/source/glm/ext/vector_integer.hpp | 149 - 3rdparty/glm/source/glm/ext/vector_integer.inl | 85 - 3rdparty/glm/source/glm/ext/vector_packing.hpp | 32 - 3rdparty/glm/source/glm/ext/vector_packing.inl | 0 3rdparty/glm/source/glm/ext/vector_reciprocal.hpp | 135 - 3rdparty/glm/source/glm/ext/vector_reciprocal.inl | 105 - 3rdparty/glm/source/glm/ext/vector_relational.hpp | 107 - 3rdparty/glm/source/glm/ext/vector_relational.inl | 75 - 3rdparty/glm/source/glm/ext/vector_uint1.hpp | 32 - 3rdparty/glm/source/glm/ext/vector_uint1_sized.hpp | 49 - 3rdparty/glm/source/glm/ext/vector_uint2.hpp | 18 - 3rdparty/glm/source/glm/ext/vector_uint2_sized.hpp | 49 - 3rdparty/glm/source/glm/ext/vector_uint3.hpp | 18 - 3rdparty/glm/source/glm/ext/vector_uint3_sized.hpp | 49 - 3rdparty/glm/source/glm/ext/vector_uint4.hpp | 18 - 3rdparty/glm/source/glm/ext/vector_uint4_sized.hpp | 49 - 3rdparty/glm/source/glm/ext/vector_ulp.hpp | 109 - 3rdparty/glm/source/glm/ext/vector_ulp.inl | 74 - 3rdparty/glm/source/glm/fwd.hpp | 1233 - 3rdparty/glm/source/glm/geometric.hpp | 116 - 3rdparty/glm/source/glm/glm.hpp | 136 - 3rdparty/glm/source/glm/gtc/bitfield.hpp | 266 - 3rdparty/glm/source/glm/gtc/bitfield.inl | 626 - 3rdparty/glm/source/glm/gtc/color_space.hpp | 56 - 3rdparty/glm/source/glm/gtc/color_space.inl | 84 - 3rdparty/glm/source/glm/gtc/constants.hpp | 165 - 3rdparty/glm/source/glm/gtc/constants.inl | 167 - 3rdparty/glm/source/glm/gtc/epsilon.hpp | 60 - 3rdparty/glm/source/glm/gtc/epsilon.inl | 80 - 3rdparty/glm/source/glm/gtc/integer.hpp | 43 - 3rdparty/glm/source/glm/gtc/integer.inl | 33 - 3rdparty/glm/source/glm/gtc/matrix_access.hpp | 60 - 3rdparty/glm/source/glm/gtc/matrix_access.inl | 62 - 3rdparty/glm/source/glm/gtc/matrix_integer.hpp | 433 - 3rdparty/glm/source/glm/gtc/matrix_inverse.hpp | 50 - 3rdparty/glm/source/glm/gtc/matrix_inverse.inl | 118 - 3rdparty/glm/source/glm/gtc/matrix_transform.hpp | 36 - 3rdparty/glm/source/glm/gtc/matrix_transform.inl | 3 - 3rdparty/glm/source/glm/gtc/noise.hpp | 61 - 3rdparty/glm/source/glm/gtc/noise.inl | 807 - 3rdparty/glm/source/glm/gtc/packing.hpp | 728 - 3rdparty/glm/source/glm/gtc/packing.inl | 938 - 3rdparty/glm/source/glm/gtc/quaternion.hpp | 173 - 3rdparty/glm/source/glm/gtc/quaternion.inl | 208 - 3rdparty/glm/source/glm/gtc/quaternion_simd.inl | 0 3rdparty/glm/source/glm/gtc/random.hpp | 82 - 3rdparty/glm/source/glm/gtc/random.inl | 303 - 3rdparty/glm/source/glm/gtc/reciprocal.hpp | 24 - 3rdparty/glm/source/glm/gtc/round.hpp | 160 - 3rdparty/glm/source/glm/gtc/round.inl | 155 - 3rdparty/glm/source/glm/gtc/type_aligned.hpp | 1315 - 3rdparty/glm/source/glm/gtc/type_precision.hpp | 2094 -- 3rdparty/glm/source/glm/gtc/type_precision.inl | 6 - 3rdparty/glm/source/glm/gtc/type_ptr.hpp | 230 - 3rdparty/glm/source/glm/gtc/type_ptr.inl | 386 - 3rdparty/glm/source/glm/gtc/ulp.hpp | 152 - 3rdparty/glm/source/glm/gtc/ulp.inl | 173 - 3rdparty/glm/source/glm/gtc/vec1.hpp | 30 - 3rdparty/glm/source/glm/gtx/associated_min_max.hpp | 207 - 3rdparty/glm/source/glm/gtx/associated_min_max.inl | 354 - 3rdparty/glm/source/glm/gtx/bit.hpp | 98 - 3rdparty/glm/source/glm/gtx/bit.inl | 92 - 3rdparty/glm/source/glm/gtx/closest_point.hpp | 49 - 3rdparty/glm/source/glm/gtx/closest_point.inl | 45 - 3rdparty/glm/source/glm/gtx/color_encoding.hpp | 54 - 3rdparty/glm/source/glm/gtx/color_encoding.inl | 45 - 3rdparty/glm/source/glm/gtx/color_space.hpp | 72 - 3rdparty/glm/source/glm/gtx/color_space.inl | 141 - 3rdparty/glm/source/glm/gtx/color_space_YCoCg.hpp | 60 - 3rdparty/glm/source/glm/gtx/color_space_YCoCg.inl | 107 - 3rdparty/glm/source/glm/gtx/common.hpp | 76 - 3rdparty/glm/source/glm/gtx/common.inl | 125 - 3rdparty/glm/source/glm/gtx/compatibility.hpp | 133 - 3rdparty/glm/source/glm/gtx/compatibility.inl | 62 - 3rdparty/glm/source/glm/gtx/component_wise.hpp | 69 - 3rdparty/glm/source/glm/gtx/component_wise.inl | 127 - 3rdparty/glm/source/glm/gtx/dual_quaternion.hpp | 274 - 3rdparty/glm/source/glm/gtx/dual_quaternion.inl | 352 - 3rdparty/glm/source/glm/gtx/easing.hpp | 219 - 3rdparty/glm/source/glm/gtx/easing.inl | 436 - 3rdparty/glm/source/glm/gtx/euler_angles.hpp | 335 - 3rdparty/glm/source/glm/gtx/euler_angles.inl | 899 - 3rdparty/glm/source/glm/gtx/extend.hpp | 42 - 3rdparty/glm/source/glm/gtx/extend.inl | 48 - 3rdparty/glm/source/glm/gtx/extended_min_max.hpp | 137 - 3rdparty/glm/source/glm/gtx/extended_min_max.inl | 138 - 3rdparty/glm/source/glm/gtx/exterior_product.hpp | 45 - 3rdparty/glm/source/glm/gtx/exterior_product.inl | 26 - 3rdparty/glm/source/glm/gtx/fast_exponential.hpp | 95 - 3rdparty/glm/source/glm/gtx/fast_exponential.inl | 136 - 3rdparty/glm/source/glm/gtx/fast_square_root.hpp | 98 - 3rdparty/glm/source/glm/gtx/fast_square_root.inl | 75 - 3rdparty/glm/source/glm/gtx/fast_trigonometry.hpp | 79 - 3rdparty/glm/source/glm/gtx/fast_trigonometry.inl | 142 - 3rdparty/glm/source/glm/gtx/float_notmalize.inl | 13 - 3rdparty/glm/source/glm/gtx/functions.hpp | 56 - 3rdparty/glm/source/glm/gtx/functions.inl | 30 - 3rdparty/glm/source/glm/gtx/gradient_paint.hpp | 53 - 3rdparty/glm/source/glm/gtx/gradient_paint.inl | 36 - .../glm/source/glm/gtx/handed_coordinate_space.hpp | 50 - .../glm/source/glm/gtx/handed_coordinate_space.inl | 26 - 3rdparty/glm/source/glm/gtx/hash.hpp | 142 - 3rdparty/glm/source/glm/gtx/hash.inl | 184 - 3rdparty/glm/source/glm/gtx/integer.hpp | 76 - 3rdparty/glm/source/glm/gtx/integer.inl | 185 - 3rdparty/glm/source/glm/gtx/intersect.hpp | 92 - 3rdparty/glm/source/glm/gtx/intersect.inl | 200 - 3rdparty/glm/source/glm/gtx/io.hpp | 201 - 3rdparty/glm/source/glm/gtx/io.inl | 440 - 3rdparty/glm/source/glm/gtx/log_base.hpp | 48 - 3rdparty/glm/source/glm/gtx/log_base.inl | 16 - .../glm/source/glm/gtx/matrix_cross_product.hpp | 47 - .../glm/source/glm/gtx/matrix_cross_product.inl | 37 - 3rdparty/glm/source/glm/gtx/matrix_decompose.hpp | 46 - 3rdparty/glm/source/glm/gtx/matrix_decompose.inl | 192 - .../glm/source/glm/gtx/matrix_factorisation.hpp | 69 - .../glm/source/glm/gtx/matrix_factorisation.inl | 84 - .../glm/source/glm/gtx/matrix_interpolation.hpp | 60 - .../glm/source/glm/gtx/matrix_interpolation.inl | 146 - .../glm/source/glm/gtx/matrix_major_storage.hpp | 119 - .../glm/source/glm/gtx/matrix_major_storage.inl | 166 - 3rdparty/glm/source/glm/gtx/matrix_operation.hpp | 103 - 3rdparty/glm/source/glm/gtx/matrix_operation.inl | 176 - 3rdparty/glm/source/glm/gtx/matrix_query.hpp | 77 - 3rdparty/glm/source/glm/gtx/matrix_query.inl | 113 - .../glm/source/glm/gtx/matrix_transform_2d.hpp | 81 - .../glm/source/glm/gtx/matrix_transform_2d.inl | 68 - 3rdparty/glm/source/glm/gtx/mixed_product.hpp | 41 - 3rdparty/glm/source/glm/gtx/mixed_product.inl | 15 - 3rdparty/glm/source/glm/gtx/norm.hpp | 88 - 3rdparty/glm/source/glm/gtx/norm.inl | 95 - 3rdparty/glm/source/glm/gtx/normal.hpp | 41 - 3rdparty/glm/source/glm/gtx/normal.inl | 15 - 3rdparty/glm/source/glm/gtx/normalize_dot.hpp | 49 - 3rdparty/glm/source/glm/gtx/normalize_dot.inl | 16 - 3rdparty/glm/source/glm/gtx/number_precision.hpp | 61 - 3rdparty/glm/source/glm/gtx/number_precision.inl | 6 - 3rdparty/glm/source/glm/gtx/optimum_pow.hpp | 54 - 3rdparty/glm/source/glm/gtx/optimum_pow.inl | 22 - 3rdparty/glm/source/glm/gtx/orthonormalize.hpp | 49 - 3rdparty/glm/source/glm/gtx/orthonormalize.inl | 29 - 3rdparty/glm/source/glm/gtx/pca.hpp | 111 - 3rdparty/glm/source/glm/gtx/pca.inl | 343 - 3rdparty/glm/source/glm/gtx/perpendicular.hpp | 41 - 3rdparty/glm/source/glm/gtx/perpendicular.inl | 10 - 3rdparty/glm/source/glm/gtx/polar_coordinates.hpp | 48 - 3rdparty/glm/source/glm/gtx/polar_coordinates.inl | 36 - 3rdparty/glm/source/glm/gtx/projection.hpp | 43 - 3rdparty/glm/source/glm/gtx/projection.inl | 10 - 3rdparty/glm/source/glm/gtx/quaternion.hpp | 174 - 3rdparty/glm/source/glm/gtx/quaternion.inl | 159 - 3rdparty/glm/source/glm/gtx/range.hpp | 98 - 3rdparty/glm/source/glm/gtx/raw_data.hpp | 51 - 3rdparty/glm/source/glm/gtx/raw_data.inl | 2 - .../glm/source/glm/gtx/rotate_normalized_axis.hpp | 68 - .../glm/source/glm/gtx/rotate_normalized_axis.inl | 58 - 3rdparty/glm/source/glm/gtx/rotate_vector.hpp | 123 - 3rdparty/glm/source/glm/gtx/rotate_vector.inl | 187 - .../glm/source/glm/gtx/scalar_multiplication.hpp | 75 - 3rdparty/glm/source/glm/gtx/scalar_relational.hpp | 36 - 3rdparty/glm/source/glm/gtx/scalar_relational.inl | 88 - 3rdparty/glm/source/glm/gtx/spline.hpp | 65 - 3rdparty/glm/source/glm/gtx/spline.inl | 60 - 3rdparty/glm/source/glm/gtx/std_based_type.hpp | 68 - 3rdparty/glm/source/glm/gtx/std_based_type.inl | 6 - 3rdparty/glm/source/glm/gtx/string_cast.hpp | 46 - 3rdparty/glm/source/glm/gtx/string_cast.inl | 492 - 3rdparty/glm/source/glm/gtx/texture.hpp | 46 - 3rdparty/glm/source/glm/gtx/texture.inl | 17 - 3rdparty/glm/source/glm/gtx/transform.hpp | 60 - 3rdparty/glm/source/glm/gtx/transform.inl | 23 - 3rdparty/glm/source/glm/gtx/transform2.hpp | 89 - 3rdparty/glm/source/glm/gtx/transform2.inl | 125 - 3rdparty/glm/source/glm/gtx/type_aligned.hpp | 982 - 3rdparty/glm/source/glm/gtx/type_aligned.inl | 6 - 3rdparty/glm/source/glm/gtx/type_trait.hpp | 85 - 3rdparty/glm/source/glm/gtx/type_trait.inl | 61 - 3rdparty/glm/source/glm/gtx/vec_swizzle.hpp | 2782 -- 3rdparty/glm/source/glm/gtx/vector_angle.hpp | 57 - 3rdparty/glm/source/glm/gtx/vector_angle.inl | 45 - 3rdparty/glm/source/glm/gtx/vector_query.hpp | 66 - 3rdparty/glm/source/glm/gtx/vector_query.inl | 154 - 3rdparty/glm/source/glm/gtx/wrap.hpp | 37 - 3rdparty/glm/source/glm/gtx/wrap.inl | 6 - 3rdparty/glm/source/glm/integer.hpp | 212 - 3rdparty/glm/source/glm/mat2x2.hpp | 9 - 3rdparty/glm/source/glm/mat2x3.hpp | 9 - 3rdparty/glm/source/glm/mat2x4.hpp | 9 - 3rdparty/glm/source/glm/mat3x2.hpp | 9 - 3rdparty/glm/source/glm/mat3x3.hpp | 8 - 3rdparty/glm/source/glm/mat3x4.hpp | 8 - 3rdparty/glm/source/glm/mat4x2.hpp | 9 - 3rdparty/glm/source/glm/mat4x3.hpp | 8 - 3rdparty/glm/source/glm/mat4x4.hpp | 9 - 3rdparty/glm/source/glm/matrix.hpp | 161 - 3rdparty/glm/source/glm/packing.hpp | 173 - 3rdparty/glm/source/glm/simd/common.h | 240 - 3rdparty/glm/source/glm/simd/exponential.h | 20 - 3rdparty/glm/source/glm/simd/geometric.h | 124 - 3rdparty/glm/source/glm/simd/integer.h | 115 - 3rdparty/glm/source/glm/simd/matrix.h | 1028 - 3rdparty/glm/source/glm/simd/neon.h | 155 - 3rdparty/glm/source/glm/simd/packing.h | 8 - 3rdparty/glm/source/glm/simd/platform.h | 408 - 3rdparty/glm/source/glm/simd/trigonometric.h | 9 - 3rdparty/glm/source/glm/simd/vector_relational.h | 8 - 3rdparty/glm/source/glm/trigonometric.hpp | 210 - 3rdparty/glm/source/glm/vec2.hpp | 14 - 3rdparty/glm/source/glm/vec3.hpp | 14 - 3rdparty/glm/source/glm/vec4.hpp | 15 - 3rdparty/glm/source/glm/vector_relational.hpp | 121 - 3rdparty/glm/source/manual.md | 2430 -- 3rdparty/glm/source/readme.md | 1231 - 3rdparty/glm/source/test/CMakeLists.txt | 246 - 3rdparty/glm/source/test/bug/CMakeLists.txt | 1 - 3rdparty/glm/source/test/bug/bug_ms_vec_static.cpp | 31 - 3rdparty/glm/source/test/cmake/CMakeLists.txt | 8 - 3rdparty/glm/source/test/cmake/test_find_glm.cpp | 22 - 3rdparty/glm/source/test/core/CMakeLists.txt | 52 - .../glm/source/test/core/core_cpp_constexpr.cpp | 750 - .../source/test/core/core_cpp_defaulted_ctor.cpp | 145 - .../test/core/core_force_aligned_gentypes.cpp | 10 - .../source/test/core/core_force_arch_unknown.cpp | 14 - .../test/core/core_force_compiler_unknown.cpp | 14 - .../glm/source/test/core/core_force_ctor_init.cpp | 139 - 3rdparty/glm/source/test/core/core_force_cxx03.cpp | 14 - 3rdparty/glm/source/test/core/core_force_cxx98.cpp | 14 - .../source/test/core/core_force_cxx_unknown.cpp | 14 - .../test/core/core_force_depth_zero_to_one.cpp | 12 - .../source/test/core/core_force_explicit_ctor.cpp | 17 - .../glm/source/test/core/core_force_inline.cpp | 12 - .../source/test/core/core_force_left_handed.cpp | 12 - .../test/core/core_force_platform_unknown.cpp | 14 - 3rdparty/glm/source/test/core/core_force_pure.cpp | 434 - .../glm/source/test/core/core_force_quat_xyzw.cpp | 13 - .../source/test/core/core_force_size_t_length.cpp | 12 - .../test/core/core_force_unrestricted_gentype.cpp | 12 - .../glm/source/test/core/core_force_xyzw_only.cpp | 58 - 3rdparty/glm/source/test/core/core_func_common.cpp | 1349 - .../glm/source/test/core/core_func_exponential.cpp | 185 - .../glm/source/test/core/core_func_geometric.cpp | 200 - .../glm/source/test/core/core_func_integer.cpp | 1556 -- .../test/core/core_func_integer_bit_count.cpp | 291 - .../test/core/core_func_integer_find_lsb.cpp | 416 - .../test/core/core_func_integer_find_msb.cpp | 440 - 3rdparty/glm/source/test/core/core_func_matrix.cpp | 312 - 3rdparty/glm/source/test/core/core_func_noise.cpp | 7 - .../glm/source/test/core/core_func_packing.cpp | 156 - .../glm/source/test/core/core_func_swizzle.cpp | 164 - .../source/test/core/core_func_trigonometric.cpp | 10 - .../test/core/core_func_vector_relational.cpp | 180 - .../source/test/core/core_setup_force_cxx98.cpp | 12 - .../test/core/core_setup_force_size_t_length.cpp | 22 - .../glm/source/test/core/core_setup_message.cpp | 230 - .../test/core/core_setup_platform_unknown.cpp | 21 - .../glm/source/test/core/core_setup_precision.cpp | 58 - .../glm/source/test/core/core_type_aligned.cpp | 92 - 3rdparty/glm/source/test/core/core_type_cast.cpp | 146 - 3rdparty/glm/source/test/core/core_type_ctor.cpp | 351 - 3rdparty/glm/source/test/core/core_type_int.cpp | 26 - 3rdparty/glm/source/test/core/core_type_length.cpp | 78 - 3rdparty/glm/source/test/core/core_type_mat2x2.cpp | 177 - 3rdparty/glm/source/test/core/core_type_mat2x3.cpp | 142 - 3rdparty/glm/source/test/core/core_type_mat2x4.cpp | 147 - 3rdparty/glm/source/test/core/core_type_mat3x2.cpp | 148 - 3rdparty/glm/source/test/core/core_type_mat3x3.cpp | 197 - 3rdparty/glm/source/test/core/core_type_mat3x4.cpp | 149 - 3rdparty/glm/source/test/core/core_type_mat4x2.cpp | 151 - 3rdparty/glm/source/test/core/core_type_mat4x3.cpp | 152 - 3rdparty/glm/source/test/core/core_type_mat4x4.cpp | 218 - 3rdparty/glm/source/test/core/core_type_vec1.cpp | 169 - 3rdparty/glm/source/test/core/core_type_vec2.cpp | 392 - 3rdparty/glm/source/test/core/core_type_vec3.cpp | 628 - 3rdparty/glm/source/test/core/core_type_vec4.cpp | 850 - 3rdparty/glm/source/test/ext/CMakeLists.txt | 55 - .../glm/source/test/ext/ext_matrix_clip_space.cpp | 13 - 3rdparty/glm/source/test/ext/ext_matrix_common.cpp | 53 - .../source/test/ext/ext_matrix_int2x2_sized.cpp | 28 - .../source/test/ext/ext_matrix_int2x3_sized.cpp | 28 - .../source/test/ext/ext_matrix_int2x4_sized.cpp | 28 - .../source/test/ext/ext_matrix_int3x2_sized.cpp | 28 - .../source/test/ext/ext_matrix_int3x3_sized.cpp | 28 - .../source/test/ext/ext_matrix_int3x4_sized.cpp | 28 - .../source/test/ext/ext_matrix_int4x2_sized.cpp | 28 - .../source/test/ext/ext_matrix_int4x3_sized.cpp | 28 - .../source/test/ext/ext_matrix_int4x4_sized.cpp | 28 - .../glm/source/test/ext/ext_matrix_integer.cpp | 237 - .../glm/source/test/ext/ext_matrix_projection.cpp | 13 - .../glm/source/test/ext/ext_matrix_relational.cpp | 163 - .../glm/source/test/ext/ext_matrix_transform.cpp | 61 - .../source/test/ext/ext_matrix_uint2x2_sized.cpp | 28 - .../source/test/ext/ext_matrix_uint2x3_sized.cpp | 28 - .../source/test/ext/ext_matrix_uint2x4_sized.cpp | 28 - .../source/test/ext/ext_matrix_uint3x2_sized.cpp | 28 - .../source/test/ext/ext_matrix_uint3x3_sized.cpp | 28 - .../source/test/ext/ext_matrix_uint3x4_sized.cpp | 28 - .../source/test/ext/ext_matrix_uint4x2_sized.cpp | 28 - .../source/test/ext/ext_matrix_uint4x3_sized.cpp | 28 - .../source/test/ext/ext_matrix_uint4x4_sized.cpp | 28 - .../glm/source/test/ext/ext_quaternion_common.cpp | 61 - .../source/test/ext/ext_quaternion_exponential.cpp | 87 - .../source/test/ext/ext_quaternion_geometric.cpp | 88 - .../source/test/ext/ext_quaternion_relational.cpp | 51 - .../source/test/ext/ext_quaternion_transform.cpp | 45 - .../test/ext/ext_quaternion_trigonometric.cpp | 40 - .../glm/source/test/ext/ext_quaternion_type.cpp | 113 - 3rdparty/glm/source/test/ext/ext_scalar_common.cpp | 360 - .../glm/source/test/ext/ext_scalar_constants.cpp | 36 - .../glm/source/test/ext/ext_scalar_int_sized.cpp | 43 - .../glm/source/test/ext/ext_scalar_integer.cpp | 686 - .../glm/source/test/ext/ext_scalar_packing.cpp | 28 - .../glm/source/test/ext/ext_scalar_reciprocal.cpp | 171 - .../glm/source/test/ext/ext_scalar_relational.cpp | 106 - .../glm/source/test/ext/ext_scalar_uint_sized.cpp | 43 - 3rdparty/glm/source/test/ext/ext_scalar_ulp.cpp | 96 - 3rdparty/glm/source/test/ext/ext_vec1.cpp | 157 - 3rdparty/glm/source/test/ext/ext_vector_bool1.cpp | 104 - 3rdparty/glm/source/test/ext/ext_vector_common.cpp | 365 - 3rdparty/glm/source/test/ext/ext_vector_iec559.cpp | 166 - .../glm/source/test/ext/ext_vector_int1_sized.cpp | 41 - .../glm/source/test/ext/ext_vector_int2_sized.cpp | 41 - .../glm/source/test/ext/ext_vector_int3_sized.cpp | 41 - .../glm/source/test/ext/ext_vector_int4_sized.cpp | 41 - .../glm/source/test/ext/ext_vector_integer.cpp | 547 - .../source/test/ext/ext_vector_integer_sized.cpp | 216 - .../glm/source/test/ext/ext_vector_packing.cpp | 58 - .../glm/source/test/ext/ext_vector_reciprocal.cpp | 186 - .../glm/source/test/ext/ext_vector_relational.cpp | 205 - .../glm/source/test/ext/ext_vector_uint1_sized.cpp | 41 - .../glm/source/test/ext/ext_vector_uint2_sized.cpp | 41 - .../glm/source/test/ext/ext_vector_uint3_sized.cpp | 41 - .../glm/source/test/ext/ext_vector_uint4_sized.cpp | 41 - 3rdparty/glm/source/test/ext/ext_vector_ulp.cpp | 99 - 3rdparty/glm/source/test/glm.cppcheck | 6 - 3rdparty/glm/source/test/gtc/CMakeLists.txt | 20 - 3rdparty/glm/source/test/gtc/gtc_bitfield.cpp | 936 - 3rdparty/glm/source/test/gtc/gtc_color_space.cpp | 78 - 3rdparty/glm/source/test/gtc/gtc_constants.cpp | 30 - 3rdparty/glm/source/test/gtc/gtc_epsilon.cpp | 78 - 3rdparty/glm/source/test/gtc/gtc_integer.cpp | 233 - 3rdparty/glm/source/test/gtc/gtc_matrix_access.cpp | 383 - .../glm/source/test/gtc/gtc_matrix_integer.cpp | 8 - .../glm/source/test/gtc/gtc_matrix_inverse.cpp | 51 - .../glm/source/test/gtc/gtc_matrix_transform.cpp | 55 - 3rdparty/glm/source/test/gtc/gtc_noise.cpp | 86 - 3rdparty/glm/source/test/gtc/gtc_packing.cpp | 878 - 3rdparty/glm/source/test/gtc/gtc_quaternion.cpp | 345 - 3rdparty/glm/source/test/gtc/gtc_random.cpp | 381 - 3rdparty/glm/source/test/gtc/gtc_reciprocal.cpp | 8 - 3rdparty/glm/source/test/gtc/gtc_round.cpp | 458 - 3rdparty/glm/source/test/gtc/gtc_type_aligned.cpp | 181 - .../glm/source/test/gtc/gtc_type_precision.cpp | 1041 - 3rdparty/glm/source/test/gtc/gtc_type_ptr.cpp | 335 - 3rdparty/glm/source/test/gtc/gtc_ulp.cpp | 99 - .../glm/source/test/gtc/gtc_user_defined_types.cpp | 30 - 3rdparty/glm/source/test/gtc/gtc_vec1.cpp | 8 - 3rdparty/glm/source/test/gtx/CMakeLists.txt | 59 - 3rdparty/glm/source/test/gtx/gtx.cpp | 8 - .../glm/source/test/gtx/gtx_associated_min_max.cpp | 10 - 3rdparty/glm/source/test/gtx/gtx_closest_point.cpp | 9 - .../glm/source/test/gtx/gtx_color_encoding.cpp | 51 - 3rdparty/glm/source/test/gtx/gtx_color_space.cpp | 20 - .../glm/source/test/gtx/gtx_color_space_YCoCg.cpp | 9 - 3rdparty/glm/source/test/gtx/gtx_common.cpp | 161 - 3rdparty/glm/source/test/gtx/gtx_compatibility.cpp | 19 - .../glm/source/test/gtx/gtx_component_wise.cpp | 116 - .../glm/source/test/gtx/gtx_dual_quaternion.cpp | 205 - 3rdparty/glm/source/test/gtx/gtx_easing.cpp | 65 - 3rdparty/glm/source/test/gtx/gtx_euler_angle.cpp | 539 - 3rdparty/glm/source/test/gtx/gtx_extend.cpp | 9 - .../glm/source/test/gtx/gtx_extended_min_max.cpp | 101 - .../glm/source/test/gtx/gtx_extented_min_max.cpp | 39 - .../glm/source/test/gtx/gtx_exterior_product.cpp | 14 - .../glm/source/test/gtx/gtx_fast_exponential.cpp | 9 - .../glm/source/test/gtx/gtx_fast_square_root.cpp | 45 - .../glm/source/test/gtx/gtx_fast_trigonometry.cpp | 564 - 3rdparty/glm/source/test/gtx/gtx_functions.cpp | 36 - .../glm/source/test/gtx/gtx_gradient_paint.cpp | 34 - .../test/gtx/gtx_handed_coordinate_space.cpp | 9 - .../glm/source/test/gtx/gtx_int_10_10_10_2.cpp | 18 - 3rdparty/glm/source/test/gtx/gtx_integer.cpp | 108 - 3rdparty/glm/source/test/gtx/gtx_intersect.cpp | 88 - 3rdparty/glm/source/test/gtx/gtx_io.cpp | 186 - 3rdparty/glm/source/test/gtx/gtx_load.cpp | 124 - 3rdparty/glm/source/test/gtx/gtx_log_base.cpp | 54 - .../source/test/gtx/gtx_matrix_cross_product.cpp | 9 - .../glm/source/test/gtx/gtx_matrix_decompose.cpp | 19 - .../source/test/gtx/gtx_matrix_factorisation.cpp | 105 - .../source/test/gtx/gtx_matrix_interpolation.cpp | 122 - .../source/test/gtx/gtx_matrix_major_storage.cpp | 9 - .../glm/source/test/gtx/gtx_matrix_operation.cpp | 86 - 3rdparty/glm/source/test/gtx/gtx_matrix_query.cpp | 66 - .../source/test/gtx/gtx_matrix_transform_2d.cpp | 9 - 3rdparty/glm/source/test/gtx/gtx_mixed_product.cpp | 18 - 3rdparty/glm/source/test/gtx/gtx_norm.cpp | 81 - 3rdparty/glm/source/test/gtx/gtx_normal.cpp | 9 - 3rdparty/glm/source/test/gtx/gtx_normalize_dot.cpp | 9 - .../glm/source/test/gtx/gtx_number_precision.cpp | 9 - 3rdparty/glm/source/test/gtx/gtx_optimum_pow.cpp | 9 - .../glm/source/test/gtx/gtx_orthonormalize.cpp | 9 - 3rdparty/glm/source/test/gtx/gtx_pca.cpp | 724 - 3rdparty/glm/source/test/gtx/gtx_perpendicular.cpp | 9 - .../glm/source/test/gtx/gtx_polar_coordinates.cpp | 9 - 3rdparty/glm/source/test/gtx/gtx_projection.cpp | 9 - 3rdparty/glm/source/test/gtx/gtx_quaternion.cpp | 107 - 3rdparty/glm/source/test/gtx/gtx_random.cpp | 99 - 3rdparty/glm/source/test/gtx/gtx_range.cpp | 83 - .../source/test/gtx/gtx_rotate_normalized_axis.cpp | 9 - 3rdparty/glm/source/test/gtx/gtx_rotate_vector.cpp | 77 - .../source/test/gtx/gtx_scalar_multiplication.cpp | 37 - .../glm/source/test/gtx/gtx_scalar_relational.cpp | 174 - 3rdparty/glm/source/test/gtx/gtx_simd_mat4.cpp | 324 - 3rdparty/glm/source/test/gtx/gtx_simd_vec4.cpp | 71 - 3rdparty/glm/source/test/gtx/gtx_spline.cpp | 100 - 3rdparty/glm/source/test/gtx/gtx_string_cast.cpp | 155 - 3rdparty/glm/source/test/gtx/gtx_texture.cpp | 22 - 3rdparty/glm/source/test/gtx/gtx_type_aligned.cpp | 114 - 3rdparty/glm/source/test/gtx/gtx_type_trait.cpp | 13 - 3rdparty/glm/source/test/gtx/gtx_vec_swizzle.cpp | 11 - 3rdparty/glm/source/test/gtx/gtx_vector_angle.cpp | 59 - 3rdparty/glm/source/test/gtx/gtx_vector_query.cpp | 82 - 3rdparty/glm/source/test/gtx/gtx_wrap.cpp | 191 - 3rdparty/glm/source/test/perf/CMakeLists.txt | 6 - 3rdparty/glm/source/test/perf/perf_matrix_div.cpp | 153 - .../glm/source/test/perf/perf_matrix_inverse.cpp | 150 - 3rdparty/glm/source/test/perf/perf_matrix_mul.cpp | 154 - .../source/test/perf/perf_matrix_mul_vector.cpp | 154 - .../glm/source/test/perf/perf_matrix_transpose.cpp | 150 - .../source/test/perf/perf_vector_mul_matrix.cpp | 154 - 3rdparty/glm/source/util/autoexp.txt | 28 - 3rdparty/glm/source/util/autoexp.vc2010.dat | 3896 --- 3rdparty/glm/source/util/glm.natvis | 555 - 3rdparty/glm/source/util/usertype.dat | 407 - 741 files changed, 170920 deletions(-) delete mode 100644 3rdparty/glfw/source/.appveyor.yml delete mode 100644 3rdparty/glfw/source/.gitattributes delete mode 100644 3rdparty/glfw/source/.github/workflows/build.yml delete mode 100644 3rdparty/glfw/source/.mailmap delete mode 100644 3rdparty/glfw/source/CONTRIBUTORS.md delete mode 100644 3rdparty/glfw/source/LICENSE.md delete mode 100644 3rdparty/glfw/source/README.md delete mode 100644 3rdparty/glfw/source/deps/getopt.c delete mode 100644 3rdparty/glfw/source/deps/getopt.h delete mode 100644 3rdparty/glfw/source/deps/glad/gl.h delete mode 100644 3rdparty/glfw/source/deps/glad/gles2.h delete mode 100644 3rdparty/glfw/source/deps/glad/vulkan.h delete mode 100644 3rdparty/glfw/source/deps/linmath.h delete mode 100644 3rdparty/glfw/source/deps/mingw/_mingw_dxhelper.h delete mode 100644 3rdparty/glfw/source/deps/mingw/dinput.h delete mode 100644 3rdparty/glfw/source/deps/mingw/xinput.h delete mode 100644 3rdparty/glfw/source/deps/nuklear.h delete mode 100644 3rdparty/glfw/source/deps/nuklear_glfw_gl2.h delete mode 100644 3rdparty/glfw/source/deps/stb_image_write.h delete mode 100644 3rdparty/glfw/source/deps/tinycthread.c delete mode 100644 3rdparty/glfw/source/deps/tinycthread.h delete mode 100644 3rdparty/glfw/source/deps/vs2008/stdint.h delete mode 100644 3rdparty/glfw/source/docs/CMakeLists.txt delete mode 100644 3rdparty/glfw/source/docs/CODEOWNERS delete mode 100644 3rdparty/glfw/source/docs/CONTRIBUTING.md delete mode 100644 3rdparty/glfw/source/docs/Doxyfile.in delete mode 100644 3rdparty/glfw/source/docs/DoxygenLayout.xml delete mode 100644 3rdparty/glfw/source/docs/SUPPORT.md delete mode 100644 3rdparty/glfw/source/docs/build.dox delete mode 100644 3rdparty/glfw/source/docs/compat.dox delete mode 100644 3rdparty/glfw/source/docs/compile.dox delete mode 100644 3rdparty/glfw/source/docs/context.dox delete mode 100644 3rdparty/glfw/source/docs/extra.css delete mode 100644 3rdparty/glfw/source/docs/extra.css.map delete mode 100644 3rdparty/glfw/source/docs/extra.scss delete mode 100644 3rdparty/glfw/source/docs/footer.html delete mode 100644 3rdparty/glfw/source/docs/header.html delete mode 100644 3rdparty/glfw/source/docs/input.dox delete mode 100644 3rdparty/glfw/source/docs/internal.dox delete mode 100644 3rdparty/glfw/source/docs/intro.dox delete mode 100644 3rdparty/glfw/source/docs/main.dox delete mode 100644 3rdparty/glfw/source/docs/monitor.dox delete mode 100644 3rdparty/glfw/source/docs/moving.dox delete mode 100644 3rdparty/glfw/source/docs/news.dox delete mode 100644 3rdparty/glfw/source/docs/quick.dox delete mode 100644 3rdparty/glfw/source/docs/spaces.svg delete mode 100644 3rdparty/glfw/source/docs/vulkan.dox delete mode 100644 3rdparty/glfw/source/docs/window.dox delete mode 100644 3rdparty/glfw/source/examples/CMakeLists.txt delete mode 100644 3rdparty/glfw/source/examples/boing.c delete mode 100644 3rdparty/glfw/source/examples/gears.c delete mode 100644 3rdparty/glfw/source/examples/glfw.icns delete mode 100644 3rdparty/glfw/source/examples/glfw.ico delete mode 100644 3rdparty/glfw/source/examples/heightmap.c delete mode 100644 3rdparty/glfw/source/examples/offscreen.c delete mode 100644 3rdparty/glfw/source/examples/particles.c delete mode 100644 3rdparty/glfw/source/examples/sharing.c delete mode 100644 3rdparty/glfw/source/examples/splitview.c delete mode 100644 3rdparty/glfw/source/examples/triangle-opengl.c delete mode 100644 3rdparty/glfw/source/examples/triangle-opengles.c delete mode 100644 3rdparty/glfw/source/examples/wave.c delete mode 100644 3rdparty/glfw/source/examples/windows.c delete mode 100644 3rdparty/glfw/source/tests/CMakeLists.txt delete mode 100644 3rdparty/glfw/source/tests/allocator.c delete mode 100644 3rdparty/glfw/source/tests/clipboard.c delete mode 100644 3rdparty/glfw/source/tests/cursor.c delete mode 100644 3rdparty/glfw/source/tests/empty.c delete mode 100644 3rdparty/glfw/source/tests/events.c delete mode 100644 3rdparty/glfw/source/tests/gamma.c delete mode 100644 3rdparty/glfw/source/tests/glfwinfo.c delete mode 100644 3rdparty/glfw/source/tests/icon.c delete mode 100644 3rdparty/glfw/source/tests/iconify.c delete mode 100644 3rdparty/glfw/source/tests/inputlag.c delete mode 100644 3rdparty/glfw/source/tests/joysticks.c delete mode 100644 3rdparty/glfw/source/tests/monitors.c delete mode 100644 3rdparty/glfw/source/tests/msaa.c delete mode 100644 3rdparty/glfw/source/tests/reopen.c delete mode 100644 3rdparty/glfw/source/tests/tearing.c delete mode 100644 3rdparty/glfw/source/tests/threads.c delete mode 100644 3rdparty/glfw/source/tests/timeout.c delete mode 100644 3rdparty/glfw/source/tests/title.c delete mode 100644 3rdparty/glfw/source/tests/triangle-vulkan.c delete mode 100644 3rdparty/glfw/source/tests/window.c delete mode 100644 3rdparty/glm/CMakeLists.txt delete mode 100644 3rdparty/glm/README.md delete mode 100644 3rdparty/glm/glm.stamp delete mode 100644 3rdparty/glm/source/.appveyor.yml delete mode 100644 3rdparty/glm/source/.gitignore delete mode 100644 3rdparty/glm/source/.travis.yml delete mode 100644 3rdparty/glm/source/CMakeLists.txt delete mode 100644 3rdparty/glm/source/cmake/cmake_uninstall.cmake.in delete mode 100644 3rdparty/glm/source/copying.txt delete mode 100644 3rdparty/glm/source/glm/CMakeLists.txt delete mode 100644 3rdparty/glm/source/glm/common.hpp delete mode 100644 3rdparty/glm/source/glm/detail/_features.hpp delete mode 100644 3rdparty/glm/source/glm/detail/_fixes.hpp delete mode 100644 3rdparty/glm/source/glm/detail/_noise.hpp delete mode 100644 3rdparty/glm/source/glm/detail/_swizzle.hpp delete mode 100644 3rdparty/glm/source/glm/detail/_swizzle_func.hpp delete mode 100644 3rdparty/glm/source/glm/detail/_vectorize.hpp delete mode 100644 3rdparty/glm/source/glm/detail/compute_common.hpp delete mode 100644 3rdparty/glm/source/glm/detail/compute_vector_relational.hpp delete mode 100644 3rdparty/glm/source/glm/detail/func_common.inl delete mode 100644 3rdparty/glm/source/glm/detail/func_common_simd.inl delete mode 100644 3rdparty/glm/source/glm/detail/func_exponential.inl delete mode 100644 3rdparty/glm/source/glm/detail/func_exponential_simd.inl delete mode 100644 3rdparty/glm/source/glm/detail/func_geometric.inl delete mode 100644 3rdparty/glm/source/glm/detail/func_geometric_simd.inl delete mode 100644 3rdparty/glm/source/glm/detail/func_integer.inl delete mode 100644 3rdparty/glm/source/glm/detail/func_integer_simd.inl delete mode 100644 3rdparty/glm/source/glm/detail/func_matrix.inl delete mode 100644 3rdparty/glm/source/glm/detail/func_matrix_simd.inl delete mode 100644 3rdparty/glm/source/glm/detail/func_packing.inl delete mode 100644 3rdparty/glm/source/glm/detail/func_packing_simd.inl delete mode 100644 3rdparty/glm/source/glm/detail/func_trigonometric.inl delete mode 100644 3rdparty/glm/source/glm/detail/func_trigonometric_simd.inl delete mode 100644 3rdparty/glm/source/glm/detail/func_vector_relational.inl delete mode 100644 3rdparty/glm/source/glm/detail/func_vector_relational_simd.inl delete mode 100644 3rdparty/glm/source/glm/detail/glm.cpp delete mode 100644 3rdparty/glm/source/glm/detail/qualifier.hpp delete mode 100644 3rdparty/glm/source/glm/detail/setup.hpp delete mode 100644 3rdparty/glm/source/glm/detail/type_float.hpp delete mode 100644 3rdparty/glm/source/glm/detail/type_half.hpp delete mode 100644 3rdparty/glm/source/glm/detail/type_half.inl delete mode 100644 3rdparty/glm/source/glm/detail/type_mat2x2.hpp delete mode 100644 3rdparty/glm/source/glm/detail/type_mat2x2.inl delete mode 100644 3rdparty/glm/source/glm/detail/type_mat2x3.hpp delete mode 100644 3rdparty/glm/source/glm/detail/type_mat2x3.inl delete mode 100644 3rdparty/glm/source/glm/detail/type_mat2x4.hpp delete mode 100644 3rdparty/glm/source/glm/detail/type_mat2x4.inl delete mode 100644 3rdparty/glm/source/glm/detail/type_mat3x2.hpp delete mode 100644 3rdparty/glm/source/glm/detail/type_mat3x2.inl delete mode 100644 3rdparty/glm/source/glm/detail/type_mat3x3.hpp delete mode 100644 3rdparty/glm/source/glm/detail/type_mat3x3.inl delete mode 100644 3rdparty/glm/source/glm/detail/type_mat3x4.hpp delete mode 100644 3rdparty/glm/source/glm/detail/type_mat3x4.inl delete mode 100644 3rdparty/glm/source/glm/detail/type_mat4x2.hpp delete mode 100644 3rdparty/glm/source/glm/detail/type_mat4x2.inl delete mode 100644 3rdparty/glm/source/glm/detail/type_mat4x3.hpp delete mode 100644 3rdparty/glm/source/glm/detail/type_mat4x3.inl delete mode 100644 3rdparty/glm/source/glm/detail/type_mat4x4.hpp delete mode 100644 3rdparty/glm/source/glm/detail/type_mat4x4.inl delete mode 100644 3rdparty/glm/source/glm/detail/type_mat4x4_simd.inl delete mode 100644 3rdparty/glm/source/glm/detail/type_quat.hpp delete mode 100644 3rdparty/glm/source/glm/detail/type_quat.inl delete mode 100644 3rdparty/glm/source/glm/detail/type_quat_simd.inl delete mode 100644 3rdparty/glm/source/glm/detail/type_vec1.hpp delete mode 100644 3rdparty/glm/source/glm/detail/type_vec1.inl delete mode 100644 3rdparty/glm/source/glm/detail/type_vec2.hpp delete mode 100644 3rdparty/glm/source/glm/detail/type_vec2.inl delete mode 100644 3rdparty/glm/source/glm/detail/type_vec3.hpp delete mode 100644 3rdparty/glm/source/glm/detail/type_vec3.inl delete mode 100644 3rdparty/glm/source/glm/detail/type_vec4.hpp delete mode 100644 3rdparty/glm/source/glm/detail/type_vec4.inl delete mode 100644 3rdparty/glm/source/glm/detail/type_vec4_simd.inl delete mode 100644 3rdparty/glm/source/glm/exponential.hpp delete mode 100644 3rdparty/glm/source/glm/ext.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_clip_space.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_clip_space.inl delete mode 100644 3rdparty/glm/source/glm/ext/matrix_common.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_common.inl delete mode 100644 3rdparty/glm/source/glm/ext/matrix_double2x2.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_double2x2_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_double2x3.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_double2x3_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_double2x4.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_double2x4_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_double3x2.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_double3x2_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_double3x3.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_double3x3_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_double3x4.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_double3x4_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_double4x2.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_double4x2_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_double4x3.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_double4x3_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_double4x4.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_double4x4_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_float2x2.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_float2x2_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_float2x3.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_float2x3_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_float2x4.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_float2x4_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_float3x2.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_float3x2_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_float3x3.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_float3x3_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_float3x4.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_float3x4_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_float4x2.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_float4x2_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_float4x3.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_float4x3_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_float4x4.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_float4x4_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_int2x2.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_int2x2_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_int2x3.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_int2x3_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_int2x4.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_int2x4_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_int3x2.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_int3x2_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_int3x3.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_int3x3_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_int3x4.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_int3x4_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_int4x2.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_int4x2_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_int4x3.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_int4x3_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_int4x4.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_int4x4_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_integer.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_integer.inl delete mode 100644 3rdparty/glm/source/glm/ext/matrix_projection.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_projection.inl delete mode 100644 3rdparty/glm/source/glm/ext/matrix_relational.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_relational.inl delete mode 100644 3rdparty/glm/source/glm/ext/matrix_transform.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_transform.inl delete mode 100644 3rdparty/glm/source/glm/ext/matrix_uint2x2.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_uint2x2_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_uint2x3.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_uint2x3_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_uint2x4.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_uint2x4_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_uint3x2.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_uint3x2_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_uint3x3.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_uint3x3_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_uint3x4.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_uint3x4_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_uint4x2.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_uint4x2_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_uint4x3.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_uint4x3_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_uint4x4.hpp delete mode 100644 3rdparty/glm/source/glm/ext/matrix_uint4x4_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/quaternion_common.hpp delete mode 100644 3rdparty/glm/source/glm/ext/quaternion_common.inl delete mode 100644 3rdparty/glm/source/glm/ext/quaternion_common_simd.inl delete mode 100644 3rdparty/glm/source/glm/ext/quaternion_double.hpp delete mode 100644 3rdparty/glm/source/glm/ext/quaternion_double_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/quaternion_exponential.hpp delete mode 100644 3rdparty/glm/source/glm/ext/quaternion_exponential.inl delete mode 100644 3rdparty/glm/source/glm/ext/quaternion_float.hpp delete mode 100644 3rdparty/glm/source/glm/ext/quaternion_float_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/quaternion_geometric.hpp delete mode 100644 3rdparty/glm/source/glm/ext/quaternion_geometric.inl delete mode 100644 3rdparty/glm/source/glm/ext/quaternion_relational.hpp delete mode 100644 3rdparty/glm/source/glm/ext/quaternion_relational.inl delete mode 100644 3rdparty/glm/source/glm/ext/quaternion_transform.hpp delete mode 100644 3rdparty/glm/source/glm/ext/quaternion_transform.inl delete mode 100644 3rdparty/glm/source/glm/ext/quaternion_trigonometric.hpp delete mode 100644 3rdparty/glm/source/glm/ext/quaternion_trigonometric.inl delete mode 100644 3rdparty/glm/source/glm/ext/scalar_common.hpp delete mode 100644 3rdparty/glm/source/glm/ext/scalar_common.inl delete mode 100644 3rdparty/glm/source/glm/ext/scalar_constants.hpp delete mode 100644 3rdparty/glm/source/glm/ext/scalar_constants.inl delete mode 100644 3rdparty/glm/source/glm/ext/scalar_int_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/scalar_integer.hpp delete mode 100644 3rdparty/glm/source/glm/ext/scalar_integer.inl delete mode 100644 3rdparty/glm/source/glm/ext/scalar_packing.hpp delete mode 100644 3rdparty/glm/source/glm/ext/scalar_packing.inl delete mode 100644 3rdparty/glm/source/glm/ext/scalar_reciprocal.hpp delete mode 100644 3rdparty/glm/source/glm/ext/scalar_reciprocal.inl delete mode 100644 3rdparty/glm/source/glm/ext/scalar_relational.hpp delete mode 100644 3rdparty/glm/source/glm/ext/scalar_relational.inl delete mode 100644 3rdparty/glm/source/glm/ext/scalar_uint_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/scalar_ulp.hpp delete mode 100644 3rdparty/glm/source/glm/ext/scalar_ulp.inl delete mode 100644 3rdparty/glm/source/glm/ext/vector_bool1.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_bool1_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_bool2.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_bool2_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_bool3.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_bool3_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_bool4.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_bool4_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_common.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_common.inl delete mode 100644 3rdparty/glm/source/glm/ext/vector_double1.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_double1_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_double2.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_double2_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_double3.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_double3_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_double4.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_double4_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_float1.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_float1_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_float2.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_float2_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_float3.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_float3_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_float4.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_float4_precision.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_int1.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_int1_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_int2.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_int2_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_int3.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_int3_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_int4.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_int4_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_integer.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_integer.inl delete mode 100644 3rdparty/glm/source/glm/ext/vector_packing.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_packing.inl delete mode 100644 3rdparty/glm/source/glm/ext/vector_reciprocal.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_reciprocal.inl delete mode 100644 3rdparty/glm/source/glm/ext/vector_relational.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_relational.inl delete mode 100644 3rdparty/glm/source/glm/ext/vector_uint1.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_uint1_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_uint2.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_uint2_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_uint3.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_uint3_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_uint4.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_uint4_sized.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_ulp.hpp delete mode 100644 3rdparty/glm/source/glm/ext/vector_ulp.inl delete mode 100644 3rdparty/glm/source/glm/fwd.hpp delete mode 100644 3rdparty/glm/source/glm/geometric.hpp delete mode 100644 3rdparty/glm/source/glm/glm.hpp delete mode 100644 3rdparty/glm/source/glm/gtc/bitfield.hpp delete mode 100644 3rdparty/glm/source/glm/gtc/bitfield.inl delete mode 100644 3rdparty/glm/source/glm/gtc/color_space.hpp delete mode 100644 3rdparty/glm/source/glm/gtc/color_space.inl delete mode 100644 3rdparty/glm/source/glm/gtc/constants.hpp delete mode 100644 3rdparty/glm/source/glm/gtc/constants.inl delete mode 100644 3rdparty/glm/source/glm/gtc/epsilon.hpp delete mode 100644 3rdparty/glm/source/glm/gtc/epsilon.inl delete mode 100644 3rdparty/glm/source/glm/gtc/integer.hpp delete mode 100644 3rdparty/glm/source/glm/gtc/integer.inl delete mode 100644 3rdparty/glm/source/glm/gtc/matrix_access.hpp delete mode 100644 3rdparty/glm/source/glm/gtc/matrix_access.inl delete mode 100644 3rdparty/glm/source/glm/gtc/matrix_integer.hpp delete mode 100644 3rdparty/glm/source/glm/gtc/matrix_inverse.hpp delete mode 100644 3rdparty/glm/source/glm/gtc/matrix_inverse.inl delete mode 100644 3rdparty/glm/source/glm/gtc/matrix_transform.hpp delete mode 100644 3rdparty/glm/source/glm/gtc/matrix_transform.inl delete mode 100644 3rdparty/glm/source/glm/gtc/noise.hpp delete mode 100644 3rdparty/glm/source/glm/gtc/noise.inl delete mode 100644 3rdparty/glm/source/glm/gtc/packing.hpp delete mode 100644 3rdparty/glm/source/glm/gtc/packing.inl delete mode 100644 3rdparty/glm/source/glm/gtc/quaternion.hpp delete mode 100644 3rdparty/glm/source/glm/gtc/quaternion.inl delete mode 100644 3rdparty/glm/source/glm/gtc/quaternion_simd.inl delete mode 100644 3rdparty/glm/source/glm/gtc/random.hpp delete mode 100644 3rdparty/glm/source/glm/gtc/random.inl delete mode 100644 3rdparty/glm/source/glm/gtc/reciprocal.hpp delete mode 100644 3rdparty/glm/source/glm/gtc/round.hpp delete mode 100644 3rdparty/glm/source/glm/gtc/round.inl delete mode 100644 3rdparty/glm/source/glm/gtc/type_aligned.hpp delete mode 100644 3rdparty/glm/source/glm/gtc/type_precision.hpp delete mode 100644 3rdparty/glm/source/glm/gtc/type_precision.inl delete mode 100644 3rdparty/glm/source/glm/gtc/type_ptr.hpp delete mode 100644 3rdparty/glm/source/glm/gtc/type_ptr.inl delete mode 100644 3rdparty/glm/source/glm/gtc/ulp.hpp delete mode 100644 3rdparty/glm/source/glm/gtc/ulp.inl delete mode 100644 3rdparty/glm/source/glm/gtc/vec1.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/associated_min_max.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/associated_min_max.inl delete mode 100644 3rdparty/glm/source/glm/gtx/bit.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/bit.inl delete mode 100644 3rdparty/glm/source/glm/gtx/closest_point.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/closest_point.inl delete mode 100644 3rdparty/glm/source/glm/gtx/color_encoding.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/color_encoding.inl delete mode 100644 3rdparty/glm/source/glm/gtx/color_space.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/color_space.inl delete mode 100644 3rdparty/glm/source/glm/gtx/color_space_YCoCg.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/color_space_YCoCg.inl delete mode 100644 3rdparty/glm/source/glm/gtx/common.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/common.inl delete mode 100644 3rdparty/glm/source/glm/gtx/compatibility.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/compatibility.inl delete mode 100644 3rdparty/glm/source/glm/gtx/component_wise.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/component_wise.inl delete mode 100644 3rdparty/glm/source/glm/gtx/dual_quaternion.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/dual_quaternion.inl delete mode 100644 3rdparty/glm/source/glm/gtx/easing.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/easing.inl delete mode 100644 3rdparty/glm/source/glm/gtx/euler_angles.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/euler_angles.inl delete mode 100644 3rdparty/glm/source/glm/gtx/extend.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/extend.inl delete mode 100644 3rdparty/glm/source/glm/gtx/extended_min_max.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/extended_min_max.inl delete mode 100644 3rdparty/glm/source/glm/gtx/exterior_product.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/exterior_product.inl delete mode 100644 3rdparty/glm/source/glm/gtx/fast_exponential.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/fast_exponential.inl delete mode 100644 3rdparty/glm/source/glm/gtx/fast_square_root.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/fast_square_root.inl delete mode 100644 3rdparty/glm/source/glm/gtx/fast_trigonometry.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/fast_trigonometry.inl delete mode 100644 3rdparty/glm/source/glm/gtx/float_notmalize.inl delete mode 100644 3rdparty/glm/source/glm/gtx/functions.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/functions.inl delete mode 100644 3rdparty/glm/source/glm/gtx/gradient_paint.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/gradient_paint.inl delete mode 100644 3rdparty/glm/source/glm/gtx/handed_coordinate_space.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/handed_coordinate_space.inl delete mode 100644 3rdparty/glm/source/glm/gtx/hash.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/hash.inl delete mode 100644 3rdparty/glm/source/glm/gtx/integer.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/integer.inl delete mode 100644 3rdparty/glm/source/glm/gtx/intersect.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/intersect.inl delete mode 100644 3rdparty/glm/source/glm/gtx/io.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/io.inl delete mode 100644 3rdparty/glm/source/glm/gtx/log_base.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/log_base.inl delete mode 100644 3rdparty/glm/source/glm/gtx/matrix_cross_product.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/matrix_cross_product.inl delete mode 100644 3rdparty/glm/source/glm/gtx/matrix_decompose.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/matrix_decompose.inl delete mode 100644 3rdparty/glm/source/glm/gtx/matrix_factorisation.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/matrix_factorisation.inl delete mode 100644 3rdparty/glm/source/glm/gtx/matrix_interpolation.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/matrix_interpolation.inl delete mode 100644 3rdparty/glm/source/glm/gtx/matrix_major_storage.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/matrix_major_storage.inl delete mode 100644 3rdparty/glm/source/glm/gtx/matrix_operation.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/matrix_operation.inl delete mode 100644 3rdparty/glm/source/glm/gtx/matrix_query.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/matrix_query.inl delete mode 100644 3rdparty/glm/source/glm/gtx/matrix_transform_2d.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/matrix_transform_2d.inl delete mode 100644 3rdparty/glm/source/glm/gtx/mixed_product.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/mixed_product.inl delete mode 100644 3rdparty/glm/source/glm/gtx/norm.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/norm.inl delete mode 100644 3rdparty/glm/source/glm/gtx/normal.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/normal.inl delete mode 100644 3rdparty/glm/source/glm/gtx/normalize_dot.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/normalize_dot.inl delete mode 100644 3rdparty/glm/source/glm/gtx/number_precision.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/number_precision.inl delete mode 100644 3rdparty/glm/source/glm/gtx/optimum_pow.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/optimum_pow.inl delete mode 100644 3rdparty/glm/source/glm/gtx/orthonormalize.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/orthonormalize.inl delete mode 100644 3rdparty/glm/source/glm/gtx/pca.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/pca.inl delete mode 100644 3rdparty/glm/source/glm/gtx/perpendicular.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/perpendicular.inl delete mode 100644 3rdparty/glm/source/glm/gtx/polar_coordinates.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/polar_coordinates.inl delete mode 100644 3rdparty/glm/source/glm/gtx/projection.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/projection.inl delete mode 100644 3rdparty/glm/source/glm/gtx/quaternion.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/quaternion.inl delete mode 100644 3rdparty/glm/source/glm/gtx/range.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/raw_data.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/raw_data.inl delete mode 100644 3rdparty/glm/source/glm/gtx/rotate_normalized_axis.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/rotate_normalized_axis.inl delete mode 100644 3rdparty/glm/source/glm/gtx/rotate_vector.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/rotate_vector.inl delete mode 100644 3rdparty/glm/source/glm/gtx/scalar_multiplication.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/scalar_relational.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/scalar_relational.inl delete mode 100644 3rdparty/glm/source/glm/gtx/spline.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/spline.inl delete mode 100644 3rdparty/glm/source/glm/gtx/std_based_type.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/std_based_type.inl delete mode 100644 3rdparty/glm/source/glm/gtx/string_cast.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/string_cast.inl delete mode 100644 3rdparty/glm/source/glm/gtx/texture.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/texture.inl delete mode 100644 3rdparty/glm/source/glm/gtx/transform.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/transform.inl delete mode 100644 3rdparty/glm/source/glm/gtx/transform2.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/transform2.inl delete mode 100644 3rdparty/glm/source/glm/gtx/type_aligned.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/type_aligned.inl delete mode 100644 3rdparty/glm/source/glm/gtx/type_trait.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/type_trait.inl delete mode 100644 3rdparty/glm/source/glm/gtx/vec_swizzle.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/vector_angle.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/vector_angle.inl delete mode 100644 3rdparty/glm/source/glm/gtx/vector_query.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/vector_query.inl delete mode 100644 3rdparty/glm/source/glm/gtx/wrap.hpp delete mode 100644 3rdparty/glm/source/glm/gtx/wrap.inl delete mode 100644 3rdparty/glm/source/glm/integer.hpp delete mode 100644 3rdparty/glm/source/glm/mat2x2.hpp delete mode 100644 3rdparty/glm/source/glm/mat2x3.hpp delete mode 100644 3rdparty/glm/source/glm/mat2x4.hpp delete mode 100644 3rdparty/glm/source/glm/mat3x2.hpp delete mode 100644 3rdparty/glm/source/glm/mat3x3.hpp delete mode 100644 3rdparty/glm/source/glm/mat3x4.hpp delete mode 100644 3rdparty/glm/source/glm/mat4x2.hpp delete mode 100644 3rdparty/glm/source/glm/mat4x3.hpp delete mode 100644 3rdparty/glm/source/glm/mat4x4.hpp delete mode 100644 3rdparty/glm/source/glm/matrix.hpp delete mode 100644 3rdparty/glm/source/glm/packing.hpp delete mode 100644 3rdparty/glm/source/glm/simd/common.h delete mode 100644 3rdparty/glm/source/glm/simd/exponential.h delete mode 100644 3rdparty/glm/source/glm/simd/geometric.h delete mode 100644 3rdparty/glm/source/glm/simd/integer.h delete mode 100644 3rdparty/glm/source/glm/simd/matrix.h delete mode 100644 3rdparty/glm/source/glm/simd/neon.h delete mode 100644 3rdparty/glm/source/glm/simd/packing.h delete mode 100644 3rdparty/glm/source/glm/simd/platform.h delete mode 100644 3rdparty/glm/source/glm/simd/trigonometric.h delete mode 100644 3rdparty/glm/source/glm/simd/vector_relational.h delete mode 100644 3rdparty/glm/source/glm/trigonometric.hpp delete mode 100644 3rdparty/glm/source/glm/vec2.hpp delete mode 100644 3rdparty/glm/source/glm/vec3.hpp delete mode 100644 3rdparty/glm/source/glm/vec4.hpp delete mode 100644 3rdparty/glm/source/glm/vector_relational.hpp delete mode 100644 3rdparty/glm/source/manual.md delete mode 100644 3rdparty/glm/source/readme.md delete mode 100644 3rdparty/glm/source/test/CMakeLists.txt delete mode 100644 3rdparty/glm/source/test/bug/CMakeLists.txt delete mode 100644 3rdparty/glm/source/test/bug/bug_ms_vec_static.cpp delete mode 100644 3rdparty/glm/source/test/cmake/CMakeLists.txt delete mode 100644 3rdparty/glm/source/test/cmake/test_find_glm.cpp delete mode 100644 3rdparty/glm/source/test/core/CMakeLists.txt delete mode 100644 3rdparty/glm/source/test/core/core_cpp_constexpr.cpp delete mode 100644 3rdparty/glm/source/test/core/core_cpp_defaulted_ctor.cpp delete mode 100644 3rdparty/glm/source/test/core/core_force_aligned_gentypes.cpp delete mode 100644 3rdparty/glm/source/test/core/core_force_arch_unknown.cpp delete mode 100644 3rdparty/glm/source/test/core/core_force_compiler_unknown.cpp delete mode 100644 3rdparty/glm/source/test/core/core_force_ctor_init.cpp delete mode 100644 3rdparty/glm/source/test/core/core_force_cxx03.cpp delete mode 100644 3rdparty/glm/source/test/core/core_force_cxx98.cpp delete mode 100644 3rdparty/glm/source/test/core/core_force_cxx_unknown.cpp delete mode 100644 3rdparty/glm/source/test/core/core_force_depth_zero_to_one.cpp delete mode 100644 3rdparty/glm/source/test/core/core_force_explicit_ctor.cpp delete mode 100644 3rdparty/glm/source/test/core/core_force_inline.cpp delete mode 100644 3rdparty/glm/source/test/core/core_force_left_handed.cpp delete mode 100644 3rdparty/glm/source/test/core/core_force_platform_unknown.cpp delete mode 100644 3rdparty/glm/source/test/core/core_force_pure.cpp delete mode 100644 3rdparty/glm/source/test/core/core_force_quat_xyzw.cpp delete mode 100644 3rdparty/glm/source/test/core/core_force_size_t_length.cpp delete mode 100644 3rdparty/glm/source/test/core/core_force_unrestricted_gentype.cpp delete mode 100644 3rdparty/glm/source/test/core/core_force_xyzw_only.cpp delete mode 100644 3rdparty/glm/source/test/core/core_func_common.cpp delete mode 100644 3rdparty/glm/source/test/core/core_func_exponential.cpp delete mode 100644 3rdparty/glm/source/test/core/core_func_geometric.cpp delete mode 100644 3rdparty/glm/source/test/core/core_func_integer.cpp delete mode 100644 3rdparty/glm/source/test/core/core_func_integer_bit_count.cpp delete mode 100644 3rdparty/glm/source/test/core/core_func_integer_find_lsb.cpp delete mode 100644 3rdparty/glm/source/test/core/core_func_integer_find_msb.cpp delete mode 100644 3rdparty/glm/source/test/core/core_func_matrix.cpp delete mode 100644 3rdparty/glm/source/test/core/core_func_noise.cpp delete mode 100644 3rdparty/glm/source/test/core/core_func_packing.cpp delete mode 100644 3rdparty/glm/source/test/core/core_func_swizzle.cpp delete mode 100644 3rdparty/glm/source/test/core/core_func_trigonometric.cpp delete mode 100644 3rdparty/glm/source/test/core/core_func_vector_relational.cpp delete mode 100644 3rdparty/glm/source/test/core/core_setup_force_cxx98.cpp delete mode 100644 3rdparty/glm/source/test/core/core_setup_force_size_t_length.cpp delete mode 100644 3rdparty/glm/source/test/core/core_setup_message.cpp delete mode 100644 3rdparty/glm/source/test/core/core_setup_platform_unknown.cpp delete mode 100644 3rdparty/glm/source/test/core/core_setup_precision.cpp delete mode 100644 3rdparty/glm/source/test/core/core_type_aligned.cpp delete mode 100644 3rdparty/glm/source/test/core/core_type_cast.cpp delete mode 100644 3rdparty/glm/source/test/core/core_type_ctor.cpp delete mode 100644 3rdparty/glm/source/test/core/core_type_int.cpp delete mode 100644 3rdparty/glm/source/test/core/core_type_length.cpp delete mode 100644 3rdparty/glm/source/test/core/core_type_mat2x2.cpp delete mode 100644 3rdparty/glm/source/test/core/core_type_mat2x3.cpp delete mode 100644 3rdparty/glm/source/test/core/core_type_mat2x4.cpp delete mode 100644 3rdparty/glm/source/test/core/core_type_mat3x2.cpp delete mode 100644 3rdparty/glm/source/test/core/core_type_mat3x3.cpp delete mode 100644 3rdparty/glm/source/test/core/core_type_mat3x4.cpp delete mode 100644 3rdparty/glm/source/test/core/core_type_mat4x2.cpp delete mode 100644 3rdparty/glm/source/test/core/core_type_mat4x3.cpp delete mode 100644 3rdparty/glm/source/test/core/core_type_mat4x4.cpp delete mode 100644 3rdparty/glm/source/test/core/core_type_vec1.cpp delete mode 100644 3rdparty/glm/source/test/core/core_type_vec2.cpp delete mode 100644 3rdparty/glm/source/test/core/core_type_vec3.cpp delete mode 100644 3rdparty/glm/source/test/core/core_type_vec4.cpp delete mode 100644 3rdparty/glm/source/test/ext/CMakeLists.txt delete mode 100644 3rdparty/glm/source/test/ext/ext_matrix_clip_space.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_matrix_common.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_matrix_int2x2_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_matrix_int2x3_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_matrix_int2x4_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_matrix_int3x2_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_matrix_int3x3_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_matrix_int3x4_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_matrix_int4x2_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_matrix_int4x3_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_matrix_int4x4_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_matrix_integer.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_matrix_projection.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_matrix_relational.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_matrix_transform.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_matrix_uint2x2_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_matrix_uint2x3_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_matrix_uint2x4_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_matrix_uint3x2_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_matrix_uint3x3_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_matrix_uint3x4_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_matrix_uint4x2_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_matrix_uint4x3_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_matrix_uint4x4_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_quaternion_common.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_quaternion_exponential.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_quaternion_geometric.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_quaternion_relational.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_quaternion_transform.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_quaternion_trigonometric.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_quaternion_type.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_scalar_common.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_scalar_constants.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_scalar_int_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_scalar_integer.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_scalar_packing.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_scalar_reciprocal.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_scalar_relational.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_scalar_uint_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_scalar_ulp.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_vec1.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_vector_bool1.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_vector_common.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_vector_iec559.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_vector_int1_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_vector_int2_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_vector_int3_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_vector_int4_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_vector_integer.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_vector_integer_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_vector_packing.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_vector_reciprocal.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_vector_relational.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_vector_uint1_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_vector_uint2_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_vector_uint3_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_vector_uint4_sized.cpp delete mode 100644 3rdparty/glm/source/test/ext/ext_vector_ulp.cpp delete mode 100644 3rdparty/glm/source/test/glm.cppcheck delete mode 100644 3rdparty/glm/source/test/gtc/CMakeLists.txt delete mode 100644 3rdparty/glm/source/test/gtc/gtc_bitfield.cpp delete mode 100644 3rdparty/glm/source/test/gtc/gtc_color_space.cpp delete mode 100644 3rdparty/glm/source/test/gtc/gtc_constants.cpp delete mode 100644 3rdparty/glm/source/test/gtc/gtc_epsilon.cpp delete mode 100644 3rdparty/glm/source/test/gtc/gtc_integer.cpp delete mode 100644 3rdparty/glm/source/test/gtc/gtc_matrix_access.cpp delete mode 100644 3rdparty/glm/source/test/gtc/gtc_matrix_integer.cpp delete mode 100644 3rdparty/glm/source/test/gtc/gtc_matrix_inverse.cpp delete mode 100644 3rdparty/glm/source/test/gtc/gtc_matrix_transform.cpp delete mode 100644 3rdparty/glm/source/test/gtc/gtc_noise.cpp delete mode 100644 3rdparty/glm/source/test/gtc/gtc_packing.cpp delete mode 100644 3rdparty/glm/source/test/gtc/gtc_quaternion.cpp delete mode 100644 3rdparty/glm/source/test/gtc/gtc_random.cpp delete mode 100644 3rdparty/glm/source/test/gtc/gtc_reciprocal.cpp delete mode 100644 3rdparty/glm/source/test/gtc/gtc_round.cpp delete mode 100644 3rdparty/glm/source/test/gtc/gtc_type_aligned.cpp delete mode 100644 3rdparty/glm/source/test/gtc/gtc_type_precision.cpp delete mode 100644 3rdparty/glm/source/test/gtc/gtc_type_ptr.cpp delete mode 100644 3rdparty/glm/source/test/gtc/gtc_ulp.cpp delete mode 100644 3rdparty/glm/source/test/gtc/gtc_user_defined_types.cpp delete mode 100644 3rdparty/glm/source/test/gtc/gtc_vec1.cpp delete mode 100644 3rdparty/glm/source/test/gtx/CMakeLists.txt delete mode 100644 3rdparty/glm/source/test/gtx/gtx.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_associated_min_max.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_closest_point.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_color_encoding.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_color_space.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_color_space_YCoCg.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_common.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_compatibility.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_component_wise.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_dual_quaternion.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_easing.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_euler_angle.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_extend.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_extended_min_max.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_extented_min_max.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_exterior_product.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_fast_exponential.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_fast_square_root.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_fast_trigonometry.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_functions.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_gradient_paint.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_handed_coordinate_space.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_int_10_10_10_2.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_integer.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_intersect.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_io.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_load.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_log_base.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_matrix_cross_product.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_matrix_decompose.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_matrix_factorisation.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_matrix_interpolation.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_matrix_major_storage.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_matrix_operation.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_matrix_query.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_matrix_transform_2d.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_mixed_product.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_norm.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_normal.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_normalize_dot.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_number_precision.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_optimum_pow.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_orthonormalize.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_pca.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_perpendicular.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_polar_coordinates.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_projection.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_quaternion.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_random.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_range.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_rotate_normalized_axis.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_rotate_vector.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_scalar_multiplication.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_scalar_relational.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_simd_mat4.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_simd_vec4.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_spline.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_string_cast.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_texture.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_type_aligned.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_type_trait.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_vec_swizzle.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_vector_angle.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_vector_query.cpp delete mode 100644 3rdparty/glm/source/test/gtx/gtx_wrap.cpp delete mode 100644 3rdparty/glm/source/test/perf/CMakeLists.txt delete mode 100644 3rdparty/glm/source/test/perf/perf_matrix_div.cpp delete mode 100644 3rdparty/glm/source/test/perf/perf_matrix_inverse.cpp delete mode 100644 3rdparty/glm/source/test/perf/perf_matrix_mul.cpp delete mode 100644 3rdparty/glm/source/test/perf/perf_matrix_mul_vector.cpp delete mode 100644 3rdparty/glm/source/test/perf/perf_matrix_transpose.cpp delete mode 100644 3rdparty/glm/source/test/perf/perf_vector_mul_matrix.cpp delete mode 100644 3rdparty/glm/source/util/autoexp.txt delete mode 100644 3rdparty/glm/source/util/autoexp.vc2010.dat delete mode 100644 3rdparty/glm/source/util/glm.natvis delete mode 100644 3rdparty/glm/source/util/usertype.dat (limited to '3rdparty') diff --git a/3rdparty/glfw/source/.appveyor.yml b/3rdparty/glfw/source/.appveyor.yml deleted file mode 100644 index 2742949..0000000 --- a/3rdparty/glfw/source/.appveyor.yml +++ /dev/null @@ -1,47 +0,0 @@ -image: - - Visual Studio 2015 -branches: - only: - - ci - - master - - latest - - 3.3-stable -skip_tags: true -environment: - matrix: - - GENERATOR: MinGW Makefiles - BUILD_SHARED_LIBS: ON - CFLAGS: -Werror - - GENERATOR: MinGW Makefiles - BUILD_SHARED_LIBS: OFF - CFLAGS: -Werror - - GENERATOR: Visual Studio 10 2010 - BUILD_SHARED_LIBS: ON - CFLAGS: /WX - - GENERATOR: Visual Studio 10 2010 - BUILD_SHARED_LIBS: OFF - CFLAGS: /WX -matrix: - fast_finish: true -for: -- - matrix: - only: - - GENERATOR: MinGW Makefiles - build_script: - - set PATH=%PATH:C:\Program Files\Git\usr\bin=C:\MinGW\bin% - - cmake -S . -B build -G "%GENERATOR%" -DBUILD_SHARED_LIBS=%BUILD_SHARED_LIBS% - - cmake --build build -- - matrix: - only: - - GENERATOR: Visual Studio 10 2010 - build_script: - - cmake -S . -B build -G "%GENERATOR%" -DBUILD_SHARED_LIBS=%BUILD_SHARED_LIBS% - - cmake --build build --target glfw -notifications: - - provider: Email - to: - - ci@glfw.org - on_build_failure: true - on_build_success: false diff --git a/3rdparty/glfw/source/.gitattributes b/3rdparty/glfw/source/.gitattributes deleted file mode 100644 index 805f403..0000000 --- a/3rdparty/glfw/source/.gitattributes +++ /dev/null @@ -1,5 +0,0 @@ -*.m linguist-language=Objective-C -.gitignore export-ignore -.gitattributes export-ignore -.travis.yml export-ignore -.appveyor.yml export-ignore diff --git a/3rdparty/glfw/source/.github/workflows/build.yml b/3rdparty/glfw/source/.github/workflows/build.yml deleted file mode 100644 index 7f79885..0000000 --- a/3rdparty/glfw/source/.github/workflows/build.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: Build -on: - pull_request: - push: - branches: [ ci, master, latest, 3.3-stable ] -permissions: - statuses: write - contents: read - -jobs: - build-linux-x11-clang: - name: X11 (Linux, Clang) - runs-on: ubuntu-latest - env: - CC: clang - CFLAGS: -Werror - steps: - - uses: actions/checkout@v2 - - name: Install dependencies - run: | - sudo apt update - sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev - - - name: Configure static library - run: cmake -S . -B build-static - - name: Build static library - run: cmake --build build-static --parallel - - - name: Configure shared library - run: cmake -S . -B build-shared -D BUILD_SHARED_LIBS=ON - - name: Build shared library - run: cmake --build build-shared --parallel - - build-linux-full-clang: - name: X11+Wayland (Linux, Clang) - runs-on: ubuntu-latest - env: - CC: clang - CFLAGS: -Werror - steps: - - uses: actions/checkout@v2 - - name: Install dependencies - run: | - sudo apt update - sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev wayland-protocols libwayland-dev libxkbcommon-dev - - - name: Configure static library - run: cmake -S . -B build-static -D GLFW_BUILD_WAYLAND=ON - - name: Build static library - run: cmake --build build-static --parallel - - - name: Configure shared library - run: cmake -S . -B build-shared -D GLFW_BUILD_WAYLAND=ON -D BUILD_SHARED_LIBS=ON - - name: Build shared library - run: cmake --build build-shared --parallel - - build-macos-cocoa-clang: - name: Cocoa (macOS, Clang) - runs-on: macos-latest - env: - CFLAGS: -Werror - MACOSX_DEPLOYMENT_TARGET: 10.8 - steps: - - uses: actions/checkout@v2 - - - name: Configure static library - run: cmake -S . -B build-static - - name: Build static library - run: cmake --build build-static --parallel - - - name: Configure shared library - run: cmake -S . -B build-shared -D BUILD_SHARED_LIBS=ON - - name: Build shared library - run: cmake --build build-shared --parallel - - build-windows-win32-vs2022: - name: Win32 (Windows, VS2022) - runs-on: windows-latest - env: - CFLAGS: /WX - steps: - - uses: actions/checkout@v2 - - - name: Configure static library - run: cmake -S . -B build-static -G "Visual Studio 17 2022" - - name: Build static library - run: cmake --build build-static --parallel - - - name: Configure shared library - run: cmake -S . -B build-shared -G "Visual Studio 17 2022" -D BUILD_SHARED_LIBS=ON - - name: Build shared library - run: cmake --build build-shared --parallel - diff --git a/3rdparty/glfw/source/.mailmap b/3rdparty/glfw/source/.mailmap deleted file mode 100644 index 96d8a9b..0000000 --- a/3rdparty/glfw/source/.mailmap +++ /dev/null @@ -1,10 +0,0 @@ -Camilla Löwy -Camilla Löwy -Camilla Löwy - -Emmanuel Gil Peyrot - -Marcus Geelnard -Marcus Geelnard -Marcus Geelnard - diff --git a/3rdparty/glfw/source/CONTRIBUTORS.md b/3rdparty/glfw/source/CONTRIBUTORS.md deleted file mode 100644 index cc77ff1..0000000 --- a/3rdparty/glfw/source/CONTRIBUTORS.md +++ /dev/null @@ -1,246 +0,0 @@ -# Acknowledgements - -GLFW exists because people around the world donated their time and lent their -skills. This list only includes contributions to the main repository and -excludes other invaluable contributions like language bindings and text and -video tutorials. - - - Bobyshev Alexander - - Laurent Aphecetche - - Matt Arsenault - - ashishgamedev - - David Avedissian - - Luca Bacci - - Keith Bauer - - John Bartholomew - - Coşku Baş - - Niklas Behrens - - Andrew Belt - - Nevyn Bengtsson - - Niklas Bergström - - Denis Bernard - - Doug Binks - - blanco - - Waris Boonyasiriwat - - Kyle Brenneman - - Rok Breulj - - Kai Burjack - - Martin Capitanio - - Nicolas Caramelli - - David Carlier - - Arturo Castro - - Chi-kwan Chan - - TheChocolateOre - - Joseph Chua - - Ian Clarkson - - Michał Cichoń - - Lambert Clara - - Anna Clarke - - Josh Codd - - Yaron Cohen-Tal - - Omar Cornut - - Andrew Corrigan - - Bailey Cosier - - Noel Cower - - CuriouserThing - - Jason Daly - - Jarrod Davis - - Olivier Delannoy - - Paul R. Deppe - - Michael Dickens - - Роман Донченко - - Mario Dorn - - Wolfgang Draxinger - - Jonathan Dummer - - Ralph Eastwood - - Fredrik Ehnbom - - Robin Eklind - - Jan Ekström - - Siavash Eliasi - - Ahmad Fatoum - - Felipe Ferreira - - Michael Fogleman - - Jason Francis - - Gerald Franz - - Mário Freitas - - GeO4d - - Marcus Geelnard - - ghuser404 - - Charles Giessen - - Ryan C. Gordon - - Stephen Gowen - - Kovid Goyal - - Kevin Grandemange - - Eloi Marín Gratacós - - Stefan Gustavson - - Andrew Gutekanst - - Stephen Gutekanst - - Jonathan Hale - - hdf89shfdfs - - Sylvain Hellegouarch - - Matthew Henry - - heromyth - - Lucas Hinderberger - - Paul Holden - - Warren Hu - - Charles Huber - - Brent Huisman - - illustris - - InKryption - - IntellectualKitty - - Aaron Jacobs - - JannikGM - - Erik S. V. Jansson - - jjYBdx4IL - - Toni Jovanoski - - Arseny Kapoulkine - - Cem Karan - - Osman Keskin - - Koray Kilinc - - Josh Kilmer - - Byunghoon Kim - - Cameron King - - Peter Knut - - Christoph Kubisch - - Yuri Kunde Schlesner - - Rokas Kupstys - - Konstantin Käfer - - Eric Larson - - Francis Lecavalier - - Jong Won Lee - - Robin Leffmann - - Glenn Lewis - - Shane Liesegang - - Anders Lindqvist - - Leon Linhart - - Marco Lizza - - Eyal Lotem - - Aaron Loucks - - Luflosi - - lukect - - Tristam MacDonald - - Hans Mackowiak - - Дмитри Малышев - - Zbigniew Mandziejewicz - - Adam Marcus - - Célestin Marot - - Kyle McDonald - - David V. McKay - - David Medlock - - Bryce Mehring - - Jonathan Mercier - - Marcel Metz - - Liam Middlebrook - - Ave Milia - - Jonathan Miller - - Kenneth Miller - - Bruce Mitchener - - Jack Moffitt - - Jeff Molofee - - Alexander Monakov - - Pierre Morel - - Jon Morton - - Pierre Moulon - - Martins Mozeiko - - Pascal Muetschard - - Julian Møller - - ndogxj - - n3rdopolis - - Kristian Nielsen - - Kamil Nowakowski - - onox - - Denis Ovod - - Ozzy - - Andri Pálsson - - luz paz - - Peoro - - Braden Pellett - - Christopher Pelloux - - Arturo J. Pérez - - Vladimir Perminov - - Anthony Pesch - - Orson Peters - - Emmanuel Gil Peyrot - - Cyril Pichard - - Keith Pitt - - Stanislav Podgorskiy - - Konstantin Podsvirov - - Nathan Poirier - - Alexandre Pretyman - - Pablo Prietz - - przemekmirek - - pthom - - Guillaume Racicot - - Philip Rideout - - Eddie Ringle - - Max Risuhin - - Jorge Rodriguez - - Jari Ronkainen - - Luca Rood - - Ed Ropple - - Aleksey Rybalkin - - Mikko Rytkönen - - Riku Salminen - - Brandon Schaefer - - Sebastian Schuberth - - Christian Sdunek - - Matt Sealey - - Steve Sexton - - Arkady Shapkin - - Ali Sherief - - Yoshiki Shibukawa - - Dmitri Shuralyov - - Joao da Silva - - Daniel Sieger - - Daniel Skorupski - - Slemmie - - Anthony Smith - - Bradley Smith - - Cliff Smolinsky - - Patrick Snape - - Erlend Sogge Heggen - - Olivier Sohn - - Julian Squires - - Johannes Stein - - Pontus Stenetorp - - Michael Stocker - - Justin Stoecker - - Elviss Strazdins - - Paul Sultana - - Nathan Sweet - - TTK-Bandit - - Jared Tiala - - Sergey Tikhomirov - - Arthur Tombs - - TronicLabs - - Ioannis Tsakpinis - - Samuli Tuomola - - Matthew Turner - - urraka - - Elias Vanderstuyft - - Stef Velzel - - Jari Vetoniemi - - Ricardo Vieira - - Nicholas Vitovitch - - Simon Voordouw - - Corentin Wallez - - Torsten Walluhn - - Patrick Walton - - Xo Wang - - Jay Weisskopf - - Frank Wille - - Andy Williams - - Joel Winarske - - Richard A. Wilkes - - Tatsuya Yatagawa - - Ryogo Yoshimura - - Lukas Zanner - - Andrey Zholos - - Aihui Zhu - - Santi Zupancic - - Jonas Ådahl - - Lasse Öörni - - Leonard König - - All the unmentioned and anonymous contributors in the GLFW community, for bug - reports, patches, feedback, testing and encouragement - diff --git a/3rdparty/glfw/source/LICENSE.md b/3rdparty/glfw/source/LICENSE.md deleted file mode 100644 index 7494a3f..0000000 --- a/3rdparty/glfw/source/LICENSE.md +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) 2002-2006 Marcus Geelnard - -Copyright (c) 2006-2019 Camilla Löwy - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would - be appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and must not - be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source - distribution. - diff --git a/3rdparty/glfw/source/README.md b/3rdparty/glfw/source/README.md deleted file mode 100644 index 13e3e08..0000000 --- a/3rdparty/glfw/source/README.md +++ /dev/null @@ -1,345 +0,0 @@ -# GLFW - -[![Build status](https://github.com/glfw/glfw/actions/workflows/build.yml/badge.svg)](https://github.com/glfw/glfw/actions) -[![Build status](https://ci.appveyor.com/api/projects/status/0kf0ct9831i5l6sp/branch/master?svg=true)](https://ci.appveyor.com/project/elmindreda/glfw) -[![Coverity Scan](https://scan.coverity.com/projects/4884/badge.svg)](https://scan.coverity.com/projects/glfw-glfw) - -## Introduction - -GLFW is an Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan -application development. It provides a simple, platform-independent API for -creating windows, contexts and surfaces, reading input, handling events, etc. - -GLFW natively supports Windows, macOS and Linux and other Unix-like systems. On -Linux both X11 and Wayland are supported. - -GLFW is licensed under the [zlib/libpng -license](https://www.glfw.org/license.html). - -You can [download](https://www.glfw.org/download.html) the latest stable release -as source or Windows binaries, or fetch the `latest` branch from GitHub. Each -release starting with 3.0 also has a corresponding [annotated -tag](https://github.com/glfw/glfw/releases) with source and binary archives. - -The [documentation](https://www.glfw.org/docs/latest/) is available online and is -included in all source and binary archives. See the [release -notes](https://www.glfw.org/docs/latest/news.html) for new features, caveats and -deprecations in the latest release. For more details see the [version -history](https://www.glfw.org/changelog.html). - -The `master` branch is the stable integration branch and _should_ always compile -and run on all supported platforms, although details of newly added features may -change until they have been included in a release. New features and many bug -fixes live in [other branches](https://github.com/glfw/glfw/branches/all) until -they are stable enough to merge. - -If you are new to GLFW, you may find the -[tutorial](https://www.glfw.org/docs/latest/quick.html) for GLFW 3 useful. If -you have used GLFW 2 in the past, there is a [transition -guide](https://www.glfw.org/docs/latest/moving.html) for moving to the GLFW -3 API. - -GLFW exists because of the contributions of [many people](CONTRIBUTORS.md) -around the world, whether by reporting bugs, providing community support, adding -features, reviewing or testing code, debugging, proofreading docs, suggesting -features or fixing bugs. - - -## Compiling GLFW - -GLFW itself requires only the headers and libraries for your OS and window -system. It does not need the headers for any context creation API (WGL, GLX, -EGL, NSGL, OSMesa) or rendering API (OpenGL, OpenGL ES, Vulkan) to enable -support for them. - -GLFW supports compilation on Windows with Visual C++ 2010 and later, MinGW and -MinGW-w64, on macOS with Clang and on Linux and other Unix-like systems with GCC -and Clang. It will likely compile in other environments as well, but this is -not regularly tested. - -There are [pre-compiled Windows binaries](https://www.glfw.org/download.html) -available for all supported compilers. - -See the [compilation guide](https://www.glfw.org/docs/latest/compile.html) for -more information about how to compile GLFW yourself. - - -## Using GLFW - -See the [documentation](https://www.glfw.org/docs/latest/) for tutorials, guides -and the API reference. - - -## Contributing to GLFW - -See the [contribution -guide](https://github.com/glfw/glfw/blob/master/docs/CONTRIBUTING.md) for -more information. - - -## System requirements - -GLFW supports Windows XP and later and macOS 10.8 and later. Linux and other -Unix-like systems running the X Window System are supported even without -a desktop environment or modern extensions, although some features require -a running window or clipboard manager. The OSMesa backend requires Mesa 6.3. - -See the [compatibility guide](https://www.glfw.org/docs/latest/compat.html) -in the documentation for more information. - - -## Dependencies - -GLFW itself needs only CMake 3.1 or later and the headers and libraries for your -OS and window system. - -The examples and test programs depend on a number of tiny libraries. These are -located in the `deps/` directory. - - - [getopt\_port](https://github.com/kimgr/getopt_port/) for examples - with command-line options - - [TinyCThread](https://github.com/tinycthread/tinycthread) for threaded - examples - - [glad2](https://github.com/Dav1dde/glad) for loading OpenGL and Vulkan - functions - - [linmath.h](https://github.com/datenwolf/linmath.h) for linear algebra in - examples - - [Nuklear](https://github.com/Immediate-Mode-UI/Nuklear) for test and example UI - - [stb\_image\_write](https://github.com/nothings/stb) for writing images to disk - -The documentation is generated with [Doxygen](https://doxygen.org/) if CMake can -find that tool. - - -## Reporting bugs - -Bugs are reported to our [issue tracker](https://github.com/glfw/glfw/issues). -Please check the [contribution -guide](https://github.com/glfw/glfw/blob/master/docs/CONTRIBUTING.md) for -information on what to include when reporting a bug. - - -## Changelog - - - Added `GLFW_PLATFORM` init hint for runtime platform selection (#1958) - - Added `GLFW_ANY_PLATFORM`, `GLFW_PLATFORM_WIN32`, `GLFW_PLATFORM_COCOA`, - `GLFW_PLATFORM_WAYLAND`, `GLFW_PLATFORM_X11` and `GLFW_PLATFORM_NULL` symbols to - specify the desired platform (#1958) - - Added `glfwGetPlatform` function to query what platform was selected (#1655,#1958) - - Added `glfwPlatformSupported` function to query if a platform is supported - (#1655,#1958) - - Added `glfwInitAllocator` for setting a custom memory allocator (#544,#1628,#1947) - - Added `GLFWallocator` struct and `GLFWallocatefun`, `GLFWreallocatefun` and - `GLFWdeallocatefun` types (#544,#1628,#1947) - - Added `glfwInitVulkanLoader` for using a non-default Vulkan loader (#1374,#1890) - - Added `GLFW_RESIZE_NWSE_CURSOR`, `GLFW_RESIZE_NESW_CURSOR`, - `GLFW_RESIZE_ALL_CURSOR` and `GLFW_NOT_ALLOWED_CURSOR` cursor shapes (#427) - - Added `GLFW_RESIZE_EW_CURSOR` alias for `GLFW_HRESIZE_CURSOR` (#427) - - Added `GLFW_RESIZE_NS_CURSOR` alias for `GLFW_VRESIZE_CURSOR` (#427) - - Added `GLFW_POINTING_HAND_CURSOR` alias for `GLFW_HAND_CURSOR` (#427) - - Added `GLFW_MOUSE_PASSTHROUGH` window hint for letting mouse input pass - through the window (#1236,#1568) - - Added `GLFW_PLATFORM_UNAVAILABLE` error for platform detection failures (#1958) - - Added `GLFW_FEATURE_UNAVAILABLE` error for platform limitations (#1692) - - Added `GLFW_FEATURE_UNIMPLEMENTED` error for incomplete backends (#1692) - - Added `GLFW_ANGLE_PLATFORM_TYPE` init hint and `GLFW_ANGLE_PLATFORM_TYPE_*` - values to select ANGLE backend (#1380) - - Added `GLFW_X11_XCB_VULKAN_SURFACE` init hint for selecting X11 Vulkan - surface extension (#1793) - - Added `GLFW_BUILD_WIN32` CMake option for enabling Win32 support (#1958) - - Added `GLFW_BUILD_COCOA` CMake option for enabling Cocoa support (#1958) - - Added `GLFW_BUILD_X11` CMake option for enabling X11 support (#1958) - - Added `GLFW_LIBRARY_TYPE` CMake variable for overriding the library type - (#279,#1307,#1497,#1574,#1928) - - Added `GLFW_PKG_CONFIG_REQUIRES_PRIVATE` and `GLFW_PKG_CONFIG_LIBS_PRIVATE` CMake - variables exposing pkg-config dependencies (#1307) - - Made joystick subsystem initialize at first use (#1284,#1646) - - Made `GLFW_DOUBLEBUFFER` a read-only window attribute - - Updated the minimum required CMake version to 3.1 - - Updated gamepad mappings from upstream - - Disabled tests and examples by default when built as a CMake subdirectory - - Renamed `GLFW_USE_WAYLAND` CMake option to `GLFW_BUILD_WAYLAND` (#1958) - - Removed `GLFW_USE_OSMESA` CMake option enabling the Null platform (#1958) - - Removed CMake generated configuration header - - Bugfix: The CMake config-file package used an absolute path and was not - relocatable (#1470) - - Bugfix: Video modes with a duplicate screen area were discarded (#1555,#1556) - - Bugfix: Compiling with -Wextra-semi caused warnings (#1440) - - Bugfix: Built-in mappings failed because some OEMs re-used VID/PID (#1583) - - Bugfix: Some extension loader headers did not prevent default OpenGL header - inclusion (#1695) - - Bugfix: Buffers were swapped at creation on single-buffered windows (#1873) - - Bugfix: Gamepad mapping updates could spam `GLFW_INVALID_VALUE` due to - incompatible controllers sharing hardware ID (#1763) - - Bugfix: Native access functions for context handles did not check that the API matched - - [Win32] Added the `GLFW_WIN32_KEYBOARD_MENU` window hint for enabling access - to the window menu - - [Win32] Added a version info resource to the GLFW DLL - - [Win32] Disabled framebuffer transparency on Windows 7 when DWM windows are - opaque (#1512) - - [Win32] Bugfix: `GLFW_INCLUDE_VULKAN` plus `VK_USE_PLATFORM_WIN32_KHR` caused - symbol redefinition (#1524) - - [Win32] Bugfix: The cursor position event was emitted before its cursor enter - event (#1490) - - [Win32] Bugfix: The window hint `GLFW_MAXIMIZED` did not move or resize the - window (#1499) - - [Win32] Bugfix: Disabled cursor mode interfered with some non-client actions - - [Win32] Bugfix: Super key was not released after Win+V hotkey (#1622) - - [Win32] Bugfix: `glfwGetKeyName` could access out of bounds and return an - invalid pointer - - [Win32] Bugfix: Some synthetic key events were reported as `GLFW_KEY_UNKNOWN` - (#1623) - - [Win32] Bugfix: Non-BMP Unicode codepoint input was reported as UTF-16 - - [Win32] Bugfix: Monitor functions could return invalid values after - configuration change (#1761) - - [Win32] Bugfix: Initialization would segfault on Windows 8 (not 8.1) (#1775) - - [Win32] Bugfix: Duplicate size events were not filtered (#1610) - - [Win32] Bugfix: Full screen windows were incorrectly resized by DPI changes - (#1582) - - [Win32] Bugfix: `GLFW_SCALE_TO_MONITOR` had no effect on systems older than - Windows 10 version 1703 (#1511) - - [Win32] Bugfix: `USE_MSVC_RUNTIME_LIBRARY_DLL` had no effect on CMake 3.15 or - later (#1783,#1796) - - [Win32] Bugfix: Compilation with LLVM for Windows failed (#1807,#1824,#1874) - - [Win32] Bugfix: The foreground lock timeout was overridden, ignoring the user - - [Win32] Bugfix: Content scale queries could fail silently (#1615) - - [Win32] Bugfix: Content scales could have garbage values if monitor was recently - disconnected (#1615) - - [Win32] Bugfix: A window created maximized and undecorated would cover the whole - monitor (#1806) - - [Win32] Bugfix: The default restored window position was lost when creating a maximized - window - - [Win32] Bugfix: `glfwMaximizeWindow` would make a hidden window visible - - [Win32] Bugfix: `Alt+PrtSc` would emit `GLFW_KEY_UNKNOWN` and a different - scancode than `PrtSc` (#1993) - - [Win32] Bugfix: `GLFW_KEY_PAUSE` scancode from `glfwGetKeyScancode` did not - match event scancode (#1993) - - [Win32] Bugfix: Instance-local operations used executable instance (#469,#1296,#1395) - - [Cocoa] Added support for `VK_EXT_metal_surface` (#1619) - - [Cocoa] Added locating the Vulkan loader at runtime in an application bundle - - [Cocoa] Moved main menu creation to GLFW initialization time (#1649) - - [Cocoa] Changed `EGLNativeWindowType` from `NSView` to `CALayer` (#1169) - - [Cocoa] Changed F13 key to report Print Screen for cross-platform consistency - (#1786) - - [Cocoa] Removed dependency on the CoreVideo framework - - [Cocoa] Bugfix: `glfwSetWindowSize` used a bottom-left anchor point (#1553) - - [Cocoa] Bugfix: Window remained on screen after destruction until event poll - (#1412) - - [Cocoa] Bugfix: Event processing before window creation would assert (#1543) - - [Cocoa] Bugfix: Undecorated windows could not be iconified on recent macOS - - [Cocoa] Bugfix: Touching event queue from secondary thread before main thread - would abort (#1649) - - [Cocoa] Bugfix: Non-BMP Unicode codepoint input was reported as UTF-16 - (#1635) - - [Cocoa] Bugfix: Failing to retrieve the refresh rate of built-in displays - could leak memory - - [Cocoa] Bugfix: Objective-C files were compiled as C with CMake 3.19 (#1787) - - [Cocoa] Bugfix: Duplicate video modes were not filtered out (#1830) - - [Cocoa] Bugfix: Menu bar was not clickable on macOS 10.15+ until it lost and - regained focus (#1648,#1802) - - [Cocoa] Bugfix: Monitor name query could segfault on macOS 11 (#1809,#1833) - - [Cocoa] Bugfix: The install name of the installed dylib was relative (#1504) - - [Cocoa] Bugfix: The MoltenVK layer contents scale was updated only after - related events were emitted - - [Cocoa] Bugfix: Moving the cursor programmatically would freeze it for - a fraction of a second (#1962) - - [Cocoa] Bugfix: `kIOMasterPortDefault` was deprecated in macOS 12.0 (#1980) - - [Cocoa] Bugfix: `kUTTypeURL` was deprecated in macOS 12.0 (#2003) - - [Cocoa] Bugfix: A connected Apple AirPlay would emit a useless error (#1791) - - [X11] Bugfix: The CMake files did not check for the XInput headers (#1480) - - [X11] Bugfix: Key names were not updated when the keyboard layout changed - (#1462,#1528) - - [X11] Bugfix: Decorations could not be enabled after window creation (#1566) - - [X11] Bugfix: Content scale fallback value could be inconsistent (#1578) - - [X11] Bugfix: `glfwMaximizeWindow` had no effect on hidden windows - - [X11] Bugfix: Clearing `GLFW_FLOATING` on a hidden window caused invalid read - - [X11] Bugfix: Changing `GLFW_FLOATING` on a hidden window could silently fail - - [X11] Bugfix: Disabled cursor mode was interrupted by indicator windows - - [X11] Bugfix: Monitor physical dimensions could be reported as zero mm - - [X11] Bugfix: Window position events were not emitted during resizing (#1613) - - [X11] Bugfix: `glfwFocusWindow` could terminate on older WMs or without a WM - - [X11] Bugfix: Querying a disconnected monitor could segfault (#1602) - - [X11] Bugfix: IME input of CJK was broken for "C" locale (#1587,#1636) - - [X11] Bugfix: Termination would segfault if the IM had been destroyed - - [X11] Bugfix: Any IM started after initialization would not be detected - - [X11] Bugfix: Xlib errors caused by other parts of the application could be - reported as GLFW errors - - [X11] Bugfix: A handle race condition could cause a `BadWindow` error (#1633) - - [X11] Bugfix: XKB path used keysyms instead of physical locations for - non-printable keys (#1598) - - [X11] Bugfix: Function keys were mapped to `GLFW_KEY_UNKNOWN` for some layout - combinations (#1598) - - [X11] Bugfix: Keys pressed simultaneously with others were not always - reported (#1112,#1415,#1472,#1616) - - [X11] Bugfix: Some window attributes were not applied on leaving fullscreen - (#1863) - - [X11] Bugfix: Changing `GLFW_FLOATING` could leak memory - - [X11] Bugfix: Icon pixel format conversion worked only by accident, relying on - undefined behavior (#1986) - - [X11] Bugfix: Dynamic loading on OpenBSD failed due to soname differences - - [X11] Bugfix: Waiting for events would fail if file descriptor was too large - (#2024) - - [X11] Bugfix: Joystick events could lead to busy-waiting (#1872) - - [X11] Bugfix: `glfwWaitEvents*` did not continue for joystick events - - [X11] Bugfix: `glfwPostEmptyEvent` could be ignored due to race condition - (#379,#1281,#1285,#2033) - - [X11] Bugfix: Dynamic loading on NetBSD failed due to soname differences - - [X11] Bugfix: Left shift of int constant relied on undefined behavior (#1951) - - [Wayland] Added dynamic loading of all Wayland libraries - - [Wayland] Added support for key names via xkbcommon - - [Wayland] Removed support for `wl_shell` (#1443) - - [Wayland] Bugfix: The `GLFW_HAND_CURSOR` shape used the wrong image (#1432) - - [Wayland] Bugfix: `CLOCK_MONOTONIC` was not correctly enabled - - [Wayland] Bugfix: Repeated keys could be reported with `NULL` window (#1704) - - [Wayland] Bugfix: Retrieving partial framebuffer size would segfault - - [Wayland] Bugfix: Scrolling offsets were inverted compared to other platforms - (#1463) - - [Wayland] Bugfix: Client-Side Decorations were destroyed in the wrong order - (#1798) - - [Wayland] Bugfix: Monitors physical size could report zero (#1784,#1792) - - [Wayland] Bugfix: Some keys were not repeating in Wayland (#1908) - - [Wayland] Bugfix: Non-arrow cursors are offset from the hotspot (#1706,#1899) - - [Wayland] Bugfix: The `O_CLOEXEC` flag was not defined on FreeBSD - - [Wayland] Bugfix: Key repeat could lead to a race condition (#1710) - - [Wayland] Bugfix: Activating a window would emit two input focus events - - [Wayland] Bugfix: Disable key repeat mechanism when window loses input focus - - [Wayland] Bugfix: Window hiding and showing did not work (#1492,#1731) - - [Wayland] Bugfix: A key being repeated was not released when window lost focus - - [Wayland] Bugfix: Showing a hidden window did not emit a window refresh event - - [Wayland] Bugfix: Full screen window creation did not ignore `GLFW_VISIBLE` - - [Wayland] Bugfix: Some keys were reported as wrong key or `GLFW_KEY_UNKNOWN` - - [Wayland] Bugfix: Text input did not repeat along with key repeat - - [Wayland] Bugfix: `glfwPostEmptyEvent` sometimes had no effect (#1520,#1521) - - [POSIX] Removed use of deprecated function `gettimeofday` - - [POSIX] Bugfix: `CLOCK_MONOTONIC` was not correctly tested for or enabled - - [WGL] Disabled the DWM swap interval hack for Windows 8 and later (#1072) - - [NSGL] Removed enforcement of forward-compatible flag for core contexts - - [NSGL] Bugfix: `GLFW_COCOA_RETINA_FRAMEBUFFER` had no effect on newer - macOS versions (#1442) - - [NSGL] Bugfix: Workaround for swap interval on 10.14 broke on 10.12 (#1483) - - [NSGL] Bugfix: Defining `GL_SILENCE_DEPRECATION` externally caused - a duplicate definition warning (#1840) - - [EGL] Added platform selection via the `EGL_EXT_platform_base` extension - (#442) - - [EGL] Added ANGLE backend selection via `EGL_ANGLE_platform_angle` extension - (#1380) - - [EGL] Bugfix: The `GLFW_DOUBLEBUFFER` context attribute was ignored (#1843) - - [GLX] Bugfix: Context creation failed if GLX 1.4 was not exported by GLX library - - -## Contact - -On [glfw.org](https://www.glfw.org/) you can find the latest version of GLFW, as -well as news, documentation and other information about the project. - -If you have questions related to the use of GLFW, we have a -[forum](https://discourse.glfw.org/), and the `#glfw` IRC channel on -[Libera.Chat](https://libera.chat/). - -If you have a bug to report, a patch to submit or a feature you'd like to -request, please file it in the -[issue tracker](https://github.com/glfw/glfw/issues) on GitHub. - -Finally, if you're interested in helping out with the development of GLFW or -porting it to your favorite platform, join us on the forum, GitHub or IRC. - diff --git a/3rdparty/glfw/source/deps/getopt.c b/3rdparty/glfw/source/deps/getopt.c deleted file mode 100644 index 9743046..0000000 --- a/3rdparty/glfw/source/deps/getopt.c +++ /dev/null @@ -1,230 +0,0 @@ -/* Copyright (c) 2012, Kim Gräsman - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * * Neither the name of Kim Gräsman nor the names of contributors may be used - * to endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL KIM GRÄSMAN BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "getopt.h" - -#include -#include - -const int no_argument = 0; -const int required_argument = 1; -const int optional_argument = 2; - -char* optarg; -int optopt; -/* The variable optind [...] shall be initialized to 1 by the system. */ -int optind = 1; -int opterr; - -static char* optcursor = NULL; - -/* Implemented based on [1] and [2] for optional arguments. - optopt is handled FreeBSD-style, per [3]. - Other GNU and FreeBSD extensions are purely accidental. - -[1] http://pubs.opengroup.org/onlinepubs/000095399/functions/getopt.html -[2] http://www.kernel.org/doc/man-pages/online/pages/man3/getopt.3.html -[3] http://www.freebsd.org/cgi/man.cgi?query=getopt&sektion=3&manpath=FreeBSD+9.0-RELEASE -*/ -int getopt(int argc, char* const argv[], const char* optstring) { - int optchar = -1; - const char* optdecl = NULL; - - optarg = NULL; - opterr = 0; - optopt = 0; - - /* Unspecified, but we need it to avoid overrunning the argv bounds. */ - if (optind >= argc) - goto no_more_optchars; - - /* If, when getopt() is called argv[optind] is a null pointer, getopt() - shall return -1 without changing optind. */ - if (argv[optind] == NULL) - goto no_more_optchars; - - /* If, when getopt() is called *argv[optind] is not the character '-', - getopt() shall return -1 without changing optind. */ - if (*argv[optind] != '-') - goto no_more_optchars; - - /* If, when getopt() is called argv[optind] points to the string "-", - getopt() shall return -1 without changing optind. */ - if (strcmp(argv[optind], "-") == 0) - goto no_more_optchars; - - /* If, when getopt() is called argv[optind] points to the string "--", - getopt() shall return -1 after incrementing optind. */ - if (strcmp(argv[optind], "--") == 0) { - ++optind; - goto no_more_optchars; - } - - if (optcursor == NULL || *optcursor == '\0') - optcursor = argv[optind] + 1; - - optchar = *optcursor; - - /* FreeBSD: The variable optopt saves the last known option character - returned by getopt(). */ - optopt = optchar; - - /* The getopt() function shall return the next option character (if one is - found) from argv that matches a character in optstring, if there is - one that matches. */ - optdecl = strchr(optstring, optchar); - if (optdecl) { - /* [I]f a character is followed by a colon, the option takes an - argument. */ - if (optdecl[1] == ':') { - optarg = ++optcursor; - if (*optarg == '\0') { - /* GNU extension: Two colons mean an option takes an - optional arg; if there is text in the current argv-element - (i.e., in the same word as the option name itself, for example, - "-oarg"), then it is returned in optarg, otherwise optarg is set - to zero. */ - if (optdecl[2] != ':') { - /* If the option was the last character in the string pointed to by - an element of argv, then optarg shall contain the next element - of argv, and optind shall be incremented by 2. If the resulting - value of optind is greater than argc, this indicates a missing - option-argument, and getopt() shall return an error indication. - - Otherwise, optarg shall point to the string following the - option character in that element of argv, and optind shall be - incremented by 1. - */ - if (++optind < argc) { - optarg = argv[optind]; - } else { - /* If it detects a missing option-argument, it shall return the - colon character ( ':' ) if the first character of optstring - was a colon, or a question-mark character ( '?' ) otherwise. - */ - optarg = NULL; - optchar = (optstring[0] == ':') ? ':' : '?'; - } - } else { - optarg = NULL; - } - } - - optcursor = NULL; - } - } else { - /* If getopt() encounters an option character that is not contained in - optstring, it shall return the question-mark ( '?' ) character. */ - optchar = '?'; - } - - if (optcursor == NULL || *++optcursor == '\0') - ++optind; - - return optchar; - -no_more_optchars: - optcursor = NULL; - return -1; -} - -/* Implementation based on [1]. - -[1] http://www.kernel.org/doc/man-pages/online/pages/man3/getopt.3.html -*/ -int getopt_long(int argc, char* const argv[], const char* optstring, - const struct option* longopts, int* longindex) { - const struct option* o = longopts; - const struct option* match = NULL; - int num_matches = 0; - size_t argument_name_length = 0; - const char* current_argument = NULL; - int retval = -1; - - optarg = NULL; - optopt = 0; - - if (optind >= argc) - return -1; - - if (strlen(argv[optind]) < 3 || strncmp(argv[optind], "--", 2) != 0) - return getopt(argc, argv, optstring); - - /* It's an option; starts with -- and is longer than two chars. */ - current_argument = argv[optind] + 2; - argument_name_length = strcspn(current_argument, "="); - for (; o->name; ++o) { - if (strncmp(o->name, current_argument, argument_name_length) == 0) { - match = o; - ++num_matches; - } - } - - if (num_matches == 1) { - /* If longindex is not NULL, it points to a variable which is set to the - index of the long option relative to longopts. */ - if (longindex) - *longindex = (int) (match - longopts); - - /* If flag is NULL, then getopt_long() shall return val. - Otherwise, getopt_long() returns 0, and flag shall point to a variable - which shall be set to val if the option is found, but left unchanged if - the option is not found. */ - if (match->flag) - *(match->flag) = match->val; - - retval = match->flag ? 0 : match->val; - - if (match->has_arg != no_argument) { - optarg = strchr(argv[optind], '='); - if (optarg != NULL) - ++optarg; - - if (match->has_arg == required_argument) { - /* Only scan the next argv for required arguments. Behavior is not - specified, but has been observed with Ubuntu and Mac OSX. */ - if (optarg == NULL && ++optind < argc) { - optarg = argv[optind]; - } - - if (optarg == NULL) - retval = ':'; - } - } else if (strchr(argv[optind], '=')) { - /* An argument was provided to a non-argument option. - I haven't seen this specified explicitly, but both GNU and BSD-based - implementations show this behavior. - */ - retval = '?'; - } - } else { - /* Unknown option or ambiguous match. */ - retval = '?'; - } - - ++optind; - return retval; -} diff --git a/3rdparty/glfw/source/deps/getopt.h b/3rdparty/glfw/source/deps/getopt.h deleted file mode 100644 index e1eb540..0000000 --- a/3rdparty/glfw/source/deps/getopt.h +++ /dev/null @@ -1,57 +0,0 @@ -/* Copyright (c) 2012, Kim Gräsman - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * * Neither the name of Kim Gräsman nor the names of contributors may be used - * to endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL KIM GRÄSMAN BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef INCLUDED_GETOPT_PORT_H -#define INCLUDED_GETOPT_PORT_H - -#if defined(__cplusplus) -extern "C" { -#endif - -extern const int no_argument; -extern const int required_argument; -extern const int optional_argument; - -extern char* optarg; -extern int optind, opterr, optopt; - -struct option { - const char* name; - int has_arg; - int* flag; - int val; -}; - -int getopt(int argc, char* const argv[], const char* optstring); - -int getopt_long(int argc, char* const argv[], - const char* optstring, const struct option* longopts, int* longindex); - -#if defined(__cplusplus) -} -#endif - -#endif // INCLUDED_GETOPT_PORT_H diff --git a/3rdparty/glfw/source/deps/glad/gl.h b/3rdparty/glfw/source/deps/glad/gl.h deleted file mode 100644 index b421fe0..0000000 --- a/3rdparty/glfw/source/deps/glad/gl.h +++ /dev/null @@ -1,5996 +0,0 @@ -/** - * Loader generated by glad 2.0.0-beta on Tue Aug 24 22:51:07 2021 - * - * Generator: C/C++ - * Specification: gl - * Extensions: 3 - * - * APIs: - * - gl:compatibility=3.3 - * - * Options: - * - ALIAS = False - * - DEBUG = False - * - HEADER_ONLY = True - * - LOADER = False - * - MX = False - * - MX_GLOBAL = False - * - ON_DEMAND = False - * - * Commandline: - * --api='gl:compatibility=3.3' --extensions='GL_ARB_multisample,GL_ARB_robustness,GL_KHR_debug' c --header-only - * - * Online: - * http://glad.sh/#api=gl%3Acompatibility%3D3.3&extensions=GL_ARB_multisample%2CGL_ARB_robustness%2CGL_KHR_debug&generator=c&options=HEADER_ONLY - * - */ - -#ifndef GLAD_GL_H_ -#define GLAD_GL_H_ - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wreserved-id-macro" -#endif -#ifdef __gl_h_ - #error OpenGL (gl.h) header already included (API: gl), remove previous include! -#endif -#define __gl_h_ 1 -#ifdef __gl3_h_ - #error OpenGL (gl3.h) header already included (API: gl), remove previous include! -#endif -#define __gl3_h_ 1 -#ifdef __glext_h_ - #error OpenGL (glext.h) header already included (API: gl), remove previous include! -#endif -#define __glext_h_ 1 -#ifdef __gl3ext_h_ - #error OpenGL (gl3ext.h) header already included (API: gl), remove previous include! -#endif -#define __gl3ext_h_ 1 -#ifdef __clang__ -#pragma clang diagnostic pop -#endif - -#define GLAD_GL -#define GLAD_OPTION_GL_HEADER_ONLY - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef GLAD_PLATFORM_H_ -#define GLAD_PLATFORM_H_ - -#ifndef GLAD_PLATFORM_WIN32 - #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__MINGW32__) - #define GLAD_PLATFORM_WIN32 1 - #else - #define GLAD_PLATFORM_WIN32 0 - #endif -#endif - -#ifndef GLAD_PLATFORM_APPLE - #ifdef __APPLE__ - #define GLAD_PLATFORM_APPLE 1 - #else - #define GLAD_PLATFORM_APPLE 0 - #endif -#endif - -#ifndef GLAD_PLATFORM_EMSCRIPTEN - #ifdef __EMSCRIPTEN__ - #define GLAD_PLATFORM_EMSCRIPTEN 1 - #else - #define GLAD_PLATFORM_EMSCRIPTEN 0 - #endif -#endif - -#ifndef GLAD_PLATFORM_UWP - #if defined(_MSC_VER) && !defined(GLAD_INTERNAL_HAVE_WINAPIFAMILY) - #ifdef __has_include - #if __has_include() - #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1 - #endif - #elif _MSC_VER >= 1700 && !_USING_V110_SDK71_ - #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1 - #endif - #endif - - #ifdef GLAD_INTERNAL_HAVE_WINAPIFAMILY - #include - #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) - #define GLAD_PLATFORM_UWP 1 - #endif - #endif - - #ifndef GLAD_PLATFORM_UWP - #define GLAD_PLATFORM_UWP 0 - #endif -#endif - -#ifdef __GNUC__ - #define GLAD_GNUC_EXTENSION __extension__ -#else - #define GLAD_GNUC_EXTENSION -#endif - -#ifndef GLAD_API_CALL - #if defined(GLAD_API_CALL_EXPORT) - #if GLAD_PLATFORM_WIN32 || defined(__CYGWIN__) - #if defined(GLAD_API_CALL_EXPORT_BUILD) - #if defined(__GNUC__) - #define GLAD_API_CALL __attribute__ ((dllexport)) extern - #else - #define GLAD_API_CALL __declspec(dllexport) extern - #endif - #else - #if defined(__GNUC__) - #define GLAD_API_CALL __attribute__ ((dllimport)) extern - #else - #define GLAD_API_CALL __declspec(dllimport) extern - #endif - #endif - #elif defined(__GNUC__) && defined(GLAD_API_CALL_EXPORT_BUILD) - #define GLAD_API_CALL __attribute__ ((visibility ("default"))) extern - #else - #define GLAD_API_CALL extern - #endif - #else - #define GLAD_API_CALL extern - #endif -#endif - -#ifdef APIENTRY - #define GLAD_API_PTR APIENTRY -#elif GLAD_PLATFORM_WIN32 - #define GLAD_API_PTR __stdcall -#else - #define GLAD_API_PTR -#endif - -#ifndef GLAPI -#define GLAPI GLAD_API_CALL -#endif - -#ifndef GLAPIENTRY -#define GLAPIENTRY GLAD_API_PTR -#endif - -#define GLAD_MAKE_VERSION(major, minor) (major * 10000 + minor) -#define GLAD_VERSION_MAJOR(version) (version / 10000) -#define GLAD_VERSION_MINOR(version) (version % 10000) - -#define GLAD_GENERATOR_VERSION "2.0.0-beta" - -typedef void (*GLADapiproc)(void); - -typedef GLADapiproc (*GLADloadfunc)(const char *name); -typedef GLADapiproc (*GLADuserptrloadfunc)(void *userptr, const char *name); - -typedef void (*GLADprecallback)(const char *name, GLADapiproc apiproc, int len_args, ...); -typedef void (*GLADpostcallback)(void *ret, const char *name, GLADapiproc apiproc, int len_args, ...); - -#endif /* GLAD_PLATFORM_H_ */ - -#define GL_2D 0x0600 -#define GL_2_BYTES 0x1407 -#define GL_3D 0x0601 -#define GL_3D_COLOR 0x0602 -#define GL_3D_COLOR_TEXTURE 0x0603 -#define GL_3_BYTES 0x1408 -#define GL_4D_COLOR_TEXTURE 0x0604 -#define GL_4_BYTES 0x1409 -#define GL_ACCUM 0x0100 -#define GL_ACCUM_ALPHA_BITS 0x0D5B -#define GL_ACCUM_BLUE_BITS 0x0D5A -#define GL_ACCUM_BUFFER_BIT 0x00000200 -#define GL_ACCUM_CLEAR_VALUE 0x0B80 -#define GL_ACCUM_GREEN_BITS 0x0D59 -#define GL_ACCUM_RED_BITS 0x0D58 -#define GL_ACTIVE_ATTRIBUTES 0x8B89 -#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A -#define GL_ACTIVE_TEXTURE 0x84E0 -#define GL_ACTIVE_UNIFORMS 0x8B86 -#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 -#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 -#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 -#define GL_ADD 0x0104 -#define GL_ADD_SIGNED 0x8574 -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E -#define GL_ALIASED_POINT_SIZE_RANGE 0x846D -#define GL_ALL_ATTRIB_BITS 0xFFFFFFFF -#define GL_ALPHA 0x1906 -#define GL_ALPHA12 0x803D -#define GL_ALPHA16 0x803E -#define GL_ALPHA4 0x803B -#define GL_ALPHA8 0x803C -#define GL_ALPHA_BIAS 0x0D1D -#define GL_ALPHA_BITS 0x0D55 -#define GL_ALPHA_INTEGER 0x8D97 -#define GL_ALPHA_SCALE 0x0D1C -#define GL_ALPHA_TEST 0x0BC0 -#define GL_ALPHA_TEST_FUNC 0x0BC1 -#define GL_ALPHA_TEST_REF 0x0BC2 -#define GL_ALREADY_SIGNALED 0x911A -#define GL_ALWAYS 0x0207 -#define GL_AMBIENT 0x1200 -#define GL_AMBIENT_AND_DIFFUSE 0x1602 -#define GL_AND 0x1501 -#define GL_AND_INVERTED 0x1504 -#define GL_AND_REVERSE 0x1502 -#define GL_ANY_SAMPLES_PASSED 0x8C2F -#define GL_ARRAY_BUFFER 0x8892 -#define GL_ARRAY_BUFFER_BINDING 0x8894 -#define GL_ATTACHED_SHADERS 0x8B85 -#define GL_ATTRIB_STACK_DEPTH 0x0BB0 -#define GL_AUTO_NORMAL 0x0D80 -#define GL_AUX0 0x0409 -#define GL_AUX1 0x040A -#define GL_AUX2 0x040B -#define GL_AUX3 0x040C -#define GL_AUX_BUFFERS 0x0C00 -#define GL_BACK 0x0405 -#define GL_BACK_LEFT 0x0402 -#define GL_BACK_RIGHT 0x0403 -#define GL_BGR 0x80E0 -#define GL_BGRA 0x80E1 -#define GL_BGRA_INTEGER 0x8D9B -#define GL_BGR_INTEGER 0x8D9A -#define GL_BITMAP 0x1A00 -#define GL_BITMAP_TOKEN 0x0704 -#define GL_BLEND 0x0BE2 -#define GL_BLEND_COLOR 0x8005 -#define GL_BLEND_DST 0x0BE0 -#define GL_BLEND_DST_ALPHA 0x80CA -#define GL_BLEND_DST_RGB 0x80C8 -#define GL_BLEND_EQUATION 0x8009 -#define GL_BLEND_EQUATION_ALPHA 0x883D -#define GL_BLEND_EQUATION_RGB 0x8009 -#define GL_BLEND_SRC 0x0BE1 -#define GL_BLEND_SRC_ALPHA 0x80CB -#define GL_BLEND_SRC_RGB 0x80C9 -#define GL_BLUE 0x1905 -#define GL_BLUE_BIAS 0x0D1B -#define GL_BLUE_BITS 0x0D54 -#define GL_BLUE_INTEGER 0x8D96 -#define GL_BLUE_SCALE 0x0D1A -#define GL_BOOL 0x8B56 -#define GL_BOOL_VEC2 0x8B57 -#define GL_BOOL_VEC3 0x8B58 -#define GL_BOOL_VEC4 0x8B59 -#define GL_BUFFER 0x82E0 -#define GL_BUFFER_ACCESS 0x88BB -#define GL_BUFFER_ACCESS_FLAGS 0x911F -#define GL_BUFFER_MAPPED 0x88BC -#define GL_BUFFER_MAP_LENGTH 0x9120 -#define GL_BUFFER_MAP_OFFSET 0x9121 -#define GL_BUFFER_MAP_POINTER 0x88BD -#define GL_BUFFER_SIZE 0x8764 -#define GL_BUFFER_USAGE 0x8765 -#define GL_BYTE 0x1400 -#define GL_C3F_V3F 0x2A24 -#define GL_C4F_N3F_V3F 0x2A26 -#define GL_C4UB_V2F 0x2A22 -#define GL_C4UB_V3F 0x2A23 -#define GL_CCW 0x0901 -#define GL_CLAMP 0x2900 -#define GL_CLAMP_FRAGMENT_COLOR 0x891B -#define GL_CLAMP_READ_COLOR 0x891C -#define GL_CLAMP_TO_BORDER 0x812D -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_CLAMP_VERTEX_COLOR 0x891A -#define GL_CLEAR 0x1500 -#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 -#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF -#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 -#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 -#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 -#define GL_CLIP_DISTANCE0 0x3000 -#define GL_CLIP_DISTANCE1 0x3001 -#define GL_CLIP_DISTANCE2 0x3002 -#define GL_CLIP_DISTANCE3 0x3003 -#define GL_CLIP_DISTANCE4 0x3004 -#define GL_CLIP_DISTANCE5 0x3005 -#define GL_CLIP_DISTANCE6 0x3006 -#define GL_CLIP_DISTANCE7 0x3007 -#define GL_CLIP_PLANE0 0x3000 -#define GL_CLIP_PLANE1 0x3001 -#define GL_CLIP_PLANE2 0x3002 -#define GL_CLIP_PLANE3 0x3003 -#define GL_CLIP_PLANE4 0x3004 -#define GL_CLIP_PLANE5 0x3005 -#define GL_COEFF 0x0A00 -#define GL_COLOR 0x1800 -#define GL_COLOR_ARRAY 0x8076 -#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 -#define GL_COLOR_ARRAY_POINTER 0x8090 -#define GL_COLOR_ARRAY_SIZE 0x8081 -#define GL_COLOR_ARRAY_STRIDE 0x8083 -#define GL_COLOR_ARRAY_TYPE 0x8082 -#define GL_COLOR_ATTACHMENT0 0x8CE0 -#define GL_COLOR_ATTACHMENT1 0x8CE1 -#define GL_COLOR_ATTACHMENT10 0x8CEA -#define GL_COLOR_ATTACHMENT11 0x8CEB -#define GL_COLOR_ATTACHMENT12 0x8CEC -#define GL_COLOR_ATTACHMENT13 0x8CED -#define GL_COLOR_ATTACHMENT14 0x8CEE -#define GL_COLOR_ATTACHMENT15 0x8CEF -#define GL_COLOR_ATTACHMENT16 0x8CF0 -#define GL_COLOR_ATTACHMENT17 0x8CF1 -#define GL_COLOR_ATTACHMENT18 0x8CF2 -#define GL_COLOR_ATTACHMENT19 0x8CF3 -#define GL_COLOR_ATTACHMENT2 0x8CE2 -#define GL_COLOR_ATTACHMENT20 0x8CF4 -#define GL_COLOR_ATTACHMENT21 0x8CF5 -#define GL_COLOR_ATTACHMENT22 0x8CF6 -#define GL_COLOR_ATTACHMENT23 0x8CF7 -#define GL_COLOR_ATTACHMENT24 0x8CF8 -#define GL_COLOR_ATTACHMENT25 0x8CF9 -#define GL_COLOR_ATTACHMENT26 0x8CFA -#define GL_COLOR_ATTACHMENT27 0x8CFB -#define GL_COLOR_ATTACHMENT28 0x8CFC -#define GL_COLOR_ATTACHMENT29 0x8CFD -#define GL_COLOR_ATTACHMENT3 0x8CE3 -#define GL_COLOR_ATTACHMENT30 0x8CFE -#define GL_COLOR_ATTACHMENT31 0x8CFF -#define GL_COLOR_ATTACHMENT4 0x8CE4 -#define GL_COLOR_ATTACHMENT5 0x8CE5 -#define GL_COLOR_ATTACHMENT6 0x8CE6 -#define GL_COLOR_ATTACHMENT7 0x8CE7 -#define GL_COLOR_ATTACHMENT8 0x8CE8 -#define GL_COLOR_ATTACHMENT9 0x8CE9 -#define GL_COLOR_BUFFER_BIT 0x00004000 -#define GL_COLOR_CLEAR_VALUE 0x0C22 -#define GL_COLOR_INDEX 0x1900 -#define GL_COLOR_INDEXES 0x1603 -#define GL_COLOR_LOGIC_OP 0x0BF2 -#define GL_COLOR_MATERIAL 0x0B57 -#define GL_COLOR_MATERIAL_FACE 0x0B55 -#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 -#define GL_COLOR_SUM 0x8458 -#define GL_COLOR_WRITEMASK 0x0C23 -#define GL_COMBINE 0x8570 -#define GL_COMBINE_ALPHA 0x8572 -#define GL_COMBINE_RGB 0x8571 -#define GL_COMPARE_REF_TO_TEXTURE 0x884E -#define GL_COMPARE_R_TO_TEXTURE 0x884E -#define GL_COMPILE 0x1300 -#define GL_COMPILE_AND_EXECUTE 0x1301 -#define GL_COMPILE_STATUS 0x8B81 -#define GL_COMPRESSED_ALPHA 0x84E9 -#define GL_COMPRESSED_INTENSITY 0x84EC -#define GL_COMPRESSED_LUMINANCE 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB -#define GL_COMPRESSED_RED 0x8225 -#define GL_COMPRESSED_RED_RGTC1 0x8DBB -#define GL_COMPRESSED_RG 0x8226 -#define GL_COMPRESSED_RGB 0x84ED -#define GL_COMPRESSED_RGBA 0x84EE -#define GL_COMPRESSED_RG_RGTC2 0x8DBD -#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC -#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE -#define GL_COMPRESSED_SLUMINANCE 0x8C4A -#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B -#define GL_COMPRESSED_SRGB 0x8C48 -#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 -#define GL_CONDITION_SATISFIED 0x911C -#define GL_CONSTANT 0x8576 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_CONSTANT_ATTENUATION 0x1207 -#define GL_CONSTANT_COLOR 0x8001 -#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 -#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 -#define GL_CONTEXT_FLAGS 0x821E -#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 -#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001 -#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 -#define GL_CONTEXT_PROFILE_MASK 0x9126 -#define GL_COORD_REPLACE 0x8862 -#define GL_COPY 0x1503 -#define GL_COPY_INVERTED 0x150C -#define GL_COPY_PIXEL_TOKEN 0x0706 -#define GL_COPY_READ_BUFFER 0x8F36 -#define GL_COPY_WRITE_BUFFER 0x8F37 -#define GL_CULL_FACE 0x0B44 -#define GL_CULL_FACE_MODE 0x0B45 -#define GL_CURRENT_BIT 0x00000001 -#define GL_CURRENT_COLOR 0x0B00 -#define GL_CURRENT_FOG_COORD 0x8453 -#define GL_CURRENT_FOG_COORDINATE 0x8453 -#define GL_CURRENT_INDEX 0x0B01 -#define GL_CURRENT_NORMAL 0x0B02 -#define GL_CURRENT_PROGRAM 0x8B8D -#define GL_CURRENT_QUERY 0x8865 -#define GL_CURRENT_RASTER_COLOR 0x0B04 -#define GL_CURRENT_RASTER_DISTANCE 0x0B09 -#define GL_CURRENT_RASTER_INDEX 0x0B05 -#define GL_CURRENT_RASTER_POSITION 0x0B07 -#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 -#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F -#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 -#define GL_CURRENT_SECONDARY_COLOR 0x8459 -#define GL_CURRENT_TEXTURE_COORDS 0x0B03 -#define GL_CURRENT_VERTEX_ATTRIB 0x8626 -#define GL_CW 0x0900 -#define GL_DEBUG_CALLBACK_FUNCTION 0x8244 -#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245 -#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D -#define GL_DEBUG_LOGGED_MESSAGES 0x9145 -#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 -#define GL_DEBUG_OUTPUT 0x92E0 -#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 -#define GL_DEBUG_SEVERITY_HIGH 0x9146 -#define GL_DEBUG_SEVERITY_LOW 0x9148 -#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 -#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B -#define GL_DEBUG_SOURCE_API 0x8246 -#define GL_DEBUG_SOURCE_APPLICATION 0x824A -#define GL_DEBUG_SOURCE_OTHER 0x824B -#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 -#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 -#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 -#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D -#define GL_DEBUG_TYPE_ERROR 0x824C -#define GL_DEBUG_TYPE_MARKER 0x8268 -#define GL_DEBUG_TYPE_OTHER 0x8251 -#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 -#define GL_DEBUG_TYPE_POP_GROUP 0x826A -#define GL_DEBUG_TYPE_PORTABILITY 0x824F -#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 -#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E -#define GL_DECAL 0x2101 -#define GL_DECR 0x1E03 -#define GL_DECR_WRAP 0x8508 -#define GL_DELETE_STATUS 0x8B80 -#define GL_DEPTH 0x1801 -#define GL_DEPTH24_STENCIL8 0x88F0 -#define GL_DEPTH32F_STENCIL8 0x8CAD -#define GL_DEPTH_ATTACHMENT 0x8D00 -#define GL_DEPTH_BIAS 0x0D1F -#define GL_DEPTH_BITS 0x0D56 -#define GL_DEPTH_BUFFER_BIT 0x00000100 -#define GL_DEPTH_CLAMP 0x864F -#define GL_DEPTH_CLEAR_VALUE 0x0B73 -#define GL_DEPTH_COMPONENT 0x1902 -#define GL_DEPTH_COMPONENT16 0x81A5 -#define GL_DEPTH_COMPONENT24 0x81A6 -#define GL_DEPTH_COMPONENT32 0x81A7 -#define GL_DEPTH_COMPONENT32F 0x8CAC -#define GL_DEPTH_FUNC 0x0B74 -#define GL_DEPTH_RANGE 0x0B70 -#define GL_DEPTH_SCALE 0x0D1E -#define GL_DEPTH_STENCIL 0x84F9 -#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A -#define GL_DEPTH_TEST 0x0B71 -#define GL_DEPTH_TEXTURE_MODE 0x884B -#define GL_DEPTH_WRITEMASK 0x0B72 -#define GL_DIFFUSE 0x1201 -#define GL_DISPLAY_LIST 0x82E7 -#define GL_DITHER 0x0BD0 -#define GL_DOMAIN 0x0A02 -#define GL_DONT_CARE 0x1100 -#define GL_DOT3_RGB 0x86AE -#define GL_DOT3_RGBA 0x86AF -#define GL_DOUBLE 0x140A -#define GL_DOUBLEBUFFER 0x0C32 -#define GL_DRAW_BUFFER 0x0C01 -#define GL_DRAW_BUFFER0 0x8825 -#define GL_DRAW_BUFFER1 0x8826 -#define GL_DRAW_BUFFER10 0x882F -#define GL_DRAW_BUFFER11 0x8830 -#define GL_DRAW_BUFFER12 0x8831 -#define GL_DRAW_BUFFER13 0x8832 -#define GL_DRAW_BUFFER14 0x8833 -#define GL_DRAW_BUFFER15 0x8834 -#define GL_DRAW_BUFFER2 0x8827 -#define GL_DRAW_BUFFER3 0x8828 -#define GL_DRAW_BUFFER4 0x8829 -#define GL_DRAW_BUFFER5 0x882A -#define GL_DRAW_BUFFER6 0x882B -#define GL_DRAW_BUFFER7 0x882C -#define GL_DRAW_BUFFER8 0x882D -#define GL_DRAW_BUFFER9 0x882E -#define GL_DRAW_FRAMEBUFFER 0x8CA9 -#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_DRAW_PIXEL_TOKEN 0x0705 -#define GL_DST_ALPHA 0x0304 -#define GL_DST_COLOR 0x0306 -#define GL_DYNAMIC_COPY 0x88EA -#define GL_DYNAMIC_DRAW 0x88E8 -#define GL_DYNAMIC_READ 0x88E9 -#define GL_EDGE_FLAG 0x0B43 -#define GL_EDGE_FLAG_ARRAY 0x8079 -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B -#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 -#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C -#define GL_ELEMENT_ARRAY_BUFFER 0x8893 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 -#define GL_EMISSION 0x1600 -#define GL_ENABLE_BIT 0x00002000 -#define GL_EQUAL 0x0202 -#define GL_EQUIV 0x1509 -#define GL_EVAL_BIT 0x00010000 -#define GL_EXP 0x0800 -#define GL_EXP2 0x0801 -#define GL_EXTENSIONS 0x1F03 -#define GL_EYE_LINEAR 0x2400 -#define GL_EYE_PLANE 0x2502 -#define GL_FALSE 0 -#define GL_FASTEST 0x1101 -#define GL_FEEDBACK 0x1C01 -#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 -#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 -#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 -#define GL_FILL 0x1B02 -#define GL_FIRST_VERTEX_CONVENTION 0x8E4D -#define GL_FIXED_ONLY 0x891D -#define GL_FLAT 0x1D00 -#define GL_FLOAT 0x1406 -#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD -#define GL_FLOAT_MAT2 0x8B5A -#define GL_FLOAT_MAT2x3 0x8B65 -#define GL_FLOAT_MAT2x4 0x8B66 -#define GL_FLOAT_MAT3 0x8B5B -#define GL_FLOAT_MAT3x2 0x8B67 -#define GL_FLOAT_MAT3x4 0x8B68 -#define GL_FLOAT_MAT4 0x8B5C -#define GL_FLOAT_MAT4x2 0x8B69 -#define GL_FLOAT_MAT4x3 0x8B6A -#define GL_FLOAT_VEC2 0x8B50 -#define GL_FLOAT_VEC3 0x8B51 -#define GL_FLOAT_VEC4 0x8B52 -#define GL_FOG 0x0B60 -#define GL_FOG_BIT 0x00000080 -#define GL_FOG_COLOR 0x0B66 -#define GL_FOG_COORD 0x8451 -#define GL_FOG_COORDINATE 0x8451 -#define GL_FOG_COORDINATE_ARRAY 0x8457 -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D -#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 -#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 -#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 -#define GL_FOG_COORDINATE_SOURCE 0x8450 -#define GL_FOG_COORD_ARRAY 0x8457 -#define GL_FOG_COORD_ARRAY_BUFFER_BINDING 0x889D -#define GL_FOG_COORD_ARRAY_POINTER 0x8456 -#define GL_FOG_COORD_ARRAY_STRIDE 0x8455 -#define GL_FOG_COORD_ARRAY_TYPE 0x8454 -#define GL_FOG_COORD_SRC 0x8450 -#define GL_FOG_DENSITY 0x0B62 -#define GL_FOG_END 0x0B64 -#define GL_FOG_HINT 0x0C54 -#define GL_FOG_INDEX 0x0B61 -#define GL_FOG_MODE 0x0B65 -#define GL_FOG_START 0x0B63 -#define GL_FRAGMENT_DEPTH 0x8452 -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B -#define GL_FRAMEBUFFER 0x8D40 -#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 -#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 -#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 -#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 -#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 -#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 -#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 -#define GL_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 -#define GL_FRAMEBUFFER_DEFAULT 0x8218 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC -#define GL_FRAMEBUFFER_SRGB 0x8DB9 -#define GL_FRAMEBUFFER_UNDEFINED 0x8219 -#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD -#define GL_FRONT 0x0404 -#define GL_FRONT_AND_BACK 0x0408 -#define GL_FRONT_FACE 0x0B46 -#define GL_FRONT_LEFT 0x0400 -#define GL_FRONT_RIGHT 0x0401 -#define GL_FUNC_ADD 0x8006 -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_FUNC_SUBTRACT 0x800A -#define GL_GENERATE_MIPMAP 0x8191 -#define GL_GENERATE_MIPMAP_HINT 0x8192 -#define GL_GEOMETRY_INPUT_TYPE 0x8917 -#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 -#define GL_GEOMETRY_SHADER 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT 0x8916 -#define GL_GEQUAL 0x0206 -#define GL_GREATER 0x0204 -#define GL_GREEN 0x1904 -#define GL_GREEN_BIAS 0x0D19 -#define GL_GREEN_BITS 0x0D53 -#define GL_GREEN_INTEGER 0x8D95 -#define GL_GREEN_SCALE 0x0D18 -#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 -#define GL_HALF_FLOAT 0x140B -#define GL_HINT_BIT 0x00008000 -#define GL_INCR 0x1E02 -#define GL_INCR_WRAP 0x8507 -#define GL_INDEX 0x8222 -#define GL_INDEX_ARRAY 0x8077 -#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 -#define GL_INDEX_ARRAY_POINTER 0x8091 -#define GL_INDEX_ARRAY_STRIDE 0x8086 -#define GL_INDEX_ARRAY_TYPE 0x8085 -#define GL_INDEX_BITS 0x0D51 -#define GL_INDEX_CLEAR_VALUE 0x0C20 -#define GL_INDEX_LOGIC_OP 0x0BF1 -#define GL_INDEX_MODE 0x0C30 -#define GL_INDEX_OFFSET 0x0D13 -#define GL_INDEX_SHIFT 0x0D12 -#define GL_INDEX_WRITEMASK 0x0C21 -#define GL_INFO_LOG_LENGTH 0x8B84 -#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 -#define GL_INT 0x1404 -#define GL_INTENSITY 0x8049 -#define GL_INTENSITY12 0x804C -#define GL_INTENSITY16 0x804D -#define GL_INTENSITY4 0x804A -#define GL_INTENSITY8 0x804B -#define GL_INTERLEAVED_ATTRIBS 0x8C8C -#define GL_INTERPOLATE 0x8575 -#define GL_INT_2_10_10_10_REV 0x8D9F -#define GL_INT_SAMPLER_1D 0x8DC9 -#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE -#define GL_INT_SAMPLER_2D 0x8DCA -#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF -#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 -#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C -#define GL_INT_SAMPLER_2D_RECT 0x8DCD -#define GL_INT_SAMPLER_3D 0x8DCB -#define GL_INT_SAMPLER_BUFFER 0x8DD0 -#define GL_INT_SAMPLER_CUBE 0x8DCC -#define GL_INT_VEC2 0x8B53 -#define GL_INT_VEC3 0x8B54 -#define GL_INT_VEC4 0x8B55 -#define GL_INVALID_ENUM 0x0500 -#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 -#define GL_INVALID_INDEX 0xFFFFFFFF -#define GL_INVALID_OPERATION 0x0502 -#define GL_INVALID_VALUE 0x0501 -#define GL_INVERT 0x150A -#define GL_KEEP 0x1E00 -#define GL_LAST_VERTEX_CONVENTION 0x8E4E -#define GL_LEFT 0x0406 -#define GL_LEQUAL 0x0203 -#define GL_LESS 0x0201 -#define GL_LIGHT0 0x4000 -#define GL_LIGHT1 0x4001 -#define GL_LIGHT2 0x4002 -#define GL_LIGHT3 0x4003 -#define GL_LIGHT4 0x4004 -#define GL_LIGHT5 0x4005 -#define GL_LIGHT6 0x4006 -#define GL_LIGHT7 0x4007 -#define GL_LIGHTING 0x0B50 -#define GL_LIGHTING_BIT 0x00000040 -#define GL_LIGHT_MODEL_AMBIENT 0x0B53 -#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 -#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 -#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 -#define GL_LINE 0x1B01 -#define GL_LINEAR 0x2601 -#define GL_LINEAR_ATTENUATION 0x1208 -#define GL_LINEAR_MIPMAP_LINEAR 0x2703 -#define GL_LINEAR_MIPMAP_NEAREST 0x2701 -#define GL_LINES 0x0001 -#define GL_LINES_ADJACENCY 0x000A -#define GL_LINE_BIT 0x00000004 -#define GL_LINE_LOOP 0x0002 -#define GL_LINE_RESET_TOKEN 0x0707 -#define GL_LINE_SMOOTH 0x0B20 -#define GL_LINE_SMOOTH_HINT 0x0C52 -#define GL_LINE_STIPPLE 0x0B24 -#define GL_LINE_STIPPLE_PATTERN 0x0B25 -#define GL_LINE_STIPPLE_REPEAT 0x0B26 -#define GL_LINE_STRIP 0x0003 -#define GL_LINE_STRIP_ADJACENCY 0x000B -#define GL_LINE_TOKEN 0x0702 -#define GL_LINE_WIDTH 0x0B21 -#define GL_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_LINE_WIDTH_RANGE 0x0B22 -#define GL_LINK_STATUS 0x8B82 -#define GL_LIST_BASE 0x0B32 -#define GL_LIST_BIT 0x00020000 -#define GL_LIST_INDEX 0x0B33 -#define GL_LIST_MODE 0x0B30 -#define GL_LOAD 0x0101 -#define GL_LOGIC_OP 0x0BF1 -#define GL_LOGIC_OP_MODE 0x0BF0 -#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 -#define GL_LOWER_LEFT 0x8CA1 -#define GL_LUMINANCE 0x1909 -#define GL_LUMINANCE12 0x8041 -#define GL_LUMINANCE12_ALPHA12 0x8047 -#define GL_LUMINANCE12_ALPHA4 0x8046 -#define GL_LUMINANCE16 0x8042 -#define GL_LUMINANCE16_ALPHA16 0x8048 -#define GL_LUMINANCE4 0x803F -#define GL_LUMINANCE4_ALPHA4 0x8043 -#define GL_LUMINANCE6_ALPHA2 0x8044 -#define GL_LUMINANCE8 0x8040 -#define GL_LUMINANCE8_ALPHA8 0x8045 -#define GL_LUMINANCE_ALPHA 0x190A -#define GL_MAJOR_VERSION 0x821B -#define GL_MAP1_COLOR_4 0x0D90 -#define GL_MAP1_GRID_DOMAIN 0x0DD0 -#define GL_MAP1_GRID_SEGMENTS 0x0DD1 -#define GL_MAP1_INDEX 0x0D91 -#define GL_MAP1_NORMAL 0x0D92 -#define GL_MAP1_TEXTURE_COORD_1 0x0D93 -#define GL_MAP1_TEXTURE_COORD_2 0x0D94 -#define GL_MAP1_TEXTURE_COORD_3 0x0D95 -#define GL_MAP1_TEXTURE_COORD_4 0x0D96 -#define GL_MAP1_VERTEX_3 0x0D97 -#define GL_MAP1_VERTEX_4 0x0D98 -#define GL_MAP2_COLOR_4 0x0DB0 -#define GL_MAP2_GRID_DOMAIN 0x0DD2 -#define GL_MAP2_GRID_SEGMENTS 0x0DD3 -#define GL_MAP2_INDEX 0x0DB1 -#define GL_MAP2_NORMAL 0x0DB2 -#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 -#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 -#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 -#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 -#define GL_MAP2_VERTEX_3 0x0DB7 -#define GL_MAP2_VERTEX_4 0x0DB8 -#define GL_MAP_COLOR 0x0D10 -#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 -#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 -#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 -#define GL_MAP_READ_BIT 0x0001 -#define GL_MAP_STENCIL 0x0D11 -#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 -#define GL_MAP_WRITE_BIT 0x0002 -#define GL_MATRIX_MODE 0x0BA0 -#define GL_MAX 0x8008 -#define GL_MAX_3D_TEXTURE_SIZE 0x8073 -#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF -#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 -#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B -#define GL_MAX_CLIP_DISTANCES 0x0D32 -#define GL_MAX_CLIP_PLANES 0x0D32 -#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF -#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E -#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 -#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D -#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E -#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C -#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C -#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 -#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 -#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F -#define GL_MAX_DRAW_BUFFERS 0x8824 -#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC -#define GL_MAX_ELEMENTS_INDICES 0x80E9 -#define GL_MAX_ELEMENTS_VERTICES 0x80E8 -#define GL_MAX_EVAL_ORDER 0x0D30 -#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 -#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 -#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 -#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 -#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF -#define GL_MAX_INTEGER_SAMPLES 0x9110 -#define GL_MAX_LABEL_LENGTH 0x82E8 -#define GL_MAX_LIGHTS 0x0D31 -#define GL_MAX_LIST_NESTING 0x0B31 -#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 -#define GL_MAX_NAME_STACK_DEPTH 0x0D37 -#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 -#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 -#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 -#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 -#define GL_MAX_SAMPLES 0x8D57 -#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 -#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 -#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B -#define GL_MAX_TEXTURE_COORDS 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 -#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD -#define GL_MAX_TEXTURE_SIZE 0x0D33 -#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 -#define GL_MAX_TEXTURE_UNITS 0x84E2 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 -#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 -#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F -#define GL_MAX_VARYING_COMPONENTS 0x8B4B -#define GL_MAX_VARYING_FLOATS 0x8B4B -#define GL_MAX_VERTEX_ATTRIBS 0x8869 -#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C -#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A -#define GL_MAX_VIEWPORT_DIMS 0x0D3A -#define GL_MIN 0x8007 -#define GL_MINOR_VERSION 0x821C -#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 -#define GL_MIRRORED_REPEAT 0x8370 -#define GL_MODELVIEW 0x1700 -#define GL_MODELVIEW_MATRIX 0x0BA6 -#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 -#define GL_MODULATE 0x2100 -#define GL_MULT 0x0103 -#define GL_MULTISAMPLE 0x809D -#define GL_MULTISAMPLE_ARB 0x809D -#define GL_MULTISAMPLE_BIT 0x20000000 -#define GL_MULTISAMPLE_BIT_ARB 0x20000000 -#define GL_N3F_V3F 0x2A25 -#define GL_NAME_STACK_DEPTH 0x0D70 -#define GL_NAND 0x150E -#define GL_NEAREST 0x2600 -#define GL_NEAREST_MIPMAP_LINEAR 0x2702 -#define GL_NEAREST_MIPMAP_NEAREST 0x2700 -#define GL_NEVER 0x0200 -#define GL_NICEST 0x1102 -#define GL_NONE 0 -#define GL_NOOP 0x1505 -#define GL_NOR 0x1508 -#define GL_NORMALIZE 0x0BA1 -#define GL_NORMAL_ARRAY 0x8075 -#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 -#define GL_NORMAL_ARRAY_POINTER 0x808F -#define GL_NORMAL_ARRAY_STRIDE 0x807F -#define GL_NORMAL_ARRAY_TYPE 0x807E -#define GL_NORMAL_MAP 0x8511 -#define GL_NOTEQUAL 0x0205 -#define GL_NO_ERROR 0 -#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_NUM_EXTENSIONS 0x821D -#define GL_OBJECT_LINEAR 0x2401 -#define GL_OBJECT_PLANE 0x2501 -#define GL_OBJECT_TYPE 0x9112 -#define GL_ONE 1 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_ONE_MINUS_DST_ALPHA 0x0305 -#define GL_ONE_MINUS_DST_COLOR 0x0307 -#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB -#define GL_ONE_MINUS_SRC1_COLOR 0x88FA -#define GL_ONE_MINUS_SRC_ALPHA 0x0303 -#define GL_ONE_MINUS_SRC_COLOR 0x0301 -#define GL_OPERAND0_ALPHA 0x8598 -#define GL_OPERAND0_RGB 0x8590 -#define GL_OPERAND1_ALPHA 0x8599 -#define GL_OPERAND1_RGB 0x8591 -#define GL_OPERAND2_ALPHA 0x859A -#define GL_OPERAND2_RGB 0x8592 -#define GL_OR 0x1507 -#define GL_ORDER 0x0A01 -#define GL_OR_INVERTED 0x150D -#define GL_OR_REVERSE 0x150B -#define GL_OUT_OF_MEMORY 0x0505 -#define GL_PACK_ALIGNMENT 0x0D05 -#define GL_PACK_IMAGE_HEIGHT 0x806C -#define GL_PACK_LSB_FIRST 0x0D01 -#define GL_PACK_ROW_LENGTH 0x0D02 -#define GL_PACK_SKIP_IMAGES 0x806B -#define GL_PACK_SKIP_PIXELS 0x0D04 -#define GL_PACK_SKIP_ROWS 0x0D03 -#define GL_PACK_SWAP_BYTES 0x0D00 -#define GL_PASS_THROUGH_TOKEN 0x0700 -#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 -#define GL_PIXEL_MAP_A_TO_A 0x0C79 -#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 -#define GL_PIXEL_MAP_B_TO_B 0x0C78 -#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 -#define GL_PIXEL_MAP_G_TO_G 0x0C77 -#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 -#define GL_PIXEL_MAP_I_TO_A 0x0C75 -#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 -#define GL_PIXEL_MAP_I_TO_B 0x0C74 -#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 -#define GL_PIXEL_MAP_I_TO_G 0x0C73 -#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 -#define GL_PIXEL_MAP_I_TO_I 0x0C70 -#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 -#define GL_PIXEL_MAP_I_TO_R 0x0C72 -#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 -#define GL_PIXEL_MAP_R_TO_R 0x0C76 -#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 -#define GL_PIXEL_MAP_S_TO_S 0x0C71 -#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 -#define GL_PIXEL_MODE_BIT 0x00000020 -#define GL_PIXEL_PACK_BUFFER 0x88EB -#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED -#define GL_PIXEL_UNPACK_BUFFER 0x88EC -#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF -#define GL_POINT 0x1B00 -#define GL_POINTS 0x0000 -#define GL_POINT_BIT 0x00000002 -#define GL_POINT_DISTANCE_ATTENUATION 0x8129 -#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 -#define GL_POINT_SIZE 0x0B11 -#define GL_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_POINT_SIZE_MAX 0x8127 -#define GL_POINT_SIZE_MIN 0x8126 -#define GL_POINT_SIZE_RANGE 0x0B12 -#define GL_POINT_SMOOTH 0x0B10 -#define GL_POINT_SMOOTH_HINT 0x0C51 -#define GL_POINT_SPRITE 0x8861 -#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 -#define GL_POINT_TOKEN 0x0701 -#define GL_POLYGON 0x0009 -#define GL_POLYGON_BIT 0x00000008 -#define GL_POLYGON_MODE 0x0B40 -#define GL_POLYGON_OFFSET_FACTOR 0x8038 -#define GL_POLYGON_OFFSET_FILL 0x8037 -#define GL_POLYGON_OFFSET_LINE 0x2A02 -#define GL_POLYGON_OFFSET_POINT 0x2A01 -#define GL_POLYGON_OFFSET_UNITS 0x2A00 -#define GL_POLYGON_SMOOTH 0x0B41 -#define GL_POLYGON_SMOOTH_HINT 0x0C53 -#define GL_POLYGON_STIPPLE 0x0B42 -#define GL_POLYGON_STIPPLE_BIT 0x00000010 -#define GL_POLYGON_TOKEN 0x0703 -#define GL_POSITION 0x1203 -#define GL_PREVIOUS 0x8578 -#define GL_PRIMARY_COLOR 0x8577 -#define GL_PRIMITIVES_GENERATED 0x8C87 -#define GL_PRIMITIVE_RESTART 0x8F9D -#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E -#define GL_PROGRAM 0x82E2 -#define GL_PROGRAM_PIPELINE 0x82E4 -#define GL_PROGRAM_POINT_SIZE 0x8642 -#define GL_PROJECTION 0x1701 -#define GL_PROJECTION_MATRIX 0x0BA7 -#define GL_PROJECTION_STACK_DEPTH 0x0BA4 -#define GL_PROVOKING_VERTEX 0x8E4F -#define GL_PROXY_TEXTURE_1D 0x8063 -#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 -#define GL_PROXY_TEXTURE_2D 0x8064 -#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B -#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 -#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 -#define GL_PROXY_TEXTURE_3D 0x8070 -#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B -#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 -#define GL_Q 0x2003 -#define GL_QUADRATIC_ATTENUATION 0x1209 -#define GL_QUADS 0x0007 -#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C -#define GL_QUAD_STRIP 0x0008 -#define GL_QUERY 0x82E3 -#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 -#define GL_QUERY_BY_REGION_WAIT 0x8E15 -#define GL_QUERY_COUNTER_BITS 0x8864 -#define GL_QUERY_NO_WAIT 0x8E14 -#define GL_QUERY_RESULT 0x8866 -#define GL_QUERY_RESULT_AVAILABLE 0x8867 -#define GL_QUERY_WAIT 0x8E13 -#define GL_R 0x2002 -#define GL_R11F_G11F_B10F 0x8C3A -#define GL_R16 0x822A -#define GL_R16F 0x822D -#define GL_R16I 0x8233 -#define GL_R16UI 0x8234 -#define GL_R16_SNORM 0x8F98 -#define GL_R32F 0x822E -#define GL_R32I 0x8235 -#define GL_R32UI 0x8236 -#define GL_R3_G3_B2 0x2A10 -#define GL_R8 0x8229 -#define GL_R8I 0x8231 -#define GL_R8UI 0x8232 -#define GL_R8_SNORM 0x8F94 -#define GL_RASTERIZER_DISCARD 0x8C89 -#define GL_READ_BUFFER 0x0C02 -#define GL_READ_FRAMEBUFFER 0x8CA8 -#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA -#define GL_READ_ONLY 0x88B8 -#define GL_READ_WRITE 0x88BA -#define GL_RED 0x1903 -#define GL_RED_BIAS 0x0D15 -#define GL_RED_BITS 0x0D52 -#define GL_RED_INTEGER 0x8D94 -#define GL_RED_SCALE 0x0D14 -#define GL_REFLECTION_MAP 0x8512 -#define GL_RENDER 0x1C00 -#define GL_RENDERBUFFER 0x8D41 -#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 -#define GL_RENDERBUFFER_BINDING 0x8CA7 -#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 -#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 -#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 -#define GL_RENDERBUFFER_HEIGHT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 -#define GL_RENDERBUFFER_RED_SIZE 0x8D50 -#define GL_RENDERBUFFER_SAMPLES 0x8CAB -#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 -#define GL_RENDERBUFFER_WIDTH 0x8D42 -#define GL_RENDERER 0x1F01 -#define GL_RENDER_MODE 0x0C40 -#define GL_REPEAT 0x2901 -#define GL_REPLACE 0x1E01 -#define GL_RESCALE_NORMAL 0x803A -#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 -#define GL_RETURN 0x0102 -#define GL_RG 0x8227 -#define GL_RG16 0x822C -#define GL_RG16F 0x822F -#define GL_RG16I 0x8239 -#define GL_RG16UI 0x823A -#define GL_RG16_SNORM 0x8F99 -#define GL_RG32F 0x8230 -#define GL_RG32I 0x823B -#define GL_RG32UI 0x823C -#define GL_RG8 0x822B -#define GL_RG8I 0x8237 -#define GL_RG8UI 0x8238 -#define GL_RG8_SNORM 0x8F95 -#define GL_RGB 0x1907 -#define GL_RGB10 0x8052 -#define GL_RGB10_A2 0x8059 -#define GL_RGB10_A2UI 0x906F -#define GL_RGB12 0x8053 -#define GL_RGB16 0x8054 -#define GL_RGB16F 0x881B -#define GL_RGB16I 0x8D89 -#define GL_RGB16UI 0x8D77 -#define GL_RGB16_SNORM 0x8F9A -#define GL_RGB32F 0x8815 -#define GL_RGB32I 0x8D83 -#define GL_RGB32UI 0x8D71 -#define GL_RGB4 0x804F -#define GL_RGB5 0x8050 -#define GL_RGB5_A1 0x8057 -#define GL_RGB8 0x8051 -#define GL_RGB8I 0x8D8F -#define GL_RGB8UI 0x8D7D -#define GL_RGB8_SNORM 0x8F96 -#define GL_RGB9_E5 0x8C3D -#define GL_RGBA 0x1908 -#define GL_RGBA12 0x805A -#define GL_RGBA16 0x805B -#define GL_RGBA16F 0x881A -#define GL_RGBA16I 0x8D88 -#define GL_RGBA16UI 0x8D76 -#define GL_RGBA16_SNORM 0x8F9B -#define GL_RGBA2 0x8055 -#define GL_RGBA32F 0x8814 -#define GL_RGBA32I 0x8D82 -#define GL_RGBA32UI 0x8D70 -#define GL_RGBA4 0x8056 -#define GL_RGBA8 0x8058 -#define GL_RGBA8I 0x8D8E -#define GL_RGBA8UI 0x8D7C -#define GL_RGBA8_SNORM 0x8F97 -#define GL_RGBA_INTEGER 0x8D99 -#define GL_RGBA_MODE 0x0C31 -#define GL_RGB_INTEGER 0x8D98 -#define GL_RGB_SCALE 0x8573 -#define GL_RG_INTEGER 0x8228 -#define GL_RIGHT 0x0407 -#define GL_S 0x2000 -#define GL_SAMPLER 0x82E6 -#define GL_SAMPLER_1D 0x8B5D -#define GL_SAMPLER_1D_ARRAY 0x8DC0 -#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 -#define GL_SAMPLER_1D_SHADOW 0x8B61 -#define GL_SAMPLER_2D 0x8B5E -#define GL_SAMPLER_2D_ARRAY 0x8DC1 -#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 -#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 -#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B -#define GL_SAMPLER_2D_RECT 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 -#define GL_SAMPLER_2D_SHADOW 0x8B62 -#define GL_SAMPLER_3D 0x8B5F -#define GL_SAMPLER_BINDING 0x8919 -#define GL_SAMPLER_BUFFER 0x8DC2 -#define GL_SAMPLER_CUBE 0x8B60 -#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLES_ARB 0x80A9 -#define GL_SAMPLES_PASSED 0x8914 -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE 0x809F -#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLE_BUFFERS_ARB 0x80A8 -#define GL_SAMPLE_COVERAGE 0x80A0 -#define GL_SAMPLE_COVERAGE_ARB 0x80A0 -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB -#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA -#define GL_SAMPLE_MASK 0x8E51 -#define GL_SAMPLE_MASK_VALUE 0x8E52 -#define GL_SAMPLE_POSITION 0x8E50 -#define GL_SCISSOR_BIT 0x00080000 -#define GL_SCISSOR_BOX 0x0C10 -#define GL_SCISSOR_TEST 0x0C11 -#define GL_SECONDARY_COLOR_ARRAY 0x845E -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C -#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D -#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A -#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C -#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B -#define GL_SELECT 0x1C02 -#define GL_SELECTION_BUFFER_POINTER 0x0DF3 -#define GL_SELECTION_BUFFER_SIZE 0x0DF4 -#define GL_SEPARATE_ATTRIBS 0x8C8D -#define GL_SEPARATE_SPECULAR_COLOR 0x81FA -#define GL_SET 0x150F -#define GL_SHADER 0x82E1 -#define GL_SHADER_SOURCE_LENGTH 0x8B88 -#define GL_SHADER_TYPE 0x8B4F -#define GL_SHADE_MODEL 0x0B54 -#define GL_SHADING_LANGUAGE_VERSION 0x8B8C -#define GL_SHININESS 0x1601 -#define GL_SHORT 0x1402 -#define GL_SIGNALED 0x9119 -#define GL_SIGNED_NORMALIZED 0x8F9C -#define GL_SINGLE_COLOR 0x81F9 -#define GL_SLUMINANCE 0x8C46 -#define GL_SLUMINANCE8 0x8C47 -#define GL_SLUMINANCE8_ALPHA8 0x8C45 -#define GL_SLUMINANCE_ALPHA 0x8C44 -#define GL_SMOOTH 0x1D01 -#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 -#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 -#define GL_SOURCE0_ALPHA 0x8588 -#define GL_SOURCE0_RGB 0x8580 -#define GL_SOURCE1_ALPHA 0x8589 -#define GL_SOURCE1_RGB 0x8581 -#define GL_SOURCE2_ALPHA 0x858A -#define GL_SOURCE2_RGB 0x8582 -#define GL_SPECULAR 0x1202 -#define GL_SPHERE_MAP 0x2402 -#define GL_SPOT_CUTOFF 0x1206 -#define GL_SPOT_DIRECTION 0x1204 -#define GL_SPOT_EXPONENT 0x1205 -#define GL_SRC0_ALPHA 0x8588 -#define GL_SRC0_RGB 0x8580 -#define GL_SRC1_ALPHA 0x8589 -#define GL_SRC1_COLOR 0x88F9 -#define GL_SRC1_RGB 0x8581 -#define GL_SRC2_ALPHA 0x858A -#define GL_SRC2_RGB 0x8582 -#define GL_SRC_ALPHA 0x0302 -#define GL_SRC_ALPHA_SATURATE 0x0308 -#define GL_SRC_COLOR 0x0300 -#define GL_SRGB 0x8C40 -#define GL_SRGB8 0x8C41 -#define GL_SRGB8_ALPHA8 0x8C43 -#define GL_SRGB_ALPHA 0x8C42 -#define GL_STACK_OVERFLOW 0x0503 -#define GL_STACK_UNDERFLOW 0x0504 -#define GL_STATIC_COPY 0x88E6 -#define GL_STATIC_DRAW 0x88E4 -#define GL_STATIC_READ 0x88E5 -#define GL_STENCIL 0x1802 -#define GL_STENCIL_ATTACHMENT 0x8D20 -#define GL_STENCIL_BACK_FAIL 0x8801 -#define GL_STENCIL_BACK_FUNC 0x8800 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 -#define GL_STENCIL_BACK_REF 0x8CA3 -#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 -#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 -#define GL_STENCIL_BITS 0x0D57 -#define GL_STENCIL_BUFFER_BIT 0x00000400 -#define GL_STENCIL_CLEAR_VALUE 0x0B91 -#define GL_STENCIL_FAIL 0x0B94 -#define GL_STENCIL_FUNC 0x0B92 -#define GL_STENCIL_INDEX 0x1901 -#define GL_STENCIL_INDEX1 0x8D46 -#define GL_STENCIL_INDEX16 0x8D49 -#define GL_STENCIL_INDEX4 0x8D47 -#define GL_STENCIL_INDEX8 0x8D48 -#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 -#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 -#define GL_STENCIL_REF 0x0B97 -#define GL_STENCIL_TEST 0x0B90 -#define GL_STENCIL_VALUE_MASK 0x0B93 -#define GL_STENCIL_WRITEMASK 0x0B98 -#define GL_STEREO 0x0C33 -#define GL_STREAM_COPY 0x88E2 -#define GL_STREAM_DRAW 0x88E0 -#define GL_STREAM_READ 0x88E1 -#define GL_SUBPIXEL_BITS 0x0D50 -#define GL_SUBTRACT 0x84E7 -#define GL_SYNC_CONDITION 0x9113 -#define GL_SYNC_FENCE 0x9116 -#define GL_SYNC_FLAGS 0x9115 -#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 -#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 -#define GL_SYNC_STATUS 0x9114 -#define GL_T 0x2001 -#define GL_T2F_C3F_V3F 0x2A2A -#define GL_T2F_C4F_N3F_V3F 0x2A2C -#define GL_T2F_C4UB_V3F 0x2A29 -#define GL_T2F_N3F_V3F 0x2A2B -#define GL_T2F_V3F 0x2A27 -#define GL_T4F_C4F_N3F_V4F 0x2A2D -#define GL_T4F_V4F 0x2A28 -#define GL_TEXTURE 0x1702 -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE_1D 0x0DE0 -#define GL_TEXTURE_1D_ARRAY 0x8C18 -#define GL_TEXTURE_2D 0x0DE1 -#define GL_TEXTURE_2D_ARRAY 0x8C1A -#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 -#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 -#define GL_TEXTURE_3D 0x806F -#define GL_TEXTURE_ALPHA_SIZE 0x805F -#define GL_TEXTURE_ALPHA_TYPE 0x8C13 -#define GL_TEXTURE_BASE_LEVEL 0x813C -#define GL_TEXTURE_BINDING_1D 0x8068 -#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C -#define GL_TEXTURE_BINDING_2D 0x8069 -#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D -#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 -#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 -#define GL_TEXTURE_BINDING_3D 0x806A -#define GL_TEXTURE_BINDING_BUFFER 0x8C2C -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 -#define GL_TEXTURE_BIT 0x00040000 -#define GL_TEXTURE_BLUE_SIZE 0x805E -#define GL_TEXTURE_BLUE_TYPE 0x8C12 -#define GL_TEXTURE_BORDER 0x1005 -#define GL_TEXTURE_BORDER_COLOR 0x1004 -#define GL_TEXTURE_BUFFER 0x8C2A -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D -#define GL_TEXTURE_COMPARE_FUNC 0x884D -#define GL_TEXTURE_COMPARE_MODE 0x884C -#define GL_TEXTURE_COMPONENTS 0x1003 -#define GL_TEXTURE_COMPRESSED 0x86A1 -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 -#define GL_TEXTURE_COMPRESSION_HINT 0x84EF -#define GL_TEXTURE_COORD_ARRAY 0x8078 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A -#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 -#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 -#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A -#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F -#define GL_TEXTURE_DEPTH 0x8071 -#define GL_TEXTURE_DEPTH_SIZE 0x884A -#define GL_TEXTURE_DEPTH_TYPE 0x8C16 -#define GL_TEXTURE_ENV 0x2300 -#define GL_TEXTURE_ENV_COLOR 0x2201 -#define GL_TEXTURE_ENV_MODE 0x2200 -#define GL_TEXTURE_FILTER_CONTROL 0x8500 -#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 -#define GL_TEXTURE_GEN_MODE 0x2500 -#define GL_TEXTURE_GEN_Q 0x0C63 -#define GL_TEXTURE_GEN_R 0x0C62 -#define GL_TEXTURE_GEN_S 0x0C60 -#define GL_TEXTURE_GEN_T 0x0C61 -#define GL_TEXTURE_GREEN_SIZE 0x805D -#define GL_TEXTURE_GREEN_TYPE 0x8C11 -#define GL_TEXTURE_HEIGHT 0x1001 -#define GL_TEXTURE_INTENSITY_SIZE 0x8061 -#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 -#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 -#define GL_TEXTURE_LOD_BIAS 0x8501 -#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 -#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 -#define GL_TEXTURE_MAG_FILTER 0x2800 -#define GL_TEXTURE_MATRIX 0x0BA8 -#define GL_TEXTURE_MAX_LEVEL 0x813D -#define GL_TEXTURE_MAX_LOD 0x813B -#define GL_TEXTURE_MIN_FILTER 0x2801 -#define GL_TEXTURE_MIN_LOD 0x813A -#define GL_TEXTURE_PRIORITY 0x8066 -#define GL_TEXTURE_RECTANGLE 0x84F5 -#define GL_TEXTURE_RED_SIZE 0x805C -#define GL_TEXTURE_RED_TYPE 0x8C10 -#define GL_TEXTURE_RESIDENT 0x8067 -#define GL_TEXTURE_SAMPLES 0x9106 -#define GL_TEXTURE_SHARED_SIZE 0x8C3F -#define GL_TEXTURE_STACK_DEPTH 0x0BA5 -#define GL_TEXTURE_STENCIL_SIZE 0x88F1 -#define GL_TEXTURE_SWIZZLE_A 0x8E45 -#define GL_TEXTURE_SWIZZLE_B 0x8E44 -#define GL_TEXTURE_SWIZZLE_G 0x8E43 -#define GL_TEXTURE_SWIZZLE_R 0x8E42 -#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 -#define GL_TEXTURE_WIDTH 0x1000 -#define GL_TEXTURE_WRAP_R 0x8072 -#define GL_TEXTURE_WRAP_S 0x2802 -#define GL_TEXTURE_WRAP_T 0x2803 -#define GL_TIMEOUT_EXPIRED 0x911B -#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF -#define GL_TIMESTAMP 0x8E28 -#define GL_TIME_ELAPSED 0x88BF -#define GL_TRANSFORM_BIT 0x00001000 -#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 -#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 -#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 -#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 -#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 -#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 -#define GL_TRIANGLES 0x0004 -#define GL_TRIANGLES_ADJACENCY 0x000C -#define GL_TRIANGLE_FAN 0x0006 -#define GL_TRIANGLE_STRIP 0x0005 -#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D -#define GL_TRUE 1 -#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C -#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 -#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 -#define GL_UNIFORM_BLOCK_BINDING 0x8A3F -#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 -#define GL_UNIFORM_BLOCK_INDEX 0x8A3A -#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 -#define GL_UNIFORM_BUFFER 0x8A11 -#define GL_UNIFORM_BUFFER_BINDING 0x8A28 -#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 -#define GL_UNIFORM_BUFFER_SIZE 0x8A2A -#define GL_UNIFORM_BUFFER_START 0x8A29 -#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E -#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D -#define GL_UNIFORM_NAME_LENGTH 0x8A39 -#define GL_UNIFORM_OFFSET 0x8A3B -#define GL_UNIFORM_SIZE 0x8A38 -#define GL_UNIFORM_TYPE 0x8A37 -#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 -#define GL_UNPACK_ALIGNMENT 0x0CF5 -#define GL_UNPACK_IMAGE_HEIGHT 0x806E -#define GL_UNPACK_LSB_FIRST 0x0CF1 -#define GL_UNPACK_ROW_LENGTH 0x0CF2 -#define GL_UNPACK_SKIP_IMAGES 0x806D -#define GL_UNPACK_SKIP_PIXELS 0x0CF4 -#define GL_UNPACK_SKIP_ROWS 0x0CF3 -#define GL_UNPACK_SWAP_BYTES 0x0CF0 -#define GL_UNSIGNALED 0x9118 -#define GL_UNSIGNED_BYTE 0x1401 -#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 -#define GL_UNSIGNED_BYTE_3_3_2 0x8032 -#define GL_UNSIGNED_INT 0x1405 -#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B -#define GL_UNSIGNED_INT_10_10_10_2 0x8036 -#define GL_UNSIGNED_INT_24_8 0x84FA -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 -#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E -#define GL_UNSIGNED_INT_8_8_8_8 0x8035 -#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 -#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 -#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 -#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 -#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 -#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A -#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D -#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 -#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 -#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 -#define GL_UNSIGNED_INT_VEC2 0x8DC6 -#define GL_UNSIGNED_INT_VEC3 0x8DC7 -#define GL_UNSIGNED_INT_VEC4 0x8DC8 -#define GL_UNSIGNED_NORMALIZED 0x8C17 -#define GL_UNSIGNED_SHORT 0x1403 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 -#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 -#define GL_UPPER_LEFT 0x8CA2 -#define GL_V2F 0x2A20 -#define GL_V3F 0x2A21 -#define GL_VALIDATE_STATUS 0x8B83 -#define GL_VENDOR 0x1F00 -#define GL_VERSION 0x1F02 -#define GL_VERTEX_ARRAY 0x8074 -#define GL_VERTEX_ARRAY_BINDING 0x85B5 -#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 -#define GL_VERTEX_ARRAY_POINTER 0x808E -#define GL_VERTEX_ARRAY_SIZE 0x807A -#define GL_VERTEX_ARRAY_STRIDE 0x807C -#define GL_VERTEX_ARRAY_TYPE 0x807B -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A -#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 -#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 -#define GL_VERTEX_SHADER 0x8B31 -#define GL_VIEWPORT 0x0BA2 -#define GL_VIEWPORT_BIT 0x00000800 -#define GL_WAIT_FAILED 0x911D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E -#define GL_WRITE_ONLY 0x88B9 -#define GL_XOR 0x1506 -#define GL_ZERO 0 -#define GL_ZOOM_X 0x0D16 -#define GL_ZOOM_Y 0x0D17 - - -#ifndef __khrplatform_h_ -#define __khrplatform_h_ - -/* -** Copyright (c) 2008-2018 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ - -/* Khronos platform-specific types and definitions. - * - * The master copy of khrplatform.h is maintained in the Khronos EGL - * Registry repository at https://github.com/KhronosGroup/EGL-Registry - * The last semantic modification to khrplatform.h was at commit ID: - * 67a3e0864c2d75ea5287b9f3d2eb74a745936692 - * - * Adopters may modify this file to suit their platform. Adopters are - * encouraged to submit platform specific modifications to the Khronos - * group so that they can be included in future versions of this file. - * Please submit changes by filing pull requests or issues on - * the EGL Registry repository linked above. - * - * - * See the Implementer's Guidelines for information about where this file - * should be located on your system and for more details of its use: - * http://www.khronos.org/registry/implementers_guide.pdf - * - * This file should be included as - * #include - * by Khronos client API header files that use its types and defines. - * - * The types in khrplatform.h should only be used to define API-specific types. - * - * Types defined in khrplatform.h: - * khronos_int8_t signed 8 bit - * khronos_uint8_t unsigned 8 bit - * khronos_int16_t signed 16 bit - * khronos_uint16_t unsigned 16 bit - * khronos_int32_t signed 32 bit - * khronos_uint32_t unsigned 32 bit - * khronos_int64_t signed 64 bit - * khronos_uint64_t unsigned 64 bit - * khronos_intptr_t signed same number of bits as a pointer - * khronos_uintptr_t unsigned same number of bits as a pointer - * khronos_ssize_t signed size - * khronos_usize_t unsigned size - * khronos_float_t signed 32 bit floating point - * khronos_time_ns_t unsigned 64 bit time in nanoseconds - * khronos_utime_nanoseconds_t unsigned time interval or absolute time in - * nanoseconds - * khronos_stime_nanoseconds_t signed time interval in nanoseconds - * khronos_boolean_enum_t enumerated boolean type. This should - * only be used as a base type when a client API's boolean type is - * an enum. Client APIs which use an integer or other type for - * booleans cannot use this as the base type for their boolean. - * - * Tokens defined in khrplatform.h: - * - * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values. - * - * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. - * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. - * - * Calling convention macros defined in this file: - * KHRONOS_APICALL - * KHRONOS_GLAD_API_PTR - * KHRONOS_APIATTRIBUTES - * - * These may be used in function prototypes as: - * - * KHRONOS_APICALL void KHRONOS_GLAD_API_PTR funcname( - * int arg1, - * int arg2) KHRONOS_APIATTRIBUTES; - */ - -#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC) -# define KHRONOS_STATIC 1 -#endif - -/*------------------------------------------------------------------------- - * Definition of KHRONOS_APICALL - *------------------------------------------------------------------------- - * This precedes the return type of the function in the function prototype. - */ -#if defined(KHRONOS_STATIC) - /* If the preprocessor constant KHRONOS_STATIC is defined, make the - * header compatible with static linking. */ -# define KHRONOS_APICALL -#elif defined(_WIN32) -# define KHRONOS_APICALL __declspec(dllimport) -#elif defined (__SYMBIAN32__) -# define KHRONOS_APICALL IMPORT_C -#elif defined(__ANDROID__) -# define KHRONOS_APICALL __attribute__((visibility("default"))) -#else -# define KHRONOS_APICALL -#endif - -/*------------------------------------------------------------------------- - * Definition of KHRONOS_GLAD_API_PTR - *------------------------------------------------------------------------- - * This follows the return type of the function and precedes the function - * name in the function prototype. - */ -#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) - /* Win32 but not WinCE */ -# define KHRONOS_GLAD_API_PTR __stdcall -#else -# define KHRONOS_GLAD_API_PTR -#endif - -/*------------------------------------------------------------------------- - * Definition of KHRONOS_APIATTRIBUTES - *------------------------------------------------------------------------- - * This follows the closing parenthesis of the function prototype arguments. - */ -#if defined (__ARMCC_2__) -#define KHRONOS_APIATTRIBUTES __softfp -#else -#define KHRONOS_APIATTRIBUTES -#endif - -/*------------------------------------------------------------------------- - * basic type definitions - *-----------------------------------------------------------------------*/ -#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__) - - -/* - * Using - */ -#include -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(__VMS ) || defined(__sgi) - -/* - * Using - */ -#include -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(_WIN32) && !defined(__SCITECH_SNAP__) - -/* - * Win32 - */ -typedef __int32 khronos_int32_t; -typedef unsigned __int32 khronos_uint32_t; -typedef __int64 khronos_int64_t; -typedef unsigned __int64 khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(__sun__) || defined(__digital__) - -/* - * Sun or Digital - */ -typedef int khronos_int32_t; -typedef unsigned int khronos_uint32_t; -#if defined(__arch64__) || defined(_LP64) -typedef long int khronos_int64_t; -typedef unsigned long int khronos_uint64_t; -#else -typedef long long int khronos_int64_t; -typedef unsigned long long int khronos_uint64_t; -#endif /* __arch64__ */ -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif 0 - -/* - * Hypothetical platform with no float or int64 support - */ -typedef int khronos_int32_t; -typedef unsigned int khronos_uint32_t; -#define KHRONOS_SUPPORT_INT64 0 -#define KHRONOS_SUPPORT_FLOAT 0 - -#else - -/* - * Generic fallback - */ -#include -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#endif - - -/* - * Types that are (so far) the same on all platforms - */ -typedef signed char khronos_int8_t; -typedef unsigned char khronos_uint8_t; -typedef signed short int khronos_int16_t; -typedef unsigned short int khronos_uint16_t; - -/* - * Types that differ between LLP64 and LP64 architectures - in LLP64, - * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears - * to be the only LLP64 architecture in current use. - */ -#ifdef _WIN64 -typedef signed long long int khronos_intptr_t; -typedef unsigned long long int khronos_uintptr_t; -typedef signed long long int khronos_ssize_t; -typedef unsigned long long int khronos_usize_t; -#else -typedef signed long int khronos_intptr_t; -typedef unsigned long int khronos_uintptr_t; -typedef signed long int khronos_ssize_t; -typedef unsigned long int khronos_usize_t; -#endif - -#if KHRONOS_SUPPORT_FLOAT -/* - * Float type - */ -typedef float khronos_float_t; -#endif - -#if KHRONOS_SUPPORT_INT64 -/* Time types - * - * These types can be used to represent a time interval in nanoseconds or - * an absolute Unadjusted System Time. Unadjusted System Time is the number - * of nanoseconds since some arbitrary system event (e.g. since the last - * time the system booted). The Unadjusted System Time is an unsigned - * 64 bit value that wraps back to 0 every 584 years. Time intervals - * may be either signed or unsigned. - */ -typedef khronos_uint64_t khronos_utime_nanoseconds_t; -typedef khronos_int64_t khronos_stime_nanoseconds_t; -#endif - -/* - * Dummy value used to pad enum types to 32 bits. - */ -#ifndef KHRONOS_MAX_ENUM -#define KHRONOS_MAX_ENUM 0x7FFFFFFF -#endif - -/* - * Enumerated boolean type - * - * Values other than zero should be considered to be true. Therefore - * comparisons should not be made against KHRONOS_TRUE. - */ -typedef enum { - KHRONOS_FALSE = 0, - KHRONOS_TRUE = 1, - KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM -} khronos_boolean_enum_t; - -#endif /* __khrplatform_h_ */ - -typedef unsigned int GLenum; - -typedef unsigned char GLboolean; - -typedef unsigned int GLbitfield; - -typedef void GLvoid; - -typedef khronos_int8_t GLbyte; - -typedef khronos_uint8_t GLubyte; - -typedef khronos_int16_t GLshort; - -typedef khronos_uint16_t GLushort; - -typedef int GLint; - -typedef unsigned int GLuint; - -typedef khronos_int32_t GLclampx; - -typedef int GLsizei; - -typedef khronos_float_t GLfloat; - -typedef khronos_float_t GLclampf; - -typedef double GLdouble; - -typedef double GLclampd; - -typedef void *GLeglClientBufferEXT; - -typedef void *GLeglImageOES; - -typedef char GLchar; - -typedef char GLcharARB; - -#ifdef __APPLE__ -typedef void *GLhandleARB; -#else -typedef unsigned int GLhandleARB; -#endif - -typedef khronos_uint16_t GLhalf; - -typedef khronos_uint16_t GLhalfARB; - -typedef khronos_int32_t GLfixed; - -#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) -typedef khronos_intptr_t GLintptr; -#else -typedef khronos_intptr_t GLintptr; -#endif - -#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) -typedef khronos_intptr_t GLintptrARB; -#else -typedef khronos_intptr_t GLintptrARB; -#endif - -#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) -typedef khronos_ssize_t GLsizeiptr; -#else -typedef khronos_ssize_t GLsizeiptr; -#endif - -#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) -typedef khronos_ssize_t GLsizeiptrARB; -#else -typedef khronos_ssize_t GLsizeiptrARB; -#endif - -typedef khronos_int64_t GLint64; - -typedef khronos_int64_t GLint64EXT; - -typedef khronos_uint64_t GLuint64; - -typedef khronos_uint64_t GLuint64EXT; - -typedef struct __GLsync *GLsync; - -struct _cl_context; - -struct _cl_event; - -typedef void (GLAD_API_PTR *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); - -typedef void (GLAD_API_PTR *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); - -typedef void (GLAD_API_PTR *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); - -typedef void (GLAD_API_PTR *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam); - -typedef unsigned short GLhalfNV; - -typedef GLintptr GLvdpauSurfaceNV; - -typedef void (GLAD_API_PTR *GLVULKANPROCNV)(void); - - - -#define GL_VERSION_1_0 1 -GLAD_API_CALL int GLAD_GL_VERSION_1_0; -#define GL_VERSION_1_1 1 -GLAD_API_CALL int GLAD_GL_VERSION_1_1; -#define GL_VERSION_1_2 1 -GLAD_API_CALL int GLAD_GL_VERSION_1_2; -#define GL_VERSION_1_3 1 -GLAD_API_CALL int GLAD_GL_VERSION_1_3; -#define GL_VERSION_1_4 1 -GLAD_API_CALL int GLAD_GL_VERSION_1_4; -#define GL_VERSION_1_5 1 -GLAD_API_CALL int GLAD_GL_VERSION_1_5; -#define GL_VERSION_2_0 1 -GLAD_API_CALL int GLAD_GL_VERSION_2_0; -#define GL_VERSION_2_1 1 -GLAD_API_CALL int GLAD_GL_VERSION_2_1; -#define GL_VERSION_3_0 1 -GLAD_API_CALL int GLAD_GL_VERSION_3_0; -#define GL_VERSION_3_1 1 -GLAD_API_CALL int GLAD_GL_VERSION_3_1; -#define GL_VERSION_3_2 1 -GLAD_API_CALL int GLAD_GL_VERSION_3_2; -#define GL_VERSION_3_3 1 -GLAD_API_CALL int GLAD_GL_VERSION_3_3; -#define GL_ARB_multisample 1 -GLAD_API_CALL int GLAD_GL_ARB_multisample; -#define GL_ARB_robustness 1 -GLAD_API_CALL int GLAD_GL_ARB_robustness; -#define GL_KHR_debug 1 -GLAD_API_CALL int GLAD_GL_KHR_debug; - - -typedef void (GLAD_API_PTR *PFNGLACCUMPROC)(GLenum op, GLfloat value); -typedef void (GLAD_API_PTR *PFNGLACTIVETEXTUREPROC)(GLenum texture); -typedef void (GLAD_API_PTR *PFNGLALPHAFUNCPROC)(GLenum func, GLfloat ref); -typedef GLboolean (GLAD_API_PTR *PFNGLARETEXTURESRESIDENTPROC)(GLsizei n, const GLuint * textures, GLboolean * residences); -typedef void (GLAD_API_PTR *PFNGLARRAYELEMENTPROC)(GLint i); -typedef void (GLAD_API_PTR *PFNGLATTACHSHADERPROC)(GLuint program, GLuint shader); -typedef void (GLAD_API_PTR *PFNGLBEGINPROC)(GLenum mode); -typedef void (GLAD_API_PTR *PFNGLBEGINCONDITIONALRENDERPROC)(GLuint id, GLenum mode); -typedef void (GLAD_API_PTR *PFNGLBEGINQUERYPROC)(GLenum target, GLuint id); -typedef void (GLAD_API_PTR *PFNGLBEGINTRANSFORMFEEDBACKPROC)(GLenum primitiveMode); -typedef void (GLAD_API_PTR *PFNGLBINDATTRIBLOCATIONPROC)(GLuint program, GLuint index, const GLchar * name); -typedef void (GLAD_API_PTR *PFNGLBINDBUFFERPROC)(GLenum target, GLuint buffer); -typedef void (GLAD_API_PTR *PFNGLBINDBUFFERBASEPROC)(GLenum target, GLuint index, GLuint buffer); -typedef void (GLAD_API_PTR *PFNGLBINDBUFFERRANGEPROC)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (GLAD_API_PTR *PFNGLBINDFRAGDATALOCATIONPROC)(GLuint program, GLuint color, const GLchar * name); -typedef void (GLAD_API_PTR *PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)(GLuint program, GLuint colorNumber, GLuint index, const GLchar * name); -typedef void (GLAD_API_PTR *PFNGLBINDFRAMEBUFFERPROC)(GLenum target, GLuint framebuffer); -typedef void (GLAD_API_PTR *PFNGLBINDRENDERBUFFERPROC)(GLenum target, GLuint renderbuffer); -typedef void (GLAD_API_PTR *PFNGLBINDSAMPLERPROC)(GLuint unit, GLuint sampler); -typedef void (GLAD_API_PTR *PFNGLBINDTEXTUREPROC)(GLenum target, GLuint texture); -typedef void (GLAD_API_PTR *PFNGLBINDVERTEXARRAYPROC)(GLuint array); -typedef void (GLAD_API_PTR *PFNGLBITMAPPROC)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap); -typedef void (GLAD_API_PTR *PFNGLBLENDCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -typedef void (GLAD_API_PTR *PFNGLBLENDEQUATIONPROC)(GLenum mode); -typedef void (GLAD_API_PTR *PFNGLBLENDEQUATIONSEPARATEPROC)(GLenum modeRGB, GLenum modeAlpha); -typedef void (GLAD_API_PTR *PFNGLBLENDFUNCPROC)(GLenum sfactor, GLenum dfactor); -typedef void (GLAD_API_PTR *PFNGLBLENDFUNCSEPARATEPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -typedef void (GLAD_API_PTR *PFNGLBLITFRAMEBUFFERPROC)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -typedef void (GLAD_API_PTR *PFNGLBUFFERDATAPROC)(GLenum target, GLsizeiptr size, const void * data, GLenum usage); -typedef void (GLAD_API_PTR *PFNGLBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, const void * data); -typedef void (GLAD_API_PTR *PFNGLCALLLISTPROC)(GLuint list); -typedef void (GLAD_API_PTR *PFNGLCALLLISTSPROC)(GLsizei n, GLenum type, const void * lists); -typedef GLenum (GLAD_API_PTR *PFNGLCHECKFRAMEBUFFERSTATUSPROC)(GLenum target); -typedef void (GLAD_API_PTR *PFNGLCLAMPCOLORPROC)(GLenum target, GLenum clamp); -typedef void (GLAD_API_PTR *PFNGLCLEARPROC)(GLbitfield mask); -typedef void (GLAD_API_PTR *PFNGLCLEARACCUMPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERFIPROC)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); -typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERFVPROC)(GLenum buffer, GLint drawbuffer, const GLfloat * value); -typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERIVPROC)(GLenum buffer, GLint drawbuffer, const GLint * value); -typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERUIVPROC)(GLenum buffer, GLint drawbuffer, const GLuint * value); -typedef void (GLAD_API_PTR *PFNGLCLEARCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -typedef void (GLAD_API_PTR *PFNGLCLEARDEPTHPROC)(GLdouble depth); -typedef void (GLAD_API_PTR *PFNGLCLEARINDEXPROC)(GLfloat c); -typedef void (GLAD_API_PTR *PFNGLCLEARSTENCILPROC)(GLint s); -typedef void (GLAD_API_PTR *PFNGLCLIENTACTIVETEXTUREPROC)(GLenum texture); -typedef GLenum (GLAD_API_PTR *PFNGLCLIENTWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout); -typedef void (GLAD_API_PTR *PFNGLCLIPPLANEPROC)(GLenum plane, const GLdouble * equation); -typedef void (GLAD_API_PTR *PFNGLCOLOR3BPROC)(GLbyte red, GLbyte green, GLbyte blue); -typedef void (GLAD_API_PTR *PFNGLCOLOR3BVPROC)(const GLbyte * v); -typedef void (GLAD_API_PTR *PFNGLCOLOR3DPROC)(GLdouble red, GLdouble green, GLdouble blue); -typedef void (GLAD_API_PTR *PFNGLCOLOR3DVPROC)(const GLdouble * v); -typedef void (GLAD_API_PTR *PFNGLCOLOR3FPROC)(GLfloat red, GLfloat green, GLfloat blue); -typedef void (GLAD_API_PTR *PFNGLCOLOR3FVPROC)(const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLCOLOR3IPROC)(GLint red, GLint green, GLint blue); -typedef void (GLAD_API_PTR *PFNGLCOLOR3IVPROC)(const GLint * v); -typedef void (GLAD_API_PTR *PFNGLCOLOR3SPROC)(GLshort red, GLshort green, GLshort blue); -typedef void (GLAD_API_PTR *PFNGLCOLOR3SVPROC)(const GLshort * v); -typedef void (GLAD_API_PTR *PFNGLCOLOR3UBPROC)(GLubyte red, GLubyte green, GLubyte blue); -typedef void (GLAD_API_PTR *PFNGLCOLOR3UBVPROC)(const GLubyte * v); -typedef void (GLAD_API_PTR *PFNGLCOLOR3UIPROC)(GLuint red, GLuint green, GLuint blue); -typedef void (GLAD_API_PTR *PFNGLCOLOR3UIVPROC)(const GLuint * v); -typedef void (GLAD_API_PTR *PFNGLCOLOR3USPROC)(GLushort red, GLushort green, GLushort blue); -typedef void (GLAD_API_PTR *PFNGLCOLOR3USVPROC)(const GLushort * v); -typedef void (GLAD_API_PTR *PFNGLCOLOR4BPROC)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); -typedef void (GLAD_API_PTR *PFNGLCOLOR4BVPROC)(const GLbyte * v); -typedef void (GLAD_API_PTR *PFNGLCOLOR4DPROC)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); -typedef void (GLAD_API_PTR *PFNGLCOLOR4DVPROC)(const GLdouble * v); -typedef void (GLAD_API_PTR *PFNGLCOLOR4FPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -typedef void (GLAD_API_PTR *PFNGLCOLOR4FVPROC)(const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLCOLOR4IPROC)(GLint red, GLint green, GLint blue, GLint alpha); -typedef void (GLAD_API_PTR *PFNGLCOLOR4IVPROC)(const GLint * v); -typedef void (GLAD_API_PTR *PFNGLCOLOR4SPROC)(GLshort red, GLshort green, GLshort blue, GLshort alpha); -typedef void (GLAD_API_PTR *PFNGLCOLOR4SVPROC)(const GLshort * v); -typedef void (GLAD_API_PTR *PFNGLCOLOR4UBPROC)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); -typedef void (GLAD_API_PTR *PFNGLCOLOR4UBVPROC)(const GLubyte * v); -typedef void (GLAD_API_PTR *PFNGLCOLOR4UIPROC)(GLuint red, GLuint green, GLuint blue, GLuint alpha); -typedef void (GLAD_API_PTR *PFNGLCOLOR4UIVPROC)(const GLuint * v); -typedef void (GLAD_API_PTR *PFNGLCOLOR4USPROC)(GLushort red, GLushort green, GLushort blue, GLushort alpha); -typedef void (GLAD_API_PTR *PFNGLCOLOR4USVPROC)(const GLushort * v); -typedef void (GLAD_API_PTR *PFNGLCOLORMASKPROC)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -typedef void (GLAD_API_PTR *PFNGLCOLORMASKIPROC)(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -typedef void (GLAD_API_PTR *PFNGLCOLORMATERIALPROC)(GLenum face, GLenum mode); -typedef void (GLAD_API_PTR *PFNGLCOLORP3UIPROC)(GLenum type, GLuint color); -typedef void (GLAD_API_PTR *PFNGLCOLORP3UIVPROC)(GLenum type, const GLuint * color); -typedef void (GLAD_API_PTR *PFNGLCOLORP4UIPROC)(GLenum type, GLuint color); -typedef void (GLAD_API_PTR *PFNGLCOLORP4UIVPROC)(GLenum type, const GLuint * color); -typedef void (GLAD_API_PTR *PFNGLCOLORPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void * pointer); -typedef void (GLAD_API_PTR *PFNGLCOMPILESHADERPROC)(GLuint shader); -typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXIMAGE1DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void * data); -typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void * data); -typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXIMAGE3DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * data); -typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void * data); -typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void * data); -typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * data); -typedef void (GLAD_API_PTR *PFNGLCOPYBUFFERSUBDATAPROC)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -typedef void (GLAD_API_PTR *PFNGLCOPYPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); -typedef void (GLAD_API_PTR *PFNGLCOPYTEXIMAGE1DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (GLAD_API_PTR *PFNGLCOPYTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (GLAD_API_PTR *PFNGLCOPYTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (GLAD_API_PTR *PFNGLCOPYTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAD_API_PTR *PFNGLCOPYTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef GLuint (GLAD_API_PTR *PFNGLCREATEPROGRAMPROC)(void); -typedef GLuint (GLAD_API_PTR *PFNGLCREATESHADERPROC)(GLenum type); -typedef void (GLAD_API_PTR *PFNGLCULLFACEPROC)(GLenum mode); -typedef void (GLAD_API_PTR *PFNGLDEBUGMESSAGECALLBACKPROC)(GLDEBUGPROC callback, const void * userParam); -typedef void (GLAD_API_PTR *PFNGLDEBUGMESSAGECONTROLPROC)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled); -typedef void (GLAD_API_PTR *PFNGLDEBUGMESSAGEINSERTPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * buf); -typedef void (GLAD_API_PTR *PFNGLDELETEBUFFERSPROC)(GLsizei n, const GLuint * buffers); -typedef void (GLAD_API_PTR *PFNGLDELETEFRAMEBUFFERSPROC)(GLsizei n, const GLuint * framebuffers); -typedef void (GLAD_API_PTR *PFNGLDELETELISTSPROC)(GLuint list, GLsizei range); -typedef void (GLAD_API_PTR *PFNGLDELETEPROGRAMPROC)(GLuint program); -typedef void (GLAD_API_PTR *PFNGLDELETEQUERIESPROC)(GLsizei n, const GLuint * ids); -typedef void (GLAD_API_PTR *PFNGLDELETERENDERBUFFERSPROC)(GLsizei n, const GLuint * renderbuffers); -typedef void (GLAD_API_PTR *PFNGLDELETESAMPLERSPROC)(GLsizei count, const GLuint * samplers); -typedef void (GLAD_API_PTR *PFNGLDELETESHADERPROC)(GLuint shader); -typedef void (GLAD_API_PTR *PFNGLDELETESYNCPROC)(GLsync sync); -typedef void (GLAD_API_PTR *PFNGLDELETETEXTURESPROC)(GLsizei n, const GLuint * textures); -typedef void (GLAD_API_PTR *PFNGLDELETEVERTEXARRAYSPROC)(GLsizei n, const GLuint * arrays); -typedef void (GLAD_API_PTR *PFNGLDEPTHFUNCPROC)(GLenum func); -typedef void (GLAD_API_PTR *PFNGLDEPTHMASKPROC)(GLboolean flag); -typedef void (GLAD_API_PTR *PFNGLDEPTHRANGEPROC)(GLdouble n, GLdouble f); -typedef void (GLAD_API_PTR *PFNGLDETACHSHADERPROC)(GLuint program, GLuint shader); -typedef void (GLAD_API_PTR *PFNGLDISABLEPROC)(GLenum cap); -typedef void (GLAD_API_PTR *PFNGLDISABLECLIENTSTATEPROC)(GLenum array); -typedef void (GLAD_API_PTR *PFNGLDISABLEVERTEXATTRIBARRAYPROC)(GLuint index); -typedef void (GLAD_API_PTR *PFNGLDISABLEIPROC)(GLenum target, GLuint index); -typedef void (GLAD_API_PTR *PFNGLDRAWARRAYSPROC)(GLenum mode, GLint first, GLsizei count); -typedef void (GLAD_API_PTR *PFNGLDRAWARRAYSINSTANCEDPROC)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount); -typedef void (GLAD_API_PTR *PFNGLDRAWBUFFERPROC)(GLenum buf); -typedef void (GLAD_API_PTR *PFNGLDRAWBUFFERSPROC)(GLsizei n, const GLenum * bufs); -typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices); -typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSBASEVERTEXPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLint basevertex); -typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSINSTANCEDPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount); -typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount, GLint basevertex); -typedef void (GLAD_API_PTR *PFNGLDRAWPIXELSPROC)(GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels); -typedef void (GLAD_API_PTR *PFNGLDRAWRANGEELEMENTSPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices); -typedef void (GLAD_API_PTR *PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices, GLint basevertex); -typedef void (GLAD_API_PTR *PFNGLEDGEFLAGPROC)(GLboolean flag); -typedef void (GLAD_API_PTR *PFNGLEDGEFLAGPOINTERPROC)(GLsizei stride, const void * pointer); -typedef void (GLAD_API_PTR *PFNGLEDGEFLAGVPROC)(const GLboolean * flag); -typedef void (GLAD_API_PTR *PFNGLENABLEPROC)(GLenum cap); -typedef void (GLAD_API_PTR *PFNGLENABLECLIENTSTATEPROC)(GLenum array); -typedef void (GLAD_API_PTR *PFNGLENABLEVERTEXATTRIBARRAYPROC)(GLuint index); -typedef void (GLAD_API_PTR *PFNGLENABLEIPROC)(GLenum target, GLuint index); -typedef void (GLAD_API_PTR *PFNGLENDPROC)(void); -typedef void (GLAD_API_PTR *PFNGLENDCONDITIONALRENDERPROC)(void); -typedef void (GLAD_API_PTR *PFNGLENDLISTPROC)(void); -typedef void (GLAD_API_PTR *PFNGLENDQUERYPROC)(GLenum target); -typedef void (GLAD_API_PTR *PFNGLENDTRANSFORMFEEDBACKPROC)(void); -typedef void (GLAD_API_PTR *PFNGLEVALCOORD1DPROC)(GLdouble u); -typedef void (GLAD_API_PTR *PFNGLEVALCOORD1DVPROC)(const GLdouble * u); -typedef void (GLAD_API_PTR *PFNGLEVALCOORD1FPROC)(GLfloat u); -typedef void (GLAD_API_PTR *PFNGLEVALCOORD1FVPROC)(const GLfloat * u); -typedef void (GLAD_API_PTR *PFNGLEVALCOORD2DPROC)(GLdouble u, GLdouble v); -typedef void (GLAD_API_PTR *PFNGLEVALCOORD2DVPROC)(const GLdouble * u); -typedef void (GLAD_API_PTR *PFNGLEVALCOORD2FPROC)(GLfloat u, GLfloat v); -typedef void (GLAD_API_PTR *PFNGLEVALCOORD2FVPROC)(const GLfloat * u); -typedef void (GLAD_API_PTR *PFNGLEVALMESH1PROC)(GLenum mode, GLint i1, GLint i2); -typedef void (GLAD_API_PTR *PFNGLEVALMESH2PROC)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); -typedef void (GLAD_API_PTR *PFNGLEVALPOINT1PROC)(GLint i); -typedef void (GLAD_API_PTR *PFNGLEVALPOINT2PROC)(GLint i, GLint j); -typedef void (GLAD_API_PTR *PFNGLFEEDBACKBUFFERPROC)(GLsizei size, GLenum type, GLfloat * buffer); -typedef GLsync (GLAD_API_PTR *PFNGLFENCESYNCPROC)(GLenum condition, GLbitfield flags); -typedef void (GLAD_API_PTR *PFNGLFINISHPROC)(void); -typedef void (GLAD_API_PTR *PFNGLFLUSHPROC)(void); -typedef void (GLAD_API_PTR *PFNGLFLUSHMAPPEDBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length); -typedef void (GLAD_API_PTR *PFNGLFOGCOORDPOINTERPROC)(GLenum type, GLsizei stride, const void * pointer); -typedef void (GLAD_API_PTR *PFNGLFOGCOORDDPROC)(GLdouble coord); -typedef void (GLAD_API_PTR *PFNGLFOGCOORDDVPROC)(const GLdouble * coord); -typedef void (GLAD_API_PTR *PFNGLFOGCOORDFPROC)(GLfloat coord); -typedef void (GLAD_API_PTR *PFNGLFOGCOORDFVPROC)(const GLfloat * coord); -typedef void (GLAD_API_PTR *PFNGLFOGFPROC)(GLenum pname, GLfloat param); -typedef void (GLAD_API_PTR *PFNGLFOGFVPROC)(GLenum pname, const GLfloat * params); -typedef void (GLAD_API_PTR *PFNGLFOGIPROC)(GLenum pname, GLint param); -typedef void (GLAD_API_PTR *PFNGLFOGIVPROC)(GLenum pname, const GLint * params); -typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERRENDERBUFFERPROC)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTUREPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE1DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE2DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE3DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURELAYERPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (GLAD_API_PTR *PFNGLFRONTFACEPROC)(GLenum mode); -typedef void (GLAD_API_PTR *PFNGLFRUSTUMPROC)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -typedef void (GLAD_API_PTR *PFNGLGENBUFFERSPROC)(GLsizei n, GLuint * buffers); -typedef void (GLAD_API_PTR *PFNGLGENFRAMEBUFFERSPROC)(GLsizei n, GLuint * framebuffers); -typedef GLuint (GLAD_API_PTR *PFNGLGENLISTSPROC)(GLsizei range); -typedef void (GLAD_API_PTR *PFNGLGENQUERIESPROC)(GLsizei n, GLuint * ids); -typedef void (GLAD_API_PTR *PFNGLGENRENDERBUFFERSPROC)(GLsizei n, GLuint * renderbuffers); -typedef void (GLAD_API_PTR *PFNGLGENSAMPLERSPROC)(GLsizei count, GLuint * samplers); -typedef void (GLAD_API_PTR *PFNGLGENTEXTURESPROC)(GLsizei n, GLuint * textures); -typedef void (GLAD_API_PTR *PFNGLGENVERTEXARRAYSPROC)(GLsizei n, GLuint * arrays); -typedef void (GLAD_API_PTR *PFNGLGENERATEMIPMAPPROC)(GLenum target); -typedef void (GLAD_API_PTR *PFNGLGETACTIVEATTRIBPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name); -typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name); -typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformBlockName); -typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMBLOCKIVPROC)(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint * params); -typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMNAMEPROC)(GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformName); -typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMSIVPROC)(GLuint program, GLsizei uniformCount, const GLuint * uniformIndices, GLenum pname, GLint * params); -typedef void (GLAD_API_PTR *PFNGLGETATTACHEDSHADERSPROC)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders); -typedef GLint (GLAD_API_PTR *PFNGLGETATTRIBLOCATIONPROC)(GLuint program, const GLchar * name); -typedef void (GLAD_API_PTR *PFNGLGETBOOLEANI_VPROC)(GLenum target, GLuint index, GLboolean * data); -typedef void (GLAD_API_PTR *PFNGLGETBOOLEANVPROC)(GLenum pname, GLboolean * data); -typedef void (GLAD_API_PTR *PFNGLGETBUFFERPARAMETERI64VPROC)(GLenum target, GLenum pname, GLint64 * params); -typedef void (GLAD_API_PTR *PFNGLGETBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params); -typedef void (GLAD_API_PTR *PFNGLGETBUFFERPOINTERVPROC)(GLenum target, GLenum pname, void ** params); -typedef void (GLAD_API_PTR *PFNGLGETBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, void * data); -typedef void (GLAD_API_PTR *PFNGLGETCLIPPLANEPROC)(GLenum plane, GLdouble * equation); -typedef void (GLAD_API_PTR *PFNGLGETCOMPRESSEDTEXIMAGEPROC)(GLenum target, GLint level, void * img); -typedef GLuint (GLAD_API_PTR *PFNGLGETDEBUGMESSAGELOGPROC)(GLuint count, GLsizei bufSize, GLenum * sources, GLenum * types, GLuint * ids, GLenum * severities, GLsizei * lengths, GLchar * messageLog); -typedef void (GLAD_API_PTR *PFNGLGETDOUBLEVPROC)(GLenum pname, GLdouble * data); -typedef GLenum (GLAD_API_PTR *PFNGLGETERRORPROC)(void); -typedef void (GLAD_API_PTR *PFNGLGETFLOATVPROC)(GLenum pname, GLfloat * data); -typedef GLint (GLAD_API_PTR *PFNGLGETFRAGDATAINDEXPROC)(GLuint program, const GLchar * name); -typedef GLint (GLAD_API_PTR *PFNGLGETFRAGDATALOCATIONPROC)(GLuint program, const GLchar * name); -typedef void (GLAD_API_PTR *PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLenum target, GLenum attachment, GLenum pname, GLint * params); -typedef GLenum (GLAD_API_PTR *PFNGLGETGRAPHICSRESETSTATUSARBPROC)(void); -typedef void (GLAD_API_PTR *PFNGLGETINTEGER64I_VPROC)(GLenum target, GLuint index, GLint64 * data); -typedef void (GLAD_API_PTR *PFNGLGETINTEGER64VPROC)(GLenum pname, GLint64 * data); -typedef void (GLAD_API_PTR *PFNGLGETINTEGERI_VPROC)(GLenum target, GLuint index, GLint * data); -typedef void (GLAD_API_PTR *PFNGLGETINTEGERVPROC)(GLenum pname, GLint * data); -typedef void (GLAD_API_PTR *PFNGLGETLIGHTFVPROC)(GLenum light, GLenum pname, GLfloat * params); -typedef void (GLAD_API_PTR *PFNGLGETLIGHTIVPROC)(GLenum light, GLenum pname, GLint * params); -typedef void (GLAD_API_PTR *PFNGLGETMAPDVPROC)(GLenum target, GLenum query, GLdouble * v); -typedef void (GLAD_API_PTR *PFNGLGETMAPFVPROC)(GLenum target, GLenum query, GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLGETMAPIVPROC)(GLenum target, GLenum query, GLint * v); -typedef void (GLAD_API_PTR *PFNGLGETMATERIALFVPROC)(GLenum face, GLenum pname, GLfloat * params); -typedef void (GLAD_API_PTR *PFNGLGETMATERIALIVPROC)(GLenum face, GLenum pname, GLint * params); -typedef void (GLAD_API_PTR *PFNGLGETMULTISAMPLEFVPROC)(GLenum pname, GLuint index, GLfloat * val); -typedef void (GLAD_API_PTR *PFNGLGETOBJECTLABELPROC)(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei * length, GLchar * label); -typedef void (GLAD_API_PTR *PFNGLGETOBJECTPTRLABELPROC)(const void * ptr, GLsizei bufSize, GLsizei * length, GLchar * label); -typedef void (GLAD_API_PTR *PFNGLGETPIXELMAPFVPROC)(GLenum map, GLfloat * values); -typedef void (GLAD_API_PTR *PFNGLGETPIXELMAPUIVPROC)(GLenum map, GLuint * values); -typedef void (GLAD_API_PTR *PFNGLGETPIXELMAPUSVPROC)(GLenum map, GLushort * values); -typedef void (GLAD_API_PTR *PFNGLGETPOINTERVPROC)(GLenum pname, void ** params); -typedef void (GLAD_API_PTR *PFNGLGETPOLYGONSTIPPLEPROC)(GLubyte * mask); -typedef void (GLAD_API_PTR *PFNGLGETPROGRAMINFOLOGPROC)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog); -typedef void (GLAD_API_PTR *PFNGLGETPROGRAMIVPROC)(GLuint program, GLenum pname, GLint * params); -typedef void (GLAD_API_PTR *PFNGLGETQUERYOBJECTI64VPROC)(GLuint id, GLenum pname, GLint64 * params); -typedef void (GLAD_API_PTR *PFNGLGETQUERYOBJECTIVPROC)(GLuint id, GLenum pname, GLint * params); -typedef void (GLAD_API_PTR *PFNGLGETQUERYOBJECTUI64VPROC)(GLuint id, GLenum pname, GLuint64 * params); -typedef void (GLAD_API_PTR *PFNGLGETQUERYOBJECTUIVPROC)(GLuint id, GLenum pname, GLuint * params); -typedef void (GLAD_API_PTR *PFNGLGETQUERYIVPROC)(GLenum target, GLenum pname, GLint * params); -typedef void (GLAD_API_PTR *PFNGLGETRENDERBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params); -typedef void (GLAD_API_PTR *PFNGLGETSAMPLERPARAMETERIIVPROC)(GLuint sampler, GLenum pname, GLint * params); -typedef void (GLAD_API_PTR *PFNGLGETSAMPLERPARAMETERIUIVPROC)(GLuint sampler, GLenum pname, GLuint * params); -typedef void (GLAD_API_PTR *PFNGLGETSAMPLERPARAMETERFVPROC)(GLuint sampler, GLenum pname, GLfloat * params); -typedef void (GLAD_API_PTR *PFNGLGETSAMPLERPARAMETERIVPROC)(GLuint sampler, GLenum pname, GLint * params); -typedef void (GLAD_API_PTR *PFNGLGETSHADERINFOLOGPROC)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog); -typedef void (GLAD_API_PTR *PFNGLGETSHADERSOURCEPROC)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source); -typedef void (GLAD_API_PTR *PFNGLGETSHADERIVPROC)(GLuint shader, GLenum pname, GLint * params); -typedef const GLubyte * (GLAD_API_PTR *PFNGLGETSTRINGPROC)(GLenum name); -typedef const GLubyte * (GLAD_API_PTR *PFNGLGETSTRINGIPROC)(GLenum name, GLuint index); -typedef void (GLAD_API_PTR *PFNGLGETSYNCIVPROC)(GLsync sync, GLenum pname, GLsizei count, GLsizei * length, GLint * values); -typedef void (GLAD_API_PTR *PFNGLGETTEXENVFVPROC)(GLenum target, GLenum pname, GLfloat * params); -typedef void (GLAD_API_PTR *PFNGLGETTEXENVIVPROC)(GLenum target, GLenum pname, GLint * params); -typedef void (GLAD_API_PTR *PFNGLGETTEXGENDVPROC)(GLenum coord, GLenum pname, GLdouble * params); -typedef void (GLAD_API_PTR *PFNGLGETTEXGENFVPROC)(GLenum coord, GLenum pname, GLfloat * params); -typedef void (GLAD_API_PTR *PFNGLGETTEXGENIVPROC)(GLenum coord, GLenum pname, GLint * params); -typedef void (GLAD_API_PTR *PFNGLGETTEXIMAGEPROC)(GLenum target, GLint level, GLenum format, GLenum type, void * pixels); -typedef void (GLAD_API_PTR *PFNGLGETTEXLEVELPARAMETERFVPROC)(GLenum target, GLint level, GLenum pname, GLfloat * params); -typedef void (GLAD_API_PTR *PFNGLGETTEXLEVELPARAMETERIVPROC)(GLenum target, GLint level, GLenum pname, GLint * params); -typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERIIVPROC)(GLenum target, GLenum pname, GLint * params); -typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERIUIVPROC)(GLenum target, GLenum pname, GLuint * params); -typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat * params); -typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params); -typedef void (GLAD_API_PTR *PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name); -typedef GLuint (GLAD_API_PTR *PFNGLGETUNIFORMBLOCKINDEXPROC)(GLuint program, const GLchar * uniformBlockName); -typedef void (GLAD_API_PTR *PFNGLGETUNIFORMINDICESPROC)(GLuint program, GLsizei uniformCount, const GLchar *const* uniformNames, GLuint * uniformIndices); -typedef GLint (GLAD_API_PTR *PFNGLGETUNIFORMLOCATIONPROC)(GLuint program, const GLchar * name); -typedef void (GLAD_API_PTR *PFNGLGETUNIFORMFVPROC)(GLuint program, GLint location, GLfloat * params); -typedef void (GLAD_API_PTR *PFNGLGETUNIFORMIVPROC)(GLuint program, GLint location, GLint * params); -typedef void (GLAD_API_PTR *PFNGLGETUNIFORMUIVPROC)(GLuint program, GLint location, GLuint * params); -typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBIIVPROC)(GLuint index, GLenum pname, GLint * params); -typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBIUIVPROC)(GLuint index, GLenum pname, GLuint * params); -typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBPOINTERVPROC)(GLuint index, GLenum pname, void ** pointer); -typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBDVPROC)(GLuint index, GLenum pname, GLdouble * params); -typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBFVPROC)(GLuint index, GLenum pname, GLfloat * params); -typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBIVPROC)(GLuint index, GLenum pname, GLint * params); -typedef void (GLAD_API_PTR *PFNGLGETNCOLORTABLEARBPROC)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, void * table); -typedef void (GLAD_API_PTR *PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC)(GLenum target, GLint lod, GLsizei bufSize, void * img); -typedef void (GLAD_API_PTR *PFNGLGETNCONVOLUTIONFILTERARBPROC)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, void * image); -typedef void (GLAD_API_PTR *PFNGLGETNHISTOGRAMARBPROC)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void * values); -typedef void (GLAD_API_PTR *PFNGLGETNMAPDVARBPROC)(GLenum target, GLenum query, GLsizei bufSize, GLdouble * v); -typedef void (GLAD_API_PTR *PFNGLGETNMAPFVARBPROC)(GLenum target, GLenum query, GLsizei bufSize, GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLGETNMAPIVARBPROC)(GLenum target, GLenum query, GLsizei bufSize, GLint * v); -typedef void (GLAD_API_PTR *PFNGLGETNMINMAXARBPROC)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void * values); -typedef void (GLAD_API_PTR *PFNGLGETNPIXELMAPFVARBPROC)(GLenum map, GLsizei bufSize, GLfloat * values); -typedef void (GLAD_API_PTR *PFNGLGETNPIXELMAPUIVARBPROC)(GLenum map, GLsizei bufSize, GLuint * values); -typedef void (GLAD_API_PTR *PFNGLGETNPIXELMAPUSVARBPROC)(GLenum map, GLsizei bufSize, GLushort * values); -typedef void (GLAD_API_PTR *PFNGLGETNPOLYGONSTIPPLEARBPROC)(GLsizei bufSize, GLubyte * pattern); -typedef void (GLAD_API_PTR *PFNGLGETNSEPARABLEFILTERARBPROC)(GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void * row, GLsizei columnBufSize, void * column, void * span); -typedef void (GLAD_API_PTR *PFNGLGETNTEXIMAGEARBPROC)(GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void * img); -typedef void (GLAD_API_PTR *PFNGLGETNUNIFORMDVARBPROC)(GLuint program, GLint location, GLsizei bufSize, GLdouble * params); -typedef void (GLAD_API_PTR *PFNGLGETNUNIFORMFVARBPROC)(GLuint program, GLint location, GLsizei bufSize, GLfloat * params); -typedef void (GLAD_API_PTR *PFNGLGETNUNIFORMIVARBPROC)(GLuint program, GLint location, GLsizei bufSize, GLint * params); -typedef void (GLAD_API_PTR *PFNGLGETNUNIFORMUIVARBPROC)(GLuint program, GLint location, GLsizei bufSize, GLuint * params); -typedef void (GLAD_API_PTR *PFNGLHINTPROC)(GLenum target, GLenum mode); -typedef void (GLAD_API_PTR *PFNGLINDEXMASKPROC)(GLuint mask); -typedef void (GLAD_API_PTR *PFNGLINDEXPOINTERPROC)(GLenum type, GLsizei stride, const void * pointer); -typedef void (GLAD_API_PTR *PFNGLINDEXDPROC)(GLdouble c); -typedef void (GLAD_API_PTR *PFNGLINDEXDVPROC)(const GLdouble * c); -typedef void (GLAD_API_PTR *PFNGLINDEXFPROC)(GLfloat c); -typedef void (GLAD_API_PTR *PFNGLINDEXFVPROC)(const GLfloat * c); -typedef void (GLAD_API_PTR *PFNGLINDEXIPROC)(GLint c); -typedef void (GLAD_API_PTR *PFNGLINDEXIVPROC)(const GLint * c); -typedef void (GLAD_API_PTR *PFNGLINDEXSPROC)(GLshort c); -typedef void (GLAD_API_PTR *PFNGLINDEXSVPROC)(const GLshort * c); -typedef void (GLAD_API_PTR *PFNGLINDEXUBPROC)(GLubyte c); -typedef void (GLAD_API_PTR *PFNGLINDEXUBVPROC)(const GLubyte * c); -typedef void (GLAD_API_PTR *PFNGLINITNAMESPROC)(void); -typedef void (GLAD_API_PTR *PFNGLINTERLEAVEDARRAYSPROC)(GLenum format, GLsizei stride, const void * pointer); -typedef GLboolean (GLAD_API_PTR *PFNGLISBUFFERPROC)(GLuint buffer); -typedef GLboolean (GLAD_API_PTR *PFNGLISENABLEDPROC)(GLenum cap); -typedef GLboolean (GLAD_API_PTR *PFNGLISENABLEDIPROC)(GLenum target, GLuint index); -typedef GLboolean (GLAD_API_PTR *PFNGLISFRAMEBUFFERPROC)(GLuint framebuffer); -typedef GLboolean (GLAD_API_PTR *PFNGLISLISTPROC)(GLuint list); -typedef GLboolean (GLAD_API_PTR *PFNGLISPROGRAMPROC)(GLuint program); -typedef GLboolean (GLAD_API_PTR *PFNGLISQUERYPROC)(GLuint id); -typedef GLboolean (GLAD_API_PTR *PFNGLISRENDERBUFFERPROC)(GLuint renderbuffer); -typedef GLboolean (GLAD_API_PTR *PFNGLISSAMPLERPROC)(GLuint sampler); -typedef GLboolean (GLAD_API_PTR *PFNGLISSHADERPROC)(GLuint shader); -typedef GLboolean (GLAD_API_PTR *PFNGLISSYNCPROC)(GLsync sync); -typedef GLboolean (GLAD_API_PTR *PFNGLISTEXTUREPROC)(GLuint texture); -typedef GLboolean (GLAD_API_PTR *PFNGLISVERTEXARRAYPROC)(GLuint array); -typedef void (GLAD_API_PTR *PFNGLLIGHTMODELFPROC)(GLenum pname, GLfloat param); -typedef void (GLAD_API_PTR *PFNGLLIGHTMODELFVPROC)(GLenum pname, const GLfloat * params); -typedef void (GLAD_API_PTR *PFNGLLIGHTMODELIPROC)(GLenum pname, GLint param); -typedef void (GLAD_API_PTR *PFNGLLIGHTMODELIVPROC)(GLenum pname, const GLint * params); -typedef void (GLAD_API_PTR *PFNGLLIGHTFPROC)(GLenum light, GLenum pname, GLfloat param); -typedef void (GLAD_API_PTR *PFNGLLIGHTFVPROC)(GLenum light, GLenum pname, const GLfloat * params); -typedef void (GLAD_API_PTR *PFNGLLIGHTIPROC)(GLenum light, GLenum pname, GLint param); -typedef void (GLAD_API_PTR *PFNGLLIGHTIVPROC)(GLenum light, GLenum pname, const GLint * params); -typedef void (GLAD_API_PTR *PFNGLLINESTIPPLEPROC)(GLint factor, GLushort pattern); -typedef void (GLAD_API_PTR *PFNGLLINEWIDTHPROC)(GLfloat width); -typedef void (GLAD_API_PTR *PFNGLLINKPROGRAMPROC)(GLuint program); -typedef void (GLAD_API_PTR *PFNGLLISTBASEPROC)(GLuint base); -typedef void (GLAD_API_PTR *PFNGLLOADIDENTITYPROC)(void); -typedef void (GLAD_API_PTR *PFNGLLOADMATRIXDPROC)(const GLdouble * m); -typedef void (GLAD_API_PTR *PFNGLLOADMATRIXFPROC)(const GLfloat * m); -typedef void (GLAD_API_PTR *PFNGLLOADNAMEPROC)(GLuint name); -typedef void (GLAD_API_PTR *PFNGLLOADTRANSPOSEMATRIXDPROC)(const GLdouble * m); -typedef void (GLAD_API_PTR *PFNGLLOADTRANSPOSEMATRIXFPROC)(const GLfloat * m); -typedef void (GLAD_API_PTR *PFNGLLOGICOPPROC)(GLenum opcode); -typedef void (GLAD_API_PTR *PFNGLMAP1DPROC)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points); -typedef void (GLAD_API_PTR *PFNGLMAP1FPROC)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points); -typedef void (GLAD_API_PTR *PFNGLMAP2DPROC)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points); -typedef void (GLAD_API_PTR *PFNGLMAP2FPROC)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points); -typedef void * (GLAD_API_PTR *PFNGLMAPBUFFERPROC)(GLenum target, GLenum access); -typedef void * (GLAD_API_PTR *PFNGLMAPBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); -typedef void (GLAD_API_PTR *PFNGLMAPGRID1DPROC)(GLint un, GLdouble u1, GLdouble u2); -typedef void (GLAD_API_PTR *PFNGLMAPGRID1FPROC)(GLint un, GLfloat u1, GLfloat u2); -typedef void (GLAD_API_PTR *PFNGLMAPGRID2DPROC)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); -typedef void (GLAD_API_PTR *PFNGLMAPGRID2FPROC)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); -typedef void (GLAD_API_PTR *PFNGLMATERIALFPROC)(GLenum face, GLenum pname, GLfloat param); -typedef void (GLAD_API_PTR *PFNGLMATERIALFVPROC)(GLenum face, GLenum pname, const GLfloat * params); -typedef void (GLAD_API_PTR *PFNGLMATERIALIPROC)(GLenum face, GLenum pname, GLint param); -typedef void (GLAD_API_PTR *PFNGLMATERIALIVPROC)(GLenum face, GLenum pname, const GLint * params); -typedef void (GLAD_API_PTR *PFNGLMATRIXMODEPROC)(GLenum mode); -typedef void (GLAD_API_PTR *PFNGLMULTMATRIXDPROC)(const GLdouble * m); -typedef void (GLAD_API_PTR *PFNGLMULTMATRIXFPROC)(const GLfloat * m); -typedef void (GLAD_API_PTR *PFNGLMULTTRANSPOSEMATRIXDPROC)(const GLdouble * m); -typedef void (GLAD_API_PTR *PFNGLMULTTRANSPOSEMATRIXFPROC)(const GLfloat * m); -typedef void (GLAD_API_PTR *PFNGLMULTIDRAWARRAYSPROC)(GLenum mode, const GLint * first, const GLsizei * count, GLsizei drawcount); -typedef void (GLAD_API_PTR *PFNGLMULTIDRAWELEMENTSPROC)(GLenum mode, const GLsizei * count, GLenum type, const void *const* indices, GLsizei drawcount); -typedef void (GLAD_API_PTR *PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)(GLenum mode, const GLsizei * count, GLenum type, const void *const* indices, GLsizei drawcount, const GLint * basevertex); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1DPROC)(GLenum target, GLdouble s); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1DVPROC)(GLenum target, const GLdouble * v); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1FPROC)(GLenum target, GLfloat s); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1FVPROC)(GLenum target, const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1IPROC)(GLenum target, GLint s); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1IVPROC)(GLenum target, const GLint * v); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1SPROC)(GLenum target, GLshort s); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1SVPROC)(GLenum target, const GLshort * v); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2DPROC)(GLenum target, GLdouble s, GLdouble t); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2DVPROC)(GLenum target, const GLdouble * v); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2FPROC)(GLenum target, GLfloat s, GLfloat t); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2FVPROC)(GLenum target, const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2IPROC)(GLenum target, GLint s, GLint t); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2IVPROC)(GLenum target, const GLint * v); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2SPROC)(GLenum target, GLshort s, GLshort t); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2SVPROC)(GLenum target, const GLshort * v); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3DPROC)(GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3DVPROC)(GLenum target, const GLdouble * v); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3FPROC)(GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3FVPROC)(GLenum target, const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3IPROC)(GLenum target, GLint s, GLint t, GLint r); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3IVPROC)(GLenum target, const GLint * v); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3SPROC)(GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3SVPROC)(GLenum target, const GLshort * v); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4DPROC)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4DVPROC)(GLenum target, const GLdouble * v); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4FPROC)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4FVPROC)(GLenum target, const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4IPROC)(GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4IVPROC)(GLenum target, const GLint * v); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4SPROC)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4SVPROC)(GLenum target, const GLshort * v); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORDP1UIPROC)(GLenum texture, GLenum type, GLuint coords); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORDP1UIVPROC)(GLenum texture, GLenum type, const GLuint * coords); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORDP2UIPROC)(GLenum texture, GLenum type, GLuint coords); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORDP2UIVPROC)(GLenum texture, GLenum type, const GLuint * coords); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORDP3UIPROC)(GLenum texture, GLenum type, GLuint coords); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORDP3UIVPROC)(GLenum texture, GLenum type, const GLuint * coords); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORDP4UIPROC)(GLenum texture, GLenum type, GLuint coords); -typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORDP4UIVPROC)(GLenum texture, GLenum type, const GLuint * coords); -typedef void (GLAD_API_PTR *PFNGLNEWLISTPROC)(GLuint list, GLenum mode); -typedef void (GLAD_API_PTR *PFNGLNORMAL3BPROC)(GLbyte nx, GLbyte ny, GLbyte nz); -typedef void (GLAD_API_PTR *PFNGLNORMAL3BVPROC)(const GLbyte * v); -typedef void (GLAD_API_PTR *PFNGLNORMAL3DPROC)(GLdouble nx, GLdouble ny, GLdouble nz); -typedef void (GLAD_API_PTR *PFNGLNORMAL3DVPROC)(const GLdouble * v); -typedef void (GLAD_API_PTR *PFNGLNORMAL3FPROC)(GLfloat nx, GLfloat ny, GLfloat nz); -typedef void (GLAD_API_PTR *PFNGLNORMAL3FVPROC)(const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLNORMAL3IPROC)(GLint nx, GLint ny, GLint nz); -typedef void (GLAD_API_PTR *PFNGLNORMAL3IVPROC)(const GLint * v); -typedef void (GLAD_API_PTR *PFNGLNORMAL3SPROC)(GLshort nx, GLshort ny, GLshort nz); -typedef void (GLAD_API_PTR *PFNGLNORMAL3SVPROC)(const GLshort * v); -typedef void (GLAD_API_PTR *PFNGLNORMALP3UIPROC)(GLenum type, GLuint coords); -typedef void (GLAD_API_PTR *PFNGLNORMALP3UIVPROC)(GLenum type, const GLuint * coords); -typedef void (GLAD_API_PTR *PFNGLNORMALPOINTERPROC)(GLenum type, GLsizei stride, const void * pointer); -typedef void (GLAD_API_PTR *PFNGLOBJECTLABELPROC)(GLenum identifier, GLuint name, GLsizei length, const GLchar * label); -typedef void (GLAD_API_PTR *PFNGLOBJECTPTRLABELPROC)(const void * ptr, GLsizei length, const GLchar * label); -typedef void (GLAD_API_PTR *PFNGLORTHOPROC)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -typedef void (GLAD_API_PTR *PFNGLPASSTHROUGHPROC)(GLfloat token); -typedef void (GLAD_API_PTR *PFNGLPIXELMAPFVPROC)(GLenum map, GLsizei mapsize, const GLfloat * values); -typedef void (GLAD_API_PTR *PFNGLPIXELMAPUIVPROC)(GLenum map, GLsizei mapsize, const GLuint * values); -typedef void (GLAD_API_PTR *PFNGLPIXELMAPUSVPROC)(GLenum map, GLsizei mapsize, const GLushort * values); -typedef void (GLAD_API_PTR *PFNGLPIXELSTOREFPROC)(GLenum pname, GLfloat param); -typedef void (GLAD_API_PTR *PFNGLPIXELSTOREIPROC)(GLenum pname, GLint param); -typedef void (GLAD_API_PTR *PFNGLPIXELTRANSFERFPROC)(GLenum pname, GLfloat param); -typedef void (GLAD_API_PTR *PFNGLPIXELTRANSFERIPROC)(GLenum pname, GLint param); -typedef void (GLAD_API_PTR *PFNGLPIXELZOOMPROC)(GLfloat xfactor, GLfloat yfactor); -typedef void (GLAD_API_PTR *PFNGLPOINTPARAMETERFPROC)(GLenum pname, GLfloat param); -typedef void (GLAD_API_PTR *PFNGLPOINTPARAMETERFVPROC)(GLenum pname, const GLfloat * params); -typedef void (GLAD_API_PTR *PFNGLPOINTPARAMETERIPROC)(GLenum pname, GLint param); -typedef void (GLAD_API_PTR *PFNGLPOINTPARAMETERIVPROC)(GLenum pname, const GLint * params); -typedef void (GLAD_API_PTR *PFNGLPOINTSIZEPROC)(GLfloat size); -typedef void (GLAD_API_PTR *PFNGLPOLYGONMODEPROC)(GLenum face, GLenum mode); -typedef void (GLAD_API_PTR *PFNGLPOLYGONOFFSETPROC)(GLfloat factor, GLfloat units); -typedef void (GLAD_API_PTR *PFNGLPOLYGONSTIPPLEPROC)(const GLubyte * mask); -typedef void (GLAD_API_PTR *PFNGLPOPATTRIBPROC)(void); -typedef void (GLAD_API_PTR *PFNGLPOPCLIENTATTRIBPROC)(void); -typedef void (GLAD_API_PTR *PFNGLPOPDEBUGGROUPPROC)(void); -typedef void (GLAD_API_PTR *PFNGLPOPMATRIXPROC)(void); -typedef void (GLAD_API_PTR *PFNGLPOPNAMEPROC)(void); -typedef void (GLAD_API_PTR *PFNGLPRIMITIVERESTARTINDEXPROC)(GLuint index); -typedef void (GLAD_API_PTR *PFNGLPRIORITIZETEXTURESPROC)(GLsizei n, const GLuint * textures, const GLfloat * priorities); -typedef void (GLAD_API_PTR *PFNGLPROVOKINGVERTEXPROC)(GLenum mode); -typedef void (GLAD_API_PTR *PFNGLPUSHATTRIBPROC)(GLbitfield mask); -typedef void (GLAD_API_PTR *PFNGLPUSHCLIENTATTRIBPROC)(GLbitfield mask); -typedef void (GLAD_API_PTR *PFNGLPUSHDEBUGGROUPPROC)(GLenum source, GLuint id, GLsizei length, const GLchar * message); -typedef void (GLAD_API_PTR *PFNGLPUSHMATRIXPROC)(void); -typedef void (GLAD_API_PTR *PFNGLPUSHNAMEPROC)(GLuint name); -typedef void (GLAD_API_PTR *PFNGLQUERYCOUNTERPROC)(GLuint id, GLenum target); -typedef void (GLAD_API_PTR *PFNGLRASTERPOS2DPROC)(GLdouble x, GLdouble y); -typedef void (GLAD_API_PTR *PFNGLRASTERPOS2DVPROC)(const GLdouble * v); -typedef void (GLAD_API_PTR *PFNGLRASTERPOS2FPROC)(GLfloat x, GLfloat y); -typedef void (GLAD_API_PTR *PFNGLRASTERPOS2FVPROC)(const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLRASTERPOS2IPROC)(GLint x, GLint y); -typedef void (GLAD_API_PTR *PFNGLRASTERPOS2IVPROC)(const GLint * v); -typedef void (GLAD_API_PTR *PFNGLRASTERPOS2SPROC)(GLshort x, GLshort y); -typedef void (GLAD_API_PTR *PFNGLRASTERPOS2SVPROC)(const GLshort * v); -typedef void (GLAD_API_PTR *PFNGLRASTERPOS3DPROC)(GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAD_API_PTR *PFNGLRASTERPOS3DVPROC)(const GLdouble * v); -typedef void (GLAD_API_PTR *PFNGLRASTERPOS3FPROC)(GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAD_API_PTR *PFNGLRASTERPOS3FVPROC)(const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLRASTERPOS3IPROC)(GLint x, GLint y, GLint z); -typedef void (GLAD_API_PTR *PFNGLRASTERPOS3IVPROC)(const GLint * v); -typedef void (GLAD_API_PTR *PFNGLRASTERPOS3SPROC)(GLshort x, GLshort y, GLshort z); -typedef void (GLAD_API_PTR *PFNGLRASTERPOS3SVPROC)(const GLshort * v); -typedef void (GLAD_API_PTR *PFNGLRASTERPOS4DPROC)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAD_API_PTR *PFNGLRASTERPOS4DVPROC)(const GLdouble * v); -typedef void (GLAD_API_PTR *PFNGLRASTERPOS4FPROC)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAD_API_PTR *PFNGLRASTERPOS4FVPROC)(const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLRASTERPOS4IPROC)(GLint x, GLint y, GLint z, GLint w); -typedef void (GLAD_API_PTR *PFNGLRASTERPOS4IVPROC)(const GLint * v); -typedef void (GLAD_API_PTR *PFNGLRASTERPOS4SPROC)(GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (GLAD_API_PTR *PFNGLRASTERPOS4SVPROC)(const GLshort * v); -typedef void (GLAD_API_PTR *PFNGLREADBUFFERPROC)(GLenum src); -typedef void (GLAD_API_PTR *PFNGLREADPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * pixels); -typedef void (GLAD_API_PTR *PFNGLREADNPIXELSARBPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void * data); -typedef void (GLAD_API_PTR *PFNGLRECTDPROC)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); -typedef void (GLAD_API_PTR *PFNGLRECTDVPROC)(const GLdouble * v1, const GLdouble * v2); -typedef void (GLAD_API_PTR *PFNGLRECTFPROC)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); -typedef void (GLAD_API_PTR *PFNGLRECTFVPROC)(const GLfloat * v1, const GLfloat * v2); -typedef void (GLAD_API_PTR *PFNGLRECTIPROC)(GLint x1, GLint y1, GLint x2, GLint y2); -typedef void (GLAD_API_PTR *PFNGLRECTIVPROC)(const GLint * v1, const GLint * v2); -typedef void (GLAD_API_PTR *PFNGLRECTSPROC)(GLshort x1, GLshort y1, GLshort x2, GLshort y2); -typedef void (GLAD_API_PTR *PFNGLRECTSVPROC)(const GLshort * v1, const GLshort * v2); -typedef GLint (GLAD_API_PTR *PFNGLRENDERMODEPROC)(GLenum mode); -typedef void (GLAD_API_PTR *PFNGLRENDERBUFFERSTORAGEPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GLAD_API_PTR *PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GLAD_API_PTR *PFNGLROTATEDPROC)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAD_API_PTR *PFNGLROTATEFPROC)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAD_API_PTR *PFNGLSAMPLECOVERAGEPROC)(GLfloat value, GLboolean invert); -typedef void (GLAD_API_PTR *PFNGLSAMPLECOVERAGEARBPROC)(GLfloat value, GLboolean invert); -typedef void (GLAD_API_PTR *PFNGLSAMPLEMASKIPROC)(GLuint maskNumber, GLbitfield mask); -typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERIIVPROC)(GLuint sampler, GLenum pname, const GLint * param); -typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERIUIVPROC)(GLuint sampler, GLenum pname, const GLuint * param); -typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERFPROC)(GLuint sampler, GLenum pname, GLfloat param); -typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERFVPROC)(GLuint sampler, GLenum pname, const GLfloat * param); -typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERIPROC)(GLuint sampler, GLenum pname, GLint param); -typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERIVPROC)(GLuint sampler, GLenum pname, const GLint * param); -typedef void (GLAD_API_PTR *PFNGLSCALEDPROC)(GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAD_API_PTR *PFNGLSCALEFPROC)(GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAD_API_PTR *PFNGLSCISSORPROC)(GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3BPROC)(GLbyte red, GLbyte green, GLbyte blue); -typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3BVPROC)(const GLbyte * v); -typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3DPROC)(GLdouble red, GLdouble green, GLdouble blue); -typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3DVPROC)(const GLdouble * v); -typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3FPROC)(GLfloat red, GLfloat green, GLfloat blue); -typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3FVPROC)(const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3IPROC)(GLint red, GLint green, GLint blue); -typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3IVPROC)(const GLint * v); -typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3SPROC)(GLshort red, GLshort green, GLshort blue); -typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3SVPROC)(const GLshort * v); -typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3UBPROC)(GLubyte red, GLubyte green, GLubyte blue); -typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3UBVPROC)(const GLubyte * v); -typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3UIPROC)(GLuint red, GLuint green, GLuint blue); -typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3UIVPROC)(const GLuint * v); -typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3USPROC)(GLushort red, GLushort green, GLushort blue); -typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3USVPROC)(const GLushort * v); -typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLORP3UIPROC)(GLenum type, GLuint color); -typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLORP3UIVPROC)(GLenum type, const GLuint * color); -typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLORPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void * pointer); -typedef void (GLAD_API_PTR *PFNGLSELECTBUFFERPROC)(GLsizei size, GLuint * buffer); -typedef void (GLAD_API_PTR *PFNGLSHADEMODELPROC)(GLenum mode); -typedef void (GLAD_API_PTR *PFNGLSHADERSOURCEPROC)(GLuint shader, GLsizei count, const GLchar *const* string, const GLint * length); -typedef void (GLAD_API_PTR *PFNGLSTENCILFUNCPROC)(GLenum func, GLint ref, GLuint mask); -typedef void (GLAD_API_PTR *PFNGLSTENCILFUNCSEPARATEPROC)(GLenum face, GLenum func, GLint ref, GLuint mask); -typedef void (GLAD_API_PTR *PFNGLSTENCILMASKPROC)(GLuint mask); -typedef void (GLAD_API_PTR *PFNGLSTENCILMASKSEPARATEPROC)(GLenum face, GLuint mask); -typedef void (GLAD_API_PTR *PFNGLSTENCILOPPROC)(GLenum fail, GLenum zfail, GLenum zpass); -typedef void (GLAD_API_PTR *PFNGLSTENCILOPSEPARATEPROC)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (GLAD_API_PTR *PFNGLTEXBUFFERPROC)(GLenum target, GLenum internalformat, GLuint buffer); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD1DPROC)(GLdouble s); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD1DVPROC)(const GLdouble * v); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD1FPROC)(GLfloat s); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD1FVPROC)(const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD1IPROC)(GLint s); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD1IVPROC)(const GLint * v); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD1SPROC)(GLshort s); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD1SVPROC)(const GLshort * v); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD2DPROC)(GLdouble s, GLdouble t); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD2DVPROC)(const GLdouble * v); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD2FPROC)(GLfloat s, GLfloat t); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD2FVPROC)(const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD2IPROC)(GLint s, GLint t); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD2IVPROC)(const GLint * v); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD2SPROC)(GLshort s, GLshort t); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD2SVPROC)(const GLshort * v); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD3DPROC)(GLdouble s, GLdouble t, GLdouble r); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD3DVPROC)(const GLdouble * v); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD3FPROC)(GLfloat s, GLfloat t, GLfloat r); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD3FVPROC)(const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD3IPROC)(GLint s, GLint t, GLint r); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD3IVPROC)(const GLint * v); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD3SPROC)(GLshort s, GLshort t, GLshort r); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD3SVPROC)(const GLshort * v); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD4DPROC)(GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD4DVPROC)(const GLdouble * v); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD4FPROC)(GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD4FVPROC)(const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD4IPROC)(GLint s, GLint t, GLint r, GLint q); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD4IVPROC)(const GLint * v); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD4SPROC)(GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (GLAD_API_PTR *PFNGLTEXCOORD4SVPROC)(const GLshort * v); -typedef void (GLAD_API_PTR *PFNGLTEXCOORDP1UIPROC)(GLenum type, GLuint coords); -typedef void (GLAD_API_PTR *PFNGLTEXCOORDP1UIVPROC)(GLenum type, const GLuint * coords); -typedef void (GLAD_API_PTR *PFNGLTEXCOORDP2UIPROC)(GLenum type, GLuint coords); -typedef void (GLAD_API_PTR *PFNGLTEXCOORDP2UIVPROC)(GLenum type, const GLuint * coords); -typedef void (GLAD_API_PTR *PFNGLTEXCOORDP3UIPROC)(GLenum type, GLuint coords); -typedef void (GLAD_API_PTR *PFNGLTEXCOORDP3UIVPROC)(GLenum type, const GLuint * coords); -typedef void (GLAD_API_PTR *PFNGLTEXCOORDP4UIPROC)(GLenum type, GLuint coords); -typedef void (GLAD_API_PTR *PFNGLTEXCOORDP4UIVPROC)(GLenum type, const GLuint * coords); -typedef void (GLAD_API_PTR *PFNGLTEXCOORDPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void * pointer); -typedef void (GLAD_API_PTR *PFNGLTEXENVFPROC)(GLenum target, GLenum pname, GLfloat param); -typedef void (GLAD_API_PTR *PFNGLTEXENVFVPROC)(GLenum target, GLenum pname, const GLfloat * params); -typedef void (GLAD_API_PTR *PFNGLTEXENVIPROC)(GLenum target, GLenum pname, GLint param); -typedef void (GLAD_API_PTR *PFNGLTEXENVIVPROC)(GLenum target, GLenum pname, const GLint * params); -typedef void (GLAD_API_PTR *PFNGLTEXGENDPROC)(GLenum coord, GLenum pname, GLdouble param); -typedef void (GLAD_API_PTR *PFNGLTEXGENDVPROC)(GLenum coord, GLenum pname, const GLdouble * params); -typedef void (GLAD_API_PTR *PFNGLTEXGENFPROC)(GLenum coord, GLenum pname, GLfloat param); -typedef void (GLAD_API_PTR *PFNGLTEXGENFVPROC)(GLenum coord, GLenum pname, const GLfloat * params); -typedef void (GLAD_API_PTR *PFNGLTEXGENIPROC)(GLenum coord, GLenum pname, GLint param); -typedef void (GLAD_API_PTR *PFNGLTEXGENIVPROC)(GLenum coord, GLenum pname, const GLint * params); -typedef void (GLAD_API_PTR *PFNGLTEXIMAGE1DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void * pixels); -typedef void (GLAD_API_PTR *PFNGLTEXIMAGE2DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels); -typedef void (GLAD_API_PTR *PFNGLTEXIMAGE2DMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -typedef void (GLAD_API_PTR *PFNGLTEXIMAGE3DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels); -typedef void (GLAD_API_PTR *PFNGLTEXIMAGE3DMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIIVPROC)(GLenum target, GLenum pname, const GLint * params); -typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIUIVPROC)(GLenum target, GLenum pname, const GLuint * params); -typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERFPROC)(GLenum target, GLenum pname, GLfloat param); -typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERFVPROC)(GLenum target, GLenum pname, const GLfloat * params); -typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIPROC)(GLenum target, GLenum pname, GLint param); -typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint * params); -typedef void (GLAD_API_PTR *PFNGLTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void * pixels); -typedef void (GLAD_API_PTR *PFNGLTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels); -typedef void (GLAD_API_PTR *PFNGLTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels); -typedef void (GLAD_API_PTR *PFNGLTRANSFORMFEEDBACKVARYINGSPROC)(GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode); -typedef void (GLAD_API_PTR *PFNGLTRANSLATEDPROC)(GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAD_API_PTR *PFNGLTRANSLATEFPROC)(GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAD_API_PTR *PFNGLUNIFORM1FPROC)(GLint location, GLfloat v0); -typedef void (GLAD_API_PTR *PFNGLUNIFORM1FVPROC)(GLint location, GLsizei count, const GLfloat * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORM1IPROC)(GLint location, GLint v0); -typedef void (GLAD_API_PTR *PFNGLUNIFORM1IVPROC)(GLint location, GLsizei count, const GLint * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORM1UIPROC)(GLint location, GLuint v0); -typedef void (GLAD_API_PTR *PFNGLUNIFORM1UIVPROC)(GLint location, GLsizei count, const GLuint * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORM2FPROC)(GLint location, GLfloat v0, GLfloat v1); -typedef void (GLAD_API_PTR *PFNGLUNIFORM2FVPROC)(GLint location, GLsizei count, const GLfloat * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORM2IPROC)(GLint location, GLint v0, GLint v1); -typedef void (GLAD_API_PTR *PFNGLUNIFORM2IVPROC)(GLint location, GLsizei count, const GLint * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORM2UIPROC)(GLint location, GLuint v0, GLuint v1); -typedef void (GLAD_API_PTR *PFNGLUNIFORM2UIVPROC)(GLint location, GLsizei count, const GLuint * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORM3FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (GLAD_API_PTR *PFNGLUNIFORM3FVPROC)(GLint location, GLsizei count, const GLfloat * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORM3IPROC)(GLint location, GLint v0, GLint v1, GLint v2); -typedef void (GLAD_API_PTR *PFNGLUNIFORM3IVPROC)(GLint location, GLsizei count, const GLint * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORM3UIPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (GLAD_API_PTR *PFNGLUNIFORM3UIVPROC)(GLint location, GLsizei count, const GLuint * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORM4FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (GLAD_API_PTR *PFNGLUNIFORM4FVPROC)(GLint location, GLsizei count, const GLfloat * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORM4IPROC)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (GLAD_API_PTR *PFNGLUNIFORM4IVPROC)(GLint location, GLsizei count, const GLint * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORM4UIPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (GLAD_API_PTR *PFNGLUNIFORM4UIVPROC)(GLint location, GLsizei count, const GLuint * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORMBLOCKBINDINGPROC)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); -typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX2X3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX2X4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX3X2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX3X4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX4X2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX4X3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef GLboolean (GLAD_API_PTR *PFNGLUNMAPBUFFERPROC)(GLenum target); -typedef void (GLAD_API_PTR *PFNGLUSEPROGRAMPROC)(GLuint program); -typedef void (GLAD_API_PTR *PFNGLVALIDATEPROGRAMPROC)(GLuint program); -typedef void (GLAD_API_PTR *PFNGLVERTEX2DPROC)(GLdouble x, GLdouble y); -typedef void (GLAD_API_PTR *PFNGLVERTEX2DVPROC)(const GLdouble * v); -typedef void (GLAD_API_PTR *PFNGLVERTEX2FPROC)(GLfloat x, GLfloat y); -typedef void (GLAD_API_PTR *PFNGLVERTEX2FVPROC)(const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLVERTEX2IPROC)(GLint x, GLint y); -typedef void (GLAD_API_PTR *PFNGLVERTEX2IVPROC)(const GLint * v); -typedef void (GLAD_API_PTR *PFNGLVERTEX2SPROC)(GLshort x, GLshort y); -typedef void (GLAD_API_PTR *PFNGLVERTEX2SVPROC)(const GLshort * v); -typedef void (GLAD_API_PTR *PFNGLVERTEX3DPROC)(GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAD_API_PTR *PFNGLVERTEX3DVPROC)(const GLdouble * v); -typedef void (GLAD_API_PTR *PFNGLVERTEX3FPROC)(GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAD_API_PTR *PFNGLVERTEX3FVPROC)(const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLVERTEX3IPROC)(GLint x, GLint y, GLint z); -typedef void (GLAD_API_PTR *PFNGLVERTEX3IVPROC)(const GLint * v); -typedef void (GLAD_API_PTR *PFNGLVERTEX3SPROC)(GLshort x, GLshort y, GLshort z); -typedef void (GLAD_API_PTR *PFNGLVERTEX3SVPROC)(const GLshort * v); -typedef void (GLAD_API_PTR *PFNGLVERTEX4DPROC)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAD_API_PTR *PFNGLVERTEX4DVPROC)(const GLdouble * v); -typedef void (GLAD_API_PTR *PFNGLVERTEX4FPROC)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAD_API_PTR *PFNGLVERTEX4FVPROC)(const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLVERTEX4IPROC)(GLint x, GLint y, GLint z, GLint w); -typedef void (GLAD_API_PTR *PFNGLVERTEX4IVPROC)(const GLint * v); -typedef void (GLAD_API_PTR *PFNGLVERTEX4SPROC)(GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (GLAD_API_PTR *PFNGLVERTEX4SVPROC)(const GLshort * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1DPROC)(GLuint index, GLdouble x); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1DVPROC)(GLuint index, const GLdouble * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1FPROC)(GLuint index, GLfloat x); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1FVPROC)(GLuint index, const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1SPROC)(GLuint index, GLshort x); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1SVPROC)(GLuint index, const GLshort * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2DPROC)(GLuint index, GLdouble x, GLdouble y); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2DVPROC)(GLuint index, const GLdouble * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2FPROC)(GLuint index, GLfloat x, GLfloat y); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2FVPROC)(GLuint index, const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2SPROC)(GLuint index, GLshort x, GLshort y); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2SVPROC)(GLuint index, const GLshort * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3DVPROC)(GLuint index, const GLdouble * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3FVPROC)(GLuint index, const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3SPROC)(GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3SVPROC)(GLuint index, const GLshort * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NBVPROC)(GLuint index, const GLbyte * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NIVPROC)(GLuint index, const GLint * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NSVPROC)(GLuint index, const GLshort * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NUBPROC)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NUBVPROC)(GLuint index, const GLubyte * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NUIVPROC)(GLuint index, const GLuint * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NUSVPROC)(GLuint index, const GLushort * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4BVPROC)(GLuint index, const GLbyte * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4DVPROC)(GLuint index, const GLdouble * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4FVPROC)(GLuint index, const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4IVPROC)(GLuint index, const GLint * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4SPROC)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4SVPROC)(GLuint index, const GLshort * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4UBVPROC)(GLuint index, const GLubyte * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4UIVPROC)(GLuint index, const GLuint * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4USVPROC)(GLuint index, const GLushort * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBDIVISORPROC)(GLuint index, GLuint divisor); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI1IPROC)(GLuint index, GLint x); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI1IVPROC)(GLuint index, const GLint * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI1UIPROC)(GLuint index, GLuint x); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI1UIVPROC)(GLuint index, const GLuint * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI2IPROC)(GLuint index, GLint x, GLint y); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI2IVPROC)(GLuint index, const GLint * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI2UIPROC)(GLuint index, GLuint x, GLuint y); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI2UIVPROC)(GLuint index, const GLuint * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI3IPROC)(GLuint index, GLint x, GLint y, GLint z); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI3IVPROC)(GLuint index, const GLint * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI3UIPROC)(GLuint index, GLuint x, GLuint y, GLuint z); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI3UIVPROC)(GLuint index, const GLuint * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4BVPROC)(GLuint index, const GLbyte * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4IPROC)(GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4IVPROC)(GLuint index, const GLint * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4SVPROC)(GLuint index, const GLshort * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4UBVPROC)(GLuint index, const GLubyte * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4UIPROC)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4UIVPROC)(GLuint index, const GLuint * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4USVPROC)(GLuint index, const GLushort * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBIPOINTERPROC)(GLuint index, GLint size, GLenum type, GLsizei stride, const void * pointer); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP1UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP1UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP2UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP2UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP3UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP3UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP4UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP4UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBPOINTERPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void * pointer); -typedef void (GLAD_API_PTR *PFNGLVERTEXP2UIPROC)(GLenum type, GLuint value); -typedef void (GLAD_API_PTR *PFNGLVERTEXP2UIVPROC)(GLenum type, const GLuint * value); -typedef void (GLAD_API_PTR *PFNGLVERTEXP3UIPROC)(GLenum type, GLuint value); -typedef void (GLAD_API_PTR *PFNGLVERTEXP3UIVPROC)(GLenum type, const GLuint * value); -typedef void (GLAD_API_PTR *PFNGLVERTEXP4UIPROC)(GLenum type, GLuint value); -typedef void (GLAD_API_PTR *PFNGLVERTEXP4UIVPROC)(GLenum type, const GLuint * value); -typedef void (GLAD_API_PTR *PFNGLVERTEXPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void * pointer); -typedef void (GLAD_API_PTR *PFNGLVIEWPORTPROC)(GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAD_API_PTR *PFNGLWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout); -typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2DPROC)(GLdouble x, GLdouble y); -typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2DVPROC)(const GLdouble * v); -typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2FPROC)(GLfloat x, GLfloat y); -typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2FVPROC)(const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2IPROC)(GLint x, GLint y); -typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2IVPROC)(const GLint * v); -typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2SPROC)(GLshort x, GLshort y); -typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2SVPROC)(const GLshort * v); -typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3DPROC)(GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3DVPROC)(const GLdouble * v); -typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3FPROC)(GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3FVPROC)(const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3IPROC)(GLint x, GLint y, GLint z); -typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3IVPROC)(const GLint * v); -typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3SPROC)(GLshort x, GLshort y, GLshort z); -typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3SVPROC)(const GLshort * v); - -GLAD_API_CALL PFNGLACCUMPROC glad_glAccum; -#define glAccum glad_glAccum -GLAD_API_CALL PFNGLACTIVETEXTUREPROC glad_glActiveTexture; -#define glActiveTexture glad_glActiveTexture -GLAD_API_CALL PFNGLALPHAFUNCPROC glad_glAlphaFunc; -#define glAlphaFunc glad_glAlphaFunc -GLAD_API_CALL PFNGLARETEXTURESRESIDENTPROC glad_glAreTexturesResident; -#define glAreTexturesResident glad_glAreTexturesResident -GLAD_API_CALL PFNGLARRAYELEMENTPROC glad_glArrayElement; -#define glArrayElement glad_glArrayElement -GLAD_API_CALL PFNGLATTACHSHADERPROC glad_glAttachShader; -#define glAttachShader glad_glAttachShader -GLAD_API_CALL PFNGLBEGINPROC glad_glBegin; -#define glBegin glad_glBegin -GLAD_API_CALL PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender; -#define glBeginConditionalRender glad_glBeginConditionalRender -GLAD_API_CALL PFNGLBEGINQUERYPROC glad_glBeginQuery; -#define glBeginQuery glad_glBeginQuery -GLAD_API_CALL PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback; -#define glBeginTransformFeedback glad_glBeginTransformFeedback -GLAD_API_CALL PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation; -#define glBindAttribLocation glad_glBindAttribLocation -GLAD_API_CALL PFNGLBINDBUFFERPROC glad_glBindBuffer; -#define glBindBuffer glad_glBindBuffer -GLAD_API_CALL PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase; -#define glBindBufferBase glad_glBindBufferBase -GLAD_API_CALL PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange; -#define glBindBufferRange glad_glBindBufferRange -GLAD_API_CALL PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation; -#define glBindFragDataLocation glad_glBindFragDataLocation -GLAD_API_CALL PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed; -#define glBindFragDataLocationIndexed glad_glBindFragDataLocationIndexed -GLAD_API_CALL PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer; -#define glBindFramebuffer glad_glBindFramebuffer -GLAD_API_CALL PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer; -#define glBindRenderbuffer glad_glBindRenderbuffer -GLAD_API_CALL PFNGLBINDSAMPLERPROC glad_glBindSampler; -#define glBindSampler glad_glBindSampler -GLAD_API_CALL PFNGLBINDTEXTUREPROC glad_glBindTexture; -#define glBindTexture glad_glBindTexture -GLAD_API_CALL PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray; -#define glBindVertexArray glad_glBindVertexArray -GLAD_API_CALL PFNGLBITMAPPROC glad_glBitmap; -#define glBitmap glad_glBitmap -GLAD_API_CALL PFNGLBLENDCOLORPROC glad_glBlendColor; -#define glBlendColor glad_glBlendColor -GLAD_API_CALL PFNGLBLENDEQUATIONPROC glad_glBlendEquation; -#define glBlendEquation glad_glBlendEquation -GLAD_API_CALL PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate; -#define glBlendEquationSeparate glad_glBlendEquationSeparate -GLAD_API_CALL PFNGLBLENDFUNCPROC glad_glBlendFunc; -#define glBlendFunc glad_glBlendFunc -GLAD_API_CALL PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate; -#define glBlendFuncSeparate glad_glBlendFuncSeparate -GLAD_API_CALL PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer; -#define glBlitFramebuffer glad_glBlitFramebuffer -GLAD_API_CALL PFNGLBUFFERDATAPROC glad_glBufferData; -#define glBufferData glad_glBufferData -GLAD_API_CALL PFNGLBUFFERSUBDATAPROC glad_glBufferSubData; -#define glBufferSubData glad_glBufferSubData -GLAD_API_CALL PFNGLCALLLISTPROC glad_glCallList; -#define glCallList glad_glCallList -GLAD_API_CALL PFNGLCALLLISTSPROC glad_glCallLists; -#define glCallLists glad_glCallLists -GLAD_API_CALL PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus; -#define glCheckFramebufferStatus glad_glCheckFramebufferStatus -GLAD_API_CALL PFNGLCLAMPCOLORPROC glad_glClampColor; -#define glClampColor glad_glClampColor -GLAD_API_CALL PFNGLCLEARPROC glad_glClear; -#define glClear glad_glClear -GLAD_API_CALL PFNGLCLEARACCUMPROC glad_glClearAccum; -#define glClearAccum glad_glClearAccum -GLAD_API_CALL PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi; -#define glClearBufferfi glad_glClearBufferfi -GLAD_API_CALL PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv; -#define glClearBufferfv glad_glClearBufferfv -GLAD_API_CALL PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv; -#define glClearBufferiv glad_glClearBufferiv -GLAD_API_CALL PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv; -#define glClearBufferuiv glad_glClearBufferuiv -GLAD_API_CALL PFNGLCLEARCOLORPROC glad_glClearColor; -#define glClearColor glad_glClearColor -GLAD_API_CALL PFNGLCLEARDEPTHPROC glad_glClearDepth; -#define glClearDepth glad_glClearDepth -GLAD_API_CALL PFNGLCLEARINDEXPROC glad_glClearIndex; -#define glClearIndex glad_glClearIndex -GLAD_API_CALL PFNGLCLEARSTENCILPROC glad_glClearStencil; -#define glClearStencil glad_glClearStencil -GLAD_API_CALL PFNGLCLIENTACTIVETEXTUREPROC glad_glClientActiveTexture; -#define glClientActiveTexture glad_glClientActiveTexture -GLAD_API_CALL PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync; -#define glClientWaitSync glad_glClientWaitSync -GLAD_API_CALL PFNGLCLIPPLANEPROC glad_glClipPlane; -#define glClipPlane glad_glClipPlane -GLAD_API_CALL PFNGLCOLOR3BPROC glad_glColor3b; -#define glColor3b glad_glColor3b -GLAD_API_CALL PFNGLCOLOR3BVPROC glad_glColor3bv; -#define glColor3bv glad_glColor3bv -GLAD_API_CALL PFNGLCOLOR3DPROC glad_glColor3d; -#define glColor3d glad_glColor3d -GLAD_API_CALL PFNGLCOLOR3DVPROC glad_glColor3dv; -#define glColor3dv glad_glColor3dv -GLAD_API_CALL PFNGLCOLOR3FPROC glad_glColor3f; -#define glColor3f glad_glColor3f -GLAD_API_CALL PFNGLCOLOR3FVPROC glad_glColor3fv; -#define glColor3fv glad_glColor3fv -GLAD_API_CALL PFNGLCOLOR3IPROC glad_glColor3i; -#define glColor3i glad_glColor3i -GLAD_API_CALL PFNGLCOLOR3IVPROC glad_glColor3iv; -#define glColor3iv glad_glColor3iv -GLAD_API_CALL PFNGLCOLOR3SPROC glad_glColor3s; -#define glColor3s glad_glColor3s -GLAD_API_CALL PFNGLCOLOR3SVPROC glad_glColor3sv; -#define glColor3sv glad_glColor3sv -GLAD_API_CALL PFNGLCOLOR3UBPROC glad_glColor3ub; -#define glColor3ub glad_glColor3ub -GLAD_API_CALL PFNGLCOLOR3UBVPROC glad_glColor3ubv; -#define glColor3ubv glad_glColor3ubv -GLAD_API_CALL PFNGLCOLOR3UIPROC glad_glColor3ui; -#define glColor3ui glad_glColor3ui -GLAD_API_CALL PFNGLCOLOR3UIVPROC glad_glColor3uiv; -#define glColor3uiv glad_glColor3uiv -GLAD_API_CALL PFNGLCOLOR3USPROC glad_glColor3us; -#define glColor3us glad_glColor3us -GLAD_API_CALL PFNGLCOLOR3USVPROC glad_glColor3usv; -#define glColor3usv glad_glColor3usv -GLAD_API_CALL PFNGLCOLOR4BPROC glad_glColor4b; -#define glColor4b glad_glColor4b -GLAD_API_CALL PFNGLCOLOR4BVPROC glad_glColor4bv; -#define glColor4bv glad_glColor4bv -GLAD_API_CALL PFNGLCOLOR4DPROC glad_glColor4d; -#define glColor4d glad_glColor4d -GLAD_API_CALL PFNGLCOLOR4DVPROC glad_glColor4dv; -#define glColor4dv glad_glColor4dv -GLAD_API_CALL PFNGLCOLOR4FPROC glad_glColor4f; -#define glColor4f glad_glColor4f -GLAD_API_CALL PFNGLCOLOR4FVPROC glad_glColor4fv; -#define glColor4fv glad_glColor4fv -GLAD_API_CALL PFNGLCOLOR4IPROC glad_glColor4i; -#define glColor4i glad_glColor4i -GLAD_API_CALL PFNGLCOLOR4IVPROC glad_glColor4iv; -#define glColor4iv glad_glColor4iv -GLAD_API_CALL PFNGLCOLOR4SPROC glad_glColor4s; -#define glColor4s glad_glColor4s -GLAD_API_CALL PFNGLCOLOR4SVPROC glad_glColor4sv; -#define glColor4sv glad_glColor4sv -GLAD_API_CALL PFNGLCOLOR4UBPROC glad_glColor4ub; -#define glColor4ub glad_glColor4ub -GLAD_API_CALL PFNGLCOLOR4UBVPROC glad_glColor4ubv; -#define glColor4ubv glad_glColor4ubv -GLAD_API_CALL PFNGLCOLOR4UIPROC glad_glColor4ui; -#define glColor4ui glad_glColor4ui -GLAD_API_CALL PFNGLCOLOR4UIVPROC glad_glColor4uiv; -#define glColor4uiv glad_glColor4uiv -GLAD_API_CALL PFNGLCOLOR4USPROC glad_glColor4us; -#define glColor4us glad_glColor4us -GLAD_API_CALL PFNGLCOLOR4USVPROC glad_glColor4usv; -#define glColor4usv glad_glColor4usv -GLAD_API_CALL PFNGLCOLORMASKPROC glad_glColorMask; -#define glColorMask glad_glColorMask -GLAD_API_CALL PFNGLCOLORMASKIPROC glad_glColorMaski; -#define glColorMaski glad_glColorMaski -GLAD_API_CALL PFNGLCOLORMATERIALPROC glad_glColorMaterial; -#define glColorMaterial glad_glColorMaterial -GLAD_API_CALL PFNGLCOLORP3UIPROC glad_glColorP3ui; -#define glColorP3ui glad_glColorP3ui -GLAD_API_CALL PFNGLCOLORP3UIVPROC glad_glColorP3uiv; -#define glColorP3uiv glad_glColorP3uiv -GLAD_API_CALL PFNGLCOLORP4UIPROC glad_glColorP4ui; -#define glColorP4ui glad_glColorP4ui -GLAD_API_CALL PFNGLCOLORP4UIVPROC glad_glColorP4uiv; -#define glColorP4uiv glad_glColorP4uiv -GLAD_API_CALL PFNGLCOLORPOINTERPROC glad_glColorPointer; -#define glColorPointer glad_glColorPointer -GLAD_API_CALL PFNGLCOMPILESHADERPROC glad_glCompileShader; -#define glCompileShader glad_glCompileShader -GLAD_API_CALL PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D; -#define glCompressedTexImage1D glad_glCompressedTexImage1D -GLAD_API_CALL PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D; -#define glCompressedTexImage2D glad_glCompressedTexImage2D -GLAD_API_CALL PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D; -#define glCompressedTexImage3D glad_glCompressedTexImage3D -GLAD_API_CALL PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D; -#define glCompressedTexSubImage1D glad_glCompressedTexSubImage1D -GLAD_API_CALL PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D; -#define glCompressedTexSubImage2D glad_glCompressedTexSubImage2D -GLAD_API_CALL PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D; -#define glCompressedTexSubImage3D glad_glCompressedTexSubImage3D -GLAD_API_CALL PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData; -#define glCopyBufferSubData glad_glCopyBufferSubData -GLAD_API_CALL PFNGLCOPYPIXELSPROC glad_glCopyPixels; -#define glCopyPixels glad_glCopyPixels -GLAD_API_CALL PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D; -#define glCopyTexImage1D glad_glCopyTexImage1D -GLAD_API_CALL PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D; -#define glCopyTexImage2D glad_glCopyTexImage2D -GLAD_API_CALL PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D; -#define glCopyTexSubImage1D glad_glCopyTexSubImage1D -GLAD_API_CALL PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D; -#define glCopyTexSubImage2D glad_glCopyTexSubImage2D -GLAD_API_CALL PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D; -#define glCopyTexSubImage3D glad_glCopyTexSubImage3D -GLAD_API_CALL PFNGLCREATEPROGRAMPROC glad_glCreateProgram; -#define glCreateProgram glad_glCreateProgram -GLAD_API_CALL PFNGLCREATESHADERPROC glad_glCreateShader; -#define glCreateShader glad_glCreateShader -GLAD_API_CALL PFNGLCULLFACEPROC glad_glCullFace; -#define glCullFace glad_glCullFace -GLAD_API_CALL PFNGLDEBUGMESSAGECALLBACKPROC glad_glDebugMessageCallback; -#define glDebugMessageCallback glad_glDebugMessageCallback -GLAD_API_CALL PFNGLDEBUGMESSAGECONTROLPROC glad_glDebugMessageControl; -#define glDebugMessageControl glad_glDebugMessageControl -GLAD_API_CALL PFNGLDEBUGMESSAGEINSERTPROC glad_glDebugMessageInsert; -#define glDebugMessageInsert glad_glDebugMessageInsert -GLAD_API_CALL PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers; -#define glDeleteBuffers glad_glDeleteBuffers -GLAD_API_CALL PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers; -#define glDeleteFramebuffers glad_glDeleteFramebuffers -GLAD_API_CALL PFNGLDELETELISTSPROC glad_glDeleteLists; -#define glDeleteLists glad_glDeleteLists -GLAD_API_CALL PFNGLDELETEPROGRAMPROC glad_glDeleteProgram; -#define glDeleteProgram glad_glDeleteProgram -GLAD_API_CALL PFNGLDELETEQUERIESPROC glad_glDeleteQueries; -#define glDeleteQueries glad_glDeleteQueries -GLAD_API_CALL PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers; -#define glDeleteRenderbuffers glad_glDeleteRenderbuffers -GLAD_API_CALL PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers; -#define glDeleteSamplers glad_glDeleteSamplers -GLAD_API_CALL PFNGLDELETESHADERPROC glad_glDeleteShader; -#define glDeleteShader glad_glDeleteShader -GLAD_API_CALL PFNGLDELETESYNCPROC glad_glDeleteSync; -#define glDeleteSync glad_glDeleteSync -GLAD_API_CALL PFNGLDELETETEXTURESPROC glad_glDeleteTextures; -#define glDeleteTextures glad_glDeleteTextures -GLAD_API_CALL PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays; -#define glDeleteVertexArrays glad_glDeleteVertexArrays -GLAD_API_CALL PFNGLDEPTHFUNCPROC glad_glDepthFunc; -#define glDepthFunc glad_glDepthFunc -GLAD_API_CALL PFNGLDEPTHMASKPROC glad_glDepthMask; -#define glDepthMask glad_glDepthMask -GLAD_API_CALL PFNGLDEPTHRANGEPROC glad_glDepthRange; -#define glDepthRange glad_glDepthRange -GLAD_API_CALL PFNGLDETACHSHADERPROC glad_glDetachShader; -#define glDetachShader glad_glDetachShader -GLAD_API_CALL PFNGLDISABLEPROC glad_glDisable; -#define glDisable glad_glDisable -GLAD_API_CALL PFNGLDISABLECLIENTSTATEPROC glad_glDisableClientState; -#define glDisableClientState glad_glDisableClientState -GLAD_API_CALL PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray; -#define glDisableVertexAttribArray glad_glDisableVertexAttribArray -GLAD_API_CALL PFNGLDISABLEIPROC glad_glDisablei; -#define glDisablei glad_glDisablei -GLAD_API_CALL PFNGLDRAWARRAYSPROC glad_glDrawArrays; -#define glDrawArrays glad_glDrawArrays -GLAD_API_CALL PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced; -#define glDrawArraysInstanced glad_glDrawArraysInstanced -GLAD_API_CALL PFNGLDRAWBUFFERPROC glad_glDrawBuffer; -#define glDrawBuffer glad_glDrawBuffer -GLAD_API_CALL PFNGLDRAWBUFFERSPROC glad_glDrawBuffers; -#define glDrawBuffers glad_glDrawBuffers -GLAD_API_CALL PFNGLDRAWELEMENTSPROC glad_glDrawElements; -#define glDrawElements glad_glDrawElements -GLAD_API_CALL PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex; -#define glDrawElementsBaseVertex glad_glDrawElementsBaseVertex -GLAD_API_CALL PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced; -#define glDrawElementsInstanced glad_glDrawElementsInstanced -GLAD_API_CALL PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex; -#define glDrawElementsInstancedBaseVertex glad_glDrawElementsInstancedBaseVertex -GLAD_API_CALL PFNGLDRAWPIXELSPROC glad_glDrawPixels; -#define glDrawPixels glad_glDrawPixels -GLAD_API_CALL PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements; -#define glDrawRangeElements glad_glDrawRangeElements -GLAD_API_CALL PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex; -#define glDrawRangeElementsBaseVertex glad_glDrawRangeElementsBaseVertex -GLAD_API_CALL PFNGLEDGEFLAGPROC glad_glEdgeFlag; -#define glEdgeFlag glad_glEdgeFlag -GLAD_API_CALL PFNGLEDGEFLAGPOINTERPROC glad_glEdgeFlagPointer; -#define glEdgeFlagPointer glad_glEdgeFlagPointer -GLAD_API_CALL PFNGLEDGEFLAGVPROC glad_glEdgeFlagv; -#define glEdgeFlagv glad_glEdgeFlagv -GLAD_API_CALL PFNGLENABLEPROC glad_glEnable; -#define glEnable glad_glEnable -GLAD_API_CALL PFNGLENABLECLIENTSTATEPROC glad_glEnableClientState; -#define glEnableClientState glad_glEnableClientState -GLAD_API_CALL PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray; -#define glEnableVertexAttribArray glad_glEnableVertexAttribArray -GLAD_API_CALL PFNGLENABLEIPROC glad_glEnablei; -#define glEnablei glad_glEnablei -GLAD_API_CALL PFNGLENDPROC glad_glEnd; -#define glEnd glad_glEnd -GLAD_API_CALL PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender; -#define glEndConditionalRender glad_glEndConditionalRender -GLAD_API_CALL PFNGLENDLISTPROC glad_glEndList; -#define glEndList glad_glEndList -GLAD_API_CALL PFNGLENDQUERYPROC glad_glEndQuery; -#define glEndQuery glad_glEndQuery -GLAD_API_CALL PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback; -#define glEndTransformFeedback glad_glEndTransformFeedback -GLAD_API_CALL PFNGLEVALCOORD1DPROC glad_glEvalCoord1d; -#define glEvalCoord1d glad_glEvalCoord1d -GLAD_API_CALL PFNGLEVALCOORD1DVPROC glad_glEvalCoord1dv; -#define glEvalCoord1dv glad_glEvalCoord1dv -GLAD_API_CALL PFNGLEVALCOORD1FPROC glad_glEvalCoord1f; -#define glEvalCoord1f glad_glEvalCoord1f -GLAD_API_CALL PFNGLEVALCOORD1FVPROC glad_glEvalCoord1fv; -#define glEvalCoord1fv glad_glEvalCoord1fv -GLAD_API_CALL PFNGLEVALCOORD2DPROC glad_glEvalCoord2d; -#define glEvalCoord2d glad_glEvalCoord2d -GLAD_API_CALL PFNGLEVALCOORD2DVPROC glad_glEvalCoord2dv; -#define glEvalCoord2dv glad_glEvalCoord2dv -GLAD_API_CALL PFNGLEVALCOORD2FPROC glad_glEvalCoord2f; -#define glEvalCoord2f glad_glEvalCoord2f -GLAD_API_CALL PFNGLEVALCOORD2FVPROC glad_glEvalCoord2fv; -#define glEvalCoord2fv glad_glEvalCoord2fv -GLAD_API_CALL PFNGLEVALMESH1PROC glad_glEvalMesh1; -#define glEvalMesh1 glad_glEvalMesh1 -GLAD_API_CALL PFNGLEVALMESH2PROC glad_glEvalMesh2; -#define glEvalMesh2 glad_glEvalMesh2 -GLAD_API_CALL PFNGLEVALPOINT1PROC glad_glEvalPoint1; -#define glEvalPoint1 glad_glEvalPoint1 -GLAD_API_CALL PFNGLEVALPOINT2PROC glad_glEvalPoint2; -#define glEvalPoint2 glad_glEvalPoint2 -GLAD_API_CALL PFNGLFEEDBACKBUFFERPROC glad_glFeedbackBuffer; -#define glFeedbackBuffer glad_glFeedbackBuffer -GLAD_API_CALL PFNGLFENCESYNCPROC glad_glFenceSync; -#define glFenceSync glad_glFenceSync -GLAD_API_CALL PFNGLFINISHPROC glad_glFinish; -#define glFinish glad_glFinish -GLAD_API_CALL PFNGLFLUSHPROC glad_glFlush; -#define glFlush glad_glFlush -GLAD_API_CALL PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange; -#define glFlushMappedBufferRange glad_glFlushMappedBufferRange -GLAD_API_CALL PFNGLFOGCOORDPOINTERPROC glad_glFogCoordPointer; -#define glFogCoordPointer glad_glFogCoordPointer -GLAD_API_CALL PFNGLFOGCOORDDPROC glad_glFogCoordd; -#define glFogCoordd glad_glFogCoordd -GLAD_API_CALL PFNGLFOGCOORDDVPROC glad_glFogCoorddv; -#define glFogCoorddv glad_glFogCoorddv -GLAD_API_CALL PFNGLFOGCOORDFPROC glad_glFogCoordf; -#define glFogCoordf glad_glFogCoordf -GLAD_API_CALL PFNGLFOGCOORDFVPROC glad_glFogCoordfv; -#define glFogCoordfv glad_glFogCoordfv -GLAD_API_CALL PFNGLFOGFPROC glad_glFogf; -#define glFogf glad_glFogf -GLAD_API_CALL PFNGLFOGFVPROC glad_glFogfv; -#define glFogfv glad_glFogfv -GLAD_API_CALL PFNGLFOGIPROC glad_glFogi; -#define glFogi glad_glFogi -GLAD_API_CALL PFNGLFOGIVPROC glad_glFogiv; -#define glFogiv glad_glFogiv -GLAD_API_CALL PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer; -#define glFramebufferRenderbuffer glad_glFramebufferRenderbuffer -GLAD_API_CALL PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture; -#define glFramebufferTexture glad_glFramebufferTexture -GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D; -#define glFramebufferTexture1D glad_glFramebufferTexture1D -GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D; -#define glFramebufferTexture2D glad_glFramebufferTexture2D -GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D; -#define glFramebufferTexture3D glad_glFramebufferTexture3D -GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer; -#define glFramebufferTextureLayer glad_glFramebufferTextureLayer -GLAD_API_CALL PFNGLFRONTFACEPROC glad_glFrontFace; -#define glFrontFace glad_glFrontFace -GLAD_API_CALL PFNGLFRUSTUMPROC glad_glFrustum; -#define glFrustum glad_glFrustum -GLAD_API_CALL PFNGLGENBUFFERSPROC glad_glGenBuffers; -#define glGenBuffers glad_glGenBuffers -GLAD_API_CALL PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers; -#define glGenFramebuffers glad_glGenFramebuffers -GLAD_API_CALL PFNGLGENLISTSPROC glad_glGenLists; -#define glGenLists glad_glGenLists -GLAD_API_CALL PFNGLGENQUERIESPROC glad_glGenQueries; -#define glGenQueries glad_glGenQueries -GLAD_API_CALL PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers; -#define glGenRenderbuffers glad_glGenRenderbuffers -GLAD_API_CALL PFNGLGENSAMPLERSPROC glad_glGenSamplers; -#define glGenSamplers glad_glGenSamplers -GLAD_API_CALL PFNGLGENTEXTURESPROC glad_glGenTextures; -#define glGenTextures glad_glGenTextures -GLAD_API_CALL PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays; -#define glGenVertexArrays glad_glGenVertexArrays -GLAD_API_CALL PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap; -#define glGenerateMipmap glad_glGenerateMipmap -GLAD_API_CALL PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib; -#define glGetActiveAttrib glad_glGetActiveAttrib -GLAD_API_CALL PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform; -#define glGetActiveUniform glad_glGetActiveUniform -GLAD_API_CALL PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName; -#define glGetActiveUniformBlockName glad_glGetActiveUniformBlockName -GLAD_API_CALL PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv; -#define glGetActiveUniformBlockiv glad_glGetActiveUniformBlockiv -GLAD_API_CALL PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName; -#define glGetActiveUniformName glad_glGetActiveUniformName -GLAD_API_CALL PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv; -#define glGetActiveUniformsiv glad_glGetActiveUniformsiv -GLAD_API_CALL PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders; -#define glGetAttachedShaders glad_glGetAttachedShaders -GLAD_API_CALL PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation; -#define glGetAttribLocation glad_glGetAttribLocation -GLAD_API_CALL PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v; -#define glGetBooleani_v glad_glGetBooleani_v -GLAD_API_CALL PFNGLGETBOOLEANVPROC glad_glGetBooleanv; -#define glGetBooleanv glad_glGetBooleanv -GLAD_API_CALL PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v; -#define glGetBufferParameteri64v glad_glGetBufferParameteri64v -GLAD_API_CALL PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv; -#define glGetBufferParameteriv glad_glGetBufferParameteriv -GLAD_API_CALL PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv; -#define glGetBufferPointerv glad_glGetBufferPointerv -GLAD_API_CALL PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData; -#define glGetBufferSubData glad_glGetBufferSubData -GLAD_API_CALL PFNGLGETCLIPPLANEPROC glad_glGetClipPlane; -#define glGetClipPlane glad_glGetClipPlane -GLAD_API_CALL PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage; -#define glGetCompressedTexImage glad_glGetCompressedTexImage -GLAD_API_CALL PFNGLGETDEBUGMESSAGELOGPROC glad_glGetDebugMessageLog; -#define glGetDebugMessageLog glad_glGetDebugMessageLog -GLAD_API_CALL PFNGLGETDOUBLEVPROC glad_glGetDoublev; -#define glGetDoublev glad_glGetDoublev -GLAD_API_CALL PFNGLGETERRORPROC glad_glGetError; -#define glGetError glad_glGetError -GLAD_API_CALL PFNGLGETFLOATVPROC glad_glGetFloatv; -#define glGetFloatv glad_glGetFloatv -GLAD_API_CALL PFNGLGETFRAGDATAINDEXPROC glad_glGetFragDataIndex; -#define glGetFragDataIndex glad_glGetFragDataIndex -GLAD_API_CALL PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation; -#define glGetFragDataLocation glad_glGetFragDataLocation -GLAD_API_CALL PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv; -#define glGetFramebufferAttachmentParameteriv glad_glGetFramebufferAttachmentParameteriv -GLAD_API_CALL PFNGLGETGRAPHICSRESETSTATUSARBPROC glad_glGetGraphicsResetStatusARB; -#define glGetGraphicsResetStatusARB glad_glGetGraphicsResetStatusARB -GLAD_API_CALL PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v; -#define glGetInteger64i_v glad_glGetInteger64i_v -GLAD_API_CALL PFNGLGETINTEGER64VPROC glad_glGetInteger64v; -#define glGetInteger64v glad_glGetInteger64v -GLAD_API_CALL PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v; -#define glGetIntegeri_v glad_glGetIntegeri_v -GLAD_API_CALL PFNGLGETINTEGERVPROC glad_glGetIntegerv; -#define glGetIntegerv glad_glGetIntegerv -GLAD_API_CALL PFNGLGETLIGHTFVPROC glad_glGetLightfv; -#define glGetLightfv glad_glGetLightfv -GLAD_API_CALL PFNGLGETLIGHTIVPROC glad_glGetLightiv; -#define glGetLightiv glad_glGetLightiv -GLAD_API_CALL PFNGLGETMAPDVPROC glad_glGetMapdv; -#define glGetMapdv glad_glGetMapdv -GLAD_API_CALL PFNGLGETMAPFVPROC glad_glGetMapfv; -#define glGetMapfv glad_glGetMapfv -GLAD_API_CALL PFNGLGETMAPIVPROC glad_glGetMapiv; -#define glGetMapiv glad_glGetMapiv -GLAD_API_CALL PFNGLGETMATERIALFVPROC glad_glGetMaterialfv; -#define glGetMaterialfv glad_glGetMaterialfv -GLAD_API_CALL PFNGLGETMATERIALIVPROC glad_glGetMaterialiv; -#define glGetMaterialiv glad_glGetMaterialiv -GLAD_API_CALL PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv; -#define glGetMultisamplefv glad_glGetMultisamplefv -GLAD_API_CALL PFNGLGETOBJECTLABELPROC glad_glGetObjectLabel; -#define glGetObjectLabel glad_glGetObjectLabel -GLAD_API_CALL PFNGLGETOBJECTPTRLABELPROC glad_glGetObjectPtrLabel; -#define glGetObjectPtrLabel glad_glGetObjectPtrLabel -GLAD_API_CALL PFNGLGETPIXELMAPFVPROC glad_glGetPixelMapfv; -#define glGetPixelMapfv glad_glGetPixelMapfv -GLAD_API_CALL PFNGLGETPIXELMAPUIVPROC glad_glGetPixelMapuiv; -#define glGetPixelMapuiv glad_glGetPixelMapuiv -GLAD_API_CALL PFNGLGETPIXELMAPUSVPROC glad_glGetPixelMapusv; -#define glGetPixelMapusv glad_glGetPixelMapusv -GLAD_API_CALL PFNGLGETPOINTERVPROC glad_glGetPointerv; -#define glGetPointerv glad_glGetPointerv -GLAD_API_CALL PFNGLGETPOLYGONSTIPPLEPROC glad_glGetPolygonStipple; -#define glGetPolygonStipple glad_glGetPolygonStipple -GLAD_API_CALL PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog; -#define glGetProgramInfoLog glad_glGetProgramInfoLog -GLAD_API_CALL PFNGLGETPROGRAMIVPROC glad_glGetProgramiv; -#define glGetProgramiv glad_glGetProgramiv -GLAD_API_CALL PFNGLGETQUERYOBJECTI64VPROC glad_glGetQueryObjecti64v; -#define glGetQueryObjecti64v glad_glGetQueryObjecti64v -GLAD_API_CALL PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv; -#define glGetQueryObjectiv glad_glGetQueryObjectiv -GLAD_API_CALL PFNGLGETQUERYOBJECTUI64VPROC glad_glGetQueryObjectui64v; -#define glGetQueryObjectui64v glad_glGetQueryObjectui64v -GLAD_API_CALL PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv; -#define glGetQueryObjectuiv glad_glGetQueryObjectuiv -GLAD_API_CALL PFNGLGETQUERYIVPROC glad_glGetQueryiv; -#define glGetQueryiv glad_glGetQueryiv -GLAD_API_CALL PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv; -#define glGetRenderbufferParameteriv glad_glGetRenderbufferParameteriv -GLAD_API_CALL PFNGLGETSAMPLERPARAMETERIIVPROC glad_glGetSamplerParameterIiv; -#define glGetSamplerParameterIiv glad_glGetSamplerParameterIiv -GLAD_API_CALL PFNGLGETSAMPLERPARAMETERIUIVPROC glad_glGetSamplerParameterIuiv; -#define glGetSamplerParameterIuiv glad_glGetSamplerParameterIuiv -GLAD_API_CALL PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv; -#define glGetSamplerParameterfv glad_glGetSamplerParameterfv -GLAD_API_CALL PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv; -#define glGetSamplerParameteriv glad_glGetSamplerParameteriv -GLAD_API_CALL PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog; -#define glGetShaderInfoLog glad_glGetShaderInfoLog -GLAD_API_CALL PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource; -#define glGetShaderSource glad_glGetShaderSource -GLAD_API_CALL PFNGLGETSHADERIVPROC glad_glGetShaderiv; -#define glGetShaderiv glad_glGetShaderiv -GLAD_API_CALL PFNGLGETSTRINGPROC glad_glGetString; -#define glGetString glad_glGetString -GLAD_API_CALL PFNGLGETSTRINGIPROC glad_glGetStringi; -#define glGetStringi glad_glGetStringi -GLAD_API_CALL PFNGLGETSYNCIVPROC glad_glGetSynciv; -#define glGetSynciv glad_glGetSynciv -GLAD_API_CALL PFNGLGETTEXENVFVPROC glad_glGetTexEnvfv; -#define glGetTexEnvfv glad_glGetTexEnvfv -GLAD_API_CALL PFNGLGETTEXENVIVPROC glad_glGetTexEnviv; -#define glGetTexEnviv glad_glGetTexEnviv -GLAD_API_CALL PFNGLGETTEXGENDVPROC glad_glGetTexGendv; -#define glGetTexGendv glad_glGetTexGendv -GLAD_API_CALL PFNGLGETTEXGENFVPROC glad_glGetTexGenfv; -#define glGetTexGenfv glad_glGetTexGenfv -GLAD_API_CALL PFNGLGETTEXGENIVPROC glad_glGetTexGeniv; -#define glGetTexGeniv glad_glGetTexGeniv -GLAD_API_CALL PFNGLGETTEXIMAGEPROC glad_glGetTexImage; -#define glGetTexImage glad_glGetTexImage -GLAD_API_CALL PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv; -#define glGetTexLevelParameterfv glad_glGetTexLevelParameterfv -GLAD_API_CALL PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv; -#define glGetTexLevelParameteriv glad_glGetTexLevelParameteriv -GLAD_API_CALL PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv; -#define glGetTexParameterIiv glad_glGetTexParameterIiv -GLAD_API_CALL PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv; -#define glGetTexParameterIuiv glad_glGetTexParameterIuiv -GLAD_API_CALL PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv; -#define glGetTexParameterfv glad_glGetTexParameterfv -GLAD_API_CALL PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv; -#define glGetTexParameteriv glad_glGetTexParameteriv -GLAD_API_CALL PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying; -#define glGetTransformFeedbackVarying glad_glGetTransformFeedbackVarying -GLAD_API_CALL PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex; -#define glGetUniformBlockIndex glad_glGetUniformBlockIndex -GLAD_API_CALL PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices; -#define glGetUniformIndices glad_glGetUniformIndices -GLAD_API_CALL PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation; -#define glGetUniformLocation glad_glGetUniformLocation -GLAD_API_CALL PFNGLGETUNIFORMFVPROC glad_glGetUniformfv; -#define glGetUniformfv glad_glGetUniformfv -GLAD_API_CALL PFNGLGETUNIFORMIVPROC glad_glGetUniformiv; -#define glGetUniformiv glad_glGetUniformiv -GLAD_API_CALL PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv; -#define glGetUniformuiv glad_glGetUniformuiv -GLAD_API_CALL PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv; -#define glGetVertexAttribIiv glad_glGetVertexAttribIiv -GLAD_API_CALL PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv; -#define glGetVertexAttribIuiv glad_glGetVertexAttribIuiv -GLAD_API_CALL PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv; -#define glGetVertexAttribPointerv glad_glGetVertexAttribPointerv -GLAD_API_CALL PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv; -#define glGetVertexAttribdv glad_glGetVertexAttribdv -GLAD_API_CALL PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv; -#define glGetVertexAttribfv glad_glGetVertexAttribfv -GLAD_API_CALL PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv; -#define glGetVertexAttribiv glad_glGetVertexAttribiv -GLAD_API_CALL PFNGLGETNCOLORTABLEARBPROC glad_glGetnColorTableARB; -#define glGetnColorTableARB glad_glGetnColorTableARB -GLAD_API_CALL PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC glad_glGetnCompressedTexImageARB; -#define glGetnCompressedTexImageARB glad_glGetnCompressedTexImageARB -GLAD_API_CALL PFNGLGETNCONVOLUTIONFILTERARBPROC glad_glGetnConvolutionFilterARB; -#define glGetnConvolutionFilterARB glad_glGetnConvolutionFilterARB -GLAD_API_CALL PFNGLGETNHISTOGRAMARBPROC glad_glGetnHistogramARB; -#define glGetnHistogramARB glad_glGetnHistogramARB -GLAD_API_CALL PFNGLGETNMAPDVARBPROC glad_glGetnMapdvARB; -#define glGetnMapdvARB glad_glGetnMapdvARB -GLAD_API_CALL PFNGLGETNMAPFVARBPROC glad_glGetnMapfvARB; -#define glGetnMapfvARB glad_glGetnMapfvARB -GLAD_API_CALL PFNGLGETNMAPIVARBPROC glad_glGetnMapivARB; -#define glGetnMapivARB glad_glGetnMapivARB -GLAD_API_CALL PFNGLGETNMINMAXARBPROC glad_glGetnMinmaxARB; -#define glGetnMinmaxARB glad_glGetnMinmaxARB -GLAD_API_CALL PFNGLGETNPIXELMAPFVARBPROC glad_glGetnPixelMapfvARB; -#define glGetnPixelMapfvARB glad_glGetnPixelMapfvARB -GLAD_API_CALL PFNGLGETNPIXELMAPUIVARBPROC glad_glGetnPixelMapuivARB; -#define glGetnPixelMapuivARB glad_glGetnPixelMapuivARB -GLAD_API_CALL PFNGLGETNPIXELMAPUSVARBPROC glad_glGetnPixelMapusvARB; -#define glGetnPixelMapusvARB glad_glGetnPixelMapusvARB -GLAD_API_CALL PFNGLGETNPOLYGONSTIPPLEARBPROC glad_glGetnPolygonStippleARB; -#define glGetnPolygonStippleARB glad_glGetnPolygonStippleARB -GLAD_API_CALL PFNGLGETNSEPARABLEFILTERARBPROC glad_glGetnSeparableFilterARB; -#define glGetnSeparableFilterARB glad_glGetnSeparableFilterARB -GLAD_API_CALL PFNGLGETNTEXIMAGEARBPROC glad_glGetnTexImageARB; -#define glGetnTexImageARB glad_glGetnTexImageARB -GLAD_API_CALL PFNGLGETNUNIFORMDVARBPROC glad_glGetnUniformdvARB; -#define glGetnUniformdvARB glad_glGetnUniformdvARB -GLAD_API_CALL PFNGLGETNUNIFORMFVARBPROC glad_glGetnUniformfvARB; -#define glGetnUniformfvARB glad_glGetnUniformfvARB -GLAD_API_CALL PFNGLGETNUNIFORMIVARBPROC glad_glGetnUniformivARB; -#define glGetnUniformivARB glad_glGetnUniformivARB -GLAD_API_CALL PFNGLGETNUNIFORMUIVARBPROC glad_glGetnUniformuivARB; -#define glGetnUniformuivARB glad_glGetnUniformuivARB -GLAD_API_CALL PFNGLHINTPROC glad_glHint; -#define glHint glad_glHint -GLAD_API_CALL PFNGLINDEXMASKPROC glad_glIndexMask; -#define glIndexMask glad_glIndexMask -GLAD_API_CALL PFNGLINDEXPOINTERPROC glad_glIndexPointer; -#define glIndexPointer glad_glIndexPointer -GLAD_API_CALL PFNGLINDEXDPROC glad_glIndexd; -#define glIndexd glad_glIndexd -GLAD_API_CALL PFNGLINDEXDVPROC glad_glIndexdv; -#define glIndexdv glad_glIndexdv -GLAD_API_CALL PFNGLINDEXFPROC glad_glIndexf; -#define glIndexf glad_glIndexf -GLAD_API_CALL PFNGLINDEXFVPROC glad_glIndexfv; -#define glIndexfv glad_glIndexfv -GLAD_API_CALL PFNGLINDEXIPROC glad_glIndexi; -#define glIndexi glad_glIndexi -GLAD_API_CALL PFNGLINDEXIVPROC glad_glIndexiv; -#define glIndexiv glad_glIndexiv -GLAD_API_CALL PFNGLINDEXSPROC glad_glIndexs; -#define glIndexs glad_glIndexs -GLAD_API_CALL PFNGLINDEXSVPROC glad_glIndexsv; -#define glIndexsv glad_glIndexsv -GLAD_API_CALL PFNGLINDEXUBPROC glad_glIndexub; -#define glIndexub glad_glIndexub -GLAD_API_CALL PFNGLINDEXUBVPROC glad_glIndexubv; -#define glIndexubv glad_glIndexubv -GLAD_API_CALL PFNGLINITNAMESPROC glad_glInitNames; -#define glInitNames glad_glInitNames -GLAD_API_CALL PFNGLINTERLEAVEDARRAYSPROC glad_glInterleavedArrays; -#define glInterleavedArrays glad_glInterleavedArrays -GLAD_API_CALL PFNGLISBUFFERPROC glad_glIsBuffer; -#define glIsBuffer glad_glIsBuffer -GLAD_API_CALL PFNGLISENABLEDPROC glad_glIsEnabled; -#define glIsEnabled glad_glIsEnabled -GLAD_API_CALL PFNGLISENABLEDIPROC glad_glIsEnabledi; -#define glIsEnabledi glad_glIsEnabledi -GLAD_API_CALL PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer; -#define glIsFramebuffer glad_glIsFramebuffer -GLAD_API_CALL PFNGLISLISTPROC glad_glIsList; -#define glIsList glad_glIsList -GLAD_API_CALL PFNGLISPROGRAMPROC glad_glIsProgram; -#define glIsProgram glad_glIsProgram -GLAD_API_CALL PFNGLISQUERYPROC glad_glIsQuery; -#define glIsQuery glad_glIsQuery -GLAD_API_CALL PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer; -#define glIsRenderbuffer glad_glIsRenderbuffer -GLAD_API_CALL PFNGLISSAMPLERPROC glad_glIsSampler; -#define glIsSampler glad_glIsSampler -GLAD_API_CALL PFNGLISSHADERPROC glad_glIsShader; -#define glIsShader glad_glIsShader -GLAD_API_CALL PFNGLISSYNCPROC glad_glIsSync; -#define glIsSync glad_glIsSync -GLAD_API_CALL PFNGLISTEXTUREPROC glad_glIsTexture; -#define glIsTexture glad_glIsTexture -GLAD_API_CALL PFNGLISVERTEXARRAYPROC glad_glIsVertexArray; -#define glIsVertexArray glad_glIsVertexArray -GLAD_API_CALL PFNGLLIGHTMODELFPROC glad_glLightModelf; -#define glLightModelf glad_glLightModelf -GLAD_API_CALL PFNGLLIGHTMODELFVPROC glad_glLightModelfv; -#define glLightModelfv glad_glLightModelfv -GLAD_API_CALL PFNGLLIGHTMODELIPROC glad_glLightModeli; -#define glLightModeli glad_glLightModeli -GLAD_API_CALL PFNGLLIGHTMODELIVPROC glad_glLightModeliv; -#define glLightModeliv glad_glLightModeliv -GLAD_API_CALL PFNGLLIGHTFPROC glad_glLightf; -#define glLightf glad_glLightf -GLAD_API_CALL PFNGLLIGHTFVPROC glad_glLightfv; -#define glLightfv glad_glLightfv -GLAD_API_CALL PFNGLLIGHTIPROC glad_glLighti; -#define glLighti glad_glLighti -GLAD_API_CALL PFNGLLIGHTIVPROC glad_glLightiv; -#define glLightiv glad_glLightiv -GLAD_API_CALL PFNGLLINESTIPPLEPROC glad_glLineStipple; -#define glLineStipple glad_glLineStipple -GLAD_API_CALL PFNGLLINEWIDTHPROC glad_glLineWidth; -#define glLineWidth glad_glLineWidth -GLAD_API_CALL PFNGLLINKPROGRAMPROC glad_glLinkProgram; -#define glLinkProgram glad_glLinkProgram -GLAD_API_CALL PFNGLLISTBASEPROC glad_glListBase; -#define glListBase glad_glListBase -GLAD_API_CALL PFNGLLOADIDENTITYPROC glad_glLoadIdentity; -#define glLoadIdentity glad_glLoadIdentity -GLAD_API_CALL PFNGLLOADMATRIXDPROC glad_glLoadMatrixd; -#define glLoadMatrixd glad_glLoadMatrixd -GLAD_API_CALL PFNGLLOADMATRIXFPROC glad_glLoadMatrixf; -#define glLoadMatrixf glad_glLoadMatrixf -GLAD_API_CALL PFNGLLOADNAMEPROC glad_glLoadName; -#define glLoadName glad_glLoadName -GLAD_API_CALL PFNGLLOADTRANSPOSEMATRIXDPROC glad_glLoadTransposeMatrixd; -#define glLoadTransposeMatrixd glad_glLoadTransposeMatrixd -GLAD_API_CALL PFNGLLOADTRANSPOSEMATRIXFPROC glad_glLoadTransposeMatrixf; -#define glLoadTransposeMatrixf glad_glLoadTransposeMatrixf -GLAD_API_CALL PFNGLLOGICOPPROC glad_glLogicOp; -#define glLogicOp glad_glLogicOp -GLAD_API_CALL PFNGLMAP1DPROC glad_glMap1d; -#define glMap1d glad_glMap1d -GLAD_API_CALL PFNGLMAP1FPROC glad_glMap1f; -#define glMap1f glad_glMap1f -GLAD_API_CALL PFNGLMAP2DPROC glad_glMap2d; -#define glMap2d glad_glMap2d -GLAD_API_CALL PFNGLMAP2FPROC glad_glMap2f; -#define glMap2f glad_glMap2f -GLAD_API_CALL PFNGLMAPBUFFERPROC glad_glMapBuffer; -#define glMapBuffer glad_glMapBuffer -GLAD_API_CALL PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange; -#define glMapBufferRange glad_glMapBufferRange -GLAD_API_CALL PFNGLMAPGRID1DPROC glad_glMapGrid1d; -#define glMapGrid1d glad_glMapGrid1d -GLAD_API_CALL PFNGLMAPGRID1FPROC glad_glMapGrid1f; -#define glMapGrid1f glad_glMapGrid1f -GLAD_API_CALL PFNGLMAPGRID2DPROC glad_glMapGrid2d; -#define glMapGrid2d glad_glMapGrid2d -GLAD_API_CALL PFNGLMAPGRID2FPROC glad_glMapGrid2f; -#define glMapGrid2f glad_glMapGrid2f -GLAD_API_CALL PFNGLMATERIALFPROC glad_glMaterialf; -#define glMaterialf glad_glMaterialf -GLAD_API_CALL PFNGLMATERIALFVPROC glad_glMaterialfv; -#define glMaterialfv glad_glMaterialfv -GLAD_API_CALL PFNGLMATERIALIPROC glad_glMateriali; -#define glMateriali glad_glMateriali -GLAD_API_CALL PFNGLMATERIALIVPROC glad_glMaterialiv; -#define glMaterialiv glad_glMaterialiv -GLAD_API_CALL PFNGLMATRIXMODEPROC glad_glMatrixMode; -#define glMatrixMode glad_glMatrixMode -GLAD_API_CALL PFNGLMULTMATRIXDPROC glad_glMultMatrixd; -#define glMultMatrixd glad_glMultMatrixd -GLAD_API_CALL PFNGLMULTMATRIXFPROC glad_glMultMatrixf; -#define glMultMatrixf glad_glMultMatrixf -GLAD_API_CALL PFNGLMULTTRANSPOSEMATRIXDPROC glad_glMultTransposeMatrixd; -#define glMultTransposeMatrixd glad_glMultTransposeMatrixd -GLAD_API_CALL PFNGLMULTTRANSPOSEMATRIXFPROC glad_glMultTransposeMatrixf; -#define glMultTransposeMatrixf glad_glMultTransposeMatrixf -GLAD_API_CALL PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays; -#define glMultiDrawArrays glad_glMultiDrawArrays -GLAD_API_CALL PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements; -#define glMultiDrawElements glad_glMultiDrawElements -GLAD_API_CALL PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex; -#define glMultiDrawElementsBaseVertex glad_glMultiDrawElementsBaseVertex -GLAD_API_CALL PFNGLMULTITEXCOORD1DPROC glad_glMultiTexCoord1d; -#define glMultiTexCoord1d glad_glMultiTexCoord1d -GLAD_API_CALL PFNGLMULTITEXCOORD1DVPROC glad_glMultiTexCoord1dv; -#define glMultiTexCoord1dv glad_glMultiTexCoord1dv -GLAD_API_CALL PFNGLMULTITEXCOORD1FPROC glad_glMultiTexCoord1f; -#define glMultiTexCoord1f glad_glMultiTexCoord1f -GLAD_API_CALL PFNGLMULTITEXCOORD1FVPROC glad_glMultiTexCoord1fv; -#define glMultiTexCoord1fv glad_glMultiTexCoord1fv -GLAD_API_CALL PFNGLMULTITEXCOORD1IPROC glad_glMultiTexCoord1i; -#define glMultiTexCoord1i glad_glMultiTexCoord1i -GLAD_API_CALL PFNGLMULTITEXCOORD1IVPROC glad_glMultiTexCoord1iv; -#define glMultiTexCoord1iv glad_glMultiTexCoord1iv -GLAD_API_CALL PFNGLMULTITEXCOORD1SPROC glad_glMultiTexCoord1s; -#define glMultiTexCoord1s glad_glMultiTexCoord1s -GLAD_API_CALL PFNGLMULTITEXCOORD1SVPROC glad_glMultiTexCoord1sv; -#define glMultiTexCoord1sv glad_glMultiTexCoord1sv -GLAD_API_CALL PFNGLMULTITEXCOORD2DPROC glad_glMultiTexCoord2d; -#define glMultiTexCoord2d glad_glMultiTexCoord2d -GLAD_API_CALL PFNGLMULTITEXCOORD2DVPROC glad_glMultiTexCoord2dv; -#define glMultiTexCoord2dv glad_glMultiTexCoord2dv -GLAD_API_CALL PFNGLMULTITEXCOORD2FPROC glad_glMultiTexCoord2f; -#define glMultiTexCoord2f glad_glMultiTexCoord2f -GLAD_API_CALL PFNGLMULTITEXCOORD2FVPROC glad_glMultiTexCoord2fv; -#define glMultiTexCoord2fv glad_glMultiTexCoord2fv -GLAD_API_CALL PFNGLMULTITEXCOORD2IPROC glad_glMultiTexCoord2i; -#define glMultiTexCoord2i glad_glMultiTexCoord2i -GLAD_API_CALL PFNGLMULTITEXCOORD2IVPROC glad_glMultiTexCoord2iv; -#define glMultiTexCoord2iv glad_glMultiTexCoord2iv -GLAD_API_CALL PFNGLMULTITEXCOORD2SPROC glad_glMultiTexCoord2s; -#define glMultiTexCoord2s glad_glMultiTexCoord2s -GLAD_API_CALL PFNGLMULTITEXCOORD2SVPROC glad_glMultiTexCoord2sv; -#define glMultiTexCoord2sv glad_glMultiTexCoord2sv -GLAD_API_CALL PFNGLMULTITEXCOORD3DPROC glad_glMultiTexCoord3d; -#define glMultiTexCoord3d glad_glMultiTexCoord3d -GLAD_API_CALL PFNGLMULTITEXCOORD3DVPROC glad_glMultiTexCoord3dv; -#define glMultiTexCoord3dv glad_glMultiTexCoord3dv -GLAD_API_CALL PFNGLMULTITEXCOORD3FPROC glad_glMultiTexCoord3f; -#define glMultiTexCoord3f glad_glMultiTexCoord3f -GLAD_API_CALL PFNGLMULTITEXCOORD3FVPROC glad_glMultiTexCoord3fv; -#define glMultiTexCoord3fv glad_glMultiTexCoord3fv -GLAD_API_CALL PFNGLMULTITEXCOORD3IPROC glad_glMultiTexCoord3i; -#define glMultiTexCoord3i glad_glMultiTexCoord3i -GLAD_API_CALL PFNGLMULTITEXCOORD3IVPROC glad_glMultiTexCoord3iv; -#define glMultiTexCoord3iv glad_glMultiTexCoord3iv -GLAD_API_CALL PFNGLMULTITEXCOORD3SPROC glad_glMultiTexCoord3s; -#define glMultiTexCoord3s glad_glMultiTexCoord3s -GLAD_API_CALL PFNGLMULTITEXCOORD3SVPROC glad_glMultiTexCoord3sv; -#define glMultiTexCoord3sv glad_glMultiTexCoord3sv -GLAD_API_CALL PFNGLMULTITEXCOORD4DPROC glad_glMultiTexCoord4d; -#define glMultiTexCoord4d glad_glMultiTexCoord4d -GLAD_API_CALL PFNGLMULTITEXCOORD4DVPROC glad_glMultiTexCoord4dv; -#define glMultiTexCoord4dv glad_glMultiTexCoord4dv -GLAD_API_CALL PFNGLMULTITEXCOORD4FPROC glad_glMultiTexCoord4f; -#define glMultiTexCoord4f glad_glMultiTexCoord4f -GLAD_API_CALL PFNGLMULTITEXCOORD4FVPROC glad_glMultiTexCoord4fv; -#define glMultiTexCoord4fv glad_glMultiTexCoord4fv -GLAD_API_CALL PFNGLMULTITEXCOORD4IPROC glad_glMultiTexCoord4i; -#define glMultiTexCoord4i glad_glMultiTexCoord4i -GLAD_API_CALL PFNGLMULTITEXCOORD4IVPROC glad_glMultiTexCoord4iv; -#define glMultiTexCoord4iv glad_glMultiTexCoord4iv -GLAD_API_CALL PFNGLMULTITEXCOORD4SPROC glad_glMultiTexCoord4s; -#define glMultiTexCoord4s glad_glMultiTexCoord4s -GLAD_API_CALL PFNGLMULTITEXCOORD4SVPROC glad_glMultiTexCoord4sv; -#define glMultiTexCoord4sv glad_glMultiTexCoord4sv -GLAD_API_CALL PFNGLMULTITEXCOORDP1UIPROC glad_glMultiTexCoordP1ui; -#define glMultiTexCoordP1ui glad_glMultiTexCoordP1ui -GLAD_API_CALL PFNGLMULTITEXCOORDP1UIVPROC glad_glMultiTexCoordP1uiv; -#define glMultiTexCoordP1uiv glad_glMultiTexCoordP1uiv -GLAD_API_CALL PFNGLMULTITEXCOORDP2UIPROC glad_glMultiTexCoordP2ui; -#define glMultiTexCoordP2ui glad_glMultiTexCoordP2ui -GLAD_API_CALL PFNGLMULTITEXCOORDP2UIVPROC glad_glMultiTexCoordP2uiv; -#define glMultiTexCoordP2uiv glad_glMultiTexCoordP2uiv -GLAD_API_CALL PFNGLMULTITEXCOORDP3UIPROC glad_glMultiTexCoordP3ui; -#define glMultiTexCoordP3ui glad_glMultiTexCoordP3ui -GLAD_API_CALL PFNGLMULTITEXCOORDP3UIVPROC glad_glMultiTexCoordP3uiv; -#define glMultiTexCoordP3uiv glad_glMultiTexCoordP3uiv -GLAD_API_CALL PFNGLMULTITEXCOORDP4UIPROC glad_glMultiTexCoordP4ui; -#define glMultiTexCoordP4ui glad_glMultiTexCoordP4ui -GLAD_API_CALL PFNGLMULTITEXCOORDP4UIVPROC glad_glMultiTexCoordP4uiv; -#define glMultiTexCoordP4uiv glad_glMultiTexCoordP4uiv -GLAD_API_CALL PFNGLNEWLISTPROC glad_glNewList; -#define glNewList glad_glNewList -GLAD_API_CALL PFNGLNORMAL3BPROC glad_glNormal3b; -#define glNormal3b glad_glNormal3b -GLAD_API_CALL PFNGLNORMAL3BVPROC glad_glNormal3bv; -#define glNormal3bv glad_glNormal3bv -GLAD_API_CALL PFNGLNORMAL3DPROC glad_glNormal3d; -#define glNormal3d glad_glNormal3d -GLAD_API_CALL PFNGLNORMAL3DVPROC glad_glNormal3dv; -#define glNormal3dv glad_glNormal3dv -GLAD_API_CALL PFNGLNORMAL3FPROC glad_glNormal3f; -#define glNormal3f glad_glNormal3f -GLAD_API_CALL PFNGLNORMAL3FVPROC glad_glNormal3fv; -#define glNormal3fv glad_glNormal3fv -GLAD_API_CALL PFNGLNORMAL3IPROC glad_glNormal3i; -#define glNormal3i glad_glNormal3i -GLAD_API_CALL PFNGLNORMAL3IVPROC glad_glNormal3iv; -#define glNormal3iv glad_glNormal3iv -GLAD_API_CALL PFNGLNORMAL3SPROC glad_glNormal3s; -#define glNormal3s glad_glNormal3s -GLAD_API_CALL PFNGLNORMAL3SVPROC glad_glNormal3sv; -#define glNormal3sv glad_glNormal3sv -GLAD_API_CALL PFNGLNORMALP3UIPROC glad_glNormalP3ui; -#define glNormalP3ui glad_glNormalP3ui -GLAD_API_CALL PFNGLNORMALP3UIVPROC glad_glNormalP3uiv; -#define glNormalP3uiv glad_glNormalP3uiv -GLAD_API_CALL PFNGLNORMALPOINTERPROC glad_glNormalPointer; -#define glNormalPointer glad_glNormalPointer -GLAD_API_CALL PFNGLOBJECTLABELPROC glad_glObjectLabel; -#define glObjectLabel glad_glObjectLabel -GLAD_API_CALL PFNGLOBJECTPTRLABELPROC glad_glObjectPtrLabel; -#define glObjectPtrLabel glad_glObjectPtrLabel -GLAD_API_CALL PFNGLORTHOPROC glad_glOrtho; -#define glOrtho glad_glOrtho -GLAD_API_CALL PFNGLPASSTHROUGHPROC glad_glPassThrough; -#define glPassThrough glad_glPassThrough -GLAD_API_CALL PFNGLPIXELMAPFVPROC glad_glPixelMapfv; -#define glPixelMapfv glad_glPixelMapfv -GLAD_API_CALL PFNGLPIXELMAPUIVPROC glad_glPixelMapuiv; -#define glPixelMapuiv glad_glPixelMapuiv -GLAD_API_CALL PFNGLPIXELMAPUSVPROC glad_glPixelMapusv; -#define glPixelMapusv glad_glPixelMapusv -GLAD_API_CALL PFNGLPIXELSTOREFPROC glad_glPixelStoref; -#define glPixelStoref glad_glPixelStoref -GLAD_API_CALL PFNGLPIXELSTOREIPROC glad_glPixelStorei; -#define glPixelStorei glad_glPixelStorei -GLAD_API_CALL PFNGLPIXELTRANSFERFPROC glad_glPixelTransferf; -#define glPixelTransferf glad_glPixelTransferf -GLAD_API_CALL PFNGLPIXELTRANSFERIPROC glad_glPixelTransferi; -#define glPixelTransferi glad_glPixelTransferi -GLAD_API_CALL PFNGLPIXELZOOMPROC glad_glPixelZoom; -#define glPixelZoom glad_glPixelZoom -GLAD_API_CALL PFNGLPOINTPARAMETERFPROC glad_glPointParameterf; -#define glPointParameterf glad_glPointParameterf -GLAD_API_CALL PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv; -#define glPointParameterfv glad_glPointParameterfv -GLAD_API_CALL PFNGLPOINTPARAMETERIPROC glad_glPointParameteri; -#define glPointParameteri glad_glPointParameteri -GLAD_API_CALL PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv; -#define glPointParameteriv glad_glPointParameteriv -GLAD_API_CALL PFNGLPOINTSIZEPROC glad_glPointSize; -#define glPointSize glad_glPointSize -GLAD_API_CALL PFNGLPOLYGONMODEPROC glad_glPolygonMode; -#define glPolygonMode glad_glPolygonMode -GLAD_API_CALL PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset; -#define glPolygonOffset glad_glPolygonOffset -GLAD_API_CALL PFNGLPOLYGONSTIPPLEPROC glad_glPolygonStipple; -#define glPolygonStipple glad_glPolygonStipple -GLAD_API_CALL PFNGLPOPATTRIBPROC glad_glPopAttrib; -#define glPopAttrib glad_glPopAttrib -GLAD_API_CALL PFNGLPOPCLIENTATTRIBPROC glad_glPopClientAttrib; -#define glPopClientAttrib glad_glPopClientAttrib -GLAD_API_CALL PFNGLPOPDEBUGGROUPPROC glad_glPopDebugGroup; -#define glPopDebugGroup glad_glPopDebugGroup -GLAD_API_CALL PFNGLPOPMATRIXPROC glad_glPopMatrix; -#define glPopMatrix glad_glPopMatrix -GLAD_API_CALL PFNGLPOPNAMEPROC glad_glPopName; -#define glPopName glad_glPopName -GLAD_API_CALL PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex; -#define glPrimitiveRestartIndex glad_glPrimitiveRestartIndex -GLAD_API_CALL PFNGLPRIORITIZETEXTURESPROC glad_glPrioritizeTextures; -#define glPrioritizeTextures glad_glPrioritizeTextures -GLAD_API_CALL PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex; -#define glProvokingVertex glad_glProvokingVertex -GLAD_API_CALL PFNGLPUSHATTRIBPROC glad_glPushAttrib; -#define glPushAttrib glad_glPushAttrib -GLAD_API_CALL PFNGLPUSHCLIENTATTRIBPROC glad_glPushClientAttrib; -#define glPushClientAttrib glad_glPushClientAttrib -GLAD_API_CALL PFNGLPUSHDEBUGGROUPPROC glad_glPushDebugGroup; -#define glPushDebugGroup glad_glPushDebugGroup -GLAD_API_CALL PFNGLPUSHMATRIXPROC glad_glPushMatrix; -#define glPushMatrix glad_glPushMatrix -GLAD_API_CALL PFNGLPUSHNAMEPROC glad_glPushName; -#define glPushName glad_glPushName -GLAD_API_CALL PFNGLQUERYCOUNTERPROC glad_glQueryCounter; -#define glQueryCounter glad_glQueryCounter -GLAD_API_CALL PFNGLRASTERPOS2DPROC glad_glRasterPos2d; -#define glRasterPos2d glad_glRasterPos2d -GLAD_API_CALL PFNGLRASTERPOS2DVPROC glad_glRasterPos2dv; -#define glRasterPos2dv glad_glRasterPos2dv -GLAD_API_CALL PFNGLRASTERPOS2FPROC glad_glRasterPos2f; -#define glRasterPos2f glad_glRasterPos2f -GLAD_API_CALL PFNGLRASTERPOS2FVPROC glad_glRasterPos2fv; -#define glRasterPos2fv glad_glRasterPos2fv -GLAD_API_CALL PFNGLRASTERPOS2IPROC glad_glRasterPos2i; -#define glRasterPos2i glad_glRasterPos2i -GLAD_API_CALL PFNGLRASTERPOS2IVPROC glad_glRasterPos2iv; -#define glRasterPos2iv glad_glRasterPos2iv -GLAD_API_CALL PFNGLRASTERPOS2SPROC glad_glRasterPos2s; -#define glRasterPos2s glad_glRasterPos2s -GLAD_API_CALL PFNGLRASTERPOS2SVPROC glad_glRasterPos2sv; -#define glRasterPos2sv glad_glRasterPos2sv -GLAD_API_CALL PFNGLRASTERPOS3DPROC glad_glRasterPos3d; -#define glRasterPos3d glad_glRasterPos3d -GLAD_API_CALL PFNGLRASTERPOS3DVPROC glad_glRasterPos3dv; -#define glRasterPos3dv glad_glRasterPos3dv -GLAD_API_CALL PFNGLRASTERPOS3FPROC glad_glRasterPos3f; -#define glRasterPos3f glad_glRasterPos3f -GLAD_API_CALL PFNGLRASTERPOS3FVPROC glad_glRasterPos3fv; -#define glRasterPos3fv glad_glRasterPos3fv -GLAD_API_CALL PFNGLRASTERPOS3IPROC glad_glRasterPos3i; -#define glRasterPos3i glad_glRasterPos3i -GLAD_API_CALL PFNGLRASTERPOS3IVPROC glad_glRasterPos3iv; -#define glRasterPos3iv glad_glRasterPos3iv -GLAD_API_CALL PFNGLRASTERPOS3SPROC glad_glRasterPos3s; -#define glRasterPos3s glad_glRasterPos3s -GLAD_API_CALL PFNGLRASTERPOS3SVPROC glad_glRasterPos3sv; -#define glRasterPos3sv glad_glRasterPos3sv -GLAD_API_CALL PFNGLRASTERPOS4DPROC glad_glRasterPos4d; -#define glRasterPos4d glad_glRasterPos4d -GLAD_API_CALL PFNGLRASTERPOS4DVPROC glad_glRasterPos4dv; -#define glRasterPos4dv glad_glRasterPos4dv -GLAD_API_CALL PFNGLRASTERPOS4FPROC glad_glRasterPos4f; -#define glRasterPos4f glad_glRasterPos4f -GLAD_API_CALL PFNGLRASTERPOS4FVPROC glad_glRasterPos4fv; -#define glRasterPos4fv glad_glRasterPos4fv -GLAD_API_CALL PFNGLRASTERPOS4IPROC glad_glRasterPos4i; -#define glRasterPos4i glad_glRasterPos4i -GLAD_API_CALL PFNGLRASTERPOS4IVPROC glad_glRasterPos4iv; -#define glRasterPos4iv glad_glRasterPos4iv -GLAD_API_CALL PFNGLRASTERPOS4SPROC glad_glRasterPos4s; -#define glRasterPos4s glad_glRasterPos4s -GLAD_API_CALL PFNGLRASTERPOS4SVPROC glad_glRasterPos4sv; -#define glRasterPos4sv glad_glRasterPos4sv -GLAD_API_CALL PFNGLREADBUFFERPROC glad_glReadBuffer; -#define glReadBuffer glad_glReadBuffer -GLAD_API_CALL PFNGLREADPIXELSPROC glad_glReadPixels; -#define glReadPixels glad_glReadPixels -GLAD_API_CALL PFNGLREADNPIXELSARBPROC glad_glReadnPixelsARB; -#define glReadnPixelsARB glad_glReadnPixelsARB -GLAD_API_CALL PFNGLRECTDPROC glad_glRectd; -#define glRectd glad_glRectd -GLAD_API_CALL PFNGLRECTDVPROC glad_glRectdv; -#define glRectdv glad_glRectdv -GLAD_API_CALL PFNGLRECTFPROC glad_glRectf; -#define glRectf glad_glRectf -GLAD_API_CALL PFNGLRECTFVPROC glad_glRectfv; -#define glRectfv glad_glRectfv -GLAD_API_CALL PFNGLRECTIPROC glad_glRecti; -#define glRecti glad_glRecti -GLAD_API_CALL PFNGLRECTIVPROC glad_glRectiv; -#define glRectiv glad_glRectiv -GLAD_API_CALL PFNGLRECTSPROC glad_glRects; -#define glRects glad_glRects -GLAD_API_CALL PFNGLRECTSVPROC glad_glRectsv; -#define glRectsv glad_glRectsv -GLAD_API_CALL PFNGLRENDERMODEPROC glad_glRenderMode; -#define glRenderMode glad_glRenderMode -GLAD_API_CALL PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage; -#define glRenderbufferStorage glad_glRenderbufferStorage -GLAD_API_CALL PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample; -#define glRenderbufferStorageMultisample glad_glRenderbufferStorageMultisample -GLAD_API_CALL PFNGLROTATEDPROC glad_glRotated; -#define glRotated glad_glRotated -GLAD_API_CALL PFNGLROTATEFPROC glad_glRotatef; -#define glRotatef glad_glRotatef -GLAD_API_CALL PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage; -#define glSampleCoverage glad_glSampleCoverage -GLAD_API_CALL PFNGLSAMPLECOVERAGEARBPROC glad_glSampleCoverageARB; -#define glSampleCoverageARB glad_glSampleCoverageARB -GLAD_API_CALL PFNGLSAMPLEMASKIPROC glad_glSampleMaski; -#define glSampleMaski glad_glSampleMaski -GLAD_API_CALL PFNGLSAMPLERPARAMETERIIVPROC glad_glSamplerParameterIiv; -#define glSamplerParameterIiv glad_glSamplerParameterIiv -GLAD_API_CALL PFNGLSAMPLERPARAMETERIUIVPROC glad_glSamplerParameterIuiv; -#define glSamplerParameterIuiv glad_glSamplerParameterIuiv -GLAD_API_CALL PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf; -#define glSamplerParameterf glad_glSamplerParameterf -GLAD_API_CALL PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv; -#define glSamplerParameterfv glad_glSamplerParameterfv -GLAD_API_CALL PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri; -#define glSamplerParameteri glad_glSamplerParameteri -GLAD_API_CALL PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv; -#define glSamplerParameteriv glad_glSamplerParameteriv -GLAD_API_CALL PFNGLSCALEDPROC glad_glScaled; -#define glScaled glad_glScaled -GLAD_API_CALL PFNGLSCALEFPROC glad_glScalef; -#define glScalef glad_glScalef -GLAD_API_CALL PFNGLSCISSORPROC glad_glScissor; -#define glScissor glad_glScissor -GLAD_API_CALL PFNGLSECONDARYCOLOR3BPROC glad_glSecondaryColor3b; -#define glSecondaryColor3b glad_glSecondaryColor3b -GLAD_API_CALL PFNGLSECONDARYCOLOR3BVPROC glad_glSecondaryColor3bv; -#define glSecondaryColor3bv glad_glSecondaryColor3bv -GLAD_API_CALL PFNGLSECONDARYCOLOR3DPROC glad_glSecondaryColor3d; -#define glSecondaryColor3d glad_glSecondaryColor3d -GLAD_API_CALL PFNGLSECONDARYCOLOR3DVPROC glad_glSecondaryColor3dv; -#define glSecondaryColor3dv glad_glSecondaryColor3dv -GLAD_API_CALL PFNGLSECONDARYCOLOR3FPROC glad_glSecondaryColor3f; -#define glSecondaryColor3f glad_glSecondaryColor3f -GLAD_API_CALL PFNGLSECONDARYCOLOR3FVPROC glad_glSecondaryColor3fv; -#define glSecondaryColor3fv glad_glSecondaryColor3fv -GLAD_API_CALL PFNGLSECONDARYCOLOR3IPROC glad_glSecondaryColor3i; -#define glSecondaryColor3i glad_glSecondaryColor3i -GLAD_API_CALL PFNGLSECONDARYCOLOR3IVPROC glad_glSecondaryColor3iv; -#define glSecondaryColor3iv glad_glSecondaryColor3iv -GLAD_API_CALL PFNGLSECONDARYCOLOR3SPROC glad_glSecondaryColor3s; -#define glSecondaryColor3s glad_glSecondaryColor3s -GLAD_API_CALL PFNGLSECONDARYCOLOR3SVPROC glad_glSecondaryColor3sv; -#define glSecondaryColor3sv glad_glSecondaryColor3sv -GLAD_API_CALL PFNGLSECONDARYCOLOR3UBPROC glad_glSecondaryColor3ub; -#define glSecondaryColor3ub glad_glSecondaryColor3ub -GLAD_API_CALL PFNGLSECONDARYCOLOR3UBVPROC glad_glSecondaryColor3ubv; -#define glSecondaryColor3ubv glad_glSecondaryColor3ubv -GLAD_API_CALL PFNGLSECONDARYCOLOR3UIPROC glad_glSecondaryColor3ui; -#define glSecondaryColor3ui glad_glSecondaryColor3ui -GLAD_API_CALL PFNGLSECONDARYCOLOR3UIVPROC glad_glSecondaryColor3uiv; -#define glSecondaryColor3uiv glad_glSecondaryColor3uiv -GLAD_API_CALL PFNGLSECONDARYCOLOR3USPROC glad_glSecondaryColor3us; -#define glSecondaryColor3us glad_glSecondaryColor3us -GLAD_API_CALL PFNGLSECONDARYCOLOR3USVPROC glad_glSecondaryColor3usv; -#define glSecondaryColor3usv glad_glSecondaryColor3usv -GLAD_API_CALL PFNGLSECONDARYCOLORP3UIPROC glad_glSecondaryColorP3ui; -#define glSecondaryColorP3ui glad_glSecondaryColorP3ui -GLAD_API_CALL PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv; -#define glSecondaryColorP3uiv glad_glSecondaryColorP3uiv -GLAD_API_CALL PFNGLSECONDARYCOLORPOINTERPROC glad_glSecondaryColorPointer; -#define glSecondaryColorPointer glad_glSecondaryColorPointer -GLAD_API_CALL PFNGLSELECTBUFFERPROC glad_glSelectBuffer; -#define glSelectBuffer glad_glSelectBuffer -GLAD_API_CALL PFNGLSHADEMODELPROC glad_glShadeModel; -#define glShadeModel glad_glShadeModel -GLAD_API_CALL PFNGLSHADERSOURCEPROC glad_glShaderSource; -#define glShaderSource glad_glShaderSource -GLAD_API_CALL PFNGLSTENCILFUNCPROC glad_glStencilFunc; -#define glStencilFunc glad_glStencilFunc -GLAD_API_CALL PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate; -#define glStencilFuncSeparate glad_glStencilFuncSeparate -GLAD_API_CALL PFNGLSTENCILMASKPROC glad_glStencilMask; -#define glStencilMask glad_glStencilMask -GLAD_API_CALL PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate; -#define glStencilMaskSeparate glad_glStencilMaskSeparate -GLAD_API_CALL PFNGLSTENCILOPPROC glad_glStencilOp; -#define glStencilOp glad_glStencilOp -GLAD_API_CALL PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate; -#define glStencilOpSeparate glad_glStencilOpSeparate -GLAD_API_CALL PFNGLTEXBUFFERPROC glad_glTexBuffer; -#define glTexBuffer glad_glTexBuffer -GLAD_API_CALL PFNGLTEXCOORD1DPROC glad_glTexCoord1d; -#define glTexCoord1d glad_glTexCoord1d -GLAD_API_CALL PFNGLTEXCOORD1DVPROC glad_glTexCoord1dv; -#define glTexCoord1dv glad_glTexCoord1dv -GLAD_API_CALL PFNGLTEXCOORD1FPROC glad_glTexCoord1f; -#define glTexCoord1f glad_glTexCoord1f -GLAD_API_CALL PFNGLTEXCOORD1FVPROC glad_glTexCoord1fv; -#define glTexCoord1fv glad_glTexCoord1fv -GLAD_API_CALL PFNGLTEXCOORD1IPROC glad_glTexCoord1i; -#define glTexCoord1i glad_glTexCoord1i -GLAD_API_CALL PFNGLTEXCOORD1IVPROC glad_glTexCoord1iv; -#define glTexCoord1iv glad_glTexCoord1iv -GLAD_API_CALL PFNGLTEXCOORD1SPROC glad_glTexCoord1s; -#define glTexCoord1s glad_glTexCoord1s -GLAD_API_CALL PFNGLTEXCOORD1SVPROC glad_glTexCoord1sv; -#define glTexCoord1sv glad_glTexCoord1sv -GLAD_API_CALL PFNGLTEXCOORD2DPROC glad_glTexCoord2d; -#define glTexCoord2d glad_glTexCoord2d -GLAD_API_CALL PFNGLTEXCOORD2DVPROC glad_glTexCoord2dv; -#define glTexCoord2dv glad_glTexCoord2dv -GLAD_API_CALL PFNGLTEXCOORD2FPROC glad_glTexCoord2f; -#define glTexCoord2f glad_glTexCoord2f -GLAD_API_CALL PFNGLTEXCOORD2FVPROC glad_glTexCoord2fv; -#define glTexCoord2fv glad_glTexCoord2fv -GLAD_API_CALL PFNGLTEXCOORD2IPROC glad_glTexCoord2i; -#define glTexCoord2i glad_glTexCoord2i -GLAD_API_CALL PFNGLTEXCOORD2IVPROC glad_glTexCoord2iv; -#define glTexCoord2iv glad_glTexCoord2iv -GLAD_API_CALL PFNGLTEXCOORD2SPROC glad_glTexCoord2s; -#define glTexCoord2s glad_glTexCoord2s -GLAD_API_CALL PFNGLTEXCOORD2SVPROC glad_glTexCoord2sv; -#define glTexCoord2sv glad_glTexCoord2sv -GLAD_API_CALL PFNGLTEXCOORD3DPROC glad_glTexCoord3d; -#define glTexCoord3d glad_glTexCoord3d -GLAD_API_CALL PFNGLTEXCOORD3DVPROC glad_glTexCoord3dv; -#define glTexCoord3dv glad_glTexCoord3dv -GLAD_API_CALL PFNGLTEXCOORD3FPROC glad_glTexCoord3f; -#define glTexCoord3f glad_glTexCoord3f -GLAD_API_CALL PFNGLTEXCOORD3FVPROC glad_glTexCoord3fv; -#define glTexCoord3fv glad_glTexCoord3fv -GLAD_API_CALL PFNGLTEXCOORD3IPROC glad_glTexCoord3i; -#define glTexCoord3i glad_glTexCoord3i -GLAD_API_CALL PFNGLTEXCOORD3IVPROC glad_glTexCoord3iv; -#define glTexCoord3iv glad_glTexCoord3iv -GLAD_API_CALL PFNGLTEXCOORD3SPROC glad_glTexCoord3s; -#define glTexCoord3s glad_glTexCoord3s -GLAD_API_CALL PFNGLTEXCOORD3SVPROC glad_glTexCoord3sv; -#define glTexCoord3sv glad_glTexCoord3sv -GLAD_API_CALL PFNGLTEXCOORD4DPROC glad_glTexCoord4d; -#define glTexCoord4d glad_glTexCoord4d -GLAD_API_CALL PFNGLTEXCOORD4DVPROC glad_glTexCoord4dv; -#define glTexCoord4dv glad_glTexCoord4dv -GLAD_API_CALL PFNGLTEXCOORD4FPROC glad_glTexCoord4f; -#define glTexCoord4f glad_glTexCoord4f -GLAD_API_CALL PFNGLTEXCOORD4FVPROC glad_glTexCoord4fv; -#define glTexCoord4fv glad_glTexCoord4fv -GLAD_API_CALL PFNGLTEXCOORD4IPROC glad_glTexCoord4i; -#define glTexCoord4i glad_glTexCoord4i -GLAD_API_CALL PFNGLTEXCOORD4IVPROC glad_glTexCoord4iv; -#define glTexCoord4iv glad_glTexCoord4iv -GLAD_API_CALL PFNGLTEXCOORD4SPROC glad_glTexCoord4s; -#define glTexCoord4s glad_glTexCoord4s -GLAD_API_CALL PFNGLTEXCOORD4SVPROC glad_glTexCoord4sv; -#define glTexCoord4sv glad_glTexCoord4sv -GLAD_API_CALL PFNGLTEXCOORDP1UIPROC glad_glTexCoordP1ui; -#define glTexCoordP1ui glad_glTexCoordP1ui -GLAD_API_CALL PFNGLTEXCOORDP1UIVPROC glad_glTexCoordP1uiv; -#define glTexCoordP1uiv glad_glTexCoordP1uiv -GLAD_API_CALL PFNGLTEXCOORDP2UIPROC glad_glTexCoordP2ui; -#define glTexCoordP2ui glad_glTexCoordP2ui -GLAD_API_CALL PFNGLTEXCOORDP2UIVPROC glad_glTexCoordP2uiv; -#define glTexCoordP2uiv glad_glTexCoordP2uiv -GLAD_API_CALL PFNGLTEXCOORDP3UIPROC glad_glTexCoordP3ui; -#define glTexCoordP3ui glad_glTexCoordP3ui -GLAD_API_CALL PFNGLTEXCOORDP3UIVPROC glad_glTexCoordP3uiv; -#define glTexCoordP3uiv glad_glTexCoordP3uiv -GLAD_API_CALL PFNGLTEXCOORDP4UIPROC glad_glTexCoordP4ui; -#define glTexCoordP4ui glad_glTexCoordP4ui -GLAD_API_CALL PFNGLTEXCOORDP4UIVPROC glad_glTexCoordP4uiv; -#define glTexCoordP4uiv glad_glTexCoordP4uiv -GLAD_API_CALL PFNGLTEXCOORDPOINTERPROC glad_glTexCoordPointer; -#define glTexCoordPointer glad_glTexCoordPointer -GLAD_API_CALL PFNGLTEXENVFPROC glad_glTexEnvf; -#define glTexEnvf glad_glTexEnvf -GLAD_API_CALL PFNGLTEXENVFVPROC glad_glTexEnvfv; -#define glTexEnvfv glad_glTexEnvfv -GLAD_API_CALL PFNGLTEXENVIPROC glad_glTexEnvi; -#define glTexEnvi glad_glTexEnvi -GLAD_API_CALL PFNGLTEXENVIVPROC glad_glTexEnviv; -#define glTexEnviv glad_glTexEnviv -GLAD_API_CALL PFNGLTEXGENDPROC glad_glTexGend; -#define glTexGend glad_glTexGend -GLAD_API_CALL PFNGLTEXGENDVPROC glad_glTexGendv; -#define glTexGendv glad_glTexGendv -GLAD_API_CALL PFNGLTEXGENFPROC glad_glTexGenf; -#define glTexGenf glad_glTexGenf -GLAD_API_CALL PFNGLTEXGENFVPROC glad_glTexGenfv; -#define glTexGenfv glad_glTexGenfv -GLAD_API_CALL PFNGLTEXGENIPROC glad_glTexGeni; -#define glTexGeni glad_glTexGeni -GLAD_API_CALL PFNGLTEXGENIVPROC glad_glTexGeniv; -#define glTexGeniv glad_glTexGeniv -GLAD_API_CALL PFNGLTEXIMAGE1DPROC glad_glTexImage1D; -#define glTexImage1D glad_glTexImage1D -GLAD_API_CALL PFNGLTEXIMAGE2DPROC glad_glTexImage2D; -#define glTexImage2D glad_glTexImage2D -GLAD_API_CALL PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample; -#define glTexImage2DMultisample glad_glTexImage2DMultisample -GLAD_API_CALL PFNGLTEXIMAGE3DPROC glad_glTexImage3D; -#define glTexImage3D glad_glTexImage3D -GLAD_API_CALL PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample; -#define glTexImage3DMultisample glad_glTexImage3DMultisample -GLAD_API_CALL PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv; -#define glTexParameterIiv glad_glTexParameterIiv -GLAD_API_CALL PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv; -#define glTexParameterIuiv glad_glTexParameterIuiv -GLAD_API_CALL PFNGLTEXPARAMETERFPROC glad_glTexParameterf; -#define glTexParameterf glad_glTexParameterf -GLAD_API_CALL PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv; -#define glTexParameterfv glad_glTexParameterfv -GLAD_API_CALL PFNGLTEXPARAMETERIPROC glad_glTexParameteri; -#define glTexParameteri glad_glTexParameteri -GLAD_API_CALL PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv; -#define glTexParameteriv glad_glTexParameteriv -GLAD_API_CALL PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D; -#define glTexSubImage1D glad_glTexSubImage1D -GLAD_API_CALL PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D; -#define glTexSubImage2D glad_glTexSubImage2D -GLAD_API_CALL PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D; -#define glTexSubImage3D glad_glTexSubImage3D -GLAD_API_CALL PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings; -#define glTransformFeedbackVaryings glad_glTransformFeedbackVaryings -GLAD_API_CALL PFNGLTRANSLATEDPROC glad_glTranslated; -#define glTranslated glad_glTranslated -GLAD_API_CALL PFNGLTRANSLATEFPROC glad_glTranslatef; -#define glTranslatef glad_glTranslatef -GLAD_API_CALL PFNGLUNIFORM1FPROC glad_glUniform1f; -#define glUniform1f glad_glUniform1f -GLAD_API_CALL PFNGLUNIFORM1FVPROC glad_glUniform1fv; -#define glUniform1fv glad_glUniform1fv -GLAD_API_CALL PFNGLUNIFORM1IPROC glad_glUniform1i; -#define glUniform1i glad_glUniform1i -GLAD_API_CALL PFNGLUNIFORM1IVPROC glad_glUniform1iv; -#define glUniform1iv glad_glUniform1iv -GLAD_API_CALL PFNGLUNIFORM1UIPROC glad_glUniform1ui; -#define glUniform1ui glad_glUniform1ui -GLAD_API_CALL PFNGLUNIFORM1UIVPROC glad_glUniform1uiv; -#define glUniform1uiv glad_glUniform1uiv -GLAD_API_CALL PFNGLUNIFORM2FPROC glad_glUniform2f; -#define glUniform2f glad_glUniform2f -GLAD_API_CALL PFNGLUNIFORM2FVPROC glad_glUniform2fv; -#define glUniform2fv glad_glUniform2fv -GLAD_API_CALL PFNGLUNIFORM2IPROC glad_glUniform2i; -#define glUniform2i glad_glUniform2i -GLAD_API_CALL PFNGLUNIFORM2IVPROC glad_glUniform2iv; -#define glUniform2iv glad_glUniform2iv -GLAD_API_CALL PFNGLUNIFORM2UIPROC glad_glUniform2ui; -#define glUniform2ui glad_glUniform2ui -GLAD_API_CALL PFNGLUNIFORM2UIVPROC glad_glUniform2uiv; -#define glUniform2uiv glad_glUniform2uiv -GLAD_API_CALL PFNGLUNIFORM3FPROC glad_glUniform3f; -#define glUniform3f glad_glUniform3f -GLAD_API_CALL PFNGLUNIFORM3FVPROC glad_glUniform3fv; -#define glUniform3fv glad_glUniform3fv -GLAD_API_CALL PFNGLUNIFORM3IPROC glad_glUniform3i; -#define glUniform3i glad_glUniform3i -GLAD_API_CALL PFNGLUNIFORM3IVPROC glad_glUniform3iv; -#define glUniform3iv glad_glUniform3iv -GLAD_API_CALL PFNGLUNIFORM3UIPROC glad_glUniform3ui; -#define glUniform3ui glad_glUniform3ui -GLAD_API_CALL PFNGLUNIFORM3UIVPROC glad_glUniform3uiv; -#define glUniform3uiv glad_glUniform3uiv -GLAD_API_CALL PFNGLUNIFORM4FPROC glad_glUniform4f; -#define glUniform4f glad_glUniform4f -GLAD_API_CALL PFNGLUNIFORM4FVPROC glad_glUniform4fv; -#define glUniform4fv glad_glUniform4fv -GLAD_API_CALL PFNGLUNIFORM4IPROC glad_glUniform4i; -#define glUniform4i glad_glUniform4i -GLAD_API_CALL PFNGLUNIFORM4IVPROC glad_glUniform4iv; -#define glUniform4iv glad_glUniform4iv -GLAD_API_CALL PFNGLUNIFORM4UIPROC glad_glUniform4ui; -#define glUniform4ui glad_glUniform4ui -GLAD_API_CALL PFNGLUNIFORM4UIVPROC glad_glUniform4uiv; -#define glUniform4uiv glad_glUniform4uiv -GLAD_API_CALL PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding; -#define glUniformBlockBinding glad_glUniformBlockBinding -GLAD_API_CALL PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv; -#define glUniformMatrix2fv glad_glUniformMatrix2fv -GLAD_API_CALL PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv; -#define glUniformMatrix2x3fv glad_glUniformMatrix2x3fv -GLAD_API_CALL PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv; -#define glUniformMatrix2x4fv glad_glUniformMatrix2x4fv -GLAD_API_CALL PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv; -#define glUniformMatrix3fv glad_glUniformMatrix3fv -GLAD_API_CALL PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv; -#define glUniformMatrix3x2fv glad_glUniformMatrix3x2fv -GLAD_API_CALL PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv; -#define glUniformMatrix3x4fv glad_glUniformMatrix3x4fv -GLAD_API_CALL PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv; -#define glUniformMatrix4fv glad_glUniformMatrix4fv -GLAD_API_CALL PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv; -#define glUniformMatrix4x2fv glad_glUniformMatrix4x2fv -GLAD_API_CALL PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv; -#define glUniformMatrix4x3fv glad_glUniformMatrix4x3fv -GLAD_API_CALL PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer; -#define glUnmapBuffer glad_glUnmapBuffer -GLAD_API_CALL PFNGLUSEPROGRAMPROC glad_glUseProgram; -#define glUseProgram glad_glUseProgram -GLAD_API_CALL PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram; -#define glValidateProgram glad_glValidateProgram -GLAD_API_CALL PFNGLVERTEX2DPROC glad_glVertex2d; -#define glVertex2d glad_glVertex2d -GLAD_API_CALL PFNGLVERTEX2DVPROC glad_glVertex2dv; -#define glVertex2dv glad_glVertex2dv -GLAD_API_CALL PFNGLVERTEX2FPROC glad_glVertex2f; -#define glVertex2f glad_glVertex2f -GLAD_API_CALL PFNGLVERTEX2FVPROC glad_glVertex2fv; -#define glVertex2fv glad_glVertex2fv -GLAD_API_CALL PFNGLVERTEX2IPROC glad_glVertex2i; -#define glVertex2i glad_glVertex2i -GLAD_API_CALL PFNGLVERTEX2IVPROC glad_glVertex2iv; -#define glVertex2iv glad_glVertex2iv -GLAD_API_CALL PFNGLVERTEX2SPROC glad_glVertex2s; -#define glVertex2s glad_glVertex2s -GLAD_API_CALL PFNGLVERTEX2SVPROC glad_glVertex2sv; -#define glVertex2sv glad_glVertex2sv -GLAD_API_CALL PFNGLVERTEX3DPROC glad_glVertex3d; -#define glVertex3d glad_glVertex3d -GLAD_API_CALL PFNGLVERTEX3DVPROC glad_glVertex3dv; -#define glVertex3dv glad_glVertex3dv -GLAD_API_CALL PFNGLVERTEX3FPROC glad_glVertex3f; -#define glVertex3f glad_glVertex3f -GLAD_API_CALL PFNGLVERTEX3FVPROC glad_glVertex3fv; -#define glVertex3fv glad_glVertex3fv -GLAD_API_CALL PFNGLVERTEX3IPROC glad_glVertex3i; -#define glVertex3i glad_glVertex3i -GLAD_API_CALL PFNGLVERTEX3IVPROC glad_glVertex3iv; -#define glVertex3iv glad_glVertex3iv -GLAD_API_CALL PFNGLVERTEX3SPROC glad_glVertex3s; -#define glVertex3s glad_glVertex3s -GLAD_API_CALL PFNGLVERTEX3SVPROC glad_glVertex3sv; -#define glVertex3sv glad_glVertex3sv -GLAD_API_CALL PFNGLVERTEX4DPROC glad_glVertex4d; -#define glVertex4d glad_glVertex4d -GLAD_API_CALL PFNGLVERTEX4DVPROC glad_glVertex4dv; -#define glVertex4dv glad_glVertex4dv -GLAD_API_CALL PFNGLVERTEX4FPROC glad_glVertex4f; -#define glVertex4f glad_glVertex4f -GLAD_API_CALL PFNGLVERTEX4FVPROC glad_glVertex4fv; -#define glVertex4fv glad_glVertex4fv -GLAD_API_CALL PFNGLVERTEX4IPROC glad_glVertex4i; -#define glVertex4i glad_glVertex4i -GLAD_API_CALL PFNGLVERTEX4IVPROC glad_glVertex4iv; -#define glVertex4iv glad_glVertex4iv -GLAD_API_CALL PFNGLVERTEX4SPROC glad_glVertex4s; -#define glVertex4s glad_glVertex4s -GLAD_API_CALL PFNGLVERTEX4SVPROC glad_glVertex4sv; -#define glVertex4sv glad_glVertex4sv -GLAD_API_CALL PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d; -#define glVertexAttrib1d glad_glVertexAttrib1d -GLAD_API_CALL PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv; -#define glVertexAttrib1dv glad_glVertexAttrib1dv -GLAD_API_CALL PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f; -#define glVertexAttrib1f glad_glVertexAttrib1f -GLAD_API_CALL PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv; -#define glVertexAttrib1fv glad_glVertexAttrib1fv -GLAD_API_CALL PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s; -#define glVertexAttrib1s glad_glVertexAttrib1s -GLAD_API_CALL PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv; -#define glVertexAttrib1sv glad_glVertexAttrib1sv -GLAD_API_CALL PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d; -#define glVertexAttrib2d glad_glVertexAttrib2d -GLAD_API_CALL PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv; -#define glVertexAttrib2dv glad_glVertexAttrib2dv -GLAD_API_CALL PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f; -#define glVertexAttrib2f glad_glVertexAttrib2f -GLAD_API_CALL PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv; -#define glVertexAttrib2fv glad_glVertexAttrib2fv -GLAD_API_CALL PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s; -#define glVertexAttrib2s glad_glVertexAttrib2s -GLAD_API_CALL PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv; -#define glVertexAttrib2sv glad_glVertexAttrib2sv -GLAD_API_CALL PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d; -#define glVertexAttrib3d glad_glVertexAttrib3d -GLAD_API_CALL PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv; -#define glVertexAttrib3dv glad_glVertexAttrib3dv -GLAD_API_CALL PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f; -#define glVertexAttrib3f glad_glVertexAttrib3f -GLAD_API_CALL PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv; -#define glVertexAttrib3fv glad_glVertexAttrib3fv -GLAD_API_CALL PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s; -#define glVertexAttrib3s glad_glVertexAttrib3s -GLAD_API_CALL PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv; -#define glVertexAttrib3sv glad_glVertexAttrib3sv -GLAD_API_CALL PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv; -#define glVertexAttrib4Nbv glad_glVertexAttrib4Nbv -GLAD_API_CALL PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv; -#define glVertexAttrib4Niv glad_glVertexAttrib4Niv -GLAD_API_CALL PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv; -#define glVertexAttrib4Nsv glad_glVertexAttrib4Nsv -GLAD_API_CALL PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub; -#define glVertexAttrib4Nub glad_glVertexAttrib4Nub -GLAD_API_CALL PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv; -#define glVertexAttrib4Nubv glad_glVertexAttrib4Nubv -GLAD_API_CALL PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv; -#define glVertexAttrib4Nuiv glad_glVertexAttrib4Nuiv -GLAD_API_CALL PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv; -#define glVertexAttrib4Nusv glad_glVertexAttrib4Nusv -GLAD_API_CALL PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv; -#define glVertexAttrib4bv glad_glVertexAttrib4bv -GLAD_API_CALL PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d; -#define glVertexAttrib4d glad_glVertexAttrib4d -GLAD_API_CALL PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv; -#define glVertexAttrib4dv glad_glVertexAttrib4dv -GLAD_API_CALL PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f; -#define glVertexAttrib4f glad_glVertexAttrib4f -GLAD_API_CALL PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv; -#define glVertexAttrib4fv glad_glVertexAttrib4fv -GLAD_API_CALL PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv; -#define glVertexAttrib4iv glad_glVertexAttrib4iv -GLAD_API_CALL PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s; -#define glVertexAttrib4s glad_glVertexAttrib4s -GLAD_API_CALL PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv; -#define glVertexAttrib4sv glad_glVertexAttrib4sv -GLAD_API_CALL PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv; -#define glVertexAttrib4ubv glad_glVertexAttrib4ubv -GLAD_API_CALL PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv; -#define glVertexAttrib4uiv glad_glVertexAttrib4uiv -GLAD_API_CALL PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv; -#define glVertexAttrib4usv glad_glVertexAttrib4usv -GLAD_API_CALL PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor; -#define glVertexAttribDivisor glad_glVertexAttribDivisor -GLAD_API_CALL PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i; -#define glVertexAttribI1i glad_glVertexAttribI1i -GLAD_API_CALL PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv; -#define glVertexAttribI1iv glad_glVertexAttribI1iv -GLAD_API_CALL PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui; -#define glVertexAttribI1ui glad_glVertexAttribI1ui -GLAD_API_CALL PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv; -#define glVertexAttribI1uiv glad_glVertexAttribI1uiv -GLAD_API_CALL PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i; -#define glVertexAttribI2i glad_glVertexAttribI2i -GLAD_API_CALL PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv; -#define glVertexAttribI2iv glad_glVertexAttribI2iv -GLAD_API_CALL PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui; -#define glVertexAttribI2ui glad_glVertexAttribI2ui -GLAD_API_CALL PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv; -#define glVertexAttribI2uiv glad_glVertexAttribI2uiv -GLAD_API_CALL PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i; -#define glVertexAttribI3i glad_glVertexAttribI3i -GLAD_API_CALL PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv; -#define glVertexAttribI3iv glad_glVertexAttribI3iv -GLAD_API_CALL PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui; -#define glVertexAttribI3ui glad_glVertexAttribI3ui -GLAD_API_CALL PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv; -#define glVertexAttribI3uiv glad_glVertexAttribI3uiv -GLAD_API_CALL PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv; -#define glVertexAttribI4bv glad_glVertexAttribI4bv -GLAD_API_CALL PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i; -#define glVertexAttribI4i glad_glVertexAttribI4i -GLAD_API_CALL PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv; -#define glVertexAttribI4iv glad_glVertexAttribI4iv -GLAD_API_CALL PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv; -#define glVertexAttribI4sv glad_glVertexAttribI4sv -GLAD_API_CALL PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv; -#define glVertexAttribI4ubv glad_glVertexAttribI4ubv -GLAD_API_CALL PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui; -#define glVertexAttribI4ui glad_glVertexAttribI4ui -GLAD_API_CALL PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv; -#define glVertexAttribI4uiv glad_glVertexAttribI4uiv -GLAD_API_CALL PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv; -#define glVertexAttribI4usv glad_glVertexAttribI4usv -GLAD_API_CALL PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer; -#define glVertexAttribIPointer glad_glVertexAttribIPointer -GLAD_API_CALL PFNGLVERTEXATTRIBP1UIPROC glad_glVertexAttribP1ui; -#define glVertexAttribP1ui glad_glVertexAttribP1ui -GLAD_API_CALL PFNGLVERTEXATTRIBP1UIVPROC glad_glVertexAttribP1uiv; -#define glVertexAttribP1uiv glad_glVertexAttribP1uiv -GLAD_API_CALL PFNGLVERTEXATTRIBP2UIPROC glad_glVertexAttribP2ui; -#define glVertexAttribP2ui glad_glVertexAttribP2ui -GLAD_API_CALL PFNGLVERTEXATTRIBP2UIVPROC glad_glVertexAttribP2uiv; -#define glVertexAttribP2uiv glad_glVertexAttribP2uiv -GLAD_API_CALL PFNGLVERTEXATTRIBP3UIPROC glad_glVertexAttribP3ui; -#define glVertexAttribP3ui glad_glVertexAttribP3ui -GLAD_API_CALL PFNGLVERTEXATTRIBP3UIVPROC glad_glVertexAttribP3uiv; -#define glVertexAttribP3uiv glad_glVertexAttribP3uiv -GLAD_API_CALL PFNGLVERTEXATTRIBP4UIPROC glad_glVertexAttribP4ui; -#define glVertexAttribP4ui glad_glVertexAttribP4ui -GLAD_API_CALL PFNGLVERTEXATTRIBP4UIVPROC glad_glVertexAttribP4uiv; -#define glVertexAttribP4uiv glad_glVertexAttribP4uiv -GLAD_API_CALL PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer; -#define glVertexAttribPointer glad_glVertexAttribPointer -GLAD_API_CALL PFNGLVERTEXP2UIPROC glad_glVertexP2ui; -#define glVertexP2ui glad_glVertexP2ui -GLAD_API_CALL PFNGLVERTEXP2UIVPROC glad_glVertexP2uiv; -#define glVertexP2uiv glad_glVertexP2uiv -GLAD_API_CALL PFNGLVERTEXP3UIPROC glad_glVertexP3ui; -#define glVertexP3ui glad_glVertexP3ui -GLAD_API_CALL PFNGLVERTEXP3UIVPROC glad_glVertexP3uiv; -#define glVertexP3uiv glad_glVertexP3uiv -GLAD_API_CALL PFNGLVERTEXP4UIPROC glad_glVertexP4ui; -#define glVertexP4ui glad_glVertexP4ui -GLAD_API_CALL PFNGLVERTEXP4UIVPROC glad_glVertexP4uiv; -#define glVertexP4uiv glad_glVertexP4uiv -GLAD_API_CALL PFNGLVERTEXPOINTERPROC glad_glVertexPointer; -#define glVertexPointer glad_glVertexPointer -GLAD_API_CALL PFNGLVIEWPORTPROC glad_glViewport; -#define glViewport glad_glViewport -GLAD_API_CALL PFNGLWAITSYNCPROC glad_glWaitSync; -#define glWaitSync glad_glWaitSync -GLAD_API_CALL PFNGLWINDOWPOS2DPROC glad_glWindowPos2d; -#define glWindowPos2d glad_glWindowPos2d -GLAD_API_CALL PFNGLWINDOWPOS2DVPROC glad_glWindowPos2dv; -#define glWindowPos2dv glad_glWindowPos2dv -GLAD_API_CALL PFNGLWINDOWPOS2FPROC glad_glWindowPos2f; -#define glWindowPos2f glad_glWindowPos2f -GLAD_API_CALL PFNGLWINDOWPOS2FVPROC glad_glWindowPos2fv; -#define glWindowPos2fv glad_glWindowPos2fv -GLAD_API_CALL PFNGLWINDOWPOS2IPROC glad_glWindowPos2i; -#define glWindowPos2i glad_glWindowPos2i -GLAD_API_CALL PFNGLWINDOWPOS2IVPROC glad_glWindowPos2iv; -#define glWindowPos2iv glad_glWindowPos2iv -GLAD_API_CALL PFNGLWINDOWPOS2SPROC glad_glWindowPos2s; -#define glWindowPos2s glad_glWindowPos2s -GLAD_API_CALL PFNGLWINDOWPOS2SVPROC glad_glWindowPos2sv; -#define glWindowPos2sv glad_glWindowPos2sv -GLAD_API_CALL PFNGLWINDOWPOS3DPROC glad_glWindowPos3d; -#define glWindowPos3d glad_glWindowPos3d -GLAD_API_CALL PFNGLWINDOWPOS3DVPROC glad_glWindowPos3dv; -#define glWindowPos3dv glad_glWindowPos3dv -GLAD_API_CALL PFNGLWINDOWPOS3FPROC glad_glWindowPos3f; -#define glWindowPos3f glad_glWindowPos3f -GLAD_API_CALL PFNGLWINDOWPOS3FVPROC glad_glWindowPos3fv; -#define glWindowPos3fv glad_glWindowPos3fv -GLAD_API_CALL PFNGLWINDOWPOS3IPROC glad_glWindowPos3i; -#define glWindowPos3i glad_glWindowPos3i -GLAD_API_CALL PFNGLWINDOWPOS3IVPROC glad_glWindowPos3iv; -#define glWindowPos3iv glad_glWindowPos3iv -GLAD_API_CALL PFNGLWINDOWPOS3SPROC glad_glWindowPos3s; -#define glWindowPos3s glad_glWindowPos3s -GLAD_API_CALL PFNGLWINDOWPOS3SVPROC glad_glWindowPos3sv; -#define glWindowPos3sv glad_glWindowPos3sv - - - - - -GLAD_API_CALL int gladLoadGLUserPtr( GLADuserptrloadfunc load, void *userptr); -GLAD_API_CALL int gladLoadGL( GLADloadfunc load); - - - -#ifdef __cplusplus -} -#endif -#endif - -/* Source */ -#ifdef GLAD_GL_IMPLEMENTATION -#include -#include -#include - -#ifndef GLAD_IMPL_UTIL_C_ -#define GLAD_IMPL_UTIL_C_ - -#ifdef _MSC_VER -#define GLAD_IMPL_UTIL_SSCANF sscanf_s -#else -#define GLAD_IMPL_UTIL_SSCANF sscanf -#endif - -#endif /* GLAD_IMPL_UTIL_C_ */ - -#ifdef __cplusplus -extern "C" { -#endif - - - -int GLAD_GL_VERSION_1_0 = 0; -int GLAD_GL_VERSION_1_1 = 0; -int GLAD_GL_VERSION_1_2 = 0; -int GLAD_GL_VERSION_1_3 = 0; -int GLAD_GL_VERSION_1_4 = 0; -int GLAD_GL_VERSION_1_5 = 0; -int GLAD_GL_VERSION_2_0 = 0; -int GLAD_GL_VERSION_2_1 = 0; -int GLAD_GL_VERSION_3_0 = 0; -int GLAD_GL_VERSION_3_1 = 0; -int GLAD_GL_VERSION_3_2 = 0; -int GLAD_GL_VERSION_3_3 = 0; -int GLAD_GL_ARB_multisample = 0; -int GLAD_GL_ARB_robustness = 0; -int GLAD_GL_KHR_debug = 0; - - - -PFNGLACCUMPROC glad_glAccum = NULL; -PFNGLACTIVETEXTUREPROC glad_glActiveTexture = NULL; -PFNGLALPHAFUNCPROC glad_glAlphaFunc = NULL; -PFNGLARETEXTURESRESIDENTPROC glad_glAreTexturesResident = NULL; -PFNGLARRAYELEMENTPROC glad_glArrayElement = NULL; -PFNGLATTACHSHADERPROC glad_glAttachShader = NULL; -PFNGLBEGINPROC glad_glBegin = NULL; -PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender = NULL; -PFNGLBEGINQUERYPROC glad_glBeginQuery = NULL; -PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback = NULL; -PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation = NULL; -PFNGLBINDBUFFERPROC glad_glBindBuffer = NULL; -PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase = NULL; -PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange = NULL; -PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation = NULL; -PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed = NULL; -PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer = NULL; -PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer = NULL; -PFNGLBINDSAMPLERPROC glad_glBindSampler = NULL; -PFNGLBINDTEXTUREPROC glad_glBindTexture = NULL; -PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray = NULL; -PFNGLBITMAPPROC glad_glBitmap = NULL; -PFNGLBLENDCOLORPROC glad_glBlendColor = NULL; -PFNGLBLENDEQUATIONPROC glad_glBlendEquation = NULL; -PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate = NULL; -PFNGLBLENDFUNCPROC glad_glBlendFunc = NULL; -PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate = NULL; -PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer = NULL; -PFNGLBUFFERDATAPROC glad_glBufferData = NULL; -PFNGLBUFFERSUBDATAPROC glad_glBufferSubData = NULL; -PFNGLCALLLISTPROC glad_glCallList = NULL; -PFNGLCALLLISTSPROC glad_glCallLists = NULL; -PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus = NULL; -PFNGLCLAMPCOLORPROC glad_glClampColor = NULL; -PFNGLCLEARPROC glad_glClear = NULL; -PFNGLCLEARACCUMPROC glad_glClearAccum = NULL; -PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi = NULL; -PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv = NULL; -PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv = NULL; -PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv = NULL; -PFNGLCLEARCOLORPROC glad_glClearColor = NULL; -PFNGLCLEARDEPTHPROC glad_glClearDepth = NULL; -PFNGLCLEARINDEXPROC glad_glClearIndex = NULL; -PFNGLCLEARSTENCILPROC glad_glClearStencil = NULL; -PFNGLCLIENTACTIVETEXTUREPROC glad_glClientActiveTexture = NULL; -PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync = NULL; -PFNGLCLIPPLANEPROC glad_glClipPlane = NULL; -PFNGLCOLOR3BPROC glad_glColor3b = NULL; -PFNGLCOLOR3BVPROC glad_glColor3bv = NULL; -PFNGLCOLOR3DPROC glad_glColor3d = NULL; -PFNGLCOLOR3DVPROC glad_glColor3dv = NULL; -PFNGLCOLOR3FPROC glad_glColor3f = NULL; -PFNGLCOLOR3FVPROC glad_glColor3fv = NULL; -PFNGLCOLOR3IPROC glad_glColor3i = NULL; -PFNGLCOLOR3IVPROC glad_glColor3iv = NULL; -PFNGLCOLOR3SPROC glad_glColor3s = NULL; -PFNGLCOLOR3SVPROC glad_glColor3sv = NULL; -PFNGLCOLOR3UBPROC glad_glColor3ub = NULL; -PFNGLCOLOR3UBVPROC glad_glColor3ubv = NULL; -PFNGLCOLOR3UIPROC glad_glColor3ui = NULL; -PFNGLCOLOR3UIVPROC glad_glColor3uiv = NULL; -PFNGLCOLOR3USPROC glad_glColor3us = NULL; -PFNGLCOLOR3USVPROC glad_glColor3usv = NULL; -PFNGLCOLOR4BPROC glad_glColor4b = NULL; -PFNGLCOLOR4BVPROC glad_glColor4bv = NULL; -PFNGLCOLOR4DPROC glad_glColor4d = NULL; -PFNGLCOLOR4DVPROC glad_glColor4dv = NULL; -PFNGLCOLOR4FPROC glad_glColor4f = NULL; -PFNGLCOLOR4FVPROC glad_glColor4fv = NULL; -PFNGLCOLOR4IPROC glad_glColor4i = NULL; -PFNGLCOLOR4IVPROC glad_glColor4iv = NULL; -PFNGLCOLOR4SPROC glad_glColor4s = NULL; -PFNGLCOLOR4SVPROC glad_glColor4sv = NULL; -PFNGLCOLOR4UBPROC glad_glColor4ub = NULL; -PFNGLCOLOR4UBVPROC glad_glColor4ubv = NULL; -PFNGLCOLOR4UIPROC glad_glColor4ui = NULL; -PFNGLCOLOR4UIVPROC glad_glColor4uiv = NULL; -PFNGLCOLOR4USPROC glad_glColor4us = NULL; -PFNGLCOLOR4USVPROC glad_glColor4usv = NULL; -PFNGLCOLORMASKPROC glad_glColorMask = NULL; -PFNGLCOLORMASKIPROC glad_glColorMaski = NULL; -PFNGLCOLORMATERIALPROC glad_glColorMaterial = NULL; -PFNGLCOLORP3UIPROC glad_glColorP3ui = NULL; -PFNGLCOLORP3UIVPROC glad_glColorP3uiv = NULL; -PFNGLCOLORP4UIPROC glad_glColorP4ui = NULL; -PFNGLCOLORP4UIVPROC glad_glColorP4uiv = NULL; -PFNGLCOLORPOINTERPROC glad_glColorPointer = NULL; -PFNGLCOMPILESHADERPROC glad_glCompileShader = NULL; -PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D = NULL; -PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D = NULL; -PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D = NULL; -PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D = NULL; -PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D = NULL; -PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D = NULL; -PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData = NULL; -PFNGLCOPYPIXELSPROC glad_glCopyPixels = NULL; -PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D = NULL; -PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D = NULL; -PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D = NULL; -PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D = NULL; -PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D = NULL; -PFNGLCREATEPROGRAMPROC glad_glCreateProgram = NULL; -PFNGLCREATESHADERPROC glad_glCreateShader = NULL; -PFNGLCULLFACEPROC glad_glCullFace = NULL; -PFNGLDEBUGMESSAGECALLBACKPROC glad_glDebugMessageCallback = NULL; -PFNGLDEBUGMESSAGECONTROLPROC glad_glDebugMessageControl = NULL; -PFNGLDEBUGMESSAGEINSERTPROC glad_glDebugMessageInsert = NULL; -PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers = NULL; -PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers = NULL; -PFNGLDELETELISTSPROC glad_glDeleteLists = NULL; -PFNGLDELETEPROGRAMPROC glad_glDeleteProgram = NULL; -PFNGLDELETEQUERIESPROC glad_glDeleteQueries = NULL; -PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers = NULL; -PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers = NULL; -PFNGLDELETESHADERPROC glad_glDeleteShader = NULL; -PFNGLDELETESYNCPROC glad_glDeleteSync = NULL; -PFNGLDELETETEXTURESPROC glad_glDeleteTextures = NULL; -PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays = NULL; -PFNGLDEPTHFUNCPROC glad_glDepthFunc = NULL; -PFNGLDEPTHMASKPROC glad_glDepthMask = NULL; -PFNGLDEPTHRANGEPROC glad_glDepthRange = NULL; -PFNGLDETACHSHADERPROC glad_glDetachShader = NULL; -PFNGLDISABLEPROC glad_glDisable = NULL; -PFNGLDISABLECLIENTSTATEPROC glad_glDisableClientState = NULL; -PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray = NULL; -PFNGLDISABLEIPROC glad_glDisablei = NULL; -PFNGLDRAWARRAYSPROC glad_glDrawArrays = NULL; -PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced = NULL; -PFNGLDRAWBUFFERPROC glad_glDrawBuffer = NULL; -PFNGLDRAWBUFFERSPROC glad_glDrawBuffers = NULL; -PFNGLDRAWELEMENTSPROC glad_glDrawElements = NULL; -PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex = NULL; -PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced = NULL; -PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex = NULL; -PFNGLDRAWPIXELSPROC glad_glDrawPixels = NULL; -PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements = NULL; -PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex = NULL; -PFNGLEDGEFLAGPROC glad_glEdgeFlag = NULL; -PFNGLEDGEFLAGPOINTERPROC glad_glEdgeFlagPointer = NULL; -PFNGLEDGEFLAGVPROC glad_glEdgeFlagv = NULL; -PFNGLENABLEPROC glad_glEnable = NULL; -PFNGLENABLECLIENTSTATEPROC glad_glEnableClientState = NULL; -PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray = NULL; -PFNGLENABLEIPROC glad_glEnablei = NULL; -PFNGLENDPROC glad_glEnd = NULL; -PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender = NULL; -PFNGLENDLISTPROC glad_glEndList = NULL; -PFNGLENDQUERYPROC glad_glEndQuery = NULL; -PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback = NULL; -PFNGLEVALCOORD1DPROC glad_glEvalCoord1d = NULL; -PFNGLEVALCOORD1DVPROC glad_glEvalCoord1dv = NULL; -PFNGLEVALCOORD1FPROC glad_glEvalCoord1f = NULL; -PFNGLEVALCOORD1FVPROC glad_glEvalCoord1fv = NULL; -PFNGLEVALCOORD2DPROC glad_glEvalCoord2d = NULL; -PFNGLEVALCOORD2DVPROC glad_glEvalCoord2dv = NULL; -PFNGLEVALCOORD2FPROC glad_glEvalCoord2f = NULL; -PFNGLEVALCOORD2FVPROC glad_glEvalCoord2fv = NULL; -PFNGLEVALMESH1PROC glad_glEvalMesh1 = NULL; -PFNGLEVALMESH2PROC glad_glEvalMesh2 = NULL; -PFNGLEVALPOINT1PROC glad_glEvalPoint1 = NULL; -PFNGLEVALPOINT2PROC glad_glEvalPoint2 = NULL; -PFNGLFEEDBACKBUFFERPROC glad_glFeedbackBuffer = NULL; -PFNGLFENCESYNCPROC glad_glFenceSync = NULL; -PFNGLFINISHPROC glad_glFinish = NULL; -PFNGLFLUSHPROC glad_glFlush = NULL; -PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange = NULL; -PFNGLFOGCOORDPOINTERPROC glad_glFogCoordPointer = NULL; -PFNGLFOGCOORDDPROC glad_glFogCoordd = NULL; -PFNGLFOGCOORDDVPROC glad_glFogCoorddv = NULL; -PFNGLFOGCOORDFPROC glad_glFogCoordf = NULL; -PFNGLFOGCOORDFVPROC glad_glFogCoordfv = NULL; -PFNGLFOGFPROC glad_glFogf = NULL; -PFNGLFOGFVPROC glad_glFogfv = NULL; -PFNGLFOGIPROC glad_glFogi = NULL; -PFNGLFOGIVPROC glad_glFogiv = NULL; -PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer = NULL; -PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture = NULL; -PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D = NULL; -PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D = NULL; -PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D = NULL; -PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer = NULL; -PFNGLFRONTFACEPROC glad_glFrontFace = NULL; -PFNGLFRUSTUMPROC glad_glFrustum = NULL; -PFNGLGENBUFFERSPROC glad_glGenBuffers = NULL; -PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers = NULL; -PFNGLGENLISTSPROC glad_glGenLists = NULL; -PFNGLGENQUERIESPROC glad_glGenQueries = NULL; -PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers = NULL; -PFNGLGENSAMPLERSPROC glad_glGenSamplers = NULL; -PFNGLGENTEXTURESPROC glad_glGenTextures = NULL; -PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays = NULL; -PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap = NULL; -PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib = NULL; -PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform = NULL; -PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName = NULL; -PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv = NULL; -PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName = NULL; -PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv = NULL; -PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders = NULL; -PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation = NULL; -PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v = NULL; -PFNGLGETBOOLEANVPROC glad_glGetBooleanv = NULL; -PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v = NULL; -PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv = NULL; -PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv = NULL; -PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData = NULL; -PFNGLGETCLIPPLANEPROC glad_glGetClipPlane = NULL; -PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage = NULL; -PFNGLGETDEBUGMESSAGELOGPROC glad_glGetDebugMessageLog = NULL; -PFNGLGETDOUBLEVPROC glad_glGetDoublev = NULL; -PFNGLGETERRORPROC glad_glGetError = NULL; -PFNGLGETFLOATVPROC glad_glGetFloatv = NULL; -PFNGLGETFRAGDATAINDEXPROC glad_glGetFragDataIndex = NULL; -PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation = NULL; -PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv = NULL; -PFNGLGETGRAPHICSRESETSTATUSARBPROC glad_glGetGraphicsResetStatusARB = NULL; -PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v = NULL; -PFNGLGETINTEGER64VPROC glad_glGetInteger64v = NULL; -PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v = NULL; -PFNGLGETINTEGERVPROC glad_glGetIntegerv = NULL; -PFNGLGETLIGHTFVPROC glad_glGetLightfv = NULL; -PFNGLGETLIGHTIVPROC glad_glGetLightiv = NULL; -PFNGLGETMAPDVPROC glad_glGetMapdv = NULL; -PFNGLGETMAPFVPROC glad_glGetMapfv = NULL; -PFNGLGETMAPIVPROC glad_glGetMapiv = NULL; -PFNGLGETMATERIALFVPROC glad_glGetMaterialfv = NULL; -PFNGLGETMATERIALIVPROC glad_glGetMaterialiv = NULL; -PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv = NULL; -PFNGLGETOBJECTLABELPROC glad_glGetObjectLabel = NULL; -PFNGLGETOBJECTPTRLABELPROC glad_glGetObjectPtrLabel = NULL; -PFNGLGETPIXELMAPFVPROC glad_glGetPixelMapfv = NULL; -PFNGLGETPIXELMAPUIVPROC glad_glGetPixelMapuiv = NULL; -PFNGLGETPIXELMAPUSVPROC glad_glGetPixelMapusv = NULL; -PFNGLGETPOINTERVPROC glad_glGetPointerv = NULL; -PFNGLGETPOLYGONSTIPPLEPROC glad_glGetPolygonStipple = NULL; -PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog = NULL; -PFNGLGETPROGRAMIVPROC glad_glGetProgramiv = NULL; -PFNGLGETQUERYOBJECTI64VPROC glad_glGetQueryObjecti64v = NULL; -PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv = NULL; -PFNGLGETQUERYOBJECTUI64VPROC glad_glGetQueryObjectui64v = NULL; -PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv = NULL; -PFNGLGETQUERYIVPROC glad_glGetQueryiv = NULL; -PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv = NULL; -PFNGLGETSAMPLERPARAMETERIIVPROC glad_glGetSamplerParameterIiv = NULL; -PFNGLGETSAMPLERPARAMETERIUIVPROC glad_glGetSamplerParameterIuiv = NULL; -PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv = NULL; -PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv = NULL; -PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog = NULL; -PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource = NULL; -PFNGLGETSHADERIVPROC glad_glGetShaderiv = NULL; -PFNGLGETSTRINGPROC glad_glGetString = NULL; -PFNGLGETSTRINGIPROC glad_glGetStringi = NULL; -PFNGLGETSYNCIVPROC glad_glGetSynciv = NULL; -PFNGLGETTEXENVFVPROC glad_glGetTexEnvfv = NULL; -PFNGLGETTEXENVIVPROC glad_glGetTexEnviv = NULL; -PFNGLGETTEXGENDVPROC glad_glGetTexGendv = NULL; -PFNGLGETTEXGENFVPROC glad_glGetTexGenfv = NULL; -PFNGLGETTEXGENIVPROC glad_glGetTexGeniv = NULL; -PFNGLGETTEXIMAGEPROC glad_glGetTexImage = NULL; -PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv = NULL; -PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv = NULL; -PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv = NULL; -PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv = NULL; -PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv = NULL; -PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv = NULL; -PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying = NULL; -PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex = NULL; -PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices = NULL; -PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation = NULL; -PFNGLGETUNIFORMFVPROC glad_glGetUniformfv = NULL; -PFNGLGETUNIFORMIVPROC glad_glGetUniformiv = NULL; -PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv = NULL; -PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv = NULL; -PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv = NULL; -PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv = NULL; -PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv = NULL; -PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv = NULL; -PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv = NULL; -PFNGLGETNCOLORTABLEARBPROC glad_glGetnColorTableARB = NULL; -PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC glad_glGetnCompressedTexImageARB = NULL; -PFNGLGETNCONVOLUTIONFILTERARBPROC glad_glGetnConvolutionFilterARB = NULL; -PFNGLGETNHISTOGRAMARBPROC glad_glGetnHistogramARB = NULL; -PFNGLGETNMAPDVARBPROC glad_glGetnMapdvARB = NULL; -PFNGLGETNMAPFVARBPROC glad_glGetnMapfvARB = NULL; -PFNGLGETNMAPIVARBPROC glad_glGetnMapivARB = NULL; -PFNGLGETNMINMAXARBPROC glad_glGetnMinmaxARB = NULL; -PFNGLGETNPIXELMAPFVARBPROC glad_glGetnPixelMapfvARB = NULL; -PFNGLGETNPIXELMAPUIVARBPROC glad_glGetnPixelMapuivARB = NULL; -PFNGLGETNPIXELMAPUSVARBPROC glad_glGetnPixelMapusvARB = NULL; -PFNGLGETNPOLYGONSTIPPLEARBPROC glad_glGetnPolygonStippleARB = NULL; -PFNGLGETNSEPARABLEFILTERARBPROC glad_glGetnSeparableFilterARB = NULL; -PFNGLGETNTEXIMAGEARBPROC glad_glGetnTexImageARB = NULL; -PFNGLGETNUNIFORMDVARBPROC glad_glGetnUniformdvARB = NULL; -PFNGLGETNUNIFORMFVARBPROC glad_glGetnUniformfvARB = NULL; -PFNGLGETNUNIFORMIVARBPROC glad_glGetnUniformivARB = NULL; -PFNGLGETNUNIFORMUIVARBPROC glad_glGetnUniformuivARB = NULL; -PFNGLHINTPROC glad_glHint = NULL; -PFNGLINDEXMASKPROC glad_glIndexMask = NULL; -PFNGLINDEXPOINTERPROC glad_glIndexPointer = NULL; -PFNGLINDEXDPROC glad_glIndexd = NULL; -PFNGLINDEXDVPROC glad_glIndexdv = NULL; -PFNGLINDEXFPROC glad_glIndexf = NULL; -PFNGLINDEXFVPROC glad_glIndexfv = NULL; -PFNGLINDEXIPROC glad_glIndexi = NULL; -PFNGLINDEXIVPROC glad_glIndexiv = NULL; -PFNGLINDEXSPROC glad_glIndexs = NULL; -PFNGLINDEXSVPROC glad_glIndexsv = NULL; -PFNGLINDEXUBPROC glad_glIndexub = NULL; -PFNGLINDEXUBVPROC glad_glIndexubv = NULL; -PFNGLINITNAMESPROC glad_glInitNames = NULL; -PFNGLINTERLEAVEDARRAYSPROC glad_glInterleavedArrays = NULL; -PFNGLISBUFFERPROC glad_glIsBuffer = NULL; -PFNGLISENABLEDPROC glad_glIsEnabled = NULL; -PFNGLISENABLEDIPROC glad_glIsEnabledi = NULL; -PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer = NULL; -PFNGLISLISTPROC glad_glIsList = NULL; -PFNGLISPROGRAMPROC glad_glIsProgram = NULL; -PFNGLISQUERYPROC glad_glIsQuery = NULL; -PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer = NULL; -PFNGLISSAMPLERPROC glad_glIsSampler = NULL; -PFNGLISSHADERPROC glad_glIsShader = NULL; -PFNGLISSYNCPROC glad_glIsSync = NULL; -PFNGLISTEXTUREPROC glad_glIsTexture = NULL; -PFNGLISVERTEXARRAYPROC glad_glIsVertexArray = NULL; -PFNGLLIGHTMODELFPROC glad_glLightModelf = NULL; -PFNGLLIGHTMODELFVPROC glad_glLightModelfv = NULL; -PFNGLLIGHTMODELIPROC glad_glLightModeli = NULL; -PFNGLLIGHTMODELIVPROC glad_glLightModeliv = NULL; -PFNGLLIGHTFPROC glad_glLightf = NULL; -PFNGLLIGHTFVPROC glad_glLightfv = NULL; -PFNGLLIGHTIPROC glad_glLighti = NULL; -PFNGLLIGHTIVPROC glad_glLightiv = NULL; -PFNGLLINESTIPPLEPROC glad_glLineStipple = NULL; -PFNGLLINEWIDTHPROC glad_glLineWidth = NULL; -PFNGLLINKPROGRAMPROC glad_glLinkProgram = NULL; -PFNGLLISTBASEPROC glad_glListBase = NULL; -PFNGLLOADIDENTITYPROC glad_glLoadIdentity = NULL; -PFNGLLOADMATRIXDPROC glad_glLoadMatrixd = NULL; -PFNGLLOADMATRIXFPROC glad_glLoadMatrixf = NULL; -PFNGLLOADNAMEPROC glad_glLoadName = NULL; -PFNGLLOADTRANSPOSEMATRIXDPROC glad_glLoadTransposeMatrixd = NULL; -PFNGLLOADTRANSPOSEMATRIXFPROC glad_glLoadTransposeMatrixf = NULL; -PFNGLLOGICOPPROC glad_glLogicOp = NULL; -PFNGLMAP1DPROC glad_glMap1d = NULL; -PFNGLMAP1FPROC glad_glMap1f = NULL; -PFNGLMAP2DPROC glad_glMap2d = NULL; -PFNGLMAP2FPROC glad_glMap2f = NULL; -PFNGLMAPBUFFERPROC glad_glMapBuffer = NULL; -PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange = NULL; -PFNGLMAPGRID1DPROC glad_glMapGrid1d = NULL; -PFNGLMAPGRID1FPROC glad_glMapGrid1f = NULL; -PFNGLMAPGRID2DPROC glad_glMapGrid2d = NULL; -PFNGLMAPGRID2FPROC glad_glMapGrid2f = NULL; -PFNGLMATERIALFPROC glad_glMaterialf = NULL; -PFNGLMATERIALFVPROC glad_glMaterialfv = NULL; -PFNGLMATERIALIPROC glad_glMateriali = NULL; -PFNGLMATERIALIVPROC glad_glMaterialiv = NULL; -PFNGLMATRIXMODEPROC glad_glMatrixMode = NULL; -PFNGLMULTMATRIXDPROC glad_glMultMatrixd = NULL; -PFNGLMULTMATRIXFPROC glad_glMultMatrixf = NULL; -PFNGLMULTTRANSPOSEMATRIXDPROC glad_glMultTransposeMatrixd = NULL; -PFNGLMULTTRANSPOSEMATRIXFPROC glad_glMultTransposeMatrixf = NULL; -PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays = NULL; -PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements = NULL; -PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex = NULL; -PFNGLMULTITEXCOORD1DPROC glad_glMultiTexCoord1d = NULL; -PFNGLMULTITEXCOORD1DVPROC glad_glMultiTexCoord1dv = NULL; -PFNGLMULTITEXCOORD1FPROC glad_glMultiTexCoord1f = NULL; -PFNGLMULTITEXCOORD1FVPROC glad_glMultiTexCoord1fv = NULL; -PFNGLMULTITEXCOORD1IPROC glad_glMultiTexCoord1i = NULL; -PFNGLMULTITEXCOORD1IVPROC glad_glMultiTexCoord1iv = NULL; -PFNGLMULTITEXCOORD1SPROC glad_glMultiTexCoord1s = NULL; -PFNGLMULTITEXCOORD1SVPROC glad_glMultiTexCoord1sv = NULL; -PFNGLMULTITEXCOORD2DPROC glad_glMultiTexCoord2d = NULL; -PFNGLMULTITEXCOORD2DVPROC glad_glMultiTexCoord2dv = NULL; -PFNGLMULTITEXCOORD2FPROC glad_glMultiTexCoord2f = NULL; -PFNGLMULTITEXCOORD2FVPROC glad_glMultiTexCoord2fv = NULL; -PFNGLMULTITEXCOORD2IPROC glad_glMultiTexCoord2i = NULL; -PFNGLMULTITEXCOORD2IVPROC glad_glMultiTexCoord2iv = NULL; -PFNGLMULTITEXCOORD2SPROC glad_glMultiTexCoord2s = NULL; -PFNGLMULTITEXCOORD2SVPROC glad_glMultiTexCoord2sv = NULL; -PFNGLMULTITEXCOORD3DPROC glad_glMultiTexCoord3d = NULL; -PFNGLMULTITEXCOORD3DVPROC glad_glMultiTexCoord3dv = NULL; -PFNGLMULTITEXCOORD3FPROC glad_glMultiTexCoord3f = NULL; -PFNGLMULTITEXCOORD3FVPROC glad_glMultiTexCoord3fv = NULL; -PFNGLMULTITEXCOORD3IPROC glad_glMultiTexCoord3i = NULL; -PFNGLMULTITEXCOORD3IVPROC glad_glMultiTexCoord3iv = NULL; -PFNGLMULTITEXCOORD3SPROC glad_glMultiTexCoord3s = NULL; -PFNGLMULTITEXCOORD3SVPROC glad_glMultiTexCoord3sv = NULL; -PFNGLMULTITEXCOORD4DPROC glad_glMultiTexCoord4d = NULL; -PFNGLMULTITEXCOORD4DVPROC glad_glMultiTexCoord4dv = NULL; -PFNGLMULTITEXCOORD4FPROC glad_glMultiTexCoord4f = NULL; -PFNGLMULTITEXCOORD4FVPROC glad_glMultiTexCoord4fv = NULL; -PFNGLMULTITEXCOORD4IPROC glad_glMultiTexCoord4i = NULL; -PFNGLMULTITEXCOORD4IVPROC glad_glMultiTexCoord4iv = NULL; -PFNGLMULTITEXCOORD4SPROC glad_glMultiTexCoord4s = NULL; -PFNGLMULTITEXCOORD4SVPROC glad_glMultiTexCoord4sv = NULL; -PFNGLMULTITEXCOORDP1UIPROC glad_glMultiTexCoordP1ui = NULL; -PFNGLMULTITEXCOORDP1UIVPROC glad_glMultiTexCoordP1uiv = NULL; -PFNGLMULTITEXCOORDP2UIPROC glad_glMultiTexCoordP2ui = NULL; -PFNGLMULTITEXCOORDP2UIVPROC glad_glMultiTexCoordP2uiv = NULL; -PFNGLMULTITEXCOORDP3UIPROC glad_glMultiTexCoordP3ui = NULL; -PFNGLMULTITEXCOORDP3UIVPROC glad_glMultiTexCoordP3uiv = NULL; -PFNGLMULTITEXCOORDP4UIPROC glad_glMultiTexCoordP4ui = NULL; -PFNGLMULTITEXCOORDP4UIVPROC glad_glMultiTexCoordP4uiv = NULL; -PFNGLNEWLISTPROC glad_glNewList = NULL; -PFNGLNORMAL3BPROC glad_glNormal3b = NULL; -PFNGLNORMAL3BVPROC glad_glNormal3bv = NULL; -PFNGLNORMAL3DPROC glad_glNormal3d = NULL; -PFNGLNORMAL3DVPROC glad_glNormal3dv = NULL; -PFNGLNORMAL3FPROC glad_glNormal3f = NULL; -PFNGLNORMAL3FVPROC glad_glNormal3fv = NULL; -PFNGLNORMAL3IPROC glad_glNormal3i = NULL; -PFNGLNORMAL3IVPROC glad_glNormal3iv = NULL; -PFNGLNORMAL3SPROC glad_glNormal3s = NULL; -PFNGLNORMAL3SVPROC glad_glNormal3sv = NULL; -PFNGLNORMALP3UIPROC glad_glNormalP3ui = NULL; -PFNGLNORMALP3UIVPROC glad_glNormalP3uiv = NULL; -PFNGLNORMALPOINTERPROC glad_glNormalPointer = NULL; -PFNGLOBJECTLABELPROC glad_glObjectLabel = NULL; -PFNGLOBJECTPTRLABELPROC glad_glObjectPtrLabel = NULL; -PFNGLORTHOPROC glad_glOrtho = NULL; -PFNGLPASSTHROUGHPROC glad_glPassThrough = NULL; -PFNGLPIXELMAPFVPROC glad_glPixelMapfv = NULL; -PFNGLPIXELMAPUIVPROC glad_glPixelMapuiv = NULL; -PFNGLPIXELMAPUSVPROC glad_glPixelMapusv = NULL; -PFNGLPIXELSTOREFPROC glad_glPixelStoref = NULL; -PFNGLPIXELSTOREIPROC glad_glPixelStorei = NULL; -PFNGLPIXELTRANSFERFPROC glad_glPixelTransferf = NULL; -PFNGLPIXELTRANSFERIPROC glad_glPixelTransferi = NULL; -PFNGLPIXELZOOMPROC glad_glPixelZoom = NULL; -PFNGLPOINTPARAMETERFPROC glad_glPointParameterf = NULL; -PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv = NULL; -PFNGLPOINTPARAMETERIPROC glad_glPointParameteri = NULL; -PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv = NULL; -PFNGLPOINTSIZEPROC glad_glPointSize = NULL; -PFNGLPOLYGONMODEPROC glad_glPolygonMode = NULL; -PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset = NULL; -PFNGLPOLYGONSTIPPLEPROC glad_glPolygonStipple = NULL; -PFNGLPOPATTRIBPROC glad_glPopAttrib = NULL; -PFNGLPOPCLIENTATTRIBPROC glad_glPopClientAttrib = NULL; -PFNGLPOPDEBUGGROUPPROC glad_glPopDebugGroup = NULL; -PFNGLPOPMATRIXPROC glad_glPopMatrix = NULL; -PFNGLPOPNAMEPROC glad_glPopName = NULL; -PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex = NULL; -PFNGLPRIORITIZETEXTURESPROC glad_glPrioritizeTextures = NULL; -PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex = NULL; -PFNGLPUSHATTRIBPROC glad_glPushAttrib = NULL; -PFNGLPUSHCLIENTATTRIBPROC glad_glPushClientAttrib = NULL; -PFNGLPUSHDEBUGGROUPPROC glad_glPushDebugGroup = NULL; -PFNGLPUSHMATRIXPROC glad_glPushMatrix = NULL; -PFNGLPUSHNAMEPROC glad_glPushName = NULL; -PFNGLQUERYCOUNTERPROC glad_glQueryCounter = NULL; -PFNGLRASTERPOS2DPROC glad_glRasterPos2d = NULL; -PFNGLRASTERPOS2DVPROC glad_glRasterPos2dv = NULL; -PFNGLRASTERPOS2FPROC glad_glRasterPos2f = NULL; -PFNGLRASTERPOS2FVPROC glad_glRasterPos2fv = NULL; -PFNGLRASTERPOS2IPROC glad_glRasterPos2i = NULL; -PFNGLRASTERPOS2IVPROC glad_glRasterPos2iv = NULL; -PFNGLRASTERPOS2SPROC glad_glRasterPos2s = NULL; -PFNGLRASTERPOS2SVPROC glad_glRasterPos2sv = NULL; -PFNGLRASTERPOS3DPROC glad_glRasterPos3d = NULL; -PFNGLRASTERPOS3DVPROC glad_glRasterPos3dv = NULL; -PFNGLRASTERPOS3FPROC glad_glRasterPos3f = NULL; -PFNGLRASTERPOS3FVPROC glad_glRasterPos3fv = NULL; -PFNGLRASTERPOS3IPROC glad_glRasterPos3i = NULL; -PFNGLRASTERPOS3IVPROC glad_glRasterPos3iv = NULL; -PFNGLRASTERPOS3SPROC glad_glRasterPos3s = NULL; -PFNGLRASTERPOS3SVPROC glad_glRasterPos3sv = NULL; -PFNGLRASTERPOS4DPROC glad_glRasterPos4d = NULL; -PFNGLRASTERPOS4DVPROC glad_glRasterPos4dv = NULL; -PFNGLRASTERPOS4FPROC glad_glRasterPos4f = NULL; -PFNGLRASTERPOS4FVPROC glad_glRasterPos4fv = NULL; -PFNGLRASTERPOS4IPROC glad_glRasterPos4i = NULL; -PFNGLRASTERPOS4IVPROC glad_glRasterPos4iv = NULL; -PFNGLRASTERPOS4SPROC glad_glRasterPos4s = NULL; -PFNGLRASTERPOS4SVPROC glad_glRasterPos4sv = NULL; -PFNGLREADBUFFERPROC glad_glReadBuffer = NULL; -PFNGLREADPIXELSPROC glad_glReadPixels = NULL; -PFNGLREADNPIXELSARBPROC glad_glReadnPixelsARB = NULL; -PFNGLRECTDPROC glad_glRectd = NULL; -PFNGLRECTDVPROC glad_glRectdv = NULL; -PFNGLRECTFPROC glad_glRectf = NULL; -PFNGLRECTFVPROC glad_glRectfv = NULL; -PFNGLRECTIPROC glad_glRecti = NULL; -PFNGLRECTIVPROC glad_glRectiv = NULL; -PFNGLRECTSPROC glad_glRects = NULL; -PFNGLRECTSVPROC glad_glRectsv = NULL; -PFNGLRENDERMODEPROC glad_glRenderMode = NULL; -PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage = NULL; -PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample = NULL; -PFNGLROTATEDPROC glad_glRotated = NULL; -PFNGLROTATEFPROC glad_glRotatef = NULL; -PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage = NULL; -PFNGLSAMPLECOVERAGEARBPROC glad_glSampleCoverageARB = NULL; -PFNGLSAMPLEMASKIPROC glad_glSampleMaski = NULL; -PFNGLSAMPLERPARAMETERIIVPROC glad_glSamplerParameterIiv = NULL; -PFNGLSAMPLERPARAMETERIUIVPROC glad_glSamplerParameterIuiv = NULL; -PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf = NULL; -PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv = NULL; -PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri = NULL; -PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv = NULL; -PFNGLSCALEDPROC glad_glScaled = NULL; -PFNGLSCALEFPROC glad_glScalef = NULL; -PFNGLSCISSORPROC glad_glScissor = NULL; -PFNGLSECONDARYCOLOR3BPROC glad_glSecondaryColor3b = NULL; -PFNGLSECONDARYCOLOR3BVPROC glad_glSecondaryColor3bv = NULL; -PFNGLSECONDARYCOLOR3DPROC glad_glSecondaryColor3d = NULL; -PFNGLSECONDARYCOLOR3DVPROC glad_glSecondaryColor3dv = NULL; -PFNGLSECONDARYCOLOR3FPROC glad_glSecondaryColor3f = NULL; -PFNGLSECONDARYCOLOR3FVPROC glad_glSecondaryColor3fv = NULL; -PFNGLSECONDARYCOLOR3IPROC glad_glSecondaryColor3i = NULL; -PFNGLSECONDARYCOLOR3IVPROC glad_glSecondaryColor3iv = NULL; -PFNGLSECONDARYCOLOR3SPROC glad_glSecondaryColor3s = NULL; -PFNGLSECONDARYCOLOR3SVPROC glad_glSecondaryColor3sv = NULL; -PFNGLSECONDARYCOLOR3UBPROC glad_glSecondaryColor3ub = NULL; -PFNGLSECONDARYCOLOR3UBVPROC glad_glSecondaryColor3ubv = NULL; -PFNGLSECONDARYCOLOR3UIPROC glad_glSecondaryColor3ui = NULL; -PFNGLSECONDARYCOLOR3UIVPROC glad_glSecondaryColor3uiv = NULL; -PFNGLSECONDARYCOLOR3USPROC glad_glSecondaryColor3us = NULL; -PFNGLSECONDARYCOLOR3USVPROC glad_glSecondaryColor3usv = NULL; -PFNGLSECONDARYCOLORP3UIPROC glad_glSecondaryColorP3ui = NULL; -PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv = NULL; -PFNGLSECONDARYCOLORPOINTERPROC glad_glSecondaryColorPointer = NULL; -PFNGLSELECTBUFFERPROC glad_glSelectBuffer = NULL; -PFNGLSHADEMODELPROC glad_glShadeModel = NULL; -PFNGLSHADERSOURCEPROC glad_glShaderSource = NULL; -PFNGLSTENCILFUNCPROC glad_glStencilFunc = NULL; -PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate = NULL; -PFNGLSTENCILMASKPROC glad_glStencilMask = NULL; -PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate = NULL; -PFNGLSTENCILOPPROC glad_glStencilOp = NULL; -PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate = NULL; -PFNGLTEXBUFFERPROC glad_glTexBuffer = NULL; -PFNGLTEXCOORD1DPROC glad_glTexCoord1d = NULL; -PFNGLTEXCOORD1DVPROC glad_glTexCoord1dv = NULL; -PFNGLTEXCOORD1FPROC glad_glTexCoord1f = NULL; -PFNGLTEXCOORD1FVPROC glad_glTexCoord1fv = NULL; -PFNGLTEXCOORD1IPROC glad_glTexCoord1i = NULL; -PFNGLTEXCOORD1IVPROC glad_glTexCoord1iv = NULL; -PFNGLTEXCOORD1SPROC glad_glTexCoord1s = NULL; -PFNGLTEXCOORD1SVPROC glad_glTexCoord1sv = NULL; -PFNGLTEXCOORD2DPROC glad_glTexCoord2d = NULL; -PFNGLTEXCOORD2DVPROC glad_glTexCoord2dv = NULL; -PFNGLTEXCOORD2FPROC glad_glTexCoord2f = NULL; -PFNGLTEXCOORD2FVPROC glad_glTexCoord2fv = NULL; -PFNGLTEXCOORD2IPROC glad_glTexCoord2i = NULL; -PFNGLTEXCOORD2IVPROC glad_glTexCoord2iv = NULL; -PFNGLTEXCOORD2SPROC glad_glTexCoord2s = NULL; -PFNGLTEXCOORD2SVPROC glad_glTexCoord2sv = NULL; -PFNGLTEXCOORD3DPROC glad_glTexCoord3d = NULL; -PFNGLTEXCOORD3DVPROC glad_glTexCoord3dv = NULL; -PFNGLTEXCOORD3FPROC glad_glTexCoord3f = NULL; -PFNGLTEXCOORD3FVPROC glad_glTexCoord3fv = NULL; -PFNGLTEXCOORD3IPROC glad_glTexCoord3i = NULL; -PFNGLTEXCOORD3IVPROC glad_glTexCoord3iv = NULL; -PFNGLTEXCOORD3SPROC glad_glTexCoord3s = NULL; -PFNGLTEXCOORD3SVPROC glad_glTexCoord3sv = NULL; -PFNGLTEXCOORD4DPROC glad_glTexCoord4d = NULL; -PFNGLTEXCOORD4DVPROC glad_glTexCoord4dv = NULL; -PFNGLTEXCOORD4FPROC glad_glTexCoord4f = NULL; -PFNGLTEXCOORD4FVPROC glad_glTexCoord4fv = NULL; -PFNGLTEXCOORD4IPROC glad_glTexCoord4i = NULL; -PFNGLTEXCOORD4IVPROC glad_glTexCoord4iv = NULL; -PFNGLTEXCOORD4SPROC glad_glTexCoord4s = NULL; -PFNGLTEXCOORD4SVPROC glad_glTexCoord4sv = NULL; -PFNGLTEXCOORDP1UIPROC glad_glTexCoordP1ui = NULL; -PFNGLTEXCOORDP1UIVPROC glad_glTexCoordP1uiv = NULL; -PFNGLTEXCOORDP2UIPROC glad_glTexCoordP2ui = NULL; -PFNGLTEXCOORDP2UIVPROC glad_glTexCoordP2uiv = NULL; -PFNGLTEXCOORDP3UIPROC glad_glTexCoordP3ui = NULL; -PFNGLTEXCOORDP3UIVPROC glad_glTexCoordP3uiv = NULL; -PFNGLTEXCOORDP4UIPROC glad_glTexCoordP4ui = NULL; -PFNGLTEXCOORDP4UIVPROC glad_glTexCoordP4uiv = NULL; -PFNGLTEXCOORDPOINTERPROC glad_glTexCoordPointer = NULL; -PFNGLTEXENVFPROC glad_glTexEnvf = NULL; -PFNGLTEXENVFVPROC glad_glTexEnvfv = NULL; -PFNGLTEXENVIPROC glad_glTexEnvi = NULL; -PFNGLTEXENVIVPROC glad_glTexEnviv = NULL; -PFNGLTEXGENDPROC glad_glTexGend = NULL; -PFNGLTEXGENDVPROC glad_glTexGendv = NULL; -PFNGLTEXGENFPROC glad_glTexGenf = NULL; -PFNGLTEXGENFVPROC glad_glTexGenfv = NULL; -PFNGLTEXGENIPROC glad_glTexGeni = NULL; -PFNGLTEXGENIVPROC glad_glTexGeniv = NULL; -PFNGLTEXIMAGE1DPROC glad_glTexImage1D = NULL; -PFNGLTEXIMAGE2DPROC glad_glTexImage2D = NULL; -PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample = NULL; -PFNGLTEXIMAGE3DPROC glad_glTexImage3D = NULL; -PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample = NULL; -PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv = NULL; -PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv = NULL; -PFNGLTEXPARAMETERFPROC glad_glTexParameterf = NULL; -PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv = NULL; -PFNGLTEXPARAMETERIPROC glad_glTexParameteri = NULL; -PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv = NULL; -PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D = NULL; -PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D = NULL; -PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D = NULL; -PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings = NULL; -PFNGLTRANSLATEDPROC glad_glTranslated = NULL; -PFNGLTRANSLATEFPROC glad_glTranslatef = NULL; -PFNGLUNIFORM1FPROC glad_glUniform1f = NULL; -PFNGLUNIFORM1FVPROC glad_glUniform1fv = NULL; -PFNGLUNIFORM1IPROC glad_glUniform1i = NULL; -PFNGLUNIFORM1IVPROC glad_glUniform1iv = NULL; -PFNGLUNIFORM1UIPROC glad_glUniform1ui = NULL; -PFNGLUNIFORM1UIVPROC glad_glUniform1uiv = NULL; -PFNGLUNIFORM2FPROC glad_glUniform2f = NULL; -PFNGLUNIFORM2FVPROC glad_glUniform2fv = NULL; -PFNGLUNIFORM2IPROC glad_glUniform2i = NULL; -PFNGLUNIFORM2IVPROC glad_glUniform2iv = NULL; -PFNGLUNIFORM2UIPROC glad_glUniform2ui = NULL; -PFNGLUNIFORM2UIVPROC glad_glUniform2uiv = NULL; -PFNGLUNIFORM3FPROC glad_glUniform3f = NULL; -PFNGLUNIFORM3FVPROC glad_glUniform3fv = NULL; -PFNGLUNIFORM3IPROC glad_glUniform3i = NULL; -PFNGLUNIFORM3IVPROC glad_glUniform3iv = NULL; -PFNGLUNIFORM3UIPROC glad_glUniform3ui = NULL; -PFNGLUNIFORM3UIVPROC glad_glUniform3uiv = NULL; -PFNGLUNIFORM4FPROC glad_glUniform4f = NULL; -PFNGLUNIFORM4FVPROC glad_glUniform4fv = NULL; -PFNGLUNIFORM4IPROC glad_glUniform4i = NULL; -PFNGLUNIFORM4IVPROC glad_glUniform4iv = NULL; -PFNGLUNIFORM4UIPROC glad_glUniform4ui = NULL; -PFNGLUNIFORM4UIVPROC glad_glUniform4uiv = NULL; -PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding = NULL; -PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv = NULL; -PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv = NULL; -PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv = NULL; -PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv = NULL; -PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv = NULL; -PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv = NULL; -PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv = NULL; -PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv = NULL; -PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv = NULL; -PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer = NULL; -PFNGLUSEPROGRAMPROC glad_glUseProgram = NULL; -PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram = NULL; -PFNGLVERTEX2DPROC glad_glVertex2d = NULL; -PFNGLVERTEX2DVPROC glad_glVertex2dv = NULL; -PFNGLVERTEX2FPROC glad_glVertex2f = NULL; -PFNGLVERTEX2FVPROC glad_glVertex2fv = NULL; -PFNGLVERTEX2IPROC glad_glVertex2i = NULL; -PFNGLVERTEX2IVPROC glad_glVertex2iv = NULL; -PFNGLVERTEX2SPROC glad_glVertex2s = NULL; -PFNGLVERTEX2SVPROC glad_glVertex2sv = NULL; -PFNGLVERTEX3DPROC glad_glVertex3d = NULL; -PFNGLVERTEX3DVPROC glad_glVertex3dv = NULL; -PFNGLVERTEX3FPROC glad_glVertex3f = NULL; -PFNGLVERTEX3FVPROC glad_glVertex3fv = NULL; -PFNGLVERTEX3IPROC glad_glVertex3i = NULL; -PFNGLVERTEX3IVPROC glad_glVertex3iv = NULL; -PFNGLVERTEX3SPROC glad_glVertex3s = NULL; -PFNGLVERTEX3SVPROC glad_glVertex3sv = NULL; -PFNGLVERTEX4DPROC glad_glVertex4d = NULL; -PFNGLVERTEX4DVPROC glad_glVertex4dv = NULL; -PFNGLVERTEX4FPROC glad_glVertex4f = NULL; -PFNGLVERTEX4FVPROC glad_glVertex4fv = NULL; -PFNGLVERTEX4IPROC glad_glVertex4i = NULL; -PFNGLVERTEX4IVPROC glad_glVertex4iv = NULL; -PFNGLVERTEX4SPROC glad_glVertex4s = NULL; -PFNGLVERTEX4SVPROC glad_glVertex4sv = NULL; -PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d = NULL; -PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv = NULL; -PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f = NULL; -PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv = NULL; -PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s = NULL; -PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv = NULL; -PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d = NULL; -PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv = NULL; -PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f = NULL; -PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv = NULL; -PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s = NULL; -PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv = NULL; -PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d = NULL; -PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv = NULL; -PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f = NULL; -PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv = NULL; -PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s = NULL; -PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv = NULL; -PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv = NULL; -PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv = NULL; -PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv = NULL; -PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub = NULL; -PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv = NULL; -PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv = NULL; -PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv = NULL; -PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv = NULL; -PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d = NULL; -PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv = NULL; -PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f = NULL; -PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv = NULL; -PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv = NULL; -PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s = NULL; -PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv = NULL; -PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv = NULL; -PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv = NULL; -PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv = NULL; -PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor = NULL; -PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i = NULL; -PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv = NULL; -PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui = NULL; -PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv = NULL; -PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i = NULL; -PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv = NULL; -PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui = NULL; -PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv = NULL; -PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i = NULL; -PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv = NULL; -PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui = NULL; -PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv = NULL; -PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv = NULL; -PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i = NULL; -PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv = NULL; -PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv = NULL; -PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv = NULL; -PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui = NULL; -PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv = NULL; -PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv = NULL; -PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer = NULL; -PFNGLVERTEXATTRIBP1UIPROC glad_glVertexAttribP1ui = NULL; -PFNGLVERTEXATTRIBP1UIVPROC glad_glVertexAttribP1uiv = NULL; -PFNGLVERTEXATTRIBP2UIPROC glad_glVertexAttribP2ui = NULL; -PFNGLVERTEXATTRIBP2UIVPROC glad_glVertexAttribP2uiv = NULL; -PFNGLVERTEXATTRIBP3UIPROC glad_glVertexAttribP3ui = NULL; -PFNGLVERTEXATTRIBP3UIVPROC glad_glVertexAttribP3uiv = NULL; -PFNGLVERTEXATTRIBP4UIPROC glad_glVertexAttribP4ui = NULL; -PFNGLVERTEXATTRIBP4UIVPROC glad_glVertexAttribP4uiv = NULL; -PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer = NULL; -PFNGLVERTEXP2UIPROC glad_glVertexP2ui = NULL; -PFNGLVERTEXP2UIVPROC glad_glVertexP2uiv = NULL; -PFNGLVERTEXP3UIPROC glad_glVertexP3ui = NULL; -PFNGLVERTEXP3UIVPROC glad_glVertexP3uiv = NULL; -PFNGLVERTEXP4UIPROC glad_glVertexP4ui = NULL; -PFNGLVERTEXP4UIVPROC glad_glVertexP4uiv = NULL; -PFNGLVERTEXPOINTERPROC glad_glVertexPointer = NULL; -PFNGLVIEWPORTPROC glad_glViewport = NULL; -PFNGLWAITSYNCPROC glad_glWaitSync = NULL; -PFNGLWINDOWPOS2DPROC glad_glWindowPos2d = NULL; -PFNGLWINDOWPOS2DVPROC glad_glWindowPos2dv = NULL; -PFNGLWINDOWPOS2FPROC glad_glWindowPos2f = NULL; -PFNGLWINDOWPOS2FVPROC glad_glWindowPos2fv = NULL; -PFNGLWINDOWPOS2IPROC glad_glWindowPos2i = NULL; -PFNGLWINDOWPOS2IVPROC glad_glWindowPos2iv = NULL; -PFNGLWINDOWPOS2SPROC glad_glWindowPos2s = NULL; -PFNGLWINDOWPOS2SVPROC glad_glWindowPos2sv = NULL; -PFNGLWINDOWPOS3DPROC glad_glWindowPos3d = NULL; -PFNGLWINDOWPOS3DVPROC glad_glWindowPos3dv = NULL; -PFNGLWINDOWPOS3FPROC glad_glWindowPos3f = NULL; -PFNGLWINDOWPOS3FVPROC glad_glWindowPos3fv = NULL; -PFNGLWINDOWPOS3IPROC glad_glWindowPos3i = NULL; -PFNGLWINDOWPOS3IVPROC glad_glWindowPos3iv = NULL; -PFNGLWINDOWPOS3SPROC glad_glWindowPos3s = NULL; -PFNGLWINDOWPOS3SVPROC glad_glWindowPos3sv = NULL; - - -static void glad_gl_load_GL_VERSION_1_0( GLADuserptrloadfunc load, void* userptr) { - if(!GLAD_GL_VERSION_1_0) return; - glad_glAccum = (PFNGLACCUMPROC) load(userptr, "glAccum"); - glad_glAlphaFunc = (PFNGLALPHAFUNCPROC) load(userptr, "glAlphaFunc"); - glad_glBegin = (PFNGLBEGINPROC) load(userptr, "glBegin"); - glad_glBitmap = (PFNGLBITMAPPROC) load(userptr, "glBitmap"); - glad_glBlendFunc = (PFNGLBLENDFUNCPROC) load(userptr, "glBlendFunc"); - glad_glCallList = (PFNGLCALLLISTPROC) load(userptr, "glCallList"); - glad_glCallLists = (PFNGLCALLLISTSPROC) load(userptr, "glCallLists"); - glad_glClear = (PFNGLCLEARPROC) load(userptr, "glClear"); - glad_glClearAccum = (PFNGLCLEARACCUMPROC) load(userptr, "glClearAccum"); - glad_glClearColor = (PFNGLCLEARCOLORPROC) load(userptr, "glClearColor"); - glad_glClearDepth = (PFNGLCLEARDEPTHPROC) load(userptr, "glClearDepth"); - glad_glClearIndex = (PFNGLCLEARINDEXPROC) load(userptr, "glClearIndex"); - glad_glClearStencil = (PFNGLCLEARSTENCILPROC) load(userptr, "glClearStencil"); - glad_glClipPlane = (PFNGLCLIPPLANEPROC) load(userptr, "glClipPlane"); - glad_glColor3b = (PFNGLCOLOR3BPROC) load(userptr, "glColor3b"); - glad_glColor3bv = (PFNGLCOLOR3BVPROC) load(userptr, "glColor3bv"); - glad_glColor3d = (PFNGLCOLOR3DPROC) load(userptr, "glColor3d"); - glad_glColor3dv = (PFNGLCOLOR3DVPROC) load(userptr, "glColor3dv"); - glad_glColor3f = (PFNGLCOLOR3FPROC) load(userptr, "glColor3f"); - glad_glColor3fv = (PFNGLCOLOR3FVPROC) load(userptr, "glColor3fv"); - glad_glColor3i = (PFNGLCOLOR3IPROC) load(userptr, "glColor3i"); - glad_glColor3iv = (PFNGLCOLOR3IVPROC) load(userptr, "glColor3iv"); - glad_glColor3s = (PFNGLCOLOR3SPROC) load(userptr, "glColor3s"); - glad_glColor3sv = (PFNGLCOLOR3SVPROC) load(userptr, "glColor3sv"); - glad_glColor3ub = (PFNGLCOLOR3UBPROC) load(userptr, "glColor3ub"); - glad_glColor3ubv = (PFNGLCOLOR3UBVPROC) load(userptr, "glColor3ubv"); - glad_glColor3ui = (PFNGLCOLOR3UIPROC) load(userptr, "glColor3ui"); - glad_glColor3uiv = (PFNGLCOLOR3UIVPROC) load(userptr, "glColor3uiv"); - glad_glColor3us = (PFNGLCOLOR3USPROC) load(userptr, "glColor3us"); - glad_glColor3usv = (PFNGLCOLOR3USVPROC) load(userptr, "glColor3usv"); - glad_glColor4b = (PFNGLCOLOR4BPROC) load(userptr, "glColor4b"); - glad_glColor4bv = (PFNGLCOLOR4BVPROC) load(userptr, "glColor4bv"); - glad_glColor4d = (PFNGLCOLOR4DPROC) load(userptr, "glColor4d"); - glad_glColor4dv = (PFNGLCOLOR4DVPROC) load(userptr, "glColor4dv"); - glad_glColor4f = (PFNGLCOLOR4FPROC) load(userptr, "glColor4f"); - glad_glColor4fv = (PFNGLCOLOR4FVPROC) load(userptr, "glColor4fv"); - glad_glColor4i = (PFNGLCOLOR4IPROC) load(userptr, "glColor4i"); - glad_glColor4iv = (PFNGLCOLOR4IVPROC) load(userptr, "glColor4iv"); - glad_glColor4s = (PFNGLCOLOR4SPROC) load(userptr, "glColor4s"); - glad_glColor4sv = (PFNGLCOLOR4SVPROC) load(userptr, "glColor4sv"); - glad_glColor4ub = (PFNGLCOLOR4UBPROC) load(userptr, "glColor4ub"); - glad_glColor4ubv = (PFNGLCOLOR4UBVPROC) load(userptr, "glColor4ubv"); - glad_glColor4ui = (PFNGLCOLOR4UIPROC) load(userptr, "glColor4ui"); - glad_glColor4uiv = (PFNGLCOLOR4UIVPROC) load(userptr, "glColor4uiv"); - glad_glColor4us = (PFNGLCOLOR4USPROC) load(userptr, "glColor4us"); - glad_glColor4usv = (PFNGLCOLOR4USVPROC) load(userptr, "glColor4usv"); - glad_glColorMask = (PFNGLCOLORMASKPROC) load(userptr, "glColorMask"); - glad_glColorMaterial = (PFNGLCOLORMATERIALPROC) load(userptr, "glColorMaterial"); - glad_glCopyPixels = (PFNGLCOPYPIXELSPROC) load(userptr, "glCopyPixels"); - glad_glCullFace = (PFNGLCULLFACEPROC) load(userptr, "glCullFace"); - glad_glDeleteLists = (PFNGLDELETELISTSPROC) load(userptr, "glDeleteLists"); - glad_glDepthFunc = (PFNGLDEPTHFUNCPROC) load(userptr, "glDepthFunc"); - glad_glDepthMask = (PFNGLDEPTHMASKPROC) load(userptr, "glDepthMask"); - glad_glDepthRange = (PFNGLDEPTHRANGEPROC) load(userptr, "glDepthRange"); - glad_glDisable = (PFNGLDISABLEPROC) load(userptr, "glDisable"); - glad_glDrawBuffer = (PFNGLDRAWBUFFERPROC) load(userptr, "glDrawBuffer"); - glad_glDrawPixels = (PFNGLDRAWPIXELSPROC) load(userptr, "glDrawPixels"); - glad_glEdgeFlag = (PFNGLEDGEFLAGPROC) load(userptr, "glEdgeFlag"); - glad_glEdgeFlagv = (PFNGLEDGEFLAGVPROC) load(userptr, "glEdgeFlagv"); - glad_glEnable = (PFNGLENABLEPROC) load(userptr, "glEnable"); - glad_glEnd = (PFNGLENDPROC) load(userptr, "glEnd"); - glad_glEndList = (PFNGLENDLISTPROC) load(userptr, "glEndList"); - glad_glEvalCoord1d = (PFNGLEVALCOORD1DPROC) load(userptr, "glEvalCoord1d"); - glad_glEvalCoord1dv = (PFNGLEVALCOORD1DVPROC) load(userptr, "glEvalCoord1dv"); - glad_glEvalCoord1f = (PFNGLEVALCOORD1FPROC) load(userptr, "glEvalCoord1f"); - glad_glEvalCoord1fv = (PFNGLEVALCOORD1FVPROC) load(userptr, "glEvalCoord1fv"); - glad_glEvalCoord2d = (PFNGLEVALCOORD2DPROC) load(userptr, "glEvalCoord2d"); - glad_glEvalCoord2dv = (PFNGLEVALCOORD2DVPROC) load(userptr, "glEvalCoord2dv"); - glad_glEvalCoord2f = (PFNGLEVALCOORD2FPROC) load(userptr, "glEvalCoord2f"); - glad_glEvalCoord2fv = (PFNGLEVALCOORD2FVPROC) load(userptr, "glEvalCoord2fv"); - glad_glEvalMesh1 = (PFNGLEVALMESH1PROC) load(userptr, "glEvalMesh1"); - glad_glEvalMesh2 = (PFNGLEVALMESH2PROC) load(userptr, "glEvalMesh2"); - glad_glEvalPoint1 = (PFNGLEVALPOINT1PROC) load(userptr, "glEvalPoint1"); - glad_glEvalPoint2 = (PFNGLEVALPOINT2PROC) load(userptr, "glEvalPoint2"); - glad_glFeedbackBuffer = (PFNGLFEEDBACKBUFFERPROC) load(userptr, "glFeedbackBuffer"); - glad_glFinish = (PFNGLFINISHPROC) load(userptr, "glFinish"); - glad_glFlush = (PFNGLFLUSHPROC) load(userptr, "glFlush"); - glad_glFogf = (PFNGLFOGFPROC) load(userptr, "glFogf"); - glad_glFogfv = (PFNGLFOGFVPROC) load(userptr, "glFogfv"); - glad_glFogi = (PFNGLFOGIPROC) load(userptr, "glFogi"); - glad_glFogiv = (PFNGLFOGIVPROC) load(userptr, "glFogiv"); - glad_glFrontFace = (PFNGLFRONTFACEPROC) load(userptr, "glFrontFace"); - glad_glFrustum = (PFNGLFRUSTUMPROC) load(userptr, "glFrustum"); - glad_glGenLists = (PFNGLGENLISTSPROC) load(userptr, "glGenLists"); - glad_glGetBooleanv = (PFNGLGETBOOLEANVPROC) load(userptr, "glGetBooleanv"); - glad_glGetClipPlane = (PFNGLGETCLIPPLANEPROC) load(userptr, "glGetClipPlane"); - glad_glGetDoublev = (PFNGLGETDOUBLEVPROC) load(userptr, "glGetDoublev"); - glad_glGetError = (PFNGLGETERRORPROC) load(userptr, "glGetError"); - glad_glGetFloatv = (PFNGLGETFLOATVPROC) load(userptr, "glGetFloatv"); - glad_glGetIntegerv = (PFNGLGETINTEGERVPROC) load(userptr, "glGetIntegerv"); - glad_glGetLightfv = (PFNGLGETLIGHTFVPROC) load(userptr, "glGetLightfv"); - glad_glGetLightiv = (PFNGLGETLIGHTIVPROC) load(userptr, "glGetLightiv"); - glad_glGetMapdv = (PFNGLGETMAPDVPROC) load(userptr, "glGetMapdv"); - glad_glGetMapfv = (PFNGLGETMAPFVPROC) load(userptr, "glGetMapfv"); - glad_glGetMapiv = (PFNGLGETMAPIVPROC) load(userptr, "glGetMapiv"); - glad_glGetMaterialfv = (PFNGLGETMATERIALFVPROC) load(userptr, "glGetMaterialfv"); - glad_glGetMaterialiv = (PFNGLGETMATERIALIVPROC) load(userptr, "glGetMaterialiv"); - glad_glGetPixelMapfv = (PFNGLGETPIXELMAPFVPROC) load(userptr, "glGetPixelMapfv"); - glad_glGetPixelMapuiv = (PFNGLGETPIXELMAPUIVPROC) load(userptr, "glGetPixelMapuiv"); - glad_glGetPixelMapusv = (PFNGLGETPIXELMAPUSVPROC) load(userptr, "glGetPixelMapusv"); - glad_glGetPolygonStipple = (PFNGLGETPOLYGONSTIPPLEPROC) load(userptr, "glGetPolygonStipple"); - glad_glGetString = (PFNGLGETSTRINGPROC) load(userptr, "glGetString"); - glad_glGetTexEnvfv = (PFNGLGETTEXENVFVPROC) load(userptr, "glGetTexEnvfv"); - glad_glGetTexEnviv = (PFNGLGETTEXENVIVPROC) load(userptr, "glGetTexEnviv"); - glad_glGetTexGendv = (PFNGLGETTEXGENDVPROC) load(userptr, "glGetTexGendv"); - glad_glGetTexGenfv = (PFNGLGETTEXGENFVPROC) load(userptr, "glGetTexGenfv"); - glad_glGetTexGeniv = (PFNGLGETTEXGENIVPROC) load(userptr, "glGetTexGeniv"); - glad_glGetTexImage = (PFNGLGETTEXIMAGEPROC) load(userptr, "glGetTexImage"); - glad_glGetTexLevelParameterfv = (PFNGLGETTEXLEVELPARAMETERFVPROC) load(userptr, "glGetTexLevelParameterfv"); - glad_glGetTexLevelParameteriv = (PFNGLGETTEXLEVELPARAMETERIVPROC) load(userptr, "glGetTexLevelParameteriv"); - glad_glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC) load(userptr, "glGetTexParameterfv"); - glad_glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC) load(userptr, "glGetTexParameteriv"); - glad_glHint = (PFNGLHINTPROC) load(userptr, "glHint"); - glad_glIndexMask = (PFNGLINDEXMASKPROC) load(userptr, "glIndexMask"); - glad_glIndexd = (PFNGLINDEXDPROC) load(userptr, "glIndexd"); - glad_glIndexdv = (PFNGLINDEXDVPROC) load(userptr, "glIndexdv"); - glad_glIndexf = (PFNGLINDEXFPROC) load(userptr, "glIndexf"); - glad_glIndexfv = (PFNGLINDEXFVPROC) load(userptr, "glIndexfv"); - glad_glIndexi = (PFNGLINDEXIPROC) load(userptr, "glIndexi"); - glad_glIndexiv = (PFNGLINDEXIVPROC) load(userptr, "glIndexiv"); - glad_glIndexs = (PFNGLINDEXSPROC) load(userptr, "glIndexs"); - glad_glIndexsv = (PFNGLINDEXSVPROC) load(userptr, "glIndexsv"); - glad_glInitNames = (PFNGLINITNAMESPROC) load(userptr, "glInitNames"); - glad_glIsEnabled = (PFNGLISENABLEDPROC) load(userptr, "glIsEnabled"); - glad_glIsList = (PFNGLISLISTPROC) load(userptr, "glIsList"); - glad_glLightModelf = (PFNGLLIGHTMODELFPROC) load(userptr, "glLightModelf"); - glad_glLightModelfv = (PFNGLLIGHTMODELFVPROC) load(userptr, "glLightModelfv"); - glad_glLightModeli = (PFNGLLIGHTMODELIPROC) load(userptr, "glLightModeli"); - glad_glLightModeliv = (PFNGLLIGHTMODELIVPROC) load(userptr, "glLightModeliv"); - glad_glLightf = (PFNGLLIGHTFPROC) load(userptr, "glLightf"); - glad_glLightfv = (PFNGLLIGHTFVPROC) load(userptr, "glLightfv"); - glad_glLighti = (PFNGLLIGHTIPROC) load(userptr, "glLighti"); - glad_glLightiv = (PFNGLLIGHTIVPROC) load(userptr, "glLightiv"); - glad_glLineStipple = (PFNGLLINESTIPPLEPROC) load(userptr, "glLineStipple"); - glad_glLineWidth = (PFNGLLINEWIDTHPROC) load(userptr, "glLineWidth"); - glad_glListBase = (PFNGLLISTBASEPROC) load(userptr, "glListBase"); - glad_glLoadIdentity = (PFNGLLOADIDENTITYPROC) load(userptr, "glLoadIdentity"); - glad_glLoadMatrixd = (PFNGLLOADMATRIXDPROC) load(userptr, "glLoadMatrixd"); - glad_glLoadMatrixf = (PFNGLLOADMATRIXFPROC) load(userptr, "glLoadMatrixf"); - glad_glLoadName = (PFNGLLOADNAMEPROC) load(userptr, "glLoadName"); - glad_glLogicOp = (PFNGLLOGICOPPROC) load(userptr, "glLogicOp"); - glad_glMap1d = (PFNGLMAP1DPROC) load(userptr, "glMap1d"); - glad_glMap1f = (PFNGLMAP1FPROC) load(userptr, "glMap1f"); - glad_glMap2d = (PFNGLMAP2DPROC) load(userptr, "glMap2d"); - glad_glMap2f = (PFNGLMAP2FPROC) load(userptr, "glMap2f"); - glad_glMapGrid1d = (PFNGLMAPGRID1DPROC) load(userptr, "glMapGrid1d"); - glad_glMapGrid1f = (PFNGLMAPGRID1FPROC) load(userptr, "glMapGrid1f"); - glad_glMapGrid2d = (PFNGLMAPGRID2DPROC) load(userptr, "glMapGrid2d"); - glad_glMapGrid2f = (PFNGLMAPGRID2FPROC) load(userptr, "glMapGrid2f"); - glad_glMaterialf = (PFNGLMATERIALFPROC) load(userptr, "glMaterialf"); - glad_glMaterialfv = (PFNGLMATERIALFVPROC) load(userptr, "glMaterialfv"); - glad_glMateriali = (PFNGLMATERIALIPROC) load(userptr, "glMateriali"); - glad_glMaterialiv = (PFNGLMATERIALIVPROC) load(userptr, "glMaterialiv"); - glad_glMatrixMode = (PFNGLMATRIXMODEPROC) load(userptr, "glMatrixMode"); - glad_glMultMatrixd = (PFNGLMULTMATRIXDPROC) load(userptr, "glMultMatrixd"); - glad_glMultMatrixf = (PFNGLMULTMATRIXFPROC) load(userptr, "glMultMatrixf"); - glad_glNewList = (PFNGLNEWLISTPROC) load(userptr, "glNewList"); - glad_glNormal3b = (PFNGLNORMAL3BPROC) load(userptr, "glNormal3b"); - glad_glNormal3bv = (PFNGLNORMAL3BVPROC) load(userptr, "glNormal3bv"); - glad_glNormal3d = (PFNGLNORMAL3DPROC) load(userptr, "glNormal3d"); - glad_glNormal3dv = (PFNGLNORMAL3DVPROC) load(userptr, "glNormal3dv"); - glad_glNormal3f = (PFNGLNORMAL3FPROC) load(userptr, "glNormal3f"); - glad_glNormal3fv = (PFNGLNORMAL3FVPROC) load(userptr, "glNormal3fv"); - glad_glNormal3i = (PFNGLNORMAL3IPROC) load(userptr, "glNormal3i"); - glad_glNormal3iv = (PFNGLNORMAL3IVPROC) load(userptr, "glNormal3iv"); - glad_glNormal3s = (PFNGLNORMAL3SPROC) load(userptr, "glNormal3s"); - glad_glNormal3sv = (PFNGLNORMAL3SVPROC) load(userptr, "glNormal3sv"); - glad_glOrtho = (PFNGLORTHOPROC) load(userptr, "glOrtho"); - glad_glPassThrough = (PFNGLPASSTHROUGHPROC) load(userptr, "glPassThrough"); - glad_glPixelMapfv = (PFNGLPIXELMAPFVPROC) load(userptr, "glPixelMapfv"); - glad_glPixelMapuiv = (PFNGLPIXELMAPUIVPROC) load(userptr, "glPixelMapuiv"); - glad_glPixelMapusv = (PFNGLPIXELMAPUSVPROC) load(userptr, "glPixelMapusv"); - glad_glPixelStoref = (PFNGLPIXELSTOREFPROC) load(userptr, "glPixelStoref"); - glad_glPixelStorei = (PFNGLPIXELSTOREIPROC) load(userptr, "glPixelStorei"); - glad_glPixelTransferf = (PFNGLPIXELTRANSFERFPROC) load(userptr, "glPixelTransferf"); - glad_glPixelTransferi = (PFNGLPIXELTRANSFERIPROC) load(userptr, "glPixelTransferi"); - glad_glPixelZoom = (PFNGLPIXELZOOMPROC) load(userptr, "glPixelZoom"); - glad_glPointSize = (PFNGLPOINTSIZEPROC) load(userptr, "glPointSize"); - glad_glPolygonMode = (PFNGLPOLYGONMODEPROC) load(userptr, "glPolygonMode"); - glad_glPolygonStipple = (PFNGLPOLYGONSTIPPLEPROC) load(userptr, "glPolygonStipple"); - glad_glPopAttrib = (PFNGLPOPATTRIBPROC) load(userptr, "glPopAttrib"); - glad_glPopMatrix = (PFNGLPOPMATRIXPROC) load(userptr, "glPopMatrix"); - glad_glPopName = (PFNGLPOPNAMEPROC) load(userptr, "glPopName"); - glad_glPushAttrib = (PFNGLPUSHATTRIBPROC) load(userptr, "glPushAttrib"); - glad_glPushMatrix = (PFNGLPUSHMATRIXPROC) load(userptr, "glPushMatrix"); - glad_glPushName = (PFNGLPUSHNAMEPROC) load(userptr, "glPushName"); - glad_glRasterPos2d = (PFNGLRASTERPOS2DPROC) load(userptr, "glRasterPos2d"); - glad_glRasterPos2dv = (PFNGLRASTERPOS2DVPROC) load(userptr, "glRasterPos2dv"); - glad_glRasterPos2f = (PFNGLRASTERPOS2FPROC) load(userptr, "glRasterPos2f"); - glad_glRasterPos2fv = (PFNGLRASTERPOS2FVPROC) load(userptr, "glRasterPos2fv"); - glad_glRasterPos2i = (PFNGLRASTERPOS2IPROC) load(userptr, "glRasterPos2i"); - glad_glRasterPos2iv = (PFNGLRASTERPOS2IVPROC) load(userptr, "glRasterPos2iv"); - glad_glRasterPos2s = (PFNGLRASTERPOS2SPROC) load(userptr, "glRasterPos2s"); - glad_glRasterPos2sv = (PFNGLRASTERPOS2SVPROC) load(userptr, "glRasterPos2sv"); - glad_glRasterPos3d = (PFNGLRASTERPOS3DPROC) load(userptr, "glRasterPos3d"); - glad_glRasterPos3dv = (PFNGLRASTERPOS3DVPROC) load(userptr, "glRasterPos3dv"); - glad_glRasterPos3f = (PFNGLRASTERPOS3FPROC) load(userptr, "glRasterPos3f"); - glad_glRasterPos3fv = (PFNGLRASTERPOS3FVPROC) load(userptr, "glRasterPos3fv"); - glad_glRasterPos3i = (PFNGLRASTERPOS3IPROC) load(userptr, "glRasterPos3i"); - glad_glRasterPos3iv = (PFNGLRASTERPOS3IVPROC) load(userptr, "glRasterPos3iv"); - glad_glRasterPos3s = (PFNGLRASTERPOS3SPROC) load(userptr, "glRasterPos3s"); - glad_glRasterPos3sv = (PFNGLRASTERPOS3SVPROC) load(userptr, "glRasterPos3sv"); - glad_glRasterPos4d = (PFNGLRASTERPOS4DPROC) load(userptr, "glRasterPos4d"); - glad_glRasterPos4dv = (PFNGLRASTERPOS4DVPROC) load(userptr, "glRasterPos4dv"); - glad_glRasterPos4f = (PFNGLRASTERPOS4FPROC) load(userptr, "glRasterPos4f"); - glad_glRasterPos4fv = (PFNGLRASTERPOS4FVPROC) load(userptr, "glRasterPos4fv"); - glad_glRasterPos4i = (PFNGLRASTERPOS4IPROC) load(userptr, "glRasterPos4i"); - glad_glRasterPos4iv = (PFNGLRASTERPOS4IVPROC) load(userptr, "glRasterPos4iv"); - glad_glRasterPos4s = (PFNGLRASTERPOS4SPROC) load(userptr, "glRasterPos4s"); - glad_glRasterPos4sv = (PFNGLRASTERPOS4SVPROC) load(userptr, "glRasterPos4sv"); - glad_glReadBuffer = (PFNGLREADBUFFERPROC) load(userptr, "glReadBuffer"); - glad_glReadPixels = (PFNGLREADPIXELSPROC) load(userptr, "glReadPixels"); - glad_glRectd = (PFNGLRECTDPROC) load(userptr, "glRectd"); - glad_glRectdv = (PFNGLRECTDVPROC) load(userptr, "glRectdv"); - glad_glRectf = (PFNGLRECTFPROC) load(userptr, "glRectf"); - glad_glRectfv = (PFNGLRECTFVPROC) load(userptr, "glRectfv"); - glad_glRecti = (PFNGLRECTIPROC) load(userptr, "glRecti"); - glad_glRectiv = (PFNGLRECTIVPROC) load(userptr, "glRectiv"); - glad_glRects = (PFNGLRECTSPROC) load(userptr, "glRects"); - glad_glRectsv = (PFNGLRECTSVPROC) load(userptr, "glRectsv"); - glad_glRenderMode = (PFNGLRENDERMODEPROC) load(userptr, "glRenderMode"); - glad_glRotated = (PFNGLROTATEDPROC) load(userptr, "glRotated"); - glad_glRotatef = (PFNGLROTATEFPROC) load(userptr, "glRotatef"); - glad_glScaled = (PFNGLSCALEDPROC) load(userptr, "glScaled"); - glad_glScalef = (PFNGLSCALEFPROC) load(userptr, "glScalef"); - glad_glScissor = (PFNGLSCISSORPROC) load(userptr, "glScissor"); - glad_glSelectBuffer = (PFNGLSELECTBUFFERPROC) load(userptr, "glSelectBuffer"); - glad_glShadeModel = (PFNGLSHADEMODELPROC) load(userptr, "glShadeModel"); - glad_glStencilFunc = (PFNGLSTENCILFUNCPROC) load(userptr, "glStencilFunc"); - glad_glStencilMask = (PFNGLSTENCILMASKPROC) load(userptr, "glStencilMask"); - glad_glStencilOp = (PFNGLSTENCILOPPROC) load(userptr, "glStencilOp"); - glad_glTexCoord1d = (PFNGLTEXCOORD1DPROC) load(userptr, "glTexCoord1d"); - glad_glTexCoord1dv = (PFNGLTEXCOORD1DVPROC) load(userptr, "glTexCoord1dv"); - glad_glTexCoord1f = (PFNGLTEXCOORD1FPROC) load(userptr, "glTexCoord1f"); - glad_glTexCoord1fv = (PFNGLTEXCOORD1FVPROC) load(userptr, "glTexCoord1fv"); - glad_glTexCoord1i = (PFNGLTEXCOORD1IPROC) load(userptr, "glTexCoord1i"); - glad_glTexCoord1iv = (PFNGLTEXCOORD1IVPROC) load(userptr, "glTexCoord1iv"); - glad_glTexCoord1s = (PFNGLTEXCOORD1SPROC) load(userptr, "glTexCoord1s"); - glad_glTexCoord1sv = (PFNGLTEXCOORD1SVPROC) load(userptr, "glTexCoord1sv"); - glad_glTexCoord2d = (PFNGLTEXCOORD2DPROC) load(userptr, "glTexCoord2d"); - glad_glTexCoord2dv = (PFNGLTEXCOORD2DVPROC) load(userptr, "glTexCoord2dv"); - glad_glTexCoord2f = (PFNGLTEXCOORD2FPROC) load(userptr, "glTexCoord2f"); - glad_glTexCoord2fv = (PFNGLTEXCOORD2FVPROC) load(userptr, "glTexCoord2fv"); - glad_glTexCoord2i = (PFNGLTEXCOORD2IPROC) load(userptr, "glTexCoord2i"); - glad_glTexCoord2iv = (PFNGLTEXCOORD2IVPROC) load(userptr, "glTexCoord2iv"); - glad_glTexCoord2s = (PFNGLTEXCOORD2SPROC) load(userptr, "glTexCoord2s"); - glad_glTexCoord2sv = (PFNGLTEXCOORD2SVPROC) load(userptr, "glTexCoord2sv"); - glad_glTexCoord3d = (PFNGLTEXCOORD3DPROC) load(userptr, "glTexCoord3d"); - glad_glTexCoord3dv = (PFNGLTEXCOORD3DVPROC) load(userptr, "glTexCoord3dv"); - glad_glTexCoord3f = (PFNGLTEXCOORD3FPROC) load(userptr, "glTexCoord3f"); - glad_glTexCoord3fv = (PFNGLTEXCOORD3FVPROC) load(userptr, "glTexCoord3fv"); - glad_glTexCoord3i = (PFNGLTEXCOORD3IPROC) load(userptr, "glTexCoord3i"); - glad_glTexCoord3iv = (PFNGLTEXCOORD3IVPROC) load(userptr, "glTexCoord3iv"); - glad_glTexCoord3s = (PFNGLTEXCOORD3SPROC) load(userptr, "glTexCoord3s"); - glad_glTexCoord3sv = (PFNGLTEXCOORD3SVPROC) load(userptr, "glTexCoord3sv"); - glad_glTexCoord4d = (PFNGLTEXCOORD4DPROC) load(userptr, "glTexCoord4d"); - glad_glTexCoord4dv = (PFNGLTEXCOORD4DVPROC) load(userptr, "glTexCoord4dv"); - glad_glTexCoord4f = (PFNGLTEXCOORD4FPROC) load(userptr, "glTexCoord4f"); - glad_glTexCoord4fv = (PFNGLTEXCOORD4FVPROC) load(userptr, "glTexCoord4fv"); - glad_glTexCoord4i = (PFNGLTEXCOORD4IPROC) load(userptr, "glTexCoord4i"); - glad_glTexCoord4iv = (PFNGLTEXCOORD4IVPROC) load(userptr, "glTexCoord4iv"); - glad_glTexCoord4s = (PFNGLTEXCOORD4SPROC) load(userptr, "glTexCoord4s"); - glad_glTexCoord4sv = (PFNGLTEXCOORD4SVPROC) load(userptr, "glTexCoord4sv"); - glad_glTexEnvf = (PFNGLTEXENVFPROC) load(userptr, "glTexEnvf"); - glad_glTexEnvfv = (PFNGLTEXENVFVPROC) load(userptr, "glTexEnvfv"); - glad_glTexEnvi = (PFNGLTEXENVIPROC) load(userptr, "glTexEnvi"); - glad_glTexEnviv = (PFNGLTEXENVIVPROC) load(userptr, "glTexEnviv"); - glad_glTexGend = (PFNGLTEXGENDPROC) load(userptr, "glTexGend"); - glad_glTexGendv = (PFNGLTEXGENDVPROC) load(userptr, "glTexGendv"); - glad_glTexGenf = (PFNGLTEXGENFPROC) load(userptr, "glTexGenf"); - glad_glTexGenfv = (PFNGLTEXGENFVPROC) load(userptr, "glTexGenfv"); - glad_glTexGeni = (PFNGLTEXGENIPROC) load(userptr, "glTexGeni"); - glad_glTexGeniv = (PFNGLTEXGENIVPROC) load(userptr, "glTexGeniv"); - glad_glTexImage1D = (PFNGLTEXIMAGE1DPROC) load(userptr, "glTexImage1D"); - glad_glTexImage2D = (PFNGLTEXIMAGE2DPROC) load(userptr, "glTexImage2D"); - glad_glTexParameterf = (PFNGLTEXPARAMETERFPROC) load(userptr, "glTexParameterf"); - glad_glTexParameterfv = (PFNGLTEXPARAMETERFVPROC) load(userptr, "glTexParameterfv"); - glad_glTexParameteri = (PFNGLTEXPARAMETERIPROC) load(userptr, "glTexParameteri"); - glad_glTexParameteriv = (PFNGLTEXPARAMETERIVPROC) load(userptr, "glTexParameteriv"); - glad_glTranslated = (PFNGLTRANSLATEDPROC) load(userptr, "glTranslated"); - glad_glTranslatef = (PFNGLTRANSLATEFPROC) load(userptr, "glTranslatef"); - glad_glVertex2d = (PFNGLVERTEX2DPROC) load(userptr, "glVertex2d"); - glad_glVertex2dv = (PFNGLVERTEX2DVPROC) load(userptr, "glVertex2dv"); - glad_glVertex2f = (PFNGLVERTEX2FPROC) load(userptr, "glVertex2f"); - glad_glVertex2fv = (PFNGLVERTEX2FVPROC) load(userptr, "glVertex2fv"); - glad_glVertex2i = (PFNGLVERTEX2IPROC) load(userptr, "glVertex2i"); - glad_glVertex2iv = (PFNGLVERTEX2IVPROC) load(userptr, "glVertex2iv"); - glad_glVertex2s = (PFNGLVERTEX2SPROC) load(userptr, "glVertex2s"); - glad_glVertex2sv = (PFNGLVERTEX2SVPROC) load(userptr, "glVertex2sv"); - glad_glVertex3d = (PFNGLVERTEX3DPROC) load(userptr, "glVertex3d"); - glad_glVertex3dv = (PFNGLVERTEX3DVPROC) load(userptr, "glVertex3dv"); - glad_glVertex3f = (PFNGLVERTEX3FPROC) load(userptr, "glVertex3f"); - glad_glVertex3fv = (PFNGLVERTEX3FVPROC) load(userptr, "glVertex3fv"); - glad_glVertex3i = (PFNGLVERTEX3IPROC) load(userptr, "glVertex3i"); - glad_glVertex3iv = (PFNGLVERTEX3IVPROC) load(userptr, "glVertex3iv"); - glad_glVertex3s = (PFNGLVERTEX3SPROC) load(userptr, "glVertex3s"); - glad_glVertex3sv = (PFNGLVERTEX3SVPROC) load(userptr, "glVertex3sv"); - glad_glVertex4d = (PFNGLVERTEX4DPROC) load(userptr, "glVertex4d"); - glad_glVertex4dv = (PFNGLVERTEX4DVPROC) load(userptr, "glVertex4dv"); - glad_glVertex4f = (PFNGLVERTEX4FPROC) load(userptr, "glVertex4f"); - glad_glVertex4fv = (PFNGLVERTEX4FVPROC) load(userptr, "glVertex4fv"); - glad_glVertex4i = (PFNGLVERTEX4IPROC) load(userptr, "glVertex4i"); - glad_glVertex4iv = (PFNGLVERTEX4IVPROC) load(userptr, "glVertex4iv"); - glad_glVertex4s = (PFNGLVERTEX4SPROC) load(userptr, "glVertex4s"); - glad_glVertex4sv = (PFNGLVERTEX4SVPROC) load(userptr, "glVertex4sv"); - glad_glViewport = (PFNGLVIEWPORTPROC) load(userptr, "glViewport"); -} -static void glad_gl_load_GL_VERSION_1_1( GLADuserptrloadfunc load, void* userptr) { - if(!GLAD_GL_VERSION_1_1) return; - glad_glAreTexturesResident = (PFNGLARETEXTURESRESIDENTPROC) load(userptr, "glAreTexturesResident"); - glad_glArrayElement = (PFNGLARRAYELEMENTPROC) load(userptr, "glArrayElement"); - glad_glBindTexture = (PFNGLBINDTEXTUREPROC) load(userptr, "glBindTexture"); - glad_glColorPointer = (PFNGLCOLORPOINTERPROC) load(userptr, "glColorPointer"); - glad_glCopyTexImage1D = (PFNGLCOPYTEXIMAGE1DPROC) load(userptr, "glCopyTexImage1D"); - glad_glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC) load(userptr, "glCopyTexImage2D"); - glad_glCopyTexSubImage1D = (PFNGLCOPYTEXSUBIMAGE1DPROC) load(userptr, "glCopyTexSubImage1D"); - glad_glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC) load(userptr, "glCopyTexSubImage2D"); - glad_glDeleteTextures = (PFNGLDELETETEXTURESPROC) load(userptr, "glDeleteTextures"); - glad_glDisableClientState = (PFNGLDISABLECLIENTSTATEPROC) load(userptr, "glDisableClientState"); - glad_glDrawArrays = (PFNGLDRAWARRAYSPROC) load(userptr, "glDrawArrays"); - glad_glDrawElements = (PFNGLDRAWELEMENTSPROC) load(userptr, "glDrawElements"); - glad_glEdgeFlagPointer = (PFNGLEDGEFLAGPOINTERPROC) load(userptr, "glEdgeFlagPointer"); - glad_glEnableClientState = (PFNGLENABLECLIENTSTATEPROC) load(userptr, "glEnableClientState"); - glad_glGenTextures = (PFNGLGENTEXTURESPROC) load(userptr, "glGenTextures"); - glad_glGetPointerv = (PFNGLGETPOINTERVPROC) load(userptr, "glGetPointerv"); - glad_glIndexPointer = (PFNGLINDEXPOINTERPROC) load(userptr, "glIndexPointer"); - glad_glIndexub = (PFNGLINDEXUBPROC) load(userptr, "glIndexub"); - glad_glIndexubv = (PFNGLINDEXUBVPROC) load(userptr, "glIndexubv"); - glad_glInterleavedArrays = (PFNGLINTERLEAVEDARRAYSPROC) load(userptr, "glInterleavedArrays"); - glad_glIsTexture = (PFNGLISTEXTUREPROC) load(userptr, "glIsTexture"); - glad_glNormalPointer = (PFNGLNORMALPOINTERPROC) load(userptr, "glNormalPointer"); - glad_glPolygonOffset = (PFNGLPOLYGONOFFSETPROC) load(userptr, "glPolygonOffset"); - glad_glPopClientAttrib = (PFNGLPOPCLIENTATTRIBPROC) load(userptr, "glPopClientAttrib"); - glad_glPrioritizeTextures = (PFNGLPRIORITIZETEXTURESPROC) load(userptr, "glPrioritizeTextures"); - glad_glPushClientAttrib = (PFNGLPUSHCLIENTATTRIBPROC) load(userptr, "glPushClientAttrib"); - glad_glTexCoordPointer = (PFNGLTEXCOORDPOINTERPROC) load(userptr, "glTexCoordPointer"); - glad_glTexSubImage1D = (PFNGLTEXSUBIMAGE1DPROC) load(userptr, "glTexSubImage1D"); - glad_glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC) load(userptr, "glTexSubImage2D"); - glad_glVertexPointer = (PFNGLVERTEXPOINTERPROC) load(userptr, "glVertexPointer"); -} -static void glad_gl_load_GL_VERSION_1_2( GLADuserptrloadfunc load, void* userptr) { - if(!GLAD_GL_VERSION_1_2) return; - glad_glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC) load(userptr, "glCopyTexSubImage3D"); - glad_glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC) load(userptr, "glDrawRangeElements"); - glad_glTexImage3D = (PFNGLTEXIMAGE3DPROC) load(userptr, "glTexImage3D"); - glad_glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC) load(userptr, "glTexSubImage3D"); -} -static void glad_gl_load_GL_VERSION_1_3( GLADuserptrloadfunc load, void* userptr) { - if(!GLAD_GL_VERSION_1_3) return; - glad_glActiveTexture = (PFNGLACTIVETEXTUREPROC) load(userptr, "glActiveTexture"); - glad_glClientActiveTexture = (PFNGLCLIENTACTIVETEXTUREPROC) load(userptr, "glClientActiveTexture"); - glad_glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC) load(userptr, "glCompressedTexImage1D"); - glad_glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC) load(userptr, "glCompressedTexImage2D"); - glad_glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC) load(userptr, "glCompressedTexImage3D"); - glad_glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) load(userptr, "glCompressedTexSubImage1D"); - glad_glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) load(userptr, "glCompressedTexSubImage2D"); - glad_glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) load(userptr, "glCompressedTexSubImage3D"); - glad_glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC) load(userptr, "glGetCompressedTexImage"); - glad_glLoadTransposeMatrixd = (PFNGLLOADTRANSPOSEMATRIXDPROC) load(userptr, "glLoadTransposeMatrixd"); - glad_glLoadTransposeMatrixf = (PFNGLLOADTRANSPOSEMATRIXFPROC) load(userptr, "glLoadTransposeMatrixf"); - glad_glMultTransposeMatrixd = (PFNGLMULTTRANSPOSEMATRIXDPROC) load(userptr, "glMultTransposeMatrixd"); - glad_glMultTransposeMatrixf = (PFNGLMULTTRANSPOSEMATRIXFPROC) load(userptr, "glMultTransposeMatrixf"); - glad_glMultiTexCoord1d = (PFNGLMULTITEXCOORD1DPROC) load(userptr, "glMultiTexCoord1d"); - glad_glMultiTexCoord1dv = (PFNGLMULTITEXCOORD1DVPROC) load(userptr, "glMultiTexCoord1dv"); - glad_glMultiTexCoord1f = (PFNGLMULTITEXCOORD1FPROC) load(userptr, "glMultiTexCoord1f"); - glad_glMultiTexCoord1fv = (PFNGLMULTITEXCOORD1FVPROC) load(userptr, "glMultiTexCoord1fv"); - glad_glMultiTexCoord1i = (PFNGLMULTITEXCOORD1IPROC) load(userptr, "glMultiTexCoord1i"); - glad_glMultiTexCoord1iv = (PFNGLMULTITEXCOORD1IVPROC) load(userptr, "glMultiTexCoord1iv"); - glad_glMultiTexCoord1s = (PFNGLMULTITEXCOORD1SPROC) load(userptr, "glMultiTexCoord1s"); - glad_glMultiTexCoord1sv = (PFNGLMULTITEXCOORD1SVPROC) load(userptr, "glMultiTexCoord1sv"); - glad_glMultiTexCoord2d = (PFNGLMULTITEXCOORD2DPROC) load(userptr, "glMultiTexCoord2d"); - glad_glMultiTexCoord2dv = (PFNGLMULTITEXCOORD2DVPROC) load(userptr, "glMultiTexCoord2dv"); - glad_glMultiTexCoord2f = (PFNGLMULTITEXCOORD2FPROC) load(userptr, "glMultiTexCoord2f"); - glad_glMultiTexCoord2fv = (PFNGLMULTITEXCOORD2FVPROC) load(userptr, "glMultiTexCoord2fv"); - glad_glMultiTexCoord2i = (PFNGLMULTITEXCOORD2IPROC) load(userptr, "glMultiTexCoord2i"); - glad_glMultiTexCoord2iv = (PFNGLMULTITEXCOORD2IVPROC) load(userptr, "glMultiTexCoord2iv"); - glad_glMultiTexCoord2s = (PFNGLMULTITEXCOORD2SPROC) load(userptr, "glMultiTexCoord2s"); - glad_glMultiTexCoord2sv = (PFNGLMULTITEXCOORD2SVPROC) load(userptr, "glMultiTexCoord2sv"); - glad_glMultiTexCoord3d = (PFNGLMULTITEXCOORD3DPROC) load(userptr, "glMultiTexCoord3d"); - glad_glMultiTexCoord3dv = (PFNGLMULTITEXCOORD3DVPROC) load(userptr, "glMultiTexCoord3dv"); - glad_glMultiTexCoord3f = (PFNGLMULTITEXCOORD3FPROC) load(userptr, "glMultiTexCoord3f"); - glad_glMultiTexCoord3fv = (PFNGLMULTITEXCOORD3FVPROC) load(userptr, "glMultiTexCoord3fv"); - glad_glMultiTexCoord3i = (PFNGLMULTITEXCOORD3IPROC) load(userptr, "glMultiTexCoord3i"); - glad_glMultiTexCoord3iv = (PFNGLMULTITEXCOORD3IVPROC) load(userptr, "glMultiTexCoord3iv"); - glad_glMultiTexCoord3s = (PFNGLMULTITEXCOORD3SPROC) load(userptr, "glMultiTexCoord3s"); - glad_glMultiTexCoord3sv = (PFNGLMULTITEXCOORD3SVPROC) load(userptr, "glMultiTexCoord3sv"); - glad_glMultiTexCoord4d = (PFNGLMULTITEXCOORD4DPROC) load(userptr, "glMultiTexCoord4d"); - glad_glMultiTexCoord4dv = (PFNGLMULTITEXCOORD4DVPROC) load(userptr, "glMultiTexCoord4dv"); - glad_glMultiTexCoord4f = (PFNGLMULTITEXCOORD4FPROC) load(userptr, "glMultiTexCoord4f"); - glad_glMultiTexCoord4fv = (PFNGLMULTITEXCOORD4FVPROC) load(userptr, "glMultiTexCoord4fv"); - glad_glMultiTexCoord4i = (PFNGLMULTITEXCOORD4IPROC) load(userptr, "glMultiTexCoord4i"); - glad_glMultiTexCoord4iv = (PFNGLMULTITEXCOORD4IVPROC) load(userptr, "glMultiTexCoord4iv"); - glad_glMultiTexCoord4s = (PFNGLMULTITEXCOORD4SPROC) load(userptr, "glMultiTexCoord4s"); - glad_glMultiTexCoord4sv = (PFNGLMULTITEXCOORD4SVPROC) load(userptr, "glMultiTexCoord4sv"); - glad_glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC) load(userptr, "glSampleCoverage"); -} -static void glad_gl_load_GL_VERSION_1_4( GLADuserptrloadfunc load, void* userptr) { - if(!GLAD_GL_VERSION_1_4) return; - glad_glBlendColor = (PFNGLBLENDCOLORPROC) load(userptr, "glBlendColor"); - glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC) load(userptr, "glBlendEquation"); - glad_glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC) load(userptr, "glBlendFuncSeparate"); - glad_glFogCoordPointer = (PFNGLFOGCOORDPOINTERPROC) load(userptr, "glFogCoordPointer"); - glad_glFogCoordd = (PFNGLFOGCOORDDPROC) load(userptr, "glFogCoordd"); - glad_glFogCoorddv = (PFNGLFOGCOORDDVPROC) load(userptr, "glFogCoorddv"); - glad_glFogCoordf = (PFNGLFOGCOORDFPROC) load(userptr, "glFogCoordf"); - glad_glFogCoordfv = (PFNGLFOGCOORDFVPROC) load(userptr, "glFogCoordfv"); - glad_glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC) load(userptr, "glMultiDrawArrays"); - glad_glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC) load(userptr, "glMultiDrawElements"); - glad_glPointParameterf = (PFNGLPOINTPARAMETERFPROC) load(userptr, "glPointParameterf"); - glad_glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC) load(userptr, "glPointParameterfv"); - glad_glPointParameteri = (PFNGLPOINTPARAMETERIPROC) load(userptr, "glPointParameteri"); - glad_glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC) load(userptr, "glPointParameteriv"); - glad_glSecondaryColor3b = (PFNGLSECONDARYCOLOR3BPROC) load(userptr, "glSecondaryColor3b"); - glad_glSecondaryColor3bv = (PFNGLSECONDARYCOLOR3BVPROC) load(userptr, "glSecondaryColor3bv"); - glad_glSecondaryColor3d = (PFNGLSECONDARYCOLOR3DPROC) load(userptr, "glSecondaryColor3d"); - glad_glSecondaryColor3dv = (PFNGLSECONDARYCOLOR3DVPROC) load(userptr, "glSecondaryColor3dv"); - glad_glSecondaryColor3f = (PFNGLSECONDARYCOLOR3FPROC) load(userptr, "glSecondaryColor3f"); - glad_glSecondaryColor3fv = (PFNGLSECONDARYCOLOR3FVPROC) load(userptr, "glSecondaryColor3fv"); - glad_glSecondaryColor3i = (PFNGLSECONDARYCOLOR3IPROC) load(userptr, "glSecondaryColor3i"); - glad_glSecondaryColor3iv = (PFNGLSECONDARYCOLOR3IVPROC) load(userptr, "glSecondaryColor3iv"); - glad_glSecondaryColor3s = (PFNGLSECONDARYCOLOR3SPROC) load(userptr, "glSecondaryColor3s"); - glad_glSecondaryColor3sv = (PFNGLSECONDARYCOLOR3SVPROC) load(userptr, "glSecondaryColor3sv"); - glad_glSecondaryColor3ub = (PFNGLSECONDARYCOLOR3UBPROC) load(userptr, "glSecondaryColor3ub"); - glad_glSecondaryColor3ubv = (PFNGLSECONDARYCOLOR3UBVPROC) load(userptr, "glSecondaryColor3ubv"); - glad_glSecondaryColor3ui = (PFNGLSECONDARYCOLOR3UIPROC) load(userptr, "glSecondaryColor3ui"); - glad_glSecondaryColor3uiv = (PFNGLSECONDARYCOLOR3UIVPROC) load(userptr, "glSecondaryColor3uiv"); - glad_glSecondaryColor3us = (PFNGLSECONDARYCOLOR3USPROC) load(userptr, "glSecondaryColor3us"); - glad_glSecondaryColor3usv = (PFNGLSECONDARYCOLOR3USVPROC) load(userptr, "glSecondaryColor3usv"); - glad_glSecondaryColorPointer = (PFNGLSECONDARYCOLORPOINTERPROC) load(userptr, "glSecondaryColorPointer"); - glad_glWindowPos2d = (PFNGLWINDOWPOS2DPROC) load(userptr, "glWindowPos2d"); - glad_glWindowPos2dv = (PFNGLWINDOWPOS2DVPROC) load(userptr, "glWindowPos2dv"); - glad_glWindowPos2f = (PFNGLWINDOWPOS2FPROC) load(userptr, "glWindowPos2f"); - glad_glWindowPos2fv = (PFNGLWINDOWPOS2FVPROC) load(userptr, "glWindowPos2fv"); - glad_glWindowPos2i = (PFNGLWINDOWPOS2IPROC) load(userptr, "glWindowPos2i"); - glad_glWindowPos2iv = (PFNGLWINDOWPOS2IVPROC) load(userptr, "glWindowPos2iv"); - glad_glWindowPos2s = (PFNGLWINDOWPOS2SPROC) load(userptr, "glWindowPos2s"); - glad_glWindowPos2sv = (PFNGLWINDOWPOS2SVPROC) load(userptr, "glWindowPos2sv"); - glad_glWindowPos3d = (PFNGLWINDOWPOS3DPROC) load(userptr, "glWindowPos3d"); - glad_glWindowPos3dv = (PFNGLWINDOWPOS3DVPROC) load(userptr, "glWindowPos3dv"); - glad_glWindowPos3f = (PFNGLWINDOWPOS3FPROC) load(userptr, "glWindowPos3f"); - glad_glWindowPos3fv = (PFNGLWINDOWPOS3FVPROC) load(userptr, "glWindowPos3fv"); - glad_glWindowPos3i = (PFNGLWINDOWPOS3IPROC) load(userptr, "glWindowPos3i"); - glad_glWindowPos3iv = (PFNGLWINDOWPOS3IVPROC) load(userptr, "glWindowPos3iv"); - glad_glWindowPos3s = (PFNGLWINDOWPOS3SPROC) load(userptr, "glWindowPos3s"); - glad_glWindowPos3sv = (PFNGLWINDOWPOS3SVPROC) load(userptr, "glWindowPos3sv"); -} -static void glad_gl_load_GL_VERSION_1_5( GLADuserptrloadfunc load, void* userptr) { - if(!GLAD_GL_VERSION_1_5) return; - glad_glBeginQuery = (PFNGLBEGINQUERYPROC) load(userptr, "glBeginQuery"); - glad_glBindBuffer = (PFNGLBINDBUFFERPROC) load(userptr, "glBindBuffer"); - glad_glBufferData = (PFNGLBUFFERDATAPROC) load(userptr, "glBufferData"); - glad_glBufferSubData = (PFNGLBUFFERSUBDATAPROC) load(userptr, "glBufferSubData"); - glad_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC) load(userptr, "glDeleteBuffers"); - glad_glDeleteQueries = (PFNGLDELETEQUERIESPROC) load(userptr, "glDeleteQueries"); - glad_glEndQuery = (PFNGLENDQUERYPROC) load(userptr, "glEndQuery"); - glad_glGenBuffers = (PFNGLGENBUFFERSPROC) load(userptr, "glGenBuffers"); - glad_glGenQueries = (PFNGLGENQUERIESPROC) load(userptr, "glGenQueries"); - glad_glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC) load(userptr, "glGetBufferParameteriv"); - glad_glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC) load(userptr, "glGetBufferPointerv"); - glad_glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC) load(userptr, "glGetBufferSubData"); - glad_glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC) load(userptr, "glGetQueryObjectiv"); - glad_glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC) load(userptr, "glGetQueryObjectuiv"); - glad_glGetQueryiv = (PFNGLGETQUERYIVPROC) load(userptr, "glGetQueryiv"); - glad_glIsBuffer = (PFNGLISBUFFERPROC) load(userptr, "glIsBuffer"); - glad_glIsQuery = (PFNGLISQUERYPROC) load(userptr, "glIsQuery"); - glad_glMapBuffer = (PFNGLMAPBUFFERPROC) load(userptr, "glMapBuffer"); - glad_glUnmapBuffer = (PFNGLUNMAPBUFFERPROC) load(userptr, "glUnmapBuffer"); -} -static void glad_gl_load_GL_VERSION_2_0( GLADuserptrloadfunc load, void* userptr) { - if(!GLAD_GL_VERSION_2_0) return; - glad_glAttachShader = (PFNGLATTACHSHADERPROC) load(userptr, "glAttachShader"); - glad_glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC) load(userptr, "glBindAttribLocation"); - glad_glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC) load(userptr, "glBlendEquationSeparate"); - glad_glCompileShader = (PFNGLCOMPILESHADERPROC) load(userptr, "glCompileShader"); - glad_glCreateProgram = (PFNGLCREATEPROGRAMPROC) load(userptr, "glCreateProgram"); - glad_glCreateShader = (PFNGLCREATESHADERPROC) load(userptr, "glCreateShader"); - glad_glDeleteProgram = (PFNGLDELETEPROGRAMPROC) load(userptr, "glDeleteProgram"); - glad_glDeleteShader = (PFNGLDELETESHADERPROC) load(userptr, "glDeleteShader"); - glad_glDetachShader = (PFNGLDETACHSHADERPROC) load(userptr, "glDetachShader"); - glad_glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC) load(userptr, "glDisableVertexAttribArray"); - glad_glDrawBuffers = (PFNGLDRAWBUFFERSPROC) load(userptr, "glDrawBuffers"); - glad_glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC) load(userptr, "glEnableVertexAttribArray"); - glad_glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC) load(userptr, "glGetActiveAttrib"); - glad_glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC) load(userptr, "glGetActiveUniform"); - glad_glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC) load(userptr, "glGetAttachedShaders"); - glad_glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC) load(userptr, "glGetAttribLocation"); - glad_glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC) load(userptr, "glGetProgramInfoLog"); - glad_glGetProgramiv = (PFNGLGETPROGRAMIVPROC) load(userptr, "glGetProgramiv"); - glad_glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC) load(userptr, "glGetShaderInfoLog"); - glad_glGetShaderSource = (PFNGLGETSHADERSOURCEPROC) load(userptr, "glGetShaderSource"); - glad_glGetShaderiv = (PFNGLGETSHADERIVPROC) load(userptr, "glGetShaderiv"); - glad_glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC) load(userptr, "glGetUniformLocation"); - glad_glGetUniformfv = (PFNGLGETUNIFORMFVPROC) load(userptr, "glGetUniformfv"); - glad_glGetUniformiv = (PFNGLGETUNIFORMIVPROC) load(userptr, "glGetUniformiv"); - glad_glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC) load(userptr, "glGetVertexAttribPointerv"); - glad_glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC) load(userptr, "glGetVertexAttribdv"); - glad_glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC) load(userptr, "glGetVertexAttribfv"); - glad_glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC) load(userptr, "glGetVertexAttribiv"); - glad_glIsProgram = (PFNGLISPROGRAMPROC) load(userptr, "glIsProgram"); - glad_glIsShader = (PFNGLISSHADERPROC) load(userptr, "glIsShader"); - glad_glLinkProgram = (PFNGLLINKPROGRAMPROC) load(userptr, "glLinkProgram"); - glad_glShaderSource = (PFNGLSHADERSOURCEPROC) load(userptr, "glShaderSource"); - glad_glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC) load(userptr, "glStencilFuncSeparate"); - glad_glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC) load(userptr, "glStencilMaskSeparate"); - glad_glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC) load(userptr, "glStencilOpSeparate"); - glad_glUniform1f = (PFNGLUNIFORM1FPROC) load(userptr, "glUniform1f"); - glad_glUniform1fv = (PFNGLUNIFORM1FVPROC) load(userptr, "glUniform1fv"); - glad_glUniform1i = (PFNGLUNIFORM1IPROC) load(userptr, "glUniform1i"); - glad_glUniform1iv = (PFNGLUNIFORM1IVPROC) load(userptr, "glUniform1iv"); - glad_glUniform2f = (PFNGLUNIFORM2FPROC) load(userptr, "glUniform2f"); - glad_glUniform2fv = (PFNGLUNIFORM2FVPROC) load(userptr, "glUniform2fv"); - glad_glUniform2i = (PFNGLUNIFORM2IPROC) load(userptr, "glUniform2i"); - glad_glUniform2iv = (PFNGLUNIFORM2IVPROC) load(userptr, "glUniform2iv"); - glad_glUniform3f = (PFNGLUNIFORM3FPROC) load(userptr, "glUniform3f"); - glad_glUniform3fv = (PFNGLUNIFORM3FVPROC) load(userptr, "glUniform3fv"); - glad_glUniform3i = (PFNGLUNIFORM3IPROC) load(userptr, "glUniform3i"); - glad_glUniform3iv = (PFNGLUNIFORM3IVPROC) load(userptr, "glUniform3iv"); - glad_glUniform4f = (PFNGLUNIFORM4FPROC) load(userptr, "glUniform4f"); - glad_glUniform4fv = (PFNGLUNIFORM4FVPROC) load(userptr, "glUniform4fv"); - glad_glUniform4i = (PFNGLUNIFORM4IPROC) load(userptr, "glUniform4i"); - glad_glUniform4iv = (PFNGLUNIFORM4IVPROC) load(userptr, "glUniform4iv"); - glad_glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC) load(userptr, "glUniformMatrix2fv"); - glad_glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC) load(userptr, "glUniformMatrix3fv"); - glad_glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC) load(userptr, "glUniformMatrix4fv"); - glad_glUseProgram = (PFNGLUSEPROGRAMPROC) load(userptr, "glUseProgram"); - glad_glValidateProgram = (PFNGLVALIDATEPROGRAMPROC) load(userptr, "glValidateProgram"); - glad_glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC) load(userptr, "glVertexAttrib1d"); - glad_glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC) load(userptr, "glVertexAttrib1dv"); - glad_glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC) load(userptr, "glVertexAttrib1f"); - glad_glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC) load(userptr, "glVertexAttrib1fv"); - glad_glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC) load(userptr, "glVertexAttrib1s"); - glad_glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC) load(userptr, "glVertexAttrib1sv"); - glad_glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC) load(userptr, "glVertexAttrib2d"); - glad_glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC) load(userptr, "glVertexAttrib2dv"); - glad_glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC) load(userptr, "glVertexAttrib2f"); - glad_glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC) load(userptr, "glVertexAttrib2fv"); - glad_glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC) load(userptr, "glVertexAttrib2s"); - glad_glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC) load(userptr, "glVertexAttrib2sv"); - glad_glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC) load(userptr, "glVertexAttrib3d"); - glad_glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC) load(userptr, "glVertexAttrib3dv"); - glad_glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC) load(userptr, "glVertexAttrib3f"); - glad_glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC) load(userptr, "glVertexAttrib3fv"); - glad_glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC) load(userptr, "glVertexAttrib3s"); - glad_glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC) load(userptr, "glVertexAttrib3sv"); - glad_glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC) load(userptr, "glVertexAttrib4Nbv"); - glad_glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC) load(userptr, "glVertexAttrib4Niv"); - glad_glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC) load(userptr, "glVertexAttrib4Nsv"); - glad_glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC) load(userptr, "glVertexAttrib4Nub"); - glad_glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC) load(userptr, "glVertexAttrib4Nubv"); - glad_glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC) load(userptr, "glVertexAttrib4Nuiv"); - glad_glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC) load(userptr, "glVertexAttrib4Nusv"); - glad_glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC) load(userptr, "glVertexAttrib4bv"); - glad_glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC) load(userptr, "glVertexAttrib4d"); - glad_glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC) load(userptr, "glVertexAttrib4dv"); - glad_glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC) load(userptr, "glVertexAttrib4f"); - glad_glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC) load(userptr, "glVertexAttrib4fv"); - glad_glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC) load(userptr, "glVertexAttrib4iv"); - glad_glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC) load(userptr, "glVertexAttrib4s"); - glad_glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC) load(userptr, "glVertexAttrib4sv"); - glad_glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC) load(userptr, "glVertexAttrib4ubv"); - glad_glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC) load(userptr, "glVertexAttrib4uiv"); - glad_glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC) load(userptr, "glVertexAttrib4usv"); - glad_glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC) load(userptr, "glVertexAttribPointer"); -} -static void glad_gl_load_GL_VERSION_2_1( GLADuserptrloadfunc load, void* userptr) { - if(!GLAD_GL_VERSION_2_1) return; - glad_glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC) load(userptr, "glUniformMatrix2x3fv"); - glad_glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC) load(userptr, "glUniformMatrix2x4fv"); - glad_glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC) load(userptr, "glUniformMatrix3x2fv"); - glad_glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC) load(userptr, "glUniformMatrix3x4fv"); - glad_glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC) load(userptr, "glUniformMatrix4x2fv"); - glad_glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC) load(userptr, "glUniformMatrix4x3fv"); -} -static void glad_gl_load_GL_VERSION_3_0( GLADuserptrloadfunc load, void* userptr) { - if(!GLAD_GL_VERSION_3_0) return; - glad_glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC) load(userptr, "glBeginConditionalRender"); - glad_glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC) load(userptr, "glBeginTransformFeedback"); - glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC) load(userptr, "glBindBufferBase"); - glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC) load(userptr, "glBindBufferRange"); - glad_glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC) load(userptr, "glBindFragDataLocation"); - glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC) load(userptr, "glBindFramebuffer"); - glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC) load(userptr, "glBindRenderbuffer"); - glad_glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC) load(userptr, "glBindVertexArray"); - glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC) load(userptr, "glBlitFramebuffer"); - glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC) load(userptr, "glCheckFramebufferStatus"); - glad_glClampColor = (PFNGLCLAMPCOLORPROC) load(userptr, "glClampColor"); - glad_glClearBufferfi = (PFNGLCLEARBUFFERFIPROC) load(userptr, "glClearBufferfi"); - glad_glClearBufferfv = (PFNGLCLEARBUFFERFVPROC) load(userptr, "glClearBufferfv"); - glad_glClearBufferiv = (PFNGLCLEARBUFFERIVPROC) load(userptr, "glClearBufferiv"); - glad_glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC) load(userptr, "glClearBufferuiv"); - glad_glColorMaski = (PFNGLCOLORMASKIPROC) load(userptr, "glColorMaski"); - glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC) load(userptr, "glDeleteFramebuffers"); - glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC) load(userptr, "glDeleteRenderbuffers"); - glad_glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC) load(userptr, "glDeleteVertexArrays"); - glad_glDisablei = (PFNGLDISABLEIPROC) load(userptr, "glDisablei"); - glad_glEnablei = (PFNGLENABLEIPROC) load(userptr, "glEnablei"); - glad_glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC) load(userptr, "glEndConditionalRender"); - glad_glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC) load(userptr, "glEndTransformFeedback"); - glad_glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC) load(userptr, "glFlushMappedBufferRange"); - glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC) load(userptr, "glFramebufferRenderbuffer"); - glad_glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC) load(userptr, "glFramebufferTexture1D"); - glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC) load(userptr, "glFramebufferTexture2D"); - glad_glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC) load(userptr, "glFramebufferTexture3D"); - glad_glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC) load(userptr, "glFramebufferTextureLayer"); - glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC) load(userptr, "glGenFramebuffers"); - glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC) load(userptr, "glGenRenderbuffers"); - glad_glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC) load(userptr, "glGenVertexArrays"); - glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC) load(userptr, "glGenerateMipmap"); - glad_glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC) load(userptr, "glGetBooleani_v"); - glad_glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC) load(userptr, "glGetFragDataLocation"); - glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) load(userptr, "glGetFramebufferAttachmentParameteriv"); - glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC) load(userptr, "glGetIntegeri_v"); - glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC) load(userptr, "glGetRenderbufferParameteriv"); - glad_glGetStringi = (PFNGLGETSTRINGIPROC) load(userptr, "glGetStringi"); - glad_glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC) load(userptr, "glGetTexParameterIiv"); - glad_glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC) load(userptr, "glGetTexParameterIuiv"); - glad_glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) load(userptr, "glGetTransformFeedbackVarying"); - glad_glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC) load(userptr, "glGetUniformuiv"); - glad_glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC) load(userptr, "glGetVertexAttribIiv"); - glad_glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC) load(userptr, "glGetVertexAttribIuiv"); - glad_glIsEnabledi = (PFNGLISENABLEDIPROC) load(userptr, "glIsEnabledi"); - glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC) load(userptr, "glIsFramebuffer"); - glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC) load(userptr, "glIsRenderbuffer"); - glad_glIsVertexArray = (PFNGLISVERTEXARRAYPROC) load(userptr, "glIsVertexArray"); - glad_glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC) load(userptr, "glMapBufferRange"); - glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC) load(userptr, "glRenderbufferStorage"); - glad_glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) load(userptr, "glRenderbufferStorageMultisample"); - glad_glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC) load(userptr, "glTexParameterIiv"); - glad_glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC) load(userptr, "glTexParameterIuiv"); - glad_glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC) load(userptr, "glTransformFeedbackVaryings"); - glad_glUniform1ui = (PFNGLUNIFORM1UIPROC) load(userptr, "glUniform1ui"); - glad_glUniform1uiv = (PFNGLUNIFORM1UIVPROC) load(userptr, "glUniform1uiv"); - glad_glUniform2ui = (PFNGLUNIFORM2UIPROC) load(userptr, "glUniform2ui"); - glad_glUniform2uiv = (PFNGLUNIFORM2UIVPROC) load(userptr, "glUniform2uiv"); - glad_glUniform3ui = (PFNGLUNIFORM3UIPROC) load(userptr, "glUniform3ui"); - glad_glUniform3uiv = (PFNGLUNIFORM3UIVPROC) load(userptr, "glUniform3uiv"); - glad_glUniform4ui = (PFNGLUNIFORM4UIPROC) load(userptr, "glUniform4ui"); - glad_glUniform4uiv = (PFNGLUNIFORM4UIVPROC) load(userptr, "glUniform4uiv"); - glad_glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC) load(userptr, "glVertexAttribI1i"); - glad_glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC) load(userptr, "glVertexAttribI1iv"); - glad_glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC) load(userptr, "glVertexAttribI1ui"); - glad_glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC) load(userptr, "glVertexAttribI1uiv"); - glad_glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC) load(userptr, "glVertexAttribI2i"); - glad_glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC) load(userptr, "glVertexAttribI2iv"); - glad_glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC) load(userptr, "glVertexAttribI2ui"); - glad_glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC) load(userptr, "glVertexAttribI2uiv"); - glad_glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC) load(userptr, "glVertexAttribI3i"); - glad_glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC) load(userptr, "glVertexAttribI3iv"); - glad_glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC) load(userptr, "glVertexAttribI3ui"); - glad_glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC) load(userptr, "glVertexAttribI3uiv"); - glad_glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC) load(userptr, "glVertexAttribI4bv"); - glad_glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC) load(userptr, "glVertexAttribI4i"); - glad_glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC) load(userptr, "glVertexAttribI4iv"); - glad_glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC) load(userptr, "glVertexAttribI4sv"); - glad_glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC) load(userptr, "glVertexAttribI4ubv"); - glad_glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC) load(userptr, "glVertexAttribI4ui"); - glad_glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC) load(userptr, "glVertexAttribI4uiv"); - glad_glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC) load(userptr, "glVertexAttribI4usv"); - glad_glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC) load(userptr, "glVertexAttribIPointer"); -} -static void glad_gl_load_GL_VERSION_3_1( GLADuserptrloadfunc load, void* userptr) { - if(!GLAD_GL_VERSION_3_1) return; - glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC) load(userptr, "glBindBufferBase"); - glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC) load(userptr, "glBindBufferRange"); - glad_glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC) load(userptr, "glCopyBufferSubData"); - glad_glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC) load(userptr, "glDrawArraysInstanced"); - glad_glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC) load(userptr, "glDrawElementsInstanced"); - glad_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) load(userptr, "glGetActiveUniformBlockName"); - glad_glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC) load(userptr, "glGetActiveUniformBlockiv"); - glad_glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC) load(userptr, "glGetActiveUniformName"); - glad_glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC) load(userptr, "glGetActiveUniformsiv"); - glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC) load(userptr, "glGetIntegeri_v"); - glad_glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC) load(userptr, "glGetUniformBlockIndex"); - glad_glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC) load(userptr, "glGetUniformIndices"); - glad_glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC) load(userptr, "glPrimitiveRestartIndex"); - glad_glTexBuffer = (PFNGLTEXBUFFERPROC) load(userptr, "glTexBuffer"); - glad_glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC) load(userptr, "glUniformBlockBinding"); -} -static void glad_gl_load_GL_VERSION_3_2( GLADuserptrloadfunc load, void* userptr) { - if(!GLAD_GL_VERSION_3_2) return; - glad_glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC) load(userptr, "glClientWaitSync"); - glad_glDeleteSync = (PFNGLDELETESYNCPROC) load(userptr, "glDeleteSync"); - glad_glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC) load(userptr, "glDrawElementsBaseVertex"); - glad_glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) load(userptr, "glDrawElementsInstancedBaseVertex"); - glad_glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) load(userptr, "glDrawRangeElementsBaseVertex"); - glad_glFenceSync = (PFNGLFENCESYNCPROC) load(userptr, "glFenceSync"); - glad_glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC) load(userptr, "glFramebufferTexture"); - glad_glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC) load(userptr, "glGetBufferParameteri64v"); - glad_glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC) load(userptr, "glGetInteger64i_v"); - glad_glGetInteger64v = (PFNGLGETINTEGER64VPROC) load(userptr, "glGetInteger64v"); - glad_glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC) load(userptr, "glGetMultisamplefv"); - glad_glGetSynciv = (PFNGLGETSYNCIVPROC) load(userptr, "glGetSynciv"); - glad_glIsSync = (PFNGLISSYNCPROC) load(userptr, "glIsSync"); - glad_glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) load(userptr, "glMultiDrawElementsBaseVertex"); - glad_glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC) load(userptr, "glProvokingVertex"); - glad_glSampleMaski = (PFNGLSAMPLEMASKIPROC) load(userptr, "glSampleMaski"); - glad_glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC) load(userptr, "glTexImage2DMultisample"); - glad_glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC) load(userptr, "glTexImage3DMultisample"); - glad_glWaitSync = (PFNGLWAITSYNCPROC) load(userptr, "glWaitSync"); -} -static void glad_gl_load_GL_VERSION_3_3( GLADuserptrloadfunc load, void* userptr) { - if(!GLAD_GL_VERSION_3_3) return; - glad_glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) load(userptr, "glBindFragDataLocationIndexed"); - glad_glBindSampler = (PFNGLBINDSAMPLERPROC) load(userptr, "glBindSampler"); - glad_glColorP3ui = (PFNGLCOLORP3UIPROC) load(userptr, "glColorP3ui"); - glad_glColorP3uiv = (PFNGLCOLORP3UIVPROC) load(userptr, "glColorP3uiv"); - glad_glColorP4ui = (PFNGLCOLORP4UIPROC) load(userptr, "glColorP4ui"); - glad_glColorP4uiv = (PFNGLCOLORP4UIVPROC) load(userptr, "glColorP4uiv"); - glad_glDeleteSamplers = (PFNGLDELETESAMPLERSPROC) load(userptr, "glDeleteSamplers"); - glad_glGenSamplers = (PFNGLGENSAMPLERSPROC) load(userptr, "glGenSamplers"); - glad_glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC) load(userptr, "glGetFragDataIndex"); - glad_glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC) load(userptr, "glGetQueryObjecti64v"); - glad_glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC) load(userptr, "glGetQueryObjectui64v"); - glad_glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC) load(userptr, "glGetSamplerParameterIiv"); - glad_glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC) load(userptr, "glGetSamplerParameterIuiv"); - glad_glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC) load(userptr, "glGetSamplerParameterfv"); - glad_glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC) load(userptr, "glGetSamplerParameteriv"); - glad_glIsSampler = (PFNGLISSAMPLERPROC) load(userptr, "glIsSampler"); - glad_glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC) load(userptr, "glMultiTexCoordP1ui"); - glad_glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC) load(userptr, "glMultiTexCoordP1uiv"); - glad_glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC) load(userptr, "glMultiTexCoordP2ui"); - glad_glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC) load(userptr, "glMultiTexCoordP2uiv"); - glad_glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC) load(userptr, "glMultiTexCoordP3ui"); - glad_glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC) load(userptr, "glMultiTexCoordP3uiv"); - glad_glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC) load(userptr, "glMultiTexCoordP4ui"); - glad_glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC) load(userptr, "glMultiTexCoordP4uiv"); - glad_glNormalP3ui = (PFNGLNORMALP3UIPROC) load(userptr, "glNormalP3ui"); - glad_glNormalP3uiv = (PFNGLNORMALP3UIVPROC) load(userptr, "glNormalP3uiv"); - glad_glQueryCounter = (PFNGLQUERYCOUNTERPROC) load(userptr, "glQueryCounter"); - glad_glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC) load(userptr, "glSamplerParameterIiv"); - glad_glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC) load(userptr, "glSamplerParameterIuiv"); - glad_glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC) load(userptr, "glSamplerParameterf"); - glad_glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC) load(userptr, "glSamplerParameterfv"); - glad_glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC) load(userptr, "glSamplerParameteri"); - glad_glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC) load(userptr, "glSamplerParameteriv"); - glad_glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC) load(userptr, "glSecondaryColorP3ui"); - glad_glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC) load(userptr, "glSecondaryColorP3uiv"); - glad_glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC) load(userptr, "glTexCoordP1ui"); - glad_glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC) load(userptr, "glTexCoordP1uiv"); - glad_glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC) load(userptr, "glTexCoordP2ui"); - glad_glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC) load(userptr, "glTexCoordP2uiv"); - glad_glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC) load(userptr, "glTexCoordP3ui"); - glad_glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC) load(userptr, "glTexCoordP3uiv"); - glad_glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC) load(userptr, "glTexCoordP4ui"); - glad_glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC) load(userptr, "glTexCoordP4uiv"); - glad_glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC) load(userptr, "glVertexAttribDivisor"); - glad_glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC) load(userptr, "glVertexAttribP1ui"); - glad_glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC) load(userptr, "glVertexAttribP1uiv"); - glad_glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC) load(userptr, "glVertexAttribP2ui"); - glad_glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC) load(userptr, "glVertexAttribP2uiv"); - glad_glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC) load(userptr, "glVertexAttribP3ui"); - glad_glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC) load(userptr, "glVertexAttribP3uiv"); - glad_glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC) load(userptr, "glVertexAttribP4ui"); - glad_glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC) load(userptr, "glVertexAttribP4uiv"); - glad_glVertexP2ui = (PFNGLVERTEXP2UIPROC) load(userptr, "glVertexP2ui"); - glad_glVertexP2uiv = (PFNGLVERTEXP2UIVPROC) load(userptr, "glVertexP2uiv"); - glad_glVertexP3ui = (PFNGLVERTEXP3UIPROC) load(userptr, "glVertexP3ui"); - glad_glVertexP3uiv = (PFNGLVERTEXP3UIVPROC) load(userptr, "glVertexP3uiv"); - glad_glVertexP4ui = (PFNGLVERTEXP4UIPROC) load(userptr, "glVertexP4ui"); - glad_glVertexP4uiv = (PFNGLVERTEXP4UIVPROC) load(userptr, "glVertexP4uiv"); -} -static void glad_gl_load_GL_ARB_multisample( GLADuserptrloadfunc load, void* userptr) { - if(!GLAD_GL_ARB_multisample) return; - glad_glSampleCoverageARB = (PFNGLSAMPLECOVERAGEARBPROC) load(userptr, "glSampleCoverageARB"); -} -static void glad_gl_load_GL_ARB_robustness( GLADuserptrloadfunc load, void* userptr) { - if(!GLAD_GL_ARB_robustness) return; - glad_glGetGraphicsResetStatusARB = (PFNGLGETGRAPHICSRESETSTATUSARBPROC) load(userptr, "glGetGraphicsResetStatusARB"); - glad_glGetnColorTableARB = (PFNGLGETNCOLORTABLEARBPROC) load(userptr, "glGetnColorTableARB"); - glad_glGetnCompressedTexImageARB = (PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) load(userptr, "glGetnCompressedTexImageARB"); - glad_glGetnConvolutionFilterARB = (PFNGLGETNCONVOLUTIONFILTERARBPROC) load(userptr, "glGetnConvolutionFilterARB"); - glad_glGetnHistogramARB = (PFNGLGETNHISTOGRAMARBPROC) load(userptr, "glGetnHistogramARB"); - glad_glGetnMapdvARB = (PFNGLGETNMAPDVARBPROC) load(userptr, "glGetnMapdvARB"); - glad_glGetnMapfvARB = (PFNGLGETNMAPFVARBPROC) load(userptr, "glGetnMapfvARB"); - glad_glGetnMapivARB = (PFNGLGETNMAPIVARBPROC) load(userptr, "glGetnMapivARB"); - glad_glGetnMinmaxARB = (PFNGLGETNMINMAXARBPROC) load(userptr, "glGetnMinmaxARB"); - glad_glGetnPixelMapfvARB = (PFNGLGETNPIXELMAPFVARBPROC) load(userptr, "glGetnPixelMapfvARB"); - glad_glGetnPixelMapuivARB = (PFNGLGETNPIXELMAPUIVARBPROC) load(userptr, "glGetnPixelMapuivARB"); - glad_glGetnPixelMapusvARB = (PFNGLGETNPIXELMAPUSVARBPROC) load(userptr, "glGetnPixelMapusvARB"); - glad_glGetnPolygonStippleARB = (PFNGLGETNPOLYGONSTIPPLEARBPROC) load(userptr, "glGetnPolygonStippleARB"); - glad_glGetnSeparableFilterARB = (PFNGLGETNSEPARABLEFILTERARBPROC) load(userptr, "glGetnSeparableFilterARB"); - glad_glGetnTexImageARB = (PFNGLGETNTEXIMAGEARBPROC) load(userptr, "glGetnTexImageARB"); - glad_glGetnUniformdvARB = (PFNGLGETNUNIFORMDVARBPROC) load(userptr, "glGetnUniformdvARB"); - glad_glGetnUniformfvARB = (PFNGLGETNUNIFORMFVARBPROC) load(userptr, "glGetnUniformfvARB"); - glad_glGetnUniformivARB = (PFNGLGETNUNIFORMIVARBPROC) load(userptr, "glGetnUniformivARB"); - glad_glGetnUniformuivARB = (PFNGLGETNUNIFORMUIVARBPROC) load(userptr, "glGetnUniformuivARB"); - glad_glReadnPixelsARB = (PFNGLREADNPIXELSARBPROC) load(userptr, "glReadnPixelsARB"); -} -static void glad_gl_load_GL_KHR_debug( GLADuserptrloadfunc load, void* userptr) { - if(!GLAD_GL_KHR_debug) return; - glad_glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC) load(userptr, "glDebugMessageCallback"); - glad_glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC) load(userptr, "glDebugMessageControl"); - glad_glDebugMessageInsert = (PFNGLDEBUGMESSAGEINSERTPROC) load(userptr, "glDebugMessageInsert"); - glad_glGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGPROC) load(userptr, "glGetDebugMessageLog"); - glad_glGetObjectLabel = (PFNGLGETOBJECTLABELPROC) load(userptr, "glGetObjectLabel"); - glad_glGetObjectPtrLabel = (PFNGLGETOBJECTPTRLABELPROC) load(userptr, "glGetObjectPtrLabel"); - glad_glGetPointerv = (PFNGLGETPOINTERVPROC) load(userptr, "glGetPointerv"); - glad_glObjectLabel = (PFNGLOBJECTLABELPROC) load(userptr, "glObjectLabel"); - glad_glObjectPtrLabel = (PFNGLOBJECTPTRLABELPROC) load(userptr, "glObjectPtrLabel"); - glad_glPopDebugGroup = (PFNGLPOPDEBUGGROUPPROC) load(userptr, "glPopDebugGroup"); - glad_glPushDebugGroup = (PFNGLPUSHDEBUGGROUPPROC) load(userptr, "glPushDebugGroup"); -} - - - -#if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0) -#define GLAD_GL_IS_SOME_NEW_VERSION 1 -#else -#define GLAD_GL_IS_SOME_NEW_VERSION 0 -#endif - -static int glad_gl_get_extensions( int version, const char **out_exts, unsigned int *out_num_exts_i, char ***out_exts_i) { -#if GLAD_GL_IS_SOME_NEW_VERSION - if(GLAD_VERSION_MAJOR(version) < 3) { -#else - (void) version; - (void) out_num_exts_i; - (void) out_exts_i; -#endif - if (glad_glGetString == NULL) { - return 0; - } - *out_exts = (const char *)glad_glGetString(GL_EXTENSIONS); -#if GLAD_GL_IS_SOME_NEW_VERSION - } else { - unsigned int index = 0; - unsigned int num_exts_i = 0; - char **exts_i = NULL; - if (glad_glGetStringi == NULL || glad_glGetIntegerv == NULL) { - return 0; - } - glad_glGetIntegerv(GL_NUM_EXTENSIONS, (int*) &num_exts_i); - if (num_exts_i > 0) { - exts_i = (char **) malloc(num_exts_i * (sizeof *exts_i)); - } - if (exts_i == NULL) { - return 0; - } - for(index = 0; index < num_exts_i; index++) { - const char *gl_str_tmp = (const char*) glad_glGetStringi(GL_EXTENSIONS, index); - size_t len = strlen(gl_str_tmp) + 1; - - char *local_str = (char*) malloc(len * sizeof(char)); - if(local_str != NULL) { - memcpy(local_str, gl_str_tmp, len * sizeof(char)); - } - - exts_i[index] = local_str; - } - - *out_num_exts_i = num_exts_i; - *out_exts_i = exts_i; - } -#endif - return 1; -} -static void glad_gl_free_extensions(char **exts_i, unsigned int num_exts_i) { - if (exts_i != NULL) { - unsigned int index; - for(index = 0; index < num_exts_i; index++) { - free((void *) (exts_i[index])); - } - free((void *)exts_i); - exts_i = NULL; - } -} -static int glad_gl_has_extension(int version, const char *exts, unsigned int num_exts_i, char **exts_i, const char *ext) { - if(GLAD_VERSION_MAJOR(version) < 3 || !GLAD_GL_IS_SOME_NEW_VERSION) { - const char *extensions; - const char *loc; - const char *terminator; - extensions = exts; - if(extensions == NULL || ext == NULL) { - return 0; - } - while(1) { - loc = strstr(extensions, ext); - if(loc == NULL) { - return 0; - } - terminator = loc + strlen(ext); - if((loc == extensions || *(loc - 1) == ' ') && - (*terminator == ' ' || *terminator == '\0')) { - return 1; - } - extensions = terminator; - } - } else { - unsigned int index; - for(index = 0; index < num_exts_i; index++) { - const char *e = exts_i[index]; - if(strcmp(e, ext) == 0) { - return 1; - } - } - } - return 0; -} - -static GLADapiproc glad_gl_get_proc_from_userptr(void *userptr, const char* name) { - return (GLAD_GNUC_EXTENSION (GLADapiproc (*)(const char *name)) userptr)(name); -} - -static int glad_gl_find_extensions_gl( int version) { - const char *exts = NULL; - unsigned int num_exts_i = 0; - char **exts_i = NULL; - if (!glad_gl_get_extensions(version, &exts, &num_exts_i, &exts_i)) return 0; - - GLAD_GL_ARB_multisample = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_ARB_multisample"); - GLAD_GL_ARB_robustness = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_ARB_robustness"); - GLAD_GL_KHR_debug = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_KHR_debug"); - - glad_gl_free_extensions(exts_i, num_exts_i); - - return 1; -} - -static int glad_gl_find_core_gl(void) { - int i; - const char* version; - const char* prefixes[] = { - "OpenGL ES-CM ", - "OpenGL ES-CL ", - "OpenGL ES ", - "OpenGL SC ", - NULL - }; - int major = 0; - int minor = 0; - version = (const char*) glad_glGetString(GL_VERSION); - if (!version) return 0; - for (i = 0; prefixes[i]; i++) { - const size_t length = strlen(prefixes[i]); - if (strncmp(version, prefixes[i], length) == 0) { - version += length; - break; - } - } - - GLAD_IMPL_UTIL_SSCANF(version, "%d.%d", &major, &minor); - - GLAD_GL_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1; - GLAD_GL_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1; - GLAD_GL_VERSION_1_2 = (major == 1 && minor >= 2) || major > 1; - GLAD_GL_VERSION_1_3 = (major == 1 && minor >= 3) || major > 1; - GLAD_GL_VERSION_1_4 = (major == 1 && minor >= 4) || major > 1; - GLAD_GL_VERSION_1_5 = (major == 1 && minor >= 5) || major > 1; - GLAD_GL_VERSION_2_0 = (major == 2 && minor >= 0) || major > 2; - GLAD_GL_VERSION_2_1 = (major == 2 && minor >= 1) || major > 2; - GLAD_GL_VERSION_3_0 = (major == 3 && minor >= 0) || major > 3; - GLAD_GL_VERSION_3_1 = (major == 3 && minor >= 1) || major > 3; - GLAD_GL_VERSION_3_2 = (major == 3 && minor >= 2) || major > 3; - GLAD_GL_VERSION_3_3 = (major == 3 && minor >= 3) || major > 3; - - return GLAD_MAKE_VERSION(major, minor); -} - -int gladLoadGLUserPtr( GLADuserptrloadfunc load, void *userptr) { - int version; - - glad_glGetString = (PFNGLGETSTRINGPROC) load(userptr, "glGetString"); - if(glad_glGetString == NULL) return 0; - if(glad_glGetString(GL_VERSION) == NULL) return 0; - version = glad_gl_find_core_gl(); - - glad_gl_load_GL_VERSION_1_0(load, userptr); - glad_gl_load_GL_VERSION_1_1(load, userptr); - glad_gl_load_GL_VERSION_1_2(load, userptr); - glad_gl_load_GL_VERSION_1_3(load, userptr); - glad_gl_load_GL_VERSION_1_4(load, userptr); - glad_gl_load_GL_VERSION_1_5(load, userptr); - glad_gl_load_GL_VERSION_2_0(load, userptr); - glad_gl_load_GL_VERSION_2_1(load, userptr); - glad_gl_load_GL_VERSION_3_0(load, userptr); - glad_gl_load_GL_VERSION_3_1(load, userptr); - glad_gl_load_GL_VERSION_3_2(load, userptr); - glad_gl_load_GL_VERSION_3_3(load, userptr); - - if (!glad_gl_find_extensions_gl(version)) return 0; - glad_gl_load_GL_ARB_multisample(load, userptr); - glad_gl_load_GL_ARB_robustness(load, userptr); - glad_gl_load_GL_KHR_debug(load, userptr); - - - - return version; -} - - -int gladLoadGL( GLADloadfunc load) { - return gladLoadGLUserPtr( glad_gl_get_proc_from_userptr, GLAD_GNUC_EXTENSION (void*) load); -} - - - - - - -#ifdef __cplusplus -} -#endif - -#endif /* GLAD_GL_IMPLEMENTATION */ - diff --git a/3rdparty/glfw/source/deps/glad/gles2.h b/3rdparty/glfw/source/deps/glad/gles2.h deleted file mode 100644 index d67f110..0000000 --- a/3rdparty/glfw/source/deps/glad/gles2.h +++ /dev/null @@ -1,1805 +0,0 @@ -/** - * Loader generated by glad 2.0.0-beta on Tue Aug 24 22:51:42 2021 - * - * Generator: C/C++ - * Specification: gl - * Extensions: 0 - * - * APIs: - * - gles2=2.0 - * - * Options: - * - ALIAS = False - * - DEBUG = False - * - HEADER_ONLY = True - * - LOADER = False - * - MX = False - * - MX_GLOBAL = False - * - ON_DEMAND = False - * - * Commandline: - * --api='gles2=2.0' --extensions='' c --header-only - * - * Online: - * http://glad.sh/#api=gles2%3D2.0&extensions=&generator=c&options=HEADER_ONLY - * - */ - -#ifndef GLAD_GLES2_H_ -#define GLAD_GLES2_H_ - -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wreserved-id-macro" -#endif -#ifdef __gl2_h_ - #error OpenGL ES 2 header already included (API: gles2), remove previous include! -#endif -#define __gl2_h_ 1 -#ifdef __gl3_h_ - #error OpenGL ES 3 header already included (API: gles2), remove previous include! -#endif -#define __gl3_h_ 1 -#ifdef __clang__ -#pragma clang diagnostic pop -#endif - -#define GLAD_GLES2 -#define GLAD_OPTION_GLES2_HEADER_ONLY - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef GLAD_PLATFORM_H_ -#define GLAD_PLATFORM_H_ - -#ifndef GLAD_PLATFORM_WIN32 - #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__MINGW32__) - #define GLAD_PLATFORM_WIN32 1 - #else - #define GLAD_PLATFORM_WIN32 0 - #endif -#endif - -#ifndef GLAD_PLATFORM_APPLE - #ifdef __APPLE__ - #define GLAD_PLATFORM_APPLE 1 - #else - #define GLAD_PLATFORM_APPLE 0 - #endif -#endif - -#ifndef GLAD_PLATFORM_EMSCRIPTEN - #ifdef __EMSCRIPTEN__ - #define GLAD_PLATFORM_EMSCRIPTEN 1 - #else - #define GLAD_PLATFORM_EMSCRIPTEN 0 - #endif -#endif - -#ifndef GLAD_PLATFORM_UWP - #if defined(_MSC_VER) && !defined(GLAD_INTERNAL_HAVE_WINAPIFAMILY) - #ifdef __has_include - #if __has_include() - #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1 - #endif - #elif _MSC_VER >= 1700 && !_USING_V110_SDK71_ - #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1 - #endif - #endif - - #ifdef GLAD_INTERNAL_HAVE_WINAPIFAMILY - #include - #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) - #define GLAD_PLATFORM_UWP 1 - #endif - #endif - - #ifndef GLAD_PLATFORM_UWP - #define GLAD_PLATFORM_UWP 0 - #endif -#endif - -#ifdef __GNUC__ - #define GLAD_GNUC_EXTENSION __extension__ -#else - #define GLAD_GNUC_EXTENSION -#endif - -#ifndef GLAD_API_CALL - #if defined(GLAD_API_CALL_EXPORT) - #if GLAD_PLATFORM_WIN32 || defined(__CYGWIN__) - #if defined(GLAD_API_CALL_EXPORT_BUILD) - #if defined(__GNUC__) - #define GLAD_API_CALL __attribute__ ((dllexport)) extern - #else - #define GLAD_API_CALL __declspec(dllexport) extern - #endif - #else - #if defined(__GNUC__) - #define GLAD_API_CALL __attribute__ ((dllimport)) extern - #else - #define GLAD_API_CALL __declspec(dllimport) extern - #endif - #endif - #elif defined(__GNUC__) && defined(GLAD_API_CALL_EXPORT_BUILD) - #define GLAD_API_CALL __attribute__ ((visibility ("default"))) extern - #else - #define GLAD_API_CALL extern - #endif - #else - #define GLAD_API_CALL extern - #endif -#endif - -#ifdef APIENTRY - #define GLAD_API_PTR APIENTRY -#elif GLAD_PLATFORM_WIN32 - #define GLAD_API_PTR __stdcall -#else - #define GLAD_API_PTR -#endif - -#ifndef GLAPI -#define GLAPI GLAD_API_CALL -#endif - -#ifndef GLAPIENTRY -#define GLAPIENTRY GLAD_API_PTR -#endif - -#define GLAD_MAKE_VERSION(major, minor) (major * 10000 + minor) -#define GLAD_VERSION_MAJOR(version) (version / 10000) -#define GLAD_VERSION_MINOR(version) (version % 10000) - -#define GLAD_GENERATOR_VERSION "2.0.0-beta" - -typedef void (*GLADapiproc)(void); - -typedef GLADapiproc (*GLADloadfunc)(const char *name); -typedef GLADapiproc (*GLADuserptrloadfunc)(void *userptr, const char *name); - -typedef void (*GLADprecallback)(const char *name, GLADapiproc apiproc, int len_args, ...); -typedef void (*GLADpostcallback)(void *ret, const char *name, GLADapiproc apiproc, int len_args, ...); - -#endif /* GLAD_PLATFORM_H_ */ - -#define GL_ACTIVE_ATTRIBUTES 0x8B89 -#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A -#define GL_ACTIVE_TEXTURE 0x84E0 -#define GL_ACTIVE_UNIFORMS 0x8B86 -#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E -#define GL_ALIASED_POINT_SIZE_RANGE 0x846D -#define GL_ALPHA 0x1906 -#define GL_ALPHA_BITS 0x0D55 -#define GL_ALWAYS 0x0207 -#define GL_ARRAY_BUFFER 0x8892 -#define GL_ARRAY_BUFFER_BINDING 0x8894 -#define GL_ATTACHED_SHADERS 0x8B85 -#define GL_BACK 0x0405 -#define GL_BLEND 0x0BE2 -#define GL_BLEND_COLOR 0x8005 -#define GL_BLEND_DST_ALPHA 0x80CA -#define GL_BLEND_DST_RGB 0x80C8 -#define GL_BLEND_EQUATION 0x8009 -#define GL_BLEND_EQUATION_ALPHA 0x883D -#define GL_BLEND_EQUATION_RGB 0x8009 -#define GL_BLEND_SRC_ALPHA 0x80CB -#define GL_BLEND_SRC_RGB 0x80C9 -#define GL_BLUE_BITS 0x0D54 -#define GL_BOOL 0x8B56 -#define GL_BOOL_VEC2 0x8B57 -#define GL_BOOL_VEC3 0x8B58 -#define GL_BOOL_VEC4 0x8B59 -#define GL_BUFFER_SIZE 0x8764 -#define GL_BUFFER_USAGE 0x8765 -#define GL_BYTE 0x1400 -#define GL_CCW 0x0901 -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_COLOR_ATTACHMENT0 0x8CE0 -#define GL_COLOR_BUFFER_BIT 0x00004000 -#define GL_COLOR_CLEAR_VALUE 0x0C22 -#define GL_COLOR_WRITEMASK 0x0C23 -#define GL_COMPILE_STATUS 0x8B81 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_CONSTANT_COLOR 0x8001 -#define GL_CULL_FACE 0x0B44 -#define GL_CULL_FACE_MODE 0x0B45 -#define GL_CURRENT_PROGRAM 0x8B8D -#define GL_CURRENT_VERTEX_ATTRIB 0x8626 -#define GL_CW 0x0900 -#define GL_DECR 0x1E03 -#define GL_DECR_WRAP 0x8508 -#define GL_DELETE_STATUS 0x8B80 -#define GL_DEPTH_ATTACHMENT 0x8D00 -#define GL_DEPTH_BITS 0x0D56 -#define GL_DEPTH_BUFFER_BIT 0x00000100 -#define GL_DEPTH_CLEAR_VALUE 0x0B73 -#define GL_DEPTH_COMPONENT 0x1902 -#define GL_DEPTH_COMPONENT16 0x81A5 -#define GL_DEPTH_FUNC 0x0B74 -#define GL_DEPTH_RANGE 0x0B70 -#define GL_DEPTH_TEST 0x0B71 -#define GL_DEPTH_WRITEMASK 0x0B72 -#define GL_DITHER 0x0BD0 -#define GL_DONT_CARE 0x1100 -#define GL_DST_ALPHA 0x0304 -#define GL_DST_COLOR 0x0306 -#define GL_DYNAMIC_DRAW 0x88E8 -#define GL_ELEMENT_ARRAY_BUFFER 0x8893 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 -#define GL_EQUAL 0x0202 -#define GL_EXTENSIONS 0x1F03 -#define GL_FALSE 0 -#define GL_FASTEST 0x1101 -#define GL_FIXED 0x140C -#define GL_FLOAT 0x1406 -#define GL_FLOAT_MAT2 0x8B5A -#define GL_FLOAT_MAT3 0x8B5B -#define GL_FLOAT_MAT4 0x8B5C -#define GL_FLOAT_VEC2 0x8B50 -#define GL_FLOAT_VEC3 0x8B51 -#define GL_FLOAT_VEC4 0x8B52 -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_FRAMEBUFFER 0x8D40 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 -#define GL_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 -#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD -#define GL_FRONT 0x0404 -#define GL_FRONT_AND_BACK 0x0408 -#define GL_FRONT_FACE 0x0B46 -#define GL_FUNC_ADD 0x8006 -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_FUNC_SUBTRACT 0x800A -#define GL_GENERATE_MIPMAP_HINT 0x8192 -#define GL_GEQUAL 0x0206 -#define GL_GREATER 0x0204 -#define GL_GREEN_BITS 0x0D53 -#define GL_HIGH_FLOAT 0x8DF2 -#define GL_HIGH_INT 0x8DF5 -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B -#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A -#define GL_INCR 0x1E02 -#define GL_INCR_WRAP 0x8507 -#define GL_INFO_LOG_LENGTH 0x8B84 -#define GL_INT 0x1404 -#define GL_INT_VEC2 0x8B53 -#define GL_INT_VEC3 0x8B54 -#define GL_INT_VEC4 0x8B55 -#define GL_INVALID_ENUM 0x0500 -#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 -#define GL_INVALID_OPERATION 0x0502 -#define GL_INVALID_VALUE 0x0501 -#define GL_INVERT 0x150A -#define GL_KEEP 0x1E00 -#define GL_LEQUAL 0x0203 -#define GL_LESS 0x0201 -#define GL_LINEAR 0x2601 -#define GL_LINEAR_MIPMAP_LINEAR 0x2703 -#define GL_LINEAR_MIPMAP_NEAREST 0x2701 -#define GL_LINES 0x0001 -#define GL_LINE_LOOP 0x0002 -#define GL_LINE_STRIP 0x0003 -#define GL_LINE_WIDTH 0x0B21 -#define GL_LINK_STATUS 0x8B82 -#define GL_LOW_FLOAT 0x8DF0 -#define GL_LOW_INT 0x8DF3 -#define GL_LUMINANCE 0x1909 -#define GL_LUMINANCE_ALPHA 0x190A -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C -#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD -#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 -#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 -#define GL_MAX_TEXTURE_SIZE 0x0D33 -#define GL_MAX_VARYING_VECTORS 0x8DFC -#define GL_MAX_VERTEX_ATTRIBS 0x8869 -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C -#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB -#define GL_MAX_VIEWPORT_DIMS 0x0D3A -#define GL_MEDIUM_FLOAT 0x8DF1 -#define GL_MEDIUM_INT 0x8DF4 -#define GL_MIRRORED_REPEAT 0x8370 -#define GL_NEAREST 0x2600 -#define GL_NEAREST_MIPMAP_LINEAR 0x2702 -#define GL_NEAREST_MIPMAP_NEAREST 0x2700 -#define GL_NEVER 0x0200 -#define GL_NICEST 0x1102 -#define GL_NONE 0 -#define GL_NOTEQUAL 0x0205 -#define GL_NO_ERROR 0 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 -#define GL_ONE 1 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_ONE_MINUS_DST_ALPHA 0x0305 -#define GL_ONE_MINUS_DST_COLOR 0x0307 -#define GL_ONE_MINUS_SRC_ALPHA 0x0303 -#define GL_ONE_MINUS_SRC_COLOR 0x0301 -#define GL_OUT_OF_MEMORY 0x0505 -#define GL_PACK_ALIGNMENT 0x0D05 -#define GL_POINTS 0x0000 -#define GL_POLYGON_OFFSET_FACTOR 0x8038 -#define GL_POLYGON_OFFSET_FILL 0x8037 -#define GL_POLYGON_OFFSET_UNITS 0x2A00 -#define GL_RED_BITS 0x0D52 -#define GL_RENDERBUFFER 0x8D41 -#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 -#define GL_RENDERBUFFER_BINDING 0x8CA7 -#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 -#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 -#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 -#define GL_RENDERBUFFER_HEIGHT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 -#define GL_RENDERBUFFER_RED_SIZE 0x8D50 -#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 -#define GL_RENDERBUFFER_WIDTH 0x8D42 -#define GL_RENDERER 0x1F01 -#define GL_REPEAT 0x2901 -#define GL_REPLACE 0x1E01 -#define GL_RGB 0x1907 -#define GL_RGB565 0x8D62 -#define GL_RGB5_A1 0x8057 -#define GL_RGBA 0x1908 -#define GL_RGBA4 0x8056 -#define GL_SAMPLER_2D 0x8B5E -#define GL_SAMPLER_CUBE 0x8B60 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLE_COVERAGE 0x80A0 -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SCISSOR_BOX 0x0C10 -#define GL_SCISSOR_TEST 0x0C11 -#define GL_SHADER_BINARY_FORMATS 0x8DF8 -#define GL_SHADER_COMPILER 0x8DFA -#define GL_SHADER_SOURCE_LENGTH 0x8B88 -#define GL_SHADER_TYPE 0x8B4F -#define GL_SHADING_LANGUAGE_VERSION 0x8B8C -#define GL_SHORT 0x1402 -#define GL_SRC_ALPHA 0x0302 -#define GL_SRC_ALPHA_SATURATE 0x0308 -#define GL_SRC_COLOR 0x0300 -#define GL_STATIC_DRAW 0x88E4 -#define GL_STENCIL_ATTACHMENT 0x8D20 -#define GL_STENCIL_BACK_FAIL 0x8801 -#define GL_STENCIL_BACK_FUNC 0x8800 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 -#define GL_STENCIL_BACK_REF 0x8CA3 -#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 -#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 -#define GL_STENCIL_BITS 0x0D57 -#define GL_STENCIL_BUFFER_BIT 0x00000400 -#define GL_STENCIL_CLEAR_VALUE 0x0B91 -#define GL_STENCIL_FAIL 0x0B94 -#define GL_STENCIL_FUNC 0x0B92 -#define GL_STENCIL_INDEX8 0x8D48 -#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 -#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 -#define GL_STENCIL_REF 0x0B97 -#define GL_STENCIL_TEST 0x0B90 -#define GL_STENCIL_VALUE_MASK 0x0B93 -#define GL_STENCIL_WRITEMASK 0x0B98 -#define GL_STREAM_DRAW 0x88E0 -#define GL_SUBPIXEL_BITS 0x0D50 -#define GL_TEXTURE 0x1702 -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE_2D 0x0DE1 -#define GL_TEXTURE_BINDING_2D 0x8069 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_MAG_FILTER 0x2800 -#define GL_TEXTURE_MIN_FILTER 0x2801 -#define GL_TEXTURE_WRAP_S 0x2802 -#define GL_TEXTURE_WRAP_T 0x2803 -#define GL_TRIANGLES 0x0004 -#define GL_TRIANGLE_FAN 0x0006 -#define GL_TRIANGLE_STRIP 0x0005 -#define GL_TRUE 1 -#define GL_UNPACK_ALIGNMENT 0x0CF5 -#define GL_UNSIGNED_BYTE 0x1401 -#define GL_UNSIGNED_INT 0x1405 -#define GL_UNSIGNED_SHORT 0x1403 -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 -#define GL_VALIDATE_STATUS 0x8B83 -#define GL_VENDOR 0x1F00 -#define GL_VERSION 0x1F02 -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A -#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 -#define GL_VERTEX_SHADER 0x8B31 -#define GL_VIEWPORT 0x0BA2 -#define GL_ZERO 0 - - -#ifndef __khrplatform_h_ -#define __khrplatform_h_ - -/* -** Copyright (c) 2008-2018 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ - -/* Khronos platform-specific types and definitions. - * - * The master copy of khrplatform.h is maintained in the Khronos EGL - * Registry repository at https://github.com/KhronosGroup/EGL-Registry - * The last semantic modification to khrplatform.h was at commit ID: - * 67a3e0864c2d75ea5287b9f3d2eb74a745936692 - * - * Adopters may modify this file to suit their platform. Adopters are - * encouraged to submit platform specific modifications to the Khronos - * group so that they can be included in future versions of this file. - * Please submit changes by filing pull requests or issues on - * the EGL Registry repository linked above. - * - * - * See the Implementer's Guidelines for information about where this file - * should be located on your system and for more details of its use: - * http://www.khronos.org/registry/implementers_guide.pdf - * - * This file should be included as - * #include - * by Khronos client API header files that use its types and defines. - * - * The types in khrplatform.h should only be used to define API-specific types. - * - * Types defined in khrplatform.h: - * khronos_int8_t signed 8 bit - * khronos_uint8_t unsigned 8 bit - * khronos_int16_t signed 16 bit - * khronos_uint16_t unsigned 16 bit - * khronos_int32_t signed 32 bit - * khronos_uint32_t unsigned 32 bit - * khronos_int64_t signed 64 bit - * khronos_uint64_t unsigned 64 bit - * khronos_intptr_t signed same number of bits as a pointer - * khronos_uintptr_t unsigned same number of bits as a pointer - * khronos_ssize_t signed size - * khronos_usize_t unsigned size - * khronos_float_t signed 32 bit floating point - * khronos_time_ns_t unsigned 64 bit time in nanoseconds - * khronos_utime_nanoseconds_t unsigned time interval or absolute time in - * nanoseconds - * khronos_stime_nanoseconds_t signed time interval in nanoseconds - * khronos_boolean_enum_t enumerated boolean type. This should - * only be used as a base type when a client API's boolean type is - * an enum. Client APIs which use an integer or other type for - * booleans cannot use this as the base type for their boolean. - * - * Tokens defined in khrplatform.h: - * - * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values. - * - * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. - * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. - * - * Calling convention macros defined in this file: - * KHRONOS_APICALL - * KHRONOS_GLAD_API_PTR - * KHRONOS_APIATTRIBUTES - * - * These may be used in function prototypes as: - * - * KHRONOS_APICALL void KHRONOS_GLAD_API_PTR funcname( - * int arg1, - * int arg2) KHRONOS_APIATTRIBUTES; - */ - -#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC) -# define KHRONOS_STATIC 1 -#endif - -/*------------------------------------------------------------------------- - * Definition of KHRONOS_APICALL - *------------------------------------------------------------------------- - * This precedes the return type of the function in the function prototype. - */ -#if defined(KHRONOS_STATIC) - /* If the preprocessor constant KHRONOS_STATIC is defined, make the - * header compatible with static linking. */ -# define KHRONOS_APICALL -#elif defined(_WIN32) -# define KHRONOS_APICALL __declspec(dllimport) -#elif defined (__SYMBIAN32__) -# define KHRONOS_APICALL IMPORT_C -#elif defined(__ANDROID__) -# define KHRONOS_APICALL __attribute__((visibility("default"))) -#else -# define KHRONOS_APICALL -#endif - -/*------------------------------------------------------------------------- - * Definition of KHRONOS_GLAD_API_PTR - *------------------------------------------------------------------------- - * This follows the return type of the function and precedes the function - * name in the function prototype. - */ -#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) - /* Win32 but not WinCE */ -# define KHRONOS_GLAD_API_PTR __stdcall -#else -# define KHRONOS_GLAD_API_PTR -#endif - -/*------------------------------------------------------------------------- - * Definition of KHRONOS_APIATTRIBUTES - *------------------------------------------------------------------------- - * This follows the closing parenthesis of the function prototype arguments. - */ -#if defined (__ARMCC_2__) -#define KHRONOS_APIATTRIBUTES __softfp -#else -#define KHRONOS_APIATTRIBUTES -#endif - -/*------------------------------------------------------------------------- - * basic type definitions - *-----------------------------------------------------------------------*/ -#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__) - - -/* - * Using - */ -#include -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(__VMS ) || defined(__sgi) - -/* - * Using - */ -#include -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(_WIN32) && !defined(__SCITECH_SNAP__) - -/* - * Win32 - */ -typedef __int32 khronos_int32_t; -typedef unsigned __int32 khronos_uint32_t; -typedef __int64 khronos_int64_t; -typedef unsigned __int64 khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif defined(__sun__) || defined(__digital__) - -/* - * Sun or Digital - */ -typedef int khronos_int32_t; -typedef unsigned int khronos_uint32_t; -#if defined(__arch64__) || defined(_LP64) -typedef long int khronos_int64_t; -typedef unsigned long int khronos_uint64_t; -#else -typedef long long int khronos_int64_t; -typedef unsigned long long int khronos_uint64_t; -#endif /* __arch64__ */ -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#elif 0 - -/* - * Hypothetical platform with no float or int64 support - */ -typedef int khronos_int32_t; -typedef unsigned int khronos_uint32_t; -#define KHRONOS_SUPPORT_INT64 0 -#define KHRONOS_SUPPORT_FLOAT 0 - -#else - -/* - * Generic fallback - */ -#include -typedef int32_t khronos_int32_t; -typedef uint32_t khronos_uint32_t; -typedef int64_t khronos_int64_t; -typedef uint64_t khronos_uint64_t; -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 - -#endif - - -/* - * Types that are (so far) the same on all platforms - */ -typedef signed char khronos_int8_t; -typedef unsigned char khronos_uint8_t; -typedef signed short int khronos_int16_t; -typedef unsigned short int khronos_uint16_t; - -/* - * Types that differ between LLP64 and LP64 architectures - in LLP64, - * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears - * to be the only LLP64 architecture in current use. - */ -#ifdef _WIN64 -typedef signed long long int khronos_intptr_t; -typedef unsigned long long int khronos_uintptr_t; -typedef signed long long int khronos_ssize_t; -typedef unsigned long long int khronos_usize_t; -#else -typedef signed long int khronos_intptr_t; -typedef unsigned long int khronos_uintptr_t; -typedef signed long int khronos_ssize_t; -typedef unsigned long int khronos_usize_t; -#endif - -#if KHRONOS_SUPPORT_FLOAT -/* - * Float type - */ -typedef float khronos_float_t; -#endif - -#if KHRONOS_SUPPORT_INT64 -/* Time types - * - * These types can be used to represent a time interval in nanoseconds or - * an absolute Unadjusted System Time. Unadjusted System Time is the number - * of nanoseconds since some arbitrary system event (e.g. since the last - * time the system booted). The Unadjusted System Time is an unsigned - * 64 bit value that wraps back to 0 every 584 years. Time intervals - * may be either signed or unsigned. - */ -typedef khronos_uint64_t khronos_utime_nanoseconds_t; -typedef khronos_int64_t khronos_stime_nanoseconds_t; -#endif - -/* - * Dummy value used to pad enum types to 32 bits. - */ -#ifndef KHRONOS_MAX_ENUM -#define KHRONOS_MAX_ENUM 0x7FFFFFFF -#endif - -/* - * Enumerated boolean type - * - * Values other than zero should be considered to be true. Therefore - * comparisons should not be made against KHRONOS_TRUE. - */ -typedef enum { - KHRONOS_FALSE = 0, - KHRONOS_TRUE = 1, - KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM -} khronos_boolean_enum_t; - -#endif /* __khrplatform_h_ */ - -typedef unsigned int GLenum; - -typedef unsigned char GLboolean; - -typedef unsigned int GLbitfield; - -typedef void GLvoid; - -typedef khronos_int8_t GLbyte; - -typedef khronos_uint8_t GLubyte; - -typedef khronos_int16_t GLshort; - -typedef khronos_uint16_t GLushort; - -typedef int GLint; - -typedef unsigned int GLuint; - -typedef khronos_int32_t GLclampx; - -typedef int GLsizei; - -typedef khronos_float_t GLfloat; - -typedef khronos_float_t GLclampf; - -typedef double GLdouble; - -typedef double GLclampd; - -typedef void *GLeglClientBufferEXT; - -typedef void *GLeglImageOES; - -typedef char GLchar; - -typedef char GLcharARB; - -#ifdef __APPLE__ -typedef void *GLhandleARB; -#else -typedef unsigned int GLhandleARB; -#endif - -typedef khronos_uint16_t GLhalf; - -typedef khronos_uint16_t GLhalfARB; - -typedef khronos_int32_t GLfixed; - -#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) -typedef khronos_intptr_t GLintptr; -#else -typedef khronos_intptr_t GLintptr; -#endif - -#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) -typedef khronos_intptr_t GLintptrARB; -#else -typedef khronos_intptr_t GLintptrARB; -#endif - -#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) -typedef khronos_ssize_t GLsizeiptr; -#else -typedef khronos_ssize_t GLsizeiptr; -#endif - -#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) -typedef khronos_ssize_t GLsizeiptrARB; -#else -typedef khronos_ssize_t GLsizeiptrARB; -#endif - -typedef khronos_int64_t GLint64; - -typedef khronos_int64_t GLint64EXT; - -typedef khronos_uint64_t GLuint64; - -typedef khronos_uint64_t GLuint64EXT; - -typedef struct __GLsync *GLsync; - -struct _cl_context; - -struct _cl_event; - -typedef void (GLAD_API_PTR *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); - -typedef void (GLAD_API_PTR *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); - -typedef void (GLAD_API_PTR *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); - -typedef void (GLAD_API_PTR *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam); - -typedef unsigned short GLhalfNV; - -typedef GLintptr GLvdpauSurfaceNV; - -typedef void (GLAD_API_PTR *GLVULKANPROCNV)(void); - - - -#define GL_ES_VERSION_2_0 1 -GLAD_API_CALL int GLAD_GL_ES_VERSION_2_0; - - -typedef void (GLAD_API_PTR *PFNGLACTIVETEXTUREPROC)(GLenum texture); -typedef void (GLAD_API_PTR *PFNGLATTACHSHADERPROC)(GLuint program, GLuint shader); -typedef void (GLAD_API_PTR *PFNGLBINDATTRIBLOCATIONPROC)(GLuint program, GLuint index, const GLchar * name); -typedef void (GLAD_API_PTR *PFNGLBINDBUFFERPROC)(GLenum target, GLuint buffer); -typedef void (GLAD_API_PTR *PFNGLBINDFRAMEBUFFERPROC)(GLenum target, GLuint framebuffer); -typedef void (GLAD_API_PTR *PFNGLBINDRENDERBUFFERPROC)(GLenum target, GLuint renderbuffer); -typedef void (GLAD_API_PTR *PFNGLBINDTEXTUREPROC)(GLenum target, GLuint texture); -typedef void (GLAD_API_PTR *PFNGLBLENDCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -typedef void (GLAD_API_PTR *PFNGLBLENDEQUATIONPROC)(GLenum mode); -typedef void (GLAD_API_PTR *PFNGLBLENDEQUATIONSEPARATEPROC)(GLenum modeRGB, GLenum modeAlpha); -typedef void (GLAD_API_PTR *PFNGLBLENDFUNCPROC)(GLenum sfactor, GLenum dfactor); -typedef void (GLAD_API_PTR *PFNGLBLENDFUNCSEPARATEPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -typedef void (GLAD_API_PTR *PFNGLBUFFERDATAPROC)(GLenum target, GLsizeiptr size, const void * data, GLenum usage); -typedef void (GLAD_API_PTR *PFNGLBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, const void * data); -typedef GLenum (GLAD_API_PTR *PFNGLCHECKFRAMEBUFFERSTATUSPROC)(GLenum target); -typedef void (GLAD_API_PTR *PFNGLCLEARPROC)(GLbitfield mask); -typedef void (GLAD_API_PTR *PFNGLCLEARCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -typedef void (GLAD_API_PTR *PFNGLCLEARDEPTHFPROC)(GLfloat d); -typedef void (GLAD_API_PTR *PFNGLCLEARSTENCILPROC)(GLint s); -typedef void (GLAD_API_PTR *PFNGLCOLORMASKPROC)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -typedef void (GLAD_API_PTR *PFNGLCOMPILESHADERPROC)(GLuint shader); -typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void * data); -typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void * data); -typedef void (GLAD_API_PTR *PFNGLCOPYTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (GLAD_API_PTR *PFNGLCOPYTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef GLuint (GLAD_API_PTR *PFNGLCREATEPROGRAMPROC)(void); -typedef GLuint (GLAD_API_PTR *PFNGLCREATESHADERPROC)(GLenum type); -typedef void (GLAD_API_PTR *PFNGLCULLFACEPROC)(GLenum mode); -typedef void (GLAD_API_PTR *PFNGLDELETEBUFFERSPROC)(GLsizei n, const GLuint * buffers); -typedef void (GLAD_API_PTR *PFNGLDELETEFRAMEBUFFERSPROC)(GLsizei n, const GLuint * framebuffers); -typedef void (GLAD_API_PTR *PFNGLDELETEPROGRAMPROC)(GLuint program); -typedef void (GLAD_API_PTR *PFNGLDELETERENDERBUFFERSPROC)(GLsizei n, const GLuint * renderbuffers); -typedef void (GLAD_API_PTR *PFNGLDELETESHADERPROC)(GLuint shader); -typedef void (GLAD_API_PTR *PFNGLDELETETEXTURESPROC)(GLsizei n, const GLuint * textures); -typedef void (GLAD_API_PTR *PFNGLDEPTHFUNCPROC)(GLenum func); -typedef void (GLAD_API_PTR *PFNGLDEPTHMASKPROC)(GLboolean flag); -typedef void (GLAD_API_PTR *PFNGLDEPTHRANGEFPROC)(GLfloat n, GLfloat f); -typedef void (GLAD_API_PTR *PFNGLDETACHSHADERPROC)(GLuint program, GLuint shader); -typedef void (GLAD_API_PTR *PFNGLDISABLEPROC)(GLenum cap); -typedef void (GLAD_API_PTR *PFNGLDISABLEVERTEXATTRIBARRAYPROC)(GLuint index); -typedef void (GLAD_API_PTR *PFNGLDRAWARRAYSPROC)(GLenum mode, GLint first, GLsizei count); -typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices); -typedef void (GLAD_API_PTR *PFNGLENABLEPROC)(GLenum cap); -typedef void (GLAD_API_PTR *PFNGLENABLEVERTEXATTRIBARRAYPROC)(GLuint index); -typedef void (GLAD_API_PTR *PFNGLFINISHPROC)(void); -typedef void (GLAD_API_PTR *PFNGLFLUSHPROC)(void); -typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERRENDERBUFFERPROC)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE2DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (GLAD_API_PTR *PFNGLFRONTFACEPROC)(GLenum mode); -typedef void (GLAD_API_PTR *PFNGLGENBUFFERSPROC)(GLsizei n, GLuint * buffers); -typedef void (GLAD_API_PTR *PFNGLGENFRAMEBUFFERSPROC)(GLsizei n, GLuint * framebuffers); -typedef void (GLAD_API_PTR *PFNGLGENRENDERBUFFERSPROC)(GLsizei n, GLuint * renderbuffers); -typedef void (GLAD_API_PTR *PFNGLGENTEXTURESPROC)(GLsizei n, GLuint * textures); -typedef void (GLAD_API_PTR *PFNGLGENERATEMIPMAPPROC)(GLenum target); -typedef void (GLAD_API_PTR *PFNGLGETACTIVEATTRIBPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name); -typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name); -typedef void (GLAD_API_PTR *PFNGLGETATTACHEDSHADERSPROC)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders); -typedef GLint (GLAD_API_PTR *PFNGLGETATTRIBLOCATIONPROC)(GLuint program, const GLchar * name); -typedef void (GLAD_API_PTR *PFNGLGETBOOLEANVPROC)(GLenum pname, GLboolean * data); -typedef void (GLAD_API_PTR *PFNGLGETBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params); -typedef GLenum (GLAD_API_PTR *PFNGLGETERRORPROC)(void); -typedef void (GLAD_API_PTR *PFNGLGETFLOATVPROC)(GLenum pname, GLfloat * data); -typedef void (GLAD_API_PTR *PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLenum target, GLenum attachment, GLenum pname, GLint * params); -typedef void (GLAD_API_PTR *PFNGLGETINTEGERVPROC)(GLenum pname, GLint * data); -typedef void (GLAD_API_PTR *PFNGLGETPROGRAMINFOLOGPROC)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog); -typedef void (GLAD_API_PTR *PFNGLGETPROGRAMIVPROC)(GLuint program, GLenum pname, GLint * params); -typedef void (GLAD_API_PTR *PFNGLGETRENDERBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params); -typedef void (GLAD_API_PTR *PFNGLGETSHADERINFOLOGPROC)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog); -typedef void (GLAD_API_PTR *PFNGLGETSHADERPRECISIONFORMATPROC)(GLenum shadertype, GLenum precisiontype, GLint * range, GLint * precision); -typedef void (GLAD_API_PTR *PFNGLGETSHADERSOURCEPROC)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source); -typedef void (GLAD_API_PTR *PFNGLGETSHADERIVPROC)(GLuint shader, GLenum pname, GLint * params); -typedef const GLubyte * (GLAD_API_PTR *PFNGLGETSTRINGPROC)(GLenum name); -typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat * params); -typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params); -typedef GLint (GLAD_API_PTR *PFNGLGETUNIFORMLOCATIONPROC)(GLuint program, const GLchar * name); -typedef void (GLAD_API_PTR *PFNGLGETUNIFORMFVPROC)(GLuint program, GLint location, GLfloat * params); -typedef void (GLAD_API_PTR *PFNGLGETUNIFORMIVPROC)(GLuint program, GLint location, GLint * params); -typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBPOINTERVPROC)(GLuint index, GLenum pname, void ** pointer); -typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBFVPROC)(GLuint index, GLenum pname, GLfloat * params); -typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBIVPROC)(GLuint index, GLenum pname, GLint * params); -typedef void (GLAD_API_PTR *PFNGLHINTPROC)(GLenum target, GLenum mode); -typedef GLboolean (GLAD_API_PTR *PFNGLISBUFFERPROC)(GLuint buffer); -typedef GLboolean (GLAD_API_PTR *PFNGLISENABLEDPROC)(GLenum cap); -typedef GLboolean (GLAD_API_PTR *PFNGLISFRAMEBUFFERPROC)(GLuint framebuffer); -typedef GLboolean (GLAD_API_PTR *PFNGLISPROGRAMPROC)(GLuint program); -typedef GLboolean (GLAD_API_PTR *PFNGLISRENDERBUFFERPROC)(GLuint renderbuffer); -typedef GLboolean (GLAD_API_PTR *PFNGLISSHADERPROC)(GLuint shader); -typedef GLboolean (GLAD_API_PTR *PFNGLISTEXTUREPROC)(GLuint texture); -typedef void (GLAD_API_PTR *PFNGLLINEWIDTHPROC)(GLfloat width); -typedef void (GLAD_API_PTR *PFNGLLINKPROGRAMPROC)(GLuint program); -typedef void (GLAD_API_PTR *PFNGLPIXELSTOREIPROC)(GLenum pname, GLint param); -typedef void (GLAD_API_PTR *PFNGLPOLYGONOFFSETPROC)(GLfloat factor, GLfloat units); -typedef void (GLAD_API_PTR *PFNGLREADPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * pixels); -typedef void (GLAD_API_PTR *PFNGLRELEASESHADERCOMPILERPROC)(void); -typedef void (GLAD_API_PTR *PFNGLRENDERBUFFERSTORAGEPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GLAD_API_PTR *PFNGLSAMPLECOVERAGEPROC)(GLfloat value, GLboolean invert); -typedef void (GLAD_API_PTR *PFNGLSCISSORPROC)(GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAD_API_PTR *PFNGLSHADERBINARYPROC)(GLsizei count, const GLuint * shaders, GLenum binaryFormat, const void * binary, GLsizei length); -typedef void (GLAD_API_PTR *PFNGLSHADERSOURCEPROC)(GLuint shader, GLsizei count, const GLchar *const* string, const GLint * length); -typedef void (GLAD_API_PTR *PFNGLSTENCILFUNCPROC)(GLenum func, GLint ref, GLuint mask); -typedef void (GLAD_API_PTR *PFNGLSTENCILFUNCSEPARATEPROC)(GLenum face, GLenum func, GLint ref, GLuint mask); -typedef void (GLAD_API_PTR *PFNGLSTENCILMASKPROC)(GLuint mask); -typedef void (GLAD_API_PTR *PFNGLSTENCILMASKSEPARATEPROC)(GLenum face, GLuint mask); -typedef void (GLAD_API_PTR *PFNGLSTENCILOPPROC)(GLenum fail, GLenum zfail, GLenum zpass); -typedef void (GLAD_API_PTR *PFNGLSTENCILOPSEPARATEPROC)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (GLAD_API_PTR *PFNGLTEXIMAGE2DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels); -typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERFPROC)(GLenum target, GLenum pname, GLfloat param); -typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERFVPROC)(GLenum target, GLenum pname, const GLfloat * params); -typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIPROC)(GLenum target, GLenum pname, GLint param); -typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint * params); -typedef void (GLAD_API_PTR *PFNGLTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels); -typedef void (GLAD_API_PTR *PFNGLUNIFORM1FPROC)(GLint location, GLfloat v0); -typedef void (GLAD_API_PTR *PFNGLUNIFORM1FVPROC)(GLint location, GLsizei count, const GLfloat * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORM1IPROC)(GLint location, GLint v0); -typedef void (GLAD_API_PTR *PFNGLUNIFORM1IVPROC)(GLint location, GLsizei count, const GLint * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORM2FPROC)(GLint location, GLfloat v0, GLfloat v1); -typedef void (GLAD_API_PTR *PFNGLUNIFORM2FVPROC)(GLint location, GLsizei count, const GLfloat * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORM2IPROC)(GLint location, GLint v0, GLint v1); -typedef void (GLAD_API_PTR *PFNGLUNIFORM2IVPROC)(GLint location, GLsizei count, const GLint * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORM3FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (GLAD_API_PTR *PFNGLUNIFORM3FVPROC)(GLint location, GLsizei count, const GLfloat * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORM3IPROC)(GLint location, GLint v0, GLint v1, GLint v2); -typedef void (GLAD_API_PTR *PFNGLUNIFORM3IVPROC)(GLint location, GLsizei count, const GLint * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORM4FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (GLAD_API_PTR *PFNGLUNIFORM4FVPROC)(GLint location, GLsizei count, const GLfloat * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORM4IPROC)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (GLAD_API_PTR *PFNGLUNIFORM4IVPROC)(GLint location, GLsizei count, const GLint * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); -typedef void (GLAD_API_PTR *PFNGLUSEPROGRAMPROC)(GLuint program); -typedef void (GLAD_API_PTR *PFNGLVALIDATEPROGRAMPROC)(GLuint program); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1FPROC)(GLuint index, GLfloat x); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1FVPROC)(GLuint index, const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2FPROC)(GLuint index, GLfloat x, GLfloat y); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2FVPROC)(GLuint index, const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3FVPROC)(GLuint index, const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4FVPROC)(GLuint index, const GLfloat * v); -typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBPOINTERPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void * pointer); -typedef void (GLAD_API_PTR *PFNGLVIEWPORTPROC)(GLint x, GLint y, GLsizei width, GLsizei height); - -GLAD_API_CALL PFNGLACTIVETEXTUREPROC glad_glActiveTexture; -#define glActiveTexture glad_glActiveTexture -GLAD_API_CALL PFNGLATTACHSHADERPROC glad_glAttachShader; -#define glAttachShader glad_glAttachShader -GLAD_API_CALL PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation; -#define glBindAttribLocation glad_glBindAttribLocation -GLAD_API_CALL PFNGLBINDBUFFERPROC glad_glBindBuffer; -#define glBindBuffer glad_glBindBuffer -GLAD_API_CALL PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer; -#define glBindFramebuffer glad_glBindFramebuffer -GLAD_API_CALL PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer; -#define glBindRenderbuffer glad_glBindRenderbuffer -GLAD_API_CALL PFNGLBINDTEXTUREPROC glad_glBindTexture; -#define glBindTexture glad_glBindTexture -GLAD_API_CALL PFNGLBLENDCOLORPROC glad_glBlendColor; -#define glBlendColor glad_glBlendColor -GLAD_API_CALL PFNGLBLENDEQUATIONPROC glad_glBlendEquation; -#define glBlendEquation glad_glBlendEquation -GLAD_API_CALL PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate; -#define glBlendEquationSeparate glad_glBlendEquationSeparate -GLAD_API_CALL PFNGLBLENDFUNCPROC glad_glBlendFunc; -#define glBlendFunc glad_glBlendFunc -GLAD_API_CALL PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate; -#define glBlendFuncSeparate glad_glBlendFuncSeparate -GLAD_API_CALL PFNGLBUFFERDATAPROC glad_glBufferData; -#define glBufferData glad_glBufferData -GLAD_API_CALL PFNGLBUFFERSUBDATAPROC glad_glBufferSubData; -#define glBufferSubData glad_glBufferSubData -GLAD_API_CALL PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus; -#define glCheckFramebufferStatus glad_glCheckFramebufferStatus -GLAD_API_CALL PFNGLCLEARPROC glad_glClear; -#define glClear glad_glClear -GLAD_API_CALL PFNGLCLEARCOLORPROC glad_glClearColor; -#define glClearColor glad_glClearColor -GLAD_API_CALL PFNGLCLEARDEPTHFPROC glad_glClearDepthf; -#define glClearDepthf glad_glClearDepthf -GLAD_API_CALL PFNGLCLEARSTENCILPROC glad_glClearStencil; -#define glClearStencil glad_glClearStencil -GLAD_API_CALL PFNGLCOLORMASKPROC glad_glColorMask; -#define glColorMask glad_glColorMask -GLAD_API_CALL PFNGLCOMPILESHADERPROC glad_glCompileShader; -#define glCompileShader glad_glCompileShader -GLAD_API_CALL PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D; -#define glCompressedTexImage2D glad_glCompressedTexImage2D -GLAD_API_CALL PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D; -#define glCompressedTexSubImage2D glad_glCompressedTexSubImage2D -GLAD_API_CALL PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D; -#define glCopyTexImage2D glad_glCopyTexImage2D -GLAD_API_CALL PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D; -#define glCopyTexSubImage2D glad_glCopyTexSubImage2D -GLAD_API_CALL PFNGLCREATEPROGRAMPROC glad_glCreateProgram; -#define glCreateProgram glad_glCreateProgram -GLAD_API_CALL PFNGLCREATESHADERPROC glad_glCreateShader; -#define glCreateShader glad_glCreateShader -GLAD_API_CALL PFNGLCULLFACEPROC glad_glCullFace; -#define glCullFace glad_glCullFace -GLAD_API_CALL PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers; -#define glDeleteBuffers glad_glDeleteBuffers -GLAD_API_CALL PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers; -#define glDeleteFramebuffers glad_glDeleteFramebuffers -GLAD_API_CALL PFNGLDELETEPROGRAMPROC glad_glDeleteProgram; -#define glDeleteProgram glad_glDeleteProgram -GLAD_API_CALL PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers; -#define glDeleteRenderbuffers glad_glDeleteRenderbuffers -GLAD_API_CALL PFNGLDELETESHADERPROC glad_glDeleteShader; -#define glDeleteShader glad_glDeleteShader -GLAD_API_CALL PFNGLDELETETEXTURESPROC glad_glDeleteTextures; -#define glDeleteTextures glad_glDeleteTextures -GLAD_API_CALL PFNGLDEPTHFUNCPROC glad_glDepthFunc; -#define glDepthFunc glad_glDepthFunc -GLAD_API_CALL PFNGLDEPTHMASKPROC glad_glDepthMask; -#define glDepthMask glad_glDepthMask -GLAD_API_CALL PFNGLDEPTHRANGEFPROC glad_glDepthRangef; -#define glDepthRangef glad_glDepthRangef -GLAD_API_CALL PFNGLDETACHSHADERPROC glad_glDetachShader; -#define glDetachShader glad_glDetachShader -GLAD_API_CALL PFNGLDISABLEPROC glad_glDisable; -#define glDisable glad_glDisable -GLAD_API_CALL PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray; -#define glDisableVertexAttribArray glad_glDisableVertexAttribArray -GLAD_API_CALL PFNGLDRAWARRAYSPROC glad_glDrawArrays; -#define glDrawArrays glad_glDrawArrays -GLAD_API_CALL PFNGLDRAWELEMENTSPROC glad_glDrawElements; -#define glDrawElements glad_glDrawElements -GLAD_API_CALL PFNGLENABLEPROC glad_glEnable; -#define glEnable glad_glEnable -GLAD_API_CALL PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray; -#define glEnableVertexAttribArray glad_glEnableVertexAttribArray -GLAD_API_CALL PFNGLFINISHPROC glad_glFinish; -#define glFinish glad_glFinish -GLAD_API_CALL PFNGLFLUSHPROC glad_glFlush; -#define glFlush glad_glFlush -GLAD_API_CALL PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer; -#define glFramebufferRenderbuffer glad_glFramebufferRenderbuffer -GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D; -#define glFramebufferTexture2D glad_glFramebufferTexture2D -GLAD_API_CALL PFNGLFRONTFACEPROC glad_glFrontFace; -#define glFrontFace glad_glFrontFace -GLAD_API_CALL PFNGLGENBUFFERSPROC glad_glGenBuffers; -#define glGenBuffers glad_glGenBuffers -GLAD_API_CALL PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers; -#define glGenFramebuffers glad_glGenFramebuffers -GLAD_API_CALL PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers; -#define glGenRenderbuffers glad_glGenRenderbuffers -GLAD_API_CALL PFNGLGENTEXTURESPROC glad_glGenTextures; -#define glGenTextures glad_glGenTextures -GLAD_API_CALL PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap; -#define glGenerateMipmap glad_glGenerateMipmap -GLAD_API_CALL PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib; -#define glGetActiveAttrib glad_glGetActiveAttrib -GLAD_API_CALL PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform; -#define glGetActiveUniform glad_glGetActiveUniform -GLAD_API_CALL PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders; -#define glGetAttachedShaders glad_glGetAttachedShaders -GLAD_API_CALL PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation; -#define glGetAttribLocation glad_glGetAttribLocation -GLAD_API_CALL PFNGLGETBOOLEANVPROC glad_glGetBooleanv; -#define glGetBooleanv glad_glGetBooleanv -GLAD_API_CALL PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv; -#define glGetBufferParameteriv glad_glGetBufferParameteriv -GLAD_API_CALL PFNGLGETERRORPROC glad_glGetError; -#define glGetError glad_glGetError -GLAD_API_CALL PFNGLGETFLOATVPROC glad_glGetFloatv; -#define glGetFloatv glad_glGetFloatv -GLAD_API_CALL PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv; -#define glGetFramebufferAttachmentParameteriv glad_glGetFramebufferAttachmentParameteriv -GLAD_API_CALL PFNGLGETINTEGERVPROC glad_glGetIntegerv; -#define glGetIntegerv glad_glGetIntegerv -GLAD_API_CALL PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog; -#define glGetProgramInfoLog glad_glGetProgramInfoLog -GLAD_API_CALL PFNGLGETPROGRAMIVPROC glad_glGetProgramiv; -#define glGetProgramiv glad_glGetProgramiv -GLAD_API_CALL PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv; -#define glGetRenderbufferParameteriv glad_glGetRenderbufferParameteriv -GLAD_API_CALL PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog; -#define glGetShaderInfoLog glad_glGetShaderInfoLog -GLAD_API_CALL PFNGLGETSHADERPRECISIONFORMATPROC glad_glGetShaderPrecisionFormat; -#define glGetShaderPrecisionFormat glad_glGetShaderPrecisionFormat -GLAD_API_CALL PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource; -#define glGetShaderSource glad_glGetShaderSource -GLAD_API_CALL PFNGLGETSHADERIVPROC glad_glGetShaderiv; -#define glGetShaderiv glad_glGetShaderiv -GLAD_API_CALL PFNGLGETSTRINGPROC glad_glGetString; -#define glGetString glad_glGetString -GLAD_API_CALL PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv; -#define glGetTexParameterfv glad_glGetTexParameterfv -GLAD_API_CALL PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv; -#define glGetTexParameteriv glad_glGetTexParameteriv -GLAD_API_CALL PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation; -#define glGetUniformLocation glad_glGetUniformLocation -GLAD_API_CALL PFNGLGETUNIFORMFVPROC glad_glGetUniformfv; -#define glGetUniformfv glad_glGetUniformfv -GLAD_API_CALL PFNGLGETUNIFORMIVPROC glad_glGetUniformiv; -#define glGetUniformiv glad_glGetUniformiv -GLAD_API_CALL PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv; -#define glGetVertexAttribPointerv glad_glGetVertexAttribPointerv -GLAD_API_CALL PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv; -#define glGetVertexAttribfv glad_glGetVertexAttribfv -GLAD_API_CALL PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv; -#define glGetVertexAttribiv glad_glGetVertexAttribiv -GLAD_API_CALL PFNGLHINTPROC glad_glHint; -#define glHint glad_glHint -GLAD_API_CALL PFNGLISBUFFERPROC glad_glIsBuffer; -#define glIsBuffer glad_glIsBuffer -GLAD_API_CALL PFNGLISENABLEDPROC glad_glIsEnabled; -#define glIsEnabled glad_glIsEnabled -GLAD_API_CALL PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer; -#define glIsFramebuffer glad_glIsFramebuffer -GLAD_API_CALL PFNGLISPROGRAMPROC glad_glIsProgram; -#define glIsProgram glad_glIsProgram -GLAD_API_CALL PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer; -#define glIsRenderbuffer glad_glIsRenderbuffer -GLAD_API_CALL PFNGLISSHADERPROC glad_glIsShader; -#define glIsShader glad_glIsShader -GLAD_API_CALL PFNGLISTEXTUREPROC glad_glIsTexture; -#define glIsTexture glad_glIsTexture -GLAD_API_CALL PFNGLLINEWIDTHPROC glad_glLineWidth; -#define glLineWidth glad_glLineWidth -GLAD_API_CALL PFNGLLINKPROGRAMPROC glad_glLinkProgram; -#define glLinkProgram glad_glLinkProgram -GLAD_API_CALL PFNGLPIXELSTOREIPROC glad_glPixelStorei; -#define glPixelStorei glad_glPixelStorei -GLAD_API_CALL PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset; -#define glPolygonOffset glad_glPolygonOffset -GLAD_API_CALL PFNGLREADPIXELSPROC glad_glReadPixels; -#define glReadPixels glad_glReadPixels -GLAD_API_CALL PFNGLRELEASESHADERCOMPILERPROC glad_glReleaseShaderCompiler; -#define glReleaseShaderCompiler glad_glReleaseShaderCompiler -GLAD_API_CALL PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage; -#define glRenderbufferStorage glad_glRenderbufferStorage -GLAD_API_CALL PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage; -#define glSampleCoverage glad_glSampleCoverage -GLAD_API_CALL PFNGLSCISSORPROC glad_glScissor; -#define glScissor glad_glScissor -GLAD_API_CALL PFNGLSHADERBINARYPROC glad_glShaderBinary; -#define glShaderBinary glad_glShaderBinary -GLAD_API_CALL PFNGLSHADERSOURCEPROC glad_glShaderSource; -#define glShaderSource glad_glShaderSource -GLAD_API_CALL PFNGLSTENCILFUNCPROC glad_glStencilFunc; -#define glStencilFunc glad_glStencilFunc -GLAD_API_CALL PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate; -#define glStencilFuncSeparate glad_glStencilFuncSeparate -GLAD_API_CALL PFNGLSTENCILMASKPROC glad_glStencilMask; -#define glStencilMask glad_glStencilMask -GLAD_API_CALL PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate; -#define glStencilMaskSeparate glad_glStencilMaskSeparate -GLAD_API_CALL PFNGLSTENCILOPPROC glad_glStencilOp; -#define glStencilOp glad_glStencilOp -GLAD_API_CALL PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate; -#define glStencilOpSeparate glad_glStencilOpSeparate -GLAD_API_CALL PFNGLTEXIMAGE2DPROC glad_glTexImage2D; -#define glTexImage2D glad_glTexImage2D -GLAD_API_CALL PFNGLTEXPARAMETERFPROC glad_glTexParameterf; -#define glTexParameterf glad_glTexParameterf -GLAD_API_CALL PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv; -#define glTexParameterfv glad_glTexParameterfv -GLAD_API_CALL PFNGLTEXPARAMETERIPROC glad_glTexParameteri; -#define glTexParameteri glad_glTexParameteri -GLAD_API_CALL PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv; -#define glTexParameteriv glad_glTexParameteriv -GLAD_API_CALL PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D; -#define glTexSubImage2D glad_glTexSubImage2D -GLAD_API_CALL PFNGLUNIFORM1FPROC glad_glUniform1f; -#define glUniform1f glad_glUniform1f -GLAD_API_CALL PFNGLUNIFORM1FVPROC glad_glUniform1fv; -#define glUniform1fv glad_glUniform1fv -GLAD_API_CALL PFNGLUNIFORM1IPROC glad_glUniform1i; -#define glUniform1i glad_glUniform1i -GLAD_API_CALL PFNGLUNIFORM1IVPROC glad_glUniform1iv; -#define glUniform1iv glad_glUniform1iv -GLAD_API_CALL PFNGLUNIFORM2FPROC glad_glUniform2f; -#define glUniform2f glad_glUniform2f -GLAD_API_CALL PFNGLUNIFORM2FVPROC glad_glUniform2fv; -#define glUniform2fv glad_glUniform2fv -GLAD_API_CALL PFNGLUNIFORM2IPROC glad_glUniform2i; -#define glUniform2i glad_glUniform2i -GLAD_API_CALL PFNGLUNIFORM2IVPROC glad_glUniform2iv; -#define glUniform2iv glad_glUniform2iv -GLAD_API_CALL PFNGLUNIFORM3FPROC glad_glUniform3f; -#define glUniform3f glad_glUniform3f -GLAD_API_CALL PFNGLUNIFORM3FVPROC glad_glUniform3fv; -#define glUniform3fv glad_glUniform3fv -GLAD_API_CALL PFNGLUNIFORM3IPROC glad_glUniform3i; -#define glUniform3i glad_glUniform3i -GLAD_API_CALL PFNGLUNIFORM3IVPROC glad_glUniform3iv; -#define glUniform3iv glad_glUniform3iv -GLAD_API_CALL PFNGLUNIFORM4FPROC glad_glUniform4f; -#define glUniform4f glad_glUniform4f -GLAD_API_CALL PFNGLUNIFORM4FVPROC glad_glUniform4fv; -#define glUniform4fv glad_glUniform4fv -GLAD_API_CALL PFNGLUNIFORM4IPROC glad_glUniform4i; -#define glUniform4i glad_glUniform4i -GLAD_API_CALL PFNGLUNIFORM4IVPROC glad_glUniform4iv; -#define glUniform4iv glad_glUniform4iv -GLAD_API_CALL PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv; -#define glUniformMatrix2fv glad_glUniformMatrix2fv -GLAD_API_CALL PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv; -#define glUniformMatrix3fv glad_glUniformMatrix3fv -GLAD_API_CALL PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv; -#define glUniformMatrix4fv glad_glUniformMatrix4fv -GLAD_API_CALL PFNGLUSEPROGRAMPROC glad_glUseProgram; -#define glUseProgram glad_glUseProgram -GLAD_API_CALL PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram; -#define glValidateProgram glad_glValidateProgram -GLAD_API_CALL PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f; -#define glVertexAttrib1f glad_glVertexAttrib1f -GLAD_API_CALL PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv; -#define glVertexAttrib1fv glad_glVertexAttrib1fv -GLAD_API_CALL PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f; -#define glVertexAttrib2f glad_glVertexAttrib2f -GLAD_API_CALL PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv; -#define glVertexAttrib2fv glad_glVertexAttrib2fv -GLAD_API_CALL PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f; -#define glVertexAttrib3f glad_glVertexAttrib3f -GLAD_API_CALL PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv; -#define glVertexAttrib3fv glad_glVertexAttrib3fv -GLAD_API_CALL PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f; -#define glVertexAttrib4f glad_glVertexAttrib4f -GLAD_API_CALL PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv; -#define glVertexAttrib4fv glad_glVertexAttrib4fv -GLAD_API_CALL PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer; -#define glVertexAttribPointer glad_glVertexAttribPointer -GLAD_API_CALL PFNGLVIEWPORTPROC glad_glViewport; -#define glViewport glad_glViewport - - - - - -GLAD_API_CALL int gladLoadGLES2UserPtr( GLADuserptrloadfunc load, void *userptr); -GLAD_API_CALL int gladLoadGLES2( GLADloadfunc load); - - - -#ifdef __cplusplus -} -#endif -#endif - -/* Source */ -#ifdef GLAD_GLES2_IMPLEMENTATION -#include -#include -#include - -#ifndef GLAD_IMPL_UTIL_C_ -#define GLAD_IMPL_UTIL_C_ - -#ifdef _MSC_VER -#define GLAD_IMPL_UTIL_SSCANF sscanf_s -#else -#define GLAD_IMPL_UTIL_SSCANF sscanf -#endif - -#endif /* GLAD_IMPL_UTIL_C_ */ - -#ifdef __cplusplus -extern "C" { -#endif - - - -int GLAD_GL_ES_VERSION_2_0 = 0; - - - -PFNGLACTIVETEXTUREPROC glad_glActiveTexture = NULL; -PFNGLATTACHSHADERPROC glad_glAttachShader = NULL; -PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation = NULL; -PFNGLBINDBUFFERPROC glad_glBindBuffer = NULL; -PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer = NULL; -PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer = NULL; -PFNGLBINDTEXTUREPROC glad_glBindTexture = NULL; -PFNGLBLENDCOLORPROC glad_glBlendColor = NULL; -PFNGLBLENDEQUATIONPROC glad_glBlendEquation = NULL; -PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate = NULL; -PFNGLBLENDFUNCPROC glad_glBlendFunc = NULL; -PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate = NULL; -PFNGLBUFFERDATAPROC glad_glBufferData = NULL; -PFNGLBUFFERSUBDATAPROC glad_glBufferSubData = NULL; -PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus = NULL; -PFNGLCLEARPROC glad_glClear = NULL; -PFNGLCLEARCOLORPROC glad_glClearColor = NULL; -PFNGLCLEARDEPTHFPROC glad_glClearDepthf = NULL; -PFNGLCLEARSTENCILPROC glad_glClearStencil = NULL; -PFNGLCOLORMASKPROC glad_glColorMask = NULL; -PFNGLCOMPILESHADERPROC glad_glCompileShader = NULL; -PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D = NULL; -PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D = NULL; -PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D = NULL; -PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D = NULL; -PFNGLCREATEPROGRAMPROC glad_glCreateProgram = NULL; -PFNGLCREATESHADERPROC glad_glCreateShader = NULL; -PFNGLCULLFACEPROC glad_glCullFace = NULL; -PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers = NULL; -PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers = NULL; -PFNGLDELETEPROGRAMPROC glad_glDeleteProgram = NULL; -PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers = NULL; -PFNGLDELETESHADERPROC glad_glDeleteShader = NULL; -PFNGLDELETETEXTURESPROC glad_glDeleteTextures = NULL; -PFNGLDEPTHFUNCPROC glad_glDepthFunc = NULL; -PFNGLDEPTHMASKPROC glad_glDepthMask = NULL; -PFNGLDEPTHRANGEFPROC glad_glDepthRangef = NULL; -PFNGLDETACHSHADERPROC glad_glDetachShader = NULL; -PFNGLDISABLEPROC glad_glDisable = NULL; -PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray = NULL; -PFNGLDRAWARRAYSPROC glad_glDrawArrays = NULL; -PFNGLDRAWELEMENTSPROC glad_glDrawElements = NULL; -PFNGLENABLEPROC glad_glEnable = NULL; -PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray = NULL; -PFNGLFINISHPROC glad_glFinish = NULL; -PFNGLFLUSHPROC glad_glFlush = NULL; -PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer = NULL; -PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D = NULL; -PFNGLFRONTFACEPROC glad_glFrontFace = NULL; -PFNGLGENBUFFERSPROC glad_glGenBuffers = NULL; -PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers = NULL; -PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers = NULL; -PFNGLGENTEXTURESPROC glad_glGenTextures = NULL; -PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap = NULL; -PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib = NULL; -PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform = NULL; -PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders = NULL; -PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation = NULL; -PFNGLGETBOOLEANVPROC glad_glGetBooleanv = NULL; -PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv = NULL; -PFNGLGETERRORPROC glad_glGetError = NULL; -PFNGLGETFLOATVPROC glad_glGetFloatv = NULL; -PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv = NULL; -PFNGLGETINTEGERVPROC glad_glGetIntegerv = NULL; -PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog = NULL; -PFNGLGETPROGRAMIVPROC glad_glGetProgramiv = NULL; -PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv = NULL; -PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog = NULL; -PFNGLGETSHADERPRECISIONFORMATPROC glad_glGetShaderPrecisionFormat = NULL; -PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource = NULL; -PFNGLGETSHADERIVPROC glad_glGetShaderiv = NULL; -PFNGLGETSTRINGPROC glad_glGetString = NULL; -PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv = NULL; -PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv = NULL; -PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation = NULL; -PFNGLGETUNIFORMFVPROC glad_glGetUniformfv = NULL; -PFNGLGETUNIFORMIVPROC glad_glGetUniformiv = NULL; -PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv = NULL; -PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv = NULL; -PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv = NULL; -PFNGLHINTPROC glad_glHint = NULL; -PFNGLISBUFFERPROC glad_glIsBuffer = NULL; -PFNGLISENABLEDPROC glad_glIsEnabled = NULL; -PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer = NULL; -PFNGLISPROGRAMPROC glad_glIsProgram = NULL; -PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer = NULL; -PFNGLISSHADERPROC glad_glIsShader = NULL; -PFNGLISTEXTUREPROC glad_glIsTexture = NULL; -PFNGLLINEWIDTHPROC glad_glLineWidth = NULL; -PFNGLLINKPROGRAMPROC glad_glLinkProgram = NULL; -PFNGLPIXELSTOREIPROC glad_glPixelStorei = NULL; -PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset = NULL; -PFNGLREADPIXELSPROC glad_glReadPixels = NULL; -PFNGLRELEASESHADERCOMPILERPROC glad_glReleaseShaderCompiler = NULL; -PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage = NULL; -PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage = NULL; -PFNGLSCISSORPROC glad_glScissor = NULL; -PFNGLSHADERBINARYPROC glad_glShaderBinary = NULL; -PFNGLSHADERSOURCEPROC glad_glShaderSource = NULL; -PFNGLSTENCILFUNCPROC glad_glStencilFunc = NULL; -PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate = NULL; -PFNGLSTENCILMASKPROC glad_glStencilMask = NULL; -PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate = NULL; -PFNGLSTENCILOPPROC glad_glStencilOp = NULL; -PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate = NULL; -PFNGLTEXIMAGE2DPROC glad_glTexImage2D = NULL; -PFNGLTEXPARAMETERFPROC glad_glTexParameterf = NULL; -PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv = NULL; -PFNGLTEXPARAMETERIPROC glad_glTexParameteri = NULL; -PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv = NULL; -PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D = NULL; -PFNGLUNIFORM1FPROC glad_glUniform1f = NULL; -PFNGLUNIFORM1FVPROC glad_glUniform1fv = NULL; -PFNGLUNIFORM1IPROC glad_glUniform1i = NULL; -PFNGLUNIFORM1IVPROC glad_glUniform1iv = NULL; -PFNGLUNIFORM2FPROC glad_glUniform2f = NULL; -PFNGLUNIFORM2FVPROC glad_glUniform2fv = NULL; -PFNGLUNIFORM2IPROC glad_glUniform2i = NULL; -PFNGLUNIFORM2IVPROC glad_glUniform2iv = NULL; -PFNGLUNIFORM3FPROC glad_glUniform3f = NULL; -PFNGLUNIFORM3FVPROC glad_glUniform3fv = NULL; -PFNGLUNIFORM3IPROC glad_glUniform3i = NULL; -PFNGLUNIFORM3IVPROC glad_glUniform3iv = NULL; -PFNGLUNIFORM4FPROC glad_glUniform4f = NULL; -PFNGLUNIFORM4FVPROC glad_glUniform4fv = NULL; -PFNGLUNIFORM4IPROC glad_glUniform4i = NULL; -PFNGLUNIFORM4IVPROC glad_glUniform4iv = NULL; -PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv = NULL; -PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv = NULL; -PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv = NULL; -PFNGLUSEPROGRAMPROC glad_glUseProgram = NULL; -PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram = NULL; -PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f = NULL; -PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv = NULL; -PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f = NULL; -PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv = NULL; -PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f = NULL; -PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv = NULL; -PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f = NULL; -PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv = NULL; -PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer = NULL; -PFNGLVIEWPORTPROC glad_glViewport = NULL; - - -static void glad_gl_load_GL_ES_VERSION_2_0( GLADuserptrloadfunc load, void* userptr) { - if(!GLAD_GL_ES_VERSION_2_0) return; - glad_glActiveTexture = (PFNGLACTIVETEXTUREPROC) load(userptr, "glActiveTexture"); - glad_glAttachShader = (PFNGLATTACHSHADERPROC) load(userptr, "glAttachShader"); - glad_glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC) load(userptr, "glBindAttribLocation"); - glad_glBindBuffer = (PFNGLBINDBUFFERPROC) load(userptr, "glBindBuffer"); - glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC) load(userptr, "glBindFramebuffer"); - glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC) load(userptr, "glBindRenderbuffer"); - glad_glBindTexture = (PFNGLBINDTEXTUREPROC) load(userptr, "glBindTexture"); - glad_glBlendColor = (PFNGLBLENDCOLORPROC) load(userptr, "glBlendColor"); - glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC) load(userptr, "glBlendEquation"); - glad_glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC) load(userptr, "glBlendEquationSeparate"); - glad_glBlendFunc = (PFNGLBLENDFUNCPROC) load(userptr, "glBlendFunc"); - glad_glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC) load(userptr, "glBlendFuncSeparate"); - glad_glBufferData = (PFNGLBUFFERDATAPROC) load(userptr, "glBufferData"); - glad_glBufferSubData = (PFNGLBUFFERSUBDATAPROC) load(userptr, "glBufferSubData"); - glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC) load(userptr, "glCheckFramebufferStatus"); - glad_glClear = (PFNGLCLEARPROC) load(userptr, "glClear"); - glad_glClearColor = (PFNGLCLEARCOLORPROC) load(userptr, "glClearColor"); - glad_glClearDepthf = (PFNGLCLEARDEPTHFPROC) load(userptr, "glClearDepthf"); - glad_glClearStencil = (PFNGLCLEARSTENCILPROC) load(userptr, "glClearStencil"); - glad_glColorMask = (PFNGLCOLORMASKPROC) load(userptr, "glColorMask"); - glad_glCompileShader = (PFNGLCOMPILESHADERPROC) load(userptr, "glCompileShader"); - glad_glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC) load(userptr, "glCompressedTexImage2D"); - glad_glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) load(userptr, "glCompressedTexSubImage2D"); - glad_glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC) load(userptr, "glCopyTexImage2D"); - glad_glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC) load(userptr, "glCopyTexSubImage2D"); - glad_glCreateProgram = (PFNGLCREATEPROGRAMPROC) load(userptr, "glCreateProgram"); - glad_glCreateShader = (PFNGLCREATESHADERPROC) load(userptr, "glCreateShader"); - glad_glCullFace = (PFNGLCULLFACEPROC) load(userptr, "glCullFace"); - glad_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC) load(userptr, "glDeleteBuffers"); - glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC) load(userptr, "glDeleteFramebuffers"); - glad_glDeleteProgram = (PFNGLDELETEPROGRAMPROC) load(userptr, "glDeleteProgram"); - glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC) load(userptr, "glDeleteRenderbuffers"); - glad_glDeleteShader = (PFNGLDELETESHADERPROC) load(userptr, "glDeleteShader"); - glad_glDeleteTextures = (PFNGLDELETETEXTURESPROC) load(userptr, "glDeleteTextures"); - glad_glDepthFunc = (PFNGLDEPTHFUNCPROC) load(userptr, "glDepthFunc"); - glad_glDepthMask = (PFNGLDEPTHMASKPROC) load(userptr, "glDepthMask"); - glad_glDepthRangef = (PFNGLDEPTHRANGEFPROC) load(userptr, "glDepthRangef"); - glad_glDetachShader = (PFNGLDETACHSHADERPROC) load(userptr, "glDetachShader"); - glad_glDisable = (PFNGLDISABLEPROC) load(userptr, "glDisable"); - glad_glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC) load(userptr, "glDisableVertexAttribArray"); - glad_glDrawArrays = (PFNGLDRAWARRAYSPROC) load(userptr, "glDrawArrays"); - glad_glDrawElements = (PFNGLDRAWELEMENTSPROC) load(userptr, "glDrawElements"); - glad_glEnable = (PFNGLENABLEPROC) load(userptr, "glEnable"); - glad_glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC) load(userptr, "glEnableVertexAttribArray"); - glad_glFinish = (PFNGLFINISHPROC) load(userptr, "glFinish"); - glad_glFlush = (PFNGLFLUSHPROC) load(userptr, "glFlush"); - glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC) load(userptr, "glFramebufferRenderbuffer"); - glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC) load(userptr, "glFramebufferTexture2D"); - glad_glFrontFace = (PFNGLFRONTFACEPROC) load(userptr, "glFrontFace"); - glad_glGenBuffers = (PFNGLGENBUFFERSPROC) load(userptr, "glGenBuffers"); - glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC) load(userptr, "glGenFramebuffers"); - glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC) load(userptr, "glGenRenderbuffers"); - glad_glGenTextures = (PFNGLGENTEXTURESPROC) load(userptr, "glGenTextures"); - glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC) load(userptr, "glGenerateMipmap"); - glad_glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC) load(userptr, "glGetActiveAttrib"); - glad_glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC) load(userptr, "glGetActiveUniform"); - glad_glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC) load(userptr, "glGetAttachedShaders"); - glad_glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC) load(userptr, "glGetAttribLocation"); - glad_glGetBooleanv = (PFNGLGETBOOLEANVPROC) load(userptr, "glGetBooleanv"); - glad_glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC) load(userptr, "glGetBufferParameteriv"); - glad_glGetError = (PFNGLGETERRORPROC) load(userptr, "glGetError"); - glad_glGetFloatv = (PFNGLGETFLOATVPROC) load(userptr, "glGetFloatv"); - glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) load(userptr, "glGetFramebufferAttachmentParameteriv"); - glad_glGetIntegerv = (PFNGLGETINTEGERVPROC) load(userptr, "glGetIntegerv"); - glad_glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC) load(userptr, "glGetProgramInfoLog"); - glad_glGetProgramiv = (PFNGLGETPROGRAMIVPROC) load(userptr, "glGetProgramiv"); - glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC) load(userptr, "glGetRenderbufferParameteriv"); - glad_glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC) load(userptr, "glGetShaderInfoLog"); - glad_glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC) load(userptr, "glGetShaderPrecisionFormat"); - glad_glGetShaderSource = (PFNGLGETSHADERSOURCEPROC) load(userptr, "glGetShaderSource"); - glad_glGetShaderiv = (PFNGLGETSHADERIVPROC) load(userptr, "glGetShaderiv"); - glad_glGetString = (PFNGLGETSTRINGPROC) load(userptr, "glGetString"); - glad_glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC) load(userptr, "glGetTexParameterfv"); - glad_glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC) load(userptr, "glGetTexParameteriv"); - glad_glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC) load(userptr, "glGetUniformLocation"); - glad_glGetUniformfv = (PFNGLGETUNIFORMFVPROC) load(userptr, "glGetUniformfv"); - glad_glGetUniformiv = (PFNGLGETUNIFORMIVPROC) load(userptr, "glGetUniformiv"); - glad_glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC) load(userptr, "glGetVertexAttribPointerv"); - glad_glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC) load(userptr, "glGetVertexAttribfv"); - glad_glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC) load(userptr, "glGetVertexAttribiv"); - glad_glHint = (PFNGLHINTPROC) load(userptr, "glHint"); - glad_glIsBuffer = (PFNGLISBUFFERPROC) load(userptr, "glIsBuffer"); - glad_glIsEnabled = (PFNGLISENABLEDPROC) load(userptr, "glIsEnabled"); - glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC) load(userptr, "glIsFramebuffer"); - glad_glIsProgram = (PFNGLISPROGRAMPROC) load(userptr, "glIsProgram"); - glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC) load(userptr, "glIsRenderbuffer"); - glad_glIsShader = (PFNGLISSHADERPROC) load(userptr, "glIsShader"); - glad_glIsTexture = (PFNGLISTEXTUREPROC) load(userptr, "glIsTexture"); - glad_glLineWidth = (PFNGLLINEWIDTHPROC) load(userptr, "glLineWidth"); - glad_glLinkProgram = (PFNGLLINKPROGRAMPROC) load(userptr, "glLinkProgram"); - glad_glPixelStorei = (PFNGLPIXELSTOREIPROC) load(userptr, "glPixelStorei"); - glad_glPolygonOffset = (PFNGLPOLYGONOFFSETPROC) load(userptr, "glPolygonOffset"); - glad_glReadPixels = (PFNGLREADPIXELSPROC) load(userptr, "glReadPixels"); - glad_glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC) load(userptr, "glReleaseShaderCompiler"); - glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC) load(userptr, "glRenderbufferStorage"); - glad_glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC) load(userptr, "glSampleCoverage"); - glad_glScissor = (PFNGLSCISSORPROC) load(userptr, "glScissor"); - glad_glShaderBinary = (PFNGLSHADERBINARYPROC) load(userptr, "glShaderBinary"); - glad_glShaderSource = (PFNGLSHADERSOURCEPROC) load(userptr, "glShaderSource"); - glad_glStencilFunc = (PFNGLSTENCILFUNCPROC) load(userptr, "glStencilFunc"); - glad_glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC) load(userptr, "glStencilFuncSeparate"); - glad_glStencilMask = (PFNGLSTENCILMASKPROC) load(userptr, "glStencilMask"); - glad_glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC) load(userptr, "glStencilMaskSeparate"); - glad_glStencilOp = (PFNGLSTENCILOPPROC) load(userptr, "glStencilOp"); - glad_glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC) load(userptr, "glStencilOpSeparate"); - glad_glTexImage2D = (PFNGLTEXIMAGE2DPROC) load(userptr, "glTexImage2D"); - glad_glTexParameterf = (PFNGLTEXPARAMETERFPROC) load(userptr, "glTexParameterf"); - glad_glTexParameterfv = (PFNGLTEXPARAMETERFVPROC) load(userptr, "glTexParameterfv"); - glad_glTexParameteri = (PFNGLTEXPARAMETERIPROC) load(userptr, "glTexParameteri"); - glad_glTexParameteriv = (PFNGLTEXPARAMETERIVPROC) load(userptr, "glTexParameteriv"); - glad_glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC) load(userptr, "glTexSubImage2D"); - glad_glUniform1f = (PFNGLUNIFORM1FPROC) load(userptr, "glUniform1f"); - glad_glUniform1fv = (PFNGLUNIFORM1FVPROC) load(userptr, "glUniform1fv"); - glad_glUniform1i = (PFNGLUNIFORM1IPROC) load(userptr, "glUniform1i"); - glad_glUniform1iv = (PFNGLUNIFORM1IVPROC) load(userptr, "glUniform1iv"); - glad_glUniform2f = (PFNGLUNIFORM2FPROC) load(userptr, "glUniform2f"); - glad_glUniform2fv = (PFNGLUNIFORM2FVPROC) load(userptr, "glUniform2fv"); - glad_glUniform2i = (PFNGLUNIFORM2IPROC) load(userptr, "glUniform2i"); - glad_glUniform2iv = (PFNGLUNIFORM2IVPROC) load(userptr, "glUniform2iv"); - glad_glUniform3f = (PFNGLUNIFORM3FPROC) load(userptr, "glUniform3f"); - glad_glUniform3fv = (PFNGLUNIFORM3FVPROC) load(userptr, "glUniform3fv"); - glad_glUniform3i = (PFNGLUNIFORM3IPROC) load(userptr, "glUniform3i"); - glad_glUniform3iv = (PFNGLUNIFORM3IVPROC) load(userptr, "glUniform3iv"); - glad_glUniform4f = (PFNGLUNIFORM4FPROC) load(userptr, "glUniform4f"); - glad_glUniform4fv = (PFNGLUNIFORM4FVPROC) load(userptr, "glUniform4fv"); - glad_glUniform4i = (PFNGLUNIFORM4IPROC) load(userptr, "glUniform4i"); - glad_glUniform4iv = (PFNGLUNIFORM4IVPROC) load(userptr, "glUniform4iv"); - glad_glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC) load(userptr, "glUniformMatrix2fv"); - glad_glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC) load(userptr, "glUniformMatrix3fv"); - glad_glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC) load(userptr, "glUniformMatrix4fv"); - glad_glUseProgram = (PFNGLUSEPROGRAMPROC) load(userptr, "glUseProgram"); - glad_glValidateProgram = (PFNGLVALIDATEPROGRAMPROC) load(userptr, "glValidateProgram"); - glad_glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC) load(userptr, "glVertexAttrib1f"); - glad_glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC) load(userptr, "glVertexAttrib1fv"); - glad_glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC) load(userptr, "glVertexAttrib2f"); - glad_glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC) load(userptr, "glVertexAttrib2fv"); - glad_glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC) load(userptr, "glVertexAttrib3f"); - glad_glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC) load(userptr, "glVertexAttrib3fv"); - glad_glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC) load(userptr, "glVertexAttrib4f"); - glad_glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC) load(userptr, "glVertexAttrib4fv"); - glad_glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC) load(userptr, "glVertexAttribPointer"); - glad_glViewport = (PFNGLVIEWPORTPROC) load(userptr, "glViewport"); -} - - - -#if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0) -#define GLAD_GL_IS_SOME_NEW_VERSION 1 -#else -#define GLAD_GL_IS_SOME_NEW_VERSION 0 -#endif - -static int glad_gl_get_extensions( int version, const char **out_exts, unsigned int *out_num_exts_i, char ***out_exts_i) { -#if GLAD_GL_IS_SOME_NEW_VERSION - if(GLAD_VERSION_MAJOR(version) < 3) { -#else - (void) version; - (void) out_num_exts_i; - (void) out_exts_i; -#endif - if (glad_glGetString == NULL) { - return 0; - } - *out_exts = (const char *)glad_glGetString(GL_EXTENSIONS); -#if GLAD_GL_IS_SOME_NEW_VERSION - } else { - unsigned int index = 0; - unsigned int num_exts_i = 0; - char **exts_i = NULL; - if (glad_glGetStringi == NULL || glad_glGetIntegerv == NULL) { - return 0; - } - glad_glGetIntegerv(GL_NUM_EXTENSIONS, (int*) &num_exts_i); - if (num_exts_i > 0) { - exts_i = (char **) malloc(num_exts_i * (sizeof *exts_i)); - } - if (exts_i == NULL) { - return 0; - } - for(index = 0; index < num_exts_i; index++) { - const char *gl_str_tmp = (const char*) glad_glGetStringi(GL_EXTENSIONS, index); - size_t len = strlen(gl_str_tmp) + 1; - - char *local_str = (char*) malloc(len * sizeof(char)); - if(local_str != NULL) { - memcpy(local_str, gl_str_tmp, len * sizeof(char)); - } - - exts_i[index] = local_str; - } - - *out_num_exts_i = num_exts_i; - *out_exts_i = exts_i; - } -#endif - return 1; -} -static void glad_gl_free_extensions(char **exts_i, unsigned int num_exts_i) { - if (exts_i != NULL) { - unsigned int index; - for(index = 0; index < num_exts_i; index++) { - free((void *) (exts_i[index])); - } - free((void *)exts_i); - exts_i = NULL; - } -} -static int glad_gl_has_extension(int version, const char *exts, unsigned int num_exts_i, char **exts_i, const char *ext) { - if(GLAD_VERSION_MAJOR(version) < 3 || !GLAD_GL_IS_SOME_NEW_VERSION) { - const char *extensions; - const char *loc; - const char *terminator; - extensions = exts; - if(extensions == NULL || ext == NULL) { - return 0; - } - while(1) { - loc = strstr(extensions, ext); - if(loc == NULL) { - return 0; - } - terminator = loc + strlen(ext); - if((loc == extensions || *(loc - 1) == ' ') && - (*terminator == ' ' || *terminator == '\0')) { - return 1; - } - extensions = terminator; - } - } else { - unsigned int index; - for(index = 0; index < num_exts_i; index++) { - const char *e = exts_i[index]; - if(strcmp(e, ext) == 0) { - return 1; - } - } - } - return 0; -} - -static GLADapiproc glad_gl_get_proc_from_userptr(void *userptr, const char* name) { - return (GLAD_GNUC_EXTENSION (GLADapiproc (*)(const char *name)) userptr)(name); -} - -static int glad_gl_find_extensions_gles2( int version) { - const char *exts = NULL; - unsigned int num_exts_i = 0; - char **exts_i = NULL; - if (!glad_gl_get_extensions(version, &exts, &num_exts_i, &exts_i)) return 0; - - (void) glad_gl_has_extension; - - glad_gl_free_extensions(exts_i, num_exts_i); - - return 1; -} - -static int glad_gl_find_core_gles2(void) { - int i; - const char* version; - const char* prefixes[] = { - "OpenGL ES-CM ", - "OpenGL ES-CL ", - "OpenGL ES ", - "OpenGL SC ", - NULL - }; - int major = 0; - int minor = 0; - version = (const char*) glad_glGetString(GL_VERSION); - if (!version) return 0; - for (i = 0; prefixes[i]; i++) { - const size_t length = strlen(prefixes[i]); - if (strncmp(version, prefixes[i], length) == 0) { - version += length; - break; - } - } - - GLAD_IMPL_UTIL_SSCANF(version, "%d.%d", &major, &minor); - - GLAD_GL_ES_VERSION_2_0 = (major == 2 && minor >= 0) || major > 2; - - return GLAD_MAKE_VERSION(major, minor); -} - -int gladLoadGLES2UserPtr( GLADuserptrloadfunc load, void *userptr) { - int version; - - glad_glGetString = (PFNGLGETSTRINGPROC) load(userptr, "glGetString"); - if(glad_glGetString == NULL) return 0; - if(glad_glGetString(GL_VERSION) == NULL) return 0; - version = glad_gl_find_core_gles2(); - - glad_gl_load_GL_ES_VERSION_2_0(load, userptr); - - if (!glad_gl_find_extensions_gles2(version)) return 0; - - - - return version; -} - - -int gladLoadGLES2( GLADloadfunc load) { - return gladLoadGLES2UserPtr( glad_gl_get_proc_from_userptr, GLAD_GNUC_EXTENSION (void*) load); -} - - - - - - -#ifdef __cplusplus -} -#endif - -#endif /* GLAD_GLES2_IMPLEMENTATION */ - diff --git a/3rdparty/glfw/source/deps/glad/vulkan.h b/3rdparty/glfw/source/deps/glad/vulkan.h deleted file mode 100644 index 9e78dad..0000000 --- a/3rdparty/glfw/source/deps/glad/vulkan.h +++ /dev/null @@ -1,4612 +0,0 @@ -/** - * Loader generated by glad 2.0.0-beta on Wed Aug 25 21:20:29 2021 - * - * Generator: C/C++ - * Specification: vk - * Extensions: 3 - * - * APIs: - * - vulkan=1.1 - * - * Options: - * - ALIAS = False - * - DEBUG = False - * - HEADER_ONLY = True - * - LOADER = False - * - MX = False - * - MX_GLOBAL = False - * - ON_DEMAND = False - * - * Commandline: - * --api='vulkan=1.1' --extensions='VK_EXT_debug_report,VK_KHR_surface,VK_KHR_swapchain' c --header-only - * - * Online: - * http://glad.sh/#api=vulkan%3D1.1&extensions=VK_EXT_debug_report%2CVK_KHR_surface%2CVK_KHR_swapchain&generator=c&options=HEADER_ONLY - * - */ - -#ifndef GLAD_VULKAN_H_ -#define GLAD_VULKAN_H_ - -#ifdef VULKAN_H_ - #error header already included (API: vulkan), remove previous include! -#endif -#define VULKAN_H_ 1 - -#ifdef VULKAN_CORE_H_ - #error header already included (API: vulkan), remove previous include! -#endif -#define VULKAN_CORE_H_ 1 - - -#define GLAD_VULKAN -#define GLAD_OPTION_VULKAN_HEADER_ONLY - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef GLAD_PLATFORM_H_ -#define GLAD_PLATFORM_H_ - -#ifndef GLAD_PLATFORM_WIN32 - #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__MINGW32__) - #define GLAD_PLATFORM_WIN32 1 - #else - #define GLAD_PLATFORM_WIN32 0 - #endif -#endif - -#ifndef GLAD_PLATFORM_APPLE - #ifdef __APPLE__ - #define GLAD_PLATFORM_APPLE 1 - #else - #define GLAD_PLATFORM_APPLE 0 - #endif -#endif - -#ifndef GLAD_PLATFORM_EMSCRIPTEN - #ifdef __EMSCRIPTEN__ - #define GLAD_PLATFORM_EMSCRIPTEN 1 - #else - #define GLAD_PLATFORM_EMSCRIPTEN 0 - #endif -#endif - -#ifndef GLAD_PLATFORM_UWP - #if defined(_MSC_VER) && !defined(GLAD_INTERNAL_HAVE_WINAPIFAMILY) - #ifdef __has_include - #if __has_include() - #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1 - #endif - #elif _MSC_VER >= 1700 && !_USING_V110_SDK71_ - #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1 - #endif - #endif - - #ifdef GLAD_INTERNAL_HAVE_WINAPIFAMILY - #include - #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) - #define GLAD_PLATFORM_UWP 1 - #endif - #endif - - #ifndef GLAD_PLATFORM_UWP - #define GLAD_PLATFORM_UWP 0 - #endif -#endif - -#ifdef __GNUC__ - #define GLAD_GNUC_EXTENSION __extension__ -#else - #define GLAD_GNUC_EXTENSION -#endif - -#ifndef GLAD_API_CALL - #if defined(GLAD_API_CALL_EXPORT) - #if GLAD_PLATFORM_WIN32 || defined(__CYGWIN__) - #if defined(GLAD_API_CALL_EXPORT_BUILD) - #if defined(__GNUC__) - #define GLAD_API_CALL __attribute__ ((dllexport)) extern - #else - #define GLAD_API_CALL __declspec(dllexport) extern - #endif - #else - #if defined(__GNUC__) - #define GLAD_API_CALL __attribute__ ((dllimport)) extern - #else - #define GLAD_API_CALL __declspec(dllimport) extern - #endif - #endif - #elif defined(__GNUC__) && defined(GLAD_API_CALL_EXPORT_BUILD) - #define GLAD_API_CALL __attribute__ ((visibility ("default"))) extern - #else - #define GLAD_API_CALL extern - #endif - #else - #define GLAD_API_CALL extern - #endif -#endif - -#ifdef APIENTRY - #define GLAD_API_PTR APIENTRY -#elif GLAD_PLATFORM_WIN32 - #define GLAD_API_PTR __stdcall -#else - #define GLAD_API_PTR -#endif - -#ifndef GLAPI -#define GLAPI GLAD_API_CALL -#endif - -#ifndef GLAPIENTRY -#define GLAPIENTRY GLAD_API_PTR -#endif - -#define GLAD_MAKE_VERSION(major, minor) (major * 10000 + minor) -#define GLAD_VERSION_MAJOR(version) (version / 10000) -#define GLAD_VERSION_MINOR(version) (version % 10000) - -#define GLAD_GENERATOR_VERSION "2.0.0-beta" - -typedef void (*GLADapiproc)(void); - -typedef GLADapiproc (*GLADloadfunc)(const char *name); -typedef GLADapiproc (*GLADuserptrloadfunc)(void *userptr, const char *name); - -typedef void (*GLADprecallback)(const char *name, GLADapiproc apiproc, int len_args, ...); -typedef void (*GLADpostcallback)(void *ret, const char *name, GLADapiproc apiproc, int len_args, ...); - -#endif /* GLAD_PLATFORM_H_ */ - -#define VK_ATTACHMENT_UNUSED (~0U) -#define VK_EXT_DEBUG_REPORT_EXTENSION_NAME "VK_EXT_debug_report" -#define VK_EXT_DEBUG_REPORT_SPEC_VERSION 9 -#define VK_FALSE 0 -#define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface" -#define VK_KHR_SURFACE_SPEC_VERSION 25 -#define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain" -#define VK_KHR_SWAPCHAIN_SPEC_VERSION 70 -#define VK_LOD_CLAMP_NONE 1000.0f -#define VK_LUID_SIZE 8 -#define VK_MAX_DESCRIPTION_SIZE 256 -#define VK_MAX_DEVICE_GROUP_SIZE 32 -#define VK_MAX_EXTENSION_NAME_SIZE 256 -#define VK_MAX_MEMORY_HEAPS 16 -#define VK_MAX_MEMORY_TYPES 32 -#define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256 -#define VK_QUEUE_FAMILY_EXTERNAL (~0U-1) -#define VK_QUEUE_FAMILY_IGNORED (~0U) -#define VK_REMAINING_ARRAY_LAYERS (~0U) -#define VK_REMAINING_MIP_LEVELS (~0U) -#define VK_SUBPASS_EXTERNAL (~0U) -#define VK_TRUE 1 -#define VK_UUID_SIZE 16 -#define VK_WHOLE_SIZE (~0ULL) - - -/* */ -/* File: vk_platform.h */ -/* */ -/* -** Copyright (c) 2014-2020 The Khronos Group Inc. -** -** SPDX-License-Identifier: Apache-2.0 -*/ - - -#ifndef VK_PLATFORM_H_ -#define VK_PLATFORM_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/* -*************************************************************************************************** -* Platform-specific directives and type declarations -*************************************************************************************************** -*/ - -/* Platform-specific calling convention macros. - * - * Platforms should define these so that Vulkan clients call Vulkan commands - * with the same calling conventions that the Vulkan implementation expects. - * - * VKAPI_ATTR - Placed before the return type in function declarations. - * Useful for C++11 and GCC/Clang-style function attribute syntax. - * VKAPI_CALL - Placed after the return type in function declarations. - * Useful for MSVC-style calling convention syntax. - * VKAPI_PTR - Placed between the '(' and '*' in function pointer types. - * - * Function declaration: VKAPI_ATTR void VKAPI_CALL vkCommand(void); - * Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void); - */ -#if defined(_WIN32) - /* On Windows, Vulkan commands use the stdcall convention */ - #define VKAPI_ATTR - #define VKAPI_CALL __stdcall - #define VKAPI_PTR VKAPI_CALL -#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7 - #error "Vulkan isn't supported for the 'armeabi' NDK ABI" -#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE) - /* On Android 32-bit ARM targets, Vulkan functions use the "hardfloat" */ - /* calling convention, i.e. float parameters are passed in registers. This */ - /* is true even if the rest of the application passes floats on the stack, */ - /* as it does by default when compiling for the armeabi-v7a NDK ABI. */ - #define VKAPI_ATTR __attribute__((pcs("aapcs-vfp"))) - #define VKAPI_CALL - #define VKAPI_PTR VKAPI_ATTR -#else - /* On other platforms, use the default calling convention */ - #define VKAPI_ATTR - #define VKAPI_CALL - #define VKAPI_PTR -#endif - -#include - -#if !defined(VK_NO_STDINT_H) - #if defined(_MSC_VER) && (_MSC_VER < 1600) - typedef signed __int8 int8_t; - typedef unsigned __int8 uint8_t; - typedef signed __int16 int16_t; - typedef unsigned __int16 uint16_t; - typedef signed __int32 int32_t; - typedef unsigned __int32 uint32_t; - typedef signed __int64 int64_t; - typedef unsigned __int64 uint64_t; - #else - #include - #endif -#endif /* !defined(VK_NO_STDINT_H) */ - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ - -#endif - -#define VK_MAKE_VERSION(major, minor, patch) \ - ((((uint32_t)(major)) << 22) | (((uint32_t)(minor)) << 12) | ((uint32_t)(patch))) - -#define VK_VERSION_MAJOR(version) ((uint32_t)(version) >> 22) - -#define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff) - -#define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xfff) - -/* DEPRECATED: This define has been removed. Specific version defines (e.g. VK_API_VERSION_1_0), or the VK_MAKE_VERSION macro, should be used instead. */ -/*#define VK_API_VERSION VK_MAKE_VERSION(1, 0, 0) // Patch version should always be set to 0 */ - -/* Vulkan 1.0 version number */ -#define VK_API_VERSION_1_0 VK_MAKE_VERSION(1, 0, 0)/* Patch version should always be set to 0 */ - -/* Vulkan 1.1 version number */ -#define VK_API_VERSION_1_1 VK_MAKE_VERSION(1, 1, 0)/* Patch version should always be set to 0 */ - -/* Version of this file */ -#define VK_HEADER_VERSION 152 - -/* Complete version of this file */ -#define VK_HEADER_VERSION_COMPLETE VK_MAKE_VERSION(1, 2, VK_HEADER_VERSION) - -#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object; - -#if !defined(VK_DEFINE_NON_DISPATCHABLE_HANDLE) -#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) - #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object; -#else - #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object; -#endif -#endif - -#define VK_NULL_HANDLE 0 - - - - - - - - - -VK_DEFINE_HANDLE(VkInstance) - -VK_DEFINE_HANDLE(VkPhysicalDevice) - -VK_DEFINE_HANDLE(VkDevice) - -VK_DEFINE_HANDLE(VkQueue) - -VK_DEFINE_HANDLE(VkCommandBuffer) - -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDeviceMemory) - -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCommandPool) - -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBuffer) - -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBufferView) - -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImage) - -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImageView) - -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkShaderModule) - -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipeline) - -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineLayout) - -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSampler) - -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSet) - -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSetLayout) - -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorPool) - -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFence) - -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSemaphore) - -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkEvent) - -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkQueryPool) - -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFramebuffer) - -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkRenderPass) - -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineCache) - -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorUpdateTemplate) - -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSamplerYcbcrConversion) - -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) - -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSwapchainKHR) - -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT) - -typedef enum VkAttachmentLoadOp { - VK_ATTACHMENT_LOAD_OP_LOAD = 0, - VK_ATTACHMENT_LOAD_OP_CLEAR = 1, - VK_ATTACHMENT_LOAD_OP_DONT_CARE = 2 -} VkAttachmentLoadOp; - -typedef enum VkAttachmentStoreOp { - VK_ATTACHMENT_STORE_OP_STORE = 0, - VK_ATTACHMENT_STORE_OP_DONT_CARE = 1 -} VkAttachmentStoreOp; - -typedef enum VkBlendFactor { - VK_BLEND_FACTOR_ZERO = 0, - VK_BLEND_FACTOR_ONE = 1, - VK_BLEND_FACTOR_SRC_COLOR = 2, - VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 3, - VK_BLEND_FACTOR_DST_COLOR = 4, - VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 5, - VK_BLEND_FACTOR_SRC_ALPHA = 6, - VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 7, - VK_BLEND_FACTOR_DST_ALPHA = 8, - VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 9, - VK_BLEND_FACTOR_CONSTANT_COLOR = 10, - VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 11, - VK_BLEND_FACTOR_CONSTANT_ALPHA = 12, - VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 13, - VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 14, - VK_BLEND_FACTOR_SRC1_COLOR = 15, - VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 16, - VK_BLEND_FACTOR_SRC1_ALPHA = 17, - VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 18 -} VkBlendFactor; - -typedef enum VkBlendOp { - VK_BLEND_OP_ADD = 0, - VK_BLEND_OP_SUBTRACT = 1, - VK_BLEND_OP_REVERSE_SUBTRACT = 2, - VK_BLEND_OP_MIN = 3, - VK_BLEND_OP_MAX = 4 -} VkBlendOp; - -typedef enum VkBorderColor { - VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0, - VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 1, - VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 2, - VK_BORDER_COLOR_INT_OPAQUE_BLACK = 3, - VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 4, - VK_BORDER_COLOR_INT_OPAQUE_WHITE = 5 -} VkBorderColor; - - - - -typedef enum VkPipelineCacheHeaderVersion { - VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1 -} VkPipelineCacheHeaderVersion; - - - - -typedef enum VkDeviceQueueCreateFlagBits { - VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT = 1 -} VkDeviceQueueCreateFlagBits; - -typedef enum VkBufferCreateFlagBits { - VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 1, - VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 2, - VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 4, - VK_BUFFER_CREATE_PROTECTED_BIT = 8 -} VkBufferCreateFlagBits; - -typedef enum VkBufferUsageFlagBits { - VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 1, - VK_BUFFER_USAGE_TRANSFER_DST_BIT = 2, - VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 4, - VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 8, - VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 16, - VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 32, - VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 64, - VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 128, - VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 256 -} VkBufferUsageFlagBits; - -typedef enum VkColorComponentFlagBits { - VK_COLOR_COMPONENT_R_BIT = 1, - VK_COLOR_COMPONENT_G_BIT = 2, - VK_COLOR_COMPONENT_B_BIT = 4, - VK_COLOR_COMPONENT_A_BIT = 8 -} VkColorComponentFlagBits; - -typedef enum VkComponentSwizzle { - VK_COMPONENT_SWIZZLE_IDENTITY = 0, - VK_COMPONENT_SWIZZLE_ZERO = 1, - VK_COMPONENT_SWIZZLE_ONE = 2, - VK_COMPONENT_SWIZZLE_R = 3, - VK_COMPONENT_SWIZZLE_G = 4, - VK_COMPONENT_SWIZZLE_B = 5, - VK_COMPONENT_SWIZZLE_A = 6 -} VkComponentSwizzle; - -typedef enum VkCommandPoolCreateFlagBits { - VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 1, - VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 2, - VK_COMMAND_POOL_CREATE_PROTECTED_BIT = 4 -} VkCommandPoolCreateFlagBits; - -typedef enum VkCommandPoolResetFlagBits { - VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 1 -} VkCommandPoolResetFlagBits; - -typedef enum VkCommandBufferResetFlagBits { - VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 1 -} VkCommandBufferResetFlagBits; - -typedef enum VkCommandBufferLevel { - VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0, - VK_COMMAND_BUFFER_LEVEL_SECONDARY = 1 -} VkCommandBufferLevel; - -typedef enum VkCommandBufferUsageFlagBits { - VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 1, - VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 2, - VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 4 -} VkCommandBufferUsageFlagBits; - -typedef enum VkCompareOp { - VK_COMPARE_OP_NEVER = 0, - VK_COMPARE_OP_LESS = 1, - VK_COMPARE_OP_EQUAL = 2, - VK_COMPARE_OP_LESS_OR_EQUAL = 3, - VK_COMPARE_OP_GREATER = 4, - VK_COMPARE_OP_NOT_EQUAL = 5, - VK_COMPARE_OP_GREATER_OR_EQUAL = 6, - VK_COMPARE_OP_ALWAYS = 7 -} VkCompareOp; - -typedef enum VkCullModeFlagBits { - VK_CULL_MODE_NONE = 0, - VK_CULL_MODE_FRONT_BIT = 1, - VK_CULL_MODE_BACK_BIT = 2, - VK_CULL_MODE_FRONT_AND_BACK = 0x00000003 -} VkCullModeFlagBits; - -typedef enum VkDescriptorType { - VK_DESCRIPTOR_TYPE_SAMPLER = 0, - VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 1, - VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 2, - VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 3, - VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 4, - VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 5, - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 6, - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 7, - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 8, - VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 9, - VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 10 -} VkDescriptorType; - -typedef enum VkDynamicState { - VK_DYNAMIC_STATE_VIEWPORT = 0, - VK_DYNAMIC_STATE_SCISSOR = 1, - VK_DYNAMIC_STATE_LINE_WIDTH = 2, - VK_DYNAMIC_STATE_DEPTH_BIAS = 3, - VK_DYNAMIC_STATE_BLEND_CONSTANTS = 4, - VK_DYNAMIC_STATE_DEPTH_BOUNDS = 5, - VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 6, - VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 7, - VK_DYNAMIC_STATE_STENCIL_REFERENCE = 8 -} VkDynamicState; - -typedef enum VkFenceCreateFlagBits { - VK_FENCE_CREATE_SIGNALED_BIT = 1 -} VkFenceCreateFlagBits; - -typedef enum VkPolygonMode { - VK_POLYGON_MODE_FILL = 0, - VK_POLYGON_MODE_LINE = 1, - VK_POLYGON_MODE_POINT = 2 -} VkPolygonMode; - -typedef enum VkFormat { - VK_FORMAT_UNDEFINED = 0, - VK_FORMAT_R4G4_UNORM_PACK8 = 1, - VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2, - VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3, - VK_FORMAT_R5G6B5_UNORM_PACK16 = 4, - VK_FORMAT_B5G6R5_UNORM_PACK16 = 5, - VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6, - VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7, - VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8, - VK_FORMAT_R8_UNORM = 9, - VK_FORMAT_R8_SNORM = 10, - VK_FORMAT_R8_USCALED = 11, - VK_FORMAT_R8_SSCALED = 12, - VK_FORMAT_R8_UINT = 13, - VK_FORMAT_R8_SINT = 14, - VK_FORMAT_R8_SRGB = 15, - VK_FORMAT_R8G8_UNORM = 16, - VK_FORMAT_R8G8_SNORM = 17, - VK_FORMAT_R8G8_USCALED = 18, - VK_FORMAT_R8G8_SSCALED = 19, - VK_FORMAT_R8G8_UINT = 20, - VK_FORMAT_R8G8_SINT = 21, - VK_FORMAT_R8G8_SRGB = 22, - VK_FORMAT_R8G8B8_UNORM = 23, - VK_FORMAT_R8G8B8_SNORM = 24, - VK_FORMAT_R8G8B8_USCALED = 25, - VK_FORMAT_R8G8B8_SSCALED = 26, - VK_FORMAT_R8G8B8_UINT = 27, - VK_FORMAT_R8G8B8_SINT = 28, - VK_FORMAT_R8G8B8_SRGB = 29, - VK_FORMAT_B8G8R8_UNORM = 30, - VK_FORMAT_B8G8R8_SNORM = 31, - VK_FORMAT_B8G8R8_USCALED = 32, - VK_FORMAT_B8G8R8_SSCALED = 33, - VK_FORMAT_B8G8R8_UINT = 34, - VK_FORMAT_B8G8R8_SINT = 35, - VK_FORMAT_B8G8R8_SRGB = 36, - VK_FORMAT_R8G8B8A8_UNORM = 37, - VK_FORMAT_R8G8B8A8_SNORM = 38, - VK_FORMAT_R8G8B8A8_USCALED = 39, - VK_FORMAT_R8G8B8A8_SSCALED = 40, - VK_FORMAT_R8G8B8A8_UINT = 41, - VK_FORMAT_R8G8B8A8_SINT = 42, - VK_FORMAT_R8G8B8A8_SRGB = 43, - VK_FORMAT_B8G8R8A8_UNORM = 44, - VK_FORMAT_B8G8R8A8_SNORM = 45, - VK_FORMAT_B8G8R8A8_USCALED = 46, - VK_FORMAT_B8G8R8A8_SSCALED = 47, - VK_FORMAT_B8G8R8A8_UINT = 48, - VK_FORMAT_B8G8R8A8_SINT = 49, - VK_FORMAT_B8G8R8A8_SRGB = 50, - VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51, - VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52, - VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53, - VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54, - VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55, - VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56, - VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57, - VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58, - VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59, - VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60, - VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61, - VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62, - VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63, - VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64, - VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65, - VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66, - VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67, - VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68, - VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69, - VK_FORMAT_R16_UNORM = 70, - VK_FORMAT_R16_SNORM = 71, - VK_FORMAT_R16_USCALED = 72, - VK_FORMAT_R16_SSCALED = 73, - VK_FORMAT_R16_UINT = 74, - VK_FORMAT_R16_SINT = 75, - VK_FORMAT_R16_SFLOAT = 76, - VK_FORMAT_R16G16_UNORM = 77, - VK_FORMAT_R16G16_SNORM = 78, - VK_FORMAT_R16G16_USCALED = 79, - VK_FORMAT_R16G16_SSCALED = 80, - VK_FORMAT_R16G16_UINT = 81, - VK_FORMAT_R16G16_SINT = 82, - VK_FORMAT_R16G16_SFLOAT = 83, - VK_FORMAT_R16G16B16_UNORM = 84, - VK_FORMAT_R16G16B16_SNORM = 85, - VK_FORMAT_R16G16B16_USCALED = 86, - VK_FORMAT_R16G16B16_SSCALED = 87, - VK_FORMAT_R16G16B16_UINT = 88, - VK_FORMAT_R16G16B16_SINT = 89, - VK_FORMAT_R16G16B16_SFLOAT = 90, - VK_FORMAT_R16G16B16A16_UNORM = 91, - VK_FORMAT_R16G16B16A16_SNORM = 92, - VK_FORMAT_R16G16B16A16_USCALED = 93, - VK_FORMAT_R16G16B16A16_SSCALED = 94, - VK_FORMAT_R16G16B16A16_UINT = 95, - VK_FORMAT_R16G16B16A16_SINT = 96, - VK_FORMAT_R16G16B16A16_SFLOAT = 97, - VK_FORMAT_R32_UINT = 98, - VK_FORMAT_R32_SINT = 99, - VK_FORMAT_R32_SFLOAT = 100, - VK_FORMAT_R32G32_UINT = 101, - VK_FORMAT_R32G32_SINT = 102, - VK_FORMAT_R32G32_SFLOAT = 103, - VK_FORMAT_R32G32B32_UINT = 104, - VK_FORMAT_R32G32B32_SINT = 105, - VK_FORMAT_R32G32B32_SFLOAT = 106, - VK_FORMAT_R32G32B32A32_UINT = 107, - VK_FORMAT_R32G32B32A32_SINT = 108, - VK_FORMAT_R32G32B32A32_SFLOAT = 109, - VK_FORMAT_R64_UINT = 110, - VK_FORMAT_R64_SINT = 111, - VK_FORMAT_R64_SFLOAT = 112, - VK_FORMAT_R64G64_UINT = 113, - VK_FORMAT_R64G64_SINT = 114, - VK_FORMAT_R64G64_SFLOAT = 115, - VK_FORMAT_R64G64B64_UINT = 116, - VK_FORMAT_R64G64B64_SINT = 117, - VK_FORMAT_R64G64B64_SFLOAT = 118, - VK_FORMAT_R64G64B64A64_UINT = 119, - VK_FORMAT_R64G64B64A64_SINT = 120, - VK_FORMAT_R64G64B64A64_SFLOAT = 121, - VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122, - VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123, - VK_FORMAT_D16_UNORM = 124, - VK_FORMAT_X8_D24_UNORM_PACK32 = 125, - VK_FORMAT_D32_SFLOAT = 126, - VK_FORMAT_S8_UINT = 127, - VK_FORMAT_D16_UNORM_S8_UINT = 128, - VK_FORMAT_D24_UNORM_S8_UINT = 129, - VK_FORMAT_D32_SFLOAT_S8_UINT = 130, - VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131, - VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132, - VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133, - VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134, - VK_FORMAT_BC2_UNORM_BLOCK = 135, - VK_FORMAT_BC2_SRGB_BLOCK = 136, - VK_FORMAT_BC3_UNORM_BLOCK = 137, - VK_FORMAT_BC3_SRGB_BLOCK = 138, - VK_FORMAT_BC4_UNORM_BLOCK = 139, - VK_FORMAT_BC4_SNORM_BLOCK = 140, - VK_FORMAT_BC5_UNORM_BLOCK = 141, - VK_FORMAT_BC5_SNORM_BLOCK = 142, - VK_FORMAT_BC6H_UFLOAT_BLOCK = 143, - VK_FORMAT_BC6H_SFLOAT_BLOCK = 144, - VK_FORMAT_BC7_UNORM_BLOCK = 145, - VK_FORMAT_BC7_SRGB_BLOCK = 146, - VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147, - VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148, - VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149, - VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150, - VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151, - VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152, - VK_FORMAT_EAC_R11_UNORM_BLOCK = 153, - VK_FORMAT_EAC_R11_SNORM_BLOCK = 154, - VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155, - VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156, - VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157, - VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158, - VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159, - VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160, - VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161, - VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162, - VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163, - VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164, - VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165, - VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166, - VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167, - VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168, - VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169, - VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170, - VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171, - VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172, - VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173, - VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174, - VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175, - VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176, - VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177, - VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178, - VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179, - VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180, - VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181, - VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182, - VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183, - VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184, - VK_FORMAT_G8B8G8R8_422_UNORM = 1000156000, - VK_FORMAT_B8G8R8G8_422_UNORM = 1000156001, - VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM = 1000156002, - VK_FORMAT_G8_B8R8_2PLANE_420_UNORM = 1000156003, - VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM = 1000156004, - VK_FORMAT_G8_B8R8_2PLANE_422_UNORM = 1000156005, - VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM = 1000156006, - VK_FORMAT_R10X6_UNORM_PACK16 = 1000156007, - VK_FORMAT_R10X6G10X6_UNORM_2PACK16 = 1000156008, - VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16 = 1000156009, - VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16 = 1000156010, - VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16 = 1000156011, - VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16 = 1000156012, - VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16 = 1000156013, - VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16 = 1000156014, - VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16 = 1000156015, - VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16 = 1000156016, - VK_FORMAT_R12X4_UNORM_PACK16 = 1000156017, - VK_FORMAT_R12X4G12X4_UNORM_2PACK16 = 1000156018, - VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16 = 1000156019, - VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16 = 1000156020, - VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16 = 1000156021, - VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16 = 1000156022, - VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16 = 1000156023, - VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16 = 1000156024, - VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16 = 1000156025, - VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16 = 1000156026, - VK_FORMAT_G16B16G16R16_422_UNORM = 1000156027, - VK_FORMAT_B16G16R16G16_422_UNORM = 1000156028, - VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM = 1000156029, - VK_FORMAT_G16_B16R16_2PLANE_420_UNORM = 1000156030, - VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM = 1000156031, - VK_FORMAT_G16_B16R16_2PLANE_422_UNORM = 1000156032, - VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM = 1000156033 -} VkFormat; - -typedef enum VkFormatFeatureFlagBits { - VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 1, - VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 2, - VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 4, - VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 8, - VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 16, - VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 32, - VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 64, - VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 128, - VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 256, - VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 512, - VK_FORMAT_FEATURE_BLIT_SRC_BIT = 1024, - VK_FORMAT_FEATURE_BLIT_DST_BIT = 2048, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 4096, - VK_FORMAT_FEATURE_TRANSFER_SRC_BIT = 16384, - VK_FORMAT_FEATURE_TRANSFER_DST_BIT = 32768, - VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT = 131072, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT = 262144, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT = 524288, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT = 1048576, - VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT = 2097152, - VK_FORMAT_FEATURE_DISJOINT_BIT = 4194304, - VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT = 8388608 -} VkFormatFeatureFlagBits; - -typedef enum VkFrontFace { - VK_FRONT_FACE_COUNTER_CLOCKWISE = 0, - VK_FRONT_FACE_CLOCKWISE = 1 -} VkFrontFace; - -typedef enum VkImageAspectFlagBits { - VK_IMAGE_ASPECT_COLOR_BIT = 1, - VK_IMAGE_ASPECT_DEPTH_BIT = 2, - VK_IMAGE_ASPECT_STENCIL_BIT = 4, - VK_IMAGE_ASPECT_METADATA_BIT = 8, - VK_IMAGE_ASPECT_PLANE_0_BIT = 16, - VK_IMAGE_ASPECT_PLANE_1_BIT = 32, - VK_IMAGE_ASPECT_PLANE_2_BIT = 64 -} VkImageAspectFlagBits; - -typedef enum VkImageCreateFlagBits { - VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 1, - VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 2, - VK_IMAGE_CREATE_SPARSE_ALIASED_BIT = 4, - VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 8, - VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 16, - VK_IMAGE_CREATE_ALIAS_BIT = 1024, - VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT = 64, - VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT = 32, - VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT = 128, - VK_IMAGE_CREATE_EXTENDED_USAGE_BIT = 256, - VK_IMAGE_CREATE_PROTECTED_BIT = 2048, - VK_IMAGE_CREATE_DISJOINT_BIT = 512 -} VkImageCreateFlagBits; - -typedef enum VkImageLayout { - VK_IMAGE_LAYOUT_UNDEFINED = 0, - VK_IMAGE_LAYOUT_GENERAL = 1, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 2, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 3, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 4, - VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 5, - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 6, - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL = 7, - VK_IMAGE_LAYOUT_PREINITIALIZED = 8, - VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL = 1000117000, - VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL = 1000117001, - VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002 -} VkImageLayout; - -typedef enum VkImageTiling { - VK_IMAGE_TILING_OPTIMAL = 0, - VK_IMAGE_TILING_LINEAR = 1 -} VkImageTiling; - -typedef enum VkImageType { - VK_IMAGE_TYPE_1D = 0, - VK_IMAGE_TYPE_2D = 1, - VK_IMAGE_TYPE_3D = 2 -} VkImageType; - -typedef enum VkImageUsageFlagBits { - VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 1, - VK_IMAGE_USAGE_TRANSFER_DST_BIT = 2, - VK_IMAGE_USAGE_SAMPLED_BIT = 4, - VK_IMAGE_USAGE_STORAGE_BIT = 8, - VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 16, - VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 32, - VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 64, - VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 128 -} VkImageUsageFlagBits; - - -typedef enum VkImageViewType { - VK_IMAGE_VIEW_TYPE_1D = 0, - VK_IMAGE_VIEW_TYPE_2D = 1, - VK_IMAGE_VIEW_TYPE_3D = 2, - VK_IMAGE_VIEW_TYPE_CUBE = 3, - VK_IMAGE_VIEW_TYPE_1D_ARRAY = 4, - VK_IMAGE_VIEW_TYPE_2D_ARRAY = 5, - VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 6 -} VkImageViewType; - -typedef enum VkSharingMode { - VK_SHARING_MODE_EXCLUSIVE = 0, - VK_SHARING_MODE_CONCURRENT = 1 -} VkSharingMode; - -typedef enum VkIndexType { - VK_INDEX_TYPE_UINT16 = 0, - VK_INDEX_TYPE_UINT32 = 1 -} VkIndexType; - -typedef enum VkLogicOp { - VK_LOGIC_OP_CLEAR = 0, - VK_LOGIC_OP_AND = 1, - VK_LOGIC_OP_AND_REVERSE = 2, - VK_LOGIC_OP_COPY = 3, - VK_LOGIC_OP_AND_INVERTED = 4, - VK_LOGIC_OP_NO_OP = 5, - VK_LOGIC_OP_XOR = 6, - VK_LOGIC_OP_OR = 7, - VK_LOGIC_OP_NOR = 8, - VK_LOGIC_OP_EQUIVALENT = 9, - VK_LOGIC_OP_INVERT = 10, - VK_LOGIC_OP_OR_REVERSE = 11, - VK_LOGIC_OP_COPY_INVERTED = 12, - VK_LOGIC_OP_OR_INVERTED = 13, - VK_LOGIC_OP_NAND = 14, - VK_LOGIC_OP_SET = 15 -} VkLogicOp; - -typedef enum VkMemoryHeapFlagBits { - VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 1, - VK_MEMORY_HEAP_MULTI_INSTANCE_BIT = 2 -} VkMemoryHeapFlagBits; - -typedef enum VkAccessFlagBits { - VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 1, - VK_ACCESS_INDEX_READ_BIT = 2, - VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 4, - VK_ACCESS_UNIFORM_READ_BIT = 8, - VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 16, - VK_ACCESS_SHADER_READ_BIT = 32, - VK_ACCESS_SHADER_WRITE_BIT = 64, - VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 128, - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 256, - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 512, - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 1024, - VK_ACCESS_TRANSFER_READ_BIT = 2048, - VK_ACCESS_TRANSFER_WRITE_BIT = 4096, - VK_ACCESS_HOST_READ_BIT = 8192, - VK_ACCESS_HOST_WRITE_BIT = 16384, - VK_ACCESS_MEMORY_READ_BIT = 32768, - VK_ACCESS_MEMORY_WRITE_BIT = 65536 -} VkAccessFlagBits; - -typedef enum VkMemoryPropertyFlagBits { - VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 1, - VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 2, - VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 4, - VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 8, - VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 16, - VK_MEMORY_PROPERTY_PROTECTED_BIT = 32 -} VkMemoryPropertyFlagBits; - -typedef enum VkPhysicalDeviceType { - VK_PHYSICAL_DEVICE_TYPE_OTHER = 0, - VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 1, - VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 2, - VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 3, - VK_PHYSICAL_DEVICE_TYPE_CPU = 4 -} VkPhysicalDeviceType; - -typedef enum VkPipelineBindPoint { - VK_PIPELINE_BIND_POINT_GRAPHICS = 0, - VK_PIPELINE_BIND_POINT_COMPUTE = 1 -} VkPipelineBindPoint; - -typedef enum VkPipelineCreateFlagBits { - VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 1, - VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 2, - VK_PIPELINE_CREATE_DERIVATIVE_BIT = 4, - VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT = 8, - VK_PIPELINE_CREATE_DISPATCH_BASE_BIT = 16, - VK_PIPELINE_CREATE_DISPATCH_BASE = VK_PIPELINE_CREATE_DISPATCH_BASE_BIT -} VkPipelineCreateFlagBits; - -typedef enum VkPrimitiveTopology { - VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0, - VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 1, - VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 2, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 3, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 4, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 5, - VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 6, - VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 7, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 8, - VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 9, - VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 10 -} VkPrimitiveTopology; - -typedef enum VkQueryControlFlagBits { - VK_QUERY_CONTROL_PRECISE_BIT = 1 -} VkQueryControlFlagBits; - -typedef enum VkQueryPipelineStatisticFlagBits { - VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 1, - VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 2, - VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 4, - VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 8, - VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 16, - VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 32, - VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 64, - VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 128, - VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 256, - VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 512, - VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 1024 -} VkQueryPipelineStatisticFlagBits; - -typedef enum VkQueryResultFlagBits { - VK_QUERY_RESULT_64_BIT = 1, - VK_QUERY_RESULT_WAIT_BIT = 2, - VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 4, - VK_QUERY_RESULT_PARTIAL_BIT = 8 -} VkQueryResultFlagBits; - -typedef enum VkQueryType { - VK_QUERY_TYPE_OCCLUSION = 0, - VK_QUERY_TYPE_PIPELINE_STATISTICS = 1, - VK_QUERY_TYPE_TIMESTAMP = 2 -} VkQueryType; - -typedef enum VkQueueFlagBits { - VK_QUEUE_GRAPHICS_BIT = 1, - VK_QUEUE_COMPUTE_BIT = 2, - VK_QUEUE_TRANSFER_BIT = 4, - VK_QUEUE_SPARSE_BINDING_BIT = 8, - VK_QUEUE_PROTECTED_BIT = 16 -} VkQueueFlagBits; - -typedef enum VkSubpassContents { - VK_SUBPASS_CONTENTS_INLINE = 0, - VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 1 -} VkSubpassContents; - -typedef enum VkResult { - VK_SUCCESS = 0, - VK_NOT_READY = 1, - VK_TIMEOUT = 2, - VK_EVENT_SET = 3, - VK_EVENT_RESET = 4, - VK_INCOMPLETE = 5, - VK_ERROR_OUT_OF_HOST_MEMORY = -1, - VK_ERROR_OUT_OF_DEVICE_MEMORY = -2, - VK_ERROR_INITIALIZATION_FAILED = -3, - VK_ERROR_DEVICE_LOST = -4, - VK_ERROR_MEMORY_MAP_FAILED = -5, - VK_ERROR_LAYER_NOT_PRESENT = -6, - VK_ERROR_EXTENSION_NOT_PRESENT = -7, - VK_ERROR_FEATURE_NOT_PRESENT = -8, - VK_ERROR_INCOMPATIBLE_DRIVER = -9, - VK_ERROR_TOO_MANY_OBJECTS = -10, - VK_ERROR_FORMAT_NOT_SUPPORTED = -11, - VK_ERROR_FRAGMENTED_POOL = -12, - VK_ERROR_UNKNOWN = -13, - VK_ERROR_OUT_OF_POOL_MEMORY = -1000069000, - VK_ERROR_INVALID_EXTERNAL_HANDLE = -1000072003, - VK_ERROR_SURFACE_LOST_KHR = -1000000000, - VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = -1000000001, - VK_SUBOPTIMAL_KHR = 1000001003, - VK_ERROR_OUT_OF_DATE_KHR = -1000001004, - VK_ERROR_VALIDATION_FAILED_EXT = -1000011001 -} VkResult; - -typedef enum VkShaderStageFlagBits { - VK_SHADER_STAGE_VERTEX_BIT = 1, - VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 2, - VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 4, - VK_SHADER_STAGE_GEOMETRY_BIT = 8, - VK_SHADER_STAGE_FRAGMENT_BIT = 16, - VK_SHADER_STAGE_COMPUTE_BIT = 32, - VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F, - VK_SHADER_STAGE_ALL = 0x7FFFFFFF -} VkShaderStageFlagBits; - -typedef enum VkSparseMemoryBindFlagBits { - VK_SPARSE_MEMORY_BIND_METADATA_BIT = 1 -} VkSparseMemoryBindFlagBits; - -typedef enum VkStencilFaceFlagBits { - VK_STENCIL_FACE_FRONT_BIT = 1, - VK_STENCIL_FACE_BACK_BIT = 2, - VK_STENCIL_FACE_FRONT_AND_BACK = 0x00000003, - VK_STENCIL_FRONT_AND_BACK = VK_STENCIL_FACE_FRONT_AND_BACK -} VkStencilFaceFlagBits; - -typedef enum VkStencilOp { - VK_STENCIL_OP_KEEP = 0, - VK_STENCIL_OP_ZERO = 1, - VK_STENCIL_OP_REPLACE = 2, - VK_STENCIL_OP_INCREMENT_AND_CLAMP = 3, - VK_STENCIL_OP_DECREMENT_AND_CLAMP = 4, - VK_STENCIL_OP_INVERT = 5, - VK_STENCIL_OP_INCREMENT_AND_WRAP = 6, - VK_STENCIL_OP_DECREMENT_AND_WRAP = 7 -} VkStencilOp; - -typedef enum VkStructureType { - VK_STRUCTURE_TYPE_APPLICATION_INFO = 0, - VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1, - VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2, - VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3, - VK_STRUCTURE_TYPE_SUBMIT_INFO = 4, - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5, - VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6, - VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7, - VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8, - VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9, - VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10, - VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11, - VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12, - VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13, - VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14, - VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15, - VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16, - VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17, - VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18, - VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19, - VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20, - VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21, - VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22, - VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23, - VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24, - VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25, - VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26, - VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27, - VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28, - VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29, - VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30, - VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32, - VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34, - VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35, - VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36, - VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37, - VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38, - VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41, - VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42, - VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43, - VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44, - VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45, - VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46, - VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47, - VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES = 1000094000, - VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO = 1000157000, - VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO = 1000157001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES = 1000083000, - VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS = 1000127000, - VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO = 1000127001, - VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO = 1000060000, - VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO = 1000060003, - VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO = 1000060004, - VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO = 1000060005, - VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO = 1000060006, - VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO = 1000060013, - VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO = 1000060014, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES = 1000070000, - VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO = 1000070001, - VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2 = 1000146000, - VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2 = 1000146001, - VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2 = 1000146002, - VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2 = 1000146003, - VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2 = 1000146004, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2 = 1000059000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2 = 1000059001, - VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2 = 1000059002, - VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2 = 1000059003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2 = 1000059004, - VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2 = 1000059005, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2 = 1000059006, - VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2 = 1000059007, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2 = 1000059008, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES = 1000117000, - VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO = 1000117001, - VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO = 1000117002, - VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO = 1000117003, - VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO = 1000053000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES = 1000053001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES = 1000053002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES = 1000120000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES, - VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO = 1000145000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES = 1000145001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES = 1000145002, - VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2 = 1000145003, - VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO = 1000156000, - VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO = 1000156001, - VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO = 1000156002, - VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO = 1000156003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES = 1000156004, - VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES = 1000156005, - VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO = 1000085000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO = 1000071000, - VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES = 1000071001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO = 1000071002, - VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES = 1000071003, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES = 1000071004, - VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO = 1000072000, - VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO = 1000072001, - VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO = 1000072002, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO = 1000112000, - VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES = 1000112001, - VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO = 1000113000, - VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO = 1000077000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO = 1000076000, - VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES = 1000076001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES = 1000168000, - VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT = 1000168001, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES = 1000063000, - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES, - VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000, - VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001, - VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR = 1000060007, - VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR = 1000060008, - VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR = 1000060009, - VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR = 1000060010, - VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR = 1000060011, - VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR = 1000060012, - VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000, - VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT -} VkStructureType; - -typedef enum VkSystemAllocationScope { - VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0, - VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 1, - VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 2, - VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 3, - VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 4 -} VkSystemAllocationScope; - -typedef enum VkInternalAllocationType { - VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0 -} VkInternalAllocationType; - -typedef enum VkSamplerAddressMode { - VK_SAMPLER_ADDRESS_MODE_REPEAT = 0, - VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 1, - VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 2, - VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 3 -} VkSamplerAddressMode; - -typedef enum VkFilter { - VK_FILTER_NEAREST = 0, - VK_FILTER_LINEAR = 1 -} VkFilter; - -typedef enum VkSamplerMipmapMode { - VK_SAMPLER_MIPMAP_MODE_NEAREST = 0, - VK_SAMPLER_MIPMAP_MODE_LINEAR = 1 -} VkSamplerMipmapMode; - -typedef enum VkVertexInputRate { - VK_VERTEX_INPUT_RATE_VERTEX = 0, - VK_VERTEX_INPUT_RATE_INSTANCE = 1 -} VkVertexInputRate; - -typedef enum VkPipelineStageFlagBits { - VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 1, - VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 2, - VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 4, - VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 8, - VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 16, - VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 32, - VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 64, - VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 128, - VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 256, - VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 512, - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 1024, - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 2048, - VK_PIPELINE_STAGE_TRANSFER_BIT = 4096, - VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 8192, - VK_PIPELINE_STAGE_HOST_BIT = 16384, - VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 32768, - VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 65536 -} VkPipelineStageFlagBits; - -typedef enum VkSparseImageFormatFlagBits { - VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 1, - VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT = 2, - VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 4 -} VkSparseImageFormatFlagBits; - -typedef enum VkSampleCountFlagBits { - VK_SAMPLE_COUNT_1_BIT = 1, - VK_SAMPLE_COUNT_2_BIT = 2, - VK_SAMPLE_COUNT_4_BIT = 4, - VK_SAMPLE_COUNT_8_BIT = 8, - VK_SAMPLE_COUNT_16_BIT = 16, - VK_SAMPLE_COUNT_32_BIT = 32, - VK_SAMPLE_COUNT_64_BIT = 64 -} VkSampleCountFlagBits; - -typedef enum VkAttachmentDescriptionFlagBits { - VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT = 1 -} VkAttachmentDescriptionFlagBits; - -typedef enum VkDescriptorPoolCreateFlagBits { - VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 1 -} VkDescriptorPoolCreateFlagBits; - -typedef enum VkDependencyFlagBits { - VK_DEPENDENCY_BY_REGION_BIT = 1, - VK_DEPENDENCY_DEVICE_GROUP_BIT = 4, - VK_DEPENDENCY_VIEW_LOCAL_BIT = 2 -} VkDependencyFlagBits; - -typedef enum VkObjectType { - VK_OBJECT_TYPE_UNKNOWN = 0, - VK_OBJECT_TYPE_INSTANCE = 1, - VK_OBJECT_TYPE_PHYSICAL_DEVICE = 2, - VK_OBJECT_TYPE_DEVICE = 3, - VK_OBJECT_TYPE_QUEUE = 4, - VK_OBJECT_TYPE_SEMAPHORE = 5, - VK_OBJECT_TYPE_COMMAND_BUFFER = 6, - VK_OBJECT_TYPE_FENCE = 7, - VK_OBJECT_TYPE_DEVICE_MEMORY = 8, - VK_OBJECT_TYPE_BUFFER = 9, - VK_OBJECT_TYPE_IMAGE = 10, - VK_OBJECT_TYPE_EVENT = 11, - VK_OBJECT_TYPE_QUERY_POOL = 12, - VK_OBJECT_TYPE_BUFFER_VIEW = 13, - VK_OBJECT_TYPE_IMAGE_VIEW = 14, - VK_OBJECT_TYPE_SHADER_MODULE = 15, - VK_OBJECT_TYPE_PIPELINE_CACHE = 16, - VK_OBJECT_TYPE_PIPELINE_LAYOUT = 17, - VK_OBJECT_TYPE_RENDER_PASS = 18, - VK_OBJECT_TYPE_PIPELINE = 19, - VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT = 20, - VK_OBJECT_TYPE_SAMPLER = 21, - VK_OBJECT_TYPE_DESCRIPTOR_POOL = 22, - VK_OBJECT_TYPE_DESCRIPTOR_SET = 23, - VK_OBJECT_TYPE_FRAMEBUFFER = 24, - VK_OBJECT_TYPE_COMMAND_POOL = 25, - VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION = 1000156000, - VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE = 1000085000, - VK_OBJECT_TYPE_SURFACE_KHR = 1000000000, - VK_OBJECT_TYPE_SWAPCHAIN_KHR = 1000001000, - VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT = 1000011000 -} VkObjectType; - -typedef enum VkDescriptorUpdateTemplateType { - VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET = 0 -} VkDescriptorUpdateTemplateType; - - -typedef enum VkPointClippingBehavior { - VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES = 0, - VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY = 1 -} VkPointClippingBehavior; - - -typedef enum VkColorSpaceKHR { - VK_COLOR_SPACE_SRGB_NONLINEAR_KHR = 0, - VK_COLORSPACE_SRGB_NONLINEAR_KHR = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR -} VkColorSpaceKHR; - -typedef enum VkCompositeAlphaFlagBitsKHR { - VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 1, - VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 2, - VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 4, - VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 8 -} VkCompositeAlphaFlagBitsKHR; - -typedef enum VkPresentModeKHR { - VK_PRESENT_MODE_IMMEDIATE_KHR = 0, - VK_PRESENT_MODE_MAILBOX_KHR = 1, - VK_PRESENT_MODE_FIFO_KHR = 2, - VK_PRESENT_MODE_FIFO_RELAXED_KHR = 3 -} VkPresentModeKHR; - -typedef enum VkSurfaceTransformFlagBitsKHR { - VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 1, - VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 2, - VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 4, - VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 8, - VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 16, - VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 32, - VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 64, - VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 128, - VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 256 -} VkSurfaceTransformFlagBitsKHR; - -typedef enum VkDebugReportFlagBitsEXT { - VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 1, - VK_DEBUG_REPORT_WARNING_BIT_EXT = 2, - VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 4, - VK_DEBUG_REPORT_ERROR_BIT_EXT = 8, - VK_DEBUG_REPORT_DEBUG_BIT_EXT = 16 -} VkDebugReportFlagBitsEXT; - -typedef enum VkDebugReportObjectTypeEXT { - VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0, - VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1, - VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2, - VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3, - VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4, - VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6, - VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7, - VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8, - VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9, - VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10, - VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11, - VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12, - VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13, - VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14, - VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15, - VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16, - VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17, - VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18, - VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20, - VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23, - VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25, - VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26, - VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27, - VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT = 28, - VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT = 29, - VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30, - VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT = 33, - VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT = 1000156000, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT = 1000085000 -} VkDebugReportObjectTypeEXT; - -typedef enum VkExternalMemoryHandleTypeFlagBits { - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT = 1, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT = 2, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 4, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT = 8, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT = 16, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT = 32, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT = 64 -} VkExternalMemoryHandleTypeFlagBits; - -typedef enum VkExternalMemoryFeatureFlagBits { - VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT = 1, - VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT = 2, - VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT = 4 -} VkExternalMemoryFeatureFlagBits; - -typedef enum VkExternalSemaphoreHandleTypeFlagBits { - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT = 1, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT = 2, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 4, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT = 8, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE_BIT = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT, - VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT = 16 -} VkExternalSemaphoreHandleTypeFlagBits; - -typedef enum VkExternalSemaphoreFeatureFlagBits { - VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT = 1, - VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT = 2 -} VkExternalSemaphoreFeatureFlagBits; - -typedef enum VkSemaphoreImportFlagBits { - VK_SEMAPHORE_IMPORT_TEMPORARY_BIT = 1 -} VkSemaphoreImportFlagBits; - -typedef enum VkExternalFenceHandleTypeFlagBits { - VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT = 1, - VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT = 2, - VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 4, - VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT = 8 -} VkExternalFenceHandleTypeFlagBits; - -typedef enum VkExternalFenceFeatureFlagBits { - VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT = 1, - VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT = 2 -} VkExternalFenceFeatureFlagBits; - -typedef enum VkFenceImportFlagBits { - VK_FENCE_IMPORT_TEMPORARY_BIT = 1 -} VkFenceImportFlagBits; - -typedef enum VkPeerMemoryFeatureFlagBits { - VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT = 1, - VK_PEER_MEMORY_FEATURE_COPY_DST_BIT = 2, - VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT = 4, - VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT = 8 -} VkPeerMemoryFeatureFlagBits; - -typedef enum VkMemoryAllocateFlagBits { - VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT = 1 -} VkMemoryAllocateFlagBits; - -typedef enum VkDeviceGroupPresentModeFlagBitsKHR { - VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR = 1, - VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR = 2, - VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR = 4, - VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR = 8 -} VkDeviceGroupPresentModeFlagBitsKHR; - -typedef enum VkSwapchainCreateFlagBitsKHR { - VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR = 1, - VK_SWAPCHAIN_CREATE_PROTECTED_BIT_KHR = 2 -} VkSwapchainCreateFlagBitsKHR; - -typedef enum VkSubgroupFeatureFlagBits { - VK_SUBGROUP_FEATURE_BASIC_BIT = 1, - VK_SUBGROUP_FEATURE_VOTE_BIT = 2, - VK_SUBGROUP_FEATURE_ARITHMETIC_BIT = 4, - VK_SUBGROUP_FEATURE_BALLOT_BIT = 8, - VK_SUBGROUP_FEATURE_SHUFFLE_BIT = 16, - VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT = 32, - VK_SUBGROUP_FEATURE_CLUSTERED_BIT = 64, - VK_SUBGROUP_FEATURE_QUAD_BIT = 128 -} VkSubgroupFeatureFlagBits; - -typedef enum VkTessellationDomainOrigin { - VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT = 0, - VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT = 1 -} VkTessellationDomainOrigin; - -typedef enum VkSamplerYcbcrModelConversion { - VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY = 0, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY = 1, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709 = 2, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601 = 3, - VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020 = 4 -} VkSamplerYcbcrModelConversion; - -typedef enum VkSamplerYcbcrRange { - VK_SAMPLER_YCBCR_RANGE_ITU_FULL = 0, - VK_SAMPLER_YCBCR_RANGE_ITU_NARROW = 1 -} VkSamplerYcbcrRange; - -typedef enum VkChromaLocation { - VK_CHROMA_LOCATION_COSITED_EVEN = 0, - VK_CHROMA_LOCATION_MIDPOINT = 1 -} VkChromaLocation; - -typedef enum VkVendorId { - VK_VENDOR_ID_VIV = 0x10001, - VK_VENDOR_ID_VSI = 0x10002, - VK_VENDOR_ID_KAZAN = 0x10003, - VK_VENDOR_ID_CODEPLAY = 0x10004, - VK_VENDOR_ID_MESA = 0x10005 -} VkVendorId; - -typedef void (VKAPI_PTR *PFN_vkInternalAllocationNotification)( - void* pUserData, - size_t size, - VkInternalAllocationType allocationType, - VkSystemAllocationScope allocationScope); - -typedef void (VKAPI_PTR *PFN_vkInternalFreeNotification)( - void* pUserData, - size_t size, - VkInternalAllocationType allocationType, - VkSystemAllocationScope allocationScope); - -typedef void* (VKAPI_PTR *PFN_vkReallocationFunction)( - void* pUserData, - void* pOriginal, - size_t size, - size_t alignment, - VkSystemAllocationScope allocationScope); - -typedef void* (VKAPI_PTR *PFN_vkAllocationFunction)( - void* pUserData, - size_t size, - size_t alignment, - VkSystemAllocationScope allocationScope); - -typedef void (VKAPI_PTR *PFN_vkFreeFunction)( - void* pUserData, - void* pMemory); - -typedef void (VKAPI_PTR *PFN_vkVoidFunction)(void); - -typedef struct VkBaseOutStructure { - VkStructureType sType; - struct VkBaseOutStructure * pNext; -} VkBaseOutStructure; - -typedef struct VkBaseInStructure { - VkStructureType sType; - const struct VkBaseInStructure * pNext; -} VkBaseInStructure; - -typedef struct VkOffset2D { - int32_t x; - int32_t y; -} VkOffset2D; - -typedef struct VkOffset3D { - int32_t x; - int32_t y; - int32_t z; -} VkOffset3D; - -typedef struct VkExtent2D { - uint32_t width; - uint32_t height; -} VkExtent2D; - -typedef struct VkExtent3D { - uint32_t width; - uint32_t height; - uint32_t depth; -} VkExtent3D; - -typedef struct VkViewport { - float x; - float y; - float width; - float height; - float minDepth; - float maxDepth; -} VkViewport; - -typedef struct VkRect2D { - VkOffset2D offset; - VkExtent2D extent; -} VkRect2D; - -typedef struct VkClearRect { - VkRect2D rect; - uint32_t baseArrayLayer; - uint32_t layerCount; -} VkClearRect; - -typedef struct VkComponentMapping { - VkComponentSwizzle r; - VkComponentSwizzle g; - VkComponentSwizzle b; - VkComponentSwizzle a; -} VkComponentMapping; - -typedef struct VkExtensionProperties { - char extensionName [ VK_MAX_EXTENSION_NAME_SIZE ]; - uint32_t specVersion; -} VkExtensionProperties; - -typedef struct VkLayerProperties { - char layerName [ VK_MAX_EXTENSION_NAME_SIZE ]; - uint32_t specVersion; - uint32_t implementationVersion; - char description [ VK_MAX_DESCRIPTION_SIZE ]; -} VkLayerProperties; - -typedef struct VkApplicationInfo { - VkStructureType sType; - const void * pNext; - const char * pApplicationName; - uint32_t applicationVersion; - const char * pEngineName; - uint32_t engineVersion; - uint32_t apiVersion; -} VkApplicationInfo; - -typedef struct VkAllocationCallbacks { - void * pUserData; - PFN_vkAllocationFunction pfnAllocation; - PFN_vkReallocationFunction pfnReallocation; - PFN_vkFreeFunction pfnFree; - PFN_vkInternalAllocationNotification pfnInternalAllocation; - PFN_vkInternalFreeNotification pfnInternalFree; -} VkAllocationCallbacks; - -typedef struct VkDescriptorImageInfo { - VkSampler sampler; - VkImageView imageView; - VkImageLayout imageLayout; -} VkDescriptorImageInfo; - -typedef struct VkCopyDescriptorSet { - VkStructureType sType; - const void * pNext; - VkDescriptorSet srcSet; - uint32_t srcBinding; - uint32_t srcArrayElement; - VkDescriptorSet dstSet; - uint32_t dstBinding; - uint32_t dstArrayElement; - uint32_t descriptorCount; -} VkCopyDescriptorSet; - -typedef struct VkDescriptorPoolSize { - VkDescriptorType type; - uint32_t descriptorCount; -} VkDescriptorPoolSize; - -typedef struct VkDescriptorSetAllocateInfo { - VkStructureType sType; - const void * pNext; - VkDescriptorPool descriptorPool; - uint32_t descriptorSetCount; - const VkDescriptorSetLayout * pSetLayouts; -} VkDescriptorSetAllocateInfo; - -typedef struct VkSpecializationMapEntry { - uint32_t constantID; - uint32_t offset; - size_t size; -} VkSpecializationMapEntry; - -typedef struct VkSpecializationInfo { - uint32_t mapEntryCount; - const VkSpecializationMapEntry * pMapEntries; - size_t dataSize; - const void * pData; -} VkSpecializationInfo; - -typedef struct VkVertexInputBindingDescription { - uint32_t binding; - uint32_t stride; - VkVertexInputRate inputRate; -} VkVertexInputBindingDescription; - -typedef struct VkVertexInputAttributeDescription { - uint32_t location; - uint32_t binding; - VkFormat format; - uint32_t offset; -} VkVertexInputAttributeDescription; - -typedef struct VkStencilOpState { - VkStencilOp failOp; - VkStencilOp passOp; - VkStencilOp depthFailOp; - VkCompareOp compareOp; - uint32_t compareMask; - uint32_t writeMask; - uint32_t reference; -} VkStencilOpState; - -typedef struct VkCommandBufferAllocateInfo { - VkStructureType sType; - const void * pNext; - VkCommandPool commandPool; - VkCommandBufferLevel level; - uint32_t commandBufferCount; -} VkCommandBufferAllocateInfo; - -typedef union VkClearColorValue { - float float32 [4]; - int32_t int32 [4]; - uint32_t uint32 [4]; -} VkClearColorValue; - -typedef struct VkClearDepthStencilValue { - float depth; - uint32_t stencil; -} VkClearDepthStencilValue; - -typedef union VkClearValue { - VkClearColorValue color; - VkClearDepthStencilValue depthStencil; -} VkClearValue; - -typedef struct VkAttachmentReference { - uint32_t attachment; - VkImageLayout layout; -} VkAttachmentReference; - -typedef struct VkDrawIndirectCommand { - uint32_t vertexCount; - uint32_t instanceCount; - uint32_t firstVertex; - uint32_t firstInstance; -} VkDrawIndirectCommand; - -typedef struct VkDrawIndexedIndirectCommand { - uint32_t indexCount; - uint32_t instanceCount; - uint32_t firstIndex; - int32_t vertexOffset; - uint32_t firstInstance; -} VkDrawIndexedIndirectCommand; - -typedef struct VkDispatchIndirectCommand { - uint32_t x; - uint32_t y; - uint32_t z; -} VkDispatchIndirectCommand; - -typedef struct VkSurfaceFormatKHR { - VkFormat format; - VkColorSpaceKHR colorSpace; -} VkSurfaceFormatKHR; - -typedef struct VkPresentInfoKHR { - VkStructureType sType; - const void * pNext; - uint32_t waitSemaphoreCount; - const VkSemaphore * pWaitSemaphores; - uint32_t swapchainCount; - const VkSwapchainKHR * pSwapchains; - const uint32_t * pImageIndices; - VkResult * pResults; -} VkPresentInfoKHR; - -typedef struct VkPhysicalDeviceExternalImageFormatInfo { - VkStructureType sType; - const void * pNext; - VkExternalMemoryHandleTypeFlagBits handleType; -} VkPhysicalDeviceExternalImageFormatInfo; - -typedef struct VkPhysicalDeviceExternalSemaphoreInfo { - VkStructureType sType; - const void * pNext; - VkExternalSemaphoreHandleTypeFlagBits handleType; -} VkPhysicalDeviceExternalSemaphoreInfo; - -typedef struct VkPhysicalDeviceExternalFenceInfo { - VkStructureType sType; - const void * pNext; - VkExternalFenceHandleTypeFlagBits handleType; -} VkPhysicalDeviceExternalFenceInfo; - -typedef struct VkPhysicalDeviceMultiviewProperties { - VkStructureType sType; - void * pNext; - uint32_t maxMultiviewViewCount; - uint32_t maxMultiviewInstanceIndex; -} VkPhysicalDeviceMultiviewProperties; - -typedef struct VkRenderPassMultiviewCreateInfo { - VkStructureType sType; - const void * pNext; - uint32_t subpassCount; - const uint32_t * pViewMasks; - uint32_t dependencyCount; - const int32_t * pViewOffsets; - uint32_t correlationMaskCount; - const uint32_t * pCorrelationMasks; -} VkRenderPassMultiviewCreateInfo; - -typedef struct VkBindBufferMemoryDeviceGroupInfo { - VkStructureType sType; - const void * pNext; - uint32_t deviceIndexCount; - const uint32_t * pDeviceIndices; -} VkBindBufferMemoryDeviceGroupInfo; - -typedef struct VkBindImageMemoryDeviceGroupInfo { - VkStructureType sType; - const void * pNext; - uint32_t deviceIndexCount; - const uint32_t * pDeviceIndices; - uint32_t splitInstanceBindRegionCount; - const VkRect2D * pSplitInstanceBindRegions; -} VkBindImageMemoryDeviceGroupInfo; - -typedef struct VkDeviceGroupRenderPassBeginInfo { - VkStructureType sType; - const void * pNext; - uint32_t deviceMask; - uint32_t deviceRenderAreaCount; - const VkRect2D * pDeviceRenderAreas; -} VkDeviceGroupRenderPassBeginInfo; - -typedef struct VkDeviceGroupCommandBufferBeginInfo { - VkStructureType sType; - const void * pNext; - uint32_t deviceMask; -} VkDeviceGroupCommandBufferBeginInfo; - -typedef struct VkDeviceGroupSubmitInfo { - VkStructureType sType; - const void * pNext; - uint32_t waitSemaphoreCount; - const uint32_t * pWaitSemaphoreDeviceIndices; - uint32_t commandBufferCount; - const uint32_t * pCommandBufferDeviceMasks; - uint32_t signalSemaphoreCount; - const uint32_t * pSignalSemaphoreDeviceIndices; -} VkDeviceGroupSubmitInfo; - -typedef struct VkDeviceGroupBindSparseInfo { - VkStructureType sType; - const void * pNext; - uint32_t resourceDeviceIndex; - uint32_t memoryDeviceIndex; -} VkDeviceGroupBindSparseInfo; - -typedef struct VkImageSwapchainCreateInfoKHR { - VkStructureType sType; - const void * pNext; - VkSwapchainKHR swapchain; -} VkImageSwapchainCreateInfoKHR; - -typedef struct VkBindImageMemorySwapchainInfoKHR { - VkStructureType sType; - const void * pNext; - VkSwapchainKHR swapchain; - uint32_t imageIndex; -} VkBindImageMemorySwapchainInfoKHR; - -typedef struct VkAcquireNextImageInfoKHR { - VkStructureType sType; - const void * pNext; - VkSwapchainKHR swapchain; - uint64_t timeout; - VkSemaphore semaphore; - VkFence fence; - uint32_t deviceMask; -} VkAcquireNextImageInfoKHR; - -typedef struct VkDeviceGroupPresentInfoKHR { - VkStructureType sType; - const void * pNext; - uint32_t swapchainCount; - const uint32_t * pDeviceMasks; - VkDeviceGroupPresentModeFlagBitsKHR mode; -} VkDeviceGroupPresentInfoKHR; - -typedef struct VkDeviceGroupDeviceCreateInfo { - VkStructureType sType; - const void * pNext; - uint32_t physicalDeviceCount; - const VkPhysicalDevice * pPhysicalDevices; -} VkDeviceGroupDeviceCreateInfo; - -typedef struct VkDescriptorUpdateTemplateEntry { - uint32_t dstBinding; - uint32_t dstArrayElement; - uint32_t descriptorCount; - VkDescriptorType descriptorType; - size_t offset; - size_t stride; -} VkDescriptorUpdateTemplateEntry; - -typedef struct VkBufferMemoryRequirementsInfo2 { - VkStructureType sType; - const void * pNext; - VkBuffer buffer; -} VkBufferMemoryRequirementsInfo2; - -typedef struct VkImageMemoryRequirementsInfo2 { - VkStructureType sType; - const void * pNext; - VkImage image; -} VkImageMemoryRequirementsInfo2; - -typedef struct VkImageSparseMemoryRequirementsInfo2 { - VkStructureType sType; - const void * pNext; - VkImage image; -} VkImageSparseMemoryRequirementsInfo2; - -typedef struct VkPhysicalDevicePointClippingProperties { - VkStructureType sType; - void * pNext; - VkPointClippingBehavior pointClippingBehavior; -} VkPhysicalDevicePointClippingProperties; - -typedef struct VkMemoryDedicatedAllocateInfo { - VkStructureType sType; - const void * pNext; - VkImage image; - VkBuffer buffer; -} VkMemoryDedicatedAllocateInfo; - -typedef struct VkPipelineTessellationDomainOriginStateCreateInfo { - VkStructureType sType; - const void * pNext; - VkTessellationDomainOrigin domainOrigin; -} VkPipelineTessellationDomainOriginStateCreateInfo; - -typedef struct VkSamplerYcbcrConversionInfo { - VkStructureType sType; - const void * pNext; - VkSamplerYcbcrConversion conversion; -} VkSamplerYcbcrConversionInfo; - -typedef struct VkBindImagePlaneMemoryInfo { - VkStructureType sType; - const void * pNext; - VkImageAspectFlagBits planeAspect; -} VkBindImagePlaneMemoryInfo; - -typedef struct VkImagePlaneMemoryRequirementsInfo { - VkStructureType sType; - const void * pNext; - VkImageAspectFlagBits planeAspect; -} VkImagePlaneMemoryRequirementsInfo; - -typedef struct VkSamplerYcbcrConversionImageFormatProperties { - VkStructureType sType; - void * pNext; - uint32_t combinedImageSamplerDescriptorCount; -} VkSamplerYcbcrConversionImageFormatProperties; - -typedef uint32_t VkSampleMask; - -typedef uint32_t VkBool32; - -typedef uint32_t VkFlags; - -typedef uint64_t VkDeviceSize; - -typedef uint64_t VkDeviceAddress; - -typedef VkFlags VkFramebufferCreateFlags; - -typedef VkFlags VkQueryPoolCreateFlags; - -typedef VkFlags VkRenderPassCreateFlags; - -typedef VkFlags VkSamplerCreateFlags; - -typedef VkFlags VkPipelineLayoutCreateFlags; - -typedef VkFlags VkPipelineCacheCreateFlags; - -typedef VkFlags VkPipelineDepthStencilStateCreateFlags; - -typedef VkFlags VkPipelineDynamicStateCreateFlags; - -typedef VkFlags VkPipelineColorBlendStateCreateFlags; - -typedef VkFlags VkPipelineMultisampleStateCreateFlags; - -typedef VkFlags VkPipelineRasterizationStateCreateFlags; - -typedef VkFlags VkPipelineViewportStateCreateFlags; - -typedef VkFlags VkPipelineTessellationStateCreateFlags; - -typedef VkFlags VkPipelineInputAssemblyStateCreateFlags; - -typedef VkFlags VkPipelineVertexInputStateCreateFlags; - -typedef VkFlags VkPipelineShaderStageCreateFlags; - -typedef VkFlags VkDescriptorSetLayoutCreateFlags; - -typedef VkFlags VkBufferViewCreateFlags; - -typedef VkFlags VkInstanceCreateFlags; - -typedef VkFlags VkDeviceCreateFlags; - -typedef VkFlags VkDeviceQueueCreateFlags; - -typedef VkFlags VkQueueFlags; - -typedef VkFlags VkMemoryPropertyFlags; - -typedef VkFlags VkMemoryHeapFlags; - -typedef VkFlags VkAccessFlags; - -typedef VkFlags VkBufferUsageFlags; - -typedef VkFlags VkBufferCreateFlags; - -typedef VkFlags VkShaderStageFlags; - -typedef VkFlags VkImageUsageFlags; - -typedef VkFlags VkImageCreateFlags; - -typedef VkFlags VkImageViewCreateFlags; - -typedef VkFlags VkPipelineCreateFlags; - -typedef VkFlags VkColorComponentFlags; - -typedef VkFlags VkFenceCreateFlags; - -typedef VkFlags VkSemaphoreCreateFlags; - -typedef VkFlags VkFormatFeatureFlags; - -typedef VkFlags VkQueryControlFlags; - -typedef VkFlags VkQueryResultFlags; - -typedef VkFlags VkShaderModuleCreateFlags; - -typedef VkFlags VkEventCreateFlags; - -typedef VkFlags VkCommandPoolCreateFlags; - -typedef VkFlags VkCommandPoolResetFlags; - -typedef VkFlags VkCommandBufferResetFlags; - -typedef VkFlags VkCommandBufferUsageFlags; - -typedef VkFlags VkQueryPipelineStatisticFlags; - -typedef VkFlags VkMemoryMapFlags; - -typedef VkFlags VkImageAspectFlags; - -typedef VkFlags VkSparseMemoryBindFlags; - -typedef VkFlags VkSparseImageFormatFlags; - -typedef VkFlags VkSubpassDescriptionFlags; - -typedef VkFlags VkPipelineStageFlags; - -typedef VkFlags VkSampleCountFlags; - -typedef VkFlags VkAttachmentDescriptionFlags; - -typedef VkFlags VkStencilFaceFlags; - -typedef VkFlags VkCullModeFlags; - -typedef VkFlags VkDescriptorPoolCreateFlags; - -typedef VkFlags VkDescriptorPoolResetFlags; - -typedef VkFlags VkDependencyFlags; - -typedef VkFlags VkSubgroupFeatureFlags; - -typedef VkFlags VkDescriptorUpdateTemplateCreateFlags; - -typedef VkFlags VkCompositeAlphaFlagsKHR; - -typedef VkFlags VkSurfaceTransformFlagsKHR; - -typedef VkFlags VkSwapchainCreateFlagsKHR; - -typedef VkFlags VkPeerMemoryFeatureFlags; - -typedef VkFlags VkMemoryAllocateFlags; - -typedef VkFlags VkDeviceGroupPresentModeFlagsKHR; - -typedef VkFlags VkDebugReportFlagsEXT; - -typedef VkFlags VkCommandPoolTrimFlags; - -typedef VkFlags VkExternalMemoryHandleTypeFlags; - -typedef VkFlags VkExternalMemoryFeatureFlags; - -typedef VkFlags VkExternalSemaphoreHandleTypeFlags; - -typedef VkFlags VkExternalSemaphoreFeatureFlags; - -typedef VkFlags VkSemaphoreImportFlags; - -typedef VkFlags VkExternalFenceHandleTypeFlags; - -typedef VkFlags VkExternalFenceFeatureFlags; - -typedef VkFlags VkFenceImportFlags; - -typedef VkBool32 (VKAPI_PTR *PFN_vkDebugReportCallbackEXT)( - VkDebugReportFlagsEXT flags, - VkDebugReportObjectTypeEXT objectType, - uint64_t object, - size_t location, - int32_t messageCode, - const char* pLayerPrefix, - const char* pMessage, - void* pUserData); - -typedef struct VkDeviceQueueCreateInfo { - VkStructureType sType; - const void * pNext; - VkDeviceQueueCreateFlags flags; - uint32_t queueFamilyIndex; - uint32_t queueCount; - const float * pQueuePriorities; -} VkDeviceQueueCreateInfo; - -typedef struct VkInstanceCreateInfo { - VkStructureType sType; - const void * pNext; - VkInstanceCreateFlags flags; - const VkApplicationInfo * pApplicationInfo; - uint32_t enabledLayerCount; - const char * const* ppEnabledLayerNames; - uint32_t enabledExtensionCount; - const char * const* ppEnabledExtensionNames; -} VkInstanceCreateInfo; - -typedef struct VkQueueFamilyProperties { - VkQueueFlags queueFlags; - uint32_t queueCount; - uint32_t timestampValidBits; - VkExtent3D minImageTransferGranularity; -} VkQueueFamilyProperties; - -typedef struct VkMemoryAllocateInfo { - VkStructureType sType; - const void * pNext; - VkDeviceSize allocationSize; - uint32_t memoryTypeIndex; -} VkMemoryAllocateInfo; - -typedef struct VkMemoryRequirements { - VkDeviceSize size; - VkDeviceSize alignment; - uint32_t memoryTypeBits; -} VkMemoryRequirements; - -typedef struct VkSparseImageFormatProperties { - VkImageAspectFlags aspectMask; - VkExtent3D imageGranularity; - VkSparseImageFormatFlags flags; -} VkSparseImageFormatProperties; - -typedef struct VkSparseImageMemoryRequirements { - VkSparseImageFormatProperties formatProperties; - uint32_t imageMipTailFirstLod; - VkDeviceSize imageMipTailSize; - VkDeviceSize imageMipTailOffset; - VkDeviceSize imageMipTailStride; -} VkSparseImageMemoryRequirements; - -typedef struct VkMemoryType { - VkMemoryPropertyFlags propertyFlags; - uint32_t heapIndex; -} VkMemoryType; - -typedef struct VkMemoryHeap { - VkDeviceSize size; - VkMemoryHeapFlags flags; -} VkMemoryHeap; - -typedef struct VkMappedMemoryRange { - VkStructureType sType; - const void * pNext; - VkDeviceMemory memory; - VkDeviceSize offset; - VkDeviceSize size; -} VkMappedMemoryRange; - -typedef struct VkFormatProperties { - VkFormatFeatureFlags linearTilingFeatures; - VkFormatFeatureFlags optimalTilingFeatures; - VkFormatFeatureFlags bufferFeatures; -} VkFormatProperties; - -typedef struct VkImageFormatProperties { - VkExtent3D maxExtent; - uint32_t maxMipLevels; - uint32_t maxArrayLayers; - VkSampleCountFlags sampleCounts; - VkDeviceSize maxResourceSize; -} VkImageFormatProperties; - -typedef struct VkDescriptorBufferInfo { - VkBuffer buffer; - VkDeviceSize offset; - VkDeviceSize range; -} VkDescriptorBufferInfo; - -typedef struct VkWriteDescriptorSet { - VkStructureType sType; - const void * pNext; - VkDescriptorSet dstSet; - uint32_t dstBinding; - uint32_t dstArrayElement; - uint32_t descriptorCount; - VkDescriptorType descriptorType; - const VkDescriptorImageInfo * pImageInfo; - const VkDescriptorBufferInfo * pBufferInfo; - const VkBufferView * pTexelBufferView; -} VkWriteDescriptorSet; - -typedef struct VkBufferCreateInfo { - VkStructureType sType; - const void * pNext; - VkBufferCreateFlags flags; - VkDeviceSize size; - VkBufferUsageFlags usage; - VkSharingMode sharingMode; - uint32_t queueFamilyIndexCount; - const uint32_t * pQueueFamilyIndices; -} VkBufferCreateInfo; - -typedef struct VkBufferViewCreateInfo { - VkStructureType sType; - const void * pNext; - VkBufferViewCreateFlags flags; - VkBuffer buffer; - VkFormat format; - VkDeviceSize offset; - VkDeviceSize range; -} VkBufferViewCreateInfo; - -typedef struct VkImageSubresource { - VkImageAspectFlags aspectMask; - uint32_t mipLevel; - uint32_t arrayLayer; -} VkImageSubresource; - -typedef struct VkImageSubresourceLayers { - VkImageAspectFlags aspectMask; - uint32_t mipLevel; - uint32_t baseArrayLayer; - uint32_t layerCount; -} VkImageSubresourceLayers; - -typedef struct VkImageSubresourceRange { - VkImageAspectFlags aspectMask; - uint32_t baseMipLevel; - uint32_t levelCount; - uint32_t baseArrayLayer; - uint32_t layerCount; -} VkImageSubresourceRange; - -typedef struct VkMemoryBarrier { - VkStructureType sType; - const void * pNext; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; -} VkMemoryBarrier; - -typedef struct VkBufferMemoryBarrier { - VkStructureType sType; - const void * pNext; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; - uint32_t srcQueueFamilyIndex; - uint32_t dstQueueFamilyIndex; - VkBuffer buffer; - VkDeviceSize offset; - VkDeviceSize size; -} VkBufferMemoryBarrier; - -typedef struct VkImageMemoryBarrier { - VkStructureType sType; - const void * pNext; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; - VkImageLayout oldLayout; - VkImageLayout newLayout; - uint32_t srcQueueFamilyIndex; - uint32_t dstQueueFamilyIndex; - VkImage image; - VkImageSubresourceRange subresourceRange; -} VkImageMemoryBarrier; - -typedef struct VkImageCreateInfo { - VkStructureType sType; - const void * pNext; - VkImageCreateFlags flags; - VkImageType imageType; - VkFormat format; - VkExtent3D extent; - uint32_t mipLevels; - uint32_t arrayLayers; - VkSampleCountFlagBits samples; - VkImageTiling tiling; - VkImageUsageFlags usage; - VkSharingMode sharingMode; - uint32_t queueFamilyIndexCount; - const uint32_t * pQueueFamilyIndices; - VkImageLayout initialLayout; -} VkImageCreateInfo; - -typedef struct VkSubresourceLayout { - VkDeviceSize offset; - VkDeviceSize size; - VkDeviceSize rowPitch; - VkDeviceSize arrayPitch; - VkDeviceSize depthPitch; -} VkSubresourceLayout; - -typedef struct VkImageViewCreateInfo { - VkStructureType sType; - const void * pNext; - VkImageViewCreateFlags flags; - VkImage image; - VkImageViewType viewType; - VkFormat format; - VkComponentMapping components; - VkImageSubresourceRange subresourceRange; -} VkImageViewCreateInfo; - -typedef struct VkBufferCopy { - VkDeviceSize srcOffset; - VkDeviceSize dstOffset; - VkDeviceSize size; -} VkBufferCopy; - -typedef struct VkSparseMemoryBind { - VkDeviceSize resourceOffset; - VkDeviceSize size; - VkDeviceMemory memory; - VkDeviceSize memoryOffset; - VkSparseMemoryBindFlags flags; -} VkSparseMemoryBind; - -typedef struct VkSparseImageMemoryBind { - VkImageSubresource subresource; - VkOffset3D offset; - VkExtent3D extent; - VkDeviceMemory memory; - VkDeviceSize memoryOffset; - VkSparseMemoryBindFlags flags; -} VkSparseImageMemoryBind; - -typedef struct VkSparseBufferMemoryBindInfo { - VkBuffer buffer; - uint32_t bindCount; - const VkSparseMemoryBind * pBinds; -} VkSparseBufferMemoryBindInfo; - -typedef struct VkSparseImageOpaqueMemoryBindInfo { - VkImage image; - uint32_t bindCount; - const VkSparseMemoryBind * pBinds; -} VkSparseImageOpaqueMemoryBindInfo; - -typedef struct VkSparseImageMemoryBindInfo { - VkImage image; - uint32_t bindCount; - const VkSparseImageMemoryBind * pBinds; -} VkSparseImageMemoryBindInfo; - -typedef struct VkBindSparseInfo { - VkStructureType sType; - const void * pNext; - uint32_t waitSemaphoreCount; - const VkSemaphore * pWaitSemaphores; - uint32_t bufferBindCount; - const VkSparseBufferMemoryBindInfo * pBufferBinds; - uint32_t imageOpaqueBindCount; - const VkSparseImageOpaqueMemoryBindInfo * pImageOpaqueBinds; - uint32_t imageBindCount; - const VkSparseImageMemoryBindInfo * pImageBinds; - uint32_t signalSemaphoreCount; - const VkSemaphore * pSignalSemaphores; -} VkBindSparseInfo; - -typedef struct VkImageCopy { - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffset; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffset; - VkExtent3D extent; -} VkImageCopy; - -typedef struct VkImageBlit { - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffsets [2]; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffsets [2]; -} VkImageBlit; - -typedef struct VkBufferImageCopy { - VkDeviceSize bufferOffset; - uint32_t bufferRowLength; - uint32_t bufferImageHeight; - VkImageSubresourceLayers imageSubresource; - VkOffset3D imageOffset; - VkExtent3D imageExtent; -} VkBufferImageCopy; - -typedef struct VkImageResolve { - VkImageSubresourceLayers srcSubresource; - VkOffset3D srcOffset; - VkImageSubresourceLayers dstSubresource; - VkOffset3D dstOffset; - VkExtent3D extent; -} VkImageResolve; - -typedef struct VkShaderModuleCreateInfo { - VkStructureType sType; - const void * pNext; - VkShaderModuleCreateFlags flags; - size_t codeSize; - const uint32_t * pCode; -} VkShaderModuleCreateInfo; - -typedef struct VkDescriptorSetLayoutBinding { - uint32_t binding; - VkDescriptorType descriptorType; - uint32_t descriptorCount; - VkShaderStageFlags stageFlags; - const VkSampler * pImmutableSamplers; -} VkDescriptorSetLayoutBinding; - -typedef struct VkDescriptorSetLayoutCreateInfo { - VkStructureType sType; - const void * pNext; - VkDescriptorSetLayoutCreateFlags flags; - uint32_t bindingCount; - const VkDescriptorSetLayoutBinding * pBindings; -} VkDescriptorSetLayoutCreateInfo; - -typedef struct VkDescriptorPoolCreateInfo { - VkStructureType sType; - const void * pNext; - VkDescriptorPoolCreateFlags flags; - uint32_t maxSets; - uint32_t poolSizeCount; - const VkDescriptorPoolSize * pPoolSizes; -} VkDescriptorPoolCreateInfo; - -typedef struct VkPipelineShaderStageCreateInfo { - VkStructureType sType; - const void * pNext; - VkPipelineShaderStageCreateFlags flags; - VkShaderStageFlagBits stage; - VkShaderModule module; - const char * pName; - const VkSpecializationInfo * pSpecializationInfo; -} VkPipelineShaderStageCreateInfo; - -typedef struct VkComputePipelineCreateInfo { - VkStructureType sType; - const void * pNext; - VkPipelineCreateFlags flags; - VkPipelineShaderStageCreateInfo stage; - VkPipelineLayout layout; - VkPipeline basePipelineHandle; - int32_t basePipelineIndex; -} VkComputePipelineCreateInfo; - -typedef struct VkPipelineVertexInputStateCreateInfo { - VkStructureType sType; - const void * pNext; - VkPipelineVertexInputStateCreateFlags flags; - uint32_t vertexBindingDescriptionCount; - const VkVertexInputBindingDescription * pVertexBindingDescriptions; - uint32_t vertexAttributeDescriptionCount; - const VkVertexInputAttributeDescription * pVertexAttributeDescriptions; -} VkPipelineVertexInputStateCreateInfo; - -typedef struct VkPipelineInputAssemblyStateCreateInfo { - VkStructureType sType; - const void * pNext; - VkPipelineInputAssemblyStateCreateFlags flags; - VkPrimitiveTopology topology; - VkBool32 primitiveRestartEnable; -} VkPipelineInputAssemblyStateCreateInfo; - -typedef struct VkPipelineTessellationStateCreateInfo { - VkStructureType sType; - const void * pNext; - VkPipelineTessellationStateCreateFlags flags; - uint32_t patchControlPoints; -} VkPipelineTessellationStateCreateInfo; - -typedef struct VkPipelineViewportStateCreateInfo { - VkStructureType sType; - const void * pNext; - VkPipelineViewportStateCreateFlags flags; - uint32_t viewportCount; - const VkViewport * pViewports; - uint32_t scissorCount; - const VkRect2D * pScissors; -} VkPipelineViewportStateCreateInfo; - -typedef struct VkPipelineRasterizationStateCreateInfo { - VkStructureType sType; - const void * pNext; - VkPipelineRasterizationStateCreateFlags flags; - VkBool32 depthClampEnable; - VkBool32 rasterizerDiscardEnable; - VkPolygonMode polygonMode; - VkCullModeFlags cullMode; - VkFrontFace frontFace; - VkBool32 depthBiasEnable; - float depthBiasConstantFactor; - float depthBiasClamp; - float depthBiasSlopeFactor; - float lineWidth; -} VkPipelineRasterizationStateCreateInfo; - -typedef struct VkPipelineMultisampleStateCreateInfo { - VkStructureType sType; - const void * pNext; - VkPipelineMultisampleStateCreateFlags flags; - VkSampleCountFlagBits rasterizationSamples; - VkBool32 sampleShadingEnable; - float minSampleShading; - const VkSampleMask * pSampleMask; - VkBool32 alphaToCoverageEnable; - VkBool32 alphaToOneEnable; -} VkPipelineMultisampleStateCreateInfo; - -typedef struct VkPipelineColorBlendAttachmentState { - VkBool32 blendEnable; - VkBlendFactor srcColorBlendFactor; - VkBlendFactor dstColorBlendFactor; - VkBlendOp colorBlendOp; - VkBlendFactor srcAlphaBlendFactor; - VkBlendFactor dstAlphaBlendFactor; - VkBlendOp alphaBlendOp; - VkColorComponentFlags colorWriteMask; -} VkPipelineColorBlendAttachmentState; - -typedef struct VkPipelineColorBlendStateCreateInfo { - VkStructureType sType; - const void * pNext; - VkPipelineColorBlendStateCreateFlags flags; - VkBool32 logicOpEnable; - VkLogicOp logicOp; - uint32_t attachmentCount; - const VkPipelineColorBlendAttachmentState * pAttachments; - float blendConstants [4]; -} VkPipelineColorBlendStateCreateInfo; - -typedef struct VkPipelineDynamicStateCreateInfo { - VkStructureType sType; - const void * pNext; - VkPipelineDynamicStateCreateFlags flags; - uint32_t dynamicStateCount; - const VkDynamicState * pDynamicStates; -} VkPipelineDynamicStateCreateInfo; - -typedef struct VkPipelineDepthStencilStateCreateInfo { - VkStructureType sType; - const void * pNext; - VkPipelineDepthStencilStateCreateFlags flags; - VkBool32 depthTestEnable; - VkBool32 depthWriteEnable; - VkCompareOp depthCompareOp; - VkBool32 depthBoundsTestEnable; - VkBool32 stencilTestEnable; - VkStencilOpState front; - VkStencilOpState back; - float minDepthBounds; - float maxDepthBounds; -} VkPipelineDepthStencilStateCreateInfo; - -typedef struct VkGraphicsPipelineCreateInfo { - VkStructureType sType; - const void * pNext; - VkPipelineCreateFlags flags; - uint32_t stageCount; - const VkPipelineShaderStageCreateInfo * pStages; - const VkPipelineVertexInputStateCreateInfo * pVertexInputState; - const VkPipelineInputAssemblyStateCreateInfo * pInputAssemblyState; - const VkPipelineTessellationStateCreateInfo * pTessellationState; - const VkPipelineViewportStateCreateInfo * pViewportState; - const VkPipelineRasterizationStateCreateInfo * pRasterizationState; - const VkPipelineMultisampleStateCreateInfo * pMultisampleState; - const VkPipelineDepthStencilStateCreateInfo * pDepthStencilState; - const VkPipelineColorBlendStateCreateInfo * pColorBlendState; - const VkPipelineDynamicStateCreateInfo * pDynamicState; - VkPipelineLayout layout; - VkRenderPass renderPass; - uint32_t subpass; - VkPipeline basePipelineHandle; - int32_t basePipelineIndex; -} VkGraphicsPipelineCreateInfo; - -typedef struct VkPipelineCacheCreateInfo { - VkStructureType sType; - const void * pNext; - VkPipelineCacheCreateFlags flags; - size_t initialDataSize; - const void * pInitialData; -} VkPipelineCacheCreateInfo; - -typedef struct VkPushConstantRange { - VkShaderStageFlags stageFlags; - uint32_t offset; - uint32_t size; -} VkPushConstantRange; - -typedef struct VkPipelineLayoutCreateInfo { - VkStructureType sType; - const void * pNext; - VkPipelineLayoutCreateFlags flags; - uint32_t setLayoutCount; - const VkDescriptorSetLayout * pSetLayouts; - uint32_t pushConstantRangeCount; - const VkPushConstantRange * pPushConstantRanges; -} VkPipelineLayoutCreateInfo; - -typedef struct VkSamplerCreateInfo { - VkStructureType sType; - const void * pNext; - VkSamplerCreateFlags flags; - VkFilter magFilter; - VkFilter minFilter; - VkSamplerMipmapMode mipmapMode; - VkSamplerAddressMode addressModeU; - VkSamplerAddressMode addressModeV; - VkSamplerAddressMode addressModeW; - float mipLodBias; - VkBool32 anisotropyEnable; - float maxAnisotropy; - VkBool32 compareEnable; - VkCompareOp compareOp; - float minLod; - float maxLod; - VkBorderColor borderColor; - VkBool32 unnormalizedCoordinates; -} VkSamplerCreateInfo; - -typedef struct VkCommandPoolCreateInfo { - VkStructureType sType; - const void * pNext; - VkCommandPoolCreateFlags flags; - uint32_t queueFamilyIndex; -} VkCommandPoolCreateInfo; - -typedef struct VkCommandBufferInheritanceInfo { - VkStructureType sType; - const void * pNext; - VkRenderPass renderPass; - uint32_t subpass; - VkFramebuffer framebuffer; - VkBool32 occlusionQueryEnable; - VkQueryControlFlags queryFlags; - VkQueryPipelineStatisticFlags pipelineStatistics; -} VkCommandBufferInheritanceInfo; - -typedef struct VkCommandBufferBeginInfo { - VkStructureType sType; - const void * pNext; - VkCommandBufferUsageFlags flags; - const VkCommandBufferInheritanceInfo * pInheritanceInfo; -} VkCommandBufferBeginInfo; - -typedef struct VkRenderPassBeginInfo { - VkStructureType sType; - const void * pNext; - VkRenderPass renderPass; - VkFramebuffer framebuffer; - VkRect2D renderArea; - uint32_t clearValueCount; - const VkClearValue * pClearValues; -} VkRenderPassBeginInfo; - -typedef struct VkClearAttachment { - VkImageAspectFlags aspectMask; - uint32_t colorAttachment; - VkClearValue clearValue; -} VkClearAttachment; - -typedef struct VkAttachmentDescription { - VkAttachmentDescriptionFlags flags; - VkFormat format; - VkSampleCountFlagBits samples; - VkAttachmentLoadOp loadOp; - VkAttachmentStoreOp storeOp; - VkAttachmentLoadOp stencilLoadOp; - VkAttachmentStoreOp stencilStoreOp; - VkImageLayout initialLayout; - VkImageLayout finalLayout; -} VkAttachmentDescription; - -typedef struct VkSubpassDescription { - VkSubpassDescriptionFlags flags; - VkPipelineBindPoint pipelineBindPoint; - uint32_t inputAttachmentCount; - const VkAttachmentReference * pInputAttachments; - uint32_t colorAttachmentCount; - const VkAttachmentReference * pColorAttachments; - const VkAttachmentReference * pResolveAttachments; - const VkAttachmentReference * pDepthStencilAttachment; - uint32_t preserveAttachmentCount; - const uint32_t * pPreserveAttachments; -} VkSubpassDescription; - -typedef struct VkSubpassDependency { - uint32_t srcSubpass; - uint32_t dstSubpass; - VkPipelineStageFlags srcStageMask; - VkPipelineStageFlags dstStageMask; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; - VkDependencyFlags dependencyFlags; -} VkSubpassDependency; - -typedef struct VkRenderPassCreateInfo { - VkStructureType sType; - const void * pNext; - VkRenderPassCreateFlags flags; - uint32_t attachmentCount; - const VkAttachmentDescription * pAttachments; - uint32_t subpassCount; - const VkSubpassDescription * pSubpasses; - uint32_t dependencyCount; - const VkSubpassDependency * pDependencies; -} VkRenderPassCreateInfo; - -typedef struct VkEventCreateInfo { - VkStructureType sType; - const void * pNext; - VkEventCreateFlags flags; -} VkEventCreateInfo; - -typedef struct VkFenceCreateInfo { - VkStructureType sType; - const void * pNext; - VkFenceCreateFlags flags; -} VkFenceCreateInfo; - -typedef struct VkPhysicalDeviceFeatures { - VkBool32 robustBufferAccess; - VkBool32 fullDrawIndexUint32; - VkBool32 imageCubeArray; - VkBool32 independentBlend; - VkBool32 geometryShader; - VkBool32 tessellationShader; - VkBool32 sampleRateShading; - VkBool32 dualSrcBlend; - VkBool32 logicOp; - VkBool32 multiDrawIndirect; - VkBool32 drawIndirectFirstInstance; - VkBool32 depthClamp; - VkBool32 depthBiasClamp; - VkBool32 fillModeNonSolid; - VkBool32 depthBounds; - VkBool32 wideLines; - VkBool32 largePoints; - VkBool32 alphaToOne; - VkBool32 multiViewport; - VkBool32 samplerAnisotropy; - VkBool32 textureCompressionETC2; - VkBool32 textureCompressionASTC_LDR; - VkBool32 textureCompressionBC; - VkBool32 occlusionQueryPrecise; - VkBool32 pipelineStatisticsQuery; - VkBool32 vertexPipelineStoresAndAtomics; - VkBool32 fragmentStoresAndAtomics; - VkBool32 shaderTessellationAndGeometryPointSize; - VkBool32 shaderImageGatherExtended; - VkBool32 shaderStorageImageExtendedFormats; - VkBool32 shaderStorageImageMultisample; - VkBool32 shaderStorageImageReadWithoutFormat; - VkBool32 shaderStorageImageWriteWithoutFormat; - VkBool32 shaderUniformBufferArrayDynamicIndexing; - VkBool32 shaderSampledImageArrayDynamicIndexing; - VkBool32 shaderStorageBufferArrayDynamicIndexing; - VkBool32 shaderStorageImageArrayDynamicIndexing; - VkBool32 shaderClipDistance; - VkBool32 shaderCullDistance; - VkBool32 shaderFloat64; - VkBool32 shaderInt64; - VkBool32 shaderInt16; - VkBool32 shaderResourceResidency; - VkBool32 shaderResourceMinLod; - VkBool32 sparseBinding; - VkBool32 sparseResidencyBuffer; - VkBool32 sparseResidencyImage2D; - VkBool32 sparseResidencyImage3D; - VkBool32 sparseResidency2Samples; - VkBool32 sparseResidency4Samples; - VkBool32 sparseResidency8Samples; - VkBool32 sparseResidency16Samples; - VkBool32 sparseResidencyAliased; - VkBool32 variableMultisampleRate; - VkBool32 inheritedQueries; -} VkPhysicalDeviceFeatures; - -typedef struct VkPhysicalDeviceSparseProperties { - VkBool32 residencyStandard2DBlockShape; - VkBool32 residencyStandard2DMultisampleBlockShape; - VkBool32 residencyStandard3DBlockShape; - VkBool32 residencyAlignedMipSize; - VkBool32 residencyNonResidentStrict; -} VkPhysicalDeviceSparseProperties; - -typedef struct VkPhysicalDeviceLimits { - uint32_t maxImageDimension1D; - uint32_t maxImageDimension2D; - uint32_t maxImageDimension3D; - uint32_t maxImageDimensionCube; - uint32_t maxImageArrayLayers; - uint32_t maxTexelBufferElements; - uint32_t maxUniformBufferRange; - uint32_t maxStorageBufferRange; - uint32_t maxPushConstantsSize; - uint32_t maxMemoryAllocationCount; - uint32_t maxSamplerAllocationCount; - VkDeviceSize bufferImageGranularity; - VkDeviceSize sparseAddressSpaceSize; - uint32_t maxBoundDescriptorSets; - uint32_t maxPerStageDescriptorSamplers; - uint32_t maxPerStageDescriptorUniformBuffers; - uint32_t maxPerStageDescriptorStorageBuffers; - uint32_t maxPerStageDescriptorSampledImages; - uint32_t maxPerStageDescriptorStorageImages; - uint32_t maxPerStageDescriptorInputAttachments; - uint32_t maxPerStageResources; - uint32_t maxDescriptorSetSamplers; - uint32_t maxDescriptorSetUniformBuffers; - uint32_t maxDescriptorSetUniformBuffersDynamic; - uint32_t maxDescriptorSetStorageBuffers; - uint32_t maxDescriptorSetStorageBuffersDynamic; - uint32_t maxDescriptorSetSampledImages; - uint32_t maxDescriptorSetStorageImages; - uint32_t maxDescriptorSetInputAttachments; - uint32_t maxVertexInputAttributes; - uint32_t maxVertexInputBindings; - uint32_t maxVertexInputAttributeOffset; - uint32_t maxVertexInputBindingStride; - uint32_t maxVertexOutputComponents; - uint32_t maxTessellationGenerationLevel; - uint32_t maxTessellationPatchSize; - uint32_t maxTessellationControlPerVertexInputComponents; - uint32_t maxTessellationControlPerVertexOutputComponents; - uint32_t maxTessellationControlPerPatchOutputComponents; - uint32_t maxTessellationControlTotalOutputComponents; - uint32_t maxTessellationEvaluationInputComponents; - uint32_t maxTessellationEvaluationOutputComponents; - uint32_t maxGeometryShaderInvocations; - uint32_t maxGeometryInputComponents; - uint32_t maxGeometryOutputComponents; - uint32_t maxGeometryOutputVertices; - uint32_t maxGeometryTotalOutputComponents; - uint32_t maxFragmentInputComponents; - uint32_t maxFragmentOutputAttachments; - uint32_t maxFragmentDualSrcAttachments; - uint32_t maxFragmentCombinedOutputResources; - uint32_t maxComputeSharedMemorySize; - uint32_t maxComputeWorkGroupCount [3]; - uint32_t maxComputeWorkGroupInvocations; - uint32_t maxComputeWorkGroupSize [3]; - uint32_t subPixelPrecisionBits; - uint32_t subTexelPrecisionBits; - uint32_t mipmapPrecisionBits; - uint32_t maxDrawIndexedIndexValue; - uint32_t maxDrawIndirectCount; - float maxSamplerLodBias; - float maxSamplerAnisotropy; - uint32_t maxViewports; - uint32_t maxViewportDimensions [2]; - float viewportBoundsRange [2]; - uint32_t viewportSubPixelBits; - size_t minMemoryMapAlignment; - VkDeviceSize minTexelBufferOffsetAlignment; - VkDeviceSize minUniformBufferOffsetAlignment; - VkDeviceSize minStorageBufferOffsetAlignment; - int32_t minTexelOffset; - uint32_t maxTexelOffset; - int32_t minTexelGatherOffset; - uint32_t maxTexelGatherOffset; - float minInterpolationOffset; - float maxInterpolationOffset; - uint32_t subPixelInterpolationOffsetBits; - uint32_t maxFramebufferWidth; - uint32_t maxFramebufferHeight; - uint32_t maxFramebufferLayers; - VkSampleCountFlags framebufferColorSampleCounts; - VkSampleCountFlags framebufferDepthSampleCounts; - VkSampleCountFlags framebufferStencilSampleCounts; - VkSampleCountFlags framebufferNoAttachmentsSampleCounts; - uint32_t maxColorAttachments; - VkSampleCountFlags sampledImageColorSampleCounts; - VkSampleCountFlags sampledImageIntegerSampleCounts; - VkSampleCountFlags sampledImageDepthSampleCounts; - VkSampleCountFlags sampledImageStencilSampleCounts; - VkSampleCountFlags storageImageSampleCounts; - uint32_t maxSampleMaskWords; - VkBool32 timestampComputeAndGraphics; - float timestampPeriod; - uint32_t maxClipDistances; - uint32_t maxCullDistances; - uint32_t maxCombinedClipAndCullDistances; - uint32_t discreteQueuePriorities; - float pointSizeRange [2]; - float lineWidthRange [2]; - float pointSizeGranularity; - float lineWidthGranularity; - VkBool32 strictLines; - VkBool32 standardSampleLocations; - VkDeviceSize optimalBufferCopyOffsetAlignment; - VkDeviceSize optimalBufferCopyRowPitchAlignment; - VkDeviceSize nonCoherentAtomSize; -} VkPhysicalDeviceLimits; - -typedef struct VkSemaphoreCreateInfo { - VkStructureType sType; - const void * pNext; - VkSemaphoreCreateFlags flags; -} VkSemaphoreCreateInfo; - -typedef struct VkQueryPoolCreateInfo { - VkStructureType sType; - const void * pNext; - VkQueryPoolCreateFlags flags; - VkQueryType queryType; - uint32_t queryCount; - VkQueryPipelineStatisticFlags pipelineStatistics; -} VkQueryPoolCreateInfo; - -typedef struct VkFramebufferCreateInfo { - VkStructureType sType; - const void * pNext; - VkFramebufferCreateFlags flags; - VkRenderPass renderPass; - uint32_t attachmentCount; - const VkImageView * pAttachments; - uint32_t width; - uint32_t height; - uint32_t layers; -} VkFramebufferCreateInfo; - -typedef struct VkSubmitInfo { - VkStructureType sType; - const void * pNext; - uint32_t waitSemaphoreCount; - const VkSemaphore * pWaitSemaphores; - const VkPipelineStageFlags * pWaitDstStageMask; - uint32_t commandBufferCount; - const VkCommandBuffer * pCommandBuffers; - uint32_t signalSemaphoreCount; - const VkSemaphore * pSignalSemaphores; -} VkSubmitInfo; - -typedef struct VkSurfaceCapabilitiesKHR { - uint32_t minImageCount; - uint32_t maxImageCount; - VkExtent2D currentExtent; - VkExtent2D minImageExtent; - VkExtent2D maxImageExtent; - uint32_t maxImageArrayLayers; - VkSurfaceTransformFlagsKHR supportedTransforms; - VkSurfaceTransformFlagBitsKHR currentTransform; - VkCompositeAlphaFlagsKHR supportedCompositeAlpha; - VkImageUsageFlags supportedUsageFlags; -} VkSurfaceCapabilitiesKHR; - -typedef struct VkSwapchainCreateInfoKHR { - VkStructureType sType; - const void * pNext; - VkSwapchainCreateFlagsKHR flags; - VkSurfaceKHR surface; - uint32_t minImageCount; - VkFormat imageFormat; - VkColorSpaceKHR imageColorSpace; - VkExtent2D imageExtent; - uint32_t imageArrayLayers; - VkImageUsageFlags imageUsage; - VkSharingMode imageSharingMode; - uint32_t queueFamilyIndexCount; - const uint32_t * pQueueFamilyIndices; - VkSurfaceTransformFlagBitsKHR preTransform; - VkCompositeAlphaFlagBitsKHR compositeAlpha; - VkPresentModeKHR presentMode; - VkBool32 clipped; - VkSwapchainKHR oldSwapchain; -} VkSwapchainCreateInfoKHR; - -typedef struct VkDebugReportCallbackCreateInfoEXT { - VkStructureType sType; - const void * pNext; - VkDebugReportFlagsEXT flags; - PFN_vkDebugReportCallbackEXT pfnCallback; - void * pUserData; -} VkDebugReportCallbackCreateInfoEXT; - -typedef struct VkPhysicalDeviceFeatures2 { - VkStructureType sType; - void * pNext; - VkPhysicalDeviceFeatures features; -} VkPhysicalDeviceFeatures2; - -typedef struct VkFormatProperties2 { - VkStructureType sType; - void * pNext; - VkFormatProperties formatProperties; -} VkFormatProperties2; - -typedef struct VkImageFormatProperties2 { - VkStructureType sType; - void * pNext; - VkImageFormatProperties imageFormatProperties; -} VkImageFormatProperties2; - -typedef struct VkPhysicalDeviceImageFormatInfo2 { - VkStructureType sType; - const void * pNext; - VkFormat format; - VkImageType type; - VkImageTiling tiling; - VkImageUsageFlags usage; - VkImageCreateFlags flags; -} VkPhysicalDeviceImageFormatInfo2; - -typedef struct VkQueueFamilyProperties2 { - VkStructureType sType; - void * pNext; - VkQueueFamilyProperties queueFamilyProperties; -} VkQueueFamilyProperties2; - -typedef struct VkSparseImageFormatProperties2 { - VkStructureType sType; - void * pNext; - VkSparseImageFormatProperties properties; -} VkSparseImageFormatProperties2; - -typedef struct VkPhysicalDeviceSparseImageFormatInfo2 { - VkStructureType sType; - const void * pNext; - VkFormat format; - VkImageType type; - VkSampleCountFlagBits samples; - VkImageUsageFlags usage; - VkImageTiling tiling; -} VkPhysicalDeviceSparseImageFormatInfo2; - -typedef struct VkPhysicalDeviceVariablePointersFeatures { - VkStructureType sType; - void * pNext; - VkBool32 variablePointersStorageBuffer; - VkBool32 variablePointers; -} VkPhysicalDeviceVariablePointersFeatures; - -typedef struct VkPhysicalDeviceVariablePointersFeatures VkPhysicalDeviceVariablePointerFeatures; - -typedef struct VkExternalMemoryProperties { - VkExternalMemoryFeatureFlags externalMemoryFeatures; - VkExternalMemoryHandleTypeFlags exportFromImportedHandleTypes; - VkExternalMemoryHandleTypeFlags compatibleHandleTypes; -} VkExternalMemoryProperties; - -typedef struct VkExternalImageFormatProperties { - VkStructureType sType; - void * pNext; - VkExternalMemoryProperties externalMemoryProperties; -} VkExternalImageFormatProperties; - -typedef struct VkPhysicalDeviceExternalBufferInfo { - VkStructureType sType; - const void * pNext; - VkBufferCreateFlags flags; - VkBufferUsageFlags usage; - VkExternalMemoryHandleTypeFlagBits handleType; -} VkPhysicalDeviceExternalBufferInfo; - -typedef struct VkExternalBufferProperties { - VkStructureType sType; - void * pNext; - VkExternalMemoryProperties externalMemoryProperties; -} VkExternalBufferProperties; - -typedef struct VkPhysicalDeviceIDProperties { - VkStructureType sType; - void * pNext; - uint8_t deviceUUID [ VK_UUID_SIZE ]; - uint8_t driverUUID [ VK_UUID_SIZE ]; - uint8_t deviceLUID [ VK_LUID_SIZE ]; - uint32_t deviceNodeMask; - VkBool32 deviceLUIDValid; -} VkPhysicalDeviceIDProperties; - -typedef struct VkExternalMemoryImageCreateInfo { - VkStructureType sType; - const void * pNext; - VkExternalMemoryHandleTypeFlags handleTypes; -} VkExternalMemoryImageCreateInfo; - -typedef struct VkExternalMemoryBufferCreateInfo { - VkStructureType sType; - const void * pNext; - VkExternalMemoryHandleTypeFlags handleTypes; -} VkExternalMemoryBufferCreateInfo; - -typedef struct VkExportMemoryAllocateInfo { - VkStructureType sType; - const void * pNext; - VkExternalMemoryHandleTypeFlags handleTypes; -} VkExportMemoryAllocateInfo; - -typedef struct VkExternalSemaphoreProperties { - VkStructureType sType; - void * pNext; - VkExternalSemaphoreHandleTypeFlags exportFromImportedHandleTypes; - VkExternalSemaphoreHandleTypeFlags compatibleHandleTypes; - VkExternalSemaphoreFeatureFlags externalSemaphoreFeatures; -} VkExternalSemaphoreProperties; - -typedef struct VkExportSemaphoreCreateInfo { - VkStructureType sType; - const void * pNext; - VkExternalSemaphoreHandleTypeFlags handleTypes; -} VkExportSemaphoreCreateInfo; - -typedef struct VkExternalFenceProperties { - VkStructureType sType; - void * pNext; - VkExternalFenceHandleTypeFlags exportFromImportedHandleTypes; - VkExternalFenceHandleTypeFlags compatibleHandleTypes; - VkExternalFenceFeatureFlags externalFenceFeatures; -} VkExternalFenceProperties; - -typedef struct VkExportFenceCreateInfo { - VkStructureType sType; - const void * pNext; - VkExternalFenceHandleTypeFlags handleTypes; -} VkExportFenceCreateInfo; - -typedef struct VkPhysicalDeviceMultiviewFeatures { - VkStructureType sType; - void * pNext; - VkBool32 multiview; - VkBool32 multiviewGeometryShader; - VkBool32 multiviewTessellationShader; -} VkPhysicalDeviceMultiviewFeatures; - -typedef struct VkPhysicalDeviceGroupProperties { - VkStructureType sType; - void * pNext; - uint32_t physicalDeviceCount; - VkPhysicalDevice physicalDevices [ VK_MAX_DEVICE_GROUP_SIZE ]; - VkBool32 subsetAllocation; -} VkPhysicalDeviceGroupProperties; - -typedef struct VkMemoryAllocateFlagsInfo { - VkStructureType sType; - const void * pNext; - VkMemoryAllocateFlags flags; - uint32_t deviceMask; -} VkMemoryAllocateFlagsInfo; - -typedef struct VkBindBufferMemoryInfo { - VkStructureType sType; - const void * pNext; - VkBuffer buffer; - VkDeviceMemory memory; - VkDeviceSize memoryOffset; -} VkBindBufferMemoryInfo; - -typedef struct VkBindImageMemoryInfo { - VkStructureType sType; - const void * pNext; - VkImage image; - VkDeviceMemory memory; - VkDeviceSize memoryOffset; -} VkBindImageMemoryInfo; - -typedef struct VkDeviceGroupPresentCapabilitiesKHR { - VkStructureType sType; - const void * pNext; - uint32_t presentMask [ VK_MAX_DEVICE_GROUP_SIZE ]; - VkDeviceGroupPresentModeFlagsKHR modes; -} VkDeviceGroupPresentCapabilitiesKHR; - -typedef struct VkDeviceGroupSwapchainCreateInfoKHR { - VkStructureType sType; - const void * pNext; - VkDeviceGroupPresentModeFlagsKHR modes; -} VkDeviceGroupSwapchainCreateInfoKHR; - -typedef struct VkDescriptorUpdateTemplateCreateInfo { - VkStructureType sType; - const void * pNext; - VkDescriptorUpdateTemplateCreateFlags flags; - uint32_t descriptorUpdateEntryCount; - const VkDescriptorUpdateTemplateEntry * pDescriptorUpdateEntries; - VkDescriptorUpdateTemplateType templateType; - VkDescriptorSetLayout descriptorSetLayout; - VkPipelineBindPoint pipelineBindPoint; - VkPipelineLayout pipelineLayout; - uint32_t set; -} VkDescriptorUpdateTemplateCreateInfo; - -typedef struct VkInputAttachmentAspectReference { - uint32_t subpass; - uint32_t inputAttachmentIndex; - VkImageAspectFlags aspectMask; -} VkInputAttachmentAspectReference; - -typedef struct VkRenderPassInputAttachmentAspectCreateInfo { - VkStructureType sType; - const void * pNext; - uint32_t aspectReferenceCount; - const VkInputAttachmentAspectReference * pAspectReferences; -} VkRenderPassInputAttachmentAspectCreateInfo; - -typedef struct VkPhysicalDevice16BitStorageFeatures { - VkStructureType sType; - void * pNext; - VkBool32 storageBuffer16BitAccess; - VkBool32 uniformAndStorageBuffer16BitAccess; - VkBool32 storagePushConstant16; - VkBool32 storageInputOutput16; -} VkPhysicalDevice16BitStorageFeatures; - -typedef struct VkPhysicalDeviceSubgroupProperties { - VkStructureType sType; - void * pNext; - uint32_t subgroupSize; - VkShaderStageFlags supportedStages; - VkSubgroupFeatureFlags supportedOperations; - VkBool32 quadOperationsInAllStages; -} VkPhysicalDeviceSubgroupProperties; - -typedef struct VkMemoryRequirements2 { - VkStructureType sType; - void * pNext; - VkMemoryRequirements memoryRequirements; -} VkMemoryRequirements2; - -typedef struct VkSparseImageMemoryRequirements2 { - VkStructureType sType; - void * pNext; - VkSparseImageMemoryRequirements memoryRequirements; -} VkSparseImageMemoryRequirements2; - -typedef struct VkMemoryDedicatedRequirements { - VkStructureType sType; - void * pNext; - VkBool32 prefersDedicatedAllocation; - VkBool32 requiresDedicatedAllocation; -} VkMemoryDedicatedRequirements; - -typedef struct VkImageViewUsageCreateInfo { - VkStructureType sType; - const void * pNext; - VkImageUsageFlags usage; -} VkImageViewUsageCreateInfo; - -typedef struct VkSamplerYcbcrConversionCreateInfo { - VkStructureType sType; - const void * pNext; - VkFormat format; - VkSamplerYcbcrModelConversion ycbcrModel; - VkSamplerYcbcrRange ycbcrRange; - VkComponentMapping components; - VkChromaLocation xChromaOffset; - VkChromaLocation yChromaOffset; - VkFilter chromaFilter; - VkBool32 forceExplicitReconstruction; -} VkSamplerYcbcrConversionCreateInfo; - -typedef struct VkPhysicalDeviceSamplerYcbcrConversionFeatures { - VkStructureType sType; - void * pNext; - VkBool32 samplerYcbcrConversion; -} VkPhysicalDeviceSamplerYcbcrConversionFeatures; - -typedef struct VkProtectedSubmitInfo { - VkStructureType sType; - const void * pNext; - VkBool32 protectedSubmit; -} VkProtectedSubmitInfo; - -typedef struct VkPhysicalDeviceProtectedMemoryFeatures { - VkStructureType sType; - void * pNext; - VkBool32 protectedMemory; -} VkPhysicalDeviceProtectedMemoryFeatures; - -typedef struct VkPhysicalDeviceProtectedMemoryProperties { - VkStructureType sType; - void * pNext; - VkBool32 protectedNoFault; -} VkPhysicalDeviceProtectedMemoryProperties; - -typedef struct VkDeviceQueueInfo2 { - VkStructureType sType; - const void * pNext; - VkDeviceQueueCreateFlags flags; - uint32_t queueFamilyIndex; - uint32_t queueIndex; -} VkDeviceQueueInfo2; - -typedef struct VkPhysicalDeviceMaintenance3Properties { - VkStructureType sType; - void * pNext; - uint32_t maxPerSetDescriptors; - VkDeviceSize maxMemoryAllocationSize; -} VkPhysicalDeviceMaintenance3Properties; - -typedef struct VkDescriptorSetLayoutSupport { - VkStructureType sType; - void * pNext; - VkBool32 supported; -} VkDescriptorSetLayoutSupport; - -typedef struct VkPhysicalDeviceShaderDrawParametersFeatures { - VkStructureType sType; - void * pNext; - VkBool32 shaderDrawParameters; -} VkPhysicalDeviceShaderDrawParametersFeatures; - -typedef struct VkPhysicalDeviceShaderDrawParametersFeatures VkPhysicalDeviceShaderDrawParameterFeatures; - -typedef struct VkPhysicalDeviceProperties { - uint32_t apiVersion; - uint32_t driverVersion; - uint32_t vendorID; - uint32_t deviceID; - VkPhysicalDeviceType deviceType; - char deviceName [ VK_MAX_PHYSICAL_DEVICE_NAME_SIZE ]; - uint8_t pipelineCacheUUID [ VK_UUID_SIZE ]; - VkPhysicalDeviceLimits limits; - VkPhysicalDeviceSparseProperties sparseProperties; -} VkPhysicalDeviceProperties; - -typedef struct VkDeviceCreateInfo { - VkStructureType sType; - const void * pNext; - VkDeviceCreateFlags flags; - uint32_t queueCreateInfoCount; - const VkDeviceQueueCreateInfo * pQueueCreateInfos; - uint32_t enabledLayerCount; - const char * const* ppEnabledLayerNames; - uint32_t enabledExtensionCount; - const char * const* ppEnabledExtensionNames; - const VkPhysicalDeviceFeatures * pEnabledFeatures; -} VkDeviceCreateInfo; - -typedef struct VkPhysicalDeviceMemoryProperties { - uint32_t memoryTypeCount; - VkMemoryType memoryTypes [ VK_MAX_MEMORY_TYPES ]; - uint32_t memoryHeapCount; - VkMemoryHeap memoryHeaps [ VK_MAX_MEMORY_HEAPS ]; -} VkPhysicalDeviceMemoryProperties; - -typedef struct VkPhysicalDeviceProperties2 { - VkStructureType sType; - void * pNext; - VkPhysicalDeviceProperties properties; -} VkPhysicalDeviceProperties2; - -typedef struct VkPhysicalDeviceMemoryProperties2 { - VkStructureType sType; - void * pNext; - VkPhysicalDeviceMemoryProperties memoryProperties; -} VkPhysicalDeviceMemoryProperties2; - - - -#define VK_VERSION_1_0 1 -GLAD_API_CALL int GLAD_VK_VERSION_1_0; -#define VK_VERSION_1_1 1 -GLAD_API_CALL int GLAD_VK_VERSION_1_1; -#define VK_EXT_debug_report 1 -GLAD_API_CALL int GLAD_VK_EXT_debug_report; -#define VK_KHR_surface 1 -GLAD_API_CALL int GLAD_VK_KHR_surface; -#define VK_KHR_swapchain 1 -GLAD_API_CALL int GLAD_VK_KHR_swapchain; - - -typedef VkResult (GLAD_API_PTR *PFN_vkAcquireNextImage2KHR)(VkDevice device, const VkAcquireNextImageInfoKHR * pAcquireInfo, uint32_t * pImageIndex); -typedef VkResult (GLAD_API_PTR *PFN_vkAcquireNextImageKHR)(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t * pImageIndex); -typedef VkResult (GLAD_API_PTR *PFN_vkAllocateCommandBuffers)(VkDevice device, const VkCommandBufferAllocateInfo * pAllocateInfo, VkCommandBuffer * pCommandBuffers); -typedef VkResult (GLAD_API_PTR *PFN_vkAllocateDescriptorSets)(VkDevice device, const VkDescriptorSetAllocateInfo * pAllocateInfo, VkDescriptorSet * pDescriptorSets); -typedef VkResult (GLAD_API_PTR *PFN_vkAllocateMemory)(VkDevice device, const VkMemoryAllocateInfo * pAllocateInfo, const VkAllocationCallbacks * pAllocator, VkDeviceMemory * pMemory); -typedef VkResult (GLAD_API_PTR *PFN_vkBeginCommandBuffer)(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo * pBeginInfo); -typedef VkResult (GLAD_API_PTR *PFN_vkBindBufferMemory)(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset); -typedef VkResult (GLAD_API_PTR *PFN_vkBindBufferMemory2)(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo * pBindInfos); -typedef VkResult (GLAD_API_PTR *PFN_vkBindImageMemory)(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset); -typedef VkResult (GLAD_API_PTR *PFN_vkBindImageMemory2)(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo * pBindInfos); -typedef void (GLAD_API_PTR *PFN_vkCmdBeginQuery)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags); -typedef void (GLAD_API_PTR *PFN_vkCmdBeginRenderPass)(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo * pRenderPassBegin, VkSubpassContents contents); -typedef void (GLAD_API_PTR *PFN_vkCmdBindDescriptorSets)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet * pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t * pDynamicOffsets); -typedef void (GLAD_API_PTR *PFN_vkCmdBindIndexBuffer)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType); -typedef void (GLAD_API_PTR *PFN_vkCmdBindPipeline)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline); -typedef void (GLAD_API_PTR *PFN_vkCmdBindVertexBuffers)(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer * pBuffers, const VkDeviceSize * pOffsets); -typedef void (GLAD_API_PTR *PFN_vkCmdBlitImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit * pRegions, VkFilter filter); -typedef void (GLAD_API_PTR *PFN_vkCmdClearAttachments)(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment * pAttachments, uint32_t rectCount, const VkClearRect * pRects); -typedef void (GLAD_API_PTR *PFN_vkCmdClearColorImage)(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue * pColor, uint32_t rangeCount, const VkImageSubresourceRange * pRanges); -typedef void (GLAD_API_PTR *PFN_vkCmdClearDepthStencilImage)(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue * pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange * pRanges); -typedef void (GLAD_API_PTR *PFN_vkCmdCopyBuffer)(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy * pRegions); -typedef void (GLAD_API_PTR *PFN_vkCmdCopyBufferToImage)(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy * pRegions); -typedef void (GLAD_API_PTR *PFN_vkCmdCopyImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy * pRegions); -typedef void (GLAD_API_PTR *PFN_vkCmdCopyImageToBuffer)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy * pRegions); -typedef void (GLAD_API_PTR *PFN_vkCmdCopyQueryPoolResults)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags); -typedef void (GLAD_API_PTR *PFN_vkCmdDispatch)(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); -typedef void (GLAD_API_PTR *PFN_vkCmdDispatchBase)(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); -typedef void (GLAD_API_PTR *PFN_vkCmdDispatchIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset); -typedef void (GLAD_API_PTR *PFN_vkCmdDraw)(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance); -typedef void (GLAD_API_PTR *PFN_vkCmdDrawIndexed)(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance); -typedef void (GLAD_API_PTR *PFN_vkCmdDrawIndexedIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); -typedef void (GLAD_API_PTR *PFN_vkCmdDrawIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); -typedef void (GLAD_API_PTR *PFN_vkCmdEndQuery)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query); -typedef void (GLAD_API_PTR *PFN_vkCmdEndRenderPass)(VkCommandBuffer commandBuffer); -typedef void (GLAD_API_PTR *PFN_vkCmdExecuteCommands)(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer * pCommandBuffers); -typedef void (GLAD_API_PTR *PFN_vkCmdFillBuffer)(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data); -typedef void (GLAD_API_PTR *PFN_vkCmdNextSubpass)(VkCommandBuffer commandBuffer, VkSubpassContents contents); -typedef void (GLAD_API_PTR *PFN_vkCmdPipelineBarrier)(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const VkMemoryBarrier * pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier * pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier * pImageMemoryBarriers); -typedef void (GLAD_API_PTR *PFN_vkCmdPushConstants)(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void * pValues); -typedef void (GLAD_API_PTR *PFN_vkCmdResetEvent)(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); -typedef void (GLAD_API_PTR *PFN_vkCmdResetQueryPool)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount); -typedef void (GLAD_API_PTR *PFN_vkCmdResolveImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve * pRegions); -typedef void (GLAD_API_PTR *PFN_vkCmdSetBlendConstants)(VkCommandBuffer commandBuffer, const float blendConstants [4]); -typedef void (GLAD_API_PTR *PFN_vkCmdSetDepthBias)(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor); -typedef void (GLAD_API_PTR *PFN_vkCmdSetDepthBounds)(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds); -typedef void (GLAD_API_PTR *PFN_vkCmdSetDeviceMask)(VkCommandBuffer commandBuffer, uint32_t deviceMask); -typedef void (GLAD_API_PTR *PFN_vkCmdSetEvent)(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); -typedef void (GLAD_API_PTR *PFN_vkCmdSetLineWidth)(VkCommandBuffer commandBuffer, float lineWidth); -typedef void (GLAD_API_PTR *PFN_vkCmdSetScissor)(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D * pScissors); -typedef void (GLAD_API_PTR *PFN_vkCmdSetStencilCompareMask)(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask); -typedef void (GLAD_API_PTR *PFN_vkCmdSetStencilReference)(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference); -typedef void (GLAD_API_PTR *PFN_vkCmdSetStencilWriteMask)(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask); -typedef void (GLAD_API_PTR *PFN_vkCmdSetViewport)(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport * pViewports); -typedef void (GLAD_API_PTR *PFN_vkCmdUpdateBuffer)(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void * pData); -typedef void (GLAD_API_PTR *PFN_vkCmdWaitEvents)(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent * pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const VkMemoryBarrier * pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier * pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier * pImageMemoryBarriers); -typedef void (GLAD_API_PTR *PFN_vkCmdWriteTimestamp)(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query); -typedef VkResult (GLAD_API_PTR *PFN_vkCreateBuffer)(VkDevice device, const VkBufferCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkBuffer * pBuffer); -typedef VkResult (GLAD_API_PTR *PFN_vkCreateBufferView)(VkDevice device, const VkBufferViewCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkBufferView * pView); -typedef VkResult (GLAD_API_PTR *PFN_vkCreateCommandPool)(VkDevice device, const VkCommandPoolCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkCommandPool * pCommandPool); -typedef VkResult (GLAD_API_PTR *PFN_vkCreateComputePipelines)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo * pCreateInfos, const VkAllocationCallbacks * pAllocator, VkPipeline * pPipelines); -typedef VkResult (GLAD_API_PTR *PFN_vkCreateDebugReportCallbackEXT)(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkDebugReportCallbackEXT * pCallback); -typedef VkResult (GLAD_API_PTR *PFN_vkCreateDescriptorPool)(VkDevice device, const VkDescriptorPoolCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkDescriptorPool * pDescriptorPool); -typedef VkResult (GLAD_API_PTR *PFN_vkCreateDescriptorSetLayout)(VkDevice device, const VkDescriptorSetLayoutCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkDescriptorSetLayout * pSetLayout); -typedef VkResult (GLAD_API_PTR *PFN_vkCreateDescriptorUpdateTemplate)(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkDescriptorUpdateTemplate * pDescriptorUpdateTemplate); -typedef VkResult (GLAD_API_PTR *PFN_vkCreateDevice)(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkDevice * pDevice); -typedef VkResult (GLAD_API_PTR *PFN_vkCreateEvent)(VkDevice device, const VkEventCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkEvent * pEvent); -typedef VkResult (GLAD_API_PTR *PFN_vkCreateFence)(VkDevice device, const VkFenceCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkFence * pFence); -typedef VkResult (GLAD_API_PTR *PFN_vkCreateFramebuffer)(VkDevice device, const VkFramebufferCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkFramebuffer * pFramebuffer); -typedef VkResult (GLAD_API_PTR *PFN_vkCreateGraphicsPipelines)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo * pCreateInfos, const VkAllocationCallbacks * pAllocator, VkPipeline * pPipelines); -typedef VkResult (GLAD_API_PTR *PFN_vkCreateImage)(VkDevice device, const VkImageCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkImage * pImage); -typedef VkResult (GLAD_API_PTR *PFN_vkCreateImageView)(VkDevice device, const VkImageViewCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkImageView * pView); -typedef VkResult (GLAD_API_PTR *PFN_vkCreateInstance)(const VkInstanceCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkInstance * pInstance); -typedef VkResult (GLAD_API_PTR *PFN_vkCreatePipelineCache)(VkDevice device, const VkPipelineCacheCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkPipelineCache * pPipelineCache); -typedef VkResult (GLAD_API_PTR *PFN_vkCreatePipelineLayout)(VkDevice device, const VkPipelineLayoutCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkPipelineLayout * pPipelineLayout); -typedef VkResult (GLAD_API_PTR *PFN_vkCreateQueryPool)(VkDevice device, const VkQueryPoolCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkQueryPool * pQueryPool); -typedef VkResult (GLAD_API_PTR *PFN_vkCreateRenderPass)(VkDevice device, const VkRenderPassCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkRenderPass * pRenderPass); -typedef VkResult (GLAD_API_PTR *PFN_vkCreateSampler)(VkDevice device, const VkSamplerCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkSampler * pSampler); -typedef VkResult (GLAD_API_PTR *PFN_vkCreateSamplerYcbcrConversion)(VkDevice device, const VkSamplerYcbcrConversionCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkSamplerYcbcrConversion * pYcbcrConversion); -typedef VkResult (GLAD_API_PTR *PFN_vkCreateSemaphore)(VkDevice device, const VkSemaphoreCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkSemaphore * pSemaphore); -typedef VkResult (GLAD_API_PTR *PFN_vkCreateShaderModule)(VkDevice device, const VkShaderModuleCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkShaderModule * pShaderModule); -typedef VkResult (GLAD_API_PTR *PFN_vkCreateSwapchainKHR)(VkDevice device, const VkSwapchainCreateInfoKHR * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkSwapchainKHR * pSwapchain); -typedef void (GLAD_API_PTR *PFN_vkDebugReportMessageEXT)(VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char * pLayerPrefix, const char * pMessage); -typedef void (GLAD_API_PTR *PFN_vkDestroyBuffer)(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks * pAllocator); -typedef void (GLAD_API_PTR *PFN_vkDestroyBufferView)(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks * pAllocator); -typedef void (GLAD_API_PTR *PFN_vkDestroyCommandPool)(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks * pAllocator); -typedef void (GLAD_API_PTR *PFN_vkDestroyDebugReportCallbackEXT)(VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks * pAllocator); -typedef void (GLAD_API_PTR *PFN_vkDestroyDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks * pAllocator); -typedef void (GLAD_API_PTR *PFN_vkDestroyDescriptorSetLayout)(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks * pAllocator); -typedef void (GLAD_API_PTR *PFN_vkDestroyDescriptorUpdateTemplate)(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks * pAllocator); -typedef void (GLAD_API_PTR *PFN_vkDestroyDevice)(VkDevice device, const VkAllocationCallbacks * pAllocator); -typedef void (GLAD_API_PTR *PFN_vkDestroyEvent)(VkDevice device, VkEvent event, const VkAllocationCallbacks * pAllocator); -typedef void (GLAD_API_PTR *PFN_vkDestroyFence)(VkDevice device, VkFence fence, const VkAllocationCallbacks * pAllocator); -typedef void (GLAD_API_PTR *PFN_vkDestroyFramebuffer)(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks * pAllocator); -typedef void (GLAD_API_PTR *PFN_vkDestroyImage)(VkDevice device, VkImage image, const VkAllocationCallbacks * pAllocator); -typedef void (GLAD_API_PTR *PFN_vkDestroyImageView)(VkDevice device, VkImageView imageView, const VkAllocationCallbacks * pAllocator); -typedef void (GLAD_API_PTR *PFN_vkDestroyInstance)(VkInstance instance, const VkAllocationCallbacks * pAllocator); -typedef void (GLAD_API_PTR *PFN_vkDestroyPipeline)(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks * pAllocator); -typedef void (GLAD_API_PTR *PFN_vkDestroyPipelineCache)(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks * pAllocator); -typedef void (GLAD_API_PTR *PFN_vkDestroyPipelineLayout)(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks * pAllocator); -typedef void (GLAD_API_PTR *PFN_vkDestroyQueryPool)(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks * pAllocator); -typedef void (GLAD_API_PTR *PFN_vkDestroyRenderPass)(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks * pAllocator); -typedef void (GLAD_API_PTR *PFN_vkDestroySampler)(VkDevice device, VkSampler sampler, const VkAllocationCallbacks * pAllocator); -typedef void (GLAD_API_PTR *PFN_vkDestroySamplerYcbcrConversion)(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks * pAllocator); -typedef void (GLAD_API_PTR *PFN_vkDestroySemaphore)(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks * pAllocator); -typedef void (GLAD_API_PTR *PFN_vkDestroyShaderModule)(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks * pAllocator); -typedef void (GLAD_API_PTR *PFN_vkDestroySurfaceKHR)(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks * pAllocator); -typedef void (GLAD_API_PTR *PFN_vkDestroySwapchainKHR)(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks * pAllocator); -typedef VkResult (GLAD_API_PTR *PFN_vkDeviceWaitIdle)(VkDevice device); -typedef VkResult (GLAD_API_PTR *PFN_vkEndCommandBuffer)(VkCommandBuffer commandBuffer); -typedef VkResult (GLAD_API_PTR *PFN_vkEnumerateDeviceExtensionProperties)(VkPhysicalDevice physicalDevice, const char * pLayerName, uint32_t * pPropertyCount, VkExtensionProperties * pProperties); -typedef VkResult (GLAD_API_PTR *PFN_vkEnumerateDeviceLayerProperties)(VkPhysicalDevice physicalDevice, uint32_t * pPropertyCount, VkLayerProperties * pProperties); -typedef VkResult (GLAD_API_PTR *PFN_vkEnumerateInstanceExtensionProperties)(const char * pLayerName, uint32_t * pPropertyCount, VkExtensionProperties * pProperties); -typedef VkResult (GLAD_API_PTR *PFN_vkEnumerateInstanceLayerProperties)(uint32_t * pPropertyCount, VkLayerProperties * pProperties); -typedef VkResult (GLAD_API_PTR *PFN_vkEnumerateInstanceVersion)(uint32_t * pApiVersion); -typedef VkResult (GLAD_API_PTR *PFN_vkEnumeratePhysicalDeviceGroups)(VkInstance instance, uint32_t * pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties * pPhysicalDeviceGroupProperties); -typedef VkResult (GLAD_API_PTR *PFN_vkEnumeratePhysicalDevices)(VkInstance instance, uint32_t * pPhysicalDeviceCount, VkPhysicalDevice * pPhysicalDevices); -typedef VkResult (GLAD_API_PTR *PFN_vkFlushMappedMemoryRanges)(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange * pMemoryRanges); -typedef void (GLAD_API_PTR *PFN_vkFreeCommandBuffers)(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer * pCommandBuffers); -typedef VkResult (GLAD_API_PTR *PFN_vkFreeDescriptorSets)(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet * pDescriptorSets); -typedef void (GLAD_API_PTR *PFN_vkFreeMemory)(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks * pAllocator); -typedef void (GLAD_API_PTR *PFN_vkGetBufferMemoryRequirements)(VkDevice device, VkBuffer buffer, VkMemoryRequirements * pMemoryRequirements); -typedef void (GLAD_API_PTR *PFN_vkGetBufferMemoryRequirements2)(VkDevice device, const VkBufferMemoryRequirementsInfo2 * pInfo, VkMemoryRequirements2 * pMemoryRequirements); -typedef void (GLAD_API_PTR *PFN_vkGetDescriptorSetLayoutSupport)(VkDevice device, const VkDescriptorSetLayoutCreateInfo * pCreateInfo, VkDescriptorSetLayoutSupport * pSupport); -typedef void (GLAD_API_PTR *PFN_vkGetDeviceGroupPeerMemoryFeatures)(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags * pPeerMemoryFeatures); -typedef VkResult (GLAD_API_PTR *PFN_vkGetDeviceGroupPresentCapabilitiesKHR)(VkDevice device, VkDeviceGroupPresentCapabilitiesKHR * pDeviceGroupPresentCapabilities); -typedef VkResult (GLAD_API_PTR *PFN_vkGetDeviceGroupSurfacePresentModesKHR)(VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHR * pModes); -typedef void (GLAD_API_PTR *PFN_vkGetDeviceMemoryCommitment)(VkDevice device, VkDeviceMemory memory, VkDeviceSize * pCommittedMemoryInBytes); -typedef PFN_vkVoidFunction (GLAD_API_PTR *PFN_vkGetDeviceProcAddr)(VkDevice device, const char * pName); -typedef void (GLAD_API_PTR *PFN_vkGetDeviceQueue)(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue * pQueue); -typedef void (GLAD_API_PTR *PFN_vkGetDeviceQueue2)(VkDevice device, const VkDeviceQueueInfo2 * pQueueInfo, VkQueue * pQueue); -typedef VkResult (GLAD_API_PTR *PFN_vkGetEventStatus)(VkDevice device, VkEvent event); -typedef VkResult (GLAD_API_PTR *PFN_vkGetFenceStatus)(VkDevice device, VkFence fence); -typedef void (GLAD_API_PTR *PFN_vkGetImageMemoryRequirements)(VkDevice device, VkImage image, VkMemoryRequirements * pMemoryRequirements); -typedef void (GLAD_API_PTR *PFN_vkGetImageMemoryRequirements2)(VkDevice device, const VkImageMemoryRequirementsInfo2 * pInfo, VkMemoryRequirements2 * pMemoryRequirements); -typedef void (GLAD_API_PTR *PFN_vkGetImageSparseMemoryRequirements)(VkDevice device, VkImage image, uint32_t * pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements * pSparseMemoryRequirements); -typedef void (GLAD_API_PTR *PFN_vkGetImageSparseMemoryRequirements2)(VkDevice device, const VkImageSparseMemoryRequirementsInfo2 * pInfo, uint32_t * pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2 * pSparseMemoryRequirements); -typedef void (GLAD_API_PTR *PFN_vkGetImageSubresourceLayout)(VkDevice device, VkImage image, const VkImageSubresource * pSubresource, VkSubresourceLayout * pLayout); -typedef PFN_vkVoidFunction (GLAD_API_PTR *PFN_vkGetInstanceProcAddr)(VkInstance instance, const char * pName); -typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceExternalBufferProperties)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo * pExternalBufferInfo, VkExternalBufferProperties * pExternalBufferProperties); -typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceExternalFenceProperties)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo * pExternalFenceInfo, VkExternalFenceProperties * pExternalFenceProperties); -typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceExternalSemaphoreProperties)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo * pExternalSemaphoreInfo, VkExternalSemaphoreProperties * pExternalSemaphoreProperties); -typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceFeatures)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures * pFeatures); -typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceFeatures2)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2 * pFeatures); -typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties * pFormatProperties); -typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceFormatProperties2)(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2 * pFormatProperties); -typedef VkResult (GLAD_API_PTR *PFN_vkGetPhysicalDeviceImageFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties * pImageFormatProperties); -typedef VkResult (GLAD_API_PTR *PFN_vkGetPhysicalDeviceImageFormatProperties2)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 * pImageFormatInfo, VkImageFormatProperties2 * pImageFormatProperties); -typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceMemoryProperties)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties * pMemoryProperties); -typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceMemoryProperties2)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2 * pMemoryProperties); -typedef VkResult (GLAD_API_PTR *PFN_vkGetPhysicalDevicePresentRectanglesKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t * pRectCount, VkRect2D * pRects); -typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceProperties)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties * pProperties); -typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceProperties2)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2 * pProperties); -typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceQueueFamilyProperties)(VkPhysicalDevice physicalDevice, uint32_t * pQueueFamilyPropertyCount, VkQueueFamilyProperties * pQueueFamilyProperties); -typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceQueueFamilyProperties2)(VkPhysicalDevice physicalDevice, uint32_t * pQueueFamilyPropertyCount, VkQueueFamilyProperties2 * pQueueFamilyProperties); -typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceSparseImageFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t * pPropertyCount, VkSparseImageFormatProperties * pProperties); -typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceSparseImageFormatProperties2)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2 * pFormatInfo, uint32_t * pPropertyCount, VkSparseImageFormatProperties2 * pProperties); -typedef VkResult (GLAD_API_PTR *PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR * pSurfaceCapabilities); -typedef VkResult (GLAD_API_PTR *PFN_vkGetPhysicalDeviceSurfaceFormatsKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t * pSurfaceFormatCount, VkSurfaceFormatKHR * pSurfaceFormats); -typedef VkResult (GLAD_API_PTR *PFN_vkGetPhysicalDeviceSurfacePresentModesKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t * pPresentModeCount, VkPresentModeKHR * pPresentModes); -typedef VkResult (GLAD_API_PTR *PFN_vkGetPhysicalDeviceSurfaceSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32 * pSupported); -typedef VkResult (GLAD_API_PTR *PFN_vkGetPipelineCacheData)(VkDevice device, VkPipelineCache pipelineCache, size_t * pDataSize, void * pData); -typedef VkResult (GLAD_API_PTR *PFN_vkGetQueryPoolResults)(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void * pData, VkDeviceSize stride, VkQueryResultFlags flags); -typedef void (GLAD_API_PTR *PFN_vkGetRenderAreaGranularity)(VkDevice device, VkRenderPass renderPass, VkExtent2D * pGranularity); -typedef VkResult (GLAD_API_PTR *PFN_vkGetSwapchainImagesKHR)(VkDevice device, VkSwapchainKHR swapchain, uint32_t * pSwapchainImageCount, VkImage * pSwapchainImages); -typedef VkResult (GLAD_API_PTR *PFN_vkInvalidateMappedMemoryRanges)(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange * pMemoryRanges); -typedef VkResult (GLAD_API_PTR *PFN_vkMapMemory)(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void ** ppData); -typedef VkResult (GLAD_API_PTR *PFN_vkMergePipelineCaches)(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache * pSrcCaches); -typedef VkResult (GLAD_API_PTR *PFN_vkQueueBindSparse)(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo * pBindInfo, VkFence fence); -typedef VkResult (GLAD_API_PTR *PFN_vkQueuePresentKHR)(VkQueue queue, const VkPresentInfoKHR * pPresentInfo); -typedef VkResult (GLAD_API_PTR *PFN_vkQueueSubmit)(VkQueue queue, uint32_t submitCount, const VkSubmitInfo * pSubmits, VkFence fence); -typedef VkResult (GLAD_API_PTR *PFN_vkQueueWaitIdle)(VkQueue queue); -typedef VkResult (GLAD_API_PTR *PFN_vkResetCommandBuffer)(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags); -typedef VkResult (GLAD_API_PTR *PFN_vkResetCommandPool)(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags); -typedef VkResult (GLAD_API_PTR *PFN_vkResetDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags); -typedef VkResult (GLAD_API_PTR *PFN_vkResetEvent)(VkDevice device, VkEvent event); -typedef VkResult (GLAD_API_PTR *PFN_vkResetFences)(VkDevice device, uint32_t fenceCount, const VkFence * pFences); -typedef VkResult (GLAD_API_PTR *PFN_vkSetEvent)(VkDevice device, VkEvent event); -typedef void (GLAD_API_PTR *PFN_vkTrimCommandPool)(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags); -typedef void (GLAD_API_PTR *PFN_vkUnmapMemory)(VkDevice device, VkDeviceMemory memory); -typedef void (GLAD_API_PTR *PFN_vkUpdateDescriptorSetWithTemplate)(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void * pData); -typedef void (GLAD_API_PTR *PFN_vkUpdateDescriptorSets)(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet * pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet * pDescriptorCopies); -typedef VkResult (GLAD_API_PTR *PFN_vkWaitForFences)(VkDevice device, uint32_t fenceCount, const VkFence * pFences, VkBool32 waitAll, uint64_t timeout); - -GLAD_API_CALL PFN_vkAcquireNextImage2KHR glad_vkAcquireNextImage2KHR; -#define vkAcquireNextImage2KHR glad_vkAcquireNextImage2KHR -GLAD_API_CALL PFN_vkAcquireNextImageKHR glad_vkAcquireNextImageKHR; -#define vkAcquireNextImageKHR glad_vkAcquireNextImageKHR -GLAD_API_CALL PFN_vkAllocateCommandBuffers glad_vkAllocateCommandBuffers; -#define vkAllocateCommandBuffers glad_vkAllocateCommandBuffers -GLAD_API_CALL PFN_vkAllocateDescriptorSets glad_vkAllocateDescriptorSets; -#define vkAllocateDescriptorSets glad_vkAllocateDescriptorSets -GLAD_API_CALL PFN_vkAllocateMemory glad_vkAllocateMemory; -#define vkAllocateMemory glad_vkAllocateMemory -GLAD_API_CALL PFN_vkBeginCommandBuffer glad_vkBeginCommandBuffer; -#define vkBeginCommandBuffer glad_vkBeginCommandBuffer -GLAD_API_CALL PFN_vkBindBufferMemory glad_vkBindBufferMemory; -#define vkBindBufferMemory glad_vkBindBufferMemory -GLAD_API_CALL PFN_vkBindBufferMemory2 glad_vkBindBufferMemory2; -#define vkBindBufferMemory2 glad_vkBindBufferMemory2 -GLAD_API_CALL PFN_vkBindImageMemory glad_vkBindImageMemory; -#define vkBindImageMemory glad_vkBindImageMemory -GLAD_API_CALL PFN_vkBindImageMemory2 glad_vkBindImageMemory2; -#define vkBindImageMemory2 glad_vkBindImageMemory2 -GLAD_API_CALL PFN_vkCmdBeginQuery glad_vkCmdBeginQuery; -#define vkCmdBeginQuery glad_vkCmdBeginQuery -GLAD_API_CALL PFN_vkCmdBeginRenderPass glad_vkCmdBeginRenderPass; -#define vkCmdBeginRenderPass glad_vkCmdBeginRenderPass -GLAD_API_CALL PFN_vkCmdBindDescriptorSets glad_vkCmdBindDescriptorSets; -#define vkCmdBindDescriptorSets glad_vkCmdBindDescriptorSets -GLAD_API_CALL PFN_vkCmdBindIndexBuffer glad_vkCmdBindIndexBuffer; -#define vkCmdBindIndexBuffer glad_vkCmdBindIndexBuffer -GLAD_API_CALL PFN_vkCmdBindPipeline glad_vkCmdBindPipeline; -#define vkCmdBindPipeline glad_vkCmdBindPipeline -GLAD_API_CALL PFN_vkCmdBindVertexBuffers glad_vkCmdBindVertexBuffers; -#define vkCmdBindVertexBuffers glad_vkCmdBindVertexBuffers -GLAD_API_CALL PFN_vkCmdBlitImage glad_vkCmdBlitImage; -#define vkCmdBlitImage glad_vkCmdBlitImage -GLAD_API_CALL PFN_vkCmdClearAttachments glad_vkCmdClearAttachments; -#define vkCmdClearAttachments glad_vkCmdClearAttachments -GLAD_API_CALL PFN_vkCmdClearColorImage glad_vkCmdClearColorImage; -#define vkCmdClearColorImage glad_vkCmdClearColorImage -GLAD_API_CALL PFN_vkCmdClearDepthStencilImage glad_vkCmdClearDepthStencilImage; -#define vkCmdClearDepthStencilImage glad_vkCmdClearDepthStencilImage -GLAD_API_CALL PFN_vkCmdCopyBuffer glad_vkCmdCopyBuffer; -#define vkCmdCopyBuffer glad_vkCmdCopyBuffer -GLAD_API_CALL PFN_vkCmdCopyBufferToImage glad_vkCmdCopyBufferToImage; -#define vkCmdCopyBufferToImage glad_vkCmdCopyBufferToImage -GLAD_API_CALL PFN_vkCmdCopyImage glad_vkCmdCopyImage; -#define vkCmdCopyImage glad_vkCmdCopyImage -GLAD_API_CALL PFN_vkCmdCopyImageToBuffer glad_vkCmdCopyImageToBuffer; -#define vkCmdCopyImageToBuffer glad_vkCmdCopyImageToBuffer -GLAD_API_CALL PFN_vkCmdCopyQueryPoolResults glad_vkCmdCopyQueryPoolResults; -#define vkCmdCopyQueryPoolResults glad_vkCmdCopyQueryPoolResults -GLAD_API_CALL PFN_vkCmdDispatch glad_vkCmdDispatch; -#define vkCmdDispatch glad_vkCmdDispatch -GLAD_API_CALL PFN_vkCmdDispatchBase glad_vkCmdDispatchBase; -#define vkCmdDispatchBase glad_vkCmdDispatchBase -GLAD_API_CALL PFN_vkCmdDispatchIndirect glad_vkCmdDispatchIndirect; -#define vkCmdDispatchIndirect glad_vkCmdDispatchIndirect -GLAD_API_CALL PFN_vkCmdDraw glad_vkCmdDraw; -#define vkCmdDraw glad_vkCmdDraw -GLAD_API_CALL PFN_vkCmdDrawIndexed glad_vkCmdDrawIndexed; -#define vkCmdDrawIndexed glad_vkCmdDrawIndexed -GLAD_API_CALL PFN_vkCmdDrawIndexedIndirect glad_vkCmdDrawIndexedIndirect; -#define vkCmdDrawIndexedIndirect glad_vkCmdDrawIndexedIndirect -GLAD_API_CALL PFN_vkCmdDrawIndirect glad_vkCmdDrawIndirect; -#define vkCmdDrawIndirect glad_vkCmdDrawIndirect -GLAD_API_CALL PFN_vkCmdEndQuery glad_vkCmdEndQuery; -#define vkCmdEndQuery glad_vkCmdEndQuery -GLAD_API_CALL PFN_vkCmdEndRenderPass glad_vkCmdEndRenderPass; -#define vkCmdEndRenderPass glad_vkCmdEndRenderPass -GLAD_API_CALL PFN_vkCmdExecuteCommands glad_vkCmdExecuteCommands; -#define vkCmdExecuteCommands glad_vkCmdExecuteCommands -GLAD_API_CALL PFN_vkCmdFillBuffer glad_vkCmdFillBuffer; -#define vkCmdFillBuffer glad_vkCmdFillBuffer -GLAD_API_CALL PFN_vkCmdNextSubpass glad_vkCmdNextSubpass; -#define vkCmdNextSubpass glad_vkCmdNextSubpass -GLAD_API_CALL PFN_vkCmdPipelineBarrier glad_vkCmdPipelineBarrier; -#define vkCmdPipelineBarrier glad_vkCmdPipelineBarrier -GLAD_API_CALL PFN_vkCmdPushConstants glad_vkCmdPushConstants; -#define vkCmdPushConstants glad_vkCmdPushConstants -GLAD_API_CALL PFN_vkCmdResetEvent glad_vkCmdResetEvent; -#define vkCmdResetEvent glad_vkCmdResetEvent -GLAD_API_CALL PFN_vkCmdResetQueryPool glad_vkCmdResetQueryPool; -#define vkCmdResetQueryPool glad_vkCmdResetQueryPool -GLAD_API_CALL PFN_vkCmdResolveImage glad_vkCmdResolveImage; -#define vkCmdResolveImage glad_vkCmdResolveImage -GLAD_API_CALL PFN_vkCmdSetBlendConstants glad_vkCmdSetBlendConstants; -#define vkCmdSetBlendConstants glad_vkCmdSetBlendConstants -GLAD_API_CALL PFN_vkCmdSetDepthBias glad_vkCmdSetDepthBias; -#define vkCmdSetDepthBias glad_vkCmdSetDepthBias -GLAD_API_CALL PFN_vkCmdSetDepthBounds glad_vkCmdSetDepthBounds; -#define vkCmdSetDepthBounds glad_vkCmdSetDepthBounds -GLAD_API_CALL PFN_vkCmdSetDeviceMask glad_vkCmdSetDeviceMask; -#define vkCmdSetDeviceMask glad_vkCmdSetDeviceMask -GLAD_API_CALL PFN_vkCmdSetEvent glad_vkCmdSetEvent; -#define vkCmdSetEvent glad_vkCmdSetEvent -GLAD_API_CALL PFN_vkCmdSetLineWidth glad_vkCmdSetLineWidth; -#define vkCmdSetLineWidth glad_vkCmdSetLineWidth -GLAD_API_CALL PFN_vkCmdSetScissor glad_vkCmdSetScissor; -#define vkCmdSetScissor glad_vkCmdSetScissor -GLAD_API_CALL PFN_vkCmdSetStencilCompareMask glad_vkCmdSetStencilCompareMask; -#define vkCmdSetStencilCompareMask glad_vkCmdSetStencilCompareMask -GLAD_API_CALL PFN_vkCmdSetStencilReference glad_vkCmdSetStencilReference; -#define vkCmdSetStencilReference glad_vkCmdSetStencilReference -GLAD_API_CALL PFN_vkCmdSetStencilWriteMask glad_vkCmdSetStencilWriteMask; -#define vkCmdSetStencilWriteMask glad_vkCmdSetStencilWriteMask -GLAD_API_CALL PFN_vkCmdSetViewport glad_vkCmdSetViewport; -#define vkCmdSetViewport glad_vkCmdSetViewport -GLAD_API_CALL PFN_vkCmdUpdateBuffer glad_vkCmdUpdateBuffer; -#define vkCmdUpdateBuffer glad_vkCmdUpdateBuffer -GLAD_API_CALL PFN_vkCmdWaitEvents glad_vkCmdWaitEvents; -#define vkCmdWaitEvents glad_vkCmdWaitEvents -GLAD_API_CALL PFN_vkCmdWriteTimestamp glad_vkCmdWriteTimestamp; -#define vkCmdWriteTimestamp glad_vkCmdWriteTimestamp -GLAD_API_CALL PFN_vkCreateBuffer glad_vkCreateBuffer; -#define vkCreateBuffer glad_vkCreateBuffer -GLAD_API_CALL PFN_vkCreateBufferView glad_vkCreateBufferView; -#define vkCreateBufferView glad_vkCreateBufferView -GLAD_API_CALL PFN_vkCreateCommandPool glad_vkCreateCommandPool; -#define vkCreateCommandPool glad_vkCreateCommandPool -GLAD_API_CALL PFN_vkCreateComputePipelines glad_vkCreateComputePipelines; -#define vkCreateComputePipelines glad_vkCreateComputePipelines -GLAD_API_CALL PFN_vkCreateDebugReportCallbackEXT glad_vkCreateDebugReportCallbackEXT; -#define vkCreateDebugReportCallbackEXT glad_vkCreateDebugReportCallbackEXT -GLAD_API_CALL PFN_vkCreateDescriptorPool glad_vkCreateDescriptorPool; -#define vkCreateDescriptorPool glad_vkCreateDescriptorPool -GLAD_API_CALL PFN_vkCreateDescriptorSetLayout glad_vkCreateDescriptorSetLayout; -#define vkCreateDescriptorSetLayout glad_vkCreateDescriptorSetLayout -GLAD_API_CALL PFN_vkCreateDescriptorUpdateTemplate glad_vkCreateDescriptorUpdateTemplate; -#define vkCreateDescriptorUpdateTemplate glad_vkCreateDescriptorUpdateTemplate -GLAD_API_CALL PFN_vkCreateDevice glad_vkCreateDevice; -#define vkCreateDevice glad_vkCreateDevice -GLAD_API_CALL PFN_vkCreateEvent glad_vkCreateEvent; -#define vkCreateEvent glad_vkCreateEvent -GLAD_API_CALL PFN_vkCreateFence glad_vkCreateFence; -#define vkCreateFence glad_vkCreateFence -GLAD_API_CALL PFN_vkCreateFramebuffer glad_vkCreateFramebuffer; -#define vkCreateFramebuffer glad_vkCreateFramebuffer -GLAD_API_CALL PFN_vkCreateGraphicsPipelines glad_vkCreateGraphicsPipelines; -#define vkCreateGraphicsPipelines glad_vkCreateGraphicsPipelines -GLAD_API_CALL PFN_vkCreateImage glad_vkCreateImage; -#define vkCreateImage glad_vkCreateImage -GLAD_API_CALL PFN_vkCreateImageView glad_vkCreateImageView; -#define vkCreateImageView glad_vkCreateImageView -GLAD_API_CALL PFN_vkCreateInstance glad_vkCreateInstance; -#define vkCreateInstance glad_vkCreateInstance -GLAD_API_CALL PFN_vkCreatePipelineCache glad_vkCreatePipelineCache; -#define vkCreatePipelineCache glad_vkCreatePipelineCache -GLAD_API_CALL PFN_vkCreatePipelineLayout glad_vkCreatePipelineLayout; -#define vkCreatePipelineLayout glad_vkCreatePipelineLayout -GLAD_API_CALL PFN_vkCreateQueryPool glad_vkCreateQueryPool; -#define vkCreateQueryPool glad_vkCreateQueryPool -GLAD_API_CALL PFN_vkCreateRenderPass glad_vkCreateRenderPass; -#define vkCreateRenderPass glad_vkCreateRenderPass -GLAD_API_CALL PFN_vkCreateSampler glad_vkCreateSampler; -#define vkCreateSampler glad_vkCreateSampler -GLAD_API_CALL PFN_vkCreateSamplerYcbcrConversion glad_vkCreateSamplerYcbcrConversion; -#define vkCreateSamplerYcbcrConversion glad_vkCreateSamplerYcbcrConversion -GLAD_API_CALL PFN_vkCreateSemaphore glad_vkCreateSemaphore; -#define vkCreateSemaphore glad_vkCreateSemaphore -GLAD_API_CALL PFN_vkCreateShaderModule glad_vkCreateShaderModule; -#define vkCreateShaderModule glad_vkCreateShaderModule -GLAD_API_CALL PFN_vkCreateSwapchainKHR glad_vkCreateSwapchainKHR; -#define vkCreateSwapchainKHR glad_vkCreateSwapchainKHR -GLAD_API_CALL PFN_vkDebugReportMessageEXT glad_vkDebugReportMessageEXT; -#define vkDebugReportMessageEXT glad_vkDebugReportMessageEXT -GLAD_API_CALL PFN_vkDestroyBuffer glad_vkDestroyBuffer; -#define vkDestroyBuffer glad_vkDestroyBuffer -GLAD_API_CALL PFN_vkDestroyBufferView glad_vkDestroyBufferView; -#define vkDestroyBufferView glad_vkDestroyBufferView -GLAD_API_CALL PFN_vkDestroyCommandPool glad_vkDestroyCommandPool; -#define vkDestroyCommandPool glad_vkDestroyCommandPool -GLAD_API_CALL PFN_vkDestroyDebugReportCallbackEXT glad_vkDestroyDebugReportCallbackEXT; -#define vkDestroyDebugReportCallbackEXT glad_vkDestroyDebugReportCallbackEXT -GLAD_API_CALL PFN_vkDestroyDescriptorPool glad_vkDestroyDescriptorPool; -#define vkDestroyDescriptorPool glad_vkDestroyDescriptorPool -GLAD_API_CALL PFN_vkDestroyDescriptorSetLayout glad_vkDestroyDescriptorSetLayout; -#define vkDestroyDescriptorSetLayout glad_vkDestroyDescriptorSetLayout -GLAD_API_CALL PFN_vkDestroyDescriptorUpdateTemplate glad_vkDestroyDescriptorUpdateTemplate; -#define vkDestroyDescriptorUpdateTemplate glad_vkDestroyDescriptorUpdateTemplate -GLAD_API_CALL PFN_vkDestroyDevice glad_vkDestroyDevice; -#define vkDestroyDevice glad_vkDestroyDevice -GLAD_API_CALL PFN_vkDestroyEvent glad_vkDestroyEvent; -#define vkDestroyEvent glad_vkDestroyEvent -GLAD_API_CALL PFN_vkDestroyFence glad_vkDestroyFence; -#define vkDestroyFence glad_vkDestroyFence -GLAD_API_CALL PFN_vkDestroyFramebuffer glad_vkDestroyFramebuffer; -#define vkDestroyFramebuffer glad_vkDestroyFramebuffer -GLAD_API_CALL PFN_vkDestroyImage glad_vkDestroyImage; -#define vkDestroyImage glad_vkDestroyImage -GLAD_API_CALL PFN_vkDestroyImageView glad_vkDestroyImageView; -#define vkDestroyImageView glad_vkDestroyImageView -GLAD_API_CALL PFN_vkDestroyInstance glad_vkDestroyInstance; -#define vkDestroyInstance glad_vkDestroyInstance -GLAD_API_CALL PFN_vkDestroyPipeline glad_vkDestroyPipeline; -#define vkDestroyPipeline glad_vkDestroyPipeline -GLAD_API_CALL PFN_vkDestroyPipelineCache glad_vkDestroyPipelineCache; -#define vkDestroyPipelineCache glad_vkDestroyPipelineCache -GLAD_API_CALL PFN_vkDestroyPipelineLayout glad_vkDestroyPipelineLayout; -#define vkDestroyPipelineLayout glad_vkDestroyPipelineLayout -GLAD_API_CALL PFN_vkDestroyQueryPool glad_vkDestroyQueryPool; -#define vkDestroyQueryPool glad_vkDestroyQueryPool -GLAD_API_CALL PFN_vkDestroyRenderPass glad_vkDestroyRenderPass; -#define vkDestroyRenderPass glad_vkDestroyRenderPass -GLAD_API_CALL PFN_vkDestroySampler glad_vkDestroySampler; -#define vkDestroySampler glad_vkDestroySampler -GLAD_API_CALL PFN_vkDestroySamplerYcbcrConversion glad_vkDestroySamplerYcbcrConversion; -#define vkDestroySamplerYcbcrConversion glad_vkDestroySamplerYcbcrConversion -GLAD_API_CALL PFN_vkDestroySemaphore glad_vkDestroySemaphore; -#define vkDestroySemaphore glad_vkDestroySemaphore -GLAD_API_CALL PFN_vkDestroyShaderModule glad_vkDestroyShaderModule; -#define vkDestroyShaderModule glad_vkDestroyShaderModule -GLAD_API_CALL PFN_vkDestroySurfaceKHR glad_vkDestroySurfaceKHR; -#define vkDestroySurfaceKHR glad_vkDestroySurfaceKHR -GLAD_API_CALL PFN_vkDestroySwapchainKHR glad_vkDestroySwapchainKHR; -#define vkDestroySwapchainKHR glad_vkDestroySwapchainKHR -GLAD_API_CALL PFN_vkDeviceWaitIdle glad_vkDeviceWaitIdle; -#define vkDeviceWaitIdle glad_vkDeviceWaitIdle -GLAD_API_CALL PFN_vkEndCommandBuffer glad_vkEndCommandBuffer; -#define vkEndCommandBuffer glad_vkEndCommandBuffer -GLAD_API_CALL PFN_vkEnumerateDeviceExtensionProperties glad_vkEnumerateDeviceExtensionProperties; -#define vkEnumerateDeviceExtensionProperties glad_vkEnumerateDeviceExtensionProperties -GLAD_API_CALL PFN_vkEnumerateDeviceLayerProperties glad_vkEnumerateDeviceLayerProperties; -#define vkEnumerateDeviceLayerProperties glad_vkEnumerateDeviceLayerProperties -GLAD_API_CALL PFN_vkEnumerateInstanceExtensionProperties glad_vkEnumerateInstanceExtensionProperties; -#define vkEnumerateInstanceExtensionProperties glad_vkEnumerateInstanceExtensionProperties -GLAD_API_CALL PFN_vkEnumerateInstanceLayerProperties glad_vkEnumerateInstanceLayerProperties; -#define vkEnumerateInstanceLayerProperties glad_vkEnumerateInstanceLayerProperties -GLAD_API_CALL PFN_vkEnumerateInstanceVersion glad_vkEnumerateInstanceVersion; -#define vkEnumerateInstanceVersion glad_vkEnumerateInstanceVersion -GLAD_API_CALL PFN_vkEnumeratePhysicalDeviceGroups glad_vkEnumeratePhysicalDeviceGroups; -#define vkEnumeratePhysicalDeviceGroups glad_vkEnumeratePhysicalDeviceGroups -GLAD_API_CALL PFN_vkEnumeratePhysicalDevices glad_vkEnumeratePhysicalDevices; -#define vkEnumeratePhysicalDevices glad_vkEnumeratePhysicalDevices -GLAD_API_CALL PFN_vkFlushMappedMemoryRanges glad_vkFlushMappedMemoryRanges; -#define vkFlushMappedMemoryRanges glad_vkFlushMappedMemoryRanges -GLAD_API_CALL PFN_vkFreeCommandBuffers glad_vkFreeCommandBuffers; -#define vkFreeCommandBuffers glad_vkFreeCommandBuffers -GLAD_API_CALL PFN_vkFreeDescriptorSets glad_vkFreeDescriptorSets; -#define vkFreeDescriptorSets glad_vkFreeDescriptorSets -GLAD_API_CALL PFN_vkFreeMemory glad_vkFreeMemory; -#define vkFreeMemory glad_vkFreeMemory -GLAD_API_CALL PFN_vkGetBufferMemoryRequirements glad_vkGetBufferMemoryRequirements; -#define vkGetBufferMemoryRequirements glad_vkGetBufferMemoryRequirements -GLAD_API_CALL PFN_vkGetBufferMemoryRequirements2 glad_vkGetBufferMemoryRequirements2; -#define vkGetBufferMemoryRequirements2 glad_vkGetBufferMemoryRequirements2 -GLAD_API_CALL PFN_vkGetDescriptorSetLayoutSupport glad_vkGetDescriptorSetLayoutSupport; -#define vkGetDescriptorSetLayoutSupport glad_vkGetDescriptorSetLayoutSupport -GLAD_API_CALL PFN_vkGetDeviceGroupPeerMemoryFeatures glad_vkGetDeviceGroupPeerMemoryFeatures; -#define vkGetDeviceGroupPeerMemoryFeatures glad_vkGetDeviceGroupPeerMemoryFeatures -GLAD_API_CALL PFN_vkGetDeviceGroupPresentCapabilitiesKHR glad_vkGetDeviceGroupPresentCapabilitiesKHR; -#define vkGetDeviceGroupPresentCapabilitiesKHR glad_vkGetDeviceGroupPresentCapabilitiesKHR -GLAD_API_CALL PFN_vkGetDeviceGroupSurfacePresentModesKHR glad_vkGetDeviceGroupSurfacePresentModesKHR; -#define vkGetDeviceGroupSurfacePresentModesKHR glad_vkGetDeviceGroupSurfacePresentModesKHR -GLAD_API_CALL PFN_vkGetDeviceMemoryCommitment glad_vkGetDeviceMemoryCommitment; -#define vkGetDeviceMemoryCommitment glad_vkGetDeviceMemoryCommitment -GLAD_API_CALL PFN_vkGetDeviceProcAddr glad_vkGetDeviceProcAddr; -#define vkGetDeviceProcAddr glad_vkGetDeviceProcAddr -GLAD_API_CALL PFN_vkGetDeviceQueue glad_vkGetDeviceQueue; -#define vkGetDeviceQueue glad_vkGetDeviceQueue -GLAD_API_CALL PFN_vkGetDeviceQueue2 glad_vkGetDeviceQueue2; -#define vkGetDeviceQueue2 glad_vkGetDeviceQueue2 -GLAD_API_CALL PFN_vkGetEventStatus glad_vkGetEventStatus; -#define vkGetEventStatus glad_vkGetEventStatus -GLAD_API_CALL PFN_vkGetFenceStatus glad_vkGetFenceStatus; -#define vkGetFenceStatus glad_vkGetFenceStatus -GLAD_API_CALL PFN_vkGetImageMemoryRequirements glad_vkGetImageMemoryRequirements; -#define vkGetImageMemoryRequirements glad_vkGetImageMemoryRequirements -GLAD_API_CALL PFN_vkGetImageMemoryRequirements2 glad_vkGetImageMemoryRequirements2; -#define vkGetImageMemoryRequirements2 glad_vkGetImageMemoryRequirements2 -GLAD_API_CALL PFN_vkGetImageSparseMemoryRequirements glad_vkGetImageSparseMemoryRequirements; -#define vkGetImageSparseMemoryRequirements glad_vkGetImageSparseMemoryRequirements -GLAD_API_CALL PFN_vkGetImageSparseMemoryRequirements2 glad_vkGetImageSparseMemoryRequirements2; -#define vkGetImageSparseMemoryRequirements2 glad_vkGetImageSparseMemoryRequirements2 -GLAD_API_CALL PFN_vkGetImageSubresourceLayout glad_vkGetImageSubresourceLayout; -#define vkGetImageSubresourceLayout glad_vkGetImageSubresourceLayout -GLAD_API_CALL PFN_vkGetInstanceProcAddr glad_vkGetInstanceProcAddr; -#define vkGetInstanceProcAddr glad_vkGetInstanceProcAddr -GLAD_API_CALL PFN_vkGetPhysicalDeviceExternalBufferProperties glad_vkGetPhysicalDeviceExternalBufferProperties; -#define vkGetPhysicalDeviceExternalBufferProperties glad_vkGetPhysicalDeviceExternalBufferProperties -GLAD_API_CALL PFN_vkGetPhysicalDeviceExternalFenceProperties glad_vkGetPhysicalDeviceExternalFenceProperties; -#define vkGetPhysicalDeviceExternalFenceProperties glad_vkGetPhysicalDeviceExternalFenceProperties -GLAD_API_CALL PFN_vkGetPhysicalDeviceExternalSemaphoreProperties glad_vkGetPhysicalDeviceExternalSemaphoreProperties; -#define vkGetPhysicalDeviceExternalSemaphoreProperties glad_vkGetPhysicalDeviceExternalSemaphoreProperties -GLAD_API_CALL PFN_vkGetPhysicalDeviceFeatures glad_vkGetPhysicalDeviceFeatures; -#define vkGetPhysicalDeviceFeatures glad_vkGetPhysicalDeviceFeatures -GLAD_API_CALL PFN_vkGetPhysicalDeviceFeatures2 glad_vkGetPhysicalDeviceFeatures2; -#define vkGetPhysicalDeviceFeatures2 glad_vkGetPhysicalDeviceFeatures2 -GLAD_API_CALL PFN_vkGetPhysicalDeviceFormatProperties glad_vkGetPhysicalDeviceFormatProperties; -#define vkGetPhysicalDeviceFormatProperties glad_vkGetPhysicalDeviceFormatProperties -GLAD_API_CALL PFN_vkGetPhysicalDeviceFormatProperties2 glad_vkGetPhysicalDeviceFormatProperties2; -#define vkGetPhysicalDeviceFormatProperties2 glad_vkGetPhysicalDeviceFormatProperties2 -GLAD_API_CALL PFN_vkGetPhysicalDeviceImageFormatProperties glad_vkGetPhysicalDeviceImageFormatProperties; -#define vkGetPhysicalDeviceImageFormatProperties glad_vkGetPhysicalDeviceImageFormatProperties -GLAD_API_CALL PFN_vkGetPhysicalDeviceImageFormatProperties2 glad_vkGetPhysicalDeviceImageFormatProperties2; -#define vkGetPhysicalDeviceImageFormatProperties2 glad_vkGetPhysicalDeviceImageFormatProperties2 -GLAD_API_CALL PFN_vkGetPhysicalDeviceMemoryProperties glad_vkGetPhysicalDeviceMemoryProperties; -#define vkGetPhysicalDeviceMemoryProperties glad_vkGetPhysicalDeviceMemoryProperties -GLAD_API_CALL PFN_vkGetPhysicalDeviceMemoryProperties2 glad_vkGetPhysicalDeviceMemoryProperties2; -#define vkGetPhysicalDeviceMemoryProperties2 glad_vkGetPhysicalDeviceMemoryProperties2 -GLAD_API_CALL PFN_vkGetPhysicalDevicePresentRectanglesKHR glad_vkGetPhysicalDevicePresentRectanglesKHR; -#define vkGetPhysicalDevicePresentRectanglesKHR glad_vkGetPhysicalDevicePresentRectanglesKHR -GLAD_API_CALL PFN_vkGetPhysicalDeviceProperties glad_vkGetPhysicalDeviceProperties; -#define vkGetPhysicalDeviceProperties glad_vkGetPhysicalDeviceProperties -GLAD_API_CALL PFN_vkGetPhysicalDeviceProperties2 glad_vkGetPhysicalDeviceProperties2; -#define vkGetPhysicalDeviceProperties2 glad_vkGetPhysicalDeviceProperties2 -GLAD_API_CALL PFN_vkGetPhysicalDeviceQueueFamilyProperties glad_vkGetPhysicalDeviceQueueFamilyProperties; -#define vkGetPhysicalDeviceQueueFamilyProperties glad_vkGetPhysicalDeviceQueueFamilyProperties -GLAD_API_CALL PFN_vkGetPhysicalDeviceQueueFamilyProperties2 glad_vkGetPhysicalDeviceQueueFamilyProperties2; -#define vkGetPhysicalDeviceQueueFamilyProperties2 glad_vkGetPhysicalDeviceQueueFamilyProperties2 -GLAD_API_CALL PFN_vkGetPhysicalDeviceSparseImageFormatProperties glad_vkGetPhysicalDeviceSparseImageFormatProperties; -#define vkGetPhysicalDeviceSparseImageFormatProperties glad_vkGetPhysicalDeviceSparseImageFormatProperties -GLAD_API_CALL PFN_vkGetPhysicalDeviceSparseImageFormatProperties2 glad_vkGetPhysicalDeviceSparseImageFormatProperties2; -#define vkGetPhysicalDeviceSparseImageFormatProperties2 glad_vkGetPhysicalDeviceSparseImageFormatProperties2 -GLAD_API_CALL PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR glad_vkGetPhysicalDeviceSurfaceCapabilitiesKHR; -#define vkGetPhysicalDeviceSurfaceCapabilitiesKHR glad_vkGetPhysicalDeviceSurfaceCapabilitiesKHR -GLAD_API_CALL PFN_vkGetPhysicalDeviceSurfaceFormatsKHR glad_vkGetPhysicalDeviceSurfaceFormatsKHR; -#define vkGetPhysicalDeviceSurfaceFormatsKHR glad_vkGetPhysicalDeviceSurfaceFormatsKHR -GLAD_API_CALL PFN_vkGetPhysicalDeviceSurfacePresentModesKHR glad_vkGetPhysicalDeviceSurfacePresentModesKHR; -#define vkGetPhysicalDeviceSurfacePresentModesKHR glad_vkGetPhysicalDeviceSurfacePresentModesKHR -GLAD_API_CALL PFN_vkGetPhysicalDeviceSurfaceSupportKHR glad_vkGetPhysicalDeviceSurfaceSupportKHR; -#define vkGetPhysicalDeviceSurfaceSupportKHR glad_vkGetPhysicalDeviceSurfaceSupportKHR -GLAD_API_CALL PFN_vkGetPipelineCacheData glad_vkGetPipelineCacheData; -#define vkGetPipelineCacheData glad_vkGetPipelineCacheData -GLAD_API_CALL PFN_vkGetQueryPoolResults glad_vkGetQueryPoolResults; -#define vkGetQueryPoolResults glad_vkGetQueryPoolResults -GLAD_API_CALL PFN_vkGetRenderAreaGranularity glad_vkGetRenderAreaGranularity; -#define vkGetRenderAreaGranularity glad_vkGetRenderAreaGranularity -GLAD_API_CALL PFN_vkGetSwapchainImagesKHR glad_vkGetSwapchainImagesKHR; -#define vkGetSwapchainImagesKHR glad_vkGetSwapchainImagesKHR -GLAD_API_CALL PFN_vkInvalidateMappedMemoryRanges glad_vkInvalidateMappedMemoryRanges; -#define vkInvalidateMappedMemoryRanges glad_vkInvalidateMappedMemoryRanges -GLAD_API_CALL PFN_vkMapMemory glad_vkMapMemory; -#define vkMapMemory glad_vkMapMemory -GLAD_API_CALL PFN_vkMergePipelineCaches glad_vkMergePipelineCaches; -#define vkMergePipelineCaches glad_vkMergePipelineCaches -GLAD_API_CALL PFN_vkQueueBindSparse glad_vkQueueBindSparse; -#define vkQueueBindSparse glad_vkQueueBindSparse -GLAD_API_CALL PFN_vkQueuePresentKHR glad_vkQueuePresentKHR; -#define vkQueuePresentKHR glad_vkQueuePresentKHR -GLAD_API_CALL PFN_vkQueueSubmit glad_vkQueueSubmit; -#define vkQueueSubmit glad_vkQueueSubmit -GLAD_API_CALL PFN_vkQueueWaitIdle glad_vkQueueWaitIdle; -#define vkQueueWaitIdle glad_vkQueueWaitIdle -GLAD_API_CALL PFN_vkResetCommandBuffer glad_vkResetCommandBuffer; -#define vkResetCommandBuffer glad_vkResetCommandBuffer -GLAD_API_CALL PFN_vkResetCommandPool glad_vkResetCommandPool; -#define vkResetCommandPool glad_vkResetCommandPool -GLAD_API_CALL PFN_vkResetDescriptorPool glad_vkResetDescriptorPool; -#define vkResetDescriptorPool glad_vkResetDescriptorPool -GLAD_API_CALL PFN_vkResetEvent glad_vkResetEvent; -#define vkResetEvent glad_vkResetEvent -GLAD_API_CALL PFN_vkResetFences glad_vkResetFences; -#define vkResetFences glad_vkResetFences -GLAD_API_CALL PFN_vkSetEvent glad_vkSetEvent; -#define vkSetEvent glad_vkSetEvent -GLAD_API_CALL PFN_vkTrimCommandPool glad_vkTrimCommandPool; -#define vkTrimCommandPool glad_vkTrimCommandPool -GLAD_API_CALL PFN_vkUnmapMemory glad_vkUnmapMemory; -#define vkUnmapMemory glad_vkUnmapMemory -GLAD_API_CALL PFN_vkUpdateDescriptorSetWithTemplate glad_vkUpdateDescriptorSetWithTemplate; -#define vkUpdateDescriptorSetWithTemplate glad_vkUpdateDescriptorSetWithTemplate -GLAD_API_CALL PFN_vkUpdateDescriptorSets glad_vkUpdateDescriptorSets; -#define vkUpdateDescriptorSets glad_vkUpdateDescriptorSets -GLAD_API_CALL PFN_vkWaitForFences glad_vkWaitForFences; -#define vkWaitForFences glad_vkWaitForFences - - - - - -GLAD_API_CALL int gladLoadVulkanUserPtr( VkPhysicalDevice physical_device, GLADuserptrloadfunc load, void *userptr); -GLAD_API_CALL int gladLoadVulkan( VkPhysicalDevice physical_device, GLADloadfunc load); - - - -#ifdef __cplusplus -} -#endif -#endif - -/* Source */ -#ifdef GLAD_VULKAN_IMPLEMENTATION -#include -#include -#include - -#ifndef GLAD_IMPL_UTIL_C_ -#define GLAD_IMPL_UTIL_C_ - -#ifdef _MSC_VER -#define GLAD_IMPL_UTIL_SSCANF sscanf_s -#else -#define GLAD_IMPL_UTIL_SSCANF sscanf -#endif - -#endif /* GLAD_IMPL_UTIL_C_ */ - -#ifdef __cplusplus -extern "C" { -#endif - - - -int GLAD_VK_VERSION_1_0 = 0; -int GLAD_VK_VERSION_1_1 = 0; -int GLAD_VK_EXT_debug_report = 0; -int GLAD_VK_KHR_surface = 0; -int GLAD_VK_KHR_swapchain = 0; - - - -PFN_vkAcquireNextImage2KHR glad_vkAcquireNextImage2KHR = NULL; -PFN_vkAcquireNextImageKHR glad_vkAcquireNextImageKHR = NULL; -PFN_vkAllocateCommandBuffers glad_vkAllocateCommandBuffers = NULL; -PFN_vkAllocateDescriptorSets glad_vkAllocateDescriptorSets = NULL; -PFN_vkAllocateMemory glad_vkAllocateMemory = NULL; -PFN_vkBeginCommandBuffer glad_vkBeginCommandBuffer = NULL; -PFN_vkBindBufferMemory glad_vkBindBufferMemory = NULL; -PFN_vkBindBufferMemory2 glad_vkBindBufferMemory2 = NULL; -PFN_vkBindImageMemory glad_vkBindImageMemory = NULL; -PFN_vkBindImageMemory2 glad_vkBindImageMemory2 = NULL; -PFN_vkCmdBeginQuery glad_vkCmdBeginQuery = NULL; -PFN_vkCmdBeginRenderPass glad_vkCmdBeginRenderPass = NULL; -PFN_vkCmdBindDescriptorSets glad_vkCmdBindDescriptorSets = NULL; -PFN_vkCmdBindIndexBuffer glad_vkCmdBindIndexBuffer = NULL; -PFN_vkCmdBindPipeline glad_vkCmdBindPipeline = NULL; -PFN_vkCmdBindVertexBuffers glad_vkCmdBindVertexBuffers = NULL; -PFN_vkCmdBlitImage glad_vkCmdBlitImage = NULL; -PFN_vkCmdClearAttachments glad_vkCmdClearAttachments = NULL; -PFN_vkCmdClearColorImage glad_vkCmdClearColorImage = NULL; -PFN_vkCmdClearDepthStencilImage glad_vkCmdClearDepthStencilImage = NULL; -PFN_vkCmdCopyBuffer glad_vkCmdCopyBuffer = NULL; -PFN_vkCmdCopyBufferToImage glad_vkCmdCopyBufferToImage = NULL; -PFN_vkCmdCopyImage glad_vkCmdCopyImage = NULL; -PFN_vkCmdCopyImageToBuffer glad_vkCmdCopyImageToBuffer = NULL; -PFN_vkCmdCopyQueryPoolResults glad_vkCmdCopyQueryPoolResults = NULL; -PFN_vkCmdDispatch glad_vkCmdDispatch = NULL; -PFN_vkCmdDispatchBase glad_vkCmdDispatchBase = NULL; -PFN_vkCmdDispatchIndirect glad_vkCmdDispatchIndirect = NULL; -PFN_vkCmdDraw glad_vkCmdDraw = NULL; -PFN_vkCmdDrawIndexed glad_vkCmdDrawIndexed = NULL; -PFN_vkCmdDrawIndexedIndirect glad_vkCmdDrawIndexedIndirect = NULL; -PFN_vkCmdDrawIndirect glad_vkCmdDrawIndirect = NULL; -PFN_vkCmdEndQuery glad_vkCmdEndQuery = NULL; -PFN_vkCmdEndRenderPass glad_vkCmdEndRenderPass = NULL; -PFN_vkCmdExecuteCommands glad_vkCmdExecuteCommands = NULL; -PFN_vkCmdFillBuffer glad_vkCmdFillBuffer = NULL; -PFN_vkCmdNextSubpass glad_vkCmdNextSubpass = NULL; -PFN_vkCmdPipelineBarrier glad_vkCmdPipelineBarrier = NULL; -PFN_vkCmdPushConstants glad_vkCmdPushConstants = NULL; -PFN_vkCmdResetEvent glad_vkCmdResetEvent = NULL; -PFN_vkCmdResetQueryPool glad_vkCmdResetQueryPool = NULL; -PFN_vkCmdResolveImage glad_vkCmdResolveImage = NULL; -PFN_vkCmdSetBlendConstants glad_vkCmdSetBlendConstants = NULL; -PFN_vkCmdSetDepthBias glad_vkCmdSetDepthBias = NULL; -PFN_vkCmdSetDepthBounds glad_vkCmdSetDepthBounds = NULL; -PFN_vkCmdSetDeviceMask glad_vkCmdSetDeviceMask = NULL; -PFN_vkCmdSetEvent glad_vkCmdSetEvent = NULL; -PFN_vkCmdSetLineWidth glad_vkCmdSetLineWidth = NULL; -PFN_vkCmdSetScissor glad_vkCmdSetScissor = NULL; -PFN_vkCmdSetStencilCompareMask glad_vkCmdSetStencilCompareMask = NULL; -PFN_vkCmdSetStencilReference glad_vkCmdSetStencilReference = NULL; -PFN_vkCmdSetStencilWriteMask glad_vkCmdSetStencilWriteMask = NULL; -PFN_vkCmdSetViewport glad_vkCmdSetViewport = NULL; -PFN_vkCmdUpdateBuffer glad_vkCmdUpdateBuffer = NULL; -PFN_vkCmdWaitEvents glad_vkCmdWaitEvents = NULL; -PFN_vkCmdWriteTimestamp glad_vkCmdWriteTimestamp = NULL; -PFN_vkCreateBuffer glad_vkCreateBuffer = NULL; -PFN_vkCreateBufferView glad_vkCreateBufferView = NULL; -PFN_vkCreateCommandPool glad_vkCreateCommandPool = NULL; -PFN_vkCreateComputePipelines glad_vkCreateComputePipelines = NULL; -PFN_vkCreateDebugReportCallbackEXT glad_vkCreateDebugReportCallbackEXT = NULL; -PFN_vkCreateDescriptorPool glad_vkCreateDescriptorPool = NULL; -PFN_vkCreateDescriptorSetLayout glad_vkCreateDescriptorSetLayout = NULL; -PFN_vkCreateDescriptorUpdateTemplate glad_vkCreateDescriptorUpdateTemplate = NULL; -PFN_vkCreateDevice glad_vkCreateDevice = NULL; -PFN_vkCreateEvent glad_vkCreateEvent = NULL; -PFN_vkCreateFence glad_vkCreateFence = NULL; -PFN_vkCreateFramebuffer glad_vkCreateFramebuffer = NULL; -PFN_vkCreateGraphicsPipelines glad_vkCreateGraphicsPipelines = NULL; -PFN_vkCreateImage glad_vkCreateImage = NULL; -PFN_vkCreateImageView glad_vkCreateImageView = NULL; -PFN_vkCreateInstance glad_vkCreateInstance = NULL; -PFN_vkCreatePipelineCache glad_vkCreatePipelineCache = NULL; -PFN_vkCreatePipelineLayout glad_vkCreatePipelineLayout = NULL; -PFN_vkCreateQueryPool glad_vkCreateQueryPool = NULL; -PFN_vkCreateRenderPass glad_vkCreateRenderPass = NULL; -PFN_vkCreateSampler glad_vkCreateSampler = NULL; -PFN_vkCreateSamplerYcbcrConversion glad_vkCreateSamplerYcbcrConversion = NULL; -PFN_vkCreateSemaphore glad_vkCreateSemaphore = NULL; -PFN_vkCreateShaderModule glad_vkCreateShaderModule = NULL; -PFN_vkCreateSwapchainKHR glad_vkCreateSwapchainKHR = NULL; -PFN_vkDebugReportMessageEXT glad_vkDebugReportMessageEXT = NULL; -PFN_vkDestroyBuffer glad_vkDestroyBuffer = NULL; -PFN_vkDestroyBufferView glad_vkDestroyBufferView = NULL; -PFN_vkDestroyCommandPool glad_vkDestroyCommandPool = NULL; -PFN_vkDestroyDebugReportCallbackEXT glad_vkDestroyDebugReportCallbackEXT = NULL; -PFN_vkDestroyDescriptorPool glad_vkDestroyDescriptorPool = NULL; -PFN_vkDestroyDescriptorSetLayout glad_vkDestroyDescriptorSetLayout = NULL; -PFN_vkDestroyDescriptorUpdateTemplate glad_vkDestroyDescriptorUpdateTemplate = NULL; -PFN_vkDestroyDevice glad_vkDestroyDevice = NULL; -PFN_vkDestroyEvent glad_vkDestroyEvent = NULL; -PFN_vkDestroyFence glad_vkDestroyFence = NULL; -PFN_vkDestroyFramebuffer glad_vkDestroyFramebuffer = NULL; -PFN_vkDestroyImage glad_vkDestroyImage = NULL; -PFN_vkDestroyImageView glad_vkDestroyImageView = NULL; -PFN_vkDestroyInstance glad_vkDestroyInstance = NULL; -PFN_vkDestroyPipeline glad_vkDestroyPipeline = NULL; -PFN_vkDestroyPipelineCache glad_vkDestroyPipelineCache = NULL; -PFN_vkDestroyPipelineLayout glad_vkDestroyPipelineLayout = NULL; -PFN_vkDestroyQueryPool glad_vkDestroyQueryPool = NULL; -PFN_vkDestroyRenderPass glad_vkDestroyRenderPass = NULL; -PFN_vkDestroySampler glad_vkDestroySampler = NULL; -PFN_vkDestroySamplerYcbcrConversion glad_vkDestroySamplerYcbcrConversion = NULL; -PFN_vkDestroySemaphore glad_vkDestroySemaphore = NULL; -PFN_vkDestroyShaderModule glad_vkDestroyShaderModule = NULL; -PFN_vkDestroySurfaceKHR glad_vkDestroySurfaceKHR = NULL; -PFN_vkDestroySwapchainKHR glad_vkDestroySwapchainKHR = NULL; -PFN_vkDeviceWaitIdle glad_vkDeviceWaitIdle = NULL; -PFN_vkEndCommandBuffer glad_vkEndCommandBuffer = NULL; -PFN_vkEnumerateDeviceExtensionProperties glad_vkEnumerateDeviceExtensionProperties = NULL; -PFN_vkEnumerateDeviceLayerProperties glad_vkEnumerateDeviceLayerProperties = NULL; -PFN_vkEnumerateInstanceExtensionProperties glad_vkEnumerateInstanceExtensionProperties = NULL; -PFN_vkEnumerateInstanceLayerProperties glad_vkEnumerateInstanceLayerProperties = NULL; -PFN_vkEnumerateInstanceVersion glad_vkEnumerateInstanceVersion = NULL; -PFN_vkEnumeratePhysicalDeviceGroups glad_vkEnumeratePhysicalDeviceGroups = NULL; -PFN_vkEnumeratePhysicalDevices glad_vkEnumeratePhysicalDevices = NULL; -PFN_vkFlushMappedMemoryRanges glad_vkFlushMappedMemoryRanges = NULL; -PFN_vkFreeCommandBuffers glad_vkFreeCommandBuffers = NULL; -PFN_vkFreeDescriptorSets glad_vkFreeDescriptorSets = NULL; -PFN_vkFreeMemory glad_vkFreeMemory = NULL; -PFN_vkGetBufferMemoryRequirements glad_vkGetBufferMemoryRequirements = NULL; -PFN_vkGetBufferMemoryRequirements2 glad_vkGetBufferMemoryRequirements2 = NULL; -PFN_vkGetDescriptorSetLayoutSupport glad_vkGetDescriptorSetLayoutSupport = NULL; -PFN_vkGetDeviceGroupPeerMemoryFeatures glad_vkGetDeviceGroupPeerMemoryFeatures = NULL; -PFN_vkGetDeviceGroupPresentCapabilitiesKHR glad_vkGetDeviceGroupPresentCapabilitiesKHR = NULL; -PFN_vkGetDeviceGroupSurfacePresentModesKHR glad_vkGetDeviceGroupSurfacePresentModesKHR = NULL; -PFN_vkGetDeviceMemoryCommitment glad_vkGetDeviceMemoryCommitment = NULL; -PFN_vkGetDeviceProcAddr glad_vkGetDeviceProcAddr = NULL; -PFN_vkGetDeviceQueue glad_vkGetDeviceQueue = NULL; -PFN_vkGetDeviceQueue2 glad_vkGetDeviceQueue2 = NULL; -PFN_vkGetEventStatus glad_vkGetEventStatus = NULL; -PFN_vkGetFenceStatus glad_vkGetFenceStatus = NULL; -PFN_vkGetImageMemoryRequirements glad_vkGetImageMemoryRequirements = NULL; -PFN_vkGetImageMemoryRequirements2 glad_vkGetImageMemoryRequirements2 = NULL; -PFN_vkGetImageSparseMemoryRequirements glad_vkGetImageSparseMemoryRequirements = NULL; -PFN_vkGetImageSparseMemoryRequirements2 glad_vkGetImageSparseMemoryRequirements2 = NULL; -PFN_vkGetImageSubresourceLayout glad_vkGetImageSubresourceLayout = NULL; -PFN_vkGetInstanceProcAddr glad_vkGetInstanceProcAddr = NULL; -PFN_vkGetPhysicalDeviceExternalBufferProperties glad_vkGetPhysicalDeviceExternalBufferProperties = NULL; -PFN_vkGetPhysicalDeviceExternalFenceProperties glad_vkGetPhysicalDeviceExternalFenceProperties = NULL; -PFN_vkGetPhysicalDeviceExternalSemaphoreProperties glad_vkGetPhysicalDeviceExternalSemaphoreProperties = NULL; -PFN_vkGetPhysicalDeviceFeatures glad_vkGetPhysicalDeviceFeatures = NULL; -PFN_vkGetPhysicalDeviceFeatures2 glad_vkGetPhysicalDeviceFeatures2 = NULL; -PFN_vkGetPhysicalDeviceFormatProperties glad_vkGetPhysicalDeviceFormatProperties = NULL; -PFN_vkGetPhysicalDeviceFormatProperties2 glad_vkGetPhysicalDeviceFormatProperties2 = NULL; -PFN_vkGetPhysicalDeviceImageFormatProperties glad_vkGetPhysicalDeviceImageFormatProperties = NULL; -PFN_vkGetPhysicalDeviceImageFormatProperties2 glad_vkGetPhysicalDeviceImageFormatProperties2 = NULL; -PFN_vkGetPhysicalDeviceMemoryProperties glad_vkGetPhysicalDeviceMemoryProperties = NULL; -PFN_vkGetPhysicalDeviceMemoryProperties2 glad_vkGetPhysicalDeviceMemoryProperties2 = NULL; -PFN_vkGetPhysicalDevicePresentRectanglesKHR glad_vkGetPhysicalDevicePresentRectanglesKHR = NULL; -PFN_vkGetPhysicalDeviceProperties glad_vkGetPhysicalDeviceProperties = NULL; -PFN_vkGetPhysicalDeviceProperties2 glad_vkGetPhysicalDeviceProperties2 = NULL; -PFN_vkGetPhysicalDeviceQueueFamilyProperties glad_vkGetPhysicalDeviceQueueFamilyProperties = NULL; -PFN_vkGetPhysicalDeviceQueueFamilyProperties2 glad_vkGetPhysicalDeviceQueueFamilyProperties2 = NULL; -PFN_vkGetPhysicalDeviceSparseImageFormatProperties glad_vkGetPhysicalDeviceSparseImageFormatProperties = NULL; -PFN_vkGetPhysicalDeviceSparseImageFormatProperties2 glad_vkGetPhysicalDeviceSparseImageFormatProperties2 = NULL; -PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR glad_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = NULL; -PFN_vkGetPhysicalDeviceSurfaceFormatsKHR glad_vkGetPhysicalDeviceSurfaceFormatsKHR = NULL; -PFN_vkGetPhysicalDeviceSurfacePresentModesKHR glad_vkGetPhysicalDeviceSurfacePresentModesKHR = NULL; -PFN_vkGetPhysicalDeviceSurfaceSupportKHR glad_vkGetPhysicalDeviceSurfaceSupportKHR = NULL; -PFN_vkGetPipelineCacheData glad_vkGetPipelineCacheData = NULL; -PFN_vkGetQueryPoolResults glad_vkGetQueryPoolResults = NULL; -PFN_vkGetRenderAreaGranularity glad_vkGetRenderAreaGranularity = NULL; -PFN_vkGetSwapchainImagesKHR glad_vkGetSwapchainImagesKHR = NULL; -PFN_vkInvalidateMappedMemoryRanges glad_vkInvalidateMappedMemoryRanges = NULL; -PFN_vkMapMemory glad_vkMapMemory = NULL; -PFN_vkMergePipelineCaches glad_vkMergePipelineCaches = NULL; -PFN_vkQueueBindSparse glad_vkQueueBindSparse = NULL; -PFN_vkQueuePresentKHR glad_vkQueuePresentKHR = NULL; -PFN_vkQueueSubmit glad_vkQueueSubmit = NULL; -PFN_vkQueueWaitIdle glad_vkQueueWaitIdle = NULL; -PFN_vkResetCommandBuffer glad_vkResetCommandBuffer = NULL; -PFN_vkResetCommandPool glad_vkResetCommandPool = NULL; -PFN_vkResetDescriptorPool glad_vkResetDescriptorPool = NULL; -PFN_vkResetEvent glad_vkResetEvent = NULL; -PFN_vkResetFences glad_vkResetFences = NULL; -PFN_vkSetEvent glad_vkSetEvent = NULL; -PFN_vkTrimCommandPool glad_vkTrimCommandPool = NULL; -PFN_vkUnmapMemory glad_vkUnmapMemory = NULL; -PFN_vkUpdateDescriptorSetWithTemplate glad_vkUpdateDescriptorSetWithTemplate = NULL; -PFN_vkUpdateDescriptorSets glad_vkUpdateDescriptorSets = NULL; -PFN_vkWaitForFences glad_vkWaitForFences = NULL; - - -static void glad_vk_load_VK_VERSION_1_0( GLADuserptrloadfunc load, void* userptr) { - if(!GLAD_VK_VERSION_1_0) return; - glad_vkAllocateCommandBuffers = (PFN_vkAllocateCommandBuffers) load(userptr, "vkAllocateCommandBuffers"); - glad_vkAllocateDescriptorSets = (PFN_vkAllocateDescriptorSets) load(userptr, "vkAllocateDescriptorSets"); - glad_vkAllocateMemory = (PFN_vkAllocateMemory) load(userptr, "vkAllocateMemory"); - glad_vkBeginCommandBuffer = (PFN_vkBeginCommandBuffer) load(userptr, "vkBeginCommandBuffer"); - glad_vkBindBufferMemory = (PFN_vkBindBufferMemory) load(userptr, "vkBindBufferMemory"); - glad_vkBindImageMemory = (PFN_vkBindImageMemory) load(userptr, "vkBindImageMemory"); - glad_vkCmdBeginQuery = (PFN_vkCmdBeginQuery) load(userptr, "vkCmdBeginQuery"); - glad_vkCmdBeginRenderPass = (PFN_vkCmdBeginRenderPass) load(userptr, "vkCmdBeginRenderPass"); - glad_vkCmdBindDescriptorSets = (PFN_vkCmdBindDescriptorSets) load(userptr, "vkCmdBindDescriptorSets"); - glad_vkCmdBindIndexBuffer = (PFN_vkCmdBindIndexBuffer) load(userptr, "vkCmdBindIndexBuffer"); - glad_vkCmdBindPipeline = (PFN_vkCmdBindPipeline) load(userptr, "vkCmdBindPipeline"); - glad_vkCmdBindVertexBuffers = (PFN_vkCmdBindVertexBuffers) load(userptr, "vkCmdBindVertexBuffers"); - glad_vkCmdBlitImage = (PFN_vkCmdBlitImage) load(userptr, "vkCmdBlitImage"); - glad_vkCmdClearAttachments = (PFN_vkCmdClearAttachments) load(userptr, "vkCmdClearAttachments"); - glad_vkCmdClearColorImage = (PFN_vkCmdClearColorImage) load(userptr, "vkCmdClearColorImage"); - glad_vkCmdClearDepthStencilImage = (PFN_vkCmdClearDepthStencilImage) load(userptr, "vkCmdClearDepthStencilImage"); - glad_vkCmdCopyBuffer = (PFN_vkCmdCopyBuffer) load(userptr, "vkCmdCopyBuffer"); - glad_vkCmdCopyBufferToImage = (PFN_vkCmdCopyBufferToImage) load(userptr, "vkCmdCopyBufferToImage"); - glad_vkCmdCopyImage = (PFN_vkCmdCopyImage) load(userptr, "vkCmdCopyImage"); - glad_vkCmdCopyImageToBuffer = (PFN_vkCmdCopyImageToBuffer) load(userptr, "vkCmdCopyImageToBuffer"); - glad_vkCmdCopyQueryPoolResults = (PFN_vkCmdCopyQueryPoolResults) load(userptr, "vkCmdCopyQueryPoolResults"); - glad_vkCmdDispatch = (PFN_vkCmdDispatch) load(userptr, "vkCmdDispatch"); - glad_vkCmdDispatchIndirect = (PFN_vkCmdDispatchIndirect) load(userptr, "vkCmdDispatchIndirect"); - glad_vkCmdDraw = (PFN_vkCmdDraw) load(userptr, "vkCmdDraw"); - glad_vkCmdDrawIndexed = (PFN_vkCmdDrawIndexed) load(userptr, "vkCmdDrawIndexed"); - glad_vkCmdDrawIndexedIndirect = (PFN_vkCmdDrawIndexedIndirect) load(userptr, "vkCmdDrawIndexedIndirect"); - glad_vkCmdDrawIndirect = (PFN_vkCmdDrawIndirect) load(userptr, "vkCmdDrawIndirect"); - glad_vkCmdEndQuery = (PFN_vkCmdEndQuery) load(userptr, "vkCmdEndQuery"); - glad_vkCmdEndRenderPass = (PFN_vkCmdEndRenderPass) load(userptr, "vkCmdEndRenderPass"); - glad_vkCmdExecuteCommands = (PFN_vkCmdExecuteCommands) load(userptr, "vkCmdExecuteCommands"); - glad_vkCmdFillBuffer = (PFN_vkCmdFillBuffer) load(userptr, "vkCmdFillBuffer"); - glad_vkCmdNextSubpass = (PFN_vkCmdNextSubpass) load(userptr, "vkCmdNextSubpass"); - glad_vkCmdPipelineBarrier = (PFN_vkCmdPipelineBarrier) load(userptr, "vkCmdPipelineBarrier"); - glad_vkCmdPushConstants = (PFN_vkCmdPushConstants) load(userptr, "vkCmdPushConstants"); - glad_vkCmdResetEvent = (PFN_vkCmdResetEvent) load(userptr, "vkCmdResetEvent"); - glad_vkCmdResetQueryPool = (PFN_vkCmdResetQueryPool) load(userptr, "vkCmdResetQueryPool"); - glad_vkCmdResolveImage = (PFN_vkCmdResolveImage) load(userptr, "vkCmdResolveImage"); - glad_vkCmdSetBlendConstants = (PFN_vkCmdSetBlendConstants) load(userptr, "vkCmdSetBlendConstants"); - glad_vkCmdSetDepthBias = (PFN_vkCmdSetDepthBias) load(userptr, "vkCmdSetDepthBias"); - glad_vkCmdSetDepthBounds = (PFN_vkCmdSetDepthBounds) load(userptr, "vkCmdSetDepthBounds"); - glad_vkCmdSetEvent = (PFN_vkCmdSetEvent) load(userptr, "vkCmdSetEvent"); - glad_vkCmdSetLineWidth = (PFN_vkCmdSetLineWidth) load(userptr, "vkCmdSetLineWidth"); - glad_vkCmdSetScissor = (PFN_vkCmdSetScissor) load(userptr, "vkCmdSetScissor"); - glad_vkCmdSetStencilCompareMask = (PFN_vkCmdSetStencilCompareMask) load(userptr, "vkCmdSetStencilCompareMask"); - glad_vkCmdSetStencilReference = (PFN_vkCmdSetStencilReference) load(userptr, "vkCmdSetStencilReference"); - glad_vkCmdSetStencilWriteMask = (PFN_vkCmdSetStencilWriteMask) load(userptr, "vkCmdSetStencilWriteMask"); - glad_vkCmdSetViewport = (PFN_vkCmdSetViewport) load(userptr, "vkCmdSetViewport"); - glad_vkCmdUpdateBuffer = (PFN_vkCmdUpdateBuffer) load(userptr, "vkCmdUpdateBuffer"); - glad_vkCmdWaitEvents = (PFN_vkCmdWaitEvents) load(userptr, "vkCmdWaitEvents"); - glad_vkCmdWriteTimestamp = (PFN_vkCmdWriteTimestamp) load(userptr, "vkCmdWriteTimestamp"); - glad_vkCreateBuffer = (PFN_vkCreateBuffer) load(userptr, "vkCreateBuffer"); - glad_vkCreateBufferView = (PFN_vkCreateBufferView) load(userptr, "vkCreateBufferView"); - glad_vkCreateCommandPool = (PFN_vkCreateCommandPool) load(userptr, "vkCreateCommandPool"); - glad_vkCreateComputePipelines = (PFN_vkCreateComputePipelines) load(userptr, "vkCreateComputePipelines"); - glad_vkCreateDescriptorPool = (PFN_vkCreateDescriptorPool) load(userptr, "vkCreateDescriptorPool"); - glad_vkCreateDescriptorSetLayout = (PFN_vkCreateDescriptorSetLayout) load(userptr, "vkCreateDescriptorSetLayout"); - glad_vkCreateDevice = (PFN_vkCreateDevice) load(userptr, "vkCreateDevice"); - glad_vkCreateEvent = (PFN_vkCreateEvent) load(userptr, "vkCreateEvent"); - glad_vkCreateFence = (PFN_vkCreateFence) load(userptr, "vkCreateFence"); - glad_vkCreateFramebuffer = (PFN_vkCreateFramebuffer) load(userptr, "vkCreateFramebuffer"); - glad_vkCreateGraphicsPipelines = (PFN_vkCreateGraphicsPipelines) load(userptr, "vkCreateGraphicsPipelines"); - glad_vkCreateImage = (PFN_vkCreateImage) load(userptr, "vkCreateImage"); - glad_vkCreateImageView = (PFN_vkCreateImageView) load(userptr, "vkCreateImageView"); - glad_vkCreateInstance = (PFN_vkCreateInstance) load(userptr, "vkCreateInstance"); - glad_vkCreatePipelineCache = (PFN_vkCreatePipelineCache) load(userptr, "vkCreatePipelineCache"); - glad_vkCreatePipelineLayout = (PFN_vkCreatePipelineLayout) load(userptr, "vkCreatePipelineLayout"); - glad_vkCreateQueryPool = (PFN_vkCreateQueryPool) load(userptr, "vkCreateQueryPool"); - glad_vkCreateRenderPass = (PFN_vkCreateRenderPass) load(userptr, "vkCreateRenderPass"); - glad_vkCreateSampler = (PFN_vkCreateSampler) load(userptr, "vkCreateSampler"); - glad_vkCreateSemaphore = (PFN_vkCreateSemaphore) load(userptr, "vkCreateSemaphore"); - glad_vkCreateShaderModule = (PFN_vkCreateShaderModule) load(userptr, "vkCreateShaderModule"); - glad_vkDestroyBuffer = (PFN_vkDestroyBuffer) load(userptr, "vkDestroyBuffer"); - glad_vkDestroyBufferView = (PFN_vkDestroyBufferView) load(userptr, "vkDestroyBufferView"); - glad_vkDestroyCommandPool = (PFN_vkDestroyCommandPool) load(userptr, "vkDestroyCommandPool"); - glad_vkDestroyDescriptorPool = (PFN_vkDestroyDescriptorPool) load(userptr, "vkDestroyDescriptorPool"); - glad_vkDestroyDescriptorSetLayout = (PFN_vkDestroyDescriptorSetLayout) load(userptr, "vkDestroyDescriptorSetLayout"); - glad_vkDestroyDevice = (PFN_vkDestroyDevice) load(userptr, "vkDestroyDevice"); - glad_vkDestroyEvent = (PFN_vkDestroyEvent) load(userptr, "vkDestroyEvent"); - glad_vkDestroyFence = (PFN_vkDestroyFence) load(userptr, "vkDestroyFence"); - glad_vkDestroyFramebuffer = (PFN_vkDestroyFramebuffer) load(userptr, "vkDestroyFramebuffer"); - glad_vkDestroyImage = (PFN_vkDestroyImage) load(userptr, "vkDestroyImage"); - glad_vkDestroyImageView = (PFN_vkDestroyImageView) load(userptr, "vkDestroyImageView"); - glad_vkDestroyInstance = (PFN_vkDestroyInstance) load(userptr, "vkDestroyInstance"); - glad_vkDestroyPipeline = (PFN_vkDestroyPipeline) load(userptr, "vkDestroyPipeline"); - glad_vkDestroyPipelineCache = (PFN_vkDestroyPipelineCache) load(userptr, "vkDestroyPipelineCache"); - glad_vkDestroyPipelineLayout = (PFN_vkDestroyPipelineLayout) load(userptr, "vkDestroyPipelineLayout"); - glad_vkDestroyQueryPool = (PFN_vkDestroyQueryPool) load(userptr, "vkDestroyQueryPool"); - glad_vkDestroyRenderPass = (PFN_vkDestroyRenderPass) load(userptr, "vkDestroyRenderPass"); - glad_vkDestroySampler = (PFN_vkDestroySampler) load(userptr, "vkDestroySampler"); - glad_vkDestroySemaphore = (PFN_vkDestroySemaphore) load(userptr, "vkDestroySemaphore"); - glad_vkDestroyShaderModule = (PFN_vkDestroyShaderModule) load(userptr, "vkDestroyShaderModule"); - glad_vkDeviceWaitIdle = (PFN_vkDeviceWaitIdle) load(userptr, "vkDeviceWaitIdle"); - glad_vkEndCommandBuffer = (PFN_vkEndCommandBuffer) load(userptr, "vkEndCommandBuffer"); - glad_vkEnumerateDeviceExtensionProperties = (PFN_vkEnumerateDeviceExtensionProperties) load(userptr, "vkEnumerateDeviceExtensionProperties"); - glad_vkEnumerateDeviceLayerProperties = (PFN_vkEnumerateDeviceLayerProperties) load(userptr, "vkEnumerateDeviceLayerProperties"); - glad_vkEnumerateInstanceExtensionProperties = (PFN_vkEnumerateInstanceExtensionProperties) load(userptr, "vkEnumerateInstanceExtensionProperties"); - glad_vkEnumerateInstanceLayerProperties = (PFN_vkEnumerateInstanceLayerProperties) load(userptr, "vkEnumerateInstanceLayerProperties"); - glad_vkEnumeratePhysicalDevices = (PFN_vkEnumeratePhysicalDevices) load(userptr, "vkEnumeratePhysicalDevices"); - glad_vkFlushMappedMemoryRanges = (PFN_vkFlushMappedMemoryRanges) load(userptr, "vkFlushMappedMemoryRanges"); - glad_vkFreeCommandBuffers = (PFN_vkFreeCommandBuffers) load(userptr, "vkFreeCommandBuffers"); - glad_vkFreeDescriptorSets = (PFN_vkFreeDescriptorSets) load(userptr, "vkFreeDescriptorSets"); - glad_vkFreeMemory = (PFN_vkFreeMemory) load(userptr, "vkFreeMemory"); - glad_vkGetBufferMemoryRequirements = (PFN_vkGetBufferMemoryRequirements) load(userptr, "vkGetBufferMemoryRequirements"); - glad_vkGetDeviceMemoryCommitment = (PFN_vkGetDeviceMemoryCommitment) load(userptr, "vkGetDeviceMemoryCommitment"); - glad_vkGetDeviceProcAddr = (PFN_vkGetDeviceProcAddr) load(userptr, "vkGetDeviceProcAddr"); - glad_vkGetDeviceQueue = (PFN_vkGetDeviceQueue) load(userptr, "vkGetDeviceQueue"); - glad_vkGetEventStatus = (PFN_vkGetEventStatus) load(userptr, "vkGetEventStatus"); - glad_vkGetFenceStatus = (PFN_vkGetFenceStatus) load(userptr, "vkGetFenceStatus"); - glad_vkGetImageMemoryRequirements = (PFN_vkGetImageMemoryRequirements) load(userptr, "vkGetImageMemoryRequirements"); - glad_vkGetImageSparseMemoryRequirements = (PFN_vkGetImageSparseMemoryRequirements) load(userptr, "vkGetImageSparseMemoryRequirements"); - glad_vkGetImageSubresourceLayout = (PFN_vkGetImageSubresourceLayout) load(userptr, "vkGetImageSubresourceLayout"); - glad_vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr) load(userptr, "vkGetInstanceProcAddr"); - glad_vkGetPhysicalDeviceFeatures = (PFN_vkGetPhysicalDeviceFeatures) load(userptr, "vkGetPhysicalDeviceFeatures"); - glad_vkGetPhysicalDeviceFormatProperties = (PFN_vkGetPhysicalDeviceFormatProperties) load(userptr, "vkGetPhysicalDeviceFormatProperties"); - glad_vkGetPhysicalDeviceImageFormatProperties = (PFN_vkGetPhysicalDeviceImageFormatProperties) load(userptr, "vkGetPhysicalDeviceImageFormatProperties"); - glad_vkGetPhysicalDeviceMemoryProperties = (PFN_vkGetPhysicalDeviceMemoryProperties) load(userptr, "vkGetPhysicalDeviceMemoryProperties"); - glad_vkGetPhysicalDeviceProperties = (PFN_vkGetPhysicalDeviceProperties) load(userptr, "vkGetPhysicalDeviceProperties"); - glad_vkGetPhysicalDeviceQueueFamilyProperties = (PFN_vkGetPhysicalDeviceQueueFamilyProperties) load(userptr, "vkGetPhysicalDeviceQueueFamilyProperties"); - glad_vkGetPhysicalDeviceSparseImageFormatProperties = (PFN_vkGetPhysicalDeviceSparseImageFormatProperties) load(userptr, "vkGetPhysicalDeviceSparseImageFormatProperties"); - glad_vkGetPipelineCacheData = (PFN_vkGetPipelineCacheData) load(userptr, "vkGetPipelineCacheData"); - glad_vkGetQueryPoolResults = (PFN_vkGetQueryPoolResults) load(userptr, "vkGetQueryPoolResults"); - glad_vkGetRenderAreaGranularity = (PFN_vkGetRenderAreaGranularity) load(userptr, "vkGetRenderAreaGranularity"); - glad_vkInvalidateMappedMemoryRanges = (PFN_vkInvalidateMappedMemoryRanges) load(userptr, "vkInvalidateMappedMemoryRanges"); - glad_vkMapMemory = (PFN_vkMapMemory) load(userptr, "vkMapMemory"); - glad_vkMergePipelineCaches = (PFN_vkMergePipelineCaches) load(userptr, "vkMergePipelineCaches"); - glad_vkQueueBindSparse = (PFN_vkQueueBindSparse) load(userptr, "vkQueueBindSparse"); - glad_vkQueueSubmit = (PFN_vkQueueSubmit) load(userptr, "vkQueueSubmit"); - glad_vkQueueWaitIdle = (PFN_vkQueueWaitIdle) load(userptr, "vkQueueWaitIdle"); - glad_vkResetCommandBuffer = (PFN_vkResetCommandBuffer) load(userptr, "vkResetCommandBuffer"); - glad_vkResetCommandPool = (PFN_vkResetCommandPool) load(userptr, "vkResetCommandPool"); - glad_vkResetDescriptorPool = (PFN_vkResetDescriptorPool) load(userptr, "vkResetDescriptorPool"); - glad_vkResetEvent = (PFN_vkResetEvent) load(userptr, "vkResetEvent"); - glad_vkResetFences = (PFN_vkResetFences) load(userptr, "vkResetFences"); - glad_vkSetEvent = (PFN_vkSetEvent) load(userptr, "vkSetEvent"); - glad_vkUnmapMemory = (PFN_vkUnmapMemory) load(userptr, "vkUnmapMemory"); - glad_vkUpdateDescriptorSets = (PFN_vkUpdateDescriptorSets) load(userptr, "vkUpdateDescriptorSets"); - glad_vkWaitForFences = (PFN_vkWaitForFences) load(userptr, "vkWaitForFences"); -} -static void glad_vk_load_VK_VERSION_1_1( GLADuserptrloadfunc load, void* userptr) { - if(!GLAD_VK_VERSION_1_1) return; - glad_vkBindBufferMemory2 = (PFN_vkBindBufferMemory2) load(userptr, "vkBindBufferMemory2"); - glad_vkBindImageMemory2 = (PFN_vkBindImageMemory2) load(userptr, "vkBindImageMemory2"); - glad_vkCmdDispatchBase = (PFN_vkCmdDispatchBase) load(userptr, "vkCmdDispatchBase"); - glad_vkCmdSetDeviceMask = (PFN_vkCmdSetDeviceMask) load(userptr, "vkCmdSetDeviceMask"); - glad_vkCreateDescriptorUpdateTemplate = (PFN_vkCreateDescriptorUpdateTemplate) load(userptr, "vkCreateDescriptorUpdateTemplate"); - glad_vkCreateSamplerYcbcrConversion = (PFN_vkCreateSamplerYcbcrConversion) load(userptr, "vkCreateSamplerYcbcrConversion"); - glad_vkDestroyDescriptorUpdateTemplate = (PFN_vkDestroyDescriptorUpdateTemplate) load(userptr, "vkDestroyDescriptorUpdateTemplate"); - glad_vkDestroySamplerYcbcrConversion = (PFN_vkDestroySamplerYcbcrConversion) load(userptr, "vkDestroySamplerYcbcrConversion"); - glad_vkEnumerateInstanceVersion = (PFN_vkEnumerateInstanceVersion) load(userptr, "vkEnumerateInstanceVersion"); - glad_vkEnumeratePhysicalDeviceGroups = (PFN_vkEnumeratePhysicalDeviceGroups) load(userptr, "vkEnumeratePhysicalDeviceGroups"); - glad_vkGetBufferMemoryRequirements2 = (PFN_vkGetBufferMemoryRequirements2) load(userptr, "vkGetBufferMemoryRequirements2"); - glad_vkGetDescriptorSetLayoutSupport = (PFN_vkGetDescriptorSetLayoutSupport) load(userptr, "vkGetDescriptorSetLayoutSupport"); - glad_vkGetDeviceGroupPeerMemoryFeatures = (PFN_vkGetDeviceGroupPeerMemoryFeatures) load(userptr, "vkGetDeviceGroupPeerMemoryFeatures"); - glad_vkGetDeviceQueue2 = (PFN_vkGetDeviceQueue2) load(userptr, "vkGetDeviceQueue2"); - glad_vkGetImageMemoryRequirements2 = (PFN_vkGetImageMemoryRequirements2) load(userptr, "vkGetImageMemoryRequirements2"); - glad_vkGetImageSparseMemoryRequirements2 = (PFN_vkGetImageSparseMemoryRequirements2) load(userptr, "vkGetImageSparseMemoryRequirements2"); - glad_vkGetPhysicalDeviceExternalBufferProperties = (PFN_vkGetPhysicalDeviceExternalBufferProperties) load(userptr, "vkGetPhysicalDeviceExternalBufferProperties"); - glad_vkGetPhysicalDeviceExternalFenceProperties = (PFN_vkGetPhysicalDeviceExternalFenceProperties) load(userptr, "vkGetPhysicalDeviceExternalFenceProperties"); - glad_vkGetPhysicalDeviceExternalSemaphoreProperties = (PFN_vkGetPhysicalDeviceExternalSemaphoreProperties) load(userptr, "vkGetPhysicalDeviceExternalSemaphoreProperties"); - glad_vkGetPhysicalDeviceFeatures2 = (PFN_vkGetPhysicalDeviceFeatures2) load(userptr, "vkGetPhysicalDeviceFeatures2"); - glad_vkGetPhysicalDeviceFormatProperties2 = (PFN_vkGetPhysicalDeviceFormatProperties2) load(userptr, "vkGetPhysicalDeviceFormatProperties2"); - glad_vkGetPhysicalDeviceImageFormatProperties2 = (PFN_vkGetPhysicalDeviceImageFormatProperties2) load(userptr, "vkGetPhysicalDeviceImageFormatProperties2"); - glad_vkGetPhysicalDeviceMemoryProperties2 = (PFN_vkGetPhysicalDeviceMemoryProperties2) load(userptr, "vkGetPhysicalDeviceMemoryProperties2"); - glad_vkGetPhysicalDeviceProperties2 = (PFN_vkGetPhysicalDeviceProperties2) load(userptr, "vkGetPhysicalDeviceProperties2"); - glad_vkGetPhysicalDeviceQueueFamilyProperties2 = (PFN_vkGetPhysicalDeviceQueueFamilyProperties2) load(userptr, "vkGetPhysicalDeviceQueueFamilyProperties2"); - glad_vkGetPhysicalDeviceSparseImageFormatProperties2 = (PFN_vkGetPhysicalDeviceSparseImageFormatProperties2) load(userptr, "vkGetPhysicalDeviceSparseImageFormatProperties2"); - glad_vkTrimCommandPool = (PFN_vkTrimCommandPool) load(userptr, "vkTrimCommandPool"); - glad_vkUpdateDescriptorSetWithTemplate = (PFN_vkUpdateDescriptorSetWithTemplate) load(userptr, "vkUpdateDescriptorSetWithTemplate"); -} -static void glad_vk_load_VK_EXT_debug_report( GLADuserptrloadfunc load, void* userptr) { - if(!GLAD_VK_EXT_debug_report) return; - glad_vkCreateDebugReportCallbackEXT = (PFN_vkCreateDebugReportCallbackEXT) load(userptr, "vkCreateDebugReportCallbackEXT"); - glad_vkDebugReportMessageEXT = (PFN_vkDebugReportMessageEXT) load(userptr, "vkDebugReportMessageEXT"); - glad_vkDestroyDebugReportCallbackEXT = (PFN_vkDestroyDebugReportCallbackEXT) load(userptr, "vkDestroyDebugReportCallbackEXT"); -} -static void glad_vk_load_VK_KHR_surface( GLADuserptrloadfunc load, void* userptr) { - if(!GLAD_VK_KHR_surface) return; - glad_vkDestroySurfaceKHR = (PFN_vkDestroySurfaceKHR) load(userptr, "vkDestroySurfaceKHR"); - glad_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = (PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR) load(userptr, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR"); - glad_vkGetPhysicalDeviceSurfaceFormatsKHR = (PFN_vkGetPhysicalDeviceSurfaceFormatsKHR) load(userptr, "vkGetPhysicalDeviceSurfaceFormatsKHR"); - glad_vkGetPhysicalDeviceSurfacePresentModesKHR = (PFN_vkGetPhysicalDeviceSurfacePresentModesKHR) load(userptr, "vkGetPhysicalDeviceSurfacePresentModesKHR"); - glad_vkGetPhysicalDeviceSurfaceSupportKHR = (PFN_vkGetPhysicalDeviceSurfaceSupportKHR) load(userptr, "vkGetPhysicalDeviceSurfaceSupportKHR"); -} -static void glad_vk_load_VK_KHR_swapchain( GLADuserptrloadfunc load, void* userptr) { - if(!GLAD_VK_KHR_swapchain) return; - glad_vkAcquireNextImage2KHR = (PFN_vkAcquireNextImage2KHR) load(userptr, "vkAcquireNextImage2KHR"); - glad_vkAcquireNextImageKHR = (PFN_vkAcquireNextImageKHR) load(userptr, "vkAcquireNextImageKHR"); - glad_vkCreateSwapchainKHR = (PFN_vkCreateSwapchainKHR) load(userptr, "vkCreateSwapchainKHR"); - glad_vkDestroySwapchainKHR = (PFN_vkDestroySwapchainKHR) load(userptr, "vkDestroySwapchainKHR"); - glad_vkGetDeviceGroupPresentCapabilitiesKHR = (PFN_vkGetDeviceGroupPresentCapabilitiesKHR) load(userptr, "vkGetDeviceGroupPresentCapabilitiesKHR"); - glad_vkGetDeviceGroupSurfacePresentModesKHR = (PFN_vkGetDeviceGroupSurfacePresentModesKHR) load(userptr, "vkGetDeviceGroupSurfacePresentModesKHR"); - glad_vkGetPhysicalDevicePresentRectanglesKHR = (PFN_vkGetPhysicalDevicePresentRectanglesKHR) load(userptr, "vkGetPhysicalDevicePresentRectanglesKHR"); - glad_vkGetSwapchainImagesKHR = (PFN_vkGetSwapchainImagesKHR) load(userptr, "vkGetSwapchainImagesKHR"); - glad_vkQueuePresentKHR = (PFN_vkQueuePresentKHR) load(userptr, "vkQueuePresentKHR"); -} - - - -static int glad_vk_get_extensions( VkPhysicalDevice physical_device, uint32_t *out_extension_count, char ***out_extensions) { - uint32_t i; - uint32_t instance_extension_count = 0; - uint32_t device_extension_count = 0; - uint32_t max_extension_count = 0; - uint32_t total_extension_count = 0; - char **extensions = NULL; - VkExtensionProperties *ext_properties = NULL; - VkResult result; - - if (glad_vkEnumerateInstanceExtensionProperties == NULL || (physical_device != NULL && glad_vkEnumerateDeviceExtensionProperties == NULL)) { - return 0; - } - - result = glad_vkEnumerateInstanceExtensionProperties(NULL, &instance_extension_count, NULL); - if (result != VK_SUCCESS) { - return 0; - } - - if (physical_device != NULL) { - result = glad_vkEnumerateDeviceExtensionProperties(physical_device, NULL, &device_extension_count, NULL); - if (result != VK_SUCCESS) { - return 0; - } - } - - total_extension_count = instance_extension_count + device_extension_count; - if (total_extension_count <= 0) { - return 0; - } - - max_extension_count = instance_extension_count > device_extension_count - ? instance_extension_count : device_extension_count; - - ext_properties = (VkExtensionProperties*) malloc(max_extension_count * sizeof(VkExtensionProperties)); - if (ext_properties == NULL) { - goto glad_vk_get_extensions_error; - } - - result = glad_vkEnumerateInstanceExtensionProperties(NULL, &instance_extension_count, ext_properties); - if (result != VK_SUCCESS) { - goto glad_vk_get_extensions_error; - } - - extensions = (char**) calloc(total_extension_count, sizeof(char*)); - if (extensions == NULL) { - goto glad_vk_get_extensions_error; - } - - for (i = 0; i < instance_extension_count; ++i) { - VkExtensionProperties ext = ext_properties[i]; - - size_t extension_name_length = strlen(ext.extensionName) + 1; - extensions[i] = (char*) malloc(extension_name_length * sizeof(char)); - if (extensions[i] == NULL) { - goto glad_vk_get_extensions_error; - } - memcpy(extensions[i], ext.extensionName, extension_name_length * sizeof(char)); - } - - if (physical_device != NULL) { - result = glad_vkEnumerateDeviceExtensionProperties(physical_device, NULL, &device_extension_count, ext_properties); - if (result != VK_SUCCESS) { - goto glad_vk_get_extensions_error; - } - - for (i = 0; i < device_extension_count; ++i) { - VkExtensionProperties ext = ext_properties[i]; - - size_t extension_name_length = strlen(ext.extensionName) + 1; - extensions[instance_extension_count + i] = (char*) malloc(extension_name_length * sizeof(char)); - if (extensions[instance_extension_count + i] == NULL) { - goto glad_vk_get_extensions_error; - } - memcpy(extensions[instance_extension_count + i], ext.extensionName, extension_name_length * sizeof(char)); - } - } - - free((void*) ext_properties); - - *out_extension_count = total_extension_count; - *out_extensions = extensions; - - return 1; - -glad_vk_get_extensions_error: - free((void*) ext_properties); - if (extensions != NULL) { - for (i = 0; i < total_extension_count; ++i) { - free((void*) extensions[i]); - } - free(extensions); - } - return 0; -} - -static void glad_vk_free_extensions(uint32_t extension_count, char **extensions) { - uint32_t i; - - for(i = 0; i < extension_count ; ++i) { - free((void*) (extensions[i])); - } - - free((void*) extensions); -} - -static int glad_vk_has_extension(const char *name, uint32_t extension_count, char **extensions) { - uint32_t i; - - for (i = 0; i < extension_count; ++i) { - if(extensions[i] != NULL && strcmp(name, extensions[i]) == 0) { - return 1; - } - } - - return 0; -} - -static GLADapiproc glad_vk_get_proc_from_userptr(void *userptr, const char* name) { - return (GLAD_GNUC_EXTENSION (GLADapiproc (*)(const char *name)) userptr)(name); -} - -static int glad_vk_find_extensions_vulkan( VkPhysicalDevice physical_device) { - uint32_t extension_count = 0; - char **extensions = NULL; - if (!glad_vk_get_extensions(physical_device, &extension_count, &extensions)) return 0; - - GLAD_VK_EXT_debug_report = glad_vk_has_extension("VK_EXT_debug_report", extension_count, extensions); - GLAD_VK_KHR_surface = glad_vk_has_extension("VK_KHR_surface", extension_count, extensions); - GLAD_VK_KHR_swapchain = glad_vk_has_extension("VK_KHR_swapchain", extension_count, extensions); - - (void) glad_vk_has_extension; - - glad_vk_free_extensions(extension_count, extensions); - - return 1; -} - -static int glad_vk_find_core_vulkan( VkPhysicalDevice physical_device) { - int major = 1; - int minor = 0; - -#ifdef VK_VERSION_1_1 - if (glad_vkEnumerateInstanceVersion != NULL) { - uint32_t version; - VkResult result; - - result = glad_vkEnumerateInstanceVersion(&version); - if (result == VK_SUCCESS) { - major = (int) VK_VERSION_MAJOR(version); - minor = (int) VK_VERSION_MINOR(version); - } - } -#endif - - if (physical_device != NULL && glad_vkGetPhysicalDeviceProperties != NULL) { - VkPhysicalDeviceProperties properties; - glad_vkGetPhysicalDeviceProperties(physical_device, &properties); - - major = (int) VK_VERSION_MAJOR(properties.apiVersion); - minor = (int) VK_VERSION_MINOR(properties.apiVersion); - } - - GLAD_VK_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1; - GLAD_VK_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1; - - return GLAD_MAKE_VERSION(major, minor); -} - -int gladLoadVulkanUserPtr( VkPhysicalDevice physical_device, GLADuserptrloadfunc load, void *userptr) { - int version; - -#ifdef VK_VERSION_1_1 - glad_vkEnumerateInstanceVersion = (PFN_vkEnumerateInstanceVersion) load(userptr, "vkEnumerateInstanceVersion"); -#endif - version = glad_vk_find_core_vulkan( physical_device); - if (!version) { - return 0; - } - - glad_vk_load_VK_VERSION_1_0(load, userptr); - glad_vk_load_VK_VERSION_1_1(load, userptr); - - if (!glad_vk_find_extensions_vulkan( physical_device)) return 0; - glad_vk_load_VK_EXT_debug_report(load, userptr); - glad_vk_load_VK_KHR_surface(load, userptr); - glad_vk_load_VK_KHR_swapchain(load, userptr); - - - return version; -} - - -int gladLoadVulkan( VkPhysicalDevice physical_device, GLADloadfunc load) { - return gladLoadVulkanUserPtr( physical_device, glad_vk_get_proc_from_userptr, GLAD_GNUC_EXTENSION (void*) load); -} - - - - - - -#ifdef __cplusplus -} -#endif - -#endif /* GLAD_VULKAN_IMPLEMENTATION */ - diff --git a/3rdparty/glfw/source/deps/linmath.h b/3rdparty/glfw/source/deps/linmath.h deleted file mode 100644 index 5c80265..0000000 --- a/3rdparty/glfw/source/deps/linmath.h +++ /dev/null @@ -1,606 +0,0 @@ -#ifndef LINMATH_H -#define LINMATH_H - -#include -#include -#include - -/* 2021-03-21 Camilla Löwy - * - Replaced double constants with float equivalents - */ - -#ifdef LINMATH_NO_INLINE -#define LINMATH_H_FUNC static -#else -#define LINMATH_H_FUNC static inline -#endif - -#define LINMATH_H_DEFINE_VEC(n) \ -typedef float vec##n[n]; \ -LINMATH_H_FUNC void vec##n##_add(vec##n r, vec##n const a, vec##n const b) \ -{ \ - int i; \ - for(i=0; ib[i] ? a[i] : b[i]; \ -} \ -LINMATH_H_FUNC void vec##n##_dup(vec##n r, vec##n const src) \ -{ \ - int i; \ - for(i=0; i 1e-4) { - vec3_norm(u, u); - mat4x4 T; - mat4x4_from_vec3_mul_outer(T, u, u); - - mat4x4 S = { - { 0, u[2], -u[1], 0}, - {-u[2], 0, u[0], 0}, - { u[1], -u[0], 0, 0}, - { 0, 0, 0, 0} - }; - mat4x4_scale(S, S, s); - - mat4x4 C; - mat4x4_identity(C); - mat4x4_sub(C, C, T); - - mat4x4_scale(C, C, c); - - mat4x4_add(T, T, C); - mat4x4_add(T, T, S); - - T[3][3] = 1.f; - mat4x4_mul(R, M, T); - } else { - mat4x4_dup(R, M); - } -} -LINMATH_H_FUNC void mat4x4_rotate_X(mat4x4 Q, mat4x4 const M, float angle) -{ - float s = sinf(angle); - float c = cosf(angle); - mat4x4 R = { - {1.f, 0.f, 0.f, 0.f}, - {0.f, c, s, 0.f}, - {0.f, -s, c, 0.f}, - {0.f, 0.f, 0.f, 1.f} - }; - mat4x4_mul(Q, M, R); -} -LINMATH_H_FUNC void mat4x4_rotate_Y(mat4x4 Q, mat4x4 const M, float angle) -{ - float s = sinf(angle); - float c = cosf(angle); - mat4x4 R = { - { c, 0.f, -s, 0.f}, - { 0.f, 1.f, 0.f, 0.f}, - { s, 0.f, c, 0.f}, - { 0.f, 0.f, 0.f, 1.f} - }; - mat4x4_mul(Q, M, R); -} -LINMATH_H_FUNC void mat4x4_rotate_Z(mat4x4 Q, mat4x4 const M, float angle) -{ - float s = sinf(angle); - float c = cosf(angle); - mat4x4 R = { - { c, s, 0.f, 0.f}, - { -s, c, 0.f, 0.f}, - { 0.f, 0.f, 1.f, 0.f}, - { 0.f, 0.f, 0.f, 1.f} - }; - mat4x4_mul(Q, M, R); -} -LINMATH_H_FUNC void mat4x4_invert(mat4x4 T, mat4x4 const M) -{ - float s[6]; - float c[6]; - s[0] = M[0][0]*M[1][1] - M[1][0]*M[0][1]; - s[1] = M[0][0]*M[1][2] - M[1][0]*M[0][2]; - s[2] = M[0][0]*M[1][3] - M[1][0]*M[0][3]; - s[3] = M[0][1]*M[1][2] - M[1][1]*M[0][2]; - s[4] = M[0][1]*M[1][3] - M[1][1]*M[0][3]; - s[5] = M[0][2]*M[1][3] - M[1][2]*M[0][3]; - - c[0] = M[2][0]*M[3][1] - M[3][0]*M[2][1]; - c[1] = M[2][0]*M[3][2] - M[3][0]*M[2][2]; - c[2] = M[2][0]*M[3][3] - M[3][0]*M[2][3]; - c[3] = M[2][1]*M[3][2] - M[3][1]*M[2][2]; - c[4] = M[2][1]*M[3][3] - M[3][1]*M[2][3]; - c[5] = M[2][2]*M[3][3] - M[3][2]*M[2][3]; - - /* Assumes it is invertible */ - float idet = 1.0f/( s[0]*c[5]-s[1]*c[4]+s[2]*c[3]+s[3]*c[2]-s[4]*c[1]+s[5]*c[0] ); - - T[0][0] = ( M[1][1] * c[5] - M[1][2] * c[4] + M[1][3] * c[3]) * idet; - T[0][1] = (-M[0][1] * c[5] + M[0][2] * c[4] - M[0][3] * c[3]) * idet; - T[0][2] = ( M[3][1] * s[5] - M[3][2] * s[4] + M[3][3] * s[3]) * idet; - T[0][3] = (-M[2][1] * s[5] + M[2][2] * s[4] - M[2][3] * s[3]) * idet; - - T[1][0] = (-M[1][0] * c[5] + M[1][2] * c[2] - M[1][3] * c[1]) * idet; - T[1][1] = ( M[0][0] * c[5] - M[0][2] * c[2] + M[0][3] * c[1]) * idet; - T[1][2] = (-M[3][0] * s[5] + M[3][2] * s[2] - M[3][3] * s[1]) * idet; - T[1][3] = ( M[2][0] * s[5] - M[2][2] * s[2] + M[2][3] * s[1]) * idet; - - T[2][0] = ( M[1][0] * c[4] - M[1][1] * c[2] + M[1][3] * c[0]) * idet; - T[2][1] = (-M[0][0] * c[4] + M[0][1] * c[2] - M[0][3] * c[0]) * idet; - T[2][2] = ( M[3][0] * s[4] - M[3][1] * s[2] + M[3][3] * s[0]) * idet; - T[2][3] = (-M[2][0] * s[4] + M[2][1] * s[2] - M[2][3] * s[0]) * idet; - - T[3][0] = (-M[1][0] * c[3] + M[1][1] * c[1] - M[1][2] * c[0]) * idet; - T[3][1] = ( M[0][0] * c[3] - M[0][1] * c[1] + M[0][2] * c[0]) * idet; - T[3][2] = (-M[3][0] * s[3] + M[3][1] * s[1] - M[3][2] * s[0]) * idet; - T[3][3] = ( M[2][0] * s[3] - M[2][1] * s[1] + M[2][2] * s[0]) * idet; -} -LINMATH_H_FUNC void mat4x4_orthonormalize(mat4x4 R, mat4x4 const M) -{ - mat4x4_dup(R, M); - float s = 1.f; - vec3 h; - - vec3_norm(R[2], R[2]); - - s = vec3_mul_inner(R[1], R[2]); - vec3_scale(h, R[2], s); - vec3_sub(R[1], R[1], h); - vec3_norm(R[1], R[1]); - - s = vec3_mul_inner(R[0], R[2]); - vec3_scale(h, R[2], s); - vec3_sub(R[0], R[0], h); - - s = vec3_mul_inner(R[0], R[1]); - vec3_scale(h, R[1], s); - vec3_sub(R[0], R[0], h); - vec3_norm(R[0], R[0]); -} - -LINMATH_H_FUNC void mat4x4_frustum(mat4x4 M, float l, float r, float b, float t, float n, float f) -{ - M[0][0] = 2.f*n/(r-l); - M[0][1] = M[0][2] = M[0][3] = 0.f; - - M[1][1] = 2.f*n/(t-b); - M[1][0] = M[1][2] = M[1][3] = 0.f; - - M[2][0] = (r+l)/(r-l); - M[2][1] = (t+b)/(t-b); - M[2][2] = -(f+n)/(f-n); - M[2][3] = -1.f; - - M[3][2] = -2.f*(f*n)/(f-n); - M[3][0] = M[3][1] = M[3][3] = 0.f; -} -LINMATH_H_FUNC void mat4x4_ortho(mat4x4 M, float l, float r, float b, float t, float n, float f) -{ - M[0][0] = 2.f/(r-l); - M[0][1] = M[0][2] = M[0][3] = 0.f; - - M[1][1] = 2.f/(t-b); - M[1][0] = M[1][2] = M[1][3] = 0.f; - - M[2][2] = -2.f/(f-n); - M[2][0] = M[2][1] = M[2][3] = 0.f; - - M[3][0] = -(r+l)/(r-l); - M[3][1] = -(t+b)/(t-b); - M[3][2] = -(f+n)/(f-n); - M[3][3] = 1.f; -} -LINMATH_H_FUNC void mat4x4_perspective(mat4x4 m, float y_fov, float aspect, float n, float f) -{ - /* NOTE: Degrees are an unhandy unit to work with. - * linmath.h uses radians for everything! */ - float const a = 1.f / tanf(y_fov / 2.f); - - m[0][0] = a / aspect; - m[0][1] = 0.f; - m[0][2] = 0.f; - m[0][3] = 0.f; - - m[1][0] = 0.f; - m[1][1] = a; - m[1][2] = 0.f; - m[1][3] = 0.f; - - m[2][0] = 0.f; - m[2][1] = 0.f; - m[2][2] = -((f + n) / (f - n)); - m[2][3] = -1.f; - - m[3][0] = 0.f; - m[3][1] = 0.f; - m[3][2] = -((2.f * f * n) / (f - n)); - m[3][3] = 0.f; -} -LINMATH_H_FUNC void mat4x4_look_at(mat4x4 m, vec3 const eye, vec3 const center, vec3 const up) -{ - /* Adapted from Android's OpenGL Matrix.java. */ - /* See the OpenGL GLUT documentation for gluLookAt for a description */ - /* of the algorithm. We implement it in a straightforward way: */ - - /* TODO: The negation of of can be spared by swapping the order of - * operands in the following cross products in the right way. */ - vec3 f; - vec3_sub(f, center, eye); - vec3_norm(f, f); - - vec3 s; - vec3_mul_cross(s, f, up); - vec3_norm(s, s); - - vec3 t; - vec3_mul_cross(t, s, f); - - m[0][0] = s[0]; - m[0][1] = t[0]; - m[0][2] = -f[0]; - m[0][3] = 0.f; - - m[1][0] = s[1]; - m[1][1] = t[1]; - m[1][2] = -f[1]; - m[1][3] = 0.f; - - m[2][0] = s[2]; - m[2][1] = t[2]; - m[2][2] = -f[2]; - m[2][3] = 0.f; - - m[3][0] = 0.f; - m[3][1] = 0.f; - m[3][2] = 0.f; - m[3][3] = 1.f; - - mat4x4_translate_in_place(m, -eye[0], -eye[1], -eye[2]); -} - -typedef float quat[4]; -#define quat_add vec4_add -#define quat_sub vec4_sub -#define quat_norm vec4_norm -#define quat_scale vec4_scale -#define quat_mul_inner vec4_mul_inner - -LINMATH_H_FUNC void quat_identity(quat q) -{ - q[0] = q[1] = q[2] = 0.f; - q[3] = 1.f; -} -LINMATH_H_FUNC void quat_mul(quat r, quat const p, quat const q) -{ - vec3 w; - vec3_mul_cross(r, p, q); - vec3_scale(w, p, q[3]); - vec3_add(r, r, w); - vec3_scale(w, q, p[3]); - vec3_add(r, r, w); - r[3] = p[3]*q[3] - vec3_mul_inner(p, q); -} -LINMATH_H_FUNC void quat_conj(quat r, quat const q) -{ - int i; - for(i=0; i<3; ++i) - r[i] = -q[i]; - r[3] = q[3]; -} -LINMATH_H_FUNC void quat_rotate(quat r, float angle, vec3 const axis) { - vec3 axis_norm; - vec3_norm(axis_norm, axis); - float s = sinf(angle / 2); - float c = cosf(angle / 2); - vec3_scale(r, axis_norm, s); - r[3] = c; -} -LINMATH_H_FUNC void quat_mul_vec3(vec3 r, quat const q, vec3 const v) -{ -/* - * Method by Fabian 'ryg' Giessen (of Farbrausch) -t = 2 * cross(q.xyz, v) -v' = v + q.w * t + cross(q.xyz, t) - */ - vec3 t; - vec3 q_xyz = {q[0], q[1], q[2]}; - vec3 u = {q[0], q[1], q[2]}; - - vec3_mul_cross(t, q_xyz, v); - vec3_scale(t, t, 2); - - vec3_mul_cross(u, q_xyz, t); - vec3_scale(t, t, q[3]); - - vec3_add(r, v, t); - vec3_add(r, r, u); -} -LINMATH_H_FUNC void mat4x4_from_quat(mat4x4 M, quat const q) -{ - float a = q[3]; - float b = q[0]; - float c = q[1]; - float d = q[2]; - float a2 = a*a; - float b2 = b*b; - float c2 = c*c; - float d2 = d*d; - - M[0][0] = a2 + b2 - c2 - d2; - M[0][1] = 2.f*(b*c + a*d); - M[0][2] = 2.f*(b*d - a*c); - M[0][3] = 0.f; - - M[1][0] = 2*(b*c - a*d); - M[1][1] = a2 - b2 + c2 - d2; - M[1][2] = 2.f*(c*d + a*b); - M[1][3] = 0.f; - - M[2][0] = 2.f*(b*d + a*c); - M[2][1] = 2.f*(c*d - a*b); - M[2][2] = a2 - b2 - c2 + d2; - M[2][3] = 0.f; - - M[3][0] = M[3][1] = M[3][2] = 0.f; - M[3][3] = 1.f; -} - -LINMATH_H_FUNC void mat4x4o_mul_quat(mat4x4 R, mat4x4 const M, quat const q) -{ -/* XXX: The way this is written only works for orthogonal matrices. */ -/* TODO: Take care of non-orthogonal case. */ - quat_mul_vec3(R[0], q, M[0]); - quat_mul_vec3(R[1], q, M[1]); - quat_mul_vec3(R[2], q, M[2]); - - R[3][0] = R[3][1] = R[3][2] = 0.f; - R[0][3] = M[0][3]; - R[1][3] = M[1][3]; - R[2][3] = M[2][3]; - R[3][3] = M[3][3]; // typically 1.0, but here we make it general -} -LINMATH_H_FUNC void quat_from_mat4x4(quat q, mat4x4 const M) -{ - float r=0.f; - int i; - - int perm[] = { 0, 1, 2, 0, 1 }; - int *p = perm; - - for(i = 0; i<3; i++) { - float m = M[i][i]; - if( m < r ) - continue; - m = r; - p = &perm[i]; - } - - r = sqrtf(1.f + M[p[0]][p[0]] - M[p[1]][p[1]] - M[p[2]][p[2]] ); - - if(r < 1e-6) { - q[0] = 1.f; - q[1] = q[2] = q[3] = 0.f; - return; - } - - q[0] = r/2.f; - q[1] = (M[p[0]][p[1]] - M[p[1]][p[0]])/(2.f*r); - q[2] = (M[p[2]][p[0]] - M[p[0]][p[2]])/(2.f*r); - q[3] = (M[p[2]][p[1]] - M[p[1]][p[2]])/(2.f*r); -} - -LINMATH_H_FUNC void mat4x4_arcball(mat4x4 R, mat4x4 const M, vec2 const _a, vec2 const _b, float s) -{ - vec2 a; memcpy(a, _a, sizeof(a)); - vec2 b; memcpy(b, _b, sizeof(b)); - - float z_a = 0.f; - float z_b = 0.f; - - if(vec2_len(a) < 1.f) { - z_a = sqrtf(1.f - vec2_mul_inner(a, a)); - } else { - vec2_norm(a, a); - } - - if(vec2_len(b) < 1.f) { - z_b = sqrtf(1.f - vec2_mul_inner(b, b)); - } else { - vec2_norm(b, b); - } - - vec3 a_ = {a[0], a[1], z_a}; - vec3 b_ = {b[0], b[1], z_b}; - - vec3 c_; - vec3_mul_cross(c_, a_, b_); - - float const angle = acos(vec3_mul_inner(a_, b_)) * s; - mat4x4_rotate(R, M, c_[0], c_[1], c_[2], angle); -} -#endif diff --git a/3rdparty/glfw/source/deps/mingw/_mingw_dxhelper.h b/3rdparty/glfw/source/deps/mingw/_mingw_dxhelper.h deleted file mode 100644 index 849e291..0000000 --- a/3rdparty/glfw/source/deps/mingw/_mingw_dxhelper.h +++ /dev/null @@ -1,117 +0,0 @@ -/** - * This file has no copyright assigned and is placed in the Public Domain. - * This file is part of the mingw-w64 runtime package. - * No warranty is given; refer to the file DISCLAIMER within this package. - */ - -#if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS) -#define NONAMELESSUNION 1 -#endif -#if defined(NONAMELESSSTRUCT) && \ - !defined(NONAMELESSUNION) -#define NONAMELESSUNION 1 -#endif -#if defined(NONAMELESSUNION) && \ - !defined(NONAMELESSSTRUCT) -#define NONAMELESSSTRUCT 1 -#endif -#if !defined(__GNU_EXTENSION) -#if defined(__GNUC__) || defined(__GNUG__) -#define __GNU_EXTENSION __extension__ -#else -#define __GNU_EXTENSION -#endif -#endif /* __extension__ */ - -#ifndef __ANONYMOUS_DEFINED -#define __ANONYMOUS_DEFINED -#if defined(__GNUC__) || defined(__GNUG__) -#define _ANONYMOUS_UNION __extension__ -#define _ANONYMOUS_STRUCT __extension__ -#else -#define _ANONYMOUS_UNION -#define _ANONYMOUS_STRUCT -#endif -#ifndef NONAMELESSUNION -#define _UNION_NAME(x) -#define _STRUCT_NAME(x) -#else /* NONAMELESSUNION */ -#define _UNION_NAME(x) x -#define _STRUCT_NAME(x) x -#endif -#endif /* __ANONYMOUS_DEFINED */ - -#ifndef DUMMYUNIONNAME -# ifdef NONAMELESSUNION -# define DUMMYUNIONNAME u -# define DUMMYUNIONNAME1 u1 /* Wine uses this variant */ -# define DUMMYUNIONNAME2 u2 -# define DUMMYUNIONNAME3 u3 -# define DUMMYUNIONNAME4 u4 -# define DUMMYUNIONNAME5 u5 -# define DUMMYUNIONNAME6 u6 -# define DUMMYUNIONNAME7 u7 -# define DUMMYUNIONNAME8 u8 -# define DUMMYUNIONNAME9 u9 -# else /* NONAMELESSUNION */ -# define DUMMYUNIONNAME -# define DUMMYUNIONNAME1 /* Wine uses this variant */ -# define DUMMYUNIONNAME2 -# define DUMMYUNIONNAME3 -# define DUMMYUNIONNAME4 -# define DUMMYUNIONNAME5 -# define DUMMYUNIONNAME6 -# define DUMMYUNIONNAME7 -# define DUMMYUNIONNAME8 -# define DUMMYUNIONNAME9 -# endif -#endif /* DUMMYUNIONNAME */ - -#if !defined(DUMMYUNIONNAME1) /* MinGW does not define this one */ -# ifdef NONAMELESSUNION -# define DUMMYUNIONNAME1 u1 /* Wine uses this variant */ -# else -# define DUMMYUNIONNAME1 /* Wine uses this variant */ -# endif -#endif /* DUMMYUNIONNAME1 */ - -#ifndef DUMMYSTRUCTNAME -# ifdef NONAMELESSUNION -# define DUMMYSTRUCTNAME s -# define DUMMYSTRUCTNAME1 s1 /* Wine uses this variant */ -# define DUMMYSTRUCTNAME2 s2 -# define DUMMYSTRUCTNAME3 s3 -# define DUMMYSTRUCTNAME4 s4 -# define DUMMYSTRUCTNAME5 s5 -# else -# define DUMMYSTRUCTNAME -# define DUMMYSTRUCTNAME1 /* Wine uses this variant */ -# define DUMMYSTRUCTNAME2 -# define DUMMYSTRUCTNAME3 -# define DUMMYSTRUCTNAME4 -# define DUMMYSTRUCTNAME5 -# endif -#endif /* DUMMYSTRUCTNAME */ - -/* These are for compatibility with the Wine source tree */ - -#ifndef WINELIB_NAME_AW -# ifdef __MINGW_NAME_AW -# define WINELIB_NAME_AW __MINGW_NAME_AW -# else -# ifdef UNICODE -# define WINELIB_NAME_AW(func) func##W -# else -# define WINELIB_NAME_AW(func) func##A -# endif -# endif -#endif /* WINELIB_NAME_AW */ - -#ifndef DECL_WINELIB_TYPE_AW -# ifdef __MINGW_TYPEDEF_AW -# define DECL_WINELIB_TYPE_AW __MINGW_TYPEDEF_AW -# else -# define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type; -# endif -#endif /* DECL_WINELIB_TYPE_AW */ - diff --git a/3rdparty/glfw/source/deps/mingw/dinput.h b/3rdparty/glfw/source/deps/mingw/dinput.h deleted file mode 100644 index b575480..0000000 --- a/3rdparty/glfw/source/deps/mingw/dinput.h +++ /dev/null @@ -1,2467 +0,0 @@ -/* - * Copyright (C) the Wine project - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __DINPUT_INCLUDED__ -#define __DINPUT_INCLUDED__ - -#define COM_NO_WINDOWS_H -#include -#include <_mingw_dxhelper.h> - -#ifndef DIRECTINPUT_VERSION -#define DIRECTINPUT_VERSION 0x0800 -#endif - -/* Classes */ -DEFINE_GUID(CLSID_DirectInput, 0x25E609E0,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(CLSID_DirectInputDevice, 0x25E609E1,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); - -DEFINE_GUID(CLSID_DirectInput8, 0x25E609E4,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(CLSID_DirectInputDevice8, 0x25E609E5,0xB259,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); - -/* Interfaces */ -DEFINE_GUID(IID_IDirectInputA, 0x89521360,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(IID_IDirectInputW, 0x89521361,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(IID_IDirectInput2A, 0x5944E662,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(IID_IDirectInput2W, 0x5944E663,0xAA8A,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(IID_IDirectInput7A, 0x9A4CB684,0x236D,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE); -DEFINE_GUID(IID_IDirectInput7W, 0x9A4CB685,0x236D,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE); -DEFINE_GUID(IID_IDirectInput8A, 0xBF798030,0x483A,0x4DA2,0xAA,0x99,0x5D,0x64,0xED,0x36,0x97,0x00); -DEFINE_GUID(IID_IDirectInput8W, 0xBF798031,0x483A,0x4DA2,0xAA,0x99,0x5D,0x64,0xED,0x36,0x97,0x00); -DEFINE_GUID(IID_IDirectInputDeviceA, 0x5944E680,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(IID_IDirectInputDeviceW, 0x5944E681,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(IID_IDirectInputDevice2A, 0x5944E682,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(IID_IDirectInputDevice2W, 0x5944E683,0xC92E,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(IID_IDirectInputDevice7A, 0x57D7C6BC,0x2356,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE); -DEFINE_GUID(IID_IDirectInputDevice7W, 0x57D7C6BD,0x2356,0x11D3,0x8E,0x9D,0x00,0xC0,0x4F,0x68,0x44,0xAE); -DEFINE_GUID(IID_IDirectInputDevice8A, 0x54D41080,0xDC15,0x4833,0xA4,0x1B,0x74,0x8F,0x73,0xA3,0x81,0x79); -DEFINE_GUID(IID_IDirectInputDevice8W, 0x54D41081,0xDC15,0x4833,0xA4,0x1B,0x74,0x8F,0x73,0xA3,0x81,0x79); -DEFINE_GUID(IID_IDirectInputEffect, 0xE7E1F7C0,0x88D2,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); - -/* Predefined object types */ -DEFINE_GUID(GUID_XAxis, 0xA36D02E0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(GUID_YAxis, 0xA36D02E1,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(GUID_ZAxis, 0xA36D02E2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(GUID_RxAxis,0xA36D02F4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(GUID_RyAxis,0xA36D02F5,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(GUID_RzAxis,0xA36D02E3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(GUID_Slider,0xA36D02E4,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(GUID_Button,0xA36D02F0,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(GUID_Key, 0x55728220,0xD33C,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(GUID_POV, 0xA36D02F2,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(GUID_Unknown,0xA36D02F3,0xC9F3,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); - -/* Predefined product GUIDs */ -DEFINE_GUID(GUID_SysMouse, 0x6F1D2B60,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(GUID_SysKeyboard, 0x6F1D2B61,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(GUID_Joystick, 0x6F1D2B70,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(GUID_SysMouseEm, 0x6F1D2B80,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(GUID_SysMouseEm2, 0x6F1D2B81,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(GUID_SysKeyboardEm, 0x6F1D2B82,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); -DEFINE_GUID(GUID_SysKeyboardEm2,0x6F1D2B83,0xD5A0,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00); - -/* predefined forcefeedback effects */ -DEFINE_GUID(GUID_ConstantForce, 0x13541C20,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); -DEFINE_GUID(GUID_RampForce, 0x13541C21,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); -DEFINE_GUID(GUID_Square, 0x13541C22,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); -DEFINE_GUID(GUID_Sine, 0x13541C23,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); -DEFINE_GUID(GUID_Triangle, 0x13541C24,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); -DEFINE_GUID(GUID_SawtoothUp, 0x13541C25,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); -DEFINE_GUID(GUID_SawtoothDown, 0x13541C26,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); -DEFINE_GUID(GUID_Spring, 0x13541C27,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); -DEFINE_GUID(GUID_Damper, 0x13541C28,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); -DEFINE_GUID(GUID_Inertia, 0x13541C29,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); -DEFINE_GUID(GUID_Friction, 0x13541C2A,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); -DEFINE_GUID(GUID_CustomForce, 0x13541C2B,0x8E33,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35); - -typedef struct IDirectInputA *LPDIRECTINPUTA; -typedef struct IDirectInputW *LPDIRECTINPUTW; -typedef struct IDirectInput2A *LPDIRECTINPUT2A; -typedef struct IDirectInput2W *LPDIRECTINPUT2W; -typedef struct IDirectInput7A *LPDIRECTINPUT7A; -typedef struct IDirectInput7W *LPDIRECTINPUT7W; -#if DIRECTINPUT_VERSION >= 0x0800 -typedef struct IDirectInput8A *LPDIRECTINPUT8A; -typedef struct IDirectInput8W *LPDIRECTINPUT8W; -#endif /* DI8 */ -typedef struct IDirectInputDeviceA *LPDIRECTINPUTDEVICEA; -typedef struct IDirectInputDeviceW *LPDIRECTINPUTDEVICEW; -#if DIRECTINPUT_VERSION >= 0x0500 -typedef struct IDirectInputDevice2A *LPDIRECTINPUTDEVICE2A; -typedef struct IDirectInputDevice2W *LPDIRECTINPUTDEVICE2W; -#endif /* DI5 */ -#if DIRECTINPUT_VERSION >= 0x0700 -typedef struct IDirectInputDevice7A *LPDIRECTINPUTDEVICE7A; -typedef struct IDirectInputDevice7W *LPDIRECTINPUTDEVICE7W; -#endif /* DI7 */ -#if DIRECTINPUT_VERSION >= 0x0800 -typedef struct IDirectInputDevice8A *LPDIRECTINPUTDEVICE8A; -typedef struct IDirectInputDevice8W *LPDIRECTINPUTDEVICE8W; -#endif /* DI8 */ -#if DIRECTINPUT_VERSION >= 0x0500 -typedef struct IDirectInputEffect *LPDIRECTINPUTEFFECT; -#endif /* DI5 */ -typedef struct SysKeyboardA *LPSYSKEYBOARDA; -typedef struct SysMouseA *LPSYSMOUSEA; - -#define IID_IDirectInput WINELIB_NAME_AW(IID_IDirectInput) -#define IDirectInput WINELIB_NAME_AW(IDirectInput) -DECL_WINELIB_TYPE_AW(LPDIRECTINPUT) -#define IID_IDirectInput2 WINELIB_NAME_AW(IID_IDirectInput2) -#define IDirectInput2 WINELIB_NAME_AW(IDirectInput2) -DECL_WINELIB_TYPE_AW(LPDIRECTINPUT2) -#define IID_IDirectInput7 WINELIB_NAME_AW(IID_IDirectInput7) -#define IDirectInput7 WINELIB_NAME_AW(IDirectInput7) -DECL_WINELIB_TYPE_AW(LPDIRECTINPUT7) -#if DIRECTINPUT_VERSION >= 0x0800 -#define IID_IDirectInput8 WINELIB_NAME_AW(IID_IDirectInput8) -#define IDirectInput8 WINELIB_NAME_AW(IDirectInput8) -DECL_WINELIB_TYPE_AW(LPDIRECTINPUT8) -#endif /* DI8 */ -#define IID_IDirectInputDevice WINELIB_NAME_AW(IID_IDirectInputDevice) -#define IDirectInputDevice WINELIB_NAME_AW(IDirectInputDevice) -DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE) -#if DIRECTINPUT_VERSION >= 0x0500 -#define IID_IDirectInputDevice2 WINELIB_NAME_AW(IID_IDirectInputDevice2) -#define IDirectInputDevice2 WINELIB_NAME_AW(IDirectInputDevice2) -DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE2) -#endif /* DI5 */ -#if DIRECTINPUT_VERSION >= 0x0700 -#define IID_IDirectInputDevice7 WINELIB_NAME_AW(IID_IDirectInputDevice7) -#define IDirectInputDevice7 WINELIB_NAME_AW(IDirectInputDevice7) -DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE7) -#endif /* DI7 */ -#if DIRECTINPUT_VERSION >= 0x0800 -#define IID_IDirectInputDevice8 WINELIB_NAME_AW(IID_IDirectInputDevice8) -#define IDirectInputDevice8 WINELIB_NAME_AW(IDirectInputDevice8) -DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE8) -#endif /* DI8 */ - -#define DI_OK S_OK -#define DI_NOTATTACHED S_FALSE -#define DI_BUFFEROVERFLOW S_FALSE -#define DI_PROPNOEFFECT S_FALSE -#define DI_NOEFFECT S_FALSE -#define DI_POLLEDDEVICE ((HRESULT)0x00000002L) -#define DI_DOWNLOADSKIPPED ((HRESULT)0x00000003L) -#define DI_EFFECTRESTARTED ((HRESULT)0x00000004L) -#define DI_TRUNCATED ((HRESULT)0x00000008L) -#define DI_SETTINGSNOTSAVED ((HRESULT)0x0000000BL) -#define DI_TRUNCATEDANDRESTARTED ((HRESULT)0x0000000CL) -#define DI_WRITEPROTECT ((HRESULT)0x00000013L) - -#define DIERR_OLDDIRECTINPUTVERSION \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_OLD_WIN_VERSION) -#define DIERR_BETADIRECTINPUTVERSION \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_RMODE_APP) -#define DIERR_BADDRIVERVER \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BAD_DRIVER_LEVEL) -#define DIERR_DEVICENOTREG REGDB_E_CLASSNOTREG -#define DIERR_NOTFOUND \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND) -#define DIERR_OBJECTNOTFOUND \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND) -#define DIERR_INVALIDPARAM E_INVALIDARG -#define DIERR_NOINTERFACE E_NOINTERFACE -#define DIERR_GENERIC E_FAIL -#define DIERR_OUTOFMEMORY E_OUTOFMEMORY -#define DIERR_UNSUPPORTED E_NOTIMPL -#define DIERR_NOTINITIALIZED \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_READY) -#define DIERR_ALREADYINITIALIZED \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_ALREADY_INITIALIZED) -#define DIERR_NOAGGREGATION CLASS_E_NOAGGREGATION -#define DIERR_OTHERAPPHASPRIO E_ACCESSDENIED -#define DIERR_INPUTLOST \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_READ_FAULT) -#define DIERR_ACQUIRED \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BUSY) -#define DIERR_NOTACQUIRED \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_INVALID_ACCESS) -#define DIERR_READONLY E_ACCESSDENIED -#define DIERR_HANDLEEXISTS E_ACCESSDENIED -#ifndef E_PENDING -#define E_PENDING 0x8000000AL -#endif -#define DIERR_INSUFFICIENTPRIVS 0x80040200L -#define DIERR_DEVICEFULL 0x80040201L -#define DIERR_MOREDATA 0x80040202L -#define DIERR_NOTDOWNLOADED 0x80040203L -#define DIERR_HASEFFECTS 0x80040204L -#define DIERR_NOTEXCLUSIVEACQUIRED 0x80040205L -#define DIERR_INCOMPLETEEFFECT 0x80040206L -#define DIERR_NOTBUFFERED 0x80040207L -#define DIERR_EFFECTPLAYING 0x80040208L -#define DIERR_UNPLUGGED 0x80040209L -#define DIERR_REPORTFULL 0x8004020AL -#define DIERR_MAPFILEFAIL 0x8004020BL - -#define DIENUM_STOP 0 -#define DIENUM_CONTINUE 1 - -#define DIEDFL_ALLDEVICES 0x00000000 -#define DIEDFL_ATTACHEDONLY 0x00000001 -#define DIEDFL_FORCEFEEDBACK 0x00000100 -#define DIEDFL_INCLUDEALIASES 0x00010000 -#define DIEDFL_INCLUDEPHANTOMS 0x00020000 -#define DIEDFL_INCLUDEHIDDEN 0x00040000 - -#define DIDEVTYPE_DEVICE 1 -#define DIDEVTYPE_MOUSE 2 -#define DIDEVTYPE_KEYBOARD 3 -#define DIDEVTYPE_JOYSTICK 4 -#define DIDEVTYPE_HID 0x00010000 - -#define DI8DEVCLASS_ALL 0 -#define DI8DEVCLASS_DEVICE 1 -#define DI8DEVCLASS_POINTER 2 -#define DI8DEVCLASS_KEYBOARD 3 -#define DI8DEVCLASS_GAMECTRL 4 - -#define DI8DEVTYPE_DEVICE 0x11 -#define DI8DEVTYPE_MOUSE 0x12 -#define DI8DEVTYPE_KEYBOARD 0x13 -#define DI8DEVTYPE_JOYSTICK 0x14 -#define DI8DEVTYPE_GAMEPAD 0x15 -#define DI8DEVTYPE_DRIVING 0x16 -#define DI8DEVTYPE_FLIGHT 0x17 -#define DI8DEVTYPE_1STPERSON 0x18 -#define DI8DEVTYPE_DEVICECTRL 0x19 -#define DI8DEVTYPE_SCREENPOINTER 0x1A -#define DI8DEVTYPE_REMOTE 0x1B -#define DI8DEVTYPE_SUPPLEMENTAL 0x1C - -#define DIDEVTYPEMOUSE_UNKNOWN 1 -#define DIDEVTYPEMOUSE_TRADITIONAL 2 -#define DIDEVTYPEMOUSE_FINGERSTICK 3 -#define DIDEVTYPEMOUSE_TOUCHPAD 4 -#define DIDEVTYPEMOUSE_TRACKBALL 5 - -#define DIDEVTYPEKEYBOARD_UNKNOWN 0 -#define DIDEVTYPEKEYBOARD_PCXT 1 -#define DIDEVTYPEKEYBOARD_OLIVETTI 2 -#define DIDEVTYPEKEYBOARD_PCAT 3 -#define DIDEVTYPEKEYBOARD_PCENH 4 -#define DIDEVTYPEKEYBOARD_NOKIA1050 5 -#define DIDEVTYPEKEYBOARD_NOKIA9140 6 -#define DIDEVTYPEKEYBOARD_NEC98 7 -#define DIDEVTYPEKEYBOARD_NEC98LAPTOP 8 -#define DIDEVTYPEKEYBOARD_NEC98106 9 -#define DIDEVTYPEKEYBOARD_JAPAN106 10 -#define DIDEVTYPEKEYBOARD_JAPANAX 11 -#define DIDEVTYPEKEYBOARD_J3100 12 - -#define DIDEVTYPEJOYSTICK_UNKNOWN 1 -#define DIDEVTYPEJOYSTICK_TRADITIONAL 2 -#define DIDEVTYPEJOYSTICK_FLIGHTSTICK 3 -#define DIDEVTYPEJOYSTICK_GAMEPAD 4 -#define DIDEVTYPEJOYSTICK_RUDDER 5 -#define DIDEVTYPEJOYSTICK_WHEEL 6 -#define DIDEVTYPEJOYSTICK_HEADTRACKER 7 - -#define DI8DEVTYPEMOUSE_UNKNOWN 1 -#define DI8DEVTYPEMOUSE_TRADITIONAL 2 -#define DI8DEVTYPEMOUSE_FINGERSTICK 3 -#define DI8DEVTYPEMOUSE_TOUCHPAD 4 -#define DI8DEVTYPEMOUSE_TRACKBALL 5 -#define DI8DEVTYPEMOUSE_ABSOLUTE 6 - -#define DI8DEVTYPEKEYBOARD_UNKNOWN 0 -#define DI8DEVTYPEKEYBOARD_PCXT 1 -#define DI8DEVTYPEKEYBOARD_OLIVETTI 2 -#define DI8DEVTYPEKEYBOARD_PCAT 3 -#define DI8DEVTYPEKEYBOARD_PCENH 4 -#define DI8DEVTYPEKEYBOARD_NOKIA1050 5 -#define DI8DEVTYPEKEYBOARD_NOKIA9140 6 -#define DI8DEVTYPEKEYBOARD_NEC98 7 -#define DI8DEVTYPEKEYBOARD_NEC98LAPTOP 8 -#define DI8DEVTYPEKEYBOARD_NEC98106 9 -#define DI8DEVTYPEKEYBOARD_JAPAN106 10 -#define DI8DEVTYPEKEYBOARD_JAPANAX 11 -#define DI8DEVTYPEKEYBOARD_J3100 12 - -#define DI8DEVTYPE_LIMITEDGAMESUBTYPE 1 - -#define DI8DEVTYPEJOYSTICK_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE -#define DI8DEVTYPEJOYSTICK_STANDARD 2 - -#define DI8DEVTYPEGAMEPAD_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE -#define DI8DEVTYPEGAMEPAD_STANDARD 2 -#define DI8DEVTYPEGAMEPAD_TILT 3 - -#define DI8DEVTYPEDRIVING_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE -#define DI8DEVTYPEDRIVING_COMBINEDPEDALS 2 -#define DI8DEVTYPEDRIVING_DUALPEDALS 3 -#define DI8DEVTYPEDRIVING_THREEPEDALS 4 -#define DI8DEVTYPEDRIVING_HANDHELD 5 - -#define DI8DEVTYPEFLIGHT_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE -#define DI8DEVTYPEFLIGHT_STICK 2 -#define DI8DEVTYPEFLIGHT_YOKE 3 -#define DI8DEVTYPEFLIGHT_RC 4 - -#define DI8DEVTYPE1STPERSON_LIMITED DI8DEVTYPE_LIMITEDGAMESUBTYPE -#define DI8DEVTYPE1STPERSON_UNKNOWN 2 -#define DI8DEVTYPE1STPERSON_SIXDOF 3 -#define DI8DEVTYPE1STPERSON_SHOOTER 4 - -#define DI8DEVTYPESCREENPTR_UNKNOWN 2 -#define DI8DEVTYPESCREENPTR_LIGHTGUN 3 -#define DI8DEVTYPESCREENPTR_LIGHTPEN 4 -#define DI8DEVTYPESCREENPTR_TOUCH 5 - -#define DI8DEVTYPEREMOTE_UNKNOWN 2 - -#define DI8DEVTYPEDEVICECTRL_UNKNOWN 2 -#define DI8DEVTYPEDEVICECTRL_COMMSSELECTION 3 -#define DI8DEVTYPEDEVICECTRL_COMMSSELECTION_HARDWIRED 4 - -#define DI8DEVTYPESUPPLEMENTAL_UNKNOWN 2 -#define DI8DEVTYPESUPPLEMENTAL_2NDHANDCONTROLLER 3 -#define DI8DEVTYPESUPPLEMENTAL_HEADTRACKER 4 -#define DI8DEVTYPESUPPLEMENTAL_HANDTRACKER 5 -#define DI8DEVTYPESUPPLEMENTAL_SHIFTSTICKGATE 6 -#define DI8DEVTYPESUPPLEMENTAL_SHIFTER 7 -#define DI8DEVTYPESUPPLEMENTAL_THROTTLE 8 -#define DI8DEVTYPESUPPLEMENTAL_SPLITTHROTTLE 9 -#define DI8DEVTYPESUPPLEMENTAL_COMBINEDPEDALS 10 -#define DI8DEVTYPESUPPLEMENTAL_DUALPEDALS 11 -#define DI8DEVTYPESUPPLEMENTAL_THREEPEDALS 12 -#define DI8DEVTYPESUPPLEMENTAL_RUDDERPEDALS 13 - -#define GET_DIDEVICE_TYPE(dwDevType) LOBYTE(dwDevType) -#define GET_DIDEVICE_SUBTYPE(dwDevType) HIBYTE(dwDevType) - -typedef struct DIDEVICEOBJECTINSTANCE_DX3A { - DWORD dwSize; - GUID guidType; - DWORD dwOfs; - DWORD dwType; - DWORD dwFlags; - CHAR tszName[MAX_PATH]; -} DIDEVICEOBJECTINSTANCE_DX3A, *LPDIDEVICEOBJECTINSTANCE_DX3A; -typedef const DIDEVICEOBJECTINSTANCE_DX3A *LPCDIDEVICEOBJECTINSTANCE_DX3A; -typedef struct DIDEVICEOBJECTINSTANCE_DX3W { - DWORD dwSize; - GUID guidType; - DWORD dwOfs; - DWORD dwType; - DWORD dwFlags; - WCHAR tszName[MAX_PATH]; -} DIDEVICEOBJECTINSTANCE_DX3W, *LPDIDEVICEOBJECTINSTANCE_DX3W; -typedef const DIDEVICEOBJECTINSTANCE_DX3W *LPCDIDEVICEOBJECTINSTANCE_DX3W; - -DECL_WINELIB_TYPE_AW(DIDEVICEOBJECTINSTANCE_DX3) -DECL_WINELIB_TYPE_AW(LPDIDEVICEOBJECTINSTANCE_DX3) -DECL_WINELIB_TYPE_AW(LPCDIDEVICEOBJECTINSTANCE_DX3) - -typedef struct DIDEVICEOBJECTINSTANCEA { - DWORD dwSize; - GUID guidType; - DWORD dwOfs; - DWORD dwType; - DWORD dwFlags; - CHAR tszName[MAX_PATH]; -#if(DIRECTINPUT_VERSION >= 0x0500) - DWORD dwFFMaxForce; - DWORD dwFFForceResolution; - WORD wCollectionNumber; - WORD wDesignatorIndex; - WORD wUsagePage; - WORD wUsage; - DWORD dwDimension; - WORD wExponent; - WORD wReserved; -#endif /* DIRECTINPUT_VERSION >= 0x0500 */ -} DIDEVICEOBJECTINSTANCEA, *LPDIDEVICEOBJECTINSTANCEA; -typedef const DIDEVICEOBJECTINSTANCEA *LPCDIDEVICEOBJECTINSTANCEA; - -typedef struct DIDEVICEOBJECTINSTANCEW { - DWORD dwSize; - GUID guidType; - DWORD dwOfs; - DWORD dwType; - DWORD dwFlags; - WCHAR tszName[MAX_PATH]; -#if(DIRECTINPUT_VERSION >= 0x0500) - DWORD dwFFMaxForce; - DWORD dwFFForceResolution; - WORD wCollectionNumber; - WORD wDesignatorIndex; - WORD wUsagePage; - WORD wUsage; - DWORD dwDimension; - WORD wExponent; - WORD wReserved; -#endif /* DIRECTINPUT_VERSION >= 0x0500 */ -} DIDEVICEOBJECTINSTANCEW, *LPDIDEVICEOBJECTINSTANCEW; -typedef const DIDEVICEOBJECTINSTANCEW *LPCDIDEVICEOBJECTINSTANCEW; - -DECL_WINELIB_TYPE_AW(DIDEVICEOBJECTINSTANCE) -DECL_WINELIB_TYPE_AW(LPDIDEVICEOBJECTINSTANCE) -DECL_WINELIB_TYPE_AW(LPCDIDEVICEOBJECTINSTANCE) - -typedef struct DIDEVICEINSTANCE_DX3A { - DWORD dwSize; - GUID guidInstance; - GUID guidProduct; - DWORD dwDevType; - CHAR tszInstanceName[MAX_PATH]; - CHAR tszProductName[MAX_PATH]; -} DIDEVICEINSTANCE_DX3A, *LPDIDEVICEINSTANCE_DX3A; -typedef const DIDEVICEINSTANCE_DX3A *LPCDIDEVICEINSTANCE_DX3A; -typedef struct DIDEVICEINSTANCE_DX3W { - DWORD dwSize; - GUID guidInstance; - GUID guidProduct; - DWORD dwDevType; - WCHAR tszInstanceName[MAX_PATH]; - WCHAR tszProductName[MAX_PATH]; -} DIDEVICEINSTANCE_DX3W, *LPDIDEVICEINSTANCE_DX3W; -typedef const DIDEVICEINSTANCE_DX3W *LPCDIDEVICEINSTANCE_DX3W; - -DECL_WINELIB_TYPE_AW(DIDEVICEINSTANCE_DX3) -DECL_WINELIB_TYPE_AW(LPDIDEVICEINSTANCE_DX3) -DECL_WINELIB_TYPE_AW(LPCDIDEVICEINSTANCE_DX3) - -typedef struct DIDEVICEINSTANCEA { - DWORD dwSize; - GUID guidInstance; - GUID guidProduct; - DWORD dwDevType; - CHAR tszInstanceName[MAX_PATH]; - CHAR tszProductName[MAX_PATH]; -#if(DIRECTINPUT_VERSION >= 0x0500) - GUID guidFFDriver; - WORD wUsagePage; - WORD wUsage; -#endif /* DIRECTINPUT_VERSION >= 0x0500 */ -} DIDEVICEINSTANCEA, *LPDIDEVICEINSTANCEA; -typedef const DIDEVICEINSTANCEA *LPCDIDEVICEINSTANCEA; - -typedef struct DIDEVICEINSTANCEW { - DWORD dwSize; - GUID guidInstance; - GUID guidProduct; - DWORD dwDevType; - WCHAR tszInstanceName[MAX_PATH]; - WCHAR tszProductName[MAX_PATH]; -#if(DIRECTINPUT_VERSION >= 0x0500) - GUID guidFFDriver; - WORD wUsagePage; - WORD wUsage; -#endif /* DIRECTINPUT_VERSION >= 0x0500 */ -} DIDEVICEINSTANCEW, *LPDIDEVICEINSTANCEW; -typedef const DIDEVICEINSTANCEW *LPCDIDEVICEINSTANCEW; - -DECL_WINELIB_TYPE_AW(DIDEVICEINSTANCE) -DECL_WINELIB_TYPE_AW(LPDIDEVICEINSTANCE) -DECL_WINELIB_TYPE_AW(LPCDIDEVICEINSTANCE) - -typedef BOOL (CALLBACK *LPDIENUMDEVICESCALLBACKA)(LPCDIDEVICEINSTANCEA,LPVOID); -typedef BOOL (CALLBACK *LPDIENUMDEVICESCALLBACKW)(LPCDIDEVICEINSTANCEW,LPVOID); -DECL_WINELIB_TYPE_AW(LPDIENUMDEVICESCALLBACK) - -#define DIEDBS_MAPPEDPRI1 0x00000001 -#define DIEDBS_MAPPEDPRI2 0x00000002 -#define DIEDBS_RECENTDEVICE 0x00000010 -#define DIEDBS_NEWDEVICE 0x00000020 - -#define DIEDBSFL_ATTACHEDONLY 0x00000000 -#define DIEDBSFL_THISUSER 0x00000010 -#define DIEDBSFL_FORCEFEEDBACK DIEDFL_FORCEFEEDBACK -#define DIEDBSFL_AVAILABLEDEVICES 0x00001000 -#define DIEDBSFL_MULTIMICEKEYBOARDS 0x00002000 -#define DIEDBSFL_NONGAMINGDEVICES 0x00004000 -#define DIEDBSFL_VALID 0x00007110 - -#if DIRECTINPUT_VERSION >= 0x0800 -typedef BOOL (CALLBACK *LPDIENUMDEVICESBYSEMANTICSCBA)(LPCDIDEVICEINSTANCEA,LPDIRECTINPUTDEVICE8A,DWORD,DWORD,LPVOID); -typedef BOOL (CALLBACK *LPDIENUMDEVICESBYSEMANTICSCBW)(LPCDIDEVICEINSTANCEW,LPDIRECTINPUTDEVICE8W,DWORD,DWORD,LPVOID); -DECL_WINELIB_TYPE_AW(LPDIENUMDEVICESBYSEMANTICSCB) -#endif - -typedef BOOL (CALLBACK *LPDICONFIGUREDEVICESCALLBACK)(LPUNKNOWN,LPVOID); - -typedef BOOL (CALLBACK *LPDIENUMDEVICEOBJECTSCALLBACKA)(LPCDIDEVICEOBJECTINSTANCEA,LPVOID); -typedef BOOL (CALLBACK *LPDIENUMDEVICEOBJECTSCALLBACKW)(LPCDIDEVICEOBJECTINSTANCEW,LPVOID); -DECL_WINELIB_TYPE_AW(LPDIENUMDEVICEOBJECTSCALLBACK) - -#if DIRECTINPUT_VERSION >= 0x0500 -typedef BOOL (CALLBACK *LPDIENUMCREATEDEFFECTOBJECTSCALLBACK)(LPDIRECTINPUTEFFECT, LPVOID); -#endif - -#define DIK_ESCAPE 0x01 -#define DIK_1 0x02 -#define DIK_2 0x03 -#define DIK_3 0x04 -#define DIK_4 0x05 -#define DIK_5 0x06 -#define DIK_6 0x07 -#define DIK_7 0x08 -#define DIK_8 0x09 -#define DIK_9 0x0A -#define DIK_0 0x0B -#define DIK_MINUS 0x0C /* - on main keyboard */ -#define DIK_EQUALS 0x0D -#define DIK_BACK 0x0E /* backspace */ -#define DIK_TAB 0x0F -#define DIK_Q 0x10 -#define DIK_W 0x11 -#define DIK_E 0x12 -#define DIK_R 0x13 -#define DIK_T 0x14 -#define DIK_Y 0x15 -#define DIK_U 0x16 -#define DIK_I 0x17 -#define DIK_O 0x18 -#define DIK_P 0x19 -#define DIK_LBRACKET 0x1A -#define DIK_RBRACKET 0x1B -#define DIK_RETURN 0x1C /* Enter on main keyboard */ -#define DIK_LCONTROL 0x1D -#define DIK_A 0x1E -#define DIK_S 0x1F -#define DIK_D 0x20 -#define DIK_F 0x21 -#define DIK_G 0x22 -#define DIK_H 0x23 -#define DIK_J 0x24 -#define DIK_K 0x25 -#define DIK_L 0x26 -#define DIK_SEMICOLON 0x27 -#define DIK_APOSTROPHE 0x28 -#define DIK_GRAVE 0x29 /* accent grave */ -#define DIK_LSHIFT 0x2A -#define DIK_BACKSLASH 0x2B -#define DIK_Z 0x2C -#define DIK_X 0x2D -#define DIK_C 0x2E -#define DIK_V 0x2F -#define DIK_B 0x30 -#define DIK_N 0x31 -#define DIK_M 0x32 -#define DIK_COMMA 0x33 -#define DIK_PERIOD 0x34 /* . on main keyboard */ -#define DIK_SLASH 0x35 /* / on main keyboard */ -#define DIK_RSHIFT 0x36 -#define DIK_MULTIPLY 0x37 /* * on numeric keypad */ -#define DIK_LMENU 0x38 /* left Alt */ -#define DIK_SPACE 0x39 -#define DIK_CAPITAL 0x3A -#define DIK_F1 0x3B -#define DIK_F2 0x3C -#define DIK_F3 0x3D -#define DIK_F4 0x3E -#define DIK_F5 0x3F -#define DIK_F6 0x40 -#define DIK_F7 0x41 -#define DIK_F8 0x42 -#define DIK_F9 0x43 -#define DIK_F10 0x44 -#define DIK_NUMLOCK 0x45 -#define DIK_SCROLL 0x46 /* Scroll Lock */ -#define DIK_NUMPAD7 0x47 -#define DIK_NUMPAD8 0x48 -#define DIK_NUMPAD9 0x49 -#define DIK_SUBTRACT 0x4A /* - on numeric keypad */ -#define DIK_NUMPAD4 0x4B -#define DIK_NUMPAD5 0x4C -#define DIK_NUMPAD6 0x4D -#define DIK_ADD 0x4E /* + on numeric keypad */ -#define DIK_NUMPAD1 0x4F -#define DIK_NUMPAD2 0x50 -#define DIK_NUMPAD3 0x51 -#define DIK_NUMPAD0 0x52 -#define DIK_DECIMAL 0x53 /* . on numeric keypad */ -#define DIK_OEM_102 0x56 /* < > | on UK/Germany keyboards */ -#define DIK_F11 0x57 -#define DIK_F12 0x58 -#define DIK_F13 0x64 /* (NEC PC98) */ -#define DIK_F14 0x65 /* (NEC PC98) */ -#define DIK_F15 0x66 /* (NEC PC98) */ -#define DIK_KANA 0x70 /* (Japanese keyboard) */ -#define DIK_ABNT_C1 0x73 /* / ? on Portugese (Brazilian) keyboards */ -#define DIK_CONVERT 0x79 /* (Japanese keyboard) */ -#define DIK_NOCONVERT 0x7B /* (Japanese keyboard) */ -#define DIK_YEN 0x7D /* (Japanese keyboard) */ -#define DIK_ABNT_C2 0x7E /* Numpad . on Portugese (Brazilian) keyboards */ -#define DIK_NUMPADEQUALS 0x8D /* = on numeric keypad (NEC PC98) */ -#define DIK_CIRCUMFLEX 0x90 /* (Japanese keyboard) */ -#define DIK_AT 0x91 /* (NEC PC98) */ -#define DIK_COLON 0x92 /* (NEC PC98) */ -#define DIK_UNDERLINE 0x93 /* (NEC PC98) */ -#define DIK_KANJI 0x94 /* (Japanese keyboard) */ -#define DIK_STOP 0x95 /* (NEC PC98) */ -#define DIK_AX 0x96 /* (Japan AX) */ -#define DIK_UNLABELED 0x97 /* (J3100) */ -#define DIK_NEXTTRACK 0x99 /* Next Track */ -#define DIK_NUMPADENTER 0x9C /* Enter on numeric keypad */ -#define DIK_RCONTROL 0x9D -#define DIK_MUTE 0xA0 /* Mute */ -#define DIK_CALCULATOR 0xA1 /* Calculator */ -#define DIK_PLAYPAUSE 0xA2 /* Play / Pause */ -#define DIK_MEDIASTOP 0xA4 /* Media Stop */ -#define DIK_VOLUMEDOWN 0xAE /* Volume - */ -#define DIK_VOLUMEUP 0xB0 /* Volume + */ -#define DIK_WEBHOME 0xB2 /* Web home */ -#define DIK_NUMPADCOMMA 0xB3 /* , on numeric keypad (NEC PC98) */ -#define DIK_DIVIDE 0xB5 /* / on numeric keypad */ -#define DIK_SYSRQ 0xB7 -#define DIK_RMENU 0xB8 /* right Alt */ -#define DIK_PAUSE 0xC5 /* Pause */ -#define DIK_HOME 0xC7 /* Home on arrow keypad */ -#define DIK_UP 0xC8 /* UpArrow on arrow keypad */ -#define DIK_PRIOR 0xC9 /* PgUp on arrow keypad */ -#define DIK_LEFT 0xCB /* LeftArrow on arrow keypad */ -#define DIK_RIGHT 0xCD /* RightArrow on arrow keypad */ -#define DIK_END 0xCF /* End on arrow keypad */ -#define DIK_DOWN 0xD0 /* DownArrow on arrow keypad */ -#define DIK_NEXT 0xD1 /* PgDn on arrow keypad */ -#define DIK_INSERT 0xD2 /* Insert on arrow keypad */ -#define DIK_DELETE 0xD3 /* Delete on arrow keypad */ -#define DIK_LWIN 0xDB /* Left Windows key */ -#define DIK_RWIN 0xDC /* Right Windows key */ -#define DIK_APPS 0xDD /* AppMenu key */ -#define DIK_POWER 0xDE -#define DIK_SLEEP 0xDF -#define DIK_WAKE 0xE3 /* System Wake */ -#define DIK_WEBSEARCH 0xE5 /* Web Search */ -#define DIK_WEBFAVORITES 0xE6 /* Web Favorites */ -#define DIK_WEBREFRESH 0xE7 /* Web Refresh */ -#define DIK_WEBSTOP 0xE8 /* Web Stop */ -#define DIK_WEBFORWARD 0xE9 /* Web Forward */ -#define DIK_WEBBACK 0xEA /* Web Back */ -#define DIK_MYCOMPUTER 0xEB /* My Computer */ -#define DIK_MAIL 0xEC /* Mail */ -#define DIK_MEDIASELECT 0xED /* Media Select */ - -#define DIK_BACKSPACE DIK_BACK /* backspace */ -#define DIK_NUMPADSTAR DIK_MULTIPLY /* * on numeric keypad */ -#define DIK_LALT DIK_LMENU /* left Alt */ -#define DIK_CAPSLOCK DIK_CAPITAL /* CapsLock */ -#define DIK_NUMPADMINUS DIK_SUBTRACT /* - on numeric keypad */ -#define DIK_NUMPADPLUS DIK_ADD /* + on numeric keypad */ -#define DIK_NUMPADPERIOD DIK_DECIMAL /* . on numeric keypad */ -#define DIK_NUMPADSLASH DIK_DIVIDE /* / on numeric keypad */ -#define DIK_RALT DIK_RMENU /* right Alt */ -#define DIK_UPARROW DIK_UP /* UpArrow on arrow keypad */ -#define DIK_PGUP DIK_PRIOR /* PgUp on arrow keypad */ -#define DIK_LEFTARROW DIK_LEFT /* LeftArrow on arrow keypad */ -#define DIK_RIGHTARROW DIK_RIGHT /* RightArrow on arrow keypad */ -#define DIK_DOWNARROW DIK_DOWN /* DownArrow on arrow keypad */ -#define DIK_PGDN DIK_NEXT /* PgDn on arrow keypad */ - -#define DIDFT_ALL 0x00000000 -#define DIDFT_RELAXIS 0x00000001 -#define DIDFT_ABSAXIS 0x00000002 -#define DIDFT_AXIS 0x00000003 -#define DIDFT_PSHBUTTON 0x00000004 -#define DIDFT_TGLBUTTON 0x00000008 -#define DIDFT_BUTTON 0x0000000C -#define DIDFT_POV 0x00000010 -#define DIDFT_COLLECTION 0x00000040 -#define DIDFT_NODATA 0x00000080 -#define DIDFT_ANYINSTANCE 0x00FFFF00 -#define DIDFT_INSTANCEMASK DIDFT_ANYINSTANCE -#define DIDFT_MAKEINSTANCE(n) ((WORD)(n) << 8) -#define DIDFT_GETTYPE(n) LOBYTE(n) -#define DIDFT_GETINSTANCE(n) LOWORD((n) >> 8) -#define DIDFT_FFACTUATOR 0x01000000 -#define DIDFT_FFEFFECTTRIGGER 0x02000000 -#if DIRECTINPUT_VERSION >= 0x050a -#define DIDFT_OUTPUT 0x10000000 -#define DIDFT_VENDORDEFINED 0x04000000 -#define DIDFT_ALIAS 0x08000000 -#endif /* DI5a */ -#ifndef DIDFT_OPTIONAL -#define DIDFT_OPTIONAL 0x80000000 -#endif -#define DIDFT_ENUMCOLLECTION(n) ((WORD)(n) << 8) -#define DIDFT_NOCOLLECTION 0x00FFFF00 - -#define DIDF_ABSAXIS 0x00000001 -#define DIDF_RELAXIS 0x00000002 - -#define DIGDD_PEEK 0x00000001 - -#define DISEQUENCE_COMPARE(dwSq1,cmp,dwSq2) ((int)((dwSq1) - (dwSq2)) cmp 0) - -typedef struct DIDEVICEOBJECTDATA_DX3 { - DWORD dwOfs; - DWORD dwData; - DWORD dwTimeStamp; - DWORD dwSequence; -} DIDEVICEOBJECTDATA_DX3,*LPDIDEVICEOBJECTDATA_DX3; -typedef const DIDEVICEOBJECTDATA_DX3 *LPCDIDEVICEOBJECTDATA_DX3; - -typedef struct DIDEVICEOBJECTDATA { - DWORD dwOfs; - DWORD dwData; - DWORD dwTimeStamp; - DWORD dwSequence; -#if(DIRECTINPUT_VERSION >= 0x0800) - UINT_PTR uAppData; -#endif /* DIRECTINPUT_VERSION >= 0x0800 */ -} DIDEVICEOBJECTDATA, *LPDIDEVICEOBJECTDATA; -typedef const DIDEVICEOBJECTDATA *LPCDIDEVICEOBJECTDATA; - -typedef struct _DIOBJECTDATAFORMAT { - const GUID *pguid; - DWORD dwOfs; - DWORD dwType; - DWORD dwFlags; -} DIOBJECTDATAFORMAT, *LPDIOBJECTDATAFORMAT; -typedef const DIOBJECTDATAFORMAT *LPCDIOBJECTDATAFORMAT; - -typedef struct _DIDATAFORMAT { - DWORD dwSize; - DWORD dwObjSize; - DWORD dwFlags; - DWORD dwDataSize; - DWORD dwNumObjs; - LPDIOBJECTDATAFORMAT rgodf; -} DIDATAFORMAT, *LPDIDATAFORMAT; -typedef const DIDATAFORMAT *LPCDIDATAFORMAT; - -#if DIRECTINPUT_VERSION >= 0x0500 -#define DIDOI_FFACTUATOR 0x00000001 -#define DIDOI_FFEFFECTTRIGGER 0x00000002 -#define DIDOI_POLLED 0x00008000 -#define DIDOI_ASPECTPOSITION 0x00000100 -#define DIDOI_ASPECTVELOCITY 0x00000200 -#define DIDOI_ASPECTACCEL 0x00000300 -#define DIDOI_ASPECTFORCE 0x00000400 -#define DIDOI_ASPECTMASK 0x00000F00 -#endif /* DI5 */ -#if DIRECTINPUT_VERSION >= 0x050a -#define DIDOI_GUIDISUSAGE 0x00010000 -#endif /* DI5a */ - -typedef struct DIPROPHEADER { - DWORD dwSize; - DWORD dwHeaderSize; - DWORD dwObj; - DWORD dwHow; -} DIPROPHEADER,*LPDIPROPHEADER; -typedef const DIPROPHEADER *LPCDIPROPHEADER; - -#define DIPH_DEVICE 0 -#define DIPH_BYOFFSET 1 -#define DIPH_BYID 2 -#if DIRECTINPUT_VERSION >= 0x050a -#define DIPH_BYUSAGE 3 - -#define DIMAKEUSAGEDWORD(UsagePage, Usage) (DWORD)MAKELONG(Usage, UsagePage) -#endif /* DI5a */ - -typedef struct DIPROPDWORD { - DIPROPHEADER diph; - DWORD dwData; -} DIPROPDWORD, *LPDIPROPDWORD; -typedef const DIPROPDWORD *LPCDIPROPDWORD; - -typedef struct DIPROPRANGE { - DIPROPHEADER diph; - LONG lMin; - LONG lMax; -} DIPROPRANGE, *LPDIPROPRANGE; -typedef const DIPROPRANGE *LPCDIPROPRANGE; - -#define DIPROPRANGE_NOMIN ((LONG)0x80000000) -#define DIPROPRANGE_NOMAX ((LONG)0x7FFFFFFF) - -#if DIRECTINPUT_VERSION >= 0x050a -typedef struct DIPROPCAL { - DIPROPHEADER diph; - LONG lMin; - LONG lCenter; - LONG lMax; -} DIPROPCAL, *LPDIPROPCAL; -typedef const DIPROPCAL *LPCDIPROPCAL; - -typedef struct DIPROPCALPOV { - DIPROPHEADER diph; - LONG lMin[5]; - LONG lMax[5]; -} DIPROPCALPOV, *LPDIPROPCALPOV; -typedef const DIPROPCALPOV *LPCDIPROPCALPOV; - -typedef struct DIPROPGUIDANDPATH { - DIPROPHEADER diph; - GUID guidClass; - WCHAR wszPath[MAX_PATH]; -} DIPROPGUIDANDPATH, *LPDIPROPGUIDANDPATH; -typedef const DIPROPGUIDANDPATH *LPCDIPROPGUIDANDPATH; - -typedef struct DIPROPSTRING { - DIPROPHEADER diph; - WCHAR wsz[MAX_PATH]; -} DIPROPSTRING, *LPDIPROPSTRING; -typedef const DIPROPSTRING *LPCDIPROPSTRING; -#endif /* DI5a */ - -#if DIRECTINPUT_VERSION >= 0x0800 -typedef struct DIPROPPOINTER { - DIPROPHEADER diph; - UINT_PTR uData; -} DIPROPPOINTER, *LPDIPROPPOINTER; -typedef const DIPROPPOINTER *LPCDIPROPPOINTER; -#endif /* DI8 */ - -/* special property GUIDs */ -#ifdef __cplusplus -#define MAKEDIPROP(prop) (*(const GUID *)(prop)) -#else -#define MAKEDIPROP(prop) ((REFGUID)(prop)) -#endif -#define DIPROP_BUFFERSIZE MAKEDIPROP(1) -#define DIPROP_AXISMODE MAKEDIPROP(2) - -#define DIPROPAXISMODE_ABS 0 -#define DIPROPAXISMODE_REL 1 - -#define DIPROP_GRANULARITY MAKEDIPROP(3) -#define DIPROP_RANGE MAKEDIPROP(4) -#define DIPROP_DEADZONE MAKEDIPROP(5) -#define DIPROP_SATURATION MAKEDIPROP(6) -#define DIPROP_FFGAIN MAKEDIPROP(7) -#define DIPROP_FFLOAD MAKEDIPROP(8) -#define DIPROP_AUTOCENTER MAKEDIPROP(9) - -#define DIPROPAUTOCENTER_OFF 0 -#define DIPROPAUTOCENTER_ON 1 - -#define DIPROP_CALIBRATIONMODE MAKEDIPROP(10) - -#define DIPROPCALIBRATIONMODE_COOKED 0 -#define DIPROPCALIBRATIONMODE_RAW 1 - -#if DIRECTINPUT_VERSION >= 0x050a -#define DIPROP_CALIBRATION MAKEDIPROP(11) -#define DIPROP_GUIDANDPATH MAKEDIPROP(12) -#define DIPROP_INSTANCENAME MAKEDIPROP(13) -#define DIPROP_PRODUCTNAME MAKEDIPROP(14) -#endif - -#if DIRECTINPUT_VERSION >= 0x5B2 -#define DIPROP_JOYSTICKID MAKEDIPROP(15) -#define DIPROP_GETPORTDISPLAYNAME MAKEDIPROP(16) -#endif - -#if DIRECTINPUT_VERSION >= 0x0700 -#define DIPROP_PHYSICALRANGE MAKEDIPROP(18) -#define DIPROP_LOGICALRANGE MAKEDIPROP(19) -#endif - -#if(DIRECTINPUT_VERSION >= 0x0800) -#define DIPROP_KEYNAME MAKEDIPROP(20) -#define DIPROP_CPOINTS MAKEDIPROP(21) -#define DIPROP_APPDATA MAKEDIPROP(22) -#define DIPROP_SCANCODE MAKEDIPROP(23) -#define DIPROP_VIDPID MAKEDIPROP(24) -#define DIPROP_USERNAME MAKEDIPROP(25) -#define DIPROP_TYPENAME MAKEDIPROP(26) - -#define MAXCPOINTSNUM 8 - -typedef struct _CPOINT { - LONG lP; - DWORD dwLog; -} CPOINT, *PCPOINT; - -typedef struct DIPROPCPOINTS { - DIPROPHEADER diph; - DWORD dwCPointsNum; - CPOINT cp[MAXCPOINTSNUM]; -} DIPROPCPOINTS, *LPDIPROPCPOINTS; -typedef const DIPROPCPOINTS *LPCDIPROPCPOINTS; -#endif /* DI8 */ - - -typedef struct DIDEVCAPS_DX3 { - DWORD dwSize; - DWORD dwFlags; - DWORD dwDevType; - DWORD dwAxes; - DWORD dwButtons; - DWORD dwPOVs; -} DIDEVCAPS_DX3, *LPDIDEVCAPS_DX3; - -typedef struct DIDEVCAPS { - DWORD dwSize; - DWORD dwFlags; - DWORD dwDevType; - DWORD dwAxes; - DWORD dwButtons; - DWORD dwPOVs; -#if(DIRECTINPUT_VERSION >= 0x0500) - DWORD dwFFSamplePeriod; - DWORD dwFFMinTimeResolution; - DWORD dwFirmwareRevision; - DWORD dwHardwareRevision; - DWORD dwFFDriverVersion; -#endif /* DIRECTINPUT_VERSION >= 0x0500 */ -} DIDEVCAPS,*LPDIDEVCAPS; - -#define DIDC_ATTACHED 0x00000001 -#define DIDC_POLLEDDEVICE 0x00000002 -#define DIDC_EMULATED 0x00000004 -#define DIDC_POLLEDDATAFORMAT 0x00000008 -#define DIDC_FORCEFEEDBACK 0x00000100 -#define DIDC_FFATTACK 0x00000200 -#define DIDC_FFFADE 0x00000400 -#define DIDC_SATURATION 0x00000800 -#define DIDC_POSNEGCOEFFICIENTS 0x00001000 -#define DIDC_POSNEGSATURATION 0x00002000 -#define DIDC_DEADBAND 0x00004000 -#define DIDC_STARTDELAY 0x00008000 -#define DIDC_ALIAS 0x00010000 -#define DIDC_PHANTOM 0x00020000 -#define DIDC_HIDDEN 0x00040000 - - -/* SetCooperativeLevel dwFlags */ -#define DISCL_EXCLUSIVE 0x00000001 -#define DISCL_NONEXCLUSIVE 0x00000002 -#define DISCL_FOREGROUND 0x00000004 -#define DISCL_BACKGROUND 0x00000008 -#define DISCL_NOWINKEY 0x00000010 - -#if (DIRECTINPUT_VERSION >= 0x0500) -/* Device FF flags */ -#define DISFFC_RESET 0x00000001 -#define DISFFC_STOPALL 0x00000002 -#define DISFFC_PAUSE 0x00000004 -#define DISFFC_CONTINUE 0x00000008 -#define DISFFC_SETACTUATORSON 0x00000010 -#define DISFFC_SETACTUATORSOFF 0x00000020 - -#define DIGFFS_EMPTY 0x00000001 -#define DIGFFS_STOPPED 0x00000002 -#define DIGFFS_PAUSED 0x00000004 -#define DIGFFS_ACTUATORSON 0x00000010 -#define DIGFFS_ACTUATORSOFF 0x00000020 -#define DIGFFS_POWERON 0x00000040 -#define DIGFFS_POWEROFF 0x00000080 -#define DIGFFS_SAFETYSWITCHON 0x00000100 -#define DIGFFS_SAFETYSWITCHOFF 0x00000200 -#define DIGFFS_USERFFSWITCHON 0x00000400 -#define DIGFFS_USERFFSWITCHOFF 0x00000800 -#define DIGFFS_DEVICELOST 0x80000000 - -/* Effect flags */ -#define DIEFT_ALL 0x00000000 - -#define DIEFT_CONSTANTFORCE 0x00000001 -#define DIEFT_RAMPFORCE 0x00000002 -#define DIEFT_PERIODIC 0x00000003 -#define DIEFT_CONDITION 0x00000004 -#define DIEFT_CUSTOMFORCE 0x00000005 -#define DIEFT_HARDWARE 0x000000FF -#define DIEFT_FFATTACK 0x00000200 -#define DIEFT_FFFADE 0x00000400 -#define DIEFT_SATURATION 0x00000800 -#define DIEFT_POSNEGCOEFFICIENTS 0x00001000 -#define DIEFT_POSNEGSATURATION 0x00002000 -#define DIEFT_DEADBAND 0x00004000 -#define DIEFT_STARTDELAY 0x00008000 -#define DIEFT_GETTYPE(n) LOBYTE(n) - -#define DIEFF_OBJECTIDS 0x00000001 -#define DIEFF_OBJECTOFFSETS 0x00000002 -#define DIEFF_CARTESIAN 0x00000010 -#define DIEFF_POLAR 0x00000020 -#define DIEFF_SPHERICAL 0x00000040 - -#define DIEP_DURATION 0x00000001 -#define DIEP_SAMPLEPERIOD 0x00000002 -#define DIEP_GAIN 0x00000004 -#define DIEP_TRIGGERBUTTON 0x00000008 -#define DIEP_TRIGGERREPEATINTERVAL 0x00000010 -#define DIEP_AXES 0x00000020 -#define DIEP_DIRECTION 0x00000040 -#define DIEP_ENVELOPE 0x00000080 -#define DIEP_TYPESPECIFICPARAMS 0x00000100 -#if(DIRECTINPUT_VERSION >= 0x0600) -#define DIEP_STARTDELAY 0x00000200 -#define DIEP_ALLPARAMS_DX5 0x000001FF -#define DIEP_ALLPARAMS 0x000003FF -#else -#define DIEP_ALLPARAMS 0x000001FF -#endif /* DIRECTINPUT_VERSION >= 0x0600 */ -#define DIEP_START 0x20000000 -#define DIEP_NORESTART 0x40000000 -#define DIEP_NODOWNLOAD 0x80000000 -#define DIEB_NOTRIGGER 0xFFFFFFFF - -#define DIES_SOLO 0x00000001 -#define DIES_NODOWNLOAD 0x80000000 - -#define DIEGES_PLAYING 0x00000001 -#define DIEGES_EMULATED 0x00000002 - -#define DI_DEGREES 100 -#define DI_FFNOMINALMAX 10000 -#define DI_SECONDS 1000000 - -typedef struct DICONSTANTFORCE { - LONG lMagnitude; -} DICONSTANTFORCE, *LPDICONSTANTFORCE; -typedef const DICONSTANTFORCE *LPCDICONSTANTFORCE; - -typedef struct DIRAMPFORCE { - LONG lStart; - LONG lEnd; -} DIRAMPFORCE, *LPDIRAMPFORCE; -typedef const DIRAMPFORCE *LPCDIRAMPFORCE; - -typedef struct DIPERIODIC { - DWORD dwMagnitude; - LONG lOffset; - DWORD dwPhase; - DWORD dwPeriod; -} DIPERIODIC, *LPDIPERIODIC; -typedef const DIPERIODIC *LPCDIPERIODIC; - -typedef struct DICONDITION { - LONG lOffset; - LONG lPositiveCoefficient; - LONG lNegativeCoefficient; - DWORD dwPositiveSaturation; - DWORD dwNegativeSaturation; - LONG lDeadBand; -} DICONDITION, *LPDICONDITION; -typedef const DICONDITION *LPCDICONDITION; - -typedef struct DICUSTOMFORCE { - DWORD cChannels; - DWORD dwSamplePeriod; - DWORD cSamples; - LPLONG rglForceData; -} DICUSTOMFORCE, *LPDICUSTOMFORCE; -typedef const DICUSTOMFORCE *LPCDICUSTOMFORCE; - -typedef struct DIENVELOPE { - DWORD dwSize; - DWORD dwAttackLevel; - DWORD dwAttackTime; - DWORD dwFadeLevel; - DWORD dwFadeTime; -} DIENVELOPE, *LPDIENVELOPE; -typedef const DIENVELOPE *LPCDIENVELOPE; - -typedef struct DIEFFECT_DX5 { - DWORD dwSize; - DWORD dwFlags; - DWORD dwDuration; - DWORD dwSamplePeriod; - DWORD dwGain; - DWORD dwTriggerButton; - DWORD dwTriggerRepeatInterval; - DWORD cAxes; - LPDWORD rgdwAxes; - LPLONG rglDirection; - LPDIENVELOPE lpEnvelope; - DWORD cbTypeSpecificParams; - LPVOID lpvTypeSpecificParams; -} DIEFFECT_DX5, *LPDIEFFECT_DX5; -typedef const DIEFFECT_DX5 *LPCDIEFFECT_DX5; - -typedef struct DIEFFECT { - DWORD dwSize; - DWORD dwFlags; - DWORD dwDuration; - DWORD dwSamplePeriod; - DWORD dwGain; - DWORD dwTriggerButton; - DWORD dwTriggerRepeatInterval; - DWORD cAxes; - LPDWORD rgdwAxes; - LPLONG rglDirection; - LPDIENVELOPE lpEnvelope; - DWORD cbTypeSpecificParams; - LPVOID lpvTypeSpecificParams; -#if(DIRECTINPUT_VERSION >= 0x0600) - DWORD dwStartDelay; -#endif /* DIRECTINPUT_VERSION >= 0x0600 */ -} DIEFFECT, *LPDIEFFECT; -typedef const DIEFFECT *LPCDIEFFECT; -typedef DIEFFECT DIEFFECT_DX6; -typedef LPDIEFFECT LPDIEFFECT_DX6; - -typedef struct DIEFFECTINFOA { - DWORD dwSize; - GUID guid; - DWORD dwEffType; - DWORD dwStaticParams; - DWORD dwDynamicParams; - CHAR tszName[MAX_PATH]; -} DIEFFECTINFOA, *LPDIEFFECTINFOA; -typedef const DIEFFECTINFOA *LPCDIEFFECTINFOA; - -typedef struct DIEFFECTINFOW { - DWORD dwSize; - GUID guid; - DWORD dwEffType; - DWORD dwStaticParams; - DWORD dwDynamicParams; - WCHAR tszName[MAX_PATH]; -} DIEFFECTINFOW, *LPDIEFFECTINFOW; -typedef const DIEFFECTINFOW *LPCDIEFFECTINFOW; - -DECL_WINELIB_TYPE_AW(DIEFFECTINFO) -DECL_WINELIB_TYPE_AW(LPDIEFFECTINFO) -DECL_WINELIB_TYPE_AW(LPCDIEFFECTINFO) - -typedef BOOL (CALLBACK *LPDIENUMEFFECTSCALLBACKA)(LPCDIEFFECTINFOA, LPVOID); -typedef BOOL (CALLBACK *LPDIENUMEFFECTSCALLBACKW)(LPCDIEFFECTINFOW, LPVOID); - -typedef struct DIEFFESCAPE { - DWORD dwSize; - DWORD dwCommand; - LPVOID lpvInBuffer; - DWORD cbInBuffer; - LPVOID lpvOutBuffer; - DWORD cbOutBuffer; -} DIEFFESCAPE, *LPDIEFFESCAPE; - -typedef struct DIJOYSTATE { - LONG lX; - LONG lY; - LONG lZ; - LONG lRx; - LONG lRy; - LONG lRz; - LONG rglSlider[2]; - DWORD rgdwPOV[4]; - BYTE rgbButtons[32]; -} DIJOYSTATE, *LPDIJOYSTATE; - -typedef struct DIJOYSTATE2 { - LONG lX; - LONG lY; - LONG lZ; - LONG lRx; - LONG lRy; - LONG lRz; - LONG rglSlider[2]; - DWORD rgdwPOV[4]; - BYTE rgbButtons[128]; - LONG lVX; /* 'v' as in velocity */ - LONG lVY; - LONG lVZ; - LONG lVRx; - LONG lVRy; - LONG lVRz; - LONG rglVSlider[2]; - LONG lAX; /* 'a' as in acceleration */ - LONG lAY; - LONG lAZ; - LONG lARx; - LONG lARy; - LONG lARz; - LONG rglASlider[2]; - LONG lFX; /* 'f' as in force */ - LONG lFY; - LONG lFZ; - LONG lFRx; /* 'fr' as in rotational force aka torque */ - LONG lFRy; - LONG lFRz; - LONG rglFSlider[2]; -} DIJOYSTATE2, *LPDIJOYSTATE2; - -#define DIJOFS_X FIELD_OFFSET(DIJOYSTATE, lX) -#define DIJOFS_Y FIELD_OFFSET(DIJOYSTATE, lY) -#define DIJOFS_Z FIELD_OFFSET(DIJOYSTATE, lZ) -#define DIJOFS_RX FIELD_OFFSET(DIJOYSTATE, lRx) -#define DIJOFS_RY FIELD_OFFSET(DIJOYSTATE, lRy) -#define DIJOFS_RZ FIELD_OFFSET(DIJOYSTATE, lRz) -#define DIJOFS_SLIDER(n) (FIELD_OFFSET(DIJOYSTATE, rglSlider) + \ - (n) * sizeof(LONG)) -#define DIJOFS_POV(n) (FIELD_OFFSET(DIJOYSTATE, rgdwPOV) + \ - (n) * sizeof(DWORD)) -#define DIJOFS_BUTTON(n) (FIELD_OFFSET(DIJOYSTATE, rgbButtons) + (n)) -#define DIJOFS_BUTTON0 DIJOFS_BUTTON(0) -#define DIJOFS_BUTTON1 DIJOFS_BUTTON(1) -#define DIJOFS_BUTTON2 DIJOFS_BUTTON(2) -#define DIJOFS_BUTTON3 DIJOFS_BUTTON(3) -#define DIJOFS_BUTTON4 DIJOFS_BUTTON(4) -#define DIJOFS_BUTTON5 DIJOFS_BUTTON(5) -#define DIJOFS_BUTTON6 DIJOFS_BUTTON(6) -#define DIJOFS_BUTTON7 DIJOFS_BUTTON(7) -#define DIJOFS_BUTTON8 DIJOFS_BUTTON(8) -#define DIJOFS_BUTTON9 DIJOFS_BUTTON(9) -#define DIJOFS_BUTTON10 DIJOFS_BUTTON(10) -#define DIJOFS_BUTTON11 DIJOFS_BUTTON(11) -#define DIJOFS_BUTTON12 DIJOFS_BUTTON(12) -#define DIJOFS_BUTTON13 DIJOFS_BUTTON(13) -#define DIJOFS_BUTTON14 DIJOFS_BUTTON(14) -#define DIJOFS_BUTTON15 DIJOFS_BUTTON(15) -#define DIJOFS_BUTTON16 DIJOFS_BUTTON(16) -#define DIJOFS_BUTTON17 DIJOFS_BUTTON(17) -#define DIJOFS_BUTTON18 DIJOFS_BUTTON(18) -#define DIJOFS_BUTTON19 DIJOFS_BUTTON(19) -#define DIJOFS_BUTTON20 DIJOFS_BUTTON(20) -#define DIJOFS_BUTTON21 DIJOFS_BUTTON(21) -#define DIJOFS_BUTTON22 DIJOFS_BUTTON(22) -#define DIJOFS_BUTTON23 DIJOFS_BUTTON(23) -#define DIJOFS_BUTTON24 DIJOFS_BUTTON(24) -#define DIJOFS_BUTTON25 DIJOFS_BUTTON(25) -#define DIJOFS_BUTTON26 DIJOFS_BUTTON(26) -#define DIJOFS_BUTTON27 DIJOFS_BUTTON(27) -#define DIJOFS_BUTTON28 DIJOFS_BUTTON(28) -#define DIJOFS_BUTTON29 DIJOFS_BUTTON(29) -#define DIJOFS_BUTTON30 DIJOFS_BUTTON(30) -#define DIJOFS_BUTTON31 DIJOFS_BUTTON(31) -#endif /* DIRECTINPUT_VERSION >= 0x0500 */ - -/* DInput 7 structures, types */ -#if(DIRECTINPUT_VERSION >= 0x0700) -typedef struct DIFILEEFFECT { - DWORD dwSize; - GUID GuidEffect; - LPCDIEFFECT lpDiEffect; - CHAR szFriendlyName[MAX_PATH]; -} DIFILEEFFECT, *LPDIFILEEFFECT; - -typedef const DIFILEEFFECT *LPCDIFILEEFFECT; -typedef BOOL (CALLBACK *LPDIENUMEFFECTSINFILECALLBACK)(LPCDIFILEEFFECT , LPVOID); -#endif /* DIRECTINPUT_VERSION >= 0x0700 */ - -/* DInput 8 structures and types */ -#if DIRECTINPUT_VERSION >= 0x0800 -typedef struct _DIACTIONA { - UINT_PTR uAppData; - DWORD dwSemantic; - DWORD dwFlags; - __GNU_EXTENSION union { - LPCSTR lptszActionName; - UINT uResIdString; - } DUMMYUNIONNAME; - GUID guidInstance; - DWORD dwObjID; - DWORD dwHow; -} DIACTIONA, *LPDIACTIONA; -typedef const DIACTIONA *LPCDIACTIONA; - -typedef struct _DIACTIONW { - UINT_PTR uAppData; - DWORD dwSemantic; - DWORD dwFlags; - __GNU_EXTENSION union { - LPCWSTR lptszActionName; - UINT uResIdString; - } DUMMYUNIONNAME; - GUID guidInstance; - DWORD dwObjID; - DWORD dwHow; -} DIACTIONW, *LPDIACTIONW; -typedef const DIACTIONW *LPCDIACTIONW; - -DECL_WINELIB_TYPE_AW(DIACTION) -DECL_WINELIB_TYPE_AW(LPDIACTION) -DECL_WINELIB_TYPE_AW(LPCDIACTION) - -#define DIA_FORCEFEEDBACK 0x00000001 -#define DIA_APPMAPPED 0x00000002 -#define DIA_APPNOMAP 0x00000004 -#define DIA_NORANGE 0x00000008 -#define DIA_APPFIXED 0x00000010 - -#define DIAH_UNMAPPED 0x00000000 -#define DIAH_USERCONFIG 0x00000001 -#define DIAH_APPREQUESTED 0x00000002 -#define DIAH_HWAPP 0x00000004 -#define DIAH_HWDEFAULT 0x00000008 -#define DIAH_DEFAULT 0x00000020 -#define DIAH_ERROR 0x80000000 - -typedef struct _DIACTIONFORMATA { - DWORD dwSize; - DWORD dwActionSize; - DWORD dwDataSize; - DWORD dwNumActions; - LPDIACTIONA rgoAction; - GUID guidActionMap; - DWORD dwGenre; - DWORD dwBufferSize; - LONG lAxisMin; - LONG lAxisMax; - HINSTANCE hInstString; - FILETIME ftTimeStamp; - DWORD dwCRC; - CHAR tszActionMap[MAX_PATH]; -} DIACTIONFORMATA, *LPDIACTIONFORMATA; -typedef const DIACTIONFORMATA *LPCDIACTIONFORMATA; - -typedef struct _DIACTIONFORMATW { - DWORD dwSize; - DWORD dwActionSize; - DWORD dwDataSize; - DWORD dwNumActions; - LPDIACTIONW rgoAction; - GUID guidActionMap; - DWORD dwGenre; - DWORD dwBufferSize; - LONG lAxisMin; - LONG lAxisMax; - HINSTANCE hInstString; - FILETIME ftTimeStamp; - DWORD dwCRC; - WCHAR tszActionMap[MAX_PATH]; -} DIACTIONFORMATW, *LPDIACTIONFORMATW; -typedef const DIACTIONFORMATW *LPCDIACTIONFORMATW; - -DECL_WINELIB_TYPE_AW(DIACTIONFORMAT) -DECL_WINELIB_TYPE_AW(LPDIACTIONFORMAT) -DECL_WINELIB_TYPE_AW(LPCDIACTIONFORMAT) - -#define DIAFTS_NEWDEVICELOW 0xFFFFFFFF -#define DIAFTS_NEWDEVICEHIGH 0xFFFFFFFF -#define DIAFTS_UNUSEDDEVICELOW 0x00000000 -#define DIAFTS_UNUSEDDEVICEHIGH 0x00000000 - -#define DIDBAM_DEFAULT 0x00000000 -#define DIDBAM_PRESERVE 0x00000001 -#define DIDBAM_INITIALIZE 0x00000002 -#define DIDBAM_HWDEFAULTS 0x00000004 - -#define DIDSAM_DEFAULT 0x00000000 -#define DIDSAM_NOUSER 0x00000001 -#define DIDSAM_FORCESAVE 0x00000002 - -#define DICD_DEFAULT 0x00000000 -#define DICD_EDIT 0x00000001 - -#ifndef D3DCOLOR_DEFINED -typedef DWORD D3DCOLOR; -#define D3DCOLOR_DEFINED -#endif - -typedef struct _DICOLORSET { - DWORD dwSize; - D3DCOLOR cTextFore; - D3DCOLOR cTextHighlight; - D3DCOLOR cCalloutLine; - D3DCOLOR cCalloutHighlight; - D3DCOLOR cBorder; - D3DCOLOR cControlFill; - D3DCOLOR cHighlightFill; - D3DCOLOR cAreaFill; -} DICOLORSET, *LPDICOLORSET; -typedef const DICOLORSET *LPCDICOLORSET; - -typedef struct _DICONFIGUREDEVICESPARAMSA { - DWORD dwSize; - DWORD dwcUsers; - LPSTR lptszUserNames; - DWORD dwcFormats; - LPDIACTIONFORMATA lprgFormats; - HWND hwnd; - DICOLORSET dics; - LPUNKNOWN lpUnkDDSTarget; -} DICONFIGUREDEVICESPARAMSA, *LPDICONFIGUREDEVICESPARAMSA; -typedef const DICONFIGUREDEVICESPARAMSA *LPCDICONFIGUREDEVICESPARAMSA; - -typedef struct _DICONFIGUREDEVICESPARAMSW { - DWORD dwSize; - DWORD dwcUsers; - LPWSTR lptszUserNames; - DWORD dwcFormats; - LPDIACTIONFORMATW lprgFormats; - HWND hwnd; - DICOLORSET dics; - LPUNKNOWN lpUnkDDSTarget; -} DICONFIGUREDEVICESPARAMSW, *LPDICONFIGUREDEVICESPARAMSW; -typedef const DICONFIGUREDEVICESPARAMSW *LPCDICONFIGUREDEVICESPARAMSW; - -DECL_WINELIB_TYPE_AW(DICONFIGUREDEVICESPARAMS) -DECL_WINELIB_TYPE_AW(LPDICONFIGUREDEVICESPARAMS) -DECL_WINELIB_TYPE_AW(LPCDICONFIGUREDEVICESPARAMS) - -#define DIDIFT_CONFIGURATION 0x00000001 -#define DIDIFT_OVERLAY 0x00000002 - -#define DIDAL_CENTERED 0x00000000 -#define DIDAL_LEFTALIGNED 0x00000001 -#define DIDAL_RIGHTALIGNED 0x00000002 -#define DIDAL_MIDDLE 0x00000000 -#define DIDAL_TOPALIGNED 0x00000004 -#define DIDAL_BOTTOMALIGNED 0x00000008 - -typedef struct _DIDEVICEIMAGEINFOA { - CHAR tszImagePath[MAX_PATH]; - DWORD dwFlags; - DWORD dwViewID; - RECT rcOverlay; - DWORD dwObjID; - DWORD dwcValidPts; - POINT rgptCalloutLine[5]; - RECT rcCalloutRect; - DWORD dwTextAlign; -} DIDEVICEIMAGEINFOA, *LPDIDEVICEIMAGEINFOA; -typedef const DIDEVICEIMAGEINFOA *LPCDIDEVICEIMAGEINFOA; - -typedef struct _DIDEVICEIMAGEINFOW { - WCHAR tszImagePath[MAX_PATH]; - DWORD dwFlags; - DWORD dwViewID; - RECT rcOverlay; - DWORD dwObjID; - DWORD dwcValidPts; - POINT rgptCalloutLine[5]; - RECT rcCalloutRect; - DWORD dwTextAlign; -} DIDEVICEIMAGEINFOW, *LPDIDEVICEIMAGEINFOW; -typedef const DIDEVICEIMAGEINFOW *LPCDIDEVICEIMAGEINFOW; - -DECL_WINELIB_TYPE_AW(DIDEVICEIMAGEINFO) -DECL_WINELIB_TYPE_AW(LPDIDEVICEIMAGEINFO) -DECL_WINELIB_TYPE_AW(LPCDIDEVICEIMAGEINFO) - -typedef struct _DIDEVICEIMAGEINFOHEADERA { - DWORD dwSize; - DWORD dwSizeImageInfo; - DWORD dwcViews; - DWORD dwcButtons; - DWORD dwcAxes; - DWORD dwcPOVs; - DWORD dwBufferSize; - DWORD dwBufferUsed; - LPDIDEVICEIMAGEINFOA lprgImageInfoArray; -} DIDEVICEIMAGEINFOHEADERA, *LPDIDEVICEIMAGEINFOHEADERA; -typedef const DIDEVICEIMAGEINFOHEADERA *LPCDIDEVICEIMAGEINFOHEADERA; - -typedef struct _DIDEVICEIMAGEINFOHEADERW { - DWORD dwSize; - DWORD dwSizeImageInfo; - DWORD dwcViews; - DWORD dwcButtons; - DWORD dwcAxes; - DWORD dwcPOVs; - DWORD dwBufferSize; - DWORD dwBufferUsed; - LPDIDEVICEIMAGEINFOW lprgImageInfoArray; -} DIDEVICEIMAGEINFOHEADERW, *LPDIDEVICEIMAGEINFOHEADERW; -typedef const DIDEVICEIMAGEINFOHEADERW *LPCDIDEVICEIMAGEINFOHEADERW; - -DECL_WINELIB_TYPE_AW(DIDEVICEIMAGEINFOHEADER) -DECL_WINELIB_TYPE_AW(LPDIDEVICEIMAGEINFOHEADER) -DECL_WINELIB_TYPE_AW(LPCDIDEVICEIMAGEINFOHEADER) - -#endif /* DI8 */ - - -/***************************************************************************** - * IDirectInputEffect interface - */ -#if (DIRECTINPUT_VERSION >= 0x0500) -#undef INTERFACE -#define INTERFACE IDirectInputEffect -DECLARE_INTERFACE_(IDirectInputEffect,IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** IDirectInputEffect methods ***/ - STDMETHOD(Initialize)(THIS_ HINSTANCE, DWORD, REFGUID) PURE; - STDMETHOD(GetEffectGuid)(THIS_ LPGUID) PURE; - STDMETHOD(GetParameters)(THIS_ LPDIEFFECT, DWORD) PURE; - STDMETHOD(SetParameters)(THIS_ LPCDIEFFECT, DWORD) PURE; - STDMETHOD(Start)(THIS_ DWORD, DWORD) PURE; - STDMETHOD(Stop)(THIS) PURE; - STDMETHOD(GetEffectStatus)(THIS_ LPDWORD) PURE; - STDMETHOD(Download)(THIS) PURE; - STDMETHOD(Unload)(THIS) PURE; - STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -/*** IUnknown methods ***/ -#define IDirectInputEffect_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectInputEffect_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectInputEffect_Release(p) (p)->lpVtbl->Release(p) -/*** IDirectInputEffect methods ***/ -#define IDirectInputEffect_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) -#define IDirectInputEffect_GetEffectGuid(p,a) (p)->lpVtbl->GetEffectGuid(p,a) -#define IDirectInputEffect_GetParameters(p,a,b) (p)->lpVtbl->GetParameters(p,a,b) -#define IDirectInputEffect_SetParameters(p,a,b) (p)->lpVtbl->SetParameters(p,a,b) -#define IDirectInputEffect_Start(p,a,b) (p)->lpVtbl->Start(p,a,b) -#define IDirectInputEffect_Stop(p) (p)->lpVtbl->Stop(p) -#define IDirectInputEffect_GetEffectStatus(p,a) (p)->lpVtbl->GetEffectStatus(p,a) -#define IDirectInputEffect_Download(p) (p)->lpVtbl->Download(p) -#define IDirectInputEffect_Unload(p) (p)->lpVtbl->Unload(p) -#define IDirectInputEffect_Escape(p,a) (p)->lpVtbl->Escape(p,a) -#else -/*** IUnknown methods ***/ -#define IDirectInputEffect_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectInputEffect_AddRef(p) (p)->AddRef() -#define IDirectInputEffect_Release(p) (p)->Release() -/*** IDirectInputEffect methods ***/ -#define IDirectInputEffect_Initialize(p,a,b,c) (p)->Initialize(a,b,c) -#define IDirectInputEffect_GetEffectGuid(p,a) (p)->GetEffectGuid(a) -#define IDirectInputEffect_GetParameters(p,a,b) (p)->GetParameters(a,b) -#define IDirectInputEffect_SetParameters(p,a,b) (p)->SetParameters(a,b) -#define IDirectInputEffect_Start(p,a,b) (p)->Start(a,b) -#define IDirectInputEffect_Stop(p) (p)->Stop() -#define IDirectInputEffect_GetEffectStatus(p,a) (p)->GetEffectStatus(a) -#define IDirectInputEffect_Download(p) (p)->Download() -#define IDirectInputEffect_Unload(p) (p)->Unload() -#define IDirectInputEffect_Escape(p,a) (p)->Escape(a) -#endif - -#endif /* DI5 */ - - -/***************************************************************************** - * IDirectInputDeviceA interface - */ -#undef INTERFACE -#define INTERFACE IDirectInputDeviceA -DECLARE_INTERFACE_(IDirectInputDeviceA,IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** IDirectInputDeviceA methods ***/ - STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS lpDIDevCaps) PURE; - STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback, LPVOID pvRef, DWORD dwFlags) PURE; - STDMETHOD(GetProperty)(THIS_ REFGUID rguidProp, LPDIPROPHEADER pdiph) PURE; - STDMETHOD(SetProperty)(THIS_ REFGUID rguidProp, LPCDIPROPHEADER pdiph) PURE; - STDMETHOD(Acquire)(THIS) PURE; - STDMETHOD(Unacquire)(THIS) PURE; - STDMETHOD(GetDeviceState)(THIS_ DWORD cbData, LPVOID lpvData) PURE; - STDMETHOD(GetDeviceData)(THIS_ DWORD cbObjectData, LPDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags) PURE; - STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT lpdf) PURE; - STDMETHOD(SetEventNotification)(THIS_ HANDLE hEvent) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwFlags) PURE; - STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA pdidoi, DWORD dwObj, DWORD dwHow) PURE; - STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA pdidi) PURE; - STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE; - STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion, REFGUID rguid) PURE; -}; - -/***************************************************************************** - * IDirectInputDeviceW interface - */ -#undef INTERFACE -#define INTERFACE IDirectInputDeviceW -DECLARE_INTERFACE_(IDirectInputDeviceW,IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** IDirectInputDeviceW methods ***/ - STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS lpDIDevCaps) PURE; - STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback, LPVOID pvRef, DWORD dwFlags) PURE; - STDMETHOD(GetProperty)(THIS_ REFGUID rguidProp, LPDIPROPHEADER pdiph) PURE; - STDMETHOD(SetProperty)(THIS_ REFGUID rguidProp, LPCDIPROPHEADER pdiph) PURE; - STDMETHOD(Acquire)(THIS) PURE; - STDMETHOD(Unacquire)(THIS) PURE; - STDMETHOD(GetDeviceState)(THIS_ DWORD cbData, LPVOID lpvData) PURE; - STDMETHOD(GetDeviceData)(THIS_ DWORD cbObjectData, LPDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags) PURE; - STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT lpdf) PURE; - STDMETHOD(SetEventNotification)(THIS_ HANDLE hEvent) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwFlags) PURE; - STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW pdidoi, DWORD dwObj, DWORD dwHow) PURE; - STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW pdidi) PURE; - STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE; - STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion, REFGUID rguid) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -/*** IUnknown methods ***/ -#define IDirectInputDevice_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectInputDevice_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectInputDevice_Release(p) (p)->lpVtbl->Release(p) -/*** IDirectInputDevice methods ***/ -#define IDirectInputDevice_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a) -#define IDirectInputDevice_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c) -#define IDirectInputDevice_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b) -#define IDirectInputDevice_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b) -#define IDirectInputDevice_Acquire(p) (p)->lpVtbl->Acquire(p) -#define IDirectInputDevice_Unacquire(p) (p)->lpVtbl->Unacquire(p) -#define IDirectInputDevice_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b) -#define IDirectInputDevice_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d) -#define IDirectInputDevice_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a) -#define IDirectInputDevice_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a) -#define IDirectInputDevice_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b) -#define IDirectInputDevice_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c) -#define IDirectInputDevice_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a) -#define IDirectInputDevice_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) -#define IDirectInputDevice_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) -#else -/*** IUnknown methods ***/ -#define IDirectInputDevice_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectInputDevice_AddRef(p) (p)->AddRef() -#define IDirectInputDevice_Release(p) (p)->Release() -/*** IDirectInputDevice methods ***/ -#define IDirectInputDevice_GetCapabilities(p,a) (p)->GetCapabilities(a) -#define IDirectInputDevice_EnumObjects(p,a,b,c) (p)->EnumObjects(a,b,c) -#define IDirectInputDevice_GetProperty(p,a,b) (p)->GetProperty(a,b) -#define IDirectInputDevice_SetProperty(p,a,b) (p)->SetProperty(a,b) -#define IDirectInputDevice_Acquire(p) (p)->Acquire() -#define IDirectInputDevice_Unacquire(p) (p)->Unacquire() -#define IDirectInputDevice_GetDeviceState(p,a,b) (p)->GetDeviceState(a,b) -#define IDirectInputDevice_GetDeviceData(p,a,b,c,d) (p)->GetDeviceData(a,b,c,d) -#define IDirectInputDevice_SetDataFormat(p,a) (p)->SetDataFormat(a) -#define IDirectInputDevice_SetEventNotification(p,a) (p)->SetEventNotification(a) -#define IDirectInputDevice_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b) -#define IDirectInputDevice_GetObjectInfo(p,a,b,c) (p)->GetObjectInfo(a,b,c) -#define IDirectInputDevice_GetDeviceInfo(p,a) (p)->GetDeviceInfo(a) -#define IDirectInputDevice_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) -#define IDirectInputDevice_Initialize(p,a,b,c) (p)->Initialize(a,b,c) -#endif - - -#if (DIRECTINPUT_VERSION >= 0x0500) -/***************************************************************************** - * IDirectInputDevice2A interface - */ -#undef INTERFACE -#define INTERFACE IDirectInputDevice2A -DECLARE_INTERFACE_(IDirectInputDevice2A,IDirectInputDeviceA) -{ - /*** IUnknown methods ***/ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** IDirectInputDeviceA methods ***/ - STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS lpDIDevCaps) PURE; - STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback, LPVOID pvRef, DWORD dwFlags) PURE; - STDMETHOD(GetProperty)(THIS_ REFGUID rguidProp, LPDIPROPHEADER pdiph) PURE; - STDMETHOD(SetProperty)(THIS_ REFGUID rguidProp, LPCDIPROPHEADER pdiph) PURE; - STDMETHOD(Acquire)(THIS) PURE; - STDMETHOD(Unacquire)(THIS) PURE; - STDMETHOD(GetDeviceState)(THIS_ DWORD cbData, LPVOID lpvData) PURE; - STDMETHOD(GetDeviceData)(THIS_ DWORD cbObjectData, LPDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags) PURE; - STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT lpdf) PURE; - STDMETHOD(SetEventNotification)(THIS_ HANDLE hEvent) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwFlags) PURE; - STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA pdidoi, DWORD dwObj, DWORD dwHow) PURE; - STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA pdidi) PURE; - STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE; - STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion, REFGUID rguid) PURE; - /*** IDirectInputDevice2A methods ***/ - STDMETHOD(CreateEffect)(THIS_ REFGUID rguid, LPCDIEFFECT lpeff, LPDIRECTINPUTEFFECT *ppdeff, LPUNKNOWN punkOuter) PURE; - STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKA lpCallback, LPVOID pvRef, DWORD dwEffType) PURE; - STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOA pdei, REFGUID rguid) PURE; - STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD pdwOut) PURE; - STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback, LPVOID pvRef, DWORD fl) PURE; - STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE pesc) PURE; - STDMETHOD(Poll)(THIS) PURE; - STDMETHOD(SendDeviceData)(THIS_ DWORD cbObjectData, LPCDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD fl) PURE; -}; - -/***************************************************************************** - * IDirectInputDevice2W interface - */ -#undef INTERFACE -#define INTERFACE IDirectInputDevice2W -DECLARE_INTERFACE_(IDirectInputDevice2W,IDirectInputDeviceW) -{ - /*** IUnknown methods ***/ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** IDirectInputDeviceW methods ***/ - STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS lpDIDevCaps) PURE; - STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback, LPVOID pvRef, DWORD dwFlags) PURE; - STDMETHOD(GetProperty)(THIS_ REFGUID rguidProp, LPDIPROPHEADER pdiph) PURE; - STDMETHOD(SetProperty)(THIS_ REFGUID rguidProp, LPCDIPROPHEADER pdiph) PURE; - STDMETHOD(Acquire)(THIS) PURE; - STDMETHOD(Unacquire)(THIS) PURE; - STDMETHOD(GetDeviceState)(THIS_ DWORD cbData, LPVOID lpvData) PURE; - STDMETHOD(GetDeviceData)(THIS_ DWORD cbObjectData, LPDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags) PURE; - STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT lpdf) PURE; - STDMETHOD(SetEventNotification)(THIS_ HANDLE hEvent) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwFlags) PURE; - STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW pdidoi, DWORD dwObj, DWORD dwHow) PURE; - STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW pdidi) PURE; - STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE; - STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion, REFGUID rguid) PURE; - /*** IDirectInputDevice2W methods ***/ - STDMETHOD(CreateEffect)(THIS_ REFGUID rguid, LPCDIEFFECT lpeff, LPDIRECTINPUTEFFECT *ppdeff, LPUNKNOWN punkOuter) PURE; - STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKW lpCallback, LPVOID pvRef, DWORD dwEffType) PURE; - STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOW pdei, REFGUID rguid) PURE; - STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD pdwOut) PURE; - STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback, LPVOID pvRef, DWORD fl) PURE; - STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE pesc) PURE; - STDMETHOD(Poll)(THIS) PURE; - STDMETHOD(SendDeviceData)(THIS_ DWORD cbObjectData, LPCDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD fl) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -/*** IUnknown methods ***/ -#define IDirectInputDevice2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectInputDevice2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectInputDevice2_Release(p) (p)->lpVtbl->Release(p) -/*** IDirectInputDevice methods ***/ -#define IDirectInputDevice2_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a) -#define IDirectInputDevice2_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c) -#define IDirectInputDevice2_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b) -#define IDirectInputDevice2_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b) -#define IDirectInputDevice2_Acquire(p) (p)->lpVtbl->Acquire(p) -#define IDirectInputDevice2_Unacquire(p) (p)->lpVtbl->Unacquire(p) -#define IDirectInputDevice2_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b) -#define IDirectInputDevice2_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d) -#define IDirectInputDevice2_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a) -#define IDirectInputDevice2_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a) -#define IDirectInputDevice2_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b) -#define IDirectInputDevice2_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c) -#define IDirectInputDevice2_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a) -#define IDirectInputDevice2_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) -#define IDirectInputDevice2_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) -/*** IDirectInputDevice2 methods ***/ -#define IDirectInputDevice2_CreateEffect(p,a,b,c,d) (p)->lpVtbl->CreateEffect(p,a,b,c,d) -#define IDirectInputDevice2_EnumEffects(p,a,b,c) (p)->lpVtbl->EnumEffects(p,a,b,c) -#define IDirectInputDevice2_GetEffectInfo(p,a,b) (p)->lpVtbl->GetEffectInfo(p,a,b) -#define IDirectInputDevice2_GetForceFeedbackState(p,a) (p)->lpVtbl->GetForceFeedbackState(p,a) -#define IDirectInputDevice2_SendForceFeedbackCommand(p,a) (p)->lpVtbl->SendForceFeedbackCommand(p,a) -#define IDirectInputDevice2_EnumCreatedEffectObjects(p,a,b,c) (p)->lpVtbl->EnumCreatedEffectObjects(p,a,b,c) -#define IDirectInputDevice2_Escape(p,a) (p)->lpVtbl->Escape(p,a) -#define IDirectInputDevice2_Poll(p) (p)->lpVtbl->Poll(p) -#define IDirectInputDevice2_SendDeviceData(p,a,b,c,d) (p)->lpVtbl->SendDeviceData(p,a,b,c,d) -#else -/*** IUnknown methods ***/ -#define IDirectInputDevice2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectInputDevice2_AddRef(p) (p)->AddRef() -#define IDirectInputDevice2_Release(p) (p)->Release() -/*** IDirectInputDevice methods ***/ -#define IDirectInputDevice2_GetCapabilities(p,a) (p)->GetCapabilities(a) -#define IDirectInputDevice2_EnumObjects(p,a,b,c) (p)->EnumObjects(a,b,c) -#define IDirectInputDevice2_GetProperty(p,a,b) (p)->GetProperty(a,b) -#define IDirectInputDevice2_SetProperty(p,a,b) (p)->SetProperty(a,b) -#define IDirectInputDevice2_Acquire(p) (p)->Acquire() -#define IDirectInputDevice2_Unacquire(p) (p)->Unacquire() -#define IDirectInputDevice2_GetDeviceState(p,a,b) (p)->GetDeviceState(a,b) -#define IDirectInputDevice2_GetDeviceData(p,a,b,c,d) (p)->GetDeviceData(a,b,c,d) -#define IDirectInputDevice2_SetDataFormat(p,a) (p)->SetDataFormat(a) -#define IDirectInputDevice2_SetEventNotification(p,a) (p)->SetEventNotification(a) -#define IDirectInputDevice2_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b) -#define IDirectInputDevice2_GetObjectInfo(p,a,b,c) (p)->GetObjectInfo(a,b,c) -#define IDirectInputDevice2_GetDeviceInfo(p,a) (p)->GetDeviceInfo(a) -#define IDirectInputDevice2_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) -#define IDirectInputDevice2_Initialize(p,a,b,c) (p)->Initialize(a,b,c) -/*** IDirectInputDevice2 methods ***/ -#define IDirectInputDevice2_CreateEffect(p,a,b,c,d) (p)->CreateEffect(a,b,c,d) -#define IDirectInputDevice2_EnumEffects(p,a,b,c) (p)->EnumEffects(a,b,c) -#define IDirectInputDevice2_GetEffectInfo(p,a,b) (p)->GetEffectInfo(a,b) -#define IDirectInputDevice2_GetForceFeedbackState(p,a) (p)->GetForceFeedbackState(a) -#define IDirectInputDevice2_SendForceFeedbackCommand(p,a) (p)->SendForceFeedbackCommand(a) -#define IDirectInputDevice2_EnumCreatedEffectObjects(p,a,b,c) (p)->EnumCreatedEffectObjects(a,b,c) -#define IDirectInputDevice2_Escape(p,a) (p)->Escape(a) -#define IDirectInputDevice2_Poll(p) (p)->Poll() -#define IDirectInputDevice2_SendDeviceData(p,a,b,c,d) (p)->SendDeviceData(a,b,c,d) -#endif -#endif /* DI5 */ - -#if DIRECTINPUT_VERSION >= 0x0700 -/***************************************************************************** - * IDirectInputDevice7A interface - */ -#undef INTERFACE -#define INTERFACE IDirectInputDevice7A -DECLARE_INTERFACE_(IDirectInputDevice7A,IDirectInputDevice2A) -{ - /*** IUnknown methods ***/ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** IDirectInputDeviceA methods ***/ - STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS lpDIDevCaps) PURE; - STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback, LPVOID pvRef, DWORD dwFlags) PURE; - STDMETHOD(GetProperty)(THIS_ REFGUID rguidProp, LPDIPROPHEADER pdiph) PURE; - STDMETHOD(SetProperty)(THIS_ REFGUID rguidProp, LPCDIPROPHEADER pdiph) PURE; - STDMETHOD(Acquire)(THIS) PURE; - STDMETHOD(Unacquire)(THIS) PURE; - STDMETHOD(GetDeviceState)(THIS_ DWORD cbData, LPVOID lpvData) PURE; - STDMETHOD(GetDeviceData)(THIS_ DWORD cbObjectData, LPDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags) PURE; - STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT lpdf) PURE; - STDMETHOD(SetEventNotification)(THIS_ HANDLE hEvent) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwFlags) PURE; - STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA pdidoi, DWORD dwObj, DWORD dwHow) PURE; - STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA pdidi) PURE; - STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE; - STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion, REFGUID rguid) PURE; - /*** IDirectInputDevice2A methods ***/ - STDMETHOD(CreateEffect)(THIS_ REFGUID rguid, LPCDIEFFECT lpeff, LPDIRECTINPUTEFFECT *ppdeff, LPUNKNOWN punkOuter) PURE; - STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKA lpCallback, LPVOID pvRef, DWORD dwEffType) PURE; - STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOA pdei, REFGUID rguid) PURE; - STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD pdwOut) PURE; - STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback, LPVOID pvRef, DWORD fl) PURE; - STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE pesc) PURE; - STDMETHOD(Poll)(THIS) PURE; - STDMETHOD(SendDeviceData)(THIS_ DWORD cbObjectData, LPCDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD fl) PURE; - /*** IDirectInputDevice7A methods ***/ - STDMETHOD(EnumEffectsInFile)(THIS_ LPCSTR lpszFileName,LPDIENUMEFFECTSINFILECALLBACK pec,LPVOID pvRef,DWORD dwFlags) PURE; - STDMETHOD(WriteEffectToFile)(THIS_ LPCSTR lpszFileName,DWORD dwEntries,LPDIFILEEFFECT rgDiFileEft,DWORD dwFlags) PURE; -}; - -/***************************************************************************** - * IDirectInputDevice7W interface - */ -#undef INTERFACE -#define INTERFACE IDirectInputDevice7W -DECLARE_INTERFACE_(IDirectInputDevice7W,IDirectInputDevice2W) -{ - /*** IUnknown methods ***/ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** IDirectInputDeviceW methods ***/ - STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS lpDIDevCaps) PURE; - STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback, LPVOID pvRef, DWORD dwFlags) PURE; - STDMETHOD(GetProperty)(THIS_ REFGUID rguidProp, LPDIPROPHEADER pdiph) PURE; - STDMETHOD(SetProperty)(THIS_ REFGUID rguidProp, LPCDIPROPHEADER pdiph) PURE; - STDMETHOD(Acquire)(THIS) PURE; - STDMETHOD(Unacquire)(THIS) PURE; - STDMETHOD(GetDeviceState)(THIS_ DWORD cbData, LPVOID lpvData) PURE; - STDMETHOD(GetDeviceData)(THIS_ DWORD cbObjectData, LPDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags) PURE; - STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT lpdf) PURE; - STDMETHOD(SetEventNotification)(THIS_ HANDLE hEvent) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwFlags) PURE; - STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW pdidoi, DWORD dwObj, DWORD dwHow) PURE; - STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW pdidi) PURE; - STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE; - STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion, REFGUID rguid) PURE; - /*** IDirectInputDevice2W methods ***/ - STDMETHOD(CreateEffect)(THIS_ REFGUID rguid, LPCDIEFFECT lpeff, LPDIRECTINPUTEFFECT *ppdeff, LPUNKNOWN punkOuter) PURE; - STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKW lpCallback, LPVOID pvRef, DWORD dwEffType) PURE; - STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOW pdei, REFGUID rguid) PURE; - STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD pdwOut) PURE; - STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback, LPVOID pvRef, DWORD fl) PURE; - STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE pesc) PURE; - STDMETHOD(Poll)(THIS) PURE; - STDMETHOD(SendDeviceData)(THIS_ DWORD cbObjectData, LPCDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD fl) PURE; - /*** IDirectInputDevice7W methods ***/ - STDMETHOD(EnumEffectsInFile)(THIS_ LPCWSTR lpszFileName,LPDIENUMEFFECTSINFILECALLBACK pec,LPVOID pvRef,DWORD dwFlags) PURE; - STDMETHOD(WriteEffectToFile)(THIS_ LPCWSTR lpszFileName,DWORD dwEntries,LPDIFILEEFFECT rgDiFileEft,DWORD dwFlags) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -/*** IUnknown methods ***/ -#define IDirectInputDevice7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectInputDevice7_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectInputDevice7_Release(p) (p)->lpVtbl->Release(p) -/*** IDirectInputDevice methods ***/ -#define IDirectInputDevice7_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a) -#define IDirectInputDevice7_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c) -#define IDirectInputDevice7_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b) -#define IDirectInputDevice7_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b) -#define IDirectInputDevice7_Acquire(p) (p)->lpVtbl->Acquire(p) -#define IDirectInputDevice7_Unacquire(p) (p)->lpVtbl->Unacquire(p) -#define IDirectInputDevice7_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b) -#define IDirectInputDevice7_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d) -#define IDirectInputDevice7_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a) -#define IDirectInputDevice7_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a) -#define IDirectInputDevice7_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b) -#define IDirectInputDevice7_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c) -#define IDirectInputDevice7_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a) -#define IDirectInputDevice7_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) -#define IDirectInputDevice7_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) -/*** IDirectInputDevice2 methods ***/ -#define IDirectInputDevice7_CreateEffect(p,a,b,c,d) (p)->lpVtbl->CreateEffect(p,a,b,c,d) -#define IDirectInputDevice7_EnumEffects(p,a,b,c) (p)->lpVtbl->EnumEffects(p,a,b,c) -#define IDirectInputDevice7_GetEffectInfo(p,a,b) (p)->lpVtbl->GetEffectInfo(p,a,b) -#define IDirectInputDevice7_GetForceFeedbackState(p,a) (p)->lpVtbl->GetForceFeedbackState(p,a) -#define IDirectInputDevice7_SendForceFeedbackCommand(p,a) (p)->lpVtbl->SendForceFeedbackCommand(p,a) -#define IDirectInputDevice7_EnumCreatedEffectObjects(p,a,b,c) (p)->lpVtbl->EnumCreatedEffectObjects(p,a,b,c) -#define IDirectInputDevice7_Escape(p,a) (p)->lpVtbl->Escape(p,a) -#define IDirectInputDevice7_Poll(p) (p)->lpVtbl->Poll(p) -#define IDirectInputDevice7_SendDeviceData(p,a,b,c,d) (p)->lpVtbl->SendDeviceData(p,a,b,c,d) -/*** IDirectInputDevice7 methods ***/ -#define IDirectInputDevice7_EnumEffectsInFile(p,a,b,c,d) (p)->lpVtbl->EnumEffectsInFile(p,a,b,c,d) -#define IDirectInputDevice7_WriteEffectToFile(p,a,b,c,d) (p)->lpVtbl->WriteEffectToFile(p,a,b,c,d) -#else -/*** IUnknown methods ***/ -#define IDirectInputDevice7_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectInputDevice7_AddRef(p) (p)->AddRef() -#define IDirectInputDevice7_Release(p) (p)->Release() -/*** IDirectInputDevice methods ***/ -#define IDirectInputDevice7_GetCapabilities(p,a) (p)->GetCapabilities(a) -#define IDirectInputDevice7_EnumObjects(p,a,b,c) (p)->EnumObjects(a,b,c) -#define IDirectInputDevice7_GetProperty(p,a,b) (p)->GetProperty(a,b) -#define IDirectInputDevice7_SetProperty(p,a,b) (p)->SetProperty(a,b) -#define IDirectInputDevice7_Acquire(p) (p)->Acquire() -#define IDirectInputDevice7_Unacquire(p) (p)->Unacquire() -#define IDirectInputDevice7_GetDeviceState(p,a,b) (p)->GetDeviceState(a,b) -#define IDirectInputDevice7_GetDeviceData(p,a,b,c,d) (p)->GetDeviceData(a,b,c,d) -#define IDirectInputDevice7_SetDataFormat(p,a) (p)->SetDataFormat(a) -#define IDirectInputDevice7_SetEventNotification(p,a) (p)->SetEventNotification(a) -#define IDirectInputDevice7_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b) -#define IDirectInputDevice7_GetObjectInfo(p,a,b,c) (p)->GetObjectInfo(a,b,c) -#define IDirectInputDevice7_GetDeviceInfo(p,a) (p)->GetDeviceInfo(a) -#define IDirectInputDevice7_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) -#define IDirectInputDevice7_Initialize(p,a,b,c) (p)->Initialize(a,b,c) -/*** IDirectInputDevice2 methods ***/ -#define IDirectInputDevice7_CreateEffect(p,a,b,c,d) (p)->CreateEffect(a,b,c,d) -#define IDirectInputDevice7_EnumEffects(p,a,b,c) (p)->EnumEffects(a,b,c) -#define IDirectInputDevice7_GetEffectInfo(p,a,b) (p)->GetEffectInfo(a,b) -#define IDirectInputDevice7_GetForceFeedbackState(p,a) (p)->GetForceFeedbackState(a) -#define IDirectInputDevice7_SendForceFeedbackCommand(p,a) (p)->SendForceFeedbackCommand(a) -#define IDirectInputDevice7_EnumCreatedEffectObjects(p,a,b,c) (p)->EnumCreatedEffectObjects(a,b,c) -#define IDirectInputDevice7_Escape(p,a) (p)->Escape(a) -#define IDirectInputDevice7_Poll(p) (p)->Poll() -#define IDirectInputDevice7_SendDeviceData(p,a,b,c,d) (p)->SendDeviceData(a,b,c,d) -/*** IDirectInputDevice7 methods ***/ -#define IDirectInputDevice7_EnumEffectsInFile(p,a,b,c,d) (p)->EnumEffectsInFile(a,b,c,d) -#define IDirectInputDevice7_WriteEffectToFile(p,a,b,c,d) (p)->WriteEffectToFile(a,b,c,d) -#endif - -#endif /* DI7 */ - -#if DIRECTINPUT_VERSION >= 0x0800 -/***************************************************************************** - * IDirectInputDevice8A interface - */ -#undef INTERFACE -#define INTERFACE IDirectInputDevice8A -DECLARE_INTERFACE_(IDirectInputDevice8A,IDirectInputDevice7A) -{ - /*** IUnknown methods ***/ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** IDirectInputDeviceA methods ***/ - STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS lpDIDevCaps) PURE; - STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback, LPVOID pvRef, DWORD dwFlags) PURE; - STDMETHOD(GetProperty)(THIS_ REFGUID rguidProp, LPDIPROPHEADER pdiph) PURE; - STDMETHOD(SetProperty)(THIS_ REFGUID rguidProp, LPCDIPROPHEADER pdiph) PURE; - STDMETHOD(Acquire)(THIS) PURE; - STDMETHOD(Unacquire)(THIS) PURE; - STDMETHOD(GetDeviceState)(THIS_ DWORD cbData, LPVOID lpvData) PURE; - STDMETHOD(GetDeviceData)(THIS_ DWORD cbObjectData, LPDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags) PURE; - STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT lpdf) PURE; - STDMETHOD(SetEventNotification)(THIS_ HANDLE hEvent) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwFlags) PURE; - STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEA pdidoi, DWORD dwObj, DWORD dwHow) PURE; - STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEA pdidi) PURE; - STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE; - STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion, REFGUID rguid) PURE; - /*** IDirectInputDevice2A methods ***/ - STDMETHOD(CreateEffect)(THIS_ REFGUID rguid, LPCDIEFFECT lpeff, LPDIRECTINPUTEFFECT *ppdeff, LPUNKNOWN punkOuter) PURE; - STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKA lpCallback, LPVOID pvRef, DWORD dwEffType) PURE; - STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOA pdei, REFGUID rguid) PURE; - STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD pdwOut) PURE; - STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback, LPVOID pvRef, DWORD fl) PURE; - STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE pesc) PURE; - STDMETHOD(Poll)(THIS) PURE; - STDMETHOD(SendDeviceData)(THIS_ DWORD cbObjectData, LPCDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD fl) PURE; - /*** IDirectInputDevice7A methods ***/ - STDMETHOD(EnumEffectsInFile)(THIS_ LPCSTR lpszFileName,LPDIENUMEFFECTSINFILECALLBACK pec,LPVOID pvRef,DWORD dwFlags) PURE; - STDMETHOD(WriteEffectToFile)(THIS_ LPCSTR lpszFileName,DWORD dwEntries,LPDIFILEEFFECT rgDiFileEft,DWORD dwFlags) PURE; - /*** IDirectInputDevice8A methods ***/ - STDMETHOD(BuildActionMap)(THIS_ LPDIACTIONFORMATA lpdiaf, LPCSTR lpszUserName, DWORD dwFlags) PURE; - STDMETHOD(SetActionMap)(THIS_ LPDIACTIONFORMATA lpdiaf, LPCSTR lpszUserName, DWORD dwFlags) PURE; - STDMETHOD(GetImageInfo)(THIS_ LPDIDEVICEIMAGEINFOHEADERA lpdiDevImageInfoHeader) PURE; -}; - -/***************************************************************************** - * IDirectInputDevice8W interface - */ -#undef INTERFACE -#define INTERFACE IDirectInputDevice8W -DECLARE_INTERFACE_(IDirectInputDevice8W,IDirectInputDevice7W) -{ - /*** IUnknown methods ***/ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** IDirectInputDeviceW methods ***/ - STDMETHOD(GetCapabilities)(THIS_ LPDIDEVCAPS lpDIDevCaps) PURE; - STDMETHOD(EnumObjects)(THIS_ LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback, LPVOID pvRef, DWORD dwFlags) PURE; - STDMETHOD(GetProperty)(THIS_ REFGUID rguidProp, LPDIPROPHEADER pdiph) PURE; - STDMETHOD(SetProperty)(THIS_ REFGUID rguidProp, LPCDIPROPHEADER pdiph) PURE; - STDMETHOD(Acquire)(THIS) PURE; - STDMETHOD(Unacquire)(THIS) PURE; - STDMETHOD(GetDeviceState)(THIS_ DWORD cbData, LPVOID lpvData) PURE; - STDMETHOD(GetDeviceData)(THIS_ DWORD cbObjectData, LPDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags) PURE; - STDMETHOD(SetDataFormat)(THIS_ LPCDIDATAFORMAT lpdf) PURE; - STDMETHOD(SetEventNotification)(THIS_ HANDLE hEvent) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND hwnd, DWORD dwFlags) PURE; - STDMETHOD(GetObjectInfo)(THIS_ LPDIDEVICEOBJECTINSTANCEW pdidoi, DWORD dwObj, DWORD dwHow) PURE; - STDMETHOD(GetDeviceInfo)(THIS_ LPDIDEVICEINSTANCEW pdidi) PURE; - STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE; - STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion, REFGUID rguid) PURE; - /*** IDirectInputDevice2W methods ***/ - STDMETHOD(CreateEffect)(THIS_ REFGUID rguid, LPCDIEFFECT lpeff, LPDIRECTINPUTEFFECT *ppdeff, LPUNKNOWN punkOuter) PURE; - STDMETHOD(EnumEffects)(THIS_ LPDIENUMEFFECTSCALLBACKW lpCallback, LPVOID pvRef, DWORD dwEffType) PURE; - STDMETHOD(GetEffectInfo)(THIS_ LPDIEFFECTINFOW pdei, REFGUID rguid) PURE; - STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD pdwOut) PURE; - STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD dwFlags) PURE; - STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback, LPVOID pvRef, DWORD fl) PURE; - STDMETHOD(Escape)(THIS_ LPDIEFFESCAPE pesc) PURE; - STDMETHOD(Poll)(THIS) PURE; - STDMETHOD(SendDeviceData)(THIS_ DWORD cbObjectData, LPCDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD fl) PURE; - /*** IDirectInputDevice7W methods ***/ - STDMETHOD(EnumEffectsInFile)(THIS_ LPCWSTR lpszFileName,LPDIENUMEFFECTSINFILECALLBACK pec,LPVOID pvRef,DWORD dwFlags) PURE; - STDMETHOD(WriteEffectToFile)(THIS_ LPCWSTR lpszFileName,DWORD dwEntries,LPDIFILEEFFECT rgDiFileEft,DWORD dwFlags) PURE; - /*** IDirectInputDevice8W methods ***/ - STDMETHOD(BuildActionMap)(THIS_ LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags) PURE; - STDMETHOD(SetActionMap)(THIS_ LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags) PURE; - STDMETHOD(GetImageInfo)(THIS_ LPDIDEVICEIMAGEINFOHEADERW lpdiDevImageInfoHeader) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -/*** IUnknown methods ***/ -#define IDirectInputDevice8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectInputDevice8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectInputDevice8_Release(p) (p)->lpVtbl->Release(p) -/*** IDirectInputDevice methods ***/ -#define IDirectInputDevice8_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a) -#define IDirectInputDevice8_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c) -#define IDirectInputDevice8_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b) -#define IDirectInputDevice8_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b) -#define IDirectInputDevice8_Acquire(p) (p)->lpVtbl->Acquire(p) -#define IDirectInputDevice8_Unacquire(p) (p)->lpVtbl->Unacquire(p) -#define IDirectInputDevice8_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b) -#define IDirectInputDevice8_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d) -#define IDirectInputDevice8_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a) -#define IDirectInputDevice8_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a) -#define IDirectInputDevice8_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b) -#define IDirectInputDevice8_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c) -#define IDirectInputDevice8_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a) -#define IDirectInputDevice8_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) -#define IDirectInputDevice8_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) -/*** IDirectInputDevice2 methods ***/ -#define IDirectInputDevice8_CreateEffect(p,a,b,c,d) (p)->lpVtbl->CreateEffect(p,a,b,c,d) -#define IDirectInputDevice8_EnumEffects(p,a,b,c) (p)->lpVtbl->EnumEffects(p,a,b,c) -#define IDirectInputDevice8_GetEffectInfo(p,a,b) (p)->lpVtbl->GetEffectInfo(p,a,b) -#define IDirectInputDevice8_GetForceFeedbackState(p,a) (p)->lpVtbl->GetForceFeedbackState(p,a) -#define IDirectInputDevice8_SendForceFeedbackCommand(p,a) (p)->lpVtbl->SendForceFeedbackCommand(p,a) -#define IDirectInputDevice8_EnumCreatedEffectObjects(p,a,b,c) (p)->lpVtbl->EnumCreatedEffectObjects(p,a,b,c) -#define IDirectInputDevice8_Escape(p,a) (p)->lpVtbl->Escape(p,a) -#define IDirectInputDevice8_Poll(p) (p)->lpVtbl->Poll(p) -#define IDirectInputDevice8_SendDeviceData(p,a,b,c,d) (p)->lpVtbl->SendDeviceData(p,a,b,c,d) -/*** IDirectInputDevice7 methods ***/ -#define IDirectInputDevice8_EnumEffectsInFile(p,a,b,c,d) (p)->lpVtbl->EnumEffectsInFile(p,a,b,c,d) -#define IDirectInputDevice8_WriteEffectToFile(p,a,b,c,d) (p)->lpVtbl->WriteEffectToFile(p,a,b,c,d) -/*** IDirectInputDevice8 methods ***/ -#define IDirectInputDevice8_BuildActionMap(p,a,b,c) (p)->lpVtbl->BuildActionMap(p,a,b,c) -#define IDirectInputDevice8_SetActionMap(p,a,b,c) (p)->lpVtbl->SetActionMap(p,a,b,c) -#define IDirectInputDevice8_GetImageInfo(p,a) (p)->lpVtbl->GetImageInfo(p,a) -#else -/*** IUnknown methods ***/ -#define IDirectInputDevice8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectInputDevice8_AddRef(p) (p)->AddRef() -#define IDirectInputDevice8_Release(p) (p)->Release() -/*** IDirectInputDevice methods ***/ -#define IDirectInputDevice8_GetCapabilities(p,a) (p)->GetCapabilities(a) -#define IDirectInputDevice8_EnumObjects(p,a,b,c) (p)->EnumObjects(a,b,c) -#define IDirectInputDevice8_GetProperty(p,a,b) (p)->GetProperty(a,b) -#define IDirectInputDevice8_SetProperty(p,a,b) (p)->SetProperty(a,b) -#define IDirectInputDevice8_Acquire(p) (p)->Acquire() -#define IDirectInputDevice8_Unacquire(p) (p)->Unacquire() -#define IDirectInputDevice8_GetDeviceState(p,a,b) (p)->GetDeviceState(a,b) -#define IDirectInputDevice8_GetDeviceData(p,a,b,c,d) (p)->GetDeviceData(a,b,c,d) -#define IDirectInputDevice8_SetDataFormat(p,a) (p)->SetDataFormat(a) -#define IDirectInputDevice8_SetEventNotification(p,a) (p)->SetEventNotification(a) -#define IDirectInputDevice8_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b) -#define IDirectInputDevice8_GetObjectInfo(p,a,b,c) (p)->GetObjectInfo(a,b,c) -#define IDirectInputDevice8_GetDeviceInfo(p,a) (p)->GetDeviceInfo(a) -#define IDirectInputDevice8_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) -#define IDirectInputDevice8_Initialize(p,a,b,c) (p)->Initialize(a,b,c) -/*** IDirectInputDevice2 methods ***/ -#define IDirectInputDevice8_CreateEffect(p,a,b,c,d) (p)->CreateEffect(a,b,c,d) -#define IDirectInputDevice8_EnumEffects(p,a,b,c) (p)->EnumEffects(a,b,c) -#define IDirectInputDevice8_GetEffectInfo(p,a,b) (p)->GetEffectInfo(a,b) -#define IDirectInputDevice8_GetForceFeedbackState(p,a) (p)->GetForceFeedbackState(a) -#define IDirectInputDevice8_SendForceFeedbackCommand(p,a) (p)->SendForceFeedbackCommand(a) -#define IDirectInputDevice8_EnumCreatedEffectObjects(p,a,b,c) (p)->EnumCreatedEffectObjects(a,b,c) -#define IDirectInputDevice8_Escape(p,a) (p)->Escape(a) -#define IDirectInputDevice8_Poll(p) (p)->Poll() -#define IDirectInputDevice8_SendDeviceData(p,a,b,c,d) (p)->SendDeviceData(a,b,c,d) -/*** IDirectInputDevice7 methods ***/ -#define IDirectInputDevice8_EnumEffectsInFile(p,a,b,c,d) (p)->EnumEffectsInFile(a,b,c,d) -#define IDirectInputDevice8_WriteEffectToFile(p,a,b,c,d) (p)->WriteEffectToFile(a,b,c,d) -/*** IDirectInputDevice8 methods ***/ -#define IDirectInputDevice8_BuildActionMap(p,a,b,c) (p)->BuildActionMap(a,b,c) -#define IDirectInputDevice8_SetActionMap(p,a,b,c) (p)->SetActionMap(a,b,c) -#define IDirectInputDevice8_GetImageInfo(p,a) (p)->GetImageInfo(a) -#endif - -#endif /* DI8 */ - -/* "Standard" Mouse report... */ -typedef struct DIMOUSESTATE { - LONG lX; - LONG lY; - LONG lZ; - BYTE rgbButtons[4]; -} DIMOUSESTATE; - -#if DIRECTINPUT_VERSION >= 0x0700 -/* "Standard" Mouse report for DInput 7... */ -typedef struct DIMOUSESTATE2 { - LONG lX; - LONG lY; - LONG lZ; - BYTE rgbButtons[8]; -} DIMOUSESTATE2; -#endif /* DI7 */ - -#define DIMOFS_X FIELD_OFFSET(DIMOUSESTATE, lX) -#define DIMOFS_Y FIELD_OFFSET(DIMOUSESTATE, lY) -#define DIMOFS_Z FIELD_OFFSET(DIMOUSESTATE, lZ) -#define DIMOFS_BUTTON0 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 0) -#define DIMOFS_BUTTON1 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 1) -#define DIMOFS_BUTTON2 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 2) -#define DIMOFS_BUTTON3 (FIELD_OFFSET(DIMOUSESTATE, rgbButtons) + 3) -#if DIRECTINPUT_VERSION >= 0x0700 -#define DIMOFS_BUTTON4 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 4) -#define DIMOFS_BUTTON5 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 5) -#define DIMOFS_BUTTON6 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 6) -#define DIMOFS_BUTTON7 (FIELD_OFFSET(DIMOUSESTATE2, rgbButtons) + 7) -#endif /* DI7 */ - -#ifdef __cplusplus -extern "C" { -#endif -extern const DIDATAFORMAT c_dfDIMouse; -#if DIRECTINPUT_VERSION >= 0x0700 -extern const DIDATAFORMAT c_dfDIMouse2; /* DX 7 */ -#endif /* DI7 */ -extern const DIDATAFORMAT c_dfDIKeyboard; -#if DIRECTINPUT_VERSION >= 0x0500 -extern const DIDATAFORMAT c_dfDIJoystick; -extern const DIDATAFORMAT c_dfDIJoystick2; -#endif /* DI5 */ -#ifdef __cplusplus -}; -#endif - -/***************************************************************************** - * IDirectInputA interface - */ -#undef INTERFACE -#define INTERFACE IDirectInputA -DECLARE_INTERFACE_(IDirectInputA,IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** IDirectInputA methods ***/ - STDMETHOD(CreateDevice)(THIS_ REFGUID rguid, LPDIRECTINPUTDEVICEA *lplpDirectInputDevice, LPUNKNOWN pUnkOuter) PURE; - STDMETHOD(EnumDevices)(THIS_ DWORD dwDevType, LPDIENUMDEVICESCALLBACKA lpCallback, LPVOID pvRef, DWORD dwFlags) PURE; - STDMETHOD(GetDeviceStatus)(THIS_ REFGUID rguidInstance) PURE; - STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE; - STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion) PURE; -}; - -/***************************************************************************** - * IDirectInputW interface - */ -#undef INTERFACE -#define INTERFACE IDirectInputW -DECLARE_INTERFACE_(IDirectInputW,IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** IDirectInputW methods ***/ - STDMETHOD(CreateDevice)(THIS_ REFGUID rguid, LPDIRECTINPUTDEVICEW *lplpDirectInputDevice, LPUNKNOWN pUnkOuter) PURE; - STDMETHOD(EnumDevices)(THIS_ DWORD dwDevType, LPDIENUMDEVICESCALLBACKW lpCallback, LPVOID pvRef, DWORD dwFlags) PURE; - STDMETHOD(GetDeviceStatus)(THIS_ REFGUID rguidInstance) PURE; - STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE; - STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -/*** IUnknown methods ***/ -#define IDirectInput_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectInput_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectInput_Release(p) (p)->lpVtbl->Release(p) -/*** IDirectInput methods ***/ -#define IDirectInput_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c) -#define IDirectInput_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d) -#define IDirectInput_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a) -#define IDirectInput_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) -#define IDirectInput_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#else -/*** IUnknown methods ***/ -#define IDirectInput_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectInput_AddRef(p) (p)->AddRef() -#define IDirectInput_Release(p) (p)->Release() -/*** IDirectInput methods ***/ -#define IDirectInput_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c) -#define IDirectInput_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d) -#define IDirectInput_GetDeviceStatus(p,a) (p)->GetDeviceStatus(a) -#define IDirectInput_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) -#define IDirectInput_Initialize(p,a,b) (p)->Initialize(a,b) -#endif - -/***************************************************************************** - * IDirectInput2A interface - */ -#undef INTERFACE -#define INTERFACE IDirectInput2A -DECLARE_INTERFACE_(IDirectInput2A,IDirectInputA) -{ - /*** IUnknown methods ***/ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** IDirectInputA methods ***/ - STDMETHOD(CreateDevice)(THIS_ REFGUID rguid, LPDIRECTINPUTDEVICEA *lplpDirectInputDevice, LPUNKNOWN pUnkOuter) PURE; - STDMETHOD(EnumDevices)(THIS_ DWORD dwDevType, LPDIENUMDEVICESCALLBACKA lpCallback, LPVOID pvRef, DWORD dwFlags) PURE; - STDMETHOD(GetDeviceStatus)(THIS_ REFGUID rguidInstance) PURE; - STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE; - STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion) PURE; - /*** IDirectInput2A methods ***/ - STDMETHOD(FindDevice)(THIS_ REFGUID rguid, LPCSTR pszName, LPGUID pguidInstance) PURE; -}; - -/***************************************************************************** - * IDirectInput2W interface - */ -#undef INTERFACE -#define INTERFACE IDirectInput2W -DECLARE_INTERFACE_(IDirectInput2W,IDirectInputW) -{ - /*** IUnknown methods ***/ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** IDirectInputW methods ***/ - STDMETHOD(CreateDevice)(THIS_ REFGUID rguid, LPDIRECTINPUTDEVICEW *lplpDirectInputDevice, LPUNKNOWN pUnkOuter) PURE; - STDMETHOD(EnumDevices)(THIS_ DWORD dwDevType, LPDIENUMDEVICESCALLBACKW lpCallback, LPVOID pvRef, DWORD dwFlags) PURE; - STDMETHOD(GetDeviceStatus)(THIS_ REFGUID rguidInstance) PURE; - STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE; - STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion) PURE; - /*** IDirectInput2W methods ***/ - STDMETHOD(FindDevice)(THIS_ REFGUID rguid, LPCWSTR pszName, LPGUID pguidInstance) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -/*** IUnknown methods ***/ -#define IDirectInput2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectInput2_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectInput2_Release(p) (p)->lpVtbl->Release(p) -/*** IDirectInput methods ***/ -#define IDirectInput2_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c) -#define IDirectInput2_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d) -#define IDirectInput2_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a) -#define IDirectInput2_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) -#define IDirectInput2_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -/*** IDirectInput2 methods ***/ -#define IDirectInput2_FindDevice(p,a,b,c) (p)->lpVtbl->FindDevice(p,a,b,c) -#else -/*** IUnknown methods ***/ -#define IDirectInput2_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectInput2_AddRef(p) (p)->AddRef() -#define IDirectInput2_Release(p) (p)->Release() -/*** IDirectInput methods ***/ -#define IDirectInput2_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c) -#define IDirectInput2_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d) -#define IDirectInput2_GetDeviceStatus(p,a) (p)->GetDeviceStatus(a) -#define IDirectInput2_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) -#define IDirectInput2_Initialize(p,a,b) (p)->Initialize(a,b) -/*** IDirectInput2 methods ***/ -#define IDirectInput2_FindDevice(p,a,b,c) (p)->FindDevice(a,b,c) -#endif - -/***************************************************************************** - * IDirectInput7A interface - */ -#undef INTERFACE -#define INTERFACE IDirectInput7A -DECLARE_INTERFACE_(IDirectInput7A,IDirectInput2A) -{ - /*** IUnknown methods ***/ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** IDirectInputA methods ***/ - STDMETHOD(CreateDevice)(THIS_ REFGUID rguid, LPDIRECTINPUTDEVICEA *lplpDirectInputDevice, LPUNKNOWN pUnkOuter) PURE; - STDMETHOD(EnumDevices)(THIS_ DWORD dwDevType, LPDIENUMDEVICESCALLBACKA lpCallback, LPVOID pvRef, DWORD dwFlags) PURE; - STDMETHOD(GetDeviceStatus)(THIS_ REFGUID rguidInstance) PURE; - STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE; - STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion) PURE; - /*** IDirectInput2A methods ***/ - STDMETHOD(FindDevice)(THIS_ REFGUID rguid, LPCSTR pszName, LPGUID pguidInstance) PURE; - /*** IDirectInput7A methods ***/ - STDMETHOD(CreateDeviceEx)(THIS_ REFGUID rguid, REFIID riid, LPVOID *pvOut, LPUNKNOWN lpUnknownOuter) PURE; -}; - -/***************************************************************************** - * IDirectInput7W interface - */ -#undef INTERFACE -#define INTERFACE IDirectInput7W -DECLARE_INTERFACE_(IDirectInput7W,IDirectInput2W) -{ - /*** IUnknown methods ***/ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** IDirectInputW methods ***/ - STDMETHOD(CreateDevice)(THIS_ REFGUID rguid, LPDIRECTINPUTDEVICEW *lplpDirectInputDevice, LPUNKNOWN pUnkOuter) PURE; - STDMETHOD(EnumDevices)(THIS_ DWORD dwDevType, LPDIENUMDEVICESCALLBACKW lpCallback, LPVOID pvRef, DWORD dwFlags) PURE; - STDMETHOD(GetDeviceStatus)(THIS_ REFGUID rguidInstance) PURE; - STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE; - STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion) PURE; - /*** IDirectInput2W methods ***/ - STDMETHOD(FindDevice)(THIS_ REFGUID rguid, LPCWSTR pszName, LPGUID pguidInstance) PURE; - /*** IDirectInput7W methods ***/ - STDMETHOD(CreateDeviceEx)(THIS_ REFGUID rguid, REFIID riid, LPVOID *pvOut, LPUNKNOWN lpUnknownOuter) PURE; -}; - -#if !defined(__cplusplus) || defined(CINTERFACE) -/*** IUnknown methods ***/ -#define IDirectInput7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectInput7_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectInput7_Release(p) (p)->lpVtbl->Release(p) -/*** IDirectInput methods ***/ -#define IDirectInput7_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c) -#define IDirectInput7_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d) -#define IDirectInput7_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a) -#define IDirectInput7_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) -#define IDirectInput7_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -/*** IDirectInput2 methods ***/ -#define IDirectInput7_FindDevice(p,a,b,c) (p)->lpVtbl->FindDevice(p,a,b,c) -/*** IDirectInput7 methods ***/ -#define IDirectInput7_CreateDeviceEx(p,a,b,c,d) (p)->lpVtbl->CreateDeviceEx(p,a,b,c,d) -#else -/*** IUnknown methods ***/ -#define IDirectInput7_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectInput7_AddRef(p) (p)->AddRef() -#define IDirectInput7_Release(p) (p)->Release() -/*** IDirectInput methods ***/ -#define IDirectInput7_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c) -#define IDirectInput7_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d) -#define IDirectInput7_GetDeviceStatus(p,a) (p)->GetDeviceStatus(a) -#define IDirectInput7_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) -#define IDirectInput7_Initialize(p,a,b) (p)->Initialize(a,b) -/*** IDirectInput2 methods ***/ -#define IDirectInput7_FindDevice(p,a,b,c) (p)->FindDevice(a,b,c) -/*** IDirectInput7 methods ***/ -#define IDirectInput7_CreateDeviceEx(p,a,b,c,d) (p)->CreateDeviceEx(a,b,c,d) -#endif - - -#if DIRECTINPUT_VERSION >= 0x0800 -/***************************************************************************** - * IDirectInput8A interface - */ -#undef INTERFACE -#define INTERFACE IDirectInput8A -DECLARE_INTERFACE_(IDirectInput8A,IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** IDirectInput8A methods ***/ - STDMETHOD(CreateDevice)(THIS_ REFGUID rguid, LPDIRECTINPUTDEVICE8A *lplpDirectInputDevice, LPUNKNOWN pUnkOuter) PURE; - STDMETHOD(EnumDevices)(THIS_ DWORD dwDevType, LPDIENUMDEVICESCALLBACKA lpCallback, LPVOID pvRef, DWORD dwFlags) PURE; - STDMETHOD(GetDeviceStatus)(THIS_ REFGUID rguidInstance) PURE; - STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE; - STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion) PURE; - STDMETHOD(FindDevice)(THIS_ REFGUID rguid, LPCSTR pszName, LPGUID pguidInstance) PURE; - STDMETHOD(EnumDevicesBySemantics)(THIS_ LPCSTR ptszUserName, LPDIACTIONFORMATA lpdiActionFormat, LPDIENUMDEVICESBYSEMANTICSCBA lpCallback, LPVOID pvRef, DWORD dwFlags) PURE; - STDMETHOD(ConfigureDevices)(THIS_ LPDICONFIGUREDEVICESCALLBACK lpdiCallback, LPDICONFIGUREDEVICESPARAMSA lpdiCDParams, DWORD dwFlags, LPVOID pvRefData) PURE; -}; - -/***************************************************************************** - * IDirectInput8W interface - */ -#undef INTERFACE -#define INTERFACE IDirectInput8W -DECLARE_INTERFACE_(IDirectInput8W,IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - /*** IDirectInput8W methods ***/ - STDMETHOD(CreateDevice)(THIS_ REFGUID rguid, LPDIRECTINPUTDEVICE8W *lplpDirectInputDevice, LPUNKNOWN pUnkOuter) PURE; - STDMETHOD(EnumDevices)(THIS_ DWORD dwDevType, LPDIENUMDEVICESCALLBACKW lpCallback, LPVOID pvRef, DWORD dwFlags) PURE; - STDMETHOD(GetDeviceStatus)(THIS_ REFGUID rguidInstance) PURE; - STDMETHOD(RunControlPanel)(THIS_ HWND hwndOwner, DWORD dwFlags) PURE; - STDMETHOD(Initialize)(THIS_ HINSTANCE hinst, DWORD dwVersion) PURE; - STDMETHOD(FindDevice)(THIS_ REFGUID rguid, LPCWSTR pszName, LPGUID pguidInstance) PURE; - STDMETHOD(EnumDevicesBySemantics)(THIS_ LPCWSTR ptszUserName, LPDIACTIONFORMATW lpdiActionFormat, LPDIENUMDEVICESBYSEMANTICSCBW lpCallback, LPVOID pvRef, DWORD dwFlags) PURE; - STDMETHOD(ConfigureDevices)(THIS_ LPDICONFIGUREDEVICESCALLBACK lpdiCallback, LPDICONFIGUREDEVICESPARAMSW lpdiCDParams, DWORD dwFlags, LPVOID pvRefData) PURE; -}; -#undef INTERFACE - -#if !defined(__cplusplus) || defined(CINTERFACE) -/*** IUnknown methods ***/ -#define IDirectInput8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IDirectInput8_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IDirectInput8_Release(p) (p)->lpVtbl->Release(p) -/*** IDirectInput8 methods ***/ -#define IDirectInput8_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c) -#define IDirectInput8_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d) -#define IDirectInput8_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a) -#define IDirectInput8_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) -#define IDirectInput8_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IDirectInput8_FindDevice(p,a,b,c) (p)->lpVtbl->FindDevice(p,a,b,c) -#define IDirectInput8_EnumDevicesBySemantics(p,a,b,c,d,e) (p)->lpVtbl->EnumDevicesBySemantics(p,a,b,c,d,e) -#define IDirectInput8_ConfigureDevices(p,a,b,c,d) (p)->lpVtbl->ConfigureDevices(p,a,b,c,d) -#else -/*** IUnknown methods ***/ -#define IDirectInput8_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IDirectInput8_AddRef(p) (p)->AddRef() -#define IDirectInput8_Release(p) (p)->Release() -/*** IDirectInput8 methods ***/ -#define IDirectInput8_CreateDevice(p,a,b,c) (p)->CreateDevice(a,b,c) -#define IDirectInput8_EnumDevices(p,a,b,c,d) (p)->EnumDevices(a,b,c,d) -#define IDirectInput8_GetDeviceStatus(p,a) (p)->GetDeviceStatus(a) -#define IDirectInput8_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) -#define IDirectInput8_Initialize(p,a,b) (p)->Initialize(a,b) -#define IDirectInput8_FindDevice(p,a,b,c) (p)->FindDevice(a,b,c) -#define IDirectInput8_EnumDevicesBySemantics(p,a,b,c,d,e) (p)->EnumDevicesBySemantics(a,b,c,d,e) -#define IDirectInput8_ConfigureDevices(p,a,b,c,d) (p)->ConfigureDevices(a,b,c,d) -#endif - -#endif /* DI8 */ - -/* Export functions */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if DIRECTINPUT_VERSION >= 0x0800 -HRESULT WINAPI DirectInput8Create(HINSTANCE,DWORD,REFIID,LPVOID *,LPUNKNOWN); -#else /* DI < 8 */ -HRESULT WINAPI DirectInputCreateA(HINSTANCE,DWORD,LPDIRECTINPUTA *,LPUNKNOWN); -HRESULT WINAPI DirectInputCreateW(HINSTANCE,DWORD,LPDIRECTINPUTW *,LPUNKNOWN); -#define DirectInputCreate WINELIB_NAME_AW(DirectInputCreate) - -HRESULT WINAPI DirectInputCreateEx(HINSTANCE,DWORD,REFIID,LPVOID *,LPUNKNOWN); -#endif /* DI8 */ - -#ifdef __cplusplus -}; -#endif - -#endif /* __DINPUT_INCLUDED__ */ diff --git a/3rdparty/glfw/source/deps/mingw/xinput.h b/3rdparty/glfw/source/deps/mingw/xinput.h deleted file mode 100644 index d3ca726..0000000 --- a/3rdparty/glfw/source/deps/mingw/xinput.h +++ /dev/null @@ -1,239 +0,0 @@ -/* - * The Wine project - Xinput Joystick Library - * Copyright 2008 Andrew Fenn - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_XINPUT_H -#define __WINE_XINPUT_H - -#include - -/* - * Bitmasks for the joysticks buttons, determines what has - * been pressed on the joystick, these need to be mapped - * to whatever device you're using instead of an xbox 360 - * joystick - */ - -#define XINPUT_GAMEPAD_DPAD_UP 0x0001 -#define XINPUT_GAMEPAD_DPAD_DOWN 0x0002 -#define XINPUT_GAMEPAD_DPAD_LEFT 0x0004 -#define XINPUT_GAMEPAD_DPAD_RIGHT 0x0008 -#define XINPUT_GAMEPAD_START 0x0010 -#define XINPUT_GAMEPAD_BACK 0x0020 -#define XINPUT_GAMEPAD_LEFT_THUMB 0x0040 -#define XINPUT_GAMEPAD_RIGHT_THUMB 0x0080 -#define XINPUT_GAMEPAD_LEFT_SHOULDER 0x0100 -#define XINPUT_GAMEPAD_RIGHT_SHOULDER 0x0200 -#define XINPUT_GAMEPAD_A 0x1000 -#define XINPUT_GAMEPAD_B 0x2000 -#define XINPUT_GAMEPAD_X 0x4000 -#define XINPUT_GAMEPAD_Y 0x8000 - -/* - * Defines the flags used to determine if the user is pushing - * down on a button, not holding a button, etc - */ - -#define XINPUT_KEYSTROKE_KEYDOWN 0x0001 -#define XINPUT_KEYSTROKE_KEYUP 0x0002 -#define XINPUT_KEYSTROKE_REPEAT 0x0004 - -/* - * Defines the codes which are returned by XInputGetKeystroke - */ - -#define VK_PAD_A 0x5800 -#define VK_PAD_B 0x5801 -#define VK_PAD_X 0x5802 -#define VK_PAD_Y 0x5803 -#define VK_PAD_RSHOULDER 0x5804 -#define VK_PAD_LSHOULDER 0x5805 -#define VK_PAD_LTRIGGER 0x5806 -#define VK_PAD_RTRIGGER 0x5807 -#define VK_PAD_DPAD_UP 0x5810 -#define VK_PAD_DPAD_DOWN 0x5811 -#define VK_PAD_DPAD_LEFT 0x5812 -#define VK_PAD_DPAD_RIGHT 0x5813 -#define VK_PAD_START 0x5814 -#define VK_PAD_BACK 0x5815 -#define VK_PAD_LTHUMB_PRESS 0x5816 -#define VK_PAD_RTHUMB_PRESS 0x5817 -#define VK_PAD_LTHUMB_UP 0x5820 -#define VK_PAD_LTHUMB_DOWN 0x5821 -#define VK_PAD_LTHUMB_RIGHT 0x5822 -#define VK_PAD_LTHUMB_LEFT 0x5823 -#define VK_PAD_LTHUMB_UPLEFT 0x5824 -#define VK_PAD_LTHUMB_UPRIGHT 0x5825 -#define VK_PAD_LTHUMB_DOWNRIGHT 0x5826 -#define VK_PAD_LTHUMB_DOWNLEFT 0x5827 -#define VK_PAD_RTHUMB_UP 0x5830 -#define VK_PAD_RTHUMB_DOWN 0x5831 -#define VK_PAD_RTHUMB_RIGHT 0x5832 -#define VK_PAD_RTHUMB_LEFT 0x5833 -#define VK_PAD_RTHUMB_UPLEFT 0x5834 -#define VK_PAD_RTHUMB_UPRIGHT 0x5835 -#define VK_PAD_RTHUMB_DOWNRIGHT 0x5836 -#define VK_PAD_RTHUMB_DOWNLEFT 0x5837 - -/* - * Deadzones are for analogue joystick controls on the joypad - * which determine when input should be assumed to be in the - * middle of the pad. This is a threshold to stop a joypad - * controlling the game when the player isn't touching the - * controls. - */ - -#define XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE 7849 -#define XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE 8689 -#define XINPUT_GAMEPAD_TRIGGER_THRESHOLD 30 - - -/* - * Defines what type of abilities the type of joystick has - * DEVTYPE_GAMEPAD is available for all joysticks, however - * there may be more specific identifiers for other joysticks - * which are being used. - */ - -#define XINPUT_DEVTYPE_GAMEPAD 0x01 -#define XINPUT_DEVSUBTYPE_GAMEPAD 0x01 -#define XINPUT_DEVSUBTYPE_WHEEL 0x02 -#define XINPUT_DEVSUBTYPE_ARCADE_STICK 0x03 -#define XINPUT_DEVSUBTYPE_FLIGHT_SICK 0x04 -#define XINPUT_DEVSUBTYPE_DANCE_PAD 0x05 -#define XINPUT_DEVSUBTYPE_GUITAR 0x06 -#define XINPUT_DEVSUBTYPE_DRUM_KIT 0x08 - -/* - * These are used with the XInputGetCapabilities function to - * determine the abilities to the joystick which has been - * plugged in. - */ - -#define XINPUT_CAPS_VOICE_SUPPORTED 0x0004 -#define XINPUT_FLAG_GAMEPAD 0x00000001 - -/* - * Defines the status of the battery if one is used in the - * attached joystick. The first two define if the joystick - * supports a battery. Disconnected means that the joystick - * isn't connected. Wired shows that the joystick is a wired - * joystick. - */ - -#define BATTERY_DEVTYPE_GAMEPAD 0x00 -#define BATTERY_DEVTYPE_HEADSET 0x01 -#define BATTERY_TYPE_DISCONNECTED 0x00 -#define BATTERY_TYPE_WIRED 0x01 -#define BATTERY_TYPE_ALKALINE 0x02 -#define BATTERY_TYPE_NIMH 0x03 -#define BATTERY_TYPE_UNKNOWN 0xFF -#define BATTERY_LEVEL_EMPTY 0x00 -#define BATTERY_LEVEL_LOW 0x01 -#define BATTERY_LEVEL_MEDIUM 0x02 -#define BATTERY_LEVEL_FULL 0x03 - -/* - * How many joysticks can be used with this library. Games that - * use the xinput library will not go over this number. - */ - -#define XUSER_MAX_COUNT 4 -#define XUSER_INDEX_ANY 0x000000FF - -/* - * Defines the structure of an xbox 360 joystick. - */ - -typedef struct _XINPUT_GAMEPAD { - WORD wButtons; - BYTE bLeftTrigger; - BYTE bRightTrigger; - SHORT sThumbLX; - SHORT sThumbLY; - SHORT sThumbRX; - SHORT sThumbRY; -} XINPUT_GAMEPAD, *PXINPUT_GAMEPAD; - -typedef struct _XINPUT_STATE { - DWORD dwPacketNumber; - XINPUT_GAMEPAD Gamepad; -} XINPUT_STATE, *PXINPUT_STATE; - -/* - * Defines the structure of how much vibration is set on both the - * right and left motors in a joystick. If you're not using a 360 - * joystick you will have to map these to your device. - */ - -typedef struct _XINPUT_VIBRATION { - WORD wLeftMotorSpeed; - WORD wRightMotorSpeed; -} XINPUT_VIBRATION, *PXINPUT_VIBRATION; - -/* - * Defines the structure for what kind of abilities the joystick has - * such abilities are things such as if the joystick has the ability - * to send and receive audio, if the joystick is in fact a driving - * wheel or perhaps if the joystick is some kind of dance pad or - * guitar. - */ - -typedef struct _XINPUT_CAPABILITIES { - BYTE Type; - BYTE SubType; - WORD Flags; - XINPUT_GAMEPAD Gamepad; - XINPUT_VIBRATION Vibration; -} XINPUT_CAPABILITIES, *PXINPUT_CAPABILITIES; - -/* - * Defines the structure for a joystick input event which is - * retrieved using the function XInputGetKeystroke - */ -typedef struct _XINPUT_KEYSTROKE { - WORD VirtualKey; - WCHAR Unicode; - WORD Flags; - BYTE UserIndex; - BYTE HidCode; -} XINPUT_KEYSTROKE, *PXINPUT_KEYSTROKE; - -typedef struct _XINPUT_BATTERY_INFORMATION -{ - BYTE BatteryType; - BYTE BatteryLevel; -} XINPUT_BATTERY_INFORMATION, *PXINPUT_BATTERY_INFORMATION; - -#ifdef __cplusplus -extern "C" { -#endif - -void WINAPI XInputEnable(WINBOOL); -DWORD WINAPI XInputSetState(DWORD, XINPUT_VIBRATION*); -DWORD WINAPI XInputGetState(DWORD, XINPUT_STATE*); -DWORD WINAPI XInputGetKeystroke(DWORD, DWORD, PXINPUT_KEYSTROKE); -DWORD WINAPI XInputGetCapabilities(DWORD, DWORD, XINPUT_CAPABILITIES*); -DWORD WINAPI XInputGetDSoundAudioDeviceGuids(DWORD, GUID*, GUID*); -DWORD WINAPI XInputGetBatteryInformation(DWORD, BYTE, XINPUT_BATTERY_INFORMATION*); - -#ifdef __cplusplus -} -#endif - -#endif /* __WINE_XINPUT_H */ diff --git a/3rdparty/glfw/source/deps/nuklear.h b/3rdparty/glfw/source/deps/nuklear.h deleted file mode 100644 index f2eb9df..0000000 --- a/3rdparty/glfw/source/deps/nuklear.h +++ /dev/null @@ -1,25778 +0,0 @@ -/* -/// # Nuklear -/// ![](https://cloud.githubusercontent.com/assets/8057201/11761525/ae06f0ca-a0c6-11e5-819d-5610b25f6ef4.gif) -/// -/// ## Contents -/// 1. About section -/// 2. Highlights section -/// 3. Features section -/// 4. Usage section -/// 1. Flags section -/// 2. Constants section -/// 3. Dependencies section -/// 5. Example section -/// 6. API section -/// 1. Context section -/// 2. Input section -/// 3. Drawing section -/// 4. Window section -/// 5. Layouting section -/// 6. Groups section -/// 7. Tree section -/// 8. Properties section -/// 7. License section -/// 8. Changelog section -/// 9. Gallery section -/// 10. Credits section -/// -/// ## About -/// This is a minimal state immediate mode graphical user interface toolkit -/// written in ANSI C and licensed under public domain. It was designed as a simple -/// embeddable user interface for application and does not have any dependencies, -/// a default renderbackend or OS window and input handling but instead provides a very modular -/// library approach by using simple input state for input and draw -/// commands describing primitive shapes as output. So instead of providing a -/// layered library that tries to abstract over a number of platform and -/// render backends it only focuses on the actual UI. -/// -/// ## Highlights -/// - Graphical user interface toolkit -/// - Single header library -/// - Written in C89 (a.k.a. ANSI C or ISO C90) -/// - Small codebase (~18kLOC) -/// - Focus on portability, efficiency and simplicity -/// - No dependencies (not even the standard library if not wanted) -/// - Fully skinnable and customizable -/// - Low memory footprint with total memory control if needed or wanted -/// - UTF-8 support -/// - No global or hidden state -/// - Customizable library modules (you can compile and use only what you need) -/// - Optional font baker and vertex buffer output -/// -/// ## Features -/// - Absolutely no platform dependent code -/// - Memory management control ranging from/to -/// - Ease of use by allocating everything from standard library -/// - Control every byte of memory inside the library -/// - Font handling control ranging from/to -/// - Use your own font implementation for everything -/// - Use this libraries internal font baking and handling API -/// - Drawing output control ranging from/to -/// - Simple shapes for more high level APIs which already have drawing capabilities -/// - Hardware accessible anti-aliased vertex buffer output -/// - Customizable colors and properties ranging from/to -/// - Simple changes to color by filling a simple color table -/// - Complete control with ability to use skinning to decorate widgets -/// - Bendable UI library with widget ranging from/to -/// - Basic widgets like buttons, checkboxes, slider, ... -/// - Advanced widget like abstract comboboxes, contextual menus,... -/// - Compile time configuration to only compile what you need -/// - Subset which can be used if you do not want to link or use the standard library -/// - Can be easily modified to only update on user input instead of frame updates -/// -/// ## Usage -/// This library is self contained in one single header file and can be used either -/// in header only mode or in implementation mode. The header only mode is used -/// by default when included and allows including this header in other headers -/// and does not contain the actual implementation.

-/// -/// The implementation mode requires to define the preprocessor macro -/// NK_IMPLEMENTATION in *one* .c/.cpp file before #includeing this file, e.g.: -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~C -/// #define NK_IMPLEMENTATION -/// #include "nuklear.h" -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Also optionally define the symbols listed in the section "OPTIONAL DEFINES" -/// below in header and implementation mode if you want to use additional functionality -/// or need more control over the library. -/// -/// !!! WARNING -/// Every time nuklear is included define the same compiler flags. This very important not doing so could lead to compiler errors or even worse stack corruptions. -/// -/// ### Flags -/// Flag | Description -/// --------------------------------|------------------------------------------ -/// NK_PRIVATE | If defined declares all functions as static, so they can only be accessed inside the file that contains the implementation -/// NK_INCLUDE_FIXED_TYPES | If defined it will include header `` for fixed sized types otherwise nuklear tries to select the correct type. If that fails it will throw a compiler error and you have to select the correct types yourself. -/// NK_INCLUDE_DEFAULT_ALLOCATOR | If defined it will include header `` and provide additional functions to use this library without caring for memory allocation control and therefore ease memory management. -/// NK_INCLUDE_STANDARD_IO | If defined it will include header `` and provide additional functions depending on file loading. -/// NK_INCLUDE_STANDARD_VARARGS | If defined it will include header and provide additional functions depending on file loading. -/// NK_INCLUDE_VERTEX_BUFFER_OUTPUT | Defining this adds a vertex draw command list backend to this library, which allows you to convert queue commands into vertex draw commands. This is mainly if you need a hardware accessible format for OpenGL, DirectX, Vulkan, Metal,... -/// NK_INCLUDE_FONT_BAKING | Defining this adds `stb_truetype` and `stb_rect_pack` implementation to this library and provides font baking and rendering. If you already have font handling or do not want to use this font handler you don't have to define it. -/// NK_INCLUDE_DEFAULT_FONT | Defining this adds the default font: ProggyClean.ttf into this library which can be loaded into a font atlas and allows using this library without having a truetype font -/// NK_INCLUDE_COMMAND_USERDATA | Defining this adds a userdata pointer into each command. Can be useful for example if you want to provide custom shaders depending on the used widget. Can be combined with the style structures. -/// NK_BUTTON_TRIGGER_ON_RELEASE | Different platforms require button clicks occurring either on buttons being pressed (up to down) or released (down to up). By default this library will react on buttons being pressed, but if you define this it will only trigger if a button is released. -/// NK_ZERO_COMMAND_MEMORY | Defining this will zero out memory for each drawing command added to a drawing queue (inside nk_command_buffer_push). Zeroing command memory is very useful for fast checking (using memcmp) if command buffers are equal and avoid drawing frames when nothing on screen has changed since previous frame. -/// NK_UINT_DRAW_INDEX | Defining this will set the size of vertex index elements when using NK_VERTEX_BUFFER_OUTPUT to 32bit instead of the default of 16bit -/// NK_KEYSTATE_BASED_INPUT | Define this if your backend uses key state for each frame rather than key press/release events -/// -/// !!! WARNING -/// The following flags will pull in the standard C library: -/// - NK_INCLUDE_DEFAULT_ALLOCATOR -/// - NK_INCLUDE_STANDARD_IO -/// - NK_INCLUDE_STANDARD_VARARGS -/// -/// !!! WARNING -/// The following flags if defined need to be defined for both header and implementation: -/// - NK_INCLUDE_FIXED_TYPES -/// - NK_INCLUDE_DEFAULT_ALLOCATOR -/// - NK_INCLUDE_STANDARD_VARARGS -/// - NK_INCLUDE_VERTEX_BUFFER_OUTPUT -/// - NK_INCLUDE_FONT_BAKING -/// - NK_INCLUDE_DEFAULT_FONT -/// - NK_INCLUDE_STANDARD_VARARGS -/// - NK_INCLUDE_COMMAND_USERDATA -/// - NK_UINT_DRAW_INDEX -/// -/// ### Constants -/// Define | Description -/// --------------------------------|--------------------------------------- -/// NK_BUFFER_DEFAULT_INITIAL_SIZE | Initial buffer size allocated by all buffers while using the default allocator functions included by defining NK_INCLUDE_DEFAULT_ALLOCATOR. If you don't want to allocate the default 4k memory then redefine it. -/// NK_MAX_NUMBER_BUFFER | Maximum buffer size for the conversion buffer between float and string Under normal circumstances this should be more than sufficient. -/// NK_INPUT_MAX | Defines the max number of bytes which can be added as text input in one frame. Under normal circumstances this should be more than sufficient. -/// -/// !!! WARNING -/// The following constants if defined need to be defined for both header and implementation: -/// - NK_MAX_NUMBER_BUFFER -/// - NK_BUFFER_DEFAULT_INITIAL_SIZE -/// - NK_INPUT_MAX -/// -/// ### Dependencies -/// Function | Description -/// ------------|--------------------------------------------------------------- -/// NK_ASSERT | If you don't define this, nuklear will use with assert(). -/// NK_MEMSET | You can define this to 'memset' or your own memset implementation replacement. If not nuklear will use its own version. -/// NK_MEMCPY | You can define this to 'memcpy' or your own memcpy implementation replacement. If not nuklear will use its own version. -/// NK_SQRT | You can define this to 'sqrt' or your own sqrt implementation replacement. If not nuklear will use its own slow and not highly accurate version. -/// NK_SIN | You can define this to 'sinf' or your own sine implementation replacement. If not nuklear will use its own approximation implementation. -/// NK_COS | You can define this to 'cosf' or your own cosine implementation replacement. If not nuklear will use its own approximation implementation. -/// NK_STRTOD | You can define this to `strtod` or your own string to double conversion implementation replacement. If not defined nuklear will use its own imprecise and possibly unsafe version (does not handle nan or infinity!). -/// NK_DTOA | You can define this to `dtoa` or your own double to string conversion implementation replacement. If not defined nuklear will use its own imprecise and possibly unsafe version (does not handle nan or infinity!). -/// NK_VSNPRINTF| If you define `NK_INCLUDE_STANDARD_VARARGS` as well as `NK_INCLUDE_STANDARD_IO` and want to be safe define this to `vsnprintf` on compilers supporting later versions of C or C++. By default nuklear will check for your stdlib version in C as well as compiler version in C++. if `vsnprintf` is available it will define it to `vsnprintf` directly. If not defined and if you have older versions of C or C++ it will be defined to `vsprintf` which is unsafe. -/// -/// !!! WARNING -/// The following dependencies will pull in the standard C library if not redefined: -/// - NK_ASSERT -/// -/// !!! WARNING -/// The following dependencies if defined need to be defined for both header and implementation: -/// - NK_ASSERT -/// -/// !!! WARNING -/// The following dependencies if defined need to be defined only for the implementation part: -/// - NK_MEMSET -/// - NK_MEMCPY -/// - NK_SQRT -/// - NK_SIN -/// - NK_COS -/// - NK_STRTOD -/// - NK_DTOA -/// - NK_VSNPRINTF -/// -/// ## Example -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// // init gui state -/// enum {EASY, HARD}; -/// static int op = EASY; -/// static float value = 0.6f; -/// static int i = 20; -/// struct nk_context ctx; -/// -/// nk_init_fixed(&ctx, calloc(1, MAX_MEMORY), MAX_MEMORY, &font); -/// if (nk_begin(&ctx, "Show", nk_rect(50, 50, 220, 220), -/// NK_WINDOW_BORDER|NK_WINDOW_MOVABLE|NK_WINDOW_CLOSABLE)) { -/// // fixed widget pixel width -/// nk_layout_row_static(&ctx, 30, 80, 1); -/// if (nk_button_label(&ctx, "button")) { -/// // event handling -/// } -/// -/// // fixed widget window ratio width -/// nk_layout_row_dynamic(&ctx, 30, 2); -/// if (nk_option_label(&ctx, "easy", op == EASY)) op = EASY; -/// if (nk_option_label(&ctx, "hard", op == HARD)) op = HARD; -/// -/// // custom widget pixel width -/// nk_layout_row_begin(&ctx, NK_STATIC, 30, 2); -/// { -/// nk_layout_row_push(&ctx, 50); -/// nk_label(&ctx, "Volume:", NK_TEXT_LEFT); -/// nk_layout_row_push(&ctx, 110); -/// nk_slider_float(&ctx, 0, &value, 1.0f, 0.1f); -/// } -/// nk_layout_row_end(&ctx); -/// } -/// nk_end(&ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// ![](https://cloud.githubusercontent.com/assets/8057201/10187981/584ecd68-675c-11e5-897c-822ef534a876.png) -/// -/// ## API -/// -*/ -#ifndef NK_SINGLE_FILE - #define NK_SINGLE_FILE -#endif - -#ifndef NK_NUKLEAR_H_ -#define NK_NUKLEAR_H_ - -#ifdef __cplusplus -extern "C" { -#endif -/* - * ============================================================== - * - * CONSTANTS - * - * =============================================================== - */ -#define NK_UNDEFINED (-1.0f) -#define NK_UTF_INVALID 0xFFFD /* internal invalid utf8 rune */ -#define NK_UTF_SIZE 4 /* describes the number of bytes a glyph consists of*/ -#ifndef NK_INPUT_MAX - #define NK_INPUT_MAX 16 -#endif -#ifndef NK_MAX_NUMBER_BUFFER - #define NK_MAX_NUMBER_BUFFER 64 -#endif -#ifndef NK_SCROLLBAR_HIDING_TIMEOUT - #define NK_SCROLLBAR_HIDING_TIMEOUT 4.0f -#endif -/* - * ============================================================== - * - * HELPER - * - * =============================================================== - */ -#ifndef NK_API - #ifdef NK_PRIVATE - #if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199409L)) - #define NK_API static inline - #elif defined(__cplusplus) - #define NK_API static inline - #else - #define NK_API static - #endif - #else - #define NK_API extern - #endif -#endif -#ifndef NK_LIB - #ifdef NK_SINGLE_FILE - #define NK_LIB static - #else - #define NK_LIB extern - #endif -#endif - -#define NK_INTERN static -#define NK_STORAGE static -#define NK_GLOBAL static - -#define NK_FLAG(x) (1 << (x)) -#define NK_STRINGIFY(x) #x -#define NK_MACRO_STRINGIFY(x) NK_STRINGIFY(x) -#define NK_STRING_JOIN_IMMEDIATE(arg1, arg2) arg1 ## arg2 -#define NK_STRING_JOIN_DELAY(arg1, arg2) NK_STRING_JOIN_IMMEDIATE(arg1, arg2) -#define NK_STRING_JOIN(arg1, arg2) NK_STRING_JOIN_DELAY(arg1, arg2) - -#ifdef _MSC_VER - #define NK_UNIQUE_NAME(name) NK_STRING_JOIN(name,__COUNTER__) -#else - #define NK_UNIQUE_NAME(name) NK_STRING_JOIN(name,__LINE__) -#endif - -#ifndef NK_STATIC_ASSERT - #define NK_STATIC_ASSERT(exp) typedef char NK_UNIQUE_NAME(_dummy_array)[(exp)?1:-1] -#endif - -#ifndef NK_FILE_LINE -#ifdef _MSC_VER - #define NK_FILE_LINE __FILE__ ":" NK_MACRO_STRINGIFY(__COUNTER__) -#else - #define NK_FILE_LINE __FILE__ ":" NK_MACRO_STRINGIFY(__LINE__) -#endif -#endif - -#define NK_MIN(a,b) ((a) < (b) ? (a) : (b)) -#define NK_MAX(a,b) ((a) < (b) ? (b) : (a)) -#define NK_CLAMP(i,v,x) (NK_MAX(NK_MIN(v,x), i)) - -#ifdef NK_INCLUDE_STANDARD_VARARGS - #include /* valist, va_start, va_end, ... */ - #if defined(_MSC_VER) && (_MSC_VER >= 1600) /* VS 2010 and above */ - #include - #define NK_PRINTF_FORMAT_STRING _Printf_format_string_ - #else - #define NK_PRINTF_FORMAT_STRING - #endif - #if defined(__GNUC__) - #define NK_PRINTF_VARARG_FUNC(fmtargnumber) __attribute__((format(__printf__, fmtargnumber, fmtargnumber+1))) - #define NK_PRINTF_VALIST_FUNC(fmtargnumber) __attribute__((format(__printf__, fmtargnumber, 0))) - #else - #define NK_PRINTF_VARARG_FUNC(fmtargnumber) - #define NK_PRINTF_VALIST_FUNC(fmtargnumber) - #endif -#endif - -/* - * =============================================================== - * - * BASIC - * - * =============================================================== - */ -#ifdef NK_INCLUDE_FIXED_TYPES - #include - #define NK_INT8 int8_t - #define NK_UINT8 uint8_t - #define NK_INT16 int16_t - #define NK_UINT16 uint16_t - #define NK_INT32 int32_t - #define NK_UINT32 uint32_t - #define NK_SIZE_TYPE uintptr_t - #define NK_POINTER_TYPE uintptr_t -#else - #ifndef NK_INT8 - #define NK_INT8 signed char - #endif - #ifndef NK_UINT8 - #define NK_UINT8 unsigned char - #endif - #ifndef NK_INT16 - #define NK_INT16 signed short - #endif - #ifndef NK_UINT16 - #define NK_UINT16 unsigned short - #endif - #ifndef NK_INT32 - #if defined(_MSC_VER) - #define NK_INT32 __int32 - #else - #define NK_INT32 signed int - #endif - #endif - #ifndef NK_UINT32 - #if defined(_MSC_VER) - #define NK_UINT32 unsigned __int32 - #else - #define NK_UINT32 unsigned int - #endif - #endif - #ifndef NK_SIZE_TYPE - #if defined(_WIN64) && defined(_MSC_VER) - #define NK_SIZE_TYPE unsigned __int64 - #elif (defined(_WIN32) || defined(WIN32)) && defined(_MSC_VER) - #define NK_SIZE_TYPE unsigned __int32 - #elif defined(__GNUC__) || defined(__clang__) - #if defined(__x86_64__) || defined(__ppc64__) - #define NK_SIZE_TYPE unsigned long - #else - #define NK_SIZE_TYPE unsigned int - #endif - #else - #define NK_SIZE_TYPE unsigned long - #endif - #endif - #ifndef NK_POINTER_TYPE - #if defined(_WIN64) && defined(_MSC_VER) - #define NK_POINTER_TYPE unsigned __int64 - #elif (defined(_WIN32) || defined(WIN32)) && defined(_MSC_VER) - #define NK_POINTER_TYPE unsigned __int32 - #elif defined(__GNUC__) || defined(__clang__) - #if defined(__x86_64__) || defined(__ppc64__) - #define NK_POINTER_TYPE unsigned long - #else - #define NK_POINTER_TYPE unsigned int - #endif - #else - #define NK_POINTER_TYPE unsigned long - #endif - #endif -#endif - -typedef NK_INT8 nk_char; -typedef NK_UINT8 nk_uchar; -typedef NK_UINT8 nk_byte; -typedef NK_INT16 nk_short; -typedef NK_UINT16 nk_ushort; -typedef NK_INT32 nk_int; -typedef NK_UINT32 nk_uint; -typedef NK_SIZE_TYPE nk_size; -typedef NK_POINTER_TYPE nk_ptr; - -typedef nk_uint nk_hash; -typedef nk_uint nk_flags; -typedef nk_uint nk_rune; - -/* Make sure correct type size: - * This will fire with a negative subscript error if the type sizes - * are set incorrectly by the compiler, and compile out if not */ -NK_STATIC_ASSERT(sizeof(nk_short) == 2); -NK_STATIC_ASSERT(sizeof(nk_ushort) == 2); -NK_STATIC_ASSERT(sizeof(nk_uint) == 4); -NK_STATIC_ASSERT(sizeof(nk_int) == 4); -NK_STATIC_ASSERT(sizeof(nk_byte) == 1); -NK_STATIC_ASSERT(sizeof(nk_flags) >= 4); -NK_STATIC_ASSERT(sizeof(nk_rune) >= 4); -NK_STATIC_ASSERT(sizeof(nk_size) >= sizeof(void*)); -NK_STATIC_ASSERT(sizeof(nk_ptr) >= sizeof(void*)); - -/* ============================================================================ - * - * API - * - * =========================================================================== */ -struct nk_buffer; -struct nk_allocator; -struct nk_command_buffer; -struct nk_draw_command; -struct nk_convert_config; -struct nk_style_item; -struct nk_text_edit; -struct nk_draw_list; -struct nk_user_font; -struct nk_panel; -struct nk_context; -struct nk_draw_vertex_layout_element; -struct nk_style_button; -struct nk_style_toggle; -struct nk_style_selectable; -struct nk_style_slide; -struct nk_style_progress; -struct nk_style_scrollbar; -struct nk_style_edit; -struct nk_style_property; -struct nk_style_chart; -struct nk_style_combo; -struct nk_style_tab; -struct nk_style_window_header; -struct nk_style_window; - -enum {nk_false, nk_true}; -struct nk_color {nk_byte r,g,b,a;}; -struct nk_colorf {float r,g,b,a;}; -struct nk_vec2 {float x,y;}; -struct nk_vec2i {short x, y;}; -struct nk_rect {float x,y,w,h;}; -struct nk_recti {short x,y,w,h;}; -typedef char nk_glyph[NK_UTF_SIZE]; -typedef union {void *ptr; int id;} nk_handle; -struct nk_image {nk_handle handle;unsigned short w,h;unsigned short region[4];}; -struct nk_cursor {struct nk_image img; struct nk_vec2 size, offset;}; -struct nk_scroll {nk_uint x, y;}; - -enum nk_heading {NK_UP, NK_RIGHT, NK_DOWN, NK_LEFT}; -enum nk_button_behavior {NK_BUTTON_DEFAULT, NK_BUTTON_REPEATER}; -enum nk_modify {NK_FIXED = nk_false, NK_MODIFIABLE = nk_true}; -enum nk_orientation {NK_VERTICAL, NK_HORIZONTAL}; -enum nk_collapse_states {NK_MINIMIZED = nk_false, NK_MAXIMIZED = nk_true}; -enum nk_show_states {NK_HIDDEN = nk_false, NK_SHOWN = nk_true}; -enum nk_chart_type {NK_CHART_LINES, NK_CHART_COLUMN, NK_CHART_MAX}; -enum nk_chart_event {NK_CHART_HOVERING = 0x01, NK_CHART_CLICKED = 0x02}; -enum nk_color_format {NK_RGB, NK_RGBA}; -enum nk_popup_type {NK_POPUP_STATIC, NK_POPUP_DYNAMIC}; -enum nk_layout_format {NK_DYNAMIC, NK_STATIC}; -enum nk_tree_type {NK_TREE_NODE, NK_TREE_TAB}; - -typedef void*(*nk_plugin_alloc)(nk_handle, void *old, nk_size); -typedef void (*nk_plugin_free)(nk_handle, void *old); -typedef int(*nk_plugin_filter)(const struct nk_text_edit*, nk_rune unicode); -typedef void(*nk_plugin_paste)(nk_handle, struct nk_text_edit*); -typedef void(*nk_plugin_copy)(nk_handle, const char*, int len); - -struct nk_allocator { - nk_handle userdata; - nk_plugin_alloc alloc; - nk_plugin_free free; -}; -enum nk_symbol_type { - NK_SYMBOL_NONE, - NK_SYMBOL_X, - NK_SYMBOL_UNDERSCORE, - NK_SYMBOL_CIRCLE_SOLID, - NK_SYMBOL_CIRCLE_OUTLINE, - NK_SYMBOL_RECT_SOLID, - NK_SYMBOL_RECT_OUTLINE, - NK_SYMBOL_TRIANGLE_UP, - NK_SYMBOL_TRIANGLE_DOWN, - NK_SYMBOL_TRIANGLE_LEFT, - NK_SYMBOL_TRIANGLE_RIGHT, - NK_SYMBOL_PLUS, - NK_SYMBOL_MINUS, - NK_SYMBOL_MAX -}; -/* ============================================================================= - * - * CONTEXT - * - * =============================================================================*/ -/*/// ### Context -/// Contexts are the main entry point and the majestro of nuklear and contain all required state. -/// They are used for window, memory, input, style, stack, commands and time management and need -/// to be passed into all nuklear GUI specific functions. -/// -/// #### Usage -/// To use a context it first has to be initialized which can be achieved by calling -/// one of either `nk_init_default`, `nk_init_fixed`, `nk_init`, `nk_init_custom`. -/// Each takes in a font handle and a specific way of handling memory. Memory control -/// hereby ranges from standard library to just specifying a fixed sized block of memory -/// which nuklear has to manage itself from. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_context ctx; -/// nk_init_xxx(&ctx, ...); -/// while (1) { -/// // [...] -/// nk_clear(&ctx); -/// } -/// nk_free(&ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// #### Reference -/// Function | Description -/// --------------------|------------------------------------------------------- -/// __nk_init_default__ | Initializes context with standard library memory allocation (malloc,free) -/// __nk_init_fixed__ | Initializes context from single fixed size memory block -/// __nk_init__ | Initializes context with memory allocator callbacks for alloc and free -/// __nk_init_custom__ | Initializes context from two buffers. One for draw commands the other for window/panel/table allocations -/// __nk_clear__ | Called at the end of the frame to reset and prepare the context for the next frame -/// __nk_free__ | Shutdown and free all memory allocated inside the context -/// __nk_set_user_data__| Utility function to pass user data to draw command - */ -#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR -/*/// #### nk_init_default -/// Initializes a `nk_context` struct with a default standard library allocator. -/// Should be used if you don't want to be bothered with memory management in nuklear. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// int nk_init_default(struct nk_context *ctx, const struct nk_user_font *font); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|--------------------------------------------------------------- -/// __ctx__ | Must point to an either stack or heap allocated `nk_context` struct -/// __font__ | Must point to a previously initialized font handle for more info look at font documentation -/// -/// Returns either `false(0)` on failure or `true(1)` on success. -/// -*/ -NK_API int nk_init_default(struct nk_context*, const struct nk_user_font*); -#endif -/*/// #### nk_init_fixed -/// Initializes a `nk_context` struct from single fixed size memory block -/// Should be used if you want complete control over nuklear's memory management. -/// Especially recommended for system with little memory or systems with virtual memory. -/// For the later case you can just allocate for example 16MB of virtual memory -/// and only the required amount of memory will actually be committed. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// int nk_init_fixed(struct nk_context *ctx, void *memory, nk_size size, const struct nk_user_font *font); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// !!! Warning -/// make sure the passed memory block is aligned correctly for `nk_draw_commands`. -/// -/// Parameter | Description -/// ------------|-------------------------------------------------------------- -/// __ctx__ | Must point to an either stack or heap allocated `nk_context` struct -/// __memory__ | Must point to a previously allocated memory block -/// __size__ | Must contain the total size of __memory__ -/// __font__ | Must point to a previously initialized font handle for more info look at font documentation -/// -/// Returns either `false(0)` on failure or `true(1)` on success. -*/ -NK_API int nk_init_fixed(struct nk_context*, void *memory, nk_size size, const struct nk_user_font*); -/*/// #### nk_init -/// Initializes a `nk_context` struct with memory allocation callbacks for nuklear to allocate -/// memory from. Used internally for `nk_init_default` and provides a kitchen sink allocation -/// interface to nuklear. Can be useful for cases like monitoring memory consumption. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// int nk_init(struct nk_context *ctx, struct nk_allocator *alloc, const struct nk_user_font *font); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|--------------------------------------------------------------- -/// __ctx__ | Must point to an either stack or heap allocated `nk_context` struct -/// __alloc__ | Must point to a previously allocated memory allocator -/// __font__ | Must point to a previously initialized font handle for more info look at font documentation -/// -/// Returns either `false(0)` on failure or `true(1)` on success. -*/ -NK_API int nk_init(struct nk_context*, struct nk_allocator*, const struct nk_user_font*); -/*/// #### nk_init_custom -/// Initializes a `nk_context` struct from two different either fixed or growing -/// buffers. The first buffer is for allocating draw commands while the second buffer is -/// used for allocating windows, panels and state tables. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// int nk_init_custom(struct nk_context *ctx, struct nk_buffer *cmds, struct nk_buffer *pool, const struct nk_user_font *font); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|--------------------------------------------------------------- -/// __ctx__ | Must point to an either stack or heap allocated `nk_context` struct -/// __cmds__ | Must point to a previously initialized memory buffer either fixed or dynamic to store draw commands into -/// __pool__ | Must point to a previously initialized memory buffer either fixed or dynamic to store windows, panels and tables -/// __font__ | Must point to a previously initialized font handle for more info look at font documentation -/// -/// Returns either `false(0)` on failure or `true(1)` on success. -*/ -NK_API int nk_init_custom(struct nk_context*, struct nk_buffer *cmds, struct nk_buffer *pool, const struct nk_user_font*); -/*/// #### nk_clear -/// Resets the context state at the end of the frame. This includes mostly -/// garbage collector tasks like removing windows or table not called and therefore -/// used anymore. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_clear(struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to a previously initialized `nk_context` struct -*/ -NK_API void nk_clear(struct nk_context*); -/*/// #### nk_free -/// Frees all memory allocated by nuklear. Not needed if context was -/// initialized with `nk_init_fixed`. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_free(struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to a previously initialized `nk_context` struct -*/ -NK_API void nk_free(struct nk_context*); -#ifdef NK_INCLUDE_COMMAND_USERDATA -/*/// #### nk_set_user_data -/// Sets the currently passed userdata passed down into each draw command. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_set_user_data(struct nk_context *ctx, nk_handle data); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|-------------------------------------------------------------- -/// __ctx__ | Must point to a previously initialized `nk_context` struct -/// __data__ | Handle with either pointer or index to be passed into every draw commands -*/ -NK_API void nk_set_user_data(struct nk_context*, nk_handle handle); -#endif -/* ============================================================================= - * - * INPUT - * - * =============================================================================*/ -/*/// ### Input -/// The input API is responsible for holding the current input state composed of -/// mouse, key and text input states. -/// It is worth noting that no direct OS or window handling is done in nuklear. -/// Instead all input state has to be provided by platform specific code. This on one hand -/// expects more work from the user and complicates usage but on the other hand -/// provides simple abstraction over a big number of platforms, libraries and other -/// already provided functionality. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// nk_input_begin(&ctx); -/// while (GetEvent(&evt)) { -/// if (evt.type == MOUSE_MOVE) -/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y); -/// else if (evt.type == [...]) { -/// // [...] -/// } -/// } nk_input_end(&ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// #### Usage -/// Input state needs to be provided to nuklear by first calling `nk_input_begin` -/// which resets internal state like delta mouse position and button transistions. -/// After `nk_input_begin` all current input state needs to be provided. This includes -/// mouse motion, button and key pressed and released, text input and scrolling. -/// Both event- or state-based input handling are supported by this API -/// and should work without problems. Finally after all input state has been -/// mirrored `nk_input_end` needs to be called to finish input process. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_context ctx; -/// nk_init_xxx(&ctx, ...); -/// while (1) { -/// Event evt; -/// nk_input_begin(&ctx); -/// while (GetEvent(&evt)) { -/// if (evt.type == MOUSE_MOVE) -/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y); -/// else if (evt.type == [...]) { -/// // [...] -/// } -/// } -/// nk_input_end(&ctx); -/// // [...] -/// nk_clear(&ctx); -/// } nk_free(&ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// #### Reference -/// Function | Description -/// --------------------|------------------------------------------------------- -/// __nk_input_begin__ | Begins the input mirroring process. Needs to be called before all other `nk_input_xxx` calls -/// __nk_input_motion__ | Mirrors mouse cursor position -/// __nk_input_key__ | Mirrors key state with either pressed or released -/// __nk_input_button__ | Mirrors mouse button state with either pressed or released -/// __nk_input_scroll__ | Mirrors mouse scroll values -/// __nk_input_char__ | Adds a single ASCII text character into an internal text buffer -/// __nk_input_glyph__ | Adds a single multi-byte UTF-8 character into an internal text buffer -/// __nk_input_unicode__| Adds a single unicode rune into an internal text buffer -/// __nk_input_end__ | Ends the input mirroring process by calculating state changes. Don't call any `nk_input_xxx` function referenced above after this call -*/ -enum nk_keys { - NK_KEY_NONE, - NK_KEY_SHIFT, - NK_KEY_CTRL, - NK_KEY_DEL, - NK_KEY_ENTER, - NK_KEY_TAB, - NK_KEY_BACKSPACE, - NK_KEY_COPY, - NK_KEY_CUT, - NK_KEY_PASTE, - NK_KEY_UP, - NK_KEY_DOWN, - NK_KEY_LEFT, - NK_KEY_RIGHT, - /* Shortcuts: text field */ - NK_KEY_TEXT_INSERT_MODE, - NK_KEY_TEXT_REPLACE_MODE, - NK_KEY_TEXT_RESET_MODE, - NK_KEY_TEXT_LINE_START, - NK_KEY_TEXT_LINE_END, - NK_KEY_TEXT_START, - NK_KEY_TEXT_END, - NK_KEY_TEXT_UNDO, - NK_KEY_TEXT_REDO, - NK_KEY_TEXT_SELECT_ALL, - NK_KEY_TEXT_WORD_LEFT, - NK_KEY_TEXT_WORD_RIGHT, - /* Shortcuts: scrollbar */ - NK_KEY_SCROLL_START, - NK_KEY_SCROLL_END, - NK_KEY_SCROLL_DOWN, - NK_KEY_SCROLL_UP, - NK_KEY_MAX -}; -enum nk_buttons { - NK_BUTTON_LEFT, - NK_BUTTON_MIDDLE, - NK_BUTTON_RIGHT, - NK_BUTTON_DOUBLE, - NK_BUTTON_MAX -}; -/*/// #### nk_input_begin -/// Begins the input mirroring process by resetting text, scroll -/// mouse, previous mouse position and movement as well as key state transitions, -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_input_begin(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to a previously initialized `nk_context` struct -*/ -NK_API void nk_input_begin(struct nk_context*); -/*/// #### nk_input_motion -/// Mirrors current mouse position to nuklear -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_input_motion(struct nk_context *ctx, int x, int y); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to a previously initialized `nk_context` struct -/// __x__ | Must hold an integer describing the current mouse cursor x-position -/// __y__ | Must hold an integer describing the current mouse cursor y-position -*/ -NK_API void nk_input_motion(struct nk_context*, int x, int y); -/*/// #### nk_input_key -/// Mirrors the state of a specific key to nuklear -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_input_key(struct nk_context*, enum nk_keys key, int down); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to a previously initialized `nk_context` struct -/// __key__ | Must be any value specified in enum `nk_keys` that needs to be mirrored -/// __down__ | Must be 0 for key is up and 1 for key is down -*/ -NK_API void nk_input_key(struct nk_context*, enum nk_keys, int down); -/*/// #### nk_input_button -/// Mirrors the state of a specific mouse button to nuklear -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_input_button(struct nk_context *ctx, enum nk_buttons btn, int x, int y, int down); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to a previously initialized `nk_context` struct -/// __btn__ | Must be any value specified in enum `nk_buttons` that needs to be mirrored -/// __x__ | Must contain an integer describing mouse cursor x-position on click up/down -/// __y__ | Must contain an integer describing mouse cursor y-position on click up/down -/// __down__ | Must be 0 for key is up and 1 for key is down -*/ -NK_API void nk_input_button(struct nk_context*, enum nk_buttons, int x, int y, int down); -/*/// #### nk_input_scroll -/// Copies the last mouse scroll value to nuklear. Is generally -/// a scroll value. So does not have to come from mouse and could also originate -/// TODO finish this sentence -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_input_scroll(struct nk_context *ctx, struct nk_vec2 val); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to a previously initialized `nk_context` struct -/// __val__ | vector with both X- as well as Y-scroll value -*/ -NK_API void nk_input_scroll(struct nk_context*, struct nk_vec2 val); -/*/// #### nk_input_char -/// Copies a single ASCII character into an internal text buffer -/// This is basically a helper function to quickly push ASCII characters into -/// nuklear. -/// -/// !!! Note -/// Stores up to NK_INPUT_MAX bytes between `nk_input_begin` and `nk_input_end`. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_input_char(struct nk_context *ctx, char c); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to a previously initialized `nk_context` struct -/// __c__ | Must be a single ASCII character preferable one that can be printed -*/ -NK_API void nk_input_char(struct nk_context*, char); -/*/// #### nk_input_glyph -/// Converts an encoded unicode rune into UTF-8 and copies the result into an -/// internal text buffer. -/// -/// !!! Note -/// Stores up to NK_INPUT_MAX bytes between `nk_input_begin` and `nk_input_end`. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_input_glyph(struct nk_context *ctx, const nk_glyph g); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to a previously initialized `nk_context` struct -/// __g__ | UTF-32 unicode codepoint -*/ -NK_API void nk_input_glyph(struct nk_context*, const nk_glyph); -/*/// #### nk_input_unicode -/// Converts a unicode rune into UTF-8 and copies the result -/// into an internal text buffer. -/// !!! Note -/// Stores up to NK_INPUT_MAX bytes between `nk_input_begin` and `nk_input_end`. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_input_unicode(struct nk_context*, nk_rune rune); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to a previously initialized `nk_context` struct -/// __rune__ | UTF-32 unicode codepoint -*/ -NK_API void nk_input_unicode(struct nk_context*, nk_rune); -/*/// #### nk_input_end -/// End the input mirroring process by resetting mouse grabbing -/// state to ensure the mouse cursor is not grabbed indefinitely. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_input_end(struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to a previously initialized `nk_context` struct -*/ -NK_API void nk_input_end(struct nk_context*); -/* ============================================================================= - * - * DRAWING - * - * =============================================================================*/ -/*/// ### Drawing -/// This library was designed to be render backend agnostic so it does -/// not draw anything to screen directly. Instead all drawn shapes, widgets -/// are made of, are buffered into memory and make up a command queue. -/// Each frame therefore fills the command buffer with draw commands -/// that then need to be executed by the user and his own render backend. -/// After that the command buffer needs to be cleared and a new frame can be -/// started. It is probably important to note that the command buffer is the main -/// drawing API and the optional vertex buffer API only takes this format and -/// converts it into a hardware accessible format. -/// -/// #### Usage -/// To draw all draw commands accumulated over a frame you need your own render -/// backend able to draw a number of 2D primitives. This includes at least -/// filled and stroked rectangles, circles, text, lines, triangles and scissors. -/// As soon as this criterion is met you can iterate over each draw command -/// and execute each draw command in a interpreter like fashion: -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// const struct nk_command *cmd = 0; -/// nk_foreach(cmd, &ctx) { -/// switch (cmd->type) { -/// case NK_COMMAND_LINE: -/// your_draw_line_function(...) -/// break; -/// case NK_COMMAND_RECT -/// your_draw_rect_function(...) -/// break; -/// case //...: -/// //[...] -/// } -/// } -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// In program flow context draw commands need to be executed after input has been -/// gathered and the complete UI with windows and their contained widgets have -/// been executed and before calling `nk_clear` which frees all previously -/// allocated draw commands. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_context ctx; -/// nk_init_xxx(&ctx, ...); -/// while (1) { -/// Event evt; -/// nk_input_begin(&ctx); -/// while (GetEvent(&evt)) { -/// if (evt.type == MOUSE_MOVE) -/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y); -/// else if (evt.type == [...]) { -/// [...] -/// } -/// } -/// nk_input_end(&ctx); -/// // -/// // [...] -/// // -/// const struct nk_command *cmd = 0; -/// nk_foreach(cmd, &ctx) { -/// switch (cmd->type) { -/// case NK_COMMAND_LINE: -/// your_draw_line_function(...) -/// break; -/// case NK_COMMAND_RECT -/// your_draw_rect_function(...) -/// break; -/// case ...: -/// // [...] -/// } -/// nk_clear(&ctx); -/// } -/// nk_free(&ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// You probably noticed that you have to draw all of the UI each frame which is -/// quite wasteful. While the actual UI updating loop is quite fast rendering -/// without actually needing it is not. So there are multiple things you could do. -/// -/// First is only update on input. This of course is only an option if your -/// application only depends on the UI and does not require any outside calculations. -/// If you actually only update on input make sure to update the UI two times each -/// frame and call `nk_clear` directly after the first pass and only draw in -/// the second pass. In addition it is recommended to also add additional timers -/// to make sure the UI is not drawn more than a fixed number of frames per second. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_context ctx; -/// nk_init_xxx(&ctx, ...); -/// while (1) { -/// // [...wait for input ] -/// // [...do two UI passes ...] -/// do_ui(...) -/// nk_clear(&ctx); -/// do_ui(...) -/// // -/// // draw -/// const struct nk_command *cmd = 0; -/// nk_foreach(cmd, &ctx) { -/// switch (cmd->type) { -/// case NK_COMMAND_LINE: -/// your_draw_line_function(...) -/// break; -/// case NK_COMMAND_RECT -/// your_draw_rect_function(...) -/// break; -/// case ...: -/// //[...] -/// } -/// nk_clear(&ctx); -/// } -/// nk_free(&ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// The second probably more applicable trick is to only draw if anything changed. -/// It is not really useful for applications with continuous draw loop but -/// quite useful for desktop applications. To actually get nuklear to only -/// draw on changes you first have to define `NK_ZERO_COMMAND_MEMORY` and -/// allocate a memory buffer that will store each unique drawing output. -/// After each frame you compare the draw command memory inside the library -/// with your allocated buffer by memcmp. If memcmp detects differences -/// you have to copy the command buffer into the allocated buffer -/// and then draw like usual (this example uses fixed memory but you could -/// use dynamically allocated memory). -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// //[... other defines ...] -/// #define NK_ZERO_COMMAND_MEMORY -/// #include "nuklear.h" -/// // -/// // setup context -/// struct nk_context ctx; -/// void *last = calloc(1,64*1024); -/// void *buf = calloc(1,64*1024); -/// nk_init_fixed(&ctx, buf, 64*1024); -/// // -/// // loop -/// while (1) { -/// // [...input...] -/// // [...ui...] -/// void *cmds = nk_buffer_memory(&ctx.memory); -/// if (memcmp(cmds, last, ctx.memory.allocated)) { -/// memcpy(last,cmds,ctx.memory.allocated); -/// const struct nk_command *cmd = 0; -/// nk_foreach(cmd, &ctx) { -/// switch (cmd->type) { -/// case NK_COMMAND_LINE: -/// your_draw_line_function(...) -/// break; -/// case NK_COMMAND_RECT -/// your_draw_rect_function(...) -/// break; -/// case ...: -/// // [...] -/// } -/// } -/// } -/// nk_clear(&ctx); -/// } -/// nk_free(&ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Finally while using draw commands makes sense for higher abstracted platforms like -/// X11 and Win32 or drawing libraries it is often desirable to use graphics -/// hardware directly. Therefore it is possible to just define -/// `NK_INCLUDE_VERTEX_BUFFER_OUTPUT` which includes optional vertex output. -/// To access the vertex output you first have to convert all draw commands into -/// vertexes by calling `nk_convert` which takes in your preferred vertex format. -/// After successfully converting all draw commands just iterate over and execute all -/// vertex draw commands: -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// // fill configuration -/// struct your_vertex -/// { -/// float pos[2]; // important to keep it to 2 floats -/// float uv[2]; -/// unsigned char col[4]; -/// }; -/// struct nk_convert_config cfg = {}; -/// static const struct nk_draw_vertex_layout_element vertex_layout[] = { -/// {NK_VERTEX_POSITION, NK_FORMAT_FLOAT, NK_OFFSETOF(struct your_vertex, pos)}, -/// {NK_VERTEX_TEXCOORD, NK_FORMAT_FLOAT, NK_OFFSETOF(struct your_vertex, uv)}, -/// {NK_VERTEX_COLOR, NK_FORMAT_R8G8B8A8, NK_OFFSETOF(struct your_vertex, col)}, -/// {NK_VERTEX_LAYOUT_END} -/// }; -/// cfg.shape_AA = NK_ANTI_ALIASING_ON; -/// cfg.line_AA = NK_ANTI_ALIASING_ON; -/// cfg.vertex_layout = vertex_layout; -/// cfg.vertex_size = sizeof(struct your_vertex); -/// cfg.vertex_alignment = NK_ALIGNOF(struct your_vertex); -/// cfg.circle_segment_count = 22; -/// cfg.curve_segment_count = 22; -/// cfg.arc_segment_count = 22; -/// cfg.global_alpha = 1.0f; -/// cfg.null = dev->null; -/// // -/// // setup buffers and convert -/// struct nk_buffer cmds, verts, idx; -/// nk_buffer_init_default(&cmds); -/// nk_buffer_init_default(&verts); -/// nk_buffer_init_default(&idx); -/// nk_convert(&ctx, &cmds, &verts, &idx, &cfg); -/// // -/// // draw -/// nk_draw_foreach(cmd, &ctx, &cmds) { -/// if (!cmd->elem_count) continue; -/// //[...] -/// } -/// nk_buffer_free(&cms); -/// nk_buffer_free(&verts); -/// nk_buffer_free(&idx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// #### Reference -/// Function | Description -/// --------------------|------------------------------------------------------- -/// __nk__begin__ | Returns the first draw command in the context draw command list to be drawn -/// __nk__next__ | Increments the draw command iterator to the next command inside the context draw command list -/// __nk_foreach__ | Iterates over each draw command inside the context draw command list -/// __nk_convert__ | Converts from the abstract draw commands list into a hardware accessible vertex format -/// __nk_draw_begin__ | Returns the first vertex command in the context vertex draw list to be executed -/// __nk__draw_next__ | Increments the vertex command iterator to the next command inside the context vertex command list -/// __nk__draw_end__ | Returns the end of the vertex draw list -/// __nk_draw_foreach__ | Iterates over each vertex draw command inside the vertex draw list -*/ -enum nk_anti_aliasing {NK_ANTI_ALIASING_OFF, NK_ANTI_ALIASING_ON}; -enum nk_convert_result { - NK_CONVERT_SUCCESS = 0, - NK_CONVERT_INVALID_PARAM = 1, - NK_CONVERT_COMMAND_BUFFER_FULL = NK_FLAG(1), - NK_CONVERT_VERTEX_BUFFER_FULL = NK_FLAG(2), - NK_CONVERT_ELEMENT_BUFFER_FULL = NK_FLAG(3) -}; -struct nk_draw_null_texture { - nk_handle texture; /* texture handle to a texture with a white pixel */ - struct nk_vec2 uv; /* coordinates to a white pixel in the texture */ -}; -struct nk_convert_config { - float global_alpha; /* global alpha value */ - enum nk_anti_aliasing line_AA; /* line anti-aliasing flag can be turned off if you are tight on memory */ - enum nk_anti_aliasing shape_AA; /* shape anti-aliasing flag can be turned off if you are tight on memory */ - unsigned circle_segment_count; /* number of segments used for circles: default to 22 */ - unsigned arc_segment_count; /* number of segments used for arcs: default to 22 */ - unsigned curve_segment_count; /* number of segments used for curves: default to 22 */ - struct nk_draw_null_texture null; /* handle to texture with a white pixel for shape drawing */ - const struct nk_draw_vertex_layout_element *vertex_layout; /* describes the vertex output format and packing */ - nk_size vertex_size; /* sizeof one vertex for vertex packing */ - nk_size vertex_alignment; /* vertex alignment: Can be obtained by NK_ALIGNOF */ -}; -/*/// #### nk__begin -/// Returns a draw command list iterator to iterate all draw -/// commands accumulated over one frame. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// const struct nk_command* nk__begin(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | must point to an previously initialized `nk_context` struct at the end of a frame -/// -/// Returns draw command pointer pointing to the first command inside the draw command list -*/ -NK_API const struct nk_command* nk__begin(struct nk_context*); -/*/// #### nk__next -/// Returns draw command pointer pointing to the next command inside the draw command list -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// const struct nk_command* nk__next(struct nk_context*, const struct nk_command*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame -/// __cmd__ | Must point to an previously a draw command either returned by `nk__begin` or `nk__next` -/// -/// Returns draw command pointer pointing to the next command inside the draw command list -*/ -NK_API const struct nk_command* nk__next(struct nk_context*, const struct nk_command*); -/*/// #### nk_foreach -/// Iterates over each draw command inside the context draw command list -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// #define nk_foreach(c, ctx) -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame -/// __cmd__ | Command pointer initialized to NULL -/// -/// Iterates over each draw command inside the context draw command list -*/ -#define nk_foreach(c, ctx) for((c) = nk__begin(ctx); (c) != 0; (c) = nk__next(ctx,c)) -#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT -/*/// #### nk_convert -/// Converts all internal draw commands into vertex draw commands and fills -/// three buffers with vertexes, vertex draw commands and vertex indices. The vertex format -/// as well as some other configuration values have to be configured by filling out a -/// `nk_convert_config` struct. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// nk_flags nk_convert(struct nk_context *ctx, struct nk_buffer *cmds, -/// struct nk_buffer *vertices, struct nk_buffer *elements, const struct nk_convert_config*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame -/// __cmds__ | Must point to a previously initialized buffer to hold converted vertex draw commands -/// __vertices__| Must point to a previously initialized buffer to hold all produced vertices -/// __elements__| Must point to a previously initialized buffer to hold all produced vertex indices -/// __config__ | Must point to a filled out `nk_config` struct to configure the conversion process -/// -/// Returns one of enum nk_convert_result error codes -/// -/// Parameter | Description -/// --------------------------------|----------------------------------------------------------- -/// NK_CONVERT_SUCCESS | Signals a successful draw command to vertex buffer conversion -/// NK_CONVERT_INVALID_PARAM | An invalid argument was passed in the function call -/// NK_CONVERT_COMMAND_BUFFER_FULL | The provided buffer for storing draw commands is full or failed to allocate more memory -/// NK_CONVERT_VERTEX_BUFFER_FULL | The provided buffer for storing vertices is full or failed to allocate more memory -/// NK_CONVERT_ELEMENT_BUFFER_FULL | The provided buffer for storing indicies is full or failed to allocate more memory -*/ -NK_API nk_flags nk_convert(struct nk_context*, struct nk_buffer *cmds, struct nk_buffer *vertices, struct nk_buffer *elements, const struct nk_convert_config*); -/*/// #### nk__draw_begin -/// Returns a draw vertex command buffer iterator to iterate over the vertex draw command buffer -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// const struct nk_draw_command* nk__draw_begin(const struct nk_context*, const struct nk_buffer*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame -/// __buf__ | Must point to an previously by `nk_convert` filled out vertex draw command buffer -/// -/// Returns vertex draw command pointer pointing to the first command inside the vertex draw command buffer -*/ -NK_API const struct nk_draw_command* nk__draw_begin(const struct nk_context*, const struct nk_buffer*); -/*/// #### nk__draw_end -/// Returns the vertex draw command at the end of the vertex draw command buffer -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// const struct nk_draw_command* nk__draw_end(const struct nk_context *ctx, const struct nk_buffer *buf); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame -/// __buf__ | Must point to an previously by `nk_convert` filled out vertex draw command buffer -/// -/// Returns vertex draw command pointer pointing to the end of the last vertex draw command inside the vertex draw command buffer -*/ -NK_API const struct nk_draw_command* nk__draw_end(const struct nk_context*, const struct nk_buffer*); -/*/// #### nk__draw_next -/// Increments the vertex draw command buffer iterator -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// const struct nk_draw_command* nk__draw_next(const struct nk_draw_command*, const struct nk_buffer*, const struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __cmd__ | Must point to an previously either by `nk__draw_begin` or `nk__draw_next` returned vertex draw command -/// __buf__ | Must point to an previously by `nk_convert` filled out vertex draw command buffer -/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame -/// -/// Returns vertex draw command pointer pointing to the end of the last vertex draw command inside the vertex draw command buffer -*/ -NK_API const struct nk_draw_command* nk__draw_next(const struct nk_draw_command*, const struct nk_buffer*, const struct nk_context*); -/*/// #### nk_draw_foreach -/// Iterates over each vertex draw command inside a vertex draw command buffer -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// #define nk_draw_foreach(cmd,ctx, b) -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __cmd__ | `nk_draw_command`iterator set to NULL -/// __buf__ | Must point to an previously by `nk_convert` filled out vertex draw command buffer -/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame -*/ -#define nk_draw_foreach(cmd,ctx, b) for((cmd)=nk__draw_begin(ctx, b); (cmd)!=0; (cmd)=nk__draw_next(cmd, b, ctx)) -#endif -/* ============================================================================= - * - * WINDOW - * - * ============================================================================= -/// ### Window -/// Windows are the main persistent state used inside nuklear and are life time -/// controlled by simply "retouching" (i.e. calling) each window each frame. -/// All widgets inside nuklear can only be added inside the function pair `nk_begin_xxx` -/// and `nk_end`. Calling any widgets outside these two functions will result in an -/// assert in debug or no state change in release mode.

-/// -/// Each window holds frame persistent state like position, size, flags, state tables, -/// and some garbage collected internal persistent widget state. Each window -/// is linked into a window stack list which determines the drawing and overlapping -/// order. The topmost window thereby is the currently active window.

-/// -/// To change window position inside the stack occurs either automatically by -/// user input by being clicked on or programmatically by calling `nk_window_focus`. -/// Windows by default are visible unless explicitly being defined with flag -/// `NK_WINDOW_HIDDEN`, the user clicked the close button on windows with flag -/// `NK_WINDOW_CLOSABLE` or if a window was explicitly hidden by calling -/// `nk_window_show`. To explicitly close and destroy a window call `nk_window_close`.

-/// -/// #### Usage -/// To create and keep a window you have to call one of the two `nk_begin_xxx` -/// functions to start window declarations and `nk_end` at the end. Furthermore it -/// is recommended to check the return value of `nk_begin_xxx` and only process -/// widgets inside the window if the value is not 0. Either way you have to call -/// `nk_end` at the end of window declarations. Furthermore, do not attempt to -/// nest `nk_begin_xxx` calls which will hopefully result in an assert or if not -/// in a segmentation fault. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// if (nk_begin_xxx(...) { -/// // [... widgets ...] -/// } -/// nk_end(ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// In the grand concept window and widget declarations need to occur after input -/// handling and before drawing to screen. Not doing so can result in higher -/// latency or at worst invalid behavior. Furthermore make sure that `nk_clear` -/// is called at the end of the frame. While nuklear's default platform backends -/// already call `nk_clear` for you if you write your own backend not calling -/// `nk_clear` can cause asserts or even worse undefined behavior. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_context ctx; -/// nk_init_xxx(&ctx, ...); -/// while (1) { -/// Event evt; -/// nk_input_begin(&ctx); -/// while (GetEvent(&evt)) { -/// if (evt.type == MOUSE_MOVE) -/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y); -/// else if (evt.type == [...]) { -/// nk_input_xxx(...); -/// } -/// } -/// nk_input_end(&ctx); -/// -/// if (nk_begin_xxx(...) { -/// //[...] -/// } -/// nk_end(ctx); -/// -/// const struct nk_command *cmd = 0; -/// nk_foreach(cmd, &ctx) { -/// case NK_COMMAND_LINE: -/// your_draw_line_function(...) -/// break; -/// case NK_COMMAND_RECT -/// your_draw_rect_function(...) -/// break; -/// case //...: -/// //[...] -/// } -/// nk_clear(&ctx); -/// } -/// nk_free(&ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// #### Reference -/// Function | Description -/// ------------------------------------|---------------------------------------- -/// nk_begin | Starts a new window; needs to be called every frame for every window (unless hidden) or otherwise the window gets removed -/// nk_begin_titled | Extended window start with separated title and identifier to allow multiple windows with same name but not title -/// nk_end | Needs to be called at the end of the window building process to process scaling, scrollbars and general cleanup -// -/// nk_window_find | Finds and returns the window with give name -/// nk_window_get_bounds | Returns a rectangle with screen position and size of the currently processed window. -/// nk_window_get_position | Returns the position of the currently processed window -/// nk_window_get_size | Returns the size with width and height of the currently processed window -/// nk_window_get_width | Returns the width of the currently processed window -/// nk_window_get_height | Returns the height of the currently processed window -/// nk_window_get_panel | Returns the underlying panel which contains all processing state of the current window -/// nk_window_get_content_region | Returns the position and size of the currently visible and non-clipped space inside the currently processed window -/// nk_window_get_content_region_min | Returns the upper rectangle position of the currently visible and non-clipped space inside the currently processed window -/// nk_window_get_content_region_max | Returns the upper rectangle position of the currently visible and non-clipped space inside the currently processed window -/// nk_window_get_content_region_size | Returns the size of the currently visible and non-clipped space inside the currently processed window -/// nk_window_get_canvas | Returns the draw command buffer. Can be used to draw custom widgets -/// nk_window_get_scroll | Gets the scroll offset of the current window -/// nk_window_has_focus | Returns if the currently processed window is currently active -/// nk_window_is_collapsed | Returns if the window with given name is currently minimized/collapsed -/// nk_window_is_closed | Returns if the currently processed window was closed -/// nk_window_is_hidden | Returns if the currently processed window was hidden -/// nk_window_is_active | Same as nk_window_has_focus for some reason -/// nk_window_is_hovered | Returns if the currently processed window is currently being hovered by mouse -/// nk_window_is_any_hovered | Return if any window currently hovered -/// nk_item_is_any_active | Returns if any window or widgets is currently hovered or active -// -/// nk_window_set_bounds | Updates position and size of the currently processed window -/// nk_window_set_position | Updates position of the currently process window -/// nk_window_set_size | Updates the size of the currently processed window -/// nk_window_set_focus | Set the currently processed window as active window -/// nk_window_set_scroll | Sets the scroll offset of the current window -// -/// nk_window_close | Closes the window with given window name which deletes the window at the end of the frame -/// nk_window_collapse | Collapses the window with given window name -/// nk_window_collapse_if | Collapses the window with given window name if the given condition was met -/// nk_window_show | Hides a visible or reshows a hidden window -/// nk_window_show_if | Hides/shows a window depending on condition -*/ -/* -/// #### nk_panel_flags -/// Flag | Description -/// ----------------------------|---------------------------------------- -/// NK_WINDOW_BORDER | Draws a border around the window to visually separate window from the background -/// NK_WINDOW_MOVABLE | The movable flag indicates that a window can be moved by user input or by dragging the window header -/// NK_WINDOW_SCALABLE | The scalable flag indicates that a window can be scaled by user input by dragging a scaler icon at the button of the window -/// NK_WINDOW_CLOSABLE | Adds a closable icon into the header -/// NK_WINDOW_MINIMIZABLE | Adds a minimize icon into the header -/// NK_WINDOW_NO_SCROLLBAR | Removes the scrollbar from the window -/// NK_WINDOW_TITLE | Forces a header at the top at the window showing the title -/// NK_WINDOW_SCROLL_AUTO_HIDE | Automatically hides the window scrollbar if no user interaction: also requires delta time in `nk_context` to be set each frame -/// NK_WINDOW_BACKGROUND | Always keep window in the background -/// NK_WINDOW_SCALE_LEFT | Puts window scaler in the left-bottom corner instead right-bottom -/// NK_WINDOW_NO_INPUT | Prevents window of scaling, moving or getting focus -/// -/// #### nk_collapse_states -/// State | Description -/// ----------------|----------------------------------------------------------- -/// __NK_MINIMIZED__| UI section is collased and not visibile until maximized -/// __NK_MAXIMIZED__| UI section is extended and visibile until minimized -///

-*/ -enum nk_panel_flags { - NK_WINDOW_BORDER = NK_FLAG(0), - NK_WINDOW_MOVABLE = NK_FLAG(1), - NK_WINDOW_SCALABLE = NK_FLAG(2), - NK_WINDOW_CLOSABLE = NK_FLAG(3), - NK_WINDOW_MINIMIZABLE = NK_FLAG(4), - NK_WINDOW_NO_SCROLLBAR = NK_FLAG(5), - NK_WINDOW_TITLE = NK_FLAG(6), - NK_WINDOW_SCROLL_AUTO_HIDE = NK_FLAG(7), - NK_WINDOW_BACKGROUND = NK_FLAG(8), - NK_WINDOW_SCALE_LEFT = NK_FLAG(9), - NK_WINDOW_NO_INPUT = NK_FLAG(10) -}; -/*/// #### nk_begin -/// Starts a new window; needs to be called every frame for every -/// window (unless hidden) or otherwise the window gets removed -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// int nk_begin(struct nk_context *ctx, const char *title, struct nk_rect bounds, nk_flags flags); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __title__ | Window title and identifier. Needs to be persistent over frames to identify the window -/// __bounds__ | Initial position and window size. However if you do not define `NK_WINDOW_SCALABLE` or `NK_WINDOW_MOVABLE` you can set window position and size every frame -/// __flags__ | Window flags defined in the nk_panel_flags section with a number of different window behaviors -/// -/// Returns `true(1)` if the window can be filled up with widgets from this point -/// until `nk_end` or `false(0)` otherwise for example if minimized -*/ -NK_API int nk_begin(struct nk_context *ctx, const char *title, struct nk_rect bounds, nk_flags flags); -/*/// #### nk_begin_titled -/// Extended window start with separated title and identifier to allow multiple -/// windows with same title but not name -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// int nk_begin_titled(struct nk_context *ctx, const char *name, const char *title, struct nk_rect bounds, nk_flags flags); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Window identifier. Needs to be persistent over frames to identify the window -/// __title__ | Window title displayed inside header if flag `NK_WINDOW_TITLE` or either `NK_WINDOW_CLOSABLE` or `NK_WINDOW_MINIMIZED` was set -/// __bounds__ | Initial position and window size. However if you do not define `NK_WINDOW_SCALABLE` or `NK_WINDOW_MOVABLE` you can set window position and size every frame -/// __flags__ | Window flags defined in the nk_panel_flags section with a number of different window behaviors -/// -/// Returns `true(1)` if the window can be filled up with widgets from this point -/// until `nk_end` or `false(0)` otherwise for example if minimized -*/ -NK_API int nk_begin_titled(struct nk_context *ctx, const char *name, const char *title, struct nk_rect bounds, nk_flags flags); -/*/// #### nk_end -/// Needs to be called at the end of the window building process to process scaling, scrollbars and general cleanup. -/// All widget calls after this functions will result in asserts or no state changes -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_end(struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -*/ -NK_API void nk_end(struct nk_context *ctx); -/*/// #### nk_window_find -/// Finds and returns a window from passed name -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_window *nk_window_find(struct nk_context *ctx, const char *name); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Window identifier -/// -/// Returns a `nk_window` struct pointing to the identified window or NULL if -/// no window with the given name was found -*/ -NK_API struct nk_window *nk_window_find(struct nk_context *ctx, const char *name); -/*/// #### nk_window_get_bounds -/// Returns a rectangle with screen position and size of the currently processed window -/// -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_rect nk_window_get_bounds(const struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns a `nk_rect` struct with window upper left window position and size -*/ -NK_API struct nk_rect nk_window_get_bounds(const struct nk_context *ctx); -/*/// #### nk_window_get_position -/// Returns the position of the currently processed window. -/// -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_vec2 nk_window_get_position(const struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns a `nk_vec2` struct with window upper left position -*/ -NK_API struct nk_vec2 nk_window_get_position(const struct nk_context *ctx); -/*/// #### nk_window_get_size -/// Returns the size with width and height of the currently processed window. -/// -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_vec2 nk_window_get_size(const struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns a `nk_vec2` struct with window width and height -*/ -NK_API struct nk_vec2 nk_window_get_size(const struct nk_context*); -/*/// #### nk_window_get_width -/// Returns the width of the currently processed window. -/// -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// float nk_window_get_width(const struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns the current window width -*/ -NK_API float nk_window_get_width(const struct nk_context*); -/*/// #### nk_window_get_height -/// Returns the height of the currently processed window. -/// -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// float nk_window_get_height(const struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns the current window height -*/ -NK_API float nk_window_get_height(const struct nk_context*); -/*/// #### nk_window_get_panel -/// Returns the underlying panel which contains all processing state of the current window. -/// -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// !!! WARNING -/// Do not keep the returned panel pointer around, it is only valid until `nk_end` -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_panel* nk_window_get_panel(struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns a pointer to window internal `nk_panel` state. -*/ -NK_API struct nk_panel* nk_window_get_panel(struct nk_context*); -/*/// #### nk_window_get_content_region -/// Returns the position and size of the currently visible and non-clipped space -/// inside the currently processed window. -/// -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_rect nk_window_get_content_region(struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns `nk_rect` struct with screen position and size (no scrollbar offset) -/// of the visible space inside the current window -*/ -NK_API struct nk_rect nk_window_get_content_region(struct nk_context*); -/*/// #### nk_window_get_content_region_min -/// Returns the upper left position of the currently visible and non-clipped -/// space inside the currently processed window. -/// -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_vec2 nk_window_get_content_region_min(struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// returns `nk_vec2` struct with upper left screen position (no scrollbar offset) -/// of the visible space inside the current window -*/ -NK_API struct nk_vec2 nk_window_get_content_region_min(struct nk_context*); -/*/// #### nk_window_get_content_region_max -/// Returns the lower right screen position of the currently visible and -/// non-clipped space inside the currently processed window. -/// -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_vec2 nk_window_get_content_region_max(struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns `nk_vec2` struct with lower right screen position (no scrollbar offset) -/// of the visible space inside the current window -*/ -NK_API struct nk_vec2 nk_window_get_content_region_max(struct nk_context*); -/*/// #### nk_window_get_content_region_size -/// Returns the size of the currently visible and non-clipped space inside the -/// currently processed window -/// -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_vec2 nk_window_get_content_region_size(struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns `nk_vec2` struct with size the visible space inside the current window -*/ -NK_API struct nk_vec2 nk_window_get_content_region_size(struct nk_context*); -/*/// #### nk_window_get_canvas -/// Returns the draw command buffer. Can be used to draw custom widgets -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// !!! WARNING -/// Do not keep the returned command buffer pointer around it is only valid until `nk_end` -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_command_buffer* nk_window_get_canvas(struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns a pointer to window internal `nk_command_buffer` struct used as -/// drawing canvas. Can be used to do custom drawing. -*/ -NK_API struct nk_command_buffer* nk_window_get_canvas(struct nk_context*); -/*/// #### nk_window_get_scroll -/// Gets the scroll offset for the current window -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_window_get_scroll(struct nk_context *ctx, nk_uint *offset_x, nk_uint *offset_y); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// -------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __offset_x__ | A pointer to the x offset output (or NULL to ignore) -/// __offset_y__ | A pointer to the y offset output (or NULL to ignore) -*/ -NK_API void nk_window_get_scroll(struct nk_context*, nk_uint *offset_x, nk_uint *offset_y); -/*/// #### nk_window_has_focus -/// Returns if the currently processed window is currently active -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// int nk_window_has_focus(const struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns `false(0)` if current window is not active or `true(1)` if it is -*/ -NK_API int nk_window_has_focus(const struct nk_context*); -/*/// #### nk_window_is_hovered -/// Return if the current window is being hovered -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// int nk_window_is_hovered(struct nk_context *ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns `true(1)` if current window is hovered or `false(0)` otherwise -*/ -NK_API int nk_window_is_hovered(struct nk_context*); -/*/// #### nk_window_is_collapsed -/// Returns if the window with given name is currently minimized/collapsed -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// int nk_window_is_collapsed(struct nk_context *ctx, const char *name); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Identifier of window you want to check if it is collapsed -/// -/// Returns `true(1)` if current window is minimized and `false(0)` if window not -/// found or is not minimized -*/ -NK_API int nk_window_is_collapsed(struct nk_context *ctx, const char *name); -/*/// #### nk_window_is_closed -/// Returns if the window with given name was closed by calling `nk_close` -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// int nk_window_is_closed(struct nk_context *ctx, const char *name); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Identifier of window you want to check if it is closed -/// -/// Returns `true(1)` if current window was closed or `false(0)` window not found or not closed -*/ -NK_API int nk_window_is_closed(struct nk_context*, const char*); -/*/// #### nk_window_is_hidden -/// Returns if the window with given name is hidden -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// int nk_window_is_hidden(struct nk_context *ctx, const char *name); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Identifier of window you want to check if it is hidden -/// -/// Returns `true(1)` if current window is hidden or `false(0)` window not found or visible -*/ -NK_API int nk_window_is_hidden(struct nk_context*, const char*); -/*/// #### nk_window_is_active -/// Same as nk_window_has_focus for some reason -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// int nk_window_is_active(struct nk_context *ctx, const char *name); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Identifier of window you want to check if it is active -/// -/// Returns `true(1)` if current window is active or `false(0)` window not found or not active -*/ -NK_API int nk_window_is_active(struct nk_context*, const char*); -/*/// #### nk_window_is_any_hovered -/// Returns if the any window is being hovered -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// int nk_window_is_any_hovered(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns `true(1)` if any window is hovered or `false(0)` otherwise -*/ -NK_API int nk_window_is_any_hovered(struct nk_context*); -/*/// #### nk_item_is_any_active -/// Returns if the any window is being hovered or any widget is currently active. -/// Can be used to decide if input should be processed by UI or your specific input handling. -/// Example could be UI and 3D camera to move inside a 3D space. -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// int nk_item_is_any_active(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// -/// Returns `true(1)` if any window is hovered or any item is active or `false(0)` otherwise -*/ -NK_API int nk_item_is_any_active(struct nk_context*); -/*/// #### nk_window_set_bounds -/// Updates position and size of window with passed in name -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_window_set_bounds(struct nk_context*, const char *name, struct nk_rect bounds); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Identifier of the window to modify both position and size -/// __bounds__ | Must point to a `nk_rect` struct with the new position and size -*/ -NK_API void nk_window_set_bounds(struct nk_context*, const char *name, struct nk_rect bounds); -/*/// #### nk_window_set_position -/// Updates position of window with passed name -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_window_set_position(struct nk_context*, const char *name, struct nk_vec2 pos); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Identifier of the window to modify both position -/// __pos__ | Must point to a `nk_vec2` struct with the new position -*/ -NK_API void nk_window_set_position(struct nk_context*, const char *name, struct nk_vec2 pos); -/*/// #### nk_window_set_size -/// Updates size of window with passed in name -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_window_set_size(struct nk_context*, const char *name, struct nk_vec2); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Identifier of the window to modify both window size -/// __size__ | Must point to a `nk_vec2` struct with new window size -*/ -NK_API void nk_window_set_size(struct nk_context*, const char *name, struct nk_vec2); -/*/// #### nk_window_set_focus -/// Sets the window with given name as active -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_window_set_focus(struct nk_context*, const char *name); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Identifier of the window to set focus on -*/ -NK_API void nk_window_set_focus(struct nk_context*, const char *name); -/*/// #### nk_window_set_scroll -/// Sets the scroll offset for the current window -/// !!! WARNING -/// Only call this function between calls `nk_begin_xxx` and `nk_end` -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_window_set_scroll(struct nk_context *ctx, nk_uint offset_x, nk_uint offset_y); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// -------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __offset_x__ | The x offset to scroll to -/// __offset_y__ | The y offset to scroll to -*/ -NK_API void nk_window_set_scroll(struct nk_context*, nk_uint offset_x, nk_uint offset_y); -/*/// #### nk_window_close -/// Closes a window and marks it for being freed at the end of the frame -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_window_close(struct nk_context *ctx, const char *name); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Identifier of the window to close -*/ -NK_API void nk_window_close(struct nk_context *ctx, const char *name); -/*/// #### nk_window_collapse -/// Updates collapse state of a window with given name -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_window_collapse(struct nk_context*, const char *name, enum nk_collapse_states state); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Identifier of the window to close -/// __state__ | value out of nk_collapse_states section -*/ -NK_API void nk_window_collapse(struct nk_context*, const char *name, enum nk_collapse_states state); -/*/// #### nk_window_collapse_if -/// Updates collapse state of a window with given name if given condition is met -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_window_collapse_if(struct nk_context*, const char *name, enum nk_collapse_states, int cond); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Identifier of the window to either collapse or maximize -/// __state__ | value out of nk_collapse_states section the window should be put into -/// __cond__ | condition that has to be met to actually commit the collapse state change -*/ -NK_API void nk_window_collapse_if(struct nk_context*, const char *name, enum nk_collapse_states, int cond); -/*/// #### nk_window_show -/// updates visibility state of a window with given name -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_window_show(struct nk_context*, const char *name, enum nk_show_states); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Identifier of the window to either collapse or maximize -/// __state__ | state with either visible or hidden to modify the window with -*/ -NK_API void nk_window_show(struct nk_context*, const char *name, enum nk_show_states); -/*/// #### nk_window_show_if -/// Updates visibility state of a window with given name if a given condition is met -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_window_show_if(struct nk_context*, const char *name, enum nk_show_states, int cond); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __name__ | Identifier of the window to either hide or show -/// __state__ | state with either visible or hidden to modify the window with -/// __cond__ | condition that has to be met to actually commit the visbility state change -*/ -NK_API void nk_window_show_if(struct nk_context*, const char *name, enum nk_show_states, int cond); -/* ============================================================================= - * - * LAYOUT - * - * ============================================================================= -/// ### Layouting -/// Layouting in general describes placing widget inside a window with position and size. -/// While in this particular implementation there are five different APIs for layouting -/// each with different trade offs between control and ease of use.

-/// -/// All layouting methods in this library are based around the concept of a row. -/// A row has a height the window content grows by and a number of columns and each -/// layouting method specifies how each widget is placed inside the row. -/// After a row has been allocated by calling a layouting functions and then -/// filled with widgets will advance an internal pointer over the allocated row.

-/// -/// To actually define a layout you just call the appropriate layouting function -/// and each subsequent widget call will place the widget as specified. Important -/// here is that if you define more widgets then columns defined inside the layout -/// functions it will allocate the next row without you having to make another layouting

-/// call. -/// -/// Biggest limitation with using all these APIs outside the `nk_layout_space_xxx` API -/// is that you have to define the row height for each. However the row height -/// often depends on the height of the font.

-/// -/// To fix that internally nuklear uses a minimum row height that is set to the -/// height plus padding of currently active font and overwrites the row height -/// value if zero.

-/// -/// If you manually want to change the minimum row height then -/// use nk_layout_set_min_row_height, and use nk_layout_reset_min_row_height to -/// reset it back to be derived from font height.

-/// -/// Also if you change the font in nuklear it will automatically change the minimum -/// row height for you and. This means if you change the font but still want -/// a minimum row height smaller than the font you have to repush your value.

-/// -/// For actually more advanced UI I would even recommend using the `nk_layout_space_xxx` -/// layouting method in combination with a cassowary constraint solver (there are -/// some versions on github with permissive license model) to take over all control over widget -/// layouting yourself. However for quick and dirty layouting using all the other layouting -/// functions should be fine. -/// -/// #### Usage -/// 1. __nk_layout_row_dynamic__

-/// The easiest layouting function is `nk_layout_row_dynamic`. It provides each -/// widgets with same horizontal space inside the row and dynamically grows -/// if the owning window grows in width. So the number of columns dictates -/// the size of each widget dynamically by formula: -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// widget_width = (window_width - padding - spacing) * (1/colum_count) -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Just like all other layouting APIs if you define more widget than columns this -/// library will allocate a new row and keep all layouting parameters previously -/// defined. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// if (nk_begin_xxx(...) { -/// // first row with height: 30 composed of two widgets -/// nk_layout_row_dynamic(&ctx, 30, 2); -/// nk_widget(...); -/// nk_widget(...); -/// // -/// // second row with same parameter as defined above -/// nk_widget(...); -/// nk_widget(...); -/// // -/// // third row uses 0 for height which will use auto layouting -/// nk_layout_row_dynamic(&ctx, 0, 2); -/// nk_widget(...); -/// nk_widget(...); -/// } -/// nk_end(...); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// 2. __nk_layout_row_static__

-/// Another easy layouting function is `nk_layout_row_static`. It provides each -/// widget with same horizontal pixel width inside the row and does not grow -/// if the owning window scales smaller or bigger. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// if (nk_begin_xxx(...) { -/// // first row with height: 30 composed of two widgets with width: 80 -/// nk_layout_row_static(&ctx, 30, 80, 2); -/// nk_widget(...); -/// nk_widget(...); -/// // -/// // second row with same parameter as defined above -/// nk_widget(...); -/// nk_widget(...); -/// // -/// // third row uses 0 for height which will use auto layouting -/// nk_layout_row_static(&ctx, 0, 80, 2); -/// nk_widget(...); -/// nk_widget(...); -/// } -/// nk_end(...); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// 3. __nk_layout_row_xxx__

-/// A little bit more advanced layouting API are functions `nk_layout_row_begin`, -/// `nk_layout_row_push` and `nk_layout_row_end`. They allow to directly -/// specify each column pixel or window ratio in a row. It supports either -/// directly setting per column pixel width or widget window ratio but not -/// both. Furthermore it is a immediate mode API so each value is directly -/// pushed before calling a widget. Therefore the layout is not automatically -/// repeating like the last two layouting functions. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// if (nk_begin_xxx(...) { -/// // first row with height: 25 composed of two widgets with width 60 and 40 -/// nk_layout_row_begin(ctx, NK_STATIC, 25, 2); -/// nk_layout_row_push(ctx, 60); -/// nk_widget(...); -/// nk_layout_row_push(ctx, 40); -/// nk_widget(...); -/// nk_layout_row_end(ctx); -/// // -/// // second row with height: 25 composed of two widgets with window ratio 0.25 and 0.75 -/// nk_layout_row_begin(ctx, NK_DYNAMIC, 25, 2); -/// nk_layout_row_push(ctx, 0.25f); -/// nk_widget(...); -/// nk_layout_row_push(ctx, 0.75f); -/// nk_widget(...); -/// nk_layout_row_end(ctx); -/// // -/// // third row with auto generated height: composed of two widgets with window ratio 0.25 and 0.75 -/// nk_layout_row_begin(ctx, NK_DYNAMIC, 0, 2); -/// nk_layout_row_push(ctx, 0.25f); -/// nk_widget(...); -/// nk_layout_row_push(ctx, 0.75f); -/// nk_widget(...); -/// nk_layout_row_end(ctx); -/// } -/// nk_end(...); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// 4. __nk_layout_row__

-/// The array counterpart to API nk_layout_row_xxx is the single nk_layout_row -/// functions. Instead of pushing either pixel or window ratio for every widget -/// it allows to define it by array. The trade of for less control is that -/// `nk_layout_row` is automatically repeating. Otherwise the behavior is the -/// same. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// if (nk_begin_xxx(...) { -/// // two rows with height: 30 composed of two widgets with width 60 and 40 -/// const float size[] = {60,40}; -/// nk_layout_row(ctx, NK_STATIC, 30, 2, ratio); -/// nk_widget(...); -/// nk_widget(...); -/// nk_widget(...); -/// nk_widget(...); -/// // -/// // two rows with height: 30 composed of two widgets with window ratio 0.25 and 0.75 -/// const float ratio[] = {0.25, 0.75}; -/// nk_layout_row(ctx, NK_DYNAMIC, 30, 2, ratio); -/// nk_widget(...); -/// nk_widget(...); -/// nk_widget(...); -/// nk_widget(...); -/// // -/// // two rows with auto generated height composed of two widgets with window ratio 0.25 and 0.75 -/// const float ratio[] = {0.25, 0.75}; -/// nk_layout_row(ctx, NK_DYNAMIC, 30, 2, ratio); -/// nk_widget(...); -/// nk_widget(...); -/// nk_widget(...); -/// nk_widget(...); -/// } -/// nk_end(...); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// 5. __nk_layout_row_template_xxx__

-/// The most complex and second most flexible API is a simplified flexbox version without -/// line wrapping and weights for dynamic widgets. It is an immediate mode API but -/// unlike `nk_layout_row_xxx` it has auto repeat behavior and needs to be called -/// before calling the templated widgets. -/// The row template layout has three different per widget size specifier. The first -/// one is the `nk_layout_row_template_push_static` with fixed widget pixel width. -/// They do not grow if the row grows and will always stay the same. -/// The second size specifier is `nk_layout_row_template_push_variable` -/// which defines a minimum widget size but it also can grow if more space is available -/// not taken by other widgets. -/// Finally there are dynamic widgets with `nk_layout_row_template_push_dynamic` -/// which are completely flexible and unlike variable widgets can even shrink -/// to zero if not enough space is provided. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// if (nk_begin_xxx(...) { -/// // two rows with height: 30 composed of three widgets -/// nk_layout_row_template_begin(ctx, 30); -/// nk_layout_row_template_push_dynamic(ctx); -/// nk_layout_row_template_push_variable(ctx, 80); -/// nk_layout_row_template_push_static(ctx, 80); -/// nk_layout_row_template_end(ctx); -/// // -/// // first row -/// nk_widget(...); // dynamic widget can go to zero if not enough space -/// nk_widget(...); // variable widget with min 80 pixel but can grow bigger if enough space -/// nk_widget(...); // static widget with fixed 80 pixel width -/// // -/// // second row same layout -/// nk_widget(...); -/// nk_widget(...); -/// nk_widget(...); -/// } -/// nk_end(...); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// 6. __nk_layout_space_xxx__

-/// Finally the most flexible API directly allows you to place widgets inside the -/// window. The space layout API is an immediate mode API which does not support -/// row auto repeat and directly sets position and size of a widget. Position -/// and size hereby can be either specified as ratio of allocated space or -/// allocated space local position and pixel size. Since this API is quite -/// powerful there are a number of utility functions to get the available space -/// and convert between local allocated space and screen space. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// if (nk_begin_xxx(...) { -/// // static row with height: 500 (you can set column count to INT_MAX if you don't want to be bothered) -/// nk_layout_space_begin(ctx, NK_STATIC, 500, INT_MAX); -/// nk_layout_space_push(ctx, nk_rect(0,0,150,200)); -/// nk_widget(...); -/// nk_layout_space_push(ctx, nk_rect(200,200,100,200)); -/// nk_widget(...); -/// nk_layout_space_end(ctx); -/// // -/// // dynamic row with height: 500 (you can set column count to INT_MAX if you don't want to be bothered) -/// nk_layout_space_begin(ctx, NK_DYNAMIC, 500, INT_MAX); -/// nk_layout_space_push(ctx, nk_rect(0.5,0.5,0.1,0.1)); -/// nk_widget(...); -/// nk_layout_space_push(ctx, nk_rect(0.7,0.6,0.1,0.1)); -/// nk_widget(...); -/// } -/// nk_end(...); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// #### Reference -/// Function | Description -/// ----------------------------------------|------------------------------------ -/// nk_layout_set_min_row_height | Set the currently used minimum row height to a specified value -/// nk_layout_reset_min_row_height | Resets the currently used minimum row height to font height -/// nk_layout_widget_bounds | Calculates current width a static layout row can fit inside a window -/// nk_layout_ratio_from_pixel | Utility functions to calculate window ratio from pixel size -// -/// nk_layout_row_dynamic | Current layout is divided into n same sized growing columns -/// nk_layout_row_static | Current layout is divided into n same fixed sized columns -/// nk_layout_row_begin | Starts a new row with given height and number of columns -/// nk_layout_row_push | Pushes another column with given size or window ratio -/// nk_layout_row_end | Finished previously started row -/// nk_layout_row | Specifies row columns in array as either window ratio or size -// -/// nk_layout_row_template_begin | Begins the row template declaration -/// nk_layout_row_template_push_dynamic | Adds a dynamic column that dynamically grows and can go to zero if not enough space -/// nk_layout_row_template_push_variable | Adds a variable column that dynamically grows but does not shrink below specified pixel width -/// nk_layout_row_template_push_static | Adds a static column that does not grow and will always have the same size -/// nk_layout_row_template_end | Marks the end of the row template -// -/// nk_layout_space_begin | Begins a new layouting space that allows to specify each widgets position and size -/// nk_layout_space_push | Pushes position and size of the next widget in own coordinate space either as pixel or ratio -/// nk_layout_space_end | Marks the end of the layouting space -// -/// nk_layout_space_bounds | Callable after nk_layout_space_begin and returns total space allocated -/// nk_layout_space_to_screen | Converts vector from nk_layout_space coordinate space into screen space -/// nk_layout_space_to_local | Converts vector from screen space into nk_layout_space coordinates -/// nk_layout_space_rect_to_screen | Converts rectangle from nk_layout_space coordinate space into screen space -/// nk_layout_space_rect_to_local | Converts rectangle from screen space into nk_layout_space coordinates -*/ -/*/// #### nk_layout_set_min_row_height -/// Sets the currently used minimum row height. -/// !!! WARNING -/// The passed height needs to include both your preferred row height -/// as well as padding. No internal padding is added. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_set_min_row_height(struct nk_context*, float height); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -/// __height__ | New minimum row height to be used for auto generating the row height -*/ -NK_API void nk_layout_set_min_row_height(struct nk_context*, float height); -/*/// #### nk_layout_reset_min_row_height -/// Reset the currently used minimum row height back to `font_height + text_padding + padding` -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_reset_min_row_height(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -*/ -NK_API void nk_layout_reset_min_row_height(struct nk_context*); -/*/// #### nk_layout_widget_bounds -/// Returns the width of the next row allocate by one of the layouting functions -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_rect nk_layout_widget_bounds(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -/// -/// Return `nk_rect` with both position and size of the next row -*/ -NK_API struct nk_rect nk_layout_widget_bounds(struct nk_context*); -/*/// #### nk_layout_ratio_from_pixel -/// Utility functions to calculate window ratio from pixel size -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// float nk_layout_ratio_from_pixel(struct nk_context*, float pixel_width); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -/// __pixel__ | Pixel_width to convert to window ratio -/// -/// Returns `nk_rect` with both position and size of the next row -*/ -NK_API float nk_layout_ratio_from_pixel(struct nk_context*, float pixel_width); -/*/// #### nk_layout_row_dynamic -/// Sets current row layout to share horizontal space -/// between @cols number of widgets evenly. Once called all subsequent widget -/// calls greater than @cols will allocate a new row with same layout. -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -/// __height__ | Holds height of each widget in row or zero for auto layouting -/// __columns__ | Number of widget inside row -*/ -NK_API void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols); -/*/// #### nk_layout_row_static -/// Sets current row layout to fill @cols number of widgets -/// in row with same @item_width horizontal size. Once called all subsequent widget -/// calls greater than @cols will allocate a new row with same layout. -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_row_static(struct nk_context *ctx, float height, int item_width, int cols); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -/// __height__ | Holds height of each widget in row or zero for auto layouting -/// __width__ | Holds pixel width of each widget in the row -/// __columns__ | Number of widget inside row -*/ -NK_API void nk_layout_row_static(struct nk_context *ctx, float height, int item_width, int cols); -/*/// #### nk_layout_row_begin -/// Starts a new dynamic or fixed row with given height and columns. -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_row_begin(struct nk_context *ctx, enum nk_layout_format fmt, float row_height, int cols); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -/// __fmt__ | either `NK_DYNAMIC` for window ratio or `NK_STATIC` for fixed size columns -/// __height__ | holds height of each widget in row or zero for auto layouting -/// __columns__ | Number of widget inside row -*/ -NK_API void nk_layout_row_begin(struct nk_context *ctx, enum nk_layout_format fmt, float row_height, int cols); -/*/// #### nk_layout_row_push -/// Specifies either window ratio or width of a single column -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_row_push(struct nk_context*, float value); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -/// __value__ | either a window ratio or fixed width depending on @fmt in previous `nk_layout_row_begin` call -*/ -NK_API void nk_layout_row_push(struct nk_context*, float value); -/*/// #### nk_layout_row_end -/// Finished previously started row -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_row_end(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -*/ -NK_API void nk_layout_row_end(struct nk_context*); -/*/// #### nk_layout_row -/// Specifies row columns in array as either window ratio or size -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_row(struct nk_context*, enum nk_layout_format, float height, int cols, const float *ratio); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -/// __fmt__ | Either `NK_DYNAMIC` for window ratio or `NK_STATIC` for fixed size columns -/// __height__ | Holds height of each widget in row or zero for auto layouting -/// __columns__ | Number of widget inside row -*/ -NK_API void nk_layout_row(struct nk_context*, enum nk_layout_format, float height, int cols, const float *ratio); -/*/// #### nk_layout_row_template_begin -/// Begins the row template declaration -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_row_template_begin(struct nk_context*, float row_height); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -/// __height__ | Holds height of each widget in row or zero for auto layouting -*/ -NK_API void nk_layout_row_template_begin(struct nk_context*, float row_height); -/*/// #### nk_layout_row_template_push_dynamic -/// Adds a dynamic column that dynamically grows and can go to zero if not enough space -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_row_template_push_dynamic(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -/// __height__ | Holds height of each widget in row or zero for auto layouting -*/ -NK_API void nk_layout_row_template_push_dynamic(struct nk_context*); -/*/// #### nk_layout_row_template_push_variable -/// Adds a variable column that dynamically grows but does not shrink below specified pixel width -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_row_template_push_variable(struct nk_context*, float min_width); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -/// __width__ | Holds the minimum pixel width the next column must always be -*/ -NK_API void nk_layout_row_template_push_variable(struct nk_context*, float min_width); -/*/// #### nk_layout_row_template_push_static -/// Adds a static column that does not grow and will always have the same size -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_row_template_push_static(struct nk_context*, float width); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -/// __width__ | Holds the absolute pixel width value the next column must be -*/ -NK_API void nk_layout_row_template_push_static(struct nk_context*, float width); -/*/// #### nk_layout_row_template_end -/// Marks the end of the row template -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_row_template_end(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -*/ -NK_API void nk_layout_row_template_end(struct nk_context*); -/*/// #### nk_layout_space_begin -/// Begins a new layouting space that allows to specify each widgets position and size. -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_space_begin(struct nk_context*, enum nk_layout_format, float height, int widget_count); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` -/// __fmt__ | Either `NK_DYNAMIC` for window ratio or `NK_STATIC` for fixed size columns -/// __height__ | Holds height of each widget in row or zero for auto layouting -/// __columns__ | Number of widgets inside row -*/ -NK_API void nk_layout_space_begin(struct nk_context*, enum nk_layout_format, float height, int widget_count); -/*/// #### nk_layout_space_push -/// Pushes position and size of the next widget in own coordinate space either as pixel or ratio -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_space_push(struct nk_context *ctx, struct nk_rect bounds); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` -/// __bounds__ | Position and size in laoyut space local coordinates -*/ -NK_API void nk_layout_space_push(struct nk_context*, struct nk_rect bounds); -/*/// #### nk_layout_space_end -/// Marks the end of the layout space -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_layout_space_end(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` -*/ -NK_API void nk_layout_space_end(struct nk_context*); -/*/// #### nk_layout_space_bounds -/// Utility function to calculate total space allocated for `nk_layout_space` -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_rect nk_layout_space_bounds(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` -/// -/// Returns `nk_rect` holding the total space allocated -*/ -NK_API struct nk_rect nk_layout_space_bounds(struct nk_context*); -/*/// #### nk_layout_space_to_screen -/// Converts vector from nk_layout_space coordinate space into screen space -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_vec2 nk_layout_space_to_screen(struct nk_context*, struct nk_vec2); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` -/// __vec__ | Position to convert from layout space into screen coordinate space -/// -/// Returns transformed `nk_vec2` in screen space coordinates -*/ -NK_API struct nk_vec2 nk_layout_space_to_screen(struct nk_context*, struct nk_vec2); -/*/// #### nk_layout_space_to_local -/// Converts vector from layout space into screen space -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_vec2 nk_layout_space_to_local(struct nk_context*, struct nk_vec2); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` -/// __vec__ | Position to convert from screen space into layout coordinate space -/// -/// Returns transformed `nk_vec2` in layout space coordinates -*/ -NK_API struct nk_vec2 nk_layout_space_to_local(struct nk_context*, struct nk_vec2); -/*/// #### nk_layout_space_rect_to_screen -/// Converts rectangle from screen space into layout space -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_rect nk_layout_space_rect_to_screen(struct nk_context*, struct nk_rect); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` -/// __bounds__ | Rectangle to convert from layout space into screen space -/// -/// Returns transformed `nk_rect` in screen space coordinates -*/ -NK_API struct nk_rect nk_layout_space_rect_to_screen(struct nk_context*, struct nk_rect); -/*/// #### nk_layout_space_rect_to_local -/// Converts rectangle from layout space into screen space -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_rect nk_layout_space_rect_to_local(struct nk_context*, struct nk_rect); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` -/// __bounds__ | Rectangle to convert from layout space into screen space -/// -/// Returns transformed `nk_rect` in layout space coordinates -*/ -NK_API struct nk_rect nk_layout_space_rect_to_local(struct nk_context*, struct nk_rect); -/* ============================================================================= - * - * GROUP - * - * ============================================================================= -/// ### Groups -/// Groups are basically windows inside windows. They allow to subdivide space -/// in a window to layout widgets as a group. Almost all more complex widget -/// layouting requirements can be solved using groups and basic layouting -/// fuctionality. Groups just like windows are identified by an unique name and -/// internally keep track of scrollbar offsets by default. However additional -/// versions are provided to directly manage the scrollbar. -/// -/// #### Usage -/// To create a group you have to call one of the three `nk_group_begin_xxx` -/// functions to start group declarations and `nk_group_end` at the end. Furthermore it -/// is required to check the return value of `nk_group_begin_xxx` and only process -/// widgets inside the window if the value is not 0. -/// Nesting groups is possible and even encouraged since many layouting schemes -/// can only be achieved by nesting. Groups, unlike windows, need `nk_group_end` -/// to be only called if the corosponding `nk_group_begin_xxx` call does not return 0: -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// if (nk_group_begin_xxx(ctx, ...) { -/// // [... widgets ...] -/// nk_group_end(ctx); -/// } -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// In the grand concept groups can be called after starting a window -/// with `nk_begin_xxx` and before calling `nk_end`: -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// struct nk_context ctx; -/// nk_init_xxx(&ctx, ...); -/// while (1) { -/// // Input -/// Event evt; -/// nk_input_begin(&ctx); -/// while (GetEvent(&evt)) { -/// if (evt.type == MOUSE_MOVE) -/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y); -/// else if (evt.type == [...]) { -/// nk_input_xxx(...); -/// } -/// } -/// nk_input_end(&ctx); -/// // -/// // Window -/// if (nk_begin_xxx(...) { -/// // [...widgets...] -/// nk_layout_row_dynamic(...); -/// if (nk_group_begin_xxx(ctx, ...) { -/// //[... widgets ...] -/// nk_group_end(ctx); -/// } -/// } -/// nk_end(ctx); -/// // -/// // Draw -/// const struct nk_command *cmd = 0; -/// nk_foreach(cmd, &ctx) { -/// switch (cmd->type) { -/// case NK_COMMAND_LINE: -/// your_draw_line_function(...) -/// break; -/// case NK_COMMAND_RECT -/// your_draw_rect_function(...) -/// break; -/// case ...: -/// // [...] -/// } -/// nk_clear(&ctx); -/// } -/// nk_free(&ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// #### Reference -/// Function | Description -/// --------------------------------|------------------------------------------- -/// nk_group_begin | Start a new group with internal scrollbar handling -/// nk_group_begin_titled | Start a new group with separeted name and title and internal scrollbar handling -/// nk_group_end | Ends a group. Should only be called if nk_group_begin returned non-zero -/// nk_group_scrolled_offset_begin | Start a new group with manual separated handling of scrollbar x- and y-offset -/// nk_group_scrolled_begin | Start a new group with manual scrollbar handling -/// nk_group_scrolled_end | Ends a group with manual scrollbar handling. Should only be called if nk_group_begin returned non-zero -/// nk_group_get_scroll | Gets the scroll offset for the given group -/// nk_group_set_scroll | Sets the scroll offset for the given group -*/ -/*/// #### nk_group_begin -/// Starts a new widget group. Requires a previous layouting function to specify a pos/size. -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// int nk_group_begin(struct nk_context*, const char *title, nk_flags); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __title__ | Must be an unique identifier for this group that is also used for the group header -/// __flags__ | Window flags defined in the nk_panel_flags section with a number of different group behaviors -/// -/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise -*/ -NK_API int nk_group_begin(struct nk_context*, const char *title, nk_flags); -/*/// #### nk_group_begin_titled -/// Starts a new widget group. Requires a previous layouting function to specify a pos/size. -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// int nk_group_begin_titled(struct nk_context*, const char *name, const char *title, nk_flags); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __id__ | Must be an unique identifier for this group -/// __title__ | Group header title -/// __flags__ | Window flags defined in the nk_panel_flags section with a number of different group behaviors -/// -/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise -*/ -NK_API int nk_group_begin_titled(struct nk_context*, const char *name, const char *title, nk_flags); -/*/// #### nk_group_end -/// Ends a widget group -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_group_end(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -*/ -NK_API void nk_group_end(struct nk_context*); -/*/// #### nk_group_scrolled_offset_begin -/// starts a new widget group. requires a previous layouting function to specify -/// a size. Does not keep track of scrollbar. -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// int nk_group_scrolled_offset_begin(struct nk_context*, nk_uint *x_offset, nk_uint *y_offset, const char *title, nk_flags flags); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __x_offset__| Scrollbar x-offset to offset all widgets inside the group horizontally. -/// __y_offset__| Scrollbar y-offset to offset all widgets inside the group vertically -/// __title__ | Window unique group title used to both identify and display in the group header -/// __flags__ | Window flags from the nk_panel_flags section -/// -/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise -*/ -NK_API int nk_group_scrolled_offset_begin(struct nk_context*, nk_uint *x_offset, nk_uint *y_offset, const char *title, nk_flags flags); -/*/// #### nk_group_scrolled_begin -/// Starts a new widget group. requires a previous -/// layouting function to specify a size. Does not keep track of scrollbar. -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// int nk_group_scrolled_begin(struct nk_context*, struct nk_scroll *off, const char *title, nk_flags); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __off__ | Both x- and y- scroll offset. Allows for manual scrollbar control -/// __title__ | Window unique group title used to both identify and display in the group header -/// __flags__ | Window flags from nk_panel_flags section -/// -/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise -*/ -NK_API int nk_group_scrolled_begin(struct nk_context*, struct nk_scroll *off, const char *title, nk_flags); -/*/// #### nk_group_scrolled_end -/// Ends a widget group after calling nk_group_scrolled_offset_begin or nk_group_scrolled_begin. -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_group_scrolled_end(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -*/ -NK_API void nk_group_scrolled_end(struct nk_context*); -/*/// #### nk_group_get_scroll -/// Gets the scroll position of the given group. -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_group_get_scroll(struct nk_context*, const char *id, nk_uint *x_offset, nk_uint *y_offset); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// -------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __id__ | The id of the group to get the scroll position of -/// __x_offset__ | A pointer to the x offset output (or NULL to ignore) -/// __y_offset__ | A pointer to the y offset output (or NULL to ignore) -*/ -NK_API void nk_group_get_scroll(struct nk_context*, const char *id, nk_uint *x_offset, nk_uint *y_offset); -/*/// #### nk_group_set_scroll -/// Sets the scroll position of the given group. -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_group_set_scroll(struct nk_context*, const char *id, nk_uint x_offset, nk_uint y_offset); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// -------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __id__ | The id of the group to scroll -/// __x_offset__ | The x offset to scroll to -/// __y_offset__ | The y offset to scroll to -*/ -NK_API void nk_group_set_scroll(struct nk_context*, const char *id, nk_uint x_offset, nk_uint y_offset); -/* ============================================================================= - * - * TREE - * - * ============================================================================= -/// ### Tree -/// Trees represent two different concept. First the concept of a collapsable -/// UI section that can be either in a hidden or visibile state. They allow the UI -/// user to selectively minimize the current set of visible UI to comprehend. -/// The second concept are tree widgets for visual UI representation of trees.

-/// -/// Trees thereby can be nested for tree representations and multiple nested -/// collapsable UI sections. All trees are started by calling of the -/// `nk_tree_xxx_push_tree` functions and ended by calling one of the -/// `nk_tree_xxx_pop_xxx()` functions. Each starting functions takes a title label -/// and optionally an image to be displayed and the initial collapse state from -/// the nk_collapse_states section.

-/// -/// The runtime state of the tree is either stored outside the library by the caller -/// or inside which requires a unique ID. The unique ID can either be generated -/// automatically from `__FILE__` and `__LINE__` with function `nk_tree_push`, -/// by `__FILE__` and a user provided ID generated for example by loop index with -/// function `nk_tree_push_id` or completely provided from outside by user with -/// function `nk_tree_push_hashed`. -/// -/// #### Usage -/// To create a tree you have to call one of the seven `nk_tree_xxx_push_xxx` -/// functions to start a collapsable UI section and `nk_tree_xxx_pop` to mark the -/// end. -/// Each starting function will either return `false(0)` if the tree is collapsed -/// or hidden and therefore does not need to be filled with content or `true(1)` -/// if visible and required to be filled. -/// -/// !!! Note -/// The tree header does not require and layouting function and instead -/// calculates a auto height based on the currently used font size -/// -/// The tree ending functions only need to be called if the tree content is -/// actually visible. So make sure the tree push function is guarded by `if` -/// and the pop call is only taken if the tree is visible. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// if (nk_tree_push(ctx, NK_TREE_TAB, "Tree", NK_MINIMIZED)) { -/// nk_layout_row_dynamic(...); -/// nk_widget(...); -/// nk_tree_pop(ctx); -/// } -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// #### Reference -/// Function | Description -/// ----------------------------|------------------------------------------- -/// nk_tree_push | Start a collapsable UI section with internal state management -/// nk_tree_push_id | Start a collapsable UI section with internal state management callable in a look -/// nk_tree_push_hashed | Start a collapsable UI section with internal state management with full control over internal unique ID use to store state -/// nk_tree_image_push | Start a collapsable UI section with image and label header -/// nk_tree_image_push_id | Start a collapsable UI section with image and label header and internal state management callable in a look -/// nk_tree_image_push_hashed | Start a collapsable UI section with image and label header and internal state management with full control over internal unique ID use to store state -/// nk_tree_pop | Ends a collapsable UI section -// -/// nk_tree_state_push | Start a collapsable UI section with external state management -/// nk_tree_state_image_push | Start a collapsable UI section with image and label header and external state management -/// nk_tree_state_pop | Ends a collapsabale UI section -/// -/// #### nk_tree_type -/// Flag | Description -/// ----------------|---------------------------------------- -/// NK_TREE_NODE | Highlighted tree header to mark a collapsable UI section -/// NK_TREE_TAB | Non-highighted tree header closer to tree representations -*/ -/*/// #### nk_tree_push -/// Starts a collapsable UI section with internal state management -/// !!! WARNING -/// To keep track of the runtime tree collapsable state this function uses -/// defines `__FILE__` and `__LINE__` to generate a unique ID. If you want -/// to call this function in a loop please use `nk_tree_push_id` or -/// `nk_tree_push_hashed` instead. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// #define nk_tree_push(ctx, type, title, state) -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node -/// __title__ | Label printed in the tree header -/// __state__ | Initial tree state value out of nk_collapse_states -/// -/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise -*/ -#define nk_tree_push(ctx, type, title, state) nk_tree_push_hashed(ctx, type, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),__LINE__) -/*/// #### nk_tree_push_id -/// Starts a collapsable UI section with internal state management callable in a look -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// #define nk_tree_push_id(ctx, type, title, state, id) -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node -/// __title__ | Label printed in the tree header -/// __state__ | Initial tree state value out of nk_collapse_states -/// __id__ | Loop counter index if this function is called in a loop -/// -/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise -*/ -#define nk_tree_push_id(ctx, type, title, state, id) nk_tree_push_hashed(ctx, type, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),id) -/*/// #### nk_tree_push_hashed -/// Start a collapsable UI section with internal state management with full -/// control over internal unique ID used to store state -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// int nk_tree_push_hashed(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node -/// __title__ | Label printed in the tree header -/// __state__ | Initial tree state value out of nk_collapse_states -/// __hash__ | Memory block or string to generate the ID from -/// __len__ | Size of passed memory block or string in __hash__ -/// __seed__ | Seeding value if this function is called in a loop or default to `0` -/// -/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise -*/ -NK_API int nk_tree_push_hashed(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed); -/*/// #### nk_tree_image_push -/// Start a collapsable UI section with image and label header -/// !!! WARNING -/// To keep track of the runtime tree collapsable state this function uses -/// defines `__FILE__` and `__LINE__` to generate a unique ID. If you want -/// to call this function in a loop please use `nk_tree_image_push_id` or -/// `nk_tree_image_push_hashed` instead. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// #define nk_tree_image_push(ctx, type, img, title, state) -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node -/// __img__ | Image to display inside the header on the left of the label -/// __title__ | Label printed in the tree header -/// __state__ | Initial tree state value out of nk_collapse_states -/// -/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise -*/ -#define nk_tree_image_push(ctx, type, img, title, state) nk_tree_image_push_hashed(ctx, type, img, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),__LINE__) -/*/// #### nk_tree_image_push_id -/// Start a collapsable UI section with image and label header and internal state -/// management callable in a look -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// #define nk_tree_image_push_id(ctx, type, img, title, state, id) -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node -/// __img__ | Image to display inside the header on the left of the label -/// __title__ | Label printed in the tree header -/// __state__ | Initial tree state value out of nk_collapse_states -/// __id__ | Loop counter index if this function is called in a loop -/// -/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise -*/ -#define nk_tree_image_push_id(ctx, type, img, title, state, id) nk_tree_image_push_hashed(ctx, type, img, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),id) -/*/// #### nk_tree_image_push_hashed -/// Start a collapsable UI section with internal state management with full -/// control over internal unique ID used to store state -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// int nk_tree_image_push_hashed(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct -/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node -/// __img__ | Image to display inside the header on the left of the label -/// __title__ | Label printed in the tree header -/// __state__ | Initial tree state value out of nk_collapse_states -/// __hash__ | Memory block or string to generate the ID from -/// __len__ | Size of passed memory block or string in __hash__ -/// __seed__ | Seeding value if this function is called in a loop or default to `0` -/// -/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise -*/ -NK_API int nk_tree_image_push_hashed(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed); -/*/// #### nk_tree_pop -/// Ends a collapsabale UI section -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_tree_pop(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling `nk_tree_xxx_push_xxx` -*/ -NK_API void nk_tree_pop(struct nk_context*); -/*/// #### nk_tree_state_push -/// Start a collapsable UI section with external state management -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// int nk_tree_state_push(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states *state); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling `nk_tree_xxx_push_xxx` -/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node -/// __title__ | Label printed in the tree header -/// __state__ | Persistent state to update -/// -/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise -*/ -NK_API int nk_tree_state_push(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states *state); -/*/// #### nk_tree_state_image_push -/// Start a collapsable UI section with image and label header and external state management -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// int nk_tree_state_image_push(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states *state); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling `nk_tree_xxx_push_xxx` -/// __img__ | Image to display inside the header on the left of the label -/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node -/// __title__ | Label printed in the tree header -/// __state__ | Persistent state to update -/// -/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise -*/ -NK_API int nk_tree_state_image_push(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states *state); -/*/// #### nk_tree_state_pop -/// Ends a collapsabale UI section -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_tree_state_pop(struct nk_context*); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// ------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling `nk_tree_xxx_push_xxx` -*/ -NK_API void nk_tree_state_pop(struct nk_context*); - -#define nk_tree_element_push(ctx, type, title, state, sel) nk_tree_element_push_hashed(ctx, type, title, state, sel, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),__LINE__) -#define nk_tree_element_push_id(ctx, type, title, state, sel, id) nk_tree_element_push_hashed(ctx, type, title, state, sel, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),id) -NK_API int nk_tree_element_push_hashed(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states initial_state, int *selected, const char *hash, int len, int seed); -NK_API int nk_tree_element_image_push_hashed(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states initial_state, int *selected, const char *hash, int len,int seed); -NK_API void nk_tree_element_pop(struct nk_context*); - -/* ============================================================================= - * - * LIST VIEW - * - * ============================================================================= */ -struct nk_list_view { -/* public: */ - int begin, end, count; -/* private: */ - int total_height; - struct nk_context *ctx; - nk_uint *scroll_pointer; - nk_uint scroll_value; -}; -NK_API int nk_list_view_begin(struct nk_context*, struct nk_list_view *out, const char *id, nk_flags, int row_height, int row_count); -NK_API void nk_list_view_end(struct nk_list_view*); -/* ============================================================================= - * - * WIDGET - * - * ============================================================================= */ -enum nk_widget_layout_states { - NK_WIDGET_INVALID, /* The widget cannot be seen and is completely out of view */ - NK_WIDGET_VALID, /* The widget is completely inside the window and can be updated and drawn */ - NK_WIDGET_ROM /* The widget is partially visible and cannot be updated */ -}; -enum nk_widget_states { - NK_WIDGET_STATE_MODIFIED = NK_FLAG(1), - NK_WIDGET_STATE_INACTIVE = NK_FLAG(2), /* widget is neither active nor hovered */ - NK_WIDGET_STATE_ENTERED = NK_FLAG(3), /* widget has been hovered on the current frame */ - NK_WIDGET_STATE_HOVER = NK_FLAG(4), /* widget is being hovered */ - NK_WIDGET_STATE_ACTIVED = NK_FLAG(5),/* widget is currently activated */ - NK_WIDGET_STATE_LEFT = NK_FLAG(6), /* widget is from this frame on not hovered anymore */ - NK_WIDGET_STATE_HOVERED = NK_WIDGET_STATE_HOVER|NK_WIDGET_STATE_MODIFIED, /* widget is being hovered */ - NK_WIDGET_STATE_ACTIVE = NK_WIDGET_STATE_ACTIVED|NK_WIDGET_STATE_MODIFIED /* widget is currently activated */ -}; -NK_API enum nk_widget_layout_states nk_widget(struct nk_rect*, const struct nk_context*); -NK_API enum nk_widget_layout_states nk_widget_fitting(struct nk_rect*, struct nk_context*, struct nk_vec2); -NK_API struct nk_rect nk_widget_bounds(struct nk_context*); -NK_API struct nk_vec2 nk_widget_position(struct nk_context*); -NK_API struct nk_vec2 nk_widget_size(struct nk_context*); -NK_API float nk_widget_width(struct nk_context*); -NK_API float nk_widget_height(struct nk_context*); -NK_API int nk_widget_is_hovered(struct nk_context*); -NK_API int nk_widget_is_mouse_clicked(struct nk_context*, enum nk_buttons); -NK_API int nk_widget_has_mouse_click_down(struct nk_context*, enum nk_buttons, int down); -NK_API void nk_spacing(struct nk_context*, int cols); -/* ============================================================================= - * - * TEXT - * - * ============================================================================= */ -enum nk_text_align { - NK_TEXT_ALIGN_LEFT = 0x01, - NK_TEXT_ALIGN_CENTERED = 0x02, - NK_TEXT_ALIGN_RIGHT = 0x04, - NK_TEXT_ALIGN_TOP = 0x08, - NK_TEXT_ALIGN_MIDDLE = 0x10, - NK_TEXT_ALIGN_BOTTOM = 0x20 -}; -enum nk_text_alignment { - NK_TEXT_LEFT = NK_TEXT_ALIGN_MIDDLE|NK_TEXT_ALIGN_LEFT, - NK_TEXT_CENTERED = NK_TEXT_ALIGN_MIDDLE|NK_TEXT_ALIGN_CENTERED, - NK_TEXT_RIGHT = NK_TEXT_ALIGN_MIDDLE|NK_TEXT_ALIGN_RIGHT -}; -NK_API void nk_text(struct nk_context*, const char*, int, nk_flags); -NK_API void nk_text_colored(struct nk_context*, const char*, int, nk_flags, struct nk_color); -NK_API void nk_text_wrap(struct nk_context*, const char*, int); -NK_API void nk_text_wrap_colored(struct nk_context*, const char*, int, struct nk_color); -NK_API void nk_label(struct nk_context*, const char*, nk_flags align); -NK_API void nk_label_colored(struct nk_context*, const char*, nk_flags align, struct nk_color); -NK_API void nk_label_wrap(struct nk_context*, const char*); -NK_API void nk_label_colored_wrap(struct nk_context*, const char*, struct nk_color); -NK_API void nk_image(struct nk_context*, struct nk_image); -NK_API void nk_image_color(struct nk_context*, struct nk_image, struct nk_color); -#ifdef NK_INCLUDE_STANDARD_VARARGS -NK_API void nk_labelf(struct nk_context*, nk_flags, NK_PRINTF_FORMAT_STRING const char*, ...) NK_PRINTF_VARARG_FUNC(3); -NK_API void nk_labelf_colored(struct nk_context*, nk_flags, struct nk_color, NK_PRINTF_FORMAT_STRING const char*,...) NK_PRINTF_VARARG_FUNC(4); -NK_API void nk_labelf_wrap(struct nk_context*, NK_PRINTF_FORMAT_STRING const char*,...) NK_PRINTF_VARARG_FUNC(2); -NK_API void nk_labelf_colored_wrap(struct nk_context*, struct nk_color, NK_PRINTF_FORMAT_STRING const char*,...) NK_PRINTF_VARARG_FUNC(3); -NK_API void nk_labelfv(struct nk_context*, nk_flags, NK_PRINTF_FORMAT_STRING const char*, va_list) NK_PRINTF_VALIST_FUNC(3); -NK_API void nk_labelfv_colored(struct nk_context*, nk_flags, struct nk_color, NK_PRINTF_FORMAT_STRING const char*, va_list) NK_PRINTF_VALIST_FUNC(4); -NK_API void nk_labelfv_wrap(struct nk_context*, NK_PRINTF_FORMAT_STRING const char*, va_list) NK_PRINTF_VALIST_FUNC(2); -NK_API void nk_labelfv_colored_wrap(struct nk_context*, struct nk_color, NK_PRINTF_FORMAT_STRING const char*, va_list) NK_PRINTF_VALIST_FUNC(3); -NK_API void nk_value_bool(struct nk_context*, const char *prefix, int); -NK_API void nk_value_int(struct nk_context*, const char *prefix, int); -NK_API void nk_value_uint(struct nk_context*, const char *prefix, unsigned int); -NK_API void nk_value_float(struct nk_context*, const char *prefix, float); -NK_API void nk_value_color_byte(struct nk_context*, const char *prefix, struct nk_color); -NK_API void nk_value_color_float(struct nk_context*, const char *prefix, struct nk_color); -NK_API void nk_value_color_hex(struct nk_context*, const char *prefix, struct nk_color); -#endif -/* ============================================================================= - * - * BUTTON - * - * ============================================================================= */ -NK_API int nk_button_text(struct nk_context*, const char *title, int len); -NK_API int nk_button_label(struct nk_context*, const char *title); -NK_API int nk_button_color(struct nk_context*, struct nk_color); -NK_API int nk_button_symbol(struct nk_context*, enum nk_symbol_type); -NK_API int nk_button_image(struct nk_context*, struct nk_image img); -NK_API int nk_button_symbol_label(struct nk_context*, enum nk_symbol_type, const char*, nk_flags text_alignment); -NK_API int nk_button_symbol_text(struct nk_context*, enum nk_symbol_type, const char*, int, nk_flags alignment); -NK_API int nk_button_image_label(struct nk_context*, struct nk_image img, const char*, nk_flags text_alignment); -NK_API int nk_button_image_text(struct nk_context*, struct nk_image img, const char*, int, nk_flags alignment); -NK_API int nk_button_text_styled(struct nk_context*, const struct nk_style_button*, const char *title, int len); -NK_API int nk_button_label_styled(struct nk_context*, const struct nk_style_button*, const char *title); -NK_API int nk_button_symbol_styled(struct nk_context*, const struct nk_style_button*, enum nk_symbol_type); -NK_API int nk_button_image_styled(struct nk_context*, const struct nk_style_button*, struct nk_image img); -NK_API int nk_button_symbol_text_styled(struct nk_context*,const struct nk_style_button*, enum nk_symbol_type, const char*, int, nk_flags alignment); -NK_API int nk_button_symbol_label_styled(struct nk_context *ctx, const struct nk_style_button *style, enum nk_symbol_type symbol, const char *title, nk_flags align); -NK_API int nk_button_image_label_styled(struct nk_context*,const struct nk_style_button*, struct nk_image img, const char*, nk_flags text_alignment); -NK_API int nk_button_image_text_styled(struct nk_context*,const struct nk_style_button*, struct nk_image img, const char*, int, nk_flags alignment); -NK_API void nk_button_set_behavior(struct nk_context*, enum nk_button_behavior); -NK_API int nk_button_push_behavior(struct nk_context*, enum nk_button_behavior); -NK_API int nk_button_pop_behavior(struct nk_context*); -/* ============================================================================= - * - * CHECKBOX - * - * ============================================================================= */ -NK_API int nk_check_label(struct nk_context*, const char*, int active); -NK_API int nk_check_text(struct nk_context*, const char*, int,int active); -NK_API unsigned nk_check_flags_label(struct nk_context*, const char*, unsigned int flags, unsigned int value); -NK_API unsigned nk_check_flags_text(struct nk_context*, const char*, int, unsigned int flags, unsigned int value); -NK_API int nk_checkbox_label(struct nk_context*, const char*, int *active); -NK_API int nk_checkbox_text(struct nk_context*, const char*, int, int *active); -NK_API int nk_checkbox_flags_label(struct nk_context*, const char*, unsigned int *flags, unsigned int value); -NK_API int nk_checkbox_flags_text(struct nk_context*, const char*, int, unsigned int *flags, unsigned int value); -/* ============================================================================= - * - * RADIO BUTTON - * - * ============================================================================= */ -NK_API int nk_radio_label(struct nk_context*, const char*, int *active); -NK_API int nk_radio_text(struct nk_context*, const char*, int, int *active); -NK_API int nk_option_label(struct nk_context*, const char*, int active); -NK_API int nk_option_text(struct nk_context*, const char*, int, int active); -/* ============================================================================= - * - * SELECTABLE - * - * ============================================================================= */ -NK_API int nk_selectable_label(struct nk_context*, const char*, nk_flags align, int *value); -NK_API int nk_selectable_text(struct nk_context*, const char*, int, nk_flags align, int *value); -NK_API int nk_selectable_image_label(struct nk_context*,struct nk_image, const char*, nk_flags align, int *value); -NK_API int nk_selectable_image_text(struct nk_context*,struct nk_image, const char*, int, nk_flags align, int *value); -NK_API int nk_selectable_symbol_label(struct nk_context*,enum nk_symbol_type, const char*, nk_flags align, int *value); -NK_API int nk_selectable_symbol_text(struct nk_context*,enum nk_symbol_type, const char*, int, nk_flags align, int *value); - -NK_API int nk_select_label(struct nk_context*, const char*, nk_flags align, int value); -NK_API int nk_select_text(struct nk_context*, const char*, int, nk_flags align, int value); -NK_API int nk_select_image_label(struct nk_context*, struct nk_image,const char*, nk_flags align, int value); -NK_API int nk_select_image_text(struct nk_context*, struct nk_image,const char*, int, nk_flags align, int value); -NK_API int nk_select_symbol_label(struct nk_context*,enum nk_symbol_type, const char*, nk_flags align, int value); -NK_API int nk_select_symbol_text(struct nk_context*,enum nk_symbol_type, const char*, int, nk_flags align, int value); - -/* ============================================================================= - * - * SLIDER - * - * ============================================================================= */ -NK_API float nk_slide_float(struct nk_context*, float min, float val, float max, float step); -NK_API int nk_slide_int(struct nk_context*, int min, int val, int max, int step); -NK_API int nk_slider_float(struct nk_context*, float min, float *val, float max, float step); -NK_API int nk_slider_int(struct nk_context*, int min, int *val, int max, int step); -/* ============================================================================= - * - * PROGRESSBAR - * - * ============================================================================= */ -NK_API int nk_progress(struct nk_context*, nk_size *cur, nk_size max, int modifyable); -NK_API nk_size nk_prog(struct nk_context*, nk_size cur, nk_size max, int modifyable); - -/* ============================================================================= - * - * COLOR PICKER - * - * ============================================================================= */ -NK_API struct nk_colorf nk_color_picker(struct nk_context*, struct nk_colorf, enum nk_color_format); -NK_API int nk_color_pick(struct nk_context*, struct nk_colorf*, enum nk_color_format); -/* ============================================================================= - * - * PROPERTIES - * - * ============================================================================= -/// ### Properties -/// Properties are the main value modification widgets in Nuklear. Changing a value -/// can be achieved by dragging, adding/removing incremental steps on button click -/// or by directly typing a number. -/// -/// #### Usage -/// Each property requires a unique name for identifaction that is also used for -/// displaying a label. If you want to use the same name multiple times make sure -/// add a '#' before your name. The '#' will not be shown but will generate a -/// unique ID. Each propery also takes in a minimum and maximum value. If you want -/// to make use of the complete number range of a type just use the provided -/// type limits from `limits.h`. For example `INT_MIN` and `INT_MAX` for -/// `nk_property_int` and `nk_propertyi`. In additional each property takes in -/// a increment value that will be added or subtracted if either the increment -/// decrement button is clicked. Finally there is a value for increment per pixel -/// dragged that is added or subtracted from the value. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// int value = 0; -/// struct nk_context ctx; -/// nk_init_xxx(&ctx, ...); -/// while (1) { -/// // Input -/// Event evt; -/// nk_input_begin(&ctx); -/// while (GetEvent(&evt)) { -/// if (evt.type == MOUSE_MOVE) -/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y); -/// else if (evt.type == [...]) { -/// nk_input_xxx(...); -/// } -/// } -/// nk_input_end(&ctx); -/// // -/// // Window -/// if (nk_begin_xxx(...) { -/// // Property -/// nk_layout_row_dynamic(...); -/// nk_property_int(ctx, "ID", INT_MIN, &value, INT_MAX, 1, 1); -/// } -/// nk_end(ctx); -/// // -/// // Draw -/// const struct nk_command *cmd = 0; -/// nk_foreach(cmd, &ctx) { -/// switch (cmd->type) { -/// case NK_COMMAND_LINE: -/// your_draw_line_function(...) -/// break; -/// case NK_COMMAND_RECT -/// your_draw_rect_function(...) -/// break; -/// case ...: -/// // [...] -/// } -/// nk_clear(&ctx); -/// } -/// nk_free(&ctx); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// #### Reference -/// Function | Description -/// --------------------|------------------------------------------- -/// nk_property_int | Integer property directly modifing a passed in value -/// nk_property_float | Float property directly modifing a passed in value -/// nk_property_double | Double property directly modifing a passed in value -/// nk_propertyi | Integer property returning the modified int value -/// nk_propertyf | Float property returning the modified float value -/// nk_propertyd | Double property returning the modified double value -/// -*/ -/*/// #### nk_property_int -/// Integer property directly modifing a passed in value -/// !!! WARNING -/// To generate a unique property ID using the same label make sure to insert -/// a `#` at the beginning. It will not be shown but guarantees correct behavior. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_property_int(struct nk_context *ctx, const char *name, int min, int *val, int max, int step, float inc_per_pixel); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// --------------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling a layouting function -/// __name__ | String used both as a label as well as a unique identifier -/// __min__ | Minimum value not allowed to be underflown -/// __val__ | Integer pointer to be modified -/// __max__ | Maximum value not allowed to be overflown -/// __step__ | Increment added and subtracted on increment and decrement button -/// __inc_per_pixel__ | Value per pixel added or subtracted on dragging -*/ -NK_API void nk_property_int(struct nk_context*, const char *name, int min, int *val, int max, int step, float inc_per_pixel); -/*/// #### nk_property_float -/// Float property directly modifing a passed in value -/// !!! WARNING -/// To generate a unique property ID using the same label make sure to insert -/// a `#` at the beginning. It will not be shown but guarantees correct behavior. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_property_float(struct nk_context *ctx, const char *name, float min, float *val, float max, float step, float inc_per_pixel); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// --------------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling a layouting function -/// __name__ | String used both as a label as well as a unique identifier -/// __min__ | Minimum value not allowed to be underflown -/// __val__ | Float pointer to be modified -/// __max__ | Maximum value not allowed to be overflown -/// __step__ | Increment added and subtracted on increment and decrement button -/// __inc_per_pixel__ | Value per pixel added or subtracted on dragging -*/ -NK_API void nk_property_float(struct nk_context*, const char *name, float min, float *val, float max, float step, float inc_per_pixel); -/*/// #### nk_property_double -/// Double property directly modifing a passed in value -/// !!! WARNING -/// To generate a unique property ID using the same label make sure to insert -/// a `#` at the beginning. It will not be shown but guarantees correct behavior. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// void nk_property_double(struct nk_context *ctx, const char *name, double min, double *val, double max, double step, double inc_per_pixel); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// --------------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling a layouting function -/// __name__ | String used both as a label as well as a unique identifier -/// __min__ | Minimum value not allowed to be underflown -/// __val__ | Double pointer to be modified -/// __max__ | Maximum value not allowed to be overflown -/// __step__ | Increment added and subtracted on increment and decrement button -/// __inc_per_pixel__ | Value per pixel added or subtracted on dragging -*/ -NK_API void nk_property_double(struct nk_context*, const char *name, double min, double *val, double max, double step, float inc_per_pixel); -/*/// #### nk_propertyi -/// Integer property modifing a passed in value and returning the new value -/// !!! WARNING -/// To generate a unique property ID using the same label make sure to insert -/// a `#` at the beginning. It will not be shown but guarantees correct behavior. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// int nk_propertyi(struct nk_context *ctx, const char *name, int min, int val, int max, int step, float inc_per_pixel); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// --------------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling a layouting function -/// __name__ | String used both as a label as well as a unique identifier -/// __min__ | Minimum value not allowed to be underflown -/// __val__ | Current integer value to be modified and returned -/// __max__ | Maximum value not allowed to be overflown -/// __step__ | Increment added and subtracted on increment and decrement button -/// __inc_per_pixel__ | Value per pixel added or subtracted on dragging -/// -/// Returns the new modified integer value -*/ -NK_API int nk_propertyi(struct nk_context*, const char *name, int min, int val, int max, int step, float inc_per_pixel); -/*/// #### nk_propertyf -/// Float property modifing a passed in value and returning the new value -/// !!! WARNING -/// To generate a unique property ID using the same label make sure to insert -/// a `#` at the beginning. It will not be shown but guarantees correct behavior. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// float nk_propertyf(struct nk_context *ctx, const char *name, float min, float val, float max, float step, float inc_per_pixel); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// --------------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling a layouting function -/// __name__ | String used both as a label as well as a unique identifier -/// __min__ | Minimum value not allowed to be underflown -/// __val__ | Current float value to be modified and returned -/// __max__ | Maximum value not allowed to be overflown -/// __step__ | Increment added and subtracted on increment and decrement button -/// __inc_per_pixel__ | Value per pixel added or subtracted on dragging -/// -/// Returns the new modified float value -*/ -NK_API float nk_propertyf(struct nk_context*, const char *name, float min, float val, float max, float step, float inc_per_pixel); -/*/// #### nk_propertyd -/// Float property modifing a passed in value and returning the new value -/// !!! WARNING -/// To generate a unique property ID using the same label make sure to insert -/// a `#` at the beginning. It will not be shown but guarantees correct behavior. -/// -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c -/// float nk_propertyd(struct nk_context *ctx, const char *name, double min, double val, double max, double step, double inc_per_pixel); -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// -/// Parameter | Description -/// --------------------|----------------------------------------------------------- -/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling a layouting function -/// __name__ | String used both as a label as well as a unique identifier -/// __min__ | Minimum value not allowed to be underflown -/// __val__ | Current double value to be modified and returned -/// __max__ | Maximum value not allowed to be overflown -/// __step__ | Increment added and subtracted on increment and decrement button -/// __inc_per_pixel__ | Value per pixel added or subtracted on dragging -/// -/// Returns the new modified double value -*/ -NK_API double nk_propertyd(struct nk_context*, const char *name, double min, double val, double max, double step, float inc_per_pixel); -/* ============================================================================= - * - * TEXT EDIT - * - * ============================================================================= */ -enum nk_edit_flags { - NK_EDIT_DEFAULT = 0, - NK_EDIT_READ_ONLY = NK_FLAG(0), - NK_EDIT_AUTO_SELECT = NK_FLAG(1), - NK_EDIT_SIG_ENTER = NK_FLAG(2), - NK_EDIT_ALLOW_TAB = NK_FLAG(3), - NK_EDIT_NO_CURSOR = NK_FLAG(4), - NK_EDIT_SELECTABLE = NK_FLAG(5), - NK_EDIT_CLIPBOARD = NK_FLAG(6), - NK_EDIT_CTRL_ENTER_NEWLINE = NK_FLAG(7), - NK_EDIT_NO_HORIZONTAL_SCROLL = NK_FLAG(8), - NK_EDIT_ALWAYS_INSERT_MODE = NK_FLAG(9), - NK_EDIT_MULTILINE = NK_FLAG(10), - NK_EDIT_GOTO_END_ON_ACTIVATE = NK_FLAG(11) -}; -enum nk_edit_types { - NK_EDIT_SIMPLE = NK_EDIT_ALWAYS_INSERT_MODE, - NK_EDIT_FIELD = NK_EDIT_SIMPLE|NK_EDIT_SELECTABLE|NK_EDIT_CLIPBOARD, - NK_EDIT_BOX = NK_EDIT_ALWAYS_INSERT_MODE| NK_EDIT_SELECTABLE| NK_EDIT_MULTILINE|NK_EDIT_ALLOW_TAB|NK_EDIT_CLIPBOARD, - NK_EDIT_EDITOR = NK_EDIT_SELECTABLE|NK_EDIT_MULTILINE|NK_EDIT_ALLOW_TAB| NK_EDIT_CLIPBOARD -}; -enum nk_edit_events { - NK_EDIT_ACTIVE = NK_FLAG(0), /* edit widget is currently being modified */ - NK_EDIT_INACTIVE = NK_FLAG(1), /* edit widget is not active and is not being modified */ - NK_EDIT_ACTIVATED = NK_FLAG(2), /* edit widget went from state inactive to state active */ - NK_EDIT_DEACTIVATED = NK_FLAG(3), /* edit widget went from state active to state inactive */ - NK_EDIT_COMMITED = NK_FLAG(4) /* edit widget has received an enter and lost focus */ -}; -NK_API nk_flags nk_edit_string(struct nk_context*, nk_flags, char *buffer, int *len, int max, nk_plugin_filter); -NK_API nk_flags nk_edit_string_zero_terminated(struct nk_context*, nk_flags, char *buffer, int max, nk_plugin_filter); -NK_API nk_flags nk_edit_buffer(struct nk_context*, nk_flags, struct nk_text_edit*, nk_plugin_filter); -NK_API void nk_edit_focus(struct nk_context*, nk_flags flags); -NK_API void nk_edit_unfocus(struct nk_context*); -/* ============================================================================= - * - * CHART - * - * ============================================================================= */ -NK_API int nk_chart_begin(struct nk_context*, enum nk_chart_type, int num, float min, float max); -NK_API int nk_chart_begin_colored(struct nk_context*, enum nk_chart_type, struct nk_color, struct nk_color active, int num, float min, float max); -NK_API void nk_chart_add_slot(struct nk_context *ctx, const enum nk_chart_type, int count, float min_value, float max_value); -NK_API void nk_chart_add_slot_colored(struct nk_context *ctx, const enum nk_chart_type, struct nk_color, struct nk_color active, int count, float min_value, float max_value); -NK_API nk_flags nk_chart_push(struct nk_context*, float); -NK_API nk_flags nk_chart_push_slot(struct nk_context*, float, int); -NK_API void nk_chart_end(struct nk_context*); -NK_API void nk_plot(struct nk_context*, enum nk_chart_type, const float *values, int count, int offset); -NK_API void nk_plot_function(struct nk_context*, enum nk_chart_type, void *userdata, float(*value_getter)(void* user, int index), int count, int offset); -/* ============================================================================= - * - * POPUP - * - * ============================================================================= */ -NK_API int nk_popup_begin(struct nk_context*, enum nk_popup_type, const char*, nk_flags, struct nk_rect bounds); -NK_API void nk_popup_close(struct nk_context*); -NK_API void nk_popup_end(struct nk_context*); -NK_API void nk_popup_get_scroll(struct nk_context*, nk_uint *offset_x, nk_uint *offset_y); -NK_API void nk_popup_set_scroll(struct nk_context*, nk_uint offset_x, nk_uint offset_y); -/* ============================================================================= - * - * COMBOBOX - * - * ============================================================================= */ -NK_API int nk_combo(struct nk_context*, const char **items, int count, int selected, int item_height, struct nk_vec2 size); -NK_API int nk_combo_separator(struct nk_context*, const char *items_separated_by_separator, int separator, int selected, int count, int item_height, struct nk_vec2 size); -NK_API int nk_combo_string(struct nk_context*, const char *items_separated_by_zeros, int selected, int count, int item_height, struct nk_vec2 size); -NK_API int nk_combo_callback(struct nk_context*, void(*item_getter)(void*, int, const char**), void *userdata, int selected, int count, int item_height, struct nk_vec2 size); -NK_API void nk_combobox(struct nk_context*, const char **items, int count, int *selected, int item_height, struct nk_vec2 size); -NK_API void nk_combobox_string(struct nk_context*, const char *items_separated_by_zeros, int *selected, int count, int item_height, struct nk_vec2 size); -NK_API void nk_combobox_separator(struct nk_context*, const char *items_separated_by_separator, int separator,int *selected, int count, int item_height, struct nk_vec2 size); -NK_API void nk_combobox_callback(struct nk_context*, void(*item_getter)(void*, int, const char**), void*, int *selected, int count, int item_height, struct nk_vec2 size); -/* ============================================================================= - * - * ABSTRACT COMBOBOX - * - * ============================================================================= */ -NK_API int nk_combo_begin_text(struct nk_context*, const char *selected, int, struct nk_vec2 size); -NK_API int nk_combo_begin_label(struct nk_context*, const char *selected, struct nk_vec2 size); -NK_API int nk_combo_begin_color(struct nk_context*, struct nk_color color, struct nk_vec2 size); -NK_API int nk_combo_begin_symbol(struct nk_context*, enum nk_symbol_type, struct nk_vec2 size); -NK_API int nk_combo_begin_symbol_label(struct nk_context*, const char *selected, enum nk_symbol_type, struct nk_vec2 size); -NK_API int nk_combo_begin_symbol_text(struct nk_context*, const char *selected, int, enum nk_symbol_type, struct nk_vec2 size); -NK_API int nk_combo_begin_image(struct nk_context*, struct nk_image img, struct nk_vec2 size); -NK_API int nk_combo_begin_image_label(struct nk_context*, const char *selected, struct nk_image, struct nk_vec2 size); -NK_API int nk_combo_begin_image_text(struct nk_context*, const char *selected, int, struct nk_image, struct nk_vec2 size); -NK_API int nk_combo_item_label(struct nk_context*, const char*, nk_flags alignment); -NK_API int nk_combo_item_text(struct nk_context*, const char*,int, nk_flags alignment); -NK_API int nk_combo_item_image_label(struct nk_context*, struct nk_image, const char*, nk_flags alignment); -NK_API int nk_combo_item_image_text(struct nk_context*, struct nk_image, const char*, int,nk_flags alignment); -NK_API int nk_combo_item_symbol_label(struct nk_context*, enum nk_symbol_type, const char*, nk_flags alignment); -NK_API int nk_combo_item_symbol_text(struct nk_context*, enum nk_symbol_type, const char*, int, nk_flags alignment); -NK_API void nk_combo_close(struct nk_context*); -NK_API void nk_combo_end(struct nk_context*); -/* ============================================================================= - * - * CONTEXTUAL - * - * ============================================================================= */ -NK_API int nk_contextual_begin(struct nk_context*, nk_flags, struct nk_vec2, struct nk_rect trigger_bounds); -NK_API int nk_contextual_item_text(struct nk_context*, const char*, int,nk_flags align); -NK_API int nk_contextual_item_label(struct nk_context*, const char*, nk_flags align); -NK_API int nk_contextual_item_image_label(struct nk_context*, struct nk_image, const char*, nk_flags alignment); -NK_API int nk_contextual_item_image_text(struct nk_context*, struct nk_image, const char*, int len, nk_flags alignment); -NK_API int nk_contextual_item_symbol_label(struct nk_context*, enum nk_symbol_type, const char*, nk_flags alignment); -NK_API int nk_contextual_item_symbol_text(struct nk_context*, enum nk_symbol_type, const char*, int, nk_flags alignment); -NK_API void nk_contextual_close(struct nk_context*); -NK_API void nk_contextual_end(struct nk_context*); -/* ============================================================================= - * - * TOOLTIP - * - * ============================================================================= */ -NK_API void nk_tooltip(struct nk_context*, const char*); -#ifdef NK_INCLUDE_STANDARD_VARARGS -NK_API void nk_tooltipf(struct nk_context*, NK_PRINTF_FORMAT_STRING const char*, ...) NK_PRINTF_VARARG_FUNC(2); -NK_API void nk_tooltipfv(struct nk_context*, NK_PRINTF_FORMAT_STRING const char*, va_list) NK_PRINTF_VALIST_FUNC(2); -#endif -NK_API int nk_tooltip_begin(struct nk_context*, float width); -NK_API void nk_tooltip_end(struct nk_context*); -/* ============================================================================= - * - * MENU - * - * ============================================================================= */ -NK_API void nk_menubar_begin(struct nk_context*); -NK_API void nk_menubar_end(struct nk_context*); -NK_API int nk_menu_begin_text(struct nk_context*, const char* title, int title_len, nk_flags align, struct nk_vec2 size); -NK_API int nk_menu_begin_label(struct nk_context*, const char*, nk_flags align, struct nk_vec2 size); -NK_API int nk_menu_begin_image(struct nk_context*, const char*, struct nk_image, struct nk_vec2 size); -NK_API int nk_menu_begin_image_text(struct nk_context*, const char*, int,nk_flags align,struct nk_image, struct nk_vec2 size); -NK_API int nk_menu_begin_image_label(struct nk_context*, const char*, nk_flags align,struct nk_image, struct nk_vec2 size); -NK_API int nk_menu_begin_symbol(struct nk_context*, const char*, enum nk_symbol_type, struct nk_vec2 size); -NK_API int nk_menu_begin_symbol_text(struct nk_context*, const char*, int,nk_flags align,enum nk_symbol_type, struct nk_vec2 size); -NK_API int nk_menu_begin_symbol_label(struct nk_context*, const char*, nk_flags align,enum nk_symbol_type, struct nk_vec2 size); -NK_API int nk_menu_item_text(struct nk_context*, const char*, int,nk_flags align); -NK_API int nk_menu_item_label(struct nk_context*, const char*, nk_flags alignment); -NK_API int nk_menu_item_image_label(struct nk_context*, struct nk_image, const char*, nk_flags alignment); -NK_API int nk_menu_item_image_text(struct nk_context*, struct nk_image, const char*, int len, nk_flags alignment); -NK_API int nk_menu_item_symbol_text(struct nk_context*, enum nk_symbol_type, const char*, int, nk_flags alignment); -NK_API int nk_menu_item_symbol_label(struct nk_context*, enum nk_symbol_type, const char*, nk_flags alignment); -NK_API void nk_menu_close(struct nk_context*); -NK_API void nk_menu_end(struct nk_context*); -/* ============================================================================= - * - * STYLE - * - * ============================================================================= */ -enum nk_style_colors { - NK_COLOR_TEXT, - NK_COLOR_WINDOW, - NK_COLOR_HEADER, - NK_COLOR_BORDER, - NK_COLOR_BUTTON, - NK_COLOR_BUTTON_HOVER, - NK_COLOR_BUTTON_ACTIVE, - NK_COLOR_TOGGLE, - NK_COLOR_TOGGLE_HOVER, - NK_COLOR_TOGGLE_CURSOR, - NK_COLOR_SELECT, - NK_COLOR_SELECT_ACTIVE, - NK_COLOR_SLIDER, - NK_COLOR_SLIDER_CURSOR, - NK_COLOR_SLIDER_CURSOR_HOVER, - NK_COLOR_SLIDER_CURSOR_ACTIVE, - NK_COLOR_PROPERTY, - NK_COLOR_EDIT, - NK_COLOR_EDIT_CURSOR, - NK_COLOR_COMBO, - NK_COLOR_CHART, - NK_COLOR_CHART_COLOR, - NK_COLOR_CHART_COLOR_HIGHLIGHT, - NK_COLOR_SCROLLBAR, - NK_COLOR_SCROLLBAR_CURSOR, - NK_COLOR_SCROLLBAR_CURSOR_HOVER, - NK_COLOR_SCROLLBAR_CURSOR_ACTIVE, - NK_COLOR_TAB_HEADER, - NK_COLOR_COUNT -}; -enum nk_style_cursor { - NK_CURSOR_ARROW, - NK_CURSOR_TEXT, - NK_CURSOR_MOVE, - NK_CURSOR_RESIZE_VERTICAL, - NK_CURSOR_RESIZE_HORIZONTAL, - NK_CURSOR_RESIZE_TOP_LEFT_DOWN_RIGHT, - NK_CURSOR_RESIZE_TOP_RIGHT_DOWN_LEFT, - NK_CURSOR_COUNT -}; -NK_API void nk_style_default(struct nk_context*); -NK_API void nk_style_from_table(struct nk_context*, const struct nk_color*); -NK_API void nk_style_load_cursor(struct nk_context*, enum nk_style_cursor, const struct nk_cursor*); -NK_API void nk_style_load_all_cursors(struct nk_context*, struct nk_cursor*); -NK_API const char* nk_style_get_color_by_name(enum nk_style_colors); -NK_API void nk_style_set_font(struct nk_context*, const struct nk_user_font*); -NK_API int nk_style_set_cursor(struct nk_context*, enum nk_style_cursor); -NK_API void nk_style_show_cursor(struct nk_context*); -NK_API void nk_style_hide_cursor(struct nk_context*); - -NK_API int nk_style_push_font(struct nk_context*, const struct nk_user_font*); -NK_API int nk_style_push_float(struct nk_context*, float*, float); -NK_API int nk_style_push_vec2(struct nk_context*, struct nk_vec2*, struct nk_vec2); -NK_API int nk_style_push_style_item(struct nk_context*, struct nk_style_item*, struct nk_style_item); -NK_API int nk_style_push_flags(struct nk_context*, nk_flags*, nk_flags); -NK_API int nk_style_push_color(struct nk_context*, struct nk_color*, struct nk_color); - -NK_API int nk_style_pop_font(struct nk_context*); -NK_API int nk_style_pop_float(struct nk_context*); -NK_API int nk_style_pop_vec2(struct nk_context*); -NK_API int nk_style_pop_style_item(struct nk_context*); -NK_API int nk_style_pop_flags(struct nk_context*); -NK_API int nk_style_pop_color(struct nk_context*); -/* ============================================================================= - * - * COLOR - * - * ============================================================================= */ -NK_API struct nk_color nk_rgb(int r, int g, int b); -NK_API struct nk_color nk_rgb_iv(const int *rgb); -NK_API struct nk_color nk_rgb_bv(const nk_byte* rgb); -NK_API struct nk_color nk_rgb_f(float r, float g, float b); -NK_API struct nk_color nk_rgb_fv(const float *rgb); -NK_API struct nk_color nk_rgb_cf(struct nk_colorf c); -NK_API struct nk_color nk_rgb_hex(const char *rgb); - -NK_API struct nk_color nk_rgba(int r, int g, int b, int a); -NK_API struct nk_color nk_rgba_u32(nk_uint); -NK_API struct nk_color nk_rgba_iv(const int *rgba); -NK_API struct nk_color nk_rgba_bv(const nk_byte *rgba); -NK_API struct nk_color nk_rgba_f(float r, float g, float b, float a); -NK_API struct nk_color nk_rgba_fv(const float *rgba); -NK_API struct nk_color nk_rgba_cf(struct nk_colorf c); -NK_API struct nk_color nk_rgba_hex(const char *rgb); - -NK_API struct nk_colorf nk_hsva_colorf(float h, float s, float v, float a); -NK_API struct nk_colorf nk_hsva_colorfv(float *c); -NK_API void nk_colorf_hsva_f(float *out_h, float *out_s, float *out_v, float *out_a, struct nk_colorf in); -NK_API void nk_colorf_hsva_fv(float *hsva, struct nk_colorf in); - -NK_API struct nk_color nk_hsv(int h, int s, int v); -NK_API struct nk_color nk_hsv_iv(const int *hsv); -NK_API struct nk_color nk_hsv_bv(const nk_byte *hsv); -NK_API struct nk_color nk_hsv_f(float h, float s, float v); -NK_API struct nk_color nk_hsv_fv(const float *hsv); - -NK_API struct nk_color nk_hsva(int h, int s, int v, int a); -NK_API struct nk_color nk_hsva_iv(const int *hsva); -NK_API struct nk_color nk_hsva_bv(const nk_byte *hsva); -NK_API struct nk_color nk_hsva_f(float h, float s, float v, float a); -NK_API struct nk_color nk_hsva_fv(const float *hsva); - -/* color (conversion nuklear --> user) */ -NK_API void nk_color_f(float *r, float *g, float *b, float *a, struct nk_color); -NK_API void nk_color_fv(float *rgba_out, struct nk_color); -NK_API struct nk_colorf nk_color_cf(struct nk_color); -NK_API void nk_color_d(double *r, double *g, double *b, double *a, struct nk_color); -NK_API void nk_color_dv(double *rgba_out, struct nk_color); - -NK_API nk_uint nk_color_u32(struct nk_color); -NK_API void nk_color_hex_rgba(char *output, struct nk_color); -NK_API void nk_color_hex_rgb(char *output, struct nk_color); - -NK_API void nk_color_hsv_i(int *out_h, int *out_s, int *out_v, struct nk_color); -NK_API void nk_color_hsv_b(nk_byte *out_h, nk_byte *out_s, nk_byte *out_v, struct nk_color); -NK_API void nk_color_hsv_iv(int *hsv_out, struct nk_color); -NK_API void nk_color_hsv_bv(nk_byte *hsv_out, struct nk_color); -NK_API void nk_color_hsv_f(float *out_h, float *out_s, float *out_v, struct nk_color); -NK_API void nk_color_hsv_fv(float *hsv_out, struct nk_color); - -NK_API void nk_color_hsva_i(int *h, int *s, int *v, int *a, struct nk_color); -NK_API void nk_color_hsva_b(nk_byte *h, nk_byte *s, nk_byte *v, nk_byte *a, struct nk_color); -NK_API void nk_color_hsva_iv(int *hsva_out, struct nk_color); -NK_API void nk_color_hsva_bv(nk_byte *hsva_out, struct nk_color); -NK_API void nk_color_hsva_f(float *out_h, float *out_s, float *out_v, float *out_a, struct nk_color); -NK_API void nk_color_hsva_fv(float *hsva_out, struct nk_color); -/* ============================================================================= - * - * IMAGE - * - * ============================================================================= */ -NK_API nk_handle nk_handle_ptr(void*); -NK_API nk_handle nk_handle_id(int); -NK_API struct nk_image nk_image_handle(nk_handle); -NK_API struct nk_image nk_image_ptr(void*); -NK_API struct nk_image nk_image_id(int); -NK_API int nk_image_is_subimage(const struct nk_image* img); -NK_API struct nk_image nk_subimage_ptr(void*, unsigned short w, unsigned short h, struct nk_rect sub_region); -NK_API struct nk_image nk_subimage_id(int, unsigned short w, unsigned short h, struct nk_rect sub_region); -NK_API struct nk_image nk_subimage_handle(nk_handle, unsigned short w, unsigned short h, struct nk_rect sub_region); -/* ============================================================================= - * - * MATH - * - * ============================================================================= */ -NK_API nk_hash nk_murmur_hash(const void *key, int len, nk_hash seed); -NK_API void nk_triangle_from_direction(struct nk_vec2 *result, struct nk_rect r, float pad_x, float pad_y, enum nk_heading); - -NK_API struct nk_vec2 nk_vec2(float x, float y); -NK_API struct nk_vec2 nk_vec2i(int x, int y); -NK_API struct nk_vec2 nk_vec2v(const float *xy); -NK_API struct nk_vec2 nk_vec2iv(const int *xy); - -NK_API struct nk_rect nk_get_null_rect(void); -NK_API struct nk_rect nk_rect(float x, float y, float w, float h); -NK_API struct nk_rect nk_recti(int x, int y, int w, int h); -NK_API struct nk_rect nk_recta(struct nk_vec2 pos, struct nk_vec2 size); -NK_API struct nk_rect nk_rectv(const float *xywh); -NK_API struct nk_rect nk_rectiv(const int *xywh); -NK_API struct nk_vec2 nk_rect_pos(struct nk_rect); -NK_API struct nk_vec2 nk_rect_size(struct nk_rect); -/* ============================================================================= - * - * STRING - * - * ============================================================================= */ -NK_API int nk_strlen(const char *str); -NK_API int nk_stricmp(const char *s1, const char *s2); -NK_API int nk_stricmpn(const char *s1, const char *s2, int n); -NK_API int nk_strtoi(const char *str, const char **endptr); -NK_API float nk_strtof(const char *str, const char **endptr); -NK_API double nk_strtod(const char *str, const char **endptr); -NK_API int nk_strfilter(const char *text, const char *regexp); -NK_API int nk_strmatch_fuzzy_string(char const *str, char const *pattern, int *out_score); -NK_API int nk_strmatch_fuzzy_text(const char *txt, int txt_len, const char *pattern, int *out_score); -/* ============================================================================= - * - * UTF-8 - * - * ============================================================================= */ -NK_API int nk_utf_decode(const char*, nk_rune*, int); -NK_API int nk_utf_encode(nk_rune, char*, int); -NK_API int nk_utf_len(const char*, int byte_len); -NK_API const char* nk_utf_at(const char *buffer, int length, int index, nk_rune *unicode, int *len); -/* =============================================================== - * - * FONT - * - * ===============================================================*/ -/* Font handling in this library was designed to be quite customizable and lets - you decide what you want to use and what you want to provide. There are three - different ways to use the font atlas. The first two will use your font - handling scheme and only requires essential data to run nuklear. The next - slightly more advanced features is font handling with vertex buffer output. - Finally the most complex API wise is using nuklear's font baking API. - - 1.) Using your own implementation without vertex buffer output - -------------------------------------------------------------- - So first up the easiest way to do font handling is by just providing a - `nk_user_font` struct which only requires the height in pixel of the used - font and a callback to calculate the width of a string. This way of handling - fonts is best fitted for using the normal draw shape command API where you - do all the text drawing yourself and the library does not require any kind - of deeper knowledge about which font handling mechanism you use. - IMPORTANT: the `nk_user_font` pointer provided to nuklear has to persist - over the complete life time! I know this sucks but it is currently the only - way to switch between fonts. - - float your_text_width_calculation(nk_handle handle, float height, const char *text, int len) - { - your_font_type *type = handle.ptr; - float text_width = ...; - return text_width; - } - - struct nk_user_font font; - font.userdata.ptr = &your_font_class_or_struct; - font.height = your_font_height; - font.width = your_text_width_calculation; - - struct nk_context ctx; - nk_init_default(&ctx, &font); - - 2.) Using your own implementation with vertex buffer output - -------------------------------------------------------------- - While the first approach works fine if you don't want to use the optional - vertex buffer output it is not enough if you do. To get font handling working - for these cases you have to provide two additional parameters inside the - `nk_user_font`. First a texture atlas handle used to draw text as subimages - of a bigger font atlas texture and a callback to query a character's glyph - information (offset, size, ...). So it is still possible to provide your own - font and use the vertex buffer output. - - float your_text_width_calculation(nk_handle handle, float height, const char *text, int len) - { - your_font_type *type = handle.ptr; - float text_width = ...; - return text_width; - } - void query_your_font_glyph(nk_handle handle, float font_height, struct nk_user_font_glyph *glyph, nk_rune codepoint, nk_rune next_codepoint) - { - your_font_type *type = handle.ptr; - glyph.width = ...; - glyph.height = ...; - glyph.xadvance = ...; - glyph.uv[0].x = ...; - glyph.uv[0].y = ...; - glyph.uv[1].x = ...; - glyph.uv[1].y = ...; - glyph.offset.x = ...; - glyph.offset.y = ...; - } - - struct nk_user_font font; - font.userdata.ptr = &your_font_class_or_struct; - font.height = your_font_height; - font.width = your_text_width_calculation; - font.query = query_your_font_glyph; - font.texture.id = your_font_texture; - - struct nk_context ctx; - nk_init_default(&ctx, &font); - - 3.) Nuklear font baker - ------------------------------------ - The final approach if you do not have a font handling functionality or don't - want to use it in this library is by using the optional font baker. - The font baker APIs can be used to create a font plus font atlas texture - and can be used with or without the vertex buffer output. - - It still uses the `nk_user_font` struct and the two different approaches - previously stated still work. The font baker is not located inside - `nk_context` like all other systems since it can be understood as more of - an extension to nuklear and does not really depend on any `nk_context` state. - - Font baker need to be initialized first by one of the nk_font_atlas_init_xxx - functions. If you don't care about memory just call the default version - `nk_font_atlas_init_default` which will allocate all memory from the standard library. - If you want to control memory allocation but you don't care if the allocated - memory is temporary and therefore can be freed directly after the baking process - is over or permanent you can call `nk_font_atlas_init`. - - After successfully initializing the font baker you can add Truetype(.ttf) fonts from - different sources like memory or from file by calling one of the `nk_font_atlas_add_xxx`. - functions. Adding font will permanently store each font, font config and ttf memory block(!) - inside the font atlas and allows to reuse the font atlas. If you don't want to reuse - the font baker by for example adding additional fonts you can call - `nk_font_atlas_cleanup` after the baking process is over (after calling nk_font_atlas_end). - - As soon as you added all fonts you wanted you can now start the baking process - for every selected glyph to image by calling `nk_font_atlas_bake`. - The baking process returns image memory, width and height which can be used to - either create your own image object or upload it to any graphics library. - No matter which case you finally have to call `nk_font_atlas_end` which - will free all temporary memory including the font atlas image so make sure - you created our texture beforehand. `nk_font_atlas_end` requires a handle - to your font texture or object and optionally fills a `struct nk_draw_null_texture` - which can be used for the optional vertex output. If you don't want it just - set the argument to `NULL`. - - At this point you are done and if you don't want to reuse the font atlas you - can call `nk_font_atlas_cleanup` to free all truetype blobs and configuration - memory. Finally if you don't use the font atlas and any of it's fonts anymore - you need to call `nk_font_atlas_clear` to free all memory still being used. - - struct nk_font_atlas atlas; - nk_font_atlas_init_default(&atlas); - nk_font_atlas_begin(&atlas); - nk_font *font = nk_font_atlas_add_from_file(&atlas, "Path/To/Your/TTF_Font.ttf", 13, 0); - nk_font *font2 = nk_font_atlas_add_from_file(&atlas, "Path/To/Your/TTF_Font2.ttf", 16, 0); - const void* img = nk_font_atlas_bake(&atlas, &img_width, &img_height, NK_FONT_ATLAS_RGBA32); - nk_font_atlas_end(&atlas, nk_handle_id(texture), 0); - - struct nk_context ctx; - nk_init_default(&ctx, &font->handle); - while (1) { - - } - nk_font_atlas_clear(&atlas); - - The font baker API is probably the most complex API inside this library and - I would suggest reading some of my examples `example/` to get a grip on how - to use the font atlas. There are a number of details I left out. For example - how to merge fonts, configure a font with `nk_font_config` to use other languages, - use another texture coordinate format and a lot more: - - struct nk_font_config cfg = nk_font_config(font_pixel_height); - cfg.merge_mode = nk_false or nk_true; - cfg.range = nk_font_korean_glyph_ranges(); - cfg.coord_type = NK_COORD_PIXEL; - nk_font *font = nk_font_atlas_add_from_file(&atlas, "Path/To/Your/TTF_Font.ttf", 13, &cfg); - -*/ -struct nk_user_font_glyph; -typedef float(*nk_text_width_f)(nk_handle, float h, const char*, int len); -typedef void(*nk_query_font_glyph_f)(nk_handle handle, float font_height, - struct nk_user_font_glyph *glyph, - nk_rune codepoint, nk_rune next_codepoint); - -#if defined(NK_INCLUDE_VERTEX_BUFFER_OUTPUT) || defined(NK_INCLUDE_SOFTWARE_FONT) -struct nk_user_font_glyph { - struct nk_vec2 uv[2]; - /* texture coordinates */ - struct nk_vec2 offset; - /* offset between top left and glyph */ - float width, height; - /* size of the glyph */ - float xadvance; - /* offset to the next glyph */ -}; -#endif - -struct nk_user_font { - nk_handle userdata; - /* user provided font handle */ - float height; - /* max height of the font */ - nk_text_width_f width; - /* font string width in pixel callback */ -#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT - nk_query_font_glyph_f query; - /* font glyph callback to query drawing info */ - nk_handle texture; - /* texture handle to the used font atlas or texture */ -#endif -}; - -#ifdef NK_INCLUDE_FONT_BAKING -enum nk_font_coord_type { - NK_COORD_UV, /* texture coordinates inside font glyphs are clamped between 0-1 */ - NK_COORD_PIXEL /* texture coordinates inside font glyphs are in absolute pixel */ -}; - -struct nk_font; -struct nk_baked_font { - float height; - /* height of the font */ - float ascent, descent; - /* font glyphs ascent and descent */ - nk_rune glyph_offset; - /* glyph array offset inside the font glyph baking output array */ - nk_rune glyph_count; - /* number of glyphs of this font inside the glyph baking array output */ - const nk_rune *ranges; - /* font codepoint ranges as pairs of (from/to) and 0 as last element */ -}; - -struct nk_font_config { - struct nk_font_config *next; - /* NOTE: only used internally */ - void *ttf_blob; - /* pointer to loaded TTF file memory block. - * NOTE: not needed for nk_font_atlas_add_from_memory and nk_font_atlas_add_from_file. */ - nk_size ttf_size; - /* size of the loaded TTF file memory block - * NOTE: not needed for nk_font_atlas_add_from_memory and nk_font_atlas_add_from_file. */ - - unsigned char ttf_data_owned_by_atlas; - /* used inside font atlas: default to: 0*/ - unsigned char merge_mode; - /* merges this font into the last font */ - unsigned char pixel_snap; - /* align every character to pixel boundary (if true set oversample (1,1)) */ - unsigned char oversample_v, oversample_h; - /* rasterize at hight quality for sub-pixel position */ - unsigned char padding[3]; - - float size; - /* baked pixel height of the font */ - enum nk_font_coord_type coord_type; - /* texture coordinate format with either pixel or UV coordinates */ - struct nk_vec2 spacing; - /* extra pixel spacing between glyphs */ - const nk_rune *range; - /* list of unicode ranges (2 values per range, zero terminated) */ - struct nk_baked_font *font; - /* font to setup in the baking process: NOTE: not needed for font atlas */ - nk_rune fallback_glyph; - /* fallback glyph to use if a given rune is not found */ - struct nk_font_config *n; - struct nk_font_config *p; -}; - -struct nk_font_glyph { - nk_rune codepoint; - float xadvance; - float x0, y0, x1, y1, w, h; - float u0, v0, u1, v1; -}; - -struct nk_font { - struct nk_font *next; - struct nk_user_font handle; - struct nk_baked_font info; - float scale; - struct nk_font_glyph *glyphs; - const struct nk_font_glyph *fallback; - nk_rune fallback_codepoint; - nk_handle texture; - struct nk_font_config *config; -}; - -enum nk_font_atlas_format { - NK_FONT_ATLAS_ALPHA8, - NK_FONT_ATLAS_RGBA32 -}; - -struct nk_font_atlas { - void *pixel; - int tex_width; - int tex_height; - - struct nk_allocator permanent; - struct nk_allocator temporary; - - struct nk_recti custom; - struct nk_cursor cursors[NK_CURSOR_COUNT]; - - int glyph_count; - struct nk_font_glyph *glyphs; - struct nk_font *default_font; - struct nk_font *fonts; - struct nk_font_config *config; - int font_num; -}; - -/* some language glyph codepoint ranges */ -NK_API const nk_rune *nk_font_default_glyph_ranges(void); -NK_API const nk_rune *nk_font_chinese_glyph_ranges(void); -NK_API const nk_rune *nk_font_cyrillic_glyph_ranges(void); -NK_API const nk_rune *nk_font_korean_glyph_ranges(void); - -#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR -NK_API void nk_font_atlas_init_default(struct nk_font_atlas*); -#endif -NK_API void nk_font_atlas_init(struct nk_font_atlas*, struct nk_allocator*); -NK_API void nk_font_atlas_init_custom(struct nk_font_atlas*, struct nk_allocator *persistent, struct nk_allocator *transient); -NK_API void nk_font_atlas_begin(struct nk_font_atlas*); -NK_API struct nk_font_config nk_font_config(float pixel_height); -NK_API struct nk_font *nk_font_atlas_add(struct nk_font_atlas*, const struct nk_font_config*); -#ifdef NK_INCLUDE_DEFAULT_FONT -NK_API struct nk_font* nk_font_atlas_add_default(struct nk_font_atlas*, float height, const struct nk_font_config*); -#endif -NK_API struct nk_font* nk_font_atlas_add_from_memory(struct nk_font_atlas *atlas, void *memory, nk_size size, float height, const struct nk_font_config *config); -#ifdef NK_INCLUDE_STANDARD_IO -NK_API struct nk_font* nk_font_atlas_add_from_file(struct nk_font_atlas *atlas, const char *file_path, float height, const struct nk_font_config*); -#endif -NK_API struct nk_font *nk_font_atlas_add_compressed(struct nk_font_atlas*, void *memory, nk_size size, float height, const struct nk_font_config*); -NK_API struct nk_font* nk_font_atlas_add_compressed_base85(struct nk_font_atlas*, const char *data, float height, const struct nk_font_config *config); -NK_API const void* nk_font_atlas_bake(struct nk_font_atlas*, int *width, int *height, enum nk_font_atlas_format); -NK_API void nk_font_atlas_end(struct nk_font_atlas*, nk_handle tex, struct nk_draw_null_texture*); -NK_API const struct nk_font_glyph* nk_font_find_glyph(struct nk_font*, nk_rune unicode); -NK_API void nk_font_atlas_cleanup(struct nk_font_atlas *atlas); -NK_API void nk_font_atlas_clear(struct nk_font_atlas*); - -#endif - -/* ============================================================== - * - * MEMORY BUFFER - * - * ===============================================================*/ -/* A basic (double)-buffer with linear allocation and resetting as only - freeing policy. The buffer's main purpose is to control all memory management - inside the GUI toolkit and still leave memory control as much as possible in - the hand of the user while also making sure the library is easy to use if - not as much control is needed. - In general all memory inside this library can be provided from the user in - three different ways. - - The first way and the one providing most control is by just passing a fixed - size memory block. In this case all control lies in the hand of the user - since he can exactly control where the memory comes from and how much memory - the library should consume. Of course using the fixed size API removes the - ability to automatically resize a buffer if not enough memory is provided so - you have to take over the resizing. While being a fixed sized buffer sounds - quite limiting, it is very effective in this library since the actual memory - consumption is quite stable and has a fixed upper bound for a lot of cases. - - If you don't want to think about how much memory the library should allocate - at all time or have a very dynamic UI with unpredictable memory consumption - habits but still want control over memory allocation you can use the dynamic - allocator based API. The allocator consists of two callbacks for allocating - and freeing memory and optional userdata so you can plugin your own allocator. - - The final and easiest way can be used by defining - NK_INCLUDE_DEFAULT_ALLOCATOR which uses the standard library memory - allocation functions malloc and free and takes over complete control over - memory in this library. -*/ -struct nk_memory_status { - void *memory; - unsigned int type; - nk_size size; - nk_size allocated; - nk_size needed; - nk_size calls; -}; - -enum nk_allocation_type { - NK_BUFFER_FIXED, - NK_BUFFER_DYNAMIC -}; - -enum nk_buffer_allocation_type { - NK_BUFFER_FRONT, - NK_BUFFER_BACK, - NK_BUFFER_MAX -}; - -struct nk_buffer_marker { - int active; - nk_size offset; -}; - -struct nk_memory {void *ptr;nk_size size;}; -struct nk_buffer { - struct nk_buffer_marker marker[NK_BUFFER_MAX]; - /* buffer marker to free a buffer to a certain offset */ - struct nk_allocator pool; - /* allocator callback for dynamic buffers */ - enum nk_allocation_type type; - /* memory management type */ - struct nk_memory memory; - /* memory and size of the current memory block */ - float grow_factor; - /* growing factor for dynamic memory management */ - nk_size allocated; - /* total amount of memory allocated */ - nk_size needed; - /* totally consumed memory given that enough memory is present */ - nk_size calls; - /* number of allocation calls */ - nk_size size; - /* current size of the buffer */ -}; - -#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR -NK_API void nk_buffer_init_default(struct nk_buffer*); -#endif -NK_API void nk_buffer_init(struct nk_buffer*, const struct nk_allocator*, nk_size size); -NK_API void nk_buffer_init_fixed(struct nk_buffer*, void *memory, nk_size size); -NK_API void nk_buffer_info(struct nk_memory_status*, struct nk_buffer*); -NK_API void nk_buffer_push(struct nk_buffer*, enum nk_buffer_allocation_type type, const void *memory, nk_size size, nk_size align); -NK_API void nk_buffer_mark(struct nk_buffer*, enum nk_buffer_allocation_type type); -NK_API void nk_buffer_reset(struct nk_buffer*, enum nk_buffer_allocation_type type); -NK_API void nk_buffer_clear(struct nk_buffer*); -NK_API void nk_buffer_free(struct nk_buffer*); -NK_API void *nk_buffer_memory(struct nk_buffer*); -NK_API const void *nk_buffer_memory_const(const struct nk_buffer*); -NK_API nk_size nk_buffer_total(struct nk_buffer*); - -/* ============================================================== - * - * STRING - * - * ===============================================================*/ -/* Basic string buffer which is only used in context with the text editor - * to manage and manipulate dynamic or fixed size string content. This is _NOT_ - * the default string handling method. The only instance you should have any contact - * with this API is if you interact with an `nk_text_edit` object inside one of the - * copy and paste functions and even there only for more advanced cases. */ -struct nk_str { - struct nk_buffer buffer; - int len; /* in codepoints/runes/glyphs */ -}; - -#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR -NK_API void nk_str_init_default(struct nk_str*); -#endif -NK_API void nk_str_init(struct nk_str*, const struct nk_allocator*, nk_size size); -NK_API void nk_str_init_fixed(struct nk_str*, void *memory, nk_size size); -NK_API void nk_str_clear(struct nk_str*); -NK_API void nk_str_free(struct nk_str*); - -NK_API int nk_str_append_text_char(struct nk_str*, const char*, int); -NK_API int nk_str_append_str_char(struct nk_str*, const char*); -NK_API int nk_str_append_text_utf8(struct nk_str*, const char*, int); -NK_API int nk_str_append_str_utf8(struct nk_str*, const char*); -NK_API int nk_str_append_text_runes(struct nk_str*, const nk_rune*, int); -NK_API int nk_str_append_str_runes(struct nk_str*, const nk_rune*); - -NK_API int nk_str_insert_at_char(struct nk_str*, int pos, const char*, int); -NK_API int nk_str_insert_at_rune(struct nk_str*, int pos, const char*, int); - -NK_API int nk_str_insert_text_char(struct nk_str*, int pos, const char*, int); -NK_API int nk_str_insert_str_char(struct nk_str*, int pos, const char*); -NK_API int nk_str_insert_text_utf8(struct nk_str*, int pos, const char*, int); -NK_API int nk_str_insert_str_utf8(struct nk_str*, int pos, const char*); -NK_API int nk_str_insert_text_runes(struct nk_str*, int pos, const nk_rune*, int); -NK_API int nk_str_insert_str_runes(struct nk_str*, int pos, const nk_rune*); - -NK_API void nk_str_remove_chars(struct nk_str*, int len); -NK_API void nk_str_remove_runes(struct nk_str *str, int len); -NK_API void nk_str_delete_chars(struct nk_str*, int pos, int len); -NK_API void nk_str_delete_runes(struct nk_str*, int pos, int len); - -NK_API char *nk_str_at_char(struct nk_str*, int pos); -NK_API char *nk_str_at_rune(struct nk_str*, int pos, nk_rune *unicode, int *len); -NK_API nk_rune nk_str_rune_at(const struct nk_str*, int pos); -NK_API const char *nk_str_at_char_const(const struct nk_str*, int pos); -NK_API const char *nk_str_at_const(const struct nk_str*, int pos, nk_rune *unicode, int *len); - -NK_API char *nk_str_get(struct nk_str*); -NK_API const char *nk_str_get_const(const struct nk_str*); -NK_API int nk_str_len(struct nk_str*); -NK_API int nk_str_len_char(struct nk_str*); - -/*=============================================================== - * - * TEXT EDITOR - * - * ===============================================================*/ -/* Editing text in this library is handled by either `nk_edit_string` or - * `nk_edit_buffer`. But like almost everything in this library there are multiple - * ways of doing it and a balance between control and ease of use with memory - * as well as functionality controlled by flags. - * - * This library generally allows three different levels of memory control: - * First of is the most basic way of just providing a simple char array with - * string length. This method is probably the easiest way of handling simple - * user text input. Main upside is complete control over memory while the biggest - * downside in comparison with the other two approaches is missing undo/redo. - * - * For UIs that require undo/redo the second way was created. It is based on - * a fixed size nk_text_edit struct, which has an internal undo/redo stack. - * This is mainly useful if you want something more like a text editor but don't want - * to have a dynamically growing buffer. - * - * The final way is using a dynamically growing nk_text_edit struct, which - * has both a default version if you don't care where memory comes from and an - * allocator version if you do. While the text editor is quite powerful for its - * complexity I would not recommend editing gigabytes of data with it. - * It is rather designed for uses cases which make sense for a GUI library not for - * an full blown text editor. - */ -#ifndef NK_TEXTEDIT_UNDOSTATECOUNT -#define NK_TEXTEDIT_UNDOSTATECOUNT 99 -#endif - -#ifndef NK_TEXTEDIT_UNDOCHARCOUNT -#define NK_TEXTEDIT_UNDOCHARCOUNT 999 -#endif - -struct nk_text_edit; -struct nk_clipboard { - nk_handle userdata; - nk_plugin_paste paste; - nk_plugin_copy copy; -}; - -struct nk_text_undo_record { - int where; - short insert_length; - short delete_length; - short char_storage; -}; - -struct nk_text_undo_state { - struct nk_text_undo_record undo_rec[NK_TEXTEDIT_UNDOSTATECOUNT]; - nk_rune undo_char[NK_TEXTEDIT_UNDOCHARCOUNT]; - short undo_point; - short redo_point; - short undo_char_point; - short redo_char_point; -}; - -enum nk_text_edit_type { - NK_TEXT_EDIT_SINGLE_LINE, - NK_TEXT_EDIT_MULTI_LINE -}; - -enum nk_text_edit_mode { - NK_TEXT_EDIT_MODE_VIEW, - NK_TEXT_EDIT_MODE_INSERT, - NK_TEXT_EDIT_MODE_REPLACE -}; - -struct nk_text_edit { - struct nk_clipboard clip; - struct nk_str string; - nk_plugin_filter filter; - struct nk_vec2 scrollbar; - - int cursor; - int select_start; - int select_end; - unsigned char mode; - unsigned char cursor_at_end_of_line; - unsigned char initialized; - unsigned char has_preferred_x; - unsigned char single_line; - unsigned char active; - unsigned char padding1; - float preferred_x; - struct nk_text_undo_state undo; -}; - -/* filter function */ -NK_API int nk_filter_default(const struct nk_text_edit*, nk_rune unicode); -NK_API int nk_filter_ascii(const struct nk_text_edit*, nk_rune unicode); -NK_API int nk_filter_float(const struct nk_text_edit*, nk_rune unicode); -NK_API int nk_filter_decimal(const struct nk_text_edit*, nk_rune unicode); -NK_API int nk_filter_hex(const struct nk_text_edit*, nk_rune unicode); -NK_API int nk_filter_oct(const struct nk_text_edit*, nk_rune unicode); -NK_API int nk_filter_binary(const struct nk_text_edit*, nk_rune unicode); - -/* text editor */ -#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR -NK_API void nk_textedit_init_default(struct nk_text_edit*); -#endif -NK_API void nk_textedit_init(struct nk_text_edit*, struct nk_allocator*, nk_size size); -NK_API void nk_textedit_init_fixed(struct nk_text_edit*, void *memory, nk_size size); -NK_API void nk_textedit_free(struct nk_text_edit*); -NK_API void nk_textedit_text(struct nk_text_edit*, const char*, int total_len); -NK_API void nk_textedit_delete(struct nk_text_edit*, int where, int len); -NK_API void nk_textedit_delete_selection(struct nk_text_edit*); -NK_API void nk_textedit_select_all(struct nk_text_edit*); -NK_API int nk_textedit_cut(struct nk_text_edit*); -NK_API int nk_textedit_paste(struct nk_text_edit*, char const*, int len); -NK_API void nk_textedit_undo(struct nk_text_edit*); -NK_API void nk_textedit_redo(struct nk_text_edit*); - -/* =============================================================== - * - * DRAWING - * - * ===============================================================*/ -/* This library was designed to be render backend agnostic so it does - not draw anything to screen. Instead all drawn shapes, widgets - are made of, are buffered into memory and make up a command queue. - Each frame therefore fills the command buffer with draw commands - that then need to be executed by the user and his own render backend. - After that the command buffer needs to be cleared and a new frame can be - started. It is probably important to note that the command buffer is the main - drawing API and the optional vertex buffer API only takes this format and - converts it into a hardware accessible format. - - To use the command queue to draw your own widgets you can access the - command buffer of each window by calling `nk_window_get_canvas` after - previously having called `nk_begin`: - - void draw_red_rectangle_widget(struct nk_context *ctx) - { - struct nk_command_buffer *canvas; - struct nk_input *input = &ctx->input; - canvas = nk_window_get_canvas(ctx); - - struct nk_rect space; - enum nk_widget_layout_states state; - state = nk_widget(&space, ctx); - if (!state) return; - - if (state != NK_WIDGET_ROM) - update_your_widget_by_user_input(...); - nk_fill_rect(canvas, space, 0, nk_rgb(255,0,0)); - } - - if (nk_begin(...)) { - nk_layout_row_dynamic(ctx, 25, 1); - draw_red_rectangle_widget(ctx); - } - nk_end(..) - - Important to know if you want to create your own widgets is the `nk_widget` - call. It allocates space on the panel reserved for this widget to be used, - but also returns the state of the widget space. If your widget is not seen and does - not have to be updated it is '0' and you can just return. If it only has - to be drawn the state will be `NK_WIDGET_ROM` otherwise you can do both - update and draw your widget. The reason for separating is to only draw and - update what is actually necessary which is crucial for performance. -*/ -enum nk_command_type { - NK_COMMAND_NOP, - NK_COMMAND_SCISSOR, - NK_COMMAND_LINE, - NK_COMMAND_CURVE, - NK_COMMAND_RECT, - NK_COMMAND_RECT_FILLED, - NK_COMMAND_RECT_MULTI_COLOR, - NK_COMMAND_CIRCLE, - NK_COMMAND_CIRCLE_FILLED, - NK_COMMAND_ARC, - NK_COMMAND_ARC_FILLED, - NK_COMMAND_TRIANGLE, - NK_COMMAND_TRIANGLE_FILLED, - NK_COMMAND_POLYGON, - NK_COMMAND_POLYGON_FILLED, - NK_COMMAND_POLYLINE, - NK_COMMAND_TEXT, - NK_COMMAND_IMAGE, - NK_COMMAND_CUSTOM -}; - -/* command base and header of every command inside the buffer */ -struct nk_command { - enum nk_command_type type; - nk_size next; -#ifdef NK_INCLUDE_COMMAND_USERDATA - nk_handle userdata; -#endif -}; - -struct nk_command_scissor { - struct nk_command header; - short x, y; - unsigned short w, h; -}; - -struct nk_command_line { - struct nk_command header; - unsigned short line_thickness; - struct nk_vec2i begin; - struct nk_vec2i end; - struct nk_color color; -}; - -struct nk_command_curve { - struct nk_command header; - unsigned short line_thickness; - struct nk_vec2i begin; - struct nk_vec2i end; - struct nk_vec2i ctrl[2]; - struct nk_color color; -}; - -struct nk_command_rect { - struct nk_command header; - unsigned short rounding; - unsigned short line_thickness; - short x, y; - unsigned short w, h; - struct nk_color color; -}; - -struct nk_command_rect_filled { - struct nk_command header; - unsigned short rounding; - short x, y; - unsigned short w, h; - struct nk_color color; -}; - -struct nk_command_rect_multi_color { - struct nk_command header; - short x, y; - unsigned short w, h; - struct nk_color left; - struct nk_color top; - struct nk_color bottom; - struct nk_color right; -}; - -struct nk_command_triangle { - struct nk_command header; - unsigned short line_thickness; - struct nk_vec2i a; - struct nk_vec2i b; - struct nk_vec2i c; - struct nk_color color; -}; - -struct nk_command_triangle_filled { - struct nk_command header; - struct nk_vec2i a; - struct nk_vec2i b; - struct nk_vec2i c; - struct nk_color color; -}; - -struct nk_command_circle { - struct nk_command header; - short x, y; - unsigned short line_thickness; - unsigned short w, h; - struct nk_color color; -}; - -struct nk_command_circle_filled { - struct nk_command header; - short x, y; - unsigned short w, h; - struct nk_color color; -}; - -struct nk_command_arc { - struct nk_command header; - short cx, cy; - unsigned short r; - unsigned short line_thickness; - float a[2]; - struct nk_color color; -}; - -struct nk_command_arc_filled { - struct nk_command header; - short cx, cy; - unsigned short r; - float a[2]; - struct nk_color color; -}; - -struct nk_command_polygon { - struct nk_command header; - struct nk_color color; - unsigned short line_thickness; - unsigned short point_count; - struct nk_vec2i points[1]; -}; - -struct nk_command_polygon_filled { - struct nk_command header; - struct nk_color color; - unsigned short point_count; - struct nk_vec2i points[1]; -}; - -struct nk_command_polyline { - struct nk_command header; - struct nk_color color; - unsigned short line_thickness; - unsigned short point_count; - struct nk_vec2i points[1]; -}; - -struct nk_command_image { - struct nk_command header; - short x, y; - unsigned short w, h; - struct nk_image img; - struct nk_color col; -}; - -typedef void (*nk_command_custom_callback)(void *canvas, short x,short y, - unsigned short w, unsigned short h, nk_handle callback_data); -struct nk_command_custom { - struct nk_command header; - short x, y; - unsigned short w, h; - nk_handle callback_data; - nk_command_custom_callback callback; -}; - -struct nk_command_text { - struct nk_command header; - const struct nk_user_font *font; - struct nk_color background; - struct nk_color foreground; - short x, y; - unsigned short w, h; - float height; - int length; - char string[1]; -}; - -enum nk_command_clipping { - NK_CLIPPING_OFF = nk_false, - NK_CLIPPING_ON = nk_true -}; - -struct nk_command_buffer { - struct nk_buffer *base; - struct nk_rect clip; - int use_clipping; - nk_handle userdata; - nk_size begin, end, last; -}; - -/* shape outlines */ -NK_API void nk_stroke_line(struct nk_command_buffer *b, float x0, float y0, float x1, float y1, float line_thickness, struct nk_color); -NK_API void nk_stroke_curve(struct nk_command_buffer*, float, float, float, float, float, float, float, float, float line_thickness, struct nk_color); -NK_API void nk_stroke_rect(struct nk_command_buffer*, struct nk_rect, float rounding, float line_thickness, struct nk_color); -NK_API void nk_stroke_circle(struct nk_command_buffer*, struct nk_rect, float line_thickness, struct nk_color); -NK_API void nk_stroke_arc(struct nk_command_buffer*, float cx, float cy, float radius, float a_min, float a_max, float line_thickness, struct nk_color); -NK_API void nk_stroke_triangle(struct nk_command_buffer*, float, float, float, float, float, float, float line_thichness, struct nk_color); -NK_API void nk_stroke_polyline(struct nk_command_buffer*, float *points, int point_count, float line_thickness, struct nk_color col); -NK_API void nk_stroke_polygon(struct nk_command_buffer*, float*, int point_count, float line_thickness, struct nk_color); - -/* filled shades */ -NK_API void nk_fill_rect(struct nk_command_buffer*, struct nk_rect, float rounding, struct nk_color); -NK_API void nk_fill_rect_multi_color(struct nk_command_buffer*, struct nk_rect, struct nk_color left, struct nk_color top, struct nk_color right, struct nk_color bottom); -NK_API void nk_fill_circle(struct nk_command_buffer*, struct nk_rect, struct nk_color); -NK_API void nk_fill_arc(struct nk_command_buffer*, float cx, float cy, float radius, float a_min, float a_max, struct nk_color); -NK_API void nk_fill_triangle(struct nk_command_buffer*, float x0, float y0, float x1, float y1, float x2, float y2, struct nk_color); -NK_API void nk_fill_polygon(struct nk_command_buffer*, float*, int point_count, struct nk_color); - -/* misc */ -NK_API void nk_draw_image(struct nk_command_buffer*, struct nk_rect, const struct nk_image*, struct nk_color); -NK_API void nk_draw_text(struct nk_command_buffer*, struct nk_rect, const char *text, int len, const struct nk_user_font*, struct nk_color, struct nk_color); -NK_API void nk_push_scissor(struct nk_command_buffer*, struct nk_rect); -NK_API void nk_push_custom(struct nk_command_buffer*, struct nk_rect, nk_command_custom_callback, nk_handle usr); - -/* =============================================================== - * - * INPUT - * - * ===============================================================*/ -struct nk_mouse_button { - int down; - unsigned int clicked; - struct nk_vec2 clicked_pos; -}; -struct nk_mouse { - struct nk_mouse_button buttons[NK_BUTTON_MAX]; - struct nk_vec2 pos; - struct nk_vec2 prev; - struct nk_vec2 delta; - struct nk_vec2 scroll_delta; - unsigned char grab; - unsigned char grabbed; - unsigned char ungrab; -}; - -struct nk_key { - int down; - unsigned int clicked; -}; -struct nk_keyboard { - struct nk_key keys[NK_KEY_MAX]; - char text[NK_INPUT_MAX]; - int text_len; -}; - -struct nk_input { - struct nk_keyboard keyboard; - struct nk_mouse mouse; -}; - -NK_API int nk_input_has_mouse_click(const struct nk_input*, enum nk_buttons); -NK_API int nk_input_has_mouse_click_in_rect(const struct nk_input*, enum nk_buttons, struct nk_rect); -NK_API int nk_input_has_mouse_click_down_in_rect(const struct nk_input*, enum nk_buttons, struct nk_rect, int down); -NK_API int nk_input_is_mouse_click_in_rect(const struct nk_input*, enum nk_buttons, struct nk_rect); -NK_API int nk_input_is_mouse_click_down_in_rect(const struct nk_input *i, enum nk_buttons id, struct nk_rect b, int down); -NK_API int nk_input_any_mouse_click_in_rect(const struct nk_input*, struct nk_rect); -NK_API int nk_input_is_mouse_prev_hovering_rect(const struct nk_input*, struct nk_rect); -NK_API int nk_input_is_mouse_hovering_rect(const struct nk_input*, struct nk_rect); -NK_API int nk_input_mouse_clicked(const struct nk_input*, enum nk_buttons, struct nk_rect); -NK_API int nk_input_is_mouse_down(const struct nk_input*, enum nk_buttons); -NK_API int nk_input_is_mouse_pressed(const struct nk_input*, enum nk_buttons); -NK_API int nk_input_is_mouse_released(const struct nk_input*, enum nk_buttons); -NK_API int nk_input_is_key_pressed(const struct nk_input*, enum nk_keys); -NK_API int nk_input_is_key_released(const struct nk_input*, enum nk_keys); -NK_API int nk_input_is_key_down(const struct nk_input*, enum nk_keys); - -/* =============================================================== - * - * DRAW LIST - * - * ===============================================================*/ -#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT -/* The optional vertex buffer draw list provides a 2D drawing context - with antialiasing functionality which takes basic filled or outlined shapes - or a path and outputs vertexes, elements and draw commands. - The actual draw list API is not required to be used directly while using this - library since converting the default library draw command output is done by - just calling `nk_convert` but I decided to still make this library accessible - since it can be useful. - - The draw list is based on a path buffering and polygon and polyline - rendering API which allows a lot of ways to draw 2D content to screen. - In fact it is probably more powerful than needed but allows even more crazy - things than this library provides by default. -*/ -#ifdef NK_UINT_DRAW_INDEX -typedef nk_uint nk_draw_index; -#else -typedef nk_ushort nk_draw_index; -#endif -enum nk_draw_list_stroke { - NK_STROKE_OPEN = nk_false, - /* build up path has no connection back to the beginning */ - NK_STROKE_CLOSED = nk_true - /* build up path has a connection back to the beginning */ -}; - -enum nk_draw_vertex_layout_attribute { - NK_VERTEX_POSITION, - NK_VERTEX_COLOR, - NK_VERTEX_TEXCOORD, - NK_VERTEX_ATTRIBUTE_COUNT -}; - -enum nk_draw_vertex_layout_format { - NK_FORMAT_SCHAR, - NK_FORMAT_SSHORT, - NK_FORMAT_SINT, - NK_FORMAT_UCHAR, - NK_FORMAT_USHORT, - NK_FORMAT_UINT, - NK_FORMAT_FLOAT, - NK_FORMAT_DOUBLE, - -NK_FORMAT_COLOR_BEGIN, - NK_FORMAT_R8G8B8 = NK_FORMAT_COLOR_BEGIN, - NK_FORMAT_R16G15B16, - NK_FORMAT_R32G32B32, - - NK_FORMAT_R8G8B8A8, - NK_FORMAT_B8G8R8A8, - NK_FORMAT_R16G15B16A16, - NK_FORMAT_R32G32B32A32, - NK_FORMAT_R32G32B32A32_FLOAT, - NK_FORMAT_R32G32B32A32_DOUBLE, - - NK_FORMAT_RGB32, - NK_FORMAT_RGBA32, -NK_FORMAT_COLOR_END = NK_FORMAT_RGBA32, - NK_FORMAT_COUNT -}; - -#define NK_VERTEX_LAYOUT_END NK_VERTEX_ATTRIBUTE_COUNT,NK_FORMAT_COUNT,0 -struct nk_draw_vertex_layout_element { - enum nk_draw_vertex_layout_attribute attribute; - enum nk_draw_vertex_layout_format format; - nk_size offset; -}; - -struct nk_draw_command { - unsigned int elem_count; - /* number of elements in the current draw batch */ - struct nk_rect clip_rect; - /* current screen clipping rectangle */ - nk_handle texture; - /* current texture to set */ -#ifdef NK_INCLUDE_COMMAND_USERDATA - nk_handle userdata; -#endif -}; - -struct nk_draw_list { - struct nk_rect clip_rect; - struct nk_vec2 circle_vtx[12]; - struct nk_convert_config config; - - struct nk_buffer *buffer; - struct nk_buffer *vertices; - struct nk_buffer *elements; - - unsigned int element_count; - unsigned int vertex_count; - unsigned int cmd_count; - nk_size cmd_offset; - - unsigned int path_count; - unsigned int path_offset; - - enum nk_anti_aliasing line_AA; - enum nk_anti_aliasing shape_AA; - -#ifdef NK_INCLUDE_COMMAND_USERDATA - nk_handle userdata; -#endif -}; - -/* draw list */ -NK_API void nk_draw_list_init(struct nk_draw_list*); -NK_API void nk_draw_list_setup(struct nk_draw_list*, const struct nk_convert_config*, struct nk_buffer *cmds, struct nk_buffer *vertices, struct nk_buffer *elements, enum nk_anti_aliasing line_aa,enum nk_anti_aliasing shape_aa); - -/* drawing */ -#define nk_draw_list_foreach(cmd, can, b) for((cmd)=nk__draw_list_begin(can, b); (cmd)!=0; (cmd)=nk__draw_list_next(cmd, b, can)) -NK_API const struct nk_draw_command* nk__draw_list_begin(const struct nk_draw_list*, const struct nk_buffer*); -NK_API const struct nk_draw_command* nk__draw_list_next(const struct nk_draw_command*, const struct nk_buffer*, const struct nk_draw_list*); -NK_API const struct nk_draw_command* nk__draw_list_end(const struct nk_draw_list*, const struct nk_buffer*); - -/* path */ -NK_API void nk_draw_list_path_clear(struct nk_draw_list*); -NK_API void nk_draw_list_path_line_to(struct nk_draw_list*, struct nk_vec2 pos); -NK_API void nk_draw_list_path_arc_to_fast(struct nk_draw_list*, struct nk_vec2 center, float radius, int a_min, int a_max); -NK_API void nk_draw_list_path_arc_to(struct nk_draw_list*, struct nk_vec2 center, float radius, float a_min, float a_max, unsigned int segments); -NK_API void nk_draw_list_path_rect_to(struct nk_draw_list*, struct nk_vec2 a, struct nk_vec2 b, float rounding); -NK_API void nk_draw_list_path_curve_to(struct nk_draw_list*, struct nk_vec2 p2, struct nk_vec2 p3, struct nk_vec2 p4, unsigned int num_segments); -NK_API void nk_draw_list_path_fill(struct nk_draw_list*, struct nk_color); -NK_API void nk_draw_list_path_stroke(struct nk_draw_list*, struct nk_color, enum nk_draw_list_stroke closed, float thickness); - -/* stroke */ -NK_API void nk_draw_list_stroke_line(struct nk_draw_list*, struct nk_vec2 a, struct nk_vec2 b, struct nk_color, float thickness); -NK_API void nk_draw_list_stroke_rect(struct nk_draw_list*, struct nk_rect rect, struct nk_color, float rounding, float thickness); -NK_API void nk_draw_list_stroke_triangle(struct nk_draw_list*, struct nk_vec2 a, struct nk_vec2 b, struct nk_vec2 c, struct nk_color, float thickness); -NK_API void nk_draw_list_stroke_circle(struct nk_draw_list*, struct nk_vec2 center, float radius, struct nk_color, unsigned int segs, float thickness); -NK_API void nk_draw_list_stroke_curve(struct nk_draw_list*, struct nk_vec2 p0, struct nk_vec2 cp0, struct nk_vec2 cp1, struct nk_vec2 p1, struct nk_color, unsigned int segments, float thickness); -NK_API void nk_draw_list_stroke_poly_line(struct nk_draw_list*, const struct nk_vec2 *pnts, const unsigned int cnt, struct nk_color, enum nk_draw_list_stroke, float thickness, enum nk_anti_aliasing); - -/* fill */ -NK_API void nk_draw_list_fill_rect(struct nk_draw_list*, struct nk_rect rect, struct nk_color, float rounding); -NK_API void nk_draw_list_fill_rect_multi_color(struct nk_draw_list*, struct nk_rect rect, struct nk_color left, struct nk_color top, struct nk_color right, struct nk_color bottom); -NK_API void nk_draw_list_fill_triangle(struct nk_draw_list*, struct nk_vec2 a, struct nk_vec2 b, struct nk_vec2 c, struct nk_color); -NK_API void nk_draw_list_fill_circle(struct nk_draw_list*, struct nk_vec2 center, float radius, struct nk_color col, unsigned int segs); -NK_API void nk_draw_list_fill_poly_convex(struct nk_draw_list*, const struct nk_vec2 *points, const unsigned int count, struct nk_color, enum nk_anti_aliasing); - -/* misc */ -NK_API void nk_draw_list_add_image(struct nk_draw_list*, struct nk_image texture, struct nk_rect rect, struct nk_color); -NK_API void nk_draw_list_add_text(struct nk_draw_list*, const struct nk_user_font*, struct nk_rect, const char *text, int len, float font_height, struct nk_color); -#ifdef NK_INCLUDE_COMMAND_USERDATA -NK_API void nk_draw_list_push_userdata(struct nk_draw_list*, nk_handle userdata); -#endif - -#endif - -/* =============================================================== - * - * GUI - * - * ===============================================================*/ -enum nk_style_item_type { - NK_STYLE_ITEM_COLOR, - NK_STYLE_ITEM_IMAGE -}; - -union nk_style_item_data { - struct nk_image image; - struct nk_color color; -}; - -struct nk_style_item { - enum nk_style_item_type type; - union nk_style_item_data data; -}; - -struct nk_style_text { - struct nk_color color; - struct nk_vec2 padding; -}; - -struct nk_style_button { - /* background */ - struct nk_style_item normal; - struct nk_style_item hover; - struct nk_style_item active; - struct nk_color border_color; - - /* text */ - struct nk_color text_background; - struct nk_color text_normal; - struct nk_color text_hover; - struct nk_color text_active; - nk_flags text_alignment; - - /* properties */ - float border; - float rounding; - struct nk_vec2 padding; - struct nk_vec2 image_padding; - struct nk_vec2 touch_padding; - - /* optional user callbacks */ - nk_handle userdata; - void(*draw_begin)(struct nk_command_buffer*, nk_handle userdata); - void(*draw_end)(struct nk_command_buffer*, nk_handle userdata); -}; - -struct nk_style_toggle { - /* background */ - struct nk_style_item normal; - struct nk_style_item hover; - struct nk_style_item active; - struct nk_color border_color; - - /* cursor */ - struct nk_style_item cursor_normal; - struct nk_style_item cursor_hover; - - /* text */ - struct nk_color text_normal; - struct nk_color text_hover; - struct nk_color text_active; - struct nk_color text_background; - nk_flags text_alignment; - - /* properties */ - struct nk_vec2 padding; - struct nk_vec2 touch_padding; - float spacing; - float border; - - /* optional user callbacks */ - nk_handle userdata; - void(*draw_begin)(struct nk_command_buffer*, nk_handle); - void(*draw_end)(struct nk_command_buffer*, nk_handle); -}; - -struct nk_style_selectable { - /* background (inactive) */ - struct nk_style_item normal; - struct nk_style_item hover; - struct nk_style_item pressed; - - /* background (active) */ - struct nk_style_item normal_active; - struct nk_style_item hover_active; - struct nk_style_item pressed_active; - - /* text color (inactive) */ - struct nk_color text_normal; - struct nk_color text_hover; - struct nk_color text_pressed; - - /* text color (active) */ - struct nk_color text_normal_active; - struct nk_color text_hover_active; - struct nk_color text_pressed_active; - struct nk_color text_background; - nk_flags text_alignment; - - /* properties */ - float rounding; - struct nk_vec2 padding; - struct nk_vec2 touch_padding; - struct nk_vec2 image_padding; - - /* optional user callbacks */ - nk_handle userdata; - void(*draw_begin)(struct nk_command_buffer*, nk_handle); - void(*draw_end)(struct nk_command_buffer*, nk_handle); -}; - -struct nk_style_slider { - /* background */ - struct nk_style_item normal; - struct nk_style_item hover; - struct nk_style_item active; - struct nk_color border_color; - - /* background bar */ - struct nk_color bar_normal; - struct nk_color bar_hover; - struct nk_color bar_active; - struct nk_color bar_filled; - - /* cursor */ - struct nk_style_item cursor_normal; - struct nk_style_item cursor_hover; - struct nk_style_item cursor_active; - - /* properties */ - float border; - float rounding; - float bar_height; - struct nk_vec2 padding; - struct nk_vec2 spacing; - struct nk_vec2 cursor_size; - - /* optional buttons */ - int show_buttons; - struct nk_style_button inc_button; - struct nk_style_button dec_button; - enum nk_symbol_type inc_symbol; - enum nk_symbol_type dec_symbol; - - /* optional user callbacks */ - nk_handle userdata; - void(*draw_begin)(struct nk_command_buffer*, nk_handle); - void(*draw_end)(struct nk_command_buffer*, nk_handle); -}; - -struct nk_style_progress { - /* background */ - struct nk_style_item normal; - struct nk_style_item hover; - struct nk_style_item active; - struct nk_color border_color; - - /* cursor */ - struct nk_style_item cursor_normal; - struct nk_style_item cursor_hover; - struct nk_style_item cursor_active; - struct nk_color cursor_border_color; - - /* properties */ - float rounding; - float border; - float cursor_border; - float cursor_rounding; - struct nk_vec2 padding; - - /* optional user callbacks */ - nk_handle userdata; - void(*draw_begin)(struct nk_command_buffer*, nk_handle); - void(*draw_end)(struct nk_command_buffer*, nk_handle); -}; - -struct nk_style_scrollbar { - /* background */ - struct nk_style_item normal; - struct nk_style_item hover; - struct nk_style_item active; - struct nk_color border_color; - - /* cursor */ - struct nk_style_item cursor_normal; - struct nk_style_item cursor_hover; - struct nk_style_item cursor_active; - struct nk_color cursor_border_color; - - /* properties */ - float border; - float rounding; - float border_cursor; - float rounding_cursor; - struct nk_vec2 padding; - - /* optional buttons */ - int show_buttons; - struct nk_style_button inc_button; - struct nk_style_button dec_button; - enum nk_symbol_type inc_symbol; - enum nk_symbol_type dec_symbol; - - /* optional user callbacks */ - nk_handle userdata; - void(*draw_begin)(struct nk_command_buffer*, nk_handle); - void(*draw_end)(struct nk_command_buffer*, nk_handle); -}; - -struct nk_style_edit { - /* background */ - struct nk_style_item normal; - struct nk_style_item hover; - struct nk_style_item active; - struct nk_color border_color; - struct nk_style_scrollbar scrollbar; - - /* cursor */ - struct nk_color cursor_normal; - struct nk_color cursor_hover; - struct nk_color cursor_text_normal; - struct nk_color cursor_text_hover; - - /* text (unselected) */ - struct nk_color text_normal; - struct nk_color text_hover; - struct nk_color text_active; - - /* text (selected) */ - struct nk_color selected_normal; - struct nk_color selected_hover; - struct nk_color selected_text_normal; - struct nk_color selected_text_hover; - - /* properties */ - float border; - float rounding; - float cursor_size; - struct nk_vec2 scrollbar_size; - struct nk_vec2 padding; - float row_padding; -}; - -struct nk_style_property { - /* background */ - struct nk_style_item normal; - struct nk_style_item hover; - struct nk_style_item active; - struct nk_color border_color; - - /* text */ - struct nk_color label_normal; - struct nk_color label_hover; - struct nk_color label_active; - - /* symbols */ - enum nk_symbol_type sym_left; - enum nk_symbol_type sym_right; - - /* properties */ - float border; - float rounding; - struct nk_vec2 padding; - - struct nk_style_edit edit; - struct nk_style_button inc_button; - struct nk_style_button dec_button; - - /* optional user callbacks */ - nk_handle userdata; - void(*draw_begin)(struct nk_command_buffer*, nk_handle); - void(*draw_end)(struct nk_command_buffer*, nk_handle); -}; - -struct nk_style_chart { - /* colors */ - struct nk_style_item background; - struct nk_color border_color; - struct nk_color selected_color; - struct nk_color color; - - /* properties */ - float border; - float rounding; - struct nk_vec2 padding; -}; - -struct nk_style_combo { - /* background */ - struct nk_style_item normal; - struct nk_style_item hover; - struct nk_style_item active; - struct nk_color border_color; - - /* label */ - struct nk_color label_normal; - struct nk_color label_hover; - struct nk_color label_active; - - /* symbol */ - struct nk_color symbol_normal; - struct nk_color symbol_hover; - struct nk_color symbol_active; - - /* button */ - struct nk_style_button button; - enum nk_symbol_type sym_normal; - enum nk_symbol_type sym_hover; - enum nk_symbol_type sym_active; - - /* properties */ - float border; - float rounding; - struct nk_vec2 content_padding; - struct nk_vec2 button_padding; - struct nk_vec2 spacing; -}; - -struct nk_style_tab { - /* background */ - struct nk_style_item background; - struct nk_color border_color; - struct nk_color text; - - /* button */ - struct nk_style_button tab_maximize_button; - struct nk_style_button tab_minimize_button; - struct nk_style_button node_maximize_button; - struct nk_style_button node_minimize_button; - enum nk_symbol_type sym_minimize; - enum nk_symbol_type sym_maximize; - - /* properties */ - float border; - float rounding; - float indent; - struct nk_vec2 padding; - struct nk_vec2 spacing; -}; - -enum nk_style_header_align { - NK_HEADER_LEFT, - NK_HEADER_RIGHT -}; -struct nk_style_window_header { - /* background */ - struct nk_style_item normal; - struct nk_style_item hover; - struct nk_style_item active; - - /* button */ - struct nk_style_button close_button; - struct nk_style_button minimize_button; - enum nk_symbol_type close_symbol; - enum nk_symbol_type minimize_symbol; - enum nk_symbol_type maximize_symbol; - - /* title */ - struct nk_color label_normal; - struct nk_color label_hover; - struct nk_color label_active; - - /* properties */ - enum nk_style_header_align align; - struct nk_vec2 padding; - struct nk_vec2 label_padding; - struct nk_vec2 spacing; -}; - -struct nk_style_window { - struct nk_style_window_header header; - struct nk_style_item fixed_background; - struct nk_color background; - - struct nk_color border_color; - struct nk_color popup_border_color; - struct nk_color combo_border_color; - struct nk_color contextual_border_color; - struct nk_color menu_border_color; - struct nk_color group_border_color; - struct nk_color tooltip_border_color; - struct nk_style_item scaler; - - float border; - float combo_border; - float contextual_border; - float menu_border; - float group_border; - float tooltip_border; - float popup_border; - float min_row_height_padding; - - float rounding; - struct nk_vec2 spacing; - struct nk_vec2 scrollbar_size; - struct nk_vec2 min_size; - - struct nk_vec2 padding; - struct nk_vec2 group_padding; - struct nk_vec2 popup_padding; - struct nk_vec2 combo_padding; - struct nk_vec2 contextual_padding; - struct nk_vec2 menu_padding; - struct nk_vec2 tooltip_padding; -}; - -struct nk_style { - const struct nk_user_font *font; - const struct nk_cursor *cursors[NK_CURSOR_COUNT]; - const struct nk_cursor *cursor_active; - struct nk_cursor *cursor_last; - int cursor_visible; - - struct nk_style_text text; - struct nk_style_button button; - struct nk_style_button contextual_button; - struct nk_style_button menu_button; - struct nk_style_toggle option; - struct nk_style_toggle checkbox; - struct nk_style_selectable selectable; - struct nk_style_slider slider; - struct nk_style_progress progress; - struct nk_style_property property; - struct nk_style_edit edit; - struct nk_style_chart chart; - struct nk_style_scrollbar scrollh; - struct nk_style_scrollbar scrollv; - struct nk_style_tab tab; - struct nk_style_combo combo; - struct nk_style_window window; -}; - -NK_API struct nk_style_item nk_style_item_image(struct nk_image img); -NK_API struct nk_style_item nk_style_item_color(struct nk_color); -NK_API struct nk_style_item nk_style_item_hide(void); - -/*============================================================== - * PANEL - * =============================================================*/ -#ifndef NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS -#define NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS 16 -#endif -#ifndef NK_CHART_MAX_SLOT -#define NK_CHART_MAX_SLOT 4 -#endif - -enum nk_panel_type { - NK_PANEL_NONE = 0, - NK_PANEL_WINDOW = NK_FLAG(0), - NK_PANEL_GROUP = NK_FLAG(1), - NK_PANEL_POPUP = NK_FLAG(2), - NK_PANEL_CONTEXTUAL = NK_FLAG(4), - NK_PANEL_COMBO = NK_FLAG(5), - NK_PANEL_MENU = NK_FLAG(6), - NK_PANEL_TOOLTIP = NK_FLAG(7) -}; -enum nk_panel_set { - NK_PANEL_SET_NONBLOCK = NK_PANEL_CONTEXTUAL|NK_PANEL_COMBO|NK_PANEL_MENU|NK_PANEL_TOOLTIP, - NK_PANEL_SET_POPUP = NK_PANEL_SET_NONBLOCK|NK_PANEL_POPUP, - NK_PANEL_SET_SUB = NK_PANEL_SET_POPUP|NK_PANEL_GROUP -}; - -struct nk_chart_slot { - enum nk_chart_type type; - struct nk_color color; - struct nk_color highlight; - float min, max, range; - int count; - struct nk_vec2 last; - int index; -}; - -struct nk_chart { - int slot; - float x, y, w, h; - struct nk_chart_slot slots[NK_CHART_MAX_SLOT]; -}; - -enum nk_panel_row_layout_type { - NK_LAYOUT_DYNAMIC_FIXED = 0, - NK_LAYOUT_DYNAMIC_ROW, - NK_LAYOUT_DYNAMIC_FREE, - NK_LAYOUT_DYNAMIC, - NK_LAYOUT_STATIC_FIXED, - NK_LAYOUT_STATIC_ROW, - NK_LAYOUT_STATIC_FREE, - NK_LAYOUT_STATIC, - NK_LAYOUT_TEMPLATE, - NK_LAYOUT_COUNT -}; -struct nk_row_layout { - enum nk_panel_row_layout_type type; - int index; - float height; - float min_height; - int columns; - const float *ratio; - float item_width; - float item_height; - float item_offset; - float filled; - struct nk_rect item; - int tree_depth; - float templates[NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS]; -}; - -struct nk_popup_buffer { - nk_size begin; - nk_size parent; - nk_size last; - nk_size end; - int active; -}; - -struct nk_menu_state { - float x, y, w, h; - struct nk_scroll offset; -}; - -struct nk_panel { - enum nk_panel_type type; - nk_flags flags; - struct nk_rect bounds; - nk_uint *offset_x; - nk_uint *offset_y; - float at_x, at_y, max_x; - float footer_height; - float header_height; - float border; - unsigned int has_scrolling; - struct nk_rect clip; - struct nk_menu_state menu; - struct nk_row_layout row; - struct nk_chart chart; - struct nk_command_buffer *buffer; - struct nk_panel *parent; -}; - -/*============================================================== - * WINDOW - * =============================================================*/ -#ifndef NK_WINDOW_MAX_NAME -#define NK_WINDOW_MAX_NAME 64 -#endif - -struct nk_table; -enum nk_window_flags { - NK_WINDOW_PRIVATE = NK_FLAG(11), - NK_WINDOW_DYNAMIC = NK_WINDOW_PRIVATE, - /* special window type growing up in height while being filled to a certain maximum height */ - NK_WINDOW_ROM = NK_FLAG(12), - /* sets window widgets into a read only mode and does not allow input changes */ - NK_WINDOW_NOT_INTERACTIVE = NK_WINDOW_ROM|NK_WINDOW_NO_INPUT, - /* prevents all interaction caused by input to either window or widgets inside */ - NK_WINDOW_HIDDEN = NK_FLAG(13), - /* Hides window and stops any window interaction and drawing */ - NK_WINDOW_CLOSED = NK_FLAG(14), - /* Directly closes and frees the window at the end of the frame */ - NK_WINDOW_MINIMIZED = NK_FLAG(15), - /* marks the window as minimized */ - NK_WINDOW_REMOVE_ROM = NK_FLAG(16) - /* Removes read only mode at the end of the window */ -}; - -struct nk_popup_state { - struct nk_window *win; - enum nk_panel_type type; - struct nk_popup_buffer buf; - nk_hash name; - int active; - unsigned combo_count; - unsigned con_count, con_old; - unsigned active_con; - struct nk_rect header; -}; - -struct nk_edit_state { - nk_hash name; - unsigned int seq; - unsigned int old; - int active, prev; - int cursor; - int sel_start; - int sel_end; - struct nk_scroll scrollbar; - unsigned char mode; - unsigned char single_line; -}; - -struct nk_property_state { - int active, prev; - char buffer[NK_MAX_NUMBER_BUFFER]; - int length; - int cursor; - int select_start; - int select_end; - nk_hash name; - unsigned int seq; - unsigned int old; - int state; -}; - -struct nk_window { - unsigned int seq; - nk_hash name; - char name_string[NK_WINDOW_MAX_NAME]; - nk_flags flags; - - struct nk_rect bounds; - struct nk_scroll scrollbar; - struct nk_command_buffer buffer; - struct nk_panel *layout; - float scrollbar_hiding_timer; - - /* persistent widget state */ - struct nk_property_state property; - struct nk_popup_state popup; - struct nk_edit_state edit; - unsigned int scrolled; - - struct nk_table *tables; - unsigned int table_count; - - /* window list hooks */ - struct nk_window *next; - struct nk_window *prev; - struct nk_window *parent; -}; - -/*============================================================== - * STACK - * =============================================================*/ -/* The style modifier stack can be used to temporarily change a - * property inside `nk_style`. For example if you want a special - * red button you can temporarily push the old button color onto a stack - * draw the button with a red color and then you just pop the old color - * back from the stack: - * - * nk_style_push_style_item(ctx, &ctx->style.button.normal, nk_style_item_color(nk_rgb(255,0,0))); - * nk_style_push_style_item(ctx, &ctx->style.button.hover, nk_style_item_color(nk_rgb(255,0,0))); - * nk_style_push_style_item(ctx, &ctx->style.button.active, nk_style_item_color(nk_rgb(255,0,0))); - * nk_style_push_vec2(ctx, &cx->style.button.padding, nk_vec2(2,2)); - * - * nk_button(...); - * - * nk_style_pop_style_item(ctx); - * nk_style_pop_style_item(ctx); - * nk_style_pop_style_item(ctx); - * nk_style_pop_vec2(ctx); - * - * Nuklear has a stack for style_items, float properties, vector properties, - * flags, colors, fonts and for button_behavior. Each has it's own fixed size stack - * which can be changed at compile time. - */ -#ifndef NK_BUTTON_BEHAVIOR_STACK_SIZE -#define NK_BUTTON_BEHAVIOR_STACK_SIZE 8 -#endif - -#ifndef NK_FONT_STACK_SIZE -#define NK_FONT_STACK_SIZE 8 -#endif - -#ifndef NK_STYLE_ITEM_STACK_SIZE -#define NK_STYLE_ITEM_STACK_SIZE 16 -#endif - -#ifndef NK_FLOAT_STACK_SIZE -#define NK_FLOAT_STACK_SIZE 32 -#endif - -#ifndef NK_VECTOR_STACK_SIZE -#define NK_VECTOR_STACK_SIZE 16 -#endif - -#ifndef NK_FLAGS_STACK_SIZE -#define NK_FLAGS_STACK_SIZE 32 -#endif - -#ifndef NK_COLOR_STACK_SIZE -#define NK_COLOR_STACK_SIZE 32 -#endif - -#define NK_CONFIGURATION_STACK_TYPE(prefix, name, type)\ - struct nk_config_stack_##name##_element {\ - prefix##_##type *address;\ - prefix##_##type old_value;\ - } -#define NK_CONFIG_STACK(type,size)\ - struct nk_config_stack_##type {\ - int head;\ - struct nk_config_stack_##type##_element elements[size];\ - } - -#define nk_float float -NK_CONFIGURATION_STACK_TYPE(struct nk, style_item, style_item); -NK_CONFIGURATION_STACK_TYPE(nk ,float, float); -NK_CONFIGURATION_STACK_TYPE(struct nk, vec2, vec2); -NK_CONFIGURATION_STACK_TYPE(nk ,flags, flags); -NK_CONFIGURATION_STACK_TYPE(struct nk, color, color); -NK_CONFIGURATION_STACK_TYPE(const struct nk, user_font, user_font*); -NK_CONFIGURATION_STACK_TYPE(enum nk, button_behavior, button_behavior); - -NK_CONFIG_STACK(style_item, NK_STYLE_ITEM_STACK_SIZE); -NK_CONFIG_STACK(float, NK_FLOAT_STACK_SIZE); -NK_CONFIG_STACK(vec2, NK_VECTOR_STACK_SIZE); -NK_CONFIG_STACK(flags, NK_FLAGS_STACK_SIZE); -NK_CONFIG_STACK(color, NK_COLOR_STACK_SIZE); -NK_CONFIG_STACK(user_font, NK_FONT_STACK_SIZE); -NK_CONFIG_STACK(button_behavior, NK_BUTTON_BEHAVIOR_STACK_SIZE); - -struct nk_configuration_stacks { - struct nk_config_stack_style_item style_items; - struct nk_config_stack_float floats; - struct nk_config_stack_vec2 vectors; - struct nk_config_stack_flags flags; - struct nk_config_stack_color colors; - struct nk_config_stack_user_font fonts; - struct nk_config_stack_button_behavior button_behaviors; -}; - -/*============================================================== - * CONTEXT - * =============================================================*/ -#define NK_VALUE_PAGE_CAPACITY \ - (((NK_MAX(sizeof(struct nk_window),sizeof(struct nk_panel)) / sizeof(nk_uint))) / 2) - -struct nk_table { - unsigned int seq; - unsigned int size; - nk_hash keys[NK_VALUE_PAGE_CAPACITY]; - nk_uint values[NK_VALUE_PAGE_CAPACITY]; - struct nk_table *next, *prev; -}; - -union nk_page_data { - struct nk_table tbl; - struct nk_panel pan; - struct nk_window win; -}; - -struct nk_page_element { - union nk_page_data data; - struct nk_page_element *next; - struct nk_page_element *prev; -}; - -struct nk_page { - unsigned int size; - struct nk_page *next; - struct nk_page_element win[1]; -}; - -struct nk_pool { - struct nk_allocator alloc; - enum nk_allocation_type type; - unsigned int page_count; - struct nk_page *pages; - struct nk_page_element *freelist; - unsigned capacity; - nk_size size; - nk_size cap; -}; - -struct nk_context { -/* public: can be accessed freely */ - struct nk_input input; - struct nk_style style; - struct nk_buffer memory; - struct nk_clipboard clip; - nk_flags last_widget_state; - enum nk_button_behavior button_behavior; - struct nk_configuration_stacks stacks; - float delta_time_seconds; - -/* private: - should only be accessed if you - know what you are doing */ -#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT - struct nk_draw_list draw_list; -#endif -#ifdef NK_INCLUDE_COMMAND_USERDATA - nk_handle userdata; -#endif - /* text editor objects are quite big because of an internal - * undo/redo stack. Therefore it does not make sense to have one for - * each window for temporary use cases, so I only provide *one* instance - * for all windows. This works because the content is cleared anyway */ - struct nk_text_edit text_edit; - /* draw buffer used for overlay drawing operation like cursor */ - struct nk_command_buffer overlay; - - /* windows */ - int build; - int use_pool; - struct nk_pool pool; - struct nk_window *begin; - struct nk_window *end; - struct nk_window *active; - struct nk_window *current; - struct nk_page_element *freelist; - unsigned int count; - unsigned int seq; -}; - -/* ============================================================== - * MATH - * =============================================================== */ -#define NK_PI 3.141592654f -#define NK_UTF_INVALID 0xFFFD -#define NK_MAX_FLOAT_PRECISION 2 - -#define NK_UNUSED(x) ((void)(x)) -#define NK_SATURATE(x) (NK_MAX(0, NK_MIN(1.0f, x))) -#define NK_LEN(a) (sizeof(a)/sizeof(a)[0]) -#define NK_ABS(a) (((a) < 0) ? -(a) : (a)) -#define NK_BETWEEN(x, a, b) ((a) <= (x) && (x) < (b)) -#define NK_INBOX(px, py, x, y, w, h)\ - (NK_BETWEEN(px,x,x+w) && NK_BETWEEN(py,y,y+h)) -#define NK_INTERSECT(x0, y0, w0, h0, x1, y1, w1, h1) \ - (!(((x1 > (x0 + w0)) || ((x1 + w1) < x0) || (y1 > (y0 + h0)) || (y1 + h1) < y0))) -#define NK_CONTAINS(x, y, w, h, bx, by, bw, bh)\ - (NK_INBOX(x,y, bx, by, bw, bh) && NK_INBOX(x+w,y+h, bx, by, bw, bh)) - -#define nk_vec2_sub(a, b) nk_vec2((a).x - (b).x, (a).y - (b).y) -#define nk_vec2_add(a, b) nk_vec2((a).x + (b).x, (a).y + (b).y) -#define nk_vec2_len_sqr(a) ((a).x*(a).x+(a).y*(a).y) -#define nk_vec2_muls(a, t) nk_vec2((a).x * (t), (a).y * (t)) - -#define nk_ptr_add(t, p, i) ((t*)((void*)((nk_byte*)(p) + (i)))) -#define nk_ptr_add_const(t, p, i) ((const t*)((const void*)((const nk_byte*)(p) + (i)))) -#define nk_zero_struct(s) nk_zero(&s, sizeof(s)) - -/* ============================================================== - * ALIGNMENT - * =============================================================== */ -/* Pointer to Integer type conversion for pointer alignment */ -#if defined(__PTRDIFF_TYPE__) /* This case should work for GCC*/ -# define NK_UINT_TO_PTR(x) ((void*)(__PTRDIFF_TYPE__)(x)) -# define NK_PTR_TO_UINT(x) ((nk_size)(__PTRDIFF_TYPE__)(x)) -#elif !defined(__GNUC__) /* works for compilers other than LLVM */ -# define NK_UINT_TO_PTR(x) ((void*)&((char*)0)[x]) -# define NK_PTR_TO_UINT(x) ((nk_size)(((char*)x)-(char*)0)) -#elif defined(NK_USE_FIXED_TYPES) /* used if we have */ -# define NK_UINT_TO_PTR(x) ((void*)(uintptr_t)(x)) -# define NK_PTR_TO_UINT(x) ((uintptr_t)(x)) -#else /* generates warning but works */ -# define NK_UINT_TO_PTR(x) ((void*)(x)) -# define NK_PTR_TO_UINT(x) ((nk_size)(x)) -#endif - -#define NK_ALIGN_PTR(x, mask)\ - (NK_UINT_TO_PTR((NK_PTR_TO_UINT((nk_byte*)(x) + (mask-1)) & ~(mask-1)))) -#define NK_ALIGN_PTR_BACK(x, mask)\ - (NK_UINT_TO_PTR((NK_PTR_TO_UINT((nk_byte*)(x)) & ~(mask-1)))) - -#define NK_OFFSETOF(st,m) ((nk_ptr)&(((st*)0)->m)) -#define NK_CONTAINER_OF(ptr,type,member)\ - (type*)((void*)((char*)(1 ? (ptr): &((type*)0)->member) - NK_OFFSETOF(type, member))) - -#ifdef __cplusplus -} -#endif - -#ifdef __cplusplus -template struct nk_alignof; -template struct nk_helper{enum {value = size_diff};}; -template struct nk_helper{enum {value = nk_alignof::value};}; -template struct nk_alignof{struct Big {T x; char c;}; enum { - diff = sizeof(Big) - sizeof(T), value = nk_helper::value};}; -#define NK_ALIGNOF(t) (nk_alignof::value) -#elif defined(_MSC_VER) -#define NK_ALIGNOF(t) (__alignof(t)) -#else -#define NK_ALIGNOF(t) ((char*)(&((struct {char c; t _h;}*)0)->_h) - (char*)0) -#endif - -#endif /* NK_NUKLEAR_H_ */ - -#ifdef NK_IMPLEMENTATION - -#ifndef NK_INTERNAL_H -#define NK_INTERNAL_H - -#ifndef NK_POOL_DEFAULT_CAPACITY -#define NK_POOL_DEFAULT_CAPACITY 16 -#endif - -#ifndef NK_DEFAULT_COMMAND_BUFFER_SIZE -#define NK_DEFAULT_COMMAND_BUFFER_SIZE (4*1024) -#endif - -#ifndef NK_BUFFER_DEFAULT_INITIAL_SIZE -#define NK_BUFFER_DEFAULT_INITIAL_SIZE (4*1024) -#endif - -/* standard library headers */ -#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR -#include /* malloc, free */ -#endif -#ifdef NK_INCLUDE_STANDARD_IO -#include /* fopen, fclose,... */ -#endif -#ifndef NK_ASSERT -#include -#define NK_ASSERT(expr) assert(expr) -#endif - -#ifndef NK_MEMSET -#define NK_MEMSET nk_memset -#endif -#ifndef NK_MEMCPY -#define NK_MEMCPY nk_memcopy -#endif -#ifndef NK_SQRT -#define NK_SQRT nk_sqrt -#endif -#ifndef NK_SIN -#define NK_SIN nk_sin -#endif -#ifndef NK_COS -#define NK_COS nk_cos -#endif -#ifndef NK_STRTOD -#define NK_STRTOD nk_strtod -#endif -#ifndef NK_DTOA -#define NK_DTOA nk_dtoa -#endif - -#define NK_DEFAULT (-1) - -#ifndef NK_VSNPRINTF -/* If your compiler does support `vsnprintf` I would highly recommend - * defining this to vsnprintf instead since `vsprintf` is basically - * unbelievable unsafe and should *NEVER* be used. But I have to support - * it since C89 only provides this unsafe version. */ - #if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) ||\ - (defined(__cplusplus) && (__cplusplus >= 201103L)) || \ - (defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L)) ||\ - (defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)) ||\ - defined(_ISOC99_SOURCE) || defined(_BSD_SOURCE) - #define NK_VSNPRINTF(s,n,f,a) vsnprintf(s,n,f,a) - #else - #define NK_VSNPRINTF(s,n,f,a) vsprintf(s,f,a) - #endif -#endif - -#define NK_SCHAR_MIN (-127) -#define NK_SCHAR_MAX 127 -#define NK_UCHAR_MIN 0 -#define NK_UCHAR_MAX 256 -#define NK_SSHORT_MIN (-32767) -#define NK_SSHORT_MAX 32767 -#define NK_USHORT_MIN 0 -#define NK_USHORT_MAX 65535 -#define NK_SINT_MIN (-2147483647) -#define NK_SINT_MAX 2147483647 -#define NK_UINT_MIN 0 -#define NK_UINT_MAX 4294967295u - -/* Make sure correct type size: - * This will fire with a negative subscript error if the type sizes - * are set incorrectly by the compiler, and compile out if not */ -NK_STATIC_ASSERT(sizeof(nk_size) >= sizeof(void*)); -NK_STATIC_ASSERT(sizeof(nk_ptr) == sizeof(void*)); -NK_STATIC_ASSERT(sizeof(nk_flags) >= 4); -NK_STATIC_ASSERT(sizeof(nk_rune) >= 4); -NK_STATIC_ASSERT(sizeof(nk_ushort) == 2); -NK_STATIC_ASSERT(sizeof(nk_short) == 2); -NK_STATIC_ASSERT(sizeof(nk_uint) == 4); -NK_STATIC_ASSERT(sizeof(nk_int) == 4); -NK_STATIC_ASSERT(sizeof(nk_byte) == 1); - -NK_GLOBAL const struct nk_rect nk_null_rect = {-8192.0f, -8192.0f, 16384, 16384}; -#define NK_FLOAT_PRECISION 0.00000000000001 - -NK_GLOBAL const struct nk_color nk_red = {255,0,0,255}; -NK_GLOBAL const struct nk_color nk_green = {0,255,0,255}; -NK_GLOBAL const struct nk_color nk_blue = {0,0,255,255}; -NK_GLOBAL const struct nk_color nk_white = {255,255,255,255}; -NK_GLOBAL const struct nk_color nk_black = {0,0,0,255}; -NK_GLOBAL const struct nk_color nk_yellow = {255,255,0,255}; - -/* widget */ -#define nk_widget_state_reset(s)\ - if ((*(s)) & NK_WIDGET_STATE_MODIFIED)\ - (*(s)) = NK_WIDGET_STATE_INACTIVE|NK_WIDGET_STATE_MODIFIED;\ - else (*(s)) = NK_WIDGET_STATE_INACTIVE; - -/* math */ -NK_LIB float nk_inv_sqrt(float n); -NK_LIB float nk_sqrt(float x); -NK_LIB float nk_sin(float x); -NK_LIB float nk_cos(float x); -NK_LIB nk_uint nk_round_up_pow2(nk_uint v); -NK_LIB struct nk_rect nk_shrink_rect(struct nk_rect r, float amount); -NK_LIB struct nk_rect nk_pad_rect(struct nk_rect r, struct nk_vec2 pad); -NK_LIB void nk_unify(struct nk_rect *clip, const struct nk_rect *a, float x0, float y0, float x1, float y1); -NK_LIB double nk_pow(double x, int n); -NK_LIB int nk_ifloord(double x); -NK_LIB int nk_ifloorf(float x); -NK_LIB int nk_iceilf(float x); -NK_LIB int nk_log10(double n); - -/* util */ -enum {NK_DO_NOT_STOP_ON_NEW_LINE, NK_STOP_ON_NEW_LINE}; -NK_LIB int nk_is_lower(int c); -NK_LIB int nk_is_upper(int c); -NK_LIB int nk_to_upper(int c); -NK_LIB int nk_to_lower(int c); -NK_LIB void* nk_memcopy(void *dst, const void *src, nk_size n); -NK_LIB void nk_memset(void *ptr, int c0, nk_size size); -NK_LIB void nk_zero(void *ptr, nk_size size); -NK_LIB char *nk_itoa(char *s, long n); -NK_LIB int nk_string_float_limit(char *string, int prec); -NK_LIB char *nk_dtoa(char *s, double n); -NK_LIB int nk_text_clamp(const struct nk_user_font *font, const char *text, int text_len, float space, int *glyphs, float *text_width, nk_rune *sep_list, int sep_count); -NK_LIB struct nk_vec2 nk_text_calculate_text_bounds(const struct nk_user_font *font, const char *begin, int byte_len, float row_height, const char **remaining, struct nk_vec2 *out_offset, int *glyphs, int op); -#ifdef NK_INCLUDE_STANDARD_VARARGS -NK_LIB int nk_strfmt(char *buf, int buf_size, const char *fmt, va_list args); -#endif -#ifdef NK_INCLUDE_STANDARD_IO -NK_LIB char *nk_file_load(const char* path, nk_size* siz, struct nk_allocator *alloc); -#endif - -/* buffer */ -#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR -NK_LIB void* nk_malloc(nk_handle unused, void *old,nk_size size); -NK_LIB void nk_mfree(nk_handle unused, void *ptr); -#endif -NK_LIB void* nk_buffer_align(void *unaligned, nk_size align, nk_size *alignment, enum nk_buffer_allocation_type type); -NK_LIB void* nk_buffer_alloc(struct nk_buffer *b, enum nk_buffer_allocation_type type, nk_size size, nk_size align); -NK_LIB void* nk_buffer_realloc(struct nk_buffer *b, nk_size capacity, nk_size *size); - -/* draw */ -NK_LIB void nk_command_buffer_init(struct nk_command_buffer *cb, struct nk_buffer *b, enum nk_command_clipping clip); -NK_LIB void nk_command_buffer_reset(struct nk_command_buffer *b); -NK_LIB void* nk_command_buffer_push(struct nk_command_buffer* b, enum nk_command_type t, nk_size size); -NK_LIB void nk_draw_symbol(struct nk_command_buffer *out, enum nk_symbol_type type, struct nk_rect content, struct nk_color background, struct nk_color foreground, float border_width, const struct nk_user_font *font); - -/* buffering */ -NK_LIB void nk_start_buffer(struct nk_context *ctx, struct nk_command_buffer *b); -NK_LIB void nk_start(struct nk_context *ctx, struct nk_window *win); -NK_LIB void nk_start_popup(struct nk_context *ctx, struct nk_window *win); -NK_LIB void nk_finish_popup(struct nk_context *ctx, struct nk_window*); -NK_LIB void nk_finish_buffer(struct nk_context *ctx, struct nk_command_buffer *b); -NK_LIB void nk_finish(struct nk_context *ctx, struct nk_window *w); -NK_LIB void nk_build(struct nk_context *ctx); - -/* text editor */ -NK_LIB void nk_textedit_clear_state(struct nk_text_edit *state, enum nk_text_edit_type type, nk_plugin_filter filter); -NK_LIB void nk_textedit_click(struct nk_text_edit *state, float x, float y, const struct nk_user_font *font, float row_height); -NK_LIB void nk_textedit_drag(struct nk_text_edit *state, float x, float y, const struct nk_user_font *font, float row_height); -NK_LIB void nk_textedit_key(struct nk_text_edit *state, enum nk_keys key, int shift_mod, const struct nk_user_font *font, float row_height); - -/* window */ -enum nk_window_insert_location { - NK_INSERT_BACK, /* inserts window into the back of list (front of screen) */ - NK_INSERT_FRONT /* inserts window into the front of list (back of screen) */ -}; -NK_LIB void *nk_create_window(struct nk_context *ctx); -NK_LIB void nk_remove_window(struct nk_context*, struct nk_window*); -NK_LIB void nk_free_window(struct nk_context *ctx, struct nk_window *win); -NK_LIB struct nk_window *nk_find_window(struct nk_context *ctx, nk_hash hash, const char *name); -NK_LIB void nk_insert_window(struct nk_context *ctx, struct nk_window *win, enum nk_window_insert_location loc); - -/* pool */ -NK_LIB void nk_pool_init(struct nk_pool *pool, struct nk_allocator *alloc, unsigned int capacity); -NK_LIB void nk_pool_free(struct nk_pool *pool); -NK_LIB void nk_pool_init_fixed(struct nk_pool *pool, void *memory, nk_size size); -NK_LIB struct nk_page_element *nk_pool_alloc(struct nk_pool *pool); - -/* page-element */ -NK_LIB struct nk_page_element* nk_create_page_element(struct nk_context *ctx); -NK_LIB void nk_link_page_element_into_freelist(struct nk_context *ctx, struct nk_page_element *elem); -NK_LIB void nk_free_page_element(struct nk_context *ctx, struct nk_page_element *elem); - -/* table */ -NK_LIB struct nk_table* nk_create_table(struct nk_context *ctx); -NK_LIB void nk_remove_table(struct nk_window *win, struct nk_table *tbl); -NK_LIB void nk_free_table(struct nk_context *ctx, struct nk_table *tbl); -NK_LIB void nk_push_table(struct nk_window *win, struct nk_table *tbl); -NK_LIB nk_uint *nk_add_value(struct nk_context *ctx, struct nk_window *win, nk_hash name, nk_uint value); -NK_LIB nk_uint *nk_find_value(struct nk_window *win, nk_hash name); - -/* panel */ -NK_LIB void *nk_create_panel(struct nk_context *ctx); -NK_LIB void nk_free_panel(struct nk_context*, struct nk_panel *pan); -NK_LIB int nk_panel_has_header(nk_flags flags, const char *title); -NK_LIB struct nk_vec2 nk_panel_get_padding(const struct nk_style *style, enum nk_panel_type type); -NK_LIB float nk_panel_get_border(const struct nk_style *style, nk_flags flags, enum nk_panel_type type); -NK_LIB struct nk_color nk_panel_get_border_color(const struct nk_style *style, enum nk_panel_type type); -NK_LIB int nk_panel_is_sub(enum nk_panel_type type); -NK_LIB int nk_panel_is_nonblock(enum nk_panel_type type); -NK_LIB int nk_panel_begin(struct nk_context *ctx, const char *title, enum nk_panel_type panel_type); -NK_LIB void nk_panel_end(struct nk_context *ctx); - -/* layout */ -NK_LIB float nk_layout_row_calculate_usable_space(const struct nk_style *style, enum nk_panel_type type, float total_space, int columns); -NK_LIB void nk_panel_layout(const struct nk_context *ctx, struct nk_window *win, float height, int cols); -NK_LIB void nk_row_layout(struct nk_context *ctx, enum nk_layout_format fmt, float height, int cols, int width); -NK_LIB void nk_panel_alloc_row(const struct nk_context *ctx, struct nk_window *win); -NK_LIB void nk_layout_widget_space(struct nk_rect *bounds, const struct nk_context *ctx, struct nk_window *win, int modify); -NK_LIB void nk_panel_alloc_space(struct nk_rect *bounds, const struct nk_context *ctx); -NK_LIB void nk_layout_peek(struct nk_rect *bounds, struct nk_context *ctx); - -/* popup */ -NK_LIB int nk_nonblock_begin(struct nk_context *ctx, nk_flags flags, struct nk_rect body, struct nk_rect header, enum nk_panel_type panel_type); - -/* text */ -struct nk_text { - struct nk_vec2 padding; - struct nk_color background; - struct nk_color text; -}; -NK_LIB void nk_widget_text(struct nk_command_buffer *o, struct nk_rect b, const char *string, int len, const struct nk_text *t, nk_flags a, const struct nk_user_font *f); -NK_LIB void nk_widget_text_wrap(struct nk_command_buffer *o, struct nk_rect b, const char *string, int len, const struct nk_text *t, const struct nk_user_font *f); - -/* button */ -NK_LIB int nk_button_behavior(nk_flags *state, struct nk_rect r, const struct nk_input *i, enum nk_button_behavior behavior); -NK_LIB const struct nk_style_item* nk_draw_button(struct nk_command_buffer *out, const struct nk_rect *bounds, nk_flags state, const struct nk_style_button *style); -NK_LIB int nk_do_button(nk_flags *state, struct nk_command_buffer *out, struct nk_rect r, const struct nk_style_button *style, const struct nk_input *in, enum nk_button_behavior behavior, struct nk_rect *content); -NK_LIB void nk_draw_button_text(struct nk_command_buffer *out, const struct nk_rect *bounds, const struct nk_rect *content, nk_flags state, const struct nk_style_button *style, const char *txt, int len, nk_flags text_alignment, const struct nk_user_font *font); -NK_LIB int nk_do_button_text(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, const char *string, int len, nk_flags align, enum nk_button_behavior behavior, const struct nk_style_button *style, const struct nk_input *in, const struct nk_user_font *font); -NK_LIB void nk_draw_button_symbol(struct nk_command_buffer *out, const struct nk_rect *bounds, const struct nk_rect *content, nk_flags state, const struct nk_style_button *style, enum nk_symbol_type type, const struct nk_user_font *font); -NK_LIB int nk_do_button_symbol(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, enum nk_symbol_type symbol, enum nk_button_behavior behavior, const struct nk_style_button *style, const struct nk_input *in, const struct nk_user_font *font); -NK_LIB void nk_draw_button_image(struct nk_command_buffer *out, const struct nk_rect *bounds, const struct nk_rect *content, nk_flags state, const struct nk_style_button *style, const struct nk_image *img); -NK_LIB int nk_do_button_image(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, struct nk_image img, enum nk_button_behavior b, const struct nk_style_button *style, const struct nk_input *in); -NK_LIB void nk_draw_button_text_symbol(struct nk_command_buffer *out, const struct nk_rect *bounds, const struct nk_rect *label, const struct nk_rect *symbol, nk_flags state, const struct nk_style_button *style, const char *str, int len, enum nk_symbol_type type, const struct nk_user_font *font); -NK_LIB int nk_do_button_text_symbol(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, enum nk_symbol_type symbol, const char *str, int len, nk_flags align, enum nk_button_behavior behavior, const struct nk_style_button *style, const struct nk_user_font *font, const struct nk_input *in); -NK_LIB void nk_draw_button_text_image(struct nk_command_buffer *out, const struct nk_rect *bounds, const struct nk_rect *label, const struct nk_rect *image, nk_flags state, const struct nk_style_button *style, const char *str, int len, const struct nk_user_font *font, const struct nk_image *img); -NK_LIB int nk_do_button_text_image(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, struct nk_image img, const char* str, int len, nk_flags align, enum nk_button_behavior behavior, const struct nk_style_button *style, const struct nk_user_font *font, const struct nk_input *in); - -/* toggle */ -enum nk_toggle_type { - NK_TOGGLE_CHECK, - NK_TOGGLE_OPTION -}; -NK_LIB int nk_toggle_behavior(const struct nk_input *in, struct nk_rect select, nk_flags *state, int active); -NK_LIB void nk_draw_checkbox(struct nk_command_buffer *out, nk_flags state, const struct nk_style_toggle *style, int active, const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *cursors, const char *string, int len, const struct nk_user_font *font); -NK_LIB void nk_draw_option(struct nk_command_buffer *out, nk_flags state, const struct nk_style_toggle *style, int active, const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *cursors, const char *string, int len, const struct nk_user_font *font); -NK_LIB int nk_do_toggle(nk_flags *state, struct nk_command_buffer *out, struct nk_rect r, int *active, const char *str, int len, enum nk_toggle_type type, const struct nk_style_toggle *style, const struct nk_input *in, const struct nk_user_font *font); - -/* progress */ -NK_LIB nk_size nk_progress_behavior(nk_flags *state, struct nk_input *in, struct nk_rect r, struct nk_rect cursor, nk_size max, nk_size value, int modifiable); -NK_LIB void nk_draw_progress(struct nk_command_buffer *out, nk_flags state, const struct nk_style_progress *style, const struct nk_rect *bounds, const struct nk_rect *scursor, nk_size value, nk_size max); -NK_LIB nk_size nk_do_progress(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, nk_size value, nk_size max, int modifiable, const struct nk_style_progress *style, struct nk_input *in); - -/* slider */ -NK_LIB float nk_slider_behavior(nk_flags *state, struct nk_rect *logical_cursor, struct nk_rect *visual_cursor, struct nk_input *in, struct nk_rect bounds, float slider_min, float slider_max, float slider_value, float slider_step, float slider_steps); -NK_LIB void nk_draw_slider(struct nk_command_buffer *out, nk_flags state, const struct nk_style_slider *style, const struct nk_rect *bounds, const struct nk_rect *visual_cursor, float min, float value, float max); -NK_LIB float nk_do_slider(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, float min, float val, float max, float step, const struct nk_style_slider *style, struct nk_input *in, const struct nk_user_font *font); - -/* scrollbar */ -NK_LIB float nk_scrollbar_behavior(nk_flags *state, struct nk_input *in, int has_scrolling, const struct nk_rect *scroll, const struct nk_rect *cursor, const struct nk_rect *empty0, const struct nk_rect *empty1, float scroll_offset, float target, float scroll_step, enum nk_orientation o); -NK_LIB void nk_draw_scrollbar(struct nk_command_buffer *out, nk_flags state, const struct nk_style_scrollbar *style, const struct nk_rect *bounds, const struct nk_rect *scroll); -NK_LIB float nk_do_scrollbarv(nk_flags *state, struct nk_command_buffer *out, struct nk_rect scroll, int has_scrolling, float offset, float target, float step, float button_pixel_inc, const struct nk_style_scrollbar *style, struct nk_input *in, const struct nk_user_font *font); -NK_LIB float nk_do_scrollbarh(nk_flags *state, struct nk_command_buffer *out, struct nk_rect scroll, int has_scrolling, float offset, float target, float step, float button_pixel_inc, const struct nk_style_scrollbar *style, struct nk_input *in, const struct nk_user_font *font); - -/* selectable */ -NK_LIB void nk_draw_selectable(struct nk_command_buffer *out, nk_flags state, const struct nk_style_selectable *style, int active, const struct nk_rect *bounds, const struct nk_rect *icon, const struct nk_image *img, enum nk_symbol_type sym, const char *string, int len, nk_flags align, const struct nk_user_font *font); -NK_LIB int nk_do_selectable(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, const char *str, int len, nk_flags align, int *value, const struct nk_style_selectable *style, const struct nk_input *in, const struct nk_user_font *font); -NK_LIB int nk_do_selectable_image(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, const char *str, int len, nk_flags align, int *value, const struct nk_image *img, const struct nk_style_selectable *style, const struct nk_input *in, const struct nk_user_font *font); - -/* edit */ -NK_LIB void nk_edit_draw_text(struct nk_command_buffer *out, const struct nk_style_edit *style, float pos_x, float pos_y, float x_offset, const char *text, int byte_len, float row_height, const struct nk_user_font *font, struct nk_color background, struct nk_color foreground, int is_selected); -NK_LIB nk_flags nk_do_edit(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, nk_flags flags, nk_plugin_filter filter, struct nk_text_edit *edit, const struct nk_style_edit *style, struct nk_input *in, const struct nk_user_font *font); - -/* color-picker */ -NK_LIB int nk_color_picker_behavior(nk_flags *state, const struct nk_rect *bounds, const struct nk_rect *matrix, const struct nk_rect *hue_bar, const struct nk_rect *alpha_bar, struct nk_colorf *color, const struct nk_input *in); -NK_LIB void nk_draw_color_picker(struct nk_command_buffer *o, const struct nk_rect *matrix, const struct nk_rect *hue_bar, const struct nk_rect *alpha_bar, struct nk_colorf col); -NK_LIB int nk_do_color_picker(nk_flags *state, struct nk_command_buffer *out, struct nk_colorf *col, enum nk_color_format fmt, struct nk_rect bounds, struct nk_vec2 padding, const struct nk_input *in, const struct nk_user_font *font); - -/* property */ -enum nk_property_status { - NK_PROPERTY_DEFAULT, - NK_PROPERTY_EDIT, - NK_PROPERTY_DRAG -}; -enum nk_property_filter { - NK_FILTER_INT, - NK_FILTER_FLOAT -}; -enum nk_property_kind { - NK_PROPERTY_INT, - NK_PROPERTY_FLOAT, - NK_PROPERTY_DOUBLE -}; -union nk_property { - int i; - float f; - double d; -}; -struct nk_property_variant { - enum nk_property_kind kind; - union nk_property value; - union nk_property min_value; - union nk_property max_value; - union nk_property step; -}; -NK_LIB struct nk_property_variant nk_property_variant_int(int value, int min_value, int max_value, int step); -NK_LIB struct nk_property_variant nk_property_variant_float(float value, float min_value, float max_value, float step); -NK_LIB struct nk_property_variant nk_property_variant_double(double value, double min_value, double max_value, double step); - -NK_LIB void nk_drag_behavior(nk_flags *state, const struct nk_input *in, struct nk_rect drag, struct nk_property_variant *variant, float inc_per_pixel); -NK_LIB void nk_property_behavior(nk_flags *ws, const struct nk_input *in, struct nk_rect property, struct nk_rect label, struct nk_rect edit, struct nk_rect empty, int *state, struct nk_property_variant *variant, float inc_per_pixel); -NK_LIB void nk_draw_property(struct nk_command_buffer *out, const struct nk_style_property *style, const struct nk_rect *bounds, const struct nk_rect *label, nk_flags state, const char *name, int len, const struct nk_user_font *font); -NK_LIB void nk_do_property(nk_flags *ws, struct nk_command_buffer *out, struct nk_rect property, const char *name, struct nk_property_variant *variant, float inc_per_pixel, char *buffer, int *len, int *state, int *cursor, int *select_begin, int *select_end, const struct nk_style_property *style, enum nk_property_filter filter, struct nk_input *in, const struct nk_user_font *font, struct nk_text_edit *text_edit, enum nk_button_behavior behavior); -NK_LIB void nk_property(struct nk_context *ctx, const char *name, struct nk_property_variant *variant, float inc_per_pixel, const enum nk_property_filter filter); - -#endif - - - - - -/* =============================================================== - * - * MATH - * - * ===============================================================*/ -/* Since nuklear is supposed to work on all systems providing floating point - math without any dependencies I also had to implement my own math functions - for sqrt, sin and cos. Since the actual highly accurate implementations for - the standard library functions are quite complex and I do not need high - precision for my use cases I use approximations. - - Sqrt - ---- - For square root nuklear uses the famous fast inverse square root: - https://en.wikipedia.org/wiki/Fast_inverse_square_root with - slightly tweaked magic constant. While on today's hardware it is - probably not faster it is still fast and accurate enough for - nuklear's use cases. IMPORTANT: this requires float format IEEE 754 - - Sine/Cosine - ----------- - All constants inside both function are generated Remez's minimax - approximations for value range 0...2*PI. The reason why I decided to - approximate exactly that range is that nuklear only needs sine and - cosine to generate circles which only requires that exact range. - In addition I used Remez instead of Taylor for additional precision: - www.lolengine.net/blog/2011/12/21/better-function-approximations. - - The tool I used to generate constants for both sine and cosine - (it can actually approximate a lot more functions) can be - found here: www.lolengine.net/wiki/oss/lolremez -*/ -NK_LIB float -nk_inv_sqrt(float n) -{ - float x2; - const float threehalfs = 1.5f; - union {nk_uint i; float f;} conv = {0}; - conv.f = n; - x2 = n * 0.5f; - conv.i = 0x5f375A84 - (conv.i >> 1); - conv.f = conv.f * (threehalfs - (x2 * conv.f * conv.f)); - return conv.f; -} -NK_LIB float -nk_sqrt(float x) -{ - return x * nk_inv_sqrt(x); -} -NK_LIB float -nk_sin(float x) -{ - NK_STORAGE const float a0 = +1.91059300966915117e-31f; - NK_STORAGE const float a1 = +1.00086760103908896f; - NK_STORAGE const float a2 = -1.21276126894734565e-2f; - NK_STORAGE const float a3 = -1.38078780785773762e-1f; - NK_STORAGE const float a4 = -2.67353392911981221e-2f; - NK_STORAGE const float a5 = +2.08026600266304389e-2f; - NK_STORAGE const float a6 = -3.03996055049204407e-3f; - NK_STORAGE const float a7 = +1.38235642404333740e-4f; - return a0 + x*(a1 + x*(a2 + x*(a3 + x*(a4 + x*(a5 + x*(a6 + x*a7)))))); -} -NK_LIB float -nk_cos(float x) -{ - /* New implementation. Also generated using lolremez. */ - /* Old version significantly deviated from expected results. */ - NK_STORAGE const float a0 = 9.9995999154986614e-1f; - NK_STORAGE const float a1 = 1.2548995793001028e-3f; - NK_STORAGE const float a2 = -5.0648546280678015e-1f; - NK_STORAGE const float a3 = 1.2942246466519995e-2f; - NK_STORAGE const float a4 = 2.8668384702547972e-2f; - NK_STORAGE const float a5 = 7.3726485210586547e-3f; - NK_STORAGE const float a6 = -3.8510875386947414e-3f; - NK_STORAGE const float a7 = 4.7196604604366623e-4f; - NK_STORAGE const float a8 = -1.8776444013090451e-5f; - return a0 + x*(a1 + x*(a2 + x*(a3 + x*(a4 + x*(a5 + x*(a6 + x*(a7 + x*a8))))))); -} -NK_LIB nk_uint -nk_round_up_pow2(nk_uint v) -{ - v--; - v |= v >> 1; - v |= v >> 2; - v |= v >> 4; - v |= v >> 8; - v |= v >> 16; - v++; - return v; -} -NK_LIB double -nk_pow(double x, int n) -{ - /* check the sign of n */ - double r = 1; - int plus = n >= 0; - n = (plus) ? n : -n; - while (n > 0) { - if ((n & 1) == 1) - r *= x; - n /= 2; - x *= x; - } - return plus ? r : 1.0 / r; -} -NK_LIB int -nk_ifloord(double x) -{ - x = (double)((int)x - ((x < 0.0) ? 1 : 0)); - return (int)x; -} -NK_LIB int -nk_ifloorf(float x) -{ - x = (float)((int)x - ((x < 0.0f) ? 1 : 0)); - return (int)x; -} -NK_LIB int -nk_iceilf(float x) -{ - if (x >= 0) { - int i = (int)x; - return (x > i) ? i+1: i; - } else { - int t = (int)x; - float r = x - (float)t; - return (r > 0.0f) ? t+1: t; - } -} -NK_LIB int -nk_log10(double n) -{ - int neg; - int ret; - int exp = 0; - - neg = (n < 0) ? 1 : 0; - ret = (neg) ? (int)-n : (int)n; - while ((ret / 10) > 0) { - ret /= 10; - exp++; - } - if (neg) exp = -exp; - return exp; -} -NK_API struct nk_rect -nk_get_null_rect(void) -{ - return nk_null_rect; -} -NK_API struct nk_rect -nk_rect(float x, float y, float w, float h) -{ - struct nk_rect r; - r.x = x; r.y = y; - r.w = w; r.h = h; - return r; -} -NK_API struct nk_rect -nk_recti(int x, int y, int w, int h) -{ - struct nk_rect r; - r.x = (float)x; - r.y = (float)y; - r.w = (float)w; - r.h = (float)h; - return r; -} -NK_API struct nk_rect -nk_recta(struct nk_vec2 pos, struct nk_vec2 size) -{ - return nk_rect(pos.x, pos.y, size.x, size.y); -} -NK_API struct nk_rect -nk_rectv(const float *r) -{ - return nk_rect(r[0], r[1], r[2], r[3]); -} -NK_API struct nk_rect -nk_rectiv(const int *r) -{ - return nk_recti(r[0], r[1], r[2], r[3]); -} -NK_API struct nk_vec2 -nk_rect_pos(struct nk_rect r) -{ - struct nk_vec2 ret; - ret.x = r.x; ret.y = r.y; - return ret; -} -NK_API struct nk_vec2 -nk_rect_size(struct nk_rect r) -{ - struct nk_vec2 ret; - ret.x = r.w; ret.y = r.h; - return ret; -} -NK_LIB struct nk_rect -nk_shrink_rect(struct nk_rect r, float amount) -{ - struct nk_rect res; - r.w = NK_MAX(r.w, 2 * amount); - r.h = NK_MAX(r.h, 2 * amount); - res.x = r.x + amount; - res.y = r.y + amount; - res.w = r.w - 2 * amount; - res.h = r.h - 2 * amount; - return res; -} -NK_LIB struct nk_rect -nk_pad_rect(struct nk_rect r, struct nk_vec2 pad) -{ - r.w = NK_MAX(r.w, 2 * pad.x); - r.h = NK_MAX(r.h, 2 * pad.y); - r.x += pad.x; r.y += pad.y; - r.w -= 2 * pad.x; - r.h -= 2 * pad.y; - return r; -} -NK_API struct nk_vec2 -nk_vec2(float x, float y) -{ - struct nk_vec2 ret; - ret.x = x; ret.y = y; - return ret; -} -NK_API struct nk_vec2 -nk_vec2i(int x, int y) -{ - struct nk_vec2 ret; - ret.x = (float)x; - ret.y = (float)y; - return ret; -} -NK_API struct nk_vec2 -nk_vec2v(const float *v) -{ - return nk_vec2(v[0], v[1]); -} -NK_API struct nk_vec2 -nk_vec2iv(const int *v) -{ - return nk_vec2i(v[0], v[1]); -} -NK_LIB void -nk_unify(struct nk_rect *clip, const struct nk_rect *a, float x0, float y0, - float x1, float y1) -{ - NK_ASSERT(a); - NK_ASSERT(clip); - clip->x = NK_MAX(a->x, x0); - clip->y = NK_MAX(a->y, y0); - clip->w = NK_MIN(a->x + a->w, x1) - clip->x; - clip->h = NK_MIN(a->y + a->h, y1) - clip->y; - clip->w = NK_MAX(0, clip->w); - clip->h = NK_MAX(0, clip->h); -} - -NK_API void -nk_triangle_from_direction(struct nk_vec2 *result, struct nk_rect r, - float pad_x, float pad_y, enum nk_heading direction) -{ - float w_half, h_half; - NK_ASSERT(result); - - r.w = NK_MAX(2 * pad_x, r.w); - r.h = NK_MAX(2 * pad_y, r.h); - r.w = r.w - 2 * pad_x; - r.h = r.h - 2 * pad_y; - - r.x = r.x + pad_x; - r.y = r.y + pad_y; - - w_half = r.w / 2.0f; - h_half = r.h / 2.0f; - - if (direction == NK_UP) { - result[0] = nk_vec2(r.x + w_half, r.y); - result[1] = nk_vec2(r.x + r.w, r.y + r.h); - result[2] = nk_vec2(r.x, r.y + r.h); - } else if (direction == NK_RIGHT) { - result[0] = nk_vec2(r.x, r.y); - result[1] = nk_vec2(r.x + r.w, r.y + h_half); - result[2] = nk_vec2(r.x, r.y + r.h); - } else if (direction == NK_DOWN) { - result[0] = nk_vec2(r.x, r.y); - result[1] = nk_vec2(r.x + r.w, r.y); - result[2] = nk_vec2(r.x + w_half, r.y + r.h); - } else { - result[0] = nk_vec2(r.x, r.y + h_half); - result[1] = nk_vec2(r.x + r.w, r.y); - result[2] = nk_vec2(r.x + r.w, r.y + r.h); - } -} - - - - - -/* =============================================================== - * - * UTIL - * - * ===============================================================*/ -NK_INTERN int nk_str_match_here(const char *regexp, const char *text); -NK_INTERN int nk_str_match_star(int c, const char *regexp, const char *text); -NK_LIB int nk_is_lower(int c) {return (c >= 'a' && c <= 'z') || (c >= 0xE0 && c <= 0xFF);} -NK_LIB int nk_is_upper(int c){return (c >= 'A' && c <= 'Z') || (c >= 0xC0 && c <= 0xDF);} -NK_LIB int nk_to_upper(int c) {return (c >= 'a' && c <= 'z') ? (c - ('a' - 'A')) : c;} -NK_LIB int nk_to_lower(int c) {return (c >= 'A' && c <= 'Z') ? (c - ('a' + 'A')) : c;} - -NK_LIB void* -nk_memcopy(void *dst0, const void *src0, nk_size length) -{ - nk_ptr t; - char *dst = (char*)dst0; - const char *src = (const char*)src0; - if (length == 0 || dst == src) - goto done; - - #define nk_word int - #define nk_wsize sizeof(nk_word) - #define nk_wmask (nk_wsize-1) - #define NK_TLOOP(s) if (t) NK_TLOOP1(s) - #define NK_TLOOP1(s) do { s; } while (--t) - - if (dst < src) { - t = (nk_ptr)src; /* only need low bits */ - if ((t | (nk_ptr)dst) & nk_wmask) { - if ((t ^ (nk_ptr)dst) & nk_wmask || length < nk_wsize) - t = length; - else - t = nk_wsize - (t & nk_wmask); - length -= t; - NK_TLOOP1(*dst++ = *src++); - } - t = length / nk_wsize; - NK_TLOOP(*(nk_word*)(void*)dst = *(const nk_word*)(const void*)src; - src += nk_wsize; dst += nk_wsize); - t = length & nk_wmask; - NK_TLOOP(*dst++ = *src++); - } else { - src += length; - dst += length; - t = (nk_ptr)src; - if ((t | (nk_ptr)dst) & nk_wmask) { - if ((t ^ (nk_ptr)dst) & nk_wmask || length <= nk_wsize) - t = length; - else - t &= nk_wmask; - length -= t; - NK_TLOOP1(*--dst = *--src); - } - t = length / nk_wsize; - NK_TLOOP(src -= nk_wsize; dst -= nk_wsize; - *(nk_word*)(void*)dst = *(const nk_word*)(const void*)src); - t = length & nk_wmask; - NK_TLOOP(*--dst = *--src); - } - #undef nk_word - #undef nk_wsize - #undef nk_wmask - #undef NK_TLOOP - #undef NK_TLOOP1 -done: - return (dst0); -} -NK_LIB void -nk_memset(void *ptr, int c0, nk_size size) -{ - #define nk_word unsigned - #define nk_wsize sizeof(nk_word) - #define nk_wmask (nk_wsize - 1) - nk_byte *dst = (nk_byte*)ptr; - unsigned c = 0; - nk_size t = 0; - - if ((c = (nk_byte)c0) != 0) { - c = (c << 8) | c; /* at least 16-bits */ - if (sizeof(unsigned int) > 2) - c = (c << 16) | c; /* at least 32-bits*/ - } - - /* too small of a word count */ - dst = (nk_byte*)ptr; - if (size < 3 * nk_wsize) { - while (size--) *dst++ = (nk_byte)c0; - return; - } - - /* align destination */ - if ((t = NK_PTR_TO_UINT(dst) & nk_wmask) != 0) { - t = nk_wsize -t; - size -= t; - do { - *dst++ = (nk_byte)c0; - } while (--t != 0); - } - - /* fill word */ - t = size / nk_wsize; - do { - *(nk_word*)((void*)dst) = c; - dst += nk_wsize; - } while (--t != 0); - - /* fill trailing bytes */ - t = (size & nk_wmask); - if (t != 0) { - do { - *dst++ = (nk_byte)c0; - } while (--t != 0); - } - - #undef nk_word - #undef nk_wsize - #undef nk_wmask -} -NK_LIB void -nk_zero(void *ptr, nk_size size) -{ - NK_ASSERT(ptr); - NK_MEMSET(ptr, 0, size); -} -NK_API int -nk_strlen(const char *str) -{ - int siz = 0; - NK_ASSERT(str); - while (str && *str++ != '\0') siz++; - return siz; -} -NK_API int -nk_strtoi(const char *str, const char **endptr) -{ - int neg = 1; - const char *p = str; - int value = 0; - - NK_ASSERT(str); - if (!str) return 0; - - /* skip whitespace */ - while (*p == ' ') p++; - if (*p == '-') { - neg = -1; - p++; - } - while (*p && *p >= '0' && *p <= '9') { - value = value * 10 + (int) (*p - '0'); - p++; - } - if (endptr) - *endptr = p; - return neg*value; -} -NK_API double -nk_strtod(const char *str, const char **endptr) -{ - double m; - double neg = 1.0; - const char *p = str; - double value = 0; - double number = 0; - - NK_ASSERT(str); - if (!str) return 0; - - /* skip whitespace */ - while (*p == ' ') p++; - if (*p == '-') { - neg = -1.0; - p++; - } - - while (*p && *p != '.' && *p != 'e') { - value = value * 10.0 + (double) (*p - '0'); - p++; - } - - if (*p == '.') { - p++; - for(m = 0.1; *p && *p != 'e'; p++ ) { - value = value + (double) (*p - '0') * m; - m *= 0.1; - } - } - if (*p == 'e') { - int i, pow, div; - p++; - if (*p == '-') { - div = nk_true; - p++; - } else if (*p == '+') { - div = nk_false; - p++; - } else div = nk_false; - - for (pow = 0; *p; p++) - pow = pow * 10 + (int) (*p - '0'); - - for (m = 1.0, i = 0; i < pow; i++) - m *= 10.0; - - if (div) - value /= m; - else value *= m; - } - number = value * neg; - if (endptr) - *endptr = p; - return number; -} -NK_API float -nk_strtof(const char *str, const char **endptr) -{ - float float_value; - double double_value; - double_value = NK_STRTOD(str, endptr); - float_value = (float)double_value; - return float_value; -} -NK_API int -nk_stricmp(const char *s1, const char *s2) -{ - nk_int c1,c2,d; - do { - c1 = *s1++; - c2 = *s2++; - d = c1 - c2; - while (d) { - if (c1 <= 'Z' && c1 >= 'A') { - d += ('a' - 'A'); - if (!d) break; - } - if (c2 <= 'Z' && c2 >= 'A') { - d -= ('a' - 'A'); - if (!d) break; - } - return ((d >= 0) << 1) - 1; - } - } while (c1); - return 0; -} -NK_API int -nk_stricmpn(const char *s1, const char *s2, int n) -{ - int c1,c2,d; - NK_ASSERT(n >= 0); - do { - c1 = *s1++; - c2 = *s2++; - if (!n--) return 0; - - d = c1 - c2; - while (d) { - if (c1 <= 'Z' && c1 >= 'A') { - d += ('a' - 'A'); - if (!d) break; - } - if (c2 <= 'Z' && c2 >= 'A') { - d -= ('a' - 'A'); - if (!d) break; - } - return ((d >= 0) << 1) - 1; - } - } while (c1); - return 0; -} -NK_INTERN int -nk_str_match_here(const char *regexp, const char *text) -{ - if (regexp[0] == '\0') - return 1; - if (regexp[1] == '*') - return nk_str_match_star(regexp[0], regexp+2, text); - if (regexp[0] == '$' && regexp[1] == '\0') - return *text == '\0'; - if (*text!='\0' && (regexp[0]=='.' || regexp[0]==*text)) - return nk_str_match_here(regexp+1, text+1); - return 0; -} -NK_INTERN int -nk_str_match_star(int c, const char *regexp, const char *text) -{ - do {/* a '* matches zero or more instances */ - if (nk_str_match_here(regexp, text)) - return 1; - } while (*text != '\0' && (*text++ == c || c == '.')); - return 0; -} -NK_API int -nk_strfilter(const char *text, const char *regexp) -{ - /* - c matches any literal character c - . matches any single character - ^ matches the beginning of the input string - $ matches the end of the input string - * matches zero or more occurrences of the previous character*/ - if (regexp[0] == '^') - return nk_str_match_here(regexp+1, text); - do { /* must look even if string is empty */ - if (nk_str_match_here(regexp, text)) - return 1; - } while (*text++ != '\0'); - return 0; -} -NK_API int -nk_strmatch_fuzzy_text(const char *str, int str_len, - const char *pattern, int *out_score) -{ - /* Returns true if each character in pattern is found sequentially within str - * if found then out_score is also set. Score value has no intrinsic meaning. - * Range varies with pattern. Can only compare scores with same search pattern. */ - - /* bonus for adjacent matches */ - #define NK_ADJACENCY_BONUS 5 - /* bonus if match occurs after a separator */ - #define NK_SEPARATOR_BONUS 10 - /* bonus if match is uppercase and prev is lower */ - #define NK_CAMEL_BONUS 10 - /* penalty applied for every letter in str before the first match */ - #define NK_LEADING_LETTER_PENALTY (-3) - /* maximum penalty for leading letters */ - #define NK_MAX_LEADING_LETTER_PENALTY (-9) - /* penalty for every letter that doesn't matter */ - #define NK_UNMATCHED_LETTER_PENALTY (-1) - - /* loop variables */ - int score = 0; - char const * pattern_iter = pattern; - int str_iter = 0; - int prev_matched = nk_false; - int prev_lower = nk_false; - /* true so if first letter match gets separator bonus*/ - int prev_separator = nk_true; - - /* use "best" matched letter if multiple string letters match the pattern */ - char const * best_letter = 0; - int best_letter_score = 0; - - /* loop over strings */ - NK_ASSERT(str); - NK_ASSERT(pattern); - if (!str || !str_len || !pattern) return 0; - while (str_iter < str_len) - { - const char pattern_letter = *pattern_iter; - const char str_letter = str[str_iter]; - - int next_match = *pattern_iter != '\0' && - nk_to_lower(pattern_letter) == nk_to_lower(str_letter); - int rematch = best_letter && nk_to_upper(*best_letter) == nk_to_upper(str_letter); - - int advanced = next_match && best_letter; - int pattern_repeat = best_letter && *pattern_iter != '\0'; - pattern_repeat = pattern_repeat && - nk_to_lower(*best_letter) == nk_to_lower(pattern_letter); - - if (advanced || pattern_repeat) { - score += best_letter_score; - best_letter = 0; - best_letter_score = 0; - } - - if (next_match || rematch) - { - int new_score = 0; - /* Apply penalty for each letter before the first pattern match */ - if (pattern_iter == pattern) { - int count = (int)(&str[str_iter] - str); - int penalty = NK_LEADING_LETTER_PENALTY * count; - if (penalty < NK_MAX_LEADING_LETTER_PENALTY) - penalty = NK_MAX_LEADING_LETTER_PENALTY; - - score += penalty; - } - - /* apply bonus for consecutive bonuses */ - if (prev_matched) - new_score += NK_ADJACENCY_BONUS; - - /* apply bonus for matches after a separator */ - if (prev_separator) - new_score += NK_SEPARATOR_BONUS; - - /* apply bonus across camel case boundaries */ - if (prev_lower && nk_is_upper(str_letter)) - new_score += NK_CAMEL_BONUS; - - /* update pattern iter IFF the next pattern letter was matched */ - if (next_match) - ++pattern_iter; - - /* update best letter in str which may be for a "next" letter or a rematch */ - if (new_score >= best_letter_score) { - /* apply penalty for now skipped letter */ - if (best_letter != 0) - score += NK_UNMATCHED_LETTER_PENALTY; - - best_letter = &str[str_iter]; - best_letter_score = new_score; - } - prev_matched = nk_true; - } else { - score += NK_UNMATCHED_LETTER_PENALTY; - prev_matched = nk_false; - } - - /* separators should be more easily defined */ - prev_lower = nk_is_lower(str_letter) != 0; - prev_separator = str_letter == '_' || str_letter == ' '; - - ++str_iter; - } - - /* apply score for last match */ - if (best_letter) - score += best_letter_score; - - /* did not match full pattern */ - if (*pattern_iter != '\0') - return nk_false; - - if (out_score) - *out_score = score; - return nk_true; -} -NK_API int -nk_strmatch_fuzzy_string(char const *str, char const *pattern, int *out_score) -{ - return nk_strmatch_fuzzy_text(str, nk_strlen(str), pattern, out_score); -} -NK_LIB int -nk_string_float_limit(char *string, int prec) -{ - int dot = 0; - char *c = string; - while (*c) { - if (*c == '.') { - dot = 1; - c++; - continue; - } - if (dot == (prec+1)) { - *c = 0; - break; - } - if (dot > 0) dot++; - c++; - } - return (int)(c - string); -} -NK_INTERN void -nk_strrev_ascii(char *s) -{ - int len = nk_strlen(s); - int end = len / 2; - int i = 0; - char t; - for (; i < end; ++i) { - t = s[i]; - s[i] = s[len - 1 - i]; - s[len -1 - i] = t; - } -} -NK_LIB char* -nk_itoa(char *s, long n) -{ - long i = 0; - if (n == 0) { - s[i++] = '0'; - s[i] = 0; - return s; - } - if (n < 0) { - s[i++] = '-'; - n = -n; - } - while (n > 0) { - s[i++] = (char)('0' + (n % 10)); - n /= 10; - } - s[i] = 0; - if (s[0] == '-') - ++s; - - nk_strrev_ascii(s); - return s; -} -NK_LIB char* -nk_dtoa(char *s, double n) -{ - int useExp = 0; - int digit = 0, m = 0, m1 = 0; - char *c = s; - int neg = 0; - - NK_ASSERT(s); - if (!s) return 0; - - if (n == 0.0) { - s[0] = '0'; s[1] = '\0'; - return s; - } - - neg = (n < 0); - if (neg) n = -n; - - /* calculate magnitude */ - m = nk_log10(n); - useExp = (m >= 14 || (neg && m >= 9) || m <= -9); - if (neg) *(c++) = '-'; - - /* set up for scientific notation */ - if (useExp) { - if (m < 0) - m -= 1; - n = n / (double)nk_pow(10.0, m); - m1 = m; - m = 0; - } - if (m < 1.0) { - m = 0; - } - - /* convert the number */ - while (n > NK_FLOAT_PRECISION || m >= 0) { - double weight = nk_pow(10.0, m); - if (weight > 0) { - double t = (double)n / weight; - digit = nk_ifloord(t); - n -= ((double)digit * weight); - *(c++) = (char)('0' + (char)digit); - } - if (m == 0 && n > 0) - *(c++) = '.'; - m--; - } - - if (useExp) { - /* convert the exponent */ - int i, j; - *(c++) = 'e'; - if (m1 > 0) { - *(c++) = '+'; - } else { - *(c++) = '-'; - m1 = -m1; - } - m = 0; - while (m1 > 0) { - *(c++) = (char)('0' + (char)(m1 % 10)); - m1 /= 10; - m++; - } - c -= m; - for (i = 0, j = m-1; i= buf_size) break; - iter++; - - /* flag arguments */ - while (*iter) { - if (*iter == '-') flag |= NK_ARG_FLAG_LEFT; - else if (*iter == '+') flag |= NK_ARG_FLAG_PLUS; - else if (*iter == ' ') flag |= NK_ARG_FLAG_SPACE; - else if (*iter == '#') flag |= NK_ARG_FLAG_NUM; - else if (*iter == '0') flag |= NK_ARG_FLAG_ZERO; - else break; - iter++; - } - - /* width argument */ - width = NK_DEFAULT; - if (*iter >= '1' && *iter <= '9') { - const char *end; - width = nk_strtoi(iter, &end); - if (end == iter) - width = -1; - else iter = end; - } else if (*iter == '*') { - width = va_arg(args, int); - iter++; - } - - /* precision argument */ - precision = NK_DEFAULT; - if (*iter == '.') { - iter++; - if (*iter == '*') { - precision = va_arg(args, int); - iter++; - } else { - const char *end; - precision = nk_strtoi(iter, &end); - if (end == iter) - precision = -1; - else iter = end; - } - } - - /* length modifier */ - if (*iter == 'h') { - if (*(iter+1) == 'h') { - arg_type = NK_ARG_TYPE_CHAR; - iter++; - } else arg_type = NK_ARG_TYPE_SHORT; - iter++; - } else if (*iter == 'l') { - arg_type = NK_ARG_TYPE_LONG; - iter++; - } else arg_type = NK_ARG_TYPE_DEFAULT; - - /* specifier */ - if (*iter == '%') { - NK_ASSERT(arg_type == NK_ARG_TYPE_DEFAULT); - NK_ASSERT(precision == NK_DEFAULT); - NK_ASSERT(width == NK_DEFAULT); - if (len < buf_size) - buf[len++] = '%'; - } else if (*iter == 's') { - /* string */ - const char *str = va_arg(args, const char*); - NK_ASSERT(str != buf && "buffer and argument are not allowed to overlap!"); - NK_ASSERT(arg_type == NK_ARG_TYPE_DEFAULT); - NK_ASSERT(precision == NK_DEFAULT); - NK_ASSERT(width == NK_DEFAULT); - if (str == buf) return -1; - while (str && *str && len < buf_size) - buf[len++] = *str++; - } else if (*iter == 'n') { - /* current length callback */ - signed int *n = va_arg(args, int*); - NK_ASSERT(arg_type == NK_ARG_TYPE_DEFAULT); - NK_ASSERT(precision == NK_DEFAULT); - NK_ASSERT(width == NK_DEFAULT); - if (n) *n = len; - } else if (*iter == 'c' || *iter == 'i' || *iter == 'd') { - /* signed integer */ - long value = 0; - const char *num_iter; - int num_len, num_print, padding; - int cur_precision = NK_MAX(precision, 1); - int cur_width = NK_MAX(width, 0); - - /* retrieve correct value type */ - if (arg_type == NK_ARG_TYPE_CHAR) - value = (signed char)va_arg(args, int); - else if (arg_type == NK_ARG_TYPE_SHORT) - value = (signed short)va_arg(args, int); - else if (arg_type == NK_ARG_TYPE_LONG) - value = va_arg(args, signed long); - else if (*iter == 'c') - value = (unsigned char)va_arg(args, int); - else value = va_arg(args, signed int); - - /* convert number to string */ - nk_itoa(number_buffer, value); - num_len = nk_strlen(number_buffer); - padding = NK_MAX(cur_width - NK_MAX(cur_precision, num_len), 0); - if ((flag & NK_ARG_FLAG_PLUS) || (flag & NK_ARG_FLAG_SPACE)) - padding = NK_MAX(padding-1, 0); - - /* fill left padding up to a total of `width` characters */ - if (!(flag & NK_ARG_FLAG_LEFT)) { - while (padding-- > 0 && (len < buf_size)) { - if ((flag & NK_ARG_FLAG_ZERO) && (precision == NK_DEFAULT)) - buf[len++] = '0'; - else buf[len++] = ' '; - } - } - - /* copy string value representation into buffer */ - if ((flag & NK_ARG_FLAG_PLUS) && value >= 0 && len < buf_size) - buf[len++] = '+'; - else if ((flag & NK_ARG_FLAG_SPACE) && value >= 0 && len < buf_size) - buf[len++] = ' '; - - /* fill up to precision number of digits with '0' */ - num_print = NK_MAX(cur_precision, num_len); - while (precision && (num_print > num_len) && (len < buf_size)) { - buf[len++] = '0'; - num_print--; - } - - /* copy string value representation into buffer */ - num_iter = number_buffer; - while (precision && *num_iter && len < buf_size) - buf[len++] = *num_iter++; - - /* fill right padding up to width characters */ - if (flag & NK_ARG_FLAG_LEFT) { - while ((padding-- > 0) && (len < buf_size)) - buf[len++] = ' '; - } - } else if (*iter == 'o' || *iter == 'x' || *iter == 'X' || *iter == 'u') { - /* unsigned integer */ - unsigned long value = 0; - int num_len = 0, num_print, padding = 0; - int cur_precision = NK_MAX(precision, 1); - int cur_width = NK_MAX(width, 0); - unsigned int base = (*iter == 'o') ? 8: (*iter == 'u')? 10: 16; - - /* print oct/hex/dec value */ - const char *upper_output_format = "0123456789ABCDEF"; - const char *lower_output_format = "0123456789abcdef"; - const char *output_format = (*iter == 'x') ? - lower_output_format: upper_output_format; - - /* retrieve correct value type */ - if (arg_type == NK_ARG_TYPE_CHAR) - value = (unsigned char)va_arg(args, int); - else if (arg_type == NK_ARG_TYPE_SHORT) - value = (unsigned short)va_arg(args, int); - else if (arg_type == NK_ARG_TYPE_LONG) - value = va_arg(args, unsigned long); - else value = va_arg(args, unsigned int); - - do { - /* convert decimal number into hex/oct number */ - int digit = output_format[value % base]; - if (num_len < NK_MAX_NUMBER_BUFFER) - number_buffer[num_len++] = (char)digit; - value /= base; - } while (value > 0); - - num_print = NK_MAX(cur_precision, num_len); - padding = NK_MAX(cur_width - NK_MAX(cur_precision, num_len), 0); - if (flag & NK_ARG_FLAG_NUM) - padding = NK_MAX(padding-1, 0); - - /* fill left padding up to a total of `width` characters */ - if (!(flag & NK_ARG_FLAG_LEFT)) { - while ((padding-- > 0) && (len < buf_size)) { - if ((flag & NK_ARG_FLAG_ZERO) && (precision == NK_DEFAULT)) - buf[len++] = '0'; - else buf[len++] = ' '; - } - } - - /* fill up to precision number of digits */ - if (num_print && (flag & NK_ARG_FLAG_NUM)) { - if ((*iter == 'o') && (len < buf_size)) { - buf[len++] = '0'; - } else if ((*iter == 'x') && ((len+1) < buf_size)) { - buf[len++] = '0'; - buf[len++] = 'x'; - } else if ((*iter == 'X') && ((len+1) < buf_size)) { - buf[len++] = '0'; - buf[len++] = 'X'; - } - } - while (precision && (num_print > num_len) && (len < buf_size)) { - buf[len++] = '0'; - num_print--; - } - - /* reverse number direction */ - while (num_len > 0) { - if (precision && (len < buf_size)) - buf[len++] = number_buffer[num_len-1]; - num_len--; - } - - /* fill right padding up to width characters */ - if (flag & NK_ARG_FLAG_LEFT) { - while ((padding-- > 0) && (len < buf_size)) - buf[len++] = ' '; - } - } else if (*iter == 'f') { - /* floating point */ - const char *num_iter; - int cur_precision = (precision < 0) ? 6: precision; - int prefix, cur_width = NK_MAX(width, 0); - double value = va_arg(args, double); - int num_len = 0, frac_len = 0, dot = 0; - int padding = 0; - - NK_ASSERT(arg_type == NK_ARG_TYPE_DEFAULT); - NK_DTOA(number_buffer, value); - num_len = nk_strlen(number_buffer); - - /* calculate padding */ - num_iter = number_buffer; - while (*num_iter && *num_iter != '.') - num_iter++; - - prefix = (*num_iter == '.')?(int)(num_iter - number_buffer)+1:0; - padding = NK_MAX(cur_width - (prefix + NK_MIN(cur_precision, num_len - prefix)) , 0); - if ((flag & NK_ARG_FLAG_PLUS) || (flag & NK_ARG_FLAG_SPACE)) - padding = NK_MAX(padding-1, 0); - - /* fill left padding up to a total of `width` characters */ - if (!(flag & NK_ARG_FLAG_LEFT)) { - while (padding-- > 0 && (len < buf_size)) { - if (flag & NK_ARG_FLAG_ZERO) - buf[len++] = '0'; - else buf[len++] = ' '; - } - } - - /* copy string value representation into buffer */ - num_iter = number_buffer; - if ((flag & NK_ARG_FLAG_PLUS) && (value >= 0) && (len < buf_size)) - buf[len++] = '+'; - else if ((flag & NK_ARG_FLAG_SPACE) && (value >= 0) && (len < buf_size)) - buf[len++] = ' '; - while (*num_iter) { - if (dot) frac_len++; - if (len < buf_size) - buf[len++] = *num_iter; - if (*num_iter == '.') dot = 1; - if (frac_len >= cur_precision) break; - num_iter++; - } - - /* fill number up to precision */ - while (frac_len < cur_precision) { - if (!dot && len < buf_size) { - buf[len++] = '.'; - dot = 1; - } - if (len < buf_size) - buf[len++] = '0'; - frac_len++; - } - - /* fill right padding up to width characters */ - if (flag & NK_ARG_FLAG_LEFT) { - while ((padding-- > 0) && (len < buf_size)) - buf[len++] = ' '; - } - } else { - /* Specifier not supported: g,G,e,E,p,z */ - NK_ASSERT(0 && "specifier is not supported!"); - return result; - } - } - buf[(len >= buf_size)?(buf_size-1):len] = 0; - result = (len >= buf_size)?-1:len; - return result; -} -#endif -NK_LIB int -nk_strfmt(char *buf, int buf_size, const char *fmt, va_list args) -{ - int result = -1; - NK_ASSERT(buf); - NK_ASSERT(buf_size); - if (!buf || !buf_size || !fmt) return 0; -#ifdef NK_INCLUDE_STANDARD_IO - result = NK_VSNPRINTF(buf, (nk_size)buf_size, fmt, args); - result = (result >= buf_size) ? -1: result; - buf[buf_size-1] = 0; -#else - result = nk_vsnprintf(buf, buf_size, fmt, args); -#endif - return result; -} -#endif -NK_API nk_hash -nk_murmur_hash(const void * key, int len, nk_hash seed) -{ - /* 32-Bit MurmurHash3: https://code.google.com/p/smhasher/wiki/MurmurHash3*/ - #define NK_ROTL(x,r) ((x) << (r) | ((x) >> (32 - r))) - - nk_uint h1 = seed; - nk_uint k1; - const nk_byte *data = (const nk_byte*)key; - const nk_byte *keyptr = data; - nk_byte *k1ptr; - const int bsize = sizeof(k1); - const int nblocks = len/4; - - const nk_uint c1 = 0xcc9e2d51; - const nk_uint c2 = 0x1b873593; - const nk_byte *tail; - int i; - - /* body */ - if (!key) return 0; - for (i = 0; i < nblocks; ++i, keyptr += bsize) { - k1ptr = (nk_byte*)&k1; - k1ptr[0] = keyptr[0]; - k1ptr[1] = keyptr[1]; - k1ptr[2] = keyptr[2]; - k1ptr[3] = keyptr[3]; - - k1 *= c1; - k1 = NK_ROTL(k1,15); - k1 *= c2; - - h1 ^= k1; - h1 = NK_ROTL(h1,13); - h1 = h1*5+0xe6546b64; - } - - /* tail */ - tail = (const nk_byte*)(data + nblocks*4); - k1 = 0; - switch (len & 3) { - case 3: k1 ^= (nk_uint)(tail[2] << 16); /* fallthrough */ - case 2: k1 ^= (nk_uint)(tail[1] << 8u); /* fallthrough */ - case 1: k1 ^= tail[0]; - k1 *= c1; - k1 = NK_ROTL(k1,15); - k1 *= c2; - h1 ^= k1; - break; - default: break; - } - - /* finalization */ - h1 ^= (nk_uint)len; - /* fmix32 */ - h1 ^= h1 >> 16; - h1 *= 0x85ebca6b; - h1 ^= h1 >> 13; - h1 *= 0xc2b2ae35; - h1 ^= h1 >> 16; - - #undef NK_ROTL - return h1; -} -#ifdef NK_INCLUDE_STANDARD_IO -NK_LIB char* -nk_file_load(const char* path, nk_size* siz, struct nk_allocator *alloc) -{ - char *buf; - FILE *fd; - long ret; - - NK_ASSERT(path); - NK_ASSERT(siz); - NK_ASSERT(alloc); - if (!path || !siz || !alloc) - return 0; - - fd = fopen(path, "rb"); - if (!fd) return 0; - fseek(fd, 0, SEEK_END); - ret = ftell(fd); - if (ret < 0) { - fclose(fd); - return 0; - } - *siz = (nk_size)ret; - fseek(fd, 0, SEEK_SET); - buf = (char*)alloc->alloc(alloc->userdata,0, *siz); - NK_ASSERT(buf); - if (!buf) { - fclose(fd); - return 0; - } - *siz = (nk_size)fread(buf, 1,*siz, fd); - fclose(fd); - return buf; -} -#endif -NK_LIB int -nk_text_clamp(const struct nk_user_font *font, const char *text, - int text_len, float space, int *glyphs, float *text_width, - nk_rune *sep_list, int sep_count) -{ - int i = 0; - int glyph_len = 0; - float last_width = 0; - nk_rune unicode = 0; - float width = 0; - int len = 0; - int g = 0; - float s; - - int sep_len = 0; - int sep_g = 0; - float sep_width = 0; - sep_count = NK_MAX(sep_count,0); - - glyph_len = nk_utf_decode(text, &unicode, text_len); - while (glyph_len && (width < space) && (len < text_len)) { - len += glyph_len; - s = font->width(font->userdata, font->height, text, len); - for (i = 0; i < sep_count; ++i) { - if (unicode != sep_list[i]) continue; - sep_width = last_width = width; - sep_g = g+1; - sep_len = len; - break; - } - if (i == sep_count){ - last_width = sep_width = width; - sep_g = g+1; - } - width = s; - glyph_len = nk_utf_decode(&text[len], &unicode, text_len - len); - g++; - } - if (len >= text_len) { - *glyphs = g; - *text_width = last_width; - return len; - } else { - *glyphs = sep_g; - *text_width = sep_width; - return (!sep_len) ? len: sep_len; - } -} -NK_LIB struct nk_vec2 -nk_text_calculate_text_bounds(const struct nk_user_font *font, - const char *begin, int byte_len, float row_height, const char **remaining, - struct nk_vec2 *out_offset, int *glyphs, int op) -{ - float line_height = row_height; - struct nk_vec2 text_size = nk_vec2(0,0); - float line_width = 0.0f; - - float glyph_width; - int glyph_len = 0; - nk_rune unicode = 0; - int text_len = 0; - if (!begin || byte_len <= 0 || !font) - return nk_vec2(0,row_height); - - glyph_len = nk_utf_decode(begin, &unicode, byte_len); - if (!glyph_len) return text_size; - glyph_width = font->width(font->userdata, font->height, begin, glyph_len); - - *glyphs = 0; - while ((text_len < byte_len) && glyph_len) { - if (unicode == '\n') { - text_size.x = NK_MAX(text_size.x, line_width); - text_size.y += line_height; - line_width = 0; - *glyphs+=1; - if (op == NK_STOP_ON_NEW_LINE) - break; - - text_len++; - glyph_len = nk_utf_decode(begin + text_len, &unicode, byte_len-text_len); - continue; - } - - if (unicode == '\r') { - text_len++; - *glyphs+=1; - glyph_len = nk_utf_decode(begin + text_len, &unicode, byte_len-text_len); - continue; - } - - *glyphs = *glyphs + 1; - text_len += glyph_len; - line_width += (float)glyph_width; - glyph_len = nk_utf_decode(begin + text_len, &unicode, byte_len-text_len); - glyph_width = font->width(font->userdata, font->height, begin+text_len, glyph_len); - continue; - } - - if (text_size.x < line_width) - text_size.x = line_width; - if (out_offset) - *out_offset = nk_vec2(line_width, text_size.y + line_height); - if (line_width > 0 || text_size.y == 0.0f) - text_size.y += line_height; - if (remaining) - *remaining = begin+text_len; - return text_size; -} - - - - - -/* ============================================================== - * - * COLOR - * - * ===============================================================*/ -NK_INTERN int -nk_parse_hex(const char *p, int length) -{ - int i = 0; - int len = 0; - while (len < length) { - i <<= 4; - if (p[len] >= 'a' && p[len] <= 'f') - i += ((p[len] - 'a') + 10); - else if (p[len] >= 'A' && p[len] <= 'F') - i += ((p[len] - 'A') + 10); - else i += (p[len] - '0'); - len++; - } - return i; -} -NK_API struct nk_color -nk_rgba(int r, int g, int b, int a) -{ - struct nk_color ret; - ret.r = (nk_byte)NK_CLAMP(0, r, 255); - ret.g = (nk_byte)NK_CLAMP(0, g, 255); - ret.b = (nk_byte)NK_CLAMP(0, b, 255); - ret.a = (nk_byte)NK_CLAMP(0, a, 255); - return ret; -} -NK_API struct nk_color -nk_rgb_hex(const char *rgb) -{ - struct nk_color col; - const char *c = rgb; - if (*c == '#') c++; - col.r = (nk_byte)nk_parse_hex(c, 2); - col.g = (nk_byte)nk_parse_hex(c+2, 2); - col.b = (nk_byte)nk_parse_hex(c+4, 2); - col.a = 255; - return col; -} -NK_API struct nk_color -nk_rgba_hex(const char *rgb) -{ - struct nk_color col; - const char *c = rgb; - if (*c == '#') c++; - col.r = (nk_byte)nk_parse_hex(c, 2); - col.g = (nk_byte)nk_parse_hex(c+2, 2); - col.b = (nk_byte)nk_parse_hex(c+4, 2); - col.a = (nk_byte)nk_parse_hex(c+6, 2); - return col; -} -NK_API void -nk_color_hex_rgba(char *output, struct nk_color col) -{ - #define NK_TO_HEX(i) ((i) <= 9 ? '0' + (i): 'A' - 10 + (i)) - output[0] = (char)NK_TO_HEX((col.r & 0xF0) >> 4); - output[1] = (char)NK_TO_HEX((col.r & 0x0F)); - output[2] = (char)NK_TO_HEX((col.g & 0xF0) >> 4); - output[3] = (char)NK_TO_HEX((col.g & 0x0F)); - output[4] = (char)NK_TO_HEX((col.b & 0xF0) >> 4); - output[5] = (char)NK_TO_HEX((col.b & 0x0F)); - output[6] = (char)NK_TO_HEX((col.a & 0xF0) >> 4); - output[7] = (char)NK_TO_HEX((col.a & 0x0F)); - output[8] = '\0'; - #undef NK_TO_HEX -} -NK_API void -nk_color_hex_rgb(char *output, struct nk_color col) -{ - #define NK_TO_HEX(i) ((i) <= 9 ? '0' + (i): 'A' - 10 + (i)) - output[0] = (char)NK_TO_HEX((col.r & 0xF0) >> 4); - output[1] = (char)NK_TO_HEX((col.r & 0x0F)); - output[2] = (char)NK_TO_HEX((col.g & 0xF0) >> 4); - output[3] = (char)NK_TO_HEX((col.g & 0x0F)); - output[4] = (char)NK_TO_HEX((col.b & 0xF0) >> 4); - output[5] = (char)NK_TO_HEX((col.b & 0x0F)); - output[6] = '\0'; - #undef NK_TO_HEX -} -NK_API struct nk_color -nk_rgba_iv(const int *c) -{ - return nk_rgba(c[0], c[1], c[2], c[3]); -} -NK_API struct nk_color -nk_rgba_bv(const nk_byte *c) -{ - return nk_rgba(c[0], c[1], c[2], c[3]); -} -NK_API struct nk_color -nk_rgb(int r, int g, int b) -{ - struct nk_color ret; - ret.r = (nk_byte)NK_CLAMP(0, r, 255); - ret.g = (nk_byte)NK_CLAMP(0, g, 255); - ret.b = (nk_byte)NK_CLAMP(0, b, 255); - ret.a = (nk_byte)255; - return ret; -} -NK_API struct nk_color -nk_rgb_iv(const int *c) -{ - return nk_rgb(c[0], c[1], c[2]); -} -NK_API struct nk_color -nk_rgb_bv(const nk_byte* c) -{ - return nk_rgb(c[0], c[1], c[2]); -} -NK_API struct nk_color -nk_rgba_u32(nk_uint in) -{ - struct nk_color ret; - ret.r = (in & 0xFF); - ret.g = ((in >> 8) & 0xFF); - ret.b = ((in >> 16) & 0xFF); - ret.a = (nk_byte)((in >> 24) & 0xFF); - return ret; -} -NK_API struct nk_color -nk_rgba_f(float r, float g, float b, float a) -{ - struct nk_color ret; - ret.r = (nk_byte)(NK_SATURATE(r) * 255.0f); - ret.g = (nk_byte)(NK_SATURATE(g) * 255.0f); - ret.b = (nk_byte)(NK_SATURATE(b) * 255.0f); - ret.a = (nk_byte)(NK_SATURATE(a) * 255.0f); - return ret; -} -NK_API struct nk_color -nk_rgba_fv(const float *c) -{ - return nk_rgba_f(c[0], c[1], c[2], c[3]); -} -NK_API struct nk_color -nk_rgba_cf(struct nk_colorf c) -{ - return nk_rgba_f(c.r, c.g, c.b, c.a); -} -NK_API struct nk_color -nk_rgb_f(float r, float g, float b) -{ - struct nk_color ret; - ret.r = (nk_byte)(NK_SATURATE(r) * 255.0f); - ret.g = (nk_byte)(NK_SATURATE(g) * 255.0f); - ret.b = (nk_byte)(NK_SATURATE(b) * 255.0f); - ret.a = 255; - return ret; -} -NK_API struct nk_color -nk_rgb_fv(const float *c) -{ - return nk_rgb_f(c[0], c[1], c[2]); -} -NK_API struct nk_color -nk_rgb_cf(struct nk_colorf c) -{ - return nk_rgb_f(c.r, c.g, c.b); -} -NK_API struct nk_color -nk_hsv(int h, int s, int v) -{ - return nk_hsva(h, s, v, 255); -} -NK_API struct nk_color -nk_hsv_iv(const int *c) -{ - return nk_hsv(c[0], c[1], c[2]); -} -NK_API struct nk_color -nk_hsv_bv(const nk_byte *c) -{ - return nk_hsv(c[0], c[1], c[2]); -} -NK_API struct nk_color -nk_hsv_f(float h, float s, float v) -{ - return nk_hsva_f(h, s, v, 1.0f); -} -NK_API struct nk_color -nk_hsv_fv(const float *c) -{ - return nk_hsv_f(c[0], c[1], c[2]); -} -NK_API struct nk_color -nk_hsva(int h, int s, int v, int a) -{ - float hf = ((float)NK_CLAMP(0, h, 255)) / 255.0f; - float sf = ((float)NK_CLAMP(0, s, 255)) / 255.0f; - float vf = ((float)NK_CLAMP(0, v, 255)) / 255.0f; - float af = ((float)NK_CLAMP(0, a, 255)) / 255.0f; - return nk_hsva_f(hf, sf, vf, af); -} -NK_API struct nk_color -nk_hsva_iv(const int *c) -{ - return nk_hsva(c[0], c[1], c[2], c[3]); -} -NK_API struct nk_color -nk_hsva_bv(const nk_byte *c) -{ - return nk_hsva(c[0], c[1], c[2], c[3]); -} -NK_API struct nk_colorf -nk_hsva_colorf(float h, float s, float v, float a) -{ - int i; - float p, q, t, f; - struct nk_colorf out = {0,0,0,0}; - if (s <= 0.0f) { - out.r = v; out.g = v; out.b = v; out.a = a; - return out; - } - h = h / (60.0f/360.0f); - i = (int)h; - f = h - (float)i; - p = v * (1.0f - s); - q = v * (1.0f - (s * f)); - t = v * (1.0f - s * (1.0f - f)); - - switch (i) { - case 0: default: out.r = v; out.g = t; out.b = p; break; - case 1: out.r = q; out.g = v; out.b = p; break; - case 2: out.r = p; out.g = v; out.b = t; break; - case 3: out.r = p; out.g = q; out.b = v; break; - case 4: out.r = t; out.g = p; out.b = v; break; - case 5: out.r = v; out.g = p; out.b = q; break;} - out.a = a; - return out; -} -NK_API struct nk_colorf -nk_hsva_colorfv(float *c) -{ - return nk_hsva_colorf(c[0], c[1], c[2], c[3]); -} -NK_API struct nk_color -nk_hsva_f(float h, float s, float v, float a) -{ - struct nk_colorf c = nk_hsva_colorf(h, s, v, a); - return nk_rgba_f(c.r, c.g, c.b, c.a); -} -NK_API struct nk_color -nk_hsva_fv(const float *c) -{ - return nk_hsva_f(c[0], c[1], c[2], c[3]); -} -NK_API nk_uint -nk_color_u32(struct nk_color in) -{ - nk_uint out = (nk_uint)in.r; - out |= ((nk_uint)in.g << 8); - out |= ((nk_uint)in.b << 16); - out |= ((nk_uint)in.a << 24); - return out; -} -NK_API void -nk_color_f(float *r, float *g, float *b, float *a, struct nk_color in) -{ - NK_STORAGE const float s = 1.0f/255.0f; - *r = (float)in.r * s; - *g = (float)in.g * s; - *b = (float)in.b * s; - *a = (float)in.a * s; -} -NK_API void -nk_color_fv(float *c, struct nk_color in) -{ - nk_color_f(&c[0], &c[1], &c[2], &c[3], in); -} -NK_API struct nk_colorf -nk_color_cf(struct nk_color in) -{ - struct nk_colorf o; - nk_color_f(&o.r, &o.g, &o.b, &o.a, in); - return o; -} -NK_API void -nk_color_d(double *r, double *g, double *b, double *a, struct nk_color in) -{ - NK_STORAGE const double s = 1.0/255.0; - *r = (double)in.r * s; - *g = (double)in.g * s; - *b = (double)in.b * s; - *a = (double)in.a * s; -} -NK_API void -nk_color_dv(double *c, struct nk_color in) -{ - nk_color_d(&c[0], &c[1], &c[2], &c[3], in); -} -NK_API void -nk_color_hsv_f(float *out_h, float *out_s, float *out_v, struct nk_color in) -{ - float a; - nk_color_hsva_f(out_h, out_s, out_v, &a, in); -} -NK_API void -nk_color_hsv_fv(float *out, struct nk_color in) -{ - float a; - nk_color_hsva_f(&out[0], &out[1], &out[2], &a, in); -} -NK_API void -nk_colorf_hsva_f(float *out_h, float *out_s, - float *out_v, float *out_a, struct nk_colorf in) -{ - float chroma; - float K = 0.0f; - if (in.g < in.b) { - const float t = in.g; in.g = in.b; in.b = t; - K = -1.f; - } - if (in.r < in.g) { - const float t = in.r; in.r = in.g; in.g = t; - K = -2.f/6.0f - K; - } - chroma = in.r - ((in.g < in.b) ? in.g: in.b); - *out_h = NK_ABS(K + (in.g - in.b)/(6.0f * chroma + 1e-20f)); - *out_s = chroma / (in.r + 1e-20f); - *out_v = in.r; - *out_a = in.a; - -} -NK_API void -nk_colorf_hsva_fv(float *hsva, struct nk_colorf in) -{ - nk_colorf_hsva_f(&hsva[0], &hsva[1], &hsva[2], &hsva[3], in); -} -NK_API void -nk_color_hsva_f(float *out_h, float *out_s, - float *out_v, float *out_a, struct nk_color in) -{ - struct nk_colorf col; - nk_color_f(&col.r,&col.g,&col.b,&col.a, in); - nk_colorf_hsva_f(out_h, out_s, out_v, out_a, col); -} -NK_API void -nk_color_hsva_fv(float *out, struct nk_color in) -{ - nk_color_hsva_f(&out[0], &out[1], &out[2], &out[3], in); -} -NK_API void -nk_color_hsva_i(int *out_h, int *out_s, int *out_v, - int *out_a, struct nk_color in) -{ - float h,s,v,a; - nk_color_hsva_f(&h, &s, &v, &a, in); - *out_h = (nk_byte)(h * 255.0f); - *out_s = (nk_byte)(s * 255.0f); - *out_v = (nk_byte)(v * 255.0f); - *out_a = (nk_byte)(a * 255.0f); -} -NK_API void -nk_color_hsva_iv(int *out, struct nk_color in) -{ - nk_color_hsva_i(&out[0], &out[1], &out[2], &out[3], in); -} -NK_API void -nk_color_hsva_bv(nk_byte *out, struct nk_color in) -{ - int tmp[4]; - nk_color_hsva_i(&tmp[0], &tmp[1], &tmp[2], &tmp[3], in); - out[0] = (nk_byte)tmp[0]; - out[1] = (nk_byte)tmp[1]; - out[2] = (nk_byte)tmp[2]; - out[3] = (nk_byte)tmp[3]; -} -NK_API void -nk_color_hsva_b(nk_byte *h, nk_byte *s, nk_byte *v, nk_byte *a, struct nk_color in) -{ - int tmp[4]; - nk_color_hsva_i(&tmp[0], &tmp[1], &tmp[2], &tmp[3], in); - *h = (nk_byte)tmp[0]; - *s = (nk_byte)tmp[1]; - *v = (nk_byte)tmp[2]; - *a = (nk_byte)tmp[3]; -} -NK_API void -nk_color_hsv_i(int *out_h, int *out_s, int *out_v, struct nk_color in) -{ - int a; - nk_color_hsva_i(out_h, out_s, out_v, &a, in); -} -NK_API void -nk_color_hsv_b(nk_byte *out_h, nk_byte *out_s, nk_byte *out_v, struct nk_color in) -{ - int tmp[4]; - nk_color_hsva_i(&tmp[0], &tmp[1], &tmp[2], &tmp[3], in); - *out_h = (nk_byte)tmp[0]; - *out_s = (nk_byte)tmp[1]; - *out_v = (nk_byte)tmp[2]; -} -NK_API void -nk_color_hsv_iv(int *out, struct nk_color in) -{ - nk_color_hsv_i(&out[0], &out[1], &out[2], in); -} -NK_API void -nk_color_hsv_bv(nk_byte *out, struct nk_color in) -{ - int tmp[4]; - nk_color_hsv_i(&tmp[0], &tmp[1], &tmp[2], in); - out[0] = (nk_byte)tmp[0]; - out[1] = (nk_byte)tmp[1]; - out[2] = (nk_byte)tmp[2]; -} - - - - - -/* =============================================================== - * - * UTF-8 - * - * ===============================================================*/ -NK_GLOBAL const nk_byte nk_utfbyte[NK_UTF_SIZE+1] = {0x80, 0, 0xC0, 0xE0, 0xF0}; -NK_GLOBAL const nk_byte nk_utfmask[NK_UTF_SIZE+1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8}; -NK_GLOBAL const nk_uint nk_utfmin[NK_UTF_SIZE+1] = {0, 0, 0x80, 0x800, 0x10000}; -NK_GLOBAL const nk_uint nk_utfmax[NK_UTF_SIZE+1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF}; - -NK_INTERN int -nk_utf_validate(nk_rune *u, int i) -{ - NK_ASSERT(u); - if (!u) return 0; - if (!NK_BETWEEN(*u, nk_utfmin[i], nk_utfmax[i]) || - NK_BETWEEN(*u, 0xD800, 0xDFFF)) - *u = NK_UTF_INVALID; - for (i = 1; *u > nk_utfmax[i]; ++i); - return i; -} -NK_INTERN nk_rune -nk_utf_decode_byte(char c, int *i) -{ - NK_ASSERT(i); - if (!i) return 0; - for(*i = 0; *i < (int)NK_LEN(nk_utfmask); ++(*i)) { - if (((nk_byte)c & nk_utfmask[*i]) == nk_utfbyte[*i]) - return (nk_byte)(c & ~nk_utfmask[*i]); - } - return 0; -} -NK_API int -nk_utf_decode(const char *c, nk_rune *u, int clen) -{ - int i, j, len, type=0; - nk_rune udecoded; - - NK_ASSERT(c); - NK_ASSERT(u); - - if (!c || !u) return 0; - if (!clen) return 0; - *u = NK_UTF_INVALID; - - udecoded = nk_utf_decode_byte(c[0], &len); - if (!NK_BETWEEN(len, 1, NK_UTF_SIZE)) - return 1; - - for (i = 1, j = 1; i < clen && j < len; ++i, ++j) { - udecoded = (udecoded << 6) | nk_utf_decode_byte(c[i], &type); - if (type != 0) - return j; - } - if (j < len) - return 0; - *u = udecoded; - nk_utf_validate(u, len); - return len; -} -NK_INTERN char -nk_utf_encode_byte(nk_rune u, int i) -{ - return (char)((nk_utfbyte[i]) | ((nk_byte)u & ~nk_utfmask[i])); -} -NK_API int -nk_utf_encode(nk_rune u, char *c, int clen) -{ - int len, i; - len = nk_utf_validate(&u, 0); - if (clen < len || !len || len > NK_UTF_SIZE) - return 0; - - for (i = len - 1; i != 0; --i) { - c[i] = nk_utf_encode_byte(u, 0); - u >>= 6; - } - c[0] = nk_utf_encode_byte(u, len); - return len; -} -NK_API int -nk_utf_len(const char *str, int len) -{ - const char *text; - int glyphs = 0; - int text_len; - int glyph_len; - int src_len = 0; - nk_rune unicode; - - NK_ASSERT(str); - if (!str || !len) return 0; - - text = str; - text_len = len; - glyph_len = nk_utf_decode(text, &unicode, text_len); - while (glyph_len && src_len < len) { - glyphs++; - src_len = src_len + glyph_len; - glyph_len = nk_utf_decode(text + src_len, &unicode, text_len - src_len); - } - return glyphs; -} -NK_API const char* -nk_utf_at(const char *buffer, int length, int index, - nk_rune *unicode, int *len) -{ - int i = 0; - int src_len = 0; - int glyph_len = 0; - const char *text; - int text_len; - - NK_ASSERT(buffer); - NK_ASSERT(unicode); - NK_ASSERT(len); - - if (!buffer || !unicode || !len) return 0; - if (index < 0) { - *unicode = NK_UTF_INVALID; - *len = 0; - return 0; - } - - text = buffer; - text_len = length; - glyph_len = nk_utf_decode(text, unicode, text_len); - while (glyph_len) { - if (i == index) { - *len = glyph_len; - break; - } - - i++; - src_len = src_len + glyph_len; - glyph_len = nk_utf_decode(text + src_len, unicode, text_len - src_len); - } - if (i != index) return 0; - return buffer + src_len; -} - - - - - -/* ============================================================== - * - * BUFFER - * - * ===============================================================*/ -#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR -NK_LIB void* -nk_malloc(nk_handle unused, void *old,nk_size size) -{ - NK_UNUSED(unused); - NK_UNUSED(old); - return malloc(size); -} -NK_LIB void -nk_mfree(nk_handle unused, void *ptr) -{ - NK_UNUSED(unused); - free(ptr); -} -NK_API void -nk_buffer_init_default(struct nk_buffer *buffer) -{ - struct nk_allocator alloc; - alloc.userdata.ptr = 0; - alloc.alloc = nk_malloc; - alloc.free = nk_mfree; - nk_buffer_init(buffer, &alloc, NK_BUFFER_DEFAULT_INITIAL_SIZE); -} -#endif - -NK_API void -nk_buffer_init(struct nk_buffer *b, const struct nk_allocator *a, - nk_size initial_size) -{ - NK_ASSERT(b); - NK_ASSERT(a); - NK_ASSERT(initial_size); - if (!b || !a || !initial_size) return; - - nk_zero(b, sizeof(*b)); - b->type = NK_BUFFER_DYNAMIC; - b->memory.ptr = a->alloc(a->userdata,0, initial_size); - b->memory.size = initial_size; - b->size = initial_size; - b->grow_factor = 2.0f; - b->pool = *a; -} -NK_API void -nk_buffer_init_fixed(struct nk_buffer *b, void *m, nk_size size) -{ - NK_ASSERT(b); - NK_ASSERT(m); - NK_ASSERT(size); - if (!b || !m || !size) return; - - nk_zero(b, sizeof(*b)); - b->type = NK_BUFFER_FIXED; - b->memory.ptr = m; - b->memory.size = size; - b->size = size; -} -NK_LIB void* -nk_buffer_align(void *unaligned, - nk_size align, nk_size *alignment, - enum nk_buffer_allocation_type type) -{ - void *memory = 0; - switch (type) { - default: - case NK_BUFFER_MAX: - case NK_BUFFER_FRONT: - if (align) { - memory = NK_ALIGN_PTR(unaligned, align); - *alignment = (nk_size)((nk_byte*)memory - (nk_byte*)unaligned); - } else { - memory = unaligned; - *alignment = 0; - } - break; - case NK_BUFFER_BACK: - if (align) { - memory = NK_ALIGN_PTR_BACK(unaligned, align); - *alignment = (nk_size)((nk_byte*)unaligned - (nk_byte*)memory); - } else { - memory = unaligned; - *alignment = 0; - } - break; - } - return memory; -} -NK_LIB void* -nk_buffer_realloc(struct nk_buffer *b, nk_size capacity, nk_size *size) -{ - void *temp; - nk_size buffer_size; - - NK_ASSERT(b); - NK_ASSERT(size); - if (!b || !size || !b->pool.alloc || !b->pool.free) - return 0; - - buffer_size = b->memory.size; - temp = b->pool.alloc(b->pool.userdata, b->memory.ptr, capacity); - NK_ASSERT(temp); - if (!temp) return 0; - - *size = capacity; - if (temp != b->memory.ptr) { - NK_MEMCPY(temp, b->memory.ptr, buffer_size); - b->pool.free(b->pool.userdata, b->memory.ptr); - } - - if (b->size == buffer_size) { - /* no back buffer so just set correct size */ - b->size = capacity; - return temp; - } else { - /* copy back buffer to the end of the new buffer */ - void *dst, *src; - nk_size back_size; - back_size = buffer_size - b->size; - dst = nk_ptr_add(void, temp, capacity - back_size); - src = nk_ptr_add(void, temp, b->size); - NK_MEMCPY(dst, src, back_size); - b->size = capacity - back_size; - } - return temp; -} -NK_LIB void* -nk_buffer_alloc(struct nk_buffer *b, enum nk_buffer_allocation_type type, - nk_size size, nk_size align) -{ - int full; - nk_size alignment; - void *unaligned; - void *memory; - - NK_ASSERT(b); - NK_ASSERT(size); - if (!b || !size) return 0; - b->needed += size; - - /* calculate total size with needed alignment + size */ - if (type == NK_BUFFER_FRONT) - unaligned = nk_ptr_add(void, b->memory.ptr, b->allocated); - else unaligned = nk_ptr_add(void, b->memory.ptr, b->size - size); - memory = nk_buffer_align(unaligned, align, &alignment, type); - - /* check if buffer has enough memory*/ - if (type == NK_BUFFER_FRONT) - full = ((b->allocated + size + alignment) > b->size); - else full = ((b->size - NK_MIN(b->size,(size + alignment))) <= b->allocated); - - if (full) { - nk_size capacity; - if (b->type != NK_BUFFER_DYNAMIC) - return 0; - NK_ASSERT(b->pool.alloc && b->pool.free); - if (b->type != NK_BUFFER_DYNAMIC || !b->pool.alloc || !b->pool.free) - return 0; - - /* buffer is full so allocate bigger buffer if dynamic */ - capacity = (nk_size)((float)b->memory.size * b->grow_factor); - capacity = NK_MAX(capacity, nk_round_up_pow2((nk_uint)(b->allocated + size))); - b->memory.ptr = nk_buffer_realloc(b, capacity, &b->memory.size); - if (!b->memory.ptr) return 0; - - /* align newly allocated pointer */ - if (type == NK_BUFFER_FRONT) - unaligned = nk_ptr_add(void, b->memory.ptr, b->allocated); - else unaligned = nk_ptr_add(void, b->memory.ptr, b->size - size); - memory = nk_buffer_align(unaligned, align, &alignment, type); - } - if (type == NK_BUFFER_FRONT) - b->allocated += size + alignment; - else b->size -= (size + alignment); - b->needed += alignment; - b->calls++; - return memory; -} -NK_API void -nk_buffer_push(struct nk_buffer *b, enum nk_buffer_allocation_type type, - const void *memory, nk_size size, nk_size align) -{ - void *mem = nk_buffer_alloc(b, type, size, align); - if (!mem) return; - NK_MEMCPY(mem, memory, size); -} -NK_API void -nk_buffer_mark(struct nk_buffer *buffer, enum nk_buffer_allocation_type type) -{ - NK_ASSERT(buffer); - if (!buffer) return; - buffer->marker[type].active = nk_true; - if (type == NK_BUFFER_BACK) - buffer->marker[type].offset = buffer->size; - else buffer->marker[type].offset = buffer->allocated; -} -NK_API void -nk_buffer_reset(struct nk_buffer *buffer, enum nk_buffer_allocation_type type) -{ - NK_ASSERT(buffer); - if (!buffer) return; - if (type == NK_BUFFER_BACK) { - /* reset back buffer either back to marker or empty */ - buffer->needed -= (buffer->memory.size - buffer->marker[type].offset); - if (buffer->marker[type].active) - buffer->size = buffer->marker[type].offset; - else buffer->size = buffer->memory.size; - buffer->marker[type].active = nk_false; - } else { - /* reset front buffer either back to back marker or empty */ - buffer->needed -= (buffer->allocated - buffer->marker[type].offset); - if (buffer->marker[type].active) - buffer->allocated = buffer->marker[type].offset; - else buffer->allocated = 0; - buffer->marker[type].active = nk_false; - } -} -NK_API void -nk_buffer_clear(struct nk_buffer *b) -{ - NK_ASSERT(b); - if (!b) return; - b->allocated = 0; - b->size = b->memory.size; - b->calls = 0; - b->needed = 0; -} -NK_API void -nk_buffer_free(struct nk_buffer *b) -{ - NK_ASSERT(b); - if (!b || !b->memory.ptr) return; - if (b->type == NK_BUFFER_FIXED) return; - if (!b->pool.free) return; - NK_ASSERT(b->pool.free); - b->pool.free(b->pool.userdata, b->memory.ptr); -} -NK_API void -nk_buffer_info(struct nk_memory_status *s, struct nk_buffer *b) -{ - NK_ASSERT(b); - NK_ASSERT(s); - if (!s || !b) return; - s->allocated = b->allocated; - s->size = b->memory.size; - s->needed = b->needed; - s->memory = b->memory.ptr; - s->calls = b->calls; -} -NK_API void* -nk_buffer_memory(struct nk_buffer *buffer) -{ - NK_ASSERT(buffer); - if (!buffer) return 0; - return buffer->memory.ptr; -} -NK_API const void* -nk_buffer_memory_const(const struct nk_buffer *buffer) -{ - NK_ASSERT(buffer); - if (!buffer) return 0; - return buffer->memory.ptr; -} -NK_API nk_size -nk_buffer_total(struct nk_buffer *buffer) -{ - NK_ASSERT(buffer); - if (!buffer) return 0; - return buffer->memory.size; -} - - - - - -/* =============================================================== - * - * STRING - * - * ===============================================================*/ -#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR -NK_API void -nk_str_init_default(struct nk_str *str) -{ - struct nk_allocator alloc; - alloc.userdata.ptr = 0; - alloc.alloc = nk_malloc; - alloc.free = nk_mfree; - nk_buffer_init(&str->buffer, &alloc, 32); - str->len = 0; -} -#endif - -NK_API void -nk_str_init(struct nk_str *str, const struct nk_allocator *alloc, nk_size size) -{ - nk_buffer_init(&str->buffer, alloc, size); - str->len = 0; -} -NK_API void -nk_str_init_fixed(struct nk_str *str, void *memory, nk_size size) -{ - nk_buffer_init_fixed(&str->buffer, memory, size); - str->len = 0; -} -NK_API int -nk_str_append_text_char(struct nk_str *s, const char *str, int len) -{ - char *mem; - NK_ASSERT(s); - NK_ASSERT(str); - if (!s || !str || !len) return 0; - mem = (char*)nk_buffer_alloc(&s->buffer, NK_BUFFER_FRONT, (nk_size)len * sizeof(char), 0); - if (!mem) return 0; - NK_MEMCPY(mem, str, (nk_size)len * sizeof(char)); - s->len += nk_utf_len(str, len); - return len; -} -NK_API int -nk_str_append_str_char(struct nk_str *s, const char *str) -{ - return nk_str_append_text_char(s, str, nk_strlen(str)); -} -NK_API int -nk_str_append_text_utf8(struct nk_str *str, const char *text, int len) -{ - int i = 0; - int byte_len = 0; - nk_rune unicode; - if (!str || !text || !len) return 0; - for (i = 0; i < len; ++i) - byte_len += nk_utf_decode(text+byte_len, &unicode, 4); - nk_str_append_text_char(str, text, byte_len); - return len; -} -NK_API int -nk_str_append_str_utf8(struct nk_str *str, const char *text) -{ - int runes = 0; - int byte_len = 0; - int num_runes = 0; - int glyph_len = 0; - nk_rune unicode; - if (!str || !text) return 0; - - glyph_len = byte_len = nk_utf_decode(text+byte_len, &unicode, 4); - while (unicode != '\0' && glyph_len) { - glyph_len = nk_utf_decode(text+byte_len, &unicode, 4); - byte_len += glyph_len; - num_runes++; - } - nk_str_append_text_char(str, text, byte_len); - return runes; -} -NK_API int -nk_str_append_text_runes(struct nk_str *str, const nk_rune *text, int len) -{ - int i = 0; - int byte_len = 0; - nk_glyph glyph; - - NK_ASSERT(str); - if (!str || !text || !len) return 0; - for (i = 0; i < len; ++i) { - byte_len = nk_utf_encode(text[i], glyph, NK_UTF_SIZE); - if (!byte_len) break; - nk_str_append_text_char(str, glyph, byte_len); - } - return len; -} -NK_API int -nk_str_append_str_runes(struct nk_str *str, const nk_rune *runes) -{ - int i = 0; - nk_glyph glyph; - int byte_len; - NK_ASSERT(str); - if (!str || !runes) return 0; - while (runes[i] != '\0') { - byte_len = nk_utf_encode(runes[i], glyph, NK_UTF_SIZE); - nk_str_append_text_char(str, glyph, byte_len); - i++; - } - return i; -} -NK_API int -nk_str_insert_at_char(struct nk_str *s, int pos, const char *str, int len) -{ - int i; - void *mem; - char *src; - char *dst; - - int copylen; - NK_ASSERT(s); - NK_ASSERT(str); - NK_ASSERT(len >= 0); - if (!s || !str || !len || (nk_size)pos > s->buffer.allocated) return 0; - if ((s->buffer.allocated + (nk_size)len >= s->buffer.memory.size) && - (s->buffer.type == NK_BUFFER_FIXED)) return 0; - - copylen = (int)s->buffer.allocated - pos; - if (!copylen) { - nk_str_append_text_char(s, str, len); - return 1; - } - mem = nk_buffer_alloc(&s->buffer, NK_BUFFER_FRONT, (nk_size)len * sizeof(char), 0); - if (!mem) return 0; - - /* memmove */ - NK_ASSERT(((int)pos + (int)len + ((int)copylen - 1)) >= 0); - NK_ASSERT(((int)pos + ((int)copylen - 1)) >= 0); - dst = nk_ptr_add(char, s->buffer.memory.ptr, pos + len + (copylen - 1)); - src = nk_ptr_add(char, s->buffer.memory.ptr, pos + (copylen-1)); - for (i = 0; i < copylen; ++i) *dst-- = *src--; - mem = nk_ptr_add(void, s->buffer.memory.ptr, pos); - NK_MEMCPY(mem, str, (nk_size)len * sizeof(char)); - s->len = nk_utf_len((char *)s->buffer.memory.ptr, (int)s->buffer.allocated); - return 1; -} -NK_API int -nk_str_insert_at_rune(struct nk_str *str, int pos, const char *cstr, int len) -{ - int glyph_len; - nk_rune unicode; - const char *begin; - const char *buffer; - - NK_ASSERT(str); - NK_ASSERT(cstr); - NK_ASSERT(len); - if (!str || !cstr || !len) return 0; - begin = nk_str_at_rune(str, pos, &unicode, &glyph_len); - if (!str->len) - return nk_str_append_text_char(str, cstr, len); - buffer = nk_str_get_const(str); - if (!begin) return 0; - return nk_str_insert_at_char(str, (int)(begin - buffer), cstr, len); -} -NK_API int -nk_str_insert_text_char(struct nk_str *str, int pos, const char *text, int len) -{ - return nk_str_insert_text_utf8(str, pos, text, len); -} -NK_API int -nk_str_insert_str_char(struct nk_str *str, int pos, const char *text) -{ - return nk_str_insert_text_utf8(str, pos, text, nk_strlen(text)); -} -NK_API int -nk_str_insert_text_utf8(struct nk_str *str, int pos, const char *text, int len) -{ - int i = 0; - int byte_len = 0; - nk_rune unicode; - - NK_ASSERT(str); - NK_ASSERT(text); - if (!str || !text || !len) return 0; - for (i = 0; i < len; ++i) - byte_len += nk_utf_decode(text+byte_len, &unicode, 4); - nk_str_insert_at_rune(str, pos, text, byte_len); - return len; -} -NK_API int -nk_str_insert_str_utf8(struct nk_str *str, int pos, const char *text) -{ - int runes = 0; - int byte_len = 0; - int num_runes = 0; - int glyph_len = 0; - nk_rune unicode; - if (!str || !text) return 0; - - glyph_len = byte_len = nk_utf_decode(text+byte_len, &unicode, 4); - while (unicode != '\0' && glyph_len) { - glyph_len = nk_utf_decode(text+byte_len, &unicode, 4); - byte_len += glyph_len; - num_runes++; - } - nk_str_insert_at_rune(str, pos, text, byte_len); - return runes; -} -NK_API int -nk_str_insert_text_runes(struct nk_str *str, int pos, const nk_rune *runes, int len) -{ - int i = 0; - int byte_len = 0; - nk_glyph glyph; - - NK_ASSERT(str); - if (!str || !runes || !len) return 0; - for (i = 0; i < len; ++i) { - byte_len = nk_utf_encode(runes[i], glyph, NK_UTF_SIZE); - if (!byte_len) break; - nk_str_insert_at_rune(str, pos+i, glyph, byte_len); - } - return len; -} -NK_API int -nk_str_insert_str_runes(struct nk_str *str, int pos, const nk_rune *runes) -{ - int i = 0; - nk_glyph glyph; - int byte_len; - NK_ASSERT(str); - if (!str || !runes) return 0; - while (runes[i] != '\0') { - byte_len = nk_utf_encode(runes[i], glyph, NK_UTF_SIZE); - nk_str_insert_at_rune(str, pos+i, glyph, byte_len); - i++; - } - return i; -} -NK_API void -nk_str_remove_chars(struct nk_str *s, int len) -{ - NK_ASSERT(s); - NK_ASSERT(len >= 0); - if (!s || len < 0 || (nk_size)len > s->buffer.allocated) return; - NK_ASSERT(((int)s->buffer.allocated - (int)len) >= 0); - s->buffer.allocated -= (nk_size)len; - s->len = nk_utf_len((char *)s->buffer.memory.ptr, (int)s->buffer.allocated); -} -NK_API void -nk_str_remove_runes(struct nk_str *str, int len) -{ - int index; - const char *begin; - const char *end; - nk_rune unicode; - - NK_ASSERT(str); - NK_ASSERT(len >= 0); - if (!str || len < 0) return; - if (len >= str->len) { - str->len = 0; - return; - } - - index = str->len - len; - begin = nk_str_at_rune(str, index, &unicode, &len); - end = (const char*)str->buffer.memory.ptr + str->buffer.allocated; - nk_str_remove_chars(str, (int)(end-begin)+1); -} -NK_API void -nk_str_delete_chars(struct nk_str *s, int pos, int len) -{ - NK_ASSERT(s); - if (!s || !len || (nk_size)pos > s->buffer.allocated || - (nk_size)(pos + len) > s->buffer.allocated) return; - - if ((nk_size)(pos + len) < s->buffer.allocated) { - /* memmove */ - char *dst = nk_ptr_add(char, s->buffer.memory.ptr, pos); - char *src = nk_ptr_add(char, s->buffer.memory.ptr, pos + len); - NK_MEMCPY(dst, src, s->buffer.allocated - (nk_size)(pos + len)); - NK_ASSERT(((int)s->buffer.allocated - (int)len) >= 0); - s->buffer.allocated -= (nk_size)len; - } else nk_str_remove_chars(s, len); - s->len = nk_utf_len((char *)s->buffer.memory.ptr, (int)s->buffer.allocated); -} -NK_API void -nk_str_delete_runes(struct nk_str *s, int pos, int len) -{ - char *temp; - nk_rune unicode; - char *begin; - char *end; - int unused; - - NK_ASSERT(s); - NK_ASSERT(s->len >= pos + len); - if (s->len < pos + len) - len = NK_CLAMP(0, (s->len - pos), s->len); - if (!len) return; - - temp = (char *)s->buffer.memory.ptr; - begin = nk_str_at_rune(s, pos, &unicode, &unused); - if (!begin) return; - s->buffer.memory.ptr = begin; - end = nk_str_at_rune(s, len, &unicode, &unused); - s->buffer.memory.ptr = temp; - if (!end) return; - nk_str_delete_chars(s, (int)(begin - temp), (int)(end - begin)); -} -NK_API char* -nk_str_at_char(struct nk_str *s, int pos) -{ - NK_ASSERT(s); - if (!s || pos > (int)s->buffer.allocated) return 0; - return nk_ptr_add(char, s->buffer.memory.ptr, pos); -} -NK_API char* -nk_str_at_rune(struct nk_str *str, int pos, nk_rune *unicode, int *len) -{ - int i = 0; - int src_len = 0; - int glyph_len = 0; - char *text; - int text_len; - - NK_ASSERT(str); - NK_ASSERT(unicode); - NK_ASSERT(len); - - if (!str || !unicode || !len) return 0; - if (pos < 0) { - *unicode = 0; - *len = 0; - return 0; - } - - text = (char*)str->buffer.memory.ptr; - text_len = (int)str->buffer.allocated; - glyph_len = nk_utf_decode(text, unicode, text_len); - while (glyph_len) { - if (i == pos) { - *len = glyph_len; - break; - } - - i++; - src_len = src_len + glyph_len; - glyph_len = nk_utf_decode(text + src_len, unicode, text_len - src_len); - } - if (i != pos) return 0; - return text + src_len; -} -NK_API const char* -nk_str_at_char_const(const struct nk_str *s, int pos) -{ - NK_ASSERT(s); - if (!s || pos > (int)s->buffer.allocated) return 0; - return nk_ptr_add(char, s->buffer.memory.ptr, pos); -} -NK_API const char* -nk_str_at_const(const struct nk_str *str, int pos, nk_rune *unicode, int *len) -{ - int i = 0; - int src_len = 0; - int glyph_len = 0; - char *text; - int text_len; - - NK_ASSERT(str); - NK_ASSERT(unicode); - NK_ASSERT(len); - - if (!str || !unicode || !len) return 0; - if (pos < 0) { - *unicode = 0; - *len = 0; - return 0; - } - - text = (char*)str->buffer.memory.ptr; - text_len = (int)str->buffer.allocated; - glyph_len = nk_utf_decode(text, unicode, text_len); - while (glyph_len) { - if (i == pos) { - *len = glyph_len; - break; - } - - i++; - src_len = src_len + glyph_len; - glyph_len = nk_utf_decode(text + src_len, unicode, text_len - src_len); - } - if (i != pos) return 0; - return text + src_len; -} -NK_API nk_rune -nk_str_rune_at(const struct nk_str *str, int pos) -{ - int len; - nk_rune unicode = 0; - nk_str_at_const(str, pos, &unicode, &len); - return unicode; -} -NK_API char* -nk_str_get(struct nk_str *s) -{ - NK_ASSERT(s); - if (!s || !s->len || !s->buffer.allocated) return 0; - return (char*)s->buffer.memory.ptr; -} -NK_API const char* -nk_str_get_const(const struct nk_str *s) -{ - NK_ASSERT(s); - if (!s || !s->len || !s->buffer.allocated) return 0; - return (const char*)s->buffer.memory.ptr; -} -NK_API int -nk_str_len(struct nk_str *s) -{ - NK_ASSERT(s); - if (!s || !s->len || !s->buffer.allocated) return 0; - return s->len; -} -NK_API int -nk_str_len_char(struct nk_str *s) -{ - NK_ASSERT(s); - if (!s || !s->len || !s->buffer.allocated) return 0; - return (int)s->buffer.allocated; -} -NK_API void -nk_str_clear(struct nk_str *str) -{ - NK_ASSERT(str); - nk_buffer_clear(&str->buffer); - str->len = 0; -} -NK_API void -nk_str_free(struct nk_str *str) -{ - NK_ASSERT(str); - nk_buffer_free(&str->buffer); - str->len = 0; -} - - - - - -/* ============================================================== - * - * DRAW - * - * ===============================================================*/ -NK_LIB void -nk_command_buffer_init(struct nk_command_buffer *cb, - struct nk_buffer *b, enum nk_command_clipping clip) -{ - NK_ASSERT(cb); - NK_ASSERT(b); - if (!cb || !b) return; - cb->base = b; - cb->use_clipping = (int)clip; - cb->begin = b->allocated; - cb->end = b->allocated; - cb->last = b->allocated; -} -NK_LIB void -nk_command_buffer_reset(struct nk_command_buffer *b) -{ - NK_ASSERT(b); - if (!b) return; - b->begin = 0; - b->end = 0; - b->last = 0; - b->clip = nk_null_rect; -#ifdef NK_INCLUDE_COMMAND_USERDATA - b->userdata.ptr = 0; -#endif -} -NK_LIB void* -nk_command_buffer_push(struct nk_command_buffer* b, - enum nk_command_type t, nk_size size) -{ - NK_STORAGE const nk_size align = NK_ALIGNOF(struct nk_command); - struct nk_command *cmd; - nk_size alignment; - void *unaligned; - void *memory; - - NK_ASSERT(b); - NK_ASSERT(b->base); - if (!b) return 0; - cmd = (struct nk_command*)nk_buffer_alloc(b->base,NK_BUFFER_FRONT,size,align); - if (!cmd) return 0; - - /* make sure the offset to the next command is aligned */ - b->last = (nk_size)((nk_byte*)cmd - (nk_byte*)b->base->memory.ptr); - unaligned = (nk_byte*)cmd + size; - memory = NK_ALIGN_PTR(unaligned, align); - alignment = (nk_size)((nk_byte*)memory - (nk_byte*)unaligned); -#ifdef NK_ZERO_COMMAND_MEMORY - NK_MEMSET(cmd, 0, size + alignment); -#endif - - cmd->type = t; - cmd->next = b->base->allocated + alignment; -#ifdef NK_INCLUDE_COMMAND_USERDATA - cmd->userdata = b->userdata; -#endif - b->end = cmd->next; - return cmd; -} -NK_API void -nk_push_scissor(struct nk_command_buffer *b, struct nk_rect r) -{ - struct nk_command_scissor *cmd; - NK_ASSERT(b); - if (!b) return; - - b->clip.x = r.x; - b->clip.y = r.y; - b->clip.w = r.w; - b->clip.h = r.h; - cmd = (struct nk_command_scissor*) - nk_command_buffer_push(b, NK_COMMAND_SCISSOR, sizeof(*cmd)); - - if (!cmd) return; - cmd->x = (short)r.x; - cmd->y = (short)r.y; - cmd->w = (unsigned short)NK_MAX(0, r.w); - cmd->h = (unsigned short)NK_MAX(0, r.h); -} -NK_API void -nk_stroke_line(struct nk_command_buffer *b, float x0, float y0, - float x1, float y1, float line_thickness, struct nk_color c) -{ - struct nk_command_line *cmd; - NK_ASSERT(b); - if (!b || line_thickness <= 0) return; - cmd = (struct nk_command_line*) - nk_command_buffer_push(b, NK_COMMAND_LINE, sizeof(*cmd)); - if (!cmd) return; - cmd->line_thickness = (unsigned short)line_thickness; - cmd->begin.x = (short)x0; - cmd->begin.y = (short)y0; - cmd->end.x = (short)x1; - cmd->end.y = (short)y1; - cmd->color = c; -} -NK_API void -nk_stroke_curve(struct nk_command_buffer *b, float ax, float ay, - float ctrl0x, float ctrl0y, float ctrl1x, float ctrl1y, - float bx, float by, float line_thickness, struct nk_color col) -{ - struct nk_command_curve *cmd; - NK_ASSERT(b); - if (!b || col.a == 0 || line_thickness <= 0) return; - - cmd = (struct nk_command_curve*) - nk_command_buffer_push(b, NK_COMMAND_CURVE, sizeof(*cmd)); - if (!cmd) return; - cmd->line_thickness = (unsigned short)line_thickness; - cmd->begin.x = (short)ax; - cmd->begin.y = (short)ay; - cmd->ctrl[0].x = (short)ctrl0x; - cmd->ctrl[0].y = (short)ctrl0y; - cmd->ctrl[1].x = (short)ctrl1x; - cmd->ctrl[1].y = (short)ctrl1y; - cmd->end.x = (short)bx; - cmd->end.y = (short)by; - cmd->color = col; -} -NK_API void -nk_stroke_rect(struct nk_command_buffer *b, struct nk_rect rect, - float rounding, float line_thickness, struct nk_color c) -{ - struct nk_command_rect *cmd; - NK_ASSERT(b); - if (!b || c.a == 0 || rect.w == 0 || rect.h == 0 || line_thickness <= 0) return; - if (b->use_clipping) { - const struct nk_rect *clip = &b->clip; - if (!NK_INTERSECT(rect.x, rect.y, rect.w, rect.h, - clip->x, clip->y, clip->w, clip->h)) return; - } - cmd = (struct nk_command_rect*) - nk_command_buffer_push(b, NK_COMMAND_RECT, sizeof(*cmd)); - if (!cmd) return; - cmd->rounding = (unsigned short)rounding; - cmd->line_thickness = (unsigned short)line_thickness; - cmd->x = (short)rect.x; - cmd->y = (short)rect.y; - cmd->w = (unsigned short)NK_MAX(0, rect.w); - cmd->h = (unsigned short)NK_MAX(0, rect.h); - cmd->color = c; -} -NK_API void -nk_fill_rect(struct nk_command_buffer *b, struct nk_rect rect, - float rounding, struct nk_color c) -{ - struct nk_command_rect_filled *cmd; - NK_ASSERT(b); - if (!b || c.a == 0 || rect.w == 0 || rect.h == 0) return; - if (b->use_clipping) { - const struct nk_rect *clip = &b->clip; - if (!NK_INTERSECT(rect.x, rect.y, rect.w, rect.h, - clip->x, clip->y, clip->w, clip->h)) return; - } - - cmd = (struct nk_command_rect_filled*) - nk_command_buffer_push(b, NK_COMMAND_RECT_FILLED, sizeof(*cmd)); - if (!cmd) return; - cmd->rounding = (unsigned short)rounding; - cmd->x = (short)rect.x; - cmd->y = (short)rect.y; - cmd->w = (unsigned short)NK_MAX(0, rect.w); - cmd->h = (unsigned short)NK_MAX(0, rect.h); - cmd->color = c; -} -NK_API void -nk_fill_rect_multi_color(struct nk_command_buffer *b, struct nk_rect rect, - struct nk_color left, struct nk_color top, struct nk_color right, - struct nk_color bottom) -{ - struct nk_command_rect_multi_color *cmd; - NK_ASSERT(b); - if (!b || rect.w == 0 || rect.h == 0) return; - if (b->use_clipping) { - const struct nk_rect *clip = &b->clip; - if (!NK_INTERSECT(rect.x, rect.y, rect.w, rect.h, - clip->x, clip->y, clip->w, clip->h)) return; - } - - cmd = (struct nk_command_rect_multi_color*) - nk_command_buffer_push(b, NK_COMMAND_RECT_MULTI_COLOR, sizeof(*cmd)); - if (!cmd) return; - cmd->x = (short)rect.x; - cmd->y = (short)rect.y; - cmd->w = (unsigned short)NK_MAX(0, rect.w); - cmd->h = (unsigned short)NK_MAX(0, rect.h); - cmd->left = left; - cmd->top = top; - cmd->right = right; - cmd->bottom = bottom; -} -NK_API void -nk_stroke_circle(struct nk_command_buffer *b, struct nk_rect r, - float line_thickness, struct nk_color c) -{ - struct nk_command_circle *cmd; - if (!b || r.w == 0 || r.h == 0 || line_thickness <= 0) return; - if (b->use_clipping) { - const struct nk_rect *clip = &b->clip; - if (!NK_INTERSECT(r.x, r.y, r.w, r.h, clip->x, clip->y, clip->w, clip->h)) - return; - } - - cmd = (struct nk_command_circle*) - nk_command_buffer_push(b, NK_COMMAND_CIRCLE, sizeof(*cmd)); - if (!cmd) return; - cmd->line_thickness = (unsigned short)line_thickness; - cmd->x = (short)r.x; - cmd->y = (short)r.y; - cmd->w = (unsigned short)NK_MAX(r.w, 0); - cmd->h = (unsigned short)NK_MAX(r.h, 0); - cmd->color = c; -} -NK_API void -nk_fill_circle(struct nk_command_buffer *b, struct nk_rect r, struct nk_color c) -{ - struct nk_command_circle_filled *cmd; - NK_ASSERT(b); - if (!b || c.a == 0 || r.w == 0 || r.h == 0) return; - if (b->use_clipping) { - const struct nk_rect *clip = &b->clip; - if (!NK_INTERSECT(r.x, r.y, r.w, r.h, clip->x, clip->y, clip->w, clip->h)) - return; - } - - cmd = (struct nk_command_circle_filled*) - nk_command_buffer_push(b, NK_COMMAND_CIRCLE_FILLED, sizeof(*cmd)); - if (!cmd) return; - cmd->x = (short)r.x; - cmd->y = (short)r.y; - cmd->w = (unsigned short)NK_MAX(r.w, 0); - cmd->h = (unsigned short)NK_MAX(r.h, 0); - cmd->color = c; -} -NK_API void -nk_stroke_arc(struct nk_command_buffer *b, float cx, float cy, float radius, - float a_min, float a_max, float line_thickness, struct nk_color c) -{ - struct nk_command_arc *cmd; - if (!b || c.a == 0 || line_thickness <= 0) return; - cmd = (struct nk_command_arc*) - nk_command_buffer_push(b, NK_COMMAND_ARC, sizeof(*cmd)); - if (!cmd) return; - cmd->line_thickness = (unsigned short)line_thickness; - cmd->cx = (short)cx; - cmd->cy = (short)cy; - cmd->r = (unsigned short)radius; - cmd->a[0] = a_min; - cmd->a[1] = a_max; - cmd->color = c; -} -NK_API void -nk_fill_arc(struct nk_command_buffer *b, float cx, float cy, float radius, - float a_min, float a_max, struct nk_color c) -{ - struct nk_command_arc_filled *cmd; - NK_ASSERT(b); - if (!b || c.a == 0) return; - cmd = (struct nk_command_arc_filled*) - nk_command_buffer_push(b, NK_COMMAND_ARC_FILLED, sizeof(*cmd)); - if (!cmd) return; - cmd->cx = (short)cx; - cmd->cy = (short)cy; - cmd->r = (unsigned short)radius; - cmd->a[0] = a_min; - cmd->a[1] = a_max; - cmd->color = c; -} -NK_API void -nk_stroke_triangle(struct nk_command_buffer *b, float x0, float y0, float x1, - float y1, float x2, float y2, float line_thickness, struct nk_color c) -{ - struct nk_command_triangle *cmd; - NK_ASSERT(b); - if (!b || c.a == 0 || line_thickness <= 0) return; - if (b->use_clipping) { - const struct nk_rect *clip = &b->clip; - if (!NK_INBOX(x0, y0, clip->x, clip->y, clip->w, clip->h) && - !NK_INBOX(x1, y1, clip->x, clip->y, clip->w, clip->h) && - !NK_INBOX(x2, y2, clip->x, clip->y, clip->w, clip->h)) - return; - } - - cmd = (struct nk_command_triangle*) - nk_command_buffer_push(b, NK_COMMAND_TRIANGLE, sizeof(*cmd)); - if (!cmd) return; - cmd->line_thickness = (unsigned short)line_thickness; - cmd->a.x = (short)x0; - cmd->a.y = (short)y0; - cmd->b.x = (short)x1; - cmd->b.y = (short)y1; - cmd->c.x = (short)x2; - cmd->c.y = (short)y2; - cmd->color = c; -} -NK_API void -nk_fill_triangle(struct nk_command_buffer *b, float x0, float y0, float x1, - float y1, float x2, float y2, struct nk_color c) -{ - struct nk_command_triangle_filled *cmd; - NK_ASSERT(b); - if (!b || c.a == 0) return; - if (!b) return; - if (b->use_clipping) { - const struct nk_rect *clip = &b->clip; - if (!NK_INBOX(x0, y0, clip->x, clip->y, clip->w, clip->h) && - !NK_INBOX(x1, y1, clip->x, clip->y, clip->w, clip->h) && - !NK_INBOX(x2, y2, clip->x, clip->y, clip->w, clip->h)) - return; - } - - cmd = (struct nk_command_triangle_filled*) - nk_command_buffer_push(b, NK_COMMAND_TRIANGLE_FILLED, sizeof(*cmd)); - if (!cmd) return; - cmd->a.x = (short)x0; - cmd->a.y = (short)y0; - cmd->b.x = (short)x1; - cmd->b.y = (short)y1; - cmd->c.x = (short)x2; - cmd->c.y = (short)y2; - cmd->color = c; -} -NK_API void -nk_stroke_polygon(struct nk_command_buffer *b, float *points, int point_count, - float line_thickness, struct nk_color col) -{ - int i; - nk_size size = 0; - struct nk_command_polygon *cmd; - - NK_ASSERT(b); - if (!b || col.a == 0 || line_thickness <= 0) return; - size = sizeof(*cmd) + sizeof(short) * 2 * (nk_size)point_count; - cmd = (struct nk_command_polygon*) nk_command_buffer_push(b, NK_COMMAND_POLYGON, size); - if (!cmd) return; - cmd->color = col; - cmd->line_thickness = (unsigned short)line_thickness; - cmd->point_count = (unsigned short)point_count; - for (i = 0; i < point_count; ++i) { - cmd->points[i].x = (short)points[i*2]; - cmd->points[i].y = (short)points[i*2+1]; - } -} -NK_API void -nk_fill_polygon(struct nk_command_buffer *b, float *points, int point_count, - struct nk_color col) -{ - int i; - nk_size size = 0; - struct nk_command_polygon_filled *cmd; - - NK_ASSERT(b); - if (!b || col.a == 0) return; - size = sizeof(*cmd) + sizeof(short) * 2 * (nk_size)point_count; - cmd = (struct nk_command_polygon_filled*) - nk_command_buffer_push(b, NK_COMMAND_POLYGON_FILLED, size); - if (!cmd) return; - cmd->color = col; - cmd->point_count = (unsigned short)point_count; - for (i = 0; i < point_count; ++i) { - cmd->points[i].x = (short)points[i*2+0]; - cmd->points[i].y = (short)points[i*2+1]; - } -} -NK_API void -nk_stroke_polyline(struct nk_command_buffer *b, float *points, int point_count, - float line_thickness, struct nk_color col) -{ - int i; - nk_size size = 0; - struct nk_command_polyline *cmd; - - NK_ASSERT(b); - if (!b || col.a == 0 || line_thickness <= 0) return; - size = sizeof(*cmd) + sizeof(short) * 2 * (nk_size)point_count; - cmd = (struct nk_command_polyline*) nk_command_buffer_push(b, NK_COMMAND_POLYLINE, size); - if (!cmd) return; - cmd->color = col; - cmd->point_count = (unsigned short)point_count; - cmd->line_thickness = (unsigned short)line_thickness; - for (i = 0; i < point_count; ++i) { - cmd->points[i].x = (short)points[i*2]; - cmd->points[i].y = (short)points[i*2+1]; - } -} -NK_API void -nk_draw_image(struct nk_command_buffer *b, struct nk_rect r, - const struct nk_image *img, struct nk_color col) -{ - struct nk_command_image *cmd; - NK_ASSERT(b); - if (!b) return; - if (b->use_clipping) { - const struct nk_rect *c = &b->clip; - if (c->w == 0 || c->h == 0 || !NK_INTERSECT(r.x, r.y, r.w, r.h, c->x, c->y, c->w, c->h)) - return; - } - - cmd = (struct nk_command_image*) - nk_command_buffer_push(b, NK_COMMAND_IMAGE, sizeof(*cmd)); - if (!cmd) return; - cmd->x = (short)r.x; - cmd->y = (short)r.y; - cmd->w = (unsigned short)NK_MAX(0, r.w); - cmd->h = (unsigned short)NK_MAX(0, r.h); - cmd->img = *img; - cmd->col = col; -} -NK_API void -nk_push_custom(struct nk_command_buffer *b, struct nk_rect r, - nk_command_custom_callback cb, nk_handle usr) -{ - struct nk_command_custom *cmd; - NK_ASSERT(b); - if (!b) return; - if (b->use_clipping) { - const struct nk_rect *c = &b->clip; - if (c->w == 0 || c->h == 0 || !NK_INTERSECT(r.x, r.y, r.w, r.h, c->x, c->y, c->w, c->h)) - return; - } - - cmd = (struct nk_command_custom*) - nk_command_buffer_push(b, NK_COMMAND_CUSTOM, sizeof(*cmd)); - if (!cmd) return; - cmd->x = (short)r.x; - cmd->y = (short)r.y; - cmd->w = (unsigned short)NK_MAX(0, r.w); - cmd->h = (unsigned short)NK_MAX(0, r.h); - cmd->callback_data = usr; - cmd->callback = cb; -} -NK_API void -nk_draw_text(struct nk_command_buffer *b, struct nk_rect r, - const char *string, int length, const struct nk_user_font *font, - struct nk_color bg, struct nk_color fg) -{ - float text_width = 0; - struct nk_command_text *cmd; - - NK_ASSERT(b); - NK_ASSERT(font); - if (!b || !string || !length || (bg.a == 0 && fg.a == 0)) return; - if (b->use_clipping) { - const struct nk_rect *c = &b->clip; - if (c->w == 0 || c->h == 0 || !NK_INTERSECT(r.x, r.y, r.w, r.h, c->x, c->y, c->w, c->h)) - return; - } - - /* make sure text fits inside bounds */ - text_width = font->width(font->userdata, font->height, string, length); - if (text_width > r.w){ - int glyphs = 0; - float txt_width = (float)text_width; - length = nk_text_clamp(font, string, length, r.w, &glyphs, &txt_width, 0,0); - } - - if (!length) return; - cmd = (struct nk_command_text*) - nk_command_buffer_push(b, NK_COMMAND_TEXT, sizeof(*cmd) + (nk_size)(length + 1)); - if (!cmd) return; - cmd->x = (short)r.x; - cmd->y = (short)r.y; - cmd->w = (unsigned short)r.w; - cmd->h = (unsigned short)r.h; - cmd->background = bg; - cmd->foreground = fg; - cmd->font = font; - cmd->length = length; - cmd->height = font->height; - NK_MEMCPY(cmd->string, string, (nk_size)length); - cmd->string[length] = '\0'; -} - - - - - -/* =============================================================== - * - * VERTEX - * - * ===============================================================*/ -#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT -NK_API void -nk_draw_list_init(struct nk_draw_list *list) -{ - nk_size i = 0; - NK_ASSERT(list); - if (!list) return; - nk_zero(list, sizeof(*list)); - for (i = 0; i < NK_LEN(list->circle_vtx); ++i) { - const float a = ((float)i / (float)NK_LEN(list->circle_vtx)) * 2 * NK_PI; - list->circle_vtx[i].x = (float)NK_COS(a); - list->circle_vtx[i].y = (float)NK_SIN(a); - } -} -NK_API void -nk_draw_list_setup(struct nk_draw_list *canvas, const struct nk_convert_config *config, - struct nk_buffer *cmds, struct nk_buffer *vertices, struct nk_buffer *elements, - enum nk_anti_aliasing line_aa, enum nk_anti_aliasing shape_aa) -{ - NK_ASSERT(canvas); - NK_ASSERT(config); - NK_ASSERT(cmds); - NK_ASSERT(vertices); - NK_ASSERT(elements); - if (!canvas || !config || !cmds || !vertices || !elements) - return; - - canvas->buffer = cmds; - canvas->config = *config; - canvas->elements = elements; - canvas->vertices = vertices; - canvas->line_AA = line_aa; - canvas->shape_AA = shape_aa; - canvas->clip_rect = nk_null_rect; - - canvas->cmd_offset = 0; - canvas->element_count = 0; - canvas->vertex_count = 0; - canvas->cmd_offset = 0; - canvas->cmd_count = 0; - canvas->path_count = 0; -} -NK_API const struct nk_draw_command* -nk__draw_list_begin(const struct nk_draw_list *canvas, const struct nk_buffer *buffer) -{ - nk_byte *memory; - nk_size offset; - const struct nk_draw_command *cmd; - - NK_ASSERT(buffer); - if (!buffer || !buffer->size || !canvas->cmd_count) - return 0; - - memory = (nk_byte*)buffer->memory.ptr; - offset = buffer->memory.size - canvas->cmd_offset; - cmd = nk_ptr_add(const struct nk_draw_command, memory, offset); - return cmd; -} -NK_API const struct nk_draw_command* -nk__draw_list_end(const struct nk_draw_list *canvas, const struct nk_buffer *buffer) -{ - nk_size size; - nk_size offset; - nk_byte *memory; - const struct nk_draw_command *end; - - NK_ASSERT(buffer); - NK_ASSERT(canvas); - if (!buffer || !canvas) - return 0; - - memory = (nk_byte*)buffer->memory.ptr; - size = buffer->memory.size; - offset = size - canvas->cmd_offset; - end = nk_ptr_add(const struct nk_draw_command, memory, offset); - end -= (canvas->cmd_count-1); - return end; -} -NK_API const struct nk_draw_command* -nk__draw_list_next(const struct nk_draw_command *cmd, - const struct nk_buffer *buffer, const struct nk_draw_list *canvas) -{ - const struct nk_draw_command *end; - NK_ASSERT(buffer); - NK_ASSERT(canvas); - if (!cmd || !buffer || !canvas) - return 0; - - end = nk__draw_list_end(canvas, buffer); - if (cmd <= end) return 0; - return (cmd-1); -} -NK_INTERN struct nk_vec2* -nk_draw_list_alloc_path(struct nk_draw_list *list, int count) -{ - struct nk_vec2 *points; - NK_STORAGE const nk_size point_align = NK_ALIGNOF(struct nk_vec2); - NK_STORAGE const nk_size point_size = sizeof(struct nk_vec2); - points = (struct nk_vec2*) - nk_buffer_alloc(list->buffer, NK_BUFFER_FRONT, - point_size * (nk_size)count, point_align); - - if (!points) return 0; - if (!list->path_offset) { - void *memory = nk_buffer_memory(list->buffer); - list->path_offset = (unsigned int)((nk_byte*)points - (nk_byte*)memory); - } - list->path_count += (unsigned int)count; - return points; -} -NK_INTERN struct nk_vec2 -nk_draw_list_path_last(struct nk_draw_list *list) -{ - void *memory; - struct nk_vec2 *point; - NK_ASSERT(list->path_count); - memory = nk_buffer_memory(list->buffer); - point = nk_ptr_add(struct nk_vec2, memory, list->path_offset); - point += (list->path_count-1); - return *point; -} -NK_INTERN struct nk_draw_command* -nk_draw_list_push_command(struct nk_draw_list *list, struct nk_rect clip, - nk_handle texture) -{ - NK_STORAGE const nk_size cmd_align = NK_ALIGNOF(struct nk_draw_command); - NK_STORAGE const nk_size cmd_size = sizeof(struct nk_draw_command); - struct nk_draw_command *cmd; - - NK_ASSERT(list); - cmd = (struct nk_draw_command*) - nk_buffer_alloc(list->buffer, NK_BUFFER_BACK, cmd_size, cmd_align); - - if (!cmd) return 0; - if (!list->cmd_count) { - nk_byte *memory = (nk_byte*)nk_buffer_memory(list->buffer); - nk_size total = nk_buffer_total(list->buffer); - memory = nk_ptr_add(nk_byte, memory, total); - list->cmd_offset = (nk_size)(memory - (nk_byte*)cmd); - } - - cmd->elem_count = 0; - cmd->clip_rect = clip; - cmd->texture = texture; -#ifdef NK_INCLUDE_COMMAND_USERDATA - cmd->userdata = list->userdata; -#endif - - list->cmd_count++; - list->clip_rect = clip; - return cmd; -} -NK_INTERN struct nk_draw_command* -nk_draw_list_command_last(struct nk_draw_list *list) -{ - void *memory; - nk_size size; - struct nk_draw_command *cmd; - NK_ASSERT(list->cmd_count); - - memory = nk_buffer_memory(list->buffer); - size = nk_buffer_total(list->buffer); - cmd = nk_ptr_add(struct nk_draw_command, memory, size - list->cmd_offset); - return (cmd - (list->cmd_count-1)); -} -NK_INTERN void -nk_draw_list_add_clip(struct nk_draw_list *list, struct nk_rect rect) -{ - NK_ASSERT(list); - if (!list) return; - if (!list->cmd_count) { - nk_draw_list_push_command(list, rect, list->config.null.texture); - } else { - struct nk_draw_command *prev = nk_draw_list_command_last(list); - if (prev->elem_count == 0) - prev->clip_rect = rect; - nk_draw_list_push_command(list, rect, prev->texture); - } -} -NK_INTERN void -nk_draw_list_push_image(struct nk_draw_list *list, nk_handle texture) -{ - NK_ASSERT(list); - if (!list) return; - if (!list->cmd_count) { - nk_draw_list_push_command(list, nk_null_rect, texture); - } else { - struct nk_draw_command *prev = nk_draw_list_command_last(list); - if (prev->elem_count == 0) { - prev->texture = texture; - #ifdef NK_INCLUDE_COMMAND_USERDATA - prev->userdata = list->userdata; - #endif - } else if (prev->texture.id != texture.id - #ifdef NK_INCLUDE_COMMAND_USERDATA - || prev->userdata.id != list->userdata.id - #endif - ) nk_draw_list_push_command(list, prev->clip_rect, texture); - } -} -#ifdef NK_INCLUDE_COMMAND_USERDATA -NK_API void -nk_draw_list_push_userdata(struct nk_draw_list *list, nk_handle userdata) -{ - list->userdata = userdata; -} -#endif -NK_INTERN void* -nk_draw_list_alloc_vertices(struct nk_draw_list *list, nk_size count) -{ - void *vtx; - NK_ASSERT(list); - if (!list) return 0; - vtx = nk_buffer_alloc(list->vertices, NK_BUFFER_FRONT, - list->config.vertex_size*count, list->config.vertex_alignment); - if (!vtx) return 0; - list->vertex_count += (unsigned int)count; - - /* This assert triggers because your are drawing a lot of stuff and nuklear - * defined `nk_draw_index` as `nk_ushort` to safe space be default. - * - * So you reached the maximum number of indicies or rather vertexes. - * To solve this issue please change typdef `nk_draw_index` to `nk_uint` - * and don't forget to specify the new element size in your drawing - * backend (OpenGL, DirectX, ...). For example in OpenGL for `glDrawElements` - * instead of specifing `GL_UNSIGNED_SHORT` you have to define `GL_UNSIGNED_INT`. - * Sorry for the inconvenience. */ - if(sizeof(nk_draw_index)==2) NK_ASSERT((list->vertex_count < NK_USHORT_MAX && - "To many verticies for 16-bit vertex indicies. Please read comment above on how to solve this problem")); - return vtx; -} -NK_INTERN nk_draw_index* -nk_draw_list_alloc_elements(struct nk_draw_list *list, nk_size count) -{ - nk_draw_index *ids; - struct nk_draw_command *cmd; - NK_STORAGE const nk_size elem_align = NK_ALIGNOF(nk_draw_index); - NK_STORAGE const nk_size elem_size = sizeof(nk_draw_index); - NK_ASSERT(list); - if (!list) return 0; - - ids = (nk_draw_index*) - nk_buffer_alloc(list->elements, NK_BUFFER_FRONT, elem_size*count, elem_align); - if (!ids) return 0; - cmd = nk_draw_list_command_last(list); - list->element_count += (unsigned int)count; - cmd->elem_count += (unsigned int)count; - return ids; -} -NK_INTERN int -nk_draw_vertex_layout_element_is_end_of_layout( - const struct nk_draw_vertex_layout_element *element) -{ - return (element->attribute == NK_VERTEX_ATTRIBUTE_COUNT || - element->format == NK_FORMAT_COUNT); -} -NK_INTERN void -nk_draw_vertex_color(void *attr, const float *vals, - enum nk_draw_vertex_layout_format format) -{ - /* if this triggers you tried to provide a value format for a color */ - float val[4]; - NK_ASSERT(format >= NK_FORMAT_COLOR_BEGIN); - NK_ASSERT(format <= NK_FORMAT_COLOR_END); - if (format < NK_FORMAT_COLOR_BEGIN || format > NK_FORMAT_COLOR_END) return; - - val[0] = NK_SATURATE(vals[0]); - val[1] = NK_SATURATE(vals[1]); - val[2] = NK_SATURATE(vals[2]); - val[3] = NK_SATURATE(vals[3]); - - switch (format) { - default: NK_ASSERT(0 && "Invalid vertex layout color format"); break; - case NK_FORMAT_R8G8B8A8: - case NK_FORMAT_R8G8B8: { - struct nk_color col = nk_rgba_fv(val); - NK_MEMCPY(attr, &col.r, sizeof(col)); - } break; - case NK_FORMAT_B8G8R8A8: { - struct nk_color col = nk_rgba_fv(val); - struct nk_color bgra = nk_rgba(col.b, col.g, col.r, col.a); - NK_MEMCPY(attr, &bgra, sizeof(bgra)); - } break; - case NK_FORMAT_R16G15B16: { - nk_ushort col[3]; - col[0] = (nk_ushort)(val[0]*(float)NK_USHORT_MAX); - col[1] = (nk_ushort)(val[1]*(float)NK_USHORT_MAX); - col[2] = (nk_ushort)(val[2]*(float)NK_USHORT_MAX); - NK_MEMCPY(attr, col, sizeof(col)); - } break; - case NK_FORMAT_R16G15B16A16: { - nk_ushort col[4]; - col[0] = (nk_ushort)(val[0]*(float)NK_USHORT_MAX); - col[1] = (nk_ushort)(val[1]*(float)NK_USHORT_MAX); - col[2] = (nk_ushort)(val[2]*(float)NK_USHORT_MAX); - col[3] = (nk_ushort)(val[3]*(float)NK_USHORT_MAX); - NK_MEMCPY(attr, col, sizeof(col)); - } break; - case NK_FORMAT_R32G32B32: { - nk_uint col[3]; - col[0] = (nk_uint)(val[0]*(float)NK_UINT_MAX); - col[1] = (nk_uint)(val[1]*(float)NK_UINT_MAX); - col[2] = (nk_uint)(val[2]*(float)NK_UINT_MAX); - NK_MEMCPY(attr, col, sizeof(col)); - } break; - case NK_FORMAT_R32G32B32A32: { - nk_uint col[4]; - col[0] = (nk_uint)(val[0]*(float)NK_UINT_MAX); - col[1] = (nk_uint)(val[1]*(float)NK_UINT_MAX); - col[2] = (nk_uint)(val[2]*(float)NK_UINT_MAX); - col[3] = (nk_uint)(val[3]*(float)NK_UINT_MAX); - NK_MEMCPY(attr, col, sizeof(col)); - } break; - case NK_FORMAT_R32G32B32A32_FLOAT: - NK_MEMCPY(attr, val, sizeof(float)*4); - break; - case NK_FORMAT_R32G32B32A32_DOUBLE: { - double col[4]; - col[0] = (double)val[0]; - col[1] = (double)val[1]; - col[2] = (double)val[2]; - col[3] = (double)val[3]; - NK_MEMCPY(attr, col, sizeof(col)); - } break; - case NK_FORMAT_RGB32: - case NK_FORMAT_RGBA32: { - struct nk_color col = nk_rgba_fv(val); - nk_uint color = nk_color_u32(col); - NK_MEMCPY(attr, &color, sizeof(color)); - } break; } -} -NK_INTERN void -nk_draw_vertex_element(void *dst, const float *values, int value_count, - enum nk_draw_vertex_layout_format format) -{ - int value_index; - void *attribute = dst; - /* if this triggers you tried to provide a color format for a value */ - NK_ASSERT(format < NK_FORMAT_COLOR_BEGIN); - if (format >= NK_FORMAT_COLOR_BEGIN && format <= NK_FORMAT_COLOR_END) return; - for (value_index = 0; value_index < value_count; ++value_index) { - switch (format) { - default: NK_ASSERT(0 && "invalid vertex layout format"); break; - case NK_FORMAT_SCHAR: { - char value = (char)NK_CLAMP((float)NK_SCHAR_MIN, values[value_index], (float)NK_SCHAR_MAX); - NK_MEMCPY(attribute, &value, sizeof(value)); - attribute = (void*)((char*)attribute + sizeof(char)); - } break; - case NK_FORMAT_SSHORT: { - nk_short value = (nk_short)NK_CLAMP((float)NK_SSHORT_MIN, values[value_index], (float)NK_SSHORT_MAX); - NK_MEMCPY(attribute, &value, sizeof(value)); - attribute = (void*)((char*)attribute + sizeof(value)); - } break; - case NK_FORMAT_SINT: { - nk_int value = (nk_int)NK_CLAMP((float)NK_SINT_MIN, values[value_index], (float)NK_SINT_MAX); - NK_MEMCPY(attribute, &value, sizeof(value)); - attribute = (void*)((char*)attribute + sizeof(nk_int)); - } break; - case NK_FORMAT_UCHAR: { - unsigned char value = (unsigned char)NK_CLAMP((float)NK_UCHAR_MIN, values[value_index], (float)NK_UCHAR_MAX); - NK_MEMCPY(attribute, &value, sizeof(value)); - attribute = (void*)((char*)attribute + sizeof(unsigned char)); - } break; - case NK_FORMAT_USHORT: { - nk_ushort value = (nk_ushort)NK_CLAMP((float)NK_USHORT_MIN, values[value_index], (float)NK_USHORT_MAX); - NK_MEMCPY(attribute, &value, sizeof(value)); - attribute = (void*)((char*)attribute + sizeof(value)); - } break; - case NK_FORMAT_UINT: { - nk_uint value = (nk_uint)NK_CLAMP((float)NK_UINT_MIN, values[value_index], (float)NK_UINT_MAX); - NK_MEMCPY(attribute, &value, sizeof(value)); - attribute = (void*)((char*)attribute + sizeof(nk_uint)); - } break; - case NK_FORMAT_FLOAT: - NK_MEMCPY(attribute, &values[value_index], sizeof(values[value_index])); - attribute = (void*)((char*)attribute + sizeof(float)); - break; - case NK_FORMAT_DOUBLE: { - double value = (double)values[value_index]; - NK_MEMCPY(attribute, &value, sizeof(value)); - attribute = (void*)((char*)attribute + sizeof(double)); - } break; - } - } -} -NK_INTERN void* -nk_draw_vertex(void *dst, const struct nk_convert_config *config, - struct nk_vec2 pos, struct nk_vec2 uv, struct nk_colorf color) -{ - void *result = (void*)((char*)dst + config->vertex_size); - const struct nk_draw_vertex_layout_element *elem_iter = config->vertex_layout; - while (!nk_draw_vertex_layout_element_is_end_of_layout(elem_iter)) { - void *address = (void*)((char*)dst + elem_iter->offset); - switch (elem_iter->attribute) { - case NK_VERTEX_ATTRIBUTE_COUNT: - default: NK_ASSERT(0 && "wrong element attribute"); break; - case NK_VERTEX_POSITION: nk_draw_vertex_element(address, &pos.x, 2, elem_iter->format); break; - case NK_VERTEX_TEXCOORD: nk_draw_vertex_element(address, &uv.x, 2, elem_iter->format); break; - case NK_VERTEX_COLOR: nk_draw_vertex_color(address, &color.r, elem_iter->format); break; - } - elem_iter++; - } - return result; -} -NK_API void -nk_draw_list_stroke_poly_line(struct nk_draw_list *list, const struct nk_vec2 *points, - const unsigned int points_count, struct nk_color color, enum nk_draw_list_stroke closed, - float thickness, enum nk_anti_aliasing aliasing) -{ - nk_size count; - int thick_line; - struct nk_colorf col; - struct nk_colorf col_trans; - NK_ASSERT(list); - if (!list || points_count < 2) return; - - color.a = (nk_byte)((float)color.a * list->config.global_alpha); - count = points_count; - if (!closed) count = points_count-1; - thick_line = thickness > 1.0f; - -#ifdef NK_INCLUDE_COMMAND_USERDATA - nk_draw_list_push_userdata(list, list->userdata); -#endif - - color.a = (nk_byte)((float)color.a * list->config.global_alpha); - nk_color_fv(&col.r, color); - col_trans = col; - col_trans.a = 0; - - if (aliasing == NK_ANTI_ALIASING_ON) { - /* ANTI-ALIASED STROKE */ - const float AA_SIZE = 1.0f; - NK_STORAGE const nk_size pnt_align = NK_ALIGNOF(struct nk_vec2); - NK_STORAGE const nk_size pnt_size = sizeof(struct nk_vec2); - - /* allocate vertices and elements */ - nk_size i1 = 0; - nk_size vertex_offset; - nk_size index = list->vertex_count; - - const nk_size idx_count = (thick_line) ? (count * 18) : (count * 12); - const nk_size vtx_count = (thick_line) ? (points_count * 4): (points_count *3); - - void *vtx = nk_draw_list_alloc_vertices(list, vtx_count); - nk_draw_index *ids = nk_draw_list_alloc_elements(list, idx_count); - - nk_size size; - struct nk_vec2 *normals, *temp; - if (!vtx || !ids) return; - - /* temporary allocate normals + points */ - vertex_offset = (nk_size)((nk_byte*)vtx - (nk_byte*)list->vertices->memory.ptr); - nk_buffer_mark(list->vertices, NK_BUFFER_FRONT); - size = pnt_size * ((thick_line) ? 5 : 3) * points_count; - normals = (struct nk_vec2*) nk_buffer_alloc(list->vertices, NK_BUFFER_FRONT, size, pnt_align); - if (!normals) return; - temp = normals + points_count; - - /* make sure vertex pointer is still correct */ - vtx = (void*)((nk_byte*)list->vertices->memory.ptr + vertex_offset); - - /* calculate normals */ - for (i1 = 0; i1 < count; ++i1) { - const nk_size i2 = ((i1 + 1) == points_count) ? 0 : (i1 + 1); - struct nk_vec2 diff = nk_vec2_sub(points[i2], points[i1]); - float len; - - /* vec2 inverted length */ - len = nk_vec2_len_sqr(diff); - if (len != 0.0f) - len = nk_inv_sqrt(len); - else len = 1.0f; - - diff = nk_vec2_muls(diff, len); - normals[i1].x = diff.y; - normals[i1].y = -diff.x; - } - - if (!closed) - normals[points_count-1] = normals[points_count-2]; - - if (!thick_line) { - nk_size idx1, i; - if (!closed) { - struct nk_vec2 d; - temp[0] = nk_vec2_add(points[0], nk_vec2_muls(normals[0], AA_SIZE)); - temp[1] = nk_vec2_sub(points[0], nk_vec2_muls(normals[0], AA_SIZE)); - d = nk_vec2_muls(normals[points_count-1], AA_SIZE); - temp[(points_count-1) * 2 + 0] = nk_vec2_add(points[points_count-1], d); - temp[(points_count-1) * 2 + 1] = nk_vec2_sub(points[points_count-1], d); - } - - /* fill elements */ - idx1 = index; - for (i1 = 0; i1 < count; i1++) { - struct nk_vec2 dm; - float dmr2; - nk_size i2 = ((i1 + 1) == points_count) ? 0 : (i1 + 1); - nk_size idx2 = ((i1+1) == points_count) ? index: (idx1 + 3); - - /* average normals */ - dm = nk_vec2_muls(nk_vec2_add(normals[i1], normals[i2]), 0.5f); - dmr2 = dm.x * dm.x + dm.y* dm.y; - if (dmr2 > 0.000001f) { - float scale = 1.0f/dmr2; - scale = NK_MIN(100.0f, scale); - dm = nk_vec2_muls(dm, scale); - } - - dm = nk_vec2_muls(dm, AA_SIZE); - temp[i2*2+0] = nk_vec2_add(points[i2], dm); - temp[i2*2+1] = nk_vec2_sub(points[i2], dm); - - ids[0] = (nk_draw_index)(idx2 + 0); ids[1] = (nk_draw_index)(idx1+0); - ids[2] = (nk_draw_index)(idx1 + 2); ids[3] = (nk_draw_index)(idx1+2); - ids[4] = (nk_draw_index)(idx2 + 2); ids[5] = (nk_draw_index)(idx2+0); - ids[6] = (nk_draw_index)(idx2 + 1); ids[7] = (nk_draw_index)(idx1+1); - ids[8] = (nk_draw_index)(idx1 + 0); ids[9] = (nk_draw_index)(idx1+0); - ids[10]= (nk_draw_index)(idx2 + 0); ids[11]= (nk_draw_index)(idx2+1); - ids += 12; - idx1 = idx2; - } - - /* fill vertices */ - for (i = 0; i < points_count; ++i) { - const struct nk_vec2 uv = list->config.null.uv; - vtx = nk_draw_vertex(vtx, &list->config, points[i], uv, col); - vtx = nk_draw_vertex(vtx, &list->config, temp[i*2+0], uv, col_trans); - vtx = nk_draw_vertex(vtx, &list->config, temp[i*2+1], uv, col_trans); - } - } else { - nk_size idx1, i; - const float half_inner_thickness = (thickness - AA_SIZE) * 0.5f; - if (!closed) { - struct nk_vec2 d1 = nk_vec2_muls(normals[0], half_inner_thickness + AA_SIZE); - struct nk_vec2 d2 = nk_vec2_muls(normals[0], half_inner_thickness); - - temp[0] = nk_vec2_add(points[0], d1); - temp[1] = nk_vec2_add(points[0], d2); - temp[2] = nk_vec2_sub(points[0], d2); - temp[3] = nk_vec2_sub(points[0], d1); - - d1 = nk_vec2_muls(normals[points_count-1], half_inner_thickness + AA_SIZE); - d2 = nk_vec2_muls(normals[points_count-1], half_inner_thickness); - - temp[(points_count-1)*4+0] = nk_vec2_add(points[points_count-1], d1); - temp[(points_count-1)*4+1] = nk_vec2_add(points[points_count-1], d2); - temp[(points_count-1)*4+2] = nk_vec2_sub(points[points_count-1], d2); - temp[(points_count-1)*4+3] = nk_vec2_sub(points[points_count-1], d1); - } - - /* add all elements */ - idx1 = index; - for (i1 = 0; i1 < count; ++i1) { - struct nk_vec2 dm_out, dm_in; - const nk_size i2 = ((i1+1) == points_count) ? 0: (i1 + 1); - nk_size idx2 = ((i1+1) == points_count) ? index: (idx1 + 4); - - /* average normals */ - struct nk_vec2 dm = nk_vec2_muls(nk_vec2_add(normals[i1], normals[i2]), 0.5f); - float dmr2 = dm.x * dm.x + dm.y* dm.y; - if (dmr2 > 0.000001f) { - float scale = 1.0f/dmr2; - scale = NK_MIN(100.0f, scale); - dm = nk_vec2_muls(dm, scale); - } - - dm_out = nk_vec2_muls(dm, ((half_inner_thickness) + AA_SIZE)); - dm_in = nk_vec2_muls(dm, half_inner_thickness); - temp[i2*4+0] = nk_vec2_add(points[i2], dm_out); - temp[i2*4+1] = nk_vec2_add(points[i2], dm_in); - temp[i2*4+2] = nk_vec2_sub(points[i2], dm_in); - temp[i2*4+3] = nk_vec2_sub(points[i2], dm_out); - - /* add indexes */ - ids[0] = (nk_draw_index)(idx2 + 1); ids[1] = (nk_draw_index)(idx1+1); - ids[2] = (nk_draw_index)(idx1 + 2); ids[3] = (nk_draw_index)(idx1+2); - ids[4] = (nk_draw_index)(idx2 + 2); ids[5] = (nk_draw_index)(idx2+1); - ids[6] = (nk_draw_index)(idx2 + 1); ids[7] = (nk_draw_index)(idx1+1); - ids[8] = (nk_draw_index)(idx1 + 0); ids[9] = (nk_draw_index)(idx1+0); - ids[10]= (nk_draw_index)(idx2 + 0); ids[11] = (nk_draw_index)(idx2+1); - ids[12]= (nk_draw_index)(idx2 + 2); ids[13] = (nk_draw_index)(idx1+2); - ids[14]= (nk_draw_index)(idx1 + 3); ids[15] = (nk_draw_index)(idx1+3); - ids[16]= (nk_draw_index)(idx2 + 3); ids[17] = (nk_draw_index)(idx2+2); - ids += 18; - idx1 = idx2; - } - - /* add vertices */ - for (i = 0; i < points_count; ++i) { - const struct nk_vec2 uv = list->config.null.uv; - vtx = nk_draw_vertex(vtx, &list->config, temp[i*4+0], uv, col_trans); - vtx = nk_draw_vertex(vtx, &list->config, temp[i*4+1], uv, col); - vtx = nk_draw_vertex(vtx, &list->config, temp[i*4+2], uv, col); - vtx = nk_draw_vertex(vtx, &list->config, temp[i*4+3], uv, col_trans); - } - } - /* free temporary normals + points */ - nk_buffer_reset(list->vertices, NK_BUFFER_FRONT); - } else { - /* NON ANTI-ALIASED STROKE */ - nk_size i1 = 0; - nk_size idx = list->vertex_count; - const nk_size idx_count = count * 6; - const nk_size vtx_count = count * 4; - void *vtx = nk_draw_list_alloc_vertices(list, vtx_count); - nk_draw_index *ids = nk_draw_list_alloc_elements(list, idx_count); - if (!vtx || !ids) return; - - for (i1 = 0; i1 < count; ++i1) { - float dx, dy; - const struct nk_vec2 uv = list->config.null.uv; - const nk_size i2 = ((i1+1) == points_count) ? 0 : i1 + 1; - const struct nk_vec2 p1 = points[i1]; - const struct nk_vec2 p2 = points[i2]; - struct nk_vec2 diff = nk_vec2_sub(p2, p1); - float len; - - /* vec2 inverted length */ - len = nk_vec2_len_sqr(diff); - if (len != 0.0f) - len = nk_inv_sqrt(len); - else len = 1.0f; - diff = nk_vec2_muls(diff, len); - - /* add vertices */ - dx = diff.x * (thickness * 0.5f); - dy = diff.y * (thickness * 0.5f); - - vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(p1.x + dy, p1.y - dx), uv, col); - vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(p2.x + dy, p2.y - dx), uv, col); - vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(p2.x - dy, p2.y + dx), uv, col); - vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(p1.x - dy, p1.y + dx), uv, col); - - ids[0] = (nk_draw_index)(idx+0); ids[1] = (nk_draw_index)(idx+1); - ids[2] = (nk_draw_index)(idx+2); ids[3] = (nk_draw_index)(idx+0); - ids[4] = (nk_draw_index)(idx+2); ids[5] = (nk_draw_index)(idx+3); - - ids += 6; - idx += 4; - } - } -} -NK_API void -nk_draw_list_fill_poly_convex(struct nk_draw_list *list, - const struct nk_vec2 *points, const unsigned int points_count, - struct nk_color color, enum nk_anti_aliasing aliasing) -{ - struct nk_colorf col; - struct nk_colorf col_trans; - - NK_STORAGE const nk_size pnt_align = NK_ALIGNOF(struct nk_vec2); - NK_STORAGE const nk_size pnt_size = sizeof(struct nk_vec2); - NK_ASSERT(list); - if (!list || points_count < 3) return; - -#ifdef NK_INCLUDE_COMMAND_USERDATA - nk_draw_list_push_userdata(list, list->userdata); -#endif - - color.a = (nk_byte)((float)color.a * list->config.global_alpha); - nk_color_fv(&col.r, color); - col_trans = col; - col_trans.a = 0; - - if (aliasing == NK_ANTI_ALIASING_ON) { - nk_size i = 0; - nk_size i0 = 0; - nk_size i1 = 0; - - const float AA_SIZE = 1.0f; - nk_size vertex_offset = 0; - nk_size index = list->vertex_count; - - const nk_size idx_count = (points_count-2)*3 + points_count*6; - const nk_size vtx_count = (points_count*2); - - void *vtx = nk_draw_list_alloc_vertices(list, vtx_count); - nk_draw_index *ids = nk_draw_list_alloc_elements(list, idx_count); - - nk_size size = 0; - struct nk_vec2 *normals = 0; - unsigned int vtx_inner_idx = (unsigned int)(index + 0); - unsigned int vtx_outer_idx = (unsigned int)(index + 1); - if (!vtx || !ids) return; - - /* temporary allocate normals */ - vertex_offset = (nk_size)((nk_byte*)vtx - (nk_byte*)list->vertices->memory.ptr); - nk_buffer_mark(list->vertices, NK_BUFFER_FRONT); - size = pnt_size * points_count; - normals = (struct nk_vec2*) nk_buffer_alloc(list->vertices, NK_BUFFER_FRONT, size, pnt_align); - if (!normals) return; - vtx = (void*)((nk_byte*)list->vertices->memory.ptr + vertex_offset); - - /* add elements */ - for (i = 2; i < points_count; i++) { - ids[0] = (nk_draw_index)(vtx_inner_idx); - ids[1] = (nk_draw_index)(vtx_inner_idx + ((i-1) << 1)); - ids[2] = (nk_draw_index)(vtx_inner_idx + (i << 1)); - ids += 3; - } - - /* compute normals */ - for (i0 = points_count-1, i1 = 0; i1 < points_count; i0 = i1++) { - struct nk_vec2 p0 = points[i0]; - struct nk_vec2 p1 = points[i1]; - struct nk_vec2 diff = nk_vec2_sub(p1, p0); - - /* vec2 inverted length */ - float len = nk_vec2_len_sqr(diff); - if (len != 0.0f) - len = nk_inv_sqrt(len); - else len = 1.0f; - diff = nk_vec2_muls(diff, len); - - normals[i0].x = diff.y; - normals[i0].y = -diff.x; - } - - /* add vertices + indexes */ - for (i0 = points_count-1, i1 = 0; i1 < points_count; i0 = i1++) { - const struct nk_vec2 uv = list->config.null.uv; - struct nk_vec2 n0 = normals[i0]; - struct nk_vec2 n1 = normals[i1]; - struct nk_vec2 dm = nk_vec2_muls(nk_vec2_add(n0, n1), 0.5f); - float dmr2 = dm.x*dm.x + dm.y*dm.y; - if (dmr2 > 0.000001f) { - float scale = 1.0f / dmr2; - scale = NK_MIN(scale, 100.0f); - dm = nk_vec2_muls(dm, scale); - } - dm = nk_vec2_muls(dm, AA_SIZE * 0.5f); - - /* add vertices */ - vtx = nk_draw_vertex(vtx, &list->config, nk_vec2_sub(points[i1], dm), uv, col); - vtx = nk_draw_vertex(vtx, &list->config, nk_vec2_add(points[i1], dm), uv, col_trans); - - /* add indexes */ - ids[0] = (nk_draw_index)(vtx_inner_idx+(i1<<1)); - ids[1] = (nk_draw_index)(vtx_inner_idx+(i0<<1)); - ids[2] = (nk_draw_index)(vtx_outer_idx+(i0<<1)); - ids[3] = (nk_draw_index)(vtx_outer_idx+(i0<<1)); - ids[4] = (nk_draw_index)(vtx_outer_idx+(i1<<1)); - ids[5] = (nk_draw_index)(vtx_inner_idx+(i1<<1)); - ids += 6; - } - /* free temporary normals + points */ - nk_buffer_reset(list->vertices, NK_BUFFER_FRONT); - } else { - nk_size i = 0; - nk_size index = list->vertex_count; - const nk_size idx_count = (points_count-2)*3; - const nk_size vtx_count = points_count; - void *vtx = nk_draw_list_alloc_vertices(list, vtx_count); - nk_draw_index *ids = nk_draw_list_alloc_elements(list, idx_count); - - if (!vtx || !ids) return; - for (i = 0; i < vtx_count; ++i) - vtx = nk_draw_vertex(vtx, &list->config, points[i], list->config.null.uv, col); - for (i = 2; i < points_count; ++i) { - ids[0] = (nk_draw_index)index; - ids[1] = (nk_draw_index)(index+ i - 1); - ids[2] = (nk_draw_index)(index+i); - ids += 3; - } - } -} -NK_API void -nk_draw_list_path_clear(struct nk_draw_list *list) -{ - NK_ASSERT(list); - if (!list) return; - nk_buffer_reset(list->buffer, NK_BUFFER_FRONT); - list->path_count = 0; - list->path_offset = 0; -} -NK_API void -nk_draw_list_path_line_to(struct nk_draw_list *list, struct nk_vec2 pos) -{ - struct nk_vec2 *points = 0; - struct nk_draw_command *cmd = 0; - NK_ASSERT(list); - if (!list) return; - if (!list->cmd_count) - nk_draw_list_add_clip(list, nk_null_rect); - - cmd = nk_draw_list_command_last(list); - if (cmd && cmd->texture.ptr != list->config.null.texture.ptr) - nk_draw_list_push_image(list, list->config.null.texture); - - points = nk_draw_list_alloc_path(list, 1); - if (!points) return; - points[0] = pos; -} -NK_API void -nk_draw_list_path_arc_to_fast(struct nk_draw_list *list, struct nk_vec2 center, - float radius, int a_min, int a_max) -{ - int a = 0; - NK_ASSERT(list); - if (!list) return; - if (a_min <= a_max) { - for (a = a_min; a <= a_max; a++) { - const struct nk_vec2 c = list->circle_vtx[(nk_size)a % NK_LEN(list->circle_vtx)]; - const float x = center.x + c.x * radius; - const float y = center.y + c.y * radius; - nk_draw_list_path_line_to(list, nk_vec2(x, y)); - } - } -} -NK_API void -nk_draw_list_path_arc_to(struct nk_draw_list *list, struct nk_vec2 center, - float radius, float a_min, float a_max, unsigned int segments) -{ - unsigned int i = 0; - NK_ASSERT(list); - if (!list) return; - if (radius == 0.0f) return; - - /* This algorithm for arc drawing relies on these two trigonometric identities[1]: - sin(a + b) = sin(a) * cos(b) + cos(a) * sin(b) - cos(a + b) = cos(a) * cos(b) - sin(a) * sin(b) - - Two coordinates (x, y) of a point on a circle centered on - the origin can be written in polar form as: - x = r * cos(a) - y = r * sin(a) - where r is the radius of the circle, - a is the angle between (x, y) and the origin. - - This allows us to rotate the coordinates around the - origin by an angle b using the following transformation: - x' = r * cos(a + b) = x * cos(b) - y * sin(b) - y' = r * sin(a + b) = y * cos(b) + x * sin(b) - - [1] https://en.wikipedia.org/wiki/List_of_trigonometric_identities#Angle_sum_and_difference_identities - */ - {const float d_angle = (a_max - a_min) / (float)segments; - const float sin_d = (float)NK_SIN(d_angle); - const float cos_d = (float)NK_COS(d_angle); - - float cx = (float)NK_COS(a_min) * radius; - float cy = (float)NK_SIN(a_min) * radius; - for(i = 0; i <= segments; ++i) { - float new_cx, new_cy; - const float x = center.x + cx; - const float y = center.y + cy; - nk_draw_list_path_line_to(list, nk_vec2(x, y)); - - new_cx = cx * cos_d - cy * sin_d; - new_cy = cy * cos_d + cx * sin_d; - cx = new_cx; - cy = new_cy; - }} -} -NK_API void -nk_draw_list_path_rect_to(struct nk_draw_list *list, struct nk_vec2 a, - struct nk_vec2 b, float rounding) -{ - float r; - NK_ASSERT(list); - if (!list) return; - r = rounding; - r = NK_MIN(r, ((b.x-a.x) < 0) ? -(b.x-a.x): (b.x-a.x)); - r = NK_MIN(r, ((b.y-a.y) < 0) ? -(b.y-a.y): (b.y-a.y)); - - if (r == 0.0f) { - nk_draw_list_path_line_to(list, a); - nk_draw_list_path_line_to(list, nk_vec2(b.x,a.y)); - nk_draw_list_path_line_to(list, b); - nk_draw_list_path_line_to(list, nk_vec2(a.x,b.y)); - } else { - nk_draw_list_path_arc_to_fast(list, nk_vec2(a.x + r, a.y + r), r, 6, 9); - nk_draw_list_path_arc_to_fast(list, nk_vec2(b.x - r, a.y + r), r, 9, 12); - nk_draw_list_path_arc_to_fast(list, nk_vec2(b.x - r, b.y - r), r, 0, 3); - nk_draw_list_path_arc_to_fast(list, nk_vec2(a.x + r, b.y - r), r, 3, 6); - } -} -NK_API void -nk_draw_list_path_curve_to(struct nk_draw_list *list, struct nk_vec2 p2, - struct nk_vec2 p3, struct nk_vec2 p4, unsigned int num_segments) -{ - float t_step; - unsigned int i_step; - struct nk_vec2 p1; - - NK_ASSERT(list); - NK_ASSERT(list->path_count); - if (!list || !list->path_count) return; - num_segments = NK_MAX(num_segments, 1); - - p1 = nk_draw_list_path_last(list); - t_step = 1.0f/(float)num_segments; - for (i_step = 1; i_step <= num_segments; ++i_step) { - float t = t_step * (float)i_step; - float u = 1.0f - t; - float w1 = u*u*u; - float w2 = 3*u*u*t; - float w3 = 3*u*t*t; - float w4 = t * t *t; - float x = w1 * p1.x + w2 * p2.x + w3 * p3.x + w4 * p4.x; - float y = w1 * p1.y + w2 * p2.y + w3 * p3.y + w4 * p4.y; - nk_draw_list_path_line_to(list, nk_vec2(x,y)); - } -} -NK_API void -nk_draw_list_path_fill(struct nk_draw_list *list, struct nk_color color) -{ - struct nk_vec2 *points; - NK_ASSERT(list); - if (!list) return; - points = (struct nk_vec2*)nk_buffer_memory(list->buffer); - nk_draw_list_fill_poly_convex(list, points, list->path_count, color, list->config.shape_AA); - nk_draw_list_path_clear(list); -} -NK_API void -nk_draw_list_path_stroke(struct nk_draw_list *list, struct nk_color color, - enum nk_draw_list_stroke closed, float thickness) -{ - struct nk_vec2 *points; - NK_ASSERT(list); - if (!list) return; - points = (struct nk_vec2*)nk_buffer_memory(list->buffer); - nk_draw_list_stroke_poly_line(list, points, list->path_count, color, - closed, thickness, list->config.line_AA); - nk_draw_list_path_clear(list); -} -NK_API void -nk_draw_list_stroke_line(struct nk_draw_list *list, struct nk_vec2 a, - struct nk_vec2 b, struct nk_color col, float thickness) -{ - NK_ASSERT(list); - if (!list || !col.a) return; - if (list->line_AA == NK_ANTI_ALIASING_ON) { - nk_draw_list_path_line_to(list, a); - nk_draw_list_path_line_to(list, b); - } else { - nk_draw_list_path_line_to(list, nk_vec2_sub(a,nk_vec2(0.5f,0.5f))); - nk_draw_list_path_line_to(list, nk_vec2_sub(b,nk_vec2(0.5f,0.5f))); - } - nk_draw_list_path_stroke(list, col, NK_STROKE_OPEN, thickness); -} -NK_API void -nk_draw_list_fill_rect(struct nk_draw_list *list, struct nk_rect rect, - struct nk_color col, float rounding) -{ - NK_ASSERT(list); - if (!list || !col.a) return; - - if (list->line_AA == NK_ANTI_ALIASING_ON) { - nk_draw_list_path_rect_to(list, nk_vec2(rect.x, rect.y), - nk_vec2(rect.x + rect.w, rect.y + rect.h), rounding); - } else { - nk_draw_list_path_rect_to(list, nk_vec2(rect.x-0.5f, rect.y-0.5f), - nk_vec2(rect.x + rect.w, rect.y + rect.h), rounding); - } nk_draw_list_path_fill(list, col); -} -NK_API void -nk_draw_list_stroke_rect(struct nk_draw_list *list, struct nk_rect rect, - struct nk_color col, float rounding, float thickness) -{ - NK_ASSERT(list); - if (!list || !col.a) return; - if (list->line_AA == NK_ANTI_ALIASING_ON) { - nk_draw_list_path_rect_to(list, nk_vec2(rect.x, rect.y), - nk_vec2(rect.x + rect.w, rect.y + rect.h), rounding); - } else { - nk_draw_list_path_rect_to(list, nk_vec2(rect.x-0.5f, rect.y-0.5f), - nk_vec2(rect.x + rect.w, rect.y + rect.h), rounding); - } nk_draw_list_path_stroke(list, col, NK_STROKE_CLOSED, thickness); -} -NK_API void -nk_draw_list_fill_rect_multi_color(struct nk_draw_list *list, struct nk_rect rect, - struct nk_color left, struct nk_color top, struct nk_color right, - struct nk_color bottom) -{ - void *vtx; - struct nk_colorf col_left, col_top; - struct nk_colorf col_right, col_bottom; - nk_draw_index *idx; - nk_draw_index index; - - nk_color_fv(&col_left.r, left); - nk_color_fv(&col_right.r, right); - nk_color_fv(&col_top.r, top); - nk_color_fv(&col_bottom.r, bottom); - - NK_ASSERT(list); - if (!list) return; - - nk_draw_list_push_image(list, list->config.null.texture); - index = (nk_draw_index)list->vertex_count; - vtx = nk_draw_list_alloc_vertices(list, 4); - idx = nk_draw_list_alloc_elements(list, 6); - if (!vtx || !idx) return; - - idx[0] = (nk_draw_index)(index+0); idx[1] = (nk_draw_index)(index+1); - idx[2] = (nk_draw_index)(index+2); idx[3] = (nk_draw_index)(index+0); - idx[4] = (nk_draw_index)(index+2); idx[5] = (nk_draw_index)(index+3); - - vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(rect.x, rect.y), list->config.null.uv, col_left); - vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(rect.x + rect.w, rect.y), list->config.null.uv, col_top); - vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(rect.x + rect.w, rect.y + rect.h), list->config.null.uv, col_right); - vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(rect.x, rect.y + rect.h), list->config.null.uv, col_bottom); -} -NK_API void -nk_draw_list_fill_triangle(struct nk_draw_list *list, struct nk_vec2 a, - struct nk_vec2 b, struct nk_vec2 c, struct nk_color col) -{ - NK_ASSERT(list); - if (!list || !col.a) return; - nk_draw_list_path_line_to(list, a); - nk_draw_list_path_line_to(list, b); - nk_draw_list_path_line_to(list, c); - nk_draw_list_path_fill(list, col); -} -NK_API void -nk_draw_list_stroke_triangle(struct nk_draw_list *list, struct nk_vec2 a, - struct nk_vec2 b, struct nk_vec2 c, struct nk_color col, float thickness) -{ - NK_ASSERT(list); - if (!list || !col.a) return; - nk_draw_list_path_line_to(list, a); - nk_draw_list_path_line_to(list, b); - nk_draw_list_path_line_to(list, c); - nk_draw_list_path_stroke(list, col, NK_STROKE_CLOSED, thickness); -} -NK_API void -nk_draw_list_fill_circle(struct nk_draw_list *list, struct nk_vec2 center, - float radius, struct nk_color col, unsigned int segs) -{ - float a_max; - NK_ASSERT(list); - if (!list || !col.a) return; - a_max = NK_PI * 2.0f * ((float)segs - 1.0f) / (float)segs; - nk_draw_list_path_arc_to(list, center, radius, 0.0f, a_max, segs); - nk_draw_list_path_fill(list, col); -} -NK_API void -nk_draw_list_stroke_circle(struct nk_draw_list *list, struct nk_vec2 center, - float radius, struct nk_color col, unsigned int segs, float thickness) -{ - float a_max; - NK_ASSERT(list); - if (!list || !col.a) return; - a_max = NK_PI * 2.0f * ((float)segs - 1.0f) / (float)segs; - nk_draw_list_path_arc_to(list, center, radius, 0.0f, a_max, segs); - nk_draw_list_path_stroke(list, col, NK_STROKE_CLOSED, thickness); -} -NK_API void -nk_draw_list_stroke_curve(struct nk_draw_list *list, struct nk_vec2 p0, - struct nk_vec2 cp0, struct nk_vec2 cp1, struct nk_vec2 p1, - struct nk_color col, unsigned int segments, float thickness) -{ - NK_ASSERT(list); - if (!list || !col.a) return; - nk_draw_list_path_line_to(list, p0); - nk_draw_list_path_curve_to(list, cp0, cp1, p1, segments); - nk_draw_list_path_stroke(list, col, NK_STROKE_OPEN, thickness); -} -NK_INTERN void -nk_draw_list_push_rect_uv(struct nk_draw_list *list, struct nk_vec2 a, - struct nk_vec2 c, struct nk_vec2 uva, struct nk_vec2 uvc, - struct nk_color color) -{ - void *vtx; - struct nk_vec2 uvb; - struct nk_vec2 uvd; - struct nk_vec2 b; - struct nk_vec2 d; - - struct nk_colorf col; - nk_draw_index *idx; - nk_draw_index index; - NK_ASSERT(list); - if (!list) return; - - nk_color_fv(&col.r, color); - uvb = nk_vec2(uvc.x, uva.y); - uvd = nk_vec2(uva.x, uvc.y); - b = nk_vec2(c.x, a.y); - d = nk_vec2(a.x, c.y); - - index = (nk_draw_index)list->vertex_count; - vtx = nk_draw_list_alloc_vertices(list, 4); - idx = nk_draw_list_alloc_elements(list, 6); - if (!vtx || !idx) return; - - idx[0] = (nk_draw_index)(index+0); idx[1] = (nk_draw_index)(index+1); - idx[2] = (nk_draw_index)(index+2); idx[3] = (nk_draw_index)(index+0); - idx[4] = (nk_draw_index)(index+2); idx[5] = (nk_draw_index)(index+3); - - vtx = nk_draw_vertex(vtx, &list->config, a, uva, col); - vtx = nk_draw_vertex(vtx, &list->config, b, uvb, col); - vtx = nk_draw_vertex(vtx, &list->config, c, uvc, col); - vtx = nk_draw_vertex(vtx, &list->config, d, uvd, col); -} -NK_API void -nk_draw_list_add_image(struct nk_draw_list *list, struct nk_image texture, - struct nk_rect rect, struct nk_color color) -{ - NK_ASSERT(list); - if (!list) return; - /* push new command with given texture */ - nk_draw_list_push_image(list, texture.handle); - if (nk_image_is_subimage(&texture)) { - /* add region inside of the texture */ - struct nk_vec2 uv[2]; - uv[0].x = (float)texture.region[0]/(float)texture.w; - uv[0].y = (float)texture.region[1]/(float)texture.h; - uv[1].x = (float)(texture.region[0] + texture.region[2])/(float)texture.w; - uv[1].y = (float)(texture.region[1] + texture.region[3])/(float)texture.h; - nk_draw_list_push_rect_uv(list, nk_vec2(rect.x, rect.y), - nk_vec2(rect.x + rect.w, rect.y + rect.h), uv[0], uv[1], color); - } else nk_draw_list_push_rect_uv(list, nk_vec2(rect.x, rect.y), - nk_vec2(rect.x + rect.w, rect.y + rect.h), - nk_vec2(0.0f, 0.0f), nk_vec2(1.0f, 1.0f),color); -} -NK_API void -nk_draw_list_add_text(struct nk_draw_list *list, const struct nk_user_font *font, - struct nk_rect rect, const char *text, int len, float font_height, - struct nk_color fg) -{ - float x = 0; - int text_len = 0; - nk_rune unicode = 0; - nk_rune next = 0; - int glyph_len = 0; - int next_glyph_len = 0; - struct nk_user_font_glyph g; - - NK_ASSERT(list); - if (!list || !len || !text) return; - if (!NK_INTERSECT(rect.x, rect.y, rect.w, rect.h, - list->clip_rect.x, list->clip_rect.y, list->clip_rect.w, list->clip_rect.h)) return; - - nk_draw_list_push_image(list, font->texture); - x = rect.x; - glyph_len = nk_utf_decode(text, &unicode, len); - if (!glyph_len) return; - - /* draw every glyph image */ - fg.a = (nk_byte)((float)fg.a * list->config.global_alpha); - while (text_len < len && glyph_len) { - float gx, gy, gh, gw; - float char_width = 0; - if (unicode == NK_UTF_INVALID) break; - - /* query currently drawn glyph information */ - next_glyph_len = nk_utf_decode(text + text_len + glyph_len, &next, (int)len - text_len); - font->query(font->userdata, font_height, &g, unicode, - (next == NK_UTF_INVALID) ? '\0' : next); - - /* calculate and draw glyph drawing rectangle and image */ - gx = x + g.offset.x; - gy = rect.y + g.offset.y; - gw = g.width; gh = g.height; - char_width = g.xadvance; - nk_draw_list_push_rect_uv(list, nk_vec2(gx,gy), nk_vec2(gx + gw, gy+ gh), - g.uv[0], g.uv[1], fg); - - /* offset next glyph */ - text_len += glyph_len; - x += char_width; - glyph_len = next_glyph_len; - unicode = next; - } -} -NK_API nk_flags -nk_convert(struct nk_context *ctx, struct nk_buffer *cmds, - struct nk_buffer *vertices, struct nk_buffer *elements, - const struct nk_convert_config *config) -{ - nk_flags res = NK_CONVERT_SUCCESS; - const struct nk_command *cmd; - NK_ASSERT(ctx); - NK_ASSERT(cmds); - NK_ASSERT(vertices); - NK_ASSERT(elements); - NK_ASSERT(config); - NK_ASSERT(config->vertex_layout); - NK_ASSERT(config->vertex_size); - if (!ctx || !cmds || !vertices || !elements || !config || !config->vertex_layout) - return NK_CONVERT_INVALID_PARAM; - - nk_draw_list_setup(&ctx->draw_list, config, cmds, vertices, elements, - config->line_AA, config->shape_AA); - nk_foreach(cmd, ctx) - { -#ifdef NK_INCLUDE_COMMAND_USERDATA - ctx->draw_list.userdata = cmd->userdata; -#endif - switch (cmd->type) { - case NK_COMMAND_NOP: break; - case NK_COMMAND_SCISSOR: { - const struct nk_command_scissor *s = (const struct nk_command_scissor*)cmd; - nk_draw_list_add_clip(&ctx->draw_list, nk_rect(s->x, s->y, s->w, s->h)); - } break; - case NK_COMMAND_LINE: { - const struct nk_command_line *l = (const struct nk_command_line*)cmd; - nk_draw_list_stroke_line(&ctx->draw_list, nk_vec2(l->begin.x, l->begin.y), - nk_vec2(l->end.x, l->end.y), l->color, l->line_thickness); - } break; - case NK_COMMAND_CURVE: { - const struct nk_command_curve *q = (const struct nk_command_curve*)cmd; - nk_draw_list_stroke_curve(&ctx->draw_list, nk_vec2(q->begin.x, q->begin.y), - nk_vec2(q->ctrl[0].x, q->ctrl[0].y), nk_vec2(q->ctrl[1].x, - q->ctrl[1].y), nk_vec2(q->end.x, q->end.y), q->color, - config->curve_segment_count, q->line_thickness); - } break; - case NK_COMMAND_RECT: { - const struct nk_command_rect *r = (const struct nk_command_rect*)cmd; - nk_draw_list_stroke_rect(&ctx->draw_list, nk_rect(r->x, r->y, r->w, r->h), - r->color, (float)r->rounding, r->line_thickness); - } break; - case NK_COMMAND_RECT_FILLED: { - const struct nk_command_rect_filled *r = (const struct nk_command_rect_filled*)cmd; - nk_draw_list_fill_rect(&ctx->draw_list, nk_rect(r->x, r->y, r->w, r->h), - r->color, (float)r->rounding); - } break; - case NK_COMMAND_RECT_MULTI_COLOR: { - const struct nk_command_rect_multi_color *r = (const struct nk_command_rect_multi_color*)cmd; - nk_draw_list_fill_rect_multi_color(&ctx->draw_list, nk_rect(r->x, r->y, r->w, r->h), - r->left, r->top, r->right, r->bottom); - } break; - case NK_COMMAND_CIRCLE: { - const struct nk_command_circle *c = (const struct nk_command_circle*)cmd; - nk_draw_list_stroke_circle(&ctx->draw_list, nk_vec2((float)c->x + (float)c->w/2, - (float)c->y + (float)c->h/2), (float)c->w/2, c->color, - config->circle_segment_count, c->line_thickness); - } break; - case NK_COMMAND_CIRCLE_FILLED: { - const struct nk_command_circle_filled *c = (const struct nk_command_circle_filled *)cmd; - nk_draw_list_fill_circle(&ctx->draw_list, nk_vec2((float)c->x + (float)c->w/2, - (float)c->y + (float)c->h/2), (float)c->w/2, c->color, - config->circle_segment_count); - } break; - case NK_COMMAND_ARC: { - const struct nk_command_arc *c = (const struct nk_command_arc*)cmd; - nk_draw_list_path_line_to(&ctx->draw_list, nk_vec2(c->cx, c->cy)); - nk_draw_list_path_arc_to(&ctx->draw_list, nk_vec2(c->cx, c->cy), c->r, - c->a[0], c->a[1], config->arc_segment_count); - nk_draw_list_path_stroke(&ctx->draw_list, c->color, NK_STROKE_CLOSED, c->line_thickness); - } break; - case NK_COMMAND_ARC_FILLED: { - const struct nk_command_arc_filled *c = (const struct nk_command_arc_filled*)cmd; - nk_draw_list_path_line_to(&ctx->draw_list, nk_vec2(c->cx, c->cy)); - nk_draw_list_path_arc_to(&ctx->draw_list, nk_vec2(c->cx, c->cy), c->r, - c->a[0], c->a[1], config->arc_segment_count); - nk_draw_list_path_fill(&ctx->draw_list, c->color); - } break; - case NK_COMMAND_TRIANGLE: { - const struct nk_command_triangle *t = (const struct nk_command_triangle*)cmd; - nk_draw_list_stroke_triangle(&ctx->draw_list, nk_vec2(t->a.x, t->a.y), - nk_vec2(t->b.x, t->b.y), nk_vec2(t->c.x, t->c.y), t->color, - t->line_thickness); - } break; - case NK_COMMAND_TRIANGLE_FILLED: { - const struct nk_command_triangle_filled *t = (const struct nk_command_triangle_filled*)cmd; - nk_draw_list_fill_triangle(&ctx->draw_list, nk_vec2(t->a.x, t->a.y), - nk_vec2(t->b.x, t->b.y), nk_vec2(t->c.x, t->c.y), t->color); - } break; - case NK_COMMAND_POLYGON: { - int i; - const struct nk_command_polygon*p = (const struct nk_command_polygon*)cmd; - for (i = 0; i < p->point_count; ++i) { - struct nk_vec2 pnt = nk_vec2((float)p->points[i].x, (float)p->points[i].y); - nk_draw_list_path_line_to(&ctx->draw_list, pnt); - } - nk_draw_list_path_stroke(&ctx->draw_list, p->color, NK_STROKE_CLOSED, p->line_thickness); - } break; - case NK_COMMAND_POLYGON_FILLED: { - int i; - const struct nk_command_polygon_filled *p = (const struct nk_command_polygon_filled*)cmd; - for (i = 0; i < p->point_count; ++i) { - struct nk_vec2 pnt = nk_vec2((float)p->points[i].x, (float)p->points[i].y); - nk_draw_list_path_line_to(&ctx->draw_list, pnt); - } - nk_draw_list_path_fill(&ctx->draw_list, p->color); - } break; - case NK_COMMAND_POLYLINE: { - int i; - const struct nk_command_polyline *p = (const struct nk_command_polyline*)cmd; - for (i = 0; i < p->point_count; ++i) { - struct nk_vec2 pnt = nk_vec2((float)p->points[i].x, (float)p->points[i].y); - nk_draw_list_path_line_to(&ctx->draw_list, pnt); - } - nk_draw_list_path_stroke(&ctx->draw_list, p->color, NK_STROKE_OPEN, p->line_thickness); - } break; - case NK_COMMAND_TEXT: { - const struct nk_command_text *t = (const struct nk_command_text*)cmd; - nk_draw_list_add_text(&ctx->draw_list, t->font, nk_rect(t->x, t->y, t->w, t->h), - t->string, t->length, t->height, t->foreground); - } break; - case NK_COMMAND_IMAGE: { - const struct nk_command_image *i = (const struct nk_command_image*)cmd; - nk_draw_list_add_image(&ctx->draw_list, i->img, nk_rect(i->x, i->y, i->w, i->h), i->col); - } break; - case NK_COMMAND_CUSTOM: { - const struct nk_command_custom *c = (const struct nk_command_custom*)cmd; - c->callback(&ctx->draw_list, c->x, c->y, c->w, c->h, c->callback_data); - } break; - default: break; - } - } - res |= (cmds->needed > cmds->allocated + (cmds->memory.size - cmds->size)) ? NK_CONVERT_COMMAND_BUFFER_FULL: 0; - res |= (vertices->needed > vertices->allocated) ? NK_CONVERT_VERTEX_BUFFER_FULL: 0; - res |= (elements->needed > elements->allocated) ? NK_CONVERT_ELEMENT_BUFFER_FULL: 0; - return res; -} -NK_API const struct nk_draw_command* -nk__draw_begin(const struct nk_context *ctx, - const struct nk_buffer *buffer) -{ - return nk__draw_list_begin(&ctx->draw_list, buffer); -} -NK_API const struct nk_draw_command* -nk__draw_end(const struct nk_context *ctx, const struct nk_buffer *buffer) -{ - return nk__draw_list_end(&ctx->draw_list, buffer); -} -NK_API const struct nk_draw_command* -nk__draw_next(const struct nk_draw_command *cmd, - const struct nk_buffer *buffer, const struct nk_context *ctx) -{ - return nk__draw_list_next(cmd, buffer, &ctx->draw_list); -} -#endif - - - - - -#ifdef NK_INCLUDE_FONT_BAKING -/* ------------------------------------------------------------- - * - * RECT PACK - * - * --------------------------------------------------------------*/ -/* stb_rect_pack.h - v0.05 - public domain - rectangle packing */ -/* Sean Barrett 2014 */ -#define NK_RP__MAXVAL 0xffff -typedef unsigned short nk_rp_coord; - -struct nk_rp_rect { - /* reserved for your use: */ - int id; - /* input: */ - nk_rp_coord w, h; - /* output: */ - nk_rp_coord x, y; - int was_packed; - /* non-zero if valid packing */ -}; /* 16 bytes, nominally */ - -struct nk_rp_node { - nk_rp_coord x,y; - struct nk_rp_node *next; -}; - -struct nk_rp_context { - int width; - int height; - int align; - int init_mode; - int heuristic; - int num_nodes; - struct nk_rp_node *active_head; - struct nk_rp_node *free_head; - struct nk_rp_node extra[2]; - /* we allocate two extra nodes so optimal user-node-count is 'width' not 'width+2' */ -}; - -struct nk_rp__findresult { - int x,y; - struct nk_rp_node **prev_link; -}; - -enum NK_RP_HEURISTIC { - NK_RP_HEURISTIC_Skyline_default=0, - NK_RP_HEURISTIC_Skyline_BL_sortHeight = NK_RP_HEURISTIC_Skyline_default, - NK_RP_HEURISTIC_Skyline_BF_sortHeight -}; -enum NK_RP_INIT_STATE{NK_RP__INIT_skyline = 1}; - -NK_INTERN void -nk_rp_setup_allow_out_of_mem(struct nk_rp_context *context, int allow_out_of_mem) -{ - if (allow_out_of_mem) - /* if it's ok to run out of memory, then don't bother aligning them; */ - /* this gives better packing, but may fail due to OOM (even though */ - /* the rectangles easily fit). @TODO a smarter approach would be to only */ - /* quantize once we've hit OOM, then we could get rid of this parameter. */ - context->align = 1; - else { - /* if it's not ok to run out of memory, then quantize the widths */ - /* so that num_nodes is always enough nodes. */ - /* */ - /* I.e. num_nodes * align >= width */ - /* align >= width / num_nodes */ - /* align = ceil(width/num_nodes) */ - context->align = (context->width + context->num_nodes-1) / context->num_nodes; - } -} -NK_INTERN void -nk_rp_init_target(struct nk_rp_context *context, int width, int height, - struct nk_rp_node *nodes, int num_nodes) -{ - int i; -#ifndef STBRP_LARGE_RECTS - NK_ASSERT(width <= 0xffff && height <= 0xffff); -#endif - - for (i=0; i < num_nodes-1; ++i) - nodes[i].next = &nodes[i+1]; - nodes[i].next = 0; - context->init_mode = NK_RP__INIT_skyline; - context->heuristic = NK_RP_HEURISTIC_Skyline_default; - context->free_head = &nodes[0]; - context->active_head = &context->extra[0]; - context->width = width; - context->height = height; - context->num_nodes = num_nodes; - nk_rp_setup_allow_out_of_mem(context, 0); - - /* node 0 is the full width, node 1 is the sentinel (lets us not store width explicitly) */ - context->extra[0].x = 0; - context->extra[0].y = 0; - context->extra[0].next = &context->extra[1]; - context->extra[1].x = (nk_rp_coord) width; - context->extra[1].y = 65535; - context->extra[1].next = 0; -} -/* find minimum y position if it starts at x1 */ -NK_INTERN int -nk_rp__skyline_find_min_y(struct nk_rp_context *c, struct nk_rp_node *first, - int x0, int width, int *pwaste) -{ - struct nk_rp_node *node = first; - int x1 = x0 + width; - int min_y, visited_width, waste_area; - NK_ASSERT(first->x <= x0); - NK_UNUSED(c); - - NK_ASSERT(node->next->x > x0); - /* we ended up handling this in the caller for efficiency */ - NK_ASSERT(node->x <= x0); - - min_y = 0; - waste_area = 0; - visited_width = 0; - while (node->x < x1) - { - if (node->y > min_y) { - /* raise min_y higher. */ - /* we've accounted for all waste up to min_y, */ - /* but we'll now add more waste for everything we've visited */ - waste_area += visited_width * (node->y - min_y); - min_y = node->y; - /* the first time through, visited_width might be reduced */ - if (node->x < x0) - visited_width += node->next->x - x0; - else - visited_width += node->next->x - node->x; - } else { - /* add waste area */ - int under_width = node->next->x - node->x; - if (under_width + visited_width > width) - under_width = width - visited_width; - waste_area += under_width * (min_y - node->y); - visited_width += under_width; - } - node = node->next; - } - *pwaste = waste_area; - return min_y; -} -NK_INTERN struct nk_rp__findresult -nk_rp__skyline_find_best_pos(struct nk_rp_context *c, int width, int height) -{ - int best_waste = (1<<30), best_x, best_y = (1 << 30); - struct nk_rp__findresult fr; - struct nk_rp_node **prev, *node, *tail, **best = 0; - - /* align to multiple of c->align */ - width = (width + c->align - 1); - width -= width % c->align; - NK_ASSERT(width % c->align == 0); - - node = c->active_head; - prev = &c->active_head; - while (node->x + width <= c->width) { - int y,waste; - y = nk_rp__skyline_find_min_y(c, node, node->x, width, &waste); - /* actually just want to test BL */ - if (c->heuristic == NK_RP_HEURISTIC_Skyline_BL_sortHeight) { - /* bottom left */ - if (y < best_y) { - best_y = y; - best = prev; - } - } else { - /* best-fit */ - if (y + height <= c->height) { - /* can only use it if it first vertically */ - if (y < best_y || (y == best_y && waste < best_waste)) { - best_y = y; - best_waste = waste; - best = prev; - } - } - } - prev = &node->next; - node = node->next; - } - best_x = (best == 0) ? 0 : (*best)->x; - - /* if doing best-fit (BF), we also have to try aligning right edge to each node position */ - /* */ - /* e.g, if fitting */ - /* */ - /* ____________________ */ - /* |____________________| */ - /* */ - /* into */ - /* */ - /* | | */ - /* | ____________| */ - /* |____________| */ - /* */ - /* then right-aligned reduces waste, but bottom-left BL is always chooses left-aligned */ - /* */ - /* This makes BF take about 2x the time */ - if (c->heuristic == NK_RP_HEURISTIC_Skyline_BF_sortHeight) - { - tail = c->active_head; - node = c->active_head; - prev = &c->active_head; - /* find first node that's admissible */ - while (tail->x < width) - tail = tail->next; - while (tail) - { - int xpos = tail->x - width; - int y,waste; - NK_ASSERT(xpos >= 0); - /* find the left position that matches this */ - while (node->next->x <= xpos) { - prev = &node->next; - node = node->next; - } - NK_ASSERT(node->next->x > xpos && node->x <= xpos); - y = nk_rp__skyline_find_min_y(c, node, xpos, width, &waste); - if (y + height < c->height) { - if (y <= best_y) { - if (y < best_y || waste < best_waste || (waste==best_waste && xpos < best_x)) { - best_x = xpos; - NK_ASSERT(y <= best_y); - best_y = y; - best_waste = waste; - best = prev; - } - } - } - tail = tail->next; - } - } - fr.prev_link = best; - fr.x = best_x; - fr.y = best_y; - return fr; -} -NK_INTERN struct nk_rp__findresult -nk_rp__skyline_pack_rectangle(struct nk_rp_context *context, int width, int height) -{ - /* find best position according to heuristic */ - struct nk_rp__findresult res = nk_rp__skyline_find_best_pos(context, width, height); - struct nk_rp_node *node, *cur; - - /* bail if: */ - /* 1. it failed */ - /* 2. the best node doesn't fit (we don't always check this) */ - /* 3. we're out of memory */ - if (res.prev_link == 0 || res.y + height > context->height || context->free_head == 0) { - res.prev_link = 0; - return res; - } - - /* on success, create new node */ - node = context->free_head; - node->x = (nk_rp_coord) res.x; - node->y = (nk_rp_coord) (res.y + height); - - context->free_head = node->next; - - /* insert the new node into the right starting point, and */ - /* let 'cur' point to the remaining nodes needing to be */ - /* stitched back in */ - cur = *res.prev_link; - if (cur->x < res.x) { - /* preserve the existing one, so start testing with the next one */ - struct nk_rp_node *next = cur->next; - cur->next = node; - cur = next; - } else { - *res.prev_link = node; - } - - /* from here, traverse cur and free the nodes, until we get to one */ - /* that shouldn't be freed */ - while (cur->next && cur->next->x <= res.x + width) { - struct nk_rp_node *next = cur->next; - /* move the current node to the free list */ - cur->next = context->free_head; - context->free_head = cur; - cur = next; - } - /* stitch the list back in */ - node->next = cur; - - if (cur->x < res.x + width) - cur->x = (nk_rp_coord) (res.x + width); - return res; -} -NK_INTERN int -nk_rect_height_compare(const void *a, const void *b) -{ - const struct nk_rp_rect *p = (const struct nk_rp_rect *) a; - const struct nk_rp_rect *q = (const struct nk_rp_rect *) b; - if (p->h > q->h) - return -1; - if (p->h < q->h) - return 1; - return (p->w > q->w) ? -1 : (p->w < q->w); -} -NK_INTERN int -nk_rect_original_order(const void *a, const void *b) -{ - const struct nk_rp_rect *p = (const struct nk_rp_rect *) a; - const struct nk_rp_rect *q = (const struct nk_rp_rect *) b; - return (p->was_packed < q->was_packed) ? -1 : (p->was_packed > q->was_packed); -} -NK_INTERN void -nk_rp_qsort(struct nk_rp_rect *array, unsigned int len, int(*cmp)(const void*,const void*)) -{ - /* iterative quick sort */ - #define NK_MAX_SORT_STACK 64 - unsigned right, left = 0, stack[NK_MAX_SORT_STACK], pos = 0; - unsigned seed = len/2 * 69069+1; - for (;;) { - for (; left+1 < len; len++) { - struct nk_rp_rect pivot, tmp; - if (pos == NK_MAX_SORT_STACK) len = stack[pos = 0]; - pivot = array[left+seed%(len-left)]; - seed = seed * 69069 + 1; - stack[pos++] = len; - for (right = left-1;;) { - while (cmp(&array[++right], &pivot) < 0); - while (cmp(&pivot, &array[--len]) < 0); - if (right >= len) break; - tmp = array[right]; - array[right] = array[len]; - array[len] = tmp; - } - } - if (pos == 0) break; - left = len; - len = stack[--pos]; - } - #undef NK_MAX_SORT_STACK -} -NK_INTERN void -nk_rp_pack_rects(struct nk_rp_context *context, struct nk_rp_rect *rects, int num_rects) -{ - int i; - /* we use the 'was_packed' field internally to allow sorting/unsorting */ - for (i=0; i < num_rects; ++i) { - rects[i].was_packed = i; - } - - /* sort according to heuristic */ - nk_rp_qsort(rects, (unsigned)num_rects, nk_rect_height_compare); - - for (i=0; i < num_rects; ++i) { - struct nk_rp__findresult fr = nk_rp__skyline_pack_rectangle(context, rects[i].w, rects[i].h); - if (fr.prev_link) { - rects[i].x = (nk_rp_coord) fr.x; - rects[i].y = (nk_rp_coord) fr.y; - } else { - rects[i].x = rects[i].y = NK_RP__MAXVAL; - } - } - - /* unsort */ - nk_rp_qsort(rects, (unsigned)num_rects, nk_rect_original_order); - - /* set was_packed flags */ - for (i=0; i < num_rects; ++i) - rects[i].was_packed = !(rects[i].x == NK_RP__MAXVAL && rects[i].y == NK_RP__MAXVAL); -} - -/* - * ============================================================== - * - * TRUETYPE - * - * =============================================================== - */ -/* stb_truetype.h - v1.07 - public domain */ -#define NK_TT_MAX_OVERSAMPLE 8 -#define NK_TT__OVER_MASK (NK_TT_MAX_OVERSAMPLE-1) - -struct nk_tt_bakedchar { - unsigned short x0,y0,x1,y1; - /* coordinates of bbox in bitmap */ - float xoff,yoff,xadvance; -}; - -struct nk_tt_aligned_quad{ - float x0,y0,s0,t0; /* top-left */ - float x1,y1,s1,t1; /* bottom-right */ -}; - -struct nk_tt_packedchar { - unsigned short x0,y0,x1,y1; - /* coordinates of bbox in bitmap */ - float xoff,yoff,xadvance; - float xoff2,yoff2; -}; - -struct nk_tt_pack_range { - float font_size; - int first_unicode_codepoint_in_range; - /* if non-zero, then the chars are continuous, and this is the first codepoint */ - int *array_of_unicode_codepoints; - /* if non-zero, then this is an array of unicode codepoints */ - int num_chars; - struct nk_tt_packedchar *chardata_for_range; /* output */ - unsigned char h_oversample, v_oversample; - /* don't set these, they're used internally */ -}; - -struct nk_tt_pack_context { - void *pack_info; - int width; - int height; - int stride_in_bytes; - int padding; - unsigned int h_oversample, v_oversample; - unsigned char *pixels; - void *nodes; -}; - -struct nk_tt_fontinfo { - const unsigned char* data; /* pointer to .ttf file */ - int fontstart;/* offset of start of font */ - int numGlyphs;/* number of glyphs, needed for range checking */ - int loca,head,glyf,hhea,hmtx,kern; /* table locations as offset from start of .ttf */ - int index_map; /* a cmap mapping for our chosen character encoding */ - int indexToLocFormat; /* format needed to map from glyph index to glyph */ -}; - -enum { - NK_TT_vmove=1, - NK_TT_vline, - NK_TT_vcurve -}; - -struct nk_tt_vertex { - short x,y,cx,cy; - unsigned char type,padding; -}; - -struct nk_tt__bitmap{ - int w,h,stride; - unsigned char *pixels; -}; - -struct nk_tt__hheap_chunk { - struct nk_tt__hheap_chunk *next; -}; -struct nk_tt__hheap { - struct nk_allocator alloc; - struct nk_tt__hheap_chunk *head; - void *first_free; - int num_remaining_in_head_chunk; -}; - -struct nk_tt__edge { - float x0,y0, x1,y1; - int invert; -}; - -struct nk_tt__active_edge { - struct nk_tt__active_edge *next; - float fx,fdx,fdy; - float direction; - float sy; - float ey; -}; -struct nk_tt__point {float x,y;}; - -#define NK_TT_MACSTYLE_DONTCARE 0 -#define NK_TT_MACSTYLE_BOLD 1 -#define NK_TT_MACSTYLE_ITALIC 2 -#define NK_TT_MACSTYLE_UNDERSCORE 4 -#define NK_TT_MACSTYLE_NONE 8 -/* <= not same as 0, this makes us check the bitfield is 0 */ - -enum { /* platformID */ - NK_TT_PLATFORM_ID_UNICODE =0, - NK_TT_PLATFORM_ID_MAC =1, - NK_TT_PLATFORM_ID_ISO =2, - NK_TT_PLATFORM_ID_MICROSOFT =3 -}; - -enum { /* encodingID for NK_TT_PLATFORM_ID_UNICODE */ - NK_TT_UNICODE_EID_UNICODE_1_0 =0, - NK_TT_UNICODE_EID_UNICODE_1_1 =1, - NK_TT_UNICODE_EID_ISO_10646 =2, - NK_TT_UNICODE_EID_UNICODE_2_0_BMP=3, - NK_TT_UNICODE_EID_UNICODE_2_0_FULL=4 -}; - -enum { /* encodingID for NK_TT_PLATFORM_ID_MICROSOFT */ - NK_TT_MS_EID_SYMBOL =0, - NK_TT_MS_EID_UNICODE_BMP =1, - NK_TT_MS_EID_SHIFTJIS =2, - NK_TT_MS_EID_UNICODE_FULL =10 -}; - -enum { /* encodingID for NK_TT_PLATFORM_ID_MAC; same as Script Manager codes */ - NK_TT_MAC_EID_ROMAN =0, NK_TT_MAC_EID_ARABIC =4, - NK_TT_MAC_EID_JAPANESE =1, NK_TT_MAC_EID_HEBREW =5, - NK_TT_MAC_EID_CHINESE_TRAD =2, NK_TT_MAC_EID_GREEK =6, - NK_TT_MAC_EID_KOREAN =3, NK_TT_MAC_EID_RUSSIAN =7 -}; - -enum { /* languageID for NK_TT_PLATFORM_ID_MICROSOFT; same as LCID... */ - /* problematic because there are e.g. 16 english LCIDs and 16 arabic LCIDs */ - NK_TT_MS_LANG_ENGLISH =0x0409, NK_TT_MS_LANG_ITALIAN =0x0410, - NK_TT_MS_LANG_CHINESE =0x0804, NK_TT_MS_LANG_JAPANESE =0x0411, - NK_TT_MS_LANG_DUTCH =0x0413, NK_TT_MS_LANG_KOREAN =0x0412, - NK_TT_MS_LANG_FRENCH =0x040c, NK_TT_MS_LANG_RUSSIAN =0x0419, - NK_TT_MS_LANG_GERMAN =0x0407, NK_TT_MS_LANG_SPANISH =0x0409, - NK_TT_MS_LANG_HEBREW =0x040d, NK_TT_MS_LANG_SWEDISH =0x041D -}; - -enum { /* languageID for NK_TT_PLATFORM_ID_MAC */ - NK_TT_MAC_LANG_ENGLISH =0 , NK_TT_MAC_LANG_JAPANESE =11, - NK_TT_MAC_LANG_ARABIC =12, NK_TT_MAC_LANG_KOREAN =23, - NK_TT_MAC_LANG_DUTCH =4 , NK_TT_MAC_LANG_RUSSIAN =32, - NK_TT_MAC_LANG_FRENCH =1 , NK_TT_MAC_LANG_SPANISH =6 , - NK_TT_MAC_LANG_GERMAN =2 , NK_TT_MAC_LANG_SWEDISH =5 , - NK_TT_MAC_LANG_HEBREW =10, NK_TT_MAC_LANG_CHINESE_SIMPLIFIED =33, - NK_TT_MAC_LANG_ITALIAN =3 , NK_TT_MAC_LANG_CHINESE_TRAD =19 -}; - -#define nk_ttBYTE(p) (* (const nk_byte *) (p)) -#define nk_ttCHAR(p) (* (const char *) (p)) - -#if defined(NK_BIGENDIAN) && !defined(NK_ALLOW_UNALIGNED_TRUETYPE) - #define nk_ttUSHORT(p) (* (nk_ushort *) (p)) - #define nk_ttSHORT(p) (* (nk_short *) (p)) - #define nk_ttULONG(p) (* (nk_uint *) (p)) - #define nk_ttLONG(p) (* (nk_int *) (p)) -#else - static nk_ushort nk_ttUSHORT(const nk_byte *p) { return (nk_ushort)(p[0]*256 + p[1]); } - static nk_short nk_ttSHORT(const nk_byte *p) { return (nk_short)(p[0]*256 + p[1]); } - static nk_uint nk_ttULONG(const nk_byte *p) { return (nk_uint)((p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3]); } -#endif - -#define nk_tt_tag4(p,c0,c1,c2,c3)\ - ((p)[0] == (c0) && (p)[1] == (c1) && (p)[2] == (c2) && (p)[3] == (c3)) -#define nk_tt_tag(p,str) nk_tt_tag4(p,str[0],str[1],str[2],str[3]) - -NK_INTERN int nk_tt_GetGlyphShape(const struct nk_tt_fontinfo *info, struct nk_allocator *alloc, - int glyph_index, struct nk_tt_vertex **pvertices); - -NK_INTERN nk_uint -nk_tt__find_table(const nk_byte *data, nk_uint fontstart, const char *tag) -{ - /* @OPTIMIZE: binary search */ - nk_int num_tables = nk_ttUSHORT(data+fontstart+4); - nk_uint tabledir = fontstart + 12; - nk_int i; - for (i = 0; i < num_tables; ++i) { - nk_uint loc = tabledir + (nk_uint)(16*i); - if (nk_tt_tag(data+loc+0, tag)) - return nk_ttULONG(data+loc+8); - } - return 0; -} -NK_INTERN int -nk_tt_InitFont(struct nk_tt_fontinfo *info, const unsigned char *data2, int fontstart) -{ - nk_uint cmap, t; - nk_int i,numTables; - const nk_byte *data = (const nk_byte *) data2; - - info->data = data; - info->fontstart = fontstart; - - cmap = nk_tt__find_table(data, (nk_uint)fontstart, "cmap"); /* required */ - info->loca = (int)nk_tt__find_table(data, (nk_uint)fontstart, "loca"); /* required */ - info->head = (int)nk_tt__find_table(data, (nk_uint)fontstart, "head"); /* required */ - info->glyf = (int)nk_tt__find_table(data, (nk_uint)fontstart, "glyf"); /* required */ - info->hhea = (int)nk_tt__find_table(data, (nk_uint)fontstart, "hhea"); /* required */ - info->hmtx = (int)nk_tt__find_table(data, (nk_uint)fontstart, "hmtx"); /* required */ - info->kern = (int)nk_tt__find_table(data, (nk_uint)fontstart, "kern"); /* not required */ - if (!cmap || !info->loca || !info->head || !info->glyf || !info->hhea || !info->hmtx) - return 0; - - t = nk_tt__find_table(data, (nk_uint)fontstart, "maxp"); - if (t) info->numGlyphs = nk_ttUSHORT(data+t+4); - else info->numGlyphs = 0xffff; - - /* find a cmap encoding table we understand *now* to avoid searching */ - /* later. (todo: could make this installable) */ - /* the same regardless of glyph. */ - numTables = nk_ttUSHORT(data + cmap + 2); - info->index_map = 0; - for (i=0; i < numTables; ++i) - { - nk_uint encoding_record = cmap + 4 + 8 * (nk_uint)i; - /* find an encoding we understand: */ - switch(nk_ttUSHORT(data+encoding_record)) { - case NK_TT_PLATFORM_ID_MICROSOFT: - switch (nk_ttUSHORT(data+encoding_record+2)) { - case NK_TT_MS_EID_UNICODE_BMP: - case NK_TT_MS_EID_UNICODE_FULL: - /* MS/Unicode */ - info->index_map = (int)(cmap + nk_ttULONG(data+encoding_record+4)); - break; - default: break; - } break; - case NK_TT_PLATFORM_ID_UNICODE: - /* Mac/iOS has these */ - /* all the encodingIDs are unicode, so we don't bother to check it */ - info->index_map = (int)(cmap + nk_ttULONG(data+encoding_record+4)); - break; - default: break; - } - } - if (info->index_map == 0) - return 0; - info->indexToLocFormat = nk_ttUSHORT(data+info->head + 50); - return 1; -} -NK_INTERN int -nk_tt_FindGlyphIndex(const struct nk_tt_fontinfo *info, int unicode_codepoint) -{ - const nk_byte *data = info->data; - nk_uint index_map = (nk_uint)info->index_map; - - nk_ushort format = nk_ttUSHORT(data + index_map + 0); - if (format == 0) { /* apple byte encoding */ - nk_int bytes = nk_ttUSHORT(data + index_map + 2); - if (unicode_codepoint < bytes-6) - return nk_ttBYTE(data + index_map + 6 + unicode_codepoint); - return 0; - } else if (format == 6) { - nk_uint first = nk_ttUSHORT(data + index_map + 6); - nk_uint count = nk_ttUSHORT(data + index_map + 8); - if ((nk_uint) unicode_codepoint >= first && (nk_uint) unicode_codepoint < first+count) - return nk_ttUSHORT(data + index_map + 10 + (unicode_codepoint - (int)first)*2); - return 0; - } else if (format == 2) { - NK_ASSERT(0); /* @TODO: high-byte mapping for japanese/chinese/korean */ - return 0; - } else if (format == 4) { /* standard mapping for windows fonts: binary search collection of ranges */ - nk_ushort segcount = nk_ttUSHORT(data+index_map+6) >> 1; - nk_ushort searchRange = nk_ttUSHORT(data+index_map+8) >> 1; - nk_ushort entrySelector = nk_ttUSHORT(data+index_map+10); - nk_ushort rangeShift = nk_ttUSHORT(data+index_map+12) >> 1; - - /* do a binary search of the segments */ - nk_uint endCount = index_map + 14; - nk_uint search = endCount; - - if (unicode_codepoint > 0xffff) - return 0; - - /* they lie from endCount .. endCount + segCount */ - /* but searchRange is the nearest power of two, so... */ - if (unicode_codepoint >= nk_ttUSHORT(data + search + rangeShift*2)) - search += (nk_uint)(rangeShift*2); - - /* now decrement to bias correctly to find smallest */ - search -= 2; - while (entrySelector) { - nk_ushort end; - searchRange >>= 1; - end = nk_ttUSHORT(data + search + searchRange*2); - if (unicode_codepoint > end) - search += (nk_uint)(searchRange*2); - --entrySelector; - } - search += 2; - - { - nk_ushort offset, start; - nk_ushort item = (nk_ushort) ((search - endCount) >> 1); - - NK_ASSERT(unicode_codepoint <= nk_ttUSHORT(data + endCount + 2*item)); - start = nk_ttUSHORT(data + index_map + 14 + segcount*2 + 2 + 2*item); - if (unicode_codepoint < start) - return 0; - - offset = nk_ttUSHORT(data + index_map + 14 + segcount*6 + 2 + 2*item); - if (offset == 0) - return (nk_ushort) (unicode_codepoint + nk_ttSHORT(data + index_map + 14 + segcount*4 + 2 + 2*item)); - - return nk_ttUSHORT(data + offset + (unicode_codepoint-start)*2 + index_map + 14 + segcount*6 + 2 + 2*item); - } - } else if (format == 12 || format == 13) { - nk_uint ngroups = nk_ttULONG(data+index_map+12); - nk_int low,high; - low = 0; high = (nk_int)ngroups; - /* Binary search the right group. */ - while (low < high) { - nk_int mid = low + ((high-low) >> 1); /* rounds down, so low <= mid < high */ - nk_uint start_char = nk_ttULONG(data+index_map+16+mid*12); - nk_uint end_char = nk_ttULONG(data+index_map+16+mid*12+4); - if ((nk_uint) unicode_codepoint < start_char) - high = mid; - else if ((nk_uint) unicode_codepoint > end_char) - low = mid+1; - else { - nk_uint start_glyph = nk_ttULONG(data+index_map+16+mid*12+8); - if (format == 12) - return (int)start_glyph + (int)unicode_codepoint - (int)start_char; - else /* format == 13 */ - return (int)start_glyph; - } - } - return 0; /* not found */ - } - /* @TODO */ - NK_ASSERT(0); - return 0; -} -NK_INTERN void -nk_tt_setvertex(struct nk_tt_vertex *v, nk_byte type, nk_int x, nk_int y, nk_int cx, nk_int cy) -{ - v->type = type; - v->x = (nk_short) x; - v->y = (nk_short) y; - v->cx = (nk_short) cx; - v->cy = (nk_short) cy; -} -NK_INTERN int -nk_tt__GetGlyfOffset(const struct nk_tt_fontinfo *info, int glyph_index) -{ - int g1,g2; - if (glyph_index >= info->numGlyphs) return -1; /* glyph index out of range */ - if (info->indexToLocFormat >= 2) return -1; /* unknown index->glyph map format */ - - if (info->indexToLocFormat == 0) { - g1 = info->glyf + nk_ttUSHORT(info->data + info->loca + glyph_index * 2) * 2; - g2 = info->glyf + nk_ttUSHORT(info->data + info->loca + glyph_index * 2 + 2) * 2; - } else { - g1 = info->glyf + (int)nk_ttULONG (info->data + info->loca + glyph_index * 4); - g2 = info->glyf + (int)nk_ttULONG (info->data + info->loca + glyph_index * 4 + 4); - } - return g1==g2 ? -1 : g1; /* if length is 0, return -1 */ -} -NK_INTERN int -nk_tt_GetGlyphBox(const struct nk_tt_fontinfo *info, int glyph_index, - int *x0, int *y0, int *x1, int *y1) -{ - int g = nk_tt__GetGlyfOffset(info, glyph_index); - if (g < 0) return 0; - - if (x0) *x0 = nk_ttSHORT(info->data + g + 2); - if (y0) *y0 = nk_ttSHORT(info->data + g + 4); - if (x1) *x1 = nk_ttSHORT(info->data + g + 6); - if (y1) *y1 = nk_ttSHORT(info->data + g + 8); - return 1; -} -NK_INTERN int -nk_tt__close_shape(struct nk_tt_vertex *vertices, int num_vertices, int was_off, - int start_off, nk_int sx, nk_int sy, nk_int scx, nk_int scy, nk_int cx, nk_int cy) -{ - if (start_off) { - if (was_off) - nk_tt_setvertex(&vertices[num_vertices++], NK_TT_vcurve, (cx+scx)>>1, (cy+scy)>>1, cx,cy); - nk_tt_setvertex(&vertices[num_vertices++], NK_TT_vcurve, sx,sy,scx,scy); - } else { - if (was_off) - nk_tt_setvertex(&vertices[num_vertices++], NK_TT_vcurve,sx,sy,cx,cy); - else - nk_tt_setvertex(&vertices[num_vertices++], NK_TT_vline,sx,sy,0,0); - } - return num_vertices; -} -NK_INTERN int -nk_tt_GetGlyphShape(const struct nk_tt_fontinfo *info, struct nk_allocator *alloc, - int glyph_index, struct nk_tt_vertex **pvertices) -{ - nk_short numberOfContours; - const nk_byte *endPtsOfContours; - const nk_byte *data = info->data; - struct nk_tt_vertex *vertices=0; - int num_vertices=0; - int g = nk_tt__GetGlyfOffset(info, glyph_index); - *pvertices = 0; - - if (g < 0) return 0; - numberOfContours = nk_ttSHORT(data + g); - if (numberOfContours > 0) { - nk_byte flags=0,flagcount; - nk_int ins, i,j=0,m,n, next_move, was_off=0, off, start_off=0; - nk_int x,y,cx,cy,sx,sy, scx,scy; - const nk_byte *points; - endPtsOfContours = (data + g + 10); - ins = nk_ttUSHORT(data + g + 10 + numberOfContours * 2); - points = data + g + 10 + numberOfContours * 2 + 2 + ins; - - n = 1+nk_ttUSHORT(endPtsOfContours + numberOfContours*2-2); - m = n + 2*numberOfContours; /* a loose bound on how many vertices we might need */ - vertices = (struct nk_tt_vertex *)alloc->alloc(alloc->userdata, 0, (nk_size)m * sizeof(vertices[0])); - if (vertices == 0) - return 0; - - next_move = 0; - flagcount=0; - - /* in first pass, we load uninterpreted data into the allocated array */ - /* above, shifted to the end of the array so we won't overwrite it when */ - /* we create our final data starting from the front */ - off = m - n; /* starting offset for uninterpreted data, regardless of how m ends up being calculated */ - - /* first load flags */ - for (i=0; i < n; ++i) { - if (flagcount == 0) { - flags = *points++; - if (flags & 8) - flagcount = *points++; - } else --flagcount; - vertices[off+i].type = flags; - } - - /* now load x coordinates */ - x=0; - for (i=0; i < n; ++i) { - flags = vertices[off+i].type; - if (flags & 2) { - nk_short dx = *points++; - x += (flags & 16) ? dx : -dx; /* ??? */ - } else { - if (!(flags & 16)) { - x = x + (nk_short) (points[0]*256 + points[1]); - points += 2; - } - } - vertices[off+i].x = (nk_short) x; - } - - /* now load y coordinates */ - y=0; - for (i=0; i < n; ++i) { - flags = vertices[off+i].type; - if (flags & 4) { - nk_short dy = *points++; - y += (flags & 32) ? dy : -dy; /* ??? */ - } else { - if (!(flags & 32)) { - y = y + (nk_short) (points[0]*256 + points[1]); - points += 2; - } - } - vertices[off+i].y = (nk_short) y; - } - - /* now convert them to our format */ - num_vertices=0; - sx = sy = cx = cy = scx = scy = 0; - for (i=0; i < n; ++i) - { - flags = vertices[off+i].type; - x = (nk_short) vertices[off+i].x; - y = (nk_short) vertices[off+i].y; - - if (next_move == i) { - if (i != 0) - num_vertices = nk_tt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy); - - /* now start the new one */ - start_off = !(flags & 1); - if (start_off) { - /* if we start off with an off-curve point, then when we need to find a point on the curve */ - /* where we can start, and we need to save some state for when we wraparound. */ - scx = x; - scy = y; - if (!(vertices[off+i+1].type & 1)) { - /* next point is also a curve point, so interpolate an on-point curve */ - sx = (x + (nk_int) vertices[off+i+1].x) >> 1; - sy = (y + (nk_int) vertices[off+i+1].y) >> 1; - } else { - /* otherwise just use the next point as our start point */ - sx = (nk_int) vertices[off+i+1].x; - sy = (nk_int) vertices[off+i+1].y; - ++i; /* we're using point i+1 as the starting point, so skip it */ - } - } else { - sx = x; - sy = y; - } - nk_tt_setvertex(&vertices[num_vertices++], NK_TT_vmove,sx,sy,0,0); - was_off = 0; - next_move = 1 + nk_ttUSHORT(endPtsOfContours+j*2); - ++j; - } else { - if (!(flags & 1)) - { /* if it's a curve */ - if (was_off) /* two off-curve control points in a row means interpolate an on-curve midpoint */ - nk_tt_setvertex(&vertices[num_vertices++], NK_TT_vcurve, (cx+x)>>1, (cy+y)>>1, cx, cy); - cx = x; - cy = y; - was_off = 1; - } else { - if (was_off) - nk_tt_setvertex(&vertices[num_vertices++], NK_TT_vcurve, x,y, cx, cy); - else nk_tt_setvertex(&vertices[num_vertices++], NK_TT_vline, x,y,0,0); - was_off = 0; - } - } - } - num_vertices = nk_tt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy); - } else if (numberOfContours == -1) { - /* Compound shapes. */ - int more = 1; - const nk_byte *comp = data + g + 10; - num_vertices = 0; - vertices = 0; - - while (more) - { - nk_ushort flags, gidx; - int comp_num_verts = 0, i; - struct nk_tt_vertex *comp_verts = 0, *tmp = 0; - float mtx[6] = {1,0,0,1,0,0}, m, n; - - flags = (nk_ushort)nk_ttSHORT(comp); comp+=2; - gidx = (nk_ushort)nk_ttSHORT(comp); comp+=2; - - if (flags & 2) { /* XY values */ - if (flags & 1) { /* shorts */ - mtx[4] = nk_ttSHORT(comp); comp+=2; - mtx[5] = nk_ttSHORT(comp); comp+=2; - } else { - mtx[4] = nk_ttCHAR(comp); comp+=1; - mtx[5] = nk_ttCHAR(comp); comp+=1; - } - } else { - /* @TODO handle matching point */ - NK_ASSERT(0); - } - if (flags & (1<<3)) { /* WE_HAVE_A_SCALE */ - mtx[0] = mtx[3] = nk_ttSHORT(comp)/16384.0f; comp+=2; - mtx[1] = mtx[2] = 0; - } else if (flags & (1<<6)) { /* WE_HAVE_AN_X_AND_YSCALE */ - mtx[0] = nk_ttSHORT(comp)/16384.0f; comp+=2; - mtx[1] = mtx[2] = 0; - mtx[3] = nk_ttSHORT(comp)/16384.0f; comp+=2; - } else if (flags & (1<<7)) { /* WE_HAVE_A_TWO_BY_TWO */ - mtx[0] = nk_ttSHORT(comp)/16384.0f; comp+=2; - mtx[1] = nk_ttSHORT(comp)/16384.0f; comp+=2; - mtx[2] = nk_ttSHORT(comp)/16384.0f; comp+=2; - mtx[3] = nk_ttSHORT(comp)/16384.0f; comp+=2; - } - - /* Find transformation scales. */ - m = (float) NK_SQRT(mtx[0]*mtx[0] + mtx[1]*mtx[1]); - n = (float) NK_SQRT(mtx[2]*mtx[2] + mtx[3]*mtx[3]); - - /* Get indexed glyph. */ - comp_num_verts = nk_tt_GetGlyphShape(info, alloc, gidx, &comp_verts); - if (comp_num_verts > 0) - { - /* Transform vertices. */ - for (i = 0; i < comp_num_verts; ++i) { - struct nk_tt_vertex* v = &comp_verts[i]; - short x,y; - x=v->x; y=v->y; - v->x = (short)(m * (mtx[0]*x + mtx[2]*y + mtx[4])); - v->y = (short)(n * (mtx[1]*x + mtx[3]*y + mtx[5])); - x=v->cx; y=v->cy; - v->cx = (short)(m * (mtx[0]*x + mtx[2]*y + mtx[4])); - v->cy = (short)(n * (mtx[1]*x + mtx[3]*y + mtx[5])); - } - /* Append vertices. */ - tmp = (struct nk_tt_vertex*)alloc->alloc(alloc->userdata, 0, - (nk_size)(num_vertices+comp_num_verts)*sizeof(struct nk_tt_vertex)); - if (!tmp) { - if (vertices) alloc->free(alloc->userdata, vertices); - if (comp_verts) alloc->free(alloc->userdata, comp_verts); - return 0; - } - if (num_vertices > 0) NK_MEMCPY(tmp, vertices, (nk_size)num_vertices*sizeof(struct nk_tt_vertex)); - NK_MEMCPY(tmp+num_vertices, comp_verts, (nk_size)comp_num_verts*sizeof(struct nk_tt_vertex)); - if (vertices) alloc->free(alloc->userdata,vertices); - vertices = tmp; - alloc->free(alloc->userdata,comp_verts); - num_vertices += comp_num_verts; - } - /* More components ? */ - more = flags & (1<<5); - } - } else if (numberOfContours < 0) { - /* @TODO other compound variations? */ - NK_ASSERT(0); - } else { - /* numberOfCounters == 0, do nothing */ - } - *pvertices = vertices; - return num_vertices; -} -NK_INTERN void -nk_tt_GetGlyphHMetrics(const struct nk_tt_fontinfo *info, int glyph_index, - int *advanceWidth, int *leftSideBearing) -{ - nk_ushort numOfLongHorMetrics = nk_ttUSHORT(info->data+info->hhea + 34); - if (glyph_index < numOfLongHorMetrics) { - if (advanceWidth) - *advanceWidth = nk_ttSHORT(info->data + info->hmtx + 4*glyph_index); - if (leftSideBearing) - *leftSideBearing = nk_ttSHORT(info->data + info->hmtx + 4*glyph_index + 2); - } else { - if (advanceWidth) - *advanceWidth = nk_ttSHORT(info->data + info->hmtx + 4*(numOfLongHorMetrics-1)); - if (leftSideBearing) - *leftSideBearing = nk_ttSHORT(info->data + info->hmtx + 4*numOfLongHorMetrics + 2*(glyph_index - numOfLongHorMetrics)); - } -} -NK_INTERN void -nk_tt_GetFontVMetrics(const struct nk_tt_fontinfo *info, - int *ascent, int *descent, int *lineGap) -{ - if (ascent ) *ascent = nk_ttSHORT(info->data+info->hhea + 4); - if (descent) *descent = nk_ttSHORT(info->data+info->hhea + 6); - if (lineGap) *lineGap = nk_ttSHORT(info->data+info->hhea + 8); -} -NK_INTERN float -nk_tt_ScaleForPixelHeight(const struct nk_tt_fontinfo *info, float height) -{ - int fheight = nk_ttSHORT(info->data + info->hhea + 4) - nk_ttSHORT(info->data + info->hhea + 6); - return (float) height / (float)fheight; -} -NK_INTERN float -nk_tt_ScaleForMappingEmToPixels(const struct nk_tt_fontinfo *info, float pixels) -{ - int unitsPerEm = nk_ttUSHORT(info->data + info->head + 18); - return pixels / (float)unitsPerEm; -} - -/*------------------------------------------------------------- - * antialiasing software rasterizer - * --------------------------------------------------------------*/ -NK_INTERN void -nk_tt_GetGlyphBitmapBoxSubpixel(const struct nk_tt_fontinfo *font, - int glyph, float scale_x, float scale_y,float shift_x, float shift_y, - int *ix0, int *iy0, int *ix1, int *iy1) -{ - int x0,y0,x1,y1; - if (!nk_tt_GetGlyphBox(font, glyph, &x0,&y0,&x1,&y1)) { - /* e.g. space character */ - if (ix0) *ix0 = 0; - if (iy0) *iy0 = 0; - if (ix1) *ix1 = 0; - if (iy1) *iy1 = 0; - } else { - /* move to integral bboxes (treating pixels as little squares, what pixels get touched)? */ - if (ix0) *ix0 = nk_ifloorf((float)x0 * scale_x + shift_x); - if (iy0) *iy0 = nk_ifloorf((float)-y1 * scale_y + shift_y); - if (ix1) *ix1 = nk_iceilf ((float)x1 * scale_x + shift_x); - if (iy1) *iy1 = nk_iceilf ((float)-y0 * scale_y + shift_y); - } -} -NK_INTERN void -nk_tt_GetGlyphBitmapBox(const struct nk_tt_fontinfo *font, int glyph, - float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1) -{ - nk_tt_GetGlyphBitmapBoxSubpixel(font, glyph, scale_x, scale_y,0.0f,0.0f, ix0, iy0, ix1, iy1); -} - -/*------------------------------------------------------------- - * Rasterizer - * --------------------------------------------------------------*/ -NK_INTERN void* -nk_tt__hheap_alloc(struct nk_tt__hheap *hh, nk_size size) -{ - if (hh->first_free) { - void *p = hh->first_free; - hh->first_free = * (void **) p; - return p; - } else { - if (hh->num_remaining_in_head_chunk == 0) { - int count = (size < 32 ? 2000 : size < 128 ? 800 : 100); - struct nk_tt__hheap_chunk *c = (struct nk_tt__hheap_chunk *) - hh->alloc.alloc(hh->alloc.userdata, 0, - sizeof(struct nk_tt__hheap_chunk) + size * (nk_size)count); - if (c == 0) return 0; - c->next = hh->head; - hh->head = c; - hh->num_remaining_in_head_chunk = count; - } - --hh->num_remaining_in_head_chunk; - return (char *) (hh->head) + size * (nk_size)hh->num_remaining_in_head_chunk; - } -} -NK_INTERN void -nk_tt__hheap_free(struct nk_tt__hheap *hh, void *p) -{ - *(void **) p = hh->first_free; - hh->first_free = p; -} -NK_INTERN void -nk_tt__hheap_cleanup(struct nk_tt__hheap *hh) -{ - struct nk_tt__hheap_chunk *c = hh->head; - while (c) { - struct nk_tt__hheap_chunk *n = c->next; - hh->alloc.free(hh->alloc.userdata, c); - c = n; - } -} -NK_INTERN struct nk_tt__active_edge* -nk_tt__new_active(struct nk_tt__hheap *hh, struct nk_tt__edge *e, - int off_x, float start_point) -{ - struct nk_tt__active_edge *z = (struct nk_tt__active_edge *) - nk_tt__hheap_alloc(hh, sizeof(*z)); - float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0); - /*STBTT_assert(e->y0 <= start_point); */ - if (!z) return z; - z->fdx = dxdy; - z->fdy = (dxdy != 0) ? (1/dxdy): 0; - z->fx = e->x0 + dxdy * (start_point - e->y0); - z->fx -= (float)off_x; - z->direction = e->invert ? 1.0f : -1.0f; - z->sy = e->y0; - z->ey = e->y1; - z->next = 0; - return z; -} -NK_INTERN void -nk_tt__handle_clipped_edge(float *scanline, int x, struct nk_tt__active_edge *e, - float x0, float y0, float x1, float y1) -{ - if (y0 == y1) return; - NK_ASSERT(y0 < y1); - NK_ASSERT(e->sy <= e->ey); - if (y0 > e->ey) return; - if (y1 < e->sy) return; - if (y0 < e->sy) { - x0 += (x1-x0) * (e->sy - y0) / (y1-y0); - y0 = e->sy; - } - if (y1 > e->ey) { - x1 += (x1-x0) * (e->ey - y1) / (y1-y0); - y1 = e->ey; - } - - if (x0 == x) NK_ASSERT(x1 <= x+1); - else if (x0 == x+1) NK_ASSERT(x1 >= x); - else if (x0 <= x) NK_ASSERT(x1 <= x); - else if (x0 >= x+1) NK_ASSERT(x1 >= x+1); - else NK_ASSERT(x1 >= x && x1 <= x+1); - - if (x0 <= x && x1 <= x) - scanline[x] += e->direction * (y1-y0); - else if (x0 >= x+1 && x1 >= x+1); - else { - NK_ASSERT(x0 >= x && x0 <= x+1 && x1 >= x && x1 <= x+1); - /* coverage = 1 - average x position */ - scanline[x] += (float)e->direction * (float)(y1-y0) * (1.0f-((x0-(float)x)+(x1-(float)x))/2.0f); - } -} -NK_INTERN void -nk_tt__fill_active_edges_new(float *scanline, float *scanline_fill, int len, - struct nk_tt__active_edge *e, float y_top) -{ - float y_bottom = y_top+1; - while (e) - { - /* brute force every pixel */ - /* compute intersection points with top & bottom */ - NK_ASSERT(e->ey >= y_top); - if (e->fdx == 0) { - float x0 = e->fx; - if (x0 < len) { - if (x0 >= 0) { - nk_tt__handle_clipped_edge(scanline,(int) x0,e, x0,y_top, x0,y_bottom); - nk_tt__handle_clipped_edge(scanline_fill-1,(int) x0+1,e, x0,y_top, x0,y_bottom); - } else { - nk_tt__handle_clipped_edge(scanline_fill-1,0,e, x0,y_top, x0,y_bottom); - } - } - } else { - float x0 = e->fx; - float dx = e->fdx; - float xb = x0 + dx; - float x_top, x_bottom; - float y0,y1; - float dy = e->fdy; - NK_ASSERT(e->sy <= y_bottom && e->ey >= y_top); - - /* compute endpoints of line segment clipped to this scanline (if the */ - /* line segment starts on this scanline. x0 is the intersection of the */ - /* line with y_top, but that may be off the line segment. */ - if (e->sy > y_top) { - x_top = x0 + dx * (e->sy - y_top); - y0 = e->sy; - } else { - x_top = x0; - y0 = y_top; - } - - if (e->ey < y_bottom) { - x_bottom = x0 + dx * (e->ey - y_top); - y1 = e->ey; - } else { - x_bottom = xb; - y1 = y_bottom; - } - - if (x_top >= 0 && x_bottom >= 0 && x_top < len && x_bottom < len) - { - /* from here on, we don't have to range check x values */ - if ((int) x_top == (int) x_bottom) { - float height; - /* simple case, only spans one pixel */ - int x = (int) x_top; - height = y1 - y0; - NK_ASSERT(x >= 0 && x < len); - scanline[x] += e->direction * (1.0f-(((float)x_top - (float)x) + ((float)x_bottom-(float)x))/2.0f) * (float)height; - scanline_fill[x] += e->direction * (float)height; /* everything right of this pixel is filled */ - } else { - int x,x1,x2; - float y_crossing, step, sign, area; - /* covers 2+ pixels */ - if (x_top > x_bottom) - { - /* flip scanline vertically; signed area is the same */ - float t; - y0 = y_bottom - (y0 - y_top); - y1 = y_bottom - (y1 - y_top); - t = y0; y0 = y1; y1 = t; - t = x_bottom; x_bottom = x_top; x_top = t; - dx = -dx; - dy = -dy; - t = x0; x0 = xb; xb = t; - } - - x1 = (int) x_top; - x2 = (int) x_bottom; - /* compute intersection with y axis at x1+1 */ - y_crossing = ((float)x1+1 - (float)x0) * (float)dy + (float)y_top; - - sign = e->direction; - /* area of the rectangle covered from y0..y_crossing */ - area = sign * (y_crossing-y0); - /* area of the triangle (x_top,y0), (x+1,y0), (x+1,y_crossing) */ - scanline[x1] += area * (1.0f-((float)((float)x_top - (float)x1)+(float)(x1+1-x1))/2.0f); - - step = sign * dy; - for (x = x1+1; x < x2; ++x) { - scanline[x] += area + step/2; - area += step; - } - y_crossing += (float)dy * (float)(x2 - (x1+1)); - - scanline[x2] += area + sign * (1.0f-((float)(x2-x2)+((float)x_bottom-(float)x2))/2.0f) * (y1-y_crossing); - scanline_fill[x2] += sign * (y1-y0); - } - } - else - { - /* if edge goes outside of box we're drawing, we require */ - /* clipping logic. since this does not match the intended use */ - /* of this library, we use a different, very slow brute */ - /* force implementation */ - int x; - for (x=0; x < len; ++x) - { - /* cases: */ - /* */ - /* there can be up to two intersections with the pixel. any intersection */ - /* with left or right edges can be handled by splitting into two (or three) */ - /* regions. intersections with top & bottom do not necessitate case-wise logic. */ - /* */ - /* the old way of doing this found the intersections with the left & right edges, */ - /* then used some simple logic to produce up to three segments in sorted order */ - /* from top-to-bottom. however, this had a problem: if an x edge was epsilon */ - /* across the x border, then the corresponding y position might not be distinct */ - /* from the other y segment, and it might ignored as an empty segment. to avoid */ - /* that, we need to explicitly produce segments based on x positions. */ - - /* rename variables to clear pairs */ - float ya = y_top; - float x1 = (float) (x); - float x2 = (float) (x+1); - float x3 = xb; - float y3 = y_bottom; - float yb,y2; - - yb = ((float)x - x0) / dx + y_top; - y2 = ((float)x+1 - x0) / dx + y_top; - - if (x0 < x1 && x3 > x2) { /* three segments descending down-right */ - nk_tt__handle_clipped_edge(scanline,x,e, x0,ya, x1,yb); - nk_tt__handle_clipped_edge(scanline,x,e, x1,yb, x2,y2); - nk_tt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3); - } else if (x3 < x1 && x0 > x2) { /* three segments descending down-left */ - nk_tt__handle_clipped_edge(scanline,x,e, x0,ya, x2,y2); - nk_tt__handle_clipped_edge(scanline,x,e, x2,y2, x1,yb); - nk_tt__handle_clipped_edge(scanline,x,e, x1,yb, x3,y3); - } else if (x0 < x1 && x3 > x1) { /* two segments across x, down-right */ - nk_tt__handle_clipped_edge(scanline,x,e, x0,ya, x1,yb); - nk_tt__handle_clipped_edge(scanline,x,e, x1,yb, x3,y3); - } else if (x3 < x1 && x0 > x1) { /* two segments across x, down-left */ - nk_tt__handle_clipped_edge(scanline,x,e, x0,ya, x1,yb); - nk_tt__handle_clipped_edge(scanline,x,e, x1,yb, x3,y3); - } else if (x0 < x2 && x3 > x2) { /* two segments across x+1, down-right */ - nk_tt__handle_clipped_edge(scanline,x,e, x0,ya, x2,y2); - nk_tt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3); - } else if (x3 < x2 && x0 > x2) { /* two segments across x+1, down-left */ - nk_tt__handle_clipped_edge(scanline,x,e, x0,ya, x2,y2); - nk_tt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3); - } else { /* one segment */ - nk_tt__handle_clipped_edge(scanline,x,e, x0,ya, x3,y3); - } - } - } - } - e = e->next; - } -} -NK_INTERN void -nk_tt__rasterize_sorted_edges(struct nk_tt__bitmap *result, struct nk_tt__edge *e, - int n, int vsubsample, int off_x, int off_y, struct nk_allocator *alloc) -{ - /* directly AA rasterize edges w/o supersampling */ - struct nk_tt__hheap hh; - struct nk_tt__active_edge *active = 0; - int y,j=0, i; - float scanline_data[129], *scanline, *scanline2; - - NK_UNUSED(vsubsample); - nk_zero_struct(hh); - hh.alloc = *alloc; - - if (result->w > 64) - scanline = (float *) alloc->alloc(alloc->userdata,0, (nk_size)(result->w*2+1) * sizeof(float)); - else scanline = scanline_data; - - scanline2 = scanline + result->w; - y = off_y; - e[n].y0 = (float) (off_y + result->h) + 1; - - while (j < result->h) - { - /* find center of pixel for this scanline */ - float scan_y_top = (float)y + 0.0f; - float scan_y_bottom = (float)y + 1.0f; - struct nk_tt__active_edge **step = &active; - - NK_MEMSET(scanline , 0, (nk_size)result->w*sizeof(scanline[0])); - NK_MEMSET(scanline2, 0, (nk_size)(result->w+1)*sizeof(scanline[0])); - - /* update all active edges; */ - /* remove all active edges that terminate before the top of this scanline */ - while (*step) { - struct nk_tt__active_edge * z = *step; - if (z->ey <= scan_y_top) { - *step = z->next; /* delete from list */ - NK_ASSERT(z->direction); - z->direction = 0; - nk_tt__hheap_free(&hh, z); - } else { - step = &((*step)->next); /* advance through list */ - } - } - - /* insert all edges that start before the bottom of this scanline */ - while (e->y0 <= scan_y_bottom) { - if (e->y0 != e->y1) { - struct nk_tt__active_edge *z = nk_tt__new_active(&hh, e, off_x, scan_y_top); - if (z != 0) { - NK_ASSERT(z->ey >= scan_y_top); - /* insert at front */ - z->next = active; - active = z; - } - } - ++e; - } - - /* now process all active edges */ - if (active) - nk_tt__fill_active_edges_new(scanline, scanline2+1, result->w, active, scan_y_top); - - { - float sum = 0; - for (i=0; i < result->w; ++i) { - float k; - int m; - sum += scanline2[i]; - k = scanline[i] + sum; - k = (float) NK_ABS(k) * 255.0f + 0.5f; - m = (int) k; - if (m > 255) m = 255; - result->pixels[j*result->stride + i] = (unsigned char) m; - } - } - /* advance all the edges */ - step = &active; - while (*step) { - struct nk_tt__active_edge *z = *step; - z->fx += z->fdx; /* advance to position for current scanline */ - step = &((*step)->next); /* advance through list */ - } - ++y; - ++j; - } - nk_tt__hheap_cleanup(&hh); - if (scanline != scanline_data) - alloc->free(alloc->userdata, scanline); -} -NK_INTERN void -nk_tt__sort_edges_ins_sort(struct nk_tt__edge *p, int n) -{ - int i,j; - #define NK_TT__COMPARE(a,b) ((a)->y0 < (b)->y0) - for (i=1; i < n; ++i) { - struct nk_tt__edge t = p[i], *a = &t; - j = i; - while (j > 0) { - struct nk_tt__edge *b = &p[j-1]; - int c = NK_TT__COMPARE(a,b); - if (!c) break; - p[j] = p[j-1]; - --j; - } - if (i != j) - p[j] = t; - } -} -NK_INTERN void -nk_tt__sort_edges_quicksort(struct nk_tt__edge *p, int n) -{ - /* threshold for transitioning to insertion sort */ - while (n > 12) { - struct nk_tt__edge t; - int c01,c12,c,m,i,j; - - /* compute median of three */ - m = n >> 1; - c01 = NK_TT__COMPARE(&p[0],&p[m]); - c12 = NK_TT__COMPARE(&p[m],&p[n-1]); - - /* if 0 >= mid >= end, or 0 < mid < end, then use mid */ - if (c01 != c12) { - /* otherwise, we'll need to swap something else to middle */ - int z; - c = NK_TT__COMPARE(&p[0],&p[n-1]); - /* 0>mid && midn => n; 0 0 */ - /* 0n: 0>n => 0; 0 n */ - z = (c == c12) ? 0 : n-1; - t = p[z]; - p[z] = p[m]; - p[m] = t; - } - - /* now p[m] is the median-of-three */ - /* swap it to the beginning so it won't move around */ - t = p[0]; - p[0] = p[m]; - p[m] = t; - - /* partition loop */ - i=1; - j=n-1; - for(;;) { - /* handling of equality is crucial here */ - /* for sentinels & efficiency with duplicates */ - for (;;++i) { - if (!NK_TT__COMPARE(&p[i], &p[0])) break; - } - for (;;--j) { - if (!NK_TT__COMPARE(&p[0], &p[j])) break; - } - - /* make sure we haven't crossed */ - if (i >= j) break; - t = p[i]; - p[i] = p[j]; - p[j] = t; - - ++i; - --j; - - } - - /* recurse on smaller side, iterate on larger */ - if (j < (n-i)) { - nk_tt__sort_edges_quicksort(p,j); - p = p+i; - n = n-i; - } else { - nk_tt__sort_edges_quicksort(p+i, n-i); - n = j; - } - } -} -NK_INTERN void -nk_tt__sort_edges(struct nk_tt__edge *p, int n) -{ - nk_tt__sort_edges_quicksort(p, n); - nk_tt__sort_edges_ins_sort(p, n); -} -NK_INTERN void -nk_tt__rasterize(struct nk_tt__bitmap *result, struct nk_tt__point *pts, - int *wcount, int windings, float scale_x, float scale_y, - float shift_x, float shift_y, int off_x, int off_y, int invert, - struct nk_allocator *alloc) -{ - float y_scale_inv = invert ? -scale_y : scale_y; - struct nk_tt__edge *e; - int n,i,j,k,m; - int vsubsample = 1; - /* vsubsample should divide 255 evenly; otherwise we won't reach full opacity */ - - /* now we have to blow out the windings into explicit edge lists */ - n = 0; - for (i=0; i < windings; ++i) - n += wcount[i]; - - e = (struct nk_tt__edge*) - alloc->alloc(alloc->userdata, 0,(sizeof(*e) * (nk_size)(n+1))); - if (e == 0) return; - n = 0; - - m=0; - for (i=0; i < windings; ++i) - { - struct nk_tt__point *p = pts + m; - m += wcount[i]; - j = wcount[i]-1; - for (k=0; k < wcount[i]; j=k++) { - int a=k,b=j; - /* skip the edge if horizontal */ - if (p[j].y == p[k].y) - continue; - - /* add edge from j to k to the list */ - e[n].invert = 0; - if (invert ? p[j].y > p[k].y : p[j].y < p[k].y) { - e[n].invert = 1; - a=j,b=k; - } - e[n].x0 = p[a].x * scale_x + shift_x; - e[n].y0 = (p[a].y * y_scale_inv + shift_y) * (float)vsubsample; - e[n].x1 = p[b].x * scale_x + shift_x; - e[n].y1 = (p[b].y * y_scale_inv + shift_y) * (float)vsubsample; - ++n; - } - } - - /* now sort the edges by their highest point (should snap to integer, and then by x) */ - /*STBTT_sort(e, n, sizeof(e[0]), nk_tt__edge_compare); */ - nk_tt__sort_edges(e, n); - /* now, traverse the scanlines and find the intersections on each scanline, use xor winding rule */ - nk_tt__rasterize_sorted_edges(result, e, n, vsubsample, off_x, off_y, alloc); - alloc->free(alloc->userdata, e); -} -NK_INTERN void -nk_tt__add_point(struct nk_tt__point *points, int n, float x, float y) -{ - if (!points) return; /* during first pass, it's unallocated */ - points[n].x = x; - points[n].y = y; -} -NK_INTERN int -nk_tt__tesselate_curve(struct nk_tt__point *points, int *num_points, - float x0, float y0, float x1, float y1, float x2, float y2, - float objspace_flatness_squared, int n) -{ - /* tesselate until threshold p is happy... - * @TODO warped to compensate for non-linear stretching */ - /* midpoint */ - float mx = (x0 + 2*x1 + x2)/4; - float my = (y0 + 2*y1 + y2)/4; - /* versus directly drawn line */ - float dx = (x0+x2)/2 - mx; - float dy = (y0+y2)/2 - my; - if (n > 16) /* 65536 segments on one curve better be enough! */ - return 1; - - /* half-pixel error allowed... need to be smaller if AA */ - if (dx*dx+dy*dy > objspace_flatness_squared) { - nk_tt__tesselate_curve(points, num_points, x0,y0, - (x0+x1)/2.0f,(y0+y1)/2.0f, mx,my, objspace_flatness_squared,n+1); - nk_tt__tesselate_curve(points, num_points, mx,my, - (x1+x2)/2.0f,(y1+y2)/2.0f, x2,y2, objspace_flatness_squared,n+1); - } else { - nk_tt__add_point(points, *num_points,x2,y2); - *num_points = *num_points+1; - } - return 1; -} -NK_INTERN struct nk_tt__point* -nk_tt_FlattenCurves(struct nk_tt_vertex *vertices, int num_verts, - float objspace_flatness, int **contour_lengths, int *num_contours, - struct nk_allocator *alloc) -{ - /* returns number of contours */ - struct nk_tt__point *points=0; - int num_points=0; - float objspace_flatness_squared = objspace_flatness * objspace_flatness; - int i; - int n=0; - int start=0; - int pass; - - /* count how many "moves" there are to get the contour count */ - for (i=0; i < num_verts; ++i) - if (vertices[i].type == NK_TT_vmove) ++n; - - *num_contours = n; - if (n == 0) return 0; - - *contour_lengths = (int *) - alloc->alloc(alloc->userdata,0, (sizeof(**contour_lengths) * (nk_size)n)); - if (*contour_lengths == 0) { - *num_contours = 0; - return 0; - } - - /* make two passes through the points so we don't need to realloc */ - for (pass=0; pass < 2; ++pass) - { - float x=0,y=0; - if (pass == 1) { - points = (struct nk_tt__point *) - alloc->alloc(alloc->userdata,0, (nk_size)num_points * sizeof(points[0])); - if (points == 0) goto error; - } - num_points = 0; - n= -1; - - for (i=0; i < num_verts; ++i) - { - switch (vertices[i].type) { - case NK_TT_vmove: - /* start the next contour */ - if (n >= 0) - (*contour_lengths)[n] = num_points - start; - ++n; - start = num_points; - - x = vertices[i].x, y = vertices[i].y; - nk_tt__add_point(points, num_points++, x,y); - break; - case NK_TT_vline: - x = vertices[i].x, y = vertices[i].y; - nk_tt__add_point(points, num_points++, x, y); - break; - case NK_TT_vcurve: - nk_tt__tesselate_curve(points, &num_points, x,y, - vertices[i].cx, vertices[i].cy, - vertices[i].x, vertices[i].y, - objspace_flatness_squared, 0); - x = vertices[i].x, y = vertices[i].y; - break; - default: break; - } - } - (*contour_lengths)[n] = num_points - start; - } - return points; - -error: - alloc->free(alloc->userdata, points); - alloc->free(alloc->userdata, *contour_lengths); - *contour_lengths = 0; - *num_contours = 0; - return 0; -} -NK_INTERN void -nk_tt_Rasterize(struct nk_tt__bitmap *result, float flatness_in_pixels, - struct nk_tt_vertex *vertices, int num_verts, - float scale_x, float scale_y, float shift_x, float shift_y, - int x_off, int y_off, int invert, struct nk_allocator *alloc) -{ - float scale = scale_x > scale_y ? scale_y : scale_x; - int winding_count, *winding_lengths; - struct nk_tt__point *windings = nk_tt_FlattenCurves(vertices, num_verts, - flatness_in_pixels / scale, &winding_lengths, &winding_count, alloc); - - NK_ASSERT(alloc); - if (windings) { - nk_tt__rasterize(result, windings, winding_lengths, winding_count, - scale_x, scale_y, shift_x, shift_y, x_off, y_off, invert, alloc); - alloc->free(alloc->userdata, winding_lengths); - alloc->free(alloc->userdata, windings); - } -} -NK_INTERN void -nk_tt_MakeGlyphBitmapSubpixel(const struct nk_tt_fontinfo *info, unsigned char *output, - int out_w, int out_h, int out_stride, float scale_x, float scale_y, - float shift_x, float shift_y, int glyph, struct nk_allocator *alloc) -{ - int ix0,iy0; - struct nk_tt_vertex *vertices; - int num_verts = nk_tt_GetGlyphShape(info, alloc, glyph, &vertices); - struct nk_tt__bitmap gbm; - - nk_tt_GetGlyphBitmapBoxSubpixel(info, glyph, scale_x, scale_y, shift_x, - shift_y, &ix0,&iy0,0,0); - gbm.pixels = output; - gbm.w = out_w; - gbm.h = out_h; - gbm.stride = out_stride; - - if (gbm.w && gbm.h) - nk_tt_Rasterize(&gbm, 0.35f, vertices, num_verts, scale_x, scale_y, - shift_x, shift_y, ix0,iy0, 1, alloc); - alloc->free(alloc->userdata, vertices); -} - -/*------------------------------------------------------------- - * Bitmap baking - * --------------------------------------------------------------*/ -NK_INTERN int -nk_tt_PackBegin(struct nk_tt_pack_context *spc, unsigned char *pixels, - int pw, int ph, int stride_in_bytes, int padding, struct nk_allocator *alloc) -{ - int num_nodes = pw - padding; - struct nk_rp_context *context = (struct nk_rp_context *) - alloc->alloc(alloc->userdata,0, sizeof(*context)); - struct nk_rp_node *nodes = (struct nk_rp_node*) - alloc->alloc(alloc->userdata,0, (sizeof(*nodes ) * (nk_size)num_nodes)); - - if (context == 0 || nodes == 0) { - if (context != 0) alloc->free(alloc->userdata, context); - if (nodes != 0) alloc->free(alloc->userdata, nodes); - return 0; - } - - spc->width = pw; - spc->height = ph; - spc->pixels = pixels; - spc->pack_info = context; - spc->nodes = nodes; - spc->padding = padding; - spc->stride_in_bytes = (stride_in_bytes != 0) ? stride_in_bytes : pw; - spc->h_oversample = 1; - spc->v_oversample = 1; - - nk_rp_init_target(context, pw-padding, ph-padding, nodes, num_nodes); - if (pixels) - NK_MEMSET(pixels, 0, (nk_size)(pw*ph)); /* background of 0 around pixels */ - return 1; -} -NK_INTERN void -nk_tt_PackEnd(struct nk_tt_pack_context *spc, struct nk_allocator *alloc) -{ - alloc->free(alloc->userdata, spc->nodes); - alloc->free(alloc->userdata, spc->pack_info); -} -NK_INTERN void -nk_tt_PackSetOversampling(struct nk_tt_pack_context *spc, - unsigned int h_oversample, unsigned int v_oversample) -{ - NK_ASSERT(h_oversample <= NK_TT_MAX_OVERSAMPLE); - NK_ASSERT(v_oversample <= NK_TT_MAX_OVERSAMPLE); - if (h_oversample <= NK_TT_MAX_OVERSAMPLE) - spc->h_oversample = h_oversample; - if (v_oversample <= NK_TT_MAX_OVERSAMPLE) - spc->v_oversample = v_oversample; -} -NK_INTERN void -nk_tt__h_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes, - int kernel_width) -{ - unsigned char buffer[NK_TT_MAX_OVERSAMPLE]; - int safe_w = w - kernel_width; - int j; - - for (j=0; j < h; ++j) - { - int i; - unsigned int total; - NK_MEMSET(buffer, 0, (nk_size)kernel_width); - - total = 0; - - /* make kernel_width a constant in common cases so compiler can optimize out the divide */ - switch (kernel_width) { - case 2: - for (i=0; i <= safe_w; ++i) { - total += (unsigned int)(pixels[i] - buffer[i & NK_TT__OVER_MASK]); - buffer[(i+kernel_width) & NK_TT__OVER_MASK] = pixels[i]; - pixels[i] = (unsigned char) (total / 2); - } - break; - case 3: - for (i=0; i <= safe_w; ++i) { - total += (unsigned int)(pixels[i] - buffer[i & NK_TT__OVER_MASK]); - buffer[(i+kernel_width) & NK_TT__OVER_MASK] = pixels[i]; - pixels[i] = (unsigned char) (total / 3); - } - break; - case 4: - for (i=0; i <= safe_w; ++i) { - total += (unsigned int)pixels[i] - buffer[i & NK_TT__OVER_MASK]; - buffer[(i+kernel_width) & NK_TT__OVER_MASK] = pixels[i]; - pixels[i] = (unsigned char) (total / 4); - } - break; - case 5: - for (i=0; i <= safe_w; ++i) { - total += (unsigned int)(pixels[i] - buffer[i & NK_TT__OVER_MASK]); - buffer[(i+kernel_width) & NK_TT__OVER_MASK] = pixels[i]; - pixels[i] = (unsigned char) (total / 5); - } - break; - default: - for (i=0; i <= safe_w; ++i) { - total += (unsigned int)(pixels[i] - buffer[i & NK_TT__OVER_MASK]); - buffer[(i+kernel_width) & NK_TT__OVER_MASK] = pixels[i]; - pixels[i] = (unsigned char) (total / (unsigned int)kernel_width); - } - break; - } - - for (; i < w; ++i) { - NK_ASSERT(pixels[i] == 0); - total -= (unsigned int)(buffer[i & NK_TT__OVER_MASK]); - pixels[i] = (unsigned char) (total / (unsigned int)kernel_width); - } - pixels += stride_in_bytes; - } -} -NK_INTERN void -nk_tt__v_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes, - int kernel_width) -{ - unsigned char buffer[NK_TT_MAX_OVERSAMPLE]; - int safe_h = h - kernel_width; - int j; - - for (j=0; j < w; ++j) - { - int i; - unsigned int total; - NK_MEMSET(buffer, 0, (nk_size)kernel_width); - - total = 0; - - /* make kernel_width a constant in common cases so compiler can optimize out the divide */ - switch (kernel_width) { - case 2: - for (i=0; i <= safe_h; ++i) { - total += (unsigned int)(pixels[i*stride_in_bytes] - buffer[i & NK_TT__OVER_MASK]); - buffer[(i+kernel_width) & NK_TT__OVER_MASK] = pixels[i*stride_in_bytes]; - pixels[i*stride_in_bytes] = (unsigned char) (total / 2); - } - break; - case 3: - for (i=0; i <= safe_h; ++i) { - total += (unsigned int)(pixels[i*stride_in_bytes] - buffer[i & NK_TT__OVER_MASK]); - buffer[(i+kernel_width) & NK_TT__OVER_MASK] = pixels[i*stride_in_bytes]; - pixels[i*stride_in_bytes] = (unsigned char) (total / 3); - } - break; - case 4: - for (i=0; i <= safe_h; ++i) { - total += (unsigned int)(pixels[i*stride_in_bytes] - buffer[i & NK_TT__OVER_MASK]); - buffer[(i+kernel_width) & NK_TT__OVER_MASK] = pixels[i*stride_in_bytes]; - pixels[i*stride_in_bytes] = (unsigned char) (total / 4); - } - break; - case 5: - for (i=0; i <= safe_h; ++i) { - total += (unsigned int)(pixels[i*stride_in_bytes] - buffer[i & NK_TT__OVER_MASK]); - buffer[(i+kernel_width) & NK_TT__OVER_MASK] = pixels[i*stride_in_bytes]; - pixels[i*stride_in_bytes] = (unsigned char) (total / 5); - } - break; - default: - for (i=0; i <= safe_h; ++i) { - total += (unsigned int)(pixels[i*stride_in_bytes] - buffer[i & NK_TT__OVER_MASK]); - buffer[(i+kernel_width) & NK_TT__OVER_MASK] = pixels[i*stride_in_bytes]; - pixels[i*stride_in_bytes] = (unsigned char) (total / (unsigned int)kernel_width); - } - break; - } - - for (; i < h; ++i) { - NK_ASSERT(pixels[i*stride_in_bytes] == 0); - total -= (unsigned int)(buffer[i & NK_TT__OVER_MASK]); - pixels[i*stride_in_bytes] = (unsigned char) (total / (unsigned int)kernel_width); - } - pixels += 1; - } -} -NK_INTERN float -nk_tt__oversample_shift(int oversample) -{ - if (!oversample) - return 0.0f; - - /* The prefilter is a box filter of width "oversample", */ - /* which shifts phase by (oversample - 1)/2 pixels in */ - /* oversampled space. We want to shift in the opposite */ - /* direction to counter this. */ - return (float)-(oversample - 1) / (2.0f * (float)oversample); -} -NK_INTERN int -nk_tt_PackFontRangesGatherRects(struct nk_tt_pack_context *spc, - struct nk_tt_fontinfo *info, struct nk_tt_pack_range *ranges, - int num_ranges, struct nk_rp_rect *rects) -{ - /* rects array must be big enough to accommodate all characters in the given ranges */ - int i,j,k; - k = 0; - - for (i=0; i < num_ranges; ++i) { - float fh = ranges[i].font_size; - float scale = (fh > 0) ? nk_tt_ScaleForPixelHeight(info, fh): - nk_tt_ScaleForMappingEmToPixels(info, -fh); - ranges[i].h_oversample = (unsigned char) spc->h_oversample; - ranges[i].v_oversample = (unsigned char) spc->v_oversample; - for (j=0; j < ranges[i].num_chars; ++j) { - int x0,y0,x1,y1; - int codepoint = ranges[i].first_unicode_codepoint_in_range ? - ranges[i].first_unicode_codepoint_in_range + j : - ranges[i].array_of_unicode_codepoints[j]; - - int glyph = nk_tt_FindGlyphIndex(info, codepoint); - nk_tt_GetGlyphBitmapBoxSubpixel(info,glyph, scale * (float)spc->h_oversample, - scale * (float)spc->v_oversample, 0,0, &x0,&y0,&x1,&y1); - rects[k].w = (nk_rp_coord) (x1-x0 + spc->padding + (int)spc->h_oversample-1); - rects[k].h = (nk_rp_coord) (y1-y0 + spc->padding + (int)spc->v_oversample-1); - ++k; - } - } - return k; -} -NK_INTERN int -nk_tt_PackFontRangesRenderIntoRects(struct nk_tt_pack_context *spc, - struct nk_tt_fontinfo *info, struct nk_tt_pack_range *ranges, - int num_ranges, struct nk_rp_rect *rects, struct nk_allocator *alloc) -{ - int i,j,k, return_value = 1; - /* save current values */ - int old_h_over = (int)spc->h_oversample; - int old_v_over = (int)spc->v_oversample; - /* rects array must be big enough to accommodate all characters in the given ranges */ - - k = 0; - for (i=0; i < num_ranges; ++i) - { - float fh = ranges[i].font_size; - float recip_h,recip_v,sub_x,sub_y; - float scale = fh > 0 ? nk_tt_ScaleForPixelHeight(info, fh): - nk_tt_ScaleForMappingEmToPixels(info, -fh); - - spc->h_oversample = ranges[i].h_oversample; - spc->v_oversample = ranges[i].v_oversample; - - recip_h = 1.0f / (float)spc->h_oversample; - recip_v = 1.0f / (float)spc->v_oversample; - - sub_x = nk_tt__oversample_shift((int)spc->h_oversample); - sub_y = nk_tt__oversample_shift((int)spc->v_oversample); - - for (j=0; j < ranges[i].num_chars; ++j) - { - struct nk_rp_rect *r = &rects[k]; - if (r->was_packed) - { - struct nk_tt_packedchar *bc = &ranges[i].chardata_for_range[j]; - int advance, lsb, x0,y0,x1,y1; - int codepoint = ranges[i].first_unicode_codepoint_in_range ? - ranges[i].first_unicode_codepoint_in_range + j : - ranges[i].array_of_unicode_codepoints[j]; - int glyph = nk_tt_FindGlyphIndex(info, codepoint); - nk_rp_coord pad = (nk_rp_coord) spc->padding; - - /* pad on left and top */ - r->x = (nk_rp_coord)((int)r->x + (int)pad); - r->y = (nk_rp_coord)((int)r->y + (int)pad); - r->w = (nk_rp_coord)((int)r->w - (int)pad); - r->h = (nk_rp_coord)((int)r->h - (int)pad); - - nk_tt_GetGlyphHMetrics(info, glyph, &advance, &lsb); - nk_tt_GetGlyphBitmapBox(info, glyph, scale * (float)spc->h_oversample, - (scale * (float)spc->v_oversample), &x0,&y0,&x1,&y1); - nk_tt_MakeGlyphBitmapSubpixel(info, spc->pixels + r->x + r->y*spc->stride_in_bytes, - (int)(r->w - spc->h_oversample+1), (int)(r->h - spc->v_oversample+1), - spc->stride_in_bytes, scale * (float)spc->h_oversample, - scale * (float)spc->v_oversample, 0,0, glyph, alloc); - - if (spc->h_oversample > 1) - nk_tt__h_prefilter(spc->pixels + r->x + r->y*spc->stride_in_bytes, - r->w, r->h, spc->stride_in_bytes, (int)spc->h_oversample); - - if (spc->v_oversample > 1) - nk_tt__v_prefilter(spc->pixels + r->x + r->y*spc->stride_in_bytes, - r->w, r->h, spc->stride_in_bytes, (int)spc->v_oversample); - - bc->x0 = (nk_ushort) r->x; - bc->y0 = (nk_ushort) r->y; - bc->x1 = (nk_ushort) (r->x + r->w); - bc->y1 = (nk_ushort) (r->y + r->h); - bc->xadvance = scale * (float)advance; - bc->xoff = (float) x0 * recip_h + sub_x; - bc->yoff = (float) y0 * recip_v + sub_y; - bc->xoff2 = ((float)x0 + r->w) * recip_h + sub_x; - bc->yoff2 = ((float)y0 + r->h) * recip_v + sub_y; - } else { - return_value = 0; /* if any fail, report failure */ - } - ++k; - } - } - /* restore original values */ - spc->h_oversample = (unsigned int)old_h_over; - spc->v_oversample = (unsigned int)old_v_over; - return return_value; -} -NK_INTERN void -nk_tt_GetPackedQuad(struct nk_tt_packedchar *chardata, int pw, int ph, - int char_index, float *xpos, float *ypos, struct nk_tt_aligned_quad *q, - int align_to_integer) -{ - float ipw = 1.0f / (float)pw, iph = 1.0f / (float)ph; - struct nk_tt_packedchar *b = (struct nk_tt_packedchar*)(chardata + char_index); - if (align_to_integer) { - int tx = nk_ifloorf((*xpos + b->xoff) + 0.5f); - int ty = nk_ifloorf((*ypos + b->yoff) + 0.5f); - - float x = (float)tx; - float y = (float)ty; - - q->x0 = x; - q->y0 = y; - q->x1 = x + b->xoff2 - b->xoff; - q->y1 = y + b->yoff2 - b->yoff; - } else { - q->x0 = *xpos + b->xoff; - q->y0 = *ypos + b->yoff; - q->x1 = *xpos + b->xoff2; - q->y1 = *ypos + b->yoff2; - } - q->s0 = b->x0 * ipw; - q->t0 = b->y0 * iph; - q->s1 = b->x1 * ipw; - q->t1 = b->y1 * iph; - *xpos += b->xadvance; -} - -/* ------------------------------------------------------------- - * - * FONT BAKING - * - * --------------------------------------------------------------*/ -struct nk_font_bake_data { - struct nk_tt_fontinfo info; - struct nk_rp_rect *rects; - struct nk_tt_pack_range *ranges; - nk_rune range_count; -}; - -struct nk_font_baker { - struct nk_allocator alloc; - struct nk_tt_pack_context spc; - struct nk_font_bake_data *build; - struct nk_tt_packedchar *packed_chars; - struct nk_rp_rect *rects; - struct nk_tt_pack_range *ranges; -}; - -NK_GLOBAL const nk_size nk_rect_align = NK_ALIGNOF(struct nk_rp_rect); -NK_GLOBAL const nk_size nk_range_align = NK_ALIGNOF(struct nk_tt_pack_range); -NK_GLOBAL const nk_size nk_char_align = NK_ALIGNOF(struct nk_tt_packedchar); -NK_GLOBAL const nk_size nk_build_align = NK_ALIGNOF(struct nk_font_bake_data); -NK_GLOBAL const nk_size nk_baker_align = NK_ALIGNOF(struct nk_font_baker); - -NK_INTERN int -nk_range_count(const nk_rune *range) -{ - const nk_rune *iter = range; - NK_ASSERT(range); - if (!range) return 0; - while (*(iter++) != 0); - return (iter == range) ? 0 : (int)((iter - range)/2); -} -NK_INTERN int -nk_range_glyph_count(const nk_rune *range, int count) -{ - int i = 0; - int total_glyphs = 0; - for (i = 0; i < count; ++i) { - int diff; - nk_rune f = range[(i*2)+0]; - nk_rune t = range[(i*2)+1]; - NK_ASSERT(t >= f); - diff = (int)((t - f) + 1); - total_glyphs += diff; - } - return total_glyphs; -} -NK_API const nk_rune* -nk_font_default_glyph_ranges(void) -{ - NK_STORAGE const nk_rune ranges[] = {0x0020, 0x00FF, 0}; - return ranges; -} -NK_API const nk_rune* -nk_font_chinese_glyph_ranges(void) -{ - NK_STORAGE const nk_rune ranges[] = { - 0x0020, 0x00FF, - 0x3000, 0x30FF, - 0x31F0, 0x31FF, - 0xFF00, 0xFFEF, - 0x4e00, 0x9FAF, - 0 - }; - return ranges; -} -NK_API const nk_rune* -nk_font_cyrillic_glyph_ranges(void) -{ - NK_STORAGE const nk_rune ranges[] = { - 0x0020, 0x00FF, - 0x0400, 0x052F, - 0x2DE0, 0x2DFF, - 0xA640, 0xA69F, - 0 - }; - return ranges; -} -NK_API const nk_rune* -nk_font_korean_glyph_ranges(void) -{ - NK_STORAGE const nk_rune ranges[] = { - 0x0020, 0x00FF, - 0x3131, 0x3163, - 0xAC00, 0xD79D, - 0 - }; - return ranges; -} -NK_INTERN void -nk_font_baker_memory(nk_size *temp, int *glyph_count, - struct nk_font_config *config_list, int count) -{ - int range_count = 0; - int total_range_count = 0; - struct nk_font_config *iter, *i; - - NK_ASSERT(config_list); - NK_ASSERT(glyph_count); - if (!config_list) { - *temp = 0; - *glyph_count = 0; - return; - } - *glyph_count = 0; - for (iter = config_list; iter; iter = iter->next) { - i = iter; - do {if (!i->range) iter->range = nk_font_default_glyph_ranges(); - range_count = nk_range_count(i->range); - total_range_count += range_count; - *glyph_count += nk_range_glyph_count(i->range, range_count); - } while ((i = i->n) != iter); - } - *temp = (nk_size)*glyph_count * sizeof(struct nk_rp_rect); - *temp += (nk_size)total_range_count * sizeof(struct nk_tt_pack_range); - *temp += (nk_size)*glyph_count * sizeof(struct nk_tt_packedchar); - *temp += (nk_size)count * sizeof(struct nk_font_bake_data); - *temp += sizeof(struct nk_font_baker); - *temp += nk_rect_align + nk_range_align + nk_char_align; - *temp += nk_build_align + nk_baker_align; -} -NK_INTERN struct nk_font_baker* -nk_font_baker(void *memory, int glyph_count, int count, struct nk_allocator *alloc) -{ - struct nk_font_baker *baker; - if (!memory) return 0; - /* setup baker inside a memory block */ - baker = (struct nk_font_baker*)NK_ALIGN_PTR(memory, nk_baker_align); - baker->build = (struct nk_font_bake_data*)NK_ALIGN_PTR((baker + 1), nk_build_align); - baker->packed_chars = (struct nk_tt_packedchar*)NK_ALIGN_PTR((baker->build + count), nk_char_align); - baker->rects = (struct nk_rp_rect*)NK_ALIGN_PTR((baker->packed_chars + glyph_count), nk_rect_align); - baker->ranges = (struct nk_tt_pack_range*)NK_ALIGN_PTR((baker->rects + glyph_count), nk_range_align); - baker->alloc = *alloc; - return baker; -} -NK_INTERN int -nk_font_bake_pack(struct nk_font_baker *baker, - nk_size *image_memory, int *width, int *height, struct nk_recti *custom, - const struct nk_font_config *config_list, int count, - struct nk_allocator *alloc) -{ - NK_STORAGE const nk_size max_height = 1024 * 32; - const struct nk_font_config *config_iter, *it; - int total_glyph_count = 0; - int total_range_count = 0; - int range_count = 0; - int i = 0; - - NK_ASSERT(image_memory); - NK_ASSERT(width); - NK_ASSERT(height); - NK_ASSERT(config_list); - NK_ASSERT(count); - NK_ASSERT(alloc); - - if (!image_memory || !width || !height || !config_list || !count) return nk_false; - for (config_iter = config_list; config_iter; config_iter = config_iter->next) { - it = config_iter; - do {range_count = nk_range_count(it->range); - total_range_count += range_count; - total_glyph_count += nk_range_glyph_count(it->range, range_count); - } while ((it = it->n) != config_iter); - } - /* setup font baker from temporary memory */ - for (config_iter = config_list; config_iter; config_iter = config_iter->next) { - it = config_iter; - do {if (!nk_tt_InitFont(&baker->build[i++].info, (const unsigned char*)it->ttf_blob, 0)) - return nk_false; - } while ((it = it->n) != config_iter); - } - *height = 0; - *width = (total_glyph_count > 1000) ? 1024 : 512; - nk_tt_PackBegin(&baker->spc, 0, (int)*width, (int)max_height, 0, 1, alloc); - { - int input_i = 0; - int range_n = 0; - int rect_n = 0; - int char_n = 0; - - if (custom) { - /* pack custom user data first so it will be in the upper left corner*/ - struct nk_rp_rect custom_space; - nk_zero(&custom_space, sizeof(custom_space)); - custom_space.w = (nk_rp_coord)(custom->w); - custom_space.h = (nk_rp_coord)(custom->h); - - nk_tt_PackSetOversampling(&baker->spc, 1, 1); - nk_rp_pack_rects((struct nk_rp_context*)baker->spc.pack_info, &custom_space, 1); - *height = NK_MAX(*height, (int)(custom_space.y + custom_space.h)); - - custom->x = (short)custom_space.x; - custom->y = (short)custom_space.y; - custom->w = (short)custom_space.w; - custom->h = (short)custom_space.h; - } - - /* first font pass: pack all glyphs */ - for (input_i = 0, config_iter = config_list; input_i < count && config_iter; - config_iter = config_iter->next) { - it = config_iter; - do {int n = 0; - int glyph_count; - const nk_rune *in_range; - const struct nk_font_config *cfg = it; - struct nk_font_bake_data *tmp = &baker->build[input_i++]; - - /* count glyphs + ranges in current font */ - glyph_count = 0; range_count = 0; - for (in_range = cfg->range; in_range[0] && in_range[1]; in_range += 2) { - glyph_count += (int)(in_range[1] - in_range[0]) + 1; - range_count++; - } - - /* setup ranges */ - tmp->ranges = baker->ranges + range_n; - tmp->range_count = (nk_rune)range_count; - range_n += range_count; - for (i = 0; i < range_count; ++i) { - in_range = &cfg->range[i * 2]; - tmp->ranges[i].font_size = cfg->size; - tmp->ranges[i].first_unicode_codepoint_in_range = (int)in_range[0]; - tmp->ranges[i].num_chars = (int)(in_range[1]- in_range[0]) + 1; - tmp->ranges[i].chardata_for_range = baker->packed_chars + char_n; - char_n += tmp->ranges[i].num_chars; - } - - /* pack */ - tmp->rects = baker->rects + rect_n; - rect_n += glyph_count; - nk_tt_PackSetOversampling(&baker->spc, cfg->oversample_h, cfg->oversample_v); - n = nk_tt_PackFontRangesGatherRects(&baker->spc, &tmp->info, - tmp->ranges, (int)tmp->range_count, tmp->rects); - nk_rp_pack_rects((struct nk_rp_context*)baker->spc.pack_info, tmp->rects, (int)n); - - /* texture height */ - for (i = 0; i < n; ++i) { - if (tmp->rects[i].was_packed) - *height = NK_MAX(*height, tmp->rects[i].y + tmp->rects[i].h); - } - } while ((it = it->n) != config_iter); - } - NK_ASSERT(rect_n == total_glyph_count); - NK_ASSERT(char_n == total_glyph_count); - NK_ASSERT(range_n == total_range_count); - } - *height = (int)nk_round_up_pow2((nk_uint)*height); - *image_memory = (nk_size)(*width) * (nk_size)(*height); - return nk_true; -} -NK_INTERN void -nk_font_bake(struct nk_font_baker *baker, void *image_memory, int width, int height, - struct nk_font_glyph *glyphs, int glyphs_count, - const struct nk_font_config *config_list, int font_count) -{ - int input_i = 0; - nk_rune glyph_n = 0; - const struct nk_font_config *config_iter; - const struct nk_font_config *it; - - NK_ASSERT(image_memory); - NK_ASSERT(width); - NK_ASSERT(height); - NK_ASSERT(config_list); - NK_ASSERT(baker); - NK_ASSERT(font_count); - NK_ASSERT(glyphs_count); - if (!image_memory || !width || !height || !config_list || - !font_count || !glyphs || !glyphs_count) - return; - - /* second font pass: render glyphs */ - nk_zero(image_memory, (nk_size)((nk_size)width * (nk_size)height)); - baker->spc.pixels = (unsigned char*)image_memory; - baker->spc.height = (int)height; - for (input_i = 0, config_iter = config_list; input_i < font_count && config_iter; - config_iter = config_iter->next) { - it = config_iter; - do {const struct nk_font_config *cfg = it; - struct nk_font_bake_data *tmp = &baker->build[input_i++]; - nk_tt_PackSetOversampling(&baker->spc, cfg->oversample_h, cfg->oversample_v); - nk_tt_PackFontRangesRenderIntoRects(&baker->spc, &tmp->info, tmp->ranges, - (int)tmp->range_count, tmp->rects, &baker->alloc); - } while ((it = it->n) != config_iter); - } nk_tt_PackEnd(&baker->spc, &baker->alloc); - - /* third pass: setup font and glyphs */ - for (input_i = 0, config_iter = config_list; input_i < font_count && config_iter; - config_iter = config_iter->next) { - it = config_iter; - do {nk_size i = 0; - int char_idx = 0; - nk_rune glyph_count = 0; - const struct nk_font_config *cfg = it; - struct nk_font_bake_data *tmp = &baker->build[input_i++]; - struct nk_baked_font *dst_font = cfg->font; - - float font_scale = nk_tt_ScaleForPixelHeight(&tmp->info, cfg->size); - int unscaled_ascent, unscaled_descent, unscaled_line_gap; - nk_tt_GetFontVMetrics(&tmp->info, &unscaled_ascent, &unscaled_descent, - &unscaled_line_gap); - - /* fill baked font */ - if (!cfg->merge_mode) { - dst_font->ranges = cfg->range; - dst_font->height = cfg->size; - dst_font->ascent = ((float)unscaled_ascent * font_scale); - dst_font->descent = ((float)unscaled_descent * font_scale); - dst_font->glyph_offset = glyph_n; - // Need to zero this, or it will carry over from a previous - // bake, and cause a segfault when accessing glyphs[]. - dst_font->glyph_count = 0; - } - - /* fill own baked font glyph array */ - for (i = 0; i < tmp->range_count; ++i) { - struct nk_tt_pack_range *range = &tmp->ranges[i]; - for (char_idx = 0; char_idx < range->num_chars; char_idx++) - { - nk_rune codepoint = 0; - float dummy_x = 0, dummy_y = 0; - struct nk_tt_aligned_quad q; - struct nk_font_glyph *glyph; - - /* query glyph bounds from stb_truetype */ - const struct nk_tt_packedchar *pc = &range->chardata_for_range[char_idx]; - if (!pc->x0 && !pc->x1 && !pc->y0 && !pc->y1) continue; - codepoint = (nk_rune)(range->first_unicode_codepoint_in_range + char_idx); - nk_tt_GetPackedQuad(range->chardata_for_range, (int)width, - (int)height, char_idx, &dummy_x, &dummy_y, &q, 0); - - /* fill own glyph type with data */ - glyph = &glyphs[dst_font->glyph_offset + dst_font->glyph_count + (unsigned int)glyph_count]; - glyph->codepoint = codepoint; - glyph->x0 = q.x0; glyph->y0 = q.y0; - glyph->x1 = q.x1; glyph->y1 = q.y1; - glyph->y0 += (dst_font->ascent + 0.5f); - glyph->y1 += (dst_font->ascent + 0.5f); - glyph->w = glyph->x1 - glyph->x0 + 0.5f; - glyph->h = glyph->y1 - glyph->y0; - - if (cfg->coord_type == NK_COORD_PIXEL) { - glyph->u0 = q.s0 * (float)width; - glyph->v0 = q.t0 * (float)height; - glyph->u1 = q.s1 * (float)width; - glyph->v1 = q.t1 * (float)height; - } else { - glyph->u0 = q.s0; - glyph->v0 = q.t0; - glyph->u1 = q.s1; - glyph->v1 = q.t1; - } - glyph->xadvance = (pc->xadvance + cfg->spacing.x); - if (cfg->pixel_snap) - glyph->xadvance = (float)(int)(glyph->xadvance + 0.5f); - glyph_count++; - } - } - dst_font->glyph_count += glyph_count; - glyph_n += glyph_count; - } while ((it = it->n) != config_iter); - } -} -NK_INTERN void -nk_font_bake_custom_data(void *img_memory, int img_width, int img_height, - struct nk_recti img_dst, const char *texture_data_mask, int tex_width, - int tex_height, char white, char black) -{ - nk_byte *pixels; - int y = 0; - int x = 0; - int n = 0; - - NK_ASSERT(img_memory); - NK_ASSERT(img_width); - NK_ASSERT(img_height); - NK_ASSERT(texture_data_mask); - NK_UNUSED(tex_height); - if (!img_memory || !img_width || !img_height || !texture_data_mask) - return; - - pixels = (nk_byte*)img_memory; - for (y = 0, n = 0; y < tex_height; ++y) { - for (x = 0; x < tex_width; ++x, ++n) { - const int off0 = ((img_dst.x + x) + (img_dst.y + y) * img_width); - const int off1 = off0 + 1 + tex_width; - pixels[off0] = (texture_data_mask[n] == white) ? 0xFF : 0x00; - pixels[off1] = (texture_data_mask[n] == black) ? 0xFF : 0x00; - } - } -} -NK_INTERN void -nk_font_bake_convert(void *out_memory, int img_width, int img_height, - const void *in_memory) -{ - int n = 0; - nk_rune *dst; - const nk_byte *src; - - NK_ASSERT(out_memory); - NK_ASSERT(in_memory); - NK_ASSERT(img_width); - NK_ASSERT(img_height); - if (!out_memory || !in_memory || !img_height || !img_width) return; - - dst = (nk_rune*)out_memory; - src = (const nk_byte*)in_memory; - for (n = (int)(img_width * img_height); n > 0; n--) - *dst++ = ((nk_rune)(*src++) << 24) | 0x00FFFFFF; -} - -/* ------------------------------------------------------------- - * - * FONT - * - * --------------------------------------------------------------*/ -NK_INTERN float -nk_font_text_width(nk_handle handle, float height, const char *text, int len) -{ - nk_rune unicode; - int text_len = 0; - float text_width = 0; - int glyph_len = 0; - float scale = 0; - - struct nk_font *font = (struct nk_font*)handle.ptr; - NK_ASSERT(font); - NK_ASSERT(font->glyphs); - if (!font || !text || !len) - return 0; - - scale = height/font->info.height; - glyph_len = text_len = nk_utf_decode(text, &unicode, (int)len); - if (!glyph_len) return 0; - while (text_len <= (int)len && glyph_len) { - const struct nk_font_glyph *g; - if (unicode == NK_UTF_INVALID) break; - - /* query currently drawn glyph information */ - g = nk_font_find_glyph(font, unicode); - text_width += g->xadvance * scale; - - /* offset next glyph */ - glyph_len = nk_utf_decode(text + text_len, &unicode, (int)len - text_len); - text_len += glyph_len; - } - return text_width; -} -#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT -NK_INTERN void -nk_font_query_font_glyph(nk_handle handle, float height, - struct nk_user_font_glyph *glyph, nk_rune codepoint, nk_rune next_codepoint) -{ - float scale; - const struct nk_font_glyph *g; - struct nk_font *font; - - NK_ASSERT(glyph); - NK_UNUSED(next_codepoint); - - font = (struct nk_font*)handle.ptr; - NK_ASSERT(font); - NK_ASSERT(font->glyphs); - if (!font || !glyph) - return; - - scale = height/font->info.height; - g = nk_font_find_glyph(font, codepoint); - glyph->width = (g->x1 - g->x0) * scale; - glyph->height = (g->y1 - g->y0) * scale; - glyph->offset = nk_vec2(g->x0 * scale, g->y0 * scale); - glyph->xadvance = (g->xadvance * scale); - glyph->uv[0] = nk_vec2(g->u0, g->v0); - glyph->uv[1] = nk_vec2(g->u1, g->v1); -} -#endif -NK_API const struct nk_font_glyph* -nk_font_find_glyph(struct nk_font *font, nk_rune unicode) -{ - int i = 0; - int count; - int total_glyphs = 0; - const struct nk_font_glyph *glyph = 0; - const struct nk_font_config *iter = 0; - - NK_ASSERT(font); - NK_ASSERT(font->glyphs); - NK_ASSERT(font->info.ranges); - if (!font || !font->glyphs) return 0; - - glyph = font->fallback; - iter = font->config; - do {count = nk_range_count(iter->range); - for (i = 0; i < count; ++i) { - nk_rune f = iter->range[(i*2)+0]; - nk_rune t = iter->range[(i*2)+1]; - int diff = (int)((t - f) + 1); - if (unicode >= f && unicode <= t) - return &font->glyphs[((nk_rune)total_glyphs + (unicode - f))]; - total_glyphs += diff; - } - } while ((iter = iter->n) != font->config); - return glyph; -} -NK_INTERN void -nk_font_init(struct nk_font *font, float pixel_height, - nk_rune fallback_codepoint, struct nk_font_glyph *glyphs, - const struct nk_baked_font *baked_font, nk_handle atlas) -{ - struct nk_baked_font baked; - NK_ASSERT(font); - NK_ASSERT(glyphs); - NK_ASSERT(baked_font); - if (!font || !glyphs || !baked_font) - return; - - baked = *baked_font; - font->fallback = 0; - font->info = baked; - font->scale = (float)pixel_height / (float)font->info.height; - font->glyphs = &glyphs[baked_font->glyph_offset]; - font->texture = atlas; - font->fallback_codepoint = fallback_codepoint; - font->fallback = nk_font_find_glyph(font, fallback_codepoint); - - font->handle.height = font->info.height * font->scale; - font->handle.width = nk_font_text_width; - font->handle.userdata.ptr = font; -#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT - font->handle.query = nk_font_query_font_glyph; - font->handle.texture = font->texture; -#endif -} - -/* --------------------------------------------------------------------------- - * - * DEFAULT FONT - * - * ProggyClean.ttf - * Copyright (c) 2004, 2005 Tristan Grimmer - * MIT license (see License.txt in http://www.upperbounds.net/download/ProggyClean.ttf.zip) - * Download and more information at http://upperbounds.net - *-----------------------------------------------------------------------------*/ -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Woverlength-strings" -#elif defined(__GNUC__) || defined(__GNUG__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Woverlength-strings" -#endif - -#ifdef NK_INCLUDE_DEFAULT_FONT - -NK_GLOBAL const char nk_proggy_clean_ttf_compressed_data_base85[11980+1] = - "7])#######hV0qs'/###[),##/l:$#Q6>##5[n42>c-TH`->>#/e>11NNV=Bv(*:.F?uu#(gRU.o0XGH`$vhLG1hxt9?W`#,5LsCp#-i>.r$<$6pD>Lb';9Crc6tgXmKVeU2cD4Eo3R/" - "2*>]b(MC;$jPfY.;h^`IWM9Qo#t'X#(v#Y9w0#1D$CIf;W'#pWUPXOuxXuU(H9M(1=Ke$$'5F%)]0^#0X@U.a$FBjVQTSDgEKnIS7EM9>ZY9w0#L;>>#Mx&4Mvt//L[MkA#W@lK.N'[0#7RL_&#w+F%HtG9M#XL`N&.,GM4Pg;--VsM.M0rJfLH2eTM`*oJMHRC`N" - "kfimM2J,W-jXS:)r0wK#@Fge$U>`w'N7G#$#fB#$E^$#:9:hk+eOe--6x)F7*E%?76%^GMHePW-Z5l'&GiF#$956:rS?dA#fiK:)Yr+`�j@'DbG&#^$PG.Ll+DNa&VZ>1i%h1S9u5o@YaaW$e+bROPOpxTO7Stwi1::iB1q)C_=dV26J;2,]7op$]uQr@_V7$q^%lQwtuHY]=DX,n3L#0PHDO4f9>dC@O>HBuKPpP*E,N+b3L#lpR/MrTEH.IAQk.a>D[.e;mc." - "x]Ip.PH^'/aqUO/$1WxLoW0[iLAw=4h(9.`G" - "CRUxHPeR`5Mjol(dUWxZa(>STrPkrJiWx`5U7F#.g*jrohGg`cg:lSTvEY/EV_7H4Q9[Z%cnv;JQYZ5q.l7Zeas:HOIZOB?Ggv:[7MI2k).'2($5FNP&EQ(,)" - "U]W]+fh18.vsai00);D3@4ku5P?DP8aJt+;qUM]=+b'8@;mViBKx0DE[-auGl8:PJ&Dj+M6OC]O^((##]`0i)drT;-7X`=-H3[igUnPG-NZlo.#k@h#=Ork$m>a>$-?Tm$UV(?#P6YY#" - "'/###xe7q.73rI3*pP/$1>s9)W,JrM7SN]'/4C#v$U`0#V.[0>xQsH$fEmPMgY2u7Kh(G%siIfLSoS+MK2eTM$=5,M8p`A.;_R%#u[K#$x4AG8.kK/HSB==-'Ie/QTtG?-.*^N-4B/ZM" - "_3YlQC7(p7q)&](`6_c)$/*JL(L-^(]$wIM`dPtOdGA,U3:w2M-0+WomX2u7lqM2iEumMTcsF?-aT=Z-97UEnXglEn1K-bnEO`gu" - "Ft(c%=;Am_Qs@jLooI&NX;]0#j4#F14;gl8-GQpgwhrq8'=l_f-b49'UOqkLu7-##oDY2L(te+Mch&gLYtJ,MEtJfLh'x'M=$CS-ZZ%P]8bZ>#S?YY#%Q&q'3^Fw&?D)UDNrocM3A76/" - "/oL?#h7gl85[qW/NDOk%16ij;+:1a'iNIdb-ou8.P*w,v5#EI$TWS>Pot-R*H'-SEpA:g)f+O$%%`kA#G=8RMmG1&O`>to8bC]T&$,n.LoO>29sp3dt-52U%VM#q7'DHpg+#Z9%H[Ket`e;)f#Km8&+DC$I46>#Kr]]u-[=99tts1.qb#q72g1WJO81q+eN'03'eM>&1XxY-caEnO" - "j%2n8)),?ILR5^.Ibn<-X-Mq7[a82Lq:F&#ce+S9wsCK*x`569E8ew'He]h:sI[2LM$[guka3ZRd6:t%IG:;$%YiJ:Nq=?eAw;/:nnDq0(CYcMpG)qLN4$##&J-XTt,%OVU4)S1+R-#dg0/Nn?Ku1^0f$B*P:Rowwm-`0PKjYDDM'3]d39VZHEl4,.j']Pk-M.h^&:0FACm$maq-&sgw0t7/6(^xtk%" - "LuH88Fj-ekm>GA#_>568x6(OFRl-IZp`&b,_P'$MhLbxfc$mj`,O;&%W2m`Zh:/)Uetw:aJ%]K9h:TcF]u_-Sj9,VK3M.*'&0D[Ca]J9gp8,kAW]" - "%(?A%R$f<->Zts'^kn=-^@c4%-pY6qI%J%1IGxfLU9CP8cbPlXv);C=b),<2mOvP8up,UVf3839acAWAW-W?#ao/^#%KYo8fRULNd2.>%m]UK:n%r$'sw]J;5pAoO_#2mO3n,'=H5(et" - "Hg*`+RLgv>=4U8guD$I%D:W>-r5V*%j*W:Kvej.Lp$'?;++O'>()jLR-^u68PHm8ZFWe+ej8h:9r6L*0//c&iH&R8pRbA#Kjm%upV1g:" - "a_#Ur7FuA#(tRh#.Y5K+@?3<-8m0$PEn;J:rh6?I6uG<-`wMU'ircp0LaE_OtlMb&1#6T.#FDKu#1Lw%u%+GM+X'e?YLfjM[VO0MbuFp7;>Q&#WIo)0@F%q7c#4XAXN-U&VBpqB>0ie&jhZ[?iLR@@_AvA-iQC(=ksRZRVp7`.=+NpBC%rh&3]R:8XDmE5^V8O(x<-+k?'(^](H.aREZSi,#1:[IXaZFOm<-ui#qUq2$##Ri;u75OK#(RtaW-K-F`S+cF]uN`-KMQ%rP/Xri.LRcB##=YL3BgM/3M" - "D?@f&1'BW-)Ju#bmmWCMkk&#TR`C,5d>g)F;t,4:@_l8G/5h4vUd%&%950:VXD'QdWoY-F$BtUwmfe$YqL'8(PWX(" - "P?^@Po3$##`MSs?DWBZ/S>+4%>fX,VWv/w'KD`LP5IbH;rTV>n3cEK8U#bX]l-/V+^lj3;vlMb&[5YQ8#pekX9JP3XUC72L,,?+Ni&co7ApnO*5NK,((W-i:$,kp'UDAO(G0Sq7MVjJs" - "bIu)'Z,*[>br5fX^:FPAWr-m2KgLQ_nN6'8uTGT5g)uLv:873UpTLgH+#FgpH'_o1780Ph8KmxQJ8#H72L4@768@Tm&Q" - "h4CB/5OvmA&,Q&QbUoi$a_%3M01H)4x7I^&KQVgtFnV+;[Pc>[m4k//,]1?#`VY[Jr*3&&slRfLiVZJ:]?=K3Sw=[$=uRB?3xk48@aege0jT6'N#(q%.O=?2S]u*(m<-" - "V8J'(1)G][68hW$5'q[GC&5j`TE?m'esFGNRM)j,ffZ?-qx8;->g4t*:CIP/[Qap7/9'#(1sao7w-.qNUdkJ)tCF&#B^;xGvn2r9FEPFFFcL@.iFNkTve$m%#QvQS8U@)2Z+3K:AKM5i" - "sZ88+dKQ)W6>J%CL`.d*(B`-n8D9oK-XV1q['-5k'cAZ69e;D_?$ZPP&s^+7])$*$#@QYi9,5P r+$%CE=68>K8r0=dSC%%(@p7" - ".m7jilQ02'0-VWAgTlGW'b)Tq7VT9q^*^$$.:&N@@" - "$&)WHtPm*5_rO0&e%K&#-30j(E4#'Zb.o/(Tpm$>K'f@[PvFl,hfINTNU6u'0pao7%XUp9]5.>%h`8_=VYbxuel.NTSsJfLacFu3B'lQSu/m6-Oqem8T+oE--$0a/k]uj9EwsG>%veR*" - "hv^BFpQj:K'#SJ,sB-'#](j.Lg92rTw-*n%@/;39rrJF,l#qV%OrtBeC6/,;qB3ebNW[?,Hqj2L.1NP&GjUR=1D8QaS3Up&@*9wP?+lo7b?@%'k4`p0Z$22%K3+iCZj?XJN4Nm&+YF]u" - "@-W$U%VEQ/,,>>#)D#%8cY#YZ?=,`Wdxu/ae&#" - "w6)R89tI#6@s'(6Bf7a&?S=^ZI_kS&ai`&=tE72L_D,;^R)7[$so8lKN%5/$(vdfq7+ebA#" - "u1p]ovUKW&Y%q]'>$1@-[xfn$7ZTp7mM,G,Ko7a&Gu%G[RMxJs[0MM%wci.LFDK)(%:_i2B5CsR8&9Z&#=mPEnm0f`<&c)QL5uJ#%u%lJj+D-r;BoFDoS97h5g)E#o:&S4weDF,9^Hoe`h*L+_a*NrLW-1pG_&2UdB8" - "6e%B/:=>)N4xeW.*wft-;$'58-ESqr#U`'6AQ]m&6/`Z>#S?YY#Vc;r7U2&326d=w&H####?TZ`*4?&.MK?LP8Vxg>$[QXc%QJv92.(Db*B)gb*BM9dM*hJMAo*c&#" - "b0v=Pjer]$gG&JXDf->'StvU7505l9$AFvgYRI^&<^b68?j#q9QX4SM'RO#&sL1IM.rJfLUAj221]d##DW=m83u5;'bYx,*Sl0hL(W;;$doB&O/TQ:(Z^xBdLjLV#*8U_72Lh+2Q8Cj0i:6hp&$C/:p(HK>T8Y[gHQ4`4)'$Ab(Nof%V'8hL&#SfD07&6D@M.*J:;$-rv29'M]8qMv-tLp,'886iaC=Hb*YJoKJ,(j%K=H`K.v9HggqBIiZu'QvBT.#=)0ukruV&.)3=(^1`o*Pj4<-#MJ+gLq9-##@HuZPN0]u:h7.T..G:;$/Usj(T7`Q8tT72LnYl<-qx8;-HV7Q-&Xdx%1a,hC=0u+HlsV>nuIQL-5" - "_>@kXQtMacfD.m-VAb8;IReM3$wf0''hra*so568'Ip&vRs849'MRYSp%:t:h5qSgwpEr$B>Q,;s(C#$)`svQuF$##-D,##,g68@2[T;.XSdN9Qe)rpt._K-#5wF)sP'##p#C0c%-Gb%" - "hd+<-j'Ai*x&&HMkT]C'OSl##5RG[JXaHN;d'uA#x._U;.`PU@(Z3dt4r152@:v,'R.Sj'w#0<-;kPI)FfJ&#AYJ&#//)>-k=m=*XnK$>=)72L]0I%>.G690a:$##<,);?;72#?x9+d;" - "^V'9;jY@;)br#q^YQpx:X#Te$Z^'=-=bGhLf:D6&bNwZ9-ZD#n^9HhLMr5G;']d&6'wYmTFmLq9wI>P(9mI[>kC-ekLC/R&CH+s'B;K-M6$EB%is00:" - "+A4[7xks.LrNk0&E)wILYF@2L'0Nb$+pv<(2.768/FrY&h$^3i&@+G%JT'<-,v`3;_)I9M^AE]CN?Cl2AZg+%4iTpT3$U4O]GKx'm9)b@p7YsvK3w^YR-" - "CdQ*:Ir<($u&)#(&?L9Rg3H)4fiEp^iI9O8KnTj,]H?D*r7'M;PwZ9K0E^k&-cpI;.p/6_vwoFMV<->#%Xi.LxVnrU(4&8/P+:hLSKj$#U%]49t'I:rgMi'FL@a:0Y-uA[39',(vbma*" - "hU%<-SRF`Tt:542R_VV$p@[p8DV[A,?1839FWdFTi1O*H&#(AL8[_P%.M>v^-))qOT*F5Cq0`Ye%+$B6i:7@0IXSsDiWP,##P`%/L-" - "S(qw%sf/@%#B6;/U7K]uZbi^Oc^2n%t<)'mEVE''n`WnJra$^TKvX5B>;_aSEK',(hwa0:i4G?.Bci.(X[?b*($,=-n<.Q%`(X=?+@Am*Js0&=3bh8K]mL69=Lb,OcZV/);TTm8VI;?%OtJ<(b4mq7M6:u?KRdFl*:xP?Yb.5)%w_I?7uk5JC+FS(m#i'k.'a0i)9<7b'fs'59hq$*5Uhv##pi^8+hIEBF`nvo`;'l0.^S1<-wUK2/Coh58KKhLj" - "M=SO*rfO`+qC`W-On.=AJ56>>i2@2LH6A:&5q`?9I3@@'04&p2/LVa*T-4<-i3;M9UvZd+N7>b*eIwg:CC)c<>nO&#$(>.Z-I&J(Q0Hd5Q%7Co-b`-cP)hI;*_F]u`Rb[.j8_Q/<&>uu+VsH$sM9TA%?)(vmJ80),P7E>)tjD%2L=-t#fK[%`v=Q8WlA2);Sa" - ">gXm8YB`1d@K#n]76-a$U,mF%Ul:#/'xoFM9QX-$.QN'>" - "[%$Z$uF6pA6Ki2O5:8w*vP1<-1`[G,)-m#>0`P&#eb#.3i)rtB61(o'$?X3B2Qft^ae_5tKL9MUe9b*sLEQ95C&`=G?@Mj=wh*'3E>=-<)Gt*Iw)'QG:`@I" - "wOf7&]1i'S01B+Ev/Nac#9S;=;YQpg_6U`*kVY39xK,[/6Aj7:'1Bm-_1EYfa1+o&o4hp7KN_Q(OlIo@S%;jVdn0'1h19w,WQhLI)3S#f$2(eb,jr*b;3Vw]*7NH%$c4Vs,eD9>XW8?N]o+(*pgC%/72LV-uW%iewS8W6m2rtCpo'RS1R84=@paTKt)>=%&1[)*vp'u+x,VrwN;&]kuO9JDbg=pO$J*.jVe;u'm0dr9l,<*wMK*Oe=g8lV_KEBFkO'oU]^=[-792#ok,)" - "i]lR8qQ2oA8wcRCZ^7w/Njh;?.stX?Q1>S1q4Bn$)K1<-rGdO'$Wr.Lc.CG)$/*JL4tNR/,SVO3,aUw'DJN:)Ss;wGn9A32ijw%FL+Z0Fn.U9;reSq)bmI32U==5ALuG&#Vf1398/pVo" - "1*c-(aY168o<`JsSbk-,1N;$>0:OUas(3:8Z972LSfF8eb=c-;>SPw7.6hn3m`9^Xkn(r.qS[0;T%&Qc=+STRxX'q1BNk3&*eu2;&8q$&x>Q#Q7^Tf+6<(d%ZVmj2bDi%.3L2n+4W'$P" - "iDDG)g,r%+?,$@?uou5tSe2aN_AQU*'IAO" - "URQ##V^Fv-XFbGM7Fl(N<3DhLGF%q.1rC$#:T__&Pi68%0xi_&[qFJ(77j_&JWoF.V735&T,[R*:xFR*K5>>#`bW-?4Ne_&6Ne_&6Ne_&n`kr-#GJcM6X;uM6X;uM(.a..^2TkL%oR(#" - ";u.T%fAr%4tJ8&><1=GHZ_+m9/#H1F^R#SC#*N=BA9(D?v[UiFY>>^8p,KKF.W]L29uLkLlu/+4T" - "w$)F./^n3+rlo+DB;5sIYGNk+i1t-69Jg--0pao7Sm#K)pdHW&;LuDNH@H>#/X-TI(;P>#,Gc>#0Su>#4`1?#8lC?#xL$#B.`$#F:r$#JF.%#NR@%#R_R%#Vke%#Zww%#_-4^Rh%Sflr-k'MS.o?.5/sWel/wpEM0%3'/1)K^f1-d>G21&v(35>V`39V7A4=onx4" - "A1OY5EI0;6Ibgr6M$HS7Q<)58C5w,;WoA*#[%T*#`1g*#d=#+#hI5+#lUG+#pbY+#tnl+#x$),#&1;,#*=M,#.I`,#2Ur,#6b.-#;w[H#iQtA#m^0B#qjBB#uvTB##-hB#'9$C#+E6C#" - "/QHC#3^ZC#7jmC#;v)D#?,)4kMYD4lVu`4m`:&5niUA5@(A5BA1]PBB:xlBCC=2CDLXMCEUtiCf&0g2'tN?PGT4CPGT4CPGT4CPGT4CPGT4CPGT4CPGT4CP" - "GT4CPGT4CPGT4CPGT4CPGT4CPGT4CP-qekC`.9kEg^+F$kwViFJTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5o,^<-28ZI'O?;xp" - "O?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xp;7q-#lLYI:xvD=#"; - -#endif /* NK_INCLUDE_DEFAULT_FONT */ - -#define NK_CURSOR_DATA_W 90 -#define NK_CURSOR_DATA_H 27 -NK_GLOBAL const char nk_custom_cursor_data[NK_CURSOR_DATA_W * NK_CURSOR_DATA_H + 1] = -{ - "..- -XXXXXXX- X - X -XXXXXXX - XXXXXXX" - "..- -X.....X- X.X - X.X -X.....X - X.....X" - "--- -XXX.XXX- X...X - X...X -X....X - X....X" - "X - X.X - X.....X - X.....X -X...X - X...X" - "XX - X.X -X.......X- X.......X -X..X.X - X.X..X" - "X.X - X.X -XXXX.XXXX- XXXX.XXXX -X.X X.X - X.X X.X" - "X..X - X.X - X.X - X.X -XX X.X - X.X XX" - "X...X - X.X - X.X - XX X.X XX - X.X - X.X " - "X....X - X.X - X.X - X.X X.X X.X - X.X - X.X " - "X.....X - X.X - X.X - X..X X.X X..X - X.X - X.X " - "X......X - X.X - X.X - X...XXXXXX.XXXXXX...X - X.X XX-XX X.X " - "X.......X - X.X - X.X -X.....................X- X.X X.X-X.X X.X " - "X........X - X.X - X.X - X...XXXXXX.XXXXXX...X - X.X..X-X..X.X " - "X.........X -XXX.XXX- X.X - X..X X.X X..X - X...X-X...X " - "X..........X-X.....X- X.X - X.X X.X X.X - X....X-X....X " - "X......XXXXX-XXXXXXX- X.X - XX X.X XX - X.....X-X.....X " - "X...X..X --------- X.X - X.X - XXXXXXX-XXXXXXX " - "X..X X..X - -XXXX.XXXX- XXXX.XXXX ------------------------------------" - "X.X X..X - -X.......X- X.......X - XX XX - " - "XX X..X - - X.....X - X.....X - X.X X.X - " - " X..X - X...X - X...X - X..X X..X - " - " XX - X.X - X.X - X...XXXXXXXXXXXXX...X - " - "------------ - X - X -X.....................X- " - " ----------------------------------- X...XXXXXXXXXXXXX...X - " - " - X..X X..X - " - " - X.X X.X - " - " - XX XX - " -}; - -#ifdef __clang__ -#pragma clang diagnostic pop -#elif defined(__GNUC__) || defined(__GNUG__) -#pragma GCC diagnostic pop -#endif - -NK_GLOBAL unsigned char *nk__barrier; -NK_GLOBAL unsigned char *nk__barrier2; -NK_GLOBAL unsigned char *nk__barrier3; -NK_GLOBAL unsigned char *nk__barrier4; -NK_GLOBAL unsigned char *nk__dout; - -NK_INTERN unsigned int -nk_decompress_length(unsigned char *input) -{ - return (unsigned int)((input[8] << 24) + (input[9] << 16) + (input[10] << 8) + input[11]); -} -NK_INTERN void -nk__match(unsigned char *data, unsigned int length) -{ - /* INVERSE of memmove... write each byte before copying the next...*/ - NK_ASSERT (nk__dout + length <= nk__barrier); - if (nk__dout + length > nk__barrier) { nk__dout += length; return; } - if (data < nk__barrier4) { nk__dout = nk__barrier+1; return; } - while (length--) *nk__dout++ = *data++; -} -NK_INTERN void -nk__lit(unsigned char *data, unsigned int length) -{ - NK_ASSERT (nk__dout + length <= nk__barrier); - if (nk__dout + length > nk__barrier) { nk__dout += length; return; } - if (data < nk__barrier2) { nk__dout = nk__barrier+1; return; } - NK_MEMCPY(nk__dout, data, length); - nk__dout += length; -} -NK_INTERN unsigned char* -nk_decompress_token(unsigned char *i) -{ - #define nk__in2(x) ((i[x] << 8) + i[(x)+1]) - #define nk__in3(x) ((i[x] << 16) + nk__in2((x)+1)) - #define nk__in4(x) ((i[x] << 24) + nk__in3((x)+1)) - - if (*i >= 0x20) { /* use fewer if's for cases that expand small */ - if (*i >= 0x80) nk__match(nk__dout-i[1]-1, (unsigned int)i[0] - 0x80 + 1), i += 2; - else if (*i >= 0x40) nk__match(nk__dout-(nk__in2(0) - 0x4000 + 1), (unsigned int)i[2]+1), i += 3; - else /* *i >= 0x20 */ nk__lit(i+1, (unsigned int)i[0] - 0x20 + 1), i += 1 + (i[0] - 0x20 + 1); - } else { /* more ifs for cases that expand large, since overhead is amortized */ - if (*i >= 0x18) nk__match(nk__dout-(unsigned int)(nk__in3(0) - 0x180000 + 1), (unsigned int)i[3]+1), i += 4; - else if (*i >= 0x10) nk__match(nk__dout-(unsigned int)(nk__in3(0) - 0x100000 + 1), (unsigned int)nk__in2(3)+1), i += 5; - else if (*i >= 0x08) nk__lit(i+2, (unsigned int)nk__in2(0) - 0x0800 + 1), i += 2 + (nk__in2(0) - 0x0800 + 1); - else if (*i == 0x07) nk__lit(i+3, (unsigned int)nk__in2(1) + 1), i += 3 + (nk__in2(1) + 1); - else if (*i == 0x06) nk__match(nk__dout-(unsigned int)(nk__in3(1)+1), i[4]+1u), i += 5; - else if (*i == 0x04) nk__match(nk__dout-(unsigned int)(nk__in3(1)+1), (unsigned int)nk__in2(4)+1u), i += 6; - } - return i; -} -NK_INTERN unsigned int -nk_adler32(unsigned int adler32, unsigned char *buffer, unsigned int buflen) -{ - const unsigned long ADLER_MOD = 65521; - unsigned long s1 = adler32 & 0xffff, s2 = adler32 >> 16; - unsigned long blocklen, i; - - blocklen = buflen % 5552; - while (buflen) { - for (i=0; i + 7 < blocklen; i += 8) { - s1 += buffer[0]; s2 += s1; - s1 += buffer[1]; s2 += s1; - s1 += buffer[2]; s2 += s1; - s1 += buffer[3]; s2 += s1; - s1 += buffer[4]; s2 += s1; - s1 += buffer[5]; s2 += s1; - s1 += buffer[6]; s2 += s1; - s1 += buffer[7]; s2 += s1; - buffer += 8; - } - for (; i < blocklen; ++i) { - s1 += *buffer++; s2 += s1; - } - - s1 %= ADLER_MOD; s2 %= ADLER_MOD; - buflen -= (unsigned int)blocklen; - blocklen = 5552; - } - return (unsigned int)(s2 << 16) + (unsigned int)s1; -} -NK_INTERN unsigned int -nk_decompress(unsigned char *output, unsigned char *i, unsigned int length) -{ - unsigned int olen; - if (nk__in4(0) != 0x57bC0000) return 0; - if (nk__in4(4) != 0) return 0; /* error! stream is > 4GB */ - olen = nk_decompress_length(i); - nk__barrier2 = i; - nk__barrier3 = i+length; - nk__barrier = output + olen; - nk__barrier4 = output; - i += 16; - - nk__dout = output; - for (;;) { - unsigned char *old_i = i; - i = nk_decompress_token(i); - if (i == old_i) { - if (*i == 0x05 && i[1] == 0xfa) { - NK_ASSERT(nk__dout == output + olen); - if (nk__dout != output + olen) return 0; - if (nk_adler32(1, output, olen) != (unsigned int) nk__in4(2)) - return 0; - return olen; - } else { - NK_ASSERT(0); /* NOTREACHED */ - return 0; - } - } - NK_ASSERT(nk__dout <= output + olen); - if (nk__dout > output + olen) - return 0; - } -} -NK_INTERN unsigned int -nk_decode_85_byte(char c) -{ - return (unsigned int)((c >= '\\') ? c-36 : c-35); -} -NK_INTERN void -nk_decode_85(unsigned char* dst, const unsigned char* src) -{ - while (*src) - { - unsigned int tmp = - nk_decode_85_byte((char)src[0]) + - 85 * (nk_decode_85_byte((char)src[1]) + - 85 * (nk_decode_85_byte((char)src[2]) + - 85 * (nk_decode_85_byte((char)src[3]) + - 85 * nk_decode_85_byte((char)src[4])))); - - /* we can't assume little-endianess. */ - dst[0] = (unsigned char)((tmp >> 0) & 0xFF); - dst[1] = (unsigned char)((tmp >> 8) & 0xFF); - dst[2] = (unsigned char)((tmp >> 16) & 0xFF); - dst[3] = (unsigned char)((tmp >> 24) & 0xFF); - - src += 5; - dst += 4; - } -} - -/* ------------------------------------------------------------- - * - * FONT ATLAS - * - * --------------------------------------------------------------*/ -NK_API struct nk_font_config -nk_font_config(float pixel_height) -{ - struct nk_font_config cfg; - nk_zero_struct(cfg); - cfg.ttf_blob = 0; - cfg.ttf_size = 0; - cfg.ttf_data_owned_by_atlas = 0; - cfg.size = pixel_height; - cfg.oversample_h = 3; - cfg.oversample_v = 1; - cfg.pixel_snap = 0; - cfg.coord_type = NK_COORD_UV; - cfg.spacing = nk_vec2(0,0); - cfg.range = nk_font_default_glyph_ranges(); - cfg.merge_mode = 0; - cfg.fallback_glyph = '?'; - cfg.font = 0; - cfg.n = 0; - return cfg; -} -#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR -NK_API void -nk_font_atlas_init_default(struct nk_font_atlas *atlas) -{ - NK_ASSERT(atlas); - if (!atlas) return; - nk_zero_struct(*atlas); - atlas->temporary.userdata.ptr = 0; - atlas->temporary.alloc = nk_malloc; - atlas->temporary.free = nk_mfree; - atlas->permanent.userdata.ptr = 0; - atlas->permanent.alloc = nk_malloc; - atlas->permanent.free = nk_mfree; -} -#endif -NK_API void -nk_font_atlas_init(struct nk_font_atlas *atlas, struct nk_allocator *alloc) -{ - NK_ASSERT(atlas); - NK_ASSERT(alloc); - if (!atlas || !alloc) return; - nk_zero_struct(*atlas); - atlas->permanent = *alloc; - atlas->temporary = *alloc; -} -NK_API void -nk_font_atlas_init_custom(struct nk_font_atlas *atlas, - struct nk_allocator *permanent, struct nk_allocator *temporary) -{ - NK_ASSERT(atlas); - NK_ASSERT(permanent); - NK_ASSERT(temporary); - if (!atlas || !permanent || !temporary) return; - nk_zero_struct(*atlas); - atlas->permanent = *permanent; - atlas->temporary = *temporary; -} -NK_API void -nk_font_atlas_begin(struct nk_font_atlas *atlas) -{ - NK_ASSERT(atlas); - NK_ASSERT(atlas->temporary.alloc && atlas->temporary.free); - NK_ASSERT(atlas->permanent.alloc && atlas->permanent.free); - if (!atlas || !atlas->permanent.alloc || !atlas->permanent.free || - !atlas->temporary.alloc || !atlas->temporary.free) return; - if (atlas->glyphs) { - atlas->permanent.free(atlas->permanent.userdata, atlas->glyphs); - atlas->glyphs = 0; - } - if (atlas->pixel) { - atlas->permanent.free(atlas->permanent.userdata, atlas->pixel); - atlas->pixel = 0; - } -} -NK_API struct nk_font* -nk_font_atlas_add(struct nk_font_atlas *atlas, const struct nk_font_config *config) -{ - struct nk_font *font = 0; - struct nk_font_config *cfg; - - NK_ASSERT(atlas); - NK_ASSERT(atlas->permanent.alloc); - NK_ASSERT(atlas->permanent.free); - NK_ASSERT(atlas->temporary.alloc); - NK_ASSERT(atlas->temporary.free); - - NK_ASSERT(config); - NK_ASSERT(config->ttf_blob); - NK_ASSERT(config->ttf_size); - NK_ASSERT(config->size > 0.0f); - - if (!atlas || !config || !config->ttf_blob || !config->ttf_size || config->size <= 0.0f|| - !atlas->permanent.alloc || !atlas->permanent.free || - !atlas->temporary.alloc || !atlas->temporary.free) - return 0; - - /* allocate font config */ - cfg = (struct nk_font_config*) - atlas->permanent.alloc(atlas->permanent.userdata,0, sizeof(struct nk_font_config)); - NK_MEMCPY(cfg, config, sizeof(*config)); - cfg->n = cfg; - cfg->p = cfg; - - if (!config->merge_mode) { - /* insert font config into list */ - if (!atlas->config) { - atlas->config = cfg; - cfg->next = 0; - } else { - struct nk_font_config *i = atlas->config; - while (i->next) i = i->next; - i->next = cfg; - cfg->next = 0; - } - /* allocate new font */ - font = (struct nk_font*) - atlas->permanent.alloc(atlas->permanent.userdata,0, sizeof(struct nk_font)); - NK_ASSERT(font); - nk_zero(font, sizeof(*font)); - if (!font) return 0; - font->config = cfg; - - /* insert font into list */ - if (!atlas->fonts) { - atlas->fonts = font; - font->next = 0; - } else { - struct nk_font *i = atlas->fonts; - while (i->next) i = i->next; - i->next = font; - font->next = 0; - } - cfg->font = &font->info; - } else { - /* extend previously added font */ - struct nk_font *f = 0; - struct nk_font_config *c = 0; - NK_ASSERT(atlas->font_num); - f = atlas->fonts; - c = f->config; - cfg->font = &f->info; - - cfg->n = c; - cfg->p = c->p; - c->p->n = cfg; - c->p = cfg; - } - /* create own copy of .TTF font blob */ - if (!config->ttf_data_owned_by_atlas) { - cfg->ttf_blob = atlas->permanent.alloc(atlas->permanent.userdata,0, cfg->ttf_size); - NK_ASSERT(cfg->ttf_blob); - if (!cfg->ttf_blob) { - atlas->font_num++; - return 0; - } - NK_MEMCPY(cfg->ttf_blob, config->ttf_blob, cfg->ttf_size); - cfg->ttf_data_owned_by_atlas = 1; - } - atlas->font_num++; - return font; -} -NK_API struct nk_font* -nk_font_atlas_add_from_memory(struct nk_font_atlas *atlas, void *memory, - nk_size size, float height, const struct nk_font_config *config) -{ - struct nk_font_config cfg; - NK_ASSERT(memory); - NK_ASSERT(size); - - NK_ASSERT(atlas); - NK_ASSERT(atlas->temporary.alloc); - NK_ASSERT(atlas->temporary.free); - NK_ASSERT(atlas->permanent.alloc); - NK_ASSERT(atlas->permanent.free); - if (!atlas || !atlas->temporary.alloc || !atlas->temporary.free || !memory || !size || - !atlas->permanent.alloc || !atlas->permanent.free) - return 0; - - cfg = (config) ? *config: nk_font_config(height); - cfg.ttf_blob = memory; - cfg.ttf_size = size; - cfg.size = height; - cfg.ttf_data_owned_by_atlas = 0; - return nk_font_atlas_add(atlas, &cfg); -} -#ifdef NK_INCLUDE_STANDARD_IO -NK_API struct nk_font* -nk_font_atlas_add_from_file(struct nk_font_atlas *atlas, const char *file_path, - float height, const struct nk_font_config *config) -{ - nk_size size; - char *memory; - struct nk_font_config cfg; - - NK_ASSERT(atlas); - NK_ASSERT(atlas->temporary.alloc); - NK_ASSERT(atlas->temporary.free); - NK_ASSERT(atlas->permanent.alloc); - NK_ASSERT(atlas->permanent.free); - - if (!atlas || !file_path) return 0; - memory = nk_file_load(file_path, &size, &atlas->permanent); - if (!memory) return 0; - - cfg = (config) ? *config: nk_font_config(height); - cfg.ttf_blob = memory; - cfg.ttf_size = size; - cfg.size = height; - cfg.ttf_data_owned_by_atlas = 1; - return nk_font_atlas_add(atlas, &cfg); -} -#endif -NK_API struct nk_font* -nk_font_atlas_add_compressed(struct nk_font_atlas *atlas, - void *compressed_data, nk_size compressed_size, float height, - const struct nk_font_config *config) -{ - unsigned int decompressed_size; - void *decompressed_data; - struct nk_font_config cfg; - - NK_ASSERT(atlas); - NK_ASSERT(atlas->temporary.alloc); - NK_ASSERT(atlas->temporary.free); - NK_ASSERT(atlas->permanent.alloc); - NK_ASSERT(atlas->permanent.free); - - NK_ASSERT(compressed_data); - NK_ASSERT(compressed_size); - if (!atlas || !compressed_data || !atlas->temporary.alloc || !atlas->temporary.free || - !atlas->permanent.alloc || !atlas->permanent.free) - return 0; - - decompressed_size = nk_decompress_length((unsigned char*)compressed_data); - decompressed_data = atlas->permanent.alloc(atlas->permanent.userdata,0,decompressed_size); - NK_ASSERT(decompressed_data); - if (!decompressed_data) return 0; - nk_decompress((unsigned char*)decompressed_data, (unsigned char*)compressed_data, - (unsigned int)compressed_size); - - cfg = (config) ? *config: nk_font_config(height); - cfg.ttf_blob = decompressed_data; - cfg.ttf_size = decompressed_size; - cfg.size = height; - cfg.ttf_data_owned_by_atlas = 1; - return nk_font_atlas_add(atlas, &cfg); -} -NK_API struct nk_font* -nk_font_atlas_add_compressed_base85(struct nk_font_atlas *atlas, - const char *data_base85, float height, const struct nk_font_config *config) -{ - int compressed_size; - void *compressed_data; - struct nk_font *font; - - NK_ASSERT(atlas); - NK_ASSERT(atlas->temporary.alloc); - NK_ASSERT(atlas->temporary.free); - NK_ASSERT(atlas->permanent.alloc); - NK_ASSERT(atlas->permanent.free); - - NK_ASSERT(data_base85); - if (!atlas || !data_base85 || !atlas->temporary.alloc || !atlas->temporary.free || - !atlas->permanent.alloc || !atlas->permanent.free) - return 0; - - compressed_size = (((int)nk_strlen(data_base85) + 4) / 5) * 4; - compressed_data = atlas->temporary.alloc(atlas->temporary.userdata,0, (nk_size)compressed_size); - NK_ASSERT(compressed_data); - if (!compressed_data) return 0; - nk_decode_85((unsigned char*)compressed_data, (const unsigned char*)data_base85); - font = nk_font_atlas_add_compressed(atlas, compressed_data, - (nk_size)compressed_size, height, config); - atlas->temporary.free(atlas->temporary.userdata, compressed_data); - return font; -} - -#ifdef NK_INCLUDE_DEFAULT_FONT -NK_API struct nk_font* -nk_font_atlas_add_default(struct nk_font_atlas *atlas, - float pixel_height, const struct nk_font_config *config) -{ - NK_ASSERT(atlas); - NK_ASSERT(atlas->temporary.alloc); - NK_ASSERT(atlas->temporary.free); - NK_ASSERT(atlas->permanent.alloc); - NK_ASSERT(atlas->permanent.free); - return nk_font_atlas_add_compressed_base85(atlas, - nk_proggy_clean_ttf_compressed_data_base85, pixel_height, config); -} -#endif -NK_API const void* -nk_font_atlas_bake(struct nk_font_atlas *atlas, int *width, int *height, - enum nk_font_atlas_format fmt) -{ - int i = 0; - void *tmp = 0; - nk_size tmp_size, img_size; - struct nk_font *font_iter; - struct nk_font_baker *baker; - - NK_ASSERT(atlas); - NK_ASSERT(atlas->temporary.alloc); - NK_ASSERT(atlas->temporary.free); - NK_ASSERT(atlas->permanent.alloc); - NK_ASSERT(atlas->permanent.free); - - NK_ASSERT(width); - NK_ASSERT(height); - if (!atlas || !width || !height || - !atlas->temporary.alloc || !atlas->temporary.free || - !atlas->permanent.alloc || !atlas->permanent.free) - return 0; - -#ifdef NK_INCLUDE_DEFAULT_FONT - /* no font added so just use default font */ - if (!atlas->font_num) - atlas->default_font = nk_font_atlas_add_default(atlas, 13.0f, 0); -#endif - NK_ASSERT(atlas->font_num); - if (!atlas->font_num) return 0; - - /* allocate temporary baker memory required for the baking process */ - nk_font_baker_memory(&tmp_size, &atlas->glyph_count, atlas->config, atlas->font_num); - tmp = atlas->temporary.alloc(atlas->temporary.userdata,0, tmp_size); - NK_ASSERT(tmp); - if (!tmp) goto failed; - - /* allocate glyph memory for all fonts */ - baker = nk_font_baker(tmp, atlas->glyph_count, atlas->font_num, &atlas->temporary); - atlas->glyphs = (struct nk_font_glyph*)atlas->permanent.alloc( - atlas->permanent.userdata,0, sizeof(struct nk_font_glyph)*(nk_size)atlas->glyph_count); - NK_ASSERT(atlas->glyphs); - if (!atlas->glyphs) - goto failed; - - /* pack all glyphs into a tight fit space */ - atlas->custom.w = (NK_CURSOR_DATA_W*2)+1; - atlas->custom.h = NK_CURSOR_DATA_H + 1; - if (!nk_font_bake_pack(baker, &img_size, width, height, &atlas->custom, - atlas->config, atlas->font_num, &atlas->temporary)) - goto failed; - - /* allocate memory for the baked image font atlas */ - atlas->pixel = atlas->temporary.alloc(atlas->temporary.userdata,0, img_size); - NK_ASSERT(atlas->pixel); - if (!atlas->pixel) - goto failed; - - /* bake glyphs and custom white pixel into image */ - nk_font_bake(baker, atlas->pixel, *width, *height, - atlas->glyphs, atlas->glyph_count, atlas->config, atlas->font_num); - nk_font_bake_custom_data(atlas->pixel, *width, *height, atlas->custom, - nk_custom_cursor_data, NK_CURSOR_DATA_W, NK_CURSOR_DATA_H, '.', 'X'); - - if (fmt == NK_FONT_ATLAS_RGBA32) { - /* convert alpha8 image into rgba32 image */ - void *img_rgba = atlas->temporary.alloc(atlas->temporary.userdata,0, - (nk_size)(*width * *height * 4)); - NK_ASSERT(img_rgba); - if (!img_rgba) goto failed; - nk_font_bake_convert(img_rgba, *width, *height, atlas->pixel); - atlas->temporary.free(atlas->temporary.userdata, atlas->pixel); - atlas->pixel = img_rgba; - } - atlas->tex_width = *width; - atlas->tex_height = *height; - - /* initialize each font */ - for (font_iter = atlas->fonts; font_iter; font_iter = font_iter->next) { - struct nk_font *font = font_iter; - struct nk_font_config *config = font->config; - nk_font_init(font, config->size, config->fallback_glyph, atlas->glyphs, - config->font, nk_handle_ptr(0)); - } - - /* initialize each cursor */ - {NK_STORAGE const struct nk_vec2 nk_cursor_data[NK_CURSOR_COUNT][3] = { - /* Pos Size Offset */ - {{ 0, 3}, {12,19}, { 0, 0}}, - {{13, 0}, { 7,16}, { 4, 8}}, - {{31, 0}, {23,23}, {11,11}}, - {{21, 0}, { 9, 23}, { 5,11}}, - {{55,18}, {23, 9}, {11, 5}}, - {{73, 0}, {17,17}, { 9, 9}}, - {{55, 0}, {17,17}, { 9, 9}} - }; - for (i = 0; i < NK_CURSOR_COUNT; ++i) { - struct nk_cursor *cursor = &atlas->cursors[i]; - cursor->img.w = (unsigned short)*width; - cursor->img.h = (unsigned short)*height; - cursor->img.region[0] = (unsigned short)(atlas->custom.x + nk_cursor_data[i][0].x); - cursor->img.region[1] = (unsigned short)(atlas->custom.y + nk_cursor_data[i][0].y); - cursor->img.region[2] = (unsigned short)nk_cursor_data[i][1].x; - cursor->img.region[3] = (unsigned short)nk_cursor_data[i][1].y; - cursor->size = nk_cursor_data[i][1]; - cursor->offset = nk_cursor_data[i][2]; - }} - /* free temporary memory */ - atlas->temporary.free(atlas->temporary.userdata, tmp); - return atlas->pixel; - -failed: - /* error so cleanup all memory */ - if (tmp) atlas->temporary.free(atlas->temporary.userdata, tmp); - if (atlas->glyphs) { - atlas->permanent.free(atlas->permanent.userdata, atlas->glyphs); - atlas->glyphs = 0; - } - if (atlas->pixel) { - atlas->temporary.free(atlas->temporary.userdata, atlas->pixel); - atlas->pixel = 0; - } - return 0; -} -NK_API void -nk_font_atlas_end(struct nk_font_atlas *atlas, nk_handle texture, - struct nk_draw_null_texture *null) -{ - int i = 0; - struct nk_font *font_iter; - NK_ASSERT(atlas); - if (!atlas) { - if (!null) return; - null->texture = texture; - null->uv = nk_vec2(0.5f,0.5f); - } - if (null) { - null->texture = texture; - null->uv.x = (atlas->custom.x + 0.5f)/(float)atlas->tex_width; - null->uv.y = (atlas->custom.y + 0.5f)/(float)atlas->tex_height; - } - for (font_iter = atlas->fonts; font_iter; font_iter = font_iter->next) { - font_iter->texture = texture; -#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT - font_iter->handle.texture = texture; -#endif - } - for (i = 0; i < NK_CURSOR_COUNT; ++i) - atlas->cursors[i].img.handle = texture; - - atlas->temporary.free(atlas->temporary.userdata, atlas->pixel); - atlas->pixel = 0; - atlas->tex_width = 0; - atlas->tex_height = 0; - atlas->custom.x = 0; - atlas->custom.y = 0; - atlas->custom.w = 0; - atlas->custom.h = 0; -} -NK_API void -nk_font_atlas_cleanup(struct nk_font_atlas *atlas) -{ - NK_ASSERT(atlas); - NK_ASSERT(atlas->temporary.alloc); - NK_ASSERT(atlas->temporary.free); - NK_ASSERT(atlas->permanent.alloc); - NK_ASSERT(atlas->permanent.free); - if (!atlas || !atlas->permanent.alloc || !atlas->permanent.free) return; - if (atlas->config) { - struct nk_font_config *iter; - for (iter = atlas->config; iter; iter = iter->next) { - struct nk_font_config *i; - for (i = iter->n; i != iter; i = i->n) { - atlas->permanent.free(atlas->permanent.userdata, i->ttf_blob); - i->ttf_blob = 0; - } - atlas->permanent.free(atlas->permanent.userdata, iter->ttf_blob); - iter->ttf_blob = 0; - } - } -} -NK_API void -nk_font_atlas_clear(struct nk_font_atlas *atlas) -{ - NK_ASSERT(atlas); - NK_ASSERT(atlas->temporary.alloc); - NK_ASSERT(atlas->temporary.free); - NK_ASSERT(atlas->permanent.alloc); - NK_ASSERT(atlas->permanent.free); - if (!atlas || !atlas->permanent.alloc || !atlas->permanent.free) return; - - if (atlas->config) { - struct nk_font_config *iter, *next; - for (iter = atlas->config; iter; iter = next) { - struct nk_font_config *i, *n; - for (i = iter->n; i != iter; i = n) { - n = i->n; - if (i->ttf_blob) - atlas->permanent.free(atlas->permanent.userdata, i->ttf_blob); - atlas->permanent.free(atlas->permanent.userdata, i); - } - next = iter->next; - if (i->ttf_blob) - atlas->permanent.free(atlas->permanent.userdata, iter->ttf_blob); - atlas->permanent.free(atlas->permanent.userdata, iter); - } - atlas->config = 0; - } - if (atlas->fonts) { - struct nk_font *iter, *next; - for (iter = atlas->fonts; iter; iter = next) { - next = iter->next; - atlas->permanent.free(atlas->permanent.userdata, iter); - } - atlas->fonts = 0; - } - if (atlas->glyphs) - atlas->permanent.free(atlas->permanent.userdata, atlas->glyphs); - nk_zero_struct(*atlas); -} -#endif - - - - - -/* =============================================================== - * - * INPUT - * - * ===============================================================*/ -NK_API void -nk_input_begin(struct nk_context *ctx) -{ - int i; - struct nk_input *in; - NK_ASSERT(ctx); - if (!ctx) return; - in = &ctx->input; - for (i = 0; i < NK_BUTTON_MAX; ++i) - in->mouse.buttons[i].clicked = 0; - - in->keyboard.text_len = 0; - in->mouse.scroll_delta = nk_vec2(0,0); - in->mouse.prev.x = in->mouse.pos.x; - in->mouse.prev.y = in->mouse.pos.y; - in->mouse.delta.x = 0; - in->mouse.delta.y = 0; - for (i = 0; i < NK_KEY_MAX; i++) - in->keyboard.keys[i].clicked = 0; -} -NK_API void -nk_input_end(struct nk_context *ctx) -{ - struct nk_input *in; - NK_ASSERT(ctx); - if (!ctx) return; - in = &ctx->input; - if (in->mouse.grab) - in->mouse.grab = 0; - if (in->mouse.ungrab) { - in->mouse.grabbed = 0; - in->mouse.ungrab = 0; - in->mouse.grab = 0; - } -} -NK_API void -nk_input_motion(struct nk_context *ctx, int x, int y) -{ - struct nk_input *in; - NK_ASSERT(ctx); - if (!ctx) return; - in = &ctx->input; - in->mouse.pos.x = (float)x; - in->mouse.pos.y = (float)y; - in->mouse.delta.x = in->mouse.pos.x - in->mouse.prev.x; - in->mouse.delta.y = in->mouse.pos.y - in->mouse.prev.y; -} -NK_API void -nk_input_key(struct nk_context *ctx, enum nk_keys key, int down) -{ - struct nk_input *in; - NK_ASSERT(ctx); - if (!ctx) return; - in = &ctx->input; -#ifdef NK_KEYSTATE_BASED_INPUT - if (in->keyboard.keys[key].down != down) - in->keyboard.keys[key].clicked++; -#else - in->keyboard.keys[key].clicked++; -#endif - in->keyboard.keys[key].down = down; -} -NK_API void -nk_input_button(struct nk_context *ctx, enum nk_buttons id, int x, int y, int down) -{ - struct nk_mouse_button *btn; - struct nk_input *in; - NK_ASSERT(ctx); - if (!ctx) return; - in = &ctx->input; - if (in->mouse.buttons[id].down == down) return; - - btn = &in->mouse.buttons[id]; - btn->clicked_pos.x = (float)x; - btn->clicked_pos.y = (float)y; - btn->down = down; - btn->clicked++; -} -NK_API void -nk_input_scroll(struct nk_context *ctx, struct nk_vec2 val) -{ - NK_ASSERT(ctx); - if (!ctx) return; - ctx->input.mouse.scroll_delta.x += val.x; - ctx->input.mouse.scroll_delta.y += val.y; -} -NK_API void -nk_input_glyph(struct nk_context *ctx, const nk_glyph glyph) -{ - int len = 0; - nk_rune unicode; - struct nk_input *in; - - NK_ASSERT(ctx); - if (!ctx) return; - in = &ctx->input; - - len = nk_utf_decode(glyph, &unicode, NK_UTF_SIZE); - if (len && ((in->keyboard.text_len + len) < NK_INPUT_MAX)) { - nk_utf_encode(unicode, &in->keyboard.text[in->keyboard.text_len], - NK_INPUT_MAX - in->keyboard.text_len); - in->keyboard.text_len += len; - } -} -NK_API void -nk_input_char(struct nk_context *ctx, char c) -{ - nk_glyph glyph; - NK_ASSERT(ctx); - if (!ctx) return; - glyph[0] = c; - nk_input_glyph(ctx, glyph); -} -NK_API void -nk_input_unicode(struct nk_context *ctx, nk_rune unicode) -{ - nk_glyph rune; - NK_ASSERT(ctx); - if (!ctx) return; - nk_utf_encode(unicode, rune, NK_UTF_SIZE); - nk_input_glyph(ctx, rune); -} -NK_API int -nk_input_has_mouse_click(const struct nk_input *i, enum nk_buttons id) -{ - const struct nk_mouse_button *btn; - if (!i) return nk_false; - btn = &i->mouse.buttons[id]; - return (btn->clicked && btn->down == nk_false) ? nk_true : nk_false; -} -NK_API int -nk_input_has_mouse_click_in_rect(const struct nk_input *i, enum nk_buttons id, - struct nk_rect b) -{ - const struct nk_mouse_button *btn; - if (!i) return nk_false; - btn = &i->mouse.buttons[id]; - if (!NK_INBOX(btn->clicked_pos.x,btn->clicked_pos.y,b.x,b.y,b.w,b.h)) - return nk_false; - return nk_true; -} -NK_API int -nk_input_has_mouse_click_down_in_rect(const struct nk_input *i, enum nk_buttons id, - struct nk_rect b, int down) -{ - const struct nk_mouse_button *btn; - if (!i) return nk_false; - btn = &i->mouse.buttons[id]; - return nk_input_has_mouse_click_in_rect(i, id, b) && (btn->down == down); -} -NK_API int -nk_input_is_mouse_click_in_rect(const struct nk_input *i, enum nk_buttons id, - struct nk_rect b) -{ - const struct nk_mouse_button *btn; - if (!i) return nk_false; - btn = &i->mouse.buttons[id]; - return (nk_input_has_mouse_click_down_in_rect(i, id, b, nk_false) && - btn->clicked) ? nk_true : nk_false; -} -NK_API int -nk_input_is_mouse_click_down_in_rect(const struct nk_input *i, enum nk_buttons id, - struct nk_rect b, int down) -{ - const struct nk_mouse_button *btn; - if (!i) return nk_false; - btn = &i->mouse.buttons[id]; - return (nk_input_has_mouse_click_down_in_rect(i, id, b, down) && - btn->clicked) ? nk_true : nk_false; -} -NK_API int -nk_input_any_mouse_click_in_rect(const struct nk_input *in, struct nk_rect b) -{ - int i, down = 0; - for (i = 0; i < NK_BUTTON_MAX; ++i) - down = down || nk_input_is_mouse_click_in_rect(in, (enum nk_buttons)i, b); - return down; -} -NK_API int -nk_input_is_mouse_hovering_rect(const struct nk_input *i, struct nk_rect rect) -{ - if (!i) return nk_false; - return NK_INBOX(i->mouse.pos.x, i->mouse.pos.y, rect.x, rect.y, rect.w, rect.h); -} -NK_API int -nk_input_is_mouse_prev_hovering_rect(const struct nk_input *i, struct nk_rect rect) -{ - if (!i) return nk_false; - return NK_INBOX(i->mouse.prev.x, i->mouse.prev.y, rect.x, rect.y, rect.w, rect.h); -} -NK_API int -nk_input_mouse_clicked(const struct nk_input *i, enum nk_buttons id, struct nk_rect rect) -{ - if (!i) return nk_false; - if (!nk_input_is_mouse_hovering_rect(i, rect)) return nk_false; - return nk_input_is_mouse_click_in_rect(i, id, rect); -} -NK_API int -nk_input_is_mouse_down(const struct nk_input *i, enum nk_buttons id) -{ - if (!i) return nk_false; - return i->mouse.buttons[id].down; -} -NK_API int -nk_input_is_mouse_pressed(const struct nk_input *i, enum nk_buttons id) -{ - const struct nk_mouse_button *b; - if (!i) return nk_false; - b = &i->mouse.buttons[id]; - if (b->down && b->clicked) - return nk_true; - return nk_false; -} -NK_API int -nk_input_is_mouse_released(const struct nk_input *i, enum nk_buttons id) -{ - if (!i) return nk_false; - return (!i->mouse.buttons[id].down && i->mouse.buttons[id].clicked); -} -NK_API int -nk_input_is_key_pressed(const struct nk_input *i, enum nk_keys key) -{ - const struct nk_key *k; - if (!i) return nk_false; - k = &i->keyboard.keys[key]; - if ((k->down && k->clicked) || (!k->down && k->clicked >= 2)) - return nk_true; - return nk_false; -} -NK_API int -nk_input_is_key_released(const struct nk_input *i, enum nk_keys key) -{ - const struct nk_key *k; - if (!i) return nk_false; - k = &i->keyboard.keys[key]; - if ((!k->down && k->clicked) || (k->down && k->clicked >= 2)) - return nk_true; - return nk_false; -} -NK_API int -nk_input_is_key_down(const struct nk_input *i, enum nk_keys key) -{ - const struct nk_key *k; - if (!i) return nk_false; - k = &i->keyboard.keys[key]; - if (k->down) return nk_true; - return nk_false; -} - - - - - -/* =============================================================== - * - * STYLE - * - * ===============================================================*/ -NK_API void nk_style_default(struct nk_context *ctx){nk_style_from_table(ctx, 0);} -#define NK_COLOR_MAP(NK_COLOR)\ - NK_COLOR(NK_COLOR_TEXT, 175,175,175,255) \ - NK_COLOR(NK_COLOR_WINDOW, 45, 45, 45, 255) \ - NK_COLOR(NK_COLOR_HEADER, 40, 40, 40, 255) \ - NK_COLOR(NK_COLOR_BORDER, 65, 65, 65, 255) \ - NK_COLOR(NK_COLOR_BUTTON, 50, 50, 50, 255) \ - NK_COLOR(NK_COLOR_BUTTON_HOVER, 40, 40, 40, 255) \ - NK_COLOR(NK_COLOR_BUTTON_ACTIVE, 35, 35, 35, 255) \ - NK_COLOR(NK_COLOR_TOGGLE, 100,100,100,255) \ - NK_COLOR(NK_COLOR_TOGGLE_HOVER, 120,120,120,255) \ - NK_COLOR(NK_COLOR_TOGGLE_CURSOR, 45, 45, 45, 255) \ - NK_COLOR(NK_COLOR_SELECT, 45, 45, 45, 255) \ - NK_COLOR(NK_COLOR_SELECT_ACTIVE, 35, 35, 35,255) \ - NK_COLOR(NK_COLOR_SLIDER, 38, 38, 38, 255) \ - NK_COLOR(NK_COLOR_SLIDER_CURSOR, 100,100,100,255) \ - NK_COLOR(NK_COLOR_SLIDER_CURSOR_HOVER, 120,120,120,255) \ - NK_COLOR(NK_COLOR_SLIDER_CURSOR_ACTIVE, 150,150,150,255) \ - NK_COLOR(NK_COLOR_PROPERTY, 38, 38, 38, 255) \ - NK_COLOR(NK_COLOR_EDIT, 38, 38, 38, 255) \ - NK_COLOR(NK_COLOR_EDIT_CURSOR, 175,175,175,255) \ - NK_COLOR(NK_COLOR_COMBO, 45, 45, 45, 255) \ - NK_COLOR(NK_COLOR_CHART, 120,120,120,255) \ - NK_COLOR(NK_COLOR_CHART_COLOR, 45, 45, 45, 255) \ - NK_COLOR(NK_COLOR_CHART_COLOR_HIGHLIGHT, 255, 0, 0, 255) \ - NK_COLOR(NK_COLOR_SCROLLBAR, 40, 40, 40, 255) \ - NK_COLOR(NK_COLOR_SCROLLBAR_CURSOR, 100,100,100,255) \ - NK_COLOR(NK_COLOR_SCROLLBAR_CURSOR_HOVER, 120,120,120,255) \ - NK_COLOR(NK_COLOR_SCROLLBAR_CURSOR_ACTIVE, 150,150,150,255) \ - NK_COLOR(NK_COLOR_TAB_HEADER, 40, 40, 40,255) - -NK_GLOBAL const struct nk_color -nk_default_color_style[NK_COLOR_COUNT] = { -#define NK_COLOR(a,b,c,d,e) {b,c,d,e}, - NK_COLOR_MAP(NK_COLOR) -#undef NK_COLOR -}; -NK_GLOBAL const char *nk_color_names[NK_COLOR_COUNT] = { -#define NK_COLOR(a,b,c,d,e) #a, - NK_COLOR_MAP(NK_COLOR) -#undef NK_COLOR -}; - -NK_API const char* -nk_style_get_color_by_name(enum nk_style_colors c) -{ - return nk_color_names[c]; -} -NK_API struct nk_style_item -nk_style_item_image(struct nk_image img) -{ - struct nk_style_item i; - i.type = NK_STYLE_ITEM_IMAGE; - i.data.image = img; - return i; -} -NK_API struct nk_style_item -nk_style_item_color(struct nk_color col) -{ - struct nk_style_item i; - i.type = NK_STYLE_ITEM_COLOR; - i.data.color = col; - return i; -} -NK_API struct nk_style_item -nk_style_item_hide(void) -{ - struct nk_style_item i; - i.type = NK_STYLE_ITEM_COLOR; - i.data.color = nk_rgba(0,0,0,0); - return i; -} -NK_API void -nk_style_from_table(struct nk_context *ctx, const struct nk_color *table) -{ - struct nk_style *style; - struct nk_style_text *text; - struct nk_style_button *button; - struct nk_style_toggle *toggle; - struct nk_style_selectable *select; - struct nk_style_slider *slider; - struct nk_style_progress *prog; - struct nk_style_scrollbar *scroll; - struct nk_style_edit *edit; - struct nk_style_property *property; - struct nk_style_combo *combo; - struct nk_style_chart *chart; - struct nk_style_tab *tab; - struct nk_style_window *win; - - NK_ASSERT(ctx); - if (!ctx) return; - style = &ctx->style; - table = (!table) ? nk_default_color_style: table; - - /* default text */ - text = &style->text; - text->color = table[NK_COLOR_TEXT]; - text->padding = nk_vec2(0,0); - - /* default button */ - button = &style->button; - nk_zero_struct(*button); - button->normal = nk_style_item_color(table[NK_COLOR_BUTTON]); - button->hover = nk_style_item_color(table[NK_COLOR_BUTTON_HOVER]); - button->active = nk_style_item_color(table[NK_COLOR_BUTTON_ACTIVE]); - button->border_color = table[NK_COLOR_BORDER]; - button->text_background = table[NK_COLOR_BUTTON]; - button->text_normal = table[NK_COLOR_TEXT]; - button->text_hover = table[NK_COLOR_TEXT]; - button->text_active = table[NK_COLOR_TEXT]; - button->padding = nk_vec2(2.0f,2.0f); - button->image_padding = nk_vec2(0.0f,0.0f); - button->touch_padding = nk_vec2(0.0f, 0.0f); - button->userdata = nk_handle_ptr(0); - button->text_alignment = NK_TEXT_CENTERED; - button->border = 1.0f; - button->rounding = 4.0f; - button->draw_begin = 0; - button->draw_end = 0; - - /* contextual button */ - button = &style->contextual_button; - nk_zero_struct(*button); - button->normal = nk_style_item_color(table[NK_COLOR_WINDOW]); - button->hover = nk_style_item_color(table[NK_COLOR_BUTTON_HOVER]); - button->active = nk_style_item_color(table[NK_COLOR_BUTTON_ACTIVE]); - button->border_color = table[NK_COLOR_WINDOW]; - button->text_background = table[NK_COLOR_WINDOW]; - button->text_normal = table[NK_COLOR_TEXT]; - button->text_hover = table[NK_COLOR_TEXT]; - button->text_active = table[NK_COLOR_TEXT]; - button->padding = nk_vec2(2.0f,2.0f); - button->touch_padding = nk_vec2(0.0f,0.0f); - button->userdata = nk_handle_ptr(0); - button->text_alignment = NK_TEXT_CENTERED; - button->border = 0.0f; - button->rounding = 0.0f; - button->draw_begin = 0; - button->draw_end = 0; - - /* menu button */ - button = &style->menu_button; - nk_zero_struct(*button); - button->normal = nk_style_item_color(table[NK_COLOR_WINDOW]); - button->hover = nk_style_item_color(table[NK_COLOR_WINDOW]); - button->active = nk_style_item_color(table[NK_COLOR_WINDOW]); - button->border_color = table[NK_COLOR_WINDOW]; - button->text_background = table[NK_COLOR_WINDOW]; - button->text_normal = table[NK_COLOR_TEXT]; - button->text_hover = table[NK_COLOR_TEXT]; - button->text_active = table[NK_COLOR_TEXT]; - button->padding = nk_vec2(2.0f,2.0f); - button->touch_padding = nk_vec2(0.0f,0.0f); - button->userdata = nk_handle_ptr(0); - button->text_alignment = NK_TEXT_CENTERED; - button->border = 0.0f; - button->rounding = 1.0f; - button->draw_begin = 0; - button->draw_end = 0; - - /* checkbox toggle */ - toggle = &style->checkbox; - nk_zero_struct(*toggle); - toggle->normal = nk_style_item_color(table[NK_COLOR_TOGGLE]); - toggle->hover = nk_style_item_color(table[NK_COLOR_TOGGLE_HOVER]); - toggle->active = nk_style_item_color(table[NK_COLOR_TOGGLE_HOVER]); - toggle->cursor_normal = nk_style_item_color(table[NK_COLOR_TOGGLE_CURSOR]); - toggle->cursor_hover = nk_style_item_color(table[NK_COLOR_TOGGLE_CURSOR]); - toggle->userdata = nk_handle_ptr(0); - toggle->text_background = table[NK_COLOR_WINDOW]; - toggle->text_normal = table[NK_COLOR_TEXT]; - toggle->text_hover = table[NK_COLOR_TEXT]; - toggle->text_active = table[NK_COLOR_TEXT]; - toggle->padding = nk_vec2(2.0f, 2.0f); - toggle->touch_padding = nk_vec2(0,0); - toggle->border_color = nk_rgba(0,0,0,0); - toggle->border = 0.0f; - toggle->spacing = 4; - - /* option toggle */ - toggle = &style->option; - nk_zero_struct(*toggle); - toggle->normal = nk_style_item_color(table[NK_COLOR_TOGGLE]); - toggle->hover = nk_style_item_color(table[NK_COLOR_TOGGLE_HOVER]); - toggle->active = nk_style_item_color(table[NK_COLOR_TOGGLE_HOVER]); - toggle->cursor_normal = nk_style_item_color(table[NK_COLOR_TOGGLE_CURSOR]); - toggle->cursor_hover = nk_style_item_color(table[NK_COLOR_TOGGLE_CURSOR]); - toggle->userdata = nk_handle_ptr(0); - toggle->text_background = table[NK_COLOR_WINDOW]; - toggle->text_normal = table[NK_COLOR_TEXT]; - toggle->text_hover = table[NK_COLOR_TEXT]; - toggle->text_active = table[NK_COLOR_TEXT]; - toggle->padding = nk_vec2(3.0f, 3.0f); - toggle->touch_padding = nk_vec2(0,0); - toggle->border_color = nk_rgba(0,0,0,0); - toggle->border = 0.0f; - toggle->spacing = 4; - - /* selectable */ - select = &style->selectable; - nk_zero_struct(*select); - select->normal = nk_style_item_color(table[NK_COLOR_SELECT]); - select->hover = nk_style_item_color(table[NK_COLOR_SELECT]); - select->pressed = nk_style_item_color(table[NK_COLOR_SELECT]); - select->normal_active = nk_style_item_color(table[NK_COLOR_SELECT_ACTIVE]); - select->hover_active = nk_style_item_color(table[NK_COLOR_SELECT_ACTIVE]); - select->pressed_active = nk_style_item_color(table[NK_COLOR_SELECT_ACTIVE]); - select->text_normal = table[NK_COLOR_TEXT]; - select->text_hover = table[NK_COLOR_TEXT]; - select->text_pressed = table[NK_COLOR_TEXT]; - select->text_normal_active = table[NK_COLOR_TEXT]; - select->text_hover_active = table[NK_COLOR_TEXT]; - select->text_pressed_active = table[NK_COLOR_TEXT]; - select->padding = nk_vec2(2.0f,2.0f); - select->image_padding = nk_vec2(2.0f,2.0f); - select->touch_padding = nk_vec2(0,0); - select->userdata = nk_handle_ptr(0); - select->rounding = 0.0f; - select->draw_begin = 0; - select->draw_end = 0; - - /* slider */ - slider = &style->slider; - nk_zero_struct(*slider); - slider->normal = nk_style_item_hide(); - slider->hover = nk_style_item_hide(); - slider->active = nk_style_item_hide(); - slider->bar_normal = table[NK_COLOR_SLIDER]; - slider->bar_hover = table[NK_COLOR_SLIDER]; - slider->bar_active = table[NK_COLOR_SLIDER]; - slider->bar_filled = table[NK_COLOR_SLIDER_CURSOR]; - slider->cursor_normal = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR]); - slider->cursor_hover = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR_HOVER]); - slider->cursor_active = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR_ACTIVE]); - slider->inc_symbol = NK_SYMBOL_TRIANGLE_RIGHT; - slider->dec_symbol = NK_SYMBOL_TRIANGLE_LEFT; - slider->cursor_size = nk_vec2(16,16); - slider->padding = nk_vec2(2,2); - slider->spacing = nk_vec2(2,2); - slider->userdata = nk_handle_ptr(0); - slider->show_buttons = nk_false; - slider->bar_height = 8; - slider->rounding = 0; - slider->draw_begin = 0; - slider->draw_end = 0; - - /* slider buttons */ - button = &style->slider.inc_button; - button->normal = nk_style_item_color(nk_rgb(40,40,40)); - button->hover = nk_style_item_color(nk_rgb(42,42,42)); - button->active = nk_style_item_color(nk_rgb(44,44,44)); - button->border_color = nk_rgb(65,65,65); - button->text_background = nk_rgb(40,40,40); - button->text_normal = nk_rgb(175,175,175); - button->text_hover = nk_rgb(175,175,175); - button->text_active = nk_rgb(175,175,175); - button->padding = nk_vec2(8.0f,8.0f); - button->touch_padding = nk_vec2(0.0f,0.0f); - button->userdata = nk_handle_ptr(0); - button->text_alignment = NK_TEXT_CENTERED; - button->border = 1.0f; - button->rounding = 0.0f; - button->draw_begin = 0; - button->draw_end = 0; - style->slider.dec_button = style->slider.inc_button; - - /* progressbar */ - prog = &style->progress; - nk_zero_struct(*prog); - prog->normal = nk_style_item_color(table[NK_COLOR_SLIDER]); - prog->hover = nk_style_item_color(table[NK_COLOR_SLIDER]); - prog->active = nk_style_item_color(table[NK_COLOR_SLIDER]); - prog->cursor_normal = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR]); - prog->cursor_hover = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR_HOVER]); - prog->cursor_active = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR_ACTIVE]); - prog->border_color = nk_rgba(0,0,0,0); - prog->cursor_border_color = nk_rgba(0,0,0,0); - prog->userdata = nk_handle_ptr(0); - prog->padding = nk_vec2(4,4); - prog->rounding = 0; - prog->border = 0; - prog->cursor_rounding = 0; - prog->cursor_border = 0; - prog->draw_begin = 0; - prog->draw_end = 0; - - /* scrollbars */ - scroll = &style->scrollh; - nk_zero_struct(*scroll); - scroll->normal = nk_style_item_color(table[NK_COLOR_SCROLLBAR]); - scroll->hover = nk_style_item_color(table[NK_COLOR_SCROLLBAR]); - scroll->active = nk_style_item_color(table[NK_COLOR_SCROLLBAR]); - scroll->cursor_normal = nk_style_item_color(table[NK_COLOR_SCROLLBAR_CURSOR]); - scroll->cursor_hover = nk_style_item_color(table[NK_COLOR_SCROLLBAR_CURSOR_HOVER]); - scroll->cursor_active = nk_style_item_color(table[NK_COLOR_SCROLLBAR_CURSOR_ACTIVE]); - scroll->dec_symbol = NK_SYMBOL_CIRCLE_SOLID; - scroll->inc_symbol = NK_SYMBOL_CIRCLE_SOLID; - scroll->userdata = nk_handle_ptr(0); - scroll->border_color = table[NK_COLOR_SCROLLBAR]; - scroll->cursor_border_color = table[NK_COLOR_SCROLLBAR]; - scroll->padding = nk_vec2(0,0); - scroll->show_buttons = nk_false; - scroll->border = 0; - scroll->rounding = 0; - scroll->border_cursor = 0; - scroll->rounding_cursor = 0; - scroll->draw_begin = 0; - scroll->draw_end = 0; - style->scrollv = style->scrollh; - - /* scrollbars buttons */ - button = &style->scrollh.inc_button; - button->normal = nk_style_item_color(nk_rgb(40,40,40)); - button->hover = nk_style_item_color(nk_rgb(42,42,42)); - button->active = nk_style_item_color(nk_rgb(44,44,44)); - button->border_color = nk_rgb(65,65,65); - button->text_background = nk_rgb(40,40,40); - button->text_normal = nk_rgb(175,175,175); - button->text_hover = nk_rgb(175,175,175); - button->text_active = nk_rgb(175,175,175); - button->padding = nk_vec2(4.0f,4.0f); - button->touch_padding = nk_vec2(0.0f,0.0f); - button->userdata = nk_handle_ptr(0); - button->text_alignment = NK_TEXT_CENTERED; - button->border = 1.0f; - button->rounding = 0.0f; - button->draw_begin = 0; - button->draw_end = 0; - style->scrollh.dec_button = style->scrollh.inc_button; - style->scrollv.inc_button = style->scrollh.inc_button; - style->scrollv.dec_button = style->scrollh.inc_button; - - /* edit */ - edit = &style->edit; - nk_zero_struct(*edit); - edit->normal = nk_style_item_color(table[NK_COLOR_EDIT]); - edit->hover = nk_style_item_color(table[NK_COLOR_EDIT]); - edit->active = nk_style_item_color(table[NK_COLOR_EDIT]); - edit->cursor_normal = table[NK_COLOR_TEXT]; - edit->cursor_hover = table[NK_COLOR_TEXT]; - edit->cursor_text_normal= table[NK_COLOR_EDIT]; - edit->cursor_text_hover = table[NK_COLOR_EDIT]; - edit->border_color = table[NK_COLOR_BORDER]; - edit->text_normal = table[NK_COLOR_TEXT]; - edit->text_hover = table[NK_COLOR_TEXT]; - edit->text_active = table[NK_COLOR_TEXT]; - edit->selected_normal = table[NK_COLOR_TEXT]; - edit->selected_hover = table[NK_COLOR_TEXT]; - edit->selected_text_normal = table[NK_COLOR_EDIT]; - edit->selected_text_hover = table[NK_COLOR_EDIT]; - edit->scrollbar_size = nk_vec2(10,10); - edit->scrollbar = style->scrollv; - edit->padding = nk_vec2(4,4); - edit->row_padding = 2; - edit->cursor_size = 4; - edit->border = 1; - edit->rounding = 0; - - /* property */ - property = &style->property; - nk_zero_struct(*property); - property->normal = nk_style_item_color(table[NK_COLOR_PROPERTY]); - property->hover = nk_style_item_color(table[NK_COLOR_PROPERTY]); - property->active = nk_style_item_color(table[NK_COLOR_PROPERTY]); - property->border_color = table[NK_COLOR_BORDER]; - property->label_normal = table[NK_COLOR_TEXT]; - property->label_hover = table[NK_COLOR_TEXT]; - property->label_active = table[NK_COLOR_TEXT]; - property->sym_left = NK_SYMBOL_TRIANGLE_LEFT; - property->sym_right = NK_SYMBOL_TRIANGLE_RIGHT; - property->userdata = nk_handle_ptr(0); - property->padding = nk_vec2(4,4); - property->border = 1; - property->rounding = 10; - property->draw_begin = 0; - property->draw_end = 0; - - /* property buttons */ - button = &style->property.dec_button; - nk_zero_struct(*button); - button->normal = nk_style_item_color(table[NK_COLOR_PROPERTY]); - button->hover = nk_style_item_color(table[NK_COLOR_PROPERTY]); - button->active = nk_style_item_color(table[NK_COLOR_PROPERTY]); - button->border_color = nk_rgba(0,0,0,0); - button->text_background = table[NK_COLOR_PROPERTY]; - button->text_normal = table[NK_COLOR_TEXT]; - button->text_hover = table[NK_COLOR_TEXT]; - button->text_active = table[NK_COLOR_TEXT]; - button->padding = nk_vec2(0.0f,0.0f); - button->touch_padding = nk_vec2(0.0f,0.0f); - button->userdata = nk_handle_ptr(0); - button->text_alignment = NK_TEXT_CENTERED; - button->border = 0.0f; - button->rounding = 0.0f; - button->draw_begin = 0; - button->draw_end = 0; - style->property.inc_button = style->property.dec_button; - - /* property edit */ - edit = &style->property.edit; - nk_zero_struct(*edit); - edit->normal = nk_style_item_color(table[NK_COLOR_PROPERTY]); - edit->hover = nk_style_item_color(table[NK_COLOR_PROPERTY]); - edit->active = nk_style_item_color(table[NK_COLOR_PROPERTY]); - edit->border_color = nk_rgba(0,0,0,0); - edit->cursor_normal = table[NK_COLOR_TEXT]; - edit->cursor_hover = table[NK_COLOR_TEXT]; - edit->cursor_text_normal= table[NK_COLOR_EDIT]; - edit->cursor_text_hover = table[NK_COLOR_EDIT]; - edit->text_normal = table[NK_COLOR_TEXT]; - edit->text_hover = table[NK_COLOR_TEXT]; - edit->text_active = table[NK_COLOR_TEXT]; - edit->selected_normal = table[NK_COLOR_TEXT]; - edit->selected_hover = table[NK_COLOR_TEXT]; - edit->selected_text_normal = table[NK_COLOR_EDIT]; - edit->selected_text_hover = table[NK_COLOR_EDIT]; - edit->padding = nk_vec2(0,0); - edit->cursor_size = 8; - edit->border = 0; - edit->rounding = 0; - - /* chart */ - chart = &style->chart; - nk_zero_struct(*chart); - chart->background = nk_style_item_color(table[NK_COLOR_CHART]); - chart->border_color = table[NK_COLOR_BORDER]; - chart->selected_color = table[NK_COLOR_CHART_COLOR_HIGHLIGHT]; - chart->color = table[NK_COLOR_CHART_COLOR]; - chart->padding = nk_vec2(4,4); - chart->border = 0; - chart->rounding = 0; - - /* combo */ - combo = &style->combo; - combo->normal = nk_style_item_color(table[NK_COLOR_COMBO]); - combo->hover = nk_style_item_color(table[NK_COLOR_COMBO]); - combo->active = nk_style_item_color(table[NK_COLOR_COMBO]); - combo->border_color = table[NK_COLOR_BORDER]; - combo->label_normal = table[NK_COLOR_TEXT]; - combo->label_hover = table[NK_COLOR_TEXT]; - combo->label_active = table[NK_COLOR_TEXT]; - combo->sym_normal = NK_SYMBOL_TRIANGLE_DOWN; - combo->sym_hover = NK_SYMBOL_TRIANGLE_DOWN; - combo->sym_active = NK_SYMBOL_TRIANGLE_DOWN; - combo->content_padding = nk_vec2(4,4); - combo->button_padding = nk_vec2(0,4); - combo->spacing = nk_vec2(4,0); - combo->border = 1; - combo->rounding = 0; - - /* combo button */ - button = &style->combo.button; - nk_zero_struct(*button); - button->normal = nk_style_item_color(table[NK_COLOR_COMBO]); - button->hover = nk_style_item_color(table[NK_COLOR_COMBO]); - button->active = nk_style_item_color(table[NK_COLOR_COMBO]); - button->border_color = nk_rgba(0,0,0,0); - button->text_background = table[NK_COLOR_COMBO]; - button->text_normal = table[NK_COLOR_TEXT]; - button->text_hover = table[NK_COLOR_TEXT]; - button->text_active = table[NK_COLOR_TEXT]; - button->padding = nk_vec2(2.0f,2.0f); - button->touch_padding = nk_vec2(0.0f,0.0f); - button->userdata = nk_handle_ptr(0); - button->text_alignment = NK_TEXT_CENTERED; - button->border = 0.0f; - button->rounding = 0.0f; - button->draw_begin = 0; - button->draw_end = 0; - - /* tab */ - tab = &style->tab; - tab->background = nk_style_item_color(table[NK_COLOR_TAB_HEADER]); - tab->border_color = table[NK_COLOR_BORDER]; - tab->text = table[NK_COLOR_TEXT]; - tab->sym_minimize = NK_SYMBOL_TRIANGLE_RIGHT; - tab->sym_maximize = NK_SYMBOL_TRIANGLE_DOWN; - tab->padding = nk_vec2(4,4); - tab->spacing = nk_vec2(4,4); - tab->indent = 10.0f; - tab->border = 1; - tab->rounding = 0; - - /* tab button */ - button = &style->tab.tab_minimize_button; - nk_zero_struct(*button); - button->normal = nk_style_item_color(table[NK_COLOR_TAB_HEADER]); - button->hover = nk_style_item_color(table[NK_COLOR_TAB_HEADER]); - button->active = nk_style_item_color(table[NK_COLOR_TAB_HEADER]); - button->border_color = nk_rgba(0,0,0,0); - button->text_background = table[NK_COLOR_TAB_HEADER]; - button->text_normal = table[NK_COLOR_TEXT]; - button->text_hover = table[NK_COLOR_TEXT]; - button->text_active = table[NK_COLOR_TEXT]; - button->padding = nk_vec2(2.0f,2.0f); - button->touch_padding = nk_vec2(0.0f,0.0f); - button->userdata = nk_handle_ptr(0); - button->text_alignment = NK_TEXT_CENTERED; - button->border = 0.0f; - button->rounding = 0.0f; - button->draw_begin = 0; - button->draw_end = 0; - style->tab.tab_maximize_button =*button; - - /* node button */ - button = &style->tab.node_minimize_button; - nk_zero_struct(*button); - button->normal = nk_style_item_color(table[NK_COLOR_WINDOW]); - button->hover = nk_style_item_color(table[NK_COLOR_WINDOW]); - button->active = nk_style_item_color(table[NK_COLOR_WINDOW]); - button->border_color = nk_rgba(0,0,0,0); - button->text_background = table[NK_COLOR_TAB_HEADER]; - button->text_normal = table[NK_COLOR_TEXT]; - button->text_hover = table[NK_COLOR_TEXT]; - button->text_active = table[NK_COLOR_TEXT]; - button->padding = nk_vec2(2.0f,2.0f); - button->touch_padding = nk_vec2(0.0f,0.0f); - button->userdata = nk_handle_ptr(0); - button->text_alignment = NK_TEXT_CENTERED; - button->border = 0.0f; - button->rounding = 0.0f; - button->draw_begin = 0; - button->draw_end = 0; - style->tab.node_maximize_button =*button; - - /* window header */ - win = &style->window; - win->header.align = NK_HEADER_RIGHT; - win->header.close_symbol = NK_SYMBOL_X; - win->header.minimize_symbol = NK_SYMBOL_MINUS; - win->header.maximize_symbol = NK_SYMBOL_PLUS; - win->header.normal = nk_style_item_color(table[NK_COLOR_HEADER]); - win->header.hover = nk_style_item_color(table[NK_COLOR_HEADER]); - win->header.active = nk_style_item_color(table[NK_COLOR_HEADER]); - win->header.label_normal = table[NK_COLOR_TEXT]; - win->header.label_hover = table[NK_COLOR_TEXT]; - win->header.label_active = table[NK_COLOR_TEXT]; - win->header.label_padding = nk_vec2(4,4); - win->header.padding = nk_vec2(4,4); - win->header.spacing = nk_vec2(0,0); - - /* window header close button */ - button = &style->window.header.close_button; - nk_zero_struct(*button); - button->normal = nk_style_item_color(table[NK_COLOR_HEADER]); - button->hover = nk_style_item_color(table[NK_COLOR_HEADER]); - button->active = nk_style_item_color(table[NK_COLOR_HEADER]); - button->border_color = nk_rgba(0,0,0,0); - button->text_background = table[NK_COLOR_HEADER]; - button->text_normal = table[NK_COLOR_TEXT]; - button->text_hover = table[NK_COLOR_TEXT]; - button->text_active = table[NK_COLOR_TEXT]; - button->padding = nk_vec2(0.0f,0.0f); - button->touch_padding = nk_vec2(0.0f,0.0f); - button->userdata = nk_handle_ptr(0); - button->text_alignment = NK_TEXT_CENTERED; - button->border = 0.0f; - button->rounding = 0.0f; - button->draw_begin = 0; - button->draw_end = 0; - - /* window header minimize button */ - button = &style->window.header.minimize_button; - nk_zero_struct(*button); - button->normal = nk_style_item_color(table[NK_COLOR_HEADER]); - button->hover = nk_style_item_color(table[NK_COLOR_HEADER]); - button->active = nk_style_item_color(table[NK_COLOR_HEADER]); - button->border_color = nk_rgba(0,0,0,0); - button->text_background = table[NK_COLOR_HEADER]; - button->text_normal = table[NK_COLOR_TEXT]; - button->text_hover = table[NK_COLOR_TEXT]; - button->text_active = table[NK_COLOR_TEXT]; - button->padding = nk_vec2(0.0f,0.0f); - button->touch_padding = nk_vec2(0.0f,0.0f); - button->userdata = nk_handle_ptr(0); - button->text_alignment = NK_TEXT_CENTERED; - button->border = 0.0f; - button->rounding = 0.0f; - button->draw_begin = 0; - button->draw_end = 0; - - /* window */ - win->background = table[NK_COLOR_WINDOW]; - win->fixed_background = nk_style_item_color(table[NK_COLOR_WINDOW]); - win->border_color = table[NK_COLOR_BORDER]; - win->popup_border_color = table[NK_COLOR_BORDER]; - win->combo_border_color = table[NK_COLOR_BORDER]; - win->contextual_border_color = table[NK_COLOR_BORDER]; - win->menu_border_color = table[NK_COLOR_BORDER]; - win->group_border_color = table[NK_COLOR_BORDER]; - win->tooltip_border_color = table[NK_COLOR_BORDER]; - win->scaler = nk_style_item_color(table[NK_COLOR_TEXT]); - - win->rounding = 0.0f; - win->spacing = nk_vec2(4,4); - win->scrollbar_size = nk_vec2(10,10); - win->min_size = nk_vec2(64,64); - - win->combo_border = 1.0f; - win->contextual_border = 1.0f; - win->menu_border = 1.0f; - win->group_border = 1.0f; - win->tooltip_border = 1.0f; - win->popup_border = 1.0f; - win->border = 2.0f; - win->min_row_height_padding = 8; - - win->padding = nk_vec2(4,4); - win->group_padding = nk_vec2(4,4); - win->popup_padding = nk_vec2(4,4); - win->combo_padding = nk_vec2(4,4); - win->contextual_padding = nk_vec2(4,4); - win->menu_padding = nk_vec2(4,4); - win->tooltip_padding = nk_vec2(4,4); -} -NK_API void -nk_style_set_font(struct nk_context *ctx, const struct nk_user_font *font) -{ - struct nk_style *style; - NK_ASSERT(ctx); - - if (!ctx) return; - style = &ctx->style; - style->font = font; - ctx->stacks.fonts.head = 0; - if (ctx->current) - nk_layout_reset_min_row_height(ctx); -} -NK_API int -nk_style_push_font(struct nk_context *ctx, const struct nk_user_font *font) -{ - struct nk_config_stack_user_font *font_stack; - struct nk_config_stack_user_font_element *element; - - NK_ASSERT(ctx); - if (!ctx) return 0; - - font_stack = &ctx->stacks.fonts; - NK_ASSERT(font_stack->head < (int)NK_LEN(font_stack->elements)); - if (font_stack->head >= (int)NK_LEN(font_stack->elements)) - return 0; - - element = &font_stack->elements[font_stack->head++]; - element->address = &ctx->style.font; - element->old_value = ctx->style.font; - ctx->style.font = font; - return 1; -} -NK_API int -nk_style_pop_font(struct nk_context *ctx) -{ - struct nk_config_stack_user_font *font_stack; - struct nk_config_stack_user_font_element *element; - - NK_ASSERT(ctx); - if (!ctx) return 0; - - font_stack = &ctx->stacks.fonts; - NK_ASSERT(font_stack->head > 0); - if (font_stack->head < 1) - return 0; - - element = &font_stack->elements[--font_stack->head]; - *element->address = element->old_value; - return 1; -} -#define NK_STYLE_PUSH_IMPLEMENATION(prefix, type, stack) \ -nk_style_push_##type(struct nk_context *ctx, prefix##_##type *address, prefix##_##type value)\ -{\ - struct nk_config_stack_##type * type_stack;\ - struct nk_config_stack_##type##_element *element;\ - NK_ASSERT(ctx);\ - if (!ctx) return 0;\ - type_stack = &ctx->stacks.stack;\ - NK_ASSERT(type_stack->head < (int)NK_LEN(type_stack->elements));\ - if (type_stack->head >= (int)NK_LEN(type_stack->elements))\ - return 0;\ - element = &type_stack->elements[type_stack->head++];\ - element->address = address;\ - element->old_value = *address;\ - *address = value;\ - return 1;\ -} -#define NK_STYLE_POP_IMPLEMENATION(type, stack) \ -nk_style_pop_##type(struct nk_context *ctx)\ -{\ - struct nk_config_stack_##type *type_stack;\ - struct nk_config_stack_##type##_element *element;\ - NK_ASSERT(ctx);\ - if (!ctx) return 0;\ - type_stack = &ctx->stacks.stack;\ - NK_ASSERT(type_stack->head > 0);\ - if (type_stack->head < 1)\ - return 0;\ - element = &type_stack->elements[--type_stack->head];\ - *element->address = element->old_value;\ - return 1;\ -} -NK_API int NK_STYLE_PUSH_IMPLEMENATION(struct nk, style_item, style_items) -NK_API int NK_STYLE_PUSH_IMPLEMENATION(nk,float, floats) -NK_API int NK_STYLE_PUSH_IMPLEMENATION(struct nk, vec2, vectors) -NK_API int NK_STYLE_PUSH_IMPLEMENATION(nk,flags, flags) -NK_API int NK_STYLE_PUSH_IMPLEMENATION(struct nk,color, colors) - -NK_API int NK_STYLE_POP_IMPLEMENATION(style_item, style_items) -NK_API int NK_STYLE_POP_IMPLEMENATION(float,floats) -NK_API int NK_STYLE_POP_IMPLEMENATION(vec2, vectors) -NK_API int NK_STYLE_POP_IMPLEMENATION(flags,flags) -NK_API int NK_STYLE_POP_IMPLEMENATION(color,colors) - -NK_API int -nk_style_set_cursor(struct nk_context *ctx, enum nk_style_cursor c) -{ - struct nk_style *style; - NK_ASSERT(ctx); - if (!ctx) return 0; - style = &ctx->style; - if (style->cursors[c]) { - style->cursor_active = style->cursors[c]; - return 1; - } - return 0; -} -NK_API void -nk_style_show_cursor(struct nk_context *ctx) -{ - ctx->style.cursor_visible = nk_true; -} -NK_API void -nk_style_hide_cursor(struct nk_context *ctx) -{ - ctx->style.cursor_visible = nk_false; -} -NK_API void -nk_style_load_cursor(struct nk_context *ctx, enum nk_style_cursor cursor, - const struct nk_cursor *c) -{ - struct nk_style *style; - NK_ASSERT(ctx); - if (!ctx) return; - style = &ctx->style; - style->cursors[cursor] = c; -} -NK_API void -nk_style_load_all_cursors(struct nk_context *ctx, struct nk_cursor *cursors) -{ - int i = 0; - struct nk_style *style; - NK_ASSERT(ctx); - if (!ctx) return; - style = &ctx->style; - for (i = 0; i < NK_CURSOR_COUNT; ++i) - style->cursors[i] = &cursors[i]; - style->cursor_visible = nk_true; -} - - - - - -/* ============================================================== - * - * CONTEXT - * - * ===============================================================*/ -NK_INTERN void -nk_setup(struct nk_context *ctx, const struct nk_user_font *font) -{ - NK_ASSERT(ctx); - if (!ctx) return; - nk_zero_struct(*ctx); - nk_style_default(ctx); - ctx->seq = 1; - if (font) ctx->style.font = font; -#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT - nk_draw_list_init(&ctx->draw_list); -#endif -} -#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR -NK_API int -nk_init_default(struct nk_context *ctx, const struct nk_user_font *font) -{ - struct nk_allocator alloc; - alloc.userdata.ptr = 0; - alloc.alloc = nk_malloc; - alloc.free = nk_mfree; - return nk_init(ctx, &alloc, font); -} -#endif -NK_API int -nk_init_fixed(struct nk_context *ctx, void *memory, nk_size size, - const struct nk_user_font *font) -{ - NK_ASSERT(memory); - if (!memory) return 0; - nk_setup(ctx, font); - nk_buffer_init_fixed(&ctx->memory, memory, size); - ctx->use_pool = nk_false; - return 1; -} -NK_API int -nk_init_custom(struct nk_context *ctx, struct nk_buffer *cmds, - struct nk_buffer *pool, const struct nk_user_font *font) -{ - NK_ASSERT(cmds); - NK_ASSERT(pool); - if (!cmds || !pool) return 0; - - nk_setup(ctx, font); - ctx->memory = *cmds; - if (pool->type == NK_BUFFER_FIXED) { - /* take memory from buffer and alloc fixed pool */ - nk_pool_init_fixed(&ctx->pool, pool->memory.ptr, pool->memory.size); - } else { - /* create dynamic pool from buffer allocator */ - struct nk_allocator *alloc = &pool->pool; - nk_pool_init(&ctx->pool, alloc, NK_POOL_DEFAULT_CAPACITY); - } - ctx->use_pool = nk_true; - return 1; -} -NK_API int -nk_init(struct nk_context *ctx, struct nk_allocator *alloc, - const struct nk_user_font *font) -{ - NK_ASSERT(alloc); - if (!alloc) return 0; - nk_setup(ctx, font); - nk_buffer_init(&ctx->memory, alloc, NK_DEFAULT_COMMAND_BUFFER_SIZE); - nk_pool_init(&ctx->pool, alloc, NK_POOL_DEFAULT_CAPACITY); - ctx->use_pool = nk_true; - return 1; -} -#ifdef NK_INCLUDE_COMMAND_USERDATA -NK_API void -nk_set_user_data(struct nk_context *ctx, nk_handle handle) -{ - if (!ctx) return; - ctx->userdata = handle; - if (ctx->current) - ctx->current->buffer.userdata = handle; -} -#endif -NK_API void -nk_free(struct nk_context *ctx) -{ - NK_ASSERT(ctx); - if (!ctx) return; - nk_buffer_free(&ctx->memory); - if (ctx->use_pool) - nk_pool_free(&ctx->pool); - - nk_zero(&ctx->input, sizeof(ctx->input)); - nk_zero(&ctx->style, sizeof(ctx->style)); - nk_zero(&ctx->memory, sizeof(ctx->memory)); - - ctx->seq = 0; - ctx->build = 0; - ctx->begin = 0; - ctx->end = 0; - ctx->active = 0; - ctx->current = 0; - ctx->freelist = 0; - ctx->count = 0; -} -NK_API void -nk_clear(struct nk_context *ctx) -{ - struct nk_window *iter; - struct nk_window *next; - NK_ASSERT(ctx); - - if (!ctx) return; - if (ctx->use_pool) - nk_buffer_clear(&ctx->memory); - else nk_buffer_reset(&ctx->memory, NK_BUFFER_FRONT); - - ctx->build = 0; - ctx->memory.calls = 0; - ctx->last_widget_state = 0; - ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_ARROW]; - NK_MEMSET(&ctx->overlay, 0, sizeof(ctx->overlay)); - - /* garbage collector */ - iter = ctx->begin; - while (iter) { - /* make sure valid minimized windows do not get removed */ - if ((iter->flags & NK_WINDOW_MINIMIZED) && - !(iter->flags & NK_WINDOW_CLOSED) && - iter->seq == ctx->seq) { - iter = iter->next; - continue; - } - /* remove hotness from hidden or closed windows*/ - if (((iter->flags & NK_WINDOW_HIDDEN) || - (iter->flags & NK_WINDOW_CLOSED)) && - iter == ctx->active) { - ctx->active = iter->prev; - ctx->end = iter->prev; - if (!ctx->end) - ctx->begin = 0; - if (ctx->active) - ctx->active->flags &= ~(unsigned)NK_WINDOW_ROM; - } - /* free unused popup windows */ - if (iter->popup.win && iter->popup.win->seq != ctx->seq) { - nk_free_window(ctx, iter->popup.win); - iter->popup.win = 0; - } - /* remove unused window state tables */ - {struct nk_table *n, *it = iter->tables; - while (it) { - n = it->next; - if (it->seq != ctx->seq) { - nk_remove_table(iter, it); - nk_zero(it, sizeof(union nk_page_data)); - nk_free_table(ctx, it); - if (it == iter->tables) - iter->tables = n; - } it = n; - }} - /* window itself is not used anymore so free */ - if (iter->seq != ctx->seq || iter->flags & NK_WINDOW_CLOSED) { - next = iter->next; - nk_remove_window(ctx, iter); - nk_free_window(ctx, iter); - iter = next; - } else iter = iter->next; - } - ctx->seq++; -} -NK_LIB void -nk_start_buffer(struct nk_context *ctx, struct nk_command_buffer *buffer) -{ - NK_ASSERT(ctx); - NK_ASSERT(buffer); - if (!ctx || !buffer) return; - buffer->begin = ctx->memory.allocated; - buffer->end = buffer->begin; - buffer->last = buffer->begin; - buffer->clip = nk_null_rect; -} -NK_LIB void -nk_start(struct nk_context *ctx, struct nk_window *win) -{ - NK_ASSERT(ctx); - NK_ASSERT(win); - nk_start_buffer(ctx, &win->buffer); -} -NK_LIB void -nk_start_popup(struct nk_context *ctx, struct nk_window *win) -{ - struct nk_popup_buffer *buf; - NK_ASSERT(ctx); - NK_ASSERT(win); - if (!ctx || !win) return; - - /* save buffer fill state for popup */ - buf = &win->popup.buf; - buf->begin = win->buffer.end; - buf->end = win->buffer.end; - buf->parent = win->buffer.last; - buf->last = buf->begin; - buf->active = nk_true; -} -NK_LIB void -nk_finish_popup(struct nk_context *ctx, struct nk_window *win) -{ - struct nk_popup_buffer *buf; - NK_ASSERT(ctx); - NK_ASSERT(win); - if (!ctx || !win) return; - - buf = &win->popup.buf; - buf->last = win->buffer.last; - buf->end = win->buffer.end; -} -NK_LIB void -nk_finish_buffer(struct nk_context *ctx, struct nk_command_buffer *buffer) -{ - NK_ASSERT(ctx); - NK_ASSERT(buffer); - if (!ctx || !buffer) return; - buffer->end = ctx->memory.allocated; -} -NK_LIB void -nk_finish(struct nk_context *ctx, struct nk_window *win) -{ - struct nk_popup_buffer *buf; - struct nk_command *parent_last; - void *memory; - - NK_ASSERT(ctx); - NK_ASSERT(win); - if (!ctx || !win) return; - nk_finish_buffer(ctx, &win->buffer); - if (!win->popup.buf.active) return; - - buf = &win->popup.buf; - memory = ctx->memory.memory.ptr; - parent_last = nk_ptr_add(struct nk_command, memory, buf->parent); - parent_last->next = buf->end; -} -NK_LIB void -nk_build(struct nk_context *ctx) -{ - struct nk_window *it = 0; - struct nk_command *cmd = 0; - nk_byte *buffer = 0; - - /* draw cursor overlay */ - if (!ctx->style.cursor_active) - ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_ARROW]; - if (ctx->style.cursor_active && !ctx->input.mouse.grabbed && ctx->style.cursor_visible) { - struct nk_rect mouse_bounds; - const struct nk_cursor *cursor = ctx->style.cursor_active; - nk_command_buffer_init(&ctx->overlay, &ctx->memory, NK_CLIPPING_OFF); - nk_start_buffer(ctx, &ctx->overlay); - - mouse_bounds.x = ctx->input.mouse.pos.x - cursor->offset.x; - mouse_bounds.y = ctx->input.mouse.pos.y - cursor->offset.y; - mouse_bounds.w = cursor->size.x; - mouse_bounds.h = cursor->size.y; - - nk_draw_image(&ctx->overlay, mouse_bounds, &cursor->img, nk_white); - nk_finish_buffer(ctx, &ctx->overlay); - } - /* build one big draw command list out of all window buffers */ - it = ctx->begin; - buffer = (nk_byte*)ctx->memory.memory.ptr; - while (it != 0) { - struct nk_window *next = it->next; - if (it->buffer.last == it->buffer.begin || (it->flags & NK_WINDOW_HIDDEN)|| - it->seq != ctx->seq) - goto cont; - - cmd = nk_ptr_add(struct nk_command, buffer, it->buffer.last); - while (next && ((next->buffer.last == next->buffer.begin) || - (next->flags & NK_WINDOW_HIDDEN) || next->seq != ctx->seq)) - next = next->next; /* skip empty command buffers */ - - if (next) cmd->next = next->buffer.begin; - cont: it = next; - } - /* append all popup draw commands into lists */ - it = ctx->begin; - while (it != 0) { - struct nk_window *next = it->next; - struct nk_popup_buffer *buf; - if (!it->popup.buf.active) - goto skip; - - buf = &it->popup.buf; - cmd->next = buf->begin; - cmd = nk_ptr_add(struct nk_command, buffer, buf->last); - buf->active = nk_false; - skip: it = next; - } - if (cmd) { - /* append overlay commands */ - if (ctx->overlay.end != ctx->overlay.begin) - cmd->next = ctx->overlay.begin; - else cmd->next = ctx->memory.allocated; - } -} -NK_API const struct nk_command* -nk__begin(struct nk_context *ctx) -{ - struct nk_window *iter; - nk_byte *buffer; - NK_ASSERT(ctx); - if (!ctx) return 0; - if (!ctx->count) return 0; - - buffer = (nk_byte*)ctx->memory.memory.ptr; - if (!ctx->build) { - nk_build(ctx); - ctx->build = nk_true; - } - iter = ctx->begin; - while (iter && ((iter->buffer.begin == iter->buffer.end) || - (iter->flags & NK_WINDOW_HIDDEN) || iter->seq != ctx->seq)) - iter = iter->next; - if (!iter) return 0; - return nk_ptr_add_const(struct nk_command, buffer, iter->buffer.begin); -} - -NK_API const struct nk_command* -nk__next(struct nk_context *ctx, const struct nk_command *cmd) -{ - nk_byte *buffer; - const struct nk_command *next; - NK_ASSERT(ctx); - if (!ctx || !cmd || !ctx->count) return 0; - if (cmd->next >= ctx->memory.allocated) return 0; - buffer = (nk_byte*)ctx->memory.memory.ptr; - next = nk_ptr_add_const(struct nk_command, buffer, cmd->next); - return next; -} - - - - - - -/* =============================================================== - * - * POOL - * - * ===============================================================*/ -NK_LIB void -nk_pool_init(struct nk_pool *pool, struct nk_allocator *alloc, - unsigned int capacity) -{ - nk_zero(pool, sizeof(*pool)); - pool->alloc = *alloc; - pool->capacity = capacity; - pool->type = NK_BUFFER_DYNAMIC; - pool->pages = 0; -} -NK_LIB void -nk_pool_free(struct nk_pool *pool) -{ - struct nk_page *iter = pool->pages; - if (!pool) return; - if (pool->type == NK_BUFFER_FIXED) return; - while (iter) { - struct nk_page *next = iter->next; - pool->alloc.free(pool->alloc.userdata, iter); - iter = next; - } -} -NK_LIB void -nk_pool_init_fixed(struct nk_pool *pool, void *memory, nk_size size) -{ - nk_zero(pool, sizeof(*pool)); - NK_ASSERT(size >= sizeof(struct nk_page)); - if (size < sizeof(struct nk_page)) return; - pool->capacity = (unsigned)(size - sizeof(struct nk_page)) / sizeof(struct nk_page_element); - pool->pages = (struct nk_page*)memory; - pool->type = NK_BUFFER_FIXED; - pool->size = size; -} -NK_LIB struct nk_page_element* -nk_pool_alloc(struct nk_pool *pool) -{ - if (!pool->pages || pool->pages->size >= pool->capacity) { - /* allocate new page */ - struct nk_page *page; - if (pool->type == NK_BUFFER_FIXED) { - NK_ASSERT(pool->pages); - if (!pool->pages) return 0; - NK_ASSERT(pool->pages->size < pool->capacity); - return 0; - } else { - nk_size size = sizeof(struct nk_page); - size += NK_POOL_DEFAULT_CAPACITY * sizeof(union nk_page_data); - page = (struct nk_page*)pool->alloc.alloc(pool->alloc.userdata,0, size); - page->next = pool->pages; - pool->pages = page; - page->size = 0; - } - } return &pool->pages->win[pool->pages->size++]; -} - - - - - -/* =============================================================== - * - * PAGE ELEMENT - * - * ===============================================================*/ -NK_LIB struct nk_page_element* -nk_create_page_element(struct nk_context *ctx) -{ - struct nk_page_element *elem; - if (ctx->freelist) { - /* unlink page element from free list */ - elem = ctx->freelist; - ctx->freelist = elem->next; - } else if (ctx->use_pool) { - /* allocate page element from memory pool */ - elem = nk_pool_alloc(&ctx->pool); - NK_ASSERT(elem); - if (!elem) return 0; - } else { - /* allocate new page element from back of fixed size memory buffer */ - NK_STORAGE const nk_size size = sizeof(struct nk_page_element); - NK_STORAGE const nk_size align = NK_ALIGNOF(struct nk_page_element); - elem = (struct nk_page_element*)nk_buffer_alloc(&ctx->memory, NK_BUFFER_BACK, size, align); - NK_ASSERT(elem); - if (!elem) return 0; - } - nk_zero_struct(*elem); - elem->next = 0; - elem->prev = 0; - return elem; -} -NK_LIB void -nk_link_page_element_into_freelist(struct nk_context *ctx, - struct nk_page_element *elem) -{ - /* link table into freelist */ - if (!ctx->freelist) { - ctx->freelist = elem; - } else { - elem->next = ctx->freelist; - ctx->freelist = elem; - } -} -NK_LIB void -nk_free_page_element(struct nk_context *ctx, struct nk_page_element *elem) -{ - /* we have a pool so just add to free list */ - if (ctx->use_pool) { - nk_link_page_element_into_freelist(ctx, elem); - return; - } - /* if possible remove last element from back of fixed memory buffer */ - {void *elem_end = (void*)(elem + 1); - void *buffer_end = (nk_byte*)ctx->memory.memory.ptr + ctx->memory.size; - if (elem_end == buffer_end) - ctx->memory.size -= sizeof(struct nk_page_element); - else nk_link_page_element_into_freelist(ctx, elem);} -} - - - - - -/* =============================================================== - * - * TABLE - * - * ===============================================================*/ -NK_LIB struct nk_table* -nk_create_table(struct nk_context *ctx) -{ - struct nk_page_element *elem; - elem = nk_create_page_element(ctx); - if (!elem) return 0; - nk_zero_struct(*elem); - return &elem->data.tbl; -} -NK_LIB void -nk_free_table(struct nk_context *ctx, struct nk_table *tbl) -{ - union nk_page_data *pd = NK_CONTAINER_OF(tbl, union nk_page_data, tbl); - struct nk_page_element *pe = NK_CONTAINER_OF(pd, struct nk_page_element, data); - nk_free_page_element(ctx, pe); -} -NK_LIB void -nk_push_table(struct nk_window *win, struct nk_table *tbl) -{ - if (!win->tables) { - win->tables = tbl; - tbl->next = 0; - tbl->prev = 0; - tbl->size = 0; - win->table_count = 1; - return; - } - win->tables->prev = tbl; - tbl->next = win->tables; - tbl->prev = 0; - tbl->size = 0; - win->tables = tbl; - win->table_count++; -} -NK_LIB void -nk_remove_table(struct nk_window *win, struct nk_table *tbl) -{ - if (win->tables == tbl) - win->tables = tbl->next; - if (tbl->next) - tbl->next->prev = tbl->prev; - if (tbl->prev) - tbl->prev->next = tbl->next; - tbl->next = 0; - tbl->prev = 0; -} -NK_LIB nk_uint* -nk_add_value(struct nk_context *ctx, struct nk_window *win, - nk_hash name, nk_uint value) -{ - NK_ASSERT(ctx); - NK_ASSERT(win); - if (!win || !ctx) return 0; - if (!win->tables || win->tables->size >= NK_VALUE_PAGE_CAPACITY) { - struct nk_table *tbl = nk_create_table(ctx); - NK_ASSERT(tbl); - if (!tbl) return 0; - nk_push_table(win, tbl); - } - win->tables->seq = win->seq; - win->tables->keys[win->tables->size] = name; - win->tables->values[win->tables->size] = value; - return &win->tables->values[win->tables->size++]; -} -NK_LIB nk_uint* -nk_find_value(struct nk_window *win, nk_hash name) -{ - struct nk_table *iter = win->tables; - while (iter) { - unsigned int i = 0; - unsigned int size = iter->size; - for (i = 0; i < size; ++i) { - if (iter->keys[i] == name) { - iter->seq = win->seq; - return &iter->values[i]; - } - } size = NK_VALUE_PAGE_CAPACITY; - iter = iter->next; - } - return 0; -} - - - - - -/* =============================================================== - * - * PANEL - * - * ===============================================================*/ -NK_LIB void* -nk_create_panel(struct nk_context *ctx) -{ - struct nk_page_element *elem; - elem = nk_create_page_element(ctx); - if (!elem) return 0; - nk_zero_struct(*elem); - return &elem->data.pan; -} -NK_LIB void -nk_free_panel(struct nk_context *ctx, struct nk_panel *pan) -{ - union nk_page_data *pd = NK_CONTAINER_OF(pan, union nk_page_data, pan); - struct nk_page_element *pe = NK_CONTAINER_OF(pd, struct nk_page_element, data); - nk_free_page_element(ctx, pe); -} -NK_LIB int -nk_panel_has_header(nk_flags flags, const char *title) -{ - int active = 0; - active = (flags & (NK_WINDOW_CLOSABLE|NK_WINDOW_MINIMIZABLE)); - active = active || (flags & NK_WINDOW_TITLE); - active = active && !(flags & NK_WINDOW_HIDDEN) && title; - return active; -} -NK_LIB struct nk_vec2 -nk_panel_get_padding(const struct nk_style *style, enum nk_panel_type type) -{ - switch (type) { - default: - case NK_PANEL_WINDOW: return style->window.padding; - case NK_PANEL_GROUP: return style->window.group_padding; - case NK_PANEL_POPUP: return style->window.popup_padding; - case NK_PANEL_CONTEXTUAL: return style->window.contextual_padding; - case NK_PANEL_COMBO: return style->window.combo_padding; - case NK_PANEL_MENU: return style->window.menu_padding; - case NK_PANEL_TOOLTIP: return style->window.menu_padding;} -} -NK_LIB float -nk_panel_get_border(const struct nk_style *style, nk_flags flags, - enum nk_panel_type type) -{ - if (flags & NK_WINDOW_BORDER) { - switch (type) { - default: - case NK_PANEL_WINDOW: return style->window.border; - case NK_PANEL_GROUP: return style->window.group_border; - case NK_PANEL_POPUP: return style->window.popup_border; - case NK_PANEL_CONTEXTUAL: return style->window.contextual_border; - case NK_PANEL_COMBO: return style->window.combo_border; - case NK_PANEL_MENU: return style->window.menu_border; - case NK_PANEL_TOOLTIP: return style->window.menu_border; - }} else return 0; -} -NK_LIB struct nk_color -nk_panel_get_border_color(const struct nk_style *style, enum nk_panel_type type) -{ - switch (type) { - default: - case NK_PANEL_WINDOW: return style->window.border_color; - case NK_PANEL_GROUP: return style->window.group_border_color; - case NK_PANEL_POPUP: return style->window.popup_border_color; - case NK_PANEL_CONTEXTUAL: return style->window.contextual_border_color; - case NK_PANEL_COMBO: return style->window.combo_border_color; - case NK_PANEL_MENU: return style->window.menu_border_color; - case NK_PANEL_TOOLTIP: return style->window.menu_border_color;} -} -NK_LIB int -nk_panel_is_sub(enum nk_panel_type type) -{ - return (type & NK_PANEL_SET_SUB)?1:0; -} -NK_LIB int -nk_panel_is_nonblock(enum nk_panel_type type) -{ - return (type & NK_PANEL_SET_NONBLOCK)?1:0; -} -NK_LIB int -nk_panel_begin(struct nk_context *ctx, const char *title, enum nk_panel_type panel_type) -{ - struct nk_input *in; - struct nk_window *win; - struct nk_panel *layout; - struct nk_command_buffer *out; - const struct nk_style *style; - const struct nk_user_font *font; - - struct nk_vec2 scrollbar_size; - struct nk_vec2 panel_padding; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) return 0; - nk_zero(ctx->current->layout, sizeof(*ctx->current->layout)); - if ((ctx->current->flags & NK_WINDOW_HIDDEN) || (ctx->current->flags & NK_WINDOW_CLOSED)) { - nk_zero(ctx->current->layout, sizeof(struct nk_panel)); - ctx->current->layout->type = panel_type; - return 0; - } - /* pull state into local stack */ - style = &ctx->style; - font = style->font; - win = ctx->current; - layout = win->layout; - out = &win->buffer; - in = (win->flags & NK_WINDOW_NO_INPUT) ? 0: &ctx->input; -#ifdef NK_INCLUDE_COMMAND_USERDATA - win->buffer.userdata = ctx->userdata; -#endif - /* pull style configuration into local stack */ - scrollbar_size = style->window.scrollbar_size; - panel_padding = nk_panel_get_padding(style, panel_type); - - /* window movement */ - if ((win->flags & NK_WINDOW_MOVABLE) && !(win->flags & NK_WINDOW_ROM)) { - int left_mouse_down; - int left_mouse_clicked; - int left_mouse_click_in_cursor; - - /* calculate draggable window space */ - struct nk_rect header; - header.x = win->bounds.x; - header.y = win->bounds.y; - header.w = win->bounds.w; - if (nk_panel_has_header(win->flags, title)) { - header.h = font->height + 2.0f * style->window.header.padding.y; - header.h += 2.0f * style->window.header.label_padding.y; - } else header.h = panel_padding.y; - - /* window movement by dragging */ - left_mouse_down = in->mouse.buttons[NK_BUTTON_LEFT].down; - left_mouse_clicked = (int)in->mouse.buttons[NK_BUTTON_LEFT].clicked; - left_mouse_click_in_cursor = nk_input_has_mouse_click_down_in_rect(in, - NK_BUTTON_LEFT, header, nk_true); - if (left_mouse_down && left_mouse_click_in_cursor && !left_mouse_clicked) { - win->bounds.x = win->bounds.x + in->mouse.delta.x; - win->bounds.y = win->bounds.y + in->mouse.delta.y; - in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x += in->mouse.delta.x; - in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.y += in->mouse.delta.y; - ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_MOVE]; - } - } - - /* setup panel */ - layout->type = panel_type; - layout->flags = win->flags; - layout->bounds = win->bounds; - layout->bounds.x += panel_padding.x; - layout->bounds.w -= 2*panel_padding.x; - if (win->flags & NK_WINDOW_BORDER) { - layout->border = nk_panel_get_border(style, win->flags, panel_type); - layout->bounds = nk_shrink_rect(layout->bounds, layout->border); - } else layout->border = 0; - layout->at_y = layout->bounds.y; - layout->at_x = layout->bounds.x; - layout->max_x = 0; - layout->header_height = 0; - layout->footer_height = 0; - nk_layout_reset_min_row_height(ctx); - layout->row.index = 0; - layout->row.columns = 0; - layout->row.ratio = 0; - layout->row.item_width = 0; - layout->row.tree_depth = 0; - layout->row.height = panel_padding.y; - layout->has_scrolling = nk_true; - if (!(win->flags & NK_WINDOW_NO_SCROLLBAR)) - layout->bounds.w -= scrollbar_size.x; - if (!nk_panel_is_nonblock(panel_type)) { - layout->footer_height = 0; - if (!(win->flags & NK_WINDOW_NO_SCROLLBAR) || win->flags & NK_WINDOW_SCALABLE) - layout->footer_height = scrollbar_size.y; - layout->bounds.h -= layout->footer_height; - } - - /* panel header */ - if (nk_panel_has_header(win->flags, title)) - { - struct nk_text text; - struct nk_rect header; - const struct nk_style_item *background = 0; - - /* calculate header bounds */ - header.x = win->bounds.x; - header.y = win->bounds.y; - header.w = win->bounds.w; - header.h = font->height + 2.0f * style->window.header.padding.y; - header.h += (2.0f * style->window.header.label_padding.y); - - /* shrink panel by header */ - layout->header_height = header.h; - layout->bounds.y += header.h; - layout->bounds.h -= header.h; - layout->at_y += header.h; - - /* select correct header background and text color */ - if (ctx->active == win) { - background = &style->window.header.active; - text.text = style->window.header.label_active; - } else if (nk_input_is_mouse_hovering_rect(&ctx->input, header)) { - background = &style->window.header.hover; - text.text = style->window.header.label_hover; - } else { - background = &style->window.header.normal; - text.text = style->window.header.label_normal; - } - - /* draw header background */ - header.h += 1.0f; - if (background->type == NK_STYLE_ITEM_IMAGE) { - text.background = nk_rgba(0,0,0,0); - nk_draw_image(&win->buffer, header, &background->data.image, nk_white); - } else { - text.background = background->data.color; - nk_fill_rect(out, header, 0, background->data.color); - } - - /* window close button */ - {struct nk_rect button; - button.y = header.y + style->window.header.padding.y; - button.h = header.h - 2 * style->window.header.padding.y; - button.w = button.h; - if (win->flags & NK_WINDOW_CLOSABLE) { - nk_flags ws = 0; - if (style->window.header.align == NK_HEADER_RIGHT) { - button.x = (header.w + header.x) - (button.w + style->window.header.padding.x); - header.w -= button.w + style->window.header.spacing.x + style->window.header.padding.x; - } else { - button.x = header.x + style->window.header.padding.x; - header.x += button.w + style->window.header.spacing.x + style->window.header.padding.x; - } - - if (nk_do_button_symbol(&ws, &win->buffer, button, - style->window.header.close_symbol, NK_BUTTON_DEFAULT, - &style->window.header.close_button, in, style->font) && !(win->flags & NK_WINDOW_ROM)) - { - layout->flags |= NK_WINDOW_HIDDEN; - layout->flags &= (nk_flags)~NK_WINDOW_MINIMIZED; - } - } - - /* window minimize button */ - if (win->flags & NK_WINDOW_MINIMIZABLE) { - nk_flags ws = 0; - if (style->window.header.align == NK_HEADER_RIGHT) { - button.x = (header.w + header.x) - button.w; - if (!(win->flags & NK_WINDOW_CLOSABLE)) { - button.x -= style->window.header.padding.x; - header.w -= style->window.header.padding.x; - } - header.w -= button.w + style->window.header.spacing.x; - } else { - button.x = header.x; - header.x += button.w + style->window.header.spacing.x + style->window.header.padding.x; - } - if (nk_do_button_symbol(&ws, &win->buffer, button, (layout->flags & NK_WINDOW_MINIMIZED)? - style->window.header.maximize_symbol: style->window.header.minimize_symbol, - NK_BUTTON_DEFAULT, &style->window.header.minimize_button, in, style->font) && !(win->flags & NK_WINDOW_ROM)) - layout->flags = (layout->flags & NK_WINDOW_MINIMIZED) ? - layout->flags & (nk_flags)~NK_WINDOW_MINIMIZED: - layout->flags | NK_WINDOW_MINIMIZED; - }} - - {/* window header title */ - int text_len = nk_strlen(title); - struct nk_rect label = {0,0,0,0}; - float t = font->width(font->userdata, font->height, title, text_len); - text.padding = nk_vec2(0,0); - - label.x = header.x + style->window.header.padding.x; - label.x += style->window.header.label_padding.x; - label.y = header.y + style->window.header.label_padding.y; - label.h = font->height + 2 * style->window.header.label_padding.y; - label.w = t + 2 * style->window.header.spacing.x; - label.w = NK_CLAMP(0, label.w, header.x + header.w - label.x); - nk_widget_text(out, label,(const char*)title, text_len, &text, NK_TEXT_LEFT, font);} - } - - /* draw window background */ - if (!(layout->flags & NK_WINDOW_MINIMIZED) && !(layout->flags & NK_WINDOW_DYNAMIC)) { - struct nk_rect body; - body.x = win->bounds.x; - body.w = win->bounds.w; - body.y = (win->bounds.y + layout->header_height); - body.h = (win->bounds.h - layout->header_height); - if (style->window.fixed_background.type == NK_STYLE_ITEM_IMAGE) - nk_draw_image(out, body, &style->window.fixed_background.data.image, nk_white); - else nk_fill_rect(out, body, 0, style->window.fixed_background.data.color); - } - - /* set clipping rectangle */ - {struct nk_rect clip; - layout->clip = layout->bounds; - nk_unify(&clip, &win->buffer.clip, layout->clip.x, layout->clip.y, - layout->clip.x + layout->clip.w, layout->clip.y + layout->clip.h); - nk_push_scissor(out, clip); - layout->clip = clip;} - return !(layout->flags & NK_WINDOW_HIDDEN) && !(layout->flags & NK_WINDOW_MINIMIZED); -} -NK_LIB void -nk_panel_end(struct nk_context *ctx) -{ - struct nk_input *in; - struct nk_window *window; - struct nk_panel *layout; - const struct nk_style *style; - struct nk_command_buffer *out; - - struct nk_vec2 scrollbar_size; - struct nk_vec2 panel_padding; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - window = ctx->current; - layout = window->layout; - style = &ctx->style; - out = &window->buffer; - in = (layout->flags & NK_WINDOW_ROM || layout->flags & NK_WINDOW_NO_INPUT) ? 0 :&ctx->input; - if (!nk_panel_is_sub(layout->type)) - nk_push_scissor(out, nk_null_rect); - - /* cache configuration data */ - scrollbar_size = style->window.scrollbar_size; - panel_padding = nk_panel_get_padding(style, layout->type); - - /* update the current cursor Y-position to point over the last added widget */ - layout->at_y += layout->row.height; - - /* dynamic panels */ - if (layout->flags & NK_WINDOW_DYNAMIC && !(layout->flags & NK_WINDOW_MINIMIZED)) - { - /* update panel height to fit dynamic growth */ - struct nk_rect empty_space; - if (layout->at_y < (layout->bounds.y + layout->bounds.h)) - layout->bounds.h = layout->at_y - layout->bounds.y; - - /* fill top empty space */ - empty_space.x = window->bounds.x; - empty_space.y = layout->bounds.y; - empty_space.h = panel_padding.y; - empty_space.w = window->bounds.w; - nk_fill_rect(out, empty_space, 0, style->window.background); - - /* fill left empty space */ - empty_space.x = window->bounds.x; - empty_space.y = layout->bounds.y; - empty_space.w = panel_padding.x + layout->border; - empty_space.h = layout->bounds.h; - nk_fill_rect(out, empty_space, 0, style->window.background); - - /* fill right empty space */ - empty_space.x = layout->bounds.x + layout->bounds.w; - empty_space.y = layout->bounds.y; - empty_space.w = panel_padding.x + layout->border; - empty_space.h = layout->bounds.h; - if (*layout->offset_y == 0 && !(layout->flags & NK_WINDOW_NO_SCROLLBAR)) - empty_space.w += scrollbar_size.x; - nk_fill_rect(out, empty_space, 0, style->window.background); - - /* fill bottom empty space */ - if (layout->footer_height > 0) { - empty_space.x = window->bounds.x; - empty_space.y = layout->bounds.y + layout->bounds.h; - empty_space.w = window->bounds.w; - empty_space.h = layout->footer_height; - nk_fill_rect(out, empty_space, 0, style->window.background); - } - } - - /* scrollbars */ - if (!(layout->flags & NK_WINDOW_NO_SCROLLBAR) && - !(layout->flags & NK_WINDOW_MINIMIZED) && - window->scrollbar_hiding_timer < NK_SCROLLBAR_HIDING_TIMEOUT) - { - struct nk_rect scroll; - int scroll_has_scrolling; - float scroll_target; - float scroll_offset; - float scroll_step; - float scroll_inc; - - /* mouse wheel scrolling */ - if (nk_panel_is_sub(layout->type)) - { - /* sub-window mouse wheel scrolling */ - struct nk_window *root_window = window; - struct nk_panel *root_panel = window->layout; - while (root_panel->parent) - root_panel = root_panel->parent; - while (root_window->parent) - root_window = root_window->parent; - - /* only allow scrolling if parent window is active */ - scroll_has_scrolling = 0; - if ((root_window == ctx->active) && layout->has_scrolling) { - /* and panel is being hovered and inside clip rect*/ - if (nk_input_is_mouse_hovering_rect(in, layout->bounds) && - NK_INTERSECT(layout->bounds.x, layout->bounds.y, layout->bounds.w, layout->bounds.h, - root_panel->clip.x, root_panel->clip.y, root_panel->clip.w, root_panel->clip.h)) - { - /* deactivate all parent scrolling */ - root_panel = window->layout; - while (root_panel->parent) { - root_panel->has_scrolling = nk_false; - root_panel = root_panel->parent; - } - root_panel->has_scrolling = nk_false; - scroll_has_scrolling = nk_true; - } - } - } else if (!nk_panel_is_sub(layout->type)) { - /* window mouse wheel scrolling */ - scroll_has_scrolling = (window == ctx->active) && layout->has_scrolling; - if (in && (in->mouse.scroll_delta.y > 0 || in->mouse.scroll_delta.x > 0) && scroll_has_scrolling) - window->scrolled = nk_true; - else window->scrolled = nk_false; - } else scroll_has_scrolling = nk_false; - - { - /* vertical scrollbar */ - nk_flags state = 0; - scroll.x = layout->bounds.x + layout->bounds.w + panel_padding.x; - scroll.y = layout->bounds.y; - scroll.w = scrollbar_size.x; - scroll.h = layout->bounds.h; - - scroll_offset = (float)*layout->offset_y; - scroll_step = scroll.h * 0.10f; - scroll_inc = scroll.h * 0.01f; - scroll_target = (float)(int)(layout->at_y - scroll.y); - scroll_offset = nk_do_scrollbarv(&state, out, scroll, scroll_has_scrolling, - scroll_offset, scroll_target, scroll_step, scroll_inc, - &ctx->style.scrollv, in, style->font); - *layout->offset_y = (nk_uint)scroll_offset; - if (in && scroll_has_scrolling) - in->mouse.scroll_delta.y = 0; - } - { - /* horizontal scrollbar */ - nk_flags state = 0; - scroll.x = layout->bounds.x; - scroll.y = layout->bounds.y + layout->bounds.h; - scroll.w = layout->bounds.w; - scroll.h = scrollbar_size.y; - - scroll_offset = (float)*layout->offset_x; - scroll_target = (float)(int)(layout->max_x - scroll.x); - scroll_step = layout->max_x * 0.05f; - scroll_inc = layout->max_x * 0.005f; - scroll_offset = nk_do_scrollbarh(&state, out, scroll, scroll_has_scrolling, - scroll_offset, scroll_target, scroll_step, scroll_inc, - &ctx->style.scrollh, in, style->font); - *layout->offset_x = (nk_uint)scroll_offset; - } - } - - /* hide scroll if no user input */ - if (window->flags & NK_WINDOW_SCROLL_AUTO_HIDE) { - int has_input = ctx->input.mouse.delta.x != 0 || ctx->input.mouse.delta.y != 0 || ctx->input.mouse.scroll_delta.y != 0; - int is_window_hovered = nk_window_is_hovered(ctx); - int any_item_active = (ctx->last_widget_state & NK_WIDGET_STATE_MODIFIED); - if ((!has_input && is_window_hovered) || (!is_window_hovered && !any_item_active)) - window->scrollbar_hiding_timer += ctx->delta_time_seconds; - else window->scrollbar_hiding_timer = 0; - } else window->scrollbar_hiding_timer = 0; - - /* window border */ - if (layout->flags & NK_WINDOW_BORDER) - { - struct nk_color border_color = nk_panel_get_border_color(style, layout->type); - const float padding_y = (layout->flags & NK_WINDOW_MINIMIZED) - ? (style->window.border + window->bounds.y + layout->header_height) - : ((layout->flags & NK_WINDOW_DYNAMIC) - ? (layout->bounds.y + layout->bounds.h + layout->footer_height) - : (window->bounds.y + window->bounds.h)); - struct nk_rect b = window->bounds; - b.h = padding_y - window->bounds.y; - nk_stroke_rect(out, b, 0, layout->border, border_color); - } - - /* scaler */ - if ((layout->flags & NK_WINDOW_SCALABLE) && in && !(layout->flags & NK_WINDOW_MINIMIZED)) - { - /* calculate scaler bounds */ - struct nk_rect scaler; - scaler.w = scrollbar_size.x; - scaler.h = scrollbar_size.y; - scaler.y = layout->bounds.y + layout->bounds.h; - if (layout->flags & NK_WINDOW_SCALE_LEFT) - scaler.x = layout->bounds.x - panel_padding.x * 0.5f; - else scaler.x = layout->bounds.x + layout->bounds.w + panel_padding.x; - if (layout->flags & NK_WINDOW_NO_SCROLLBAR) - scaler.x -= scaler.w; - - /* draw scaler */ - {const struct nk_style_item *item = &style->window.scaler; - if (item->type == NK_STYLE_ITEM_IMAGE) - nk_draw_image(out, scaler, &item->data.image, nk_white); - else { - if (layout->flags & NK_WINDOW_SCALE_LEFT) { - nk_fill_triangle(out, scaler.x, scaler.y, scaler.x, - scaler.y + scaler.h, scaler.x + scaler.w, - scaler.y + scaler.h, item->data.color); - } else { - nk_fill_triangle(out, scaler.x + scaler.w, scaler.y, scaler.x + scaler.w, - scaler.y + scaler.h, scaler.x, scaler.y + scaler.h, item->data.color); - } - }} - - /* do window scaling */ - if (!(window->flags & NK_WINDOW_ROM)) { - struct nk_vec2 window_size = style->window.min_size; - int left_mouse_down = in->mouse.buttons[NK_BUTTON_LEFT].down; - int left_mouse_click_in_scaler = nk_input_has_mouse_click_down_in_rect(in, - NK_BUTTON_LEFT, scaler, nk_true); - - if (left_mouse_down && left_mouse_click_in_scaler) { - float delta_x = in->mouse.delta.x; - if (layout->flags & NK_WINDOW_SCALE_LEFT) { - delta_x = -delta_x; - window->bounds.x += in->mouse.delta.x; - } - /* dragging in x-direction */ - if (window->bounds.w + delta_x >= window_size.x) { - if ((delta_x < 0) || (delta_x > 0 && in->mouse.pos.x >= scaler.x)) { - window->bounds.w = window->bounds.w + delta_x; - scaler.x += in->mouse.delta.x; - } - } - /* dragging in y-direction (only possible if static window) */ - if (!(layout->flags & NK_WINDOW_DYNAMIC)) { - if (window_size.y < window->bounds.h + in->mouse.delta.y) { - if ((in->mouse.delta.y < 0) || (in->mouse.delta.y > 0 && in->mouse.pos.y >= scaler.y)) { - window->bounds.h = window->bounds.h + in->mouse.delta.y; - scaler.y += in->mouse.delta.y; - } - } - } - ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_RESIZE_TOP_RIGHT_DOWN_LEFT]; - in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x = scaler.x + scaler.w/2.0f; - in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.y = scaler.y + scaler.h/2.0f; - } - } - } - if (!nk_panel_is_sub(layout->type)) { - /* window is hidden so clear command buffer */ - if (layout->flags & NK_WINDOW_HIDDEN) - nk_command_buffer_reset(&window->buffer); - /* window is visible and not tab */ - else nk_finish(ctx, window); - } - - /* NK_WINDOW_REMOVE_ROM flag was set so remove NK_WINDOW_ROM */ - if (layout->flags & NK_WINDOW_REMOVE_ROM) { - layout->flags &= ~(nk_flags)NK_WINDOW_ROM; - layout->flags &= ~(nk_flags)NK_WINDOW_REMOVE_ROM; - } - window->flags = layout->flags; - - /* property garbage collector */ - if (window->property.active && window->property.old != window->property.seq && - window->property.active == window->property.prev) { - nk_zero(&window->property, sizeof(window->property)); - } else { - window->property.old = window->property.seq; - window->property.prev = window->property.active; - window->property.seq = 0; - } - /* edit garbage collector */ - if (window->edit.active && window->edit.old != window->edit.seq && - window->edit.active == window->edit.prev) { - nk_zero(&window->edit, sizeof(window->edit)); - } else { - window->edit.old = window->edit.seq; - window->edit.prev = window->edit.active; - window->edit.seq = 0; - } - /* contextual garbage collector */ - if (window->popup.active_con && window->popup.con_old != window->popup.con_count) { - window->popup.con_count = 0; - window->popup.con_old = 0; - window->popup.active_con = 0; - } else { - window->popup.con_old = window->popup.con_count; - window->popup.con_count = 0; - } - window->popup.combo_count = 0; - /* helper to make sure you have a 'nk_tree_push' for every 'nk_tree_pop' */ - NK_ASSERT(!layout->row.tree_depth); -} - - - - - -/* =============================================================== - * - * WINDOW - * - * ===============================================================*/ -NK_LIB void* -nk_create_window(struct nk_context *ctx) -{ - struct nk_page_element *elem; - elem = nk_create_page_element(ctx); - if (!elem) return 0; - elem->data.win.seq = ctx->seq; - return &elem->data.win; -} -NK_LIB void -nk_free_window(struct nk_context *ctx, struct nk_window *win) -{ - /* unlink windows from list */ - struct nk_table *it = win->tables; - if (win->popup.win) { - nk_free_window(ctx, win->popup.win); - win->popup.win = 0; - } - win->next = 0; - win->prev = 0; - - while (it) { - /*free window state tables */ - struct nk_table *n = it->next; - nk_remove_table(win, it); - nk_free_table(ctx, it); - if (it == win->tables) - win->tables = n; - it = n; - } - - /* link windows into freelist */ - {union nk_page_data *pd = NK_CONTAINER_OF(win, union nk_page_data, win); - struct nk_page_element *pe = NK_CONTAINER_OF(pd, struct nk_page_element, data); - nk_free_page_element(ctx, pe);} -} -NK_LIB struct nk_window* -nk_find_window(struct nk_context *ctx, nk_hash hash, const char *name) -{ - struct nk_window *iter; - iter = ctx->begin; - while (iter) { - NK_ASSERT(iter != iter->next); - if (iter->name == hash) { - int max_len = nk_strlen(iter->name_string); - if (!nk_stricmpn(iter->name_string, name, max_len)) - return iter; - } - iter = iter->next; - } - return 0; -} -NK_LIB void -nk_insert_window(struct nk_context *ctx, struct nk_window *win, - enum nk_window_insert_location loc) -{ - const struct nk_window *iter; - NK_ASSERT(ctx); - NK_ASSERT(win); - if (!win || !ctx) return; - - iter = ctx->begin; - while (iter) { - NK_ASSERT(iter != iter->next); - NK_ASSERT(iter != win); - if (iter == win) return; - iter = iter->next; - } - - if (!ctx->begin) { - win->next = 0; - win->prev = 0; - ctx->begin = win; - ctx->end = win; - ctx->count = 1; - return; - } - if (loc == NK_INSERT_BACK) { - struct nk_window *end; - end = ctx->end; - end->flags |= NK_WINDOW_ROM; - end->next = win; - win->prev = ctx->end; - win->next = 0; - ctx->end = win; - ctx->active = ctx->end; - ctx->end->flags &= ~(nk_flags)NK_WINDOW_ROM; - } else { - /*ctx->end->flags |= NK_WINDOW_ROM;*/ - ctx->begin->prev = win; - win->next = ctx->begin; - win->prev = 0; - ctx->begin = win; - ctx->begin->flags &= ~(nk_flags)NK_WINDOW_ROM; - } - ctx->count++; -} -NK_LIB void -nk_remove_window(struct nk_context *ctx, struct nk_window *win) -{ - if (win == ctx->begin || win == ctx->end) { - if (win == ctx->begin) { - ctx->begin = win->next; - if (win->next) - win->next->prev = 0; - } - if (win == ctx->end) { - ctx->end = win->prev; - if (win->prev) - win->prev->next = 0; - } - } else { - if (win->next) - win->next->prev = win->prev; - if (win->prev) - win->prev->next = win->next; - } - if (win == ctx->active || !ctx->active) { - ctx->active = ctx->end; - if (ctx->end) - ctx->end->flags &= ~(nk_flags)NK_WINDOW_ROM; - } - win->next = 0; - win->prev = 0; - ctx->count--; -} -NK_API int -nk_begin(struct nk_context *ctx, const char *title, - struct nk_rect bounds, nk_flags flags) -{ - return nk_begin_titled(ctx, title, title, bounds, flags); -} -NK_API int -nk_begin_titled(struct nk_context *ctx, const char *name, const char *title, - struct nk_rect bounds, nk_flags flags) -{ - struct nk_window *win; - struct nk_style *style; - nk_hash name_hash; - int name_len; - int ret = 0; - - NK_ASSERT(ctx); - NK_ASSERT(name); - NK_ASSERT(title); - NK_ASSERT(ctx->style.font && ctx->style.font->width && "if this triggers you forgot to add a font"); - NK_ASSERT(!ctx->current && "if this triggers you missed a `nk_end` call"); - if (!ctx || ctx->current || !title || !name) - return 0; - - /* find or create window */ - style = &ctx->style; - name_len = (int)nk_strlen(name); - name_hash = nk_murmur_hash(name, (int)name_len, NK_WINDOW_TITLE); - win = nk_find_window(ctx, name_hash, name); - if (!win) { - /* create new window */ - nk_size name_length = (nk_size)name_len; - win = (struct nk_window*)nk_create_window(ctx); - NK_ASSERT(win); - if (!win) return 0; - - if (flags & NK_WINDOW_BACKGROUND) - nk_insert_window(ctx, win, NK_INSERT_FRONT); - else nk_insert_window(ctx, win, NK_INSERT_BACK); - nk_command_buffer_init(&win->buffer, &ctx->memory, NK_CLIPPING_ON); - - win->flags = flags; - win->bounds = bounds; - win->name = name_hash; - name_length = NK_MIN(name_length, NK_WINDOW_MAX_NAME-1); - NK_MEMCPY(win->name_string, name, name_length); - win->name_string[name_length] = 0; - win->popup.win = 0; - if (!ctx->active) - ctx->active = win; - } else { - /* update window */ - win->flags &= ~(nk_flags)(NK_WINDOW_PRIVATE-1); - win->flags |= flags; - if (!(win->flags & (NK_WINDOW_MOVABLE | NK_WINDOW_SCALABLE))) - win->bounds = bounds; - /* If this assert triggers you either: - * - * I.) Have more than one window with the same name or - * II.) You forgot to actually draw the window. - * More specific you did not call `nk_clear` (nk_clear will be - * automatically called for you if you are using one of the - * provided demo backends). */ - NK_ASSERT(win->seq != ctx->seq); - win->seq = ctx->seq; - if (!ctx->active && !(win->flags & NK_WINDOW_HIDDEN)) { - ctx->active = win; - ctx->end = win; - } - } - if (win->flags & NK_WINDOW_HIDDEN) { - ctx->current = win; - win->layout = 0; - return 0; - } else nk_start(ctx, win); - - /* window overlapping */ - if (!(win->flags & NK_WINDOW_HIDDEN) && !(win->flags & NK_WINDOW_NO_INPUT)) - { - int inpanel, ishovered; - struct nk_window *iter = win; - float h = ctx->style.font->height + 2.0f * style->window.header.padding.y + - (2.0f * style->window.header.label_padding.y); - struct nk_rect win_bounds = (!(win->flags & NK_WINDOW_MINIMIZED))? - win->bounds: nk_rect(win->bounds.x, win->bounds.y, win->bounds.w, h); - - /* activate window if hovered and no other window is overlapping this window */ - inpanel = nk_input_has_mouse_click_down_in_rect(&ctx->input, NK_BUTTON_LEFT, win_bounds, nk_true); - inpanel = inpanel && ctx->input.mouse.buttons[NK_BUTTON_LEFT].clicked; - ishovered = nk_input_is_mouse_hovering_rect(&ctx->input, win_bounds); - if ((win != ctx->active) && ishovered && !ctx->input.mouse.buttons[NK_BUTTON_LEFT].down) { - iter = win->next; - while (iter) { - struct nk_rect iter_bounds = (!(iter->flags & NK_WINDOW_MINIMIZED))? - iter->bounds: nk_rect(iter->bounds.x, iter->bounds.y, iter->bounds.w, h); - if (NK_INTERSECT(win_bounds.x, win_bounds.y, win_bounds.w, win_bounds.h, - iter_bounds.x, iter_bounds.y, iter_bounds.w, iter_bounds.h) && - (!(iter->flags & NK_WINDOW_HIDDEN))) - break; - - if (iter->popup.win && iter->popup.active && !(iter->flags & NK_WINDOW_HIDDEN) && - NK_INTERSECT(win->bounds.x, win_bounds.y, win_bounds.w, win_bounds.h, - iter->popup.win->bounds.x, iter->popup.win->bounds.y, - iter->popup.win->bounds.w, iter->popup.win->bounds.h)) - break; - iter = iter->next; - } - } - - /* activate window if clicked */ - if (iter && inpanel && (win != ctx->end)) { - iter = win->next; - while (iter) { - /* try to find a panel with higher priority in the same position */ - struct nk_rect iter_bounds = (!(iter->flags & NK_WINDOW_MINIMIZED))? - iter->bounds: nk_rect(iter->bounds.x, iter->bounds.y, iter->bounds.w, h); - if (NK_INBOX(ctx->input.mouse.pos.x, ctx->input.mouse.pos.y, - iter_bounds.x, iter_bounds.y, iter_bounds.w, iter_bounds.h) && - !(iter->flags & NK_WINDOW_HIDDEN)) - break; - if (iter->popup.win && iter->popup.active && !(iter->flags & NK_WINDOW_HIDDEN) && - NK_INTERSECT(win_bounds.x, win_bounds.y, win_bounds.w, win_bounds.h, - iter->popup.win->bounds.x, iter->popup.win->bounds.y, - iter->popup.win->bounds.w, iter->popup.win->bounds.h)) - break; - iter = iter->next; - } - } - if (iter && !(win->flags & NK_WINDOW_ROM) && (win->flags & NK_WINDOW_BACKGROUND)) { - win->flags |= (nk_flags)NK_WINDOW_ROM; - iter->flags &= ~(nk_flags)NK_WINDOW_ROM; - ctx->active = iter; - if (!(iter->flags & NK_WINDOW_BACKGROUND)) { - /* current window is active in that position so transfer to top - * at the highest priority in stack */ - nk_remove_window(ctx, iter); - nk_insert_window(ctx, iter, NK_INSERT_BACK); - } - } else { - if (!iter && ctx->end != win) { - if (!(win->flags & NK_WINDOW_BACKGROUND)) { - /* current window is active in that position so transfer to top - * at the highest priority in stack */ - nk_remove_window(ctx, win); - nk_insert_window(ctx, win, NK_INSERT_BACK); - } - win->flags &= ~(nk_flags)NK_WINDOW_ROM; - ctx->active = win; - } - if (ctx->end != win && !(win->flags & NK_WINDOW_BACKGROUND)) - win->flags |= NK_WINDOW_ROM; - } - } - win->layout = (struct nk_panel*)nk_create_panel(ctx); - ctx->current = win; - ret = nk_panel_begin(ctx, title, NK_PANEL_WINDOW); - win->layout->offset_x = &win->scrollbar.x; - win->layout->offset_y = &win->scrollbar.y; - return ret; -} -NK_API void -nk_end(struct nk_context *ctx) -{ - struct nk_panel *layout; - NK_ASSERT(ctx); - NK_ASSERT(ctx->current && "if this triggers you forgot to call `nk_begin`"); - if (!ctx || !ctx->current) - return; - - layout = ctx->current->layout; - if (!layout || (layout->type == NK_PANEL_WINDOW && (ctx->current->flags & NK_WINDOW_HIDDEN))) { - ctx->current = 0; - return; - } - nk_panel_end(ctx); - nk_free_panel(ctx, ctx->current->layout); - ctx->current = 0; -} -NK_API struct nk_rect -nk_window_get_bounds(const struct nk_context *ctx) -{ - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - if (!ctx || !ctx->current) return nk_rect(0,0,0,0); - return ctx->current->bounds; -} -NK_API struct nk_vec2 -nk_window_get_position(const struct nk_context *ctx) -{ - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - if (!ctx || !ctx->current) return nk_vec2(0,0); - return nk_vec2(ctx->current->bounds.x, ctx->current->bounds.y); -} -NK_API struct nk_vec2 -nk_window_get_size(const struct nk_context *ctx) -{ - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - if (!ctx || !ctx->current) return nk_vec2(0,0); - return nk_vec2(ctx->current->bounds.w, ctx->current->bounds.h); -} -NK_API float -nk_window_get_width(const struct nk_context *ctx) -{ - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - if (!ctx || !ctx->current) return 0; - return ctx->current->bounds.w; -} -NK_API float -nk_window_get_height(const struct nk_context *ctx) -{ - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - if (!ctx || !ctx->current) return 0; - return ctx->current->bounds.h; -} -NK_API struct nk_rect -nk_window_get_content_region(struct nk_context *ctx) -{ - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - if (!ctx || !ctx->current) return nk_rect(0,0,0,0); - return ctx->current->layout->clip; -} -NK_API struct nk_vec2 -nk_window_get_content_region_min(struct nk_context *ctx) -{ - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current) return nk_vec2(0,0); - return nk_vec2(ctx->current->layout->clip.x, ctx->current->layout->clip.y); -} -NK_API struct nk_vec2 -nk_window_get_content_region_max(struct nk_context *ctx) -{ - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current) return nk_vec2(0,0); - return nk_vec2(ctx->current->layout->clip.x + ctx->current->layout->clip.w, - ctx->current->layout->clip.y + ctx->current->layout->clip.h); -} -NK_API struct nk_vec2 -nk_window_get_content_region_size(struct nk_context *ctx) -{ - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current) return nk_vec2(0,0); - return nk_vec2(ctx->current->layout->clip.w, ctx->current->layout->clip.h); -} -NK_API struct nk_command_buffer* -nk_window_get_canvas(struct nk_context *ctx) -{ - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current) return 0; - return &ctx->current->buffer; -} -NK_API struct nk_panel* -nk_window_get_panel(struct nk_context *ctx) -{ - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - if (!ctx || !ctx->current) return 0; - return ctx->current->layout; -} -NK_API void -nk_window_get_scroll(struct nk_context *ctx, nk_uint *offset_x, nk_uint *offset_y) -{ - struct nk_window *win; - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - if (!ctx || !ctx->current) - return ; - win = ctx->current; - if (offset_x) - *offset_x = win->scrollbar.x; - if (offset_y) - *offset_y = win->scrollbar.y; -} -NK_API int -nk_window_has_focus(const struct nk_context *ctx) -{ - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current) return 0; - return ctx->current == ctx->active; -} -NK_API int -nk_window_is_hovered(struct nk_context *ctx) -{ - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - if (!ctx || !ctx->current) return 0; - if(ctx->current->flags & NK_WINDOW_HIDDEN) - return 0; - return nk_input_is_mouse_hovering_rect(&ctx->input, ctx->current->bounds); -} -NK_API int -nk_window_is_any_hovered(struct nk_context *ctx) -{ - struct nk_window *iter; - NK_ASSERT(ctx); - if (!ctx) return 0; - iter = ctx->begin; - while (iter) { - /* check if window is being hovered */ - if(!(iter->flags & NK_WINDOW_HIDDEN)) { - /* check if window popup is being hovered */ - if (iter->popup.active && iter->popup.win && nk_input_is_mouse_hovering_rect(&ctx->input, iter->popup.win->bounds)) - return 1; - - if (iter->flags & NK_WINDOW_MINIMIZED) { - struct nk_rect header = iter->bounds; - header.h = ctx->style.font->height + 2 * ctx->style.window.header.padding.y; - if (nk_input_is_mouse_hovering_rect(&ctx->input, header)) - return 1; - } else if (nk_input_is_mouse_hovering_rect(&ctx->input, iter->bounds)) { - return 1; - } - } - iter = iter->next; - } - return 0; -} -NK_API int -nk_item_is_any_active(struct nk_context *ctx) -{ - int any_hovered = nk_window_is_any_hovered(ctx); - int any_active = (ctx->last_widget_state & NK_WIDGET_STATE_MODIFIED); - return any_hovered || any_active; -} -NK_API int -nk_window_is_collapsed(struct nk_context *ctx, const char *name) -{ - int title_len; - nk_hash title_hash; - struct nk_window *win; - NK_ASSERT(ctx); - if (!ctx) return 0; - - title_len = (int)nk_strlen(name); - title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE); - win = nk_find_window(ctx, title_hash, name); - if (!win) return 0; - return win->flags & NK_WINDOW_MINIMIZED; -} -NK_API int -nk_window_is_closed(struct nk_context *ctx, const char *name) -{ - int title_len; - nk_hash title_hash; - struct nk_window *win; - NK_ASSERT(ctx); - if (!ctx) return 1; - - title_len = (int)nk_strlen(name); - title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE); - win = nk_find_window(ctx, title_hash, name); - if (!win) return 1; - return (win->flags & NK_WINDOW_CLOSED); -} -NK_API int -nk_window_is_hidden(struct nk_context *ctx, const char *name) -{ - int title_len; - nk_hash title_hash; - struct nk_window *win; - NK_ASSERT(ctx); - if (!ctx) return 1; - - title_len = (int)nk_strlen(name); - title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE); - win = nk_find_window(ctx, title_hash, name); - if (!win) return 1; - return (win->flags & NK_WINDOW_HIDDEN); -} -NK_API int -nk_window_is_active(struct nk_context *ctx, const char *name) -{ - int title_len; - nk_hash title_hash; - struct nk_window *win; - NK_ASSERT(ctx); - if (!ctx) return 0; - - title_len = (int)nk_strlen(name); - title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE); - win = nk_find_window(ctx, title_hash, name); - if (!win) return 0; - return win == ctx->active; -} -NK_API struct nk_window* -nk_window_find(struct nk_context *ctx, const char *name) -{ - int title_len; - nk_hash title_hash; - title_len = (int)nk_strlen(name); - title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE); - return nk_find_window(ctx, title_hash, name); -} -NK_API void -nk_window_close(struct nk_context *ctx, const char *name) -{ - struct nk_window *win; - NK_ASSERT(ctx); - if (!ctx) return; - win = nk_window_find(ctx, name); - if (!win) return; - NK_ASSERT(ctx->current != win && "You cannot close a currently active window"); - if (ctx->current == win) return; - win->flags |= NK_WINDOW_HIDDEN; - win->flags |= NK_WINDOW_CLOSED; -} -NK_API void -nk_window_set_bounds(struct nk_context *ctx, - const char *name, struct nk_rect bounds) -{ - struct nk_window *win; - NK_ASSERT(ctx); - if (!ctx) return; - win = nk_window_find(ctx, name); - if (!win) return; - NK_ASSERT(ctx->current != win && "You cannot update a currently in procecss window"); - win->bounds = bounds; -} -NK_API void -nk_window_set_position(struct nk_context *ctx, - const char *name, struct nk_vec2 pos) -{ - struct nk_window *win = nk_window_find(ctx, name); - if (!win) return; - win->bounds.x = pos.x; - win->bounds.y = pos.y; -} -NK_API void -nk_window_set_size(struct nk_context *ctx, - const char *name, struct nk_vec2 size) -{ - struct nk_window *win = nk_window_find(ctx, name); - if (!win) return; - win->bounds.w = size.x; - win->bounds.h = size.y; -} -NK_API void -nk_window_set_scroll(struct nk_context *ctx, nk_uint offset_x, nk_uint offset_y) -{ - struct nk_window *win; - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - if (!ctx || !ctx->current) - return; - win = ctx->current; - win->scrollbar.x = offset_x; - win->scrollbar.y = offset_y; -} -NK_API void -nk_window_collapse(struct nk_context *ctx, const char *name, - enum nk_collapse_states c) -{ - int title_len; - nk_hash title_hash; - struct nk_window *win; - NK_ASSERT(ctx); - if (!ctx) return; - - title_len = (int)nk_strlen(name); - title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE); - win = nk_find_window(ctx, title_hash, name); - if (!win) return; - if (c == NK_MINIMIZED) - win->flags |= NK_WINDOW_MINIMIZED; - else win->flags &= ~(nk_flags)NK_WINDOW_MINIMIZED; -} -NK_API void -nk_window_collapse_if(struct nk_context *ctx, const char *name, - enum nk_collapse_states c, int cond) -{ - NK_ASSERT(ctx); - if (!ctx || !cond) return; - nk_window_collapse(ctx, name, c); -} -NK_API void -nk_window_show(struct nk_context *ctx, const char *name, enum nk_show_states s) -{ - int title_len; - nk_hash title_hash; - struct nk_window *win; - NK_ASSERT(ctx); - if (!ctx) return; - - title_len = (int)nk_strlen(name); - title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE); - win = nk_find_window(ctx, title_hash, name); - if (!win) return; - if (s == NK_HIDDEN) { - win->flags |= NK_WINDOW_HIDDEN; - } else win->flags &= ~(nk_flags)NK_WINDOW_HIDDEN; -} -NK_API void -nk_window_show_if(struct nk_context *ctx, const char *name, - enum nk_show_states s, int cond) -{ - NK_ASSERT(ctx); - if (!ctx || !cond) return; - nk_window_show(ctx, name, s); -} - -NK_API void -nk_window_set_focus(struct nk_context *ctx, const char *name) -{ - int title_len; - nk_hash title_hash; - struct nk_window *win; - NK_ASSERT(ctx); - if (!ctx) return; - - title_len = (int)nk_strlen(name); - title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE); - win = nk_find_window(ctx, title_hash, name); - if (win && ctx->end != win) { - nk_remove_window(ctx, win); - nk_insert_window(ctx, win, NK_INSERT_BACK); - } - ctx->active = win; -} - - - - -/* =============================================================== - * - * POPUP - * - * ===============================================================*/ -NK_API int -nk_popup_begin(struct nk_context *ctx, enum nk_popup_type type, - const char *title, nk_flags flags, struct nk_rect rect) -{ - struct nk_window *popup; - struct nk_window *win; - struct nk_panel *panel; - - int title_len; - nk_hash title_hash; - nk_size allocated; - - NK_ASSERT(ctx); - NK_ASSERT(title); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - win = ctx->current; - panel = win->layout; - NK_ASSERT(!(panel->type & NK_PANEL_SET_POPUP) && "popups are not allowed to have popups"); - (void)panel; - title_len = (int)nk_strlen(title); - title_hash = nk_murmur_hash(title, (int)title_len, NK_PANEL_POPUP); - - popup = win->popup.win; - if (!popup) { - popup = (struct nk_window*)nk_create_window(ctx); - popup->parent = win; - win->popup.win = popup; - win->popup.active = 0; - win->popup.type = NK_PANEL_POPUP; - } - - /* make sure we have correct popup */ - if (win->popup.name != title_hash) { - if (!win->popup.active) { - nk_zero(popup, sizeof(*popup)); - win->popup.name = title_hash; - win->popup.active = 1; - win->popup.type = NK_PANEL_POPUP; - } else return 0; - } - - /* popup position is local to window */ - ctx->current = popup; - rect.x += win->layout->clip.x; - rect.y += win->layout->clip.y; - - /* setup popup data */ - popup->parent = win; - popup->bounds = rect; - popup->seq = ctx->seq; - popup->layout = (struct nk_panel*)nk_create_panel(ctx); - popup->flags = flags; - popup->flags |= NK_WINDOW_BORDER; - if (type == NK_POPUP_DYNAMIC) - popup->flags |= NK_WINDOW_DYNAMIC; - - popup->buffer = win->buffer; - nk_start_popup(ctx, win); - allocated = ctx->memory.allocated; - nk_push_scissor(&popup->buffer, nk_null_rect); - - if (nk_panel_begin(ctx, title, NK_PANEL_POPUP)) { - /* popup is running therefore invalidate parent panels */ - struct nk_panel *root; - root = win->layout; - while (root) { - root->flags |= NK_WINDOW_ROM; - root->flags &= ~(nk_flags)NK_WINDOW_REMOVE_ROM; - root = root->parent; - } - win->popup.active = 1; - popup->layout->offset_x = &popup->scrollbar.x; - popup->layout->offset_y = &popup->scrollbar.y; - popup->layout->parent = win->layout; - return 1; - } else { - /* popup was closed/is invalid so cleanup */ - struct nk_panel *root; - root = win->layout; - while (root) { - root->flags |= NK_WINDOW_REMOVE_ROM; - root = root->parent; - } - win->popup.buf.active = 0; - win->popup.active = 0; - ctx->memory.allocated = allocated; - ctx->current = win; - nk_free_panel(ctx, popup->layout); - popup->layout = 0; - return 0; - } -} -NK_LIB int -nk_nonblock_begin(struct nk_context *ctx, - nk_flags flags, struct nk_rect body, struct nk_rect header, - enum nk_panel_type panel_type) -{ - struct nk_window *popup; - struct nk_window *win; - struct nk_panel *panel; - int is_active = nk_true; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - /* popups cannot have popups */ - win = ctx->current; - panel = win->layout; - NK_ASSERT(!(panel->type & NK_PANEL_SET_POPUP)); - (void)panel; - popup = win->popup.win; - if (!popup) { - /* create window for nonblocking popup */ - popup = (struct nk_window*)nk_create_window(ctx); - popup->parent = win; - win->popup.win = popup; - win->popup.type = panel_type; - nk_command_buffer_init(&popup->buffer, &ctx->memory, NK_CLIPPING_ON); - } else { - /* close the popup if user pressed outside or in the header */ - int pressed, in_body, in_header; -#ifdef NK_BUTTON_TRIGGER_ON_RELEASE - pressed = nk_input_is_mouse_released(&ctx->input, NK_BUTTON_LEFT); -#else - pressed = nk_input_is_mouse_pressed(&ctx->input, NK_BUTTON_LEFT); -#endif - in_body = nk_input_is_mouse_hovering_rect(&ctx->input, body); - in_header = nk_input_is_mouse_hovering_rect(&ctx->input, header); - if (pressed && (!in_body || in_header)) - is_active = nk_false; - } - win->popup.header = header; - - if (!is_active) { - /* remove read only mode from all parent panels */ - struct nk_panel *root = win->layout; - while (root) { - root->flags |= NK_WINDOW_REMOVE_ROM; - root = root->parent; - } - return is_active; - } - popup->bounds = body; - popup->parent = win; - popup->layout = (struct nk_panel*)nk_create_panel(ctx); - popup->flags = flags; - popup->flags |= NK_WINDOW_BORDER; - popup->flags |= NK_WINDOW_DYNAMIC; - popup->seq = ctx->seq; - win->popup.active = 1; - NK_ASSERT(popup->layout); - - nk_start_popup(ctx, win); - popup->buffer = win->buffer; - nk_push_scissor(&popup->buffer, nk_null_rect); - ctx->current = popup; - - nk_panel_begin(ctx, 0, panel_type); - win->buffer = popup->buffer; - popup->layout->parent = win->layout; - popup->layout->offset_x = &popup->scrollbar.x; - popup->layout->offset_y = &popup->scrollbar.y; - - /* set read only mode to all parent panels */ - {struct nk_panel *root; - root = win->layout; - while (root) { - root->flags |= NK_WINDOW_ROM; - root = root->parent; - }} - return is_active; -} -NK_API void -nk_popup_close(struct nk_context *ctx) -{ - struct nk_window *popup; - NK_ASSERT(ctx); - if (!ctx || !ctx->current) return; - - popup = ctx->current; - NK_ASSERT(popup->parent); - NK_ASSERT(popup->layout->type & NK_PANEL_SET_POPUP); - popup->flags |= NK_WINDOW_HIDDEN; -} -NK_API void -nk_popup_end(struct nk_context *ctx) -{ - struct nk_window *win; - struct nk_window *popup; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - popup = ctx->current; - if (!popup->parent) return; - win = popup->parent; - if (popup->flags & NK_WINDOW_HIDDEN) { - struct nk_panel *root; - root = win->layout; - while (root) { - root->flags |= NK_WINDOW_REMOVE_ROM; - root = root->parent; - } - win->popup.active = 0; - } - nk_push_scissor(&popup->buffer, nk_null_rect); - nk_end(ctx); - - win->buffer = popup->buffer; - nk_finish_popup(ctx, win); - ctx->current = win; - nk_push_scissor(&win->buffer, win->layout->clip); -} -NK_API void -nk_popup_get_scroll(struct nk_context *ctx, nk_uint *offset_x, nk_uint *offset_y) -{ - struct nk_window *popup; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - popup = ctx->current; - if (offset_x) - *offset_x = popup->scrollbar.x; - if (offset_y) - *offset_y = popup->scrollbar.y; -} -NK_API void -nk_popup_set_scroll(struct nk_context *ctx, nk_uint offset_x, nk_uint offset_y) -{ - struct nk_window *popup; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - popup = ctx->current; - popup->scrollbar.x = offset_x; - popup->scrollbar.y = offset_y; -} - - - - -/* ============================================================== - * - * CONTEXTUAL - * - * ===============================================================*/ -NK_API int -nk_contextual_begin(struct nk_context *ctx, nk_flags flags, struct nk_vec2 size, - struct nk_rect trigger_bounds) -{ - struct nk_window *win; - struct nk_window *popup; - struct nk_rect body; - - NK_STORAGE const struct nk_rect null_rect = {-1,-1,0,0}; - int is_clicked = 0; - int is_open = 0; - int ret = 0; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - win = ctx->current; - ++win->popup.con_count; - if (ctx->current != ctx->active) - return 0; - - /* check if currently active contextual is active */ - popup = win->popup.win; - is_open = (popup && win->popup.type == NK_PANEL_CONTEXTUAL); - is_clicked = nk_input_mouse_clicked(&ctx->input, NK_BUTTON_RIGHT, trigger_bounds); - if (win->popup.active_con && win->popup.con_count != win->popup.active_con) - return 0; - if (!is_open && win->popup.active_con) - win->popup.active_con = 0; - if ((!is_open && !is_clicked)) - return 0; - - /* calculate contextual position on click */ - win->popup.active_con = win->popup.con_count; - if (is_clicked) { - body.x = ctx->input.mouse.pos.x; - body.y = ctx->input.mouse.pos.y; - } else { - body.x = popup->bounds.x; - body.y = popup->bounds.y; - } - body.w = size.x; - body.h = size.y; - - /* start nonblocking contextual popup */ - ret = nk_nonblock_begin(ctx, flags|NK_WINDOW_NO_SCROLLBAR, body, - null_rect, NK_PANEL_CONTEXTUAL); - if (ret) win->popup.type = NK_PANEL_CONTEXTUAL; - else { - win->popup.active_con = 0; - win->popup.type = NK_PANEL_NONE; - if (win->popup.win) - win->popup.win->flags = 0; - } - return ret; -} -NK_API int -nk_contextual_item_text(struct nk_context *ctx, const char *text, int len, - nk_flags alignment) -{ - struct nk_window *win; - const struct nk_input *in; - const struct nk_style *style; - - struct nk_rect bounds; - enum nk_widget_layout_states state; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - win = ctx->current; - style = &ctx->style; - state = nk_widget_fitting(&bounds, ctx, style->contextual_button.padding); - if (!state) return nk_false; - - in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; - if (nk_do_button_text(&ctx->last_widget_state, &win->buffer, bounds, - text, len, alignment, NK_BUTTON_DEFAULT, &style->contextual_button, in, style->font)) { - nk_contextual_close(ctx); - return nk_true; - } - return nk_false; -} -NK_API int -nk_contextual_item_label(struct nk_context *ctx, const char *label, nk_flags align) -{ - return nk_contextual_item_text(ctx, label, nk_strlen(label), align); -} -NK_API int -nk_contextual_item_image_text(struct nk_context *ctx, struct nk_image img, - const char *text, int len, nk_flags align) -{ - struct nk_window *win; - const struct nk_input *in; - const struct nk_style *style; - - struct nk_rect bounds; - enum nk_widget_layout_states state; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - win = ctx->current; - style = &ctx->style; - state = nk_widget_fitting(&bounds, ctx, style->contextual_button.padding); - if (!state) return nk_false; - - in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; - if (nk_do_button_text_image(&ctx->last_widget_state, &win->buffer, bounds, - img, text, len, align, NK_BUTTON_DEFAULT, &style->contextual_button, style->font, in)){ - nk_contextual_close(ctx); - return nk_true; - } - return nk_false; -} -NK_API int -nk_contextual_item_image_label(struct nk_context *ctx, struct nk_image img, - const char *label, nk_flags align) -{ - return nk_contextual_item_image_text(ctx, img, label, nk_strlen(label), align); -} -NK_API int -nk_contextual_item_symbol_text(struct nk_context *ctx, enum nk_symbol_type symbol, - const char *text, int len, nk_flags align) -{ - struct nk_window *win; - const struct nk_input *in; - const struct nk_style *style; - - struct nk_rect bounds; - enum nk_widget_layout_states state; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - win = ctx->current; - style = &ctx->style; - state = nk_widget_fitting(&bounds, ctx, style->contextual_button.padding); - if (!state) return nk_false; - - in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; - if (nk_do_button_text_symbol(&ctx->last_widget_state, &win->buffer, bounds, - symbol, text, len, align, NK_BUTTON_DEFAULT, &style->contextual_button, style->font, in)) { - nk_contextual_close(ctx); - return nk_true; - } - return nk_false; -} -NK_API int -nk_contextual_item_symbol_label(struct nk_context *ctx, enum nk_symbol_type symbol, - const char *text, nk_flags align) -{ - return nk_contextual_item_symbol_text(ctx, symbol, text, nk_strlen(text), align); -} -NK_API void -nk_contextual_close(struct nk_context *ctx) -{ - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) return; - nk_popup_close(ctx); -} -NK_API void -nk_contextual_end(struct nk_context *ctx) -{ - struct nk_window *popup; - struct nk_panel *panel; - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - if (!ctx || !ctx->current) return; - - popup = ctx->current; - panel = popup->layout; - NK_ASSERT(popup->parent); - NK_ASSERT(panel->type & NK_PANEL_SET_POPUP); - if (panel->flags & NK_WINDOW_DYNAMIC) { - /* Close behavior - This is a bit of a hack solution since we do not know before we end our popup - how big it will be. We therefore do not directly know when a - click outside the non-blocking popup must close it at that direct frame. - Instead it will be closed in the next frame.*/ - struct nk_rect body = {0,0,0,0}; - if (panel->at_y < (panel->bounds.y + panel->bounds.h)) { - struct nk_vec2 padding = nk_panel_get_padding(&ctx->style, panel->type); - body = panel->bounds; - body.y = (panel->at_y + panel->footer_height + panel->border + padding.y + panel->row.height); - body.h = (panel->bounds.y + panel->bounds.h) - body.y; - } - {int pressed = nk_input_is_mouse_pressed(&ctx->input, NK_BUTTON_LEFT); - int in_body = nk_input_is_mouse_hovering_rect(&ctx->input, body); - if (pressed && in_body) - popup->flags |= NK_WINDOW_HIDDEN; - } - } - if (popup->flags & NK_WINDOW_HIDDEN) - popup->seq = 0; - nk_popup_end(ctx); - return; -} - - - - - -/* =============================================================== - * - * MENU - * - * ===============================================================*/ -NK_API void -nk_menubar_begin(struct nk_context *ctx) -{ - struct nk_panel *layout; - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - layout = ctx->current->layout; - NK_ASSERT(layout->at_y == layout->bounds.y); - /* if this assert triggers you allocated space between nk_begin and nk_menubar_begin. - If you want a menubar the first nuklear function after `nk_begin` has to be a - `nk_menubar_begin` call. Inside the menubar you then have to allocate space for - widgets (also supports multiple rows). - Example: - if (nk_begin(...)) { - nk_menubar_begin(...); - nk_layout_xxxx(...); - nk_button(...); - nk_layout_xxxx(...); - nk_button(...); - nk_menubar_end(...); - } - nk_end(...); - */ - if (layout->flags & NK_WINDOW_HIDDEN || layout->flags & NK_WINDOW_MINIMIZED) - return; - - layout->menu.x = layout->at_x; - layout->menu.y = layout->at_y + layout->row.height; - layout->menu.w = layout->bounds.w; - layout->menu.offset.x = *layout->offset_x; - layout->menu.offset.y = *layout->offset_y; - *layout->offset_y = 0; -} -NK_API void -nk_menubar_end(struct nk_context *ctx) -{ - struct nk_window *win; - struct nk_panel *layout; - struct nk_command_buffer *out; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - win = ctx->current; - out = &win->buffer; - layout = win->layout; - if (layout->flags & NK_WINDOW_HIDDEN || layout->flags & NK_WINDOW_MINIMIZED) - return; - - layout->menu.h = layout->at_y - layout->menu.y; - layout->bounds.y += layout->menu.h + ctx->style.window.spacing.y + layout->row.height; - layout->bounds.h -= layout->menu.h + ctx->style.window.spacing.y + layout->row.height; - - *layout->offset_x = layout->menu.offset.x; - *layout->offset_y = layout->menu.offset.y; - layout->at_y = layout->bounds.y - layout->row.height; - - layout->clip.y = layout->bounds.y; - layout->clip.h = layout->bounds.h; - nk_push_scissor(out, layout->clip); -} -NK_INTERN int -nk_menu_begin(struct nk_context *ctx, struct nk_window *win, - const char *id, int is_clicked, struct nk_rect header, struct nk_vec2 size) -{ - int is_open = 0; - int is_active = 0; - struct nk_rect body; - struct nk_window *popup; - nk_hash hash = nk_murmur_hash(id, (int)nk_strlen(id), NK_PANEL_MENU); - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - body.x = header.x; - body.w = size.x; - body.y = header.y + header.h; - body.h = size.y; - - popup = win->popup.win; - is_open = popup ? nk_true : nk_false; - is_active = (popup && (win->popup.name == hash) && win->popup.type == NK_PANEL_MENU); - if ((is_clicked && is_open && !is_active) || (is_open && !is_active) || - (!is_open && !is_active && !is_clicked)) return 0; - if (!nk_nonblock_begin(ctx, NK_WINDOW_NO_SCROLLBAR, body, header, NK_PANEL_MENU)) - return 0; - - win->popup.type = NK_PANEL_MENU; - win->popup.name = hash; - return 1; -} -NK_API int -nk_menu_begin_text(struct nk_context *ctx, const char *title, int len, - nk_flags align, struct nk_vec2 size) -{ - struct nk_window *win; - const struct nk_input *in; - struct nk_rect header; - int is_clicked = nk_false; - nk_flags state; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - win = ctx->current; - state = nk_widget(&header, ctx); - if (!state) return 0; - in = (state == NK_WIDGET_ROM || win->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; - if (nk_do_button_text(&ctx->last_widget_state, &win->buffer, header, - title, len, align, NK_BUTTON_DEFAULT, &ctx->style.menu_button, in, ctx->style.font)) - is_clicked = nk_true; - return nk_menu_begin(ctx, win, title, is_clicked, header, size); -} -NK_API int nk_menu_begin_label(struct nk_context *ctx, - const char *text, nk_flags align, struct nk_vec2 size) -{ - return nk_menu_begin_text(ctx, text, nk_strlen(text), align, size); -} -NK_API int -nk_menu_begin_image(struct nk_context *ctx, const char *id, struct nk_image img, - struct nk_vec2 size) -{ - struct nk_window *win; - struct nk_rect header; - const struct nk_input *in; - int is_clicked = nk_false; - nk_flags state; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - win = ctx->current; - state = nk_widget(&header, ctx); - if (!state) return 0; - in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; - if (nk_do_button_image(&ctx->last_widget_state, &win->buffer, header, - img, NK_BUTTON_DEFAULT, &ctx->style.menu_button, in)) - is_clicked = nk_true; - return nk_menu_begin(ctx, win, id, is_clicked, header, size); -} -NK_API int -nk_menu_begin_symbol(struct nk_context *ctx, const char *id, - enum nk_symbol_type sym, struct nk_vec2 size) -{ - struct nk_window *win; - const struct nk_input *in; - struct nk_rect header; - int is_clicked = nk_false; - nk_flags state; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - win = ctx->current; - state = nk_widget(&header, ctx); - if (!state) return 0; - in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; - if (nk_do_button_symbol(&ctx->last_widget_state, &win->buffer, header, - sym, NK_BUTTON_DEFAULT, &ctx->style.menu_button, in, ctx->style.font)) - is_clicked = nk_true; - return nk_menu_begin(ctx, win, id, is_clicked, header, size); -} -NK_API int -nk_menu_begin_image_text(struct nk_context *ctx, const char *title, int len, - nk_flags align, struct nk_image img, struct nk_vec2 size) -{ - struct nk_window *win; - struct nk_rect header; - const struct nk_input *in; - int is_clicked = nk_false; - nk_flags state; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - win = ctx->current; - state = nk_widget(&header, ctx); - if (!state) return 0; - in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; - if (nk_do_button_text_image(&ctx->last_widget_state, &win->buffer, - header, img, title, len, align, NK_BUTTON_DEFAULT, &ctx->style.menu_button, - ctx->style.font, in)) - is_clicked = nk_true; - return nk_menu_begin(ctx, win, title, is_clicked, header, size); -} -NK_API int -nk_menu_begin_image_label(struct nk_context *ctx, - const char *title, nk_flags align, struct nk_image img, struct nk_vec2 size) -{ - return nk_menu_begin_image_text(ctx, title, nk_strlen(title), align, img, size); -} -NK_API int -nk_menu_begin_symbol_text(struct nk_context *ctx, const char *title, int len, - nk_flags align, enum nk_symbol_type sym, struct nk_vec2 size) -{ - struct nk_window *win; - struct nk_rect header; - const struct nk_input *in; - int is_clicked = nk_false; - nk_flags state; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - win = ctx->current; - state = nk_widget(&header, ctx); - if (!state) return 0; - - in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; - if (nk_do_button_text_symbol(&ctx->last_widget_state, &win->buffer, - header, sym, title, len, align, NK_BUTTON_DEFAULT, &ctx->style.menu_button, - ctx->style.font, in)) is_clicked = nk_true; - return nk_menu_begin(ctx, win, title, is_clicked, header, size); -} -NK_API int -nk_menu_begin_symbol_label(struct nk_context *ctx, - const char *title, nk_flags align, enum nk_symbol_type sym, struct nk_vec2 size ) -{ - return nk_menu_begin_symbol_text(ctx, title, nk_strlen(title), align,sym,size); -} -NK_API int -nk_menu_item_text(struct nk_context *ctx, const char *title, int len, nk_flags align) -{ - return nk_contextual_item_text(ctx, title, len, align); -} -NK_API int -nk_menu_item_label(struct nk_context *ctx, const char *label, nk_flags align) -{ - return nk_contextual_item_label(ctx, label, align); -} -NK_API int -nk_menu_item_image_label(struct nk_context *ctx, struct nk_image img, - const char *label, nk_flags align) -{ - return nk_contextual_item_image_label(ctx, img, label, align); -} -NK_API int -nk_menu_item_image_text(struct nk_context *ctx, struct nk_image img, - const char *text, int len, nk_flags align) -{ - return nk_contextual_item_image_text(ctx, img, text, len, align); -} -NK_API int nk_menu_item_symbol_text(struct nk_context *ctx, enum nk_symbol_type sym, - const char *text, int len, nk_flags align) -{ - return nk_contextual_item_symbol_text(ctx, sym, text, len, align); -} -NK_API int nk_menu_item_symbol_label(struct nk_context *ctx, enum nk_symbol_type sym, - const char *label, nk_flags align) -{ - return nk_contextual_item_symbol_label(ctx, sym, label, align); -} -NK_API void nk_menu_close(struct nk_context *ctx) -{ - nk_contextual_close(ctx); -} -NK_API void -nk_menu_end(struct nk_context *ctx) -{ - nk_contextual_end(ctx); -} - - - - - -/* =============================================================== - * - * LAYOUT - * - * ===============================================================*/ -NK_API void -nk_layout_set_min_row_height(struct nk_context *ctx, float height) -{ - struct nk_window *win; - struct nk_panel *layout; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - win = ctx->current; - layout = win->layout; - layout->row.min_height = height; -} -NK_API void -nk_layout_reset_min_row_height(struct nk_context *ctx) -{ - struct nk_window *win; - struct nk_panel *layout; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - win = ctx->current; - layout = win->layout; - layout->row.min_height = ctx->style.font->height; - layout->row.min_height += ctx->style.text.padding.y*2; - layout->row.min_height += ctx->style.window.min_row_height_padding*2; -} -NK_LIB float -nk_layout_row_calculate_usable_space(const struct nk_style *style, enum nk_panel_type type, - float total_space, int columns) -{ - float panel_padding; - float panel_spacing; - float panel_space; - - struct nk_vec2 spacing; - struct nk_vec2 padding; - - spacing = style->window.spacing; - padding = nk_panel_get_padding(style, type); - - /* calculate the usable panel space */ - panel_padding = 2 * padding.x; - panel_spacing = (float)NK_MAX(columns - 1, 0) * spacing.x; - panel_space = total_space - panel_padding - panel_spacing; - return panel_space; -} -NK_LIB void -nk_panel_layout(const struct nk_context *ctx, struct nk_window *win, - float height, int cols) -{ - struct nk_panel *layout; - const struct nk_style *style; - struct nk_command_buffer *out; - - struct nk_vec2 item_spacing; - struct nk_color color; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - /* prefetch some configuration data */ - layout = win->layout; - style = &ctx->style; - out = &win->buffer; - color = style->window.background; - item_spacing = style->window.spacing; - - /* if one of these triggers you forgot to add an `if` condition around either - a window, group, popup, combobox or contextual menu `begin` and `end` block. - Example: - if (nk_begin(...) {...} nk_end(...); or - if (nk_group_begin(...) { nk_group_end(...);} */ - NK_ASSERT(!(layout->flags & NK_WINDOW_MINIMIZED)); - NK_ASSERT(!(layout->flags & NK_WINDOW_HIDDEN)); - NK_ASSERT(!(layout->flags & NK_WINDOW_CLOSED)); - - /* update the current row and set the current row layout */ - layout->row.index = 0; - layout->at_y += layout->row.height; - layout->row.columns = cols; - if (height == 0.0f) - layout->row.height = NK_MAX(height, layout->row.min_height) + item_spacing.y; - else layout->row.height = height + item_spacing.y; - - layout->row.item_offset = 0; - if (layout->flags & NK_WINDOW_DYNAMIC) { - /* draw background for dynamic panels */ - struct nk_rect background; - background.x = win->bounds.x; - background.w = win->bounds.w; - background.y = layout->at_y - 1.0f; - background.h = layout->row.height + 1.0f; - nk_fill_rect(out, background, 0, color); - } -} -NK_LIB void -nk_row_layout(struct nk_context *ctx, enum nk_layout_format fmt, - float height, int cols, int width) -{ - /* update the current row and set the current row layout */ - struct nk_window *win; - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - win = ctx->current; - nk_panel_layout(ctx, win, height, cols); - if (fmt == NK_DYNAMIC) - win->layout->row.type = NK_LAYOUT_DYNAMIC_FIXED; - else win->layout->row.type = NK_LAYOUT_STATIC_FIXED; - - win->layout->row.ratio = 0; - win->layout->row.filled = 0; - win->layout->row.item_offset = 0; - win->layout->row.item_width = (float)width; -} -NK_API float -nk_layout_ratio_from_pixel(struct nk_context *ctx, float pixel_width) -{ - struct nk_window *win; - NK_ASSERT(ctx); - NK_ASSERT(pixel_width); - if (!ctx || !ctx->current || !ctx->current->layout) return 0; - win = ctx->current; - return NK_CLAMP(0.0f, pixel_width/win->bounds.x, 1.0f); -} -NK_API void -nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols) -{ - nk_row_layout(ctx, NK_DYNAMIC, height, cols, 0); -} -NK_API void -nk_layout_row_static(struct nk_context *ctx, float height, int item_width, int cols) -{ - nk_row_layout(ctx, NK_STATIC, height, cols, item_width); -} -NK_API void -nk_layout_row_begin(struct nk_context *ctx, enum nk_layout_format fmt, - float row_height, int cols) -{ - struct nk_window *win; - struct nk_panel *layout; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - win = ctx->current; - layout = win->layout; - nk_panel_layout(ctx, win, row_height, cols); - if (fmt == NK_DYNAMIC) - layout->row.type = NK_LAYOUT_DYNAMIC_ROW; - else layout->row.type = NK_LAYOUT_STATIC_ROW; - - layout->row.ratio = 0; - layout->row.filled = 0; - layout->row.item_width = 0; - layout->row.item_offset = 0; - layout->row.columns = cols; -} -NK_API void -nk_layout_row_push(struct nk_context *ctx, float ratio_or_width) -{ - struct nk_window *win; - struct nk_panel *layout; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - win = ctx->current; - layout = win->layout; - NK_ASSERT(layout->row.type == NK_LAYOUT_STATIC_ROW || layout->row.type == NK_LAYOUT_DYNAMIC_ROW); - if (layout->row.type != NK_LAYOUT_STATIC_ROW && layout->row.type != NK_LAYOUT_DYNAMIC_ROW) - return; - - if (layout->row.type == NK_LAYOUT_DYNAMIC_ROW) { - float ratio = ratio_or_width; - if ((ratio + layout->row.filled) > 1.0f) return; - if (ratio > 0.0f) - layout->row.item_width = NK_SATURATE(ratio); - else layout->row.item_width = 1.0f - layout->row.filled; - } else layout->row.item_width = ratio_or_width; -} -NK_API void -nk_layout_row_end(struct nk_context *ctx) -{ - struct nk_window *win; - struct nk_panel *layout; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - win = ctx->current; - layout = win->layout; - NK_ASSERT(layout->row.type == NK_LAYOUT_STATIC_ROW || layout->row.type == NK_LAYOUT_DYNAMIC_ROW); - if (layout->row.type != NK_LAYOUT_STATIC_ROW && layout->row.type != NK_LAYOUT_DYNAMIC_ROW) - return; - layout->row.item_width = 0; - layout->row.item_offset = 0; -} -NK_API void -nk_layout_row(struct nk_context *ctx, enum nk_layout_format fmt, - float height, int cols, const float *ratio) -{ - int i; - int n_undef = 0; - struct nk_window *win; - struct nk_panel *layout; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - win = ctx->current; - layout = win->layout; - nk_panel_layout(ctx, win, height, cols); - if (fmt == NK_DYNAMIC) { - /* calculate width of undefined widget ratios */ - float r = 0; - layout->row.ratio = ratio; - for (i = 0; i < cols; ++i) { - if (ratio[i] < 0.0f) - n_undef++; - else r += ratio[i]; - } - r = NK_SATURATE(1.0f - r); - layout->row.type = NK_LAYOUT_DYNAMIC; - layout->row.item_width = (r > 0 && n_undef > 0) ? (r / (float)n_undef):0; - } else { - layout->row.ratio = ratio; - layout->row.type = NK_LAYOUT_STATIC; - layout->row.item_width = 0; - layout->row.item_offset = 0; - } - layout->row.item_offset = 0; - layout->row.filled = 0; -} -NK_API void -nk_layout_row_template_begin(struct nk_context *ctx, float height) -{ - struct nk_window *win; - struct nk_panel *layout; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - win = ctx->current; - layout = win->layout; - nk_panel_layout(ctx, win, height, 1); - layout->row.type = NK_LAYOUT_TEMPLATE; - layout->row.columns = 0; - layout->row.ratio = 0; - layout->row.item_width = 0; - layout->row.item_height = 0; - layout->row.item_offset = 0; - layout->row.filled = 0; - layout->row.item.x = 0; - layout->row.item.y = 0; - layout->row.item.w = 0; - layout->row.item.h = 0; -} -NK_API void -nk_layout_row_template_push_dynamic(struct nk_context *ctx) -{ - struct nk_window *win; - struct nk_panel *layout; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - win = ctx->current; - layout = win->layout; - NK_ASSERT(layout->row.type == NK_LAYOUT_TEMPLATE); - NK_ASSERT(layout->row.columns < NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS); - if (layout->row.type != NK_LAYOUT_TEMPLATE) return; - if (layout->row.columns >= NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS) return; - layout->row.templates[layout->row.columns++] = -1.0f; -} -NK_API void -nk_layout_row_template_push_variable(struct nk_context *ctx, float min_width) -{ - struct nk_window *win; - struct nk_panel *layout; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - win = ctx->current; - layout = win->layout; - NK_ASSERT(layout->row.type == NK_LAYOUT_TEMPLATE); - NK_ASSERT(layout->row.columns < NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS); - if (layout->row.type != NK_LAYOUT_TEMPLATE) return; - if (layout->row.columns >= NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS) return; - layout->row.templates[layout->row.columns++] = -min_width; -} -NK_API void -nk_layout_row_template_push_static(struct nk_context *ctx, float width) -{ - struct nk_window *win; - struct nk_panel *layout; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - win = ctx->current; - layout = win->layout; - NK_ASSERT(layout->row.type == NK_LAYOUT_TEMPLATE); - NK_ASSERT(layout->row.columns < NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS); - if (layout->row.type != NK_LAYOUT_TEMPLATE) return; - if (layout->row.columns >= NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS) return; - layout->row.templates[layout->row.columns++] = width; -} -NK_API void -nk_layout_row_template_end(struct nk_context *ctx) -{ - struct nk_window *win; - struct nk_panel *layout; - - int i = 0; - int variable_count = 0; - int min_variable_count = 0; - float min_fixed_width = 0.0f; - float total_fixed_width = 0.0f; - float max_variable_width = 0.0f; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - win = ctx->current; - layout = win->layout; - NK_ASSERT(layout->row.type == NK_LAYOUT_TEMPLATE); - if (layout->row.type != NK_LAYOUT_TEMPLATE) return; - for (i = 0; i < layout->row.columns; ++i) { - float width = layout->row.templates[i]; - if (width >= 0.0f) { - total_fixed_width += width; - min_fixed_width += width; - } else if (width < -1.0f) { - width = -width; - total_fixed_width += width; - max_variable_width = NK_MAX(max_variable_width, width); - variable_count++; - } else { - min_variable_count++; - variable_count++; - } - } - if (variable_count) { - float space = nk_layout_row_calculate_usable_space(&ctx->style, layout->type, - layout->bounds.w, layout->row.columns); - float var_width = (NK_MAX(space-min_fixed_width,0.0f)) / (float)variable_count; - int enough_space = var_width >= max_variable_width; - if (!enough_space) - var_width = (NK_MAX(space-total_fixed_width,0)) / (float)min_variable_count; - for (i = 0; i < layout->row.columns; ++i) { - float *width = &layout->row.templates[i]; - *width = (*width >= 0.0f)? *width: (*width < -1.0f && !enough_space)? -(*width): var_width; - } - } -} -NK_API void -nk_layout_space_begin(struct nk_context *ctx, enum nk_layout_format fmt, - float height, int widget_count) -{ - struct nk_window *win; - struct nk_panel *layout; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - win = ctx->current; - layout = win->layout; - nk_panel_layout(ctx, win, height, widget_count); - if (fmt == NK_STATIC) - layout->row.type = NK_LAYOUT_STATIC_FREE; - else layout->row.type = NK_LAYOUT_DYNAMIC_FREE; - - layout->row.ratio = 0; - layout->row.filled = 0; - layout->row.item_width = 0; - layout->row.item_offset = 0; -} -NK_API void -nk_layout_space_end(struct nk_context *ctx) -{ - struct nk_window *win; - struct nk_panel *layout; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - win = ctx->current; - layout = win->layout; - layout->row.item_width = 0; - layout->row.item_height = 0; - layout->row.item_offset = 0; - nk_zero(&layout->row.item, sizeof(layout->row.item)); -} -NK_API void -nk_layout_space_push(struct nk_context *ctx, struct nk_rect rect) -{ - struct nk_window *win; - struct nk_panel *layout; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - win = ctx->current; - layout = win->layout; - layout->row.item = rect; -} -NK_API struct nk_rect -nk_layout_space_bounds(struct nk_context *ctx) -{ - struct nk_rect ret; - struct nk_window *win; - struct nk_panel *layout; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - win = ctx->current; - layout = win->layout; - - ret.x = layout->clip.x; - ret.y = layout->clip.y; - ret.w = layout->clip.w; - ret.h = layout->row.height; - return ret; -} -NK_API struct nk_rect -nk_layout_widget_bounds(struct nk_context *ctx) -{ - struct nk_rect ret; - struct nk_window *win; - struct nk_panel *layout; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - win = ctx->current; - layout = win->layout; - - ret.x = layout->at_x; - ret.y = layout->at_y; - ret.w = layout->bounds.w - NK_MAX(layout->at_x - layout->bounds.x,0); - ret.h = layout->row.height; - return ret; -} -NK_API struct nk_vec2 -nk_layout_space_to_screen(struct nk_context *ctx, struct nk_vec2 ret) -{ - struct nk_window *win; - struct nk_panel *layout; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - win = ctx->current; - layout = win->layout; - - ret.x += layout->at_x - (float)*layout->offset_x; - ret.y += layout->at_y - (float)*layout->offset_y; - return ret; -} -NK_API struct nk_vec2 -nk_layout_space_to_local(struct nk_context *ctx, struct nk_vec2 ret) -{ - struct nk_window *win; - struct nk_panel *layout; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - win = ctx->current; - layout = win->layout; - - ret.x += -layout->at_x + (float)*layout->offset_x; - ret.y += -layout->at_y + (float)*layout->offset_y; - return ret; -} -NK_API struct nk_rect -nk_layout_space_rect_to_screen(struct nk_context *ctx, struct nk_rect ret) -{ - struct nk_window *win; - struct nk_panel *layout; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - win = ctx->current; - layout = win->layout; - - ret.x += layout->at_x - (float)*layout->offset_x; - ret.y += layout->at_y - (float)*layout->offset_y; - return ret; -} -NK_API struct nk_rect -nk_layout_space_rect_to_local(struct nk_context *ctx, struct nk_rect ret) -{ - struct nk_window *win; - struct nk_panel *layout; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - win = ctx->current; - layout = win->layout; - - ret.x += -layout->at_x + (float)*layout->offset_x; - ret.y += -layout->at_y + (float)*layout->offset_y; - return ret; -} -NK_LIB void -nk_panel_alloc_row(const struct nk_context *ctx, struct nk_window *win) -{ - struct nk_panel *layout = win->layout; - struct nk_vec2 spacing = ctx->style.window.spacing; - const float row_height = layout->row.height - spacing.y; - nk_panel_layout(ctx, win, row_height, layout->row.columns); -} -NK_LIB void -nk_layout_widget_space(struct nk_rect *bounds, const struct nk_context *ctx, - struct nk_window *win, int modify) -{ - struct nk_panel *layout; - const struct nk_style *style; - - struct nk_vec2 spacing; - struct nk_vec2 padding; - - float item_offset = 0; - float item_width = 0; - float item_spacing = 0; - float panel_space = 0; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - win = ctx->current; - layout = win->layout; - style = &ctx->style; - NK_ASSERT(bounds); - - spacing = style->window.spacing; - padding = nk_panel_get_padding(style, layout->type); - panel_space = nk_layout_row_calculate_usable_space(&ctx->style, layout->type, - layout->bounds.w, layout->row.columns); - - #define NK_FRAC(x) (x - (int)x) /* will be used to remove fookin gaps */ - /* calculate the width of one item inside the current layout space */ - switch (layout->row.type) { - case NK_LAYOUT_DYNAMIC_FIXED: { - /* scaling fixed size widgets item width */ - float w = NK_MAX(1.0f,panel_space) / (float)layout->row.columns; - item_offset = (float)layout->row.index * w; - item_width = w + NK_FRAC(item_offset); - item_spacing = (float)layout->row.index * spacing.x; - } break; - case NK_LAYOUT_DYNAMIC_ROW: { - /* scaling single ratio widget width */ - float w = layout->row.item_width * panel_space; - item_offset = layout->row.item_offset; - item_width = w + NK_FRAC(item_offset); - item_spacing = 0; - - if (modify) { - layout->row.item_offset += w + spacing.x; - layout->row.filled += layout->row.item_width; - layout->row.index = 0; - } - } break; - case NK_LAYOUT_DYNAMIC_FREE: { - /* panel width depended free widget placing */ - bounds->x = layout->at_x + (layout->bounds.w * layout->row.item.x); - bounds->x -= (float)*layout->offset_x; - bounds->y = layout->at_y + (layout->row.height * layout->row.item.y); - bounds->y -= (float)*layout->offset_y; - bounds->w = layout->bounds.w * layout->row.item.w + NK_FRAC(bounds->x); - bounds->h = layout->row.height * layout->row.item.h + NK_FRAC(bounds->y); - return; - } - case NK_LAYOUT_DYNAMIC: { - /* scaling arrays of panel width ratios for every widget */ - float ratio, w; - NK_ASSERT(layout->row.ratio); - ratio = (layout->row.ratio[layout->row.index] < 0) ? - layout->row.item_width : layout->row.ratio[layout->row.index]; - - w = (ratio * panel_space); - item_spacing = (float)layout->row.index * spacing.x; - item_offset = layout->row.item_offset; - item_width = w + NK_FRAC(item_offset); - - if (modify) { - layout->row.item_offset += w; - layout->row.filled += ratio; - } - } break; - case NK_LAYOUT_STATIC_FIXED: { - /* non-scaling fixed widgets item width */ - item_width = layout->row.item_width; - item_offset = (float)layout->row.index * item_width; - item_spacing = (float)layout->row.index * spacing.x; - } break; - case NK_LAYOUT_STATIC_ROW: { - /* scaling single ratio widget width */ - item_width = layout->row.item_width; - item_offset = layout->row.item_offset; - item_spacing = (float)layout->row.index * spacing.x; - if (modify) layout->row.item_offset += item_width; - } break; - case NK_LAYOUT_STATIC_FREE: { - /* free widget placing */ - bounds->x = layout->at_x + layout->row.item.x; - bounds->w = layout->row.item.w; - if (((bounds->x + bounds->w) > layout->max_x) && modify) - layout->max_x = (bounds->x + bounds->w); - bounds->x -= (float)*layout->offset_x; - bounds->y = layout->at_y + layout->row.item.y; - bounds->y -= (float)*layout->offset_y; - bounds->h = layout->row.item.h; - return; - } - case NK_LAYOUT_STATIC: { - /* non-scaling array of panel pixel width for every widget */ - item_spacing = (float)layout->row.index * spacing.x; - item_width = layout->row.ratio[layout->row.index]; - item_offset = layout->row.item_offset; - if (modify) layout->row.item_offset += item_width; - } break; - case NK_LAYOUT_TEMPLATE: { - /* stretchy row layout with combined dynamic/static widget width*/ - float w; - NK_ASSERT(layout->row.index < layout->row.columns); - NK_ASSERT(layout->row.index < NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS); - w = layout->row.templates[layout->row.index]; - item_offset = layout->row.item_offset; - item_width = w + NK_FRAC(item_offset); - item_spacing = (float)layout->row.index * spacing.x; - if (modify) layout->row.item_offset += w; - } break; - #undef NK_FRAC - default: NK_ASSERT(0); break; - }; - - /* set the bounds of the newly allocated widget */ - bounds->w = item_width; - bounds->h = layout->row.height - spacing.y; - bounds->y = layout->at_y - (float)*layout->offset_y; - bounds->x = layout->at_x + item_offset + item_spacing + padding.x; - if (((bounds->x + bounds->w) > layout->max_x) && modify) - layout->max_x = bounds->x + bounds->w; - bounds->x -= (float)*layout->offset_x; -} -NK_LIB void -nk_panel_alloc_space(struct nk_rect *bounds, const struct nk_context *ctx) -{ - struct nk_window *win; - struct nk_panel *layout; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - /* check if the end of the row has been hit and begin new row if so */ - win = ctx->current; - layout = win->layout; - if (layout->row.index >= layout->row.columns) - nk_panel_alloc_row(ctx, win); - - /* calculate widget position and size */ - nk_layout_widget_space(bounds, ctx, win, nk_true); - layout->row.index++; -} -NK_LIB void -nk_layout_peek(struct nk_rect *bounds, struct nk_context *ctx) -{ - float y; - int index; - struct nk_window *win; - struct nk_panel *layout; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - win = ctx->current; - layout = win->layout; - y = layout->at_y; - index = layout->row.index; - if (layout->row.index >= layout->row.columns) { - layout->at_y += layout->row.height; - layout->row.index = 0; - } - nk_layout_widget_space(bounds, ctx, win, nk_false); - if (!layout->row.index) { - bounds->x -= layout->row.item_offset; - } - layout->at_y = y; - layout->row.index = index; -} - - - - - -/* =============================================================== - * - * TREE - * - * ===============================================================*/ -NK_INTERN int -nk_tree_state_base(struct nk_context *ctx, enum nk_tree_type type, - struct nk_image *img, const char *title, enum nk_collapse_states *state) -{ - struct nk_window *win; - struct nk_panel *layout; - const struct nk_style *style; - struct nk_command_buffer *out; - const struct nk_input *in; - const struct nk_style_button *button; - enum nk_symbol_type symbol; - float row_height; - - struct nk_vec2 item_spacing; - struct nk_rect header = {0,0,0,0}; - struct nk_rect sym = {0,0,0,0}; - struct nk_text text; - - nk_flags ws = 0; - enum nk_widget_layout_states widget_state; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - /* cache some data */ - win = ctx->current; - layout = win->layout; - out = &win->buffer; - style = &ctx->style; - item_spacing = style->window.spacing; - - /* calculate header bounds and draw background */ - row_height = style->font->height + 2 * style->tab.padding.y; - nk_layout_set_min_row_height(ctx, row_height); - nk_layout_row_dynamic(ctx, row_height, 1); - nk_layout_reset_min_row_height(ctx); - - widget_state = nk_widget(&header, ctx); - if (type == NK_TREE_TAB) { - const struct nk_style_item *background = &style->tab.background; - if (background->type == NK_STYLE_ITEM_IMAGE) { - nk_draw_image(out, header, &background->data.image, nk_white); - text.background = nk_rgba(0,0,0,0); - } else { - text.background = background->data.color; - nk_fill_rect(out, header, 0, style->tab.border_color); - nk_fill_rect(out, nk_shrink_rect(header, style->tab.border), - style->tab.rounding, background->data.color); - } - } else text.background = style->window.background; - - /* update node state */ - in = (!(layout->flags & NK_WINDOW_ROM)) ? &ctx->input: 0; - in = (in && widget_state == NK_WIDGET_VALID) ? &ctx->input : 0; - if (nk_button_behavior(&ws, header, in, NK_BUTTON_DEFAULT)) - *state = (*state == NK_MAXIMIZED) ? NK_MINIMIZED : NK_MAXIMIZED; - - /* select correct button style */ - if (*state == NK_MAXIMIZED) { - symbol = style->tab.sym_maximize; - if (type == NK_TREE_TAB) - button = &style->tab.tab_maximize_button; - else button = &style->tab.node_maximize_button; - } else { - symbol = style->tab.sym_minimize; - if (type == NK_TREE_TAB) - button = &style->tab.tab_minimize_button; - else button = &style->tab.node_minimize_button; - } - - {/* draw triangle button */ - sym.w = sym.h = style->font->height; - sym.y = header.y + style->tab.padding.y; - sym.x = header.x + style->tab.padding.x; - nk_do_button_symbol(&ws, &win->buffer, sym, symbol, NK_BUTTON_DEFAULT, - button, 0, style->font); - - if (img) { - /* draw optional image icon */ - sym.x = sym.x + sym.w + 4 * item_spacing.x; - nk_draw_image(&win->buffer, sym, img, nk_white); - sym.w = style->font->height + style->tab.spacing.x;} - } - - {/* draw label */ - struct nk_rect label; - header.w = NK_MAX(header.w, sym.w + item_spacing.x); - label.x = sym.x + sym.w + item_spacing.x; - label.y = sym.y; - label.w = header.w - (sym.w + item_spacing.y + style->tab.indent); - label.h = style->font->height; - text.text = style->tab.text; - text.padding = nk_vec2(0,0); - nk_widget_text(out, label, title, nk_strlen(title), &text, - NK_TEXT_LEFT, style->font);} - - /* increase x-axis cursor widget position pointer */ - if (*state == NK_MAXIMIZED) { - layout->at_x = header.x + (float)*layout->offset_x + style->tab.indent; - layout->bounds.w = NK_MAX(layout->bounds.w, style->tab.indent); - layout->bounds.w -= (style->tab.indent + style->window.padding.x); - layout->row.tree_depth++; - return nk_true; - } else return nk_false; -} -NK_INTERN int -nk_tree_base(struct nk_context *ctx, enum nk_tree_type type, - struct nk_image *img, const char *title, enum nk_collapse_states initial_state, - const char *hash, int len, int line) -{ - struct nk_window *win = ctx->current; - int title_len = 0; - nk_hash tree_hash = 0; - nk_uint *state = 0; - - /* retrieve tree state from internal widget state tables */ - if (!hash) { - title_len = (int)nk_strlen(title); - tree_hash = nk_murmur_hash(title, (int)title_len, (nk_hash)line); - } else tree_hash = nk_murmur_hash(hash, len, (nk_hash)line); - state = nk_find_value(win, tree_hash); - if (!state) { - state = nk_add_value(ctx, win, tree_hash, 0); - *state = initial_state; - } - return nk_tree_state_base(ctx, type, img, title, (enum nk_collapse_states*)state); -} -NK_API int -nk_tree_state_push(struct nk_context *ctx, enum nk_tree_type type, - const char *title, enum nk_collapse_states *state) -{ - return nk_tree_state_base(ctx, type, 0, title, state); -} -NK_API int -nk_tree_state_image_push(struct nk_context *ctx, enum nk_tree_type type, - struct nk_image img, const char *title, enum nk_collapse_states *state) -{ - return nk_tree_state_base(ctx, type, &img, title, state); -} -NK_API void -nk_tree_state_pop(struct nk_context *ctx) -{ - struct nk_window *win = 0; - struct nk_panel *layout = 0; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - win = ctx->current; - layout = win->layout; - layout->at_x -= ctx->style.tab.indent + ctx->style.window.padding.x; - layout->bounds.w += ctx->style.tab.indent + ctx->style.window.padding.x; - NK_ASSERT(layout->row.tree_depth); - layout->row.tree_depth--; -} -NK_API int -nk_tree_push_hashed(struct nk_context *ctx, enum nk_tree_type type, - const char *title, enum nk_collapse_states initial_state, - const char *hash, int len, int line) -{ - return nk_tree_base(ctx, type, 0, title, initial_state, hash, len, line); -} -NK_API int -nk_tree_image_push_hashed(struct nk_context *ctx, enum nk_tree_type type, - struct nk_image img, const char *title, enum nk_collapse_states initial_state, - const char *hash, int len,int seed) -{ - return nk_tree_base(ctx, type, &img, title, initial_state, hash, len, seed); -} -NK_API void -nk_tree_pop(struct nk_context *ctx) -{ - nk_tree_state_pop(ctx); -} -NK_INTERN int -nk_tree_element_image_push_hashed_base(struct nk_context *ctx, enum nk_tree_type type, - struct nk_image *img, const char *title, int title_len, - enum nk_collapse_states *state, int *selected) -{ - struct nk_window *win; - struct nk_panel *layout; - const struct nk_style *style; - struct nk_command_buffer *out; - const struct nk_input *in; - const struct nk_style_button *button; - enum nk_symbol_type symbol; - float row_height; - struct nk_vec2 padding; - - int text_len; - float text_width; - - struct nk_vec2 item_spacing; - struct nk_rect header = {0,0,0,0}; - struct nk_rect sym = {0,0,0,0}; - struct nk_text text; - - nk_flags ws = 0; - enum nk_widget_layout_states widget_state; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - /* cache some data */ - win = ctx->current; - layout = win->layout; - out = &win->buffer; - style = &ctx->style; - item_spacing = style->window.spacing; - padding = style->selectable.padding; - - /* calculate header bounds and draw background */ - row_height = style->font->height + 2 * style->tab.padding.y; - nk_layout_set_min_row_height(ctx, row_height); - nk_layout_row_dynamic(ctx, row_height, 1); - nk_layout_reset_min_row_height(ctx); - - widget_state = nk_widget(&header, ctx); - if (type == NK_TREE_TAB) { - const struct nk_style_item *background = &style->tab.background; - if (background->type == NK_STYLE_ITEM_IMAGE) { - nk_draw_image(out, header, &background->data.image, nk_white); - text.background = nk_rgba(0,0,0,0); - } else { - text.background = background->data.color; - nk_fill_rect(out, header, 0, style->tab.border_color); - nk_fill_rect(out, nk_shrink_rect(header, style->tab.border), - style->tab.rounding, background->data.color); - } - } else text.background = style->window.background; - - in = (!(layout->flags & NK_WINDOW_ROM)) ? &ctx->input: 0; - in = (in && widget_state == NK_WIDGET_VALID) ? &ctx->input : 0; - - /* select correct button style */ - if (*state == NK_MAXIMIZED) { - symbol = style->tab.sym_maximize; - if (type == NK_TREE_TAB) - button = &style->tab.tab_maximize_button; - else button = &style->tab.node_maximize_button; - } else { - symbol = style->tab.sym_minimize; - if (type == NK_TREE_TAB) - button = &style->tab.tab_minimize_button; - else button = &style->tab.node_minimize_button; - } - {/* draw triangle button */ - sym.w = sym.h = style->font->height; - sym.y = header.y + style->tab.padding.y; - sym.x = header.x + style->tab.padding.x; - if (nk_do_button_symbol(&ws, &win->buffer, sym, symbol, NK_BUTTON_DEFAULT, button, in, style->font)) - *state = (*state == NK_MAXIMIZED) ? NK_MINIMIZED : NK_MAXIMIZED;} - - /* draw label */ - {nk_flags dummy = 0; - struct nk_rect label; - /* calculate size of the text and tooltip */ - text_len = nk_strlen(title); - text_width = style->font->width(style->font->userdata, style->font->height, title, text_len); - text_width += (4 * padding.x); - - header.w = NK_MAX(header.w, sym.w + item_spacing.x); - label.x = sym.x + sym.w + item_spacing.x; - label.y = sym.y; - label.w = NK_MIN(header.w - (sym.w + item_spacing.y + style->tab.indent), text_width); - label.h = style->font->height; - - if (img) { - nk_do_selectable_image(&dummy, &win->buffer, label, title, title_len, NK_TEXT_LEFT, - selected, img, &style->selectable, in, style->font); - } else nk_do_selectable(&dummy, &win->buffer, label, title, title_len, NK_TEXT_LEFT, - selected, &style->selectable, in, style->font); - } - /* increase x-axis cursor widget position pointer */ - if (*state == NK_MAXIMIZED) { - layout->at_x = header.x + (float)*layout->offset_x + style->tab.indent; - layout->bounds.w = NK_MAX(layout->bounds.w, style->tab.indent); - layout->bounds.w -= (style->tab.indent + style->window.padding.x); - layout->row.tree_depth++; - return nk_true; - } else return nk_false; -} -NK_INTERN int -nk_tree_element_base(struct nk_context *ctx, enum nk_tree_type type, - struct nk_image *img, const char *title, enum nk_collapse_states initial_state, - int *selected, const char *hash, int len, int line) -{ - struct nk_window *win = ctx->current; - int title_len = 0; - nk_hash tree_hash = 0; - nk_uint *state = 0; - - /* retrieve tree state from internal widget state tables */ - if (!hash) { - title_len = (int)nk_strlen(title); - tree_hash = nk_murmur_hash(title, (int)title_len, (nk_hash)line); - } else tree_hash = nk_murmur_hash(hash, len, (nk_hash)line); - state = nk_find_value(win, tree_hash); - if (!state) { - state = nk_add_value(ctx, win, tree_hash, 0); - *state = initial_state; - } return nk_tree_element_image_push_hashed_base(ctx, type, img, title, - nk_strlen(title), (enum nk_collapse_states*)state, selected); -} -NK_API int -nk_tree_element_push_hashed(struct nk_context *ctx, enum nk_tree_type type, - const char *title, enum nk_collapse_states initial_state, - int *selected, const char *hash, int len, int seed) -{ - return nk_tree_element_base(ctx, type, 0, title, initial_state, selected, hash, len, seed); -} -NK_API int -nk_tree_element_image_push_hashed(struct nk_context *ctx, enum nk_tree_type type, - struct nk_image img, const char *title, enum nk_collapse_states initial_state, - int *selected, const char *hash, int len,int seed) -{ - return nk_tree_element_base(ctx, type, &img, title, initial_state, selected, hash, len, seed); -} -NK_API void -nk_tree_element_pop(struct nk_context *ctx) -{ - nk_tree_state_pop(ctx); -} - - - - - -/* =============================================================== - * - * GROUP - * - * ===============================================================*/ -NK_API int -nk_group_scrolled_offset_begin(struct nk_context *ctx, - nk_uint *x_offset, nk_uint *y_offset, const char *title, nk_flags flags) -{ - struct nk_rect bounds; - struct nk_window panel; - struct nk_window *win; - - win = ctx->current; - nk_panel_alloc_space(&bounds, ctx); - {const struct nk_rect *c = &win->layout->clip; - if (!NK_INTERSECT(c->x, c->y, c->w, c->h, bounds.x, bounds.y, bounds.w, bounds.h) && - !(flags & NK_WINDOW_MOVABLE)) { - return 0; - }} - if (win->flags & NK_WINDOW_ROM) - flags |= NK_WINDOW_ROM; - - /* initialize a fake window to create the panel from */ - nk_zero(&panel, sizeof(panel)); - panel.bounds = bounds; - panel.flags = flags; - panel.scrollbar.x = *x_offset; - panel.scrollbar.y = *y_offset; - panel.buffer = win->buffer; - panel.layout = (struct nk_panel*)nk_create_panel(ctx); - ctx->current = &panel; - nk_panel_begin(ctx, (flags & NK_WINDOW_TITLE) ? title: 0, NK_PANEL_GROUP); - - win->buffer = panel.buffer; - win->buffer.clip = panel.layout->clip; - panel.layout->offset_x = x_offset; - panel.layout->offset_y = y_offset; - panel.layout->parent = win->layout; - win->layout = panel.layout; - - ctx->current = win; - if ((panel.layout->flags & NK_WINDOW_CLOSED) || - (panel.layout->flags & NK_WINDOW_MINIMIZED)) - { - nk_flags f = panel.layout->flags; - nk_group_scrolled_end(ctx); - if (f & NK_WINDOW_CLOSED) - return NK_WINDOW_CLOSED; - if (f & NK_WINDOW_MINIMIZED) - return NK_WINDOW_MINIMIZED; - } - return 1; -} -NK_API void -nk_group_scrolled_end(struct nk_context *ctx) -{ - struct nk_window *win; - struct nk_panel *parent; - struct nk_panel *g; - - struct nk_rect clip; - struct nk_window pan; - struct nk_vec2 panel_padding; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - if (!ctx || !ctx->current) - return; - - /* make sure nk_group_begin was called correctly */ - NK_ASSERT(ctx->current); - win = ctx->current; - NK_ASSERT(win->layout); - g = win->layout; - NK_ASSERT(g->parent); - parent = g->parent; - - /* dummy window */ - nk_zero_struct(pan); - panel_padding = nk_panel_get_padding(&ctx->style, NK_PANEL_GROUP); - pan.bounds.y = g->bounds.y - (g->header_height + g->menu.h); - pan.bounds.x = g->bounds.x - panel_padding.x; - pan.bounds.w = g->bounds.w + 2 * panel_padding.x; - pan.bounds.h = g->bounds.h + g->header_height + g->menu.h; - if (g->flags & NK_WINDOW_BORDER) { - pan.bounds.x -= g->border; - pan.bounds.y -= g->border; - pan.bounds.w += 2*g->border; - pan.bounds.h += 2*g->border; - } - if (!(g->flags & NK_WINDOW_NO_SCROLLBAR)) { - pan.bounds.w += ctx->style.window.scrollbar_size.x; - pan.bounds.h += ctx->style.window.scrollbar_size.y; - } - pan.scrollbar.x = *g->offset_x; - pan.scrollbar.y = *g->offset_y; - pan.flags = g->flags; - pan.buffer = win->buffer; - pan.layout = g; - pan.parent = win; - ctx->current = &pan; - - /* make sure group has correct clipping rectangle */ - nk_unify(&clip, &parent->clip, pan.bounds.x, pan.bounds.y, - pan.bounds.x + pan.bounds.w, pan.bounds.y + pan.bounds.h + panel_padding.x); - nk_push_scissor(&pan.buffer, clip); - nk_end(ctx); - - win->buffer = pan.buffer; - nk_push_scissor(&win->buffer, parent->clip); - ctx->current = win; - win->layout = parent; - g->bounds = pan.bounds; - return; -} -NK_API int -nk_group_scrolled_begin(struct nk_context *ctx, - struct nk_scroll *scroll, const char *title, nk_flags flags) -{ - return nk_group_scrolled_offset_begin(ctx, &scroll->x, &scroll->y, title, flags); -} -NK_API int -nk_group_begin_titled(struct nk_context *ctx, const char *id, - const char *title, nk_flags flags) -{ - int id_len; - nk_hash id_hash; - struct nk_window *win; - nk_uint *x_offset; - nk_uint *y_offset; - - NK_ASSERT(ctx); - NK_ASSERT(id); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout || !id) - return 0; - - /* find persistent group scrollbar value */ - win = ctx->current; - id_len = (int)nk_strlen(id); - id_hash = nk_murmur_hash(id, (int)id_len, NK_PANEL_GROUP); - x_offset = nk_find_value(win, id_hash); - if (!x_offset) { - x_offset = nk_add_value(ctx, win, id_hash, 0); - y_offset = nk_add_value(ctx, win, id_hash+1, 0); - - NK_ASSERT(x_offset); - NK_ASSERT(y_offset); - if (!x_offset || !y_offset) return 0; - *x_offset = *y_offset = 0; - } else y_offset = nk_find_value(win, id_hash+1); - return nk_group_scrolled_offset_begin(ctx, x_offset, y_offset, title, flags); -} -NK_API int -nk_group_begin(struct nk_context *ctx, const char *title, nk_flags flags) -{ - return nk_group_begin_titled(ctx, title, title, flags); -} -NK_API void -nk_group_end(struct nk_context *ctx) -{ - nk_group_scrolled_end(ctx); -} -NK_API void -nk_group_get_scroll(struct nk_context *ctx, const char *id, nk_uint *x_offset, nk_uint *y_offset) -{ - int id_len; - nk_hash id_hash; - struct nk_window *win; - nk_uint *x_offset_ptr; - nk_uint *y_offset_ptr; - - NK_ASSERT(ctx); - NK_ASSERT(id); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout || !id) - return; - - /* find persistent group scrollbar value */ - win = ctx->current; - id_len = (int)nk_strlen(id); - id_hash = nk_murmur_hash(id, (int)id_len, NK_PANEL_GROUP); - x_offset_ptr = nk_find_value(win, id_hash); - if (!x_offset_ptr) { - x_offset_ptr = nk_add_value(ctx, win, id_hash, 0); - y_offset_ptr = nk_add_value(ctx, win, id_hash+1, 0); - - NK_ASSERT(x_offset_ptr); - NK_ASSERT(y_offset_ptr); - if (!x_offset_ptr || !y_offset_ptr) return; - *x_offset_ptr = *y_offset_ptr = 0; - } else y_offset_ptr = nk_find_value(win, id_hash+1); - if (x_offset) - *x_offset = *x_offset_ptr; - if (y_offset) - *y_offset = *y_offset_ptr; -} -NK_API void -nk_group_set_scroll(struct nk_context *ctx, const char *id, nk_uint x_offset, nk_uint y_offset) -{ - int id_len; - nk_hash id_hash; - struct nk_window *win; - nk_uint *x_offset_ptr; - nk_uint *y_offset_ptr; - - NK_ASSERT(ctx); - NK_ASSERT(id); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout || !id) - return; - - /* find persistent group scrollbar value */ - win = ctx->current; - id_len = (int)nk_strlen(id); - id_hash = nk_murmur_hash(id, (int)id_len, NK_PANEL_GROUP); - x_offset_ptr = nk_find_value(win, id_hash); - if (!x_offset_ptr) { - x_offset_ptr = nk_add_value(ctx, win, id_hash, 0); - y_offset_ptr = nk_add_value(ctx, win, id_hash+1, 0); - - NK_ASSERT(x_offset_ptr); - NK_ASSERT(y_offset_ptr); - if (!x_offset_ptr || !y_offset_ptr) return; - *x_offset_ptr = *y_offset_ptr = 0; - } else y_offset_ptr = nk_find_value(win, id_hash+1); - *x_offset_ptr = x_offset; - *y_offset_ptr = y_offset; -} - - - - -/* =============================================================== - * - * LIST VIEW - * - * ===============================================================*/ -NK_API int -nk_list_view_begin(struct nk_context *ctx, struct nk_list_view *view, - const char *title, nk_flags flags, int row_height, int row_count) -{ - int title_len; - nk_hash title_hash; - nk_uint *x_offset; - nk_uint *y_offset; - - int result; - struct nk_window *win; - struct nk_panel *layout; - const struct nk_style *style; - struct nk_vec2 item_spacing; - - NK_ASSERT(ctx); - NK_ASSERT(view); - NK_ASSERT(title); - if (!ctx || !view || !title) return 0; - - win = ctx->current; - style = &ctx->style; - item_spacing = style->window.spacing; - row_height += NK_MAX(0, (int)item_spacing.y); - - /* find persistent list view scrollbar offset */ - title_len = (int)nk_strlen(title); - title_hash = nk_murmur_hash(title, (int)title_len, NK_PANEL_GROUP); - x_offset = nk_find_value(win, title_hash); - if (!x_offset) { - x_offset = nk_add_value(ctx, win, title_hash, 0); - y_offset = nk_add_value(ctx, win, title_hash+1, 0); - - NK_ASSERT(x_offset); - NK_ASSERT(y_offset); - if (!x_offset || !y_offset) return 0; - *x_offset = *y_offset = 0; - } else y_offset = nk_find_value(win, title_hash+1); - view->scroll_value = *y_offset; - view->scroll_pointer = y_offset; - - *y_offset = 0; - result = nk_group_scrolled_offset_begin(ctx, x_offset, y_offset, title, flags); - win = ctx->current; - layout = win->layout; - - view->total_height = row_height * NK_MAX(row_count,1); - view->begin = (int)NK_MAX(((float)view->scroll_value / (float)row_height), 0.0f); - view->count = (int)NK_MAX(nk_iceilf((layout->clip.h)/(float)row_height),0); - view->count = NK_MIN(view->count, row_count - view->begin); - view->end = view->begin + view->count; - view->ctx = ctx; - return result; -} -NK_API void -nk_list_view_end(struct nk_list_view *view) -{ - struct nk_context *ctx; - struct nk_window *win; - struct nk_panel *layout; - - NK_ASSERT(view); - NK_ASSERT(view->ctx); - NK_ASSERT(view->scroll_pointer); - if (!view || !view->ctx) return; - - ctx = view->ctx; - win = ctx->current; - layout = win->layout; - layout->at_y = layout->bounds.y + (float)view->total_height; - *view->scroll_pointer = *view->scroll_pointer + view->scroll_value; - nk_group_end(view->ctx); -} - - - - - -/* =============================================================== - * - * WIDGET - * - * ===============================================================*/ -NK_API struct nk_rect -nk_widget_bounds(struct nk_context *ctx) -{ - struct nk_rect bounds; - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - if (!ctx || !ctx->current) - return nk_rect(0,0,0,0); - nk_layout_peek(&bounds, ctx); - return bounds; -} -NK_API struct nk_vec2 -nk_widget_position(struct nk_context *ctx) -{ - struct nk_rect bounds; - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - if (!ctx || !ctx->current) - return nk_vec2(0,0); - - nk_layout_peek(&bounds, ctx); - return nk_vec2(bounds.x, bounds.y); -} -NK_API struct nk_vec2 -nk_widget_size(struct nk_context *ctx) -{ - struct nk_rect bounds; - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - if (!ctx || !ctx->current) - return nk_vec2(0,0); - - nk_layout_peek(&bounds, ctx); - return nk_vec2(bounds.w, bounds.h); -} -NK_API float -nk_widget_width(struct nk_context *ctx) -{ - struct nk_rect bounds; - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - if (!ctx || !ctx->current) - return 0; - - nk_layout_peek(&bounds, ctx); - return bounds.w; -} -NK_API float -nk_widget_height(struct nk_context *ctx) -{ - struct nk_rect bounds; - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - if (!ctx || !ctx->current) - return 0; - - nk_layout_peek(&bounds, ctx); - return bounds.h; -} -NK_API int -nk_widget_is_hovered(struct nk_context *ctx) -{ - struct nk_rect c, v; - struct nk_rect bounds; - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - if (!ctx || !ctx->current || ctx->active != ctx->current) - return 0; - - c = ctx->current->layout->clip; - c.x = (float)((int)c.x); - c.y = (float)((int)c.y); - c.w = (float)((int)c.w); - c.h = (float)((int)c.h); - - nk_layout_peek(&bounds, ctx); - nk_unify(&v, &c, bounds.x, bounds.y, bounds.x + bounds.w, bounds.y + bounds.h); - if (!NK_INTERSECT(c.x, c.y, c.w, c.h, bounds.x, bounds.y, bounds.w, bounds.h)) - return 0; - return nk_input_is_mouse_hovering_rect(&ctx->input, bounds); -} -NK_API int -nk_widget_is_mouse_clicked(struct nk_context *ctx, enum nk_buttons btn) -{ - struct nk_rect c, v; - struct nk_rect bounds; - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - if (!ctx || !ctx->current || ctx->active != ctx->current) - return 0; - - c = ctx->current->layout->clip; - c.x = (float)((int)c.x); - c.y = (float)((int)c.y); - c.w = (float)((int)c.w); - c.h = (float)((int)c.h); - - nk_layout_peek(&bounds, ctx); - nk_unify(&v, &c, bounds.x, bounds.y, bounds.x + bounds.w, bounds.y + bounds.h); - if (!NK_INTERSECT(c.x, c.y, c.w, c.h, bounds.x, bounds.y, bounds.w, bounds.h)) - return 0; - return nk_input_mouse_clicked(&ctx->input, btn, bounds); -} -NK_API int -nk_widget_has_mouse_click_down(struct nk_context *ctx, enum nk_buttons btn, int down) -{ - struct nk_rect c, v; - struct nk_rect bounds; - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - if (!ctx || !ctx->current || ctx->active != ctx->current) - return 0; - - c = ctx->current->layout->clip; - c.x = (float)((int)c.x); - c.y = (float)((int)c.y); - c.w = (float)((int)c.w); - c.h = (float)((int)c.h); - - nk_layout_peek(&bounds, ctx); - nk_unify(&v, &c, bounds.x, bounds.y, bounds.x + bounds.w, bounds.y + bounds.h); - if (!NK_INTERSECT(c.x, c.y, c.w, c.h, bounds.x, bounds.y, bounds.w, bounds.h)) - return 0; - return nk_input_has_mouse_click_down_in_rect(&ctx->input, btn, bounds, down); -} -NK_API enum nk_widget_layout_states -nk_widget(struct nk_rect *bounds, const struct nk_context *ctx) -{ - struct nk_rect c, v; - struct nk_window *win; - struct nk_panel *layout; - const struct nk_input *in; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return NK_WIDGET_INVALID; - - /* allocate space and check if the widget needs to be updated and drawn */ - nk_panel_alloc_space(bounds, ctx); - win = ctx->current; - layout = win->layout; - in = &ctx->input; - c = layout->clip; - - /* if one of these triggers you forgot to add an `if` condition around either - a window, group, popup, combobox or contextual menu `begin` and `end` block. - Example: - if (nk_begin(...) {...} nk_end(...); or - if (nk_group_begin(...) { nk_group_end(...);} */ - NK_ASSERT(!(layout->flags & NK_WINDOW_MINIMIZED)); - NK_ASSERT(!(layout->flags & NK_WINDOW_HIDDEN)); - NK_ASSERT(!(layout->flags & NK_WINDOW_CLOSED)); - - /* need to convert to int here to remove floating point errors */ - bounds->x = (float)((int)bounds->x); - bounds->y = (float)((int)bounds->y); - bounds->w = (float)((int)bounds->w); - bounds->h = (float)((int)bounds->h); - - c.x = (float)((int)c.x); - c.y = (float)((int)c.y); - c.w = (float)((int)c.w); - c.h = (float)((int)c.h); - - nk_unify(&v, &c, bounds->x, bounds->y, bounds->x + bounds->w, bounds->y + bounds->h); - if (!NK_INTERSECT(c.x, c.y, c.w, c.h, bounds->x, bounds->y, bounds->w, bounds->h)) - return NK_WIDGET_INVALID; - if (!NK_INBOX(in->mouse.pos.x, in->mouse.pos.y, v.x, v.y, v.w, v.h)) - return NK_WIDGET_ROM; - return NK_WIDGET_VALID; -} -NK_API enum nk_widget_layout_states -nk_widget_fitting(struct nk_rect *bounds, struct nk_context *ctx, - struct nk_vec2 item_padding) -{ - /* update the bounds to stand without padding */ - struct nk_window *win; - struct nk_style *style; - struct nk_panel *layout; - enum nk_widget_layout_states state; - struct nk_vec2 panel_padding; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return NK_WIDGET_INVALID; - - win = ctx->current; - style = &ctx->style; - layout = win->layout; - state = nk_widget(bounds, ctx); - - panel_padding = nk_panel_get_padding(style, layout->type); - if (layout->row.index == 1) { - bounds->w += panel_padding.x; - bounds->x -= panel_padding.x; - } else bounds->x -= item_padding.x; - - if (layout->row.index == layout->row.columns) - bounds->w += panel_padding.x; - else bounds->w += item_padding.x; - return state; -} -NK_API void -nk_spacing(struct nk_context *ctx, int cols) -{ - struct nk_window *win; - struct nk_panel *layout; - struct nk_rect none; - int i, index, rows; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - /* spacing over row boundaries */ - win = ctx->current; - layout = win->layout; - index = (layout->row.index + cols) % layout->row.columns; - rows = (layout->row.index + cols) / layout->row.columns; - if (rows) { - for (i = 0; i < rows; ++i) - nk_panel_alloc_row(ctx, win); - cols = index; - } - /* non table layout need to allocate space */ - if (layout->row.type != NK_LAYOUT_DYNAMIC_FIXED && - layout->row.type != NK_LAYOUT_STATIC_FIXED) { - for (i = 0; i < cols; ++i) - nk_panel_alloc_space(&none, ctx); - } layout->row.index = index; -} - - - - - -/* =============================================================== - * - * TEXT - * - * ===============================================================*/ -NK_LIB void -nk_widget_text(struct nk_command_buffer *o, struct nk_rect b, - const char *string, int len, const struct nk_text *t, - nk_flags a, const struct nk_user_font *f) -{ - struct nk_rect label; - float text_width; - - NK_ASSERT(o); - NK_ASSERT(t); - if (!o || !t) return; - - b.h = NK_MAX(b.h, 2 * t->padding.y); - label.x = 0; label.w = 0; - label.y = b.y + t->padding.y; - label.h = NK_MIN(f->height, b.h - 2 * t->padding.y); - - text_width = f->width(f->userdata, f->height, (const char*)string, len); - text_width += (2.0f * t->padding.x); - - /* align in x-axis */ - if (a & NK_TEXT_ALIGN_LEFT) { - label.x = b.x + t->padding.x; - label.w = NK_MAX(0, b.w - 2 * t->padding.x); - } else if (a & NK_TEXT_ALIGN_CENTERED) { - label.w = NK_MAX(1, 2 * t->padding.x + (float)text_width); - label.x = (b.x + t->padding.x + ((b.w - 2 * t->padding.x) - label.w) / 2); - label.x = NK_MAX(b.x + t->padding.x, label.x); - label.w = NK_MIN(b.x + b.w, label.x + label.w); - if (label.w >= label.x) label.w -= label.x; - } else if (a & NK_TEXT_ALIGN_RIGHT) { - label.x = NK_MAX(b.x + t->padding.x, (b.x + b.w) - (2 * t->padding.x + (float)text_width)); - label.w = (float)text_width + 2 * t->padding.x; - } else return; - - /* align in y-axis */ - if (a & NK_TEXT_ALIGN_MIDDLE) { - label.y = b.y + b.h/2.0f - (float)f->height/2.0f; - label.h = NK_MAX(b.h/2.0f, b.h - (b.h/2.0f + f->height/2.0f)); - } else if (a & NK_TEXT_ALIGN_BOTTOM) { - label.y = b.y + b.h - f->height; - label.h = f->height; - } - nk_draw_text(o, label, (const char*)string, len, f, t->background, t->text); -} -NK_LIB void -nk_widget_text_wrap(struct nk_command_buffer *o, struct nk_rect b, - const char *string, int len, const struct nk_text *t, - const struct nk_user_font *f) -{ - float width; - int glyphs = 0; - int fitting = 0; - int done = 0; - struct nk_rect line; - struct nk_text text; - NK_INTERN nk_rune seperator[] = {' '}; - - NK_ASSERT(o); - NK_ASSERT(t); - if (!o || !t) return; - - text.padding = nk_vec2(0,0); - text.background = t->background; - text.text = t->text; - - b.w = NK_MAX(b.w, 2 * t->padding.x); - b.h = NK_MAX(b.h, 2 * t->padding.y); - b.h = b.h - 2 * t->padding.y; - - line.x = b.x + t->padding.x; - line.y = b.y + t->padding.y; - line.w = b.w - 2 * t->padding.x; - line.h = 2 * t->padding.y + f->height; - - fitting = nk_text_clamp(f, string, len, line.w, &glyphs, &width, seperator,NK_LEN(seperator)); - while (done < len) { - if (!fitting || line.y + line.h >= (b.y + b.h)) break; - nk_widget_text(o, line, &string[done], fitting, &text, NK_TEXT_LEFT, f); - done += fitting; - line.y += f->height + 2 * t->padding.y; - fitting = nk_text_clamp(f, &string[done], len - done, line.w, &glyphs, &width, seperator,NK_LEN(seperator)); - } -} -NK_API void -nk_text_colored(struct nk_context *ctx, const char *str, int len, - nk_flags alignment, struct nk_color color) -{ - struct nk_window *win; - const struct nk_style *style; - - struct nk_vec2 item_padding; - struct nk_rect bounds; - struct nk_text text; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) return; - - win = ctx->current; - style = &ctx->style; - nk_panel_alloc_space(&bounds, ctx); - item_padding = style->text.padding; - - text.padding.x = item_padding.x; - text.padding.y = item_padding.y; - text.background = style->window.background; - text.text = color; - nk_widget_text(&win->buffer, bounds, str, len, &text, alignment, style->font); -} -NK_API void -nk_text_wrap_colored(struct nk_context *ctx, const char *str, - int len, struct nk_color color) -{ - struct nk_window *win; - const struct nk_style *style; - - struct nk_vec2 item_padding; - struct nk_rect bounds; - struct nk_text text; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) return; - - win = ctx->current; - style = &ctx->style; - nk_panel_alloc_space(&bounds, ctx); - item_padding = style->text.padding; - - text.padding.x = item_padding.x; - text.padding.y = item_padding.y; - text.background = style->window.background; - text.text = color; - nk_widget_text_wrap(&win->buffer, bounds, str, len, &text, style->font); -} -#ifdef NK_INCLUDE_STANDARD_VARARGS -NK_API void -nk_labelf_colored(struct nk_context *ctx, nk_flags flags, - struct nk_color color, const char *fmt, ...) -{ - va_list args; - va_start(args, fmt); - nk_labelfv_colored(ctx, flags, color, fmt, args); - va_end(args); -} -NK_API void -nk_labelf_colored_wrap(struct nk_context *ctx, struct nk_color color, - const char *fmt, ...) -{ - va_list args; - va_start(args, fmt); - nk_labelfv_colored_wrap(ctx, color, fmt, args); - va_end(args); -} -NK_API void -nk_labelf(struct nk_context *ctx, nk_flags flags, const char *fmt, ...) -{ - va_list args; - va_start(args, fmt); - nk_labelfv(ctx, flags, fmt, args); - va_end(args); -} -NK_API void -nk_labelf_wrap(struct nk_context *ctx, const char *fmt,...) -{ - va_list args; - va_start(args, fmt); - nk_labelfv_wrap(ctx, fmt, args); - va_end(args); -} -NK_API void -nk_labelfv_colored(struct nk_context *ctx, nk_flags flags, - struct nk_color color, const char *fmt, va_list args) -{ - char buf[256]; - nk_strfmt(buf, NK_LEN(buf), fmt, args); - nk_label_colored(ctx, buf, flags, color); -} - -NK_API void -nk_labelfv_colored_wrap(struct nk_context *ctx, struct nk_color color, - const char *fmt, va_list args) -{ - char buf[256]; - nk_strfmt(buf, NK_LEN(buf), fmt, args); - nk_label_colored_wrap(ctx, buf, color); -} - -NK_API void -nk_labelfv(struct nk_context *ctx, nk_flags flags, const char *fmt, va_list args) -{ - char buf[256]; - nk_strfmt(buf, NK_LEN(buf), fmt, args); - nk_label(ctx, buf, flags); -} - -NK_API void -nk_labelfv_wrap(struct nk_context *ctx, const char *fmt, va_list args) -{ - char buf[256]; - nk_strfmt(buf, NK_LEN(buf), fmt, args); - nk_label_wrap(ctx, buf); -} - -NK_API void -nk_value_bool(struct nk_context *ctx, const char *prefix, int value) -{ - nk_labelf(ctx, NK_TEXT_LEFT, "%s: %s", prefix, ((value) ? "true": "false")); -} -NK_API void -nk_value_int(struct nk_context *ctx, const char *prefix, int value) -{ - nk_labelf(ctx, NK_TEXT_LEFT, "%s: %d", prefix, value); -} -NK_API void -nk_value_uint(struct nk_context *ctx, const char *prefix, unsigned int value) -{ - nk_labelf(ctx, NK_TEXT_LEFT, "%s: %u", prefix, value); -} -NK_API void -nk_value_float(struct nk_context *ctx, const char *prefix, float value) -{ - double double_value = (double)value; - nk_labelf(ctx, NK_TEXT_LEFT, "%s: %.3f", prefix, double_value); -} -NK_API void -nk_value_color_byte(struct nk_context *ctx, const char *p, struct nk_color c) -{ - nk_labelf(ctx, NK_TEXT_LEFT, "%s: (%d, %d, %d, %d)", p, c.r, c.g, c.b, c.a); -} -NK_API void -nk_value_color_float(struct nk_context *ctx, const char *p, struct nk_color color) -{ - double c[4]; nk_color_dv(c, color); - nk_labelf(ctx, NK_TEXT_LEFT, "%s: (%.2f, %.2f, %.2f, %.2f)", - p, c[0], c[1], c[2], c[3]); -} -NK_API void -nk_value_color_hex(struct nk_context *ctx, const char *prefix, struct nk_color color) -{ - char hex[16]; - nk_color_hex_rgba(hex, color); - nk_labelf(ctx, NK_TEXT_LEFT, "%s: %s", prefix, hex); -} -#endif -NK_API void -nk_text(struct nk_context *ctx, const char *str, int len, nk_flags alignment) -{ - NK_ASSERT(ctx); - if (!ctx) return; - nk_text_colored(ctx, str, len, alignment, ctx->style.text.color); -} -NK_API void -nk_text_wrap(struct nk_context *ctx, const char *str, int len) -{ - NK_ASSERT(ctx); - if (!ctx) return; - nk_text_wrap_colored(ctx, str, len, ctx->style.text.color); -} -NK_API void -nk_label(struct nk_context *ctx, const char *str, nk_flags alignment) -{ - nk_text(ctx, str, nk_strlen(str), alignment); -} -NK_API void -nk_label_colored(struct nk_context *ctx, const char *str, nk_flags align, - struct nk_color color) -{ - nk_text_colored(ctx, str, nk_strlen(str), align, color); -} -NK_API void -nk_label_wrap(struct nk_context *ctx, const char *str) -{ - nk_text_wrap(ctx, str, nk_strlen(str)); -} -NK_API void -nk_label_colored_wrap(struct nk_context *ctx, const char *str, struct nk_color color) -{ - nk_text_wrap_colored(ctx, str, nk_strlen(str), color); -} - - - - - -/* =============================================================== - * - * IMAGE - * - * ===============================================================*/ -NK_API nk_handle -nk_handle_ptr(void *ptr) -{ - nk_handle handle = {0}; - handle.ptr = ptr; - return handle; -} -NK_API nk_handle -nk_handle_id(int id) -{ - nk_handle handle; - nk_zero_struct(handle); - handle.id = id; - return handle; -} -NK_API struct nk_image -nk_subimage_ptr(void *ptr, unsigned short w, unsigned short h, struct nk_rect r) -{ - struct nk_image s; - nk_zero(&s, sizeof(s)); - s.handle.ptr = ptr; - s.w = w; s.h = h; - s.region[0] = (unsigned short)r.x; - s.region[1] = (unsigned short)r.y; - s.region[2] = (unsigned short)r.w; - s.region[3] = (unsigned short)r.h; - return s; -} -NK_API struct nk_image -nk_subimage_id(int id, unsigned short w, unsigned short h, struct nk_rect r) -{ - struct nk_image s; - nk_zero(&s, sizeof(s)); - s.handle.id = id; - s.w = w; s.h = h; - s.region[0] = (unsigned short)r.x; - s.region[1] = (unsigned short)r.y; - s.region[2] = (unsigned short)r.w; - s.region[3] = (unsigned short)r.h; - return s; -} -NK_API struct nk_image -nk_subimage_handle(nk_handle handle, unsigned short w, unsigned short h, - struct nk_rect r) -{ - struct nk_image s; - nk_zero(&s, sizeof(s)); - s.handle = handle; - s.w = w; s.h = h; - s.region[0] = (unsigned short)r.x; - s.region[1] = (unsigned short)r.y; - s.region[2] = (unsigned short)r.w; - s.region[3] = (unsigned short)r.h; - return s; -} -NK_API struct nk_image -nk_image_handle(nk_handle handle) -{ - struct nk_image s; - nk_zero(&s, sizeof(s)); - s.handle = handle; - s.w = 0; s.h = 0; - s.region[0] = 0; - s.region[1] = 0; - s.region[2] = 0; - s.region[3] = 0; - return s; -} -NK_API struct nk_image -nk_image_ptr(void *ptr) -{ - struct nk_image s; - nk_zero(&s, sizeof(s)); - NK_ASSERT(ptr); - s.handle.ptr = ptr; - s.w = 0; s.h = 0; - s.region[0] = 0; - s.region[1] = 0; - s.region[2] = 0; - s.region[3] = 0; - return s; -} -NK_API struct nk_image -nk_image_id(int id) -{ - struct nk_image s; - nk_zero(&s, sizeof(s)); - s.handle.id = id; - s.w = 0; s.h = 0; - s.region[0] = 0; - s.region[1] = 0; - s.region[2] = 0; - s.region[3] = 0; - return s; -} -NK_API int -nk_image_is_subimage(const struct nk_image* img) -{ - NK_ASSERT(img); - return !(img->w == 0 && img->h == 0); -} -NK_API void -nk_image(struct nk_context *ctx, struct nk_image img) -{ - struct nk_window *win; - struct nk_rect bounds; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) return; - - win = ctx->current; - if (!nk_widget(&bounds, ctx)) return; - nk_draw_image(&win->buffer, bounds, &img, nk_white); -} -NK_API void -nk_image_color(struct nk_context *ctx, struct nk_image img, struct nk_color col) -{ - struct nk_window *win; - struct nk_rect bounds; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) return; - - win = ctx->current; - if (!nk_widget(&bounds, ctx)) return; - nk_draw_image(&win->buffer, bounds, &img, col); -} - - - - - -/* ============================================================== - * - * BUTTON - * - * ===============================================================*/ -NK_LIB void -nk_draw_symbol(struct nk_command_buffer *out, enum nk_symbol_type type, - struct nk_rect content, struct nk_color background, struct nk_color foreground, - float border_width, const struct nk_user_font *font) -{ - switch (type) { - case NK_SYMBOL_X: - case NK_SYMBOL_UNDERSCORE: - case NK_SYMBOL_PLUS: - case NK_SYMBOL_MINUS: { - /* single character text symbol */ - const char *X = (type == NK_SYMBOL_X) ? "x": - (type == NK_SYMBOL_UNDERSCORE) ? "_": - (type == NK_SYMBOL_PLUS) ? "+": "-"; - struct nk_text text; - text.padding = nk_vec2(0,0); - text.background = background; - text.text = foreground; - nk_widget_text(out, content, X, 1, &text, NK_TEXT_CENTERED, font); - } break; - case NK_SYMBOL_CIRCLE_SOLID: - case NK_SYMBOL_CIRCLE_OUTLINE: - case NK_SYMBOL_RECT_SOLID: - case NK_SYMBOL_RECT_OUTLINE: { - /* simple empty/filled shapes */ - if (type == NK_SYMBOL_RECT_SOLID || type == NK_SYMBOL_RECT_OUTLINE) { - nk_fill_rect(out, content, 0, foreground); - if (type == NK_SYMBOL_RECT_OUTLINE) - nk_fill_rect(out, nk_shrink_rect(content, border_width), 0, background); - } else { - nk_fill_circle(out, content, foreground); - if (type == NK_SYMBOL_CIRCLE_OUTLINE) - nk_fill_circle(out, nk_shrink_rect(content, 1), background); - } - } break; - case NK_SYMBOL_TRIANGLE_UP: - case NK_SYMBOL_TRIANGLE_DOWN: - case NK_SYMBOL_TRIANGLE_LEFT: - case NK_SYMBOL_TRIANGLE_RIGHT: { - enum nk_heading heading; - struct nk_vec2 points[3]; - heading = (type == NK_SYMBOL_TRIANGLE_RIGHT) ? NK_RIGHT : - (type == NK_SYMBOL_TRIANGLE_LEFT) ? NK_LEFT: - (type == NK_SYMBOL_TRIANGLE_UP) ? NK_UP: NK_DOWN; - nk_triangle_from_direction(points, content, 0, 0, heading); - nk_fill_triangle(out, points[0].x, points[0].y, points[1].x, points[1].y, - points[2].x, points[2].y, foreground); - } break; - default: - case NK_SYMBOL_NONE: - case NK_SYMBOL_MAX: break; - } -} -NK_LIB int -nk_button_behavior(nk_flags *state, struct nk_rect r, - const struct nk_input *i, enum nk_button_behavior behavior) -{ - int ret = 0; - nk_widget_state_reset(state); - if (!i) return 0; - if (nk_input_is_mouse_hovering_rect(i, r)) { - *state = NK_WIDGET_STATE_HOVERED; - if (nk_input_is_mouse_down(i, NK_BUTTON_LEFT)) - *state = NK_WIDGET_STATE_ACTIVE; - if (nk_input_has_mouse_click_in_rect(i, NK_BUTTON_LEFT, r)) { - ret = (behavior != NK_BUTTON_DEFAULT) ? - nk_input_is_mouse_down(i, NK_BUTTON_LEFT): -#ifdef NK_BUTTON_TRIGGER_ON_RELEASE - nk_input_is_mouse_released(i, NK_BUTTON_LEFT); -#else - nk_input_is_mouse_pressed(i, NK_BUTTON_LEFT); -#endif - } - } - if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(i, r)) - *state |= NK_WIDGET_STATE_ENTERED; - else if (nk_input_is_mouse_prev_hovering_rect(i, r)) - *state |= NK_WIDGET_STATE_LEFT; - return ret; -} -NK_LIB const struct nk_style_item* -nk_draw_button(struct nk_command_buffer *out, - const struct nk_rect *bounds, nk_flags state, - const struct nk_style_button *style) -{ - const struct nk_style_item *background; - if (state & NK_WIDGET_STATE_HOVER) - background = &style->hover; - else if (state & NK_WIDGET_STATE_ACTIVED) - background = &style->active; - else background = &style->normal; - - if (background->type == NK_STYLE_ITEM_IMAGE) { - nk_draw_image(out, *bounds, &background->data.image, nk_white); - } else { - nk_fill_rect(out, *bounds, style->rounding, background->data.color); - nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color); - } - return background; -} -NK_LIB int -nk_do_button(nk_flags *state, struct nk_command_buffer *out, struct nk_rect r, - const struct nk_style_button *style, const struct nk_input *in, - enum nk_button_behavior behavior, struct nk_rect *content) -{ - struct nk_rect bounds; - NK_ASSERT(style); - NK_ASSERT(state); - NK_ASSERT(out); - if (!out || !style) - return nk_false; - - /* calculate button content space */ - content->x = r.x + style->padding.x + style->border + style->rounding; - content->y = r.y + style->padding.y + style->border + style->rounding; - content->w = r.w - (2 * style->padding.x + style->border + style->rounding*2); - content->h = r.h - (2 * style->padding.y + style->border + style->rounding*2); - - /* execute button behavior */ - bounds.x = r.x - style->touch_padding.x; - bounds.y = r.y - style->touch_padding.y; - bounds.w = r.w + 2 * style->touch_padding.x; - bounds.h = r.h + 2 * style->touch_padding.y; - return nk_button_behavior(state, bounds, in, behavior); -} -NK_LIB void -nk_draw_button_text(struct nk_command_buffer *out, - const struct nk_rect *bounds, const struct nk_rect *content, nk_flags state, - const struct nk_style_button *style, const char *txt, int len, - nk_flags text_alignment, const struct nk_user_font *font) -{ - struct nk_text text; - const struct nk_style_item *background; - background = nk_draw_button(out, bounds, state, style); - - /* select correct colors/images */ - if (background->type == NK_STYLE_ITEM_COLOR) - text.background = background->data.color; - else text.background = style->text_background; - if (state & NK_WIDGET_STATE_HOVER) - text.text = style->text_hover; - else if (state & NK_WIDGET_STATE_ACTIVED) - text.text = style->text_active; - else text.text = style->text_normal; - - text.padding = nk_vec2(0,0); - nk_widget_text(out, *content, txt, len, &text, text_alignment, font); -} -NK_LIB int -nk_do_button_text(nk_flags *state, - struct nk_command_buffer *out, struct nk_rect bounds, - const char *string, int len, nk_flags align, enum nk_button_behavior behavior, - const struct nk_style_button *style, const struct nk_input *in, - const struct nk_user_font *font) -{ - struct nk_rect content; - int ret = nk_false; - - NK_ASSERT(state); - NK_ASSERT(style); - NK_ASSERT(out); - NK_ASSERT(string); - NK_ASSERT(font); - if (!out || !style || !font || !string) - return nk_false; - - ret = nk_do_button(state, out, bounds, style, in, behavior, &content); - if (style->draw_begin) style->draw_begin(out, style->userdata); - nk_draw_button_text(out, &bounds, &content, *state, style, string, len, align, font); - if (style->draw_end) style->draw_end(out, style->userdata); - return ret; -} -NK_LIB void -nk_draw_button_symbol(struct nk_command_buffer *out, - const struct nk_rect *bounds, const struct nk_rect *content, - nk_flags state, const struct nk_style_button *style, - enum nk_symbol_type type, const struct nk_user_font *font) -{ - struct nk_color sym, bg; - const struct nk_style_item *background; - - /* select correct colors/images */ - background = nk_draw_button(out, bounds, state, style); - if (background->type == NK_STYLE_ITEM_COLOR) - bg = background->data.color; - else bg = style->text_background; - - if (state & NK_WIDGET_STATE_HOVER) - sym = style->text_hover; - else if (state & NK_WIDGET_STATE_ACTIVED) - sym = style->text_active; - else sym = style->text_normal; - nk_draw_symbol(out, type, *content, bg, sym, 1, font); -} -NK_LIB int -nk_do_button_symbol(nk_flags *state, - struct nk_command_buffer *out, struct nk_rect bounds, - enum nk_symbol_type symbol, enum nk_button_behavior behavior, - const struct nk_style_button *style, const struct nk_input *in, - const struct nk_user_font *font) -{ - int ret; - struct nk_rect content; - - NK_ASSERT(state); - NK_ASSERT(style); - NK_ASSERT(font); - NK_ASSERT(out); - if (!out || !style || !font || !state) - return nk_false; - - ret = nk_do_button(state, out, bounds, style, in, behavior, &content); - if (style->draw_begin) style->draw_begin(out, style->userdata); - nk_draw_button_symbol(out, &bounds, &content, *state, style, symbol, font); - if (style->draw_end) style->draw_end(out, style->userdata); - return ret; -} -NK_LIB void -nk_draw_button_image(struct nk_command_buffer *out, - const struct nk_rect *bounds, const struct nk_rect *content, - nk_flags state, const struct nk_style_button *style, const struct nk_image *img) -{ - nk_draw_button(out, bounds, state, style); - nk_draw_image(out, *content, img, nk_white); -} -NK_LIB int -nk_do_button_image(nk_flags *state, - struct nk_command_buffer *out, struct nk_rect bounds, - struct nk_image img, enum nk_button_behavior b, - const struct nk_style_button *style, const struct nk_input *in) -{ - int ret; - struct nk_rect content; - - NK_ASSERT(state); - NK_ASSERT(style); - NK_ASSERT(out); - if (!out || !style || !state) - return nk_false; - - ret = nk_do_button(state, out, bounds, style, in, b, &content); - content.x += style->image_padding.x; - content.y += style->image_padding.y; - content.w -= 2 * style->image_padding.x; - content.h -= 2 * style->image_padding.y; - - if (style->draw_begin) style->draw_begin(out, style->userdata); - nk_draw_button_image(out, &bounds, &content, *state, style, &img); - if (style->draw_end) style->draw_end(out, style->userdata); - return ret; -} -NK_LIB void -nk_draw_button_text_symbol(struct nk_command_buffer *out, - const struct nk_rect *bounds, const struct nk_rect *label, - const struct nk_rect *symbol, nk_flags state, const struct nk_style_button *style, - const char *str, int len, enum nk_symbol_type type, - const struct nk_user_font *font) -{ - struct nk_color sym; - struct nk_text text; - const struct nk_style_item *background; - - /* select correct background colors/images */ - background = nk_draw_button(out, bounds, state, style); - if (background->type == NK_STYLE_ITEM_COLOR) - text.background = background->data.color; - else text.background = style->text_background; - - /* select correct text colors */ - if (state & NK_WIDGET_STATE_HOVER) { - sym = style->text_hover; - text.text = style->text_hover; - } else if (state & NK_WIDGET_STATE_ACTIVED) { - sym = style->text_active; - text.text = style->text_active; - } else { - sym = style->text_normal; - text.text = style->text_normal; - } - - text.padding = nk_vec2(0,0); - nk_draw_symbol(out, type, *symbol, style->text_background, sym, 0, font); - nk_widget_text(out, *label, str, len, &text, NK_TEXT_CENTERED, font); -} -NK_LIB int -nk_do_button_text_symbol(nk_flags *state, - struct nk_command_buffer *out, struct nk_rect bounds, - enum nk_symbol_type symbol, const char *str, int len, nk_flags align, - enum nk_button_behavior behavior, const struct nk_style_button *style, - const struct nk_user_font *font, const struct nk_input *in) -{ - int ret; - struct nk_rect tri = {0,0,0,0}; - struct nk_rect content; - - NK_ASSERT(style); - NK_ASSERT(out); - NK_ASSERT(font); - if (!out || !style || !font) - return nk_false; - - ret = nk_do_button(state, out, bounds, style, in, behavior, &content); - tri.y = content.y + (content.h/2) - font->height/2; - tri.w = font->height; tri.h = font->height; - if (align & NK_TEXT_ALIGN_LEFT) { - tri.x = (content.x + content.w) - (2 * style->padding.x + tri.w); - tri.x = NK_MAX(tri.x, 0); - } else tri.x = content.x + 2 * style->padding.x; - - /* draw button */ - if (style->draw_begin) style->draw_begin(out, style->userdata); - nk_draw_button_text_symbol(out, &bounds, &content, &tri, - *state, style, str, len, symbol, font); - if (style->draw_end) style->draw_end(out, style->userdata); - return ret; -} -NK_LIB void -nk_draw_button_text_image(struct nk_command_buffer *out, - const struct nk_rect *bounds, const struct nk_rect *label, - const struct nk_rect *image, nk_flags state, const struct nk_style_button *style, - const char *str, int len, const struct nk_user_font *font, - const struct nk_image *img) -{ - struct nk_text text; - const struct nk_style_item *background; - background = nk_draw_button(out, bounds, state, style); - - /* select correct colors */ - if (background->type == NK_STYLE_ITEM_COLOR) - text.background = background->data.color; - else text.background = style->text_background; - if (state & NK_WIDGET_STATE_HOVER) - text.text = style->text_hover; - else if (state & NK_WIDGET_STATE_ACTIVED) - text.text = style->text_active; - else text.text = style->text_normal; - - text.padding = nk_vec2(0,0); - nk_widget_text(out, *label, str, len, &text, NK_TEXT_CENTERED, font); - nk_draw_image(out, *image, img, nk_white); -} -NK_LIB int -nk_do_button_text_image(nk_flags *state, - struct nk_command_buffer *out, struct nk_rect bounds, - struct nk_image img, const char* str, int len, nk_flags align, - enum nk_button_behavior behavior, const struct nk_style_button *style, - const struct nk_user_font *font, const struct nk_input *in) -{ - int ret; - struct nk_rect icon; - struct nk_rect content; - - NK_ASSERT(style); - NK_ASSERT(state); - NK_ASSERT(font); - NK_ASSERT(out); - if (!out || !font || !style || !str) - return nk_false; - - ret = nk_do_button(state, out, bounds, style, in, behavior, &content); - icon.y = bounds.y + style->padding.y; - icon.w = icon.h = bounds.h - 2 * style->padding.y; - if (align & NK_TEXT_ALIGN_LEFT) { - icon.x = (bounds.x + bounds.w) - (2 * style->padding.x + icon.w); - icon.x = NK_MAX(icon.x, 0); - } else icon.x = bounds.x + 2 * style->padding.x; - - icon.x += style->image_padding.x; - icon.y += style->image_padding.y; - icon.w -= 2 * style->image_padding.x; - icon.h -= 2 * style->image_padding.y; - - if (style->draw_begin) style->draw_begin(out, style->userdata); - nk_draw_button_text_image(out, &bounds, &content, &icon, *state, style, str, len, font, &img); - if (style->draw_end) style->draw_end(out, style->userdata); - return ret; -} -NK_API void -nk_button_set_behavior(struct nk_context *ctx, enum nk_button_behavior behavior) -{ - NK_ASSERT(ctx); - if (!ctx) return; - ctx->button_behavior = behavior; -} -NK_API int -nk_button_push_behavior(struct nk_context *ctx, enum nk_button_behavior behavior) -{ - struct nk_config_stack_button_behavior *button_stack; - struct nk_config_stack_button_behavior_element *element; - - NK_ASSERT(ctx); - if (!ctx) return 0; - - button_stack = &ctx->stacks.button_behaviors; - NK_ASSERT(button_stack->head < (int)NK_LEN(button_stack->elements)); - if (button_stack->head >= (int)NK_LEN(button_stack->elements)) - return 0; - - element = &button_stack->elements[button_stack->head++]; - element->address = &ctx->button_behavior; - element->old_value = ctx->button_behavior; - ctx->button_behavior = behavior; - return 1; -} -NK_API int -nk_button_pop_behavior(struct nk_context *ctx) -{ - struct nk_config_stack_button_behavior *button_stack; - struct nk_config_stack_button_behavior_element *element; - - NK_ASSERT(ctx); - if (!ctx) return 0; - - button_stack = &ctx->stacks.button_behaviors; - NK_ASSERT(button_stack->head > 0); - if (button_stack->head < 1) - return 0; - - element = &button_stack->elements[--button_stack->head]; - *element->address = element->old_value; - return 1; -} -NK_API int -nk_button_text_styled(struct nk_context *ctx, - const struct nk_style_button *style, const char *title, int len) -{ - struct nk_window *win; - struct nk_panel *layout; - const struct nk_input *in; - - struct nk_rect bounds; - enum nk_widget_layout_states state; - - NK_ASSERT(ctx); - NK_ASSERT(style); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!style || !ctx || !ctx->current || !ctx->current->layout) return 0; - - win = ctx->current; - layout = win->layout; - state = nk_widget(&bounds, ctx); - - if (!state) return 0; - in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; - return nk_do_button_text(&ctx->last_widget_state, &win->buffer, bounds, - title, len, style->text_alignment, ctx->button_behavior, - style, in, ctx->style.font); -} -NK_API int -nk_button_text(struct nk_context *ctx, const char *title, int len) -{ - NK_ASSERT(ctx); - if (!ctx) return 0; - return nk_button_text_styled(ctx, &ctx->style.button, title, len); -} -NK_API int nk_button_label_styled(struct nk_context *ctx, - const struct nk_style_button *style, const char *title) -{ - return nk_button_text_styled(ctx, style, title, nk_strlen(title)); -} -NK_API int nk_button_label(struct nk_context *ctx, const char *title) -{ - return nk_button_text(ctx, title, nk_strlen(title)); -} -NK_API int -nk_button_color(struct nk_context *ctx, struct nk_color color) -{ - struct nk_window *win; - struct nk_panel *layout; - const struct nk_input *in; - struct nk_style_button button; - - int ret = 0; - struct nk_rect bounds; - struct nk_rect content; - enum nk_widget_layout_states state; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - win = ctx->current; - layout = win->layout; - - state = nk_widget(&bounds, ctx); - if (!state) return 0; - in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; - - button = ctx->style.button; - button.normal = nk_style_item_color(color); - button.hover = nk_style_item_color(color); - button.active = nk_style_item_color(color); - ret = nk_do_button(&ctx->last_widget_state, &win->buffer, bounds, - &button, in, ctx->button_behavior, &content); - nk_draw_button(&win->buffer, &bounds, ctx->last_widget_state, &button); - return ret; -} -NK_API int -nk_button_symbol_styled(struct nk_context *ctx, - const struct nk_style_button *style, enum nk_symbol_type symbol) -{ - struct nk_window *win; - struct nk_panel *layout; - const struct nk_input *in; - - struct nk_rect bounds; - enum nk_widget_layout_states state; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - win = ctx->current; - layout = win->layout; - state = nk_widget(&bounds, ctx); - if (!state) return 0; - in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; - return nk_do_button_symbol(&ctx->last_widget_state, &win->buffer, bounds, - symbol, ctx->button_behavior, style, in, ctx->style.font); -} -NK_API int -nk_button_symbol(struct nk_context *ctx, enum nk_symbol_type symbol) -{ - NK_ASSERT(ctx); - if (!ctx) return 0; - return nk_button_symbol_styled(ctx, &ctx->style.button, symbol); -} -NK_API int -nk_button_image_styled(struct nk_context *ctx, const struct nk_style_button *style, - struct nk_image img) -{ - struct nk_window *win; - struct nk_panel *layout; - const struct nk_input *in; - - struct nk_rect bounds; - enum nk_widget_layout_states state; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - win = ctx->current; - layout = win->layout; - - state = nk_widget(&bounds, ctx); - if (!state) return 0; - in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; - return nk_do_button_image(&ctx->last_widget_state, &win->buffer, bounds, - img, ctx->button_behavior, style, in); -} -NK_API int -nk_button_image(struct nk_context *ctx, struct nk_image img) -{ - NK_ASSERT(ctx); - if (!ctx) return 0; - return nk_button_image_styled(ctx, &ctx->style.button, img); -} -NK_API int -nk_button_symbol_text_styled(struct nk_context *ctx, - const struct nk_style_button *style, enum nk_symbol_type symbol, - const char *text, int len, nk_flags align) -{ - struct nk_window *win; - struct nk_panel *layout; - const struct nk_input *in; - - struct nk_rect bounds; - enum nk_widget_layout_states state; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - win = ctx->current; - layout = win->layout; - - state = nk_widget(&bounds, ctx); - if (!state) return 0; - in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; - return nk_do_button_text_symbol(&ctx->last_widget_state, &win->buffer, bounds, - symbol, text, len, align, ctx->button_behavior, - style, ctx->style.font, in); -} -NK_API int -nk_button_symbol_text(struct nk_context *ctx, enum nk_symbol_type symbol, - const char* text, int len, nk_flags align) -{ - NK_ASSERT(ctx); - if (!ctx) return 0; - return nk_button_symbol_text_styled(ctx, &ctx->style.button, symbol, text, len, align); -} -NK_API int nk_button_symbol_label(struct nk_context *ctx, enum nk_symbol_type symbol, - const char *label, nk_flags align) -{ - return nk_button_symbol_text(ctx, symbol, label, nk_strlen(label), align); -} -NK_API int nk_button_symbol_label_styled(struct nk_context *ctx, - const struct nk_style_button *style, enum nk_symbol_type symbol, - const char *title, nk_flags align) -{ - return nk_button_symbol_text_styled(ctx, style, symbol, title, nk_strlen(title), align); -} -NK_API int -nk_button_image_text_styled(struct nk_context *ctx, - const struct nk_style_button *style, struct nk_image img, const char *text, - int len, nk_flags align) -{ - struct nk_window *win; - struct nk_panel *layout; - const struct nk_input *in; - - struct nk_rect bounds; - enum nk_widget_layout_states state; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - win = ctx->current; - layout = win->layout; - - state = nk_widget(&bounds, ctx); - if (!state) return 0; - in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; - return nk_do_button_text_image(&ctx->last_widget_state, &win->buffer, - bounds, img, text, len, align, ctx->button_behavior, - style, ctx->style.font, in); -} -NK_API int -nk_button_image_text(struct nk_context *ctx, struct nk_image img, - const char *text, int len, nk_flags align) -{ - return nk_button_image_text_styled(ctx, &ctx->style.button,img, text, len, align); -} -NK_API int nk_button_image_label(struct nk_context *ctx, struct nk_image img, - const char *label, nk_flags align) -{ - return nk_button_image_text(ctx, img, label, nk_strlen(label), align); -} -NK_API int nk_button_image_label_styled(struct nk_context *ctx, - const struct nk_style_button *style, struct nk_image img, - const char *label, nk_flags text_alignment) -{ - return nk_button_image_text_styled(ctx, style, img, label, nk_strlen(label), text_alignment); -} - - - - - -/* =============================================================== - * - * TOGGLE - * - * ===============================================================*/ -NK_LIB int -nk_toggle_behavior(const struct nk_input *in, struct nk_rect select, - nk_flags *state, int active) -{ - nk_widget_state_reset(state); - if (nk_button_behavior(state, select, in, NK_BUTTON_DEFAULT)) { - *state = NK_WIDGET_STATE_ACTIVE; - active = !active; - } - if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, select)) - *state |= NK_WIDGET_STATE_ENTERED; - else if (nk_input_is_mouse_prev_hovering_rect(in, select)) - *state |= NK_WIDGET_STATE_LEFT; - return active; -} -NK_LIB void -nk_draw_checkbox(struct nk_command_buffer *out, - nk_flags state, const struct nk_style_toggle *style, int active, - const struct nk_rect *label, const struct nk_rect *selector, - const struct nk_rect *cursors, const char *string, int len, - const struct nk_user_font *font) -{ - const struct nk_style_item *background; - const struct nk_style_item *cursor; - struct nk_text text; - - /* select correct colors/images */ - if (state & NK_WIDGET_STATE_HOVER) { - background = &style->hover; - cursor = &style->cursor_hover; - text.text = style->text_hover; - } else if (state & NK_WIDGET_STATE_ACTIVED) { - background = &style->hover; - cursor = &style->cursor_hover; - text.text = style->text_active; - } else { - background = &style->normal; - cursor = &style->cursor_normal; - text.text = style->text_normal; - } - - /* draw background and cursor */ - if (background->type == NK_STYLE_ITEM_COLOR) { - nk_fill_rect(out, *selector, 0, style->border_color); - nk_fill_rect(out, nk_shrink_rect(*selector, style->border), 0, background->data.color); - } else nk_draw_image(out, *selector, &background->data.image, nk_white); - if (active) { - if (cursor->type == NK_STYLE_ITEM_IMAGE) - nk_draw_image(out, *cursors, &cursor->data.image, nk_white); - else nk_fill_rect(out, *cursors, 0, cursor->data.color); - } - - text.padding.x = 0; - text.padding.y = 0; - text.background = style->text_background; - nk_widget_text(out, *label, string, len, &text, NK_TEXT_LEFT, font); -} -NK_LIB void -nk_draw_option(struct nk_command_buffer *out, - nk_flags state, const struct nk_style_toggle *style, int active, - const struct nk_rect *label, const struct nk_rect *selector, - const struct nk_rect *cursors, const char *string, int len, - const struct nk_user_font *font) -{ - const struct nk_style_item *background; - const struct nk_style_item *cursor; - struct nk_text text; - - /* select correct colors/images */ - if (state & NK_WIDGET_STATE_HOVER) { - background = &style->hover; - cursor = &style->cursor_hover; - text.text = style->text_hover; - } else if (state & NK_WIDGET_STATE_ACTIVED) { - background = &style->hover; - cursor = &style->cursor_hover; - text.text = style->text_active; - } else { - background = &style->normal; - cursor = &style->cursor_normal; - text.text = style->text_normal; - } - - /* draw background and cursor */ - if (background->type == NK_STYLE_ITEM_COLOR) { - nk_fill_circle(out, *selector, style->border_color); - nk_fill_circle(out, nk_shrink_rect(*selector, style->border), background->data.color); - } else nk_draw_image(out, *selector, &background->data.image, nk_white); - if (active) { - if (cursor->type == NK_STYLE_ITEM_IMAGE) - nk_draw_image(out, *cursors, &cursor->data.image, nk_white); - else nk_fill_circle(out, *cursors, cursor->data.color); - } - - text.padding.x = 0; - text.padding.y = 0; - text.background = style->text_background; - nk_widget_text(out, *label, string, len, &text, NK_TEXT_LEFT, font); -} -NK_LIB int -nk_do_toggle(nk_flags *state, - struct nk_command_buffer *out, struct nk_rect r, - int *active, const char *str, int len, enum nk_toggle_type type, - const struct nk_style_toggle *style, const struct nk_input *in, - const struct nk_user_font *font) -{ - int was_active; - struct nk_rect bounds; - struct nk_rect select; - struct nk_rect cursor; - struct nk_rect label; - - NK_ASSERT(style); - NK_ASSERT(out); - NK_ASSERT(font); - if (!out || !style || !font || !active) - return 0; - - r.w = NK_MAX(r.w, font->height + 2 * style->padding.x); - r.h = NK_MAX(r.h, font->height + 2 * style->padding.y); - - /* add additional touch padding for touch screen devices */ - bounds.x = r.x - style->touch_padding.x; - bounds.y = r.y - style->touch_padding.y; - bounds.w = r.w + 2 * style->touch_padding.x; - bounds.h = r.h + 2 * style->touch_padding.y; - - /* calculate the selector space */ - select.w = font->height; - select.h = select.w; - select.y = r.y + r.h/2.0f - select.h/2.0f; - select.x = r.x; - - /* calculate the bounds of the cursor inside the selector */ - cursor.x = select.x + style->padding.x + style->border; - cursor.y = select.y + style->padding.y + style->border; - cursor.w = select.w - (2 * style->padding.x + 2 * style->border); - cursor.h = select.h - (2 * style->padding.y + 2 * style->border); - - /* label behind the selector */ - label.x = select.x + select.w + style->spacing; - label.y = select.y; - label.w = NK_MAX(r.x + r.w, label.x) - label.x; - label.h = select.w; - - /* update selector */ - was_active = *active; - *active = nk_toggle_behavior(in, bounds, state, *active); - - /* draw selector */ - if (style->draw_begin) - style->draw_begin(out, style->userdata); - if (type == NK_TOGGLE_CHECK) { - nk_draw_checkbox(out, *state, style, *active, &label, &select, &cursor, str, len, font); - } else { - nk_draw_option(out, *state, style, *active, &label, &select, &cursor, str, len, font); - } - if (style->draw_end) - style->draw_end(out, style->userdata); - return (was_active != *active); -} -/*---------------------------------------------------------------- - * - * CHECKBOX - * - * --------------------------------------------------------------*/ -NK_API int -nk_check_text(struct nk_context *ctx, const char *text, int len, int active) -{ - struct nk_window *win; - struct nk_panel *layout; - const struct nk_input *in; - const struct nk_style *style; - - struct nk_rect bounds; - enum nk_widget_layout_states state; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return active; - - win = ctx->current; - style = &ctx->style; - layout = win->layout; - - state = nk_widget(&bounds, ctx); - if (!state) return active; - in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; - nk_do_toggle(&ctx->last_widget_state, &win->buffer, bounds, &active, - text, len, NK_TOGGLE_CHECK, &style->checkbox, in, style->font); - return active; -} -NK_API unsigned int -nk_check_flags_text(struct nk_context *ctx, const char *text, int len, - unsigned int flags, unsigned int value) -{ - int old_active; - NK_ASSERT(ctx); - NK_ASSERT(text); - if (!ctx || !text) return flags; - old_active = (int)((flags & value) & value); - if (nk_check_text(ctx, text, len, old_active)) - flags |= value; - else flags &= ~value; - return flags; -} -NK_API int -nk_checkbox_text(struct nk_context *ctx, const char *text, int len, int *active) -{ - int old_val; - NK_ASSERT(ctx); - NK_ASSERT(text); - NK_ASSERT(active); - if (!ctx || !text || !active) return 0; - old_val = *active; - *active = nk_check_text(ctx, text, len, *active); - return old_val != *active; -} -NK_API int -nk_checkbox_flags_text(struct nk_context *ctx, const char *text, int len, - unsigned int *flags, unsigned int value) -{ - int active; - NK_ASSERT(ctx); - NK_ASSERT(text); - NK_ASSERT(flags); - if (!ctx || !text || !flags) return 0; - - active = (int)((*flags & value) & value); - if (nk_checkbox_text(ctx, text, len, &active)) { - if (active) *flags |= value; - else *flags &= ~value; - return 1; - } - return 0; -} -NK_API int nk_check_label(struct nk_context *ctx, const char *label, int active) -{ - return nk_check_text(ctx, label, nk_strlen(label), active); -} -NK_API unsigned int nk_check_flags_label(struct nk_context *ctx, const char *label, - unsigned int flags, unsigned int value) -{ - return nk_check_flags_text(ctx, label, nk_strlen(label), flags, value); -} -NK_API int nk_checkbox_label(struct nk_context *ctx, const char *label, int *active) -{ - return nk_checkbox_text(ctx, label, nk_strlen(label), active); -} -NK_API int nk_checkbox_flags_label(struct nk_context *ctx, const char *label, - unsigned int *flags, unsigned int value) -{ - return nk_checkbox_flags_text(ctx, label, nk_strlen(label), flags, value); -} -/*---------------------------------------------------------------- - * - * OPTION - * - * --------------------------------------------------------------*/ -NK_API int -nk_option_text(struct nk_context *ctx, const char *text, int len, int is_active) -{ - struct nk_window *win; - struct nk_panel *layout; - const struct nk_input *in; - const struct nk_style *style; - - struct nk_rect bounds; - enum nk_widget_layout_states state; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return is_active; - - win = ctx->current; - style = &ctx->style; - layout = win->layout; - - state = nk_widget(&bounds, ctx); - if (!state) return (int)state; - in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; - nk_do_toggle(&ctx->last_widget_state, &win->buffer, bounds, &is_active, - text, len, NK_TOGGLE_OPTION, &style->option, in, style->font); - return is_active; -} -NK_API int -nk_radio_text(struct nk_context *ctx, const char *text, int len, int *active) -{ - int old_value; - NK_ASSERT(ctx); - NK_ASSERT(text); - NK_ASSERT(active); - if (!ctx || !text || !active) return 0; - old_value = *active; - *active = nk_option_text(ctx, text, len, old_value); - return old_value != *active; -} -NK_API int -nk_option_label(struct nk_context *ctx, const char *label, int active) -{ - return nk_option_text(ctx, label, nk_strlen(label), active); -} -NK_API int -nk_radio_label(struct nk_context *ctx, const char *label, int *active) -{ - return nk_radio_text(ctx, label, nk_strlen(label), active); -} - - - - - -/* =============================================================== - * - * SELECTABLE - * - * ===============================================================*/ -NK_LIB void -nk_draw_selectable(struct nk_command_buffer *out, - nk_flags state, const struct nk_style_selectable *style, int active, - const struct nk_rect *bounds, - const struct nk_rect *icon, const struct nk_image *img, enum nk_symbol_type sym, - const char *string, int len, nk_flags align, const struct nk_user_font *font) -{ - const struct nk_style_item *background; - struct nk_text text; - text.padding = style->padding; - - /* select correct colors/images */ - if (!active) { - if (state & NK_WIDGET_STATE_ACTIVED) { - background = &style->pressed; - text.text = style->text_pressed; - } else if (state & NK_WIDGET_STATE_HOVER) { - background = &style->hover; - text.text = style->text_hover; - } else { - background = &style->normal; - text.text = style->text_normal; - } - } else { - if (state & NK_WIDGET_STATE_ACTIVED) { - background = &style->pressed_active; - text.text = style->text_pressed_active; - } else if (state & NK_WIDGET_STATE_HOVER) { - background = &style->hover_active; - text.text = style->text_hover_active; - } else { - background = &style->normal_active; - text.text = style->text_normal_active; - } - } - /* draw selectable background and text */ - if (background->type == NK_STYLE_ITEM_IMAGE) { - nk_draw_image(out, *bounds, &background->data.image, nk_white); - text.background = nk_rgba(0,0,0,0); - } else { - nk_fill_rect(out, *bounds, style->rounding, background->data.color); - text.background = background->data.color; - } - if (icon) { - if (img) nk_draw_image(out, *icon, img, nk_white); - else nk_draw_symbol(out, sym, *icon, text.background, text.text, 1, font); - } - nk_widget_text(out, *bounds, string, len, &text, align, font); -} -NK_LIB int -nk_do_selectable(nk_flags *state, struct nk_command_buffer *out, - struct nk_rect bounds, const char *str, int len, nk_flags align, int *value, - const struct nk_style_selectable *style, const struct nk_input *in, - const struct nk_user_font *font) -{ - int old_value; - struct nk_rect touch; - - NK_ASSERT(state); - NK_ASSERT(out); - NK_ASSERT(str); - NK_ASSERT(len); - NK_ASSERT(value); - NK_ASSERT(style); - NK_ASSERT(font); - - if (!state || !out || !str || !len || !value || !style || !font) return 0; - old_value = *value; - - /* remove padding */ - touch.x = bounds.x - style->touch_padding.x; - touch.y = bounds.y - style->touch_padding.y; - touch.w = bounds.w + style->touch_padding.x * 2; - touch.h = bounds.h + style->touch_padding.y * 2; - - /* update button */ - if (nk_button_behavior(state, touch, in, NK_BUTTON_DEFAULT)) - *value = !(*value); - - /* draw selectable */ - if (style->draw_begin) style->draw_begin(out, style->userdata); - nk_draw_selectable(out, *state, style, *value, &bounds, 0,0,NK_SYMBOL_NONE, str, len, align, font); - if (style->draw_end) style->draw_end(out, style->userdata); - return old_value != *value; -} -NK_LIB int -nk_do_selectable_image(nk_flags *state, struct nk_command_buffer *out, - struct nk_rect bounds, const char *str, int len, nk_flags align, int *value, - const struct nk_image *img, const struct nk_style_selectable *style, - const struct nk_input *in, const struct nk_user_font *font) -{ - int old_value; - struct nk_rect touch; - struct nk_rect icon; - - NK_ASSERT(state); - NK_ASSERT(out); - NK_ASSERT(str); - NK_ASSERT(len); - NK_ASSERT(value); - NK_ASSERT(style); - NK_ASSERT(font); - - if (!state || !out || !str || !len || !value || !style || !font) return 0; - old_value = *value; - - /* toggle behavior */ - touch.x = bounds.x - style->touch_padding.x; - touch.y = bounds.y - style->touch_padding.y; - touch.w = bounds.w + style->touch_padding.x * 2; - touch.h = bounds.h + style->touch_padding.y * 2; - if (nk_button_behavior(state, touch, in, NK_BUTTON_DEFAULT)) - *value = !(*value); - - icon.y = bounds.y + style->padding.y; - icon.w = icon.h = bounds.h - 2 * style->padding.y; - if (align & NK_TEXT_ALIGN_LEFT) { - icon.x = (bounds.x + bounds.w) - (2 * style->padding.x + icon.w); - icon.x = NK_MAX(icon.x, 0); - } else icon.x = bounds.x + 2 * style->padding.x; - - icon.x += style->image_padding.x; - icon.y += style->image_padding.y; - icon.w -= 2 * style->image_padding.x; - icon.h -= 2 * style->image_padding.y; - - /* draw selectable */ - if (style->draw_begin) style->draw_begin(out, style->userdata); - nk_draw_selectable(out, *state, style, *value, &bounds, &icon, img, NK_SYMBOL_NONE, str, len, align, font); - if (style->draw_end) style->draw_end(out, style->userdata); - return old_value != *value; -} -NK_LIB int -nk_do_selectable_symbol(nk_flags *state, struct nk_command_buffer *out, - struct nk_rect bounds, const char *str, int len, nk_flags align, int *value, - enum nk_symbol_type sym, const struct nk_style_selectable *style, - const struct nk_input *in, const struct nk_user_font *font) -{ - int old_value; - struct nk_rect touch; - struct nk_rect icon; - - NK_ASSERT(state); - NK_ASSERT(out); - NK_ASSERT(str); - NK_ASSERT(len); - NK_ASSERT(value); - NK_ASSERT(style); - NK_ASSERT(font); - - if (!state || !out || !str || !len || !value || !style || !font) return 0; - old_value = *value; - - /* toggle behavior */ - touch.x = bounds.x - style->touch_padding.x; - touch.y = bounds.y - style->touch_padding.y; - touch.w = bounds.w + style->touch_padding.x * 2; - touch.h = bounds.h + style->touch_padding.y * 2; - if (nk_button_behavior(state, touch, in, NK_BUTTON_DEFAULT)) - *value = !(*value); - - icon.y = bounds.y + style->padding.y; - icon.w = icon.h = bounds.h - 2 * style->padding.y; - if (align & NK_TEXT_ALIGN_LEFT) { - icon.x = (bounds.x + bounds.w) - (2 * style->padding.x + icon.w); - icon.x = NK_MAX(icon.x, 0); - } else icon.x = bounds.x + 2 * style->padding.x; - - icon.x += style->image_padding.x; - icon.y += style->image_padding.y; - icon.w -= 2 * style->image_padding.x; - icon.h -= 2 * style->image_padding.y; - - /* draw selectable */ - if (style->draw_begin) style->draw_begin(out, style->userdata); - nk_draw_selectable(out, *state, style, *value, &bounds, &icon, 0, sym, str, len, align, font); - if (style->draw_end) style->draw_end(out, style->userdata); - return old_value != *value; -} - -NK_API int -nk_selectable_text(struct nk_context *ctx, const char *str, int len, - nk_flags align, int *value) -{ - struct nk_window *win; - struct nk_panel *layout; - const struct nk_input *in; - const struct nk_style *style; - - enum nk_widget_layout_states state; - struct nk_rect bounds; - - NK_ASSERT(ctx); - NK_ASSERT(value); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout || !value) - return 0; - - win = ctx->current; - layout = win->layout; - style = &ctx->style; - - state = nk_widget(&bounds, ctx); - if (!state) return 0; - in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; - return nk_do_selectable(&ctx->last_widget_state, &win->buffer, bounds, - str, len, align, value, &style->selectable, in, style->font); -} -NK_API int -nk_selectable_image_text(struct nk_context *ctx, struct nk_image img, - const char *str, int len, nk_flags align, int *value) -{ - struct nk_window *win; - struct nk_panel *layout; - const struct nk_input *in; - const struct nk_style *style; - - enum nk_widget_layout_states state; - struct nk_rect bounds; - - NK_ASSERT(ctx); - NK_ASSERT(value); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout || !value) - return 0; - - win = ctx->current; - layout = win->layout; - style = &ctx->style; - - state = nk_widget(&bounds, ctx); - if (!state) return 0; - in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; - return nk_do_selectable_image(&ctx->last_widget_state, &win->buffer, bounds, - str, len, align, value, &img, &style->selectable, in, style->font); -} -NK_API int -nk_selectable_symbol_text(struct nk_context *ctx, enum nk_symbol_type sym, - const char *str, int len, nk_flags align, int *value) -{ - struct nk_window *win; - struct nk_panel *layout; - const struct nk_input *in; - const struct nk_style *style; - - enum nk_widget_layout_states state; - struct nk_rect bounds; - - NK_ASSERT(ctx); - NK_ASSERT(value); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout || !value) - return 0; - - win = ctx->current; - layout = win->layout; - style = &ctx->style; - - state = nk_widget(&bounds, ctx); - if (!state) return 0; - in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; - return nk_do_selectable_symbol(&ctx->last_widget_state, &win->buffer, bounds, - str, len, align, value, sym, &style->selectable, in, style->font); -} -NK_API int -nk_selectable_symbol_label(struct nk_context *ctx, enum nk_symbol_type sym, - const char *title, nk_flags align, int *value) -{ - return nk_selectable_symbol_text(ctx, sym, title, nk_strlen(title), align, value); -} -NK_API int nk_select_text(struct nk_context *ctx, const char *str, int len, - nk_flags align, int value) -{ - nk_selectable_text(ctx, str, len, align, &value);return value; -} -NK_API int nk_selectable_label(struct nk_context *ctx, const char *str, nk_flags align, int *value) -{ - return nk_selectable_text(ctx, str, nk_strlen(str), align, value); -} -NK_API int nk_selectable_image_label(struct nk_context *ctx,struct nk_image img, - const char *str, nk_flags align, int *value) -{ - return nk_selectable_image_text(ctx, img, str, nk_strlen(str), align, value); -} -NK_API int nk_select_label(struct nk_context *ctx, const char *str, nk_flags align, int value) -{ - nk_selectable_text(ctx, str, nk_strlen(str), align, &value);return value; -} -NK_API int nk_select_image_label(struct nk_context *ctx, struct nk_image img, - const char *str, nk_flags align, int value) -{ - nk_selectable_image_text(ctx, img, str, nk_strlen(str), align, &value);return value; -} -NK_API int nk_select_image_text(struct nk_context *ctx, struct nk_image img, - const char *str, int len, nk_flags align, int value) -{ - nk_selectable_image_text(ctx, img, str, len, align, &value);return value; -} -NK_API int -nk_select_symbol_text(struct nk_context *ctx, enum nk_symbol_type sym, - const char *title, int title_len, nk_flags align, int value) -{ - nk_selectable_symbol_text(ctx, sym, title, title_len, align, &value);return value; -} -NK_API int -nk_select_symbol_label(struct nk_context *ctx, enum nk_symbol_type sym, - const char *title, nk_flags align, int value) -{ - return nk_select_symbol_text(ctx, sym, title, nk_strlen(title), align, value); -} - - - - - -/* =============================================================== - * - * SLIDER - * - * ===============================================================*/ -NK_LIB float -nk_slider_behavior(nk_flags *state, struct nk_rect *logical_cursor, - struct nk_rect *visual_cursor, struct nk_input *in, - struct nk_rect bounds, float slider_min, float slider_max, float slider_value, - float slider_step, float slider_steps) -{ - int left_mouse_down; - int left_mouse_click_in_cursor; - - /* check if visual cursor is being dragged */ - nk_widget_state_reset(state); - left_mouse_down = in && in->mouse.buttons[NK_BUTTON_LEFT].down; - left_mouse_click_in_cursor = in && nk_input_has_mouse_click_down_in_rect(in, - NK_BUTTON_LEFT, *visual_cursor, nk_true); - - if (left_mouse_down && left_mouse_click_in_cursor) { - float ratio = 0; - const float d = in->mouse.pos.x - (visual_cursor->x+visual_cursor->w*0.5f); - const float pxstep = bounds.w / slider_steps; - - /* only update value if the next slider step is reached */ - *state = NK_WIDGET_STATE_ACTIVE; - if (NK_ABS(d) >= pxstep) { - const float steps = (float)((int)(NK_ABS(d) / pxstep)); - slider_value += (d > 0) ? (slider_step*steps) : -(slider_step*steps); - slider_value = NK_CLAMP(slider_min, slider_value, slider_max); - ratio = (slider_value - slider_min)/slider_step; - logical_cursor->x = bounds.x + (logical_cursor->w * ratio); - in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x = logical_cursor->x; - } - } - - /* slider widget state */ - if (nk_input_is_mouse_hovering_rect(in, bounds)) - *state = NK_WIDGET_STATE_HOVERED; - if (*state & NK_WIDGET_STATE_HOVER && - !nk_input_is_mouse_prev_hovering_rect(in, bounds)) - *state |= NK_WIDGET_STATE_ENTERED; - else if (nk_input_is_mouse_prev_hovering_rect(in, bounds)) - *state |= NK_WIDGET_STATE_LEFT; - return slider_value; -} -NK_LIB void -nk_draw_slider(struct nk_command_buffer *out, nk_flags state, - const struct nk_style_slider *style, const struct nk_rect *bounds, - const struct nk_rect *visual_cursor, float min, float value, float max) -{ - struct nk_rect fill; - struct nk_rect bar; - const struct nk_style_item *background; - - /* select correct slider images/colors */ - struct nk_color bar_color; - const struct nk_style_item *cursor; - - NK_UNUSED(min); - NK_UNUSED(max); - NK_UNUSED(value); - - if (state & NK_WIDGET_STATE_ACTIVED) { - background = &style->active; - bar_color = style->bar_active; - cursor = &style->cursor_active; - } else if (state & NK_WIDGET_STATE_HOVER) { - background = &style->hover; - bar_color = style->bar_hover; - cursor = &style->cursor_hover; - } else { - background = &style->normal; - bar_color = style->bar_normal; - cursor = &style->cursor_normal; - } - /* calculate slider background bar */ - bar.x = bounds->x; - bar.y = (visual_cursor->y + visual_cursor->h/2) - bounds->h/12; - bar.w = bounds->w; - bar.h = bounds->h/6; - - /* filled background bar style */ - fill.w = (visual_cursor->x + (visual_cursor->w/2.0f)) - bar.x; - fill.x = bar.x; - fill.y = bar.y; - fill.h = bar.h; - - /* draw background */ - if (background->type == NK_STYLE_ITEM_IMAGE) { - nk_draw_image(out, *bounds, &background->data.image, nk_white); - } else { - nk_fill_rect(out, *bounds, style->rounding, background->data.color); - nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color); - } - - /* draw slider bar */ - nk_fill_rect(out, bar, style->rounding, bar_color); - nk_fill_rect(out, fill, style->rounding, style->bar_filled); - - /* draw cursor */ - if (cursor->type == NK_STYLE_ITEM_IMAGE) - nk_draw_image(out, *visual_cursor, &cursor->data.image, nk_white); - else nk_fill_circle(out, *visual_cursor, cursor->data.color); -} -NK_LIB float -nk_do_slider(nk_flags *state, - struct nk_command_buffer *out, struct nk_rect bounds, - float min, float val, float max, float step, - const struct nk_style_slider *style, struct nk_input *in, - const struct nk_user_font *font) -{ - float slider_range; - float slider_min; - float slider_max; - float slider_value; - float slider_steps; - float cursor_offset; - - struct nk_rect visual_cursor; - struct nk_rect logical_cursor; - - NK_ASSERT(style); - NK_ASSERT(out); - if (!out || !style) - return 0; - - /* remove padding from slider bounds */ - bounds.x = bounds.x + style->padding.x; - bounds.y = bounds.y + style->padding.y; - bounds.h = NK_MAX(bounds.h, 2*style->padding.y); - bounds.w = NK_MAX(bounds.w, 2*style->padding.x + style->cursor_size.x); - bounds.w -= 2 * style->padding.x; - bounds.h -= 2 * style->padding.y; - - /* optional buttons */ - if (style->show_buttons) { - nk_flags ws; - struct nk_rect button; - button.y = bounds.y; - button.w = bounds.h; - button.h = bounds.h; - - /* decrement button */ - button.x = bounds.x; - if (nk_do_button_symbol(&ws, out, button, style->dec_symbol, NK_BUTTON_DEFAULT, - &style->dec_button, in, font)) - val -= step; - - /* increment button */ - button.x = (bounds.x + bounds.w) - button.w; - if (nk_do_button_symbol(&ws, out, button, style->inc_symbol, NK_BUTTON_DEFAULT, - &style->inc_button, in, font)) - val += step; - - bounds.x = bounds.x + button.w + style->spacing.x; - bounds.w = bounds.w - (2*button.w + 2*style->spacing.x); - } - - /* remove one cursor size to support visual cursor */ - bounds.x += style->cursor_size.x*0.5f; - bounds.w -= style->cursor_size.x; - - /* make sure the provided values are correct */ - slider_max = NK_MAX(min, max); - slider_min = NK_MIN(min, max); - slider_value = NK_CLAMP(slider_min, val, slider_max); - slider_range = slider_max - slider_min; - slider_steps = slider_range / step; - cursor_offset = (slider_value - slider_min) / step; - - /* calculate cursor - Basically you have two cursors. One for visual representation and interaction - and one for updating the actual cursor value. */ - logical_cursor.h = bounds.h; - logical_cursor.w = bounds.w / slider_steps; - logical_cursor.x = bounds.x + (logical_cursor.w * cursor_offset); - logical_cursor.y = bounds.y; - - visual_cursor.h = style->cursor_size.y; - visual_cursor.w = style->cursor_size.x; - visual_cursor.y = (bounds.y + bounds.h*0.5f) - visual_cursor.h*0.5f; - visual_cursor.x = logical_cursor.x - visual_cursor.w*0.5f; - - slider_value = nk_slider_behavior(state, &logical_cursor, &visual_cursor, - in, bounds, slider_min, slider_max, slider_value, step, slider_steps); - visual_cursor.x = logical_cursor.x - visual_cursor.w*0.5f; - - /* draw slider */ - if (style->draw_begin) style->draw_begin(out, style->userdata); - nk_draw_slider(out, *state, style, &bounds, &visual_cursor, slider_min, slider_value, slider_max); - if (style->draw_end) style->draw_end(out, style->userdata); - return slider_value; -} -NK_API int -nk_slider_float(struct nk_context *ctx, float min_value, float *value, float max_value, - float value_step) -{ - struct nk_window *win; - struct nk_panel *layout; - struct nk_input *in; - const struct nk_style *style; - - int ret = 0; - float old_value; - struct nk_rect bounds; - enum nk_widget_layout_states state; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - NK_ASSERT(value); - if (!ctx || !ctx->current || !ctx->current->layout || !value) - return ret; - - win = ctx->current; - style = &ctx->style; - layout = win->layout; - - state = nk_widget(&bounds, ctx); - if (!state) return ret; - in = (/*state == NK_WIDGET_ROM || */ layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; - - old_value = *value; - *value = nk_do_slider(&ctx->last_widget_state, &win->buffer, bounds, min_value, - old_value, max_value, value_step, &style->slider, in, style->font); - return (old_value > *value || old_value < *value); -} -NK_API float -nk_slide_float(struct nk_context *ctx, float min, float val, float max, float step) -{ - nk_slider_float(ctx, min, &val, max, step); return val; -} -NK_API int -nk_slide_int(struct nk_context *ctx, int min, int val, int max, int step) -{ - float value = (float)val; - nk_slider_float(ctx, (float)min, &value, (float)max, (float)step); - return (int)value; -} -NK_API int -nk_slider_int(struct nk_context *ctx, int min, int *val, int max, int step) -{ - int ret; - float value = (float)*val; - ret = nk_slider_float(ctx, (float)min, &value, (float)max, (float)step); - *val = (int)value; - return ret; -} - - - - - -/* =============================================================== - * - * PROGRESS - * - * ===============================================================*/ -NK_LIB nk_size -nk_progress_behavior(nk_flags *state, struct nk_input *in, - struct nk_rect r, struct nk_rect cursor, nk_size max, nk_size value, int modifiable) -{ - int left_mouse_down = 0; - int left_mouse_click_in_cursor = 0; - - nk_widget_state_reset(state); - if (!in || !modifiable) return value; - left_mouse_down = in && in->mouse.buttons[NK_BUTTON_LEFT].down; - left_mouse_click_in_cursor = in && nk_input_has_mouse_click_down_in_rect(in, - NK_BUTTON_LEFT, cursor, nk_true); - if (nk_input_is_mouse_hovering_rect(in, r)) - *state = NK_WIDGET_STATE_HOVERED; - - if (in && left_mouse_down && left_mouse_click_in_cursor) { - if (left_mouse_down && left_mouse_click_in_cursor) { - float ratio = NK_MAX(0, (float)(in->mouse.pos.x - cursor.x)) / (float)cursor.w; - value = (nk_size)NK_CLAMP(0, (float)max * ratio, (float)max); - in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x = cursor.x + cursor.w/2.0f; - *state |= NK_WIDGET_STATE_ACTIVE; - } - } - /* set progressbar widget state */ - if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, r)) - *state |= NK_WIDGET_STATE_ENTERED; - else if (nk_input_is_mouse_prev_hovering_rect(in, r)) - *state |= NK_WIDGET_STATE_LEFT; - return value; -} -NK_LIB void -nk_draw_progress(struct nk_command_buffer *out, nk_flags state, - const struct nk_style_progress *style, const struct nk_rect *bounds, - const struct nk_rect *scursor, nk_size value, nk_size max) -{ - const struct nk_style_item *background; - const struct nk_style_item *cursor; - - NK_UNUSED(max); - NK_UNUSED(value); - - /* select correct colors/images to draw */ - if (state & NK_WIDGET_STATE_ACTIVED) { - background = &style->active; - cursor = &style->cursor_active; - } else if (state & NK_WIDGET_STATE_HOVER){ - background = &style->hover; - cursor = &style->cursor_hover; - } else { - background = &style->normal; - cursor = &style->cursor_normal; - } - - /* draw background */ - if (background->type == NK_STYLE_ITEM_COLOR) { - nk_fill_rect(out, *bounds, style->rounding, background->data.color); - nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color); - } else nk_draw_image(out, *bounds, &background->data.image, nk_white); - - /* draw cursor */ - if (cursor->type == NK_STYLE_ITEM_COLOR) { - nk_fill_rect(out, *scursor, style->rounding, cursor->data.color); - nk_stroke_rect(out, *scursor, style->rounding, style->border, style->border_color); - } else nk_draw_image(out, *scursor, &cursor->data.image, nk_white); -} -NK_LIB nk_size -nk_do_progress(nk_flags *state, - struct nk_command_buffer *out, struct nk_rect bounds, - nk_size value, nk_size max, int modifiable, - const struct nk_style_progress *style, struct nk_input *in) -{ - float prog_scale; - nk_size prog_value; - struct nk_rect cursor; - - NK_ASSERT(style); - NK_ASSERT(out); - if (!out || !style) return 0; - - /* calculate progressbar cursor */ - cursor.w = NK_MAX(bounds.w, 2 * style->padding.x + 2 * style->border); - cursor.h = NK_MAX(bounds.h, 2 * style->padding.y + 2 * style->border); - cursor = nk_pad_rect(bounds, nk_vec2(style->padding.x + style->border, style->padding.y + style->border)); - prog_scale = (float)value / (float)max; - - /* update progressbar */ - prog_value = NK_MIN(value, max); - prog_value = nk_progress_behavior(state, in, bounds, cursor,max, prog_value, modifiable); - cursor.w = cursor.w * prog_scale; - - /* draw progressbar */ - if (style->draw_begin) style->draw_begin(out, style->userdata); - nk_draw_progress(out, *state, style, &bounds, &cursor, value, max); - if (style->draw_end) style->draw_end(out, style->userdata); - return prog_value; -} -NK_API int -nk_progress(struct nk_context *ctx, nk_size *cur, nk_size max, int is_modifyable) -{ - struct nk_window *win; - struct nk_panel *layout; - const struct nk_style *style; - struct nk_input *in; - - struct nk_rect bounds; - enum nk_widget_layout_states state; - nk_size old_value; - - NK_ASSERT(ctx); - NK_ASSERT(cur); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout || !cur) - return 0; - - win = ctx->current; - style = &ctx->style; - layout = win->layout; - state = nk_widget(&bounds, ctx); - if (!state) return 0; - - in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; - old_value = *cur; - *cur = nk_do_progress(&ctx->last_widget_state, &win->buffer, bounds, - *cur, max, is_modifyable, &style->progress, in); - return (*cur != old_value); -} -NK_API nk_size -nk_prog(struct nk_context *ctx, nk_size cur, nk_size max, int modifyable) -{ - nk_progress(ctx, &cur, max, modifyable); - return cur; -} - - - - - -/* =============================================================== - * - * SCROLLBAR - * - * ===============================================================*/ -NK_LIB float -nk_scrollbar_behavior(nk_flags *state, struct nk_input *in, - int has_scrolling, const struct nk_rect *scroll, - const struct nk_rect *cursor, const struct nk_rect *empty0, - const struct nk_rect *empty1, float scroll_offset, - float target, float scroll_step, enum nk_orientation o) -{ - nk_flags ws = 0; - int left_mouse_down; - int left_mouse_clicked; - int left_mouse_click_in_cursor; - float scroll_delta; - - nk_widget_state_reset(state); - if (!in) return scroll_offset; - - left_mouse_down = in->mouse.buttons[NK_BUTTON_LEFT].down; - left_mouse_clicked = in->mouse.buttons[NK_BUTTON_LEFT].clicked; - left_mouse_click_in_cursor = nk_input_has_mouse_click_down_in_rect(in, - NK_BUTTON_LEFT, *cursor, nk_true); - if (nk_input_is_mouse_hovering_rect(in, *scroll)) - *state = NK_WIDGET_STATE_HOVERED; - - scroll_delta = (o == NK_VERTICAL) ? in->mouse.scroll_delta.y: in->mouse.scroll_delta.x; - if (left_mouse_down && left_mouse_click_in_cursor && !left_mouse_clicked) { - /* update cursor by mouse dragging */ - float pixel, delta; - *state = NK_WIDGET_STATE_ACTIVE; - if (o == NK_VERTICAL) { - float cursor_y; - pixel = in->mouse.delta.y; - delta = (pixel / scroll->h) * target; - scroll_offset = NK_CLAMP(0, scroll_offset + delta, target - scroll->h); - cursor_y = scroll->y + ((scroll_offset/target) * scroll->h); - in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.y = cursor_y + cursor->h/2.0f; - } else { - float cursor_x; - pixel = in->mouse.delta.x; - delta = (pixel / scroll->w) * target; - scroll_offset = NK_CLAMP(0, scroll_offset + delta, target - scroll->w); - cursor_x = scroll->x + ((scroll_offset/target) * scroll->w); - in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x = cursor_x + cursor->w/2.0f; - } - } else if ((nk_input_is_key_pressed(in, NK_KEY_SCROLL_UP) && o == NK_VERTICAL && has_scrolling)|| - nk_button_behavior(&ws, *empty0, in, NK_BUTTON_DEFAULT)) { - /* scroll page up by click on empty space or shortcut */ - if (o == NK_VERTICAL) - scroll_offset = NK_MAX(0, scroll_offset - scroll->h); - else scroll_offset = NK_MAX(0, scroll_offset - scroll->w); - } else if ((nk_input_is_key_pressed(in, NK_KEY_SCROLL_DOWN) && o == NK_VERTICAL && has_scrolling) || - nk_button_behavior(&ws, *empty1, in, NK_BUTTON_DEFAULT)) { - /* scroll page down by click on empty space or shortcut */ - if (o == NK_VERTICAL) - scroll_offset = NK_MIN(scroll_offset + scroll->h, target - scroll->h); - else scroll_offset = NK_MIN(scroll_offset + scroll->w, target - scroll->w); - } else if (has_scrolling) { - if ((scroll_delta < 0 || (scroll_delta > 0))) { - /* update cursor by mouse scrolling */ - scroll_offset = scroll_offset + scroll_step * (-scroll_delta); - if (o == NK_VERTICAL) - scroll_offset = NK_CLAMP(0, scroll_offset, target - scroll->h); - else scroll_offset = NK_CLAMP(0, scroll_offset, target - scroll->w); - } else if (nk_input_is_key_pressed(in, NK_KEY_SCROLL_START)) { - /* update cursor to the beginning */ - if (o == NK_VERTICAL) scroll_offset = 0; - } else if (nk_input_is_key_pressed(in, NK_KEY_SCROLL_END)) { - /* update cursor to the end */ - if (o == NK_VERTICAL) scroll_offset = target - scroll->h; - } - } - if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, *scroll)) - *state |= NK_WIDGET_STATE_ENTERED; - else if (nk_input_is_mouse_prev_hovering_rect(in, *scroll)) - *state |= NK_WIDGET_STATE_LEFT; - return scroll_offset; -} -NK_LIB void -nk_draw_scrollbar(struct nk_command_buffer *out, nk_flags state, - const struct nk_style_scrollbar *style, const struct nk_rect *bounds, - const struct nk_rect *scroll) -{ - const struct nk_style_item *background; - const struct nk_style_item *cursor; - - /* select correct colors/images to draw */ - if (state & NK_WIDGET_STATE_ACTIVED) { - background = &style->active; - cursor = &style->cursor_active; - } else if (state & NK_WIDGET_STATE_HOVER) { - background = &style->hover; - cursor = &style->cursor_hover; - } else { - background = &style->normal; - cursor = &style->cursor_normal; - } - - /* draw background */ - if (background->type == NK_STYLE_ITEM_COLOR) { - nk_fill_rect(out, *bounds, style->rounding, background->data.color); - nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color); - } else { - nk_draw_image(out, *bounds, &background->data.image, nk_white); - } - - /* draw cursor */ - if (cursor->type == NK_STYLE_ITEM_COLOR) { - nk_fill_rect(out, *scroll, style->rounding_cursor, cursor->data.color); - nk_stroke_rect(out, *scroll, style->rounding_cursor, style->border_cursor, style->cursor_border_color); - } else nk_draw_image(out, *scroll, &cursor->data.image, nk_white); -} -NK_LIB float -nk_do_scrollbarv(nk_flags *state, - struct nk_command_buffer *out, struct nk_rect scroll, int has_scrolling, - float offset, float target, float step, float button_pixel_inc, - const struct nk_style_scrollbar *style, struct nk_input *in, - const struct nk_user_font *font) -{ - struct nk_rect empty_north; - struct nk_rect empty_south; - struct nk_rect cursor; - - float scroll_step; - float scroll_offset; - float scroll_off; - float scroll_ratio; - - NK_ASSERT(out); - NK_ASSERT(style); - NK_ASSERT(state); - if (!out || !style) return 0; - - scroll.w = NK_MAX(scroll.w, 1); - scroll.h = NK_MAX(scroll.h, 0); - if (target <= scroll.h) return 0; - - /* optional scrollbar buttons */ - if (style->show_buttons) { - nk_flags ws; - float scroll_h; - struct nk_rect button; - - button.x = scroll.x; - button.w = scroll.w; - button.h = scroll.w; - - scroll_h = NK_MAX(scroll.h - 2 * button.h,0); - scroll_step = NK_MIN(step, button_pixel_inc); - - /* decrement button */ - button.y = scroll.y; - if (nk_do_button_symbol(&ws, out, button, style->dec_symbol, - NK_BUTTON_REPEATER, &style->dec_button, in, font)) - offset = offset - scroll_step; - - /* increment button */ - button.y = scroll.y + scroll.h - button.h; - if (nk_do_button_symbol(&ws, out, button, style->inc_symbol, - NK_BUTTON_REPEATER, &style->inc_button, in, font)) - offset = offset + scroll_step; - - scroll.y = scroll.y + button.h; - scroll.h = scroll_h; - } - - /* calculate scrollbar constants */ - scroll_step = NK_MIN(step, scroll.h); - scroll_offset = NK_CLAMP(0, offset, target - scroll.h); - scroll_ratio = scroll.h / target; - scroll_off = scroll_offset / target; - - /* calculate scrollbar cursor bounds */ - cursor.h = NK_MAX((scroll_ratio * scroll.h) - (2*style->border + 2*style->padding.y), 0); - cursor.y = scroll.y + (scroll_off * scroll.h) + style->border + style->padding.y; - cursor.w = scroll.w - (2 * style->border + 2 * style->padding.x); - cursor.x = scroll.x + style->border + style->padding.x; - - /* calculate empty space around cursor */ - empty_north.x = scroll.x; - empty_north.y = scroll.y; - empty_north.w = scroll.w; - empty_north.h = NK_MAX(cursor.y - scroll.y, 0); - - empty_south.x = scroll.x; - empty_south.y = cursor.y + cursor.h; - empty_south.w = scroll.w; - empty_south.h = NK_MAX((scroll.y + scroll.h) - (cursor.y + cursor.h), 0); - - /* update scrollbar */ - scroll_offset = nk_scrollbar_behavior(state, in, has_scrolling, &scroll, &cursor, - &empty_north, &empty_south, scroll_offset, target, scroll_step, NK_VERTICAL); - scroll_off = scroll_offset / target; - cursor.y = scroll.y + (scroll_off * scroll.h) + style->border_cursor + style->padding.y; - - /* draw scrollbar */ - if (style->draw_begin) style->draw_begin(out, style->userdata); - nk_draw_scrollbar(out, *state, style, &scroll, &cursor); - if (style->draw_end) style->draw_end(out, style->userdata); - return scroll_offset; -} -NK_LIB float -nk_do_scrollbarh(nk_flags *state, - struct nk_command_buffer *out, struct nk_rect scroll, int has_scrolling, - float offset, float target, float step, float button_pixel_inc, - const struct nk_style_scrollbar *style, struct nk_input *in, - const struct nk_user_font *font) -{ - struct nk_rect cursor; - struct nk_rect empty_west; - struct nk_rect empty_east; - - float scroll_step; - float scroll_offset; - float scroll_off; - float scroll_ratio; - - NK_ASSERT(out); - NK_ASSERT(style); - if (!out || !style) return 0; - - /* scrollbar background */ - scroll.h = NK_MAX(scroll.h, 1); - scroll.w = NK_MAX(scroll.w, 2 * scroll.h); - if (target <= scroll.w) return 0; - - /* optional scrollbar buttons */ - if (style->show_buttons) { - nk_flags ws; - float scroll_w; - struct nk_rect button; - button.y = scroll.y; - button.w = scroll.h; - button.h = scroll.h; - - scroll_w = scroll.w - 2 * button.w; - scroll_step = NK_MIN(step, button_pixel_inc); - - /* decrement button */ - button.x = scroll.x; - if (nk_do_button_symbol(&ws, out, button, style->dec_symbol, - NK_BUTTON_REPEATER, &style->dec_button, in, font)) - offset = offset - scroll_step; - - /* increment button */ - button.x = scroll.x + scroll.w - button.w; - if (nk_do_button_symbol(&ws, out, button, style->inc_symbol, - NK_BUTTON_REPEATER, &style->inc_button, in, font)) - offset = offset + scroll_step; - - scroll.x = scroll.x + button.w; - scroll.w = scroll_w; - } - - /* calculate scrollbar constants */ - scroll_step = NK_MIN(step, scroll.w); - scroll_offset = NK_CLAMP(0, offset, target - scroll.w); - scroll_ratio = scroll.w / target; - scroll_off = scroll_offset / target; - - /* calculate cursor bounds */ - cursor.w = (scroll_ratio * scroll.w) - (2*style->border + 2*style->padding.x); - cursor.x = scroll.x + (scroll_off * scroll.w) + style->border + style->padding.x; - cursor.h = scroll.h - (2 * style->border + 2 * style->padding.y); - cursor.y = scroll.y + style->border + style->padding.y; - - /* calculate empty space around cursor */ - empty_west.x = scroll.x; - empty_west.y = scroll.y; - empty_west.w = cursor.x - scroll.x; - empty_west.h = scroll.h; - - empty_east.x = cursor.x + cursor.w; - empty_east.y = scroll.y; - empty_east.w = (scroll.x + scroll.w) - (cursor.x + cursor.w); - empty_east.h = scroll.h; - - /* update scrollbar */ - scroll_offset = nk_scrollbar_behavior(state, in, has_scrolling, &scroll, &cursor, - &empty_west, &empty_east, scroll_offset, target, scroll_step, NK_HORIZONTAL); - scroll_off = scroll_offset / target; - cursor.x = scroll.x + (scroll_off * scroll.w); - - /* draw scrollbar */ - if (style->draw_begin) style->draw_begin(out, style->userdata); - nk_draw_scrollbar(out, *state, style, &scroll, &cursor); - if (style->draw_end) style->draw_end(out, style->userdata); - return scroll_offset; -} - - - - - -/* =============================================================== - * - * TEXT EDITOR - * - * ===============================================================*/ -/* stb_textedit.h - v1.8 - public domain - Sean Barrett */ -struct nk_text_find { - float x,y; /* position of n'th character */ - float height; /* height of line */ - int first_char, length; /* first char of row, and length */ - int prev_first; /*_ first char of previous row */ -}; - -struct nk_text_edit_row { - float x0,x1; - /* starting x location, end x location (allows for align=right, etc) */ - float baseline_y_delta; - /* position of baseline relative to previous row's baseline*/ - float ymin,ymax; - /* height of row above and below baseline */ - int num_chars; -}; - -/* forward declarations */ -NK_INTERN void nk_textedit_makeundo_delete(struct nk_text_edit*, int, int); -NK_INTERN void nk_textedit_makeundo_insert(struct nk_text_edit*, int, int); -NK_INTERN void nk_textedit_makeundo_replace(struct nk_text_edit*, int, int, int); -#define NK_TEXT_HAS_SELECTION(s) ((s)->select_start != (s)->select_end) - -NK_INTERN float -nk_textedit_get_width(const struct nk_text_edit *edit, int line_start, int char_id, - const struct nk_user_font *font) -{ - int len = 0; - nk_rune unicode = 0; - const char *str = nk_str_at_const(&edit->string, line_start + char_id, &unicode, &len); - return font->width(font->userdata, font->height, str, len); -} -NK_INTERN void -nk_textedit_layout_row(struct nk_text_edit_row *r, struct nk_text_edit *edit, - int line_start_id, float row_height, const struct nk_user_font *font) -{ - int l; - int glyphs = 0; - nk_rune unicode; - const char *remaining; - int len = nk_str_len_char(&edit->string); - const char *end = nk_str_get_const(&edit->string) + len; - const char *text = nk_str_at_const(&edit->string, line_start_id, &unicode, &l); - const struct nk_vec2 size = nk_text_calculate_text_bounds(font, - text, (int)(end - text), row_height, &remaining, 0, &glyphs, NK_STOP_ON_NEW_LINE); - - r->x0 = 0.0f; - r->x1 = size.x; - r->baseline_y_delta = size.y; - r->ymin = 0.0f; - r->ymax = size.y; - r->num_chars = glyphs; -} -NK_INTERN int -nk_textedit_locate_coord(struct nk_text_edit *edit, float x, float y, - const struct nk_user_font *font, float row_height) -{ - struct nk_text_edit_row r; - int n = edit->string.len; - float base_y = 0, prev_x; - int i=0, k; - - r.x0 = r.x1 = 0; - r.ymin = r.ymax = 0; - r.num_chars = 0; - - /* search rows to find one that straddles 'y' */ - while (i < n) { - nk_textedit_layout_row(&r, edit, i, row_height, font); - if (r.num_chars <= 0) - return n; - - if (i==0 && y < base_y + r.ymin) - return 0; - - if (y < base_y + r.ymax) - break; - - i += r.num_chars; - base_y += r.baseline_y_delta; - } - - /* below all text, return 'after' last character */ - if (i >= n) - return n; - - /* check if it's before the beginning of the line */ - if (x < r.x0) - return i; - - /* check if it's before the end of the line */ - if (x < r.x1) { - /* search characters in row for one that straddles 'x' */ - k = i; - prev_x = r.x0; - for (i=0; i < r.num_chars; ++i) { - float w = nk_textedit_get_width(edit, k, i, font); - if (x < prev_x+w) { - if (x < prev_x+w/2) - return k+i; - else return k+i+1; - } - prev_x += w; - } - /* shouldn't happen, but if it does, fall through to end-of-line case */ - } - - /* if the last character is a newline, return that. - * otherwise return 'after' the last character */ - if (nk_str_rune_at(&edit->string, i+r.num_chars-1) == '\n') - return i+r.num_chars-1; - else return i+r.num_chars; -} -NK_LIB void -nk_textedit_click(struct nk_text_edit *state, float x, float y, - const struct nk_user_font *font, float row_height) -{ - /* API click: on mouse down, move the cursor to the clicked location, - * and reset the selection */ - state->cursor = nk_textedit_locate_coord(state, x, y, font, row_height); - state->select_start = state->cursor; - state->select_end = state->cursor; - state->has_preferred_x = 0; -} -NK_LIB void -nk_textedit_drag(struct nk_text_edit *state, float x, float y, - const struct nk_user_font *font, float row_height) -{ - /* API drag: on mouse drag, move the cursor and selection endpoint - * to the clicked location */ - int p = nk_textedit_locate_coord(state, x, y, font, row_height); - if (state->select_start == state->select_end) - state->select_start = state->cursor; - state->cursor = state->select_end = p; -} -NK_INTERN void -nk_textedit_find_charpos(struct nk_text_find *find, struct nk_text_edit *state, - int n, int single_line, const struct nk_user_font *font, float row_height) -{ - /* find the x/y location of a character, and remember info about the previous - * row in case we get a move-up event (for page up, we'll have to rescan) */ - struct nk_text_edit_row r; - int prev_start = 0; - int z = state->string.len; - int i=0, first; - - nk_zero_struct(r); - if (n == z) { - /* if it's at the end, then find the last line -- simpler than trying to - explicitly handle this case in the regular code */ - nk_textedit_layout_row(&r, state, 0, row_height, font); - if (single_line) { - find->first_char = 0; - find->length = z; - } else { - while (i < z) { - prev_start = i; - i += r.num_chars; - nk_textedit_layout_row(&r, state, i, row_height, font); - } - - find->first_char = i; - find->length = r.num_chars; - } - find->x = r.x1; - find->y = r.ymin; - find->height = r.ymax - r.ymin; - find->prev_first = prev_start; - return; - } - - /* search rows to find the one that straddles character n */ - find->y = 0; - - for(;;) { - nk_textedit_layout_row(&r, state, i, row_height, font); - if (n < i + r.num_chars) break; - prev_start = i; - i += r.num_chars; - find->y += r.baseline_y_delta; - } - - find->first_char = first = i; - find->length = r.num_chars; - find->height = r.ymax - r.ymin; - find->prev_first = prev_start; - - /* now scan to find xpos */ - find->x = r.x0; - for (i=0; first+i < n; ++i) - find->x += nk_textedit_get_width(state, first, i, font); -} -NK_INTERN void -nk_textedit_clamp(struct nk_text_edit *state) -{ - /* make the selection/cursor state valid if client altered the string */ - int n = state->string.len; - if (NK_TEXT_HAS_SELECTION(state)) { - if (state->select_start > n) state->select_start = n; - if (state->select_end > n) state->select_end = n; - /* if clamping forced them to be equal, move the cursor to match */ - if (state->select_start == state->select_end) - state->cursor = state->select_start; - } - if (state->cursor > n) state->cursor = n; -} -NK_API void -nk_textedit_delete(struct nk_text_edit *state, int where, int len) -{ - /* delete characters while updating undo */ - nk_textedit_makeundo_delete(state, where, len); - nk_str_delete_runes(&state->string, where, len); - state->has_preferred_x = 0; -} -NK_API void -nk_textedit_delete_selection(struct nk_text_edit *state) -{ - /* delete the section */ - nk_textedit_clamp(state); - if (NK_TEXT_HAS_SELECTION(state)) { - if (state->select_start < state->select_end) { - nk_textedit_delete(state, state->select_start, - state->select_end - state->select_start); - state->select_end = state->cursor = state->select_start; - } else { - nk_textedit_delete(state, state->select_end, - state->select_start - state->select_end); - state->select_start = state->cursor = state->select_end; - } - state->has_preferred_x = 0; - } -} -NK_INTERN void -nk_textedit_sortselection(struct nk_text_edit *state) -{ - /* canonicalize the selection so start <= end */ - if (state->select_end < state->select_start) { - int temp = state->select_end; - state->select_end = state->select_start; - state->select_start = temp; - } -} -NK_INTERN void -nk_textedit_move_to_first(struct nk_text_edit *state) -{ - /* move cursor to first character of selection */ - if (NK_TEXT_HAS_SELECTION(state)) { - nk_textedit_sortselection(state); - state->cursor = state->select_start; - state->select_end = state->select_start; - state->has_preferred_x = 0; - } -} -NK_INTERN void -nk_textedit_move_to_last(struct nk_text_edit *state) -{ - /* move cursor to last character of selection */ - if (NK_TEXT_HAS_SELECTION(state)) { - nk_textedit_sortselection(state); - nk_textedit_clamp(state); - state->cursor = state->select_end; - state->select_start = state->select_end; - state->has_preferred_x = 0; - } -} -NK_INTERN int -nk_is_word_boundary( struct nk_text_edit *state, int idx) -{ - int len; - nk_rune c; - if (idx <= 0) return 1; - if (!nk_str_at_rune(&state->string, idx, &c, &len)) return 1; - return (c == ' ' || c == '\t' ||c == 0x3000 || c == ',' || c == ';' || - c == '(' || c == ')' || c == '{' || c == '}' || c == '[' || c == ']' || - c == '|'); -} -NK_INTERN int -nk_textedit_move_to_word_previous(struct nk_text_edit *state) -{ - int c = state->cursor - 1; - while( c >= 0 && !nk_is_word_boundary(state, c)) - --c; - - if( c < 0 ) - c = 0; - - return c; -} -NK_INTERN int -nk_textedit_move_to_word_next(struct nk_text_edit *state) -{ - const int len = state->string.len; - int c = state->cursor+1; - while( c < len && !nk_is_word_boundary(state, c)) - ++c; - - if( c > len ) - c = len; - - return c; -} -NK_INTERN void -nk_textedit_prep_selection_at_cursor(struct nk_text_edit *state) -{ - /* update selection and cursor to match each other */ - if (!NK_TEXT_HAS_SELECTION(state)) - state->select_start = state->select_end = state->cursor; - else state->cursor = state->select_end; -} -NK_API int -nk_textedit_cut(struct nk_text_edit *state) -{ - /* API cut: delete selection */ - if (state->mode == NK_TEXT_EDIT_MODE_VIEW) - return 0; - if (NK_TEXT_HAS_SELECTION(state)) { - nk_textedit_delete_selection(state); /* implicitly clamps */ - state->has_preferred_x = 0; - return 1; - } - return 0; -} -NK_API int -nk_textedit_paste(struct nk_text_edit *state, char const *ctext, int len) -{ - /* API paste: replace existing selection with passed-in text */ - int glyphs; - const char *text = (const char *) ctext; - if (state->mode == NK_TEXT_EDIT_MODE_VIEW) return 0; - - /* if there's a selection, the paste should delete it */ - nk_textedit_clamp(state); - nk_textedit_delete_selection(state); - - /* try to insert the characters */ - glyphs = nk_utf_len(ctext, len); - if (nk_str_insert_text_char(&state->string, state->cursor, text, len)) { - nk_textedit_makeundo_insert(state, state->cursor, glyphs); - state->cursor += len; - state->has_preferred_x = 0; - return 1; - } - /* remove the undo since we didn't actually insert the characters */ - if (state->undo.undo_point) - --state->undo.undo_point; - return 0; -} -NK_API void -nk_textedit_text(struct nk_text_edit *state, const char *text, int total_len) -{ - nk_rune unicode; - int glyph_len; - int text_len = 0; - - NK_ASSERT(state); - NK_ASSERT(text); - if (!text || !total_len || state->mode == NK_TEXT_EDIT_MODE_VIEW) return; - - glyph_len = nk_utf_decode(text, &unicode, total_len); - while ((text_len < total_len) && glyph_len) - { - /* don't insert a backward delete, just process the event */ - if (unicode == 127) goto next; - /* can't add newline in single-line mode */ - if (unicode == '\n' && state->single_line) goto next; - /* filter incoming text */ - if (state->filter && !state->filter(state, unicode)) goto next; - - if (!NK_TEXT_HAS_SELECTION(state) && - state->cursor < state->string.len) - { - if (state->mode == NK_TEXT_EDIT_MODE_REPLACE) { - nk_textedit_makeundo_replace(state, state->cursor, 1, 1); - nk_str_delete_runes(&state->string, state->cursor, 1); - } - if (nk_str_insert_text_utf8(&state->string, state->cursor, - text+text_len, 1)) - { - ++state->cursor; - state->has_preferred_x = 0; - } - } else { - nk_textedit_delete_selection(state); /* implicitly clamps */ - if (nk_str_insert_text_utf8(&state->string, state->cursor, - text+text_len, 1)) - { - nk_textedit_makeundo_insert(state, state->cursor, 1); - ++state->cursor; - state->has_preferred_x = 0; - } - } - next: - text_len += glyph_len; - glyph_len = nk_utf_decode(text + text_len, &unicode, total_len-text_len); - } -} -NK_LIB void -nk_textedit_key(struct nk_text_edit *state, enum nk_keys key, int shift_mod, - const struct nk_user_font *font, float row_height) -{ -retry: - switch (key) - { - case NK_KEY_NONE: - case NK_KEY_CTRL: - case NK_KEY_ENTER: - case NK_KEY_SHIFT: - case NK_KEY_TAB: - case NK_KEY_COPY: - case NK_KEY_CUT: - case NK_KEY_PASTE: - case NK_KEY_MAX: - default: break; - case NK_KEY_TEXT_UNDO: - nk_textedit_undo(state); - state->has_preferred_x = 0; - break; - - case NK_KEY_TEXT_REDO: - nk_textedit_redo(state); - state->has_preferred_x = 0; - break; - - case NK_KEY_TEXT_SELECT_ALL: - nk_textedit_select_all(state); - state->has_preferred_x = 0; - break; - - case NK_KEY_TEXT_INSERT_MODE: - if (state->mode == NK_TEXT_EDIT_MODE_VIEW) - state->mode = NK_TEXT_EDIT_MODE_INSERT; - break; - case NK_KEY_TEXT_REPLACE_MODE: - if (state->mode == NK_TEXT_EDIT_MODE_VIEW) - state->mode = NK_TEXT_EDIT_MODE_REPLACE; - break; - case NK_KEY_TEXT_RESET_MODE: - if (state->mode == NK_TEXT_EDIT_MODE_INSERT || - state->mode == NK_TEXT_EDIT_MODE_REPLACE) - state->mode = NK_TEXT_EDIT_MODE_VIEW; - break; - - case NK_KEY_LEFT: - if (shift_mod) { - nk_textedit_clamp(state); - nk_textedit_prep_selection_at_cursor(state); - /* move selection left */ - if (state->select_end > 0) - --state->select_end; - state->cursor = state->select_end; - state->has_preferred_x = 0; - } else { - /* if currently there's a selection, - * move cursor to start of selection */ - if (NK_TEXT_HAS_SELECTION(state)) - nk_textedit_move_to_first(state); - else if (state->cursor > 0) - --state->cursor; - state->has_preferred_x = 0; - } break; - - case NK_KEY_RIGHT: - if (shift_mod) { - nk_textedit_prep_selection_at_cursor(state); - /* move selection right */ - ++state->select_end; - nk_textedit_clamp(state); - state->cursor = state->select_end; - state->has_preferred_x = 0; - } else { - /* if currently there's a selection, - * move cursor to end of selection */ - if (NK_TEXT_HAS_SELECTION(state)) - nk_textedit_move_to_last(state); - else ++state->cursor; - nk_textedit_clamp(state); - state->has_preferred_x = 0; - } break; - - case NK_KEY_TEXT_WORD_LEFT: - if (shift_mod) { - if( !NK_TEXT_HAS_SELECTION( state ) ) - nk_textedit_prep_selection_at_cursor(state); - state->cursor = nk_textedit_move_to_word_previous(state); - state->select_end = state->cursor; - nk_textedit_clamp(state ); - } else { - if (NK_TEXT_HAS_SELECTION(state)) - nk_textedit_move_to_first(state); - else { - state->cursor = nk_textedit_move_to_word_previous(state); - nk_textedit_clamp(state ); - } - } break; - - case NK_KEY_TEXT_WORD_RIGHT: - if (shift_mod) { - if( !NK_TEXT_HAS_SELECTION( state ) ) - nk_textedit_prep_selection_at_cursor(state); - state->cursor = nk_textedit_move_to_word_next(state); - state->select_end = state->cursor; - nk_textedit_clamp(state); - } else { - if (NK_TEXT_HAS_SELECTION(state)) - nk_textedit_move_to_last(state); - else { - state->cursor = nk_textedit_move_to_word_next(state); - nk_textedit_clamp(state ); - } - } break; - - case NK_KEY_DOWN: { - struct nk_text_find find; - struct nk_text_edit_row row; - int i, sel = shift_mod; - - if (state->single_line) { - /* on windows, up&down in single-line behave like left&right */ - key = NK_KEY_RIGHT; - goto retry; - } - - if (sel) - nk_textedit_prep_selection_at_cursor(state); - else if (NK_TEXT_HAS_SELECTION(state)) - nk_textedit_move_to_last(state); - - /* compute current position of cursor point */ - nk_textedit_clamp(state); - nk_textedit_find_charpos(&find, state, state->cursor, state->single_line, - font, row_height); - - /* now find character position down a row */ - if (find.length) - { - float x; - float goal_x = state->has_preferred_x ? state->preferred_x : find.x; - int start = find.first_char + find.length; - - state->cursor = start; - nk_textedit_layout_row(&row, state, state->cursor, row_height, font); - x = row.x0; - - for (i=0; i < row.num_chars && x < row.x1; ++i) { - float dx = nk_textedit_get_width(state, start, i, font); - x += dx; - if (x > goal_x) - break; - ++state->cursor; - } - nk_textedit_clamp(state); - - state->has_preferred_x = 1; - state->preferred_x = goal_x; - if (sel) - state->select_end = state->cursor; - } - } break; - - case NK_KEY_UP: { - struct nk_text_find find; - struct nk_text_edit_row row; - int i, sel = shift_mod; - - if (state->single_line) { - /* on windows, up&down become left&right */ - key = NK_KEY_LEFT; - goto retry; - } - - if (sel) - nk_textedit_prep_selection_at_cursor(state); - else if (NK_TEXT_HAS_SELECTION(state)) - nk_textedit_move_to_first(state); - - /* compute current position of cursor point */ - nk_textedit_clamp(state); - nk_textedit_find_charpos(&find, state, state->cursor, state->single_line, - font, row_height); - - /* can only go up if there's a previous row */ - if (find.prev_first != find.first_char) { - /* now find character position up a row */ - float x; - float goal_x = state->has_preferred_x ? state->preferred_x : find.x; - - state->cursor = find.prev_first; - nk_textedit_layout_row(&row, state, state->cursor, row_height, font); - x = row.x0; - - for (i=0; i < row.num_chars && x < row.x1; ++i) { - float dx = nk_textedit_get_width(state, find.prev_first, i, font); - x += dx; - if (x > goal_x) - break; - ++state->cursor; - } - nk_textedit_clamp(state); - - state->has_preferred_x = 1; - state->preferred_x = goal_x; - if (sel) state->select_end = state->cursor; - } - } break; - - case NK_KEY_DEL: - if (state->mode == NK_TEXT_EDIT_MODE_VIEW) - break; - if (NK_TEXT_HAS_SELECTION(state)) - nk_textedit_delete_selection(state); - else { - int n = state->string.len; - if (state->cursor < n) - nk_textedit_delete(state, state->cursor, 1); - } - state->has_preferred_x = 0; - break; - - case NK_KEY_BACKSPACE: - if (state->mode == NK_TEXT_EDIT_MODE_VIEW) - break; - if (NK_TEXT_HAS_SELECTION(state)) - nk_textedit_delete_selection(state); - else { - nk_textedit_clamp(state); - if (state->cursor > 0) { - nk_textedit_delete(state, state->cursor-1, 1); - --state->cursor; - } - } - state->has_preferred_x = 0; - break; - - case NK_KEY_TEXT_START: - if (shift_mod) { - nk_textedit_prep_selection_at_cursor(state); - state->cursor = state->select_end = 0; - state->has_preferred_x = 0; - } else { - state->cursor = state->select_start = state->select_end = 0; - state->has_preferred_x = 0; - } - break; - - case NK_KEY_TEXT_END: - if (shift_mod) { - nk_textedit_prep_selection_at_cursor(state); - state->cursor = state->select_end = state->string.len; - state->has_preferred_x = 0; - } else { - state->cursor = state->string.len; - state->select_start = state->select_end = 0; - state->has_preferred_x = 0; - } - break; - - case NK_KEY_TEXT_LINE_START: { - if (shift_mod) { - struct nk_text_find find; - nk_textedit_clamp(state); - nk_textedit_prep_selection_at_cursor(state); - if (state->string.len && state->cursor == state->string.len) - --state->cursor; - nk_textedit_find_charpos(&find, state,state->cursor, state->single_line, - font, row_height); - state->cursor = state->select_end = find.first_char; - state->has_preferred_x = 0; - } else { - struct nk_text_find find; - if (state->string.len && state->cursor == state->string.len) - --state->cursor; - nk_textedit_clamp(state); - nk_textedit_move_to_first(state); - nk_textedit_find_charpos(&find, state, state->cursor, state->single_line, - font, row_height); - state->cursor = find.first_char; - state->has_preferred_x = 0; - } - } break; - - case NK_KEY_TEXT_LINE_END: { - if (shift_mod) { - struct nk_text_find find; - nk_textedit_clamp(state); - nk_textedit_prep_selection_at_cursor(state); - nk_textedit_find_charpos(&find, state, state->cursor, state->single_line, - font, row_height); - state->has_preferred_x = 0; - state->cursor = find.first_char + find.length; - if (find.length > 0 && nk_str_rune_at(&state->string, state->cursor-1) == '\n') - --state->cursor; - state->select_end = state->cursor; - } else { - struct nk_text_find find; - nk_textedit_clamp(state); - nk_textedit_move_to_first(state); - nk_textedit_find_charpos(&find, state, state->cursor, state->single_line, - font, row_height); - - state->has_preferred_x = 0; - state->cursor = find.first_char + find.length; - if (find.length > 0 && nk_str_rune_at(&state->string, state->cursor-1) == '\n') - --state->cursor; - }} break; - } -} -NK_INTERN void -nk_textedit_flush_redo(struct nk_text_undo_state *state) -{ - state->redo_point = NK_TEXTEDIT_UNDOSTATECOUNT; - state->redo_char_point = NK_TEXTEDIT_UNDOCHARCOUNT; -} -NK_INTERN void -nk_textedit_discard_undo(struct nk_text_undo_state *state) -{ - /* discard the oldest entry in the undo list */ - if (state->undo_point > 0) { - /* if the 0th undo state has characters, clean those up */ - if (state->undo_rec[0].char_storage >= 0) { - int n = state->undo_rec[0].insert_length, i; - /* delete n characters from all other records */ - state->undo_char_point = (short)(state->undo_char_point - n); - NK_MEMCPY(state->undo_char, state->undo_char + n, - (nk_size)state->undo_char_point*sizeof(nk_rune)); - for (i=0; i < state->undo_point; ++i) { - if (state->undo_rec[i].char_storage >= 0) - state->undo_rec[i].char_storage = (short) - (state->undo_rec[i].char_storage - n); - } - } - --state->undo_point; - NK_MEMCPY(state->undo_rec, state->undo_rec+1, - (nk_size)((nk_size)state->undo_point * sizeof(state->undo_rec[0]))); - } -} -NK_INTERN void -nk_textedit_discard_redo(struct nk_text_undo_state *state) -{ -/* discard the oldest entry in the redo list--it's bad if this - ever happens, but because undo & redo have to store the actual - characters in different cases, the redo character buffer can - fill up even though the undo buffer didn't */ - nk_size num; - int k = NK_TEXTEDIT_UNDOSTATECOUNT-1; - if (state->redo_point <= k) { - /* if the k'th undo state has characters, clean those up */ - if (state->undo_rec[k].char_storage >= 0) { - int n = state->undo_rec[k].insert_length, i; - /* delete n characters from all other records */ - state->redo_char_point = (short)(state->redo_char_point + n); - num = (nk_size)(NK_TEXTEDIT_UNDOCHARCOUNT - state->redo_char_point); - NK_MEMCPY(state->undo_char + state->redo_char_point, - state->undo_char + state->redo_char_point-n, num * sizeof(char)); - for (i = state->redo_point; i < k; ++i) { - if (state->undo_rec[i].char_storage >= 0) { - state->undo_rec[i].char_storage = (short) - (state->undo_rec[i].char_storage + n); - } - } - } - ++state->redo_point; - num = (nk_size)(NK_TEXTEDIT_UNDOSTATECOUNT - state->redo_point); - if (num) NK_MEMCPY(state->undo_rec + state->redo_point-1, - state->undo_rec + state->redo_point, num * sizeof(state->undo_rec[0])); - } -} -NK_INTERN struct nk_text_undo_record* -nk_textedit_create_undo_record(struct nk_text_undo_state *state, int numchars) -{ - /* any time we create a new undo record, we discard redo*/ - nk_textedit_flush_redo(state); - - /* if we have no free records, we have to make room, - * by sliding the existing records down */ - if (state->undo_point == NK_TEXTEDIT_UNDOSTATECOUNT) - nk_textedit_discard_undo(state); - - /* if the characters to store won't possibly fit in the buffer, - * we can't undo */ - if (numchars > NK_TEXTEDIT_UNDOCHARCOUNT) { - state->undo_point = 0; - state->undo_char_point = 0; - return 0; - } - - /* if we don't have enough free characters in the buffer, - * we have to make room */ - while (state->undo_char_point + numchars > NK_TEXTEDIT_UNDOCHARCOUNT) - nk_textedit_discard_undo(state); - return &state->undo_rec[state->undo_point++]; -} -NK_INTERN nk_rune* -nk_textedit_createundo(struct nk_text_undo_state *state, int pos, - int insert_len, int delete_len) -{ - struct nk_text_undo_record *r = nk_textedit_create_undo_record(state, insert_len); - if (r == 0) - return 0; - - r->where = pos; - r->insert_length = (short) insert_len; - r->delete_length = (short) delete_len; - - if (insert_len == 0) { - r->char_storage = -1; - return 0; - } else { - r->char_storage = state->undo_char_point; - state->undo_char_point = (short)(state->undo_char_point + insert_len); - return &state->undo_char[r->char_storage]; - } -} -NK_API void -nk_textedit_undo(struct nk_text_edit *state) -{ - struct nk_text_undo_state *s = &state->undo; - struct nk_text_undo_record u, *r; - if (s->undo_point == 0) - return; - - /* we need to do two things: apply the undo record, and create a redo record */ - u = s->undo_rec[s->undo_point-1]; - r = &s->undo_rec[s->redo_point-1]; - r->char_storage = -1; - - r->insert_length = u.delete_length; - r->delete_length = u.insert_length; - r->where = u.where; - - if (u.delete_length) - { - /* if the undo record says to delete characters, then the redo record will - need to re-insert the characters that get deleted, so we need to store - them. - there are three cases: - - there's enough room to store the characters - - characters stored for *redoing* don't leave room for redo - - characters stored for *undoing* don't leave room for redo - if the last is true, we have to bail */ - if (s->undo_char_point + u.delete_length >= NK_TEXTEDIT_UNDOCHARCOUNT) { - /* the undo records take up too much character space; there's no space - * to store the redo characters */ - r->insert_length = 0; - } else { - int i; - /* there's definitely room to store the characters eventually */ - while (s->undo_char_point + u.delete_length > s->redo_char_point) { - /* there's currently not enough room, so discard a redo record */ - nk_textedit_discard_redo(s); - /* should never happen: */ - if (s->redo_point == NK_TEXTEDIT_UNDOSTATECOUNT) - return; - } - - r = &s->undo_rec[s->redo_point-1]; - r->char_storage = (short)(s->redo_char_point - u.delete_length); - s->redo_char_point = (short)(s->redo_char_point - u.delete_length); - - /* now save the characters */ - for (i=0; i < u.delete_length; ++i) - s->undo_char[r->char_storage + i] = - nk_str_rune_at(&state->string, u.where + i); - } - /* now we can carry out the deletion */ - nk_str_delete_runes(&state->string, u.where, u.delete_length); - } - - /* check type of recorded action: */ - if (u.insert_length) { - /* easy case: was a deletion, so we need to insert n characters */ - nk_str_insert_text_runes(&state->string, u.where, - &s->undo_char[u.char_storage], u.insert_length); - s->undo_char_point = (short)(s->undo_char_point - u.insert_length); - } - state->cursor = (short)(u.where + u.insert_length); - - s->undo_point--; - s->redo_point--; -} -NK_API void -nk_textedit_redo(struct nk_text_edit *state) -{ - struct nk_text_undo_state *s = &state->undo; - struct nk_text_undo_record *u, r; - if (s->redo_point == NK_TEXTEDIT_UNDOSTATECOUNT) - return; - - /* we need to do two things: apply the redo record, and create an undo record */ - u = &s->undo_rec[s->undo_point]; - r = s->undo_rec[s->redo_point]; - - /* we KNOW there must be room for the undo record, because the redo record - was derived from an undo record */ - u->delete_length = r.insert_length; - u->insert_length = r.delete_length; - u->where = r.where; - u->char_storage = -1; - - if (r.delete_length) { - /* the redo record requires us to delete characters, so the undo record - needs to store the characters */ - if (s->undo_char_point + u->insert_length > s->redo_char_point) { - u->insert_length = 0; - u->delete_length = 0; - } else { - int i; - u->char_storage = s->undo_char_point; - s->undo_char_point = (short)(s->undo_char_point + u->insert_length); - - /* now save the characters */ - for (i=0; i < u->insert_length; ++i) { - s->undo_char[u->char_storage + i] = - nk_str_rune_at(&state->string, u->where + i); - } - } - nk_str_delete_runes(&state->string, r.where, r.delete_length); - } - - if (r.insert_length) { - /* easy case: need to insert n characters */ - nk_str_insert_text_runes(&state->string, r.where, - &s->undo_char[r.char_storage], r.insert_length); - } - state->cursor = r.where + r.insert_length; - - s->undo_point++; - s->redo_point++; -} -NK_INTERN void -nk_textedit_makeundo_insert(struct nk_text_edit *state, int where, int length) -{ - nk_textedit_createundo(&state->undo, where, 0, length); -} -NK_INTERN void -nk_textedit_makeundo_delete(struct nk_text_edit *state, int where, int length) -{ - int i; - nk_rune *p = nk_textedit_createundo(&state->undo, where, length, 0); - if (p) { - for (i=0; i < length; ++i) - p[i] = nk_str_rune_at(&state->string, where+i); - } -} -NK_INTERN void -nk_textedit_makeundo_replace(struct nk_text_edit *state, int where, - int old_length, int new_length) -{ - int i; - nk_rune *p = nk_textedit_createundo(&state->undo, where, old_length, new_length); - if (p) { - for (i=0; i < old_length; ++i) - p[i] = nk_str_rune_at(&state->string, where+i); - } -} -NK_LIB void -nk_textedit_clear_state(struct nk_text_edit *state, enum nk_text_edit_type type, - nk_plugin_filter filter) -{ - /* reset the state to default */ - state->undo.undo_point = 0; - state->undo.undo_char_point = 0; - state->undo.redo_point = NK_TEXTEDIT_UNDOSTATECOUNT; - state->undo.redo_char_point = NK_TEXTEDIT_UNDOCHARCOUNT; - state->select_end = state->select_start = 0; - state->cursor = 0; - state->has_preferred_x = 0; - state->preferred_x = 0; - state->cursor_at_end_of_line = 0; - state->initialized = 1; - state->single_line = (unsigned char)(type == NK_TEXT_EDIT_SINGLE_LINE); - state->mode = NK_TEXT_EDIT_MODE_VIEW; - state->filter = filter; - state->scrollbar = nk_vec2(0,0); -} -NK_API void -nk_textedit_init_fixed(struct nk_text_edit *state, void *memory, nk_size size) -{ - NK_ASSERT(state); - NK_ASSERT(memory); - if (!state || !memory || !size) return; - NK_MEMSET(state, 0, sizeof(struct nk_text_edit)); - nk_textedit_clear_state(state, NK_TEXT_EDIT_SINGLE_LINE, 0); - nk_str_init_fixed(&state->string, memory, size); -} -NK_API void -nk_textedit_init(struct nk_text_edit *state, struct nk_allocator *alloc, nk_size size) -{ - NK_ASSERT(state); - NK_ASSERT(alloc); - if (!state || !alloc) return; - NK_MEMSET(state, 0, sizeof(struct nk_text_edit)); - nk_textedit_clear_state(state, NK_TEXT_EDIT_SINGLE_LINE, 0); - nk_str_init(&state->string, alloc, size); -} -#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR -NK_API void -nk_textedit_init_default(struct nk_text_edit *state) -{ - NK_ASSERT(state); - if (!state) return; - NK_MEMSET(state, 0, sizeof(struct nk_text_edit)); - nk_textedit_clear_state(state, NK_TEXT_EDIT_SINGLE_LINE, 0); - nk_str_init_default(&state->string); -} -#endif -NK_API void -nk_textedit_select_all(struct nk_text_edit *state) -{ - NK_ASSERT(state); - state->select_start = 0; - state->select_end = state->string.len; -} -NK_API void -nk_textedit_free(struct nk_text_edit *state) -{ - NK_ASSERT(state); - if (!state) return; - nk_str_free(&state->string); -} - - - - - -/* =============================================================== - * - * FILTER - * - * ===============================================================*/ -NK_API int -nk_filter_default(const struct nk_text_edit *box, nk_rune unicode) -{ - NK_UNUSED(unicode); - NK_UNUSED(box); - return nk_true; -} -NK_API int -nk_filter_ascii(const struct nk_text_edit *box, nk_rune unicode) -{ - NK_UNUSED(box); - if (unicode > 128) return nk_false; - else return nk_true; -} -NK_API int -nk_filter_float(const struct nk_text_edit *box, nk_rune unicode) -{ - NK_UNUSED(box); - if ((unicode < '0' || unicode > '9') && unicode != '.' && unicode != '-') - return nk_false; - else return nk_true; -} -NK_API int -nk_filter_decimal(const struct nk_text_edit *box, nk_rune unicode) -{ - NK_UNUSED(box); - if ((unicode < '0' || unicode > '9') && unicode != '-') - return nk_false; - else return nk_true; -} -NK_API int -nk_filter_hex(const struct nk_text_edit *box, nk_rune unicode) -{ - NK_UNUSED(box); - if ((unicode < '0' || unicode > '9') && - (unicode < 'a' || unicode > 'f') && - (unicode < 'A' || unicode > 'F')) - return nk_false; - else return nk_true; -} -NK_API int -nk_filter_oct(const struct nk_text_edit *box, nk_rune unicode) -{ - NK_UNUSED(box); - if (unicode < '0' || unicode > '7') - return nk_false; - else return nk_true; -} -NK_API int -nk_filter_binary(const struct nk_text_edit *box, nk_rune unicode) -{ - NK_UNUSED(box); - if (unicode != '0' && unicode != '1') - return nk_false; - else return nk_true; -} - -/* =============================================================== - * - * EDIT - * - * ===============================================================*/ -NK_LIB void -nk_edit_draw_text(struct nk_command_buffer *out, - const struct nk_style_edit *style, float pos_x, float pos_y, - float x_offset, const char *text, int byte_len, float row_height, - const struct nk_user_font *font, struct nk_color background, - struct nk_color foreground, int is_selected) -{ - NK_ASSERT(out); - NK_ASSERT(font); - NK_ASSERT(style); - if (!text || !byte_len || !out || !style) return; - - {int glyph_len = 0; - nk_rune unicode = 0; - int text_len = 0; - float line_width = 0; - float glyph_width; - const char *line = text; - float line_offset = 0; - int line_count = 0; - - struct nk_text txt; - txt.padding = nk_vec2(0,0); - txt.background = background; - txt.text = foreground; - - glyph_len = nk_utf_decode(text+text_len, &unicode, byte_len-text_len); - if (!glyph_len) return; - while ((text_len < byte_len) && glyph_len) - { - if (unicode == '\n') { - /* new line separator so draw previous line */ - struct nk_rect label; - label.y = pos_y + line_offset; - label.h = row_height; - label.w = line_width; - label.x = pos_x; - if (!line_count) - label.x += x_offset; - - if (is_selected) /* selection needs to draw different background color */ - nk_fill_rect(out, label, 0, background); - nk_widget_text(out, label, line, (int)((text + text_len) - line), - &txt, NK_TEXT_CENTERED, font); - - text_len++; - line_count++; - line_width = 0; - line = text + text_len; - line_offset += row_height; - glyph_len = nk_utf_decode(text + text_len, &unicode, (int)(byte_len-text_len)); - continue; - } - if (unicode == '\r') { - text_len++; - glyph_len = nk_utf_decode(text + text_len, &unicode, byte_len-text_len); - continue; - } - glyph_width = font->width(font->userdata, font->height, text+text_len, glyph_len); - line_width += (float)glyph_width; - text_len += glyph_len; - glyph_len = nk_utf_decode(text + text_len, &unicode, byte_len-text_len); - continue; - } - if (line_width > 0) { - /* draw last line */ - struct nk_rect label; - label.y = pos_y + line_offset; - label.h = row_height; - label.w = line_width; - label.x = pos_x; - if (!line_count) - label.x += x_offset; - - if (is_selected) - nk_fill_rect(out, label, 0, background); - nk_widget_text(out, label, line, (int)((text + text_len) - line), - &txt, NK_TEXT_LEFT, font); - }} -} -NK_LIB nk_flags -nk_do_edit(nk_flags *state, struct nk_command_buffer *out, - struct nk_rect bounds, nk_flags flags, nk_plugin_filter filter, - struct nk_text_edit *edit, const struct nk_style_edit *style, - struct nk_input *in, const struct nk_user_font *font) -{ - struct nk_rect area; - nk_flags ret = 0; - float row_height; - char prev_state = 0; - char is_hovered = 0; - char select_all = 0; - char cursor_follow = 0; - struct nk_rect old_clip; - struct nk_rect clip; - - NK_ASSERT(state); - NK_ASSERT(out); - NK_ASSERT(style); - if (!state || !out || !style) - return ret; - - /* visible text area calculation */ - area.x = bounds.x + style->padding.x + style->border; - area.y = bounds.y + style->padding.y + style->border; - area.w = bounds.w - (2.0f * style->padding.x + 2 * style->border); - area.h = bounds.h - (2.0f * style->padding.y + 2 * style->border); - if (flags & NK_EDIT_MULTILINE) - area.w = NK_MAX(0, area.w - style->scrollbar_size.x); - row_height = (flags & NK_EDIT_MULTILINE)? font->height + style->row_padding: area.h; - - /* calculate clipping rectangle */ - old_clip = out->clip; - nk_unify(&clip, &old_clip, area.x, area.y, area.x + area.w, area.y + area.h); - - /* update edit state */ - prev_state = (char)edit->active; - is_hovered = (char)nk_input_is_mouse_hovering_rect(in, bounds); - if (in && in->mouse.buttons[NK_BUTTON_LEFT].clicked && in->mouse.buttons[NK_BUTTON_LEFT].down) { - edit->active = NK_INBOX(in->mouse.pos.x, in->mouse.pos.y, - bounds.x, bounds.y, bounds.w, bounds.h); - } - - /* (de)activate text editor */ - if (!prev_state && edit->active) { - const enum nk_text_edit_type type = (flags & NK_EDIT_MULTILINE) ? - NK_TEXT_EDIT_MULTI_LINE: NK_TEXT_EDIT_SINGLE_LINE; - nk_textedit_clear_state(edit, type, filter); - if (flags & NK_EDIT_AUTO_SELECT) - select_all = nk_true; - if (flags & NK_EDIT_GOTO_END_ON_ACTIVATE) { - edit->cursor = edit->string.len; - in = 0; - } - } else if (!edit->active) edit->mode = NK_TEXT_EDIT_MODE_VIEW; - if (flags & NK_EDIT_READ_ONLY) - edit->mode = NK_TEXT_EDIT_MODE_VIEW; - else if (flags & NK_EDIT_ALWAYS_INSERT_MODE) - edit->mode = NK_TEXT_EDIT_MODE_INSERT; - - ret = (edit->active) ? NK_EDIT_ACTIVE: NK_EDIT_INACTIVE; - if (prev_state != edit->active) - ret |= (edit->active) ? NK_EDIT_ACTIVATED: NK_EDIT_DEACTIVATED; - - /* handle user input */ - if (edit->active && in) - { - int shift_mod = in->keyboard.keys[NK_KEY_SHIFT].down; - const float mouse_x = (in->mouse.pos.x - area.x) + edit->scrollbar.x; - const float mouse_y = (in->mouse.pos.y - area.y) + edit->scrollbar.y; - - /* mouse click handler */ - is_hovered = (char)nk_input_is_mouse_hovering_rect(in, area); - if (select_all) { - nk_textedit_select_all(edit); - } else if (is_hovered && in->mouse.buttons[NK_BUTTON_LEFT].down && - in->mouse.buttons[NK_BUTTON_LEFT].clicked) { - nk_textedit_click(edit, mouse_x, mouse_y, font, row_height); - } else if (is_hovered && in->mouse.buttons[NK_BUTTON_LEFT].down && - (in->mouse.delta.x != 0.0f || in->mouse.delta.y != 0.0f)) { - nk_textedit_drag(edit, mouse_x, mouse_y, font, row_height); - cursor_follow = nk_true; - } else if (is_hovered && in->mouse.buttons[NK_BUTTON_RIGHT].clicked && - in->mouse.buttons[NK_BUTTON_RIGHT].down) { - nk_textedit_key(edit, NK_KEY_TEXT_WORD_LEFT, nk_false, font, row_height); - nk_textedit_key(edit, NK_KEY_TEXT_WORD_RIGHT, nk_true, font, row_height); - cursor_follow = nk_true; - } - - {int i; /* keyboard input */ - int old_mode = edit->mode; - for (i = 0; i < NK_KEY_MAX; ++i) { - if (i == NK_KEY_ENTER || i == NK_KEY_TAB) continue; /* special case */ - if (nk_input_is_key_pressed(in, (enum nk_keys)i)) { - nk_textedit_key(edit, (enum nk_keys)i, shift_mod, font, row_height); - cursor_follow = nk_true; - } - } - if (old_mode != edit->mode) { - in->keyboard.text_len = 0; - }} - - /* text input */ - edit->filter = filter; - if (in->keyboard.text_len) { - nk_textedit_text(edit, in->keyboard.text, in->keyboard.text_len); - cursor_follow = nk_true; - in->keyboard.text_len = 0; - } - - /* enter key handler */ - if (nk_input_is_key_pressed(in, NK_KEY_ENTER)) { - cursor_follow = nk_true; - if (flags & NK_EDIT_CTRL_ENTER_NEWLINE && shift_mod) - nk_textedit_text(edit, "\n", 1); - else if (flags & NK_EDIT_SIG_ENTER) - ret |= NK_EDIT_COMMITED; - else nk_textedit_text(edit, "\n", 1); - } - - /* cut & copy handler */ - {int copy= nk_input_is_key_pressed(in, NK_KEY_COPY); - int cut = nk_input_is_key_pressed(in, NK_KEY_CUT); - if ((copy || cut) && (flags & NK_EDIT_CLIPBOARD)) - { - int glyph_len; - nk_rune unicode; - const char *text; - int b = edit->select_start; - int e = edit->select_end; - - int begin = NK_MIN(b, e); - int end = NK_MAX(b, e); - text = nk_str_at_const(&edit->string, begin, &unicode, &glyph_len); - if (edit->clip.copy) - edit->clip.copy(edit->clip.userdata, text, end - begin); - if (cut && !(flags & NK_EDIT_READ_ONLY)){ - nk_textedit_cut(edit); - cursor_follow = nk_true; - } - }} - - /* paste handler */ - {int paste = nk_input_is_key_pressed(in, NK_KEY_PASTE); - if (paste && (flags & NK_EDIT_CLIPBOARD) && edit->clip.paste) { - edit->clip.paste(edit->clip.userdata, edit); - cursor_follow = nk_true; - }} - - /* tab handler */ - {int tab = nk_input_is_key_pressed(in, NK_KEY_TAB); - if (tab && (flags & NK_EDIT_ALLOW_TAB)) { - nk_textedit_text(edit, " ", 4); - cursor_follow = nk_true; - }} - } - - /* set widget state */ - if (edit->active) - *state = NK_WIDGET_STATE_ACTIVE; - else nk_widget_state_reset(state); - - if (is_hovered) - *state |= NK_WIDGET_STATE_HOVERED; - - /* DRAW EDIT */ - {const char *text = nk_str_get_const(&edit->string); - int len = nk_str_len_char(&edit->string); - - {/* select background colors/images */ - const struct nk_style_item *background; - if (*state & NK_WIDGET_STATE_ACTIVED) - background = &style->active; - else if (*state & NK_WIDGET_STATE_HOVER) - background = &style->hover; - else background = &style->normal; - - /* draw background frame */ - if (background->type == NK_STYLE_ITEM_COLOR) { - nk_stroke_rect(out, bounds, style->rounding, style->border, style->border_color); - nk_fill_rect(out, bounds, style->rounding, background->data.color); - } else nk_draw_image(out, bounds, &background->data.image, nk_white);} - - area.w = NK_MAX(0, area.w - style->cursor_size); - if (edit->active) - { - int total_lines = 1; - struct nk_vec2 text_size = nk_vec2(0,0); - - /* text pointer positions */ - const char *cursor_ptr = 0; - const char *select_begin_ptr = 0; - const char *select_end_ptr = 0; - - /* 2D pixel positions */ - struct nk_vec2 cursor_pos = nk_vec2(0,0); - struct nk_vec2 selection_offset_start = nk_vec2(0,0); - struct nk_vec2 selection_offset_end = nk_vec2(0,0); - - int selection_begin = NK_MIN(edit->select_start, edit->select_end); - int selection_end = NK_MAX(edit->select_start, edit->select_end); - - /* calculate total line count + total space + cursor/selection position */ - float line_width = 0.0f; - if (text && len) - { - /* utf8 encoding */ - float glyph_width; - int glyph_len = 0; - nk_rune unicode = 0; - int text_len = 0; - int glyphs = 0; - int row_begin = 0; - - glyph_len = nk_utf_decode(text, &unicode, len); - glyph_width = font->width(font->userdata, font->height, text, glyph_len); - line_width = 0; - - /* iterate all lines */ - while ((text_len < len) && glyph_len) - { - /* set cursor 2D position and line */ - if (!cursor_ptr && glyphs == edit->cursor) - { - int glyph_offset; - struct nk_vec2 out_offset; - struct nk_vec2 row_size; - const char *remaining; - - /* calculate 2d position */ - cursor_pos.y = (float)(total_lines-1) * row_height; - row_size = nk_text_calculate_text_bounds(font, text+row_begin, - text_len-row_begin, row_height, &remaining, - &out_offset, &glyph_offset, NK_STOP_ON_NEW_LINE); - cursor_pos.x = row_size.x; - cursor_ptr = text + text_len; - } - - /* set start selection 2D position and line */ - if (!select_begin_ptr && edit->select_start != edit->select_end && - glyphs == selection_begin) - { - int glyph_offset; - struct nk_vec2 out_offset; - struct nk_vec2 row_size; - const char *remaining; - - /* calculate 2d position */ - selection_offset_start.y = (float)(NK_MAX(total_lines-1,0)) * row_height; - row_size = nk_text_calculate_text_bounds(font, text+row_begin, - text_len-row_begin, row_height, &remaining, - &out_offset, &glyph_offset, NK_STOP_ON_NEW_LINE); - selection_offset_start.x = row_size.x; - select_begin_ptr = text + text_len; - } - - /* set end selection 2D position and line */ - if (!select_end_ptr && edit->select_start != edit->select_end && - glyphs == selection_end) - { - int glyph_offset; - struct nk_vec2 out_offset; - struct nk_vec2 row_size; - const char *remaining; - - /* calculate 2d position */ - selection_offset_end.y = (float)(total_lines-1) * row_height; - row_size = nk_text_calculate_text_bounds(font, text+row_begin, - text_len-row_begin, row_height, &remaining, - &out_offset, &glyph_offset, NK_STOP_ON_NEW_LINE); - selection_offset_end.x = row_size.x; - select_end_ptr = text + text_len; - } - if (unicode == '\n') { - text_size.x = NK_MAX(text_size.x, line_width); - total_lines++; - line_width = 0; - text_len++; - glyphs++; - row_begin = text_len; - glyph_len = nk_utf_decode(text + text_len, &unicode, len-text_len); - glyph_width = font->width(font->userdata, font->height, text+text_len, glyph_len); - continue; - } - - glyphs++; - text_len += glyph_len; - line_width += (float)glyph_width; - - glyph_len = nk_utf_decode(text + text_len, &unicode, len-text_len); - glyph_width = font->width(font->userdata, font->height, - text+text_len, glyph_len); - continue; - } - text_size.y = (float)total_lines * row_height; - - /* handle case when cursor is at end of text buffer */ - if (!cursor_ptr && edit->cursor == edit->string.len) { - cursor_pos.x = line_width; - cursor_pos.y = text_size.y - row_height; - } - } - { - /* scrollbar */ - if (cursor_follow) - { - /* update scrollbar to follow cursor */ - if (!(flags & NK_EDIT_NO_HORIZONTAL_SCROLL)) { - /* horizontal scroll */ - const float scroll_increment = area.w * 0.25f; - if (cursor_pos.x < edit->scrollbar.x) - edit->scrollbar.x = (float)(int)NK_MAX(0.0f, cursor_pos.x - scroll_increment); - if (cursor_pos.x >= edit->scrollbar.x + area.w) - edit->scrollbar.x = (float)(int)NK_MAX(0.0f, edit->scrollbar.x + scroll_increment); - } else edit->scrollbar.x = 0; - - if (flags & NK_EDIT_MULTILINE) { - /* vertical scroll */ - if (cursor_pos.y < edit->scrollbar.y) - edit->scrollbar.y = NK_MAX(0.0f, cursor_pos.y - row_height); - if (cursor_pos.y >= edit->scrollbar.y + area.h) - edit->scrollbar.y = edit->scrollbar.y + row_height; - } else edit->scrollbar.y = 0; - } - - /* scrollbar widget */ - if (flags & NK_EDIT_MULTILINE) - { - nk_flags ws; - struct nk_rect scroll; - float scroll_target; - float scroll_offset; - float scroll_step; - float scroll_inc; - - scroll = area; - scroll.x = (bounds.x + bounds.w - style->border) - style->scrollbar_size.x; - scroll.w = style->scrollbar_size.x; - - scroll_offset = edit->scrollbar.y; - scroll_step = scroll.h * 0.10f; - scroll_inc = scroll.h * 0.01f; - scroll_target = text_size.y; - edit->scrollbar.y = nk_do_scrollbarv(&ws, out, scroll, 0, - scroll_offset, scroll_target, scroll_step, scroll_inc, - &style->scrollbar, in, font); - } - } - - /* draw text */ - {struct nk_color background_color; - struct nk_color text_color; - struct nk_color sel_background_color; - struct nk_color sel_text_color; - struct nk_color cursor_color; - struct nk_color cursor_text_color; - const struct nk_style_item *background; - nk_push_scissor(out, clip); - - /* select correct colors to draw */ - if (*state & NK_WIDGET_STATE_ACTIVED) { - background = &style->active; - text_color = style->text_active; - sel_text_color = style->selected_text_hover; - sel_background_color = style->selected_hover; - cursor_color = style->cursor_hover; - cursor_text_color = style->cursor_text_hover; - } else if (*state & NK_WIDGET_STATE_HOVER) { - background = &style->hover; - text_color = style->text_hover; - sel_text_color = style->selected_text_hover; - sel_background_color = style->selected_hover; - cursor_text_color = style->cursor_text_hover; - cursor_color = style->cursor_hover; - } else { - background = &style->normal; - text_color = style->text_normal; - sel_text_color = style->selected_text_normal; - sel_background_color = style->selected_normal; - cursor_color = style->cursor_normal; - cursor_text_color = style->cursor_text_normal; - } - if (background->type == NK_STYLE_ITEM_IMAGE) - background_color = nk_rgba(0,0,0,0); - else background_color = background->data.color; - - - if (edit->select_start == edit->select_end) { - /* no selection so just draw the complete text */ - const char *begin = nk_str_get_const(&edit->string); - int l = nk_str_len_char(&edit->string); - nk_edit_draw_text(out, style, area.x - edit->scrollbar.x, - area.y - edit->scrollbar.y, 0, begin, l, row_height, font, - background_color, text_color, nk_false); - } else { - /* edit has selection so draw 1-3 text chunks */ - if (edit->select_start != edit->select_end && selection_begin > 0){ - /* draw unselected text before selection */ - const char *begin = nk_str_get_const(&edit->string); - NK_ASSERT(select_begin_ptr); - nk_edit_draw_text(out, style, area.x - edit->scrollbar.x, - area.y - edit->scrollbar.y, 0, begin, (int)(select_begin_ptr - begin), - row_height, font, background_color, text_color, nk_false); - } - if (edit->select_start != edit->select_end) { - /* draw selected text */ - NK_ASSERT(select_begin_ptr); - if (!select_end_ptr) { - const char *begin = nk_str_get_const(&edit->string); - select_end_ptr = begin + nk_str_len_char(&edit->string); - } - nk_edit_draw_text(out, style, - area.x - edit->scrollbar.x, - area.y + selection_offset_start.y - edit->scrollbar.y, - selection_offset_start.x, - select_begin_ptr, (int)(select_end_ptr - select_begin_ptr), - row_height, font, sel_background_color, sel_text_color, nk_true); - } - if ((edit->select_start != edit->select_end && - selection_end < edit->string.len)) - { - /* draw unselected text after selected text */ - const char *begin = select_end_ptr; - const char *end = nk_str_get_const(&edit->string) + - nk_str_len_char(&edit->string); - NK_ASSERT(select_end_ptr); - nk_edit_draw_text(out, style, - area.x - edit->scrollbar.x, - area.y + selection_offset_end.y - edit->scrollbar.y, - selection_offset_end.x, - begin, (int)(end - begin), row_height, font, - background_color, text_color, nk_true); - } - } - - /* cursor */ - if (edit->select_start == edit->select_end) - { - if (edit->cursor >= nk_str_len(&edit->string) || - (cursor_ptr && *cursor_ptr == '\n')) { - /* draw cursor at end of line */ - struct nk_rect cursor; - cursor.w = style->cursor_size; - cursor.h = font->height; - cursor.x = area.x + cursor_pos.x - edit->scrollbar.x; - cursor.y = area.y + cursor_pos.y + row_height/2.0f - cursor.h/2.0f; - cursor.y -= edit->scrollbar.y; - nk_fill_rect(out, cursor, 0, cursor_color); - } else { - /* draw cursor inside text */ - int glyph_len; - struct nk_rect label; - struct nk_text txt; - - nk_rune unicode; - NK_ASSERT(cursor_ptr); - glyph_len = nk_utf_decode(cursor_ptr, &unicode, 4); - - label.x = area.x + cursor_pos.x - edit->scrollbar.x; - label.y = area.y + cursor_pos.y - edit->scrollbar.y; - label.w = font->width(font->userdata, font->height, cursor_ptr, glyph_len); - label.h = row_height; - - txt.padding = nk_vec2(0,0); - txt.background = cursor_color;; - txt.text = cursor_text_color; - nk_fill_rect(out, label, 0, cursor_color); - nk_widget_text(out, label, cursor_ptr, glyph_len, &txt, NK_TEXT_LEFT, font); - } - }} - } else { - /* not active so just draw text */ - int l = nk_str_len_char(&edit->string); - const char *begin = nk_str_get_const(&edit->string); - - const struct nk_style_item *background; - struct nk_color background_color; - struct nk_color text_color; - nk_push_scissor(out, clip); - if (*state & NK_WIDGET_STATE_ACTIVED) { - background = &style->active; - text_color = style->text_active; - } else if (*state & NK_WIDGET_STATE_HOVER) { - background = &style->hover; - text_color = style->text_hover; - } else { - background = &style->normal; - text_color = style->text_normal; - } - if (background->type == NK_STYLE_ITEM_IMAGE) - background_color = nk_rgba(0,0,0,0); - else background_color = background->data.color; - nk_edit_draw_text(out, style, area.x - edit->scrollbar.x, - area.y - edit->scrollbar.y, 0, begin, l, row_height, font, - background_color, text_color, nk_false); - } - nk_push_scissor(out, old_clip);} - return ret; -} -NK_API void -nk_edit_focus(struct nk_context *ctx, nk_flags flags) -{ - nk_hash hash; - struct nk_window *win; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - if (!ctx || !ctx->current) return; - - win = ctx->current; - hash = win->edit.seq; - win->edit.active = nk_true; - win->edit.name = hash; - if (flags & NK_EDIT_ALWAYS_INSERT_MODE) - win->edit.mode = NK_TEXT_EDIT_MODE_INSERT; -} -NK_API void -nk_edit_unfocus(struct nk_context *ctx) -{ - struct nk_window *win; - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - if (!ctx || !ctx->current) return; - - win = ctx->current; - win->edit.active = nk_false; - win->edit.name = 0; -} -NK_API nk_flags -nk_edit_string(struct nk_context *ctx, nk_flags flags, - char *memory, int *len, int max, nk_plugin_filter filter) -{ - nk_hash hash; - nk_flags state; - struct nk_text_edit *edit; - struct nk_window *win; - - NK_ASSERT(ctx); - NK_ASSERT(memory); - NK_ASSERT(len); - if (!ctx || !memory || !len) - return 0; - - filter = (!filter) ? nk_filter_default: filter; - win = ctx->current; - hash = win->edit.seq; - edit = &ctx->text_edit; - nk_textedit_clear_state(&ctx->text_edit, (flags & NK_EDIT_MULTILINE)? - NK_TEXT_EDIT_MULTI_LINE: NK_TEXT_EDIT_SINGLE_LINE, filter); - - if (win->edit.active && hash == win->edit.name) { - if (flags & NK_EDIT_NO_CURSOR) - edit->cursor = nk_utf_len(memory, *len); - else edit->cursor = win->edit.cursor; - if (!(flags & NK_EDIT_SELECTABLE)) { - edit->select_start = win->edit.cursor; - edit->select_end = win->edit.cursor; - } else { - edit->select_start = win->edit.sel_start; - edit->select_end = win->edit.sel_end; - } - edit->mode = win->edit.mode; - edit->scrollbar.x = (float)win->edit.scrollbar.x; - edit->scrollbar.y = (float)win->edit.scrollbar.y; - edit->active = nk_true; - } else edit->active = nk_false; - - max = NK_MAX(1, max); - *len = NK_MIN(*len, max-1); - nk_str_init_fixed(&edit->string, memory, (nk_size)max); - edit->string.buffer.allocated = (nk_size)*len; - edit->string.len = nk_utf_len(memory, *len); - state = nk_edit_buffer(ctx, flags, edit, filter); - *len = (int)edit->string.buffer.allocated; - - if (edit->active) { - win->edit.cursor = edit->cursor; - win->edit.sel_start = edit->select_start; - win->edit.sel_end = edit->select_end; - win->edit.mode = edit->mode; - win->edit.scrollbar.x = (nk_uint)edit->scrollbar.x; - win->edit.scrollbar.y = (nk_uint)edit->scrollbar.y; - } return state; -} -NK_API nk_flags -nk_edit_buffer(struct nk_context *ctx, nk_flags flags, - struct nk_text_edit *edit, nk_plugin_filter filter) -{ - struct nk_window *win; - struct nk_style *style; - struct nk_input *in; - - enum nk_widget_layout_states state; - struct nk_rect bounds; - - nk_flags ret_flags = 0; - unsigned char prev_state; - nk_hash hash; - - /* make sure correct values */ - NK_ASSERT(ctx); - NK_ASSERT(edit); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - win = ctx->current; - style = &ctx->style; - state = nk_widget(&bounds, ctx); - if (!state) return state; - in = (win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; - - /* check if edit is currently hot item */ - hash = win->edit.seq++; - if (win->edit.active && hash == win->edit.name) { - if (flags & NK_EDIT_NO_CURSOR) - edit->cursor = edit->string.len; - if (!(flags & NK_EDIT_SELECTABLE)) { - edit->select_start = edit->cursor; - edit->select_end = edit->cursor; - } - if (flags & NK_EDIT_CLIPBOARD) - edit->clip = ctx->clip; - edit->active = (unsigned char)win->edit.active; - } else edit->active = nk_false; - edit->mode = win->edit.mode; - - filter = (!filter) ? nk_filter_default: filter; - prev_state = (unsigned char)edit->active; - in = (flags & NK_EDIT_READ_ONLY) ? 0: in; - ret_flags = nk_do_edit(&ctx->last_widget_state, &win->buffer, bounds, flags, - filter, edit, &style->edit, in, style->font); - - if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER) - ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_TEXT]; - if (edit->active && prev_state != edit->active) { - /* current edit is now hot */ - win->edit.active = nk_true; - win->edit.name = hash; - } else if (prev_state && !edit->active) { - /* current edit is now cold */ - win->edit.active = nk_false; - } return ret_flags; -} -NK_API nk_flags -nk_edit_string_zero_terminated(struct nk_context *ctx, nk_flags flags, - char *buffer, int max, nk_plugin_filter filter) -{ - nk_flags result; - int len = nk_strlen(buffer); - result = nk_edit_string(ctx, flags, buffer, &len, max, filter); - buffer[NK_MIN(NK_MAX(max-1,0), len)] = '\0'; - return result; -} - - - - - -/* =============================================================== - * - * PROPERTY - * - * ===============================================================*/ -NK_LIB void -nk_drag_behavior(nk_flags *state, const struct nk_input *in, - struct nk_rect drag, struct nk_property_variant *variant, - float inc_per_pixel) -{ - int left_mouse_down = in && in->mouse.buttons[NK_BUTTON_LEFT].down; - int left_mouse_click_in_cursor = in && - nk_input_has_mouse_click_down_in_rect(in, NK_BUTTON_LEFT, drag, nk_true); - - nk_widget_state_reset(state); - if (nk_input_is_mouse_hovering_rect(in, drag)) - *state = NK_WIDGET_STATE_HOVERED; - - if (left_mouse_down && left_mouse_click_in_cursor) { - float delta, pixels; - pixels = in->mouse.delta.x; - delta = pixels * inc_per_pixel; - switch (variant->kind) { - default: break; - case NK_PROPERTY_INT: - variant->value.i = variant->value.i + (int)delta; - variant->value.i = NK_CLAMP(variant->min_value.i, variant->value.i, variant->max_value.i); - break; - case NK_PROPERTY_FLOAT: - variant->value.f = variant->value.f + (float)delta; - variant->value.f = NK_CLAMP(variant->min_value.f, variant->value.f, variant->max_value.f); - break; - case NK_PROPERTY_DOUBLE: - variant->value.d = variant->value.d + (double)delta; - variant->value.d = NK_CLAMP(variant->min_value.d, variant->value.d, variant->max_value.d); - break; - } - *state = NK_WIDGET_STATE_ACTIVE; - } - if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, drag)) - *state |= NK_WIDGET_STATE_ENTERED; - else if (nk_input_is_mouse_prev_hovering_rect(in, drag)) - *state |= NK_WIDGET_STATE_LEFT; -} -NK_LIB void -nk_property_behavior(nk_flags *ws, const struct nk_input *in, - struct nk_rect property, struct nk_rect label, struct nk_rect edit, - struct nk_rect empty, int *state, struct nk_property_variant *variant, - float inc_per_pixel) -{ - if (in && *state == NK_PROPERTY_DEFAULT) { - if (nk_button_behavior(ws, edit, in, NK_BUTTON_DEFAULT)) - *state = NK_PROPERTY_EDIT; - else if (nk_input_is_mouse_click_down_in_rect(in, NK_BUTTON_LEFT, label, nk_true)) - *state = NK_PROPERTY_DRAG; - else if (nk_input_is_mouse_click_down_in_rect(in, NK_BUTTON_LEFT, empty, nk_true)) - *state = NK_PROPERTY_DRAG; - } - if (*state == NK_PROPERTY_DRAG) { - nk_drag_behavior(ws, in, property, variant, inc_per_pixel); - if (!(*ws & NK_WIDGET_STATE_ACTIVED)) *state = NK_PROPERTY_DEFAULT; - } -} -NK_LIB void -nk_draw_property(struct nk_command_buffer *out, const struct nk_style_property *style, - const struct nk_rect *bounds, const struct nk_rect *label, nk_flags state, - const char *name, int len, const struct nk_user_font *font) -{ - struct nk_text text; - const struct nk_style_item *background; - - /* select correct background and text color */ - if (state & NK_WIDGET_STATE_ACTIVED) { - background = &style->active; - text.text = style->label_active; - } else if (state & NK_WIDGET_STATE_HOVER) { - background = &style->hover; - text.text = style->label_hover; - } else { - background = &style->normal; - text.text = style->label_normal; - } - - /* draw background */ - if (background->type == NK_STYLE_ITEM_IMAGE) { - nk_draw_image(out, *bounds, &background->data.image, nk_white); - text.background = nk_rgba(0,0,0,0); - } else { - text.background = background->data.color; - nk_fill_rect(out, *bounds, style->rounding, background->data.color); - nk_stroke_rect(out, *bounds, style->rounding, style->border, background->data.color); - } - - /* draw label */ - text.padding = nk_vec2(0,0); - nk_widget_text(out, *label, name, len, &text, NK_TEXT_CENTERED, font); -} -NK_LIB void -nk_do_property(nk_flags *ws, - struct nk_command_buffer *out, struct nk_rect property, - const char *name, struct nk_property_variant *variant, - float inc_per_pixel, char *buffer, int *len, - int *state, int *cursor, int *select_begin, int *select_end, - const struct nk_style_property *style, - enum nk_property_filter filter, struct nk_input *in, - const struct nk_user_font *font, struct nk_text_edit *text_edit, - enum nk_button_behavior behavior) -{ - const nk_plugin_filter filters[] = { - nk_filter_decimal, - nk_filter_float - }; - int active, old; - int num_len, name_len; - char string[NK_MAX_NUMBER_BUFFER]; - float size; - - char *dst = 0; - int *length; - - struct nk_rect left; - struct nk_rect right; - struct nk_rect label; - struct nk_rect edit; - struct nk_rect empty; - - /* left decrement button */ - left.h = font->height/2; - left.w = left.h; - left.x = property.x + style->border + style->padding.x; - left.y = property.y + style->border + property.h/2.0f - left.h/2; - - /* text label */ - name_len = nk_strlen(name); - size = font->width(font->userdata, font->height, name, name_len); - label.x = left.x + left.w + style->padding.x; - label.w = (float)size + 2 * style->padding.x; - label.y = property.y + style->border + style->padding.y; - label.h = property.h - (2 * style->border + 2 * style->padding.y); - - /* right increment button */ - right.y = left.y; - right.w = left.w; - right.h = left.h; - right.x = property.x + property.w - (right.w + style->padding.x); - - /* edit */ - if (*state == NK_PROPERTY_EDIT) { - size = font->width(font->userdata, font->height, buffer, *len); - size += style->edit.cursor_size; - length = len; - dst = buffer; - } else { - switch (variant->kind) { - default: break; - case NK_PROPERTY_INT: - nk_itoa(string, variant->value.i); - num_len = nk_strlen(string); - break; - case NK_PROPERTY_FLOAT: - NK_DTOA(string, (double)variant->value.f); - num_len = nk_string_float_limit(string, NK_MAX_FLOAT_PRECISION); - break; - case NK_PROPERTY_DOUBLE: - NK_DTOA(string, variant->value.d); - num_len = nk_string_float_limit(string, NK_MAX_FLOAT_PRECISION); - break; - } - size = font->width(font->userdata, font->height, string, num_len); - dst = string; - length = &num_len; - } - - edit.w = (float)size + 2 * style->padding.x; - edit.w = NK_MIN(edit.w, right.x - (label.x + label.w)); - edit.x = right.x - (edit.w + style->padding.x); - edit.y = property.y + style->border; - edit.h = property.h - (2 * style->border); - - /* empty left space activator */ - empty.w = edit.x - (label.x + label.w); - empty.x = label.x + label.w; - empty.y = property.y; - empty.h = property.h; - - /* update property */ - old = (*state == NK_PROPERTY_EDIT); - nk_property_behavior(ws, in, property, label, edit, empty, state, variant, inc_per_pixel); - - /* draw property */ - if (style->draw_begin) style->draw_begin(out, style->userdata); - nk_draw_property(out, style, &property, &label, *ws, name, name_len, font); - if (style->draw_end) style->draw_end(out, style->userdata); - - /* execute right button */ - if (nk_do_button_symbol(ws, out, left, style->sym_left, behavior, &style->dec_button, in, font)) { - switch (variant->kind) { - default: break; - case NK_PROPERTY_INT: - variant->value.i = NK_CLAMP(variant->min_value.i, variant->value.i - variant->step.i, variant->max_value.i); break; - case NK_PROPERTY_FLOAT: - variant->value.f = NK_CLAMP(variant->min_value.f, variant->value.f - variant->step.f, variant->max_value.f); break; - case NK_PROPERTY_DOUBLE: - variant->value.d = NK_CLAMP(variant->min_value.d, variant->value.d - variant->step.d, variant->max_value.d); break; - } - } - /* execute left button */ - if (nk_do_button_symbol(ws, out, right, style->sym_right, behavior, &style->inc_button, in, font)) { - switch (variant->kind) { - default: break; - case NK_PROPERTY_INT: - variant->value.i = NK_CLAMP(variant->min_value.i, variant->value.i + variant->step.i, variant->max_value.i); break; - case NK_PROPERTY_FLOAT: - variant->value.f = NK_CLAMP(variant->min_value.f, variant->value.f + variant->step.f, variant->max_value.f); break; - case NK_PROPERTY_DOUBLE: - variant->value.d = NK_CLAMP(variant->min_value.d, variant->value.d + variant->step.d, variant->max_value.d); break; - } - } - if (old != NK_PROPERTY_EDIT && (*state == NK_PROPERTY_EDIT)) { - /* property has been activated so setup buffer */ - NK_MEMCPY(buffer, dst, (nk_size)*length); - *cursor = nk_utf_len(buffer, *length); - *len = *length; - length = len; - dst = buffer; - active = 0; - } else active = (*state == NK_PROPERTY_EDIT); - - /* execute and run text edit field */ - nk_textedit_clear_state(text_edit, NK_TEXT_EDIT_SINGLE_LINE, filters[filter]); - text_edit->active = (unsigned char)active; - text_edit->string.len = *length; - text_edit->cursor = NK_CLAMP(0, *cursor, *length); - text_edit->select_start = NK_CLAMP(0,*select_begin, *length); - text_edit->select_end = NK_CLAMP(0,*select_end, *length); - text_edit->string.buffer.allocated = (nk_size)*length; - text_edit->string.buffer.memory.size = NK_MAX_NUMBER_BUFFER; - text_edit->string.buffer.memory.ptr = dst; - text_edit->string.buffer.size = NK_MAX_NUMBER_BUFFER; - text_edit->mode = NK_TEXT_EDIT_MODE_INSERT; - nk_do_edit(ws, out, edit, NK_EDIT_FIELD|NK_EDIT_AUTO_SELECT, - filters[filter], text_edit, &style->edit, (*state == NK_PROPERTY_EDIT) ? in: 0, font); - - *length = text_edit->string.len; - *cursor = text_edit->cursor; - *select_begin = text_edit->select_start; - *select_end = text_edit->select_end; - if (text_edit->active && nk_input_is_key_pressed(in, NK_KEY_ENTER)) - text_edit->active = nk_false; - - if (active && !text_edit->active) { - /* property is now not active so convert edit text to value*/ - *state = NK_PROPERTY_DEFAULT; - buffer[*len] = '\0'; - switch (variant->kind) { - default: break; - case NK_PROPERTY_INT: - variant->value.i = nk_strtoi(buffer, 0); - variant->value.i = NK_CLAMP(variant->min_value.i, variant->value.i, variant->max_value.i); - break; - case NK_PROPERTY_FLOAT: - nk_string_float_limit(buffer, NK_MAX_FLOAT_PRECISION); - variant->value.f = nk_strtof(buffer, 0); - variant->value.f = NK_CLAMP(variant->min_value.f, variant->value.f, variant->max_value.f); - break; - case NK_PROPERTY_DOUBLE: - nk_string_float_limit(buffer, NK_MAX_FLOAT_PRECISION); - variant->value.d = nk_strtod(buffer, 0); - variant->value.d = NK_CLAMP(variant->min_value.d, variant->value.d, variant->max_value.d); - break; - } - } -} -NK_LIB struct nk_property_variant -nk_property_variant_int(int value, int min_value, int max_value, int step) -{ - struct nk_property_variant result; - result.kind = NK_PROPERTY_INT; - result.value.i = value; - result.min_value.i = min_value; - result.max_value.i = max_value; - result.step.i = step; - return result; -} -NK_LIB struct nk_property_variant -nk_property_variant_float(float value, float min_value, float max_value, float step) -{ - struct nk_property_variant result; - result.kind = NK_PROPERTY_FLOAT; - result.value.f = value; - result.min_value.f = min_value; - result.max_value.f = max_value; - result.step.f = step; - return result; -} -NK_LIB struct nk_property_variant -nk_property_variant_double(double value, double min_value, double max_value, - double step) -{ - struct nk_property_variant result; - result.kind = NK_PROPERTY_DOUBLE; - result.value.d = value; - result.min_value.d = min_value; - result.max_value.d = max_value; - result.step.d = step; - return result; -} -NK_LIB void -nk_property(struct nk_context *ctx, const char *name, struct nk_property_variant *variant, - float inc_per_pixel, const enum nk_property_filter filter) -{ - struct nk_window *win; - struct nk_panel *layout; - struct nk_input *in; - const struct nk_style *style; - - struct nk_rect bounds; - enum nk_widget_layout_states s; - - int *state = 0; - nk_hash hash = 0; - char *buffer = 0; - int *len = 0; - int *cursor = 0; - int *select_begin = 0; - int *select_end = 0; - int old_state; - - char dummy_buffer[NK_MAX_NUMBER_BUFFER]; - int dummy_state = NK_PROPERTY_DEFAULT; - int dummy_length = 0; - int dummy_cursor = 0; - int dummy_select_begin = 0; - int dummy_select_end = 0; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return; - - win = ctx->current; - layout = win->layout; - style = &ctx->style; - s = nk_widget(&bounds, ctx); - if (!s) return; - - /* calculate hash from name */ - if (name[0] == '#') { - hash = nk_murmur_hash(name, (int)nk_strlen(name), win->property.seq++); - name++; /* special number hash */ - } else hash = nk_murmur_hash(name, (int)nk_strlen(name), 42); - - /* check if property is currently hot item */ - if (win->property.active && hash == win->property.name) { - buffer = win->property.buffer; - len = &win->property.length; - cursor = &win->property.cursor; - state = &win->property.state; - select_begin = &win->property.select_start; - select_end = &win->property.select_end; - } else { - buffer = dummy_buffer; - len = &dummy_length; - cursor = &dummy_cursor; - state = &dummy_state; - select_begin = &dummy_select_begin; - select_end = &dummy_select_end; - } - - /* execute property widget */ - old_state = *state; - ctx->text_edit.clip = ctx->clip; - in = ((s == NK_WIDGET_ROM && !win->property.active) || - layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; - nk_do_property(&ctx->last_widget_state, &win->buffer, bounds, name, - variant, inc_per_pixel, buffer, len, state, cursor, select_begin, - select_end, &style->property, filter, in, style->font, &ctx->text_edit, - ctx->button_behavior); - - if (in && *state != NK_PROPERTY_DEFAULT && !win->property.active) { - /* current property is now hot */ - win->property.active = 1; - NK_MEMCPY(win->property.buffer, buffer, (nk_size)*len); - win->property.length = *len; - win->property.cursor = *cursor; - win->property.state = *state; - win->property.name = hash; - win->property.select_start = *select_begin; - win->property.select_end = *select_end; - if (*state == NK_PROPERTY_DRAG) { - ctx->input.mouse.grab = nk_true; - ctx->input.mouse.grabbed = nk_true; - } - } - /* check if previously active property is now inactive */ - if (*state == NK_PROPERTY_DEFAULT && old_state != NK_PROPERTY_DEFAULT) { - if (old_state == NK_PROPERTY_DRAG) { - ctx->input.mouse.grab = nk_false; - ctx->input.mouse.grabbed = nk_false; - ctx->input.mouse.ungrab = nk_true; - } - win->property.select_start = 0; - win->property.select_end = 0; - win->property.active = 0; - } -} -NK_API void -nk_property_int(struct nk_context *ctx, const char *name, - int min, int *val, int max, int step, float inc_per_pixel) -{ - struct nk_property_variant variant; - NK_ASSERT(ctx); - NK_ASSERT(name); - NK_ASSERT(val); - - if (!ctx || !ctx->current || !name || !val) return; - variant = nk_property_variant_int(*val, min, max, step); - nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_INT); - *val = variant.value.i; -} -NK_API void -nk_property_float(struct nk_context *ctx, const char *name, - float min, float *val, float max, float step, float inc_per_pixel) -{ - struct nk_property_variant variant; - NK_ASSERT(ctx); - NK_ASSERT(name); - NK_ASSERT(val); - - if (!ctx || !ctx->current || !name || !val) return; - variant = nk_property_variant_float(*val, min, max, step); - nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_FLOAT); - *val = variant.value.f; -} -NK_API void -nk_property_double(struct nk_context *ctx, const char *name, - double min, double *val, double max, double step, float inc_per_pixel) -{ - struct nk_property_variant variant; - NK_ASSERT(ctx); - NK_ASSERT(name); - NK_ASSERT(val); - - if (!ctx || !ctx->current || !name || !val) return; - variant = nk_property_variant_double(*val, min, max, step); - nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_FLOAT); - *val = variant.value.d; -} -NK_API int -nk_propertyi(struct nk_context *ctx, const char *name, int min, int val, - int max, int step, float inc_per_pixel) -{ - struct nk_property_variant variant; - NK_ASSERT(ctx); - NK_ASSERT(name); - - if (!ctx || !ctx->current || !name) return val; - variant = nk_property_variant_int(val, min, max, step); - nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_INT); - val = variant.value.i; - return val; -} -NK_API float -nk_propertyf(struct nk_context *ctx, const char *name, float min, - float val, float max, float step, float inc_per_pixel) -{ - struct nk_property_variant variant; - NK_ASSERT(ctx); - NK_ASSERT(name); - - if (!ctx || !ctx->current || !name) return val; - variant = nk_property_variant_float(val, min, max, step); - nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_FLOAT); - val = variant.value.f; - return val; -} -NK_API double -nk_propertyd(struct nk_context *ctx, const char *name, double min, - double val, double max, double step, float inc_per_pixel) -{ - struct nk_property_variant variant; - NK_ASSERT(ctx); - NK_ASSERT(name); - - if (!ctx || !ctx->current || !name) return val; - variant = nk_property_variant_double(val, min, max, step); - nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_FLOAT); - val = variant.value.d; - return val; -} - - - - - -/* ============================================================== - * - * CHART - * - * ===============================================================*/ -NK_API int -nk_chart_begin_colored(struct nk_context *ctx, enum nk_chart_type type, - struct nk_color color, struct nk_color highlight, - int count, float min_value, float max_value) -{ - struct nk_window *win; - struct nk_chart *chart; - const struct nk_style *config; - const struct nk_style_chart *style; - - const struct nk_style_item *background; - struct nk_rect bounds = {0, 0, 0, 0}; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - - if (!ctx || !ctx->current || !ctx->current->layout) return 0; - if (!nk_widget(&bounds, ctx)) { - chart = &ctx->current->layout->chart; - nk_zero(chart, sizeof(*chart)); - return 0; - } - - win = ctx->current; - config = &ctx->style; - chart = &win->layout->chart; - style = &config->chart; - - /* setup basic generic chart */ - nk_zero(chart, sizeof(*chart)); - chart->x = bounds.x + style->padding.x; - chart->y = bounds.y + style->padding.y; - chart->w = bounds.w - 2 * style->padding.x; - chart->h = bounds.h - 2 * style->padding.y; - chart->w = NK_MAX(chart->w, 2 * style->padding.x); - chart->h = NK_MAX(chart->h, 2 * style->padding.y); - - /* add first slot into chart */ - {struct nk_chart_slot *slot = &chart->slots[chart->slot++]; - slot->type = type; - slot->count = count; - slot->color = color; - slot->highlight = highlight; - slot->min = NK_MIN(min_value, max_value); - slot->max = NK_MAX(min_value, max_value); - slot->range = slot->max - slot->min;} - - /* draw chart background */ - background = &style->background; - if (background->type == NK_STYLE_ITEM_IMAGE) { - nk_draw_image(&win->buffer, bounds, &background->data.image, nk_white); - } else { - nk_fill_rect(&win->buffer, bounds, style->rounding, style->border_color); - nk_fill_rect(&win->buffer, nk_shrink_rect(bounds, style->border), - style->rounding, style->background.data.color); - } - return 1; -} -NK_API int -nk_chart_begin(struct nk_context *ctx, const enum nk_chart_type type, - int count, float min_value, float max_value) -{ - return nk_chart_begin_colored(ctx, type, ctx->style.chart.color, - ctx->style.chart.selected_color, count, min_value, max_value); -} -NK_API void -nk_chart_add_slot_colored(struct nk_context *ctx, const enum nk_chart_type type, - struct nk_color color, struct nk_color highlight, - int count, float min_value, float max_value) -{ - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - NK_ASSERT(ctx->current->layout->chart.slot < NK_CHART_MAX_SLOT); - if (!ctx || !ctx->current || !ctx->current->layout) return; - if (ctx->current->layout->chart.slot >= NK_CHART_MAX_SLOT) return; - - /* add another slot into the graph */ - {struct nk_chart *chart = &ctx->current->layout->chart; - struct nk_chart_slot *slot = &chart->slots[chart->slot++]; - slot->type = type; - slot->count = count; - slot->color = color; - slot->highlight = highlight; - slot->min = NK_MIN(min_value, max_value); - slot->max = NK_MAX(min_value, max_value); - slot->range = slot->max - slot->min;} -} -NK_API void -nk_chart_add_slot(struct nk_context *ctx, const enum nk_chart_type type, - int count, float min_value, float max_value) -{ - nk_chart_add_slot_colored(ctx, type, ctx->style.chart.color, - ctx->style.chart.selected_color, count, min_value, max_value); -} -NK_INTERN nk_flags -nk_chart_push_line(struct nk_context *ctx, struct nk_window *win, - struct nk_chart *g, float value, int slot) -{ - struct nk_panel *layout = win->layout; - const struct nk_input *i = &ctx->input; - struct nk_command_buffer *out = &win->buffer; - - nk_flags ret = 0; - struct nk_vec2 cur; - struct nk_rect bounds; - struct nk_color color; - float step; - float range; - float ratio; - - NK_ASSERT(slot >= 0 && slot < NK_CHART_MAX_SLOT); - step = g->w / (float)g->slots[slot].count; - range = g->slots[slot].max - g->slots[slot].min; - ratio = (value - g->slots[slot].min) / range; - - if (g->slots[slot].index == 0) { - /* first data point does not have a connection */ - g->slots[slot].last.x = g->x; - g->slots[slot].last.y = (g->y + g->h) - ratio * (float)g->h; - - bounds.x = g->slots[slot].last.x - 2; - bounds.y = g->slots[slot].last.y - 2; - bounds.w = bounds.h = 4; - - color = g->slots[slot].color; - if (!(layout->flags & NK_WINDOW_ROM) && - NK_INBOX(i->mouse.pos.x,i->mouse.pos.y, g->slots[slot].last.x-3, g->slots[slot].last.y-3, 6, 6)){ - ret = nk_input_is_mouse_hovering_rect(i, bounds) ? NK_CHART_HOVERING : 0; - ret |= (i->mouse.buttons[NK_BUTTON_LEFT].down && - i->mouse.buttons[NK_BUTTON_LEFT].clicked) ? NK_CHART_CLICKED: 0; - color = g->slots[slot].highlight; - } - nk_fill_rect(out, bounds, 0, color); - g->slots[slot].index += 1; - return ret; - } - - /* draw a line between the last data point and the new one */ - color = g->slots[slot].color; - cur.x = g->x + (float)(step * (float)g->slots[slot].index); - cur.y = (g->y + g->h) - (ratio * (float)g->h); - nk_stroke_line(out, g->slots[slot].last.x, g->slots[slot].last.y, cur.x, cur.y, 1.0f, color); - - bounds.x = cur.x - 3; - bounds.y = cur.y - 3; - bounds.w = bounds.h = 6; - - /* user selection of current data point */ - if (!(layout->flags & NK_WINDOW_ROM)) { - if (nk_input_is_mouse_hovering_rect(i, bounds)) { - ret = NK_CHART_HOVERING; - ret |= (!i->mouse.buttons[NK_BUTTON_LEFT].down && - i->mouse.buttons[NK_BUTTON_LEFT].clicked) ? NK_CHART_CLICKED: 0; - color = g->slots[slot].highlight; - } - } - nk_fill_rect(out, nk_rect(cur.x - 2, cur.y - 2, 4, 4), 0, color); - - /* save current data point position */ - g->slots[slot].last.x = cur.x; - g->slots[slot].last.y = cur.y; - g->slots[slot].index += 1; - return ret; -} -NK_INTERN nk_flags -nk_chart_push_column(const struct nk_context *ctx, struct nk_window *win, - struct nk_chart *chart, float value, int slot) -{ - struct nk_command_buffer *out = &win->buffer; - const struct nk_input *in = &ctx->input; - struct nk_panel *layout = win->layout; - - float ratio; - nk_flags ret = 0; - struct nk_color color; - struct nk_rect item = {0,0,0,0}; - - NK_ASSERT(slot >= 0 && slot < NK_CHART_MAX_SLOT); - if (chart->slots[slot].index >= chart->slots[slot].count) - return nk_false; - if (chart->slots[slot].count) { - float padding = (float)(chart->slots[slot].count-1); - item.w = (chart->w - padding) / (float)(chart->slots[slot].count); - } - - /* calculate bounds of current bar chart entry */ - color = chart->slots[slot].color;; - item.h = chart->h * NK_ABS((value/chart->slots[slot].range)); - if (value >= 0) { - ratio = (value + NK_ABS(chart->slots[slot].min)) / NK_ABS(chart->slots[slot].range); - item.y = (chart->y + chart->h) - chart->h * ratio; - } else { - ratio = (value - chart->slots[slot].max) / chart->slots[slot].range; - item.y = chart->y + (chart->h * NK_ABS(ratio)) - item.h; - } - item.x = chart->x + ((float)chart->slots[slot].index * item.w); - item.x = item.x + ((float)chart->slots[slot].index); - - /* user chart bar selection */ - if (!(layout->flags & NK_WINDOW_ROM) && - NK_INBOX(in->mouse.pos.x,in->mouse.pos.y,item.x,item.y,item.w,item.h)) { - ret = NK_CHART_HOVERING; - ret |= (!in->mouse.buttons[NK_BUTTON_LEFT].down && - in->mouse.buttons[NK_BUTTON_LEFT].clicked) ? NK_CHART_CLICKED: 0; - color = chart->slots[slot].highlight; - } - nk_fill_rect(out, item, 0, color); - chart->slots[slot].index += 1; - return ret; -} -NK_API nk_flags -nk_chart_push_slot(struct nk_context *ctx, float value, int slot) -{ - nk_flags flags; - struct nk_window *win; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(slot >= 0 && slot < NK_CHART_MAX_SLOT); - NK_ASSERT(slot < ctx->current->layout->chart.slot); - if (!ctx || !ctx->current || slot >= NK_CHART_MAX_SLOT) return nk_false; - if (slot >= ctx->current->layout->chart.slot) return nk_false; - - win = ctx->current; - if (win->layout->chart.slot < slot) return nk_false; - switch (win->layout->chart.slots[slot].type) { - case NK_CHART_LINES: - flags = nk_chart_push_line(ctx, win, &win->layout->chart, value, slot); break; - case NK_CHART_COLUMN: - flags = nk_chart_push_column(ctx, win, &win->layout->chart, value, slot); break; - default: - case NK_CHART_MAX: - flags = 0; - } - return flags; -} -NK_API nk_flags -nk_chart_push(struct nk_context *ctx, float value) -{ - return nk_chart_push_slot(ctx, value, 0); -} -NK_API void -nk_chart_end(struct nk_context *ctx) -{ - struct nk_window *win; - struct nk_chart *chart; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - if (!ctx || !ctx->current) - return; - - win = ctx->current; - chart = &win->layout->chart; - NK_MEMSET(chart, 0, sizeof(*chart)); - return; -} -NK_API void -nk_plot(struct nk_context *ctx, enum nk_chart_type type, const float *values, - int count, int offset) -{ - int i = 0; - float min_value; - float max_value; - - NK_ASSERT(ctx); - NK_ASSERT(values); - if (!ctx || !values || !count) return; - - min_value = values[offset]; - max_value = values[offset]; - for (i = 0; i < count; ++i) { - min_value = NK_MIN(values[i + offset], min_value); - max_value = NK_MAX(values[i + offset], max_value); - } - - if (nk_chart_begin(ctx, type, count, min_value, max_value)) { - for (i = 0; i < count; ++i) - nk_chart_push(ctx, values[i + offset]); - nk_chart_end(ctx); - } -} -NK_API void -nk_plot_function(struct nk_context *ctx, enum nk_chart_type type, void *userdata, - float(*value_getter)(void* user, int index), int count, int offset) -{ - int i = 0; - float min_value; - float max_value; - - NK_ASSERT(ctx); - NK_ASSERT(value_getter); - if (!ctx || !value_getter || !count) return; - - max_value = min_value = value_getter(userdata, offset); - for (i = 0; i < count; ++i) { - float value = value_getter(userdata, i + offset); - min_value = NK_MIN(value, min_value); - max_value = NK_MAX(value, max_value); - } - - if (nk_chart_begin(ctx, type, count, min_value, max_value)) { - for (i = 0; i < count; ++i) - nk_chart_push(ctx, value_getter(userdata, i + offset)); - nk_chart_end(ctx); - } -} - - - - - -/* ============================================================== - * - * COLOR PICKER - * - * ===============================================================*/ -NK_LIB int -nk_color_picker_behavior(nk_flags *state, - const struct nk_rect *bounds, const struct nk_rect *matrix, - const struct nk_rect *hue_bar, const struct nk_rect *alpha_bar, - struct nk_colorf *color, const struct nk_input *in) -{ - float hsva[4]; - int value_changed = 0; - int hsv_changed = 0; - - NK_ASSERT(state); - NK_ASSERT(matrix); - NK_ASSERT(hue_bar); - NK_ASSERT(color); - - /* color matrix */ - nk_colorf_hsva_fv(hsva, *color); - if (nk_button_behavior(state, *matrix, in, NK_BUTTON_REPEATER)) { - hsva[1] = NK_SATURATE((in->mouse.pos.x - matrix->x) / (matrix->w-1)); - hsva[2] = 1.0f - NK_SATURATE((in->mouse.pos.y - matrix->y) / (matrix->h-1)); - value_changed = hsv_changed = 1; - } - /* hue bar */ - if (nk_button_behavior(state, *hue_bar, in, NK_BUTTON_REPEATER)) { - hsva[0] = NK_SATURATE((in->mouse.pos.y - hue_bar->y) / (hue_bar->h-1)); - value_changed = hsv_changed = 1; - } - /* alpha bar */ - if (alpha_bar) { - if (nk_button_behavior(state, *alpha_bar, in, NK_BUTTON_REPEATER)) { - hsva[3] = 1.0f - NK_SATURATE((in->mouse.pos.y - alpha_bar->y) / (alpha_bar->h-1)); - value_changed = 1; - } - } - nk_widget_state_reset(state); - if (hsv_changed) { - *color = nk_hsva_colorfv(hsva); - *state = NK_WIDGET_STATE_ACTIVE; - } - if (value_changed) { - color->a = hsva[3]; - *state = NK_WIDGET_STATE_ACTIVE; - } - /* set color picker widget state */ - if (nk_input_is_mouse_hovering_rect(in, *bounds)) - *state = NK_WIDGET_STATE_HOVERED; - if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, *bounds)) - *state |= NK_WIDGET_STATE_ENTERED; - else if (nk_input_is_mouse_prev_hovering_rect(in, *bounds)) - *state |= NK_WIDGET_STATE_LEFT; - return value_changed; -} -NK_LIB void -nk_draw_color_picker(struct nk_command_buffer *o, const struct nk_rect *matrix, - const struct nk_rect *hue_bar, const struct nk_rect *alpha_bar, - struct nk_colorf col) -{ - NK_STORAGE const struct nk_color black = {0,0,0,255}; - NK_STORAGE const struct nk_color white = {255, 255, 255, 255}; - NK_STORAGE const struct nk_color black_trans = {0,0,0,0}; - - const float crosshair_size = 7.0f; - struct nk_color temp; - float hsva[4]; - float line_y; - int i; - - NK_ASSERT(o); - NK_ASSERT(matrix); - NK_ASSERT(hue_bar); - - /* draw hue bar */ - nk_colorf_hsva_fv(hsva, col); - for (i = 0; i < 6; ++i) { - NK_GLOBAL const struct nk_color hue_colors[] = { - {255, 0, 0, 255}, {255,255,0,255}, {0,255,0,255}, {0, 255,255,255}, - {0,0,255,255}, {255, 0, 255, 255}, {255, 0, 0, 255} - }; - nk_fill_rect_multi_color(o, - nk_rect(hue_bar->x, hue_bar->y + (float)i * (hue_bar->h/6.0f) + 0.5f, - hue_bar->w, (hue_bar->h/6.0f) + 0.5f), hue_colors[i], hue_colors[i], - hue_colors[i+1], hue_colors[i+1]); - } - line_y = (float)(int)(hue_bar->y + hsva[0] * matrix->h + 0.5f); - nk_stroke_line(o, hue_bar->x-1, line_y, hue_bar->x + hue_bar->w + 2, - line_y, 1, nk_rgb(255,255,255)); - - /* draw alpha bar */ - if (alpha_bar) { - float alpha = NK_SATURATE(col.a); - line_y = (float)(int)(alpha_bar->y + (1.0f - alpha) * matrix->h + 0.5f); - - nk_fill_rect_multi_color(o, *alpha_bar, white, white, black, black); - nk_stroke_line(o, alpha_bar->x-1, line_y, alpha_bar->x + alpha_bar->w + 2, - line_y, 1, nk_rgb(255,255,255)); - } - - /* draw color matrix */ - temp = nk_hsv_f(hsva[0], 1.0f, 1.0f); - nk_fill_rect_multi_color(o, *matrix, white, temp, temp, white); - nk_fill_rect_multi_color(o, *matrix, black_trans, black_trans, black, black); - - /* draw cross-hair */ - {struct nk_vec2 p; float S = hsva[1]; float V = hsva[2]; - p.x = (float)(int)(matrix->x + S * matrix->w); - p.y = (float)(int)(matrix->y + (1.0f - V) * matrix->h); - nk_stroke_line(o, p.x - crosshair_size, p.y, p.x-2, p.y, 1.0f, white); - nk_stroke_line(o, p.x + crosshair_size + 1, p.y, p.x+3, p.y, 1.0f, white); - nk_stroke_line(o, p.x, p.y + crosshair_size + 1, p.x, p.y+3, 1.0f, white); - nk_stroke_line(o, p.x, p.y - crosshair_size, p.x, p.y-2, 1.0f, white);} -} -NK_LIB int -nk_do_color_picker(nk_flags *state, - struct nk_command_buffer *out, struct nk_colorf *col, - enum nk_color_format fmt, struct nk_rect bounds, - struct nk_vec2 padding, const struct nk_input *in, - const struct nk_user_font *font) -{ - int ret = 0; - struct nk_rect matrix; - struct nk_rect hue_bar; - struct nk_rect alpha_bar; - float bar_w; - - NK_ASSERT(out); - NK_ASSERT(col); - NK_ASSERT(state); - NK_ASSERT(font); - if (!out || !col || !state || !font) - return ret; - - bar_w = font->height; - bounds.x += padding.x; - bounds.y += padding.x; - bounds.w -= 2 * padding.x; - bounds.h -= 2 * padding.y; - - matrix.x = bounds.x; - matrix.y = bounds.y; - matrix.h = bounds.h; - matrix.w = bounds.w - (3 * padding.x + 2 * bar_w); - - hue_bar.w = bar_w; - hue_bar.y = bounds.y; - hue_bar.h = matrix.h; - hue_bar.x = matrix.x + matrix.w + padding.x; - - alpha_bar.x = hue_bar.x + hue_bar.w + padding.x; - alpha_bar.y = bounds.y; - alpha_bar.w = bar_w; - alpha_bar.h = matrix.h; - - ret = nk_color_picker_behavior(state, &bounds, &matrix, &hue_bar, - (fmt == NK_RGBA) ? &alpha_bar:0, col, in); - nk_draw_color_picker(out, &matrix, &hue_bar, (fmt == NK_RGBA) ? &alpha_bar:0, *col); - return ret; -} -NK_API int -nk_color_pick(struct nk_context * ctx, struct nk_colorf *color, - enum nk_color_format fmt) -{ - struct nk_window *win; - struct nk_panel *layout; - const struct nk_style *config; - const struct nk_input *in; - - enum nk_widget_layout_states state; - struct nk_rect bounds; - - NK_ASSERT(ctx); - NK_ASSERT(color); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout || !color) - return 0; - - win = ctx->current; - config = &ctx->style; - layout = win->layout; - state = nk_widget(&bounds, ctx); - if (!state) return 0; - in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input; - return nk_do_color_picker(&ctx->last_widget_state, &win->buffer, color, fmt, bounds, - nk_vec2(0,0), in, config->font); -} -NK_API struct nk_colorf -nk_color_picker(struct nk_context *ctx, struct nk_colorf color, - enum nk_color_format fmt) -{ - nk_color_pick(ctx, &color, fmt); - return color; -} - - - - - -/* ============================================================== - * - * COMBO - * - * ===============================================================*/ -NK_INTERN int -nk_combo_begin(struct nk_context *ctx, struct nk_window *win, - struct nk_vec2 size, int is_clicked, struct nk_rect header) -{ - struct nk_window *popup; - int is_open = 0; - int is_active = 0; - struct nk_rect body; - nk_hash hash; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - popup = win->popup.win; - body.x = header.x; - body.w = size.x; - body.y = header.y + header.h-ctx->style.window.combo_border; - body.h = size.y; - - hash = win->popup.combo_count++; - is_open = (popup) ? nk_true:nk_false; - is_active = (popup && (win->popup.name == hash) && win->popup.type == NK_PANEL_COMBO); - if ((is_clicked && is_open && !is_active) || (is_open && !is_active) || - (!is_open && !is_active && !is_clicked)) return 0; - if (!nk_nonblock_begin(ctx, 0, body, - (is_clicked && is_open)?nk_rect(0,0,0,0):header, NK_PANEL_COMBO)) return 0; - - win->popup.type = NK_PANEL_COMBO; - win->popup.name = hash; - return 1; -} -NK_API int -nk_combo_begin_text(struct nk_context *ctx, const char *selected, int len, - struct nk_vec2 size) -{ - const struct nk_input *in; - struct nk_window *win; - struct nk_style *style; - - enum nk_widget_layout_states s; - int is_clicked = nk_false; - struct nk_rect header; - const struct nk_style_item *background; - struct nk_text text; - - NK_ASSERT(ctx); - NK_ASSERT(selected); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout || !selected) - return 0; - - win = ctx->current; - style = &ctx->style; - s = nk_widget(&header, ctx); - if (s == NK_WIDGET_INVALID) - return 0; - - in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_ROM)? 0: &ctx->input; - if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT)) - is_clicked = nk_true; - - /* draw combo box header background and border */ - if (ctx->last_widget_state & NK_WIDGET_STATE_ACTIVED) { - background = &style->combo.active; - text.text = style->combo.label_active; - } else if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER) { - background = &style->combo.hover; - text.text = style->combo.label_hover; - } else { - background = &style->combo.normal; - text.text = style->combo.label_normal; - } - if (background->type == NK_STYLE_ITEM_IMAGE) { - text.background = nk_rgba(0,0,0,0); - nk_draw_image(&win->buffer, header, &background->data.image, nk_white); - } else { - text.background = background->data.color; - nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color); - nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color); - } - { - /* print currently selected text item */ - struct nk_rect label; - struct nk_rect button; - struct nk_rect content; - - enum nk_symbol_type sym; - if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER) - sym = style->combo.sym_hover; - else if (is_clicked) - sym = style->combo.sym_active; - else sym = style->combo.sym_normal; - - /* calculate button */ - button.w = header.h - 2 * style->combo.button_padding.y; - button.x = (header.x + header.w - header.h) - style->combo.button_padding.x; - button.y = header.y + style->combo.button_padding.y; - button.h = button.w; - - content.x = button.x + style->combo.button.padding.x; - content.y = button.y + style->combo.button.padding.y; - content.w = button.w - 2 * style->combo.button.padding.x; - content.h = button.h - 2 * style->combo.button.padding.y; - - /* draw selected label */ - text.padding = nk_vec2(0,0); - label.x = header.x + style->combo.content_padding.x; - label.y = header.y + style->combo.content_padding.y; - label.w = button.x - (style->combo.content_padding.x + style->combo.spacing.x) - label.x;; - label.h = header.h - 2 * style->combo.content_padding.y; - nk_widget_text(&win->buffer, label, selected, len, &text, - NK_TEXT_LEFT, ctx->style.font); - - /* draw open/close button */ - nk_draw_button_symbol(&win->buffer, &button, &content, ctx->last_widget_state, - &ctx->style.combo.button, sym, style->font); - } - return nk_combo_begin(ctx, win, size, is_clicked, header); -} -NK_API int -nk_combo_begin_label(struct nk_context *ctx, const char *selected, struct nk_vec2 size) -{ - return nk_combo_begin_text(ctx, selected, nk_strlen(selected), size); -} -NK_API int -nk_combo_begin_color(struct nk_context *ctx, struct nk_color color, struct nk_vec2 size) -{ - struct nk_window *win; - struct nk_style *style; - const struct nk_input *in; - - struct nk_rect header; - int is_clicked = nk_false; - enum nk_widget_layout_states s; - const struct nk_style_item *background; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - win = ctx->current; - style = &ctx->style; - s = nk_widget(&header, ctx); - if (s == NK_WIDGET_INVALID) - return 0; - - in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_ROM)? 0: &ctx->input; - if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT)) - is_clicked = nk_true; - - /* draw combo box header background and border */ - if (ctx->last_widget_state & NK_WIDGET_STATE_ACTIVED) - background = &style->combo.active; - else if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER) - background = &style->combo.hover; - else background = &style->combo.normal; - - if (background->type == NK_STYLE_ITEM_IMAGE) { - nk_draw_image(&win->buffer, header, &background->data.image,nk_white); - } else { - nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color); - nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color); - } - { - struct nk_rect content; - struct nk_rect button; - struct nk_rect bounds; - - enum nk_symbol_type sym; - if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER) - sym = style->combo.sym_hover; - else if (is_clicked) - sym = style->combo.sym_active; - else sym = style->combo.sym_normal; - - /* calculate button */ - button.w = header.h - 2 * style->combo.button_padding.y; - button.x = (header.x + header.w - header.h) - style->combo.button_padding.x; - button.y = header.y + style->combo.button_padding.y; - button.h = button.w; - - content.x = button.x + style->combo.button.padding.x; - content.y = button.y + style->combo.button.padding.y; - content.w = button.w - 2 * style->combo.button.padding.x; - content.h = button.h - 2 * style->combo.button.padding.y; - - /* draw color */ - bounds.h = header.h - 4 * style->combo.content_padding.y; - bounds.y = header.y + 2 * style->combo.content_padding.y; - bounds.x = header.x + 2 * style->combo.content_padding.x; - bounds.w = (button.x - (style->combo.content_padding.x + style->combo.spacing.x)) - bounds.x; - nk_fill_rect(&win->buffer, bounds, 0, color); - - /* draw open/close button */ - nk_draw_button_symbol(&win->buffer, &button, &content, ctx->last_widget_state, - &ctx->style.combo.button, sym, style->font); - } - return nk_combo_begin(ctx, win, size, is_clicked, header); -} -NK_API int -nk_combo_begin_symbol(struct nk_context *ctx, enum nk_symbol_type symbol, struct nk_vec2 size) -{ - struct nk_window *win; - struct nk_style *style; - const struct nk_input *in; - - struct nk_rect header; - int is_clicked = nk_false; - enum nk_widget_layout_states s; - const struct nk_style_item *background; - struct nk_color sym_background; - struct nk_color symbol_color; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - win = ctx->current; - style = &ctx->style; - s = nk_widget(&header, ctx); - if (s == NK_WIDGET_INVALID) - return 0; - - in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_ROM)? 0: &ctx->input; - if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT)) - is_clicked = nk_true; - - /* draw combo box header background and border */ - if (ctx->last_widget_state & NK_WIDGET_STATE_ACTIVED) { - background = &style->combo.active; - symbol_color = style->combo.symbol_active; - } else if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER) { - background = &style->combo.hover; - symbol_color = style->combo.symbol_hover; - } else { - background = &style->combo.normal; - symbol_color = style->combo.symbol_hover; - } - - if (background->type == NK_STYLE_ITEM_IMAGE) { - sym_background = nk_rgba(0,0,0,0); - nk_draw_image(&win->buffer, header, &background->data.image, nk_white); - } else { - sym_background = background->data.color; - nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color); - nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color); - } - { - struct nk_rect bounds = {0,0,0,0}; - struct nk_rect content; - struct nk_rect button; - - enum nk_symbol_type sym; - if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER) - sym = style->combo.sym_hover; - else if (is_clicked) - sym = style->combo.sym_active; - else sym = style->combo.sym_normal; - - /* calculate button */ - button.w = header.h - 2 * style->combo.button_padding.y; - button.x = (header.x + header.w - header.h) - style->combo.button_padding.y; - button.y = header.y + style->combo.button_padding.y; - button.h = button.w; - - content.x = button.x + style->combo.button.padding.x; - content.y = button.y + style->combo.button.padding.y; - content.w = button.w - 2 * style->combo.button.padding.x; - content.h = button.h - 2 * style->combo.button.padding.y; - - /* draw symbol */ - bounds.h = header.h - 2 * style->combo.content_padding.y; - bounds.y = header.y + style->combo.content_padding.y; - bounds.x = header.x + style->combo.content_padding.x; - bounds.w = (button.x - style->combo.content_padding.y) - bounds.x; - nk_draw_symbol(&win->buffer, symbol, bounds, sym_background, symbol_color, - 1.0f, style->font); - - /* draw open/close button */ - nk_draw_button_symbol(&win->buffer, &bounds, &content, ctx->last_widget_state, - &ctx->style.combo.button, sym, style->font); - } - return nk_combo_begin(ctx, win, size, is_clicked, header); -} -NK_API int -nk_combo_begin_symbol_text(struct nk_context *ctx, const char *selected, int len, - enum nk_symbol_type symbol, struct nk_vec2 size) -{ - struct nk_window *win; - struct nk_style *style; - struct nk_input *in; - - struct nk_rect header; - int is_clicked = nk_false; - enum nk_widget_layout_states s; - const struct nk_style_item *background; - struct nk_color symbol_color; - struct nk_text text; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - win = ctx->current; - style = &ctx->style; - s = nk_widget(&header, ctx); - if (!s) return 0; - - in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_ROM)? 0: &ctx->input; - if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT)) - is_clicked = nk_true; - - /* draw combo box header background and border */ - if (ctx->last_widget_state & NK_WIDGET_STATE_ACTIVED) { - background = &style->combo.active; - symbol_color = style->combo.symbol_active; - text.text = style->combo.label_active; - } else if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER) { - background = &style->combo.hover; - symbol_color = style->combo.symbol_hover; - text.text = style->combo.label_hover; - } else { - background = &style->combo.normal; - symbol_color = style->combo.symbol_normal; - text.text = style->combo.label_normal; - } - if (background->type == NK_STYLE_ITEM_IMAGE) { - text.background = nk_rgba(0,0,0,0); - nk_draw_image(&win->buffer, header, &background->data.image, nk_white); - } else { - text.background = background->data.color; - nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color); - nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color); - } - { - struct nk_rect content; - struct nk_rect button; - struct nk_rect label; - struct nk_rect image; - - enum nk_symbol_type sym; - if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER) - sym = style->combo.sym_hover; - else if (is_clicked) - sym = style->combo.sym_active; - else sym = style->combo.sym_normal; - - /* calculate button */ - button.w = header.h - 2 * style->combo.button_padding.y; - button.x = (header.x + header.w - header.h) - style->combo.button_padding.x; - button.y = header.y + style->combo.button_padding.y; - button.h = button.w; - - content.x = button.x + style->combo.button.padding.x; - content.y = button.y + style->combo.button.padding.y; - content.w = button.w - 2 * style->combo.button.padding.x; - content.h = button.h - 2 * style->combo.button.padding.y; - nk_draw_button_symbol(&win->buffer, &button, &content, ctx->last_widget_state, - &ctx->style.combo.button, sym, style->font); - - /* draw symbol */ - image.x = header.x + style->combo.content_padding.x; - image.y = header.y + style->combo.content_padding.y; - image.h = header.h - 2 * style->combo.content_padding.y; - image.w = image.h; - nk_draw_symbol(&win->buffer, symbol, image, text.background, symbol_color, - 1.0f, style->font); - - /* draw label */ - text.padding = nk_vec2(0,0); - label.x = image.x + image.w + style->combo.spacing.x + style->combo.content_padding.x; - label.y = header.y + style->combo.content_padding.y; - label.w = (button.x - style->combo.content_padding.x) - label.x; - label.h = header.h - 2 * style->combo.content_padding.y; - nk_widget_text(&win->buffer, label, selected, len, &text, NK_TEXT_LEFT, style->font); - } - return nk_combo_begin(ctx, win, size, is_clicked, header); -} -NK_API int -nk_combo_begin_image(struct nk_context *ctx, struct nk_image img, struct nk_vec2 size) -{ - struct nk_window *win; - struct nk_style *style; - const struct nk_input *in; - - struct nk_rect header; - int is_clicked = nk_false; - enum nk_widget_layout_states s; - const struct nk_style_item *background; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - win = ctx->current; - style = &ctx->style; - s = nk_widget(&header, ctx); - if (s == NK_WIDGET_INVALID) - return 0; - - in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_ROM)? 0: &ctx->input; - if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT)) - is_clicked = nk_true; - - /* draw combo box header background and border */ - if (ctx->last_widget_state & NK_WIDGET_STATE_ACTIVED) - background = &style->combo.active; - else if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER) - background = &style->combo.hover; - else background = &style->combo.normal; - - if (background->type == NK_STYLE_ITEM_IMAGE) { - nk_draw_image(&win->buffer, header, &background->data.image, nk_white); - } else { - nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color); - nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color); - } - { - struct nk_rect bounds = {0,0,0,0}; - struct nk_rect content; - struct nk_rect button; - - enum nk_symbol_type sym; - if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER) - sym = style->combo.sym_hover; - else if (is_clicked) - sym = style->combo.sym_active; - else sym = style->combo.sym_normal; - - /* calculate button */ - button.w = header.h - 2 * style->combo.button_padding.y; - button.x = (header.x + header.w - header.h) - style->combo.button_padding.y; - button.y = header.y + style->combo.button_padding.y; - button.h = button.w; - - content.x = button.x + style->combo.button.padding.x; - content.y = button.y + style->combo.button.padding.y; - content.w = button.w - 2 * style->combo.button.padding.x; - content.h = button.h - 2 * style->combo.button.padding.y; - - /* draw image */ - bounds.h = header.h - 2 * style->combo.content_padding.y; - bounds.y = header.y + style->combo.content_padding.y; - bounds.x = header.x + style->combo.content_padding.x; - bounds.w = (button.x - style->combo.content_padding.y) - bounds.x; - nk_draw_image(&win->buffer, bounds, &img, nk_white); - - /* draw open/close button */ - nk_draw_button_symbol(&win->buffer, &bounds, &content, ctx->last_widget_state, - &ctx->style.combo.button, sym, style->font); - } - return nk_combo_begin(ctx, win, size, is_clicked, header); -} -NK_API int -nk_combo_begin_image_text(struct nk_context *ctx, const char *selected, int len, - struct nk_image img, struct nk_vec2 size) -{ - struct nk_window *win; - struct nk_style *style; - struct nk_input *in; - - struct nk_rect header; - int is_clicked = nk_false; - enum nk_widget_layout_states s; - const struct nk_style_item *background; - struct nk_text text; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - win = ctx->current; - style = &ctx->style; - s = nk_widget(&header, ctx); - if (!s) return 0; - - in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_ROM)? 0: &ctx->input; - if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT)) - is_clicked = nk_true; - - /* draw combo box header background and border */ - if (ctx->last_widget_state & NK_WIDGET_STATE_ACTIVED) { - background = &style->combo.active; - text.text = style->combo.label_active; - } else if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER) { - background = &style->combo.hover; - text.text = style->combo.label_hover; - } else { - background = &style->combo.normal; - text.text = style->combo.label_normal; - } - if (background->type == NK_STYLE_ITEM_IMAGE) { - text.background = nk_rgba(0,0,0,0); - nk_draw_image(&win->buffer, header, &background->data.image, nk_white); - } else { - text.background = background->data.color; - nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color); - nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color); - } - { - struct nk_rect content; - struct nk_rect button; - struct nk_rect label; - struct nk_rect image; - - enum nk_symbol_type sym; - if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER) - sym = style->combo.sym_hover; - else if (is_clicked) - sym = style->combo.sym_active; - else sym = style->combo.sym_normal; - - /* calculate button */ - button.w = header.h - 2 * style->combo.button_padding.y; - button.x = (header.x + header.w - header.h) - style->combo.button_padding.x; - button.y = header.y + style->combo.button_padding.y; - button.h = button.w; - - content.x = button.x + style->combo.button.padding.x; - content.y = button.y + style->combo.button.padding.y; - content.w = button.w - 2 * style->combo.button.padding.x; - content.h = button.h - 2 * style->combo.button.padding.y; - nk_draw_button_symbol(&win->buffer, &button, &content, ctx->last_widget_state, - &ctx->style.combo.button, sym, style->font); - - /* draw image */ - image.x = header.x + style->combo.content_padding.x; - image.y = header.y + style->combo.content_padding.y; - image.h = header.h - 2 * style->combo.content_padding.y; - image.w = image.h; - nk_draw_image(&win->buffer, image, &img, nk_white); - - /* draw label */ - text.padding = nk_vec2(0,0); - label.x = image.x + image.w + style->combo.spacing.x + style->combo.content_padding.x; - label.y = header.y + style->combo.content_padding.y; - label.w = (button.x - style->combo.content_padding.x) - label.x; - label.h = header.h - 2 * style->combo.content_padding.y; - nk_widget_text(&win->buffer, label, selected, len, &text, NK_TEXT_LEFT, style->font); - } - return nk_combo_begin(ctx, win, size, is_clicked, header); -} -NK_API int -nk_combo_begin_symbol_label(struct nk_context *ctx, - const char *selected, enum nk_symbol_type type, struct nk_vec2 size) -{ - return nk_combo_begin_symbol_text(ctx, selected, nk_strlen(selected), type, size); -} -NK_API int -nk_combo_begin_image_label(struct nk_context *ctx, - const char *selected, struct nk_image img, struct nk_vec2 size) -{ - return nk_combo_begin_image_text(ctx, selected, nk_strlen(selected), img, size); -} -NK_API int -nk_combo_item_text(struct nk_context *ctx, const char *text, int len,nk_flags align) -{ - return nk_contextual_item_text(ctx, text, len, align); -} -NK_API int -nk_combo_item_label(struct nk_context *ctx, const char *label, nk_flags align) -{ - return nk_contextual_item_label(ctx, label, align); -} -NK_API int -nk_combo_item_image_text(struct nk_context *ctx, struct nk_image img, const char *text, - int len, nk_flags alignment) -{ - return nk_contextual_item_image_text(ctx, img, text, len, alignment); -} -NK_API int -nk_combo_item_image_label(struct nk_context *ctx, struct nk_image img, - const char *text, nk_flags alignment) -{ - return nk_contextual_item_image_label(ctx, img, text, alignment); -} -NK_API int -nk_combo_item_symbol_text(struct nk_context *ctx, enum nk_symbol_type sym, - const char *text, int len, nk_flags alignment) -{ - return nk_contextual_item_symbol_text(ctx, sym, text, len, alignment); -} -NK_API int -nk_combo_item_symbol_label(struct nk_context *ctx, enum nk_symbol_type sym, - const char *label, nk_flags alignment) -{ - return nk_contextual_item_symbol_label(ctx, sym, label, alignment); -} -NK_API void nk_combo_end(struct nk_context *ctx) -{ - nk_contextual_end(ctx); -} -NK_API void nk_combo_close(struct nk_context *ctx) -{ - nk_contextual_close(ctx); -} -NK_API int -nk_combo(struct nk_context *ctx, const char **items, int count, - int selected, int item_height, struct nk_vec2 size) -{ - int i = 0; - int max_height; - struct nk_vec2 item_spacing; - struct nk_vec2 window_padding; - - NK_ASSERT(ctx); - NK_ASSERT(items); - NK_ASSERT(ctx->current); - if (!ctx || !items ||!count) - return selected; - - item_spacing = ctx->style.window.spacing; - window_padding = nk_panel_get_padding(&ctx->style, ctx->current->layout->type); - max_height = count * item_height + count * (int)item_spacing.y; - max_height += (int)item_spacing.y * 2 + (int)window_padding.y * 2; - size.y = NK_MIN(size.y, (float)max_height); - if (nk_combo_begin_label(ctx, items[selected], size)) { - nk_layout_row_dynamic(ctx, (float)item_height, 1); - for (i = 0; i < count; ++i) { - if (nk_combo_item_label(ctx, items[i], NK_TEXT_LEFT)) - selected = i; - } - nk_combo_end(ctx); - } - return selected; -} -NK_API int -nk_combo_separator(struct nk_context *ctx, const char *items_separated_by_separator, - int separator, int selected, int count, int item_height, struct nk_vec2 size) -{ - int i; - int max_height; - struct nk_vec2 item_spacing; - struct nk_vec2 window_padding; - const char *current_item; - const char *iter; - int length = 0; - - NK_ASSERT(ctx); - NK_ASSERT(items_separated_by_separator); - if (!ctx || !items_separated_by_separator) - return selected; - - /* calculate popup window */ - item_spacing = ctx->style.window.spacing; - window_padding = nk_panel_get_padding(&ctx->style, ctx->current->layout->type); - max_height = count * item_height + count * (int)item_spacing.y; - max_height += (int)item_spacing.y * 2 + (int)window_padding.y * 2; - size.y = NK_MIN(size.y, (float)max_height); - - /* find selected item */ - current_item = items_separated_by_separator; - for (i = 0; i < count; ++i) { - iter = current_item; - while (*iter && *iter != separator) iter++; - length = (int)(iter - current_item); - if (i == selected) break; - current_item = iter + 1; - } - - if (nk_combo_begin_text(ctx, current_item, length, size)) { - current_item = items_separated_by_separator; - nk_layout_row_dynamic(ctx, (float)item_height, 1); - for (i = 0; i < count; ++i) { - iter = current_item; - while (*iter && *iter != separator) iter++; - length = (int)(iter - current_item); - if (nk_combo_item_text(ctx, current_item, length, NK_TEXT_LEFT)) - selected = i; - current_item = current_item + length + 1; - } - nk_combo_end(ctx); - } - return selected; -} -NK_API int -nk_combo_string(struct nk_context *ctx, const char *items_separated_by_zeros, - int selected, int count, int item_height, struct nk_vec2 size) -{ - return nk_combo_separator(ctx, items_separated_by_zeros, '\0', selected, count, item_height, size); -} -NK_API int -nk_combo_callback(struct nk_context *ctx, void(*item_getter)(void*, int, const char**), - void *userdata, int selected, int count, int item_height, struct nk_vec2 size) -{ - int i; - int max_height; - struct nk_vec2 item_spacing; - struct nk_vec2 window_padding; - const char *item; - - NK_ASSERT(ctx); - NK_ASSERT(item_getter); - if (!ctx || !item_getter) - return selected; - - /* calculate popup window */ - item_spacing = ctx->style.window.spacing; - window_padding = nk_panel_get_padding(&ctx->style, ctx->current->layout->type); - max_height = count * item_height + count * (int)item_spacing.y; - max_height += (int)item_spacing.y * 2 + (int)window_padding.y * 2; - size.y = NK_MIN(size.y, (float)max_height); - - item_getter(userdata, selected, &item); - if (nk_combo_begin_label(ctx, item, size)) { - nk_layout_row_dynamic(ctx, (float)item_height, 1); - for (i = 0; i < count; ++i) { - item_getter(userdata, i, &item); - if (nk_combo_item_label(ctx, item, NK_TEXT_LEFT)) - selected = i; - } - nk_combo_end(ctx); - } return selected; -} -NK_API void -nk_combobox(struct nk_context *ctx, const char **items, int count, - int *selected, int item_height, struct nk_vec2 size) -{ - *selected = nk_combo(ctx, items, count, *selected, item_height, size); -} -NK_API void -nk_combobox_string(struct nk_context *ctx, const char *items_separated_by_zeros, - int *selected, int count, int item_height, struct nk_vec2 size) -{ - *selected = nk_combo_string(ctx, items_separated_by_zeros, *selected, count, item_height, size); -} -NK_API void -nk_combobox_separator(struct nk_context *ctx, const char *items_separated_by_separator, - int separator,int *selected, int count, int item_height, struct nk_vec2 size) -{ - *selected = nk_combo_separator(ctx, items_separated_by_separator, separator, - *selected, count, item_height, size); -} -NK_API void -nk_combobox_callback(struct nk_context *ctx, - void(*item_getter)(void* data, int id, const char **out_text), - void *userdata, int *selected, int count, int item_height, struct nk_vec2 size) -{ - *selected = nk_combo_callback(ctx, item_getter, userdata, *selected, count, item_height, size); -} - - - - - -/* =============================================================== - * - * TOOLTIP - * - * ===============================================================*/ -NK_API int -nk_tooltip_begin(struct nk_context *ctx, float width) -{ - int x,y,w,h; - struct nk_window *win; - const struct nk_input *in; - struct nk_rect bounds; - int ret; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - if (!ctx || !ctx->current || !ctx->current->layout) - return 0; - - /* make sure that no nonblocking popup is currently active */ - win = ctx->current; - in = &ctx->input; - if (win->popup.win && (win->popup.type & NK_PANEL_SET_NONBLOCK)) - return 0; - - w = nk_iceilf(width); - h = nk_iceilf(nk_null_rect.h); - x = nk_ifloorf(in->mouse.pos.x + 1) - (int)win->layout->clip.x; - y = nk_ifloorf(in->mouse.pos.y + 1) - (int)win->layout->clip.y; - - bounds.x = (float)x; - bounds.y = (float)y; - bounds.w = (float)w; - bounds.h = (float)h; - - ret = nk_popup_begin(ctx, NK_POPUP_DYNAMIC, - "__##Tooltip##__", NK_WINDOW_NO_SCROLLBAR|NK_WINDOW_BORDER, bounds); - if (ret) win->layout->flags &= ~(nk_flags)NK_WINDOW_ROM; - win->popup.type = NK_PANEL_TOOLTIP; - ctx->current->layout->type = NK_PANEL_TOOLTIP; - return ret; -} - -NK_API void -nk_tooltip_end(struct nk_context *ctx) -{ - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - if (!ctx || !ctx->current) return; - ctx->current->seq--; - nk_popup_close(ctx); - nk_popup_end(ctx); -} -NK_API void -nk_tooltip(struct nk_context *ctx, const char *text) -{ - const struct nk_style *style; - struct nk_vec2 padding; - - int text_len; - float text_width; - float text_height; - - NK_ASSERT(ctx); - NK_ASSERT(ctx->current); - NK_ASSERT(ctx->current->layout); - NK_ASSERT(text); - if (!ctx || !ctx->current || !ctx->current->layout || !text) - return; - - /* fetch configuration data */ - style = &ctx->style; - padding = style->window.padding; - - /* calculate size of the text and tooltip */ - text_len = nk_strlen(text); - text_width = style->font->width(style->font->userdata, - style->font->height, text, text_len); - text_width += (4 * padding.x); - text_height = (style->font->height + 2 * padding.y); - - /* execute tooltip and fill with text */ - if (nk_tooltip_begin(ctx, (float)text_width)) { - nk_layout_row_dynamic(ctx, (float)text_height, 1); - nk_text(ctx, text, text_len, NK_TEXT_LEFT); - nk_tooltip_end(ctx); - } -} -#ifdef NK_INCLUDE_STANDARD_VARARGS -NK_API void -nk_tooltipf(struct nk_context *ctx, const char *fmt, ...) -{ - va_list args; - va_start(args, fmt); - nk_tooltipfv(ctx, fmt, args); - va_end(args); -} -NK_API void -nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args) -{ - char buf[256]; - nk_strfmt(buf, NK_LEN(buf), fmt, args); - nk_tooltip(ctx, buf); -} -#endif - - - -#endif /* NK_IMPLEMENTATION */ - -/* -/// ## License -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~none -/// ------------------------------------------------------------------------------ -/// This software is available under 2 licenses -- choose whichever you prefer. -/// ------------------------------------------------------------------------------ -/// ALTERNATIVE A - MIT License -/// Copyright (c) 2016-2018 Micha Mettke -/// Permission is hereby granted, free of charge, to any person obtaining a copy of -/// this software and associated documentation files (the "Software"), to deal in -/// the Software without restriction, including without limitation the rights to -/// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -/// of the Software, and to permit persons to whom the Software is furnished to do -/// so, subject to the following conditions: -/// The above copyright notice and this permission notice shall be included in all -/// copies or substantial portions of the Software. -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -/// SOFTWARE. -/// ------------------------------------------------------------------------------ -/// ALTERNATIVE B - Public Domain (www.unlicense.org) -/// This is free and unencumbered software released into the public domain. -/// Anyone is free to copy, modify, publish, use, compile, sell, or distribute this -/// software, either in source code form or as a compiled binary, for any purpose, -/// commercial or non-commercial, and by any means. -/// In jurisdictions that recognize copyright laws, the author or authors of this -/// software dedicate any and all copyright interest in the software to the public -/// domain. We make this dedication for the benefit of the public at large and to -/// the detriment of our heirs and successors. We intend this dedication to be an -/// overt act of relinquishment in perpetuity of all present and future rights to -/// this software under copyright law. -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -/// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -/// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -/// ------------------------------------------------------------------------------ -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -/// ## Changelog -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~none -/// [date][x.yy.zz]-[description] -/// -[date]: date on which the change has been pushed -/// -[x.yy.zz]: Numerical version string representation. Each version number on the right -/// resets back to zero if version on the left is incremented. -/// - [x]: Major version with API and library breaking changes -/// - [yy]: Minor version with non-breaking API and library changes -/// - [zz]: Bug fix version with no direct changes to API -/// -/// - 2019/09/20 (4.01.3) - Fixed a bug wherein combobox cannot be closed by clicking the header -/// when NK_BUTTON_TRIGGER_ON_RELEASE is defined. -/// - 2019/09/10 (4.01.2) - Fixed the nk_cos function, which deviated significantly. -/// - 2019/09/08 (4.01.1) - Fixed a bug wherein re-baking of fonts caused a segmentation -/// fault due to dst_font->glyph_count not being zeroed on subsequent -/// bakes of the same set of fonts. -/// - 2019/06/23 (4.01.0) - Added nk_***_get_scroll and nk_***_set_scroll for groups, windows, and popups. -/// - 2019/06/12 (4.00.3) - Fix panel background drawing bug. -/// - 2018/10/31 (4.00.2) - Added NK_KEYSTATE_BASED_INPUT to "fix" state based backends -/// like GLFW without breaking key repeat behavior on event based. -/// - 2018/04/01 (4.00.1) - Fixed calling `nk_convert` multiple time per single frame. -/// - 2018/04/01 (4.00.0) - BREAKING CHANGE: nk_draw_list_clear no longer tries to -/// clear provided buffers. So make sure to either free -/// or clear each passed buffer after calling nk_convert. -/// - 2018/02/23 (3.00.6) - Fixed slider dragging behavior. -/// - 2018/01/31 (3.00.5) - Fixed overcalculation of cursor data in font baking process. -/// - 2018/01/31 (3.00.4) - Removed name collision with stb_truetype. -/// - 2018/01/28 (3.00.3) - Fixed panel window border drawing bug. -/// - 2018/01/12 (3.00.2) - Added `nk_group_begin_titled` for separed group identifier and title. -/// - 2018/01/07 (3.00.1) - Started to change documentation style. -/// - 2018/01/05 (3.00.0) - BREAKING CHANGE: The previous color picker API was broken -/// because of conversions between float and byte color representation. -/// Color pickers now use floating point values to represent -/// HSV values. To get back the old behavior I added some additional -/// color conversion functions to cast between nk_color and -/// nk_colorf. -/// - 2017/12/23 (2.00.7) - Fixed small warning. -/// - 2017/12/23 (2.00.7) - Fixed `nk_edit_buffer` behavior if activated to allow input. -/// - 2017/12/23 (2.00.7) - Fixed modifyable progressbar dragging visuals and input behavior. -/// - 2017/12/04 (2.00.6) - Added formated string tooltip widget. -/// - 2017/11/18 (2.00.5) - Fixed window becoming hidden with flag `NK_WINDOW_NO_INPUT`. -/// - 2017/11/15 (2.00.4) - Fixed font merging. -/// - 2017/11/07 (2.00.3) - Fixed window size and position modifier functions. -/// - 2017/09/14 (2.00.2) - Fixed `nk_edit_buffer` and `nk_edit_focus` behavior. -/// - 2017/09/14 (2.00.1) - Fixed window closing behavior. -/// - 2017/09/14 (2.00.0) - BREAKING CHANGE: Modifing window position and size funtions now -/// require the name of the window and must happen outside the window -/// building process (between function call nk_begin and nk_end). -/// - 2017/09/11 (1.40.9) - Fixed window background flag if background window is declared last. -/// - 2017/08/27 (1.40.8) - Fixed `nk_item_is_any_active` for hidden windows. -/// - 2017/08/27 (1.40.7) - Fixed window background flag. -/// - 2017/07/07 (1.40.6) - Fixed missing clipping rect check for hovering/clicked -/// query for widgets. -/// - 2017/07/07 (1.40.5) - Fixed drawing bug for vertex output for lines and stroked -/// and filled rectangles. -/// - 2017/07/07 (1.40.4) - Fixed bug in nk_convert trying to add windows that are in -/// process of being destroyed. -/// - 2017/07/07 (1.40.3) - Fixed table internal bug caused by storing table size in -/// window instead of directly in table. -/// - 2017/06/30 (1.40.2) - Removed unneeded semicolon in C++ NK_ALIGNOF macro. -/// - 2017/06/30 (1.40.1) - Fixed drawing lines smaller or equal zero. -/// - 2017/06/08 (1.40.0) - Removed the breaking part of last commit. Auto layout now only -/// comes in effect if you pass in zero was row height argument. -/// - 2017/06/08 (1.40.0) - BREAKING CHANGE: while not directly API breaking it will change -/// how layouting works. From now there will be an internal minimum -/// row height derived from font height. If you need a row smaller than -/// that you can directly set it by `nk_layout_set_min_row_height` and -/// reset the value back by calling `nk_layout_reset_min_row_height. -/// - 2017/06/08 (1.39.1) - Fixed property text edit handling bug caused by past `nk_widget` fix. -/// - 2017/06/08 (1.39.0) - Added function to retrieve window space without calling a `nk_layout_xxx` function. -/// - 2017/06/06 (1.38.5) - Fixed `nk_convert` return flag for command buffer. -/// - 2017/05/23 (1.38.4) - Fixed activation behavior for widgets partially clipped. -/// - 2017/05/10 (1.38.3) - Fixed wrong min window size mouse scaling over boundries. -/// - 2017/05/09 (1.38.2) - Fixed vertical scrollbar drawing with not enough space. -/// - 2017/05/09 (1.38.1) - Fixed scaler dragging behavior if window size hits minimum size. -/// - 2017/05/06 (1.38.0) - Added platform double-click support. -/// - 2017/04/20 (1.37.1) - Fixed key repeat found inside glfw demo backends. -/// - 2017/04/20 (1.37.0) - Extended properties with selection and clipboard support. -/// - 2017/04/20 (1.36.2) - Fixed #405 overlapping rows with zero padding and spacing. -/// - 2017/04/09 (1.36.1) - Fixed #403 with another widget float error. -/// - 2017/04/09 (1.36.0) - Added window `NK_WINDOW_NO_INPUT` and `NK_WINDOW_NOT_INTERACTIVE` flags. -/// - 2017/04/09 (1.35.3) - Fixed buffer heap corruption. -/// - 2017/03/25 (1.35.2) - Fixed popup overlapping for `NK_WINDOW_BACKGROUND` windows. -/// - 2017/03/25 (1.35.1) - Fixed windows closing behavior. -/// - 2017/03/18 (1.35.0) - Added horizontal scroll requested in #377. -/// - 2017/03/18 (1.34.3) - Fixed long window header titles. -/// - 2017/03/04 (1.34.2) - Fixed text edit filtering. -/// - 2017/03/04 (1.34.1) - Fixed group closable flag. -/// - 2017/02/25 (1.34.0) - Added custom draw command for better language binding support. -/// - 2017/01/24 (1.33.0) - Added programatic way of remove edit focus. -/// - 2017/01/24 (1.32.3) - Fixed wrong define for basic type definitions for windows. -/// - 2017/01/21 (1.32.2) - Fixed input capture from hidden or closed windows. -/// - 2017/01/21 (1.32.1) - Fixed slider behavior and drawing. -/// - 2017/01/13 (1.32.0) - Added flag to put scaler into the bottom left corner. -/// - 2017/01/13 (1.31.0) - Added additional row layouting method to combine both -/// dynamic and static widgets. -/// - 2016/12/31 (1.30.0) - Extended scrollbar offset from 16-bit to 32-bit. -/// - 2016/12/31 (1.29.2) - Fixed closing window bug of minimized windows. -/// - 2016/12/03 (1.29.1) - Fixed wrapped text with no seperator and C89 error. -/// - 2016/12/03 (1.29.0) - Changed text wrapping to process words not characters. -/// - 2016/11/22 (1.28.6) - Fixed window minimized closing bug. -/// - 2016/11/19 (1.28.5) - Fixed abstract combo box closing behavior. -/// - 2016/11/19 (1.28.4) - Fixed tooltip flickering. -/// - 2016/11/19 (1.28.3) - Fixed memory leak caused by popup repeated closing. -/// - 2016/11/18 (1.28.2) - Fixed memory leak caused by popup panel allocation. -/// - 2016/11/10 (1.28.1) - Fixed some warnings and C++ error. -/// - 2016/11/10 (1.28.0) - Added additional `nk_button` versions which allows to directly -/// pass in a style struct to change buttons visual. -/// - 2016/11/10 (1.27.0) - Added additional `nk_tree` versions to support external state -/// storage. Just like last the `nk_group` commit the main -/// advantage is that you optionally can minimize nuklears runtime -/// memory consumption or handle hash collisions. -/// - 2016/11/09 (1.26.0) - Added additional `nk_group` version to support external scrollbar -/// offset storage. Main advantage is that you can externalize -/// the memory management for the offset. It could also be helpful -/// if you have a hash collision in `nk_group_begin` but really -/// want the name. In addition I added `nk_list_view` which allows -/// to draw big lists inside a group without actually having to -/// commit the whole list to nuklear (issue #269). -/// - 2016/10/30 (1.25.1) - Fixed clipping rectangle bug inside `nk_draw_list`. -/// - 2016/10/29 (1.25.0) - Pulled `nk_panel` memory management into nuklear and out of -/// the hands of the user. From now on users don't have to care -/// about panels unless they care about some information. If you -/// still need the panel just call `nk_window_get_panel`. -/// - 2016/10/21 (1.24.0) - Changed widget border drawing to stroked rectangle from filled -/// rectangle for less overdraw and widget background transparency. -/// - 2016/10/18 (1.23.0) - Added `nk_edit_focus` for manually edit widget focus control. -/// - 2016/09/29 (1.22.7) - Fixed deduction of basic type in non `` compilation. -/// - 2016/09/29 (1.22.6) - Fixed edit widget UTF-8 text cursor drawing bug. -/// - 2016/09/28 (1.22.5) - Fixed edit widget UTF-8 text appending/inserting/removing. -/// - 2016/09/28 (1.22.4) - Fixed drawing bug inside edit widgets which offset all text -/// text in every edit widget if one of them is scrolled. -/// - 2016/09/28 (1.22.3) - Fixed small bug in edit widgets if not active. The wrong -/// text length is passed. It should have been in bytes but -/// was passed as glyphes. -/// - 2016/09/20 (1.22.2) - Fixed color button size calculation. -/// - 2016/09/20 (1.22.1) - Fixed some `nk_vsnprintf` behavior bugs and removed `` -/// again from `NK_INCLUDE_STANDARD_VARARGS`. -/// - 2016/09/18 (1.22.0) - C89 does not support vsnprintf only C99 and newer as well -/// as C++11 and newer. In addition to use vsnprintf you have -/// to include . So just defining `NK_INCLUDE_STD_VAR_ARGS` -/// is not enough. That behavior is now fixed. By default if -/// both varargs as well as stdio is selected I try to use -/// vsnprintf if not possible I will revert to vsprintf. If -/// varargs but not stdio was defined I will use my own function. -/// - 2016/09/15 (1.21.2) - Fixed panel `close` behavior for deeper panel levels. -/// - 2016/09/15 (1.21.1) - Fixed C++ errors and wrong argument to `nk_panel_get_xxxx`. -/// - 2016/09/13 (1.21.0) - !BREAKING! Fixed nonblocking popup behavior in menu, combo, -/// and contextual which prevented closing in y-direction if -/// popup did not reach max height. -/// In addition the height parameter was changed into vec2 -/// for width and height to have more control over the popup size. -/// - 2016/09/13 (1.20.3) - Cleaned up and extended type selection. -/// - 2016/09/13 (1.20.2) - Fixed slider behavior hopefully for the last time. This time -/// all calculation are correct so no more hackery. -/// - 2016/09/13 (1.20.1) - Internal change to divide window/panel flags into panel flags and types. -/// Suprisinly spend years in C and still happened to confuse types -/// with flags. Probably something to take note. -/// - 2016/09/08 (1.20.0) - Added additional helper function to make it easier to just -/// take the produced buffers from `nk_convert` and unplug the -/// iteration process from `nk_context`. So now you can -/// just use the vertex,element and command buffer + two pointer -/// inside the command buffer retrieved by calls `nk__draw_begin` -/// and `nk__draw_end` and macro `nk_draw_foreach_bounded`. -/// - 2016/09/08 (1.19.0) - Added additional asserts to make sure every `nk_xxx_begin` call -/// for windows, popups, combobox, menu and contextual is guarded by -/// `if` condition and does not produce false drawing output. -/// - 2016/09/08 (1.18.0) - Changed confusing name for `NK_SYMBOL_RECT_FILLED`, `NK_SYMBOL_RECT` -/// to hopefully easier to understand `NK_SYMBOL_RECT_FILLED` and -/// `NK_SYMBOL_RECT_OUTLINE`. -/// - 2016/09/08 (1.17.0) - Changed confusing name for `NK_SYMBOL_CIRLCE_FILLED`, `NK_SYMBOL_CIRCLE` -/// to hopefully easier to understand `NK_SYMBOL_CIRCLE_FILLED` and -/// `NK_SYMBOL_CIRCLE_OUTLINE`. -/// - 2016/09/08 (1.16.0) - Added additional checks to select correct types if `NK_INCLUDE_FIXED_TYPES` -/// is not defined by supporting the biggest compiler GCC, clang and MSVC. -/// - 2016/09/07 (1.15.3) - Fixed `NK_INCLUDE_COMMAND_USERDATA` define to not cause an error. -/// - 2016/09/04 (1.15.2) - Fixed wrong combobox height calculation. -/// - 2016/09/03 (1.15.1) - Fixed gaps inside combo boxes in OpenGL. -/// - 2016/09/02 (1.15.0) - Changed nuklear to not have any default vertex layout and -/// instead made it user provided. The range of types to convert -/// to is quite limited at the moment, but I would be more than -/// happy to accept PRs to add additional. -/// - 2016/08/30 (1.14.2) - Removed unused variables. -/// - 2016/08/30 (1.14.1) - Fixed C++ build errors. -/// - 2016/08/30 (1.14.0) - Removed mouse dragging from SDL demo since it does not work correctly. -/// - 2016/08/30 (1.13.4) - Tweaked some default styling variables. -/// - 2016/08/30 (1.13.3) - Hopefully fixed drawing bug in slider, in general I would -/// refrain from using slider with a big number of steps. -/// - 2016/08/30 (1.13.2) - Fixed close and minimize button which would fire even if the -/// window was in Read Only Mode. -/// - 2016/08/30 (1.13.1) - Fixed popup panel padding handling which was previously just -/// a hack for combo box and menu. -/// - 2016/08/30 (1.13.0) - Removed `NK_WINDOW_DYNAMIC` flag from public API since -/// it is bugged and causes issues in window selection. -/// - 2016/08/30 (1.12.0) - Removed scaler size. The size of the scaler is now -/// determined by the scrollbar size. -/// - 2016/08/30 (1.11.2) - Fixed some drawing bugs caused by changes from 1.11.0. -/// - 2016/08/30 (1.11.1) - Fixed overlapping minimized window selection. -/// - 2016/08/30 (1.11.0) - Removed some internal complexity and overly complex code -/// handling panel padding and panel border. -/// - 2016/08/29 (1.10.0) - Added additional height parameter to `nk_combobox_xxx`. -/// - 2016/08/29 (1.10.0) - Fixed drawing bug in dynamic popups. -/// - 2016/08/29 (1.10.0) - Added experimental mouse scrolling to popups, menus and comboboxes. -/// - 2016/08/26 (1.10.0) - Added window name string prepresentation to account for -/// hash collisions. Currently limited to `NK_WINDOW_MAX_NAME` -/// which in term can be redefined if not big enough. -/// - 2016/08/26 (1.10.0) - Added stacks for temporary style/UI changes in code. -/// - 2016/08/25 (1.10.0) - Changed `nk_input_is_key_pressed` and 'nk_input_is_key_released' -/// to account for key press and release happening in one frame. -/// - 2016/08/25 (1.10.0) - Added additional nk_edit flag to directly jump to the end on activate. -/// - 2016/08/17 (1.09.6) - Removed invalid check for value zero in `nk_propertyx`. -/// - 2016/08/16 (1.09.5) - Fixed ROM mode for deeper levels of popup windows parents. -/// - 2016/08/15 (1.09.4) - Editbox are now still active if enter was pressed with flag -/// `NK_EDIT_SIG_ENTER`. Main reasoning is to be able to keep -/// typing after commiting. -/// - 2016/08/15 (1.09.4) - Removed redundant code. -/// - 2016/08/15 (1.09.4) - Fixed negative numbers in `nk_strtoi` and remove unused variable. -/// - 2016/08/15 (1.09.3) - Fixed `NK_WINDOW_BACKGROUND` flag behavior to select a background -/// window only as selected by hovering and not by clicking. -/// - 2016/08/14 (1.09.2) - Fixed a bug in font atlas which caused wrong loading -/// of glyphes for font with multiple ranges. -/// - 2016/08/12 (1.09.1) - Added additional function to check if window is currently -/// hidden and therefore not visible. -/// - 2016/08/12 (1.09.1) - nk_window_is_closed now queries the correct flag `NK_WINDOW_CLOSED` -/// instead of the old flag `NK_WINDOW_HIDDEN`. -/// - 2016/08/09 (1.09.0) - Added additional double version to nk_property and changed -/// the underlying implementation to not cast to float and instead -/// work directly on the given values. -/// - 2016/08/09 (1.08.0) - Added additional define to overwrite library internal -/// floating pointer number to string conversion for additional -/// precision. -/// - 2016/08/09 (1.08.0) - Added additional define to overwrite library internal -/// string to floating point number conversion for additional -/// precision. -/// - 2016/08/08 (1.07.2) - Fixed compiling error without define `NK_INCLUDE_FIXED_TYPE`. -/// - 2016/08/08 (1.07.1) - Fixed possible floating point error inside `nk_widget` leading -/// to wrong wiget width calculation which results in widgets falsly -/// becomming tagged as not inside window and cannot be accessed. -/// - 2016/08/08 (1.07.0) - Nuklear now differentiates between hiding a window (NK_WINDOW_HIDDEN) and -/// closing a window (NK_WINDOW_CLOSED). A window can be hidden/shown -/// by using `nk_window_show` and closed by either clicking the close -/// icon in a window or by calling `nk_window_close`. Only closed -/// windows get removed at the end of the frame while hidden windows -/// remain. -/// - 2016/08/08 (1.06.0) - Added `nk_edit_string_zero_terminated` as a second option to -/// `nk_edit_string` which takes, edits and outputs a '\0' terminated string. -/// - 2016/08/08 (1.05.4) - Fixed scrollbar auto hiding behavior. -/// - 2016/08/08 (1.05.3) - Fixed wrong panel padding selection in `nk_layout_widget_space`. -/// - 2016/08/07 (1.05.2) - Fixed old bug in dynamic immediate mode layout API, calculating -/// wrong item spacing and panel width. -/// - 2016/08/07 (1.05.1) - Hopefully finally fixed combobox popup drawing bug. -/// - 2016/08/07 (1.05.0) - Split varargs away from `NK_INCLUDE_STANDARD_IO` into own -/// define `NK_INCLUDE_STANDARD_VARARGS` to allow more fine -/// grained controlled over library includes. -/// - 2016/08/06 (1.04.5) - Changed memset calls to `NK_MEMSET`. -/// - 2016/08/04 (1.04.4) - Fixed fast window scaling behavior. -/// - 2016/08/04 (1.04.3) - Fixed window scaling, movement bug which appears if you -/// move/scale a window and another window is behind it. -/// If you are fast enough then the window behind gets activated -/// and the operation is blocked. I now require activating -/// by hovering only if mouse is not pressed. -/// - 2016/08/04 (1.04.2) - Fixed changing fonts. -/// - 2016/08/03 (1.04.1) - Fixed `NK_WINDOW_BACKGROUND` behavior. -/// - 2016/08/03 (1.04.0) - Added color parameter to `nk_draw_image`. -/// - 2016/08/03 (1.04.0) - Added additional window padding style attributes for -/// sub windows (combo, menu, ...). -/// - 2016/08/03 (1.04.0) - Added functions to show/hide software cursor. -/// - 2016/08/03 (1.04.0) - Added `NK_WINDOW_BACKGROUND` flag to force a window -/// to be always in the background of the screen. -/// - 2016/08/03 (1.03.2) - Removed invalid assert macro for NK_RGB color picker. -/// - 2016/08/01 (1.03.1) - Added helper macros into header include guard. -/// - 2016/07/29 (1.03.0) - Moved the window/table pool into the header part to -/// simplify memory management by removing the need to -/// allocate the pool. -/// - 2016/07/29 (1.02.0) - Added auto scrollbar hiding window flag which if enabled -/// will hide the window scrollbar after NK_SCROLLBAR_HIDING_TIMEOUT -/// seconds without window interaction. To make it work -/// you have to also set a delta time inside the `nk_context`. -/// - 2016/07/25 (1.01.1) - Fixed small panel and panel border drawing bugs. -/// - 2016/07/15 (1.01.0) - Added software cursor to `nk_style` and `nk_context`. -/// - 2016/07/15 (1.01.0) - Added const correctness to `nk_buffer_push' data argument. -/// - 2016/07/15 (1.01.0) - Removed internal font baking API and simplified -/// font atlas memory management by converting pointer -/// arrays for fonts and font configurations to lists. -/// - 2016/07/15 (1.00.0) - Changed button API to use context dependend button -/// behavior instead of passing it for every function call. -/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/// ## Gallery -/// ![Figure [blue]: Feature overview with blue color styling](https://cloud.githubusercontent.com/assets/8057201/13538240/acd96876-e249-11e5-9547-5ac0b19667a0.png) -/// ![Figure [red]: Feature overview with red color styling](https://cloud.githubusercontent.com/assets/8057201/13538243/b04acd4c-e249-11e5-8fd2-ad7744a5b446.png) -/// ![Figure [widgets]: Widget overview](https://cloud.githubusercontent.com/assets/8057201/11282359/3325e3c6-8eff-11e5-86cb-cf02b0596087.png) -/// ![Figure [blackwhite]: Black and white](https://cloud.githubusercontent.com/assets/8057201/11033668/59ab5d04-86e5-11e5-8091-c56f16411565.png) -/// ![Figure [filexp]: File explorer](https://cloud.githubusercontent.com/assets/8057201/10718115/02a9ba08-7b6b-11e5-950f-adacdd637739.png) -/// ![Figure [opengl]: OpenGL Editor](https://cloud.githubusercontent.com/assets/8057201/12779619/2a20d72c-ca69-11e5-95fe-4edecf820d5c.png) -/// ![Figure [nodedit]: Node Editor](https://cloud.githubusercontent.com/assets/8057201/9976995/e81ac04a-5ef7-11e5-872b-acd54fbeee03.gif) -/// ![Figure [skinning]: Using skinning in Nuklear](https://cloud.githubusercontent.com/assets/8057201/15991632/76494854-30b8-11e6-9555-a69840d0d50b.png) -/// ![Figure [bf]: Heavy modified version](https://cloud.githubusercontent.com/assets/8057201/14902576/339926a8-0d9c-11e6-9fee-a8b73af04473.png) -/// -/// ## Credits -/// Developed by Micha Mettke and every direct or indirect github contributor.

-/// -/// Embeds [stb_texedit](https://github.com/nothings/stb/blob/master/stb_textedit.h), [stb_truetype](https://github.com/nothings/stb/blob/master/stb_truetype.h) and [stb_rectpack](https://github.com/nothings/stb/blob/master/stb_rect_pack.h) by Sean Barret (public domain)
-/// Uses [stddoc.c](https://github.com/r-lyeh/stddoc.c) from r-lyeh@github.com for documentation generation

-/// Embeds ProggyClean.ttf font by Tristan Grimmer (MIT license).
-/// -/// Big thank you to Omar Cornut (ocornut@github) for his [imgui library](https://github.com/ocornut/imgui) and -/// giving me the inspiration for this library, Casey Muratori for handmade hero -/// and his original immediate mode graphical user interface idea and Sean -/// Barret for his amazing single header libraries which restored my faith -/// in libraries and brought me to create some of my own. Finally Apoorva Joshi -/// for his single header file packer. -*/ - diff --git a/3rdparty/glfw/source/deps/nuklear_glfw_gl2.h b/3rdparty/glfw/source/deps/nuklear_glfw_gl2.h deleted file mode 100644 index a959b14..0000000 --- a/3rdparty/glfw/source/deps/nuklear_glfw_gl2.h +++ /dev/null @@ -1,381 +0,0 @@ -/* - * Nuklear - v1.32.0 - public domain - * no warrenty implied; use at your own risk. - * authored from 2015-2017 by Micha Mettke - */ -/* - * ============================================================== - * - * API - * - * =============================================================== - */ -#ifndef NK_GLFW_GL2_H_ -#define NK_GLFW_GL2_H_ - -#include - -enum nk_glfw_init_state{ - NK_GLFW3_DEFAULT = 0, - NK_GLFW3_INSTALL_CALLBACKS -}; -NK_API struct nk_context* nk_glfw3_init(GLFWwindow *win, enum nk_glfw_init_state); -NK_API void nk_glfw3_font_stash_begin(struct nk_font_atlas **atlas); -NK_API void nk_glfw3_font_stash_end(void); - -NK_API void nk_glfw3_new_frame(void); -NK_API void nk_glfw3_render(enum nk_anti_aliasing); -NK_API void nk_glfw3_shutdown(void); - -NK_API void nk_glfw3_char_callback(GLFWwindow *win, unsigned int codepoint); -NK_API void nk_gflw3_scroll_callback(GLFWwindow *win, double xoff, double yoff); - -#endif - -/* - * ============================================================== - * - * IMPLEMENTATION - * - * =============================================================== - */ -#ifdef NK_GLFW_GL2_IMPLEMENTATION - -#ifndef NK_GLFW_TEXT_MAX -#define NK_GLFW_TEXT_MAX 256 -#endif -#ifndef NK_GLFW_DOUBLE_CLICK_LO -#define NK_GLFW_DOUBLE_CLICK_LO 0.02 -#endif -#ifndef NK_GLFW_DOUBLE_CLICK_HI -#define NK_GLFW_DOUBLE_CLICK_HI 0.2 -#endif - -struct nk_glfw_device { - struct nk_buffer cmds; - struct nk_draw_null_texture null; - GLuint font_tex; -}; - -struct nk_glfw_vertex { - float position[2]; - float uv[2]; - nk_byte col[4]; -}; - -static struct nk_glfw { - GLFWwindow *win; - int width, height; - int display_width, display_height; - struct nk_glfw_device ogl; - struct nk_context ctx; - struct nk_font_atlas atlas; - struct nk_vec2 fb_scale; - unsigned int text[NK_GLFW_TEXT_MAX]; - int text_len; - struct nk_vec2 scroll; - double last_button_click; - int is_double_click_down; - struct nk_vec2 double_click_pos; -} glfw; - -NK_INTERN void -nk_glfw3_device_upload_atlas(const void *image, int width, int height) -{ - struct nk_glfw_device *dev = &glfw.ogl; - glGenTextures(1, &dev->font_tex); - glBindTexture(GL_TEXTURE_2D, dev->font_tex); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, (GLsizei)width, (GLsizei)height, 0, - GL_RGBA, GL_UNSIGNED_BYTE, image); -} - -NK_API void -nk_glfw3_render(enum nk_anti_aliasing AA) -{ - /* setup global state */ - struct nk_glfw_device *dev = &glfw.ogl; - glPushAttrib(GL_ENABLE_BIT|GL_COLOR_BUFFER_BIT|GL_TRANSFORM_BIT); - glDisable(GL_CULL_FACE); - glDisable(GL_DEPTH_TEST); - glEnable(GL_SCISSOR_TEST); - glEnable(GL_BLEND); - glEnable(GL_TEXTURE_2D); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - /* setup viewport/project */ - glViewport(0,0,(GLsizei)glfw.display_width,(GLsizei)glfw.display_height); - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadIdentity(); - glOrtho(0.0f, glfw.width, glfw.height, 0.0f, -1.0f, 1.0f); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - glLoadIdentity(); - - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glEnableClientState(GL_COLOR_ARRAY); - { - GLsizei vs = sizeof(struct nk_glfw_vertex); - size_t vp = offsetof(struct nk_glfw_vertex, position); - size_t vt = offsetof(struct nk_glfw_vertex, uv); - size_t vc = offsetof(struct nk_glfw_vertex, col); - - /* convert from command queue into draw list and draw to screen */ - const struct nk_draw_command *cmd; - const nk_draw_index *offset = NULL; - struct nk_buffer vbuf, ebuf; - - /* fill convert configuration */ - struct nk_convert_config config; - static const struct nk_draw_vertex_layout_element vertex_layout[] = { - {NK_VERTEX_POSITION, NK_FORMAT_FLOAT, NK_OFFSETOF(struct nk_glfw_vertex, position)}, - {NK_VERTEX_TEXCOORD, NK_FORMAT_FLOAT, NK_OFFSETOF(struct nk_glfw_vertex, uv)}, - {NK_VERTEX_COLOR, NK_FORMAT_R8G8B8A8, NK_OFFSETOF(struct nk_glfw_vertex, col)}, - {NK_VERTEX_LAYOUT_END} - }; - NK_MEMSET(&config, 0, sizeof(config)); - config.vertex_layout = vertex_layout; - config.vertex_size = sizeof(struct nk_glfw_vertex); - config.vertex_alignment = NK_ALIGNOF(struct nk_glfw_vertex); - config.null = dev->null; - config.circle_segment_count = 22; - config.curve_segment_count = 22; - config.arc_segment_count = 22; - config.global_alpha = 1.0f; - config.shape_AA = AA; - config.line_AA = AA; - - /* convert shapes into vertexes */ - nk_buffer_init_default(&vbuf); - nk_buffer_init_default(&ebuf); - nk_convert(&glfw.ctx, &dev->cmds, &vbuf, &ebuf, &config); - - /* setup vertex buffer pointer */ - {const void *vertices = nk_buffer_memory_const(&vbuf); - glVertexPointer(2, GL_FLOAT, vs, (const void*)((const nk_byte*)vertices + vp)); - glTexCoordPointer(2, GL_FLOAT, vs, (const void*)((const nk_byte*)vertices + vt)); - glColorPointer(4, GL_UNSIGNED_BYTE, vs, (const void*)((const nk_byte*)vertices + vc));} - - /* iterate over and execute each draw command */ - offset = (const nk_draw_index*)nk_buffer_memory_const(&ebuf); - nk_draw_foreach(cmd, &glfw.ctx, &dev->cmds) - { - if (!cmd->elem_count) continue; - glBindTexture(GL_TEXTURE_2D, (GLuint)cmd->texture.id); - glScissor( - (GLint)(cmd->clip_rect.x * glfw.fb_scale.x), - (GLint)((glfw.height - (GLint)(cmd->clip_rect.y + cmd->clip_rect.h)) * glfw.fb_scale.y), - (GLint)(cmd->clip_rect.w * glfw.fb_scale.x), - (GLint)(cmd->clip_rect.h * glfw.fb_scale.y)); - glDrawElements(GL_TRIANGLES, (GLsizei)cmd->elem_count, GL_UNSIGNED_SHORT, offset); - offset += cmd->elem_count; - } - nk_clear(&glfw.ctx); - nk_buffer_free(&vbuf); - nk_buffer_free(&ebuf); - } - - /* default OpenGL state */ - glDisableClientState(GL_VERTEX_ARRAY); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - glDisableClientState(GL_COLOR_ARRAY); - - glDisable(GL_CULL_FACE); - glDisable(GL_DEPTH_TEST); - glDisable(GL_SCISSOR_TEST); - glDisable(GL_BLEND); - glDisable(GL_TEXTURE_2D); - - glBindTexture(GL_TEXTURE_2D, 0); - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); - glMatrixMode(GL_PROJECTION); - glPopMatrix(); - glPopAttrib(); -} - -NK_API void -nk_glfw3_char_callback(GLFWwindow *win, unsigned int codepoint) -{ - (void)win; - if (glfw.text_len < NK_GLFW_TEXT_MAX) - glfw.text[glfw.text_len++] = codepoint; -} - -NK_API void -nk_gflw3_scroll_callback(GLFWwindow *win, double xoff, double yoff) -{ - (void)win; (void)xoff; - glfw.scroll.x += (float)xoff; - glfw.scroll.y += (float)yoff; -} - -NK_API void -nk_glfw3_mouse_button_callback(GLFWwindow* window, int button, int action, int mods) -{ - double x, y; - if (button != GLFW_MOUSE_BUTTON_LEFT) return; - glfwGetCursorPos(window, &x, &y); - if (action == GLFW_PRESS) { - double dt = glfwGetTime() - glfw.last_button_click; - if (dt > NK_GLFW_DOUBLE_CLICK_LO && dt < NK_GLFW_DOUBLE_CLICK_HI) { - glfw.is_double_click_down = nk_true; - glfw.double_click_pos = nk_vec2((float)x, (float)y); - } - glfw.last_button_click = glfwGetTime(); - } else glfw.is_double_click_down = nk_false; -} - -NK_INTERN void -nk_glfw3_clipboard_paste(nk_handle usr, struct nk_text_edit *edit) -{ - const char *text = glfwGetClipboardString(glfw.win); - if (text) nk_textedit_paste(edit, text, nk_strlen(text)); - (void)usr; -} - -NK_INTERN void -nk_glfw3_clipboard_copy(nk_handle usr, const char *text, int len) -{ - char *str = 0; - (void)usr; - if (!len) return; - str = (char*)malloc((size_t)len+1); - if (!str) return; - NK_MEMCPY(str, text, (size_t)len); - str[len] = '\0'; - glfwSetClipboardString(glfw.win, str); - free(str); -} - -NK_API struct nk_context* -nk_glfw3_init(GLFWwindow *win, enum nk_glfw_init_state init_state) -{ - glfw.win = win; - if (init_state == NK_GLFW3_INSTALL_CALLBACKS) { - glfwSetScrollCallback(win, nk_gflw3_scroll_callback); - glfwSetCharCallback(win, nk_glfw3_char_callback); - glfwSetMouseButtonCallback(win, nk_glfw3_mouse_button_callback); - } - nk_init_default(&glfw.ctx, 0); - glfw.ctx.clip.copy = nk_glfw3_clipboard_copy; - glfw.ctx.clip.paste = nk_glfw3_clipboard_paste; - glfw.ctx.clip.userdata = nk_handle_ptr(0); - nk_buffer_init_default(&glfw.ogl.cmds); - - glfw.is_double_click_down = nk_false; - glfw.double_click_pos = nk_vec2(0, 0); - - return &glfw.ctx; -} - -NK_API void -nk_glfw3_font_stash_begin(struct nk_font_atlas **atlas) -{ - nk_font_atlas_init_default(&glfw.atlas); - nk_font_atlas_begin(&glfw.atlas); - *atlas = &glfw.atlas; -} - -NK_API void -nk_glfw3_font_stash_end(void) -{ - const void *image; int w, h; - image = nk_font_atlas_bake(&glfw.atlas, &w, &h, NK_FONT_ATLAS_RGBA32); - nk_glfw3_device_upload_atlas(image, w, h); - nk_font_atlas_end(&glfw.atlas, nk_handle_id((int)glfw.ogl.font_tex), &glfw.ogl.null); - if (glfw.atlas.default_font) - nk_style_set_font(&glfw.ctx, &glfw.atlas.default_font->handle); -} - -NK_API void -nk_glfw3_new_frame(void) -{ - int i; - double x, y; - struct nk_context *ctx = &glfw.ctx; - struct GLFWwindow *win = glfw.win; - - glfwGetWindowSize(win, &glfw.width, &glfw.height); - glfwGetFramebufferSize(win, &glfw.display_width, &glfw.display_height); - glfw.fb_scale.x = (float)glfw.display_width/(float)glfw.width; - glfw.fb_scale.y = (float)glfw.display_height/(float)glfw.height; - - nk_input_begin(ctx); - for (i = 0; i < glfw.text_len; ++i) - nk_input_unicode(ctx, glfw.text[i]); - - /* optional grabbing behavior */ - if (ctx->input.mouse.grab) - glfwSetInputMode(glfw.win, GLFW_CURSOR, GLFW_CURSOR_HIDDEN); - else if (ctx->input.mouse.ungrab) - glfwSetInputMode(glfw.win, GLFW_CURSOR, GLFW_CURSOR_NORMAL); - - nk_input_key(ctx, NK_KEY_DEL, glfwGetKey(win, GLFW_KEY_DELETE) == GLFW_PRESS); - nk_input_key(ctx, NK_KEY_ENTER, glfwGetKey(win, GLFW_KEY_ENTER) == GLFW_PRESS); - nk_input_key(ctx, NK_KEY_TAB, glfwGetKey(win, GLFW_KEY_TAB) == GLFW_PRESS); - nk_input_key(ctx, NK_KEY_BACKSPACE, glfwGetKey(win, GLFW_KEY_BACKSPACE) == GLFW_PRESS); - nk_input_key(ctx, NK_KEY_UP, glfwGetKey(win, GLFW_KEY_UP) == GLFW_PRESS); - nk_input_key(ctx, NK_KEY_DOWN, glfwGetKey(win, GLFW_KEY_DOWN) == GLFW_PRESS); - nk_input_key(ctx, NK_KEY_TEXT_START, glfwGetKey(win, GLFW_KEY_HOME) == GLFW_PRESS); - nk_input_key(ctx, NK_KEY_TEXT_END, glfwGetKey(win, GLFW_KEY_END) == GLFW_PRESS); - nk_input_key(ctx, NK_KEY_SCROLL_START, glfwGetKey(win, GLFW_KEY_HOME) == GLFW_PRESS); - nk_input_key(ctx, NK_KEY_SCROLL_END, glfwGetKey(win, GLFW_KEY_END) == GLFW_PRESS); - nk_input_key(ctx, NK_KEY_SCROLL_DOWN, glfwGetKey(win, GLFW_KEY_PAGE_DOWN) == GLFW_PRESS); - nk_input_key(ctx, NK_KEY_SCROLL_UP, glfwGetKey(win, GLFW_KEY_PAGE_UP) == GLFW_PRESS); - nk_input_key(ctx, NK_KEY_SHIFT, glfwGetKey(win, GLFW_KEY_LEFT_SHIFT) == GLFW_PRESS|| - glfwGetKey(win, GLFW_KEY_RIGHT_SHIFT) == GLFW_PRESS); - - if (glfwGetKey(win, GLFW_KEY_LEFT_CONTROL) == GLFW_PRESS || - glfwGetKey(win, GLFW_KEY_RIGHT_CONTROL) == GLFW_PRESS) { - nk_input_key(ctx, NK_KEY_COPY, glfwGetKey(win, GLFW_KEY_C) == GLFW_PRESS); - nk_input_key(ctx, NK_KEY_PASTE, glfwGetKey(win, GLFW_KEY_V) == GLFW_PRESS); - nk_input_key(ctx, NK_KEY_CUT, glfwGetKey(win, GLFW_KEY_X) == GLFW_PRESS); - nk_input_key(ctx, NK_KEY_TEXT_UNDO, glfwGetKey(win, GLFW_KEY_Z) == GLFW_PRESS); - nk_input_key(ctx, NK_KEY_TEXT_REDO, glfwGetKey(win, GLFW_KEY_R) == GLFW_PRESS); - nk_input_key(ctx, NK_KEY_TEXT_WORD_LEFT, glfwGetKey(win, GLFW_KEY_LEFT) == GLFW_PRESS); - nk_input_key(ctx, NK_KEY_TEXT_WORD_RIGHT, glfwGetKey(win, GLFW_KEY_RIGHT) == GLFW_PRESS); - nk_input_key(ctx, NK_KEY_TEXT_LINE_START, glfwGetKey(win, GLFW_KEY_B) == GLFW_PRESS); - nk_input_key(ctx, NK_KEY_TEXT_LINE_END, glfwGetKey(win, GLFW_KEY_E) == GLFW_PRESS); - } else { - nk_input_key(ctx, NK_KEY_LEFT, glfwGetKey(win, GLFW_KEY_LEFT) == GLFW_PRESS); - nk_input_key(ctx, NK_KEY_RIGHT, glfwGetKey(win, GLFW_KEY_RIGHT) == GLFW_PRESS); - nk_input_key(ctx, NK_KEY_COPY, 0); - nk_input_key(ctx, NK_KEY_PASTE, 0); - nk_input_key(ctx, NK_KEY_CUT, 0); - nk_input_key(ctx, NK_KEY_SHIFT, 0); - } - - glfwGetCursorPos(win, &x, &y); - nk_input_motion(ctx, (int)x, (int)y); - if (ctx->input.mouse.grabbed) { - glfwSetCursorPos(glfw.win, (double)ctx->input.mouse.prev.x, (double)ctx->input.mouse.prev.y); - ctx->input.mouse.pos.x = ctx->input.mouse.prev.x; - ctx->input.mouse.pos.y = ctx->input.mouse.prev.y; - } - - nk_input_button(ctx, NK_BUTTON_LEFT, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_LEFT) == GLFW_PRESS); - nk_input_button(ctx, NK_BUTTON_MIDDLE, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_MIDDLE) == GLFW_PRESS); - nk_input_button(ctx, NK_BUTTON_RIGHT, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_RIGHT) == GLFW_PRESS); - nk_input_button(ctx, NK_BUTTON_DOUBLE, (int)glfw.double_click_pos.x, (int)glfw.double_click_pos.y, glfw.is_double_click_down); - nk_input_scroll(ctx, glfw.scroll); - nk_input_end(&glfw.ctx); - glfw.text_len = 0; - glfw.scroll = nk_vec2(0,0); -} - -NK_API -void nk_glfw3_shutdown(void) -{ - struct nk_glfw_device *dev = &glfw.ogl; - nk_font_atlas_clear(&glfw.atlas); - nk_free(&glfw.ctx); - glDeleteTextures(1, &dev->font_tex); - nk_buffer_free(&dev->cmds); - NK_MEMSET(&glfw, 0, sizeof(glfw)); -} - -#endif diff --git a/3rdparty/glfw/source/deps/stb_image_write.h b/3rdparty/glfw/source/deps/stb_image_write.h deleted file mode 100644 index 4319c0d..0000000 --- a/3rdparty/glfw/source/deps/stb_image_write.h +++ /dev/null @@ -1,1048 +0,0 @@ -/* stb_image_write - v1.02 - public domain - http://nothings.org/stb/stb_image_write.h - writes out PNG/BMP/TGA images to C stdio - Sean Barrett 2010-2015 - no warranty implied; use at your own risk - - Before #including, - - #define STB_IMAGE_WRITE_IMPLEMENTATION - - in the file that you want to have the implementation. - - Will probably not work correctly with strict-aliasing optimizations. - -ABOUT: - - This header file is a library for writing images to C stdio. It could be - adapted to write to memory or a general streaming interface; let me know. - - The PNG output is not optimal; it is 20-50% larger than the file - written by a decent optimizing implementation. This library is designed - for source code compactness and simplicity, not optimal image file size - or run-time performance. - -BUILDING: - - You can #define STBIW_ASSERT(x) before the #include to avoid using assert.h. - You can #define STBIW_MALLOC(), STBIW_REALLOC(), and STBIW_FREE() to replace - malloc,realloc,free. - You can define STBIW_MEMMOVE() to replace memmove() - -USAGE: - - There are four functions, one for each image file format: - - int stbi_write_png(char const *filename, int w, int h, int comp, const void *data, int stride_in_bytes); - int stbi_write_bmp(char const *filename, int w, int h, int comp, const void *data); - int stbi_write_tga(char const *filename, int w, int h, int comp, const void *data); - int stbi_write_hdr(char const *filename, int w, int h, int comp, const float *data); - - There are also four equivalent functions that use an arbitrary write function. You are - expected to open/close your file-equivalent before and after calling these: - - int stbi_write_png_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data, int stride_in_bytes); - int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data); - int stbi_write_tga_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data); - int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const float *data); - - where the callback is: - void stbi_write_func(void *context, void *data, int size); - - You can define STBI_WRITE_NO_STDIO to disable the file variant of these - functions, so the library will not use stdio.h at all. However, this will - also disable HDR writing, because it requires stdio for formatted output. - - Each function returns 0 on failure and non-0 on success. - - The functions create an image file defined by the parameters. The image - is a rectangle of pixels stored from left-to-right, top-to-bottom. - Each pixel contains 'comp' channels of data stored interleaved with 8-bits - per channel, in the following order: 1=Y, 2=YA, 3=RGB, 4=RGBA. (Y is - monochrome color.) The rectangle is 'w' pixels wide and 'h' pixels tall. - The *data pointer points to the first byte of the top-left-most pixel. - For PNG, "stride_in_bytes" is the distance in bytes from the first byte of - a row of pixels to the first byte of the next row of pixels. - - PNG creates output files with the same number of components as the input. - The BMP format expands Y to RGB in the file format and does not - output alpha. - - PNG supports writing rectangles of data even when the bytes storing rows of - data are not consecutive in memory (e.g. sub-rectangles of a larger image), - by supplying the stride between the beginning of adjacent rows. The other - formats do not. (Thus you cannot write a native-format BMP through the BMP - writer, both because it is in BGR order and because it may have padding - at the end of the line.) - - HDR expects linear float data. Since the format is always 32-bit rgb(e) - data, alpha (if provided) is discarded, and for monochrome data it is - replicated across all three channels. - - TGA supports RLE or non-RLE compressed data. To use non-RLE-compressed - data, set the global variable 'stbi_write_tga_with_rle' to 0. - -CREDITS: - - PNG/BMP/TGA - Sean Barrett - HDR - Baldur Karlsson - TGA monochrome: - Jean-Sebastien Guay - misc enhancements: - Tim Kelsey - TGA RLE - Alan Hickman - initial file IO callback implementation - Emmanuel Julien - bugfixes: - github:Chribba - Guillaume Chereau - github:jry2 - github:romigrou - Sergio Gonzalez - Jonas Karlsson - Filip Wasil - Thatcher Ulrich - -LICENSE - -This software is dual-licensed to the public domain and under the following -license: you are granted a perpetual, irrevocable license to copy, modify, -publish, and distribute this file as you see fit. - -*/ - -#ifndef INCLUDE_STB_IMAGE_WRITE_H -#define INCLUDE_STB_IMAGE_WRITE_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef STB_IMAGE_WRITE_STATIC -#define STBIWDEF static -#else -#define STBIWDEF extern -extern int stbi_write_tga_with_rle; -#endif - -#ifndef STBI_WRITE_NO_STDIO -STBIWDEF int stbi_write_png(char const *filename, int w, int h, int comp, const void *data, int stride_in_bytes); -STBIWDEF int stbi_write_bmp(char const *filename, int w, int h, int comp, const void *data); -STBIWDEF int stbi_write_tga(char const *filename, int w, int h, int comp, const void *data); -STBIWDEF int stbi_write_hdr(char const *filename, int w, int h, int comp, const float *data); -#endif - -typedef void stbi_write_func(void *context, void *data, int size); - -STBIWDEF int stbi_write_png_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data, int stride_in_bytes); -STBIWDEF int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data); -STBIWDEF int stbi_write_tga_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data); -STBIWDEF int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const float *data); - -#ifdef __cplusplus -} -#endif - -#endif//INCLUDE_STB_IMAGE_WRITE_H - -#ifdef STB_IMAGE_WRITE_IMPLEMENTATION - -#ifdef _WIN32 - #ifndef _CRT_SECURE_NO_WARNINGS - #define _CRT_SECURE_NO_WARNINGS - #endif - #ifndef _CRT_NONSTDC_NO_DEPRECATE - #define _CRT_NONSTDC_NO_DEPRECATE - #endif -#endif - -#ifndef STBI_WRITE_NO_STDIO -#include -#endif // STBI_WRITE_NO_STDIO - -#include -#include -#include -#include - -#if defined(STBIW_MALLOC) && defined(STBIW_FREE) && (defined(STBIW_REALLOC) || defined(STBIW_REALLOC_SIZED)) -// ok -#elif !defined(STBIW_MALLOC) && !defined(STBIW_FREE) && !defined(STBIW_REALLOC) && !defined(STBIW_REALLOC_SIZED) -// ok -#else -#error "Must define all or none of STBIW_MALLOC, STBIW_FREE, and STBIW_REALLOC (or STBIW_REALLOC_SIZED)." -#endif - -#ifndef STBIW_MALLOC -#define STBIW_MALLOC(sz) malloc(sz) -#define STBIW_REALLOC(p,newsz) realloc(p,newsz) -#define STBIW_FREE(p) free(p) -#endif - -#ifndef STBIW_REALLOC_SIZED -#define STBIW_REALLOC_SIZED(p,oldsz,newsz) STBIW_REALLOC(p,newsz) -#endif - - -#ifndef STBIW_MEMMOVE -#define STBIW_MEMMOVE(a,b,sz) memmove(a,b,sz) -#endif - - -#ifndef STBIW_ASSERT -#include -#define STBIW_ASSERT(x) assert(x) -#endif - -#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff) - -typedef struct -{ - stbi_write_func *func; - void *context; -} stbi__write_context; - -// initialize a callback-based context -static void stbi__start_write_callbacks(stbi__write_context *s, stbi_write_func *c, void *context) -{ - s->func = c; - s->context = context; -} - -#ifndef STBI_WRITE_NO_STDIO - -static void stbi__stdio_write(void *context, void *data, int size) -{ - fwrite(data,1,size,(FILE*) context); -} - -static int stbi__start_write_file(stbi__write_context *s, const char *filename) -{ - FILE *f = fopen(filename, "wb"); - stbi__start_write_callbacks(s, stbi__stdio_write, (void *) f); - return f != NULL; -} - -static void stbi__end_write_file(stbi__write_context *s) -{ - fclose((FILE *)s->context); -} - -#endif // !STBI_WRITE_NO_STDIO - -typedef unsigned int stbiw_uint32; -typedef int stb_image_write_test[sizeof(stbiw_uint32)==4 ? 1 : -1]; - -#ifdef STB_IMAGE_WRITE_STATIC -static int stbi_write_tga_with_rle = 1; -#else -int stbi_write_tga_with_rle = 1; -#endif - -static void stbiw__writefv(stbi__write_context *s, const char *fmt, va_list v) -{ - while (*fmt) { - switch (*fmt++) { - case ' ': break; - case '1': { unsigned char x = STBIW_UCHAR(va_arg(v, int)); - s->func(s->context,&x,1); - break; } - case '2': { int x = va_arg(v,int); - unsigned char b[2]; - b[0] = STBIW_UCHAR(x); - b[1] = STBIW_UCHAR(x>>8); - s->func(s->context,b,2); - break; } - case '4': { stbiw_uint32 x = va_arg(v,int); - unsigned char b[4]; - b[0]=STBIW_UCHAR(x); - b[1]=STBIW_UCHAR(x>>8); - b[2]=STBIW_UCHAR(x>>16); - b[3]=STBIW_UCHAR(x>>24); - s->func(s->context,b,4); - break; } - default: - STBIW_ASSERT(0); - return; - } - } -} - -static void stbiw__writef(stbi__write_context *s, const char *fmt, ...) -{ - va_list v; - va_start(v, fmt); - stbiw__writefv(s, fmt, v); - va_end(v); -} - -static void stbiw__write3(stbi__write_context *s, unsigned char a, unsigned char b, unsigned char c) -{ - unsigned char arr[3]; - arr[0] = a, arr[1] = b, arr[2] = c; - s->func(s->context, arr, 3); -} - -static void stbiw__write_pixel(stbi__write_context *s, int rgb_dir, int comp, int write_alpha, int expand_mono, unsigned char *d) -{ - unsigned char bg[3] = { 255, 0, 255}, px[3]; - int k; - - if (write_alpha < 0) - s->func(s->context, &d[comp - 1], 1); - - switch (comp) { - case 1: - s->func(s->context,d,1); - break; - case 2: - if (expand_mono) - stbiw__write3(s, d[0], d[0], d[0]); // monochrome bmp - else - s->func(s->context, d, 1); // monochrome TGA - break; - case 4: - if (!write_alpha) { - // composite against pink background - for (k = 0; k < 3; ++k) - px[k] = bg[k] + ((d[k] - bg[k]) * d[3]) / 255; - stbiw__write3(s, px[1 - rgb_dir], px[1], px[1 + rgb_dir]); - break; - } - /* FALLTHROUGH */ - case 3: - stbiw__write3(s, d[1 - rgb_dir], d[1], d[1 + rgb_dir]); - break; - } - if (write_alpha > 0) - s->func(s->context, &d[comp - 1], 1); -} - -static void stbiw__write_pixels(stbi__write_context *s, int rgb_dir, int vdir, int x, int y, int comp, void *data, int write_alpha, int scanline_pad, int expand_mono) -{ - stbiw_uint32 zero = 0; - int i,j, j_end; - - if (y <= 0) - return; - - if (vdir < 0) - j_end = -1, j = y-1; - else - j_end = y, j = 0; - - for (; j != j_end; j += vdir) { - for (i=0; i < x; ++i) { - unsigned char *d = (unsigned char *) data + (j*x+i)*comp; - stbiw__write_pixel(s, rgb_dir, comp, write_alpha, expand_mono, d); - } - s->func(s->context, &zero, scanline_pad); - } -} - -static int stbiw__outfile(stbi__write_context *s, int rgb_dir, int vdir, int x, int y, int comp, int expand_mono, void *data, int alpha, int pad, const char *fmt, ...) -{ - if (y < 0 || x < 0) { - return 0; - } else { - va_list v; - va_start(v, fmt); - stbiw__writefv(s, fmt, v); - va_end(v); - stbiw__write_pixels(s,rgb_dir,vdir,x,y,comp,data,alpha,pad, expand_mono); - return 1; - } -} - -static int stbi_write_bmp_core(stbi__write_context *s, int x, int y, int comp, const void *data) -{ - int pad = (-x*3) & 3; - return stbiw__outfile(s,-1,-1,x,y,comp,1,(void *) data,0,pad, - "11 4 22 4" "4 44 22 444444", - 'B', 'M', 14+40+(x*3+pad)*y, 0,0, 14+40, // file header - 40, x,y, 1,24, 0,0,0,0,0,0); // bitmap header -} - -STBIWDEF int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data) -{ - stbi__write_context s; - stbi__start_write_callbacks(&s, func, context); - return stbi_write_bmp_core(&s, x, y, comp, data); -} - -#ifndef STBI_WRITE_NO_STDIO -STBIWDEF int stbi_write_bmp(char const *filename, int x, int y, int comp, const void *data) -{ - stbi__write_context s; - if (stbi__start_write_file(&s,filename)) { - int r = stbi_write_bmp_core(&s, x, y, comp, data); - stbi__end_write_file(&s); - return r; - } else - return 0; -} -#endif //!STBI_WRITE_NO_STDIO - -static int stbi_write_tga_core(stbi__write_context *s, int x, int y, int comp, void *data) -{ - int has_alpha = (comp == 2 || comp == 4); - int colorbytes = has_alpha ? comp-1 : comp; - int format = colorbytes < 2 ? 3 : 2; // 3 color channels (RGB/RGBA) = 2, 1 color channel (Y/YA) = 3 - - if (y < 0 || x < 0) - return 0; - - if (!stbi_write_tga_with_rle) { - return stbiw__outfile(s, -1, -1, x, y, comp, 0, (void *) data, has_alpha, 0, - "111 221 2222 11", 0, 0, format, 0, 0, 0, 0, 0, x, y, (colorbytes + has_alpha) * 8, has_alpha * 8); - } else { - int i,j,k; - - stbiw__writef(s, "111 221 2222 11", 0,0,format+8, 0,0,0, 0,0,x,y, (colorbytes + has_alpha) * 8, has_alpha * 8); - - for (j = y - 1; j >= 0; --j) { - unsigned char *row = (unsigned char *) data + j * x * comp; - int len; - - for (i = 0; i < x; i += len) { - unsigned char *begin = row + i * comp; - int diff = 1; - len = 1; - - if (i < x - 1) { - ++len; - diff = memcmp(begin, row + (i + 1) * comp, comp); - if (diff) { - const unsigned char *prev = begin; - for (k = i + 2; k < x && len < 128; ++k) { - if (memcmp(prev, row + k * comp, comp)) { - prev += comp; - ++len; - } else { - --len; - break; - } - } - } else { - for (k = i + 2; k < x && len < 128; ++k) { - if (!memcmp(begin, row + k * comp, comp)) { - ++len; - } else { - break; - } - } - } - } - - if (diff) { - unsigned char header = STBIW_UCHAR(len - 1); - s->func(s->context, &header, 1); - for (k = 0; k < len; ++k) { - stbiw__write_pixel(s, -1, comp, has_alpha, 0, begin + k * comp); - } - } else { - unsigned char header = STBIW_UCHAR(len - 129); - s->func(s->context, &header, 1); - stbiw__write_pixel(s, -1, comp, has_alpha, 0, begin); - } - } - } - } - return 1; -} - -int stbi_write_tga_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data) -{ - stbi__write_context s; - stbi__start_write_callbacks(&s, func, context); - return stbi_write_tga_core(&s, x, y, comp, (void *) data); -} - -#ifndef STBI_WRITE_NO_STDIO -int stbi_write_tga(char const *filename, int x, int y, int comp, const void *data) -{ - stbi__write_context s; - if (stbi__start_write_file(&s,filename)) { - int r = stbi_write_tga_core(&s, x, y, comp, (void *) data); - stbi__end_write_file(&s); - return r; - } else - return 0; -} -#endif - -// ************************************************************************************************* -// Radiance RGBE HDR writer -// by Baldur Karlsson -#ifndef STBI_WRITE_NO_STDIO - -#define stbiw__max(a, b) ((a) > (b) ? (a) : (b)) - -void stbiw__linear_to_rgbe(unsigned char *rgbe, float *linear) -{ - int exponent; - float maxcomp = stbiw__max(linear[0], stbiw__max(linear[1], linear[2])); - - if (maxcomp < 1e-32f) { - rgbe[0] = rgbe[1] = rgbe[2] = rgbe[3] = 0; - } else { - float normalize = (float) frexp(maxcomp, &exponent) * 256.0f/maxcomp; - - rgbe[0] = (unsigned char)(linear[0] * normalize); - rgbe[1] = (unsigned char)(linear[1] * normalize); - rgbe[2] = (unsigned char)(linear[2] * normalize); - rgbe[3] = (unsigned char)(exponent + 128); - } -} - -void stbiw__write_run_data(stbi__write_context *s, int length, unsigned char databyte) -{ - unsigned char lengthbyte = STBIW_UCHAR(length+128); - STBIW_ASSERT(length+128 <= 255); - s->func(s->context, &lengthbyte, 1); - s->func(s->context, &databyte, 1); -} - -void stbiw__write_dump_data(stbi__write_context *s, int length, unsigned char *data) -{ - unsigned char lengthbyte = STBIW_UCHAR(length); - STBIW_ASSERT(length <= 128); // inconsistent with spec but consistent with official code - s->func(s->context, &lengthbyte, 1); - s->func(s->context, data, length); -} - -void stbiw__write_hdr_scanline(stbi__write_context *s, int width, int ncomp, unsigned char *scratch, float *scanline) -{ - unsigned char scanlineheader[4] = { 2, 2, 0, 0 }; - unsigned char rgbe[4]; - float linear[3]; - int x; - - scanlineheader[2] = (width&0xff00)>>8; - scanlineheader[3] = (width&0x00ff); - - /* skip RLE for images too small or large */ - if (width < 8 || width >= 32768) { - for (x=0; x < width; x++) { - switch (ncomp) { - case 4: /* fallthrough */ - case 3: linear[2] = scanline[x*ncomp + 2]; - linear[1] = scanline[x*ncomp + 1]; - linear[0] = scanline[x*ncomp + 0]; - break; - default: - linear[0] = linear[1] = linear[2] = scanline[x*ncomp + 0]; - break; - } - stbiw__linear_to_rgbe(rgbe, linear); - s->func(s->context, rgbe, 4); - } - } else { - int c,r; - /* encode into scratch buffer */ - for (x=0; x < width; x++) { - switch(ncomp) { - case 4: /* fallthrough */ - case 3: linear[2] = scanline[x*ncomp + 2]; - linear[1] = scanline[x*ncomp + 1]; - linear[0] = scanline[x*ncomp + 0]; - break; - default: - linear[0] = linear[1] = linear[2] = scanline[x*ncomp + 0]; - break; - } - stbiw__linear_to_rgbe(rgbe, linear); - scratch[x + width*0] = rgbe[0]; - scratch[x + width*1] = rgbe[1]; - scratch[x + width*2] = rgbe[2]; - scratch[x + width*3] = rgbe[3]; - } - - s->func(s->context, scanlineheader, 4); - - /* RLE each component separately */ - for (c=0; c < 4; c++) { - unsigned char *comp = &scratch[width*c]; - - x = 0; - while (x < width) { - // find first run - r = x; - while (r+2 < width) { - if (comp[r] == comp[r+1] && comp[r] == comp[r+2]) - break; - ++r; - } - if (r+2 >= width) - r = width; - // dump up to first run - while (x < r) { - int len = r-x; - if (len > 128) len = 128; - stbiw__write_dump_data(s, len, &comp[x]); - x += len; - } - // if there's a run, output it - if (r+2 < width) { // same test as what we break out of in search loop, so only true if we break'd - // find next byte after run - while (r < width && comp[r] == comp[x]) - ++r; - // output run up to r - while (x < r) { - int len = r-x; - if (len > 127) len = 127; - stbiw__write_run_data(s, len, comp[x]); - x += len; - } - } - } - } - } -} - -static int stbi_write_hdr_core(stbi__write_context *s, int x, int y, int comp, float *data) -{ - if (y <= 0 || x <= 0 || data == NULL) - return 0; - else { - // Each component is stored separately. Allocate scratch space for full output scanline. - unsigned char *scratch = (unsigned char *) STBIW_MALLOC(x*4); - int i, len; - char buffer[128]; - char header[] = "#?RADIANCE\n# Written by stb_image_write.h\nFORMAT=32-bit_rle_rgbe\n"; - s->func(s->context, header, sizeof(header)-1); - - len = sprintf(buffer, "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x); - s->func(s->context, buffer, len); - - for(i=0; i < y; i++) - stbiw__write_hdr_scanline(s, x, comp, scratch, data + comp*i*x); - STBIW_FREE(scratch); - return 1; - } -} - -int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const float *data) -{ - stbi__write_context s; - stbi__start_write_callbacks(&s, func, context); - return stbi_write_hdr_core(&s, x, y, comp, (float *) data); -} - -int stbi_write_hdr(char const *filename, int x, int y, int comp, const float *data) -{ - stbi__write_context s; - if (stbi__start_write_file(&s,filename)) { - int r = stbi_write_hdr_core(&s, x, y, comp, (float *) data); - stbi__end_write_file(&s); - return r; - } else - return 0; -} -#endif // STBI_WRITE_NO_STDIO - - -////////////////////////////////////////////////////////////////////////////// -// -// PNG writer -// - -// stretchy buffer; stbiw__sbpush() == vector<>::push_back() -- stbiw__sbcount() == vector<>::size() -#define stbiw__sbraw(a) ((int *) (a) - 2) -#define stbiw__sbm(a) stbiw__sbraw(a)[0] -#define stbiw__sbn(a) stbiw__sbraw(a)[1] - -#define stbiw__sbneedgrow(a,n) ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a)) -#define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0) -#define stbiw__sbgrow(a,n) stbiw__sbgrowf((void **) &(a), (n), sizeof(*(a))) - -#define stbiw__sbpush(a, v) (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v)) -#define stbiw__sbcount(a) ((a) ? stbiw__sbn(a) : 0) -#define stbiw__sbfree(a) ((a) ? STBIW_FREE(stbiw__sbraw(a)),0 : 0) - -static void *stbiw__sbgrowf(void **arr, int increment, int itemsize) -{ - int m = *arr ? 2*stbiw__sbm(*arr)+increment : increment+1; - void *p = STBIW_REALLOC_SIZED(*arr ? stbiw__sbraw(*arr) : 0, *arr ? (stbiw__sbm(*arr)*itemsize + sizeof(int)*2) : 0, itemsize * m + sizeof(int)*2); - STBIW_ASSERT(p); - if (p) { - if (!*arr) ((int *) p)[1] = 0; - *arr = (void *) ((int *) p + 2); - stbiw__sbm(*arr) = m; - } - return *arr; -} - -static unsigned char *stbiw__zlib_flushf(unsigned char *data, unsigned int *bitbuffer, int *bitcount) -{ - while (*bitcount >= 8) { - stbiw__sbpush(data, STBIW_UCHAR(*bitbuffer)); - *bitbuffer >>= 8; - *bitcount -= 8; - } - return data; -} - -static int stbiw__zlib_bitrev(int code, int codebits) -{ - int res=0; - while (codebits--) { - res = (res << 1) | (code & 1); - code >>= 1; - } - return res; -} - -static unsigned int stbiw__zlib_countm(unsigned char *a, unsigned char *b, int limit) -{ - int i; - for (i=0; i < limit && i < 258; ++i) - if (a[i] != b[i]) break; - return i; -} - -static unsigned int stbiw__zhash(unsigned char *data) -{ - stbiw_uint32 hash = data[0] + (data[1] << 8) + (data[2] << 16); - hash ^= hash << 3; - hash += hash >> 5; - hash ^= hash << 4; - hash += hash >> 17; - hash ^= hash << 25; - hash += hash >> 6; - return hash; -} - -#define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount)) -#define stbiw__zlib_add(code,codebits) \ - (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush()) -#define stbiw__zlib_huffa(b,c) stbiw__zlib_add(stbiw__zlib_bitrev(b,c),c) -// default huffman tables -#define stbiw__zlib_huff1(n) stbiw__zlib_huffa(0x30 + (n), 8) -#define stbiw__zlib_huff2(n) stbiw__zlib_huffa(0x190 + (n)-144, 9) -#define stbiw__zlib_huff3(n) stbiw__zlib_huffa(0 + (n)-256,7) -#define stbiw__zlib_huff4(n) stbiw__zlib_huffa(0xc0 + (n)-280,8) -#define stbiw__zlib_huff(n) ((n) <= 143 ? stbiw__zlib_huff1(n) : (n) <= 255 ? stbiw__zlib_huff2(n) : (n) <= 279 ? stbiw__zlib_huff3(n) : stbiw__zlib_huff4(n)) -#define stbiw__zlib_huffb(n) ((n) <= 143 ? stbiw__zlib_huff1(n) : stbiw__zlib_huff2(n)) - -#define stbiw__ZHASH 16384 - -unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_len, int quality) -{ - static unsigned short lengthc[] = { 3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258, 259 }; - static unsigned char lengtheb[]= { 0,0,0,0,0,0,0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 }; - static unsigned short distc[] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577, 32768 }; - static unsigned char disteb[] = { 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13 }; - unsigned int bitbuf=0; - int i,j, bitcount=0; - unsigned char *out = NULL; - unsigned char ***hash_table = (unsigned char***) STBIW_MALLOC(stbiw__ZHASH * sizeof(char**)); - if (quality < 5) quality = 5; - - stbiw__sbpush(out, 0x78); // DEFLATE 32K window - stbiw__sbpush(out, 0x5e); // FLEVEL = 1 - stbiw__zlib_add(1,1); // BFINAL = 1 - stbiw__zlib_add(1,2); // BTYPE = 1 -- fixed huffman - - for (i=0; i < stbiw__ZHASH; ++i) - hash_table[i] = NULL; - - i=0; - while (i < data_len-3) { - // hash next 3 bytes of data to be compressed - int h = stbiw__zhash(data+i)&(stbiw__ZHASH-1), best=3; - unsigned char *bestloc = 0; - unsigned char **hlist = hash_table[h]; - int n = stbiw__sbcount(hlist); - for (j=0; j < n; ++j) { - if (hlist[j]-data > i-32768) { // if entry lies within window - int d = stbiw__zlib_countm(hlist[j], data+i, data_len-i); - if (d >= best) best=d,bestloc=hlist[j]; - } - } - // when hash table entry is too long, delete half the entries - if (hash_table[h] && stbiw__sbn(hash_table[h]) == 2*quality) { - STBIW_MEMMOVE(hash_table[h], hash_table[h]+quality, sizeof(hash_table[h][0])*quality); - stbiw__sbn(hash_table[h]) = quality; - } - stbiw__sbpush(hash_table[h],data+i); - - if (bestloc) { - // "lazy matching" - check match at *next* byte, and if it's better, do cur byte as literal - h = stbiw__zhash(data+i+1)&(stbiw__ZHASH-1); - hlist = hash_table[h]; - n = stbiw__sbcount(hlist); - for (j=0; j < n; ++j) { - if (hlist[j]-data > i-32767) { - int e = stbiw__zlib_countm(hlist[j], data+i+1, data_len-i-1); - if (e > best) { // if next match is better, bail on current match - bestloc = NULL; - break; - } - } - } - } - - if (bestloc) { - int d = (int) (data+i - bestloc); // distance back - STBIW_ASSERT(d <= 32767 && best <= 258); - for (j=0; best > lengthc[j+1]-1; ++j); - stbiw__zlib_huff(j+257); - if (lengtheb[j]) stbiw__zlib_add(best - lengthc[j], lengtheb[j]); - for (j=0; d > distc[j+1]-1; ++j); - stbiw__zlib_add(stbiw__zlib_bitrev(j,5),5); - if (disteb[j]) stbiw__zlib_add(d - distc[j], disteb[j]); - i += best; - } else { - stbiw__zlib_huffb(data[i]); - ++i; - } - } - // write out final bytes - for (;i < data_len; ++i) - stbiw__zlib_huffb(data[i]); - stbiw__zlib_huff(256); // end of block - // pad with 0 bits to byte boundary - while (bitcount) - stbiw__zlib_add(0,1); - - for (i=0; i < stbiw__ZHASH; ++i) - (void) stbiw__sbfree(hash_table[i]); - STBIW_FREE(hash_table); - - { - // compute adler32 on input - unsigned int s1=1, s2=0; - int blocklen = (int) (data_len % 5552); - j=0; - while (j < data_len) { - for (i=0; i < blocklen; ++i) s1 += data[j+i], s2 += s1; - s1 %= 65521, s2 %= 65521; - j += blocklen; - blocklen = 5552; - } - stbiw__sbpush(out, STBIW_UCHAR(s2 >> 8)); - stbiw__sbpush(out, STBIW_UCHAR(s2)); - stbiw__sbpush(out, STBIW_UCHAR(s1 >> 8)); - stbiw__sbpush(out, STBIW_UCHAR(s1)); - } - *out_len = stbiw__sbn(out); - // make returned pointer freeable - STBIW_MEMMOVE(stbiw__sbraw(out), out, *out_len); - return (unsigned char *) stbiw__sbraw(out); -} - -static unsigned int stbiw__crc32(unsigned char *buffer, int len) -{ - static unsigned int crc_table[256] = - { - 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, - 0x0eDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, - 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, - 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, - 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, - 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, - 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, - 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, - 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, - 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, - 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, - 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, - 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, - 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, - 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, - 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, - 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, - 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, - 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, - 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, - 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, - 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, - 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, - 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, - 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, - 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, - 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, - 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, - 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, - 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, - 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, - 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D - }; - - unsigned int crc = ~0u; - int i; - for (i=0; i < len; ++i) - crc = (crc >> 8) ^ crc_table[buffer[i] ^ (crc & 0xff)]; - return ~crc; -} - -#define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4) -#define stbiw__wp32(data,v) stbiw__wpng4(data, (v)>>24,(v)>>16,(v)>>8,(v)); -#define stbiw__wptag(data,s) stbiw__wpng4(data, s[0],s[1],s[2],s[3]) - -static void stbiw__wpcrc(unsigned char **data, int len) -{ - unsigned int crc = stbiw__crc32(*data - len - 4, len+4); - stbiw__wp32(*data, crc); -} - -static unsigned char stbiw__paeth(int a, int b, int c) -{ - int p = a + b - c, pa = abs(p-a), pb = abs(p-b), pc = abs(p-c); - if (pa <= pb && pa <= pc) return STBIW_UCHAR(a); - if (pb <= pc) return STBIW_UCHAR(b); - return STBIW_UCHAR(c); -} - -unsigned char *stbi_write_png_to_mem(unsigned char *pixels, int stride_bytes, int x, int y, int n, int *out_len) -{ - int ctype[5] = { -1, 0, 4, 2, 6 }; - unsigned char sig[8] = { 137,80,78,71,13,10,26,10 }; - unsigned char *out,*o, *filt, *zlib; - signed char *line_buffer; - int i,j,k,p,zlen; - - if (stride_bytes == 0) - stride_bytes = x * n; - - filt = (unsigned char *) STBIW_MALLOC((x*n+1) * y); if (!filt) return 0; - line_buffer = (signed char *) STBIW_MALLOC(x * n); if (!line_buffer) { STBIW_FREE(filt); return 0; } - for (j=0; j < y; ++j) { - static int mapping[] = { 0,1,2,3,4 }; - static int firstmap[] = { 0,1,0,5,6 }; - int *mymap = j ? mapping : firstmap; - int best = 0, bestval = 0x7fffffff; - for (p=0; p < 2; ++p) { - for (k= p?best:0; k < 5; ++k) { - int type = mymap[k],est=0; - unsigned char *z = pixels + stride_bytes*j; - for (i=0; i < n; ++i) - switch (type) { - case 0: line_buffer[i] = z[i]; break; - case 1: line_buffer[i] = z[i]; break; - case 2: line_buffer[i] = z[i] - z[i-stride_bytes]; break; - case 3: line_buffer[i] = z[i] - (z[i-stride_bytes]>>1); break; - case 4: line_buffer[i] = (signed char) (z[i] - stbiw__paeth(0,z[i-stride_bytes],0)); break; - case 5: line_buffer[i] = z[i]; break; - case 6: line_buffer[i] = z[i]; break; - } - for (i=n; i < x*n; ++i) { - switch (type) { - case 0: line_buffer[i] = z[i]; break; - case 1: line_buffer[i] = z[i] - z[i-n]; break; - case 2: line_buffer[i] = z[i] - z[i-stride_bytes]; break; - case 3: line_buffer[i] = z[i] - ((z[i-n] + z[i-stride_bytes])>>1); break; - case 4: line_buffer[i] = z[i] - stbiw__paeth(z[i-n], z[i-stride_bytes], z[i-stride_bytes-n]); break; - case 5: line_buffer[i] = z[i] - (z[i-n]>>1); break; - case 6: line_buffer[i] = z[i] - stbiw__paeth(z[i-n], 0,0); break; - } - } - if (p) break; - for (i=0; i < x*n; ++i) - est += abs((signed char) line_buffer[i]); - if (est < bestval) { bestval = est; best = k; } - } - } - // when we get here, best contains the filter type, and line_buffer contains the data - filt[j*(x*n+1)] = (unsigned char) best; - STBIW_MEMMOVE(filt+j*(x*n+1)+1, line_buffer, x*n); - } - STBIW_FREE(line_buffer); - zlib = stbi_zlib_compress(filt, y*( x*n+1), &zlen, 8); // increase 8 to get smaller but use more memory - STBIW_FREE(filt); - if (!zlib) return 0; - - // each tag requires 12 bytes of overhead - out = (unsigned char *) STBIW_MALLOC(8 + 12+13 + 12+zlen + 12); - if (!out) return 0; - *out_len = 8 + 12+13 + 12+zlen + 12; - - o=out; - STBIW_MEMMOVE(o,sig,8); o+= 8; - stbiw__wp32(o, 13); // header length - stbiw__wptag(o, "IHDR"); - stbiw__wp32(o, x); - stbiw__wp32(o, y); - *o++ = 8; - *o++ = STBIW_UCHAR(ctype[n]); - *o++ = 0; - *o++ = 0; - *o++ = 0; - stbiw__wpcrc(&o,13); - - stbiw__wp32(o, zlen); - stbiw__wptag(o, "IDAT"); - STBIW_MEMMOVE(o, zlib, zlen); - o += zlen; - STBIW_FREE(zlib); - stbiw__wpcrc(&o, zlen); - - stbiw__wp32(o,0); - stbiw__wptag(o, "IEND"); - stbiw__wpcrc(&o,0); - - STBIW_ASSERT(o == out + *out_len); - - return out; -} - -#ifndef STBI_WRITE_NO_STDIO -STBIWDEF int stbi_write_png(char const *filename, int x, int y, int comp, const void *data, int stride_bytes) -{ - FILE *f; - int len; - unsigned char *png = stbi_write_png_to_mem((unsigned char *) data, stride_bytes, x, y, comp, &len); - if (png == NULL) return 0; - f = fopen(filename, "wb"); - if (!f) { STBIW_FREE(png); return 0; } - fwrite(png, 1, len, f); - fclose(f); - STBIW_FREE(png); - return 1; -} -#endif - -STBIWDEF int stbi_write_png_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data, int stride_bytes) -{ - int len; - unsigned char *png = stbi_write_png_to_mem((unsigned char *) data, stride_bytes, x, y, comp, &len); - if (png == NULL) return 0; - func(context, png, len); - STBIW_FREE(png); - return 1; -} - -#endif // STB_IMAGE_WRITE_IMPLEMENTATION - -/* Revision history - 1.02 (2016-04-02) - avoid allocating large structures on the stack - 1.01 (2016-01-16) - STBIW_REALLOC_SIZED: support allocators with no realloc support - avoid race-condition in crc initialization - minor compile issues - 1.00 (2015-09-14) - installable file IO function - 0.99 (2015-09-13) - warning fixes; TGA rle support - 0.98 (2015-04-08) - added STBIW_MALLOC, STBIW_ASSERT etc - 0.97 (2015-01-18) - fixed HDR asserts, rewrote HDR rle logic - 0.96 (2015-01-17) - add HDR output - fix monochrome BMP - 0.95 (2014-08-17) - add monochrome TGA output - 0.94 (2014-05-31) - rename private functions to avoid conflicts with stb_image.h - 0.93 (2014-05-27) - warning fixes - 0.92 (2010-08-01) - casts to unsigned char to fix warnings - 0.91 (2010-07-17) - first public release - 0.90 first internal release -*/ diff --git a/3rdparty/glfw/source/deps/tinycthread.c b/3rdparty/glfw/source/deps/tinycthread.c deleted file mode 100644 index f9cea2e..0000000 --- a/3rdparty/glfw/source/deps/tinycthread.c +++ /dev/null @@ -1,594 +0,0 @@ -/* -*- mode: c; tab-width: 2; indent-tabs-mode: nil; -*- -Copyright (c) 2012 Marcus Geelnard - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*/ - -/* 2013-01-06 Camilla Löwy - * - * Added casts from time_t to DWORD to avoid warnings on VC++. - * Fixed time retrieval on POSIX systems. - */ - -#include "tinycthread.h" -#include - -/* Platform specific includes */ -#if defined(_TTHREAD_POSIX_) - #include - #include - #include - #include - #include -#elif defined(_TTHREAD_WIN32_) - #include - #include -#endif - -/* Standard, good-to-have defines */ -#ifndef NULL - #define NULL (void*)0 -#endif -#ifndef TRUE - #define TRUE 1 -#endif -#ifndef FALSE - #define FALSE 0 -#endif - -int mtx_init(mtx_t *mtx, int type) -{ -#if defined(_TTHREAD_WIN32_) - mtx->mAlreadyLocked = FALSE; - mtx->mRecursive = type & mtx_recursive; - InitializeCriticalSection(&mtx->mHandle); - return thrd_success; -#else - int ret; - pthread_mutexattr_t attr; - pthread_mutexattr_init(&attr); - if (type & mtx_recursive) - { - pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); - } - ret = pthread_mutex_init(mtx, &attr); - pthread_mutexattr_destroy(&attr); - return ret == 0 ? thrd_success : thrd_error; -#endif -} - -void mtx_destroy(mtx_t *mtx) -{ -#if defined(_TTHREAD_WIN32_) - DeleteCriticalSection(&mtx->mHandle); -#else - pthread_mutex_destroy(mtx); -#endif -} - -int mtx_lock(mtx_t *mtx) -{ -#if defined(_TTHREAD_WIN32_) - EnterCriticalSection(&mtx->mHandle); - if (!mtx->mRecursive) - { - while(mtx->mAlreadyLocked) Sleep(1000); /* Simulate deadlock... */ - mtx->mAlreadyLocked = TRUE; - } - return thrd_success; -#else - return pthread_mutex_lock(mtx) == 0 ? thrd_success : thrd_error; -#endif -} - -int mtx_timedlock(mtx_t *mtx, const struct timespec *ts) -{ - /* FIXME! */ - (void)mtx; - (void)ts; - return thrd_error; -} - -int mtx_trylock(mtx_t *mtx) -{ -#if defined(_TTHREAD_WIN32_) - int ret = TryEnterCriticalSection(&mtx->mHandle) ? thrd_success : thrd_busy; - if ((!mtx->mRecursive) && (ret == thrd_success) && mtx->mAlreadyLocked) - { - LeaveCriticalSection(&mtx->mHandle); - ret = thrd_busy; - } - return ret; -#else - return (pthread_mutex_trylock(mtx) == 0) ? thrd_success : thrd_busy; -#endif -} - -int mtx_unlock(mtx_t *mtx) -{ -#if defined(_TTHREAD_WIN32_) - mtx->mAlreadyLocked = FALSE; - LeaveCriticalSection(&mtx->mHandle); - return thrd_success; -#else - return pthread_mutex_unlock(mtx) == 0 ? thrd_success : thrd_error;; -#endif -} - -#if defined(_TTHREAD_WIN32_) -#define _CONDITION_EVENT_ONE 0 -#define _CONDITION_EVENT_ALL 1 -#endif - -int cnd_init(cnd_t *cond) -{ -#if defined(_TTHREAD_WIN32_) - cond->mWaitersCount = 0; - - /* Init critical section */ - InitializeCriticalSection(&cond->mWaitersCountLock); - - /* Init events */ - cond->mEvents[_CONDITION_EVENT_ONE] = CreateEvent(NULL, FALSE, FALSE, NULL); - if (cond->mEvents[_CONDITION_EVENT_ONE] == NULL) - { - cond->mEvents[_CONDITION_EVENT_ALL] = NULL; - return thrd_error; - } - cond->mEvents[_CONDITION_EVENT_ALL] = CreateEvent(NULL, TRUE, FALSE, NULL); - if (cond->mEvents[_CONDITION_EVENT_ALL] == NULL) - { - CloseHandle(cond->mEvents[_CONDITION_EVENT_ONE]); - cond->mEvents[_CONDITION_EVENT_ONE] = NULL; - return thrd_error; - } - - return thrd_success; -#else - return pthread_cond_init(cond, NULL) == 0 ? thrd_success : thrd_error; -#endif -} - -void cnd_destroy(cnd_t *cond) -{ -#if defined(_TTHREAD_WIN32_) - if (cond->mEvents[_CONDITION_EVENT_ONE] != NULL) - { - CloseHandle(cond->mEvents[_CONDITION_EVENT_ONE]); - } - if (cond->mEvents[_CONDITION_EVENT_ALL] != NULL) - { - CloseHandle(cond->mEvents[_CONDITION_EVENT_ALL]); - } - DeleteCriticalSection(&cond->mWaitersCountLock); -#else - pthread_cond_destroy(cond); -#endif -} - -int cnd_signal(cnd_t *cond) -{ -#if defined(_TTHREAD_WIN32_) - int haveWaiters; - - /* Are there any waiters? */ - EnterCriticalSection(&cond->mWaitersCountLock); - haveWaiters = (cond->mWaitersCount > 0); - LeaveCriticalSection(&cond->mWaitersCountLock); - - /* If we have any waiting threads, send them a signal */ - if(haveWaiters) - { - if (SetEvent(cond->mEvents[_CONDITION_EVENT_ONE]) == 0) - { - return thrd_error; - } - } - - return thrd_success; -#else - return pthread_cond_signal(cond) == 0 ? thrd_success : thrd_error; -#endif -} - -int cnd_broadcast(cnd_t *cond) -{ -#if defined(_TTHREAD_WIN32_) - int haveWaiters; - - /* Are there any waiters? */ - EnterCriticalSection(&cond->mWaitersCountLock); - haveWaiters = (cond->mWaitersCount > 0); - LeaveCriticalSection(&cond->mWaitersCountLock); - - /* If we have any waiting threads, send them a signal */ - if(haveWaiters) - { - if (SetEvent(cond->mEvents[_CONDITION_EVENT_ALL]) == 0) - { - return thrd_error; - } - } - - return thrd_success; -#else - return pthread_cond_signal(cond) == 0 ? thrd_success : thrd_error; -#endif -} - -#if defined(_TTHREAD_WIN32_) -static int _cnd_timedwait_win32(cnd_t *cond, mtx_t *mtx, DWORD timeout) -{ - int result, lastWaiter; - - /* Increment number of waiters */ - EnterCriticalSection(&cond->mWaitersCountLock); - ++ cond->mWaitersCount; - LeaveCriticalSection(&cond->mWaitersCountLock); - - /* Release the mutex while waiting for the condition (will decrease - the number of waiters when done)... */ - mtx_unlock(mtx); - - /* Wait for either event to become signaled due to cnd_signal() or - cnd_broadcast() being called */ - result = WaitForMultipleObjects(2, cond->mEvents, FALSE, timeout); - if (result == WAIT_TIMEOUT) - { - return thrd_timeout; - } - else if (result == (int)WAIT_FAILED) - { - return thrd_error; - } - - /* Check if we are the last waiter */ - EnterCriticalSection(&cond->mWaitersCountLock); - -- cond->mWaitersCount; - lastWaiter = (result == (WAIT_OBJECT_0 + _CONDITION_EVENT_ALL)) && - (cond->mWaitersCount == 0); - LeaveCriticalSection(&cond->mWaitersCountLock); - - /* If we are the last waiter to be notified to stop waiting, reset the event */ - if (lastWaiter) - { - if (ResetEvent(cond->mEvents[_CONDITION_EVENT_ALL]) == 0) - { - return thrd_error; - } - } - - /* Re-acquire the mutex */ - mtx_lock(mtx); - - return thrd_success; -} -#endif - -int cnd_wait(cnd_t *cond, mtx_t *mtx) -{ -#if defined(_TTHREAD_WIN32_) - return _cnd_timedwait_win32(cond, mtx, INFINITE); -#else - return pthread_cond_wait(cond, mtx) == 0 ? thrd_success : thrd_error; -#endif -} - -int cnd_timedwait(cnd_t *cond, mtx_t *mtx, const struct timespec *ts) -{ -#if defined(_TTHREAD_WIN32_) - struct timespec now; - if (clock_gettime(CLOCK_REALTIME, &now) == 0) - { - DWORD delta = (DWORD) ((ts->tv_sec - now.tv_sec) * 1000 + - (ts->tv_nsec - now.tv_nsec + 500000) / 1000000); - return _cnd_timedwait_win32(cond, mtx, delta); - } - else - return thrd_error; -#else - int ret; - ret = pthread_cond_timedwait(cond, mtx, ts); - if (ret == ETIMEDOUT) - { - return thrd_timeout; - } - return ret == 0 ? thrd_success : thrd_error; -#endif -} - - -/** Information to pass to the new thread (what to run). */ -typedef struct { - thrd_start_t mFunction; /**< Pointer to the function to be executed. */ - void * mArg; /**< Function argument for the thread function. */ -} _thread_start_info; - -/* Thread wrapper function. */ -#if defined(_TTHREAD_WIN32_) -static unsigned WINAPI _thrd_wrapper_function(void * aArg) -#elif defined(_TTHREAD_POSIX_) -static void * _thrd_wrapper_function(void * aArg) -#endif -{ - thrd_start_t fun; - void *arg; - int res; -#if defined(_TTHREAD_POSIX_) - void *pres; -#endif - - /* Get thread startup information */ - _thread_start_info *ti = (_thread_start_info *) aArg; - fun = ti->mFunction; - arg = ti->mArg; - - /* The thread is responsible for freeing the startup information */ - free((void *)ti); - - /* Call the actual client thread function */ - res = fun(arg); - -#if defined(_TTHREAD_WIN32_) - return res; -#else - pres = malloc(sizeof(int)); - if (pres != NULL) - { - *(int*)pres = res; - } - return pres; -#endif -} - -int thrd_create(thrd_t *thr, thrd_start_t func, void *arg) -{ - /* Fill out the thread startup information (passed to the thread wrapper, - which will eventually free it) */ - _thread_start_info* ti = (_thread_start_info*)malloc(sizeof(_thread_start_info)); - if (ti == NULL) - { - return thrd_nomem; - } - ti->mFunction = func; - ti->mArg = arg; - - /* Create the thread */ -#if defined(_TTHREAD_WIN32_) - *thr = (HANDLE)_beginthreadex(NULL, 0, _thrd_wrapper_function, (void *)ti, 0, NULL); -#elif defined(_TTHREAD_POSIX_) - if(pthread_create(thr, NULL, _thrd_wrapper_function, (void *)ti) != 0) - { - *thr = 0; - } -#endif - - /* Did we fail to create the thread? */ - if(!*thr) - { - free(ti); - return thrd_error; - } - - return thrd_success; -} - -thrd_t thrd_current(void) -{ -#if defined(_TTHREAD_WIN32_) - return GetCurrentThread(); -#else - return pthread_self(); -#endif -} - -int thrd_detach(thrd_t thr) -{ - /* FIXME! */ - (void)thr; - return thrd_error; -} - -int thrd_equal(thrd_t thr0, thrd_t thr1) -{ -#if defined(_TTHREAD_WIN32_) - return thr0 == thr1; -#else - return pthread_equal(thr0, thr1); -#endif -} - -void thrd_exit(int res) -{ -#if defined(_TTHREAD_WIN32_) - ExitThread(res); -#else - void *pres = malloc(sizeof(int)); - if (pres != NULL) - { - *(int*)pres = res; - } - pthread_exit(pres); -#endif -} - -int thrd_join(thrd_t thr, int *res) -{ -#if defined(_TTHREAD_WIN32_) - if (WaitForSingleObject(thr, INFINITE) == WAIT_FAILED) - { - return thrd_error; - } - if (res != NULL) - { - DWORD dwRes; - GetExitCodeThread(thr, &dwRes); - *res = dwRes; - } -#elif defined(_TTHREAD_POSIX_) - void *pres; - int ires = 0; - if (pthread_join(thr, &pres) != 0) - { - return thrd_error; - } - if (pres != NULL) - { - ires = *(int*)pres; - free(pres); - } - if (res != NULL) - { - *res = ires; - } -#endif - return thrd_success; -} - -int thrd_sleep(const struct timespec *time_point, struct timespec *remaining) -{ - struct timespec now; -#if defined(_TTHREAD_WIN32_) - DWORD delta; -#else - long delta; -#endif - - /* Get the current time */ - if (clock_gettime(CLOCK_REALTIME, &now) != 0) - return -2; // FIXME: Some specific error code? - -#if defined(_TTHREAD_WIN32_) - /* Delta in milliseconds */ - delta = (DWORD) ((time_point->tv_sec - now.tv_sec) * 1000 + - (time_point->tv_nsec - now.tv_nsec + 500000) / 1000000); - if (delta > 0) - { - Sleep(delta); - } -#else - /* Delta in microseconds */ - delta = (time_point->tv_sec - now.tv_sec) * 1000000L + - (time_point->tv_nsec - now.tv_nsec + 500L) / 1000L; - - /* On some systems, the usleep argument must be < 1000000 */ - while (delta > 999999L) - { - usleep(999999); - delta -= 999999L; - } - if (delta > 0L) - { - usleep((useconds_t)delta); - } -#endif - - /* We don't support waking up prematurely (yet) */ - if (remaining) - { - remaining->tv_sec = 0; - remaining->tv_nsec = 0; - } - return 0; -} - -void thrd_yield(void) -{ -#if defined(_TTHREAD_WIN32_) - Sleep(0); -#else - sched_yield(); -#endif -} - -int tss_create(tss_t *key, tss_dtor_t dtor) -{ -#if defined(_TTHREAD_WIN32_) - /* FIXME: The destructor function is not supported yet... */ - if (dtor != NULL) - { - return thrd_error; - } - *key = TlsAlloc(); - if (*key == TLS_OUT_OF_INDEXES) - { - return thrd_error; - } -#else - if (pthread_key_create(key, dtor) != 0) - { - return thrd_error; - } -#endif - return thrd_success; -} - -void tss_delete(tss_t key) -{ -#if defined(_TTHREAD_WIN32_) - TlsFree(key); -#else - pthread_key_delete(key); -#endif -} - -void *tss_get(tss_t key) -{ -#if defined(_TTHREAD_WIN32_) - return TlsGetValue(key); -#else - return pthread_getspecific(key); -#endif -} - -int tss_set(tss_t key, void *val) -{ -#if defined(_TTHREAD_WIN32_) - if (TlsSetValue(key, val) == 0) - { - return thrd_error; - } -#else - if (pthread_setspecific(key, val) != 0) - { - return thrd_error; - } -#endif - return thrd_success; -} - -#if defined(_TTHREAD_EMULATE_CLOCK_GETTIME_) -int _tthread_clock_gettime(clockid_t clk_id, struct timespec *ts) -{ -#if defined(_TTHREAD_WIN32_) - struct _timeb tb; - _ftime(&tb); - ts->tv_sec = (time_t)tb.time; - ts->tv_nsec = 1000000L * (long)tb.millitm; -#else - struct timeval tv; - gettimeofday(&tv, NULL); - ts->tv_sec = (time_t)tv.tv_sec; - ts->tv_nsec = 1000L * (long)tv.tv_usec; -#endif - return 0; -} -#endif // _TTHREAD_EMULATE_CLOCK_GETTIME_ - diff --git a/3rdparty/glfw/source/deps/tinycthread.h b/3rdparty/glfw/source/deps/tinycthread.h deleted file mode 100644 index 42958c3..0000000 --- a/3rdparty/glfw/source/deps/tinycthread.h +++ /dev/null @@ -1,443 +0,0 @@ -/* -*- mode: c; tab-width: 2; indent-tabs-mode: nil; -*- -Copyright (c) 2012 Marcus Geelnard - -This software is provided 'as-is', without any express or implied -warranty. In no event will the authors be held liable for any damages -arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it -freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source - distribution. -*/ - -#ifndef _TINYCTHREAD_H_ -#define _TINYCTHREAD_H_ - -/** -* @file -* @mainpage TinyCThread API Reference -* -* @section intro_sec Introduction -* TinyCThread is a minimal, portable implementation of basic threading -* classes for C. -* -* They closely mimic the functionality and naming of the C11 standard, and -* should be easily replaceable with the corresponding standard variants. -* -* @section port_sec Portability -* The Win32 variant uses the native Win32 API for implementing the thread -* classes, while for other systems, the POSIX threads API (pthread) is used. -* -* @section misc_sec Miscellaneous -* The following special keywords are available: #_Thread_local. -* -* For more detailed information, browse the different sections of this -* documentation. A good place to start is: -* tinycthread.h. -*/ - -/* Which platform are we on? */ -#if !defined(_TTHREAD_PLATFORM_DEFINED_) - #if defined(_WIN32) || defined(__WIN32__) || defined(__WINDOWS__) - #define _TTHREAD_WIN32_ - #else - #define _TTHREAD_POSIX_ - #endif - #define _TTHREAD_PLATFORM_DEFINED_ -#endif - -/* Activate some POSIX functionality (e.g. clock_gettime and recursive mutexes) */ -#if defined(_TTHREAD_POSIX_) - #undef _FEATURES_H - #if !defined(_GNU_SOURCE) - #define _GNU_SOURCE - #endif - #if !defined(_POSIX_C_SOURCE) || ((_POSIX_C_SOURCE - 0) < 199309L) - #undef _POSIX_C_SOURCE - #define _POSIX_C_SOURCE 199309L - #endif - #if !defined(_XOPEN_SOURCE) || ((_XOPEN_SOURCE - 0) < 500) - #undef _XOPEN_SOURCE - #define _XOPEN_SOURCE 500 - #endif -#endif - -/* Generic includes */ -#include - -/* Platform specific includes */ -#if defined(_TTHREAD_POSIX_) - #include - #include -#elif defined(_TTHREAD_WIN32_) - #ifndef WIN32_LEAN_AND_MEAN - #define WIN32_LEAN_AND_MEAN - #define __UNDEF_LEAN_AND_MEAN - #endif - #include - #ifdef __UNDEF_LEAN_AND_MEAN - #undef WIN32_LEAN_AND_MEAN - #undef __UNDEF_LEAN_AND_MEAN - #endif -#endif - -/* Workaround for missing TIME_UTC: If time.h doesn't provide TIME_UTC, - it's quite likely that libc does not support it either. Hence, fall back to - the only other supported time specifier: CLOCK_REALTIME (and if that fails, - we're probably emulating clock_gettime anyway, so anything goes). */ -#ifndef TIME_UTC - #ifdef CLOCK_REALTIME - #define TIME_UTC CLOCK_REALTIME - #else - #define TIME_UTC 0 - #endif -#endif - -/* Workaround for missing clock_gettime (most Windows compilers, afaik) */ -#if defined(_TTHREAD_WIN32_) || defined(__APPLE_CC__) -#define _TTHREAD_EMULATE_CLOCK_GETTIME_ -/* Emulate struct timespec */ -#if defined(_TTHREAD_WIN32_) -struct _ttherad_timespec { - time_t tv_sec; - long tv_nsec; -}; -#define timespec _ttherad_timespec -#endif - -/* Emulate clockid_t */ -typedef int _tthread_clockid_t; -#define clockid_t _tthread_clockid_t - -/* Emulate clock_gettime */ -int _tthread_clock_gettime(clockid_t clk_id, struct timespec *ts); -#define clock_gettime _tthread_clock_gettime -#ifndef CLOCK_REALTIME - #define CLOCK_REALTIME 0 -#endif -#endif - - -/** TinyCThread version (major number). */ -#define TINYCTHREAD_VERSION_MAJOR 1 -/** TinyCThread version (minor number). */ -#define TINYCTHREAD_VERSION_MINOR 1 -/** TinyCThread version (full version). */ -#define TINYCTHREAD_VERSION (TINYCTHREAD_VERSION_MAJOR * 100 + TINYCTHREAD_VERSION_MINOR) - -/** -* @def _Thread_local -* Thread local storage keyword. -* A variable that is declared with the @c _Thread_local keyword makes the -* value of the variable local to each thread (known as thread-local storage, -* or TLS). Example usage: -* @code -* // This variable is local to each thread. -* _Thread_local int variable; -* @endcode -* @note The @c _Thread_local keyword is a macro that maps to the corresponding -* compiler directive (e.g. @c __declspec(thread)). -* @note This directive is currently not supported on Mac OS X (it will give -* a compiler error), since compile-time TLS is not supported in the Mac OS X -* executable format. Also, some older versions of MinGW (before GCC 4.x) do -* not support this directive. -* @hideinitializer -*/ - -/* FIXME: Check for a PROPER value of __STDC_VERSION__ to know if we have C11 */ -#if !(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201102L)) && !defined(_Thread_local) - #if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__SUNPRO_CC) || defined(__IBMCPP__) - #define _Thread_local __thread - #else - #define _Thread_local __declspec(thread) - #endif -#endif - -/* Macros */ -#define TSS_DTOR_ITERATIONS 0 - -/* Function return values */ -#define thrd_error 0 /**< The requested operation failed */ -#define thrd_success 1 /**< The requested operation succeeded */ -#define thrd_timeout 2 /**< The time specified in the call was reached without acquiring the requested resource */ -#define thrd_busy 3 /**< The requested operation failed because a tesource requested by a test and return function is already in use */ -#define thrd_nomem 4 /**< The requested operation failed because it was unable to allocate memory */ - -/* Mutex types */ -#define mtx_plain 1 -#define mtx_timed 2 -#define mtx_try 4 -#define mtx_recursive 8 - -/* Mutex */ -#if defined(_TTHREAD_WIN32_) -typedef struct { - CRITICAL_SECTION mHandle; /* Critical section handle */ - int mAlreadyLocked; /* TRUE if the mutex is already locked */ - int mRecursive; /* TRUE if the mutex is recursive */ -} mtx_t; -#else -typedef pthread_mutex_t mtx_t; -#endif - -/** Create a mutex object. -* @param mtx A mutex object. -* @param type Bit-mask that must have one of the following six values: -* @li @c mtx_plain for a simple non-recursive mutex -* @li @c mtx_timed for a non-recursive mutex that supports timeout -* @li @c mtx_try for a non-recursive mutex that supports test and return -* @li @c mtx_plain | @c mtx_recursive (same as @c mtx_plain, but recursive) -* @li @c mtx_timed | @c mtx_recursive (same as @c mtx_timed, but recursive) -* @li @c mtx_try | @c mtx_recursive (same as @c mtx_try, but recursive) -* @return @ref thrd_success on success, or @ref thrd_error if the request could -* not be honored. -*/ -int mtx_init(mtx_t *mtx, int type); - -/** Release any resources used by the given mutex. -* @param mtx A mutex object. -*/ -void mtx_destroy(mtx_t *mtx); - -/** Lock the given mutex. -* Blocks until the given mutex can be locked. If the mutex is non-recursive, and -* the calling thread already has a lock on the mutex, this call will block -* forever. -* @param mtx A mutex object. -* @return @ref thrd_success on success, or @ref thrd_error if the request could -* not be honored. -*/ -int mtx_lock(mtx_t *mtx); - -/** NOT YET IMPLEMENTED. -*/ -int mtx_timedlock(mtx_t *mtx, const struct timespec *ts); - -/** Try to lock the given mutex. -* The specified mutex shall support either test and return or timeout. If the -* mutex is already locked, the function returns without blocking. -* @param mtx A mutex object. -* @return @ref thrd_success on success, or @ref thrd_busy if the resource -* requested is already in use, or @ref thrd_error if the request could not be -* honored. -*/ -int mtx_trylock(mtx_t *mtx); - -/** Unlock the given mutex. -* @param mtx A mutex object. -* @return @ref thrd_success on success, or @ref thrd_error if the request could -* not be honored. -*/ -int mtx_unlock(mtx_t *mtx); - -/* Condition variable */ -#if defined(_TTHREAD_WIN32_) -typedef struct { - HANDLE mEvents[2]; /* Signal and broadcast event HANDLEs. */ - unsigned int mWaitersCount; /* Count of the number of waiters. */ - CRITICAL_SECTION mWaitersCountLock; /* Serialize access to mWaitersCount. */ -} cnd_t; -#else -typedef pthread_cond_t cnd_t; -#endif - -/** Create a condition variable object. -* @param cond A condition variable object. -* @return @ref thrd_success on success, or @ref thrd_error if the request could -* not be honored. -*/ -int cnd_init(cnd_t *cond); - -/** Release any resources used by the given condition variable. -* @param cond A condition variable object. -*/ -void cnd_destroy(cnd_t *cond); - -/** Signal a condition variable. -* Unblocks one of the threads that are blocked on the given condition variable -* at the time of the call. If no threads are blocked on the condition variable -* at the time of the call, the function does nothing and return success. -* @param cond A condition variable object. -* @return @ref thrd_success on success, or @ref thrd_error if the request could -* not be honored. -*/ -int cnd_signal(cnd_t *cond); - -/** Broadcast a condition variable. -* Unblocks all of the threads that are blocked on the given condition variable -* at the time of the call. If no threads are blocked on the condition variable -* at the time of the call, the function does nothing and return success. -* @param cond A condition variable object. -* @return @ref thrd_success on success, or @ref thrd_error if the request could -* not be honored. -*/ -int cnd_broadcast(cnd_t *cond); - -/** Wait for a condition variable to become signaled. -* The function atomically unlocks the given mutex and endeavors to block until -* the given condition variable is signaled by a call to cnd_signal or to -* cnd_broadcast. When the calling thread becomes unblocked it locks the mutex -* before it returns. -* @param cond A condition variable object. -* @param mtx A mutex object. -* @return @ref thrd_success on success, or @ref thrd_error if the request could -* not be honored. -*/ -int cnd_wait(cnd_t *cond, mtx_t *mtx); - -/** Wait for a condition variable to become signaled. -* The function atomically unlocks the given mutex and endeavors to block until -* the given condition variable is signaled by a call to cnd_signal or to -* cnd_broadcast, or until after the specified time. When the calling thread -* becomes unblocked it locks the mutex before it returns. -* @param cond A condition variable object. -* @param mtx A mutex object. -* @param xt A point in time at which the request will time out (absolute time). -* @return @ref thrd_success upon success, or @ref thrd_timeout if the time -* specified in the call was reached without acquiring the requested resource, or -* @ref thrd_error if the request could not be honored. -*/ -int cnd_timedwait(cnd_t *cond, mtx_t *mtx, const struct timespec *ts); - -/* Thread */ -#if defined(_TTHREAD_WIN32_) -typedef HANDLE thrd_t; -#else -typedef pthread_t thrd_t; -#endif - -/** Thread start function. -* Any thread that is started with the @ref thrd_create() function must be -* started through a function of this type. -* @param arg The thread argument (the @c arg argument of the corresponding -* @ref thrd_create() call). -* @return The thread return value, which can be obtained by another thread -* by using the @ref thrd_join() function. -*/ -typedef int (*thrd_start_t)(void *arg); - -/** Create a new thread. -* @param thr Identifier of the newly created thread. -* @param func A function pointer to the function that will be executed in -* the new thread. -* @param arg An argument to the thread function. -* @return @ref thrd_success on success, or @ref thrd_nomem if no memory could -* be allocated for the thread requested, or @ref thrd_error if the request -* could not be honored. -* @note A thread’s identifier may be reused for a different thread once the -* original thread has exited and either been detached or joined to another -* thread. -*/ -int thrd_create(thrd_t *thr, thrd_start_t func, void *arg); - -/** Identify the calling thread. -* @return The identifier of the calling thread. -*/ -thrd_t thrd_current(void); - -/** NOT YET IMPLEMENTED. -*/ -int thrd_detach(thrd_t thr); - -/** Compare two thread identifiers. -* The function determines if two thread identifiers refer to the same thread. -* @return Zero if the two thread identifiers refer to different threads. -* Otherwise a nonzero value is returned. -*/ -int thrd_equal(thrd_t thr0, thrd_t thr1); - -/** Terminate execution of the calling thread. -* @param res Result code of the calling thread. -*/ -void thrd_exit(int res); - -/** Wait for a thread to terminate. -* The function joins the given thread with the current thread by blocking -* until the other thread has terminated. -* @param thr The thread to join with. -* @param res If this pointer is not NULL, the function will store the result -* code of the given thread in the integer pointed to by @c res. -* @return @ref thrd_success on success, or @ref thrd_error if the request could -* not be honored. -*/ -int thrd_join(thrd_t thr, int *res); - -/** Put the calling thread to sleep. -* Suspend execution of the calling thread. -* @param time_point A point in time at which the thread will resume (absolute time). -* @param remaining If non-NULL, this parameter will hold the remaining time until -* time_point upon return. This will typically be zero, but if -* the thread was woken up by a signal that is not ignored before -* time_point was reached @c remaining will hold a positive -* time. -* @return 0 (zero) on successful sleep, or -1 if an interrupt occurred. -*/ -int thrd_sleep(const struct timespec *time_point, struct timespec *remaining); - -/** Yield execution to another thread. -* Permit other threads to run, even if the current thread would ordinarily -* continue to run. -*/ -void thrd_yield(void); - -/* Thread local storage */ -#if defined(_TTHREAD_WIN32_) -typedef DWORD tss_t; -#else -typedef pthread_key_t tss_t; -#endif - -/** Destructor function for a thread-specific storage. -* @param val The value of the destructed thread-specific storage. -*/ -typedef void (*tss_dtor_t)(void *val); - -/** Create a thread-specific storage. -* @param key The unique key identifier that will be set if the function is -* successful. -* @param dtor Destructor function. This can be NULL. -* @return @ref thrd_success on success, or @ref thrd_error if the request could -* not be honored. -* @note The destructor function is not supported under Windows. If @c dtor is -* not NULL when calling this function under Windows, the function will fail -* and return @ref thrd_error. -*/ -int tss_create(tss_t *key, tss_dtor_t dtor); - -/** Delete a thread-specific storage. -* The function releases any resources used by the given thread-specific -* storage. -* @param key The key that shall be deleted. -*/ -void tss_delete(tss_t key); - -/** Get the value for a thread-specific storage. -* @param key The thread-specific storage identifier. -* @return The value for the current thread held in the given thread-specific -* storage. -*/ -void *tss_get(tss_t key); - -/** Set the value for a thread-specific storage. -* @param key The thread-specific storage identifier. -* @param val The value of the thread-specific storage to set for the current -* thread. -* @return @ref thrd_success on success, or @ref thrd_error if the request could -* not be honored. -*/ -int tss_set(tss_t key, void *val); - - -#endif /* _TINYTHREAD_H_ */ - diff --git a/3rdparty/glfw/source/deps/vs2008/stdint.h b/3rdparty/glfw/source/deps/vs2008/stdint.h deleted file mode 100644 index d02608a..0000000 --- a/3rdparty/glfw/source/deps/vs2008/stdint.h +++ /dev/null @@ -1,247 +0,0 @@ -// ISO C9x compliant stdint.h for Microsoft Visual Studio -// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 -// -// Copyright (c) 2006-2008 Alexander Chemeris -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. The name of the author may be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED -// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _MSC_VER // [ -#error "Use this header only with Microsoft Visual C++ compilers!" -#endif // _MSC_VER ] - -#ifndef _MSC_STDINT_H_ // [ -#define _MSC_STDINT_H_ - -#if _MSC_VER > 1000 -#pragma once -#endif - -#include - -// For Visual Studio 6 in C++ mode and for many Visual Studio versions when -// compiling for ARM we should wrap include with 'extern "C++" {}' -// or compiler give many errors like this: -// error C2733: second C linkage of overloaded function 'wmemchr' not allowed -#ifdef __cplusplus -extern "C" { -#endif -# include -#ifdef __cplusplus -} -#endif - -// Define _W64 macros to mark types changing their size, like intptr_t. -#ifndef _W64 -# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 -# define _W64 __w64 -# else -# define _W64 -# endif -#endif - - -// 7.18.1 Integer types - -// 7.18.1.1 Exact-width integer types - -// Visual Studio 6 and Embedded Visual C++ 4 doesn't -// realize that, e.g. char has the same size as __int8 -// so we give up on __intX for them. -#if (_MSC_VER < 1300) - typedef signed char int8_t; - typedef signed short int16_t; - typedef signed int int32_t; - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; - typedef unsigned int uint32_t; -#else - typedef signed __int8 int8_t; - typedef signed __int16 int16_t; - typedef signed __int32 int32_t; - typedef unsigned __int8 uint8_t; - typedef unsigned __int16 uint16_t; - typedef unsigned __int32 uint32_t; -#endif -typedef signed __int64 int64_t; -typedef unsigned __int64 uint64_t; - - -// 7.18.1.2 Minimum-width integer types -typedef int8_t int_least8_t; -typedef int16_t int_least16_t; -typedef int32_t int_least32_t; -typedef int64_t int_least64_t; -typedef uint8_t uint_least8_t; -typedef uint16_t uint_least16_t; -typedef uint32_t uint_least32_t; -typedef uint64_t uint_least64_t; - -// 7.18.1.3 Fastest minimum-width integer types -typedef int8_t int_fast8_t; -typedef int16_t int_fast16_t; -typedef int32_t int_fast32_t; -typedef int64_t int_fast64_t; -typedef uint8_t uint_fast8_t; -typedef uint16_t uint_fast16_t; -typedef uint32_t uint_fast32_t; -typedef uint64_t uint_fast64_t; - -// 7.18.1.4 Integer types capable of holding object pointers -#ifdef _WIN64 // [ - typedef signed __int64 intptr_t; - typedef unsigned __int64 uintptr_t; -#else // _WIN64 ][ - typedef _W64 signed int intptr_t; - typedef _W64 unsigned int uintptr_t; -#endif // _WIN64 ] - -// 7.18.1.5 Greatest-width integer types -typedef int64_t intmax_t; -typedef uint64_t uintmax_t; - - -// 7.18.2 Limits of specified-width integer types - -#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 - -// 7.18.2.1 Limits of exact-width integer types -#define INT8_MIN ((int8_t)_I8_MIN) -#define INT8_MAX _I8_MAX -#define INT16_MIN ((int16_t)_I16_MIN) -#define INT16_MAX _I16_MAX -#define INT32_MIN ((int32_t)_I32_MIN) -#define INT32_MAX _I32_MAX -#define INT64_MIN ((int64_t)_I64_MIN) -#define INT64_MAX _I64_MAX -#define UINT8_MAX _UI8_MAX -#define UINT16_MAX _UI16_MAX -#define UINT32_MAX _UI32_MAX -#define UINT64_MAX _UI64_MAX - -// 7.18.2.2 Limits of minimum-width integer types -#define INT_LEAST8_MIN INT8_MIN -#define INT_LEAST8_MAX INT8_MAX -#define INT_LEAST16_MIN INT16_MIN -#define INT_LEAST16_MAX INT16_MAX -#define INT_LEAST32_MIN INT32_MIN -#define INT_LEAST32_MAX INT32_MAX -#define INT_LEAST64_MIN INT64_MIN -#define INT_LEAST64_MAX INT64_MAX -#define UINT_LEAST8_MAX UINT8_MAX -#define UINT_LEAST16_MAX UINT16_MAX -#define UINT_LEAST32_MAX UINT32_MAX -#define UINT_LEAST64_MAX UINT64_MAX - -// 7.18.2.3 Limits of fastest minimum-width integer types -#define INT_FAST8_MIN INT8_MIN -#define INT_FAST8_MAX INT8_MAX -#define INT_FAST16_MIN INT16_MIN -#define INT_FAST16_MAX INT16_MAX -#define INT_FAST32_MIN INT32_MIN -#define INT_FAST32_MAX INT32_MAX -#define INT_FAST64_MIN INT64_MIN -#define INT_FAST64_MAX INT64_MAX -#define UINT_FAST8_MAX UINT8_MAX -#define UINT_FAST16_MAX UINT16_MAX -#define UINT_FAST32_MAX UINT32_MAX -#define UINT_FAST64_MAX UINT64_MAX - -// 7.18.2.4 Limits of integer types capable of holding object pointers -#ifdef _WIN64 // [ -# define INTPTR_MIN INT64_MIN -# define INTPTR_MAX INT64_MAX -# define UINTPTR_MAX UINT64_MAX -#else // _WIN64 ][ -# define INTPTR_MIN INT32_MIN -# define INTPTR_MAX INT32_MAX -# define UINTPTR_MAX UINT32_MAX -#endif // _WIN64 ] - -// 7.18.2.5 Limits of greatest-width integer types -#define INTMAX_MIN INT64_MIN -#define INTMAX_MAX INT64_MAX -#define UINTMAX_MAX UINT64_MAX - -// 7.18.3 Limits of other integer types - -#ifdef _WIN64 // [ -# define PTRDIFF_MIN _I64_MIN -# define PTRDIFF_MAX _I64_MAX -#else // _WIN64 ][ -# define PTRDIFF_MIN _I32_MIN -# define PTRDIFF_MAX _I32_MAX -#endif // _WIN64 ] - -#define SIG_ATOMIC_MIN INT_MIN -#define SIG_ATOMIC_MAX INT_MAX - -#ifndef SIZE_MAX // [ -# ifdef _WIN64 // [ -# define SIZE_MAX _UI64_MAX -# else // _WIN64 ][ -# define SIZE_MAX _UI32_MAX -# endif // _WIN64 ] -#endif // SIZE_MAX ] - -// WCHAR_MIN and WCHAR_MAX are also defined in -#ifndef WCHAR_MIN // [ -# define WCHAR_MIN 0 -#endif // WCHAR_MIN ] -#ifndef WCHAR_MAX // [ -# define WCHAR_MAX _UI16_MAX -#endif // WCHAR_MAX ] - -#define WINT_MIN 0 -#define WINT_MAX _UI16_MAX - -#endif // __STDC_LIMIT_MACROS ] - - -// 7.18.4 Limits of other integer types - -#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 - -// 7.18.4.1 Macros for minimum-width integer constants - -#define INT8_C(val) val##i8 -#define INT16_C(val) val##i16 -#define INT32_C(val) val##i32 -#define INT64_C(val) val##i64 - -#define UINT8_C(val) val##ui8 -#define UINT16_C(val) val##ui16 -#define UINT32_C(val) val##ui32 -#define UINT64_C(val) val##ui64 - -// 7.18.4.2 Macros for greatest-width integer constants -#define INTMAX_C INT64_C -#define UINTMAX_C UINT64_C - -#endif // __STDC_CONSTANT_MACROS ] - - -#endif // _MSC_STDINT_H_ ] diff --git a/3rdparty/glfw/source/docs/CMakeLists.txt b/3rdparty/glfw/source/docs/CMakeLists.txt deleted file mode 100644 index 79cad56..0000000 --- a/3rdparty/glfw/source/docs/CMakeLists.txt +++ /dev/null @@ -1,46 +0,0 @@ - -# NOTE: The order of this list determines the order of items in the Guides -# (i.e. Pages) list in the generated documentation -set(source_files - main.dox - news.dox - quick.dox - moving.dox - compile.dox - build.dox - intro.dox - context.dox - monitor.dox - window.dox - input.dox - vulkan.dox - compat.dox - internal.dox) - -set(extra_files DoxygenLayout.xml header.html footer.html extra.css spaces.svg) - -set(header_paths - "${GLFW_SOURCE_DIR}/include/GLFW/glfw3.h" - "${GLFW_SOURCE_DIR}/include/GLFW/glfw3native.h") - -# Format the source list into a Doxyfile INPUT value that Doxygen can parse -foreach(path IN LISTS header_paths) - string(APPEND GLFW_DOXYGEN_INPUT " \\\n\"${path}\"") -endforeach() -foreach(file IN LISTS source_files) - string(APPEND GLFW_DOXYGEN_INPUT " \\\n\"${CMAKE_CURRENT_SOURCE_DIR}/${file}\"") -endforeach() - -configure_file(Doxyfile.in Doxyfile @ONLY) - -add_custom_command(OUTPUT "html/index.html" - COMMAND "${DOXYGEN_EXECUTABLE}" - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" - MAIN_DEPENDENCY Doxyfile - DEPENDS ${header_paths} ${source_files} ${extra_files} - COMMENT "Generating HTML documentation" - VERBATIM) - -add_custom_target(docs ALL SOURCES "html/index.html") -set_target_properties(docs PROPERTIES FOLDER "GLFW3") - diff --git a/3rdparty/glfw/source/docs/CODEOWNERS b/3rdparty/glfw/source/docs/CODEOWNERS deleted file mode 100644 index 018808b..0000000 --- a/3rdparty/glfw/source/docs/CODEOWNERS +++ /dev/null @@ -1,10 +0,0 @@ - -* @elmindreda - -src/wl_* @linkmauve - -docs/*.css @glfw/webdev -docs/*.scss @glfw/webdev -docs/*.html @glfw/webdev -docs/*.xml @glfw/webdev - diff --git a/3rdparty/glfw/source/docs/CONTRIBUTING.md b/3rdparty/glfw/source/docs/CONTRIBUTING.md deleted file mode 100644 index 11ddf09..0000000 --- a/3rdparty/glfw/source/docs/CONTRIBUTING.md +++ /dev/null @@ -1,391 +0,0 @@ -# Contribution Guide - -## Contents - -- [Asking a question](#asking-a-question) -- [Reporting a bug](#reporting-a-bug) - - [Reporting a compile or link bug](#reporting-a-compile-or-link-bug) - - [Reporting a segfault or other crash bug](#reporting-a-segfault-or-other-crash-bug) - - [Reporting a context creation bug](#reporting-a-context-creation-bug) - - [Reporting a monitor or video mode bug](#reporting-a-monitor-or-video-mode-bug) - - [Reporting a window, input or event bug](#reporting-a-window-input-or-event-bug) - - [Reporting some other library bug](#reporting-some-other-library-bug) - - [Reporting a documentation bug](#reporting-a-documentation-bug) - - [Reporting a website bug](#reporting-a-website-bug) -- [Requesting a feature](#requesting-a-feature) -- [Contributing a bug fix](#contributing-a-bug-fix) -- [Contributing a feature](#contributing-a-feature) - - -## Asking a question - -Questions about how to use GLFW should be asked either in the [support -section](https://discourse.glfw.org/c/support) of the forum, under the [Stack -Overflow tag](https://stackoverflow.com/questions/tagged/glfw) or [Game -Development tag](https://gamedev.stackexchange.com/questions/tagged/glfw) on -Stack Exchange or in the IRC channel `#glfw` on -[Libera.Chat](https://libera.chat/). - -Questions about the design or implementation of GLFW or about future plans -should be asked in the [dev section](https://discourse.glfw.org/c/dev) of the -forum or in the IRC channel. Please don't open a GitHub issue to discuss design -questions without first checking with a maintainer. - - -## Reporting a bug - -If GLFW is behaving unexpectedly at run-time, start by setting an [error -callback](https://www.glfw.org/docs/latest/intro_guide.html#error_handling). -GLFW will often tell you the cause of an error via this callback. If it -doesn't, that might be a separate bug. - -If GLFW is crashing or triggering asserts, make sure that all your object -handles and other pointers are valid. - -For bugs where it makes sense, a short, self contained example is absolutely -invaluable. Just put it inline in the body text. Note that if the bug is -reproducible with one of the test programs that come with GLFW, just mention -that instead. - -__Don't worry about adding too much information__. Unimportant information can -be abbreviated or removed later, but missing information can stall bug fixing, -especially when your schedule doesn't align with that of the maintainer. - -__Please provide text as text, not as images__. This includes code, error -messages and any other text. Text in images cannot be found by other users -searching for the same problem and may have to be re-typed by maintainers when -debugging. - -You don't need to manually indent your code or other text to quote it with -GitHub Markdown; just surround it with triple backticks: - - ``` - Some quoted text. - ``` - -You can also add syntax highlighting by appending the common file extension: - - ```c - int five(void) - { - return 5; - } - ``` - -There are issue labels for both platforms and GPU manufacturers, so there is no -need to mention these in the subject line. If you do, it will be removed when -the issue is labeled. - -If your bug is already reported, please add any new information you have, or if -it already has everything, give it a :+1:. - - -### Reporting a compile or link bug - -__Note:__ GLFW needs many system APIs to do its job, which on some platforms -means linking to many system libraries. If you are using GLFW as a static -library, that means your application needs to link to these in addition to GLFW. - -__Note:__ Check the [Compiling -GLFW](https://www.glfw.org/docs/latest/compile.html) guide and or [Building -applications](https://www.glfw.org/docs/latest/build.html) guide for before -opening an issue of this kind. Most issues are caused by a missing package or -linker flag. - -Always include the __operating system name and version__ (e.g. `Windows -7 64-bit` or `Ubuntu 15.10`) and the __compiler name and version__ (e.g. `Visual -C++ 2015 Update 2`). If you are using an official release of GLFW, -include the __GLFW release version__ (e.g. `3.1.2`), otherwise include the -__GLFW commit ID__ (e.g. `3795d78b14ef06008889cc422a1fb8d642597751`) from Git. - -Please also include the __complete build log__ from your compiler and linker, -even if it's long. It can always be shortened later, if necessary. - - -#### Quick template - -``` -OS and version: -Compiler version: -Release or commit: -Build log: -``` - - -### Reporting a segfault or other crash bug - -Always include the __operating system name and version__ (e.g. `Windows -7 64-bit` or `Ubuntu 15.10`). If you are using an official release of GLFW, -include the __GLFW release version__ (e.g. `3.1.2`), otherwise include the -__GLFW commit ID__ (e.g. `3795d78b14ef06008889cc422a1fb8d642597751`) from Git. - -Please also include any __error messages__ provided to your application via the -[error -callback](https://www.glfw.org/docs/latest/intro_guide.html#error_handling) and -the __full call stack__ of the crash, or if the crash does not occur in debug -mode, mention that instead. - - -#### Quick template - -``` -OS and version: -Release or commit: -Error messages: -Call stack: -``` - - -### Reporting a context creation bug - -__Note:__ Windows ships with graphics drivers that do not support OpenGL. If -GLFW says that your machine lacks support for OpenGL, it very likely does. -Install drivers from the computer manufacturer or graphics card manufacturer -([Nvidia](https://www.geforce.com/drivers), -[AMD](https://www.amd.com/en/support), -[Intel](https://www-ssl.intel.com/content/www/us/en/support/detect.html)) to -fix this. - -__Note:__ AMD only supports OpenGL ES on Windows via EGL. See the -[GLFW\_CONTEXT\_CREATION\_API](https://www.glfw.org/docs/latest/window_guide.html#window_hints_ctx) -hint for how to select EGL. - -Please verify that context creation also fails with the `glfwinfo` tool before -reporting it as a bug. This tool is included in the GLFW source tree as -`tests/glfwinfo.c` and is built along with the library. It has switches for all -GLFW context and framebuffer hints. Run `glfwinfo -h` for a complete list. - -Always include the __operating system name and version__ (e.g. `Windows -7 64-bit` or `Ubuntu 15.10`). If you are using an official release of GLFW, -include the __GLFW release version__ (e.g. `3.1.2`), otherwise include the -__GLFW commit ID__ (e.g. `3795d78b14ef06008889cc422a1fb8d642597751`) from Git. - -If you are running your program in a virtual machine, please mention this and -include the __VM name and version__ (e.g. `VirtualBox 5.1`). - -Please also include the __GLFW version string__ (`3.2.0 X11 EGL clock_gettime -/dev/js`), as described -[here](https://www.glfw.org/docs/latest/intro.html#intro_version_string), the -__GPU model and driver version__ (e.g. `GeForce GTX660 with 352.79`), and the -__output of `glfwinfo`__ (with switches matching any hints you set in your -code) when reporting this kind of bug. If this tool doesn't run on the machine, -mention that instead. - - -#### Quick template - -``` -OS and version: -GPU and driver: -Release or commit: -Version string: -glfwinfo output: -``` - - -### Reporting a monitor or video mode bug - -__Note:__ On headless systems on some platforms, no monitors are reported. This -causes glfwGetPrimaryMonitor to return `NULL`, which not all applications are -prepared for. - -__Note:__ Some third-party tools report more video modes than are approved of -by the OS. For safety and compatibility, GLFW only reports video modes the OS -wants programs to use. This is not a bug. - -The `monitors` tool is included in the GLFW source tree as `tests/monitors.c` -and is built along with the library. It lists all information GLFW provides -about monitors it detects. - -Always include the __operating system name and version__ (e.g. `Windows -7 64-bit` or `Ubuntu 15.10`). If you are using an official release of GLFW, -include the __GLFW release version__ (e.g. `3.1.2`), otherwise include the -__GLFW commit ID__ (e.g. `3795d78b14ef06008889cc422a1fb8d642597751`) from Git. - -If you are running your program in a virtual machine, please mention this and -include the __VM name and version__ (e.g. `VirtualBox 5.1`). - -Please also include any __error messages__ provided to your application via the -[error -callback](https://www.glfw.org/docs/latest/intro_guide.html#error_handling) and -the __output of `monitors`__ when reporting this kind of bug. If this tool -doesn't run on the machine, mention this instead. - - -#### Quick template - -``` -OS and version: -Release or commit: -Error messages: -monitors output: -``` - - -### Reporting a window, input or event bug - -__Note:__ The exact ordering of related window events will sometimes differ. - -__Note:__ Window moving and resizing (by the user) will block the main thread on -some platforms. This is not a bug. Set a [refresh -callback](https://www.glfw.org/docs/latest/window.html#window_refresh) if you -want to keep the window contents updated during a move or size operation. - -The `events` tool is included in the GLFW source tree as `tests/events.c` and is -built along with the library. It prints all information provided to every -callback supported by GLFW as events occur. Each event is listed with the time -and a unique number to make discussions about event logs easier. The tool has -command-line options for creating multiple windows and full screen windows. - -Always include the __operating system name and version__ (e.g. `Windows -7 64-bit` or `Ubuntu 15.10`). If you are using an official release of GLFW, -include the __GLFW release version__ (e.g. `3.1.2`), otherwise include the -__GLFW commit ID__ (e.g. `3795d78b14ef06008889cc422a1fb8d642597751`) from Git. - -If you are running your program in a virtual machine, please mention this and -include the __VM name and version__ (e.g. `VirtualBox 5.1`). - -Please also include any __error messages__ provided to your application via the -[error -callback](https://www.glfw.org/docs/latest/intro_guide.html#error_handling) and -if relevant, the __output of `events`__ when reporting this kind of bug. If -this tool doesn't run on the machine, mention this instead. - -__X11:__ If possible, please include what desktop environment (e.g. GNOME, -Unity, KDE) and/or window manager (e.g. Openbox, dwm, Window Maker) you are -running. If the bug is related to keyboard input, please include any input -method (e.g. ibus, SCIM) you are using. - - -#### Quick template - -``` -OS and version: -Release or commit: -Error messages: -events output: -``` - - -### Reporting some other library bug - -Always include the __operating system name and version__ (e.g. `Windows -7 64-bit` or `Ubuntu 15.10`). If you are using an official release of GLFW, -include the __GLFW release version__ (e.g. `3.1.2`), otherwise include the -__GLFW commit ID__ (e.g. `3795d78b14ef06008889cc422a1fb8d642597751`) from Git. - -Please also include any __error messages__ provided to your application via the -[error -callback](https://www.glfw.org/docs/latest/intro_guide.html#error_handling), if -relevant. - - -#### Quick template - -``` -OS and version: -Release or commit: -Error messages: -``` - - -### Reporting a documentation bug - -If you found a bug in the documentation, including this file, then it's fine to -just link to that web page or mention that source file. You don't need to match -the source to the output or vice versa. - - -### Reporting a website bug - -If the bug is in the documentation (anything under `/docs/`) then please see the -section above. Bugs in the rest of the site are reported to the [website -source repository](https://github.com/glfw/website/issues). - - -## Requesting a feature - -Please explain why you need the feature and how you intend to use it. If you -have a specific API design in mind, please add that as well. If you have or are -planning to write code for the feature, see the section below. - -If there already is a request for the feature you need, add your specific use -case unless it is already mentioned. If it is, give it a :+1:. - - -## Contributing a bug fix - -__Note:__ You must have all necessary [intellectual -property rights](https://en.wikipedia.org/wiki/Intellectual_property) to any -code you contribute. If you did not write the code yourself, you must explain -where it came from and under what license you received it. Even code using the -same license as GLFW may not be copied without attribution. - -__There is no preferred patch size__. A one character fix is just as welcome as -a thousand line one, if that is the appropriate size for the fix. - -In addition to the code, a complete bug fix includes: - -- Change log entry in `README.md`, describing the incorrect behavior -- Credits entries for all authors of the bug fix - -Bug fixes will not be rejected because they don't include all the above parts, -but please keep in mind that maintainer time is finite and that there are many -other bugs and features to work on. - -If the patch fixes a bug introduced after the last release, it should not get -a change log entry. - -If you haven't already, read the excellent article [How to Write a Git Commit -Message](https://chris.beams.io/posts/git-commit/). - - -## Contributing a feature - -__Note:__ You must have all necessary rights to any code you contribute. If you -did not write the code yourself, you must explain where it came from and under -what license. Even code using the same license as GLFW may not be copied -without attribution. - -__Note:__ If you haven't already implemented the feature, check first if there -already is an open issue for it and if it's already being developed in an -[experimental branch](https://github.com/glfw/glfw/branches/all). - -__There is no preferred patch size__. A one character change is just as welcome -as one adding a thousand line one, if that is the appropriate size for the -feature. - -In addition to the code, a complete feature includes: - -- Change log entry in `README.md`, listing all new symbols -- News page entry, briefly describing the feature -- Guide documentation, with minimal examples, in the relevant guide -- Reference documentation, with all applicable tags -- Cross-references and mentions in appropriate places -- Credits entries for all authors of the feature - -If the feature requires platform-specific code, at minimum stubs must be added -for the new platform function to all supported and experimental platforms. - -If it adds a new callback, support for it must be added to `tests/event.c`. - -If it adds a new monitor property, support for it must be added to -`tests/monitor.c`. - -If it adds a new OpenGL, OpenGL ES or Vulkan option or extension, support -for it must be added to `tests/glfwinfo.c` and the behavior of the library when -the extension is missing documented in `docs/compat.dox`. - -If you haven't already, read the excellent article [How to Write a Git Commit -Message](https://chris.beams.io/posts/git-commit/). - -Features will not be rejected because they don't include all the above parts, -but please keep in mind that maintainer time is finite and that there are many -other features and bugs to work on. - -Please also keep in mind that any part of the public API that has been included -in a release cannot be changed until the next _major_ version. Features can be -added and existing parts can sometimes be overloaded (in the general sense of -doing more things, not in the C++ sense), but code written to the API of one -minor release should both compile and run on subsequent minor releases. - diff --git a/3rdparty/glfw/source/docs/Doxyfile.in b/3rdparty/glfw/source/docs/Doxyfile.in deleted file mode 100644 index 812eec5..0000000 --- a/3rdparty/glfw/source/docs/Doxyfile.in +++ /dev/null @@ -1,2465 +0,0 @@ -# Doxyfile 1.8.18 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a double hash (##) is considered a comment and is placed in -# front of the TAG it is preceding. -# -# All text after a single hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists, items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (\" \"). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the configuration -# file that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# https://www.gnu.org/software/libiconv/ for the list of possible encodings. -# The default value is: UTF-8. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by -# double-quotes, unless you are using Doxywizard) that should identify the -# project for which the documentation is generated. This name is used in the -# title of most generated pages and in a few other places. -# The default value is: My Project. - -PROJECT_NAME = "GLFW" - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. This -# could be handy for archiving the generated documentation or if some version -# control system is used. - -PROJECT_NUMBER = @GLFW_VERSION@ - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer a -# quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = "A multi-platform library for OpenGL, window and input" - -# With the PROJECT_LOGO tag one can specify a logo or an icon that is included -# in the documentation. The maximum height of the logo should not exceed 55 -# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy -# the logo to the output directory. - -PROJECT_LOGO = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path -# into which the generated documentation will be written. If a relative path is -# entered, it will be relative to the location where doxygen was started. If -# left blank the current directory will be used. - -OUTPUT_DIRECTORY = "@GLFW_BINARY_DIR@/docs" - -# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- -# directories (in 2 levels) under the output directory of each output format and -# will distribute the generated files over these directories. Enabling this -# option can be useful when feeding doxygen a huge amount of source files, where -# putting all generated files in the same directory would otherwise causes -# performance problems for the file system. -# The default value is: NO. - -CREATE_SUBDIRS = NO - -# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII -# characters to appear in the names of generated files. If set to NO, non-ASCII -# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode -# U+3044. -# The default value is: NO. - -ALLOW_UNICODE_NAMES = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, -# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), -# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, -# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, -# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, -# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, -# Ukrainian and Vietnamese. -# The default value is: English. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member -# descriptions after the members that are listed in the file and class -# documentation (similar to Javadoc). Set to NO to disable this. -# The default value is: YES. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief -# description of a member or function before the detailed description -# -# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. -# The default value is: YES. - -REPEAT_BRIEF = NO - -# This tag implements a quasi-intelligent brief description abbreviator that is -# used to form the text in various listings. Each string in this list, if found -# as the leading text of the brief description, will be stripped from the text -# and the result, after processing the whole list, is used as the annotated -# text. Otherwise, the brief description is used as-is. If left blank, the -# following values are used ($name is automatically replaced with the name of -# the entity):The $name class, The $name widget, The $name file, is, provides, -# specifies, contains, represents, a, an and the. - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# doxygen will generate a detailed section even if there is only a brief -# description. -# The default value is: NO. - -ALWAYS_DETAILED_SEC = YES - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. -# The default value is: NO. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path -# before files name in the file list and in the header files. If set to NO the -# shortest path that makes the file name unique will be used -# The default value is: YES. - -FULL_PATH_NAMES = NO - -# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. -# Stripping is only done if one of the specified strings matches the left-hand -# part of the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the path to -# strip. -# -# Note that you can specify absolute paths here, but also relative paths, which -# will be relative from the directory where doxygen is started. -# This tag requires that the tag FULL_PATH_NAMES is set to YES. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the -# path mentioned in the documentation of a class, which tells the reader which -# header file to include in order to use a class. If left blank only the name of -# the header file containing the class definition is used. Otherwise one should -# specify the list of include paths that are normally passed to the compiler -# using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but -# less readable) file names. This can be useful is your file systems doesn't -# support long names like on DOS, Mac, or CD-ROM. -# The default value is: NO. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the -# first line (until the first dot) of a Javadoc-style comment as the brief -# description. If set to NO, the Javadoc-style will behave just like regular Qt- -# style comments (thus requiring an explicit @brief command for a brief -# description.) -# The default value is: NO. - -JAVADOC_AUTOBRIEF = NO - -# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line -# such as -# /*************** -# as being the beginning of a Javadoc-style comment "banner". If set to NO, the -# Javadoc-style will behave just like regular comments and it will not be -# interpreted by doxygen. -# The default value is: NO. - -JAVADOC_BANNER = NO - -# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first -# line (until the first dot) of a Qt-style comment as the brief description. If -# set to NO, the Qt-style will behave just like regular Qt-style comments (thus -# requiring an explicit \brief command for a brief description.) -# The default value is: NO. - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a -# multi-line C++ special comment block (i.e. a block of //! or /// comments) as -# a brief description. This used to be the default behavior. The new default is -# to treat a multi-line C++ comment block as a detailed description. Set this -# tag to YES if you prefer the old behavior instead. -# -# Note that setting this tag to YES also means that rational rose comments are -# not recognized any more. -# The default value is: NO. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the -# documentation from any documented member that it re-implements. -# The default value is: YES. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new -# page for each member. If set to NO, the documentation of a member will be part -# of the file/class/namespace that contains it. -# The default value is: NO. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen -# uses this value to replace tabs by spaces in code fragments. -# Minimum value: 1, maximum value: 16, default value: 4. - -TAB_SIZE = 8 - -# This tag can be used to specify a number of aliases that act as commands in -# the documentation. An alias has the form: -# name=value -# For example adding -# "sideeffect=@par Side Effects:\n" -# will allow you to put the command \sideeffect (or @sideeffect) in the -# documentation, which will result in a user-defined paragraph with heading -# "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines (in the resulting output). You can put ^^ in the value part of an -# alias to insert a newline as if a physical newline was in the original file. -# When you need a literal { or } or , in the value part of an alias you have to -# escape them by means of a backslash (\), this can lead to conflicts with the -# commands \{ and \} for these it is advised to use the version @{ and @} or use -# a double escape (\\{ and \\}) - -ALIASES = "thread_safety=@par Thread safety^^" \ - "pointer_lifetime=@par Pointer lifetime^^" \ - "analysis=@par Analysis^^" \ - "reentrancy=@par Reentrancy^^" \ - "errors=@par Errors^^" \ - "callback_signature=@par Callback signature^^" \ - "glfw3=__GLFW 3:__" \ - "x11=__X11:__" \ - "wayland=__Wayland:__" \ - "win32=__Windows:__" \ - "macos=__macOS:__" \ - "linux=__Linux:__" - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. For -# instance, some of the names that are used will be different. The list of all -# members will be omitted, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or -# Python sources only. Doxygen will then generate output that is more tailored -# for that language. For instance, namespaces will be presented as packages, -# qualified scopes will look different, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources. Doxygen will then generate output that is tailored for Fortran. -# The default value is: NO. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for VHDL. -# The default value is: NO. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice -# sources only. Doxygen will then generate output that is more tailored for that -# language. For instance, namespaces will be presented as modules, types will be -# separated into more groups, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_SLICE = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given -# extension. Doxygen has a built-in mapping, but you can override or extend it -# using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, -# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, VHDL, -# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: -# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser -# tries to guess whether the code is fixed or free formatted code, this is the -# default for Fortran type files). For instance to make doxygen treat .inc files -# as Fortran files (default is PHP), and .f files as C (default is Fortran), -# use: inc=Fortran f=C. -# -# Note: For files without extension you can use no_extension as a placeholder. -# -# Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments -# according to the Markdown format, which allows for more readable -# documentation. See https://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you can -# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in -# case of backward compatibilities issues. -# The default value is: YES. - -MARKDOWN_SUPPORT = YES - -# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up -# to that level are automatically included in the table of contents, even if -# they do not have an id attribute. -# Note: This feature currently applies only to Markdown headings. -# Minimum value: 0, maximum value: 99, default value: 5. -# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. - -TOC_INCLUDE_HEADINGS = 5 - -# When enabled doxygen tries to link words that correspond to documented -# classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by putting a % sign in front of the word or -# globally by setting AUTOLINK_SUPPORT to NO. -# The default value is: YES. - -AUTOLINK_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should set this -# tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); -# versus func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. -# The default value is: NO. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. -# The default value is: NO. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen -# will parse them like normal C++ but will assume all classes use public instead -# of private inheritance when no explicit protection keyword is present. -# The default value is: NO. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate -# getter and setter methods for a property. Setting this option to YES will make -# doxygen to replace the get and set methods by a property in the documentation. -# This will only work if the methods are indeed getting or setting a simple -# type. If this is not the case, or you want to show the methods anyway, you -# should set this option to NO. -# The default value is: YES. - -IDL_PROPERTY_SUPPORT = NO - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. -# The default value is: NO. - -DISTRIBUTE_GROUP_DOC = NO - -# If one adds a struct or class to a group and this option is enabled, then also -# any nested class or struct is added to the same group. By default this option -# is disabled and one has to add nested compounds explicitly via \ingroup. -# The default value is: NO. - -GROUP_NESTED_COMPOUNDS = NO - -# Set the SUBGROUPING tag to YES to allow class member groups of the same type -# (for instance a group of public functions) to be put as a subgroup of that -# type (e.g. under the Public Functions section). Set it to NO to prevent -# subgrouping. Alternatively, this can be done per class using the -# \nosubgrouping command. -# The default value is: YES. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions -# are shown inside the group in which they are included (e.g. using \ingroup) -# instead of on a separate page (for HTML and Man pages) or section (for LaTeX -# and RTF). -# -# Note that this feature does not work in combination with -# SEPARATE_MEMBER_PAGES. -# The default value is: NO. - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions -# with only public data fields or simple typedef fields will be shown inline in -# the documentation of the scope in which they are defined (i.e. file, -# namespace, or group documentation), provided this scope is documented. If set -# to NO, structs, classes, and unions are shown on a separate page (for HTML and -# Man pages) or section (for LaTeX and RTF). -# The default value is: NO. - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or -# enum is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically be -# useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. -# The default value is: NO. - -TYPEDEF_HIDES_STRUCT = NO - -# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This -# cache is used to resolve symbols given their name and scope. Since this can be -# an expensive process and often the same symbol appears multiple times in the -# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small -# doxygen will become slower. If the cache is too large, memory is wasted. The -# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range -# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 -# symbols. At the end of a run doxygen will report the cache usage and suggest -# the optimal cache size from a speed point of view. -# Minimum value: 0, maximum value: 9, default value: 0. - -LOOKUP_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in -# documentation are documented, even if no documentation was available. Private -# class members and static file members will be hidden unless the -# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. -# Note: This will also disable the warnings about undocumented members that are -# normally produced when WARNINGS is set to YES. -# The default value is: NO. - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will -# be included in the documentation. -# The default value is: NO. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual -# methods of a class will be included in the documentation. -# The default value is: NO. - -EXTRACT_PRIV_VIRTUAL = NO - -# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal -# scope will be included in the documentation. -# The default value is: NO. - -EXTRACT_PACKAGE = NO - -# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be -# included in the documentation. -# The default value is: NO. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO, -# only classes defined in header files are included. Does not have any effect -# for Java sources. -# The default value is: YES. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. If set to YES, local methods, -# which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO, only methods in the interface are -# included. -# The default value is: NO. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base name of -# the file that contains the anonymous namespace. By default anonymous namespace -# are hidden. -# The default value is: NO. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all -# undocumented members inside documented classes or files. If set to NO these -# members will be included in the various overviews, but no documentation -# section is generated. This option has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. If set -# to NO, these classes will be included in the various overviews. This option -# has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# declarations. If set to NO, these declarations will be included in the -# documentation. -# The default value is: NO. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO, these -# blocks will be appended to the function's detailed documentation block. -# The default value is: NO. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation that is typed after a -# \internal command is included. If the tag is set to NO then the documentation -# will be excluded. Set it to YES to include the internal documentation. -# The default value is: NO. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES, upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# (including Cygwin) ands Mac users are advised to set this option to NO. -# The default value is: system dependent. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES, the -# scope will be hidden. -# The default value is: NO. - -HIDE_SCOPE_NAMES = NO - -# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will -# append additional text to a page's title, such as Class Reference. If set to -# YES the compound reference will be hidden. -# The default value is: NO. - -HIDE_COMPOUND_REFERENCE= NO - -# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of -# the files that are included by a file in the documentation of that file. -# The default value is: YES. - -SHOW_INCLUDE_FILES = NO - -# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each -# grouped member an include statement to the documentation, telling the reader -# which file to include in order to use the member. -# The default value is: NO. - -SHOW_GROUPED_MEMB_INC = NO - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include -# files with double quotes in the documentation rather than with sharp brackets. -# The default value is: NO. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the -# documentation for inline members. -# The default value is: YES. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the -# (detailed) documentation of file and class members alphabetically by member -# name. If set to NO, the members will appear in declaration order. -# The default value is: YES. - -SORT_MEMBER_DOCS = NO - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief -# descriptions of file, namespace and class members alphabetically by member -# name. If set to NO, the members will appear in declaration order. Note that -# this will also influence the order of the classes in the class list. -# The default value is: NO. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the -# (brief and detailed) documentation of class members so that constructors and -# destructors are listed first. If set to NO the constructors will appear in the -# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. -# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief -# member documentation. -# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting -# detailed member documentation. -# The default value is: NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy -# of group names into alphabetical order. If set to NO the group names will -# appear in their defined order. -# The default value is: NO. - -SORT_GROUP_NAMES = YES - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by -# fully-qualified names, including namespaces. If set to NO, the class list will -# be sorted only by class name, not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the alphabetical -# list. -# The default value is: NO. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper -# type resolution of all parameters of a function it will reject a match between -# the prototype and the implementation of a member function even if there is -# only one candidate or it is obvious which candidate to choose by doing a -# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still -# accept a match between prototype and implementation in such cases. -# The default value is: NO. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo -# list. This list is created by putting \todo commands in the documentation. -# The default value is: YES. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test -# list. This list is created by putting \test commands in the documentation. -# The default value is: YES. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug -# list. This list is created by putting \bug commands in the documentation. -# The default value is: YES. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) -# the deprecated list. This list is created by putting \deprecated commands in -# the documentation. -# The default value is: YES. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional documentation -# sections, marked by \if ... \endif and \cond -# ... \endcond blocks. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the -# initial value of a variable or macro / define can have for it to appear in the -# documentation. If the initializer consists of more lines than specified here -# it will be hidden. Use a value of 0 to hide initializers completely. The -# appearance of the value of individual variables and macros / defines can be -# controlled using \showinitializer or \hideinitializer command in the -# documentation regardless of this setting. -# Minimum value: 0, maximum value: 10000, default value: 30. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES, the -# list will mention the files that were used to generate the documentation. -# The default value is: YES. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This -# will remove the Files entry from the Quick Index and from the Folder Tree View -# (if specified). -# The default value is: YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces -# page. This will remove the Namespaces entry from the Quick Index and from the -# Folder Tree View (if specified). -# The default value is: YES. - -SHOW_NAMESPACES = NO - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command command input-file, where command is the value of the -# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided -# by doxygen. Whatever the program writes to standard output is used as the file -# version. For an example see the documentation. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. You can -# optionally specify a file name after the option, if omitted DoxygenLayout.xml -# will be used as the name of the layout file. -# -# Note that if you run doxygen from a directory containing a file called -# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE -# tag is left empty. - -LAYOUT_FILE = "@GLFW_SOURCE_DIR@/docs/DoxygenLayout.xml" - -# The CITE_BIB_FILES tag can be used to specify one or more bib files containing -# the reference definitions. This must be a list of .bib files. The .bib -# extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. -# For LaTeX the style of the bibliography can be controlled using -# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the -# search path. See also \cite for info how to create references. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# Configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated to -# standard output by doxygen. If QUIET is set to YES this implies that the -# messages are off. -# The default value is: NO. - -QUIET = YES - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES -# this implies that the warnings are on. -# -# Tip: Turn warnings on while writing the documentation. -# The default value is: YES. - -WARNINGS = YES - -# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate -# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag -# will automatically be disabled. -# The default value is: YES. - -WARN_IF_UNDOCUMENTED = YES - -# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some parameters -# in a documented function, or documenting parameters that don't exist or using -# markup commands wrongly. -# The default value is: YES. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that -# are documented, but have no documentation for their parameters or return -# value. If set to NO, doxygen will only warn about wrong or incomplete -# parameter documentation, but not about the absence of documentation. If -# EXTRACT_ALL is set to YES then this flag will automatically be disabled. -# The default value is: NO. - -WARN_NO_PARAMDOC = YES - -# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when -# a warning is encountered. -# The default value is: NO. - -WARN_AS_ERROR = NO - -# The WARN_FORMAT tag determines the format of the warning messages that doxygen -# can produce. The string should contain the $file, $line, and $text tags, which -# will be replaced by the file and line number from which the warning originated -# and the warning text. Optionally the format may contain $version, which will -# be replaced by the version of the file (if it could be obtained via -# FILE_VERSION_FILTER) -# The default value is: $file:$line: $text. - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning and error -# messages should be written. If left blank the output is written to standard -# error (stderr). - -WARN_LOGFILE = "@GLFW_BINARY_DIR@/docs/warnings.txt" - -#--------------------------------------------------------------------------- -# Configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag is used to specify the files and/or directories that contain -# documented source files. You may enter file names like myfile.cpp or -# directories like /usr/src/myproject. Separate the files or directories with -# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING -# Note: If this tag is empty the current directory is searched. - -INPUT = @GLFW_DOXYGEN_INPUT@ - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses -# libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: https://www.gnu.org/software/libiconv/) for the list of -# possible encodings. -# The default value is: UTF-8. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# read by doxygen. -# -# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, -# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, -# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, -# *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C comment), -# *.doc (to be provided as doxygen C comment), *.txt (to be provided as doxygen -# C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, -# *.vhdl, *.ucf, *.qsf and *.ice. - -FILE_PATTERNS = *.h *.dox - -# The RECURSIVE tag can be used to specify whether or not subdirectories should -# be searched for input files as well. -# The default value is: NO. - -RECURSIVE = NO - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. -# The default value is: NO. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories use the pattern */test/* - -EXCLUDE_SYMBOLS = APIENTRY GLFWAPI - -# The EXAMPLE_PATH tag can be used to specify one or more files or directories -# that contain example code fragments that are included (see the \include -# command). - -EXAMPLE_PATH = "@GLFW_SOURCE_DIR@/examples" - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank all -# files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude commands -# irrespective of the value of the RECURSIVE tag. -# The default value is: NO. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or directories -# that contain images that are to be included in the documentation (see the -# \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command: -# -# -# -# where is the value of the INPUT_FILTER tag, and is the -# name of an input file. Doxygen will then use the output that the filter -# program writes to standard output. If FILTER_PATTERNS is specified, this tag -# will be ignored. -# -# Note that the filter must not add or remove lines; it is applied before the -# code is scanned, but not when the output code is generated. If lines are added -# or removed, the anchors will not be placed correctly. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# properly processed by doxygen. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: pattern=filter -# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how -# filters are used. If the FILTER_PATTERNS tag is empty or if none of the -# patterns match the file name, INPUT_FILTER is applied. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# properly processed by doxygen. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will also be used to filter the input files that are used for -# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). -# The default value is: NO. - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and -# it is also possible to disable source filtering for a specific pattern using -# *.ext= (so without naming a filter). -# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. - -FILTER_SOURCE_PATTERNS = - -# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that -# is part of the input, its contents will be placed on the main page -# (index.html). This can be useful if you have a project on for instance GitHub -# and want to reuse the introduction page also for the doxygen output. - -USE_MDFILE_AS_MAINPAGE = - -#--------------------------------------------------------------------------- -# Configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will be -# generated. Documented entities will be cross-referenced with these sources. -# -# Note: To get rid of all source code in the generated output, make sure that -# also VERBATIM_HEADERS is set to NO. -# The default value is: NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body of functions, -# classes and enums directly into the documentation. -# The default value is: NO. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any -# special comment blocks from generated source code fragments. Normal C, C++ and -# Fortran comments will always remain visible. -# The default value is: YES. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# entity all documented functions referencing it will be listed. -# The default value is: NO. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES then for each documented function -# all documented entities called/used by that function will be listed. -# The default value is: NO. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES then the hyperlinks from functions in REFERENCES_RELATION and -# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will -# link to the documentation. -# The default value is: YES. - -REFERENCES_LINK_SOURCE = YES - -# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the -# source code will show a tooltip with additional information such as prototype, -# brief description and links to the definition and documentation. Since this -# will make the HTML file larger and loading of large files a bit slower, you -# can opt to disable this feature. -# The default value is: YES. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -SOURCE_TOOLTIPS = YES - -# If the USE_HTAGS tag is set to YES then the references to source code will -# point to the HTML generated by the htags(1) tool instead of doxygen built-in -# source browser. The htags tool is part of GNU's global source tagging system -# (see https://www.gnu.org/software/global/global.html). You will need version -# 4.8.6 or higher. -# -# To use it do the following: -# - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file -# - Make sure the INPUT points to the root of the source tree -# - Run doxygen as normal -# -# Doxygen will invoke htags (and that will in turn invoke gtags), so these -# tools must be available from the command line (i.e. in the search path). -# -# The result: instead of the source browser generated by doxygen, the links to -# source code will now point to the output of htags. -# The default value is: NO. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a -# verbatim copy of the header file for each class for which an include is -# specified. Set to NO to disable this. -# See also: Section \class. -# The default value is: YES. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# Configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all -# compounds will be generated. Enable this if the project contains a lot of -# classes, structs, unions or interfaces. -# The default value is: YES. - -ALPHABETICAL_INDEX = YES - -# In case all classes in a project start with a common prefix, all classes will -# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag -# can be used to specify a prefix (or a list of prefixes) that should be ignored -# while generating the index headers. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -IGNORE_PREFIX = glfw GLFW_ - -#--------------------------------------------------------------------------- -# Configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output -# The default value is: YES. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. -# The default directory is: html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each -# generated HTML page (for example: .htm, .php, .asp). -# The default value is: .html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a user-defined HTML header file for -# each generated HTML page. If the tag is left blank doxygen will generate a -# standard header. -# -# To get valid HTML the header file that includes any scripts and style sheets -# that doxygen needs, which is dependent on the configuration options used (e.g. -# the setting GENERATE_TREEVIEW). It is highly recommended to start with a -# default header using -# doxygen -w html new_header.html new_footer.html new_stylesheet.css -# YourConfigFile -# and then modify the file new_header.html. See also section "Doxygen usage" -# for information on how to generate the default header that doxygen normally -# uses. -# Note: The header is subject to change so you typically have to regenerate the -# default header when upgrading to a newer version of doxygen. For a description -# of the possible markers and block names see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_HEADER = "@GLFW_SOURCE_DIR@/docs/header.html" - -# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each -# generated HTML page. If the tag is left blank doxygen will generate a standard -# footer. See HTML_HEADER for more information on how to generate a default -# footer and what special commands can be used inside the footer. See also -# section "Doxygen usage" for information on how to generate the default footer -# that doxygen normally uses. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FOOTER = "@GLFW_SOURCE_DIR@/docs/footer.html" - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style -# sheet that is used by each HTML page. It can be used to fine-tune the look of -# the HTML output. If left blank doxygen will generate a default style sheet. -# See also section "Doxygen usage" for information on how to generate the style -# sheet that doxygen normally uses. -# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as -# it is more robust and this tag (HTML_STYLESHEET) will in the future become -# obsolete. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_STYLESHEET = - -# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined -# cascading style sheets that are included after the standard style sheets -# created by doxygen. Using this option one can overrule certain style aspects. -# This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefore more robust against future updates. -# Doxygen will copy the style sheet files to the output directory. -# Note: The order of the extra style sheet files is of importance (e.g. the last -# style sheet in the list overrules the setting of the previous ones in the -# list). For an example see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_STYLESHEET = "@GLFW_SOURCE_DIR@/docs/extra.css" - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that the -# files will be copied as-is; there are no commands or markers available. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_FILES = "@GLFW_SOURCE_DIR@/docs/spaces.svg" - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the style sheet and background images according to -# this color. Hue is specified as an angle on a colorwheel, see -# https://en.wikipedia.org/wiki/Hue for more information. For instance the value -# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 -# purple, and 360 is red again. -# Minimum value: 0, maximum value: 359, default value: 220. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors -# in the HTML output. For a value of 0 the output will use grayscales only. A -# value of 255 will produce the most vivid colors. -# Minimum value: 0, maximum value: 255, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the -# luminance component of the colors in the HTML output. Values below 100 -# gradually make the output lighter, whereas values above 100 make the output -# darker. The value divided by 100 is the actual gamma applied, so 80 represents -# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not -# change the gamma. -# Minimum value: 40, maximum value: 240, default value: 80. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting this -# to YES can help to show when doxygen was last run and thus if the -# documentation is up to date. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_TIMESTAMP = YES - -# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML -# documentation will contain a main index with vertical navigation menus that -# are dynamically created via JavaScript. If disabled, the navigation index will -# consists of multiple levels of tabs that are statically embedded in every HTML -# page. Disable this option to support browsers that do not have JavaScript, -# like the Qt help browser. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_MENUS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_SECTIONS = NO - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries -# shown in the various tree structured indices initially; the user can expand -# and collapse entries dynamically later on. Doxygen will expand the tree to -# such a level that at most the specified number of entries are visible (unless -# a fully collapsed tree already exceeds this amount). So setting the number of -# entries 1 will produce a full collapsed tree by default. 0 is a special value -# representing an infinite number of entries and will result in a full expanded -# tree by default. -# Minimum value: 0, maximum value: 9999, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files will be -# generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: https://developer.apple.com/xcode/), introduced with OSX -# 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy -# genXcode/_index.html for more information. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_DOCSET = NO - -# This tag determines the name of the docset feed. A documentation feed provides -# an umbrella under which multiple documentation sets from a single provider -# (such as a company or product suite) can be grouped. -# The default value is: Doxygen generated docs. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# This tag specifies a string that should uniquely identify the documentation -# set bundle. This should be a reverse domain-name style string, e.g. -# com.mycompany.MyDocSet. Doxygen will append .docset to the name. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. -# The default value is: org.doxygen.Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. -# The default value is: Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three -# additional HTML index files: index.hhp, index.hhc, and index.hhk. The -# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. -# -# The HTML Help Workshop contains a compiler that can convert all HTML output -# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML -# files are now used as the Windows 98 help format, and will replace the old -# Windows help format (.hlp) on all Windows platforms in the future. Compressed -# HTML files also contain an index, a table of contents, and you can search for -# words in the documentation. The HTML workshop also contains a viewer for -# compressed HTML files. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_HTMLHELP = NO - -# The CHM_FILE tag can be used to specify the file name of the resulting .chm -# file. You can add a path in front of the file if the result should not be -# written to the html output directory. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_FILE = - -# The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler (hhc.exe). If non-empty, -# doxygen will try to run the HTML help compiler on the generated index.hhp. -# The file has to be specified with full path. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -HHC_LOCATION = - -# The GENERATE_CHI flag controls if a separate .chi index file is generated -# (YES) or that it should be included in the master .chm file (NO). -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -GENERATE_CHI = NO - -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) -# and project file content. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_INDEX_ENCODING = - -# The BINARY_TOC flag controls whether a binary table of contents is generated -# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it -# enables the Previous and Next buttons. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members to -# the table of contents of the HTML help documentation and to the tree view. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that -# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help -# (.qch) of the generated HTML documentation. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify -# the file name of the resulting .qch file. The path specified is relative to -# the HTML output folder. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help -# Project output. For more information please see Qt Help Project / Namespace -# (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt -# Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual- -# folders). -# The default value is: doc. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_VIRTUAL_FOLDER = doc - -# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom -# filter to add. For more information please see Qt Help Project / Custom -# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- -# filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- -# filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's filter section matches. Qt Help Project / Filter Attributes (see: -# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_SECT_FILTER_ATTRS = - -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be -# generated, together with the HTML files, they form an Eclipse help plugin. To -# install this plugin and make it available under the help contents menu in -# Eclipse, the contents of the directory containing the HTML and XML files needs -# to be copied into the plugins directory of eclipse. The name of the directory -# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. -# After copying Eclipse needs to be restarted before the help appears. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the Eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have this -# name. Each documentation set should have its own identifier. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# If you want full control over the layout of the generated HTML pages it might -# be necessary to disable the index and replace it with your own. The -# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top -# of each HTML page. A value of NO enables the index and the value YES disables -# it. Since the tabs in the index contain the same information as the navigation -# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -DISABLE_INDEX = NO - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. If the tag -# value is set to YES, a side panel will be generated containing a tree-like -# index structure (just like the one that is generated for HTML Help). For this -# to work a browser that supports JavaScript, DHTML, CSS and frames is required -# (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can -# further fine-tune the look of the index. As an example, the default style -# sheet generated by doxygen has an example that shows how to put an image at -# the root of the tree instead of the PROJECT_NAME. Since the tree basically has -# the same information as the tab index, you could consider setting -# DISABLE_INDEX to YES when enabling this option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_TREEVIEW = NO - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that -# doxygen will group on one line in the generated HTML documentation. -# -# Note that a value of 0 will completely suppress the enum values from appearing -# in the overview section. -# Minimum value: 0, maximum value: 20, default value: 4. -# This tag requires that the tag GENERATE_HTML is set to YES. - -ENUM_VALUES_PER_LINE = 4 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used -# to set the initial width (in pixels) of the frame in which the tree is shown. -# Minimum value: 0, maximum value: 1500, default value: 250. -# This tag requires that the tag GENERATE_HTML is set to YES. - -TREEVIEW_WIDTH = 300 - -# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to -# external symbols imported via tag files in a separate window. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -EXT_LINKS_IN_WINDOW = NO - -# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg -# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see -# https://inkscape.org) to generate formulas as SVG images instead of PNGs for -# the HTML output. These images will generally look nicer at scaled resolutions. -# Possible values are: png The default and svg Looks nicer but requires the -# pdf2svg tool. -# The default value is: png. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FORMULA_FORMAT = png - -# Use this tag to change the font size of LaTeX formulas included as images in -# the HTML documentation. When you change the font size after a successful -# doxygen run you need to manually remove any form_*.png images from the HTML -# output directory to force them to be regenerated. -# Minimum value: 8, maximum value: 50, default value: 10. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANSPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not -# supported properly for IE 6.0, but are supported on all modern browsers. -# -# Note that when changing this option you need to delete any form_*.png files in -# the HTML output directory before the changes have effect. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_TRANSPARENT = YES - -# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands -# to create new LaTeX commands to be used in formulas as building blocks. See -# the section "Including formulas" for details. - -FORMULA_MACROFILE = - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# https://www.mathjax.org) which uses client side JavaScript for the rendering -# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX -# installed or if you want to formulas look prettier in the HTML output. When -# enabled you may also need to install MathJax separately and configure the path -# to it using the MATHJAX_RELPATH option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -USE_MATHJAX = NO - -# When MathJax is enabled you can set the default output format to be used for -# the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. -# Possible values are: HTML-CSS (which is slower, but has the best -# compatibility), NativeMML (i.e. MathML) and SVG. -# The default value is: HTML-CSS. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_FORMAT = HTML-CSS - -# When MathJax is enabled you need to specify the location relative to the HTML -# output directory using the MATHJAX_RELPATH option. The destination directory -# should contain the MathJax.js script. For instance, if the mathjax directory -# is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax -# Content Delivery Network so you can quickly see the result without installing -# MathJax. However, it is strongly recommended to install a local copy of -# MathJax from https://www.mathjax.org before deployment. -# The default value is: https://cdn.jsdelivr.net/npm/mathjax@2. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_RELPATH = https://cdn.jsdelivr.net/npm/mathjax@2 - -# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax -# extension names that should be enabled during MathJax rendering. For example -# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_EXTENSIONS = - -# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces -# of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an -# example see the documentation. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_CODEFILE = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box for -# the HTML output. The underlying search engine uses javascript and DHTML and -# should work on any modern browser. Note that when using HTML help -# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) -# there is already a search function so this one should typically be disabled. -# For large projects the javascript based search engine can be slow, then -# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to -# search using the keyboard; to jump to the search box use + S -# (what the is depends on the OS and browser, but it is typically -# , /
- - - - - diff --git a/3rdparty/glfw/source/docs/input.dox b/3rdparty/glfw/source/docs/input.dox deleted file mode 100644 index faa94cd..0000000 --- a/3rdparty/glfw/source/docs/input.dox +++ /dev/null @@ -1,953 +0,0 @@ -/*! - -@page input_guide Input guide - -@tableofcontents - -This guide introduces the input related functions of GLFW. For details on -a specific function in this category, see the @ref input. There are also guides -for the other areas of GLFW. - - - @ref intro_guide - - @ref window_guide - - @ref context_guide - - @ref vulkan_guide - - @ref monitor_guide - -GLFW provides many kinds of input. While some can only be polled, like time, or -only received via callbacks, like scrolling, many provide both callbacks and -polling. Callbacks are more work to use than polling but is less CPU intensive -and guarantees that you do not miss state changes. - -All input callbacks receive a window handle. By using the -[window user pointer](@ref window_userptr), you can access non-global structures -or objects from your callbacks. - -To get a better feel for how the various events callbacks behave, run the -`events` test program. It register every callback supported by GLFW and prints -out all arguments provided for every event, along with time and sequence -information. - - -@section events Event processing - -GLFW needs to poll the window system for events both to provide input to the -application and to prove to the window system that the application hasn't locked -up. Event processing is normally done each frame after -[buffer swapping](@ref buffer_swap). Even when you have no windows, event -polling needs to be done in order to receive monitor and joystick connection -events. - -There are three functions for processing pending events. @ref glfwPollEvents, -processes only those events that have already been received and then returns -immediately. - -@code -glfwPollEvents(); -@endcode - -This is the best choice when rendering continuously, like most games do. - -If you only need to update the contents of the window when you receive new -input, @ref glfwWaitEvents is a better choice. - -@code -glfwWaitEvents(); -@endcode - -It puts the thread to sleep until at least one event has been received and then -processes all received events. This saves a great deal of CPU cycles and is -useful for, for example, editing tools. - -If you want to wait for events but have UI elements or other tasks that need -periodic updates, @ref glfwWaitEventsTimeout lets you specify a timeout. - -@code -glfwWaitEventsTimeout(0.7); -@endcode - -It puts the thread to sleep until at least one event has been received, or until -the specified number of seconds have elapsed. It then processes any received -events. - -If the main thread is sleeping in @ref glfwWaitEvents, you can wake it from -another thread by posting an empty event to the event queue with @ref -glfwPostEmptyEvent. - -@code -glfwPostEmptyEvent(); -@endcode - -Do not assume that callbacks will _only_ be called in response to the above -functions. While it is necessary to process events in one or more of the ways -above, window systems that require GLFW to register callbacks of its own can -pass events to GLFW in response to many window system function calls. GLFW will -pass those events on to the application callbacks before returning. - -For example, on Windows the system function that @ref glfwSetWindowSize is -implemented with will send window size events directly to the event callback -that every window has and that GLFW implements for its windows. If you have set -a [window size callback](@ref window_size) GLFW will call it in turn with the -new size before everything returns back out of the @ref glfwSetWindowSize call. - - -@section input_keyboard Keyboard input - -GLFW divides keyboard input into two categories; key events and character -events. Key events relate to actual physical keyboard keys, whereas character -events relate to the Unicode code points generated by pressing some of them. - -Keys and characters do not map 1:1. A single key press may produce several -characters, and a single character may require several keys to produce. This -may not be the case on your machine, but your users are likely not all using the -same keyboard layout, input method or even operating system as you. - - -@subsection input_key Key input - -If you wish to be notified when a physical key is pressed or released or when it -repeats, set a key callback. - -@code -glfwSetKeyCallback(window, key_callback); -@endcode - -The callback function receives the [keyboard key](@ref keys), platform-specific -scancode, key action and [modifier bits](@ref mods). - -@code -void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key == GLFW_KEY_E && action == GLFW_PRESS) - activate_airship(); -} -@endcode - -The action is one of `GLFW_PRESS`, `GLFW_REPEAT` or `GLFW_RELEASE`. The key -will be `GLFW_KEY_UNKNOWN` if GLFW lacks a key token for it, for example -_E-mail_ and _Play_ keys. - -The scancode is unique for every key, regardless of whether it has a key token. -Scancodes are platform-specific but consistent over time, so keys will have -different scancodes depending on the platform but they are safe to save to disk. -You can query the scancode for any [named key](@ref keys) on the current -platform with @ref glfwGetKeyScancode. - -@code -const int scancode = glfwGetKeyScancode(GLFW_KEY_X); -set_key_mapping(scancode, swap_weapons); -@endcode - -The last reported state for every [named key](@ref keys) is also saved in -per-window state arrays that can be polled with @ref glfwGetKey. - -@code -int state = glfwGetKey(window, GLFW_KEY_E); -if (state == GLFW_PRESS) -{ - activate_airship(); -} -@endcode - -The returned state is one of `GLFW_PRESS` or `GLFW_RELEASE`. - -This function only returns cached key event state. It does not poll the -system for the current physical state of the key. - -@anchor GLFW_STICKY_KEYS -Whenever you poll state, you risk missing the state change you are looking for. -If a pressed key is released again before you poll its state, you will have -missed the key press. The recommended solution for this is to use a -key callback, but there is also the `GLFW_STICKY_KEYS` input mode. - -@code -glfwSetInputMode(window, GLFW_STICKY_KEYS, GLFW_TRUE); -@endcode - -When sticky keys mode is enabled, the pollable state of a key will remain -`GLFW_PRESS` until the state of that key is polled with @ref glfwGetKey. Once -it has been polled, if a key release event had been processed in the meantime, -the state will reset to `GLFW_RELEASE`, otherwise it will remain `GLFW_PRESS`. - -@anchor GLFW_LOCK_KEY_MODS -If you wish to know what the state of the Caps Lock and Num Lock keys was when -input events were generated, set the `GLFW_LOCK_KEY_MODS` input mode. - -@code -glfwSetInputMode(window, GLFW_LOCK_KEY_MODS, GLFW_TRUE); -@endcode - -When this input mode is enabled, any callback that receives -[modifier bits](@ref mods) will have the @ref GLFW_MOD_CAPS_LOCK bit set if Caps -Lock was on when the event occurred and the @ref GLFW_MOD_NUM_LOCK bit set if -Num Lock was on. - -The `GLFW_KEY_LAST` constant holds the highest value of any -[named key](@ref keys). - - -@subsection input_char Text input - -GLFW supports text input in the form of a stream of -[Unicode code points](https://en.wikipedia.org/wiki/Unicode), as produced by the -operating system text input system. Unlike key input, text input obeys keyboard -layouts and modifier keys and supports composing characters using -[dead keys](https://en.wikipedia.org/wiki/Dead_key). Once received, you can -encode the code points into UTF-8 or any other encoding you prefer. - -Because an `unsigned int` is 32 bits long on all platforms supported by GLFW, -you can treat the code point argument as native endian UTF-32. - -If you wish to offer regular text input, set a character callback. - -@code -glfwSetCharCallback(window, character_callback); -@endcode - -The callback function receives Unicode code points for key events that would -have led to regular text input and generally behaves as a standard text field on -that platform. - -@code -void character_callback(GLFWwindow* window, unsigned int codepoint) -{ -} -@endcode - - -@subsection input_key_name Key names - -If you wish to refer to keys by name, you can query the keyboard layout -dependent name of printable keys with @ref glfwGetKeyName. - -@code -const char* key_name = glfwGetKeyName(GLFW_KEY_W, 0); -show_tutorial_hint("Press %s to move forward", key_name); -@endcode - -This function can handle both [keys and scancodes](@ref input_key). If the -specified key is `GLFW_KEY_UNKNOWN` then the scancode is used, otherwise it is -ignored. This matches the behavior of the key callback, meaning the callback -arguments can always be passed unmodified to this function. - - -@section input_mouse Mouse input - -Mouse input comes in many forms, including mouse motion, button presses and -scrolling offsets. The cursor appearance can also be changed, either to -a custom image or a standard cursor shape from the system theme. - - -@subsection cursor_pos Cursor position - -If you wish to be notified when the cursor moves over the window, set a cursor -position callback. - -@code -glfwSetCursorPosCallback(window, cursor_position_callback); -@endcode - -The callback functions receives the cursor position, measured in screen -coordinates but relative to the top-left corner of the window content area. On -platforms that provide it, the full sub-pixel cursor position is passed on. - -@code -static void cursor_position_callback(GLFWwindow* window, double xpos, double ypos) -{ -} -@endcode - -The cursor position is also saved per-window and can be polled with @ref -glfwGetCursorPos. - -@code -double xpos, ypos; -glfwGetCursorPos(window, &xpos, &ypos); -@endcode - - -@subsection cursor_mode Cursor mode - -@anchor GLFW_CURSOR -The `GLFW_CURSOR` input mode provides several cursor modes for special forms of -mouse motion input. By default, the cursor mode is `GLFW_CURSOR_NORMAL`, -meaning the regular arrow cursor (or another cursor set with @ref glfwSetCursor) -is used and cursor motion is not limited. - -If you wish to implement mouse motion based camera controls or other input -schemes that require unlimited mouse movement, set the cursor mode to -`GLFW_CURSOR_DISABLED`. - -@code -glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED); -@endcode - -This will hide the cursor and lock it to the specified window. GLFW will then -take care of all the details of cursor re-centering and offset calculation and -providing the application with a virtual cursor position. This virtual position -is provided normally via both the cursor position callback and through polling. - -@note You should not implement your own version of this functionality using -other features of GLFW. It is not supported and will not work as robustly as -`GLFW_CURSOR_DISABLED`. - -If you only wish the cursor to become hidden when it is over a window but still -want it to behave normally, set the cursor mode to `GLFW_CURSOR_HIDDEN`. - -@code -glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_HIDDEN); -@endcode - -This mode puts no limit on the motion of the cursor. - -To exit out of either of these special modes, restore the `GLFW_CURSOR_NORMAL` -cursor mode. - -@code -glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL); -@endcode - - -@anchor GLFW_RAW_MOUSE_MOTION -@subsection raw_mouse_motion Raw mouse motion - -When the cursor is disabled, raw (unscaled and unaccelerated) mouse motion can -be enabled if available. - -Raw mouse motion is closer to the actual motion of the mouse across a surface. -It is not affected by the scaling and acceleration applied to the motion of the -desktop cursor. That processing is suitable for a cursor while raw motion is -better for controlling for example a 3D camera. Because of this, raw mouse -motion is only provided when the cursor is disabled. - -Call @ref glfwRawMouseMotionSupported to check if the current machine provides -raw motion and set the `GLFW_RAW_MOUSE_MOTION` input mode to enable it. It is -disabled by default. - -@code -if (glfwRawMouseMotionSupported()) - glfwSetInputMode(window, GLFW_RAW_MOUSE_MOTION, GLFW_TRUE); -@endcode - -If supported, raw mouse motion can be enabled or disabled per-window and at any -time but it will only be provided when the cursor is disabled. - - -@subsection cursor_object Cursor objects - -GLFW supports creating both custom and system theme cursor images, encapsulated -as @ref GLFWcursor objects. They are created with @ref glfwCreateCursor or @ref -glfwCreateStandardCursor and destroyed with @ref glfwDestroyCursor, or @ref -glfwTerminate, if any remain. - - -@subsubsection cursor_custom Custom cursor creation - -A custom cursor is created with @ref glfwCreateCursor, which returns a handle to -the created cursor object. For example, this creates a 16x16 white square -cursor with the hot-spot in the upper-left corner: - -@code -unsigned char pixels[16 * 16 * 4]; -memset(pixels, 0xff, sizeof(pixels)); - -GLFWimage image; -image.width = 16; -image.height = 16; -image.pixels = pixels; - -GLFWcursor* cursor = glfwCreateCursor(&image, 0, 0); -@endcode - -If cursor creation fails, `NULL` will be returned, so it is necessary to check -the return value. - -The image data is 32-bit, little-endian, non-premultiplied RGBA, i.e. eight bits -per channel with the red channel first. The pixels are arranged canonically as -sequential rows, starting from the top-left corner. - - -@subsubsection cursor_standard Standard cursor creation - -A cursor with a [standard shape](@ref shapes) from the current system cursor -theme can be can be created with @ref glfwCreateStandardCursor. - -@code -GLFWcursor* url_cursor = glfwCreateStandardCursor(GLFW_POINTING_HAND_CURSOR); -@endcode - -These cursor objects behave in the exact same way as those created with @ref -glfwCreateCursor except that the system cursor theme provides the actual image. - -A few of these shapes are not available everywhere. If a shape is unavailable, -`NULL` is returned. See @ref glfwCreateStandardCursor for details. - - -@subsubsection cursor_destruction Cursor destruction - -When a cursor is no longer needed, destroy it with @ref glfwDestroyCursor. - -@code -glfwDestroyCursor(cursor); -@endcode - -Cursor destruction always succeeds. If the cursor is current for any window, -that window will revert to the default cursor. This does not affect the cursor -mode. All remaining cursors are destroyed when @ref glfwTerminate is called. - - -@subsubsection cursor_set Cursor setting - -A cursor can be set as current for a window with @ref glfwSetCursor. - -@code -glfwSetCursor(window, cursor); -@endcode - -Once set, the cursor image will be used as long as the system cursor is over the -content area of the window and the [cursor mode](@ref cursor_mode) is set -to `GLFW_CURSOR_NORMAL`. - -A single cursor may be set for any number of windows. - -To revert to the default cursor, set the cursor of that window to `NULL`. - -@code -glfwSetCursor(window, NULL); -@endcode - -When a cursor is destroyed, any window that has it set will revert to the -default cursor. This does not affect the cursor mode. - - -@subsection cursor_enter Cursor enter/leave events - -If you wish to be notified when the cursor enters or leaves the content area of -a window, set a cursor enter/leave callback. - -@code -glfwSetCursorEnterCallback(window, cursor_enter_callback); -@endcode - -The callback function receives the new classification of the cursor. - -@code -void cursor_enter_callback(GLFWwindow* window, int entered) -{ - if (entered) - { - // The cursor entered the content area of the window - } - else - { - // The cursor left the content area of the window - } -} -@endcode - -You can query whether the cursor is currently inside the content area of the -window with the [GLFW_HOVERED](@ref GLFW_HOVERED_attrib) window attribute. - -@code -if (glfwGetWindowAttrib(window, GLFW_HOVERED)) -{ - highlight_interface(); -} -@endcode - - -@subsection input_mouse_button Mouse button input - -If you wish to be notified when a mouse button is pressed or released, set -a mouse button callback. - -@code -glfwSetMouseButtonCallback(window, mouse_button_callback); -@endcode - -The callback function receives the [mouse button](@ref buttons), button action -and [modifier bits](@ref mods). - -@code -void mouse_button_callback(GLFWwindow* window, int button, int action, int mods) -{ - if (button == GLFW_MOUSE_BUTTON_RIGHT && action == GLFW_PRESS) - popup_menu(); -} -@endcode - -The action is one of `GLFW_PRESS` or `GLFW_RELEASE`. - -Mouse button states for [named buttons](@ref buttons) are also saved in -per-window state arrays that can be polled with @ref glfwGetMouseButton. - -@code -int state = glfwGetMouseButton(window, GLFW_MOUSE_BUTTON_LEFT); -if (state == GLFW_PRESS) -{ - upgrade_cow(); -} -@endcode - -The returned state is one of `GLFW_PRESS` or `GLFW_RELEASE`. - -This function only returns cached mouse button event state. It does not poll -the system for the current state of the mouse button. - -@anchor GLFW_STICKY_MOUSE_BUTTONS -Whenever you poll state, you risk missing the state change you are looking for. -If a pressed mouse button is released again before you poll its state, you will have -missed the button press. The recommended solution for this is to use a -mouse button callback, but there is also the `GLFW_STICKY_MOUSE_BUTTONS` -input mode. - -@code -glfwSetInputMode(window, GLFW_STICKY_MOUSE_BUTTONS, GLFW_TRUE); -@endcode - -When sticky mouse buttons mode is enabled, the pollable state of a mouse button -will remain `GLFW_PRESS` until the state of that button is polled with @ref -glfwGetMouseButton. Once it has been polled, if a mouse button release event -had been processed in the meantime, the state will reset to `GLFW_RELEASE`, -otherwise it will remain `GLFW_PRESS`. - -The `GLFW_MOUSE_BUTTON_LAST` constant holds the highest value of any -[named button](@ref buttons). - - -@subsection scrolling Scroll input - -If you wish to be notified when the user scrolls, whether with a mouse wheel or -touchpad gesture, set a scroll callback. - -@code -glfwSetScrollCallback(window, scroll_callback); -@endcode - -The callback function receives two-dimensional scroll offsets. - -@code -void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) -{ -} -@endcode - -A normal mouse wheel, being vertical, provides offsets along the Y-axis. - - -@section joystick Joystick input - -The joystick functions expose connected joysticks and controllers, with both -referred to as joysticks. It supports up to sixteen joysticks, ranging from -`GLFW_JOYSTICK_1`, `GLFW_JOYSTICK_2` up to and including `GLFW_JOYSTICK_16` or -`GLFW_JOYSTICK_LAST`. You can test whether a [joystick](@ref joysticks) is -present with @ref glfwJoystickPresent. - -@code -int present = glfwJoystickPresent(GLFW_JOYSTICK_1); -@endcode - -Each joystick has zero or more axes, zero or more buttons, zero or more hats, -a human-readable name, a user pointer and an SDL compatible GUID. - -Detected joysticks are added to the beginning of the array. Once a joystick is -detected, it keeps its assigned ID until it is disconnected or the library is -terminated, so as joysticks are connected and disconnected, there may appear -gaps in the IDs. - -Joystick axis, button and hat state is updated when polled and does not require -a window to be created or events to be processed. However, if you want joystick -connection and disconnection events reliably delivered to the -[joystick callback](@ref joystick_event) then you must -[process events](@ref events). - -To see all the properties of all connected joysticks in real-time, run the -`joysticks` test program. - - -@subsection joystick_axis Joystick axis states - -The positions of all axes of a joystick are returned by @ref -glfwGetJoystickAxes. See the reference documentation for the lifetime of the -returned array. - -@code -int count; -const float* axes = glfwGetJoystickAxes(GLFW_JOYSTICK_5, &count); -@endcode - -Each element in the returned array is a value between -1.0 and 1.0. - - -@subsection joystick_button Joystick button states - -The states of all buttons of a joystick are returned by @ref -glfwGetJoystickButtons. See the reference documentation for the lifetime of the -returned array. - -@code -int count; -const unsigned char* buttons = glfwGetJoystickButtons(GLFW_JOYSTICK_3, &count); -@endcode - -Each element in the returned array is either `GLFW_PRESS` or `GLFW_RELEASE`. - -For backward compatibility with earlier versions that did not have @ref -glfwGetJoystickHats, the button array by default also includes all hats. See -the reference documentation for @ref glfwGetJoystickButtons for details. - - -@subsection joystick_hat Joystick hat states - -The states of all hats are returned by @ref glfwGetJoystickHats. See the -reference documentation for the lifetime of the returned array. - -@code -int count; -const unsigned char* hats = glfwGetJoystickHats(GLFW_JOYSTICK_7, &count); -@endcode - -Each element in the returned array is one of the following: - -Name | Value ----- | ----- -`GLFW_HAT_CENTERED` | 0 -`GLFW_HAT_UP` | 1 -`GLFW_HAT_RIGHT` | 2 -`GLFW_HAT_DOWN` | 4 -`GLFW_HAT_LEFT` | 8 -`GLFW_HAT_RIGHT_UP` | `GLFW_HAT_RIGHT` \| `GLFW_HAT_UP` -`GLFW_HAT_RIGHT_DOWN` | `GLFW_HAT_RIGHT` \| `GLFW_HAT_DOWN` -`GLFW_HAT_LEFT_UP` | `GLFW_HAT_LEFT` \| `GLFW_HAT_UP` -`GLFW_HAT_LEFT_DOWN` | `GLFW_HAT_LEFT` \| `GLFW_HAT_DOWN` - -The diagonal directions are bitwise combinations of the primary (up, right, down -and left) directions and you can test for these individually by ANDing it with -the corresponding direction. - -@code -if (hats[2] & GLFW_HAT_RIGHT) -{ - // State of hat 2 could be right-up, right or right-down -} -@endcode - -For backward compatibility with earlier versions that did not have @ref -glfwGetJoystickHats, all hats are by default also included in the button array. -See the reference documentation for @ref glfwGetJoystickButtons for details. - - -@subsection joystick_name Joystick name - -The human-readable, UTF-8 encoded name of a joystick is returned by @ref -glfwGetJoystickName. See the reference documentation for the lifetime of the -returned string. - -@code -const char* name = glfwGetJoystickName(GLFW_JOYSTICK_4); -@endcode - -Joystick names are not guaranteed to be unique. Two joysticks of the same model -and make may have the same name. Only the [joystick ID](@ref joysticks) is -guaranteed to be unique, and only until that joystick is disconnected. - - -@subsection joystick_userptr Joystick user pointer - -Each joystick has a user pointer that can be set with @ref -glfwSetJoystickUserPointer and queried with @ref glfwGetJoystickUserPointer. -This can be used for any purpose you need and will not be modified by GLFW. The -value will be kept until the joystick is disconnected or until the library is -terminated. - -The initial value of the pointer is `NULL`. - - -@subsection joystick_event Joystick configuration changes - -If you wish to be notified when a joystick is connected or disconnected, set -a joystick callback. - -@code -glfwSetJoystickCallback(joystick_callback); -@endcode - -The callback function receives the ID of the joystick that has been connected -and disconnected and the event that occurred. - -@code -void joystick_callback(int jid, int event) -{ - if (event == GLFW_CONNECTED) - { - // The joystick was connected - } - else if (event == GLFW_DISCONNECTED) - { - // The joystick was disconnected - } -} -@endcode - -For joystick connection and disconnection events to be delivered on all -platforms, you need to call one of the [event processing](@ref events) -functions. Joystick disconnection may also be detected and the callback -called by joystick functions. The function will then return whatever it -returns for a disconnected joystick. - -Only @ref glfwGetJoystickName and @ref glfwGetJoystickUserPointer will return -useful values for a disconnected joystick and only before the monitor callback -returns. - - -@subsection gamepad Gamepad input - -The joystick functions provide unlabeled axes, buttons and hats, with no -indication of where they are located on the device. Their order may also vary -between platforms even with the same device. - -To solve this problem the SDL community crowdsourced the -[SDL_GameControllerDB](https://github.com/gabomdq/SDL_GameControllerDB) project, -a database of mappings from many different devices to an Xbox-like gamepad. - -GLFW supports this mapping format and contains a copy of the mappings -available at the time of release. See @ref gamepad_mapping for how to update -this at runtime. Mappings will be assigned to joysticks automatically any time -a joystick is connected or the mappings are updated. - -You can check whether a joystick is both present and has a gamepad mapping with -@ref glfwJoystickIsGamepad. - -@code -if (glfwJoystickIsGamepad(GLFW_JOYSTICK_2)) -{ - // Use as gamepad -} -@endcode - -If you are only interested in gamepad input you can use this function instead of -@ref glfwJoystickPresent. - -You can query the human-readable name provided by the gamepad mapping with @ref -glfwGetGamepadName. This may or may not be the same as the -[joystick name](@ref joystick_name). - -@code -const char* name = glfwGetGamepadName(GLFW_JOYSTICK_7); -@endcode - -To retrieve the gamepad state of a joystick, call @ref glfwGetGamepadState. - -@code -GLFWgamepadstate state; - -if (glfwGetGamepadState(GLFW_JOYSTICK_3, &state)) -{ - if (state.buttons[GLFW_GAMEPAD_BUTTON_A]) - { - input_jump(); - } - - input_speed(state.axes[GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER]); -} -@endcode - -The @ref GLFWgamepadstate struct has two arrays; one for button states and one -for axis states. The values for each button and axis are the same as for the -@ref glfwGetJoystickButtons and @ref glfwGetJoystickAxes functions, i.e. -`GLFW_PRESS` or `GLFW_RELEASE` for buttons and -1.0 to 1.0 inclusive for axes. - -The sizes of the arrays and the positions within each array are fixed. - -The [button indices](@ref gamepad_buttons) are `GLFW_GAMEPAD_BUTTON_A`, -`GLFW_GAMEPAD_BUTTON_B`, `GLFW_GAMEPAD_BUTTON_X`, `GLFW_GAMEPAD_BUTTON_Y`, -`GLFW_GAMEPAD_BUTTON_LEFT_BUMPER`, `GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER`, -`GLFW_GAMEPAD_BUTTON_BACK`, `GLFW_GAMEPAD_BUTTON_START`, -`GLFW_GAMEPAD_BUTTON_GUIDE`, `GLFW_GAMEPAD_BUTTON_LEFT_THUMB`, -`GLFW_GAMEPAD_BUTTON_RIGHT_THUMB`, `GLFW_GAMEPAD_BUTTON_DPAD_UP`, -`GLFW_GAMEPAD_BUTTON_DPAD_RIGHT`, `GLFW_GAMEPAD_BUTTON_DPAD_DOWN` and -`GLFW_GAMEPAD_BUTTON_DPAD_LEFT`. - -For those who prefer, there are also the `GLFW_GAMEPAD_BUTTON_CROSS`, -`GLFW_GAMEPAD_BUTTON_CIRCLE`, `GLFW_GAMEPAD_BUTTON_SQUARE` and -`GLFW_GAMEPAD_BUTTON_TRIANGLE` aliases for the A, B, X and Y button indices. - -The [axis indices](@ref gamepad_axes) are `GLFW_GAMEPAD_AXIS_LEFT_X`, -`GLFW_GAMEPAD_AXIS_LEFT_Y`, `GLFW_GAMEPAD_AXIS_RIGHT_X`, -`GLFW_GAMEPAD_AXIS_RIGHT_Y`, `GLFW_GAMEPAD_AXIS_LEFT_TRIGGER` and -`GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER`. - -The `GLFW_GAMEPAD_BUTTON_LAST` and `GLFW_GAMEPAD_AXIS_LAST` constants equal -the largest available index for each array. - - -@subsection gamepad_mapping Gamepad mappings - -GLFW contains a copy of the mappings available in -[SDL_GameControllerDB](https://github.com/gabomdq/SDL_GameControllerDB) at the -time of release. Newer ones can be added at runtime with @ref -glfwUpdateGamepadMappings. - -@code -const char* mappings = load_file_contents("game/data/gamecontrollerdb.txt"); - -glfwUpdateGamepadMappings(mappings); -@endcode - -This function supports everything from single lines up to and including the -unmodified contents of the whole `gamecontrollerdb.txt` file. - -If you are compiling GLFW from source with CMake you can update the built-in mappings by -building the _update_mappings_ target. This runs the `GenerateMappings.cmake` CMake -script, which downloads `gamecontrollerdb.txt` and regenerates the `mappings.h` header -file. - -Below is a description of the mapping format. Please keep in mind that __this -description is not authoritative__. The format is defined by the SDL and -SDL_GameControllerDB projects and their documentation and code takes precedence. - -Each mapping is a single line of comma-separated values describing the GUID, -name and layout of the gamepad. Lines that do not begin with a hexadecimal -digit are ignored. - -The first value is always the gamepad GUID, a 32 character long hexadecimal -string that typically identifies its make, model, revision and the type of -connection to the computer. When this information is not available, the GUID is -generated using the gamepad name. GLFW uses the SDL 2.0.5+ GUID format but can -convert from the older formats. - -The second value is always the human-readable name of the gamepad. - -All subsequent values are in the form `:` and describe the layout -of the mapping. These fields may not all be present and may occur in any order. - -The button fields are `a`, `b`, `x`, `y`, `back`, `start`, `guide`, `dpup`, -`dpright`, `dpdown`, `dpleft`, `leftshoulder`, `rightshoulder`, `leftstick` and -`rightstick`. - -The axis fields are `leftx`, `lefty`, `rightx`, `righty`, `lefttrigger` and -`righttrigger`. - -The value of an axis or button field can be a joystick button, a joystick axis, -a hat bitmask or empty. Joystick buttons are specified as `bN`, for example -`b2` for the third button. Joystick axes are specified as `aN`, for example -`a7` for the eighth button. Joystick hat bit masks are specified as `hN.N`, for -example `h0.8` for left on the first hat. More than one bit may be set in the -mask. - -Before an axis there may be a `+` or `-` range modifier, for example `+a3` for -the positive half of the fourth axis. This restricts input to only the positive -or negative halves of the joystick axis. After an axis or half-axis there may -be the `~` inversion modifier, for example `a2~` or `-a7~`. This negates the -values of the gamepad axis. - -The hat bit mask match the [hat states](@ref hat_state) in the joystick -functions. - -There is also the special `platform` field that specifies which platform the -mapping is valid for. Possible values are `Windows`, `Mac OS X` and `Linux`. - -Below is an example of what a gamepad mapping might look like. It is the -one built into GLFW for Xbox controllers accessed via the XInput API on Windows. -This example has been broken into several lines to fit on the page, but real -gamepad mappings must be a single line. - -@code{.unparsed} -78696e70757401000000000000000000,XInput Gamepad (GLFW),platform:Windows,a:b0, -b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,leftstick:b8, -rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4, -righttrigger:a5,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8, -@endcode - -@note GLFW does not yet support the output range and modifiers `+` and `-` that -were recently added to SDL. The input modifiers `+`, `-` and `~` are supported -and described above. - - -@section time Time input - -GLFW provides high-resolution time input, in seconds, with @ref glfwGetTime. - -@code -double seconds = glfwGetTime(); -@endcode - -It returns the number of seconds since the library was initialized with @ref -glfwInit. The platform-specific time sources used typically have micro- or -nanosecond resolution. - -You can modify the base time with @ref glfwSetTime. - -@code -glfwSetTime(4.0); -@endcode - -This sets the time to the specified time, in seconds, and it continues to count -from there. - -You can also access the raw timer used to implement the functions above, -with @ref glfwGetTimerValue. - -@code -uint64_t value = glfwGetTimerValue(); -@endcode - -This value is in 1 / frequency seconds. The frequency of the raw -timer varies depending on the operating system and hardware. You can query the -frequency, in Hz, with @ref glfwGetTimerFrequency. - -@code -uint64_t frequency = glfwGetTimerFrequency(); -@endcode - - -@section clipboard Clipboard input and output - -If the system clipboard contains a UTF-8 encoded string or if it can be -converted to one, you can retrieve it with @ref glfwGetClipboardString. See the -reference documentation for the lifetime of the returned string. - -@code -const char* text = glfwGetClipboardString(NULL); -if (text) -{ - insert_text(text); -} -@endcode - -If the clipboard is empty or if its contents could not be converted, `NULL` is -returned. - -The contents of the system clipboard can be set to a UTF-8 encoded string with -@ref glfwSetClipboardString. - -@code -glfwSetClipboardString(NULL, "A string with words in it"); -@endcode - - -@section path_drop Path drop input - -If you wish to receive the paths of files and/or directories dropped on -a window, set a file drop callback. - -@code -glfwSetDropCallback(window, drop_callback); -@endcode - -The callback function receives an array of paths encoded as UTF-8. - -@code -void drop_callback(GLFWwindow* window, int count, const char** paths) -{ - int i; - for (i = 0; i < count; i++) - handle_dropped_file(paths[i]); -} -@endcode - -The path array and its strings are only valid until the file drop callback -returns, as they may have been generated specifically for that event. You need -to make a deep copy of the array if you want to keep the paths. - -*/ diff --git a/3rdparty/glfw/source/docs/internal.dox b/3rdparty/glfw/source/docs/internal.dox deleted file mode 100644 index 6922756..0000000 --- a/3rdparty/glfw/source/docs/internal.dox +++ /dev/null @@ -1,123 +0,0 @@ -/*! - -@page internals_guide Internal structure - -@tableofcontents - -There are several interfaces inside GLFW. Each interface has its own area of -responsibility and its own naming conventions. - - -@section internals_public Public interface - -The most well-known is the public interface, described in the glfw3.h header -file. This is implemented in source files shared by all platforms and these -files contain no platform-specific code. This code usually ends up calling the -platform and internal interfaces to do the actual work. - -The public interface uses the OpenGL naming conventions except with GLFW and -glfw instead of GL and gl. For struct members, where OpenGL sets no precedent, -it use headless camel case. - -Examples: `glfwCreateWindow`, `GLFWwindow`, `GLFW_RED_BITS` - - -@section internals_native Native interface - -The [native interface](@ref native) is a small set of publicly available -but platform-specific functions, described in the glfw3native.h header file and -used to gain access to the underlying window, context and (on some platforms) -display handles used by the platform interface. - -The function names of the native interface are similar to those of the public -interface, but embeds the name of the interface that the returned handle is -from. - -Examples: `glfwGetX11Window`, `glfwGetWGLContext` - - -@section internals_internal Internal interface - -The internal interface consists of utility functions used by all other -interfaces. It is shared code implemented in the same shared source files as -the public and event interfaces. The internal interface is described in the -internal.h header file. - -The internal interface is in charge of GLFW's global data, which it stores in -a `_GLFWlibrary` struct named `_glfw`. - -The internal interface uses the same style as the public interface, except all -global names have a leading underscore. - -Examples: `_glfwIsValidContextConfig`, `_GLFWwindow`, `_glfw.monitorCount` - - -@section internals_platform Platform interface - -The platform interface implements all platform-specific operations as a service -to the public interface. This includes event processing. The platform -interface is never directly called by application code and never directly calls -application-provided callbacks. It is also prohibited from modifying the -platform-independent part of the internal structs. Instead, it calls the event -interface when events interesting to GLFW are received. - -The platform interface mostly mirrors those parts of the public interface that needs to -perform platform-specific operations on some or all platforms. - -The window system bits of the platform API is called through the `_GLFWplatform` struct of -function pointers, to allow runtime selection of platform. This includes the window and -context creation, input and event processing, monitor and Vulkan surface creation parts of -GLFW. This is located in the global `_glfw` struct. - -Examples: `_glfw.platform.createWindow` - -The timer, threading and module loading bits of the platform API are plain functions with -a `_glfwPlatform` prefix, as these things are independent of what window system is being -used. - -Examples: `_glfwPlatformGetTimerValue` - -The platform interface also defines structs that contain platform-specific -global and per-object state. Their names mirror those of the internal -interface, except that an interface-specific suffix is added. - -Examples: `_GLFWwindowX11`, `_GLFWcontextWGL` - -These structs are incorporated as members into the internal interface structs -using special macros that name them after the specific interface used. This -prevents shared code from accidentally using these members. - -Examples: `window->win32.handle`, `_glfw.x11.display` - - -@section internals_event Event interface - -The event interface is implemented in the same shared source files as the public -interface and is responsible for delivering the events it receives to the -application, either via callbacks, via window state changes or both. - -The function names of the event interface use a `_glfwInput` prefix and the -ObjectEvent pattern. - -Examples: `_glfwInputWindowFocus`, `_glfwInputCursorPos` - - -@section internals_static Static functions - -Static functions may be used by any interface and have no prefixes or suffixes. -These use headless camel case. - -Examples: `isValidElementForJoystick` - - -@section internals_config Configuration macros - -GLFW uses a number of configuration macros to select at compile time which -interfaces and code paths to use. They are defined in the GLFW CMake target. - -Configuration macros the same style as tokens in the public interface, except -with a leading underscore. - -Examples: `_GLFW_WIN32`, `_GLFW_BUILD_DLL` - -*/ diff --git a/3rdparty/glfw/source/docs/intro.dox b/3rdparty/glfw/source/docs/intro.dox deleted file mode 100644 index 5cbd7eb..0000000 --- a/3rdparty/glfw/source/docs/intro.dox +++ /dev/null @@ -1,619 +0,0 @@ -/*! - -@page intro_guide Introduction to the API - -@tableofcontents - -This guide introduces the basic concepts of GLFW and describes initialization, -error handling and API guarantees and limitations. For a broad but shallow -tutorial, see @ref quick_guide instead. For details on a specific function in -this category, see the @ref init. - -There are also guides for the other areas of GLFW. - - - @ref window_guide - - @ref context_guide - - @ref vulkan_guide - - @ref monitor_guide - - @ref input_guide - - -@section intro_init Initialization and termination - -Before most GLFW functions may be called, the library must be initialized. -This initialization checks what features are available on the machine, -enumerates monitors, initializes the timer and performs any required -platform-specific initialization. - -Only the following functions may be called before the library has been -successfully initialized, and only from the main thread. - - - @ref glfwGetVersion - - @ref glfwGetVersionString - - @ref glfwPlatformSupported - - @ref glfwGetError - - @ref glfwSetErrorCallback - - @ref glfwInitHint - - @ref glfwInitAllocator - - @ref glfwInitVulkanLoader - - @ref glfwInit - - @ref glfwTerminate - -Calling any other function before successful initialization will cause a @ref -GLFW_NOT_INITIALIZED error. - - -@subsection intro_init_init Initializing GLFW - -The library is initialized with @ref glfwInit, which returns `GLFW_FALSE` if an -error occurred. - -@code -if (!glfwInit()) -{ - // Handle initialization failure -} -@endcode - -If any part of initialization fails, any parts that succeeded are terminated as -if @ref glfwTerminate had been called. The library only needs to be initialized -once and additional calls to an already initialized library will return -`GLFW_TRUE` immediately. - -Once the library has been successfully initialized, it should be terminated -before the application exits. Modern systems are very good at freeing resources -allocated by programs that exit, but GLFW sometimes has to change global system -settings and these might not be restored without termination. - -@macos When the library is initialized the main menu and dock icon are created. -These are not desirable for a command-line only program. The creation of the -main menu and dock icon can be disabled with the @ref GLFW_COCOA_MENUBAR init -hint. - - -@subsection init_hints Initialization hints - -Initialization hints are set before @ref glfwInit and affect how the library -behaves until termination. Hints are set with @ref glfwInitHint. - -@code -glfwInitHint(GLFW_JOYSTICK_HAT_BUTTONS, GLFW_FALSE); -@endcode - -The values you set hints to are never reset by GLFW, but they only take effect -during initialization. Once GLFW has been initialized, any values you set will -be ignored until the library is terminated and initialized again. - -Some hints are platform specific. These may be set on any platform but they -will only affect their specific platform. Other platforms will ignore them. -Setting these hints requires no platform specific headers or functions. - - -@subsubsection init_hints_shared Shared init hints - -@anchor GLFW_PLATFORM -__GLFW_PLATFORM__ specifies the platform to use for windowing and input. -Possible values are `GLFW_ANY_PLATFORM`, `GLFW_PLATFORM_WIN32`, -`GLFW_PLATFORM_COCOA`, `GLFW_PLATFORM_X11`, `GLFW_PLATFORM_WAYLAND` and -`GLFW_PLATFORM_NULL`. The default value is `GLFW_ANY_PLATFORM`, which will -choose any platform the library includes support for except for the Null -backend. - - -@anchor GLFW_JOYSTICK_HAT_BUTTONS -__GLFW_JOYSTICK_HAT_BUTTONS__ specifies whether to also expose joystick hats as -buttons, for compatibility with earlier versions of GLFW that did not have @ref -glfwGetJoystickHats. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. - -@anchor GLFW_ANGLE_PLATFORM_TYPE_hint -__GLFW_ANGLE_PLATFORM_TYPE__ specifies the platform type (rendering backend) to -request when using OpenGL ES and EGL via -[ANGLE](https://chromium.googlesource.com/angle/angle/). If the requested -platform type is unavailable, ANGLE will use its default. Possible values are -one of `GLFW_ANGLE_PLATFORM_TYPE_NONE`, `GLFW_ANGLE_PLATFORM_TYPE_OPENGL`, -`GLFW_ANGLE_PLATFORM_TYPE_OPENGLES`, `GLFW_ANGLE_PLATFORM_TYPE_D3D9`, -`GLFW_ANGLE_PLATFORM_TYPE_D3D11`, `GLFW_ANGLE_PLATFORM_TYPE_VULKAN` and -`GLFW_ANGLE_PLATFORM_TYPE_METAL`. - -The ANGLE platform type is specified via the `EGL_ANGLE_platform_angle` -extension. This extension is not used if this hint is -`GLFW_ANGLE_PLATFORM_TYPE_NONE`, which is the default value. - - -@subsubsection init_hints_osx macOS specific init hints - -@anchor GLFW_COCOA_CHDIR_RESOURCES_hint -__GLFW_COCOA_CHDIR_RESOURCES__ specifies whether to set the current directory to -the application to the `Contents/Resources` subdirectory of the application's -bundle, if present. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. This is -ignored on other platforms. - -@anchor GLFW_COCOA_MENUBAR_hint -__GLFW_COCOA_MENUBAR__ specifies whether to create the menu bar and dock icon -when GLFW is initialized. This applies whether the menu bar is created from -a nib or manually by GLFW. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. -This is ignored on other platforms. - - -@subsubsection init_hints_x11 X11 specific init hints - -@anchor GLFW_X11_XCB_VULKAN_SURFACE_hint -__GLFW_X11_XCB_VULKAN_SURFACE__ specifies whether to prefer the -`VK_KHR_xcb_surface` extension for creating Vulkan surfaces, or whether to use -the `VK_KHR_xlib_surface` extension. Possible values are `GLFW_TRUE` and -`GLFW_FALSE`. This is ignored on other platforms. - - -@subsubsection init_hints_values Supported and default values - -Initialization hint | Default value | Supported values --------------------------------- | ------------------------------- | ---------------- -@ref GLFW_PLATFORM | `GLFW_ANY_PLATFORM` | `GLFW_ANY_PLATFORM`, `GLFW_PLATFORM_WIN32`, `GLFW_PLATFORM_COCOA`, `GLFW_PLATFORM_X11`, `GLFW_PLATFORM_WAYLAND` or `GLFW_PLATFORM_NULL` -@ref GLFW_JOYSTICK_HAT_BUTTONS | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE` -@ref GLFW_ANGLE_PLATFORM_TYPE | `GLFW_ANGLE_PLATFORM_TYPE_NONE` | `GLFW_ANGLE_PLATFORM_TYPE_NONE`, `GLFW_ANGLE_PLATFORM_TYPE_OPENGL`, `GLFW_ANGLE_PLATFORM_TYPE_OPENGLES`, `GLFW_ANGLE_PLATFORM_TYPE_D3D9`, `GLFW_ANGLE_PLATFORM_TYPE_D3D11`, `GLFW_ANGLE_PLATFORM_TYPE_VULKAN` or `GLFW_ANGLE_PLATFORM_TYPE_METAL` -@ref GLFW_COCOA_CHDIR_RESOURCES | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE` -@ref GLFW_COCOA_MENUBAR | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE` -@ref GLFW_X11_XCB_VULKAN_SURFACE | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE` - - -@subsection platform Runtime platform selection - -GLFW can be compiled for more than one platform (window system) at once. This lets -a single library binary support both X11 and Wayland on Linux and other Unix-like systems. - -You can control platform selection via the @ref GLFW_PLATFORM initialization hint. By -default this is set to @ref GLFW_ANY_PLATFORM, which will look for supported window -systems in order of priority and select the first one it finds. It can also be set to any -specific platform to have GLFW only look for that one. - -@code -glfwInitHint(GLFW_PLATFORM, GLFW_PLATFORM_X11); -@endcode - -This mechanism also provides the Null platform, which is always supported but needs to be -explicitly requested. This platform is effectively a stub, emulating a window system on -a single 1080p monitor, but will not interact with any actual window system. - -@code -glfwInitHint(GLFW_PLATFORM, GLFW_PLATFORM_NULL); -@endcode - -You can test whether a library binary was compiled with support for a specific platform -with @ref glfwPlatformSupported. - -@code -if (glfwPlatformSupported(GLFW_PLATFORM_WAYLAND)) - glfwInitHint(GLFW_PLATFORM, GLFW_PLATFORM_WAYLAND); -@endcode - -Once GLFW has been initialized, you can query which platform was selected with @ref -glfwGetPlatform. - -@code -int platform = glfwGetPlatform(); -@endcode - -If you are using any [native access functions](@ref native), especially on Linux and other -Unix-like systems, then you may need to check that you are calling the ones matching the -selected platform. - - -@subsection init_allocator Custom heap memory allocator - -The heap memory allocator can be customized before initialization with @ref -glfwInitAllocator. - -@code -GLFWallocator allocator; -allocator.allocate = my_malloc; -allocator.reallocate = my_realloc; -allocator.deallocate = my_free; -allocator.user = NULL; - -glfwInitAllocator(&allocator); -@endcode - -The allocator will be picked up at the beginning of initialization and will be -used until GLFW has been fully terminated. Any allocator set after -initialization will be picked up only at the next initialization. - -The allocator will only be used for allocations that would have been made with -the C standard library. Memory allocations that must be made with platform -specific APIs will still use those. - -The allocation function must have a signature matching @ref GLFWallocatefun. It receives -the desired size, in bytes, and the user pointer passed to @ref glfwInitAllocator and -returns the address to the allocated memory block. - -@code -void* my_malloc(size_t size, void* user) -{ - ... -} -@endcode - -The reallocation function must have a function signature matching @ref GLFWreallocatefun. -It receives the memory block to be reallocated, the new desired size, in bytes, and the user -pointer passed to @ref glfwInitAllocator and returns the address to the resized memory -block. - -@code -void* my_realloc(void* block, size_t size, void* user) -{ - ... -} -@endcode - -The deallocation function must have a function signature matching @ref GLFWdeallocatefun. -It receives the memory block to be deallocated and the user pointer passed to @ref -glfwInitAllocator. - -@code -void my_free(void* block, void* user) -{ - ... -} -@endcode - - -@subsection intro_init_terminate Terminating GLFW - -Before your application exits, you should terminate the GLFW library if it has -been initialized. This is done with @ref glfwTerminate. - -@code -glfwTerminate(); -@endcode - -This will destroy any remaining window, monitor and cursor objects, restore any -modified gamma ramps, re-enable the screensaver if it had been disabled and free -any other resources allocated by GLFW. - -Once the library is terminated, it is as if it had never been initialized and -you will need to initialize it again before being able to use GLFW. If the -library was not initialized or had already been terminated, it return -immediately. - - -@section error_handling Error handling - -Some GLFW functions have return values that indicate an error, but this is often -not very helpful when trying to figure out what happened or why it occurred. -Other functions have no return value reserved for errors, so error notification -needs a separate channel. Finally, far from all GLFW functions have return -values. - -The last [error code](@ref errors) for the calling thread can be queried at any -time with @ref glfwGetError. - -@code -int code = glfwGetError(NULL); - -if (code != GLFW_NO_ERROR) - handle_error(code); -@endcode - -If no error has occurred since the last call, @ref GLFW_NO_ERROR (zero) is -returned. The error is cleared before the function returns. - -The error code indicates the general category of the error. Some error codes, -such as @ref GLFW_NOT_INITIALIZED has only a single meaning, whereas others like -@ref GLFW_PLATFORM_ERROR are used for many different errors. - -GLFW often has more information about an error than its general category. You -can retrieve a UTF-8 encoded human-readable description along with the error -code. If no error has occurred since the last call, the description is set to -`NULL`. - -@code -const char* description; -int code = glfwGetError(&description); - -if (description) - display_error_message(code, description); -@endcode - -The retrieved description string is only valid until the next error occurs. -This means you must make a copy of it if you want to keep it. - -You can also set an error callback, which will be called each time an error -occurs. It is set with @ref glfwSetErrorCallback. - -@code -glfwSetErrorCallback(error_callback); -@endcode - -The error callback receives the same error code and human-readable description -returned by @ref glfwGetError. - -@code -void error_callback(int code, const char* description) -{ - display_error_message(code, description); -} -@endcode - -The error callback is called after the error is stored, so calling @ref -glfwGetError from within the error callback returns the same values as the -callback argument. - -The description string passed to the callback is only valid until the error -callback returns. This means you must make a copy of it if you want to keep it. - -__Reported errors are never fatal.__ As long as GLFW was successfully -initialized, it will remain initialized and in a safe state until terminated -regardless of how many errors occur. If an error occurs during initialization -that causes @ref glfwInit to fail, any part of the library that was initialized -will be safely terminated. - -Do not rely on a currently invalid call to generate a specific error, as in the -future that same call may generate a different error or become valid. - - -@section coordinate_systems Coordinate systems - -GLFW has two primary coordinate systems: the _virtual screen_ and the window -_content area_ or _content area_. Both use the same unit: _virtual screen -coordinates_, or just _screen coordinates_, which don't necessarily correspond -to pixels. - - - -Both the virtual screen and the content area coordinate systems have the X-axis -pointing to the right and the Y-axis pointing down. - -Window and monitor positions are specified as the position of the upper-left -corners of their content areas relative to the virtual screen, while cursor -positions are specified relative to a window's content area. - -Because the origin of the window's content area coordinate system is also the -point from which the window position is specified, you can translate content -area coordinates to the virtual screen by adding the window position. The -window frame, when present, extends out from the content area but does not -affect the window position. - -Almost all positions and sizes in GLFW are measured in screen coordinates -relative to one of the two origins above. This includes cursor positions, -window positions and sizes, window frame sizes, monitor positions and video mode -resolutions. - -Two exceptions are the [monitor physical size](@ref monitor_size), which is -measured in millimetres, and [framebuffer size](@ref window_fbsize), which is -measured in pixels. - -Pixels and screen coordinates may map 1:1 on your machine, but they won't on -every other machine, for example on a Mac with a Retina display. The ratio -between screen coordinates and pixels may also change at run-time depending on -which monitor the window is currently considered to be on. - - -@section guarantees_limitations Guarantees and limitations - -This section describes the conditions under which GLFW can be expected to -function, barring bugs in the operating system or drivers. Use of GLFW outside -of these limits may work on some platforms, or on some machines, or some of the -time, or on some versions of GLFW, but it may break at any time and this will -not be considered a bug. - - -@subsection lifetime Pointer lifetimes - -GLFW will never free any pointer you provide to it and you must never free any -pointer it provides to you. - -Many GLFW functions return pointers to dynamically allocated structures, strings -or arrays, and some callbacks are provided with strings or arrays. These are -always managed by GLFW and should never be freed by the application. The -lifetime of these pointers is documented for each GLFW function and callback. -If you need to keep this data, you must copy it before its lifetime expires. - -Many GLFW functions accept pointers to structures or strings allocated by the -application. These are never freed by GLFW and are always the responsibility of -the application. If GLFW needs to keep the data in these structures or strings, -it is copied before the function returns. - -Pointer lifetimes are guaranteed not to be shortened in future minor or patch -releases. - - -@subsection reentrancy Reentrancy - -GLFW event processing and object destruction are not reentrant. This means that -the following functions must not be called from any callback function: - - - @ref glfwDestroyWindow - - @ref glfwDestroyCursor - - @ref glfwPollEvents - - @ref glfwWaitEvents - - @ref glfwWaitEventsTimeout - - @ref glfwTerminate - -These functions may be made reentrant in future minor or patch releases, but -functions not on this list will not be made non-reentrant. - - -@subsection thread_safety Thread safety - -Most GLFW functions must only be called from the main thread (the thread that -calls main), but some may be called from any thread once the library has been -initialized. Before initialization the whole library is thread-unsafe. - -The reference documentation for every GLFW function states whether it is limited -to the main thread. - -Initialization, termination, event processing and the creation and -destruction of windows, cursors and OpenGL and OpenGL ES contexts are all -restricted to the main thread due to limitations of one or several platforms. - -Because event processing must be performed on the main thread, all callbacks -except for the error callback will only be called on that thread. The error -callback may be called on any thread, as any GLFW function may generate errors. - -The error code and description may be queried from any thread. - - - @ref glfwGetError - -Empty events may be posted from any thread. - - - @ref glfwPostEmptyEvent - -The window user pointer and close flag may be read and written from any thread, -but this is not synchronized by GLFW. - - - @ref glfwGetWindowUserPointer - - @ref glfwSetWindowUserPointer - - @ref glfwWindowShouldClose - - @ref glfwSetWindowShouldClose - -These functions for working with OpenGL and OpenGL ES contexts may be called -from any thread, but the window object is not synchronized by GLFW. - - - @ref glfwMakeContextCurrent - - @ref glfwGetCurrentContext - - @ref glfwSwapBuffers - - @ref glfwSwapInterval - - @ref glfwExtensionSupported - - @ref glfwGetProcAddress - -The raw timer functions may be called from any thread. - - - @ref glfwGetTimerFrequency - - @ref glfwGetTimerValue - -The regular timer may be used from any thread, but reading and writing the timer -offset is not synchronized by GLFW. - - - @ref glfwGetTime - - @ref glfwSetTime - -Library version information may be queried from any thread. - - - @ref glfwGetVersion - - @ref glfwGetVersionString - -Platform information may be queried from any thread. - - - @ref glfwPlatformSupported - - @ref glfwGetPlatform - -All Vulkan related functions may be called from any thread. - - - @ref glfwVulkanSupported - - @ref glfwGetRequiredInstanceExtensions - - @ref glfwGetInstanceProcAddress - - @ref glfwGetPhysicalDevicePresentationSupport - - @ref glfwCreateWindowSurface - -GLFW uses synchronization objects internally only to manage the per-thread -context and error states. Additional synchronization is left to the -application. - -Functions that may currently be called from any thread will always remain so, -but functions that are currently limited to the main thread may be updated to -allow calls from any thread in future releases. - - -@subsection compatibility Version compatibility - -GLFW uses [Semantic Versioning](https://semver.org/). This guarantees source -and binary backward compatibility with earlier minor versions of the API. This -means that you can drop in a newer version of the library and existing programs -will continue to compile and existing binaries will continue to run. - -Once a function or constant has been added, the signature of that function or -value of that constant will remain unchanged until the next major version of -GLFW. No compatibility of any kind is guaranteed between major versions. - -Undocumented behavior, i.e. behavior that is not described in the documentation, -may change at any time until it is documented. - -If the reference documentation and the implementation differ, the reference -documentation will almost always take precedence and the implementation will be -fixed in the next release. The reference documentation will also take -precedence over anything stated in a guide. - - -@subsection event_order Event order - -The order of arrival of related events is not guaranteed to be consistent -across platforms. The exception is synthetic key and mouse button release -events, which are always delivered after the window defocus event. - - -@section intro_version Version management - -GLFW provides mechanisms for identifying what version of GLFW your application -was compiled against as well as what version it is currently running against. -If you are loading GLFW dynamically (not just linking dynamically), you can use -this to verify that the library binary is compatible with your application. - - -@subsection intro_version_compile Compile-time version - -The compile-time version of GLFW is provided by the GLFW header with the -`GLFW_VERSION_MAJOR`, `GLFW_VERSION_MINOR` and `GLFW_VERSION_REVISION` macros. - -@code -printf("Compiled against GLFW %i.%i.%i\n", - GLFW_VERSION_MAJOR, - GLFW_VERSION_MINOR, - GLFW_VERSION_REVISION); -@endcode - - -@subsection intro_version_runtime Run-time version - -The run-time version can be retrieved with @ref glfwGetVersion, a function that -may be called regardless of whether GLFW is initialized. - -@code -int major, minor, revision; -glfwGetVersion(&major, &minor, &revision); - -printf("Running against GLFW %i.%i.%i\n", major, minor, revision); -@endcode - - -@subsection intro_version_string Version string - -GLFW 3 also provides a compile-time generated version string that describes the -version, platform, compiler and any platform-specific compile-time options. -This is primarily intended for submitting bug reports, to allow developers to -see which code paths are enabled in a binary. - -The version string is returned by @ref glfwGetVersionString, a function that may -be called regardless of whether GLFW is initialized. - -__Do not use the version string__ to parse the GLFW library version. The @ref -glfwGetVersion function already provides the version of the running library -binary. - -__Do not use the version string__ to parse what platforms are supported. The @ref -glfwPlatformSupported function lets you query platform support. - -__GLFW 3.4:__ The format of this string was changed to support the addition of -[runtime platform selection](@ref platform). - -The format of the string is as follows: - - The version of GLFW - - For each supported platform: - - The name of the window system API - - The name of the window system specific context creation API, if applicable - - The names of the always supported context creation APIs EGL and OSMesa - - Any additional compile-time options, APIs and (on Windows) what compiler was used - -For example, GLFW 3.4 compiled as a DLL for Windows with MinGW may have a version string -like this: - -@code -3.4.0 Win32 WGL Null EGL OSMesa MinGW DLL -@endcode - -While GLFW compiled as as static library for Linux with both Wayland and X11 enabled may -have a version string like this: - -@code -3.4.0 Wayland X11 GLX Null EGL OSMesa monotonic -@endcode - -*/ diff --git a/3rdparty/glfw/source/docs/main.dox b/3rdparty/glfw/source/docs/main.dox deleted file mode 100644 index 995c2f5..0000000 --- a/3rdparty/glfw/source/docs/main.dox +++ /dev/null @@ -1,46 +0,0 @@ -/*! - -@mainpage notitle - -@section main_intro Introduction - -GLFW is a free, Open Source, multi-platform library for OpenGL, OpenGL ES and -Vulkan application development. It provides a simple, platform-independent API -for creating windows, contexts and surfaces, reading input, handling events, etc. - -@ref news_34 list new features, caveats and deprecations. - -@ref quick_guide is a guide for users new to GLFW. It takes you through how to -write a small but complete program. - -There are guides for each section of the API: - - - @ref intro_guide – initialization, error handling and high-level design - - @ref window_guide – creating and working with windows and framebuffers - - @ref context_guide – working with OpenGL and OpenGL ES contexts - - @ref vulkan_guide - working with Vulkan objects and extensions - - @ref monitor_guide – enumerating and working with monitors and video modes - - @ref input_guide – receiving events, polling and processing input - -Once you have written a program, see @ref compile_guide and @ref build_guide. - -The [reference documentation](modules.html) provides more detailed information -about specific functions. - -@ref moving_guide explains what has changed and how to update existing code to -use the new API. - -There is a section on @ref guarantees_limitations for pointer lifetimes, -reentrancy, thread safety, event order and backward and forward compatibility. - -The [FAQ](https://www.glfw.org/faq.html) answers many common questions about the -design, implementation and use of GLFW. - -Finally, @ref compat_guide explains what APIs, standards and protocols GLFW uses -and what happens when they are not present on a given machine. - -This documentation was generated with Doxygen. The sources for it are available -in both the [source distribution](https://www.glfw.org/download.html) and -[GitHub repository](https://github.com/glfw/glfw). - -*/ diff --git a/3rdparty/glfw/source/docs/monitor.dox b/3rdparty/glfw/source/docs/monitor.dox deleted file mode 100644 index 86eb454..0000000 --- a/3rdparty/glfw/source/docs/monitor.dox +++ /dev/null @@ -1,268 +0,0 @@ -/*! - -@page monitor_guide Monitor guide - -@tableofcontents - -This guide introduces the monitor related functions of GLFW. For details on -a specific function in this category, see the @ref monitor. There are also -guides for the other areas of GLFW. - - - @ref intro_guide - - @ref window_guide - - @ref context_guide - - @ref vulkan_guide - - @ref input_guide - - -@section monitor_object Monitor objects - -A monitor object represents a currently connected monitor and is represented as -a pointer to the [opaque](https://en.wikipedia.org/wiki/Opaque_data_type) type -@ref GLFWmonitor. Monitor objects cannot be created or destroyed by the -application and retain their addresses until the monitors they represent are -disconnected or until the library is [terminated](@ref intro_init_terminate). - -Each monitor has a current video mode, a list of supported video modes, -a virtual position, a human-readable name, an estimated physical size and -a gamma ramp. One of the monitors is the primary monitor. - -The virtual position of a monitor is in -[screen coordinates](@ref coordinate_systems) and, together with the current -video mode, describes the viewports that the connected monitors provide into the -virtual desktop that spans them. - -To see how GLFW views your monitor setup and its available video modes, run the -`monitors` test program. - - -@subsection monitor_monitors Retrieving monitors - -The primary monitor is returned by @ref glfwGetPrimaryMonitor. It is the user's -preferred monitor and is usually the one with global UI elements like task bar -or menu bar. - -@code -GLFWmonitor* primary = glfwGetPrimaryMonitor(); -@endcode - -You can retrieve all currently connected monitors with @ref glfwGetMonitors. -See the reference documentation for the lifetime of the returned array. - -@code -int count; -GLFWmonitor** monitors = glfwGetMonitors(&count); -@endcode - -The primary monitor is always the first monitor in the returned array, but other -monitors may be moved to a different index when a monitor is connected or -disconnected. - - -@subsection monitor_event Monitor configuration changes - -If you wish to be notified when a monitor is connected or disconnected, set -a monitor callback. - -@code -glfwSetMonitorCallback(monitor_callback); -@endcode - -The callback function receives the handle for the monitor that has been -connected or disconnected and the event that occurred. - -@code -void monitor_callback(GLFWmonitor* monitor, int event) -{ - if (event == GLFW_CONNECTED) - { - // The monitor was connected - } - else if (event == GLFW_DISCONNECTED) - { - // The monitor was disconnected - } -} -@endcode - -If a monitor is disconnected, all windows that are full screen on it will be -switched to windowed mode before the callback is called. Only @ref -glfwGetMonitorName and @ref glfwGetMonitorUserPointer will return useful values -for a disconnected monitor and only before the monitor callback returns. - - -@section monitor_properties Monitor properties - -Each monitor has a current video mode, a list of supported video modes, -a virtual position, a content scale, a human-readable name, a user pointer, an -estimated physical size and a gamma ramp. - - -@subsection monitor_modes Video modes - -GLFW generally does a good job selecting a suitable video mode when you create -a full screen window, change its video mode or make a windowed one full -screen, but it is sometimes useful to know exactly which video modes are -supported. - -Video modes are represented as @ref GLFWvidmode structures. You can get an -array of the video modes supported by a monitor with @ref glfwGetVideoModes. -See the reference documentation for the lifetime of the returned array. - -@code -int count; -GLFWvidmode* modes = glfwGetVideoModes(monitor, &count); -@endcode - -To get the current video mode of a monitor call @ref glfwGetVideoMode. See the -reference documentation for the lifetime of the returned pointer. - -@code -const GLFWvidmode* mode = glfwGetVideoMode(monitor); -@endcode - -The resolution of a video mode is specified in -[screen coordinates](@ref coordinate_systems), not pixels. - - -@subsection monitor_size Physical size - -The physical size of a monitor in millimetres, or an estimation of it, can be -retrieved with @ref glfwGetMonitorPhysicalSize. This has no relation to its -current _resolution_, i.e. the width and height of its current -[video mode](@ref monitor_modes). - -@code -int width_mm, height_mm; -glfwGetMonitorPhysicalSize(monitor, &width_mm, &height_mm); -@endcode - -While this can be used to calculate the raw DPI of a monitor, this is often not -useful. Instead use the [monitor content scale](@ref monitor_scale) and -[window content scale](@ref window_scale) to scale your content. - - -@subsection monitor_scale Content scale - -The content scale for a monitor can be retrieved with @ref -glfwGetMonitorContentScale. - -@code -float xscale, yscale; -glfwGetMonitorContentScale(monitor, &xscale, &yscale); -@endcode - -The content scale is the ratio between the current DPI and the platform's -default DPI. This is especially important for text and any UI elements. If the -pixel dimensions of your UI scaled by this look appropriate on your machine then -it should appear at a reasonable size on other machines regardless of their DPI -and scaling settings. This relies on the system DPI and scaling settings being -somewhat correct. - -The content scale may depend on both the monitor resolution and pixel density -and on user settings. It may be very different from the raw DPI calculated from -the physical size and current resolution. - - -@subsection monitor_pos Virtual position - -The position of the monitor on the virtual desktop, in -[screen coordinates](@ref coordinate_systems), can be retrieved with @ref -glfwGetMonitorPos. - -@code -int xpos, ypos; -glfwGetMonitorPos(monitor, &xpos, &ypos); -@endcode - - -@subsection monitor_workarea Work area - -The area of a monitor not occupied by global task bars or menu bars is the work -area. This is specified in [screen coordinates](@ref coordinate_systems) and -can be retrieved with @ref glfwGetMonitorWorkarea. - -@code -int xpos, ypos, width, height; -glfwGetMonitorWorkarea(monitor, &xpos, &ypos, &width, &height); -@endcode - - -@subsection monitor_name Human-readable name - -The human-readable, UTF-8 encoded name of a monitor is returned by @ref -glfwGetMonitorName. See the reference documentation for the lifetime of the -returned string. - -@code -const char* name = glfwGetMonitorName(monitor); -@endcode - -Monitor names are not guaranteed to be unique. Two monitors of the same model -and make may have the same name. Only the monitor handle is guaranteed to be -unique, and only until that monitor is disconnected. - - -@subsection monitor_userptr User pointer - -Each monitor has a user pointer that can be set with @ref -glfwSetMonitorUserPointer and queried with @ref glfwGetMonitorUserPointer. This -can be used for any purpose you need and will not be modified by GLFW. The -value will be kept until the monitor is disconnected or until the library is -terminated. - -The initial value of the pointer is `NULL`. - - -@subsection monitor_gamma Gamma ramp - -The gamma ramp of a monitor can be set with @ref glfwSetGammaRamp, which accepts -a monitor handle and a pointer to a @ref GLFWgammaramp structure. - -@code -GLFWgammaramp ramp; -unsigned short red[256], green[256], blue[256]; - -ramp.size = 256; -ramp.red = red; -ramp.green = green; -ramp.blue = blue; - -for (i = 0; i < ramp.size; i++) -{ - // Fill out gamma ramp arrays as desired -} - -glfwSetGammaRamp(monitor, &ramp); -@endcode - -The gamma ramp data is copied before the function returns, so there is no need -to keep it around once the ramp has been set. - -It is recommended that your gamma ramp have the same size as the current gamma -ramp for that monitor. - -The current gamma ramp for a monitor is returned by @ref glfwGetGammaRamp. See -the reference documentation for the lifetime of the returned structure. - -@code -const GLFWgammaramp* ramp = glfwGetGammaRamp(monitor); -@endcode - -If you wish to set a regular gamma ramp, you can have GLFW calculate it for you -from the desired exponent with @ref glfwSetGamma, which in turn calls @ref -glfwSetGammaRamp with the resulting ramp. - -@code -glfwSetGamma(monitor, 1.0); -@endcode - -To experiment with gamma correction via the @ref glfwSetGamma function, run the -`gamma` test program. - -@note The software controlled gamma ramp is applied _in addition_ to the -hardware gamma correction, which today is usually an approximation of sRGB -gamma. This means that setting a perfectly linear ramp, or gamma 1.0, will -produce the default (usually sRGB-like) behavior. - -*/ diff --git a/3rdparty/glfw/source/docs/moving.dox b/3rdparty/glfw/source/docs/moving.dox deleted file mode 100644 index b80d84a..0000000 --- a/3rdparty/glfw/source/docs/moving.dox +++ /dev/null @@ -1,513 +0,0 @@ -/*! - -@page moving_guide Moving from GLFW 2 to 3 - -@tableofcontents - -This is a transition guide for moving from GLFW 2 to 3. It describes what has -changed or been removed, but does _not_ include -[new features](@ref news) unless they are required when moving an existing code -base onto the new API. For example, the new multi-monitor functions are -required to create full screen windows with GLFW 3. - - -@section moving_removed Changed and removed features - -@subsection moving_renamed_files Renamed library and header file - -The GLFW 3 header is named @ref glfw3.h and moved to the `GLFW` directory, to -avoid collisions with the headers of other major versions. Similarly, the GLFW -3 library is named `glfw3,` except when it's installed as a shared library on -Unix-like systems, where it uses the -[soname](https://en.wikipedia.org/wiki/soname) `libglfw.so.3`. - -@par Old syntax -@code -#include -@endcode - -@par New syntax -@code -#include -@endcode - - -@subsection moving_threads Removal of threading functions - -The threading functions have been removed, including the per-thread sleep -function. They were fairly primitive, under-used, poorly integrated and took -time away from the focus of GLFW (i.e. context, input and window). There are -better threading libraries available and native threading support is available -in both [C++11](https://en.cppreference.com/w/cpp/thread) and -[C11](https://en.cppreference.com/w/c/thread), both of which are gaining -traction. - -If you wish to use the C++11 or C11 facilities but your compiler doesn't yet -support them, see the -[TinyThread++](https://gitorious.org/tinythread/tinythreadpp) and -[TinyCThread](https://github.com/tinycthread/tinycthread) projects created by -the original author of GLFW. These libraries implement a usable subset of the -threading APIs in C++11 and C11, and in fact some GLFW 3 test programs use -TinyCThread. - -However, GLFW 3 has better support for _use from multiple threads_ than GLFW -2 had. Contexts can be made current on any thread, although only a single -thread at a time, and the documentation explicitly states which functions may be -used from any thread and which must only be used from the main thread. - -@par Removed functions -`glfwSleep`, `glfwCreateThread`, `glfwDestroyThread`, `glfwWaitThread`, -`glfwGetThreadID`, `glfwCreateMutex`, `glfwDestroyMutex`, `glfwLockMutex`, -`glfwUnlockMutex`, `glfwCreateCond`, `glfwDestroyCond`, `glfwWaitCond`, -`glfwSignalCond`, `glfwBroadcastCond` and `glfwGetNumberOfProcessors`. - -@par Removed types -`GLFWthreadfun` - - -@subsection moving_image Removal of image and texture loading - -The image and texture loading functions have been removed. They only supported -the Targa image format, making them mostly useful for beginner level examples. -To become of sufficiently high quality to warrant keeping them in GLFW 3, they -would need not only to support other formats, but also modern extensions to -OpenGL texturing. This would either add a number of external -dependencies (libjpeg, libpng, etc.), or force GLFW to ship with inline versions -of these libraries. - -As there already are libraries doing this, it is unnecessary both to duplicate -the work and to tie the duplicate to GLFW. The resulting library would also be -platform-independent, as both OpenGL and stdio are available wherever GLFW is. - -@par Removed functions -`glfwReadImage`, `glfwReadMemoryImage`, `glfwFreeImage`, `glfwLoadTexture2D`, -`glfwLoadMemoryTexture2D` and `glfwLoadTextureImage2D`. - - -@subsection moving_stdcall Removal of GLFWCALL macro - -The `GLFWCALL` macro, which made callback functions use -[__stdcall](https://msdn.microsoft.com/en-us/library/zxk0tw93.aspx) on Windows, -has been removed. GLFW is written in C, not Pascal. Removing this macro means -there's one less thing for application programmers to remember, i.e. the -requirement to mark all callback functions with `GLFWCALL`. It also simplifies -the creation of DLLs and DLL link libraries, as there's no need to explicitly -disable `@n` entry point suffixes. - -@par Old syntax -@code -void GLFWCALL callback_function(...); -@endcode - -@par New syntax -@code -void callback_function(...); -@endcode - - -@subsection moving_window_handles Window handle parameters - -Because GLFW 3 supports multiple windows, window handle parameters have been -added to all window-related GLFW functions and callbacks. The handle of -a newly created window is returned by @ref glfwCreateWindow (formerly -`glfwOpenWindow`). Window handles are pointers to the -[opaque](https://en.wikipedia.org/wiki/Opaque_data_type) type @ref GLFWwindow. - -@par Old syntax -@code -glfwSetWindowTitle("New Window Title"); -@endcode - -@par New syntax -@code -glfwSetWindowTitle(window, "New Window Title"); -@endcode - - -@subsection moving_monitor Explicit monitor selection - -GLFW 3 provides support for multiple monitors. To request a full screen mode window, -instead of passing `GLFW_FULLSCREEN` you specify which monitor you wish the -window to use. The @ref glfwGetPrimaryMonitor function returns the monitor that -GLFW 2 would have selected, but there are many other -[monitor functions](@ref monitor_guide). Monitor handles are pointers to the -[opaque](https://en.wikipedia.org/wiki/Opaque_data_type) type @ref GLFWmonitor. - -@par Old basic full screen -@code -glfwOpenWindow(640, 480, 8, 8, 8, 0, 24, 0, GLFW_FULLSCREEN); -@endcode - -@par New basic full screen -@code -window = glfwCreateWindow(640, 480, "My Window", glfwGetPrimaryMonitor(), NULL); -@endcode - -@note The framebuffer bit depth parameters of `glfwOpenWindow` have been turned -into [window hints](@ref window_hints), but as they have been given -[sane defaults](@ref window_hints_values) you rarely need to set these hints. - - -@subsection moving_autopoll Removal of automatic event polling - -GLFW 3 does not automatically poll for events in @ref glfwSwapBuffers, meaning -you need to call @ref glfwPollEvents or @ref glfwWaitEvents yourself. Unlike -buffer swap, which acts on a single window, the event processing functions act -on all windows at once. - -@par Old basic main loop -@code -while (...) -{ - // Process input - // Render output - glfwSwapBuffers(); -} -@endcode - -@par New basic main loop -@code -while (...) -{ - // Process input - // Render output - glfwSwapBuffers(window); - glfwPollEvents(); -} -@endcode - - -@subsection moving_context Explicit context management - -Each GLFW 3 window has its own OpenGL context and only you, the application -programmer, can know which context should be current on which thread at any -given time. Therefore, GLFW 3 leaves that decision to you. - -This means that you need to call @ref glfwMakeContextCurrent after creating -a window before you can call any OpenGL functions. - - -@subsection moving_hidpi Separation of window and framebuffer sizes - -Window positions and sizes now use screen coordinates, which may not be the same -as pixels on machines with high-DPI monitors. This is important as OpenGL uses -pixels, not screen coordinates. For example, the rectangle specified with -`glViewport` needs to use pixels. Therefore, framebuffer size functions have -been added. You can retrieve the size of the framebuffer of a window with @ref -glfwGetFramebufferSize function. A framebuffer size callback has also been -added, which can be set with @ref glfwSetFramebufferSizeCallback. - -@par Old basic viewport setup -@code -glfwGetWindowSize(&width, &height); -glViewport(0, 0, width, height); -@endcode - -@par New basic viewport setup -@code -glfwGetFramebufferSize(window, &width, &height); -glViewport(0, 0, width, height); -@endcode - - -@subsection moving_window_close Window closing changes - -The `GLFW_OPENED` window parameter has been removed. As long as the window has -not been destroyed, whether through @ref glfwDestroyWindow or @ref -glfwTerminate, the window is "open". - -A user attempting to close a window is now just an event like any other. Unlike -GLFW 2, windows and contexts created with GLFW 3 will never be destroyed unless -you choose them to be. Each window now has a close flag that is set to -`GLFW_TRUE` when the user attempts to close that window. By default, nothing else -happens and the window stays visible. It is then up to you to either destroy -the window, take some other action or ignore the request. - -You can query the close flag at any time with @ref glfwWindowShouldClose and set -it at any time with @ref glfwSetWindowShouldClose. - -@par Old basic main loop -@code -while (glfwGetWindowParam(GLFW_OPENED)) -{ - ... -} -@endcode - -@par New basic main loop -@code -while (!glfwWindowShouldClose(window)) -{ - ... -} -@endcode - -The close callback no longer returns a value. Instead, it is called after the -close flag has been set so it can override its value, if it chooses to, before -event processing completes. You may however not call @ref glfwDestroyWindow -from the close callback (or any other window related callback). - -@par Old syntax -@code -int GLFWCALL window_close_callback(void); -@endcode - -@par New syntax -@code -void window_close_callback(GLFWwindow* window); -@endcode - -@note GLFW never clears the close flag to `GLFW_FALSE`, meaning you can use it -for other reasons to close the window as well, for example the user choosing -Quit from an in-game menu. - - -@subsection moving_hints Persistent window hints - -The `glfwOpenWindowHint` function has been renamed to @ref glfwWindowHint. - -Window hints are no longer reset to their default values on window creation, but -instead retain their values until modified by @ref glfwWindowHint or @ref -glfwDefaultWindowHints, or until the library is terminated and re-initialized. - - -@subsection moving_video_modes Video mode enumeration - -Video mode enumeration is now per-monitor. The @ref glfwGetVideoModes function -now returns all available modes for a specific monitor instead of requiring you -to guess how large an array you need. The `glfwGetDesktopMode` function, which -had poorly defined behavior, has been replaced by @ref glfwGetVideoMode, which -returns the current mode of a monitor. - - -@subsection moving_char_up Removal of character actions - -The action parameter of the [character callback](@ref GLFWcharfun) has been -removed. This was an artefact of the origin of GLFW, i.e. being developed in -English by a Swede. However, many keyboard layouts require more than one key to -produce characters with diacritical marks. Even the Swedish keyboard layout -requires this for uncommon cases like ü. - -@par Old syntax -@code -void GLFWCALL character_callback(int character, int action); -@endcode - -@par New syntax -@code -void character_callback(GLFWwindow* window, int character); -@endcode - - -@subsection moving_cursorpos Cursor position changes - -The `glfwGetMousePos` function has been renamed to @ref glfwGetCursorPos, -`glfwSetMousePos` to @ref glfwSetCursorPos and `glfwSetMousePosCallback` to @ref -glfwSetCursorPosCallback. - -The cursor position is now `double` instead of `int`, both for the direct -functions and for the callback. Some platforms can provide sub-pixel cursor -movement and this data is now passed on to the application where available. On -platforms where this is not provided, the decimal part is zero. - -GLFW 3 only allows you to position the cursor within a window using @ref -glfwSetCursorPos (formerly `glfwSetMousePos`) when that window is active. -Unless the window is active, the function fails silently. - - -@subsection moving_wheel Wheel position replaced by scroll offsets - -The `glfwGetMouseWheel` function has been removed. Scrolling is the input of -offsets and has no absolute position. The mouse wheel callback has been -replaced by a [scroll callback](@ref GLFWscrollfun) that receives -two-dimensional floating point scroll offsets. This allows you to receive -precise scroll data from for example modern touchpads. - -@par Old syntax -@code -void GLFWCALL mouse_wheel_callback(int position); -@endcode - -@par New syntax -@code -void scroll_callback(GLFWwindow* window, double xoffset, double yoffset); -@endcode - -@par Removed functions -`glfwGetMouseWheel` - - -@subsection moving_repeat Key repeat action - -The `GLFW_KEY_REPEAT` enable has been removed and key repeat is always enabled -for both keys and characters. A new key action, `GLFW_REPEAT`, has been added -to allow the [key callback](@ref GLFWkeyfun) to distinguish an initial key press -from a repeat. Note that @ref glfwGetKey still returns only `GLFW_PRESS` or -`GLFW_RELEASE`. - - -@subsection moving_keys Physical key input - -GLFW 3 key tokens map to physical keys, unlike in GLFW 2 where they mapped to -the values generated by the current keyboard layout. The tokens are named -according to the values they would have using the standard US layout, but this -is only a convenience, as most programmers are assumed to know that layout. -This means that (for example) `GLFW_KEY_LEFT_BRACKET` is always a single key and -is the same key in the same place regardless of what keyboard layouts the users -of your program has. - -The key input facility was never meant for text input, although using it that -way worked slightly better in GLFW 2. If you were using it to input text, you -should be using the character callback instead, on both GLFW 2 and 3. This will -give you the characters being input, as opposed to the keys being pressed. - -GLFW 3 has key tokens for all keys on a standard 105 key keyboard, so instead of -having to remember whether to check for `a` or `A`, you now check for -@ref GLFW_KEY_A. - - -@subsection moving_joystick Joystick function changes - -The `glfwGetJoystickPos` function has been renamed to @ref glfwGetJoystickAxes. - -The `glfwGetJoystickParam` function and the `GLFW_PRESENT`, `GLFW_AXES` and -`GLFW_BUTTONS` tokens have been replaced by the @ref glfwJoystickPresent -function as well as axis and button counts returned by the @ref -glfwGetJoystickAxes and @ref glfwGetJoystickButtons functions. - - -@subsection moving_mbcs Win32 MBCS support - -The Win32 port of GLFW 3 will not compile in -[MBCS mode](https://msdn.microsoft.com/en-us/library/5z097dxa.aspx). -However, because the use of the Unicode version of the Win32 API doesn't affect -the process as a whole, but only those windows created using it, it's perfectly -possible to call MBCS functions from other parts of the same application. -Therefore, even if an application using GLFW has MBCS mode code, there's no need -for GLFW itself to support it. - - -@subsection moving_windows Support for versions of Windows older than XP - -All explicit support for version of Windows older than XP has been removed. -There is no code that actively prevents GLFW 3 from running on these earlier -versions, but it uses Win32 functions that those versions lack. - -Windows XP was released in 2001, and by now (January 2015) it has not only -replaced almost all earlier versions of Windows, but is itself rapidly being -replaced by Windows 7 and 8. The MSDN library doesn't even provide -documentation for version older than Windows 2000, making it difficult to -maintain compatibility with these versions even if it was deemed worth the -effort. - -The Win32 API has also not stood still, and GLFW 3 uses many functions only -present on Windows XP or later. Even supporting an OS as new as XP (new -from the perspective of GLFW 2, which still supports Windows 95) requires -runtime checking for a number of functions that are present only on modern -version of Windows. - - -@subsection moving_syskeys Capture of system-wide hotkeys - -The ability to disable and capture system-wide hotkeys like Alt+Tab has been -removed. Modern applications, whether they're games, scientific visualisations -or something else, are nowadays expected to be good desktop citizens and allow -these hotkeys to function even when running in full screen mode. - - -@subsection moving_terminate Automatic termination - -GLFW 3 does not register @ref glfwTerminate with `atexit` at initialization, -because `exit` calls registered functions from the calling thread and while it -is permitted to call `exit` from any thread, @ref glfwTerminate must only be -called from the main thread. - -To release all resources allocated by GLFW, you should call @ref glfwTerminate -yourself, from the main thread, before the program terminates. Note that this -destroys all windows not already destroyed with @ref glfwDestroyWindow, -invalidating any window handles you may still have. - - -@subsection moving_glu GLU header inclusion - -GLFW 3 does not by default include the GLU header and GLU itself has been -deprecated by [Khronos](https://en.wikipedia.org/wiki/Khronos_Group). __New -projects should not use GLU__, but if you need it for legacy code that -has been moved to GLFW 3, you can request that the GLFW header includes it by -defining @ref GLFW_INCLUDE_GLU before the inclusion of the GLFW header. - -@par Old syntax -@code -#include -@endcode - -@par New syntax -@code -#define GLFW_INCLUDE_GLU -#include -@endcode - -There are many libraries that offer replacements for the functionality offered -by GLU. For the matrix helper functions, see math libraries like -[GLM](https://github.com/g-truc/glm) (for C++), -[linmath.h](https://github.com/datenwolf/linmath.h) (for C) and others. For the -tessellation functions, see for example -[libtess2](https://github.com/memononen/libtess2). - - -@section moving_tables Name change tables - - -@subsection moving_renamed_functions Renamed functions - -| GLFW 2 | GLFW 3 | Notes | -| --------------------------- | ----------------------------- | ----- | -| `glfwOpenWindow` | @ref glfwCreateWindow | All channel bit depths are now hints -| `glfwCloseWindow` | @ref glfwDestroyWindow | | -| `glfwOpenWindowHint` | @ref glfwWindowHint | Now accepts all `GLFW_*_BITS` tokens | -| `glfwEnable` | @ref glfwSetInputMode | | -| `glfwDisable` | @ref glfwSetInputMode | | -| `glfwGetMousePos` | @ref glfwGetCursorPos | | -| `glfwSetMousePos` | @ref glfwSetCursorPos | | -| `glfwSetMousePosCallback` | @ref glfwSetCursorPosCallback | | -| `glfwSetMouseWheelCallback` | @ref glfwSetScrollCallback | Accepts two-dimensional scroll offsets as doubles | -| `glfwGetJoystickPos` | @ref glfwGetJoystickAxes | | -| `glfwGetWindowParam` | @ref glfwGetWindowAttrib | | -| `glfwGetGLVersion` | @ref glfwGetWindowAttrib | Use `GLFW_CONTEXT_VERSION_MAJOR`, `GLFW_CONTEXT_VERSION_MINOR` and `GLFW_CONTEXT_REVISION` | -| `glfwGetDesktopMode` | @ref glfwGetVideoMode | Returns the current mode of a monitor | -| `glfwGetJoystickParam` | @ref glfwJoystickPresent | The axis and button counts are provided by @ref glfwGetJoystickAxes and @ref glfwGetJoystickButtons | - - -@subsection moving_renamed_types Renamed types - -| GLFW 2 | GLFW 3 | Notes | -| ------------------- | --------------------- | | -| `GLFWmousewheelfun` | @ref GLFWscrollfun | | -| `GLFWmouseposfun` | @ref GLFWcursorposfun | | - - -@subsection moving_renamed_tokens Renamed tokens - -| GLFW 2 | GLFW 3 | Notes | -| --------------------------- | ---------------------------- | ----- | -| `GLFW_OPENGL_VERSION_MAJOR` | `GLFW_CONTEXT_VERSION_MAJOR` | Renamed as it applies to OpenGL ES as well | -| `GLFW_OPENGL_VERSION_MINOR` | `GLFW_CONTEXT_VERSION_MINOR` | Renamed as it applies to OpenGL ES as well | -| `GLFW_FSAA_SAMPLES` | `GLFW_SAMPLES` | Renamed to match the OpenGL API | -| `GLFW_ACTIVE` | `GLFW_FOCUSED` | Renamed to match the window focus callback | -| `GLFW_WINDOW_NO_RESIZE` | `GLFW_RESIZABLE` | The default has been inverted | -| `GLFW_MOUSE_CURSOR` | `GLFW_CURSOR` | Used with @ref glfwSetInputMode | -| `GLFW_KEY_ESC` | `GLFW_KEY_ESCAPE` | | -| `GLFW_KEY_DEL` | `GLFW_KEY_DELETE` | | -| `GLFW_KEY_PAGEUP` | `GLFW_KEY_PAGE_UP` | | -| `GLFW_KEY_PAGEDOWN` | `GLFW_KEY_PAGE_DOWN` | | -| `GLFW_KEY_KP_NUM_LOCK` | `GLFW_KEY_NUM_LOCK` | | -| `GLFW_KEY_LCTRL` | `GLFW_KEY_LEFT_CONTROL` | | -| `GLFW_KEY_LSHIFT` | `GLFW_KEY_LEFT_SHIFT` | | -| `GLFW_KEY_LALT` | `GLFW_KEY_LEFT_ALT` | | -| `GLFW_KEY_LSUPER` | `GLFW_KEY_LEFT_SUPER` | | -| `GLFW_KEY_RCTRL` | `GLFW_KEY_RIGHT_CONTROL` | | -| `GLFW_KEY_RSHIFT` | `GLFW_KEY_RIGHT_SHIFT` | | -| `GLFW_KEY_RALT` | `GLFW_KEY_RIGHT_ALT` | | -| `GLFW_KEY_RSUPER` | `GLFW_KEY_RIGHT_SUPER` | | - -*/ diff --git a/3rdparty/glfw/source/docs/news.dox b/3rdparty/glfw/source/docs/news.dox deleted file mode 100644 index fbf6031..0000000 --- a/3rdparty/glfw/source/docs/news.dox +++ /dev/null @@ -1,240 +0,0 @@ -/*! - -@page news Release notes - -@tableofcontents - - -@section news_34 Release notes for version 3.4 - -@subsection features_34 New features in version 3.4 - -@subsubsection runtime_platform_34 Runtime platform selection - -GLFW now supports being compiled for multiple backends and selecting between -them at runtime with the @ref GLFW_PLATFORM init hint. After initialization the -selected platform can be queried with @ref glfwGetPlatform. You can check if -support for a given platform is compiled in with @ref glfwPlatformSupported. - - -@subsubsection standard_cursors_34 More standard cursors - -GLFW now provides the standard cursor shapes @ref GLFW_RESIZE_NWSE_CURSOR and -@ref GLFW_RESIZE_NESW_CURSOR for diagonal resizing, @ref GLFW_RESIZE_ALL_CURSOR -for omni-directional resizing and @ref GLFW_NOT_ALLOWED_CURSOR for showing an -action is not allowed. - -Unlike the original set, these shapes may not be available everywhere and -creation will then fail with the new @ref GLFW_CURSOR_UNAVAILABLE error. - -The cursors for horizontal and vertical resizing are now referred to as @ref -GLFW_RESIZE_EW_CURSOR and @ref GLFW_RESIZE_NS_CURSOR, and the pointing hand -cursor is now referred to as @ref GLFW_POINTING_HAND_CURSOR. The older names -are still available. - -For more information see @ref cursor_standard. - - -@subsubsection mouse_passthrough_34 Mouse event passthrough - -GLFW now provides the [GLFW_MOUSE_PASSTHROUGH](@ref GLFW_MOUSE_PASSTHROUGH_hint) -window hint for making a window transparent to mouse input, lettings events pass -to whatever window is behind it. This can also be changed after window -creation with the matching [window attribute](@ref GLFW_MOUSE_PASSTHROUGH_attrib). - - -@subsubsection features_34_angle_backend Support for ANGLE rendering backend selection - -GLFW now provides the -[GLFW_ANGLE_PLATFORM_TYPE](@ref GLFW_ANGLE_PLATFORM_TYPE_hint) init hint for -requesting a specific rendering backend when using -[ANGLE](https://chromium.googlesource.com/angle/angle/) to create OpenGL ES -contexts. - - -@subsubsection features_34_init_allocator Support for custom memory allocator - -GLFW now supports plugging a custom memory allocator at initialization with @ref -glfwInitAllocator. The allocator is a struct of type @ref GLFWallocator with -function pointers corresponding to the standard library functions `malloc`, -`realloc` and `free`. - -For more information see @ref init_allocator. - - -@subsubsection features_34_win32_keymenu Support for keyboard access to Windows window menu - -GLFW now provides the -[GLFW_WIN32_KEYBOARD_MENU](@ref GLFW_WIN32_KEYBOARD_MENU_hint) window hint for -enabling keyboard access to the window menu via the Alt+Space and -Alt-and-then-Space shortcuts. This may be useful for more GUI-oriented -applications. - - -@subsection caveats Caveats for version 3.4 - -@subsubsection native_34 Multiple sets of native access functions - -Because GLFW now supports runtime selection of platform (window system), a library binary -may export native access functions for multiple platforms. Starting with version 3.4 you -must not assume that GLFW is running on a platform just because it exports native access -functions for it. After initialization you can query the selected platform with @ref -glfwGetPlatform. - - -@subsubsection version_string_34 Version string format has been changed - -Because GLFW now supports runtime selection of platform (window system), the version -string returned by @ref glfwGetVersionString has been expanded. It now contains the names -of all APIs for all the platforms that the library binary supports. - - -@subsubsection joysticks_34 Joystick support is initialized on demand - -The joystick part of GLFW is now initialized when first used, primarily to work -around faulty Windows drivers that cause DirectInput to take up to several -seconds to enumerate devices. - -This change will usually not be observable. However, if your application waits -for events without having first called any joystick function or created any -visible windows, the wait may never unblock as GLFW may not yet have subscribed -to joystick related OS events. - -To work around this, call any joystick function before waiting for events, for -example by setting a [joystick callback](@ref joystick_event). - - -@subsubsection standalone_34 Tests and examples are disabled when built as a sub-project - -GLFW now does not build the tests and examples when it is added as -a subdirectory of another CMake project. To enable these, set the @ref -GLFW_BUILD_TESTS and @ref GLFW_BUILD_EXAMPLES cache variables before adding the -GLFW subdirectory. - -@code{.cmake} -set(GLFW_BUILD_EXAMPLES ON CACHE BOOL "" FORCE) -set(GLFW_BUILD_TESTS ON CACHE BOOL "" FORCE) -add_subdirectory(path/to/glfw) -@endcode - - -@subsubsection initmenu_34 macOS main menu now created at initialization - -GLFW now creates the main menu and completes the initialization of NSApplication -during initialization. Programs that do not want a main menu can disable it -with the [GLFW_COCOA_MENUBAR](@ref GLFW_COCOA_MENUBAR_hint) init hint. - - -@subsubsection corevideo_34 CoreVideo dependency has been removed - -GLFW no longer depends on the CoreVideo framework on macOS and it no longer -needs to be specified during compilation or linking. - - -@subsubsection caveat_fbtransparency_34 Framebuffer transparency requires DWM transparency - -GLFW no longer supports framebuffer transparency enabled via @ref -GLFW_TRANSPARENT_FRAMEBUFFER on Windows 7 if DWM transparency is off -(the Transparency setting under Personalization > Window Color). - - -@subsubsection emptyevents_34 Empty events on X11 no longer roundtrip to server - -Events posted with @ref glfwPostEmptyEvent now use a separate unnamed pipe -instead of sending an X11 client event to the helper window. - - -@subsection deprecations_34 Deprecations in version 3.4 - -@subsection removals_34 Removals in 3.4 - -@subsubsection vulkan_static_34 GLFW_VULKAN_STATIC CMake option has been removed - -This option was used to compile GLFW directly linked with the Vulkan loader, instead of -using dynamic loading to get hold of `vkGetInstanceProcAddr` at initialization. This is -now done by calling the @ref glfwInitVulkanLoader function before initialization. - -If you need backward compatibility, this macro can still be defined for GLFW 3.4 and will -have no effect. The call to @ref glfwInitVulkanLoader can be conditionally enabled in -your code by checking the @ref GLFW_VERSION_MAJOR and @ref GLFW_VERSION_MINOR macros. - - -@subsubsection osmesa_option_34 GLFW_USE_OSMESA CMake option has been removed - -This option was used to compile GLFW for the Null platform. The Null platform is now -always supported. To produce a library binary that only supports this platform, the way -this CMake option used to do, you will instead need to disable the default platform for -the target OS. This means setting the @ref GLFW_BUILD_WIN32, @ref GLFW_BUILD_COCOA or -@ref GLFW_BUILD_X11 CMake option to false. - -You can set all of them to false and the ones that don't apply for the target OS will be -ignored. - - -@subsubsection wl_shell_34 Support for the wl_shell protocol has been removed - -Support for the wl_shell protocol has been removed and GLFW now only supports -the XDG-Shell protocol. If your Wayland compositor does not support XDG-Shell -then GLFW will fail to initialize. - - -@subsection symbols_34 New symbols in version 3.4 - -@subsubsection functions_34 New functions in version 3.4 - - - @ref glfwInitAllocator - - @ref glfwGetPlatform - - @ref glfwPlatformSupported - - @ref glfwInitVulkanLoader - - -@subsubsection types_34 New types in version 3.4 - - - @ref GLFWallocator - - @ref GLFWallocatefun - - @ref GLFWreallocatefun - - @ref GLFWdeallocatefun - - -@subsubsection constants_34 New constants in version 3.4 - - - @ref GLFW_PLATFORM - - @ref GLFW_ANY_PLATFORM - - @ref GLFW_PLATFORM_WIN32 - - @ref GLFW_PLATFORM_COCOA - - @ref GLFW_PLATFORM_WAYLAND - - @ref GLFW_PLATFORM_X11 - - @ref GLFW_PLATFORM_NULL - - @ref GLFW_PLATFORM_UNAVAILABLE - - @ref GLFW_POINTING_HAND_CURSOR - - @ref GLFW_RESIZE_EW_CURSOR - - @ref GLFW_RESIZE_NS_CURSOR - - @ref GLFW_RESIZE_NWSE_CURSOR - - @ref GLFW_RESIZE_NESW_CURSOR - - @ref GLFW_RESIZE_ALL_CURSOR - - @ref GLFW_MOUSE_PASSTHROUGH - - @ref GLFW_NOT_ALLOWED_CURSOR - - @ref GLFW_CURSOR_UNAVAILABLE - - @ref GLFW_WIN32_KEYBOARD_MENU - - @ref GLFW_CONTEXT_DEBUG - - @ref GLFW_FEATURE_UNAVAILABLE - - @ref GLFW_FEATURE_UNIMPLEMENTED - - @ref GLFW_ANGLE_PLATFORM_TYPE - - @ref GLFW_ANGLE_PLATFORM_TYPE_NONE - - @ref GLFW_ANGLE_PLATFORM_TYPE_OPENGL - - @ref GLFW_ANGLE_PLATFORM_TYPE_OPENGLES - - @ref GLFW_ANGLE_PLATFORM_TYPE_D3D9 - - @ref GLFW_ANGLE_PLATFORM_TYPE_D3D11 - - @ref GLFW_ANGLE_PLATFORM_TYPE_VULKAN - - @ref GLFW_ANGLE_PLATFORM_TYPE_METAL - - @ref GLFW_X11_XCB_VULKAN_SURFACE - - -@section news_archive Release notes for earlier versions - -- [Release notes for 3.3](https://www.glfw.org/docs/3.3/news.html) -- [Release notes for 3.2](https://www.glfw.org/docs/3.2/news.html) -- [Release notes for 3.1](https://www.glfw.org/docs/3.1/news.html) -- [Release notes for 3.0](https://www.glfw.org/docs/3.0/news.html) - -*/ diff --git a/3rdparty/glfw/source/docs/quick.dox b/3rdparty/glfw/source/docs/quick.dox deleted file mode 100644 index c3f47aa..0000000 --- a/3rdparty/glfw/source/docs/quick.dox +++ /dev/null @@ -1,371 +0,0 @@ -/*! - -@page quick_guide Getting started - -@tableofcontents - -This guide takes you through writing a small application using GLFW 3. The -application will create a window and OpenGL context, render a rotating triangle -and exit when the user closes the window or presses _Escape_. This guide will -introduce a few of the most commonly used functions, but there are many more. - -This guide assumes no experience with earlier versions of GLFW. If you -have used GLFW 2 in the past, read @ref moving_guide, as some functions -behave differently in GLFW 3. - - -@section quick_steps Step by step - -@subsection quick_include Including the GLFW header - -In the source files of your application where you use GLFW, you need to include -its header file. - -@code -#include -@endcode - -This header provides all the constants, types and function prototypes of the -GLFW API. - -By default it also includes the OpenGL header from your development environment. -On some platforms this header only supports older versions of OpenGL. The most -extreme case is Windows, where it typically only supports OpenGL 1.2. - -Most programs will instead use an -[extension loader library](@ref context_glext_auto) and include its header. -This example uses files generated by [glad](https://gen.glad.sh/). The GLFW -header can detect most such headers if they are included first and will then not -include the one from your development environment. - -@code -#include -#include -@endcode - -To make sure there will be no header conflicts, you can define @ref -GLFW_INCLUDE_NONE before the GLFW header to explicitly disable inclusion of the -development environment header. This also allows the two headers to be included -in any order. - -@code -#define GLFW_INCLUDE_NONE -#include -#include -@endcode - - -@subsection quick_init_term Initializing and terminating GLFW - -Before you can use most GLFW functions, the library must be initialized. On -successful initialization, `GLFW_TRUE` is returned. If an error occurred, -`GLFW_FALSE` is returned. - -@code -if (!glfwInit()) -{ - // Initialization failed -} -@endcode - -Note that `GLFW_TRUE` and `GLFW_FALSE` are and will always be one and zero. - -When you are done using GLFW, typically just before the application exits, you -need to terminate GLFW. - -@code -glfwTerminate(); -@endcode - -This destroys any remaining windows and releases any other resources allocated by -GLFW. After this call, you must initialize GLFW again before using any GLFW -functions that require it. - - -@subsection quick_capture_error Setting an error callback - -Most events are reported through callbacks, whether it's a key being pressed, -a GLFW window being moved, or an error occurring. Callbacks are C functions (or -C++ static methods) that are called by GLFW with arguments describing the event. - -In case a GLFW function fails, an error is reported to the GLFW error callback. -You can receive these reports with an error callback. This function must have -the signature below but may do anything permitted in other callbacks. - -@code -void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} -@endcode - -Callback functions must be set, so GLFW knows to call them. The function to set -the error callback is one of the few GLFW functions that may be called before -initialization, which lets you be notified of errors both during and after -initialization. - -@code -glfwSetErrorCallback(error_callback); -@endcode - - -@subsection quick_create_window Creating a window and context - -The window and its OpenGL context are created with a single call to @ref -glfwCreateWindow, which returns a handle to the created combined window and -context object - -@code -GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", NULL, NULL); -if (!window) -{ - // Window or OpenGL context creation failed -} -@endcode - -This creates a 640 by 480 windowed mode window with an OpenGL context. If -window or OpenGL context creation fails, `NULL` will be returned. You should -always check the return value. While window creation rarely fails, context -creation depends on properly installed drivers and may fail even on machines -with the necessary hardware. - -By default, the OpenGL context GLFW creates may have any version. You can -require a minimum OpenGL version by setting the `GLFW_CONTEXT_VERSION_MAJOR` and -`GLFW_CONTEXT_VERSION_MINOR` hints _before_ creation. If the required minimum -version is not supported on the machine, context (and window) creation fails. - -You can select the OpenGL profile by setting the `GLFW_OPENGL_PROFILE` hint. -This program uses the core profile as that is the only profile macOS supports -for OpenGL 3.x and 4.x. - -@code -glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); -glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); -glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); -GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", NULL, NULL); -if (!window) -{ - // Window or context creation failed -} -@endcode - -The window handle is passed to all window related functions and is provided to -along to all window related callbacks, so they can tell which window received -the event. - -When a window and context is no longer needed, destroy it. - -@code -glfwDestroyWindow(window); -@endcode - -Once this function is called, no more events will be delivered for that window -and its handle becomes invalid. - - -@subsection quick_context_current Making the OpenGL context current - -Before you can use the OpenGL API, you must have a current OpenGL context. - -@code -glfwMakeContextCurrent(window); -@endcode - -The context will remain current until you make another context current or until -the window owning the current context is destroyed. - -If you are using an [extension loader library](@ref context_glext_auto) to -access modern OpenGL then this is when to initialize it, as the loader needs -a current context to load from. This example uses -[glad](https://github.com/Dav1dde/glad), but the same rule applies to all such -libraries. - -@code -gladLoadGL(glfwGetProcAddress); -@endcode - - -@subsection quick_window_close Checking the window close flag - -Each window has a flag indicating whether the window should be closed. - -When the user attempts to close the window, either by pressing the close widget -in the title bar or using a key combination like Alt+F4, this flag is set to 1. -Note that __the window isn't actually closed__, so you are expected to monitor -this flag and either destroy the window or give some kind of feedback to the -user. - -@code -while (!glfwWindowShouldClose(window)) -{ - // Keep running -} -@endcode - -You can be notified when the user is attempting to close the window by setting -a close callback with @ref glfwSetWindowCloseCallback. The callback will be -called immediately after the close flag has been set. - -You can also set it yourself with @ref glfwSetWindowShouldClose. This can be -useful if you want to interpret other kinds of input as closing the window, like -for example pressing the _Escape_ key. - - -@subsection quick_key_input Receiving input events - -Each window has a large number of callbacks that can be set to receive all the -various kinds of events. To receive key press and release events, create a key -callback function. - -@code -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) - glfwSetWindowShouldClose(window, GLFW_TRUE); -} -@endcode - -The key callback, like other window related callbacks, are set per-window. - -@code -glfwSetKeyCallback(window, key_callback); -@endcode - -In order for event callbacks to be called when events occur, you need to process -events as described below. - - -@subsection quick_render Rendering with OpenGL - -Once you have a current OpenGL context, you can use OpenGL normally. In this -tutorial, a multi-colored rotating triangle will be rendered. The framebuffer -size needs to be retrieved for `glViewport`. - -@code -int width, height; -glfwGetFramebufferSize(window, &width, &height); -glViewport(0, 0, width, height); -@endcode - -You can also set a framebuffer size callback using @ref -glfwSetFramebufferSizeCallback and be notified when the size changes. - -The details of how to render with OpenGL is outside the scope of this tutorial, -but there are many excellent resources for learning modern OpenGL. Here are -a few of them: - - - [Anton's OpenGL 4 Tutorials](https://antongerdelan.net/opengl/) - - [Learn OpenGL](https://learnopengl.com/) - - [Open.GL](https://open.gl/) - -These all happen to use GLFW, but OpenGL itself works the same whatever API you -use to create the window and context. - - -@subsection quick_timer Reading the timer - -To create smooth animation, a time source is needed. GLFW provides a timer that -returns the number of seconds since initialization. The time source used is the -most accurate on each platform and generally has micro- or nanosecond -resolution. - -@code -double time = glfwGetTime(); -@endcode - - -@subsection quick_swap_buffers Swapping buffers - -GLFW windows by default use double buffering. That means that each window has -two rendering buffers; a front buffer and a back buffer. The front buffer is -the one being displayed and the back buffer the one you render to. - -When the entire frame has been rendered, the buffers need to be swapped with one -another, so the back buffer becomes the front buffer and vice versa. - -@code -glfwSwapBuffers(window); -@endcode - -The swap interval indicates how many frames to wait until swapping the buffers, -commonly known as _vsync_. By default, the swap interval is zero, meaning -buffer swapping will occur immediately. On fast machines, many of those frames -will never be seen, as the screen is still only updated typically 60-75 times -per second, so this wastes a lot of CPU and GPU cycles. - -Also, because the buffers will be swapped in the middle the screen update, -leading to [screen tearing](https://en.wikipedia.org/wiki/Screen_tearing). - -For these reasons, applications will typically want to set the swap interval to -one. It can be set to higher values, but this is usually not recommended, -because of the input latency it leads to. - -@code -glfwSwapInterval(1); -@endcode - -This function acts on the current context and will fail unless a context is -current. - - -@subsection quick_process_events Processing events - -GLFW needs to communicate regularly with the window system both in order to -receive events and to show that the application hasn't locked up. Event -processing must be done regularly while you have visible windows and is normally -done each frame after buffer swapping. - -There are two methods for processing pending events; polling and waiting. This -example will use event polling, which processes only those events that have -already been received and then returns immediately. - -@code -glfwPollEvents(); -@endcode - -This is the best choice when rendering continually, like most games do. If -instead you only need to update your rendering once you have received new input, -@ref glfwWaitEvents is a better choice. It waits until at least one event has -been received, putting the thread to sleep in the meantime, and then processes -all received events. This saves a great deal of CPU cycles and is useful for, -for example, many kinds of editing tools. - - -@section quick_example Putting it together - -Now that you know how to initialize GLFW, create a window and poll for -keyboard input, it's possible to create a small program. - -This program creates a 640 by 480 windowed mode window and starts a loop that -clears the screen, renders a triangle and processes events until the user either -presses _Escape_ or closes the window. - -@snippet triangle-opengl.c code - -The program above can be found in the -[source package](https://www.glfw.org/download.html) as -`examples/triangle-opengl.c` and is compiled along with all other examples when -you build GLFW. If you built GLFW from the source package then you already have -this as `triangle-opengl.exe` on Windows, `triangle-opengl` on Linux or -`triangle-opengl.app` on macOS. - -This tutorial used only a few of the many functions GLFW provides. There are -guides for each of the areas covered by GLFW. Each guide will introduce all the -functions for that category. - - - @ref intro_guide - - @ref window_guide - - @ref context_guide - - @ref monitor_guide - - @ref input_guide - -You can access reference documentation for any GLFW function by clicking it and -the reference for each function links to related functions and guide sections. - -The tutorial ends here. Once you have written a program that uses GLFW, you -will need to compile and link it. How to do that depends on the development -environment you are using and is best explained by the documentation for that -environment. To learn about the details that are specific to GLFW, see -@ref build_guide. - -*/ diff --git a/3rdparty/glfw/source/docs/spaces.svg b/3rdparty/glfw/source/docs/spaces.svg deleted file mode 100644 index 5b32646..0000000 --- a/3rdparty/glfw/source/docs/spaces.svg +++ /dev/null @@ -1,877 +0,0 @@ - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/3rdparty/glfw/source/docs/vulkan.dox b/3rdparty/glfw/source/docs/vulkan.dox deleted file mode 100644 index 3189103..0000000 --- a/3rdparty/glfw/source/docs/vulkan.dox +++ /dev/null @@ -1,246 +0,0 @@ -/*! - -@page vulkan_guide Vulkan guide - -@tableofcontents - -This guide is intended to fill the gaps between the official [Vulkan -resources](https://www.khronos.org/vulkan/) and the rest of the GLFW -documentation and is not a replacement for either. It assumes some familiarity -with Vulkan concepts like loaders, devices, queues and surfaces and leaves it to -the Vulkan documentation to explain the details of Vulkan functions. - -To develop for Vulkan you should download the [LunarG Vulkan -SDK](https://vulkan.lunarg.com/) for your platform. Apart from headers and link -libraries, they also provide the validation layers necessary for development. - -The [Vulkan Tutorial](https://vulkan-tutorial.com/) has more information on how -to use GLFW and Vulkan. The [Khronos Vulkan -Samples](https://github.com/KhronosGroup/Vulkan-Samples) also use GLFW, although -with a small framework in between. - -For details on a specific Vulkan support function, see the @ref vulkan. There -are also guides for the other areas of the GLFW API. - - - @ref intro_guide - - @ref window_guide - - @ref context_guide - - @ref monitor_guide - - @ref input_guide - - -@section vulkan_loader Finding the Vulkan loader - -GLFW itself does not ever need to be linked against the Vulkan loader. - -By default, GLFW will load the Vulkan loader dynamically at runtime via its standard name: -`vulkan-1.dll` on Windows, `libvulkan.so.1` on Linux and other Unix-like systems and -`libvulkan.1.dylib` on macOS. - -@macos GLFW will also look up and search the executable subdirectory of your application -bundle. - -If your code is using a Vulkan loader with a different name or in a non-standard location -you will need to direct GLFW to it. Pass your version of `vkGetInstanceProcAddr` to @ref -glfwInitVulkanLoader before initializing GLFW and it will use that function for all Vulkan -entry point retrieval. This prevents GLFW from dynamically loading the Vulkan loader. - -@code -glfwInitVulkanLoader(vkGetInstanceProcAddr); -@endcode - -@macos To make your application be redistributable you will need to set up the application -bundle according to the LunarG SDK documentation. This is explained in more detail in the -[SDK documentation for macOS](https://vulkan.lunarg.com/doc/sdk/latest/mac/getting_started.html). - - -@section vulkan_include Including the Vulkan header file - -To have GLFW include the Vulkan header, define @ref GLFW_INCLUDE_VULKAN before including -the GLFW header. - -@code -#define GLFW_INCLUDE_VULKAN -#include -@endcode - -If you instead want to include the Vulkan header from a custom location or use -your own custom Vulkan header then do this before the GLFW header. - -@code -#include -#include -@endcode - -Unless a Vulkan header is included, either by the GLFW header or above it, the following -GLFW functions will not be declared, as depend on Vulkan types. - - - @ref glfwInitVulkanLoader - - @ref glfwGetInstanceProcAddress - - @ref glfwGetPhysicalDevicePresentationSupport - - @ref glfwCreateWindowSurface - -The `VK_USE_PLATFORM_*_KHR` macros do not need to be defined for the Vulkan part -of GLFW to work. Define them only if you are using these extensions directly. - - -@section vulkan_support Querying for Vulkan support - -If you are linking directly against the Vulkan loader then you can skip this -section. The canonical desktop loader library exports all Vulkan core and -Khronos extension functions, allowing them to be called directly. - -If you are loading the Vulkan loader dynamically instead of linking directly -against it, you can check for the availability of a loader and ICD with @ref -glfwVulkanSupported. - -@code -if (glfwVulkanSupported()) -{ - // Vulkan is available, at least for compute -} -@endcode - -This function returns `GLFW_TRUE` if the Vulkan loader and any minimally -functional ICD was found. - -If one or both were not found, calling any other Vulkan related GLFW function -will generate a @ref GLFW_API_UNAVAILABLE error. - - -@subsection vulkan_proc Querying Vulkan function pointers - -To load any Vulkan core or extension function from the found loader, call @ref -glfwGetInstanceProcAddress. To load functions needed for instance creation, -pass `NULL` as the instance. - -@code -PFN_vkCreateInstance pfnCreateInstance = (PFN_vkCreateInstance) - glfwGetInstanceProcAddress(NULL, "vkCreateInstance"); -@endcode - -Once you have created an instance, you can load from it all other Vulkan core -functions and functions from any instance extensions you enabled. - -@code -PFN_vkCreateDevice pfnCreateDevice = (PFN_vkCreateDevice) - glfwGetInstanceProcAddress(instance, "vkCreateDevice"); -@endcode - -This function in turn calls `vkGetInstanceProcAddr`. If that fails, the -function falls back to a platform-specific query of the Vulkan loader (i.e. -`dlsym` or `GetProcAddress`). If that also fails, the function returns `NULL`. -For more information about `vkGetInstanceProcAddr`, see the Vulkan -documentation. - -Vulkan also provides `vkGetDeviceProcAddr` for loading device-specific versions -of Vulkan function. This function can be retrieved from an instance with @ref -glfwGetInstanceProcAddress. - -@code -PFN_vkGetDeviceProcAddr pfnGetDeviceProcAddr = (PFN_vkGetDeviceProcAddr) - glfwGetInstanceProcAddress(instance, "vkGetDeviceProcAddr"); -@endcode - -Device-specific functions may execute a little bit faster, due to not having to -dispatch internally based on the device passed to them. For more information -about `vkGetDeviceProcAddr`, see the Vulkan documentation. - - -@section vulkan_ext Querying required Vulkan extensions - -To do anything useful with Vulkan you need to create an instance. If you want -to use Vulkan to render to a window, you must enable the instance extensions -GLFW requires to create Vulkan surfaces. - -To query the instance extensions required, call @ref -glfwGetRequiredInstanceExtensions. - -@code -uint32_t count; -const char** extensions = glfwGetRequiredInstanceExtensions(&count); -@endcode - -These extensions must all be enabled when creating instances that are going to -be passed to @ref glfwGetPhysicalDevicePresentationSupport and @ref -glfwCreateWindowSurface. The set of extensions will vary depending on platform -and may also vary depending on graphics drivers and other factors. - -If it fails it will return `NULL` and GLFW will not be able to create Vulkan -window surfaces. You can still use Vulkan for off-screen rendering and compute -work. - -If successful the returned array will always include `VK_KHR_surface`, so if -you don't require any additional extensions you can pass this list directly to -the `VkInstanceCreateInfo` struct. - -@code -VkInstanceCreateInfo ici; - -memset(&ici, 0, sizeof(ici)); -ici.enabledExtensionCount = count; -ici.ppEnabledExtensionNames = extensions; -... -@endcode - -Additional extensions may be required by future versions of GLFW. You should -check whether any extensions you wish to enable are already in the returned -array, as it is an error to specify an extension more than once in the -`VkInstanceCreateInfo` struct. - - -@section vulkan_present Querying for Vulkan presentation support - -Not every queue family of every Vulkan device can present images to surfaces. -To check whether a specific queue family of a physical device supports image -presentation without first having to create a window and surface, call @ref -glfwGetPhysicalDevicePresentationSupport. - -@code -if (glfwGetPhysicalDevicePresentationSupport(instance, physical_device, queue_family_index)) -{ - // Queue family supports image presentation -} -@endcode - -The `VK_KHR_surface` extension additionally provides the -`vkGetPhysicalDeviceSurfaceSupportKHR` function, which performs the same test on -an existing Vulkan surface. - - -@section vulkan_window Creating the window - -Unless you will be using OpenGL or OpenGL ES with the same window as Vulkan, -there is no need to create a context. You can disable context creation with the -[GLFW_CLIENT_API](@ref GLFW_CLIENT_API_hint) hint. - -@code -glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); -GLFWwindow* window = glfwCreateWindow(640, 480, "Window Title", NULL, NULL); -@endcode - -See @ref context_less for more information. - - -@section vulkan_surface Creating a Vulkan window surface - -You can create a Vulkan surface (as defined by the `VK_KHR_surface` extension) -for a GLFW window with @ref glfwCreateWindowSurface. - -@code -VkSurfaceKHR surface; -VkResult err = glfwCreateWindowSurface(instance, window, NULL, &surface); -if (err) -{ - // Window surface creation failed -} -@endcode - -If an OpenGL or OpenGL ES context was created on the window, the context has -ownership of the presentation on the window and a Vulkan surface cannot be -created. - -It is your responsibility to destroy the surface. GLFW does not destroy it for -you. Call `vkDestroySurfaceKHR` function from the same extension to destroy it. - -*/ diff --git a/3rdparty/glfw/source/docs/window.dox b/3rdparty/glfw/source/docs/window.dox deleted file mode 100644 index 32271e3..0000000 --- a/3rdparty/glfw/source/docs/window.dox +++ /dev/null @@ -1,1457 +0,0 @@ -/*! - -@page window_guide Window guide - -@tableofcontents - -This guide introduces the window related functions of GLFW. For details on -a specific function in this category, see the @ref window. There are also -guides for the other areas of GLFW. - - - @ref intro_guide - - @ref context_guide - - @ref vulkan_guide - - @ref monitor_guide - - @ref input_guide - - -@section window_object Window objects - -The @ref GLFWwindow object encapsulates both a window and a context. They are -created with @ref glfwCreateWindow and destroyed with @ref glfwDestroyWindow, or -@ref glfwTerminate, if any remain. As the window and context are inseparably -linked, the object pointer is used as both a context and window handle. - -To see the event stream provided to the various window related callbacks, run -the `events` test program. - - -@subsection window_creation Window creation - -A window and its OpenGL or OpenGL ES context are created with @ref -glfwCreateWindow, which returns a handle to the created window object. For -example, this creates a 640 by 480 windowed mode window: - -@code -GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", NULL, NULL); -@endcode - -If window creation fails, `NULL` will be returned, so it is necessary to check -the return value. - -The window handle is passed to all window related functions and is provided to -along with all input events, so event handlers can tell which window received -the event. - - -@subsubsection window_full_screen Full screen windows - -To create a full screen window, you need to specify which monitor the window -should use. In most cases, the user's primary monitor is a good choice. -For more information about retrieving monitors, see @ref monitor_monitors. - -@code -GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", glfwGetPrimaryMonitor(), NULL); -@endcode - -Full screen windows cover the entire display area of a monitor, have no border -or decorations. - -Windowed mode windows can be made full screen by setting a monitor with @ref -glfwSetWindowMonitor, and full screen ones can be made windowed by unsetting it -with the same function. - -Each field of the @ref GLFWvidmode structure corresponds to a function parameter -or window hint and combine to form the _desired video mode_ for that window. -The supported video mode most closely matching the desired video mode will be -set for the chosen monitor as long as the window has input focus. For more -information about retrieving video modes, see @ref monitor_modes. - -Video mode field | Corresponds to ----------------- | -------------- -GLFWvidmode.width | `width` parameter of @ref glfwCreateWindow -GLFWvidmode.height | `height` parameter of @ref glfwCreateWindow -GLFWvidmode.redBits | @ref GLFW_RED_BITS hint -GLFWvidmode.greenBits | @ref GLFW_GREEN_BITS hint -GLFWvidmode.blueBits | @ref GLFW_BLUE_BITS hint -GLFWvidmode.refreshRate | @ref GLFW_REFRESH_RATE hint - -Once you have a full screen window, you can change its resolution, refresh rate -and monitor with @ref glfwSetWindowMonitor. If you only need change its -resolution you can also call @ref glfwSetWindowSize. In all cases, the new -video mode will be selected the same way as the video mode chosen by @ref -glfwCreateWindow. If the window has an OpenGL or OpenGL ES context, it will be -unaffected. - -By default, the original video mode of the monitor will be restored and the -window iconified if it loses input focus, to allow the user to switch back to -the desktop. This behavior can be disabled with the -[GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_hint) window hint, for example if you -wish to simultaneously cover multiple monitors with full screen windows. - -If a monitor is disconnected, all windows that are full screen on that monitor -will be switched to windowed mode. See @ref monitor_event for more information. - - -@subsubsection window_windowed_full_screen "Windowed full screen" windows - -If the closest match for the desired video mode is the current one, the video -mode will not be changed, making window creation faster and application -switching much smoother. This is sometimes called _windowed full screen_ or -_borderless full screen_ window and counts as a full screen window. To create -such a window, request the current video mode. - -@code -const GLFWvidmode* mode = glfwGetVideoMode(monitor); - -glfwWindowHint(GLFW_RED_BITS, mode->redBits); -glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits); -glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits); -glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate); - -GLFWwindow* window = glfwCreateWindow(mode->width, mode->height, "My Title", monitor, NULL); -@endcode - -This also works for windowed mode windows that are made full screen. - -@code -const GLFWvidmode* mode = glfwGetVideoMode(monitor); - -glfwSetWindowMonitor(window, monitor, 0, 0, mode->width, mode->height, mode->refreshRate); -@endcode - -Note that @ref glfwGetVideoMode returns the _current_ video mode of a monitor, -so if you already have a full screen window on that monitor that you want to -make windowed full screen, you need to have saved the desktop resolution before. - - -@subsection window_destruction Window destruction - -When a window is no longer needed, destroy it with @ref glfwDestroyWindow. - -@code -glfwDestroyWindow(window); -@endcode - -Window destruction always succeeds. Before the actual destruction, all -callbacks are removed so no further events will be delivered for the window. -All windows remaining when @ref glfwTerminate is called are destroyed as well. - -When a full screen window is destroyed, the original video mode of its monitor -is restored, but the gamma ramp is left untouched. - - -@subsection window_hints Window creation hints - -There are a number of hints that can be set before the creation of a window and -context. Some affect the window itself, others affect the framebuffer or -context. These hints are set to their default values each time the library is -initialized with @ref glfwInit. Integer value hints can be set individually -with @ref glfwWindowHint and string value hints with @ref glfwWindowHintString. -You can reset all at once to their defaults with @ref glfwDefaultWindowHints. - -Some hints are platform specific. These are always valid to set on any -platform but they will only affect their specific platform. Other platforms -will ignore them. Setting these hints requires no platform specific headers or -calls. - -@note Window hints need to be set before the creation of the window and context -you wish to have the specified attributes. They function as additional -arguments to @ref glfwCreateWindow. - - -@subsubsection window_hints_hard Hard and soft constraints - -Some window hints are hard constraints. These must match the available -capabilities _exactly_ for window and context creation to succeed. Hints -that are not hard constraints are matched as closely as possible, but the -resulting context and framebuffer may differ from what these hints requested. - -The following hints are always hard constraints: -- @ref GLFW_STEREO -- @ref GLFW_DOUBLEBUFFER -- [GLFW_CLIENT_API](@ref GLFW_CLIENT_API_hint) -- [GLFW_CONTEXT_CREATION_API](@ref GLFW_CONTEXT_CREATION_API_hint) - -The following additional hints are hard constraints when requesting an OpenGL -context, but are ignored when requesting an OpenGL ES context: -- [GLFW_OPENGL_FORWARD_COMPAT](@ref GLFW_OPENGL_FORWARD_COMPAT_hint) -- [GLFW_OPENGL_PROFILE](@ref GLFW_OPENGL_PROFILE_hint) - - -@subsubsection window_hints_wnd Window related hints - -@anchor GLFW_RESIZABLE_hint -__GLFW_RESIZABLE__ specifies whether the windowed mode window will be resizable -_by the user_. The window will still be resizable using the @ref -glfwSetWindowSize function. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. -This hint is ignored for full screen and undecorated windows. - -@anchor GLFW_VISIBLE_hint -__GLFW_VISIBLE__ specifies whether the windowed mode window will be initially -visible. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. This hint is -ignored for full screen windows. - -@anchor GLFW_DECORATED_hint -__GLFW_DECORATED__ specifies whether the windowed mode window will have window -decorations such as a border, a close widget, etc. An undecorated window will -not be resizable by the user but will still allow the user to generate close -events on some platforms. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. -This hint is ignored for full screen windows. - -@anchor GLFW_FOCUSED_hint -__GLFW_FOCUSED__ specifies whether the windowed mode window will be given input -focus when created. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. This -hint is ignored for full screen and initially hidden windows. - -@anchor GLFW_AUTO_ICONIFY_hint -__GLFW_AUTO_ICONIFY__ specifies whether the full screen window will -automatically iconify and restore the previous video mode on input focus loss. -Possible values are `GLFW_TRUE` and `GLFW_FALSE`. This hint is ignored for -windowed mode windows. - -@anchor GLFW_FLOATING_hint -__GLFW_FLOATING__ specifies whether the windowed mode window will be floating -above other regular windows, also called topmost or always-on-top. This is -intended primarily for debugging purposes and cannot be used to implement proper -full screen windows. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. This -hint is ignored for full screen windows. - -@anchor GLFW_MAXIMIZED_hint -__GLFW_MAXIMIZED__ specifies whether the windowed mode window will be maximized -when created. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. This hint is -ignored for full screen windows. - -@anchor GLFW_CENTER_CURSOR_hint -__GLFW_CENTER_CURSOR__ specifies whether the cursor should be centered over -newly created full screen windows. Possible values are `GLFW_TRUE` and -`GLFW_FALSE`. This hint is ignored for windowed mode windows. - -@anchor GLFW_TRANSPARENT_FRAMEBUFFER_hint -__GLFW_TRANSPARENT_FRAMEBUFFER__ specifies whether the window framebuffer will -be transparent. If enabled and supported by the system, the window framebuffer -alpha channel will be used to combine the framebuffer with the background. This -does not affect window decorations. Possible values are `GLFW_TRUE` and -`GLFW_FALSE`. - -@anchor GLFW_FOCUS_ON_SHOW_hint -__GLFW_FOCUS_ON_SHOW__ specifies whether the window will be given input -focus when @ref glfwShowWindow is called. Possible values are `GLFW_TRUE` and -`GLFW_FALSE`. - -@anchor GLFW_SCALE_TO_MONITOR -__GLFW_SCALE_TO_MONITOR__ specified whether the window content area should be -resized based on the [monitor content scale](@ref monitor_scale) of any monitor -it is placed on. This includes the initial placement when the window is -created. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. - -This hint only has an effect on platforms where screen coordinates and pixels -always map 1:1 such as Windows and X11. On platforms like macOS the resolution -of the framebuffer is changed independently of the window size. - -@anchor GLFW_MOUSE_PASSTHROUGH_hint -__GLFW_MOUSE_PASSTHROUGH__ specifies whether the window is transparent to mouse -input, letting any mouse events pass through to whatever window is behind it. -This is only supported for undecorated windows. Decorated windows with this -enabled will behave differently between platforms. Possible values are -`GLFW_TRUE` and `GLFW_FALSE`. - - -@subsubsection window_hints_fb Framebuffer related hints - -@anchor GLFW_RED_BITS -@anchor GLFW_GREEN_BITS -@anchor GLFW_BLUE_BITS -@anchor GLFW_ALPHA_BITS -@anchor GLFW_DEPTH_BITS -@anchor GLFW_STENCIL_BITS -__GLFW_RED_BITS__, __GLFW_GREEN_BITS__, __GLFW_BLUE_BITS__, __GLFW_ALPHA_BITS__, -__GLFW_DEPTH_BITS__ and __GLFW_STENCIL_BITS__ specify the desired bit depths of -the various components of the default framebuffer. A value of `GLFW_DONT_CARE` -means the application has no preference. - -@anchor GLFW_ACCUM_RED_BITS -@anchor GLFW_ACCUM_GREEN_BITS -@anchor GLFW_ACCUM_BLUE_BITS -@anchor GLFW_ACCUM_ALPHA_BITS -__GLFW_ACCUM_RED_BITS__, __GLFW_ACCUM_GREEN_BITS__, __GLFW_ACCUM_BLUE_BITS__ and -__GLFW_ACCUM_ALPHA_BITS__ specify the desired bit depths of the various -components of the accumulation buffer. A value of `GLFW_DONT_CARE` means the -application has no preference. - -Accumulation buffers are a legacy OpenGL feature and should not be used in new -code. - -@anchor GLFW_AUX_BUFFERS -__GLFW_AUX_BUFFERS__ specifies the desired number of auxiliary buffers. A value -of `GLFW_DONT_CARE` means the application has no preference. - -Auxiliary buffers are a legacy OpenGL feature and should not be used in new -code. - -@anchor GLFW_STEREO -__GLFW_STEREO__ specifies whether to use OpenGL stereoscopic rendering. -Possible values are `GLFW_TRUE` and `GLFW_FALSE`. This is a hard constraint. - -@anchor GLFW_SAMPLES -__GLFW_SAMPLES__ specifies the desired number of samples to use for -multisampling. Zero disables multisampling. A value of `GLFW_DONT_CARE` means -the application has no preference. - -@anchor GLFW_SRGB_CAPABLE -__GLFW_SRGB_CAPABLE__ specifies whether the framebuffer should be sRGB capable. -Possible values are `GLFW_TRUE` and `GLFW_FALSE`. - -@note __OpenGL:__ If enabled and supported by the system, the -`GL_FRAMEBUFFER_SRGB` enable will control sRGB rendering. By default, sRGB -rendering will be disabled. - -@note __OpenGL ES:__ If enabled and supported by the system, the context will -always have sRGB rendering enabled. - -@anchor GLFW_DOUBLEBUFFER -@anchor GLFW_DOUBLEBUFFER_hint -__GLFW_DOUBLEBUFFER__ specifies whether the framebuffer should be double -buffered. You nearly always want to use double buffering. This is a hard -constraint. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. - - -@subsubsection window_hints_mtr Monitor related hints - -@anchor GLFW_REFRESH_RATE -__GLFW_REFRESH_RATE__ specifies the desired refresh rate for full screen -windows. A value of `GLFW_DONT_CARE` means the highest available refresh rate -will be used. This hint is ignored for windowed mode windows. - - -@subsubsection window_hints_ctx Context related hints - -@anchor GLFW_CLIENT_API_hint -__GLFW_CLIENT_API__ specifies which client API to create the context for. -Possible values are `GLFW_OPENGL_API`, `GLFW_OPENGL_ES_API` and `GLFW_NO_API`. -This is a hard constraint. - -@anchor GLFW_CONTEXT_CREATION_API_hint -__GLFW_CONTEXT_CREATION_API__ specifies which context creation API to use to -create the context. Possible values are `GLFW_NATIVE_CONTEXT_API`, -`GLFW_EGL_CONTEXT_API` and `GLFW_OSMESA_CONTEXT_API`. This is a hard -constraint. If no client API is requested, this hint is ignored. - -An [extension loader library](@ref context_glext_auto) that assumes it knows -which API was used to create the current context may fail if you change this -hint. This can be resolved by having it load functions via @ref -glfwGetProcAddress. - -@note @wayland The EGL API _is_ the native context creation API, so this hint -will have no effect. - -@note @x11 On some Linux systems, creating contexts via both the native and EGL -APIs in a single process will cause the application to segfault. Stick to one -API or the other on Linux for now. - -@note __OSMesa:__ As its name implies, an OpenGL context created with OSMesa -does not update the window contents when its buffers are swapped. Use OpenGL -functions or the OSMesa native access functions @ref glfwGetOSMesaColorBuffer -and @ref glfwGetOSMesaDepthBuffer to retrieve the framebuffer contents. - -@anchor GLFW_CONTEXT_VERSION_MAJOR_hint -@anchor GLFW_CONTEXT_VERSION_MINOR_hint -__GLFW_CONTEXT_VERSION_MAJOR__ and __GLFW_CONTEXT_VERSION_MINOR__ specify the -client API version that the created context must be compatible with. The exact -behavior of these hints depend on the requested client API. - -While there is no way to ask the driver for a context of the highest supported -version, GLFW will attempt to provide this when you ask for a version 1.0 -context, which is the default for these hints. - -Do not confuse these hints with @ref GLFW_VERSION_MAJOR and @ref -GLFW_VERSION_MINOR, which provide the API version of the GLFW header. - -@note __OpenGL:__ These hints are not hard constraints, but creation will fail -if the OpenGL version of the created context is less than the one requested. It -is therefore perfectly safe to use the default of version 1.0 for legacy code -and you will still get backwards-compatible contexts of version 3.0 and above -when available. - -@note __OpenGL ES:__ These hints are not hard constraints, but creation will -fail if the OpenGL ES version of the created context is less than the one -requested. Additionally, OpenGL ES 1.x cannot be returned if 2.0 or later was -requested, and vice versa. This is because OpenGL ES 3.x is backward compatible -with 2.0, but OpenGL ES 2.0 is not backward compatible with 1.x. - -@note @macos The OS only supports core profile contexts for OpenGL versions 3.2 -and later. Before creating an OpenGL context of version 3.2 or later you must -set the [GLFW_OPENGL_PROFILE](@ref GLFW_OPENGL_PROFILE_hint) hint accordingly. -OpenGL 3.0 and 3.1 contexts are not supported at all on macOS. - -@anchor GLFW_OPENGL_FORWARD_COMPAT_hint -__GLFW_OPENGL_FORWARD_COMPAT__ specifies whether the OpenGL context should be -forward-compatible, i.e. one where all functionality deprecated in the requested -version of OpenGL is removed. This must only be used if the requested OpenGL -version is 3.0 or above. If OpenGL ES is requested, this hint is ignored. - -Forward-compatibility is described in detail in the -[OpenGL Reference Manual](https://www.opengl.org/registry/). - -@anchor GLFW_CONTEXT_DEBUG_hint -@anchor GLFW_OPENGL_DEBUG_CONTEXT_hint -__GLFW_CONTEXT_DEBUG__ specifies whether the context should be created in debug -mode, which may provide additional error and diagnostic reporting functionality. -Possible values are `GLFW_TRUE` and `GLFW_FALSE`. - -Debug contexts for OpenGL and OpenGL ES are described in detail by the -[GL_KHR_debug](https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_debug.txt) -extension. - -@note `GLFW_CONTEXT_DEBUG` is the new name introduced in GLFW 3.4. The older -`GLFW_OPENGL_DEBUG_CONTEXT` name is also available for compatibility. - -@anchor GLFW_OPENGL_PROFILE_hint -__GLFW_OPENGL_PROFILE__ specifies which OpenGL profile to create the context -for. Possible values are one of `GLFW_OPENGL_CORE_PROFILE` or -`GLFW_OPENGL_COMPAT_PROFILE`, or `GLFW_OPENGL_ANY_PROFILE` to not request -a specific profile. If requesting an OpenGL version below 3.2, -`GLFW_OPENGL_ANY_PROFILE` must be used. If OpenGL ES is requested, this hint -is ignored. - -OpenGL profiles are described in detail in the -[OpenGL Reference Manual](https://www.opengl.org/registry/). - -@anchor GLFW_CONTEXT_ROBUSTNESS_hint -__GLFW_CONTEXT_ROBUSTNESS__ specifies the robustness strategy to be used by the -context. This can be one of `GLFW_NO_RESET_NOTIFICATION` or -`GLFW_LOSE_CONTEXT_ON_RESET`, or `GLFW_NO_ROBUSTNESS` to not request -a robustness strategy. - -@anchor GLFW_CONTEXT_RELEASE_BEHAVIOR_hint -__GLFW_CONTEXT_RELEASE_BEHAVIOR__ specifies the release behavior to be -used by the context. Possible values are one of `GLFW_ANY_RELEASE_BEHAVIOR`, -`GLFW_RELEASE_BEHAVIOR_FLUSH` or `GLFW_RELEASE_BEHAVIOR_NONE`. If the -behavior is `GLFW_ANY_RELEASE_BEHAVIOR`, the default behavior of the context -creation API will be used. If the behavior is `GLFW_RELEASE_BEHAVIOR_FLUSH`, -the pipeline will be flushed whenever the context is released from being the -current one. If the behavior is `GLFW_RELEASE_BEHAVIOR_NONE`, the pipeline will -not be flushed on release. - -Context release behaviors are described in detail by the -[GL_KHR_context_flush_control](https://www.opengl.org/registry/specs/KHR/context_flush_control.txt) -extension. - -@anchor GLFW_CONTEXT_NO_ERROR_hint -__GLFW_CONTEXT_NO_ERROR__ specifies whether errors should be generated by the -context. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. If enabled, -situations that would have generated errors instead cause undefined behavior. - -The no error mode for OpenGL and OpenGL ES is described in detail by the -[GL_KHR_no_error](https://www.opengl.org/registry/specs/KHR/no_error.txt) -extension. - - -@subsubsection window_hints_win32 Win32 specific hints - -@anchor GLFW_WIN32_KEYBOARD_MENU_hint -__GLFW_WIN32_KEYBOARD_MENU__ specifies whether to allow access to the window -menu via the Alt+Space and Alt-and-then-Space keyboard shortcuts. This is -ignored on other platforms. - - -@subsubsection window_hints_osx macOS specific hints - -@anchor GLFW_COCOA_RETINA_FRAMEBUFFER_hint -__GLFW_COCOA_RETINA_FRAMEBUFFER__ specifies whether to use full resolution -framebuffers on Retina displays. Possible values are `GLFW_TRUE` and -`GLFW_FALSE`. This is ignored on other platforms. - -@anchor GLFW_COCOA_FRAME_NAME_hint -__GLFW_COCOA_FRAME_NAME__ specifies the UTF-8 encoded name to use for autosaving -the window frame, or if empty disables frame autosaving for the window. This is -ignored on other platforms. This is set with @ref glfwWindowHintString. - -@anchor GLFW_COCOA_GRAPHICS_SWITCHING_hint -__GLFW_COCOA_GRAPHICS_SWITCHING__ specifies whether to in Automatic Graphics -Switching, i.e. to allow the system to choose the integrated GPU for the OpenGL -context and move it between GPUs if necessary or whether to force it to always -run on the discrete GPU. This only affects systems with both integrated and -discrete GPUs. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. This is -ignored on other platforms. - -Simpler programs and tools may want to enable this to save power, while games -and other applications performing advanced rendering will want to leave it -disabled. - -A bundled application that wishes to participate in Automatic Graphics Switching -should also declare this in its `Info.plist` by setting the -`NSSupportsAutomaticGraphicsSwitching` key to `true`. - - -@subsubsection window_hints_x11 X11 specific window hints - -@anchor GLFW_X11_CLASS_NAME_hint -@anchor GLFW_X11_INSTANCE_NAME_hint -__GLFW_X11_CLASS_NAME__ and __GLFW_X11_INSTANCE_NAME__ specifies the desired -ASCII encoded class and instance parts of the ICCCM `WM_CLASS` window property. -These are set with @ref glfwWindowHintString. - - -@subsubsection window_hints_values Supported and default values - -Window hint | Default value | Supported values ------------------------------ | --------------------------- | ---------------- -GLFW_RESIZABLE | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE` -GLFW_VISIBLE | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE` -GLFW_DECORATED | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE` -GLFW_FOCUSED | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE` -GLFW_AUTO_ICONIFY | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE` -GLFW_FLOATING | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE` -GLFW_MAXIMIZED | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE` -GLFW_CENTER_CURSOR | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE` -GLFW_TRANSPARENT_FRAMEBUFFER | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE` -GLFW_FOCUS_ON_SHOW | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE` -GLFW_SCALE_TO_MONITOR | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE` -GLFW_MOUSE_PASSTHROUGH | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE` -GLFW_RED_BITS | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -GLFW_GREEN_BITS | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -GLFW_BLUE_BITS | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -GLFW_ALPHA_BITS | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -GLFW_DEPTH_BITS | 24 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -GLFW_STENCIL_BITS | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -GLFW_ACCUM_RED_BITS | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -GLFW_ACCUM_GREEN_BITS | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -GLFW_ACCUM_BLUE_BITS | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -GLFW_ACCUM_ALPHA_BITS | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -GLFW_AUX_BUFFERS | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -GLFW_SAMPLES | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE` -GLFW_REFRESH_RATE | `GLFW_DONT_CARE` | 0 to `INT_MAX` or `GLFW_DONT_CARE` -GLFW_STEREO | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE` -GLFW_SRGB_CAPABLE | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE` -GLFW_DOUBLEBUFFER | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE` -GLFW_CLIENT_API | `GLFW_OPENGL_API` | `GLFW_OPENGL_API`, `GLFW_OPENGL_ES_API` or `GLFW_NO_API` -GLFW_CONTEXT_CREATION_API | `GLFW_NATIVE_CONTEXT_API` | `GLFW_NATIVE_CONTEXT_API`, `GLFW_EGL_CONTEXT_API` or `GLFW_OSMESA_CONTEXT_API` -GLFW_CONTEXT_VERSION_MAJOR | 1 | Any valid major version number of the chosen client API -GLFW_CONTEXT_VERSION_MINOR | 0 | Any valid minor version number of the chosen client API -GLFW_CONTEXT_ROBUSTNESS | `GLFW_NO_ROBUSTNESS` | `GLFW_NO_ROBUSTNESS`, `GLFW_NO_RESET_NOTIFICATION` or `GLFW_LOSE_CONTEXT_ON_RESET` -GLFW_CONTEXT_RELEASE_BEHAVIOR | `GLFW_ANY_RELEASE_BEHAVIOR` | `GLFW_ANY_RELEASE_BEHAVIOR`, `GLFW_RELEASE_BEHAVIOR_FLUSH` or `GLFW_RELEASE_BEHAVIOR_NONE` -GLFW_OPENGL_FORWARD_COMPAT | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE` -GLFW_CONTEXT_DEBUG | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE` -GLFW_OPENGL_PROFILE | `GLFW_OPENGL_ANY_PROFILE` | `GLFW_OPENGL_ANY_PROFILE`, `GLFW_OPENGL_COMPAT_PROFILE` or `GLFW_OPENGL_CORE_PROFILE` -GLFW_WIN32_KEYBOARD_MENU | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE` -GLFW_COCOA_RETINA_FRAMEBUFFER | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE` -GLFW_COCOA_FRAME_NAME | `""` | A UTF-8 encoded frame autosave name -GLFW_COCOA_GRAPHICS_SWITCHING | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE` -GLFW_X11_CLASS_NAME | `""` | An ASCII encoded `WM_CLASS` class name -GLFW_X11_INSTANCE_NAME | `""` | An ASCII encoded `WM_CLASS` instance name - - -@section window_events Window event processing - -See @ref events. - - -@section window_properties Window properties and events - -@subsection window_userptr User pointer - -Each window has a user pointer that can be set with @ref -glfwSetWindowUserPointer and queried with @ref glfwGetWindowUserPointer. This -can be used for any purpose you need and will not be modified by GLFW throughout -the life-time of the window. - -The initial value of the pointer is `NULL`. - - -@subsection window_close Window closing and close flag - -When the user attempts to close the window, for example by clicking the close -widget or using a key chord like Alt+F4, the _close flag_ of the window is set. -The window is however not actually destroyed and, unless you watch for this -state change, nothing further happens. - -The current state of the close flag is returned by @ref glfwWindowShouldClose -and can be set or cleared directly with @ref glfwSetWindowShouldClose. A common -pattern is to use the close flag as a main loop condition. - -@code -while (!glfwWindowShouldClose(window)) -{ - render(window); - - glfwSwapBuffers(window); - glfwPollEvents(); -} -@endcode - -If you wish to be notified when the user attempts to close a window, set a close -callback. - -@code -glfwSetWindowCloseCallback(window, window_close_callback); -@endcode - -The callback function is called directly _after_ the close flag has been set. -It can be used for example to filter close requests and clear the close flag -again unless certain conditions are met. - -@code -void window_close_callback(GLFWwindow* window) -{ - if (!time_to_close) - glfwSetWindowShouldClose(window, GLFW_FALSE); -} -@endcode - - -@subsection window_size Window size - -The size of a window can be changed with @ref glfwSetWindowSize. For windowed -mode windows, this sets the size, in -[screen coordinates](@ref coordinate_systems) of the _content area_ or _content -area_ of the window. The window system may impose limits on window size. - -@code -glfwSetWindowSize(window, 640, 480); -@endcode - -For full screen windows, the specified size becomes the new resolution of the -window's desired video mode. The video mode most closely matching the new -desired video mode is set immediately. The window is resized to fit the -resolution of the set video mode. - -If you wish to be notified when a window is resized, whether by the user, the -system or your own code, set a size callback. - -@code -glfwSetWindowSizeCallback(window, window_size_callback); -@endcode - -The callback function receives the new size, in screen coordinates, of the -content area of the window when the window is resized. - -@code -void window_size_callback(GLFWwindow* window, int width, int height) -{ -} -@endcode - -There is also @ref glfwGetWindowSize for directly retrieving the current size of -a window. - -@code -int width, height; -glfwGetWindowSize(window, &width, &height); -@endcode - -@note Do not pass the window size to `glViewport` or other pixel-based OpenGL -calls. The window size is in screen coordinates, not pixels. Use the -[framebuffer size](@ref window_fbsize), which is in pixels, for pixel-based -calls. - -The above functions work with the size of the content area, but decorated -windows typically have title bars and window frames around this rectangle. You -can retrieve the extents of these with @ref glfwGetWindowFrameSize. - -@code -int left, top, right, bottom; -glfwGetWindowFrameSize(window, &left, &top, &right, &bottom); -@endcode - -The returned values are the distances, in screen coordinates, from the edges of -the content area to the corresponding edges of the full window. As they are -distances and not coordinates, they are always zero or positive. - - -@subsection window_fbsize Framebuffer size - -While the size of a window is measured in screen coordinates, OpenGL works with -pixels. The size you pass into `glViewport`, for example, should be in pixels. -On some machines screen coordinates and pixels are the same, but on others they -will not be. There is a second set of functions to retrieve the size, in -pixels, of the framebuffer of a window. - -If you wish to be notified when the framebuffer of a window is resized, whether -by the user or the system, set a size callback. - -@code -glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); -@endcode - -The callback function receives the new size of the framebuffer when it is -resized, which can for example be used to update the OpenGL viewport. - -@code -void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - glViewport(0, 0, width, height); -} -@endcode - -There is also @ref glfwGetFramebufferSize for directly retrieving the current -size of the framebuffer of a window. - -@code -int width, height; -glfwGetFramebufferSize(window, &width, &height); -glViewport(0, 0, width, height); -@endcode - -The size of a framebuffer may change independently of the size of a window, for -example if the window is dragged between a regular monitor and a high-DPI one. - - -@subsection window_scale Window content scale - -The content scale for a window can be retrieved with @ref -glfwGetWindowContentScale. - -@code -float xscale, yscale; -glfwGetWindowContentScale(window, &xscale, &yscale); -@endcode - -The content scale is the ratio between the current DPI and the platform's -default DPI. This is especially important for text and any UI elements. If the -pixel dimensions of your UI scaled by this look appropriate on your machine then -it should appear at a reasonable size on other machines regardless of their DPI -and scaling settings. This relies on the system DPI and scaling settings being -somewhat correct. - -On systems where each monitors can have its own content scale, the window -content scale will depend on which monitor the system considers the window to be -on. - -If you wish to be notified when the content scale of a window changes, whether -because of a system setting change or because it was moved to a monitor with -a different scale, set a content scale callback. - -@code -glfwSetWindowContentScaleCallback(window, window_content_scale_callback); -@endcode - -The callback function receives the new content scale of the window. - -@code -void window_content_scale_callback(GLFWwindow* window, float xscale, float yscale) -{ - set_interface_scale(xscale, yscale); -} -@endcode - -On platforms where pixels and screen coordinates always map 1:1, the window -will need to be resized to appear the same size when it is moved to a monitor -with a different content scale. To have this done automatically both when the -window is created and when its content scale later changes, set the @ref -GLFW_SCALE_TO_MONITOR window hint. - - -@subsection window_sizelimits Window size limits - -The minimum and maximum size of the content area of a windowed mode window can -be enforced with @ref glfwSetWindowSizeLimits. The user may resize the window -to any size and aspect ratio within the specified limits, unless the aspect -ratio is also set. - -@code -glfwSetWindowSizeLimits(window, 200, 200, 400, 400); -@endcode - -To specify only a minimum size or only a maximum one, set the other pair to -`GLFW_DONT_CARE`. - -@code -glfwSetWindowSizeLimits(window, 640, 480, GLFW_DONT_CARE, GLFW_DONT_CARE); -@endcode - -To disable size limits for a window, set them all to `GLFW_DONT_CARE`. - -The aspect ratio of the content area of a windowed mode window can be enforced -with @ref glfwSetWindowAspectRatio. The user may resize the window freely -unless size limits are also set, but the size will be constrained to maintain -the aspect ratio. - -@code -glfwSetWindowAspectRatio(window, 16, 9); -@endcode - -The aspect ratio is specified as a numerator and denominator, corresponding to -the width and height, respectively. If you want a window to maintain its -current aspect ratio, use its current size as the ratio. - -@code -int width, height; -glfwGetWindowSize(window, &width, &height); -glfwSetWindowAspectRatio(window, width, height); -@endcode - -To disable the aspect ratio limit for a window, set both terms to -`GLFW_DONT_CARE`. - -You can have both size limits and aspect ratio set for a window, but the results -are undefined if they conflict. - - -@subsection window_pos Window position - -The position of a windowed-mode window can be changed with @ref -glfwSetWindowPos. This moves the window so that the upper-left corner of its -content area has the specified [screen coordinates](@ref coordinate_systems). -The window system may put limitations on window placement. - -@code -glfwSetWindowPos(window, 100, 100); -@endcode - -If you wish to be notified when a window is moved, whether by the user, the -system or your own code, set a position callback. - -@code -glfwSetWindowPosCallback(window, window_pos_callback); -@endcode - -The callback function receives the new position, in screen coordinates, of the -upper-left corner of the content area when the window is moved. - -@code -void window_pos_callback(GLFWwindow* window, int xpos, int ypos) -{ -} -@endcode - -There is also @ref glfwGetWindowPos for directly retrieving the current position -of the content area of the window. - -@code -int xpos, ypos; -glfwGetWindowPos(window, &xpos, &ypos); -@endcode - - -@subsection window_title Window title - -All GLFW windows have a title, although undecorated or full screen windows may -not display it or only display it in a task bar or similar interface. You can -set a UTF-8 encoded window title with @ref glfwSetWindowTitle. - -@code -glfwSetWindowTitle(window, "My Window"); -@endcode - -The specified string is copied before the function returns, so there is no need -to keep it around. - -As long as your source file is encoded as UTF-8, you can use any Unicode -characters directly in the source. - -@code -glfwSetWindowTitle(window, "ラストエグザイル"); -@endcode - -If you are using C++11 or C11, you can use a UTF-8 string literal. - -@code -glfwSetWindowTitle(window, u8"This is always a UTF-8 string"); -@endcode - - -@subsection window_icon Window icon - -Decorated windows have icons on some platforms. You can set this icon by -specifying a list of candidate images with @ref glfwSetWindowIcon. - -@code -GLFWimage images[2]; -images[0] = load_icon("my_icon.png"); -images[1] = load_icon("my_icon_small.png"); - -glfwSetWindowIcon(window, 2, images); -@endcode - -The image data is 32-bit, little-endian, non-premultiplied RGBA, i.e. eight bits -per channel with the red channel first. The pixels are arranged canonically as -sequential rows, starting from the top-left corner. - -To revert to the default window icon, pass in an empty image array. - -@code -glfwSetWindowIcon(window, 0, NULL); -@endcode - - -@subsection window_monitor Window monitor - -Full screen windows are associated with a specific monitor. You can get the -handle for this monitor with @ref glfwGetWindowMonitor. - -@code -GLFWmonitor* monitor = glfwGetWindowMonitor(window); -@endcode - -This monitor handle is one of those returned by @ref glfwGetMonitors. - -For windowed mode windows, this function returns `NULL`. This is how to tell -full screen windows from windowed mode windows. - -You can move windows between monitors or between full screen and windowed mode -with @ref glfwSetWindowMonitor. When making a window full screen on the same or -on a different monitor, specify the desired monitor, resolution and refresh -rate. The position arguments are ignored. - -@code -const GLFWvidmode* mode = glfwGetVideoMode(monitor); - -glfwSetWindowMonitor(window, monitor, 0, 0, mode->width, mode->height, mode->refreshRate); -@endcode - -When making the window windowed, specify the desired position and size. The -refresh rate argument is ignored. - -@code -glfwSetWindowMonitor(window, NULL, xpos, ypos, width, height, 0); -@endcode - -This restores any previous window settings such as whether it is decorated, -floating, resizable, has size or aspect ratio limits, etc.. To restore a window -that was originally windowed to its original size and position, save these -before making it full screen and then pass them in as above. - - -@subsection window_iconify Window iconification - -Windows can be iconified (i.e. minimized) with @ref glfwIconifyWindow. - -@code -glfwIconifyWindow(window); -@endcode - -When a full screen window is iconified, the original video mode of its monitor -is restored until the user or application restores the window. - -Iconified windows can be restored with @ref glfwRestoreWindow. This function -also restores windows from maximization. - -@code -glfwRestoreWindow(window); -@endcode - -When a full screen window is restored, the desired video mode is restored to its -monitor as well. - -If you wish to be notified when a window is iconified or restored, whether by -the user, system or your own code, set an iconify callback. - -@code -glfwSetWindowIconifyCallback(window, window_iconify_callback); -@endcode - -The callback function receives changes in the iconification state of the window. - -@code -void window_iconify_callback(GLFWwindow* window, int iconified) -{ - if (iconified) - { - // The window was iconified - } - else - { - // The window was restored - } -} -@endcode - -You can also get the current iconification state with @ref glfwGetWindowAttrib. - -@code -int iconified = glfwGetWindowAttrib(window, GLFW_ICONIFIED); -@endcode - - -@subsection window_maximize Window maximization - -Windows can be maximized (i.e. zoomed) with @ref glfwMaximizeWindow. - -@code -glfwMaximizeWindow(window); -@endcode - -Full screen windows cannot be maximized and passing a full screen window to this -function does nothing. - -Maximized windows can be restored with @ref glfwRestoreWindow. This function -also restores windows from iconification. - -@code -glfwRestoreWindow(window); -@endcode - -If you wish to be notified when a window is maximized or restored, whether by -the user, system or your own code, set a maximize callback. - -@code -glfwSetWindowMaximizeCallback(window, window_maximize_callback); -@endcode - -The callback function receives changes in the maximization state of the window. - -@code -void window_maximize_callback(GLFWwindow* window, int maximized) -{ - if (maximized) - { - // The window was maximized - } - else - { - // The window was restored - } -} -@endcode - -You can also get the current maximization state with @ref glfwGetWindowAttrib. - -@code -int maximized = glfwGetWindowAttrib(window, GLFW_MAXIMIZED); -@endcode - -By default, newly created windows are not maximized. You can change this -behavior by setting the [GLFW_MAXIMIZED](@ref GLFW_MAXIMIZED_hint) window hint -before creating the window. - -@code -glfwWindowHint(GLFW_MAXIMIZED, GLFW_TRUE); -@endcode - - -@subsection window_hide Window visibility - -Windowed mode windows can be hidden with @ref glfwHideWindow. - -@code -glfwHideWindow(window); -@endcode - -This makes the window completely invisible to the user, including removing it -from the task bar, dock or window list. Full screen windows cannot be hidden -and calling @ref glfwHideWindow on a full screen window does nothing. - -Hidden windows can be shown with @ref glfwShowWindow. - -@code -glfwShowWindow(window); -@endcode - -By default, this function will also set the input focus to that window. Set -the [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_hint) window hint to change -this behavior for all newly created windows, or change the behavior for an -existing window with @ref glfwSetWindowAttrib. - -You can also get the current visibility state with @ref glfwGetWindowAttrib. - -@code -int visible = glfwGetWindowAttrib(window, GLFW_VISIBLE); -@endcode - -By default, newly created windows are visible. You can change this behavior by -setting the [GLFW_VISIBLE](@ref GLFW_VISIBLE_hint) window hint before creating -the window. - -@code -glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE); -@endcode - -Windows created hidden are completely invisible to the user until shown. This -can be useful if you need to set up your window further before showing it, for -example moving it to a specific location. - - -@subsection window_focus Window input focus - -Windows can be given input focus and brought to the front with @ref -glfwFocusWindow. - -@code -glfwFocusWindow(window); -@endcode - -Keep in mind that it can be very disruptive to the user when a window is forced -to the top. For a less disruptive way of getting the user's attention, see -[attention requests](@ref window_attention). - -If you wish to be notified when a window gains or loses input focus, whether by -the user, system or your own code, set a focus callback. - -@code -glfwSetWindowFocusCallback(window, window_focus_callback); -@endcode - -The callback function receives changes in the input focus state of the window. - -@code -void window_focus_callback(GLFWwindow* window, int focused) -{ - if (focused) - { - // The window gained input focus - } - else - { - // The window lost input focus - } -} -@endcode - -You can also get the current input focus state with @ref glfwGetWindowAttrib. - -@code -int focused = glfwGetWindowAttrib(window, GLFW_FOCUSED); -@endcode - -By default, newly created windows are given input focus. You can change this -behavior by setting the [GLFW_FOCUSED](@ref GLFW_FOCUSED_hint) window hint -before creating the window. - -@code -glfwWindowHint(GLFW_FOCUSED, GLFW_FALSE); -@endcode - - -@subsection window_attention Window attention request - -If you wish to notify the user of an event without interrupting, you can request -attention with @ref glfwRequestWindowAttention. - -@code -glfwRequestWindowAttention(window); -@endcode - -The system will highlight the specified window, or on platforms where this is -not supported, the application as a whole. Once the user has given it -attention, the system will automatically end the request. - - -@subsection window_refresh Window damage and refresh - -If you wish to be notified when the contents of a window is damaged and needs -to be refreshed, set a window refresh callback. - -@code -glfwSetWindowRefreshCallback(m_handle, window_refresh_callback); -@endcode - -The callback function is called when the contents of the window needs to be -refreshed. - -@code -void window_refresh_callback(GLFWwindow* window) -{ - draw_editor_ui(window); - glfwSwapBuffers(window); -} -@endcode - -@note On compositing window systems such as Aero, Compiz or Aqua, where the -window contents are saved off-screen, this callback might only be called when -the window or framebuffer is resized. - - -@subsection window_transparency Window transparency - -GLFW supports two kinds of transparency for windows; framebuffer transparency -and whole window transparency. A single window may not use both methods. The -results of doing this are undefined. - -Both methods require the platform to support it and not every version of every -platform GLFW supports does this, so there are mechanisms to check whether the -window really is transparent. - -Window framebuffers can be made transparent on a per-pixel per-frame basis with -the [GLFW_TRANSPARENT_FRAMEBUFFER](@ref GLFW_TRANSPARENT_FRAMEBUFFER_hint) -window hint. - -@code -glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE); -@endcode - -If supported by the system, the window content area will be composited with the -background using the framebuffer per-pixel alpha channel. This requires desktop -compositing to be enabled on the system. It does not affect window decorations. - -You can check whether the window framebuffer was successfully made transparent -with the -[GLFW_TRANSPARENT_FRAMEBUFFER](@ref GLFW_TRANSPARENT_FRAMEBUFFER_attrib) -window attribute. - -@code -if (glfwGetWindowAttrib(window, GLFW_TRANSPARENT_FRAMEBUFFER)) -{ - // window framebuffer is currently transparent -} -@endcode - -GLFW comes with an example that enabled framebuffer transparency called `gears`. - -The opacity of the whole window, including any decorations, can be set with @ref -glfwSetWindowOpacity. - -@code -glfwSetWindowOpacity(window, 0.5f); -@endcode - -The opacity (or alpha) value is a positive finite number between zero and one, -where 0 (zero) is fully transparent and 1 (one) is fully opaque. The initial -opacity value for newly created windows is 1. - -The current opacity of a window can be queried with @ref glfwGetWindowOpacity. - -@code -float opacity = glfwGetWindowOpacity(window); -@endcode - -If the system does not support whole window transparency, this function always -returns one. - -GLFW comes with a test program that lets you control whole window transparency -at run-time called `window`. - -If you want to use either of these transparency methods to display a temporary -overlay like for example a notification, the @ref GLFW_FLOATING and @ref -GLFW_MOUSE_PASSTHROUGH window hints and attributes may be useful. - - -@subsection window_attribs Window attributes - -Windows have a number of attributes that can be returned using @ref -glfwGetWindowAttrib. Some reflect state that may change as a result of user -interaction, (e.g. whether it has input focus), while others reflect inherent -properties of the window (e.g. what kind of border it has). Some are related to -the window and others to its OpenGL or OpenGL ES context. - -@code -if (glfwGetWindowAttrib(window, GLFW_FOCUSED)) -{ - // window has input focus -} -@endcode - -The [GLFW_DECORATED](@ref GLFW_DECORATED_attrib), -[GLFW_RESIZABLE](@ref GLFW_RESIZABLE_attrib), -[GLFW_FLOATING](@ref GLFW_FLOATING_attrib), -[GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_attrib) and -[GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_attrib) window attributes can be -changed with @ref glfwSetWindowAttrib. - -@code -glfwSetWindowAttrib(window, GLFW_RESIZABLE, GLFW_FALSE); -@endcode - - - -@subsubsection window_attribs_wnd Window related attributes - -@anchor GLFW_FOCUSED_attrib -__GLFW_FOCUSED__ indicates whether the specified window has input focus. See -@ref window_focus for details. - -@anchor GLFW_ICONIFIED_attrib -__GLFW_ICONIFIED__ indicates whether the specified window is iconified. -See @ref window_iconify for details. - -@anchor GLFW_MAXIMIZED_attrib -__GLFW_MAXIMIZED__ indicates whether the specified window is maximized. See -@ref window_maximize for details. - -@anchor GLFW_HOVERED_attrib -__GLFW_HOVERED__ indicates whether the cursor is currently directly over the -content area of the window, with no other windows between. See @ref -cursor_enter for details. - -@anchor GLFW_VISIBLE_attrib -__GLFW_VISIBLE__ indicates whether the specified window is visible. See @ref -window_hide for details. - -@anchor GLFW_RESIZABLE_attrib -__GLFW_RESIZABLE__ indicates whether the specified window is resizable _by the -user_. This can be set before creation with the -[GLFW_RESIZABLE](@ref GLFW_RESIZABLE_hint) window hint or after with @ref -glfwSetWindowAttrib. - -@anchor GLFW_DECORATED_attrib -__GLFW_DECORATED__ indicates whether the specified window has decorations such -as a border, a close widget, etc. This can be set before creation with the -[GLFW_DECORATED](@ref GLFW_DECORATED_hint) window hint or after with @ref -glfwSetWindowAttrib. - -@anchor GLFW_AUTO_ICONIFY_attrib -__GLFW_AUTO_ICONIFY__ indicates whether the specified full screen window is -iconified on focus loss, a close widget, etc. This can be set before creation -with the [GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_hint) window hint or after -with @ref glfwSetWindowAttrib. - -@anchor GLFW_FLOATING_attrib -__GLFW_FLOATING__ indicates whether the specified window is floating, also -called topmost or always-on-top. This can be set before creation with the -[GLFW_FLOATING](@ref GLFW_FLOATING_hint) window hint or after with @ref -glfwSetWindowAttrib. - -@anchor GLFW_TRANSPARENT_FRAMEBUFFER_attrib -__GLFW_TRANSPARENT_FRAMEBUFFER__ indicates whether the specified window has -a transparent framebuffer, i.e. the window contents is composited with the -background using the window framebuffer alpha channel. See @ref -window_transparency for details. - -@anchor GLFW_FOCUS_ON_SHOW_attrib -__GLFW_FOCUS_ON_SHOW__ specifies whether the window will be given input -focus when @ref glfwShowWindow is called. This can be set before creation -with the [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_hint) window hint or -after with @ref glfwSetWindowAttrib. - -@anchor GLFW_MOUSE_PASSTHROUGH_attrib -__GLFW_MOUSE_PASSTHROUGH__ specifies whether the window is transparent to mouse -input, letting any mouse events pass through to whatever window is behind it. -This can be set before creation with the -[GLFW_MOUSE_PASSTHROUGH](@ref GLFW_MOUSE_PASSTHROUGH_hint) window hint or after -with @ref glfwSetWindowAttrib. This is only supported for undecorated windows. -Decorated windows with this enabled will behave differently between platforms. - - -@subsubsection window_attribs_ctx Context related attributes - -@anchor GLFW_CLIENT_API_attrib -__GLFW_CLIENT_API__ indicates the client API provided by the window's context; -either `GLFW_OPENGL_API`, `GLFW_OPENGL_ES_API` or `GLFW_NO_API`. - -@anchor GLFW_CONTEXT_CREATION_API_attrib -__GLFW_CONTEXT_CREATION_API__ indicates the context creation API used to create -the window's context; either `GLFW_NATIVE_CONTEXT_API`, `GLFW_EGL_CONTEXT_API` -or `GLFW_OSMESA_CONTEXT_API`. - -@anchor GLFW_CONTEXT_VERSION_MAJOR_attrib -@anchor GLFW_CONTEXT_VERSION_MINOR_attrib -@anchor GLFW_CONTEXT_REVISION_attrib -__GLFW_CONTEXT_VERSION_MAJOR__, __GLFW_CONTEXT_VERSION_MINOR__ and -__GLFW_CONTEXT_REVISION__ indicate the client API version of the window's -context. - -@note Do not confuse these attributes with `GLFW_VERSION_MAJOR`, -`GLFW_VERSION_MINOR` and `GLFW_VERSION_REVISION` which provide the API version -of the GLFW header. - -@anchor GLFW_OPENGL_FORWARD_COMPAT_attrib -__GLFW_OPENGL_FORWARD_COMPAT__ is `GLFW_TRUE` if the window's context is an -OpenGL forward-compatible one, or `GLFW_FALSE` otherwise. - -@anchor GLFW_CONTEXT_DEBUG_attrib -@anchor GLFW_OPENGL_DEBUG_CONTEXT_attrib -__GLFW_CONTEXT_DEBUG__ is `GLFW_TRUE` if the window's context is in debug -mode, or `GLFW_FALSE` otherwise. - -@par -This is the new name, introduced in GLFW 3.4. The older -`GLFW_OPENGL_DEBUG_CONTEXT` name is also available for compatibility. - -@anchor GLFW_OPENGL_PROFILE_attrib -__GLFW_OPENGL_PROFILE__ indicates the OpenGL profile used by the context. This -is `GLFW_OPENGL_CORE_PROFILE` or `GLFW_OPENGL_COMPAT_PROFILE` if the context -uses a known profile, or `GLFW_OPENGL_ANY_PROFILE` if the OpenGL profile is -unknown or the context is an OpenGL ES context. Note that the returned profile -may not match the profile bits of the context flags, as GLFW will try other -means of detecting the profile when no bits are set. - -@anchor GLFW_CONTEXT_RELEASE_BEHAVIOR_attrib -__GLFW_CONTEXT_RELEASE_BEHAVIOR__ indicates the release used by the context. -Possible values are one of `GLFW_ANY_RELEASE_BEHAVIOR`, -`GLFW_RELEASE_BEHAVIOR_FLUSH` or `GLFW_RELEASE_BEHAVIOR_NONE`. If the -behavior is `GLFW_ANY_RELEASE_BEHAVIOR`, the default behavior of the context -creation API will be used. If the behavior is `GLFW_RELEASE_BEHAVIOR_FLUSH`, -the pipeline will be flushed whenever the context is released from being the -current one. If the behavior is `GLFW_RELEASE_BEHAVIOR_NONE`, the pipeline will -not be flushed on release. - -@anchor GLFW_CONTEXT_NO_ERROR_attrib -__GLFW_CONTEXT_NO_ERROR__ indicates whether errors are generated by the context. -Possible values are `GLFW_TRUE` and `GLFW_FALSE`. If enabled, situations that -would have generated errors instead cause undefined behavior. - -@anchor GLFW_CONTEXT_ROBUSTNESS_attrib -__GLFW_CONTEXT_ROBUSTNESS__ indicates the robustness strategy used by the -context. This is `GLFW_LOSE_CONTEXT_ON_RESET` or `GLFW_NO_RESET_NOTIFICATION` -if the window's context supports robustness, or `GLFW_NO_ROBUSTNESS` otherwise. - - -@subsubsection window_attribs_fb Framebuffer related attributes - -GLFW does not expose most attributes of the default framebuffer (i.e. the -framebuffer attached to the window) as these can be queried directly with either -OpenGL, OpenGL ES or Vulkan. The one exception is -[GLFW_DOUBLEBUFFER](@ref GLFW_DOUBLEBUFFER_attrib), as this is not provided by -OpenGL ES. - -If you are using version 3.0 or later of OpenGL or OpenGL ES, the -`glGetFramebufferAttachmentParameteriv` function can be used to retrieve the -number of bits for the red, green, blue, alpha, depth and stencil buffer -channels. Otherwise, the `glGetIntegerv` function can be used. - -The number of MSAA samples are always retrieved with `glGetIntegerv`. For -contexts supporting framebuffer objects, the number of samples of the currently -bound framebuffer is returned. - -Attribute | glGetIntegerv | glGetFramebufferAttachmentParameteriv ------------- | ----------------- | ------------------------------------- -Red bits | `GL_RED_BITS` | `GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE` -Green bits | `GL_GREEN_BITS` | `GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE` -Blue bits | `GL_BLUE_BITS` | `GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE` -Alpha bits | `GL_ALPHA_BITS` | `GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE` -Depth bits | `GL_DEPTH_BITS` | `GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE` -Stencil bits | `GL_STENCIL_BITS` | `GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE` -MSAA samples | `GL_SAMPLES` | _Not provided by this function_ - -When calling `glGetFramebufferAttachmentParameteriv`, the red, green, blue and -alpha sizes are queried from the `GL_BACK_LEFT`, while the depth and stencil -sizes are queried from the `GL_DEPTH` and `GL_STENCIL` attachments, -respectively. - -@anchor GLFW_DOUBLEBUFFER_attrib -__GLFW_DOUBLEBUFFER__ indicates whether the specified window is double-buffered -when rendering with OpenGL or OpenGL ES. This can be set before creation with -the [GLFW_DOUBLEBUFFER](@ref GLFW_DOUBLEBUFFER_hint) window hint. - - -@section buffer_swap Buffer swapping - -GLFW windows are by default double buffered. That means that you have two -rendering buffers; a front buffer and a back buffer. The front buffer is -the one being displayed and the back buffer the one you render to. - -When the entire frame has been rendered, it is time to swap the back and the -front buffers in order to display what has been rendered and begin rendering -a new frame. This is done with @ref glfwSwapBuffers. - -@code -glfwSwapBuffers(window); -@endcode - -Sometimes it can be useful to select when the buffer swap will occur. With the -function @ref glfwSwapInterval it is possible to select the minimum number of -monitor refreshes the driver should wait from the time @ref glfwSwapBuffers was -called before swapping the buffers: - -@code -glfwSwapInterval(1); -@endcode - -If the interval is zero, the swap will take place immediately when @ref -glfwSwapBuffers is called without waiting for a refresh. Otherwise at least -interval retraces will pass between each buffer swap. Using a swap interval of -zero can be useful for benchmarking purposes, when it is not desirable to -measure the time it takes to wait for the vertical retrace. However, a swap -interval of one lets you avoid tearing. - -Note that this may not work on all machines, as some drivers have -user-controlled settings that override any swap interval the application -requests. - -A context that supports either the `WGL_EXT_swap_control_tear` or the -`GLX_EXT_swap_control_tear` extension also accepts _negative_ swap intervals, -which allows the driver to swap immediately even if a frame arrives a little bit -late. This trades the risk of visible tears for greater framerate stability. -You can check for these extensions with @ref glfwExtensionSupported. - -*/ diff --git a/3rdparty/glfw/source/examples/CMakeLists.txt b/3rdparty/glfw/source/examples/CMakeLists.txt deleted file mode 100644 index be8927d..0000000 --- a/3rdparty/glfw/source/examples/CMakeLists.txt +++ /dev/null @@ -1,88 +0,0 @@ - -link_libraries(glfw) - -include_directories("${GLFW_SOURCE_DIR}/deps") - -if (MATH_LIBRARY) - link_libraries("${MATH_LIBRARY}") -endif() - -# Workaround for the MS CRT deprecating parts of the standard library -if (MSVC OR CMAKE_C_SIMULATE_ID STREQUAL "MSVC") - add_definitions(-D_CRT_SECURE_NO_WARNINGS) -endif() - -if (WIN32) - set(ICON glfw.rc) -elseif (APPLE) - set(ICON glfw.icns) -endif() - -set(GLAD_GL "${GLFW_SOURCE_DIR}/deps/glad/gl.h") -set(GLAD_GLES2 "${GLFW_SOURCE_DIR}/deps/glad/gles2.h") -set(GETOPT "${GLFW_SOURCE_DIR}/deps/getopt.h" - "${GLFW_SOURCE_DIR}/deps/getopt.c") -set(TINYCTHREAD "${GLFW_SOURCE_DIR}/deps/tinycthread.h" - "${GLFW_SOURCE_DIR}/deps/tinycthread.c") - -add_executable(boing WIN32 MACOSX_BUNDLE boing.c ${ICON} ${GLAD_GL}) -add_executable(gears WIN32 MACOSX_BUNDLE gears.c ${ICON} ${GLAD_GL}) -add_executable(heightmap WIN32 MACOSX_BUNDLE heightmap.c ${ICON} ${GLAD_GL}) -add_executable(offscreen offscreen.c ${ICON} ${GLAD_GL}) -add_executable(particles WIN32 MACOSX_BUNDLE particles.c ${ICON} ${TINYCTHREAD} ${GETOPT} ${GLAD_GL}) -add_executable(sharing WIN32 MACOSX_BUNDLE sharing.c ${ICON} ${GLAD_GL}) -add_executable(splitview WIN32 MACOSX_BUNDLE splitview.c ${ICON} ${GLAD_GL}) -add_executable(triangle-opengl WIN32 MACOSX_BUNDLE triangle-opengl.c ${ICON} ${GLAD_GL}) -add_executable(triangle-opengles WIN32 MACOSX_BUNDLE triangle-opengles.c ${ICON} ${GLAD_GLES2}) -add_executable(wave WIN32 MACOSX_BUNDLE wave.c ${ICON} ${GLAD_GL}) -add_executable(windows WIN32 MACOSX_BUNDLE windows.c ${ICON} ${GLAD_GL}) - -target_link_libraries(particles Threads::Threads) -if (RT_LIBRARY) - target_link_libraries(particles "${RT_LIBRARY}") -endif() - -set(GUI_ONLY_BINARIES boing gears heightmap particles sharing splitview - triangle-opengl triangle-opengles wave windows) -set(CONSOLE_BINARIES offscreen) - -set_target_properties(${GUI_ONLY_BINARIES} ${CONSOLE_BINARIES} PROPERTIES - C_STANDARD 99 - FOLDER "GLFW3/Examples") - -if (GLFW_USE_OSMESA) - find_package(OSMesa REQUIRED) - target_compile_definitions(offscreen PRIVATE USE_NATIVE_OSMESA) -endif() - -if (MSVC) - # Tell MSVC to use main instead of WinMain - set_target_properties(${GUI_ONLY_BINARIES} PROPERTIES - LINK_FLAGS "/ENTRY:mainCRTStartup") -elseif (CMAKE_C_SIMULATE_ID STREQUAL "MSVC") - # Tell Clang using MS CRT to use main instead of WinMain - set_target_properties(${GUI_ONLY_BINARIES} PROPERTIES - LINK_FLAGS "-Wl,/entry:mainCRTStartup") -endif() - -if (APPLE) - set_target_properties(boing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Boing") - set_target_properties(gears PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Gears") - set_target_properties(heightmap PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Heightmap") - set_target_properties(particles PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Particles") - set_target_properties(sharing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Sharing") - set_target_properties(triangle-opengl PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "OpenGL Triangle") - set_target_properties(triangle-opengles PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "OpenGL ES Triangle") - set_target_properties(splitview PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "SplitView") - set_target_properties(wave PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Wave") - set_target_properties(windows PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Windows") - - set_source_files_properties(glfw.icns PROPERTIES - MACOSX_PACKAGE_LOCATION "Resources") - set_target_properties(${GUI_ONLY_BINARIES} PROPERTIES - MACOSX_BUNDLE_SHORT_VERSION_STRING ${GLFW_VERSION} - MACOSX_BUNDLE_LONG_VERSION_STRING ${GLFW_VERSION} - MACOSX_BUNDLE_ICON_FILE glfw.icns - MACOSX_BUNDLE_INFO_PLIST "${GLFW_SOURCE_DIR}/CMake/Info.plist.in") -endif() - diff --git a/3rdparty/glfw/source/examples/boing.c b/3rdparty/glfw/source/examples/boing.c deleted file mode 100644 index ec118a3..0000000 --- a/3rdparty/glfw/source/examples/boing.c +++ /dev/null @@ -1,680 +0,0 @@ -/***************************************************************************** - * Title: GLBoing - * Desc: Tribute to Amiga Boing. - * Author: Jim Brooks - * Original Amiga authors were R.J. Mical and Dale Luck. - * GLFW conversion by Marcus Geelnard - * Notes: - 360' = 2*PI [radian] - * - * - Distances between objects are created by doing a relative - * Z translations. - * - * - Although OpenGL enticingly supports alpha-blending, - * the shadow of the original Boing didn't affect the color - * of the grid. - * - * - [Marcus] Changed timing scheme from interval driven to frame- - * time based animation steps (which results in much smoother - * movement) - * - * History of Amiga Boing: - * - * Boing was demonstrated on the prototype Amiga (codenamed "Lorraine") in - * 1985. According to legend, it was written ad-hoc in one night by - * R. J. Mical and Dale Luck. Because the bouncing ball animation was so fast - * and smooth, attendees did not believe the Amiga prototype was really doing - * the rendering. Suspecting a trick, they began looking around the booth for - * a hidden computer or VCR. - *****************************************************************************/ - -#if defined(_MSC_VER) - // Make MS math.h define M_PI - #define _USE_MATH_DEFINES -#endif - -#include -#include -#include - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#include - - -/***************************************************************************** - * Various declarations and macros - *****************************************************************************/ - -/* Prototypes */ -void init( void ); -void display( void ); -void reshape( GLFWwindow* window, int w, int h ); -void key_callback( GLFWwindow* window, int key, int scancode, int action, int mods ); -void mouse_button_callback( GLFWwindow* window, int button, int action, int mods ); -void cursor_position_callback( GLFWwindow* window, double x, double y ); -void DrawBoingBall( void ); -void BounceBall( double dt ); -void DrawBoingBallBand( GLfloat long_lo, GLfloat long_hi ); -void DrawGrid( void ); - -#define RADIUS 70.f -#define STEP_LONGITUDE 22.5f /* 22.5 makes 8 bands like original Boing */ -#define STEP_LATITUDE 22.5f - -#define DIST_BALL (RADIUS * 2.f + RADIUS * 0.1f) - -#define VIEW_SCENE_DIST (DIST_BALL * 3.f + 200.f)/* distance from viewer to middle of boing area */ -#define GRID_SIZE (RADIUS * 4.5f) /* length (width) of grid */ -#define BOUNCE_HEIGHT (RADIUS * 2.1f) -#define BOUNCE_WIDTH (RADIUS * 2.1f) - -#define SHADOW_OFFSET_X -20.f -#define SHADOW_OFFSET_Y 10.f -#define SHADOW_OFFSET_Z 0.f - -#define WALL_L_OFFSET 0.f -#define WALL_R_OFFSET 5.f - -/* Animation speed (50.0 mimics the original GLUT demo speed) */ -#define ANIMATION_SPEED 50.f - -/* Maximum allowed delta time per physics iteration */ -#define MAX_DELTA_T 0.02f - -/* Draw ball, or its shadow */ -typedef enum { DRAW_BALL, DRAW_BALL_SHADOW } DRAW_BALL_ENUM; - -/* Vertex type */ -typedef struct {float x; float y; float z;} vertex_t; - -/* Global vars */ -int windowed_xpos, windowed_ypos, windowed_width, windowed_height; -int width, height; -GLfloat deg_rot_y = 0.f; -GLfloat deg_rot_y_inc = 2.f; -int override_pos = GLFW_FALSE; -GLfloat cursor_x = 0.f; -GLfloat cursor_y = 0.f; -GLfloat ball_x = -RADIUS; -GLfloat ball_y = -RADIUS; -GLfloat ball_x_inc = 1.f; -GLfloat ball_y_inc = 2.f; -DRAW_BALL_ENUM drawBallHow; -double t; -double t_old = 0.f; -double dt; - -/* Random number generator */ -#ifndef RAND_MAX - #define RAND_MAX 4095 -#endif - - -/***************************************************************************** - * Truncate a degree. - *****************************************************************************/ -GLfloat TruncateDeg( GLfloat deg ) -{ - if ( deg >= 360.f ) - return (deg - 360.f); - else - return deg; -} - -/***************************************************************************** - * Convert a degree (360-based) into a radian. - * 360' = 2 * PI - *****************************************************************************/ -double deg2rad( double deg ) -{ - return deg / 360 * (2 * M_PI); -} - -/***************************************************************************** - * 360' sin(). - *****************************************************************************/ -double sin_deg( double deg ) -{ - return sin( deg2rad( deg ) ); -} - -/***************************************************************************** - * 360' cos(). - *****************************************************************************/ -double cos_deg( double deg ) -{ - return cos( deg2rad( deg ) ); -} - -/***************************************************************************** - * Compute a cross product (for a normal vector). - * - * c = a x b - *****************************************************************************/ -void CrossProduct( vertex_t a, vertex_t b, vertex_t c, vertex_t *n ) -{ - GLfloat u1, u2, u3; - GLfloat v1, v2, v3; - - u1 = b.x - a.x; - u2 = b.y - a.y; - u3 = b.y - a.z; - - v1 = c.x - a.x; - v2 = c.y - a.y; - v3 = c.z - a.z; - - n->x = u2 * v3 - v2 * u3; - n->y = u3 * v1 - v3 * u1; - n->z = u1 * v2 - v1 * u2; -} - - -#define BOING_DEBUG 0 - - -/***************************************************************************** - * init() - *****************************************************************************/ -void init( void ) -{ - /* - * Clear background. - */ - glClearColor( 0.55f, 0.55f, 0.55f, 0.f ); - - glShadeModel( GL_FLAT ); -} - - -/***************************************************************************** - * display() - *****************************************************************************/ -void display(void) -{ - glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); - glPushMatrix(); - - drawBallHow = DRAW_BALL_SHADOW; - DrawBoingBall(); - - DrawGrid(); - - drawBallHow = DRAW_BALL; - DrawBoingBall(); - - glPopMatrix(); - glFlush(); -} - - -/***************************************************************************** - * reshape() - *****************************************************************************/ -void reshape( GLFWwindow* window, int w, int h ) -{ - mat4x4 projection, view; - - glViewport( 0, 0, (GLsizei)w, (GLsizei)h ); - - glMatrixMode( GL_PROJECTION ); - mat4x4_perspective( projection, - 2.f * (float) atan2( RADIUS, 200.f ), - (float)w / (float)h, - 1.f, VIEW_SCENE_DIST ); - glLoadMatrixf((const GLfloat*) projection); - - glMatrixMode( GL_MODELVIEW ); - { - vec3 eye = { 0.f, 0.f, VIEW_SCENE_DIST }; - vec3 center = { 0.f, 0.f, 0.f }; - vec3 up = { 0.f, -1.f, 0.f }; - mat4x4_look_at( view, eye, center, up ); - } - glLoadMatrixf((const GLfloat*) view); -} - -void key_callback( GLFWwindow* window, int key, int scancode, int action, int mods ) -{ - if (action != GLFW_PRESS) - return; - - if (key == GLFW_KEY_ESCAPE && mods == 0) - glfwSetWindowShouldClose(window, GLFW_TRUE); - if ((key == GLFW_KEY_ENTER && mods == GLFW_MOD_ALT) || - (key == GLFW_KEY_F11 && mods == GLFW_MOD_ALT)) - { - if (glfwGetWindowMonitor(window)) - { - glfwSetWindowMonitor(window, NULL, - windowed_xpos, windowed_ypos, - windowed_width, windowed_height, 0); - } - else - { - GLFWmonitor* monitor = glfwGetPrimaryMonitor(); - if (monitor) - { - const GLFWvidmode* mode = glfwGetVideoMode(monitor); - glfwGetWindowPos(window, &windowed_xpos, &windowed_ypos); - glfwGetWindowSize(window, &windowed_width, &windowed_height); - glfwSetWindowMonitor(window, monitor, 0, 0, mode->width, mode->height, mode->refreshRate); - } - } - } -} - -static void set_ball_pos ( GLfloat x, GLfloat y ) -{ - ball_x = (width / 2) - x; - ball_y = y - (height / 2); -} - -void mouse_button_callback( GLFWwindow* window, int button, int action, int mods ) -{ - if (button != GLFW_MOUSE_BUTTON_LEFT) - return; - - if (action == GLFW_PRESS) - { - override_pos = GLFW_TRUE; - set_ball_pos(cursor_x, cursor_y); - } - else - { - override_pos = GLFW_FALSE; - } -} - -void cursor_position_callback( GLFWwindow* window, double x, double y ) -{ - cursor_x = (float) x; - cursor_y = (float) y; - - if ( override_pos ) - set_ball_pos(cursor_x, cursor_y); -} - -/***************************************************************************** - * Draw the Boing ball. - * - * The Boing ball is sphere in which each facet is a rectangle. - * Facet colors alternate between red and white. - * The ball is built by stacking latitudinal circles. Each circle is composed - * of a widely-separated set of points, so that each facet is noticeably large. - *****************************************************************************/ -void DrawBoingBall( void ) -{ - GLfloat lon_deg; /* degree of longitude */ - double dt_total, dt2; - - glPushMatrix(); - glMatrixMode( GL_MODELVIEW ); - - /* - * Another relative Z translation to separate objects. - */ - glTranslatef( 0.0, 0.0, DIST_BALL ); - - /* Update ball position and rotation (iterate if necessary) */ - dt_total = dt; - while( dt_total > 0.0 ) - { - dt2 = dt_total > MAX_DELTA_T ? MAX_DELTA_T : dt_total; - dt_total -= dt2; - BounceBall( dt2 ); - deg_rot_y = TruncateDeg( deg_rot_y + deg_rot_y_inc*((float)dt2*ANIMATION_SPEED) ); - } - - /* Set ball position */ - glTranslatef( ball_x, ball_y, 0.0 ); - - /* - * Offset the shadow. - */ - if ( drawBallHow == DRAW_BALL_SHADOW ) - { - glTranslatef( SHADOW_OFFSET_X, - SHADOW_OFFSET_Y, - SHADOW_OFFSET_Z ); - } - - /* - * Tilt the ball. - */ - glRotatef( -20.0, 0.0, 0.0, 1.0 ); - - /* - * Continually rotate ball around Y axis. - */ - glRotatef( deg_rot_y, 0.0, 1.0, 0.0 ); - - /* - * Set OpenGL state for Boing ball. - */ - glCullFace( GL_FRONT ); - glEnable( GL_CULL_FACE ); - glEnable( GL_NORMALIZE ); - - /* - * Build a faceted latitude slice of the Boing ball, - * stepping same-sized vertical bands of the sphere. - */ - for ( lon_deg = 0; - lon_deg < 180; - lon_deg += STEP_LONGITUDE ) - { - /* - * Draw a latitude circle at this longitude. - */ - DrawBoingBallBand( lon_deg, - lon_deg + STEP_LONGITUDE ); - } - - glPopMatrix(); - - return; -} - - -/***************************************************************************** - * Bounce the ball. - *****************************************************************************/ -void BounceBall( double delta_t ) -{ - GLfloat sign; - GLfloat deg; - - if ( override_pos ) - return; - - /* Bounce on walls */ - if ( ball_x > (BOUNCE_WIDTH/2 + WALL_R_OFFSET ) ) - { - ball_x_inc = -0.5f - 0.75f * (GLfloat)rand() / (GLfloat)RAND_MAX; - deg_rot_y_inc = -deg_rot_y_inc; - } - if ( ball_x < -(BOUNCE_HEIGHT/2 + WALL_L_OFFSET) ) - { - ball_x_inc = 0.5f + 0.75f * (GLfloat)rand() / (GLfloat)RAND_MAX; - deg_rot_y_inc = -deg_rot_y_inc; - } - - /* Bounce on floor / roof */ - if ( ball_y > BOUNCE_HEIGHT/2 ) - { - ball_y_inc = -0.75f - 1.f * (GLfloat)rand() / (GLfloat)RAND_MAX; - } - if ( ball_y < -BOUNCE_HEIGHT/2*0.85 ) - { - ball_y_inc = 0.75f + 1.f * (GLfloat)rand() / (GLfloat)RAND_MAX; - } - - /* Update ball position */ - ball_x += ball_x_inc * ((float)delta_t*ANIMATION_SPEED); - ball_y += ball_y_inc * ((float)delta_t*ANIMATION_SPEED); - - /* - * Simulate the effects of gravity on Y movement. - */ - if ( ball_y_inc < 0 ) sign = -1.0; else sign = 1.0; - - deg = (ball_y + BOUNCE_HEIGHT/2) * 90 / BOUNCE_HEIGHT; - if ( deg > 80 ) deg = 80; - if ( deg < 10 ) deg = 10; - - ball_y_inc = sign * 4.f * (float) sin_deg( deg ); -} - - -/***************************************************************************** - * Draw a faceted latitude band of the Boing ball. - * - * Parms: long_lo, long_hi - * Low and high longitudes of slice, resp. - *****************************************************************************/ -void DrawBoingBallBand( GLfloat long_lo, - GLfloat long_hi ) -{ - vertex_t vert_ne; /* "ne" means south-east, so on */ - vertex_t vert_nw; - vertex_t vert_sw; - vertex_t vert_se; - vertex_t vert_norm; - GLfloat lat_deg; - static int colorToggle = 0; - - /* - * Iterate through the points of a latitude circle. - * A latitude circle is a 2D set of X,Z points. - */ - for ( lat_deg = 0; - lat_deg <= (360 - STEP_LATITUDE); - lat_deg += STEP_LATITUDE ) - { - /* - * Color this polygon with red or white. - */ - if ( colorToggle ) - glColor3f( 0.8f, 0.1f, 0.1f ); - else - glColor3f( 0.95f, 0.95f, 0.95f ); -#if 0 - if ( lat_deg >= 180 ) - if ( colorToggle ) - glColor3f( 0.1f, 0.8f, 0.1f ); - else - glColor3f( 0.5f, 0.5f, 0.95f ); -#endif - colorToggle = ! colorToggle; - - /* - * Change color if drawing shadow. - */ - if ( drawBallHow == DRAW_BALL_SHADOW ) - glColor3f( 0.35f, 0.35f, 0.35f ); - - /* - * Assign each Y. - */ - vert_ne.y = vert_nw.y = (float) cos_deg(long_hi) * RADIUS; - vert_sw.y = vert_se.y = (float) cos_deg(long_lo) * RADIUS; - - /* - * Assign each X,Z with sin,cos values scaled by latitude radius indexed by longitude. - * Eg, long=0 and long=180 are at the poles, so zero scale is sin(longitude), - * while long=90 (sin(90)=1) is at equator. - */ - vert_ne.x = (float) cos_deg( lat_deg ) * (RADIUS * (float) sin_deg( long_lo + STEP_LONGITUDE )); - vert_se.x = (float) cos_deg( lat_deg ) * (RADIUS * (float) sin_deg( long_lo )); - vert_nw.x = (float) cos_deg( lat_deg + STEP_LATITUDE ) * (RADIUS * (float) sin_deg( long_lo + STEP_LONGITUDE )); - vert_sw.x = (float) cos_deg( lat_deg + STEP_LATITUDE ) * (RADIUS * (float) sin_deg( long_lo )); - - vert_ne.z = (float) sin_deg( lat_deg ) * (RADIUS * (float) sin_deg( long_lo + STEP_LONGITUDE )); - vert_se.z = (float) sin_deg( lat_deg ) * (RADIUS * (float) sin_deg( long_lo )); - vert_nw.z = (float) sin_deg( lat_deg + STEP_LATITUDE ) * (RADIUS * (float) sin_deg( long_lo + STEP_LONGITUDE )); - vert_sw.z = (float) sin_deg( lat_deg + STEP_LATITUDE ) * (RADIUS * (float) sin_deg( long_lo )); - - /* - * Draw the facet. - */ - glBegin( GL_POLYGON ); - - CrossProduct( vert_ne, vert_nw, vert_sw, &vert_norm ); - glNormal3f( vert_norm.x, vert_norm.y, vert_norm.z ); - - glVertex3f( vert_ne.x, vert_ne.y, vert_ne.z ); - glVertex3f( vert_nw.x, vert_nw.y, vert_nw.z ); - glVertex3f( vert_sw.x, vert_sw.y, vert_sw.z ); - glVertex3f( vert_se.x, vert_se.y, vert_se.z ); - - glEnd(); - -#if BOING_DEBUG - printf( "----------------------------------------------------------- \n" ); - printf( "lat = %f long_lo = %f long_hi = %f \n", lat_deg, long_lo, long_hi ); - printf( "vert_ne x = %.8f y = %.8f z = %.8f \n", vert_ne.x, vert_ne.y, vert_ne.z ); - printf( "vert_nw x = %.8f y = %.8f z = %.8f \n", vert_nw.x, vert_nw.y, vert_nw.z ); - printf( "vert_se x = %.8f y = %.8f z = %.8f \n", vert_se.x, vert_se.y, vert_se.z ); - printf( "vert_sw x = %.8f y = %.8f z = %.8f \n", vert_sw.x, vert_sw.y, vert_sw.z ); -#endif - - } - - /* - * Toggle color so that next band will opposite red/white colors than this one. - */ - colorToggle = ! colorToggle; - - /* - * This circular band is done. - */ - return; -} - - -/***************************************************************************** - * Draw the purple grid of lines, behind the Boing ball. - * When the Workbench is dropped to the bottom, Boing shows 12 rows. - *****************************************************************************/ -void DrawGrid( void ) -{ - int row, col; - const int rowTotal = 12; /* must be divisible by 2 */ - const int colTotal = rowTotal; /* must be same as rowTotal */ - const GLfloat widthLine = 2.0; /* should be divisible by 2 */ - const GLfloat sizeCell = GRID_SIZE / rowTotal; - const GLfloat z_offset = -40.0; - GLfloat xl, xr; - GLfloat yt, yb; - - glPushMatrix(); - glDisable( GL_CULL_FACE ); - - /* - * Another relative Z translation to separate objects. - */ - glTranslatef( 0.0, 0.0, DIST_BALL ); - - /* - * Draw vertical lines (as skinny 3D rectangles). - */ - for ( col = 0; col <= colTotal; col++ ) - { - /* - * Compute co-ords of line. - */ - xl = -GRID_SIZE / 2 + col * sizeCell; - xr = xl + widthLine; - - yt = GRID_SIZE / 2; - yb = -GRID_SIZE / 2 - widthLine; - - glBegin( GL_POLYGON ); - - glColor3f( 0.6f, 0.1f, 0.6f ); /* purple */ - - glVertex3f( xr, yt, z_offset ); /* NE */ - glVertex3f( xl, yt, z_offset ); /* NW */ - glVertex3f( xl, yb, z_offset ); /* SW */ - glVertex3f( xr, yb, z_offset ); /* SE */ - - glEnd(); - } - - /* - * Draw horizontal lines (as skinny 3D rectangles). - */ - for ( row = 0; row <= rowTotal; row++ ) - { - /* - * Compute co-ords of line. - */ - yt = GRID_SIZE / 2 - row * sizeCell; - yb = yt - widthLine; - - xl = -GRID_SIZE / 2; - xr = GRID_SIZE / 2 + widthLine; - - glBegin( GL_POLYGON ); - - glColor3f( 0.6f, 0.1f, 0.6f ); /* purple */ - - glVertex3f( xr, yt, z_offset ); /* NE */ - glVertex3f( xl, yt, z_offset ); /* NW */ - glVertex3f( xl, yb, z_offset ); /* SW */ - glVertex3f( xr, yb, z_offset ); /* SE */ - - glEnd(); - } - - glPopMatrix(); - - return; -} - - -/*======================================================================* - * main() - *======================================================================*/ - -int main( void ) -{ - GLFWwindow* window; - - /* Init GLFW */ - if( !glfwInit() ) - exit( EXIT_FAILURE ); - - window = glfwCreateWindow( 400, 400, "Boing (classic Amiga demo)", NULL, NULL ); - if (!window) - { - glfwTerminate(); - exit( EXIT_FAILURE ); - } - - glfwSetWindowAspectRatio(window, 1, 1); - - glfwSetFramebufferSizeCallback(window, reshape); - glfwSetKeyCallback(window, key_callback); - glfwSetMouseButtonCallback(window, mouse_button_callback); - glfwSetCursorPosCallback(window, cursor_position_callback); - - glfwMakeContextCurrent(window); - gladLoadGL(glfwGetProcAddress); - glfwSwapInterval( 1 ); - - glfwGetFramebufferSize(window, &width, &height); - reshape(window, width, height); - - glfwSetTime( 0.0 ); - - init(); - - /* Main loop */ - for (;;) - { - /* Timing */ - t = glfwGetTime(); - dt = t - t_old; - t_old = t; - - /* Draw one frame */ - display(); - - /* Swap buffers */ - glfwSwapBuffers(window); - glfwPollEvents(); - - /* Check if we are still running */ - if (glfwWindowShouldClose(window)) - break; - } - - glfwTerminate(); - exit( EXIT_SUCCESS ); -} - diff --git a/3rdparty/glfw/source/examples/gears.c b/3rdparty/glfw/source/examples/gears.c deleted file mode 100644 index 3d63013..0000000 --- a/3rdparty/glfw/source/examples/gears.c +++ /dev/null @@ -1,361 +0,0 @@ -/* - * 3-D gear wheels. This program is in the public domain. - * - * Command line options: - * -info print GL implementation information - * -exit automatically exit after 30 seconds - * - * - * Brian Paul - * - * - * Marcus Geelnard: - * - Conversion to GLFW - * - Time based rendering (frame rate independent) - * - Slightly modified camera that should work better for stereo viewing - * - * - * Camilla Löwy: - * - Removed FPS counter (this is not a benchmark) - * - Added a few comments - * - Enabled vsync - */ - -#if defined(_MSC_VER) - // Make MS math.h define M_PI - #define _USE_MATH_DEFINES -#endif - -#include -#include -#include -#include - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -/** - - Draw a gear wheel. You'll probably want to call this function when - building a display list since we do a lot of trig here. - - Input: inner_radius - radius of hole at center - outer_radius - radius at center of teeth - width - width of gear teeth - number of teeth - tooth_depth - depth of tooth - - **/ - -static void -gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width, - GLint teeth, GLfloat tooth_depth) -{ - GLint i; - GLfloat r0, r1, r2; - GLfloat angle, da; - GLfloat u, v, len; - - r0 = inner_radius; - r1 = outer_radius - tooth_depth / 2.f; - r2 = outer_radius + tooth_depth / 2.f; - - da = 2.f * (float) M_PI / teeth / 4.f; - - glShadeModel(GL_FLAT); - - glNormal3f(0.f, 0.f, 1.f); - - /* draw front face */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= teeth; i++) { - angle = i * 2.f * (float) M_PI / teeth; - glVertex3f(r0 * (float) cos(angle), r0 * (float) sin(angle), width * 0.5f); - glVertex3f(r1 * (float) cos(angle), r1 * (float) sin(angle), width * 0.5f); - if (i < teeth) { - glVertex3f(r0 * (float) cos(angle), r0 * (float) sin(angle), width * 0.5f); - glVertex3f(r1 * (float) cos(angle + 3 * da), r1 * (float) sin(angle + 3 * da), width * 0.5f); - } - } - glEnd(); - - /* draw front sides of teeth */ - glBegin(GL_QUADS); - da = 2.f * (float) M_PI / teeth / 4.f; - for (i = 0; i < teeth; i++) { - angle = i * 2.f * (float) M_PI / teeth; - - glVertex3f(r1 * (float) cos(angle), r1 * (float) sin(angle), width * 0.5f); - glVertex3f(r2 * (float) cos(angle + da), r2 * (float) sin(angle + da), width * 0.5f); - glVertex3f(r2 * (float) cos(angle + 2 * da), r2 * (float) sin(angle + 2 * da), width * 0.5f); - glVertex3f(r1 * (float) cos(angle + 3 * da), r1 * (float) sin(angle + 3 * da), width * 0.5f); - } - glEnd(); - - glNormal3f(0.0, 0.0, -1.0); - - /* draw back face */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= teeth; i++) { - angle = i * 2.f * (float) M_PI / teeth; - glVertex3f(r1 * (float) cos(angle), r1 * (float) sin(angle), -width * 0.5f); - glVertex3f(r0 * (float) cos(angle), r0 * (float) sin(angle), -width * 0.5f); - if (i < teeth) { - glVertex3f(r1 * (float) cos(angle + 3 * da), r1 * (float) sin(angle + 3 * da), -width * 0.5f); - glVertex3f(r0 * (float) cos(angle), r0 * (float) sin(angle), -width * 0.5f); - } - } - glEnd(); - - /* draw back sides of teeth */ - glBegin(GL_QUADS); - da = 2.f * (float) M_PI / teeth / 4.f; - for (i = 0; i < teeth; i++) { - angle = i * 2.f * (float) M_PI / teeth; - - glVertex3f(r1 * (float) cos(angle + 3 * da), r1 * (float) sin(angle + 3 * da), -width * 0.5f); - glVertex3f(r2 * (float) cos(angle + 2 * da), r2 * (float) sin(angle + 2 * da), -width * 0.5f); - glVertex3f(r2 * (float) cos(angle + da), r2 * (float) sin(angle + da), -width * 0.5f); - glVertex3f(r1 * (float) cos(angle), r1 * (float) sin(angle), -width * 0.5f); - } - glEnd(); - - /* draw outward faces of teeth */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i < teeth; i++) { - angle = i * 2.f * (float) M_PI / teeth; - - glVertex3f(r1 * (float) cos(angle), r1 * (float) sin(angle), width * 0.5f); - glVertex3f(r1 * (float) cos(angle), r1 * (float) sin(angle), -width * 0.5f); - u = r2 * (float) cos(angle + da) - r1 * (float) cos(angle); - v = r2 * (float) sin(angle + da) - r1 * (float) sin(angle); - len = (float) sqrt(u * u + v * v); - u /= len; - v /= len; - glNormal3f(v, -u, 0.0); - glVertex3f(r2 * (float) cos(angle + da), r2 * (float) sin(angle + da), width * 0.5f); - glVertex3f(r2 * (float) cos(angle + da), r2 * (float) sin(angle + da), -width * 0.5f); - glNormal3f((float) cos(angle), (float) sin(angle), 0.f); - glVertex3f(r2 * (float) cos(angle + 2 * da), r2 * (float) sin(angle + 2 * da), width * 0.5f); - glVertex3f(r2 * (float) cos(angle + 2 * da), r2 * (float) sin(angle + 2 * da), -width * 0.5f); - u = r1 * (float) cos(angle + 3 * da) - r2 * (float) cos(angle + 2 * da); - v = r1 * (float) sin(angle + 3 * da) - r2 * (float) sin(angle + 2 * da); - glNormal3f(v, -u, 0.f); - glVertex3f(r1 * (float) cos(angle + 3 * da), r1 * (float) sin(angle + 3 * da), width * 0.5f); - glVertex3f(r1 * (float) cos(angle + 3 * da), r1 * (float) sin(angle + 3 * da), -width * 0.5f); - glNormal3f((float) cos(angle), (float) sin(angle), 0.f); - } - - glVertex3f(r1 * (float) cos(0), r1 * (float) sin(0), width * 0.5f); - glVertex3f(r1 * (float) cos(0), r1 * (float) sin(0), -width * 0.5f); - - glEnd(); - - glShadeModel(GL_SMOOTH); - - /* draw inside radius cylinder */ - glBegin(GL_QUAD_STRIP); - for (i = 0; i <= teeth; i++) { - angle = i * 2.f * (float) M_PI / teeth; - glNormal3f(-(float) cos(angle), -(float) sin(angle), 0.f); - glVertex3f(r0 * (float) cos(angle), r0 * (float) sin(angle), -width * 0.5f); - glVertex3f(r0 * (float) cos(angle), r0 * (float) sin(angle), width * 0.5f); - } - glEnd(); - -} - - -static GLfloat view_rotx = 20.f, view_roty = 30.f, view_rotz = 0.f; -static GLint gear1, gear2, gear3; -static GLfloat angle = 0.f; - -/* OpenGL draw function & timing */ -static void draw(void) -{ - glClearColor(0.0, 0.0, 0.0, 0.0); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - glPushMatrix(); - glRotatef(view_rotx, 1.0, 0.0, 0.0); - glRotatef(view_roty, 0.0, 1.0, 0.0); - glRotatef(view_rotz, 0.0, 0.0, 1.0); - - glPushMatrix(); - glTranslatef(-3.0, -2.0, 0.0); - glRotatef(angle, 0.0, 0.0, 1.0); - glCallList(gear1); - glPopMatrix(); - - glPushMatrix(); - glTranslatef(3.1f, -2.f, 0.f); - glRotatef(-2.f * angle - 9.f, 0.f, 0.f, 1.f); - glCallList(gear2); - glPopMatrix(); - - glPushMatrix(); - glTranslatef(-3.1f, 4.2f, 0.f); - glRotatef(-2.f * angle - 25.f, 0.f, 0.f, 1.f); - glCallList(gear3); - glPopMatrix(); - - glPopMatrix(); -} - - -/* update animation parameters */ -static void animate(void) -{ - angle = 100.f * (float) glfwGetTime(); -} - - -/* change view angle, exit upon ESC */ -void key( GLFWwindow* window, int k, int s, int action, int mods ) -{ - if( action != GLFW_PRESS ) return; - - switch (k) { - case GLFW_KEY_Z: - if( mods & GLFW_MOD_SHIFT ) - view_rotz -= 5.0; - else - view_rotz += 5.0; - break; - case GLFW_KEY_ESCAPE: - glfwSetWindowShouldClose(window, GLFW_TRUE); - break; - case GLFW_KEY_UP: - view_rotx += 5.0; - break; - case GLFW_KEY_DOWN: - view_rotx -= 5.0; - break; - case GLFW_KEY_LEFT: - view_roty += 5.0; - break; - case GLFW_KEY_RIGHT: - view_roty -= 5.0; - break; - default: - return; - } -} - - -/* new window size */ -void reshape( GLFWwindow* window, int width, int height ) -{ - GLfloat h = (GLfloat) height / (GLfloat) width; - GLfloat xmax, znear, zfar; - - znear = 5.0f; - zfar = 30.0f; - xmax = znear * 0.5f; - - glViewport( 0, 0, (GLint) width, (GLint) height ); - glMatrixMode( GL_PROJECTION ); - glLoadIdentity(); - glFrustum( -xmax, xmax, -xmax*h, xmax*h, znear, zfar ); - glMatrixMode( GL_MODELVIEW ); - glLoadIdentity(); - glTranslatef( 0.0, 0.0, -20.0 ); -} - - -/* program & OpenGL initialization */ -static void init(void) -{ - static GLfloat pos[4] = {5.f, 5.f, 10.f, 0.f}; - static GLfloat red[4] = {0.8f, 0.1f, 0.f, 1.f}; - static GLfloat green[4] = {0.f, 0.8f, 0.2f, 1.f}; - static GLfloat blue[4] = {0.2f, 0.2f, 1.f, 1.f}; - - glLightfv(GL_LIGHT0, GL_POSITION, pos); - glEnable(GL_CULL_FACE); - glEnable(GL_LIGHTING); - glEnable(GL_LIGHT0); - glEnable(GL_DEPTH_TEST); - - /* make the gears */ - gear1 = glGenLists(1); - glNewList(gear1, GL_COMPILE); - glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red); - gear(1.f, 4.f, 1.f, 20, 0.7f); - glEndList(); - - gear2 = glGenLists(1); - glNewList(gear2, GL_COMPILE); - glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green); - gear(0.5f, 2.f, 2.f, 10, 0.7f); - glEndList(); - - gear3 = glGenLists(1); - glNewList(gear3, GL_COMPILE); - glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue); - gear(1.3f, 2.f, 0.5f, 10, 0.7f); - glEndList(); - - glEnable(GL_NORMALIZE); -} - - -/* program entry */ -int main(int argc, char *argv[]) -{ - GLFWwindow* window; - int width, height; - - if( !glfwInit() ) - { - fprintf( stderr, "Failed to initialize GLFW\n" ); - exit( EXIT_FAILURE ); - } - - glfwWindowHint(GLFW_DEPTH_BITS, 16); - glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE); - - window = glfwCreateWindow( 300, 300, "Gears", NULL, NULL ); - if (!window) - { - fprintf( stderr, "Failed to open GLFW window\n" ); - glfwTerminate(); - exit( EXIT_FAILURE ); - } - - // Set callback functions - glfwSetFramebufferSizeCallback(window, reshape); - glfwSetKeyCallback(window, key); - - glfwMakeContextCurrent(window); - gladLoadGL(glfwGetProcAddress); - glfwSwapInterval( 1 ); - - glfwGetFramebufferSize(window, &width, &height); - reshape(window, width, height); - - // Parse command-line options - init(); - - // Main loop - while( !glfwWindowShouldClose(window) ) - { - // Draw gears - draw(); - - // Update animation - animate(); - - // Swap buffers - glfwSwapBuffers(window); - glfwPollEvents(); - } - - // Terminate GLFW - glfwTerminate(); - - // Exit program - exit( EXIT_SUCCESS ); -} - diff --git a/3rdparty/glfw/source/examples/glfw.icns b/3rdparty/glfw/source/examples/glfw.icns deleted file mode 100644 index ad98f39..0000000 Binary files a/3rdparty/glfw/source/examples/glfw.icns and /dev/null differ diff --git a/3rdparty/glfw/source/examples/glfw.ico b/3rdparty/glfw/source/examples/glfw.ico deleted file mode 100644 index 882a660..0000000 Binary files a/3rdparty/glfw/source/examples/glfw.ico and /dev/null differ diff --git a/3rdparty/glfw/source/examples/heightmap.c b/3rdparty/glfw/source/examples/heightmap.c deleted file mode 100644 index ad5d47c..0000000 --- a/3rdparty/glfw/source/examples/heightmap.c +++ /dev/null @@ -1,513 +0,0 @@ -//======================================================================== -// Heightmap example program using OpenGL 3 core profile -// Copyright (c) 2010 Olivier Delannoy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== - -#include -#include -#include -#include -#include - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -/* Map height updates */ -#define MAX_CIRCLE_SIZE (5.0f) -#define MAX_DISPLACEMENT (1.0f) -#define DISPLACEMENT_SIGN_LIMIT (0.3f) -#define MAX_ITER (200) -#define NUM_ITER_AT_A_TIME (1) - -/* Map general information */ -#define MAP_SIZE (10.0f) -#define MAP_NUM_VERTICES (80) -#define MAP_NUM_TOTAL_VERTICES (MAP_NUM_VERTICES*MAP_NUM_VERTICES) -#define MAP_NUM_LINES (3* (MAP_NUM_VERTICES - 1) * (MAP_NUM_VERTICES - 1) + \ - 2 * (MAP_NUM_VERTICES - 1)) - - -/********************************************************************** - * Default shader programs - *********************************************************************/ - -static const char* vertex_shader_text = -"#version 150\n" -"uniform mat4 project;\n" -"uniform mat4 modelview;\n" -"in float x;\n" -"in float y;\n" -"in float z;\n" -"\n" -"void main()\n" -"{\n" -" gl_Position = project * modelview * vec4(x, y, z, 1.0);\n" -"}\n"; - -static const char* fragment_shader_text = -"#version 150\n" -"out vec4 color;\n" -"void main()\n" -"{\n" -" color = vec4(0.2, 1.0, 0.2, 1.0); \n" -"}\n"; - -/********************************************************************** - * Values for shader uniforms - *********************************************************************/ - -/* Frustum configuration */ -static GLfloat view_angle = 45.0f; -static GLfloat aspect_ratio = 4.0f/3.0f; -static GLfloat z_near = 1.0f; -static GLfloat z_far = 100.f; - -/* Projection matrix */ -static GLfloat projection_matrix[16] = { - 1.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f -}; - -/* Model view matrix */ -static GLfloat modelview_matrix[16] = { - 1.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f -}; - -/********************************************************************** - * Heightmap vertex and index data - *********************************************************************/ - -static GLfloat map_vertices[3][MAP_NUM_TOTAL_VERTICES]; -static GLuint map_line_indices[2*MAP_NUM_LINES]; - -/* Store uniform location for the shaders - * Those values are setup as part of the process of creating - * the shader program. They should not be used before creating - * the program. - */ -static GLuint mesh; -static GLuint mesh_vbo[4]; - -/********************************************************************** - * OpenGL helper functions - *********************************************************************/ - -/* Creates a shader object of the specified type using the specified text - */ -static GLuint make_shader(GLenum type, const char* text) -{ - GLuint shader; - GLint shader_ok; - GLsizei log_length; - char info_log[8192]; - - shader = glCreateShader(type); - if (shader != 0) - { - glShaderSource(shader, 1, (const GLchar**)&text, NULL); - glCompileShader(shader); - glGetShaderiv(shader, GL_COMPILE_STATUS, &shader_ok); - if (shader_ok != GL_TRUE) - { - fprintf(stderr, "ERROR: Failed to compile %s shader\n", (type == GL_FRAGMENT_SHADER) ? "fragment" : "vertex" ); - glGetShaderInfoLog(shader, 8192, &log_length,info_log); - fprintf(stderr, "ERROR: \n%s\n\n", info_log); - glDeleteShader(shader); - shader = 0; - } - } - return shader; -} - -/* Creates a program object using the specified vertex and fragment text - */ -static GLuint make_shader_program(const char* vs_text, const char* fs_text) -{ - GLuint program = 0u; - GLint program_ok; - GLuint vertex_shader = 0u; - GLuint fragment_shader = 0u; - GLsizei log_length; - char info_log[8192]; - - vertex_shader = make_shader(GL_VERTEX_SHADER, vs_text); - if (vertex_shader != 0u) - { - fragment_shader = make_shader(GL_FRAGMENT_SHADER, fs_text); - if (fragment_shader != 0u) - { - /* make the program that connect the two shader and link it */ - program = glCreateProgram(); - if (program != 0u) - { - /* attach both shader and link */ - glAttachShader(program, vertex_shader); - glAttachShader(program, fragment_shader); - glLinkProgram(program); - glGetProgramiv(program, GL_LINK_STATUS, &program_ok); - - if (program_ok != GL_TRUE) - { - fprintf(stderr, "ERROR, failed to link shader program\n"); - glGetProgramInfoLog(program, 8192, &log_length, info_log); - fprintf(stderr, "ERROR: \n%s\n\n", info_log); - glDeleteProgram(program); - glDeleteShader(fragment_shader); - glDeleteShader(vertex_shader); - program = 0u; - } - } - } - else - { - fprintf(stderr, "ERROR: Unable to load fragment shader\n"); - glDeleteShader(vertex_shader); - } - } - else - { - fprintf(stderr, "ERROR: Unable to load vertex shader\n"); - } - return program; -} - -/********************************************************************** - * Geometry creation functions - *********************************************************************/ - -/* Generate vertices and indices for the heightmap - */ -static void init_map(void) -{ - int i; - int j; - int k; - GLfloat step = MAP_SIZE / (MAP_NUM_VERTICES - 1); - GLfloat x = 0.0f; - GLfloat z = 0.0f; - /* Create a flat grid */ - k = 0; - for (i = 0 ; i < MAP_NUM_VERTICES ; ++i) - { - for (j = 0 ; j < MAP_NUM_VERTICES ; ++j) - { - map_vertices[0][k] = x; - map_vertices[1][k] = 0.0f; - map_vertices[2][k] = z; - z += step; - ++k; - } - x += step; - z = 0.0f; - } -#if DEBUG_ENABLED - for (i = 0 ; i < MAP_NUM_TOTAL_VERTICES ; ++i) - { - printf ("Vertice %d (%f, %f, %f)\n", - i, map_vertices[0][i], map_vertices[1][i], map_vertices[2][i]); - - } -#endif - /* create indices */ - /* line fan based on i - * i+1 - * | / i + n + 1 - * | / - * |/ - * i --- i + n - */ - - /* close the top of the square */ - k = 0; - for (i = 0 ; i < MAP_NUM_VERTICES -1 ; ++i) - { - map_line_indices[k++] = (i + 1) * MAP_NUM_VERTICES -1; - map_line_indices[k++] = (i + 2) * MAP_NUM_VERTICES -1; - } - /* close the right of the square */ - for (i = 0 ; i < MAP_NUM_VERTICES -1 ; ++i) - { - map_line_indices[k++] = (MAP_NUM_VERTICES - 1) * MAP_NUM_VERTICES + i; - map_line_indices[k++] = (MAP_NUM_VERTICES - 1) * MAP_NUM_VERTICES + i + 1; - } - - for (i = 0 ; i < (MAP_NUM_VERTICES - 1) ; ++i) - { - for (j = 0 ; j < (MAP_NUM_VERTICES - 1) ; ++j) - { - int ref = i * (MAP_NUM_VERTICES) + j; - map_line_indices[k++] = ref; - map_line_indices[k++] = ref + 1; - - map_line_indices[k++] = ref; - map_line_indices[k++] = ref + MAP_NUM_VERTICES; - - map_line_indices[k++] = ref; - map_line_indices[k++] = ref + MAP_NUM_VERTICES + 1; - } - } - -#ifdef DEBUG_ENABLED - for (k = 0 ; k < 2 * MAP_NUM_LINES ; k += 2) - { - int beg, end; - beg = map_line_indices[k]; - end = map_line_indices[k+1]; - printf ("Line %d: %d -> %d (%f, %f, %f) -> (%f, %f, %f)\n", - k / 2, beg, end, - map_vertices[0][beg], map_vertices[1][beg], map_vertices[2][beg], - map_vertices[0][end], map_vertices[1][end], map_vertices[2][end]); - } -#endif -} - -static void generate_heightmap__circle(float* center_x, float* center_y, - float* size, float* displacement) -{ - float sign; - /* random value for element in between [0-1.0] */ - *center_x = (MAP_SIZE * rand()) / (float) RAND_MAX; - *center_y = (MAP_SIZE * rand()) / (float) RAND_MAX; - *size = (MAX_CIRCLE_SIZE * rand()) / (float) RAND_MAX; - sign = (1.0f * rand()) / (float) RAND_MAX; - sign = (sign < DISPLACEMENT_SIGN_LIMIT) ? -1.0f : 1.0f; - *displacement = (sign * (MAX_DISPLACEMENT * rand())) / (float) RAND_MAX; -} - -/* Run the specified number of iterations of the generation process for the - * heightmap - */ -static void update_map(int num_iter) -{ - assert(num_iter > 0); - while(num_iter) - { - /* center of the circle */ - float center_x; - float center_z; - float circle_size; - float disp; - size_t ii; - generate_heightmap__circle(¢er_x, ¢er_z, &circle_size, &disp); - disp = disp / 2.0f; - for (ii = 0u ; ii < MAP_NUM_TOTAL_VERTICES ; ++ii) - { - GLfloat dx = center_x - map_vertices[0][ii]; - GLfloat dz = center_z - map_vertices[2][ii]; - GLfloat pd = (2.0f * (float) sqrt((dx * dx) + (dz * dz))) / circle_size; - if (fabs(pd) <= 1.0f) - { - /* tx,tz is within the circle */ - GLfloat new_height = disp + (float) (cos(pd*3.14f)*disp); - map_vertices[1][ii] += new_height; - } - } - --num_iter; - } -} - -/********************************************************************** - * OpenGL helper functions - *********************************************************************/ - -/* Create VBO, IBO and VAO objects for the heightmap geometry and bind them to - * the specified program object - */ -static void make_mesh(GLuint program) -{ - GLuint attrloc; - - glGenVertexArrays(1, &mesh); - glGenBuffers(4, mesh_vbo); - glBindVertexArray(mesh); - /* Prepare the data for drawing through a buffer inidices */ - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mesh_vbo[3]); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(GLuint)* MAP_NUM_LINES * 2, map_line_indices, GL_STATIC_DRAW); - - /* Prepare the attributes for rendering */ - attrloc = glGetAttribLocation(program, "x"); - glBindBuffer(GL_ARRAY_BUFFER, mesh_vbo[0]); - glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * MAP_NUM_TOTAL_VERTICES, &map_vertices[0][0], GL_STATIC_DRAW); - glEnableVertexAttribArray(attrloc); - glVertexAttribPointer(attrloc, 1, GL_FLOAT, GL_FALSE, 0, 0); - - attrloc = glGetAttribLocation(program, "z"); - glBindBuffer(GL_ARRAY_BUFFER, mesh_vbo[2]); - glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * MAP_NUM_TOTAL_VERTICES, &map_vertices[2][0], GL_STATIC_DRAW); - glEnableVertexAttribArray(attrloc); - glVertexAttribPointer(attrloc, 1, GL_FLOAT, GL_FALSE, 0, 0); - - attrloc = glGetAttribLocation(program, "y"); - glBindBuffer(GL_ARRAY_BUFFER, mesh_vbo[1]); - glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * MAP_NUM_TOTAL_VERTICES, &map_vertices[1][0], GL_DYNAMIC_DRAW); - glEnableVertexAttribArray(attrloc); - glVertexAttribPointer(attrloc, 1, GL_FLOAT, GL_FALSE, 0, 0); -} - -/* Update VBO vertices from source data - */ -static void update_mesh(void) -{ - glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(GLfloat) * MAP_NUM_TOTAL_VERTICES, &map_vertices[1][0]); -} - -/********************************************************************** - * GLFW callback functions - *********************************************************************/ - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - switch(key) - { - case GLFW_KEY_ESCAPE: - /* Exit program on Escape */ - glfwSetWindowShouldClose(window, GLFW_TRUE); - break; - } -} - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -int main(int argc, char** argv) -{ - GLFWwindow* window; - int iter; - double dt; - double last_update_time; - int frame; - float f; - GLint uloc_modelview; - GLint uloc_project; - int width, height; - - GLuint shader_program; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE); - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2); - glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); - glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE); - - window = glfwCreateWindow(800, 600, "GLFW OpenGL3 Heightmap demo", NULL, NULL); - if (! window ) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - /* Register events callback */ - glfwSetKeyCallback(window, key_callback); - - glfwMakeContextCurrent(window); - gladLoadGL(glfwGetProcAddress); - - /* Prepare opengl resources for rendering */ - shader_program = make_shader_program(vertex_shader_text, fragment_shader_text); - - if (shader_program == 0u) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glUseProgram(shader_program); - uloc_project = glGetUniformLocation(shader_program, "project"); - uloc_modelview = glGetUniformLocation(shader_program, "modelview"); - - /* Compute the projection matrix */ - f = 1.0f / tanf(view_angle / 2.0f); - projection_matrix[0] = f / aspect_ratio; - projection_matrix[5] = f; - projection_matrix[10] = (z_far + z_near)/ (z_near - z_far); - projection_matrix[11] = -1.0f; - projection_matrix[14] = 2.0f * (z_far * z_near) / (z_near - z_far); - glUniformMatrix4fv(uloc_project, 1, GL_FALSE, projection_matrix); - - /* Set the camera position */ - modelview_matrix[12] = -5.0f; - modelview_matrix[13] = -5.0f; - modelview_matrix[14] = -20.0f; - glUniformMatrix4fv(uloc_modelview, 1, GL_FALSE, modelview_matrix); - - /* Create mesh data */ - init_map(); - make_mesh(shader_program); - - /* Create vao + vbo to store the mesh */ - /* Create the vbo to store all the information for the grid and the height */ - - /* setup the scene ready for rendering */ - glfwGetFramebufferSize(window, &width, &height); - glViewport(0, 0, width, height); - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - - /* main loop */ - frame = 0; - iter = 0; - last_update_time = glfwGetTime(); - - while (!glfwWindowShouldClose(window)) - { - ++frame; - /* render the next frame */ - glClear(GL_COLOR_BUFFER_BIT); - glDrawElements(GL_LINES, 2* MAP_NUM_LINES , GL_UNSIGNED_INT, 0); - - /* display and process events through callbacks */ - glfwSwapBuffers(window); - glfwPollEvents(); - /* Check the frame rate and update the heightmap if needed */ - dt = glfwGetTime(); - if ((dt - last_update_time) > 0.2) - { - /* generate the next iteration of the heightmap */ - if (iter < MAX_ITER) - { - update_map(NUM_ITER_AT_A_TIME); - update_mesh(); - iter += NUM_ITER_AT_A_TIME; - } - last_update_time = dt; - frame = 0; - } - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/3rdparty/glfw/source/examples/offscreen.c b/3rdparty/glfw/source/examples/offscreen.c deleted file mode 100644 index b7cd2fd..0000000 --- a/3rdparty/glfw/source/examples/offscreen.c +++ /dev/null @@ -1,178 +0,0 @@ -//======================================================================== -// Offscreen rendering example -// Copyright (c) Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#if USE_NATIVE_OSMESA - #define GLFW_EXPOSE_NATIVE_OSMESA - #include -#endif - -#include "linmath.h" - -#include -#include - -#define STB_IMAGE_WRITE_IMPLEMENTATION -#include - -static const struct -{ - float x, y; - float r, g, b; -} vertices[3] = -{ - { -0.6f, -0.4f, 1.f, 0.f, 0.f }, - { 0.6f, -0.4f, 0.f, 1.f, 0.f }, - { 0.f, 0.6f, 0.f, 0.f, 1.f } -}; - -static const char* vertex_shader_text = -"#version 110\n" -"uniform mat4 MVP;\n" -"attribute vec3 vCol;\n" -"attribute vec2 vPos;\n" -"varying vec3 color;\n" -"void main()\n" -"{\n" -" gl_Position = MVP * vec4(vPos, 0.0, 1.0);\n" -" color = vCol;\n" -"}\n"; - -static const char* fragment_shader_text = -"#version 110\n" -"varying vec3 color;\n" -"void main()\n" -"{\n" -" gl_FragColor = vec4(color, 1.0);\n" -"}\n"; - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -int main(void) -{ - GLFWwindow* window; - GLuint vertex_buffer, vertex_shader, fragment_shader, program; - GLint mvp_location, vpos_location, vcol_location; - float ratio; - int width, height; - mat4x4 mvp; - char* buffer; - - glfwSetErrorCallback(error_callback); - - glfwInitHint(GLFW_COCOA_MENUBAR, GLFW_FALSE); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); - glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE); - - window = glfwCreateWindow(640, 480, "Simple example", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - gladLoadGL(glfwGetProcAddress); - - // NOTE: OpenGL error checks have been omitted for brevity - - glGenBuffers(1, &vertex_buffer); - glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer); - glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW); - - vertex_shader = glCreateShader(GL_VERTEX_SHADER); - glShaderSource(vertex_shader, 1, &vertex_shader_text, NULL); - glCompileShader(vertex_shader); - - fragment_shader = glCreateShader(GL_FRAGMENT_SHADER); - glShaderSource(fragment_shader, 1, &fragment_shader_text, NULL); - glCompileShader(fragment_shader); - - program = glCreateProgram(); - glAttachShader(program, vertex_shader); - glAttachShader(program, fragment_shader); - glLinkProgram(program); - - mvp_location = glGetUniformLocation(program, "MVP"); - vpos_location = glGetAttribLocation(program, "vPos"); - vcol_location = glGetAttribLocation(program, "vCol"); - - glEnableVertexAttribArray(vpos_location); - glVertexAttribPointer(vpos_location, 2, GL_FLOAT, GL_FALSE, - sizeof(vertices[0]), (void*) 0); - glEnableVertexAttribArray(vcol_location); - glVertexAttribPointer(vcol_location, 3, GL_FLOAT, GL_FALSE, - sizeof(vertices[0]), (void*) (sizeof(float) * 2)); - - glfwGetFramebufferSize(window, &width, &height); - ratio = width / (float) height; - - glViewport(0, 0, width, height); - glClear(GL_COLOR_BUFFER_BIT); - - mat4x4_ortho(mvp, -ratio, ratio, -1.f, 1.f, 1.f, -1.f); - - glUseProgram(program); - glUniformMatrix4fv(mvp_location, 1, GL_FALSE, (const GLfloat*) mvp); - glDrawArrays(GL_TRIANGLES, 0, 3); - glFinish(); - -#if USE_NATIVE_OSMESA - glfwGetOSMesaColorBuffer(window, &width, &height, NULL, (void**) &buffer); -#else - buffer = calloc(4, width * height); - glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, buffer); -#endif - - // Write image Y-flipped because OpenGL - stbi_write_png("offscreen.png", - width, height, 4, - buffer + (width * 4 * (height - 1)), - -width * 4); - -#if USE_NATIVE_OSMESA - // Here is where there's nothing -#else - free(buffer); -#endif - - glfwDestroyWindow(window); - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/3rdparty/glfw/source/examples/particles.c b/3rdparty/glfw/source/examples/particles.c deleted file mode 100644 index baafe82..0000000 --- a/3rdparty/glfw/source/examples/particles.c +++ /dev/null @@ -1,1074 +0,0 @@ -//======================================================================== -// A simple particle engine with threaded physics -// Copyright (c) Marcus Geelnard -// Copyright (c) Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== - -#if defined(_MSC_VER) - // Make MS math.h define M_PI - #define _USE_MATH_DEFINES -#endif - -#include -#include -#include -#include -#include - -#include -#include -#include - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -// Define tokens for GL_EXT_separate_specular_color if not already defined -#ifndef GL_EXT_separate_specular_color -#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 -#define GL_SINGLE_COLOR_EXT 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA -#endif // GL_EXT_separate_specular_color - - -//======================================================================== -// Type definitions -//======================================================================== - -typedef struct -{ - float x, y, z; -} Vec3; - -// This structure is used for interleaved vertex arrays (see the -// draw_particles function) -// -// NOTE: This structure SHOULD be packed on most systems. It uses 32-bit fields -// on 32-bit boundaries, and is a multiple of 64 bits in total (6x32=3x64). If -// it does not work, try using pragmas or whatever to force the structure to be -// packed. -typedef struct -{ - GLfloat s, t; // Texture coordinates - GLuint rgba; // Color (four ubytes packed into an uint) - GLfloat x, y, z; // Vertex coordinates -} Vertex; - - -//======================================================================== -// Program control global variables -//======================================================================== - -// Window dimensions -float aspect_ratio; - -// "wireframe" flag (true if we use wireframe view) -int wireframe; - -// Thread synchronization -struct { - double t; // Time (s) - float dt; // Time since last frame (s) - int p_frame; // Particle physics frame number - int d_frame; // Particle draw frame number - cnd_t p_done; // Condition: particle physics done - cnd_t d_done; // Condition: particle draw done - mtx_t particles_lock; // Particles data sharing mutex -} thread_sync; - - -//======================================================================== -// Texture declarations (we hard-code them into the source code, since -// they are so simple) -//======================================================================== - -#define P_TEX_WIDTH 8 // Particle texture dimensions -#define P_TEX_HEIGHT 8 -#define F_TEX_WIDTH 16 // Floor texture dimensions -#define F_TEX_HEIGHT 16 - -// Texture object IDs -GLuint particle_tex_id, floor_tex_id; - -// Particle texture (a simple spot) -const unsigned char particle_texture[ P_TEX_WIDTH * P_TEX_HEIGHT ] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x11, 0x22, 0x22, 0x11, 0x00, 0x00, - 0x00, 0x11, 0x33, 0x88, 0x77, 0x33, 0x11, 0x00, - 0x00, 0x22, 0x88, 0xff, 0xee, 0x77, 0x22, 0x00, - 0x00, 0x22, 0x77, 0xee, 0xff, 0x88, 0x22, 0x00, - 0x00, 0x11, 0x33, 0x77, 0x88, 0x33, 0x11, 0x00, - 0x00, 0x00, 0x11, 0x33, 0x22, 0x11, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -// Floor texture (your basic checkered floor) -const unsigned char floor_texture[ F_TEX_WIDTH * F_TEX_HEIGHT ] = { - 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0xff, 0xf0, 0xcc, 0xf0, 0xf0, 0xf0, 0xff, 0xf0, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0xf0, 0xcc, 0xee, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0x30, 0x66, 0x30, 0x30, 0x30, 0x20, 0x30, 0x30, - 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xee, 0xf0, 0xf0, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0xf0, 0xf0, 0xf0, 0xf0, 0xcc, 0xf0, 0xf0, 0xf0, 0x30, 0x30, 0x55, 0x30, 0x30, 0x44, 0x30, 0x30, - 0xf0, 0xdd, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x33, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xf0, 0xf0, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x60, 0x30, - 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x33, 0x33, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x33, 0x30, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, 0x30, 0x30, 0xf0, 0xff, 0xf0, 0xf0, 0xdd, 0xf0, 0xf0, 0xff, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x55, 0x33, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xff, 0xf0, 0xf0, - 0x30, 0x44, 0x66, 0x30, 0x30, 0x30, 0x30, 0x30, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0xf0, 0xf0, 0xf0, 0xaa, 0xf0, 0xf0, 0xcc, 0xf0, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0xff, 0xf0, 0xf0, 0xf0, 0xff, 0xf0, 0xdd, 0xf0, - 0x30, 0x30, 0x30, 0x77, 0x30, 0x30, 0x30, 0x30, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, -}; - - -//======================================================================== -// These are fixed constants that control the particle engine. In a -// modular world, these values should be variables... -//======================================================================== - -// Maximum number of particles -#define MAX_PARTICLES 3000 - -// Life span of a particle (in seconds) -#define LIFE_SPAN 8.f - -// A new particle is born every [BIRTH_INTERVAL] second -#define BIRTH_INTERVAL (LIFE_SPAN/(float)MAX_PARTICLES) - -// Particle size (meters) -#define PARTICLE_SIZE 0.7f - -// Gravitational constant (m/s^2) -#define GRAVITY 9.8f - -// Base initial velocity (m/s) -#define VELOCITY 8.f - -// Bounce friction (1.0 = no friction, 0.0 = maximum friction) -#define FRICTION 0.75f - -// "Fountain" height (m) -#define FOUNTAIN_HEIGHT 3.f - -// Fountain radius (m) -#define FOUNTAIN_RADIUS 1.6f - -// Minimum delta-time for particle phisics (s) -#define MIN_DELTA_T (BIRTH_INTERVAL * 0.5f) - - -//======================================================================== -// Particle system global variables -//======================================================================== - -// This structure holds all state for a single particle -typedef struct { - float x,y,z; // Position in space - float vx,vy,vz; // Velocity vector - float r,g,b; // Color of particle - float life; // Life of particle (1.0 = newborn, < 0.0 = dead) - int active; // Tells if this particle is active -} PARTICLE; - -// Global vectors holding all particles. We use two vectors for double -// buffering. -static PARTICLE particles[MAX_PARTICLES]; - -// Global variable holding the age of the youngest particle -static float min_age; - -// Color of latest born particle (used for fountain lighting) -static float glow_color[4]; - -// Position of latest born particle (used for fountain lighting) -static float glow_pos[4]; - - -//======================================================================== -// Object material and fog configuration constants -//======================================================================== - -const GLfloat fountain_diffuse[4] = { 0.7f, 1.f, 1.f, 1.f }; -const GLfloat fountain_specular[4] = { 1.f, 1.f, 1.f, 1.f }; -const GLfloat fountain_shininess = 12.f; -const GLfloat floor_diffuse[4] = { 1.f, 0.6f, 0.6f, 1.f }; -const GLfloat floor_specular[4] = { 0.6f, 0.6f, 0.6f, 1.f }; -const GLfloat floor_shininess = 18.f; -const GLfloat fog_color[4] = { 0.1f, 0.1f, 0.1f, 1.f }; - - -//======================================================================== -// Print usage information -//======================================================================== - -static void usage(void) -{ - printf("Usage: particles [-bfhs]\n"); - printf("Options:\n"); - printf(" -f Run in full screen\n"); - printf(" -h Display this help\n"); - printf(" -s Run program as single thread (default is to use two threads)\n"); - printf("\n"); - printf("Program runtime controls:\n"); - printf(" W Toggle wireframe mode\n"); - printf(" Esc Exit program\n"); -} - - -//======================================================================== -// Initialize a new particle -//======================================================================== - -static void init_particle(PARTICLE *p, double t) -{ - float xy_angle, velocity; - - // Start position of particle is at the fountain blow-out - p->x = 0.f; - p->y = 0.f; - p->z = FOUNTAIN_HEIGHT; - - // Start velocity is up (Z)... - p->vz = 0.7f + (0.3f / 4096.f) * (float) (rand() & 4095); - - // ...and a randomly chosen X/Y direction - xy_angle = (2.f * (float) M_PI / 4096.f) * (float) (rand() & 4095); - p->vx = 0.4f * (float) cos(xy_angle); - p->vy = 0.4f * (float) sin(xy_angle); - - // Scale velocity vector according to a time-varying velocity - velocity = VELOCITY * (0.8f + 0.1f * (float) (sin(0.5 * t) + sin(1.31 * t))); - p->vx *= velocity; - p->vy *= velocity; - p->vz *= velocity; - - // Color is time-varying - p->r = 0.7f + 0.3f * (float) sin(0.34 * t + 0.1); - p->g = 0.6f + 0.4f * (float) sin(0.63 * t + 1.1); - p->b = 0.6f + 0.4f * (float) sin(0.91 * t + 2.1); - - // Store settings for fountain glow lighting - glow_pos[0] = 0.4f * (float) sin(1.34 * t); - glow_pos[1] = 0.4f * (float) sin(3.11 * t); - glow_pos[2] = FOUNTAIN_HEIGHT + 1.f; - glow_pos[3] = 1.f; - glow_color[0] = p->r; - glow_color[1] = p->g; - glow_color[2] = p->b; - glow_color[3] = 1.f; - - // The particle is new-born and active - p->life = 1.f; - p->active = 1; -} - - -//======================================================================== -// Update a particle -//======================================================================== - -#define FOUNTAIN_R2 (FOUNTAIN_RADIUS+PARTICLE_SIZE/2)*(FOUNTAIN_RADIUS+PARTICLE_SIZE/2) - -static void update_particle(PARTICLE *p, float dt) -{ - // If the particle is not active, we need not do anything - if (!p->active) - return; - - // The particle is getting older... - p->life -= dt * (1.f / LIFE_SPAN); - - // Did the particle die? - if (p->life <= 0.f) - { - p->active = 0; - return; - } - - // Apply gravity - p->vz = p->vz - GRAVITY * dt; - - // Update particle position - p->x = p->x + p->vx * dt; - p->y = p->y + p->vy * dt; - p->z = p->z + p->vz * dt; - - // Simple collision detection + response - if (p->vz < 0.f) - { - // Particles should bounce on the fountain (with friction) - if ((p->x * p->x + p->y * p->y) < FOUNTAIN_R2 && - p->z < (FOUNTAIN_HEIGHT + PARTICLE_SIZE / 2)) - { - p->vz = -FRICTION * p->vz; - p->z = FOUNTAIN_HEIGHT + PARTICLE_SIZE / 2 + - FRICTION * (FOUNTAIN_HEIGHT + - PARTICLE_SIZE / 2 - p->z); - } - - // Particles should bounce on the floor (with friction) - else if (p->z < PARTICLE_SIZE / 2) - { - p->vz = -FRICTION * p->vz; - p->z = PARTICLE_SIZE / 2 + - FRICTION * (PARTICLE_SIZE / 2 - p->z); - } - } -} - - -//======================================================================== -// The main frame for the particle engine. Called once per frame. -//======================================================================== - -static void particle_engine(double t, float dt) -{ - int i; - float dt2; - - // Update particles (iterated several times per frame if dt is too large) - while (dt > 0.f) - { - // Calculate delta time for this iteration - dt2 = dt < MIN_DELTA_T ? dt : MIN_DELTA_T; - - for (i = 0; i < MAX_PARTICLES; i++) - update_particle(&particles[i], dt2); - - min_age += dt2; - - // Should we create any new particle(s)? - while (min_age >= BIRTH_INTERVAL) - { - min_age -= BIRTH_INTERVAL; - - // Find a dead particle to replace with a new one - for (i = 0; i < MAX_PARTICLES; i++) - { - if (!particles[i].active) - { - init_particle(&particles[i], t + min_age); - update_particle(&particles[i], min_age); - break; - } - } - } - - dt -= dt2; - } -} - - -//======================================================================== -// Draw all active particles. We use OpenGL 1.1 vertex -// arrays for this in order to accelerate the drawing. -//======================================================================== - -#define BATCH_PARTICLES 70 // Number of particles to draw in each batch - // (70 corresponds to 7.5 KB = will not blow - // the L1 data cache on most CPUs) -#define PARTICLE_VERTS 4 // Number of vertices per particle - -static void draw_particles(GLFWwindow* window, double t, float dt) -{ - int i, particle_count; - Vertex vertex_array[BATCH_PARTICLES * PARTICLE_VERTS]; - Vertex* vptr; - float alpha; - GLuint rgba; - Vec3 quad_lower_left, quad_lower_right; - GLfloat mat[16]; - PARTICLE* pptr; - - // Here comes the real trick with flat single primitive objects (s.c. - // "billboards"): We must rotate the textured primitive so that it - // always faces the viewer (is coplanar with the view-plane). - // We: - // 1) Create the primitive around origo (0,0,0) - // 2) Rotate it so that it is coplanar with the view plane - // 3) Translate it according to the particle position - // Note that 1) and 2) is the same for all particles (done only once). - - // Get modelview matrix. We will only use the upper left 3x3 part of - // the matrix, which represents the rotation. - glGetFloatv(GL_MODELVIEW_MATRIX, mat); - - // 1) & 2) We do it in one swift step: - // Although not obvious, the following six lines represent two matrix/ - // vector multiplications. The matrix is the inverse 3x3 rotation - // matrix (i.e. the transpose of the same matrix), and the two vectors - // represent the lower left corner of the quad, PARTICLE_SIZE/2 * - // (-1,-1,0), and the lower right corner, PARTICLE_SIZE/2 * (1,-1,0). - // The upper left/right corners of the quad is always the negative of - // the opposite corners (regardless of rotation). - quad_lower_left.x = (-PARTICLE_SIZE / 2) * (mat[0] + mat[1]); - quad_lower_left.y = (-PARTICLE_SIZE / 2) * (mat[4] + mat[5]); - quad_lower_left.z = (-PARTICLE_SIZE / 2) * (mat[8] + mat[9]); - quad_lower_right.x = (PARTICLE_SIZE / 2) * (mat[0] - mat[1]); - quad_lower_right.y = (PARTICLE_SIZE / 2) * (mat[4] - mat[5]); - quad_lower_right.z = (PARTICLE_SIZE / 2) * (mat[8] - mat[9]); - - // Don't update z-buffer, since all particles are transparent! - glDepthMask(GL_FALSE); - - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE); - - // Select particle texture - if (!wireframe) - { - glEnable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, particle_tex_id); - } - - // Set up vertex arrays. We use interleaved arrays, which is easier to - // handle (in most situations) and it gives a linear memory access - // access pattern (which may give better performance in some - // situations). GL_T2F_C4UB_V3F means: 2 floats for texture coords, - // 4 ubytes for color and 3 floats for vertex coord (in that order). - // Most OpenGL cards / drivers are optimized for this format. - glInterleavedArrays(GL_T2F_C4UB_V3F, 0, vertex_array); - - // Wait for particle physics thread to be done - mtx_lock(&thread_sync.particles_lock); - while (!glfwWindowShouldClose(window) && - thread_sync.p_frame <= thread_sync.d_frame) - { - struct timespec ts; - clock_gettime(CLOCK_REALTIME, &ts); - ts.tv_nsec += 100 * 1000 * 1000; - ts.tv_sec += ts.tv_nsec / (1000 * 1000 * 1000); - ts.tv_nsec %= 1000 * 1000 * 1000; - cnd_timedwait(&thread_sync.p_done, &thread_sync.particles_lock, &ts); - } - - // Store the frame time and delta time for the physics thread - thread_sync.t = t; - thread_sync.dt = dt; - - // Update frame counter - thread_sync.d_frame++; - - // Loop through all particles and build vertex arrays. - particle_count = 0; - vptr = vertex_array; - pptr = particles; - - for (i = 0; i < MAX_PARTICLES; i++) - { - if (pptr->active) - { - // Calculate particle intensity (we set it to max during 75% - // of its life, then it fades out) - alpha = 4.f * pptr->life; - if (alpha > 1.f) - alpha = 1.f; - - // Convert color from float to 8-bit (store it in a 32-bit - // integer using endian independent type casting) - ((GLubyte*) &rgba)[0] = (GLubyte)(pptr->r * 255.f); - ((GLubyte*) &rgba)[1] = (GLubyte)(pptr->g * 255.f); - ((GLubyte*) &rgba)[2] = (GLubyte)(pptr->b * 255.f); - ((GLubyte*) &rgba)[3] = (GLubyte)(alpha * 255.f); - - // 3) Translate the quad to the correct position in modelview - // space and store its parameters in vertex arrays (we also - // store texture coord and color information for each vertex). - - // Lower left corner - vptr->s = 0.f; - vptr->t = 0.f; - vptr->rgba = rgba; - vptr->x = pptr->x + quad_lower_left.x; - vptr->y = pptr->y + quad_lower_left.y; - vptr->z = pptr->z + quad_lower_left.z; - vptr ++; - - // Lower right corner - vptr->s = 1.f; - vptr->t = 0.f; - vptr->rgba = rgba; - vptr->x = pptr->x + quad_lower_right.x; - vptr->y = pptr->y + quad_lower_right.y; - vptr->z = pptr->z + quad_lower_right.z; - vptr ++; - - // Upper right corner - vptr->s = 1.f; - vptr->t = 1.f; - vptr->rgba = rgba; - vptr->x = pptr->x - quad_lower_left.x; - vptr->y = pptr->y - quad_lower_left.y; - vptr->z = pptr->z - quad_lower_left.z; - vptr ++; - - // Upper left corner - vptr->s = 0.f; - vptr->t = 1.f; - vptr->rgba = rgba; - vptr->x = pptr->x - quad_lower_right.x; - vptr->y = pptr->y - quad_lower_right.y; - vptr->z = pptr->z - quad_lower_right.z; - vptr ++; - - // Increase count of drawable particles - particle_count ++; - } - - // If we have filled up one batch of particles, draw it as a set - // of quads using glDrawArrays. - if (particle_count >= BATCH_PARTICLES) - { - // The first argument tells which primitive type we use (QUAD) - // The second argument tells the index of the first vertex (0) - // The last argument is the vertex count - glDrawArrays(GL_QUADS, 0, PARTICLE_VERTS * particle_count); - particle_count = 0; - vptr = vertex_array; - } - - // Next particle - pptr++; - } - - // We are done with the particle data - mtx_unlock(&thread_sync.particles_lock); - cnd_signal(&thread_sync.d_done); - - // Draw final batch of particles (if any) - glDrawArrays(GL_QUADS, 0, PARTICLE_VERTS * particle_count); - - // Disable vertex arrays (Note: glInterleavedArrays implicitly called - // glEnableClientState for vertex, texture coord and color arrays) - glDisableClientState(GL_VERTEX_ARRAY); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - glDisableClientState(GL_COLOR_ARRAY); - - glDisable(GL_TEXTURE_2D); - glDisable(GL_BLEND); - - glDepthMask(GL_TRUE); -} - - -//======================================================================== -// Fountain geometry specification -//======================================================================== - -#define FOUNTAIN_SIDE_POINTS 14 -#define FOUNTAIN_SWEEP_STEPS 32 - -static const float fountain_side[FOUNTAIN_SIDE_POINTS * 2] = -{ - 1.2f, 0.f, 1.f, 0.2f, 0.41f, 0.3f, 0.4f, 0.35f, - 0.4f, 1.95f, 0.41f, 2.f, 0.8f, 2.2f, 1.2f, 2.4f, - 1.5f, 2.7f, 1.55f,2.95f, 1.6f, 3.f, 1.f, 3.f, - 0.5f, 3.f, 0.f, 3.f -}; - -static const float fountain_normal[FOUNTAIN_SIDE_POINTS * 2] = -{ - 1.0000f, 0.0000f, 0.6428f, 0.7660f, 0.3420f, 0.9397f, 1.0000f, 0.0000f, - 1.0000f, 0.0000f, 0.3420f,-0.9397f, 0.4226f,-0.9063f, 0.5000f,-0.8660f, - 0.7660f,-0.6428f, 0.9063f,-0.4226f, 0.0000f,1.00000f, 0.0000f,1.00000f, - 0.0000f,1.00000f, 0.0000f,1.00000f -}; - - -//======================================================================== -// Draw a fountain -//======================================================================== - -static void draw_fountain(void) -{ - static GLuint fountain_list = 0; - double angle; - float x, y; - int m, n; - - // The first time, we build the fountain display list - if (!fountain_list) - { - fountain_list = glGenLists(1); - glNewList(fountain_list, GL_COMPILE_AND_EXECUTE); - - glMaterialfv(GL_FRONT, GL_DIFFUSE, fountain_diffuse); - glMaterialfv(GL_FRONT, GL_SPECULAR, fountain_specular); - glMaterialf(GL_FRONT, GL_SHININESS, fountain_shininess); - - // Build fountain using triangle strips - for (n = 0; n < FOUNTAIN_SIDE_POINTS - 1; n++) - { - glBegin(GL_TRIANGLE_STRIP); - for (m = 0; m <= FOUNTAIN_SWEEP_STEPS; m++) - { - angle = (double) m * (2.0 * M_PI / (double) FOUNTAIN_SWEEP_STEPS); - x = (float) cos(angle); - y = (float) sin(angle); - - // Draw triangle strip - glNormal3f(x * fountain_normal[n * 2 + 2], - y * fountain_normal[n * 2 + 2], - fountain_normal[n * 2 + 3]); - glVertex3f(x * fountain_side[n * 2 + 2], - y * fountain_side[n * 2 + 2], - fountain_side[n * 2 +3 ]); - glNormal3f(x * fountain_normal[n * 2], - y * fountain_normal[n * 2], - fountain_normal[n * 2 + 1]); - glVertex3f(x * fountain_side[n * 2], - y * fountain_side[n * 2], - fountain_side[n * 2 + 1]); - } - - glEnd(); - } - - glEndList(); - } - else - glCallList(fountain_list); -} - - -//======================================================================== -// Recursive function for building variable tessellated floor -//======================================================================== - -static void tessellate_floor(float x1, float y1, float x2, float y2, int depth) -{ - float delta, x, y; - - // Last recursion? - if (depth >= 5) - delta = 999999.f; - else - { - x = (float) (fabs(x1) < fabs(x2) ? fabs(x1) : fabs(x2)); - y = (float) (fabs(y1) < fabs(y2) ? fabs(y1) : fabs(y2)); - delta = x*x + y*y; - } - - // Recurse further? - if (delta < 0.1f) - { - x = (x1 + x2) * 0.5f; - y = (y1 + y2) * 0.5f; - tessellate_floor(x1, y1, x, y, depth + 1); - tessellate_floor(x, y1, x2, y, depth + 1); - tessellate_floor(x1, y, x, y2, depth + 1); - tessellate_floor(x, y, x2, y2, depth + 1); - } - else - { - glTexCoord2f(x1 * 30.f, y1 * 30.f); - glVertex3f( x1 * 80.f, y1 * 80.f, 0.f); - glTexCoord2f(x2 * 30.f, y1 * 30.f); - glVertex3f( x2 * 80.f, y1 * 80.f, 0.f); - glTexCoord2f(x2 * 30.f, y2 * 30.f); - glVertex3f( x2 * 80.f, y2 * 80.f, 0.f); - glTexCoord2f(x1 * 30.f, y2 * 30.f); - glVertex3f( x1 * 80.f, y2 * 80.f, 0.f); - } -} - - -//======================================================================== -// Draw floor. We build the floor recursively and let the tessellation in the -// center (near x,y=0,0) be high, while the tessellation around the edges be -// low. -//======================================================================== - -static void draw_floor(void) -{ - static GLuint floor_list = 0; - - if (!wireframe) - { - glEnable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, floor_tex_id); - } - - // The first time, we build the floor display list - if (!floor_list) - { - floor_list = glGenLists(1); - glNewList(floor_list, GL_COMPILE_AND_EXECUTE); - - glMaterialfv(GL_FRONT, GL_DIFFUSE, floor_diffuse); - glMaterialfv(GL_FRONT, GL_SPECULAR, floor_specular); - glMaterialf(GL_FRONT, GL_SHININESS, floor_shininess); - - // Draw floor as a bunch of triangle strips (high tessellation - // improves lighting) - glNormal3f(0.f, 0.f, 1.f); - glBegin(GL_QUADS); - tessellate_floor(-1.f, -1.f, 0.f, 0.f, 0); - tessellate_floor( 0.f, -1.f, 1.f, 0.f, 0); - tessellate_floor( 0.f, 0.f, 1.f, 1.f, 0); - tessellate_floor(-1.f, 0.f, 0.f, 1.f, 0); - glEnd(); - - glEndList(); - } - else - glCallList(floor_list); - - glDisable(GL_TEXTURE_2D); - -} - - -//======================================================================== -// Position and configure light sources -//======================================================================== - -static void setup_lights(void) -{ - float l1pos[4], l1amb[4], l1dif[4], l1spec[4]; - float l2pos[4], l2amb[4], l2dif[4], l2spec[4]; - - // Set light source 1 parameters - l1pos[0] = 0.f; l1pos[1] = -9.f; l1pos[2] = 8.f; l1pos[3] = 1.f; - l1amb[0] = 0.2f; l1amb[1] = 0.2f; l1amb[2] = 0.2f; l1amb[3] = 1.f; - l1dif[0] = 0.8f; l1dif[1] = 0.4f; l1dif[2] = 0.2f; l1dif[3] = 1.f; - l1spec[0] = 1.f; l1spec[1] = 0.6f; l1spec[2] = 0.2f; l1spec[3] = 0.f; - - // Set light source 2 parameters - l2pos[0] = -15.f; l2pos[1] = 12.f; l2pos[2] = 1.5f; l2pos[3] = 1.f; - l2amb[0] = 0.f; l2amb[1] = 0.f; l2amb[2] = 0.f; l2amb[3] = 1.f; - l2dif[0] = 0.2f; l2dif[1] = 0.4f; l2dif[2] = 0.8f; l2dif[3] = 1.f; - l2spec[0] = 0.2f; l2spec[1] = 0.6f; l2spec[2] = 1.f; l2spec[3] = 0.f; - - glLightfv(GL_LIGHT1, GL_POSITION, l1pos); - glLightfv(GL_LIGHT1, GL_AMBIENT, l1amb); - glLightfv(GL_LIGHT1, GL_DIFFUSE, l1dif); - glLightfv(GL_LIGHT1, GL_SPECULAR, l1spec); - glLightfv(GL_LIGHT2, GL_POSITION, l2pos); - glLightfv(GL_LIGHT2, GL_AMBIENT, l2amb); - glLightfv(GL_LIGHT2, GL_DIFFUSE, l2dif); - glLightfv(GL_LIGHT2, GL_SPECULAR, l2spec); - glLightfv(GL_LIGHT3, GL_POSITION, glow_pos); - glLightfv(GL_LIGHT3, GL_DIFFUSE, glow_color); - glLightfv(GL_LIGHT3, GL_SPECULAR, glow_color); - - glEnable(GL_LIGHT1); - glEnable(GL_LIGHT2); - glEnable(GL_LIGHT3); -} - - -//======================================================================== -// Main rendering function -//======================================================================== - -static void draw_scene(GLFWwindow* window, double t) -{ - double xpos, ypos, zpos, angle_x, angle_y, angle_z; - static double t_old = 0.0; - float dt; - mat4x4 projection; - - // Calculate frame-to-frame delta time - dt = (float) (t - t_old); - t_old = t; - - mat4x4_perspective(projection, - 65.f * (float) M_PI / 180.f, - aspect_ratio, - 1.0, 60.0); - - glClearColor(0.1f, 0.1f, 0.1f, 1.f); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - glMatrixMode(GL_PROJECTION); - glLoadMatrixf((const GLfloat*) projection); - - // Setup camera - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - - // Rotate camera - angle_x = 90.0 - 10.0; - angle_y = 10.0 * sin(0.3 * t); - angle_z = 10.0 * t; - glRotated(-angle_x, 1.0, 0.0, 0.0); - glRotated(-angle_y, 0.0, 1.0, 0.0); - glRotated(-angle_z, 0.0, 0.0, 1.0); - - // Translate camera - xpos = 15.0 * sin((M_PI / 180.0) * angle_z) + - 2.0 * sin((M_PI / 180.0) * 3.1 * t); - ypos = -15.0 * cos((M_PI / 180.0) * angle_z) + - 2.0 * cos((M_PI / 180.0) * 2.9 * t); - zpos = 4.0 + 2.0 * cos((M_PI / 180.0) * 4.9 * t); - glTranslated(-xpos, -ypos, -zpos); - - glFrontFace(GL_CCW); - glCullFace(GL_BACK); - glEnable(GL_CULL_FACE); - - setup_lights(); - glEnable(GL_LIGHTING); - - glEnable(GL_FOG); - glFogi(GL_FOG_MODE, GL_EXP); - glFogf(GL_FOG_DENSITY, 0.05f); - glFogfv(GL_FOG_COLOR, fog_color); - - draw_floor(); - - glEnable(GL_DEPTH_TEST); - glDepthFunc(GL_LEQUAL); - glDepthMask(GL_TRUE); - - draw_fountain(); - - glDisable(GL_LIGHTING); - glDisable(GL_FOG); - - // Particles must be drawn after all solid objects have been drawn - draw_particles(window, t, dt); - - // Z-buffer not needed anymore - glDisable(GL_DEPTH_TEST); -} - - -//======================================================================== -// Window resize callback function -//======================================================================== - -static void resize_callback(GLFWwindow* window, int width, int height) -{ - glViewport(0, 0, width, height); - aspect_ratio = height ? width / (float) height : 1.f; -} - - -//======================================================================== -// Key callback functions -//======================================================================== - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action == GLFW_PRESS) - { - switch (key) - { - case GLFW_KEY_ESCAPE: - glfwSetWindowShouldClose(window, GLFW_TRUE); - break; - case GLFW_KEY_W: - wireframe = !wireframe; - glPolygonMode(GL_FRONT_AND_BACK, - wireframe ? GL_LINE : GL_FILL); - break; - default: - break; - } - } -} - - -//======================================================================== -// Thread for updating particle physics -//======================================================================== - -static int physics_thread_main(void* arg) -{ - GLFWwindow* window = arg; - - for (;;) - { - mtx_lock(&thread_sync.particles_lock); - - // Wait for particle drawing to be done - while (!glfwWindowShouldClose(window) && - thread_sync.p_frame > thread_sync.d_frame) - { - struct timespec ts; - clock_gettime(CLOCK_REALTIME, &ts); - ts.tv_nsec += 100 * 1000 * 1000; - ts.tv_sec += ts.tv_nsec / (1000 * 1000 * 1000); - ts.tv_nsec %= 1000 * 1000 * 1000; - cnd_timedwait(&thread_sync.d_done, &thread_sync.particles_lock, &ts); - } - - if (glfwWindowShouldClose(window)) - break; - - // Update particles - particle_engine(thread_sync.t, thread_sync.dt); - - // Update frame counter - thread_sync.p_frame++; - - // Unlock mutex and signal drawing thread - mtx_unlock(&thread_sync.particles_lock); - cnd_signal(&thread_sync.p_done); - } - - return 0; -} - - -//======================================================================== -// main -//======================================================================== - -int main(int argc, char** argv) -{ - int ch, width, height; - thrd_t physics_thread = 0; - GLFWwindow* window; - GLFWmonitor* monitor = NULL; - - if (!glfwInit()) - { - fprintf(stderr, "Failed to initialize GLFW\n"); - exit(EXIT_FAILURE); - } - - while ((ch = getopt(argc, argv, "fh")) != -1) - { - switch (ch) - { - case 'f': - monitor = glfwGetPrimaryMonitor(); - break; - case 'h': - usage(); - exit(EXIT_SUCCESS); - } - } - - if (monitor) - { - const GLFWvidmode* mode = glfwGetVideoMode(monitor); - - glfwWindowHint(GLFW_RED_BITS, mode->redBits); - glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits); - glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits); - glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate); - - width = mode->width; - height = mode->height; - } - else - { - width = 640; - height = 480; - } - - window = glfwCreateWindow(width, height, "Particle Engine", monitor, NULL); - if (!window) - { - fprintf(stderr, "Failed to create GLFW window\n"); - glfwTerminate(); - exit(EXIT_FAILURE); - } - - if (monitor) - glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED); - - glfwMakeContextCurrent(window); - gladLoadGL(glfwGetProcAddress); - glfwSwapInterval(1); - - glfwSetFramebufferSizeCallback(window, resize_callback); - glfwSetKeyCallback(window, key_callback); - - // Set initial aspect ratio - glfwGetFramebufferSize(window, &width, &height); - resize_callback(window, width, height); - - // Upload particle texture - glGenTextures(1, &particle_tex_id); - glBindTexture(GL_TEXTURE_2D, particle_tex_id); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, P_TEX_WIDTH, P_TEX_HEIGHT, - 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, particle_texture); - - // Upload floor texture - glGenTextures(1, &floor_tex_id); - glBindTexture(GL_TEXTURE_2D, floor_tex_id); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, F_TEX_WIDTH, F_TEX_HEIGHT, - 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, floor_texture); - - if (glfwExtensionSupported("GL_EXT_separate_specular_color")) - { - glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL_EXT, - GL_SEPARATE_SPECULAR_COLOR_EXT); - } - - // Set filled polygon mode as default (not wireframe) - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - wireframe = 0; - - // Set initial times - thread_sync.t = 0.0; - thread_sync.dt = 0.001f; - thread_sync.p_frame = 0; - thread_sync.d_frame = 0; - - mtx_init(&thread_sync.particles_lock, mtx_timed); - cnd_init(&thread_sync.p_done); - cnd_init(&thread_sync.d_done); - - if (thrd_create(&physics_thread, physics_thread_main, window) != thrd_success) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwSetTime(0.0); - - while (!glfwWindowShouldClose(window)) - { - draw_scene(window, glfwGetTime()); - - glfwSwapBuffers(window); - glfwPollEvents(); - } - - thrd_join(physics_thread, NULL); - - glfwDestroyWindow(window); - glfwTerminate(); - - exit(EXIT_SUCCESS); -} - diff --git a/3rdparty/glfw/source/examples/sharing.c b/3rdparty/glfw/source/examples/sharing.c deleted file mode 100644 index d840c58..0000000 --- a/3rdparty/glfw/source/examples/sharing.c +++ /dev/null @@ -1,235 +0,0 @@ -//======================================================================== -// Context sharing example -// Copyright (c) Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#include -#include - -#include "getopt.h" -#include "linmath.h" - -static const char* vertex_shader_text = -"#version 110\n" -"uniform mat4 MVP;\n" -"attribute vec2 vPos;\n" -"varying vec2 texcoord;\n" -"void main()\n" -"{\n" -" gl_Position = MVP * vec4(vPos, 0.0, 1.0);\n" -" texcoord = vPos;\n" -"}\n"; - -static const char* fragment_shader_text = -"#version 110\n" -"uniform sampler2D texture;\n" -"uniform vec3 color;\n" -"varying vec2 texcoord;\n" -"void main()\n" -"{\n" -" gl_FragColor = vec4(color * texture2D(texture, texcoord).rgb, 1.0);\n" -"}\n"; - -static const vec2 vertices[4] = -{ - { 0.f, 0.f }, - { 1.f, 0.f }, - { 1.f, 1.f }, - { 0.f, 1.f } -}; - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action == GLFW_PRESS && key == GLFW_KEY_ESCAPE) - glfwSetWindowShouldClose(window, GLFW_TRUE); -} - -int main(int argc, char** argv) -{ - GLFWwindow* windows[2]; - GLuint texture, program, vertex_buffer; - GLint mvp_location, vpos_location, color_location, texture_location; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); - - windows[0] = glfwCreateWindow(400, 400, "First", NULL, NULL); - if (!windows[0]) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwSetKeyCallback(windows[0], key_callback); - - glfwMakeContextCurrent(windows[0]); - - // Only enable vsync for the first of the windows to be swapped to - // avoid waiting out the interval for each window - glfwSwapInterval(1); - - // The contexts are created with the same APIs so the function - // pointers should be re-usable between them - gladLoadGL(glfwGetProcAddress); - - // Create the OpenGL objects inside the first context, created above - // All objects will be shared with the second context, created below - { - int x, y; - char pixels[16 * 16]; - GLuint vertex_shader, fragment_shader; - - glGenTextures(1, &texture); - glBindTexture(GL_TEXTURE_2D, texture); - - srand((unsigned int) glfwGetTimerValue()); - - for (y = 0; y < 16; y++) - { - for (x = 0; x < 16; x++) - pixels[y * 16 + x] = rand() % 256; - } - - glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, 16, 16, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, pixels); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - - vertex_shader = glCreateShader(GL_VERTEX_SHADER); - glShaderSource(vertex_shader, 1, &vertex_shader_text, NULL); - glCompileShader(vertex_shader); - - fragment_shader = glCreateShader(GL_FRAGMENT_SHADER); - glShaderSource(fragment_shader, 1, &fragment_shader_text, NULL); - glCompileShader(fragment_shader); - - program = glCreateProgram(); - glAttachShader(program, vertex_shader); - glAttachShader(program, fragment_shader); - glLinkProgram(program); - - mvp_location = glGetUniformLocation(program, "MVP"); - color_location = glGetUniformLocation(program, "color"); - texture_location = glGetUniformLocation(program, "texture"); - vpos_location = glGetAttribLocation(program, "vPos"); - - glGenBuffers(1, &vertex_buffer); - glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer); - glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW); - } - - glUseProgram(program); - glUniform1i(texture_location, 0); - - glEnable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, texture); - - glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer); - glEnableVertexAttribArray(vpos_location); - glVertexAttribPointer(vpos_location, 2, GL_FLOAT, GL_FALSE, - sizeof(vertices[0]), (void*) 0); - - windows[1] = glfwCreateWindow(400, 400, "Second", NULL, windows[0]); - if (!windows[1]) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - // Place the second window to the right of the first - { - int xpos, ypos, left, right, width; - - glfwGetWindowSize(windows[0], &width, NULL); - glfwGetWindowFrameSize(windows[0], &left, NULL, &right, NULL); - glfwGetWindowPos(windows[0], &xpos, &ypos); - - glfwSetWindowPos(windows[1], xpos + width + left + right, ypos); - } - - glfwSetKeyCallback(windows[1], key_callback); - - glfwMakeContextCurrent(windows[1]); - - // While objects are shared, the global context state is not and will - // need to be set up for each context - - glUseProgram(program); - - glEnable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, texture); - - glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer); - glEnableVertexAttribArray(vpos_location); - glVertexAttribPointer(vpos_location, 2, GL_FLOAT, GL_FALSE, - sizeof(vertices[0]), (void*) 0); - - while (!glfwWindowShouldClose(windows[0]) && - !glfwWindowShouldClose(windows[1])) - { - int i; - const vec3 colors[2] = - { - { 0.8f, 0.4f, 1.f }, - { 0.3f, 0.4f, 1.f } - }; - - for (i = 0; i < 2; i++) - { - int width, height; - mat4x4 mvp; - - glfwGetFramebufferSize(windows[i], &width, &height); - glfwMakeContextCurrent(windows[i]); - - glViewport(0, 0, width, height); - - mat4x4_ortho(mvp, 0.f, 1.f, 0.f, 1.f, 0.f, 1.f); - glUniformMatrix4fv(mvp_location, 1, GL_FALSE, (const GLfloat*) mvp); - glUniform3fv(color_location, 1, colors[i]); - glDrawArrays(GL_TRIANGLE_FAN, 0, 4); - - glfwSwapBuffers(windows[i]); - } - - glfwWaitEvents(); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/3rdparty/glfw/source/examples/splitview.c b/3rdparty/glfw/source/examples/splitview.c deleted file mode 100644 index 990df12..0000000 --- a/3rdparty/glfw/source/examples/splitview.c +++ /dev/null @@ -1,547 +0,0 @@ -//======================================================================== -// This is an example program for the GLFW library -// -// The program uses a "split window" view, rendering four views of the -// same scene in one window (e.g. useful for 3D modelling software). This -// demo uses scissors to separate the four different rendering areas from -// each other. -// -// (If the code seems a little bit strange here and there, it may be -// because I am not a friend of orthogonal projections) -//======================================================================== - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#if defined(_MSC_VER) - // Make MS math.h define M_PI - #define _USE_MATH_DEFINES -#endif - -#include -#include -#include - -#include - - -//======================================================================== -// Global variables -//======================================================================== - -// Mouse position -static double xpos = 0, ypos = 0; - -// Window size -static int width, height; - -// Active view: 0 = none, 1 = upper left, 2 = upper right, 3 = lower left, -// 4 = lower right -static int active_view = 0; - -// Rotation around each axis -static int rot_x = 0, rot_y = 0, rot_z = 0; - -// Do redraw? -static int do_redraw = 1; - - -//======================================================================== -// Draw a solid torus (use a display list for the model) -//======================================================================== - -#define TORUS_MAJOR 1.5 -#define TORUS_MINOR 0.5 -#define TORUS_MAJOR_RES 32 -#define TORUS_MINOR_RES 32 - -static void drawTorus(void) -{ - static GLuint torus_list = 0; - int i, j, k; - double s, t, x, y, z, nx, ny, nz, scale, twopi; - - if (!torus_list) - { - // Start recording displaylist - torus_list = glGenLists(1); - glNewList(torus_list, GL_COMPILE_AND_EXECUTE); - - // Draw torus - twopi = 2.0 * M_PI; - for (i = 0; i < TORUS_MINOR_RES; i++) - { - glBegin(GL_QUAD_STRIP); - for (j = 0; j <= TORUS_MAJOR_RES; j++) - { - for (k = 1; k >= 0; k--) - { - s = (i + k) % TORUS_MINOR_RES + 0.5; - t = j % TORUS_MAJOR_RES; - - // Calculate point on surface - x = (TORUS_MAJOR + TORUS_MINOR * cos(s * twopi / TORUS_MINOR_RES)) * cos(t * twopi / TORUS_MAJOR_RES); - y = TORUS_MINOR * sin(s * twopi / TORUS_MINOR_RES); - z = (TORUS_MAJOR + TORUS_MINOR * cos(s * twopi / TORUS_MINOR_RES)) * sin(t * twopi / TORUS_MAJOR_RES); - - // Calculate surface normal - nx = x - TORUS_MAJOR * cos(t * twopi / TORUS_MAJOR_RES); - ny = y; - nz = z - TORUS_MAJOR * sin(t * twopi / TORUS_MAJOR_RES); - scale = 1.0 / sqrt(nx*nx + ny*ny + nz*nz); - nx *= scale; - ny *= scale; - nz *= scale; - - glNormal3f((float) nx, (float) ny, (float) nz); - glVertex3f((float) x, (float) y, (float) z); - } - } - - glEnd(); - } - - // Stop recording displaylist - glEndList(); - } - else - { - // Playback displaylist - glCallList(torus_list); - } -} - - -//======================================================================== -// Draw the scene (a rotating torus) -//======================================================================== - -static void drawScene(void) -{ - const GLfloat model_diffuse[4] = {1.0f, 0.8f, 0.8f, 1.0f}; - const GLfloat model_specular[4] = {0.6f, 0.6f, 0.6f, 1.0f}; - const GLfloat model_shininess = 20.0f; - - glPushMatrix(); - - // Rotate the object - glRotatef((GLfloat) rot_x * 0.5f, 1.0f, 0.0f, 0.0f); - glRotatef((GLfloat) rot_y * 0.5f, 0.0f, 1.0f, 0.0f); - glRotatef((GLfloat) rot_z * 0.5f, 0.0f, 0.0f, 1.0f); - - // Set model color (used for orthogonal views, lighting disabled) - glColor4fv(model_diffuse); - - // Set model material (used for perspective view, lighting enabled) - glMaterialfv(GL_FRONT, GL_DIFFUSE, model_diffuse); - glMaterialfv(GL_FRONT, GL_SPECULAR, model_specular); - glMaterialf(GL_FRONT, GL_SHININESS, model_shininess); - - // Draw torus - drawTorus(); - - glPopMatrix(); -} - - -//======================================================================== -// Draw a 2D grid (used for orthogonal views) -//======================================================================== - -static void drawGrid(float scale, int steps) -{ - int i; - float x, y; - mat4x4 view; - - glPushMatrix(); - - // Set background to some dark bluish grey - glClearColor(0.05f, 0.05f, 0.2f, 0.0f); - glClear(GL_COLOR_BUFFER_BIT); - - // Setup modelview matrix (flat XY view) - { - vec3 eye = { 0.f, 0.f, 1.f }; - vec3 center = { 0.f, 0.f, 0.f }; - vec3 up = { 0.f, 1.f, 0.f }; - mat4x4_look_at(view, eye, center, up); - } - glLoadMatrixf((const GLfloat*) view); - - // We don't want to update the Z-buffer - glDepthMask(GL_FALSE); - - // Set grid color - glColor3f(0.0f, 0.5f, 0.5f); - - glBegin(GL_LINES); - - // Horizontal lines - x = scale * 0.5f * (float) (steps - 1); - y = -scale * 0.5f * (float) (steps - 1); - for (i = 0; i < steps; i++) - { - glVertex3f(-x, y, 0.0f); - glVertex3f(x, y, 0.0f); - y += scale; - } - - // Vertical lines - x = -scale * 0.5f * (float) (steps - 1); - y = scale * 0.5f * (float) (steps - 1); - for (i = 0; i < steps; i++) - { - glVertex3f(x, -y, 0.0f); - glVertex3f(x, y, 0.0f); - x += scale; - } - - glEnd(); - - // Enable Z-buffer writing again - glDepthMask(GL_TRUE); - - glPopMatrix(); -} - - -//======================================================================== -// Draw all views -//======================================================================== - -static void drawAllViews(void) -{ - const GLfloat light_position[4] = {0.0f, 8.0f, 8.0f, 1.0f}; - const GLfloat light_diffuse[4] = {1.0f, 1.0f, 1.0f, 1.0f}; - const GLfloat light_specular[4] = {1.0f, 1.0f, 1.0f, 1.0f}; - const GLfloat light_ambient[4] = {0.2f, 0.2f, 0.3f, 1.0f}; - float aspect; - mat4x4 view, projection; - - // Calculate aspect of window - if (height > 0) - aspect = (float) width / (float) height; - else - aspect = 1.f; - - // Clear screen - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - // Enable scissor test - glEnable(GL_SCISSOR_TEST); - - // Enable depth test - glEnable(GL_DEPTH_TEST); - glDepthFunc(GL_LEQUAL); - - // ** ORTHOGONAL VIEWS ** - - // For orthogonal views, use wireframe rendering - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - - // Enable line anti-aliasing - glEnable(GL_LINE_SMOOTH); - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - // Setup orthogonal projection matrix - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(-3.0 * aspect, 3.0 * aspect, -3.0, 3.0, 1.0, 50.0); - - // Upper left view (TOP VIEW) - glViewport(0, height / 2, width / 2, height / 2); - glScissor(0, height / 2, width / 2, height / 2); - glMatrixMode(GL_MODELVIEW); - { - vec3 eye = { 0.f, 10.f, 1e-3f }; - vec3 center = { 0.f, 0.f, 0.f }; - vec3 up = { 0.f, 1.f, 0.f }; - mat4x4_look_at( view, eye, center, up ); - } - glLoadMatrixf((const GLfloat*) view); - drawGrid(0.5, 12); - drawScene(); - - // Lower left view (FRONT VIEW) - glViewport(0, 0, width / 2, height / 2); - glScissor(0, 0, width / 2, height / 2); - glMatrixMode(GL_MODELVIEW); - { - vec3 eye = { 0.f, 0.f, 10.f }; - vec3 center = { 0.f, 0.f, 0.f }; - vec3 up = { 0.f, 1.f, 0.f }; - mat4x4_look_at( view, eye, center, up ); - } - glLoadMatrixf((const GLfloat*) view); - drawGrid(0.5, 12); - drawScene(); - - // Lower right view (SIDE VIEW) - glViewport(width / 2, 0, width / 2, height / 2); - glScissor(width / 2, 0, width / 2, height / 2); - glMatrixMode(GL_MODELVIEW); - { - vec3 eye = { 10.f, 0.f, 0.f }; - vec3 center = { 0.f, 0.f, 0.f }; - vec3 up = { 0.f, 1.f, 0.f }; - mat4x4_look_at( view, eye, center, up ); - } - glLoadMatrixf((const GLfloat*) view); - drawGrid(0.5, 12); - drawScene(); - - // Disable line anti-aliasing - glDisable(GL_LINE_SMOOTH); - glDisable(GL_BLEND); - - // ** PERSPECTIVE VIEW ** - - // For perspective view, use solid rendering - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - - // Enable face culling (faster rendering) - glEnable(GL_CULL_FACE); - glCullFace(GL_BACK); - glFrontFace(GL_CW); - - // Setup perspective projection matrix - glMatrixMode(GL_PROJECTION); - mat4x4_perspective(projection, - 65.f * (float) M_PI / 180.f, - aspect, - 1.f, 50.f); - glLoadMatrixf((const GLfloat*) projection); - - // Upper right view (PERSPECTIVE VIEW) - glViewport(width / 2, height / 2, width / 2, height / 2); - glScissor(width / 2, height / 2, width / 2, height / 2); - glMatrixMode(GL_MODELVIEW); - { - vec3 eye = { 3.f, 1.5f, 3.f }; - vec3 center = { 0.f, 0.f, 0.f }; - vec3 up = { 0.f, 1.f, 0.f }; - mat4x4_look_at( view, eye, center, up ); - } - glLoadMatrixf((const GLfloat*) view); - - // Configure and enable light source 1 - glLightfv(GL_LIGHT1, GL_POSITION, light_position); - glLightfv(GL_LIGHT1, GL_AMBIENT, light_ambient); - glLightfv(GL_LIGHT1, GL_DIFFUSE, light_diffuse); - glLightfv(GL_LIGHT1, GL_SPECULAR, light_specular); - glEnable(GL_LIGHT1); - glEnable(GL_LIGHTING); - - // Draw scene - drawScene(); - - // Disable lighting - glDisable(GL_LIGHTING); - - // Disable face culling - glDisable(GL_CULL_FACE); - - // Disable depth test - glDisable(GL_DEPTH_TEST); - - // Disable scissor test - glDisable(GL_SCISSOR_TEST); - - // Draw a border around the active view - if (active_view > 0 && active_view != 2) - { - glViewport(0, 0, width, height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(0.0, 2.0, 0.0, 2.0, 0.0, 1.0); - - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - glTranslatef((GLfloat) ((active_view - 1) & 1), (GLfloat) (1 - (active_view - 1) / 2), 0.0f); - - glColor3f(1.0f, 1.0f, 0.6f); - - glBegin(GL_LINE_STRIP); - glVertex2i(0, 0); - glVertex2i(1, 0); - glVertex2i(1, 1); - glVertex2i(0, 1); - glVertex2i(0, 0); - glEnd(); - } -} - - -//======================================================================== -// Framebuffer size callback function -//======================================================================== - -static void framebufferSizeFun(GLFWwindow* window, int w, int h) -{ - width = w; - height = h > 0 ? h : 1; - do_redraw = 1; -} - - -//======================================================================== -// Window refresh callback function -//======================================================================== - -static void windowRefreshFun(GLFWwindow* window) -{ - drawAllViews(); - glfwSwapBuffers(window); - do_redraw = 0; -} - - -//======================================================================== -// Mouse position callback function -//======================================================================== - -static void cursorPosFun(GLFWwindow* window, double x, double y) -{ - int wnd_width, wnd_height, fb_width, fb_height; - double scale; - - glfwGetWindowSize(window, &wnd_width, &wnd_height); - glfwGetFramebufferSize(window, &fb_width, &fb_height); - - scale = (double) fb_width / (double) wnd_width; - - x *= scale; - y *= scale; - - // Depending on which view was selected, rotate around different axes - switch (active_view) - { - case 1: - rot_x += (int) (y - ypos); - rot_z += (int) (x - xpos); - do_redraw = 1; - break; - case 3: - rot_x += (int) (y - ypos); - rot_y += (int) (x - xpos); - do_redraw = 1; - break; - case 4: - rot_y += (int) (x - xpos); - rot_z += (int) (y - ypos); - do_redraw = 1; - break; - default: - // Do nothing for perspective view, or if no view is selected - break; - } - - // Remember cursor position - xpos = x; - ypos = y; -} - - -//======================================================================== -// Mouse button callback function -//======================================================================== - -static void mouseButtonFun(GLFWwindow* window, int button, int action, int mods) -{ - if ((button == GLFW_MOUSE_BUTTON_LEFT) && action == GLFW_PRESS) - { - // Detect which of the four views was clicked - active_view = 1; - if (xpos >= width / 2) - active_view += 1; - if (ypos >= height / 2) - active_view += 2; - } - else if (button == GLFW_MOUSE_BUTTON_LEFT) - { - // Deselect any previously selected view - active_view = 0; - } - - do_redraw = 1; -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) - glfwSetWindowShouldClose(window, GLFW_TRUE); -} - - -//======================================================================== -// main -//======================================================================== - -int main(void) -{ - GLFWwindow* window; - - // Initialise GLFW - if (!glfwInit()) - { - fprintf(stderr, "Failed to initialize GLFW\n"); - exit(EXIT_FAILURE); - } - - glfwWindowHint(GLFW_SAMPLES, 4); - - // Open OpenGL window - window = glfwCreateWindow(500, 500, "Split view demo", NULL, NULL); - if (!window) - { - fprintf(stderr, "Failed to open GLFW window\n"); - - glfwTerminate(); - exit(EXIT_FAILURE); - } - - // Set callback functions - glfwSetFramebufferSizeCallback(window, framebufferSizeFun); - glfwSetWindowRefreshCallback(window, windowRefreshFun); - glfwSetCursorPosCallback(window, cursorPosFun); - glfwSetMouseButtonCallback(window, mouseButtonFun); - glfwSetKeyCallback(window, key_callback); - - // Enable vsync - glfwMakeContextCurrent(window); - gladLoadGL(glfwGetProcAddress); - glfwSwapInterval(1); - - if (GLAD_GL_ARB_multisample || GLAD_GL_VERSION_1_3) - glEnable(GL_MULTISAMPLE_ARB); - - glfwGetFramebufferSize(window, &width, &height); - framebufferSizeFun(window, width, height); - - // Main loop - for (;;) - { - // Only redraw if we need to - if (do_redraw) - windowRefreshFun(window); - - // Wait for new events - glfwWaitEvents(); - - // Check if the window should be closed - if (glfwWindowShouldClose(window)) - break; - } - - // Close OpenGL window and terminate GLFW - glfwTerminate(); - - exit(EXIT_SUCCESS); -} - diff --git a/3rdparty/glfw/source/examples/triangle-opengl.c b/3rdparty/glfw/source/examples/triangle-opengl.c deleted file mode 100644 index ff9e7d3..0000000 --- a/3rdparty/glfw/source/examples/triangle-opengl.c +++ /dev/null @@ -1,171 +0,0 @@ -//======================================================================== -// OpenGL triangle example -// Copyright (c) Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -//! [code] - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#include "linmath.h" - -#include -#include -#include - -typedef struct Vertex -{ - vec2 pos; - vec3 col; -} Vertex; - -static const Vertex vertices[3] = -{ - { { -0.6f, -0.4f }, { 1.f, 0.f, 0.f } }, - { { 0.6f, -0.4f }, { 0.f, 1.f, 0.f } }, - { { 0.f, 0.6f }, { 0.f, 0.f, 1.f } } -}; - -static const char* vertex_shader_text = -"#version 330\n" -"uniform mat4 MVP;\n" -"in vec3 vCol;\n" -"in vec2 vPos;\n" -"out vec3 color;\n" -"void main()\n" -"{\n" -" gl_Position = MVP * vec4(vPos, 0.0, 1.0);\n" -" color = vCol;\n" -"}\n"; - -static const char* fragment_shader_text = -"#version 330\n" -"in vec3 color;\n" -"out vec4 fragment;\n" -"void main()\n" -"{\n" -" fragment = vec4(color, 1.0);\n" -"}\n"; - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) - glfwSetWindowShouldClose(window, GLFW_TRUE); -} - -int main(void) -{ - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); - glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); - - GLFWwindow* window = glfwCreateWindow(640, 480, "OpenGL Triangle", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwSetKeyCallback(window, key_callback); - - glfwMakeContextCurrent(window); - gladLoadGL(glfwGetProcAddress); - glfwSwapInterval(1); - - // NOTE: OpenGL error checks have been omitted for brevity - - GLuint vertex_buffer; - glGenBuffers(1, &vertex_buffer); - glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer); - glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW); - - const GLuint vertex_shader = glCreateShader(GL_VERTEX_SHADER); - glShaderSource(vertex_shader, 1, &vertex_shader_text, NULL); - glCompileShader(vertex_shader); - - const GLuint fragment_shader = glCreateShader(GL_FRAGMENT_SHADER); - glShaderSource(fragment_shader, 1, &fragment_shader_text, NULL); - glCompileShader(fragment_shader); - - const GLuint program = glCreateProgram(); - glAttachShader(program, vertex_shader); - glAttachShader(program, fragment_shader); - glLinkProgram(program); - - const GLint mvp_location = glGetUniformLocation(program, "MVP"); - const GLint vpos_location = glGetAttribLocation(program, "vPos"); - const GLint vcol_location = glGetAttribLocation(program, "vCol"); - - GLuint vertex_array; - glGenVertexArrays(1, &vertex_array); - glBindVertexArray(vertex_array); - glEnableVertexAttribArray(vpos_location); - glVertexAttribPointer(vpos_location, 2, GL_FLOAT, GL_FALSE, - sizeof(Vertex), (void*) offsetof(Vertex, pos)); - glEnableVertexAttribArray(vcol_location); - glVertexAttribPointer(vcol_location, 3, GL_FLOAT, GL_FALSE, - sizeof(Vertex), (void*) offsetof(Vertex, col)); - - while (!glfwWindowShouldClose(window)) - { - int width, height; - glfwGetFramebufferSize(window, &width, &height); - const float ratio = width / (float) height; - - glViewport(0, 0, width, height); - glClear(GL_COLOR_BUFFER_BIT); - - mat4x4 m, p, mvp; - mat4x4_identity(m); - mat4x4_rotate_Z(m, m, (float) glfwGetTime()); - mat4x4_ortho(p, -ratio, ratio, -1.f, 1.f, 1.f, -1.f); - mat4x4_mul(mvp, p, m); - - glUseProgram(program); - glUniformMatrix4fv(mvp_location, 1, GL_FALSE, (const GLfloat*) &mvp); - glBindVertexArray(vertex_array); - glDrawArrays(GL_TRIANGLES, 0, 3); - - glfwSwapBuffers(window); - glfwPollEvents(); - } - - glfwDestroyWindow(window); - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - -//! [code] diff --git a/3rdparty/glfw/source/examples/triangle-opengles.c b/3rdparty/glfw/source/examples/triangle-opengles.c deleted file mode 100644 index 03eb026..0000000 --- a/3rdparty/glfw/source/examples/triangle-opengles.c +++ /dev/null @@ -1,170 +0,0 @@ -//======================================================================== -// OpenGL ES 2.0 triangle example -// Copyright (c) Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== - -#define GLAD_GLES2_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#include "linmath.h" - -#include -#include -#include - -typedef struct Vertex -{ - vec2 pos; - vec3 col; -} Vertex; - -static const Vertex vertices[3] = -{ - { { -0.6f, -0.4f }, { 1.f, 0.f, 0.f } }, - { { 0.6f, -0.4f }, { 0.f, 1.f, 0.f } }, - { { 0.f, 0.6f }, { 0.f, 0.f, 1.f } } -}; - -static const char* vertex_shader_text = -"#version 100\n" -"precision mediump float;\n" -"uniform mat4 MVP;\n" -"attribute vec3 vCol;\n" -"attribute vec2 vPos;\n" -"varying vec3 color;\n" -"void main()\n" -"{\n" -" gl_Position = MVP * vec4(vPos, 0.0, 1.0);\n" -" color = vCol;\n" -"}\n"; - -static const char* fragment_shader_text = -"#version 100\n" -"precision mediump float;\n" -"varying vec3 color;\n" -"void main()\n" -"{\n" -" gl_FragColor = vec4(color, 1.0);\n" -"}\n"; - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "GLFW Error: %s\n", description); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) - glfwSetWindowShouldClose(window, GLFW_TRUE); -} - -int main(void) -{ - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API); - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); - glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API); - - GLFWwindow* window = glfwCreateWindow(640, 480, "OpenGL ES 2.0 Triangle (EGL)", NULL, NULL); - if (!window) - { - glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_NATIVE_CONTEXT_API); - window = glfwCreateWindow(640, 480, "OpenGL ES 2.0 Triangle", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - } - - glfwSetKeyCallback(window, key_callback); - - glfwMakeContextCurrent(window); - gladLoadGLES2(glfwGetProcAddress); - glfwSwapInterval(1); - - GLuint vertex_buffer; - glGenBuffers(1, &vertex_buffer); - glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer); - glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW); - - const GLuint vertex_shader = glCreateShader(GL_VERTEX_SHADER); - glShaderSource(vertex_shader, 1, &vertex_shader_text, NULL); - glCompileShader(vertex_shader); - - const GLuint fragment_shader = glCreateShader(GL_FRAGMENT_SHADER); - glShaderSource(fragment_shader, 1, &fragment_shader_text, NULL); - glCompileShader(fragment_shader); - - const GLuint program = glCreateProgram(); - glAttachShader(program, vertex_shader); - glAttachShader(program, fragment_shader); - glLinkProgram(program); - - const GLint mvp_location = glGetUniformLocation(program, "MVP"); - const GLint vpos_location = glGetAttribLocation(program, "vPos"); - const GLint vcol_location = glGetAttribLocation(program, "vCol"); - - glEnableVertexAttribArray(vpos_location); - glEnableVertexAttribArray(vcol_location); - glVertexAttribPointer(vpos_location, 2, GL_FLOAT, GL_FALSE, - sizeof(Vertex), (void*) offsetof(Vertex, pos)); - glVertexAttribPointer(vcol_location, 3, GL_FLOAT, GL_FALSE, - sizeof(Vertex), (void*) offsetof(Vertex, col)); - - while (!glfwWindowShouldClose(window)) - { - int width, height; - glfwGetFramebufferSize(window, &width, &height); - const float ratio = width / (float) height; - - glViewport(0, 0, width, height); - glClear(GL_COLOR_BUFFER_BIT); - - mat4x4 m, p, mvp; - mat4x4_identity(m); - mat4x4_rotate_Z(m, m, (float) glfwGetTime()); - mat4x4_ortho(p, -ratio, ratio, -1.f, 1.f, 1.f, -1.f); - mat4x4_mul(mvp, p, m); - - glUseProgram(program); - glUniformMatrix4fv(mvp_location, 1, GL_FALSE, (const GLfloat*) &mvp); - glDrawArrays(GL_TRIANGLES, 0, 3); - - glfwSwapBuffers(window); - glfwPollEvents(); - } - - glfwDestroyWindow(window); - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/3rdparty/glfw/source/examples/wave.c b/3rdparty/glfw/source/examples/wave.c deleted file mode 100644 index d7ead49..0000000 --- a/3rdparty/glfw/source/examples/wave.c +++ /dev/null @@ -1,463 +0,0 @@ -/***************************************************************************** - * Wave Simulation in OpenGL - * (C) 2002 Jakob Thomsen - * http://home.in.tum.de/~thomsen - * Modified for GLFW by Sylvain Hellegouarch - sh@programmationworld.com - * Modified for variable frame rate by Marcus Geelnard - * 2003-Jan-31: Minor cleanups and speedups / MG - * 2010-10-24: Formatting and cleanup - Camilla Löwy - *****************************************************************************/ - -#if defined(_MSC_VER) - // Make MS math.h define M_PI - #define _USE_MATH_DEFINES -#endif - -#include -#include -#include - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#include - -// Maximum delta T to allow for differential calculations -#define MAX_DELTA_T 0.01 - -// Animation speed (10.0 looks good) -#define ANIMATION_SPEED 10.0 - -GLfloat alpha = 210.f, beta = -70.f; -GLfloat zoom = 2.f; - -double cursorX; -double cursorY; - -struct Vertex -{ - GLfloat x, y, z; - GLfloat r, g, b; -}; - -#define GRIDW 50 -#define GRIDH 50 -#define VERTEXNUM (GRIDW*GRIDH) - -#define QUADW (GRIDW - 1) -#define QUADH (GRIDH - 1) -#define QUADNUM (QUADW*QUADH) - -GLuint quad[4 * QUADNUM]; -struct Vertex vertex[VERTEXNUM]; - -/* The grid will look like this: - * - * 3 4 5 - * *---*---* - * | | | - * | 0 | 1 | - * | | | - * *---*---* - * 0 1 2 - */ - -//======================================================================== -// Initialize grid geometry -//======================================================================== - -void init_vertices(void) -{ - int x, y, p; - - // Place the vertices in a grid - for (y = 0; y < GRIDH; y++) - { - for (x = 0; x < GRIDW; x++) - { - p = y * GRIDW + x; - - vertex[p].x = (GLfloat) (x - GRIDW / 2) / (GLfloat) (GRIDW / 2); - vertex[p].y = (GLfloat) (y - GRIDH / 2) / (GLfloat) (GRIDH / 2); - vertex[p].z = 0; - - if ((x % 4 < 2) ^ (y % 4 < 2)) - vertex[p].r = 0.0; - else - vertex[p].r = 1.0; - - vertex[p].g = (GLfloat) y / (GLfloat) GRIDH; - vertex[p].b = 1.f - ((GLfloat) x / (GLfloat) GRIDW + (GLfloat) y / (GLfloat) GRIDH) / 2.f; - } - } - - for (y = 0; y < QUADH; y++) - { - for (x = 0; x < QUADW; x++) - { - p = 4 * (y * QUADW + x); - - quad[p + 0] = y * GRIDW + x; // Some point - quad[p + 1] = y * GRIDW + x + 1; // Neighbor at the right side - quad[p + 2] = (y + 1) * GRIDW + x + 1; // Upper right neighbor - quad[p + 3] = (y + 1) * GRIDW + x; // Upper neighbor - } - } -} - -double dt; -double p[GRIDW][GRIDH]; -double vx[GRIDW][GRIDH], vy[GRIDW][GRIDH]; -double ax[GRIDW][GRIDH], ay[GRIDW][GRIDH]; - -//======================================================================== -// Initialize grid -//======================================================================== - -void init_grid(void) -{ - int x, y; - double dx, dy, d; - - for (y = 0; y < GRIDH; y++) - { - for (x = 0; x < GRIDW; x++) - { - dx = (double) (x - GRIDW / 2); - dy = (double) (y - GRIDH / 2); - d = sqrt(dx * dx + dy * dy); - if (d < 0.1 * (double) (GRIDW / 2)) - { - d = d * 10.0; - p[x][y] = -cos(d * (M_PI / (double)(GRIDW * 4))) * 100.0; - } - else - p[x][y] = 0.0; - - vx[x][y] = 0.0; - vy[x][y] = 0.0; - } - } -} - - -//======================================================================== -// Draw scene -//======================================================================== - -void draw_scene(GLFWwindow* window) -{ - // Clear the color and depth buffers - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - // We don't want to modify the projection matrix - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - - // Move back - glTranslatef(0.0, 0.0, -zoom); - // Rotate the view - glRotatef(beta, 1.0, 0.0, 0.0); - glRotatef(alpha, 0.0, 0.0, 1.0); - - glDrawElements(GL_QUADS, 4 * QUADNUM, GL_UNSIGNED_INT, quad); - - glfwSwapBuffers(window); -} - - -//======================================================================== -// Initialize Miscellaneous OpenGL state -//======================================================================== - -void init_opengl(void) -{ - // Use Gouraud (smooth) shading - glShadeModel(GL_SMOOTH); - - // Switch on the z-buffer - glEnable(GL_DEPTH_TEST); - - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_COLOR_ARRAY); - glVertexPointer(3, GL_FLOAT, sizeof(struct Vertex), vertex); - glColorPointer(3, GL_FLOAT, sizeof(struct Vertex), &vertex[0].r); // Pointer to the first color - - glPointSize(2.0); - - // Background color is black - glClearColor(0, 0, 0, 0); -} - - -//======================================================================== -// Modify the height of each vertex according to the pressure -//======================================================================== - -void adjust_grid(void) -{ - int pos; - int x, y; - - for (y = 0; y < GRIDH; y++) - { - for (x = 0; x < GRIDW; x++) - { - pos = y * GRIDW + x; - vertex[pos].z = (float) (p[x][y] * (1.0 / 50.0)); - } - } -} - - -//======================================================================== -// Calculate wave propagation -//======================================================================== - -void calc_grid(void) -{ - int x, y, x2, y2; - double time_step = dt * ANIMATION_SPEED; - - // Compute accelerations - for (x = 0; x < GRIDW; x++) - { - x2 = (x + 1) % GRIDW; - for(y = 0; y < GRIDH; y++) - ax[x][y] = p[x][y] - p[x2][y]; - } - - for (y = 0; y < GRIDH; y++) - { - y2 = (y + 1) % GRIDH; - for(x = 0; x < GRIDW; x++) - ay[x][y] = p[x][y] - p[x][y2]; - } - - // Compute speeds - for (x = 0; x < GRIDW; x++) - { - for (y = 0; y < GRIDH; y++) - { - vx[x][y] = vx[x][y] + ax[x][y] * time_step; - vy[x][y] = vy[x][y] + ay[x][y] * time_step; - } - } - - // Compute pressure - for (x = 1; x < GRIDW; x++) - { - x2 = x - 1; - for (y = 1; y < GRIDH; y++) - { - y2 = y - 1; - p[x][y] = p[x][y] + (vx[x2][y] - vx[x][y] + vy[x][y2] - vy[x][y]) * time_step; - } - } -} - - -//======================================================================== -// Print errors -//======================================================================== - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - - -//======================================================================== -// Handle key strokes -//======================================================================== - -void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_ESCAPE: - glfwSetWindowShouldClose(window, GLFW_TRUE); - break; - case GLFW_KEY_SPACE: - init_grid(); - break; - case GLFW_KEY_LEFT: - alpha += 5; - break; - case GLFW_KEY_RIGHT: - alpha -= 5; - break; - case GLFW_KEY_UP: - beta -= 5; - break; - case GLFW_KEY_DOWN: - beta += 5; - break; - case GLFW_KEY_PAGE_UP: - zoom -= 0.25f; - if (zoom < 0.f) - zoom = 0.f; - break; - case GLFW_KEY_PAGE_DOWN: - zoom += 0.25f; - break; - default: - break; - } -} - - -//======================================================================== -// Callback function for mouse button events -//======================================================================== - -void mouse_button_callback(GLFWwindow* window, int button, int action, int mods) -{ - if (button != GLFW_MOUSE_BUTTON_LEFT) - return; - - if (action == GLFW_PRESS) - { - glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED); - glfwGetCursorPos(window, &cursorX, &cursorY); - } - else - glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL); -} - - -//======================================================================== -// Callback function for cursor motion events -//======================================================================== - -void cursor_position_callback(GLFWwindow* window, double x, double y) -{ - if (glfwGetInputMode(window, GLFW_CURSOR) == GLFW_CURSOR_DISABLED) - { - alpha += (GLfloat) (x - cursorX) / 10.f; - beta += (GLfloat) (y - cursorY) / 10.f; - - cursorX = x; - cursorY = y; - } -} - - -//======================================================================== -// Callback function for scroll events -//======================================================================== - -void scroll_callback(GLFWwindow* window, double x, double y) -{ - zoom += (float) y / 4.f; - if (zoom < 0) - zoom = 0; -} - - -//======================================================================== -// Callback function for framebuffer resize events -//======================================================================== - -void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - float ratio = 1.f; - mat4x4 projection; - - if (height > 0) - ratio = (float) width / (float) height; - - // Setup viewport - glViewport(0, 0, width, height); - - // Change to the projection matrix and set our viewing volume - glMatrixMode(GL_PROJECTION); - mat4x4_perspective(projection, - 60.f * (float) M_PI / 180.f, - ratio, - 1.f, 1024.f); - glLoadMatrixf((const GLfloat*) projection); -} - - -//======================================================================== -// main -//======================================================================== - -int main(int argc, char* argv[]) -{ - GLFWwindow* window; - double t, dt_total, t_old; - int width, height; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - window = glfwCreateWindow(640, 480, "Wave Simulation", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwSetKeyCallback(window, key_callback); - glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); - glfwSetMouseButtonCallback(window, mouse_button_callback); - glfwSetCursorPosCallback(window, cursor_position_callback); - glfwSetScrollCallback(window, scroll_callback); - - glfwMakeContextCurrent(window); - gladLoadGL(glfwGetProcAddress); - glfwSwapInterval(1); - - glfwGetFramebufferSize(window, &width, &height); - framebuffer_size_callback(window, width, height); - - // Initialize OpenGL - init_opengl(); - - // Initialize simulation - init_vertices(); - init_grid(); - adjust_grid(); - - // Initialize timer - t_old = glfwGetTime() - 0.01; - - while (!glfwWindowShouldClose(window)) - { - t = glfwGetTime(); - dt_total = t - t_old; - t_old = t; - - // Safety - iterate if dt_total is too large - while (dt_total > 0.f) - { - // Select iteration time step - dt = dt_total > MAX_DELTA_T ? MAX_DELTA_T : dt_total; - dt_total -= dt; - - // Calculate wave propagation - calc_grid(); - } - - // Compute height of each vertex - adjust_grid(); - - // Draw wave grid to OpenGL display - draw_scene(window); - - glfwPollEvents(); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/3rdparty/glfw/source/examples/windows.c b/3rdparty/glfw/source/examples/windows.c deleted file mode 100644 index 598e521..0000000 --- a/3rdparty/glfw/source/examples/windows.c +++ /dev/null @@ -1,110 +0,0 @@ -//======================================================================== -// Simple multi-window example -// Copyright (c) Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#include -#include - -int main(int argc, char** argv) -{ - int xpos, ypos, height; - const char* description; - GLFWwindow* windows[4]; - - if (!glfwInit()) - { - glfwGetError(&description); - printf("Error: %s\n", description); - exit(EXIT_FAILURE); - } - - glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE); - glfwWindowHint(GLFW_DECORATED, GLFW_FALSE); - - glfwGetMonitorWorkarea(glfwGetPrimaryMonitor(), &xpos, &ypos, NULL, &height); - - for (int i = 0; i < 4; i++) - { - const int size = height / 5; - const struct - { - float r, g, b; - } colors[] = - { - { 0.95f, 0.32f, 0.11f }, - { 0.50f, 0.80f, 0.16f }, - { 0.f, 0.68f, 0.94f }, - { 0.98f, 0.74f, 0.04f } - }; - - if (i > 0) - glfwWindowHint(GLFW_FOCUS_ON_SHOW, GLFW_FALSE); - - windows[i] = glfwCreateWindow(size, size, "Multi-Window Example", NULL, NULL); - if (!windows[i]) - { - glfwGetError(&description); - printf("Error: %s\n", description); - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwSetWindowPos(windows[i], - xpos + size * (1 + (i & 1)), - ypos + size * (1 + (i >> 1))); - glfwSetInputMode(windows[i], GLFW_STICKY_KEYS, GLFW_TRUE); - - glfwMakeContextCurrent(windows[i]); - gladLoadGL(glfwGetProcAddress); - glClearColor(colors[i].r, colors[i].g, colors[i].b, 1.f); - } - - for (int i = 0; i < 4; i++) - glfwShowWindow(windows[i]); - - for (;;) - { - for (int i = 0; i < 4; i++) - { - glfwMakeContextCurrent(windows[i]); - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(windows[i]); - - if (glfwWindowShouldClose(windows[i]) || - glfwGetKey(windows[i], GLFW_KEY_ESCAPE)) - { - glfwTerminate(); - exit(EXIT_SUCCESS); - } - } - - glfwWaitEvents(); - } -} - diff --git a/3rdparty/glfw/source/tests/CMakeLists.txt b/3rdparty/glfw/source/tests/CMakeLists.txt deleted file mode 100644 index f81cfeb..0000000 --- a/3rdparty/glfw/source/tests/CMakeLists.txt +++ /dev/null @@ -1,86 +0,0 @@ - -link_libraries(glfw) - -include_directories("${GLFW_SOURCE_DIR}/deps") - -if (MATH_LIBRARY) - link_libraries("${MATH_LIBRARY}") -endif() - -# Workaround for the MS CRT deprecating parts of the standard library -if (MSVC OR CMAKE_C_SIMULATE_ID STREQUAL "MSVC") - add_definitions(-D_CRT_SECURE_NO_WARNINGS) -endif() - -set(GLAD_GL "${GLFW_SOURCE_DIR}/deps/glad/gl.h") -set(GLAD_VULKAN "${GLFW_SOURCE_DIR}/deps/glad/vulkan.h") -set(GETOPT "${GLFW_SOURCE_DIR}/deps/getopt.h" - "${GLFW_SOURCE_DIR}/deps/getopt.c") -set(TINYCTHREAD "${GLFW_SOURCE_DIR}/deps/tinycthread.h" - "${GLFW_SOURCE_DIR}/deps/tinycthread.c") - -add_executable(allocator allocator.c ${GLAD_GL}) -add_executable(clipboard clipboard.c ${GETOPT} ${GLAD_GL}) -add_executable(events events.c ${GETOPT} ${GLAD_GL}) -add_executable(msaa msaa.c ${GETOPT} ${GLAD_GL}) -add_executable(glfwinfo glfwinfo.c ${GETOPT} ${GLAD_GL} ${GLAD_VULKAN}) -add_executable(iconify iconify.c ${GETOPT} ${GLAD_GL}) -add_executable(monitors monitors.c ${GETOPT} ${GLAD_GL}) -add_executable(reopen reopen.c ${GLAD_GL}) -add_executable(cursor cursor.c ${GLAD_GL}) - -add_executable(empty WIN32 MACOSX_BUNDLE empty.c ${TINYCTHREAD} ${GLAD_GL}) -add_executable(gamma WIN32 MACOSX_BUNDLE gamma.c ${GLAD_GL}) -add_executable(icon WIN32 MACOSX_BUNDLE icon.c ${GLAD_GL}) -add_executable(inputlag WIN32 MACOSX_BUNDLE inputlag.c ${GETOPT} ${GLAD_GL}) -add_executable(joysticks WIN32 MACOSX_BUNDLE joysticks.c ${GLAD_GL}) -add_executable(tearing WIN32 MACOSX_BUNDLE tearing.c ${GLAD_GL}) -add_executable(threads WIN32 MACOSX_BUNDLE threads.c ${TINYCTHREAD} ${GLAD_GL}) -add_executable(timeout WIN32 MACOSX_BUNDLE timeout.c ${GLAD_GL}) -add_executable(title WIN32 MACOSX_BUNDLE title.c ${GLAD_GL}) -add_executable(triangle-vulkan WIN32 triangle-vulkan.c ${GLAD_VULKAN}) -add_executable(window WIN32 MACOSX_BUNDLE window.c ${GLAD_GL}) - -target_link_libraries(empty Threads::Threads) -target_link_libraries(threads Threads::Threads) -if (RT_LIBRARY) - target_link_libraries(empty "${RT_LIBRARY}") - target_link_libraries(threads "${RT_LIBRARY}") -endif() - -set(GUI_ONLY_BINARIES empty gamma icon inputlag joysticks tearing threads - timeout title triangle-vulkan window) -set(CONSOLE_BINARIES allocator clipboard events msaa glfwinfo iconify monitors - reopen cursor) - -set_target_properties(${GUI_ONLY_BINARIES} ${CONSOLE_BINARIES} PROPERTIES - C_STANDARD 99 - FOLDER "GLFW3/Tests") - -if (MSVC) - # Tell MSVC to use main instead of WinMain - set_target_properties(${GUI_ONLY_BINARIES} PROPERTIES - LINK_FLAGS "/ENTRY:mainCRTStartup") -elseif (CMAKE_C_SIMULATE_ID STREQUAL "MSVC") - # Tell Clang using MS CRT to use main instead of WinMain - set_target_properties(${GUI_ONLY_BINARIES} PROPERTIES - LINK_FLAGS "-Wl,/entry:mainCRTStartup") -endif() - -if (APPLE) - set_target_properties(empty PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Empty Event") - set_target_properties(gamma PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Gamma") - set_target_properties(inputlag PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Input Lag") - set_target_properties(joysticks PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Joysticks") - set_target_properties(tearing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Tearing") - set_target_properties(threads PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Threads") - set_target_properties(timeout PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Timeout") - set_target_properties(title PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Title") - set_target_properties(window PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Window") - - set_target_properties(${GUI_ONLY_BINARIES} PROPERTIES - MACOSX_BUNDLE_SHORT_VERSION_STRING ${GLFW_VERSION} - MACOSX_BUNDLE_LONG_VERSION_STRING ${GLFW_VERSION} - MACOSX_BUNDLE_INFO_PLIST "${GLFW_SOURCE_DIR}/CMake/Info.plist.in") -endif() - diff --git a/3rdparty/glfw/source/tests/allocator.c b/3rdparty/glfw/source/tests/allocator.c deleted file mode 100644 index 3fb004d..0000000 --- a/3rdparty/glfw/source/tests/allocator.c +++ /dev/null @@ -1,142 +0,0 @@ -//======================================================================== -// Custom heap allocator test -// Copyright (c) Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#include -#include -#include - -#define CALL(x) (function_name = #x, x) -static const char* function_name = NULL; - -struct allocator_stats -{ - size_t total; - size_t current; - size_t maximum; -}; - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void* allocate(size_t size, void* user) -{ - struct allocator_stats* stats = user; - assert(size > 0); - - stats->total += size; - stats->current += size; - if (stats->current > stats->maximum) - stats->maximum = stats->current; - - printf("%s: allocate %zu bytes (current %zu maximum %zu total %zu)\n", - function_name, size, stats->current, stats->maximum, stats->total); - - size_t* real_block = malloc(size + sizeof(size_t)); - assert(real_block != NULL); - *real_block = size; - return real_block + 1; -} - -static void deallocate(void* block, void* user) -{ - struct allocator_stats* stats = user; - assert(block != NULL); - - size_t* real_block = (size_t*) block - 1; - stats->current -= *real_block; - - printf("%s: deallocate %zu bytes (current %zu maximum %zu total %zu)\n", - function_name, *real_block, stats->current, stats->maximum, stats->total); - - free(real_block); -} - -static void* reallocate(void* block, size_t size, void* user) -{ - struct allocator_stats* stats = user; - assert(block != NULL); - assert(size > 0); - - size_t* real_block = (size_t*) block - 1; - stats->total += size; - stats->current += size - *real_block; - if (stats->current > stats->maximum) - stats->maximum = stats->current; - - printf("%s: reallocate %zu bytes to %zu bytes (current %zu maximum %zu total %zu)\n", - function_name, *real_block, size, stats->current, stats->maximum, stats->total); - - real_block = realloc(real_block, size + sizeof(size_t)); - assert(real_block != NULL); - *real_block = size; - return real_block + 1; -} - -int main(void) -{ - struct allocator_stats stats = {0}; - const GLFWallocator allocator = - { - .allocate = allocate, - .deallocate = deallocate, - .reallocate = reallocate, - .user = &stats - }; - - glfwSetErrorCallback(error_callback); - glfwInitAllocator(&allocator); - - if (!CALL(glfwInit)()) - exit(EXIT_FAILURE); - - GLFWwindow* window = CALL(glfwCreateWindow)(400, 400, "Custom allocator test", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - CALL(glfwMakeContextCurrent)(window); - gladLoadGL(glfwGetProcAddress); - CALL(glfwSwapInterval)(1); - - while (!CALL(glfwWindowShouldClose)(window)) - { - glClear(GL_COLOR_BUFFER_BIT); - CALL(glfwSwapBuffers)(window); - CALL(glfwWaitEvents)(); - } - - CALL(glfwTerminate)(); - exit(EXIT_SUCCESS); -} - diff --git a/3rdparty/glfw/source/tests/clipboard.c b/3rdparty/glfw/source/tests/clipboard.c deleted file mode 100644 index eaad516..0000000 --- a/3rdparty/glfw/source/tests/clipboard.c +++ /dev/null @@ -1,146 +0,0 @@ -//======================================================================== -// Clipboard test program -// Copyright (c) Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This program is used to test the clipboard functionality. -// -//======================================================================== - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#include -#include - -#include "getopt.h" - -#if defined(__APPLE__) - #define MODIFIER GLFW_MOD_SUPER -#else - #define MODIFIER GLFW_MOD_CONTROL -#endif - -static void usage(void) -{ - printf("Usage: clipboard [-h]\n"); -} - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_ESCAPE: - glfwSetWindowShouldClose(window, GLFW_TRUE); - break; - - case GLFW_KEY_V: - if (mods == MODIFIER) - { - const char* string; - - string = glfwGetClipboardString(NULL); - if (string) - printf("Clipboard contains \"%s\"\n", string); - else - printf("Clipboard does not contain a string\n"); - } - break; - - case GLFW_KEY_C: - if (mods == MODIFIER) - { - const char* string = "Hello GLFW World!"; - glfwSetClipboardString(NULL, string); - printf("Setting clipboard to \"%s\"\n", string); - } - break; - } -} - -int main(int argc, char** argv) -{ - int ch; - GLFWwindow* window; - - while ((ch = getopt(argc, argv, "h")) != -1) - { - switch (ch) - { - case 'h': - usage(); - exit(EXIT_SUCCESS); - - default: - usage(); - exit(EXIT_FAILURE); - } - } - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - { - fprintf(stderr, "Failed to initialize GLFW\n"); - exit(EXIT_FAILURE); - } - - window = glfwCreateWindow(200, 200, "Clipboard Test", NULL, NULL); - if (!window) - { - glfwTerminate(); - - fprintf(stderr, "Failed to open GLFW window\n"); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - gladLoadGL(glfwGetProcAddress); - glfwSwapInterval(1); - - glfwSetKeyCallback(window, key_callback); - - glClearColor(0.5f, 0.5f, 0.5f, 0); - - while (!glfwWindowShouldClose(window)) - { - glClear(GL_COLOR_BUFFER_BIT); - - glfwSwapBuffers(window); - glfwWaitEvents(); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/3rdparty/glfw/source/tests/cursor.c b/3rdparty/glfw/source/tests/cursor.c deleted file mode 100644 index 9be4274..0000000 --- a/3rdparty/glfw/source/tests/cursor.c +++ /dev/null @@ -1,489 +0,0 @@ -//======================================================================== -// Cursor & input mode tests -// Copyright (c) Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This test provides an interface to the cursor image and cursor mode -// parts of the API. -// -// Custom cursor image generation by urraka. -// -//======================================================================== - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#if defined(_MSC_VER) - // Make MS math.h define M_PI - #define _USE_MATH_DEFINES -#endif - -#include -#include -#include - -#include "linmath.h" - -#define CURSOR_FRAME_COUNT 60 - -static const char* vertex_shader_text = -"#version 110\n" -"uniform mat4 MVP;\n" -"attribute vec2 vPos;\n" -"void main()\n" -"{\n" -" gl_Position = MVP * vec4(vPos, 0.0, 1.0);\n" -"}\n"; - -static const char* fragment_shader_text = -"#version 110\n" -"void main()\n" -"{\n" -" gl_FragColor = vec4(1.0);\n" -"}\n"; - -static double cursor_x; -static double cursor_y; -static int swap_interval = 1; -static int wait_events = GLFW_TRUE; -static int animate_cursor = GLFW_FALSE; -static int track_cursor = GLFW_FALSE; -static GLFWcursor* standard_cursors[10]; -static GLFWcursor* tracking_cursor = NULL; - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static float star(int x, int y, float t) -{ - const float c = 64 / 2.f; - - const float i = (0.25f * (float) sin(2.f * M_PI * t) + 0.75f); - const float k = 64 * 0.046875f * i; - - const float dist = (float) sqrt((x - c) * (x - c) + (y - c) * (y - c)); - - const float salpha = 1.f - dist / c; - const float xalpha = (float) x == c ? c : k / (float) fabs(x - c); - const float yalpha = (float) y == c ? c : k / (float) fabs(y - c); - - return (float) fmax(0.f, fmin(1.f, i * salpha * 0.2f + salpha * xalpha * yalpha)); -} - -static GLFWcursor* create_cursor_frame(float t) -{ - int i = 0, x, y; - unsigned char buffer[64 * 64 * 4]; - const GLFWimage image = { 64, 64, buffer }; - - for (y = 0; y < image.width; y++) - { - for (x = 0; x < image.height; x++) - { - buffer[i++] = 255; - buffer[i++] = 255; - buffer[i++] = 255; - buffer[i++] = (unsigned char) (255 * star(x, y, t)); - } - } - - return glfwCreateCursor(&image, image.width / 2, image.height / 2); -} - -static GLFWcursor* create_tracking_cursor(void) -{ - int i = 0, x, y; - unsigned char buffer[32 * 32 * 4]; - const GLFWimage image = { 32, 32, buffer }; - - for (y = 0; y < image.width; y++) - { - for (x = 0; x < image.height; x++) - { - if (x == 7 || y == 7) - { - buffer[i++] = 255; - buffer[i++] = 0; - buffer[i++] = 0; - buffer[i++] = 255; - } - else - { - buffer[i++] = 0; - buffer[i++] = 0; - buffer[i++] = 0; - buffer[i++] = 0; - } - } - } - - return glfwCreateCursor(&image, 7, 7); -} - -static void cursor_position_callback(GLFWwindow* window, double x, double y) -{ - printf("%0.3f: Cursor position: %f %f (%+f %+f)\n", - glfwGetTime(), - x, y, x - cursor_x, y - cursor_y); - - cursor_x = x; - cursor_y = y; -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_A: - { - animate_cursor = !animate_cursor; - if (!animate_cursor) - glfwSetCursor(window, NULL); - - break; - } - - case GLFW_KEY_ESCAPE: - { - if (glfwGetInputMode(window, GLFW_CURSOR) != GLFW_CURSOR_DISABLED) - { - glfwSetWindowShouldClose(window, GLFW_TRUE); - break; - } - - /* FALLTHROUGH */ - } - - case GLFW_KEY_N: - glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL); - glfwGetCursorPos(window, &cursor_x, &cursor_y); - printf("(( cursor is normal ))\n"); - break; - - case GLFW_KEY_D: - glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED); - printf("(( cursor is disabled ))\n"); - break; - - case GLFW_KEY_H: - glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_HIDDEN); - printf("(( cursor is hidden ))\n"); - break; - - case GLFW_KEY_R: - if (!glfwRawMouseMotionSupported()) - break; - - if (glfwGetInputMode(window, GLFW_RAW_MOUSE_MOTION)) - { - glfwSetInputMode(window, GLFW_RAW_MOUSE_MOTION, GLFW_FALSE); - printf("(( raw input is disabled ))\n"); - } - else - { - glfwSetInputMode(window, GLFW_RAW_MOUSE_MOTION, GLFW_TRUE); - printf("(( raw input is enabled ))\n"); - } - break; - - case GLFW_KEY_SPACE: - swap_interval = 1 - swap_interval; - printf("(( swap interval: %i ))\n", swap_interval); - glfwSwapInterval(swap_interval); - break; - - case GLFW_KEY_W: - wait_events = !wait_events; - printf("(( %sing for events ))\n", wait_events ? "wait" : "poll"); - break; - - case GLFW_KEY_T: - track_cursor = !track_cursor; - if (track_cursor) - glfwSetCursor(window, tracking_cursor); - else - glfwSetCursor(window, NULL); - - break; - - case GLFW_KEY_P: - { - double x, y; - glfwGetCursorPos(window, &x, &y); - - printf("Query before set: %f %f (%+f %+f)\n", - x, y, x - cursor_x, y - cursor_y); - cursor_x = x; - cursor_y = y; - - glfwSetCursorPos(window, cursor_x, cursor_y); - glfwGetCursorPos(window, &x, &y); - - printf("Query after set: %f %f (%+f %+f)\n", - x, y, x - cursor_x, y - cursor_y); - cursor_x = x; - cursor_y = y; - break; - } - - case GLFW_KEY_UP: - glfwSetCursorPos(window, 0, 0); - glfwGetCursorPos(window, &cursor_x, &cursor_y); - break; - - case GLFW_KEY_DOWN: - { - int width, height; - glfwGetWindowSize(window, &width, &height); - glfwSetCursorPos(window, width - 1, height - 1); - glfwGetCursorPos(window, &cursor_x, &cursor_y); - break; - } - - case GLFW_KEY_0: - glfwSetCursor(window, NULL); - break; - - case GLFW_KEY_1: - case GLFW_KEY_2: - case GLFW_KEY_3: - case GLFW_KEY_4: - case GLFW_KEY_5: - case GLFW_KEY_6: - case GLFW_KEY_7: - case GLFW_KEY_8: - case GLFW_KEY_9: - { - int index = key - GLFW_KEY_1; - if (mods & GLFW_MOD_SHIFT) - index += 9; - - if (index < sizeof(standard_cursors) / sizeof(standard_cursors[0])) - glfwSetCursor(window, standard_cursors[index]); - - break; - } - - case GLFW_KEY_F11: - case GLFW_KEY_ENTER: - { - static int x, y, width, height; - - if (mods != GLFW_MOD_ALT) - return; - - if (glfwGetWindowMonitor(window)) - glfwSetWindowMonitor(window, NULL, x, y, width, height, 0); - else - { - GLFWmonitor* monitor = glfwGetPrimaryMonitor(); - const GLFWvidmode* mode = glfwGetVideoMode(monitor); - glfwGetWindowPos(window, &x, &y); - glfwGetWindowSize(window, &width, &height); - glfwSetWindowMonitor(window, monitor, - 0, 0, mode->width, mode->height, - mode->refreshRate); - } - - glfwGetCursorPos(window, &cursor_x, &cursor_y); - break; - } - } -} - -int main(void) -{ - int i; - GLFWwindow* window; - GLFWcursor* star_cursors[CURSOR_FRAME_COUNT]; - GLFWcursor* current_frame = NULL; - GLuint vertex_buffer, vertex_shader, fragment_shader, program; - GLint mvp_location, vpos_location; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - tracking_cursor = create_tracking_cursor(); - if (!tracking_cursor) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - for (i = 0; i < CURSOR_FRAME_COUNT; i++) - { - star_cursors[i] = create_cursor_frame(i / (float) CURSOR_FRAME_COUNT); - if (!star_cursors[i]) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - } - - for (i = 0; i < sizeof(standard_cursors) / sizeof(standard_cursors[0]); i++) - { - const int shapes[] = { - GLFW_ARROW_CURSOR, - GLFW_IBEAM_CURSOR, - GLFW_CROSSHAIR_CURSOR, - GLFW_POINTING_HAND_CURSOR, - GLFW_RESIZE_EW_CURSOR, - GLFW_RESIZE_NS_CURSOR, - GLFW_RESIZE_NWSE_CURSOR, - GLFW_RESIZE_NESW_CURSOR, - GLFW_RESIZE_ALL_CURSOR, - GLFW_NOT_ALLOWED_CURSOR - }; - - standard_cursors[i] = glfwCreateStandardCursor(shapes[i]); - } - - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); - - window = glfwCreateWindow(640, 480, "Cursor Test", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - gladLoadGL(glfwGetProcAddress); - - glGenBuffers(1, &vertex_buffer); - glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer); - - vertex_shader = glCreateShader(GL_VERTEX_SHADER); - glShaderSource(vertex_shader, 1, &vertex_shader_text, NULL); - glCompileShader(vertex_shader); - - fragment_shader = glCreateShader(GL_FRAGMENT_SHADER); - glShaderSource(fragment_shader, 1, &fragment_shader_text, NULL); - glCompileShader(fragment_shader); - - program = glCreateProgram(); - glAttachShader(program, vertex_shader); - glAttachShader(program, fragment_shader); - glLinkProgram(program); - - mvp_location = glGetUniformLocation(program, "MVP"); - vpos_location = glGetAttribLocation(program, "vPos"); - - glEnableVertexAttribArray(vpos_location); - glVertexAttribPointer(vpos_location, 2, GL_FLOAT, GL_FALSE, - sizeof(vec2), (void*) 0); - glUseProgram(program); - - glfwGetCursorPos(window, &cursor_x, &cursor_y); - printf("Cursor position: %f %f\n", cursor_x, cursor_y); - - glfwSetCursorPosCallback(window, cursor_position_callback); - glfwSetKeyCallback(window, key_callback); - - while (!glfwWindowShouldClose(window)) - { - glClear(GL_COLOR_BUFFER_BIT); - - if (track_cursor) - { - int wnd_width, wnd_height, fb_width, fb_height; - float scale; - vec2 vertices[4]; - mat4x4 mvp; - - glfwGetWindowSize(window, &wnd_width, &wnd_height); - glfwGetFramebufferSize(window, &fb_width, &fb_height); - - glViewport(0, 0, fb_width, fb_height); - - scale = (float) fb_width / (float) wnd_width; - vertices[0][0] = 0.5f; - vertices[0][1] = (float) (fb_height - floor(cursor_y * scale) - 1.f + 0.5f); - vertices[1][0] = (float) fb_width + 0.5f; - vertices[1][1] = (float) (fb_height - floor(cursor_y * scale) - 1.f + 0.5f); - vertices[2][0] = (float) floor(cursor_x * scale) + 0.5f; - vertices[2][1] = 0.5f; - vertices[3][0] = (float) floor(cursor_x * scale) + 0.5f; - vertices[3][1] = (float) fb_height + 0.5f; - - glBufferData(GL_ARRAY_BUFFER, - sizeof(vertices), - vertices, - GL_STREAM_DRAW); - - mat4x4_ortho(mvp, 0.f, (float) fb_width, 0.f, (float) fb_height, 0.f, 1.f); - glUniformMatrix4fv(mvp_location, 1, GL_FALSE, (const GLfloat*) mvp); - - glDrawArrays(GL_LINES, 0, 4); - } - - glfwSwapBuffers(window); - - if (animate_cursor) - { - const int i = (int) (glfwGetTime() * 30.0) % CURSOR_FRAME_COUNT; - if (current_frame != star_cursors[i]) - { - glfwSetCursor(window, star_cursors[i]); - current_frame = star_cursors[i]; - } - } - else - current_frame = NULL; - - if (wait_events) - { - if (animate_cursor) - glfwWaitEventsTimeout(1.0 / 30.0); - else - glfwWaitEvents(); - } - else - glfwPollEvents(); - - // Workaround for an issue with msvcrt and mintty - fflush(stdout); - } - - glfwDestroyWindow(window); - - for (i = 0; i < CURSOR_FRAME_COUNT; i++) - glfwDestroyCursor(star_cursors[i]); - - for (i = 0; i < sizeof(standard_cursors) / sizeof(standard_cursors[0]); i++) - glfwDestroyCursor(standard_cursors[i]); - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/3rdparty/glfw/source/tests/empty.c b/3rdparty/glfw/source/tests/empty.c deleted file mode 100644 index 72caccb..0000000 --- a/3rdparty/glfw/source/tests/empty.c +++ /dev/null @@ -1,133 +0,0 @@ -//======================================================================== -// Empty event test -// Copyright (c) Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This test is intended to verify that posting of empty events works -// -//======================================================================== - -#include "tinycthread.h" - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#include -#include -#include - -static volatile int running = GLFW_TRUE; - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static int thread_main(void* data) -{ - struct timespec time; - - while (running) - { - clock_gettime(CLOCK_REALTIME, &time); - time.tv_sec += 1; - thrd_sleep(&time, NULL); - - glfwPostEmptyEvent(); - } - - return 0; -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) - glfwSetWindowShouldClose(window, GLFW_TRUE); -} - -static float nrand(void) -{ - return (float) rand() / (float) RAND_MAX; -} - -int main(void) -{ - int result; - thrd_t thread; - GLFWwindow* window; - - srand((unsigned int) time(NULL)); - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - window = glfwCreateWindow(640, 480, "Empty Event Test", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - gladLoadGL(glfwGetProcAddress); - glfwSetKeyCallback(window, key_callback); - - if (thrd_create(&thread, thread_main, NULL) != thrd_success) - { - fprintf(stderr, "Failed to create secondary thread\n"); - - glfwTerminate(); - exit(EXIT_FAILURE); - } - - while (running) - { - int width, height; - float r = nrand(), g = nrand(), b = nrand(); - float l = (float) sqrt(r * r + g * g + b * b); - - glfwGetFramebufferSize(window, &width, &height); - - glViewport(0, 0, width, height); - glClearColor(r / l, g / l, b / l, 1.f); - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(window); - - glfwWaitEvents(); - - if (glfwWindowShouldClose(window)) - running = GLFW_FALSE; - } - - glfwHideWindow(window); - thrd_join(thread, &result); - glfwDestroyWindow(window); - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/3rdparty/glfw/source/tests/events.c b/3rdparty/glfw/source/tests/events.c deleted file mode 100644 index f14449a..0000000 --- a/3rdparty/glfw/source/tests/events.c +++ /dev/null @@ -1,692 +0,0 @@ -//======================================================================== -// Event linter (event spewer) -// Copyright (c) Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This test hooks every available callback and outputs their arguments -// -// Log messages go to stdout, error messages to stderr -// -// Every event also gets a (sequential) number to aid discussion of logs -// -//======================================================================== - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#include -#include -#include -#include -#include - -#include "getopt.h" - -// Event index -static unsigned int counter = 0; - -typedef struct -{ - GLFWwindow* window; - int number; - int closeable; -} Slot; - -static void usage(void) -{ - printf("Usage: events [-f] [-h] [-n WINDOWS]\n"); - printf("Options:\n"); - printf(" -f use full screen\n"); - printf(" -h show this help\n"); - printf(" -n the number of windows to create\n"); -} - -static const char* get_key_name(int key) -{ - switch (key) - { - // Printable keys - case GLFW_KEY_A: return "A"; - case GLFW_KEY_B: return "B"; - case GLFW_KEY_C: return "C"; - case GLFW_KEY_D: return "D"; - case GLFW_KEY_E: return "E"; - case GLFW_KEY_F: return "F"; - case GLFW_KEY_G: return "G"; - case GLFW_KEY_H: return "H"; - case GLFW_KEY_I: return "I"; - case GLFW_KEY_J: return "J"; - case GLFW_KEY_K: return "K"; - case GLFW_KEY_L: return "L"; - case GLFW_KEY_M: return "M"; - case GLFW_KEY_N: return "N"; - case GLFW_KEY_O: return "O"; - case GLFW_KEY_P: return "P"; - case GLFW_KEY_Q: return "Q"; - case GLFW_KEY_R: return "R"; - case GLFW_KEY_S: return "S"; - case GLFW_KEY_T: return "T"; - case GLFW_KEY_U: return "U"; - case GLFW_KEY_V: return "V"; - case GLFW_KEY_W: return "W"; - case GLFW_KEY_X: return "X"; - case GLFW_KEY_Y: return "Y"; - case GLFW_KEY_Z: return "Z"; - case GLFW_KEY_1: return "1"; - case GLFW_KEY_2: return "2"; - case GLFW_KEY_3: return "3"; - case GLFW_KEY_4: return "4"; - case GLFW_KEY_5: return "5"; - case GLFW_KEY_6: return "6"; - case GLFW_KEY_7: return "7"; - case GLFW_KEY_8: return "8"; - case GLFW_KEY_9: return "9"; - case GLFW_KEY_0: return "0"; - case GLFW_KEY_SPACE: return "SPACE"; - case GLFW_KEY_MINUS: return "MINUS"; - case GLFW_KEY_EQUAL: return "EQUAL"; - case GLFW_KEY_LEFT_BRACKET: return "LEFT BRACKET"; - case GLFW_KEY_RIGHT_BRACKET: return "RIGHT BRACKET"; - case GLFW_KEY_BACKSLASH: return "BACKSLASH"; - case GLFW_KEY_SEMICOLON: return "SEMICOLON"; - case GLFW_KEY_APOSTROPHE: return "APOSTROPHE"; - case GLFW_KEY_GRAVE_ACCENT: return "GRAVE ACCENT"; - case GLFW_KEY_COMMA: return "COMMA"; - case GLFW_KEY_PERIOD: return "PERIOD"; - case GLFW_KEY_SLASH: return "SLASH"; - case GLFW_KEY_WORLD_1: return "WORLD 1"; - case GLFW_KEY_WORLD_2: return "WORLD 2"; - - // Function keys - case GLFW_KEY_ESCAPE: return "ESCAPE"; - case GLFW_KEY_F1: return "F1"; - case GLFW_KEY_F2: return "F2"; - case GLFW_KEY_F3: return "F3"; - case GLFW_KEY_F4: return "F4"; - case GLFW_KEY_F5: return "F5"; - case GLFW_KEY_F6: return "F6"; - case GLFW_KEY_F7: return "F7"; - case GLFW_KEY_F8: return "F8"; - case GLFW_KEY_F9: return "F9"; - case GLFW_KEY_F10: return "F10"; - case GLFW_KEY_F11: return "F11"; - case GLFW_KEY_F12: return "F12"; - case GLFW_KEY_F13: return "F13"; - case GLFW_KEY_F14: return "F14"; - case GLFW_KEY_F15: return "F15"; - case GLFW_KEY_F16: return "F16"; - case GLFW_KEY_F17: return "F17"; - case GLFW_KEY_F18: return "F18"; - case GLFW_KEY_F19: return "F19"; - case GLFW_KEY_F20: return "F20"; - case GLFW_KEY_F21: return "F21"; - case GLFW_KEY_F22: return "F22"; - case GLFW_KEY_F23: return "F23"; - case GLFW_KEY_F24: return "F24"; - case GLFW_KEY_F25: return "F25"; - case GLFW_KEY_UP: return "UP"; - case GLFW_KEY_DOWN: return "DOWN"; - case GLFW_KEY_LEFT: return "LEFT"; - case GLFW_KEY_RIGHT: return "RIGHT"; - case GLFW_KEY_LEFT_SHIFT: return "LEFT SHIFT"; - case GLFW_KEY_RIGHT_SHIFT: return "RIGHT SHIFT"; - case GLFW_KEY_LEFT_CONTROL: return "LEFT CONTROL"; - case GLFW_KEY_RIGHT_CONTROL: return "RIGHT CONTROL"; - case GLFW_KEY_LEFT_ALT: return "LEFT ALT"; - case GLFW_KEY_RIGHT_ALT: return "RIGHT ALT"; - case GLFW_KEY_TAB: return "TAB"; - case GLFW_KEY_ENTER: return "ENTER"; - case GLFW_KEY_BACKSPACE: return "BACKSPACE"; - case GLFW_KEY_INSERT: return "INSERT"; - case GLFW_KEY_DELETE: return "DELETE"; - case GLFW_KEY_PAGE_UP: return "PAGE UP"; - case GLFW_KEY_PAGE_DOWN: return "PAGE DOWN"; - case GLFW_KEY_HOME: return "HOME"; - case GLFW_KEY_END: return "END"; - case GLFW_KEY_KP_0: return "KEYPAD 0"; - case GLFW_KEY_KP_1: return "KEYPAD 1"; - case GLFW_KEY_KP_2: return "KEYPAD 2"; - case GLFW_KEY_KP_3: return "KEYPAD 3"; - case GLFW_KEY_KP_4: return "KEYPAD 4"; - case GLFW_KEY_KP_5: return "KEYPAD 5"; - case GLFW_KEY_KP_6: return "KEYPAD 6"; - case GLFW_KEY_KP_7: return "KEYPAD 7"; - case GLFW_KEY_KP_8: return "KEYPAD 8"; - case GLFW_KEY_KP_9: return "KEYPAD 9"; - case GLFW_KEY_KP_DIVIDE: return "KEYPAD DIVIDE"; - case GLFW_KEY_KP_MULTIPLY: return "KEYPAD MULTIPLY"; - case GLFW_KEY_KP_SUBTRACT: return "KEYPAD SUBTRACT"; - case GLFW_KEY_KP_ADD: return "KEYPAD ADD"; - case GLFW_KEY_KP_DECIMAL: return "KEYPAD DECIMAL"; - case GLFW_KEY_KP_EQUAL: return "KEYPAD EQUAL"; - case GLFW_KEY_KP_ENTER: return "KEYPAD ENTER"; - case GLFW_KEY_PRINT_SCREEN: return "PRINT SCREEN"; - case GLFW_KEY_NUM_LOCK: return "NUM LOCK"; - case GLFW_KEY_CAPS_LOCK: return "CAPS LOCK"; - case GLFW_KEY_SCROLL_LOCK: return "SCROLL LOCK"; - case GLFW_KEY_PAUSE: return "PAUSE"; - case GLFW_KEY_LEFT_SUPER: return "LEFT SUPER"; - case GLFW_KEY_RIGHT_SUPER: return "RIGHT SUPER"; - case GLFW_KEY_MENU: return "MENU"; - - default: return "UNKNOWN"; - } -} - -static const char* get_action_name(int action) -{ - switch (action) - { - case GLFW_PRESS: - return "pressed"; - case GLFW_RELEASE: - return "released"; - case GLFW_REPEAT: - return "repeated"; - } - - return "caused unknown action"; -} - -static const char* get_button_name(int button) -{ - switch (button) - { - case GLFW_MOUSE_BUTTON_LEFT: - return "left"; - case GLFW_MOUSE_BUTTON_RIGHT: - return "right"; - case GLFW_MOUSE_BUTTON_MIDDLE: - return "middle"; - default: - { - static char name[16]; - snprintf(name, sizeof(name), "%i", button); - return name; - } - } -} - -static const char* get_mods_name(int mods) -{ - static char name[512]; - - if (mods == 0) - return " no mods"; - - name[0] = '\0'; - - if (mods & GLFW_MOD_SHIFT) - strcat(name, " shift"); - if (mods & GLFW_MOD_CONTROL) - strcat(name, " control"); - if (mods & GLFW_MOD_ALT) - strcat(name, " alt"); - if (mods & GLFW_MOD_SUPER) - strcat(name, " super"); - if (mods & GLFW_MOD_CAPS_LOCK) - strcat(name, " capslock-on"); - if (mods & GLFW_MOD_NUM_LOCK) - strcat(name, " numlock-on"); - - return name; -} - -static size_t encode_utf8(char* s, unsigned int ch) -{ - size_t count = 0; - - if (ch < 0x80) - s[count++] = (char) ch; - else if (ch < 0x800) - { - s[count++] = (ch >> 6) | 0xc0; - s[count++] = (ch & 0x3f) | 0x80; - } - else if (ch < 0x10000) - { - s[count++] = (ch >> 12) | 0xe0; - s[count++] = ((ch >> 6) & 0x3f) | 0x80; - s[count++] = (ch & 0x3f) | 0x80; - } - else if (ch < 0x110000) - { - s[count++] = (ch >> 18) | 0xf0; - s[count++] = ((ch >> 12) & 0x3f) | 0x80; - s[count++] = ((ch >> 6) & 0x3f) | 0x80; - s[count++] = (ch & 0x3f) | 0x80; - } - - return count; -} - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void window_pos_callback(GLFWwindow* window, int x, int y) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Window position: %i %i\n", - counter++, slot->number, glfwGetTime(), x, y); -} - -static void window_size_callback(GLFWwindow* window, int width, int height) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Window size: %i %i\n", - counter++, slot->number, glfwGetTime(), width, height); -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Framebuffer size: %i %i\n", - counter++, slot->number, glfwGetTime(), width, height); -} - -static void window_content_scale_callback(GLFWwindow* window, float xscale, float yscale) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Window content scale: %0.3f %0.3f\n", - counter++, slot->number, glfwGetTime(), xscale, yscale); -} - -static void window_close_callback(GLFWwindow* window) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Window close\n", - counter++, slot->number, glfwGetTime()); - - if (!slot->closeable) - { - printf("(( closing is disabled, press %s to re-enable )\n", - glfwGetKeyName(GLFW_KEY_C, 0)); - } - - glfwSetWindowShouldClose(window, slot->closeable); -} - -static void window_refresh_callback(GLFWwindow* window) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Window refresh\n", - counter++, slot->number, glfwGetTime()); - - glfwMakeContextCurrent(window); - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(window); -} - -static void window_focus_callback(GLFWwindow* window, int focused) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Window %s\n", - counter++, slot->number, glfwGetTime(), - focused ? "focused" : "defocused"); -} - -static void window_iconify_callback(GLFWwindow* window, int iconified) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Window was %s\n", - counter++, slot->number, glfwGetTime(), - iconified ? "iconified" : "uniconified"); -} - -static void window_maximize_callback(GLFWwindow* window, int maximized) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Window was %s\n", - counter++, slot->number, glfwGetTime(), - maximized ? "maximized" : "unmaximized"); -} - -static void mouse_button_callback(GLFWwindow* window, int button, int action, int mods) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Mouse button %i (%s) (with%s) was %s\n", - counter++, slot->number, glfwGetTime(), button, - get_button_name(button), - get_mods_name(mods), - get_action_name(action)); -} - -static void cursor_position_callback(GLFWwindow* window, double x, double y) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Cursor position: %f %f\n", - counter++, slot->number, glfwGetTime(), x, y); -} - -static void cursor_enter_callback(GLFWwindow* window, int entered) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Cursor %s window\n", - counter++, slot->number, glfwGetTime(), - entered ? "entered" : "left"); -} - -static void scroll_callback(GLFWwindow* window, double x, double y) -{ - Slot* slot = glfwGetWindowUserPointer(window); - printf("%08x to %i at %0.3f: Scroll: %0.3f %0.3f\n", - counter++, slot->number, glfwGetTime(), x, y); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - Slot* slot = glfwGetWindowUserPointer(window); - const char* name = glfwGetKeyName(key, scancode); - - GLFWkeyboard* keyboard = glfwGetLastActiveKeyboard(); - - if (name) - { - printf("%08x to %i at %0.3f: Key 0x%04x Scancode 0x%04x Keyboard %s (%s) (%s) (with%s) was %s\n", - counter++, slot->number, glfwGetTime(), key, scancode, - keyboard ? glfwGetKeyboardName(keyboard) : "NULL", - get_key_name(key), - name, - get_mods_name(mods), - get_action_name(action)); - } - else - { - printf("%08x to %i at %0.3f: Key 0x%04x Scancode 0x%04x Keyboard %s (%s) (with%s) was %s\n", - counter++, slot->number, glfwGetTime(), key, scancode, - keyboard ? glfwGetKeyboardName(keyboard) : "NULL", - get_key_name(key), - get_mods_name(mods), - get_action_name(action)); - } - - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_C: - { - slot->closeable = !slot->closeable; - - printf("(( closing %s ))\n", slot->closeable ? "enabled" : "disabled"); - break; - } - - case GLFW_KEY_L: - { - const int state = glfwGetInputMode(window, GLFW_LOCK_KEY_MODS); - glfwSetInputMode(window, GLFW_LOCK_KEY_MODS, !state); - - printf("(( lock key mods %s ))\n", !state ? "enabled" : "disabled"); - break; - } - } -} - -static void char_callback(GLFWwindow* window, unsigned int codepoint) -{ - Slot* slot = glfwGetWindowUserPointer(window); - char string[5] = ""; - - encode_utf8(string, codepoint); - printf("%08x to %i at %0.3f: Character 0x%08x (%s) input\n", - counter++, slot->number, glfwGetTime(), codepoint, string); -} - -static void drop_callback(GLFWwindow* window, int count, const char* paths[]) -{ - int i; - Slot* slot = glfwGetWindowUserPointer(window); - - printf("%08x to %i at %0.3f: Drop input\n", - counter++, slot->number, glfwGetTime()); - - for (i = 0; i < count; i++) - printf(" %i: \"%s\"\n", i, paths[i]); -} - -static void monitor_callback(GLFWmonitor* monitor, int event) -{ - if (event == GLFW_CONNECTED) - { - int x, y, widthMM, heightMM; - const GLFWvidmode* mode = glfwGetVideoMode(monitor); - - glfwGetMonitorPos(monitor, &x, &y); - glfwGetMonitorPhysicalSize(monitor, &widthMM, &heightMM); - - printf("%08x at %0.3f: Monitor %s (%ix%i at %ix%i, %ix%i mm) was connected\n", - counter++, - glfwGetTime(), - glfwGetMonitorName(monitor), - mode->width, mode->height, - x, y, - widthMM, heightMM); - } - else if (event == GLFW_DISCONNECTED) - { - printf("%08x at %0.3f: Monitor %s was disconnected\n", - counter++, - glfwGetTime(), - glfwGetMonitorName(monitor)); - } -} - -static void keyboard_callback(GLFWkeyboard* keyboard, int event) -{ - if (event == GLFW_CONNECTED) - { - printf("%08x at %0.3f: Keyboard %s was connected\n", - counter++, glfwGetTime(), - glfwGetKeyboardName(keyboard)); - } - else if (event == GLFW_DISCONNECTED) - { - printf("%08x at %0.3f: Keyboard %s was disconnected\n", - counter++, glfwGetTime(), - glfwGetKeyboardName(keyboard)); - } -} - -static void joystick_callback(int jid, int event) -{ - if (event == GLFW_CONNECTED) - { - int axisCount, buttonCount, hatCount; - - glfwGetJoystickAxes(jid, &axisCount); - glfwGetJoystickButtons(jid, &buttonCount); - glfwGetJoystickHats(jid, &hatCount); - - printf("%08x at %0.3f: Joystick %i (%s) was connected with %i axes, %i buttons, and %i hats\n", - counter++, glfwGetTime(), - jid, - glfwGetJoystickName(jid), - axisCount, - buttonCount, - hatCount); - - if (glfwJoystickIsGamepad(jid)) - { - printf(" Joystick %i (%s) has a gamepad mapping (%s)\n", - jid, - glfwGetJoystickGUID(jid), - glfwGetGamepadName(jid)); - } - else - { - printf(" Joystick %i (%s) has no gamepad mapping\n", - jid, - glfwGetJoystickGUID(jid)); - } - } - else - { - printf("%08x at %0.3f: Joystick %i was disconnected\n", - counter++, glfwGetTime(), jid); - } -} - -int main(int argc, char** argv) -{ - Slot* slots; - GLFWmonitor* monitor = NULL; - int ch, i, width, height, count = 1; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - printf("Library initialized\n"); - - glfwSetMonitorCallback(monitor_callback); - glfwSetKeyboardCallback(keyboard_callback); - glfwSetJoystickCallback(joystick_callback); - - while ((ch = getopt(argc, argv, "hfn:")) != -1) - { - switch (ch) - { - case 'h': - usage(); - exit(EXIT_SUCCESS); - - case 'f': - monitor = glfwGetPrimaryMonitor(); - break; - - case 'n': - count = (int) strtoul(optarg, NULL, 10); - break; - - default: - usage(); - exit(EXIT_FAILURE); - } - } - - if (monitor) - { - const GLFWvidmode* mode = glfwGetVideoMode(monitor); - - glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate); - glfwWindowHint(GLFW_RED_BITS, mode->redBits); - glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits); - glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits); - - width = mode->width; - height = mode->height; - } - else - { - width = 640; - height = 480; - } - - slots = calloc(count, sizeof(Slot)); - - for (i = 0; i < count; i++) - { - char title[128]; - - slots[i].closeable = GLFW_TRUE; - slots[i].number = i + 1; - - snprintf(title, sizeof(title), "Event Linter (Window %i)", slots[i].number); - - if (monitor) - { - printf("Creating full screen window %i (%ix%i on %s)\n", - slots[i].number, - width, height, - glfwGetMonitorName(monitor)); - } - else - { - printf("Creating windowed mode window %i (%ix%i)\n", - slots[i].number, - width, height); - } - - slots[i].window = glfwCreateWindow(width, height, title, monitor, NULL); - if (!slots[i].window) - { - free(slots); - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwSetWindowUserPointer(slots[i].window, slots + i); - - glfwSetWindowPosCallback(slots[i].window, window_pos_callback); - glfwSetWindowSizeCallback(slots[i].window, window_size_callback); - glfwSetFramebufferSizeCallback(slots[i].window, framebuffer_size_callback); - glfwSetWindowContentScaleCallback(slots[i].window, window_content_scale_callback); - glfwSetWindowCloseCallback(slots[i].window, window_close_callback); - glfwSetWindowRefreshCallback(slots[i].window, window_refresh_callback); - glfwSetWindowFocusCallback(slots[i].window, window_focus_callback); - glfwSetWindowIconifyCallback(slots[i].window, window_iconify_callback); - glfwSetWindowMaximizeCallback(slots[i].window, window_maximize_callback); - glfwSetMouseButtonCallback(slots[i].window, mouse_button_callback); - glfwSetCursorPosCallback(slots[i].window, cursor_position_callback); - glfwSetCursorEnterCallback(slots[i].window, cursor_enter_callback); - glfwSetScrollCallback(slots[i].window, scroll_callback); - glfwSetKeyCallback(slots[i].window, key_callback); - glfwSetCharCallback(slots[i].window, char_callback); - glfwSetDropCallback(slots[i].window, drop_callback); - - glfwMakeContextCurrent(slots[i].window); - gladLoadGL(glfwGetProcAddress); - glfwSwapInterval(1); - } - - printf("Main loop starting\n"); - - for (;;) - { - for (i = 0; i < count; i++) - { - if (glfwWindowShouldClose(slots[i].window)) - break; - } - - if (i < count) - break; - - glfwWaitEvents(); - - // Workaround for an issue with msvcrt and mintty - fflush(stdout); - } - - free(slots); - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/3rdparty/glfw/source/tests/gamma.c b/3rdparty/glfw/source/tests/gamma.c deleted file mode 100644 index d1f6dc2..0000000 --- a/3rdparty/glfw/source/tests/gamma.c +++ /dev/null @@ -1,187 +0,0 @@ -//======================================================================== -// Gamma correction test program -// Copyright (c) Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This program is used to test the gamma correction functionality for -// both full screen and windowed mode windows -// -//======================================================================== - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#define NK_IMPLEMENTATION -#define NK_INCLUDE_FIXED_TYPES -#define NK_INCLUDE_FONT_BAKING -#define NK_INCLUDE_DEFAULT_FONT -#define NK_INCLUDE_DEFAULT_ALLOCATOR -#define NK_INCLUDE_VERTEX_BUFFER_OUTPUT -#define NK_INCLUDE_STANDARD_VARARGS -#define NK_BUTTON_TRIGGER_ON_RELEASE -#include - -#define NK_GLFW_GL2_IMPLEMENTATION -#include - -#include -#include -#include - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action == GLFW_PRESS && key == GLFW_KEY_ESCAPE) - glfwSetWindowShouldClose(window, GLFW_TRUE); -} - -static void chart_ramp_array(struct nk_context* nk, - struct nk_color color, - int count, unsigned short int* values) -{ - if (nk_chart_begin_colored(nk, NK_CHART_LINES, - color, nk_rgb(255, 255, 255), - count, 0, 65535)) - { - int i; - for (i = 0; i < count; i++) - { - char buffer[1024]; - if (nk_chart_push(nk, values[i])) - { - snprintf(buffer, sizeof(buffer), "#%u: %u (%0.5f) ", - i, values[i], values[i] / 65535.f); - nk_tooltip(nk, buffer); - } - } - - nk_chart_end(nk); - } -} - -int main(int argc, char** argv) -{ - GLFWmonitor* monitor = NULL; - GLFWwindow* window; - GLFWgammaramp orig_ramp; - struct nk_context* nk; - struct nk_font_atlas* atlas; - float gamma_value = 1.f; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - monitor = glfwGetPrimaryMonitor(); - - glfwWindowHint(GLFW_SCALE_TO_MONITOR, GLFW_TRUE); - glfwWindowHint(GLFW_WIN32_KEYBOARD_MENU, GLFW_TRUE); - - window = glfwCreateWindow(800, 400, "Gamma Test", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - { - const GLFWgammaramp* ramp = glfwGetGammaRamp(monitor); - if (!ramp) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - const size_t array_size = ramp->size * sizeof(short); - orig_ramp.size = ramp->size; - orig_ramp.red = malloc(array_size); - orig_ramp.green = malloc(array_size); - orig_ramp.blue = malloc(array_size); - memcpy(orig_ramp.red, ramp->red, array_size); - memcpy(orig_ramp.green, ramp->green, array_size); - memcpy(orig_ramp.blue, ramp->blue, array_size); - } - - glfwMakeContextCurrent(window); - gladLoadGL(glfwGetProcAddress); - glfwSwapInterval(1); - - nk = nk_glfw3_init(window, NK_GLFW3_INSTALL_CALLBACKS); - nk_glfw3_font_stash_begin(&atlas); - nk_glfw3_font_stash_end(); - - glfwSetKeyCallback(window, key_callback); - - while (!glfwWindowShouldClose(window)) - { - int width, height; - struct nk_rect area; - - glfwGetWindowSize(window, &width, &height); - area = nk_rect(0.f, 0.f, (float) width, (float) height); - nk_window_set_bounds(nk, "", area); - - glClear(GL_COLOR_BUFFER_BIT); - nk_glfw3_new_frame(); - if (nk_begin(nk, "", area, 0)) - { - const GLFWgammaramp* ramp; - - nk_layout_row_dynamic(nk, 30, 3); - if (nk_slider_float(nk, 0.1f, &gamma_value, 5.f, 0.1f)) - glfwSetGamma(monitor, gamma_value); - nk_labelf(nk, NK_TEXT_LEFT, "%0.1f", gamma_value); - if (nk_button_label(nk, "Revert")) - glfwSetGammaRamp(monitor, &orig_ramp); - - ramp = glfwGetGammaRamp(monitor); - - nk_layout_row_dynamic(nk, height - 60.f, 3); - chart_ramp_array(nk, nk_rgb(255, 0, 0), ramp->size, ramp->red); - chart_ramp_array(nk, nk_rgb(0, 255, 0), ramp->size, ramp->green); - chart_ramp_array(nk, nk_rgb(0, 0, 255), ramp->size, ramp->blue); - } - - nk_end(nk); - nk_glfw3_render(NK_ANTI_ALIASING_ON); - - glfwSwapBuffers(window); - glfwWaitEventsTimeout(1.0); - } - - free(orig_ramp.red); - free(orig_ramp.green); - free(orig_ramp.blue); - - nk_glfw3_shutdown(); - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/3rdparty/glfw/source/tests/glfwinfo.c b/3rdparty/glfw/source/tests/glfwinfo.c deleted file mode 100644 index 14347e4..0000000 --- a/3rdparty/glfw/source/tests/glfwinfo.c +++ /dev/null @@ -1,1061 +0,0 @@ -//======================================================================== -// Context creation and information tool -// Copyright (c) Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLAD_VULKAN_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#include -#include -#include -#include - -#include "getopt.h" - -#ifdef _MSC_VER -#define strcasecmp(x, y) _stricmp(x, y) -#endif - -#define API_NAME_OPENGL "gl" -#define API_NAME_OPENGL_ES "es" - -#define API_NAME_NATIVE "native" -#define API_NAME_EGL "egl" -#define API_NAME_OSMESA "osmesa" - -#define PROFILE_NAME_CORE "core" -#define PROFILE_NAME_COMPAT "compat" - -#define STRATEGY_NAME_NONE "none" -#define STRATEGY_NAME_LOSE "lose" - -#define BEHAVIOR_NAME_NONE "none" -#define BEHAVIOR_NAME_FLUSH "flush" - -#define ANGLE_TYPE_OPENGL "gl" -#define ANGLE_TYPE_OPENGLES "es" -#define ANGLE_TYPE_D3D9 "d3d9" -#define ANGLE_TYPE_D3D11 "d3d11" -#define ANGLE_TYPE_VULKAN "vk" -#define ANGLE_TYPE_METAL "mtl" - -#define PLATFORM_NAME_ANY "any" -#define PLATFORM_NAME_WIN32 "win32" -#define PLATFORM_NAME_COCOA "cooca" -#define PLATFORM_NAME_WL "wayland" -#define PLATFORM_NAME_X11 "x11" -#define PLATFORM_NAME_NULL "null" - -static void usage(void) -{ - printf("Usage: glfwinfo [OPTION]...\n"); - printf("Options:\n"); - printf(" --platform=PLATFORM the platform to use (" - PLATFORM_NAME_ANY " or " - PLATFORM_NAME_WIN32 " or " - PLATFORM_NAME_COCOA " or " - PLATFORM_NAME_X11 " or " - PLATFORM_NAME_WL " or " - PLATFORM_NAME_NULL ")\n"); - printf(" -a, --client-api=API the client API to use (" - API_NAME_OPENGL " or " - API_NAME_OPENGL_ES ")\n"); - printf(" -b, --behavior=BEHAVIOR the release behavior to use (" - BEHAVIOR_NAME_NONE " or " - BEHAVIOR_NAME_FLUSH ")\n"); - printf(" -c, --context-api=API the context creation API to use (" - API_NAME_NATIVE " or " - API_NAME_EGL " or " - API_NAME_OSMESA ")\n"); - printf(" -d, --debug request a debug context\n"); - printf(" -f, --forward require a forward-compatible context\n"); - printf(" -h, --help show this help\n"); - printf(" -l, --list-extensions list all Vulkan and client API extensions\n"); - printf(" --list-layers list all Vulkan layers\n"); - printf(" -m, --major=MAJOR the major number of the required " - "client API version\n"); - printf(" -n, --minor=MINOR the minor number of the required " - "client API version\n"); - printf(" -p, --profile=PROFILE the OpenGL profile to use (" - PROFILE_NAME_CORE " or " - PROFILE_NAME_COMPAT ")\n"); - printf(" -s, --robustness=STRATEGY the robustness strategy to use (" - STRATEGY_NAME_NONE " or " - STRATEGY_NAME_LOSE ")\n"); - printf(" -v, --version print version information\n"); - printf(" --red-bits=N the number of red bits to request\n"); - printf(" --green-bits=N the number of green bits to request\n"); - printf(" --blue-bits=N the number of blue bits to request\n"); - printf(" --alpha-bits=N the number of alpha bits to request\n"); - printf(" --depth-bits=N the number of depth bits to request\n"); - printf(" --stencil-bits=N the number of stencil bits to request\n"); - printf(" --accum-red-bits=N the number of red bits to request\n"); - printf(" --accum-green-bits=N the number of green bits to request\n"); - printf(" --accum-blue-bits=N the number of blue bits to request\n"); - printf(" --accum-alpha-bits=N the number of alpha bits to request\n"); - printf(" --aux-buffers=N the number of aux buffers to request\n"); - printf(" --samples=N the number of MSAA samples to request\n"); - printf(" --stereo request stereo rendering\n"); - printf(" --srgb request an sRGB capable framebuffer\n"); - printf(" --singlebuffer request single-buffering\n"); - printf(" --no-error request a context that does not emit errors\n"); - printf(" --angle-type=TYPE the ANGLE platform type to use (" - ANGLE_TYPE_OPENGL ", " - ANGLE_TYPE_OPENGLES ", " - ANGLE_TYPE_D3D9 ", " - ANGLE_TYPE_D3D11 ", " - ANGLE_TYPE_VULKAN " or " - ANGLE_TYPE_METAL ")\n"); - printf(" --graphics-switching request macOS graphics switching\n"); - printf(" --disable-xcb-surface disable VK_KHR_xcb_surface extension\n"); -} - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static const char* get_platform_name(int platform) -{ - if (platform == GLFW_PLATFORM_WIN32) - return "Win32"; - else if (platform == GLFW_PLATFORM_COCOA) - return "Cocoa"; - else if (platform == GLFW_PLATFORM_WAYLAND) - return "Wayland"; - else if (platform == GLFW_PLATFORM_X11) - return "X11"; - else if (platform == GLFW_PLATFORM_NULL) - return "Null"; - - return "unknown"; -} - -static const char* get_device_type_name(VkPhysicalDeviceType type) -{ - if (type == VK_PHYSICAL_DEVICE_TYPE_OTHER) - return "other"; - else if (type == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU) - return "integrated GPU"; - else if (type == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU) - return "discrete GPU"; - else if (type == VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU) - return "virtual GPU"; - else if (type == VK_PHYSICAL_DEVICE_TYPE_CPU) - return "CPU"; - - return "unknown"; -} - -static const char* get_api_name(int api) -{ - if (api == GLFW_OPENGL_API) - return "OpenGL"; - else if (api == GLFW_OPENGL_ES_API) - return "OpenGL ES"; - - return "Unknown API"; -} - -static const char* get_profile_name_gl(GLint mask) -{ - if (mask & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT) - return PROFILE_NAME_COMPAT; - if (mask & GL_CONTEXT_CORE_PROFILE_BIT) - return PROFILE_NAME_CORE; - - return "unknown"; -} - -static const char* get_profile_name_glfw(int profile) -{ - if (profile == GLFW_OPENGL_COMPAT_PROFILE) - return PROFILE_NAME_COMPAT; - if (profile == GLFW_OPENGL_CORE_PROFILE) - return PROFILE_NAME_CORE; - - return "unknown"; -} - -static const char* get_strategy_name_gl(GLint strategy) -{ - if (strategy == GL_LOSE_CONTEXT_ON_RESET_ARB) - return STRATEGY_NAME_LOSE; - if (strategy == GL_NO_RESET_NOTIFICATION_ARB) - return STRATEGY_NAME_NONE; - - return "unknown"; -} - -static const char* get_strategy_name_glfw(int strategy) -{ - if (strategy == GLFW_LOSE_CONTEXT_ON_RESET) - return STRATEGY_NAME_LOSE; - if (strategy == GLFW_NO_RESET_NOTIFICATION) - return STRATEGY_NAME_NONE; - - return "unknown"; -} - -static void list_context_extensions(int client, int major, int minor) -{ - printf("%s context extensions:\n", get_api_name(client)); - - if (client == GLFW_OPENGL_API && major > 2) - { - GLint count; - glGetIntegerv(GL_NUM_EXTENSIONS, &count); - - for (int i = 0; i < count; i++) - printf(" %s\n", (const char*) glGetStringi(GL_EXTENSIONS, i)); - } - else - { - const GLubyte* extensions = glGetString(GL_EXTENSIONS); - while (*extensions != '\0') - { - putchar(' '); - - while (*extensions != '\0' && *extensions != ' ') - { - putchar(*extensions); - extensions++; - } - - while (*extensions == ' ') - extensions++; - - putchar('\n'); - } - } -} - -static void list_vulkan_instance_extensions(void) -{ - printf("Vulkan instance extensions:\n"); - - uint32_t ep_count; - vkEnumerateInstanceExtensionProperties(NULL, &ep_count, NULL); - VkExtensionProperties* ep = calloc(ep_count, sizeof(VkExtensionProperties)); - vkEnumerateInstanceExtensionProperties(NULL, &ep_count, ep); - - for (uint32_t i = 0; i < ep_count; i++) - printf(" %s (spec version %u)\n", ep[i].extensionName, ep[i].specVersion); - - free(ep); -} - -static void list_vulkan_instance_layers(void) -{ - printf("Vulkan instance layers:\n"); - - uint32_t lp_count; - vkEnumerateInstanceLayerProperties(&lp_count, NULL); - VkLayerProperties* lp = calloc(lp_count, sizeof(VkLayerProperties)); - vkEnumerateInstanceLayerProperties(&lp_count, lp); - - for (uint32_t i = 0; i < lp_count; i++) - { - printf(" %s (spec version %u) \"%s\"\n", - lp[i].layerName, - lp[i].specVersion >> 22, - lp[i].description); - } - - free(lp); -} - -static void list_vulkan_device_extensions(VkInstance instance, VkPhysicalDevice device) -{ - printf("Vulkan device extensions:\n"); - - uint32_t ep_count; - vkEnumerateDeviceExtensionProperties(device, NULL, &ep_count, NULL); - VkExtensionProperties* ep = calloc(ep_count, sizeof(VkExtensionProperties)); - vkEnumerateDeviceExtensionProperties(device, NULL, &ep_count, ep); - - for (uint32_t i = 0; i < ep_count; i++) - printf(" %s (spec version %u)\n", ep[i].extensionName, ep[i].specVersion); - - free(ep); -} - -static void list_vulkan_device_layers(VkInstance instance, VkPhysicalDevice device) -{ - printf("Vulkan device layers:\n"); - - uint32_t lp_count; - vkEnumerateDeviceLayerProperties(device, &lp_count, NULL); - VkLayerProperties* lp = calloc(lp_count, sizeof(VkLayerProperties)); - vkEnumerateDeviceLayerProperties(device, &lp_count, lp); - - for (uint32_t i = 0; i < lp_count; i++) - { - printf(" %s (spec version %u) \"%s\"\n", - lp[i].layerName, - lp[i].specVersion >> 22, - lp[i].description); - } - - free(lp); -} - -static bool valid_version(void) -{ - int major, minor, revision; - glfwGetVersion(&major, &minor, &revision); - - if (major != GLFW_VERSION_MAJOR) - { - printf("*** ERROR: GLFW major version mismatch! ***\n"); - return false; - } - - if (minor != GLFW_VERSION_MINOR || revision != GLFW_VERSION_REVISION) - printf("*** WARNING: GLFW version mismatch! ***\n"); - - return true; -} - -static void print_version(void) -{ - int major, minor, revision; - glfwGetVersion(&major, &minor, &revision); - - printf("GLFW header version: %u.%u.%u\n", - GLFW_VERSION_MAJOR, - GLFW_VERSION_MINOR, - GLFW_VERSION_REVISION); - printf("GLFW library version: %u.%u.%u\n", major, minor, revision); - printf("GLFW library version string: \"%s\"\n", glfwGetVersionString()); -} - -static void print_platform(void) -{ - const int platforms[] = - { - GLFW_PLATFORM_WIN32, - GLFW_PLATFORM_COCOA, - GLFW_PLATFORM_WAYLAND, - GLFW_PLATFORM_X11, - GLFW_PLATFORM_NULL - }; - - printf("GLFW platform: %s\n", get_platform_name(glfwGetPlatform())); - printf("GLFW supported platforms:\n"); - - for (size_t i = 0; i < sizeof(platforms) / sizeof(platforms[0]); i++) - { - if (glfwPlatformSupported(platforms[i])) - printf(" %s\n", get_platform_name(platforms[i])); - } -} - -int main(int argc, char** argv) -{ - int ch; - bool list_extensions = false, list_layers = false; - - // These duplicate the defaults for each hint - int platform = GLFW_ANY_PLATFORM; - int client_api = GLFW_OPENGL_API; - int context_major = 1; - int context_minor = 0; - int context_release = GLFW_ANY_RELEASE_BEHAVIOR; - int context_creation_api = GLFW_NATIVE_CONTEXT_API; - int context_robustness = GLFW_NO_ROBUSTNESS; - bool context_debug = false; - bool context_no_error = false; - bool opengl_forward = false; - int opengl_profile = GLFW_OPENGL_ANY_PROFILE; - int fb_red_bits = 8; - int fb_green_bits = 8; - int fb_blue_bits = 8; - int fb_alpha_bits = 8; - int fb_depth_bits = 24; - int fb_stencil_bits = 8; - int fb_accum_red_bits = 0; - int fb_accum_green_bits = 0; - int fb_accum_blue_bits = 0; - int fb_accum_alpha_bits = 0; - int fb_aux_buffers = 0; - int fb_samples = 0; - bool fb_stereo = false; - bool fb_srgb = false; - bool fb_doublebuffer = true; - int angle_type = GLFW_ANGLE_PLATFORM_TYPE_NONE; - bool cocoa_graphics_switching = false; - bool disable_xcb_surface = false; - - enum { PLATFORM, CLIENT, CONTEXT, BEHAVIOR, DEBUG_CONTEXT, FORWARD, HELP, - EXTENSIONS, LAYERS, - MAJOR, MINOR, PROFILE, ROBUSTNESS, VERSION, - REDBITS, GREENBITS, BLUEBITS, ALPHABITS, DEPTHBITS, STENCILBITS, - ACCUMREDBITS, ACCUMGREENBITS, ACCUMBLUEBITS, ACCUMALPHABITS, - AUXBUFFERS, SAMPLES, STEREO, SRGB, SINGLEBUFFER, NOERROR_SRSLY, - ANGLE_TYPE, GRAPHICS_SWITCHING, XCB_SURFACE }; - const struct option options[] = - { - { "platform", 1, NULL, PLATFORM }, - { "behavior", 1, NULL, BEHAVIOR }, - { "client-api", 1, NULL, CLIENT }, - { "context-api", 1, NULL, CONTEXT }, - { "debug", 0, NULL, DEBUG_CONTEXT }, - { "forward", 0, NULL, FORWARD }, - { "help", 0, NULL, HELP }, - { "list-extensions", 0, NULL, EXTENSIONS }, - { "list-layers", 0, NULL, LAYERS }, - { "major", 1, NULL, MAJOR }, - { "minor", 1, NULL, MINOR }, - { "profile", 1, NULL, PROFILE }, - { "robustness", 1, NULL, ROBUSTNESS }, - { "version", 0, NULL, VERSION }, - { "red-bits", 1, NULL, REDBITS }, - { "green-bits", 1, NULL, GREENBITS }, - { "blue-bits", 1, NULL, BLUEBITS }, - { "alpha-bits", 1, NULL, ALPHABITS }, - { "depth-bits", 1, NULL, DEPTHBITS }, - { "stencil-bits", 1, NULL, STENCILBITS }, - { "accum-red-bits", 1, NULL, ACCUMREDBITS }, - { "accum-green-bits", 1, NULL, ACCUMGREENBITS }, - { "accum-blue-bits", 1, NULL, ACCUMBLUEBITS }, - { "accum-alpha-bits", 1, NULL, ACCUMALPHABITS }, - { "aux-buffers", 1, NULL, AUXBUFFERS }, - { "samples", 1, NULL, SAMPLES }, - { "stereo", 0, NULL, STEREO }, - { "srgb", 0, NULL, SRGB }, - { "singlebuffer", 0, NULL, SINGLEBUFFER }, - { "no-error", 0, NULL, NOERROR_SRSLY }, - { "angle-type", 1, NULL, ANGLE_TYPE }, - { "graphics-switching", 0, NULL, GRAPHICS_SWITCHING }, - { "vk-xcb-surface", 0, NULL, XCB_SURFACE }, - { NULL, 0, NULL, 0 } - }; - - while ((ch = getopt_long(argc, argv, "a:b:c:dfhlm:n:p:s:v", options, NULL)) != -1) - { - switch (ch) - { - case PLATFORM: - if (strcasecmp(optarg, PLATFORM_NAME_ANY) == 0) - platform = GLFW_ANY_PLATFORM; - else if (strcasecmp(optarg, PLATFORM_NAME_WIN32) == 0) - platform = GLFW_PLATFORM_WIN32; - else if (strcasecmp(optarg, PLATFORM_NAME_COCOA) == 0) - platform = GLFW_PLATFORM_COCOA; - else if (strcasecmp(optarg, PLATFORM_NAME_WL) == 0) - platform = GLFW_PLATFORM_WAYLAND; - else if (strcasecmp(optarg, PLATFORM_NAME_X11) == 0) - platform = GLFW_PLATFORM_X11; - else if (strcasecmp(optarg, PLATFORM_NAME_NULL) == 0) - platform = GLFW_PLATFORM_NULL; - else - { - usage(); - exit(EXIT_FAILURE); - } - break; - case 'a': - case CLIENT: - if (strcasecmp(optarg, API_NAME_OPENGL) == 0) - client_api = GLFW_OPENGL_API; - else if (strcasecmp(optarg, API_NAME_OPENGL_ES) == 0) - client_api = GLFW_OPENGL_ES_API; - else - { - usage(); - exit(EXIT_FAILURE); - } - break; - case 'b': - case BEHAVIOR: - if (strcasecmp(optarg, BEHAVIOR_NAME_NONE) == 0) - context_release = GLFW_RELEASE_BEHAVIOR_NONE; - else if (strcasecmp(optarg, BEHAVIOR_NAME_FLUSH) == 0) - context_release = GLFW_RELEASE_BEHAVIOR_FLUSH; - else - { - usage(); - exit(EXIT_FAILURE); - } - break; - case 'c': - case CONTEXT: - if (strcasecmp(optarg, API_NAME_NATIVE) == 0) - context_creation_api = GLFW_NATIVE_CONTEXT_API; - else if (strcasecmp(optarg, API_NAME_EGL) == 0) - context_creation_api = GLFW_EGL_CONTEXT_API; - else if (strcasecmp(optarg, API_NAME_OSMESA) == 0) - context_creation_api = GLFW_OSMESA_CONTEXT_API; - else - { - usage(); - exit(EXIT_FAILURE); - } - break; - case 'd': - case DEBUG_CONTEXT: - context_debug = true; - break; - case 'f': - case FORWARD: - opengl_forward = true; - break; - case 'h': - case HELP: - usage(); - exit(EXIT_SUCCESS); - case 'l': - case EXTENSIONS: - list_extensions = true; - break; - case LAYERS: - list_layers = true; - break; - case 'm': - case MAJOR: - context_major = atoi(optarg); - break; - case 'n': - case MINOR: - context_minor = atoi(optarg); - break; - case 'p': - case PROFILE: - if (strcasecmp(optarg, PROFILE_NAME_CORE) == 0) - opengl_profile = GLFW_OPENGL_CORE_PROFILE; - else if (strcasecmp(optarg, PROFILE_NAME_COMPAT) == 0) - opengl_profile = GLFW_OPENGL_COMPAT_PROFILE; - else - { - usage(); - exit(EXIT_FAILURE); - } - break; - case 's': - case ROBUSTNESS: - if (strcasecmp(optarg, STRATEGY_NAME_NONE) == 0) - context_robustness = GLFW_NO_RESET_NOTIFICATION; - else if (strcasecmp(optarg, STRATEGY_NAME_LOSE) == 0) - context_robustness = GLFW_LOSE_CONTEXT_ON_RESET; - else - { - usage(); - exit(EXIT_FAILURE); - } - break; - case 'v': - case VERSION: - print_version(); - exit(EXIT_SUCCESS); - case REDBITS: - if (strcmp(optarg, "-") == 0) - fb_red_bits = GLFW_DONT_CARE; - else - fb_red_bits = atoi(optarg); - break; - case GREENBITS: - if (strcmp(optarg, "-") == 0) - fb_green_bits = GLFW_DONT_CARE; - else - fb_green_bits = atoi(optarg); - break; - case BLUEBITS: - if (strcmp(optarg, "-") == 0) - fb_blue_bits = GLFW_DONT_CARE; - else - fb_blue_bits = atoi(optarg); - break; - case ALPHABITS: - if (strcmp(optarg, "-") == 0) - fb_alpha_bits = GLFW_DONT_CARE; - else - fb_alpha_bits = atoi(optarg); - break; - case DEPTHBITS: - if (strcmp(optarg, "-") == 0) - fb_depth_bits = GLFW_DONT_CARE; - else - fb_depth_bits = atoi(optarg); - break; - case STENCILBITS: - if (strcmp(optarg, "-") == 0) - fb_stencil_bits = GLFW_DONT_CARE; - else - fb_stencil_bits = atoi(optarg); - break; - case ACCUMREDBITS: - if (strcmp(optarg, "-") == 0) - fb_accum_red_bits = GLFW_DONT_CARE; - else - fb_accum_red_bits = atoi(optarg); - break; - case ACCUMGREENBITS: - if (strcmp(optarg, "-") == 0) - fb_accum_green_bits = GLFW_DONT_CARE; - else - fb_accum_green_bits = atoi(optarg); - break; - case ACCUMBLUEBITS: - if (strcmp(optarg, "-") == 0) - fb_accum_blue_bits = GLFW_DONT_CARE; - else - fb_accum_blue_bits = atoi(optarg); - break; - case ACCUMALPHABITS: - if (strcmp(optarg, "-") == 0) - fb_accum_alpha_bits = GLFW_DONT_CARE; - else - fb_accum_alpha_bits = atoi(optarg); - break; - case AUXBUFFERS: - if (strcmp(optarg, "-") == 0) - fb_aux_buffers = GLFW_DONT_CARE; - else - fb_aux_buffers = atoi(optarg); - break; - case SAMPLES: - if (strcmp(optarg, "-") == 0) - fb_samples = GLFW_DONT_CARE; - else - fb_samples = atoi(optarg); - break; - case STEREO: - fb_stereo = true; - break; - case SRGB: - fb_srgb = true; - break; - case SINGLEBUFFER: - fb_doublebuffer = false; - break; - case NOERROR_SRSLY: - context_no_error = true; - break; - case ANGLE_TYPE: - if (strcmp(optarg, ANGLE_TYPE_OPENGL) == 0) - angle_type = GLFW_ANGLE_PLATFORM_TYPE_OPENGL; - else if (strcmp(optarg, ANGLE_TYPE_OPENGLES) == 0) - angle_type = GLFW_ANGLE_PLATFORM_TYPE_OPENGLES; - else if (strcmp(optarg, ANGLE_TYPE_D3D9) == 0) - angle_type = GLFW_ANGLE_PLATFORM_TYPE_D3D9; - else if (strcmp(optarg, ANGLE_TYPE_D3D11) == 0) - angle_type = GLFW_ANGLE_PLATFORM_TYPE_D3D11; - else if (strcmp(optarg, ANGLE_TYPE_VULKAN) == 0) - angle_type = GLFW_ANGLE_PLATFORM_TYPE_VULKAN; - else if (strcmp(optarg, ANGLE_TYPE_METAL) == 0) - angle_type = GLFW_ANGLE_PLATFORM_TYPE_METAL; - else - { - usage(); - exit(EXIT_FAILURE); - } - break; - case GRAPHICS_SWITCHING: - cocoa_graphics_switching = true; - break; - case XCB_SURFACE: - disable_xcb_surface = true; - break; - default: - usage(); - exit(EXIT_FAILURE); - } - } - - // Initialize GLFW and create window - - if (!valid_version()) - exit(EXIT_FAILURE); - - glfwSetErrorCallback(error_callback); - - glfwInitHint(GLFW_PLATFORM, platform); - - glfwInitHint(GLFW_COCOA_MENUBAR, false); - - glfwInitHint(GLFW_ANGLE_PLATFORM_TYPE, angle_type); - glfwInitHint(GLFW_X11_XCB_VULKAN_SURFACE, !disable_xcb_surface); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - print_version(); - print_platform(); - - glfwWindowHint(GLFW_VISIBLE, false); - - glfwWindowHint(GLFW_CLIENT_API, client_api); - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, context_major); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, context_minor); - glfwWindowHint(GLFW_CONTEXT_RELEASE_BEHAVIOR, context_release); - glfwWindowHint(GLFW_CONTEXT_CREATION_API, context_creation_api); - glfwWindowHint(GLFW_CONTEXT_ROBUSTNESS, context_robustness); - glfwWindowHint(GLFW_CONTEXT_DEBUG, context_debug); - glfwWindowHint(GLFW_CONTEXT_NO_ERROR, context_no_error); - glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, opengl_forward); - glfwWindowHint(GLFW_OPENGL_PROFILE, opengl_profile); - - glfwWindowHint(GLFW_RED_BITS, fb_red_bits); - glfwWindowHint(GLFW_BLUE_BITS, fb_blue_bits); - glfwWindowHint(GLFW_GREEN_BITS, fb_green_bits); - glfwWindowHint(GLFW_ALPHA_BITS, fb_alpha_bits); - glfwWindowHint(GLFW_DEPTH_BITS, fb_depth_bits); - glfwWindowHint(GLFW_STENCIL_BITS, fb_stencil_bits); - glfwWindowHint(GLFW_ACCUM_RED_BITS, fb_accum_red_bits); - glfwWindowHint(GLFW_ACCUM_GREEN_BITS, fb_accum_green_bits); - glfwWindowHint(GLFW_ACCUM_BLUE_BITS, fb_accum_blue_bits); - glfwWindowHint(GLFW_ACCUM_ALPHA_BITS, fb_accum_alpha_bits); - glfwWindowHint(GLFW_AUX_BUFFERS, fb_aux_buffers); - glfwWindowHint(GLFW_SAMPLES, fb_samples); - glfwWindowHint(GLFW_STEREO, fb_stereo); - glfwWindowHint(GLFW_SRGB_CAPABLE, fb_srgb); - glfwWindowHint(GLFW_DOUBLEBUFFER, fb_doublebuffer); - - glfwWindowHint(GLFW_COCOA_GRAPHICS_SWITCHING, cocoa_graphics_switching); - - GLFWwindow* window = glfwCreateWindow(200, 200, "Version", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - gladLoadGL(glfwGetProcAddress); - - const GLenum error = glGetError(); - if (error != GL_NO_ERROR) - printf("*** OpenGL error after make current: 0x%08x ***\n", error); - - // Report client API version - - const int client = glfwGetWindowAttrib(window, GLFW_CLIENT_API); - const int major = glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MAJOR); - const int minor = glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MINOR); - const int revision = glfwGetWindowAttrib(window, GLFW_CONTEXT_REVISION); - const int profile = glfwGetWindowAttrib(window, GLFW_OPENGL_PROFILE); - - printf("%s context version string: \"%s\"\n", - get_api_name(client), - glGetString(GL_VERSION)); - - printf("%s context version parsed by GLFW: %u.%u.%u\n", - get_api_name(client), - major, minor, revision); - - // Report client API context properties - - if (client == GLFW_OPENGL_API) - { - if (major >= 3) - { - GLint flags; - - glGetIntegerv(GL_CONTEXT_FLAGS, &flags); - printf("%s context flags (0x%08x):", get_api_name(client), flags); - - if (flags & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT) - printf(" forward-compatible"); - if (flags & 2/*GL_CONTEXT_FLAG_DEBUG_BIT*/) - printf(" debug"); - if (flags & GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB) - printf(" robustness"); - if (flags & 8/*GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR*/) - printf(" no-error"); - putchar('\n'); - - printf("%s context flags parsed by GLFW:", get_api_name(client)); - - if (glfwGetWindowAttrib(window, GLFW_OPENGL_FORWARD_COMPAT)) - printf(" forward-compatible"); - if (glfwGetWindowAttrib(window, GLFW_CONTEXT_DEBUG)) - printf(" debug"); - if (glfwGetWindowAttrib(window, GLFW_CONTEXT_ROBUSTNESS) == GLFW_LOSE_CONTEXT_ON_RESET) - printf(" robustness"); - if (glfwGetWindowAttrib(window, GLFW_CONTEXT_NO_ERROR)) - printf(" no-error"); - putchar('\n'); - } - - if (major >= 4 || (major == 3 && minor >= 2)) - { - GLint mask; - glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &mask); - - printf("%s profile mask (0x%08x): %s\n", - get_api_name(client), - mask, - get_profile_name_gl(mask)); - - printf("%s profile mask parsed by GLFW: %s\n", - get_api_name(client), - get_profile_name_glfw(profile)); - } - - if (GLAD_GL_ARB_robustness) - { - const int robustness = glfwGetWindowAttrib(window, GLFW_CONTEXT_ROBUSTNESS); - GLint strategy; - glGetIntegerv(GL_RESET_NOTIFICATION_STRATEGY_ARB, &strategy); - - printf("%s robustness strategy (0x%08x): %s\n", - get_api_name(client), - strategy, - get_strategy_name_gl(strategy)); - - printf("%s robustness strategy parsed by GLFW: %s\n", - get_api_name(client), - get_strategy_name_glfw(robustness)); - } - } - - printf("%s context renderer string: \"%s\"\n", - get_api_name(client), - glGetString(GL_RENDERER)); - printf("%s context vendor string: \"%s\"\n", - get_api_name(client), - glGetString(GL_VENDOR)); - - if (major >= 2) - { - printf("%s context shading language version: \"%s\"\n", - get_api_name(client), - glGetString(GL_SHADING_LANGUAGE_VERSION)); - } - - printf("%s framebuffer:\n", get_api_name(client)); - - GLint redbits, greenbits, bluebits, alphabits, depthbits, stencilbits; - - if (client == GLFW_OPENGL_API && profile == GLFW_OPENGL_CORE_PROFILE) - { - glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, - GL_BACK_LEFT, - GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE, - &redbits); - glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, - GL_BACK_LEFT, - GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE, - &greenbits); - glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, - GL_BACK_LEFT, - GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE, - &bluebits); - glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, - GL_BACK_LEFT, - GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE, - &alphabits); - glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, - GL_DEPTH, - GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE, - &depthbits); - glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, - GL_STENCIL, - GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE, - &stencilbits); - } - else - { - glGetIntegerv(GL_RED_BITS, &redbits); - glGetIntegerv(GL_GREEN_BITS, &greenbits); - glGetIntegerv(GL_BLUE_BITS, &bluebits); - glGetIntegerv(GL_ALPHA_BITS, &alphabits); - glGetIntegerv(GL_DEPTH_BITS, &depthbits); - glGetIntegerv(GL_STENCIL_BITS, &stencilbits); - } - - printf(" red: %u green: %u blue: %u alpha: %u depth: %u stencil: %u\n", - redbits, greenbits, bluebits, alphabits, depthbits, stencilbits); - - if (client == GLFW_OPENGL_ES_API || - GLAD_GL_ARB_multisample || - major > 1 || minor >= 3) - { - GLint samples, samplebuffers; - glGetIntegerv(GL_SAMPLES, &samples); - glGetIntegerv(GL_SAMPLE_BUFFERS, &samplebuffers); - - printf(" samples: %u sample buffers: %u\n", samples, samplebuffers); - } - - if (client == GLFW_OPENGL_API && profile != GLFW_OPENGL_CORE_PROFILE) - { - GLint accumredbits, accumgreenbits, accumbluebits, accumalphabits; - GLint auxbuffers; - - glGetIntegerv(GL_ACCUM_RED_BITS, &accumredbits); - glGetIntegerv(GL_ACCUM_GREEN_BITS, &accumgreenbits); - glGetIntegerv(GL_ACCUM_BLUE_BITS, &accumbluebits); - glGetIntegerv(GL_ACCUM_ALPHA_BITS, &accumalphabits); - glGetIntegerv(GL_AUX_BUFFERS, &auxbuffers); - - printf(" accum red: %u accum green: %u accum blue: %u accum alpha: %u aux buffers: %u\n", - accumredbits, accumgreenbits, accumbluebits, accumalphabits, auxbuffers); - } - - if (list_extensions) - list_context_extensions(client, major, minor); - - glfwDestroyWindow(window); - - glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); - - window = glfwCreateWindow(200, 200, "Version", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - printf("Vulkan loader: %s\n", - glfwVulkanSupported() ? "available" : "missing"); - - if (glfwVulkanSupported()) - { - gladLoadVulkanUserPtr(NULL, (GLADuserptrloadfunc) glfwGetInstanceProcAddress, NULL); - - uint32_t loader_version = VK_API_VERSION_1_0; - - if (vkEnumerateInstanceVersion) - { - uint32_t version; - if (vkEnumerateInstanceVersion(&version) == VK_SUCCESS) - loader_version = version; - } - - printf("Vulkan loader API version: %i.%i\n", - VK_VERSION_MAJOR(loader_version), - VK_VERSION_MINOR(loader_version)); - - uint32_t re_count; - const char** re = glfwGetRequiredInstanceExtensions(&re_count); - - if (re) - { - printf("Vulkan window surface required instance extensions:\n"); - for (uint32_t i = 0; i < re_count; i++) - printf(" %s\n", re[i]); - } - else - printf("Vulkan window surface extensions missing\n"); - - if (list_extensions) - list_vulkan_instance_extensions(); - - if (list_layers) - list_vulkan_instance_layers(); - - VkApplicationInfo ai = { VK_STRUCTURE_TYPE_APPLICATION_INFO }; - ai.pApplicationName = "glfwinfo"; - ai.applicationVersion = VK_MAKE_VERSION(GLFW_VERSION_MAJOR, - GLFW_VERSION_MINOR, - GLFW_VERSION_REVISION); - - if (loader_version >= VK_API_VERSION_1_1) - ai.apiVersion = VK_API_VERSION_1_1; - else - ai.apiVersion = VK_API_VERSION_1_0; - - VkInstanceCreateInfo ici = { VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO }; - ici.pApplicationInfo = &ai; - ici.enabledExtensionCount = re_count; - ici.ppEnabledExtensionNames = re; - - VkInstance instance = VK_NULL_HANDLE; - - if (vkCreateInstance(&ici, NULL, &instance) != VK_SUCCESS) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - gladLoadVulkanUserPtr(NULL, (GLADuserptrloadfunc) glfwGetInstanceProcAddress, instance); - - if (re) - { - VkSurfaceKHR surface = VK_NULL_HANDLE; - - if (glfwCreateWindowSurface(instance, window, NULL, &surface) == VK_SUCCESS) - { - printf("Vulkan window surface created successfully\n"); - vkDestroySurfaceKHR(instance, surface, NULL); - } - else - printf("Failed to create Vulkan window surface\n"); - } - - uint32_t pd_count; - vkEnumeratePhysicalDevices(instance, &pd_count, NULL); - VkPhysicalDevice* pd = calloc(pd_count, sizeof(VkPhysicalDevice)); - vkEnumeratePhysicalDevices(instance, &pd_count, pd); - - for (uint32_t i = 0; i < pd_count; i++) - { - VkPhysicalDeviceProperties pdp; - vkGetPhysicalDeviceProperties(pd[i], &pdp); - - printf("Vulkan %s device: \"%s\" (API version %i.%i)\n", - get_device_type_name(pdp.deviceType), - pdp.deviceName, - VK_VERSION_MAJOR(pdp.apiVersion), - VK_VERSION_MINOR(pdp.apiVersion)); - - uint32_t qfp_count; - vkGetPhysicalDeviceQueueFamilyProperties(pd[i], &qfp_count, NULL); - - if (re) - { - printf("Vulkan device queue family presentation support:\n"); - for (uint32_t j = 0; j < qfp_count; j++) - { - printf(" %u: ", j); - if (glfwGetPhysicalDevicePresentationSupport(instance, pd[i], j)) - printf("supported\n"); - else - printf("no\n"); - } - } - - if (list_extensions) - list_vulkan_device_extensions(instance, pd[i]); - - if (list_layers) - list_vulkan_device_layers(instance, pd[i]); - } - - free(pd); - vkDestroyInstance(instance, NULL); - } - - glfwDestroyWindow(window); - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/3rdparty/glfw/source/tests/icon.c b/3rdparty/glfw/source/tests/icon.c deleted file mode 100644 index d5baf0a..0000000 --- a/3rdparty/glfw/source/tests/icon.c +++ /dev/null @@ -1,150 +0,0 @@ -//======================================================================== -// Window icon test program -// Copyright (c) Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This program is used to test the icon feature. -// -//======================================================================== - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#include -#include -#include - -// a simple glfw logo -const char* const logo[] = -{ - "................", - "................", - "...0000..0......", - "...0.....0......", - "...0.00..0......", - "...0..0..0......", - "...0000..0000...", - "................", - "................", - "...000..0...0...", - "...0....0...0...", - "...000..0.0.0...", - "...0....0.0.0...", - "...0....00000...", - "................", - "................" -}; - -const unsigned char icon_colors[5][4] = -{ - { 0, 0, 0, 255 }, // black - { 255, 0, 0, 255 }, // red - { 0, 255, 0, 255 }, // green - { 0, 0, 255, 255 }, // blue - { 255, 255, 255, 255 } // white -}; - -static int cur_icon_color = 0; - -static void set_icon(GLFWwindow* window, int icon_color) -{ - int x, y; - unsigned char pixels[16 * 16 * 4]; - unsigned char* target = pixels; - GLFWimage img = { 16, 16, pixels }; - - for (y = 0; y < img.width; y++) - { - for (x = 0; x < img.height; x++) - { - if (logo[y][x] == '0') - memcpy(target, icon_colors[icon_color], 4); - else - memset(target, 0, 4); - - target += 4; - } - } - - glfwSetWindowIcon(window, 1, &img); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_ESCAPE: - glfwSetWindowShouldClose(window, GLFW_TRUE); - break; - case GLFW_KEY_SPACE: - cur_icon_color = (cur_icon_color + 1) % 5; - set_icon(window, cur_icon_color); - break; - case GLFW_KEY_X: - glfwSetWindowIcon(window, 0, NULL); - break; - } -} - -int main(int argc, char** argv) -{ - GLFWwindow* window; - - if (!glfwInit()) - { - fprintf(stderr, "Failed to initialize GLFW\n"); - exit(EXIT_FAILURE); - } - - window = glfwCreateWindow(200, 200, "Window Icon", NULL, NULL); - if (!window) - { - glfwTerminate(); - - fprintf(stderr, "Failed to open GLFW window\n"); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - gladLoadGL(glfwGetProcAddress); - - glfwSetKeyCallback(window, key_callback); - set_icon(window, cur_icon_color); - - while (!glfwWindowShouldClose(window)) - { - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(window); - glfwWaitEvents(); - } - - glfwDestroyWindow(window); - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/3rdparty/glfw/source/tests/iconify.c b/3rdparty/glfw/source/tests/iconify.c deleted file mode 100644 index 32fd44f..0000000 --- a/3rdparty/glfw/source/tests/iconify.c +++ /dev/null @@ -1,298 +0,0 @@ -//======================================================================== -// Iconify/restore test program -// Copyright (c) Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This program is used to test the iconify/restore functionality for -// both full screen and windowed mode windows -// -//======================================================================== - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#include -#include - -#include "getopt.h" - -static int windowed_xpos, windowed_ypos, windowed_width = 640, windowed_height = 480; - -static void usage(void) -{ - printf("Usage: iconify [-h] [-f [-a] [-n]]\n"); - printf("Options:\n"); - printf(" -a create windows for all monitors\n"); - printf(" -f create full screen window(s)\n"); - printf(" -h show this help\n"); -} - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - printf("%0.2f Key %s\n", - glfwGetTime(), - action == GLFW_PRESS ? "pressed" : "released"); - - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_I: - glfwIconifyWindow(window); - break; - case GLFW_KEY_M: - glfwMaximizeWindow(window); - break; - case GLFW_KEY_R: - glfwRestoreWindow(window); - break; - case GLFW_KEY_ESCAPE: - glfwSetWindowShouldClose(window, GLFW_TRUE); - break; - case GLFW_KEY_A: - glfwSetWindowAttrib(window, GLFW_AUTO_ICONIFY, !glfwGetWindowAttrib(window, GLFW_AUTO_ICONIFY)); - break; - case GLFW_KEY_B: - glfwSetWindowAttrib(window, GLFW_RESIZABLE, !glfwGetWindowAttrib(window, GLFW_RESIZABLE)); - break; - case GLFW_KEY_D: - glfwSetWindowAttrib(window, GLFW_DECORATED, !glfwGetWindowAttrib(window, GLFW_DECORATED)); - break; - case GLFW_KEY_F: - glfwSetWindowAttrib(window, GLFW_FLOATING, !glfwGetWindowAttrib(window, GLFW_FLOATING)); - break; - case GLFW_KEY_F11: - case GLFW_KEY_ENTER: - { - if (mods != GLFW_MOD_ALT) - return; - - if (glfwGetWindowMonitor(window)) - { - glfwSetWindowMonitor(window, NULL, - windowed_xpos, windowed_ypos, - windowed_width, windowed_height, - 0); - } - else - { - GLFWmonitor* monitor = glfwGetPrimaryMonitor(); - if (monitor) - { - const GLFWvidmode* mode = glfwGetVideoMode(monitor); - glfwGetWindowPos(window, &windowed_xpos, &windowed_ypos); - glfwGetWindowSize(window, &windowed_width, &windowed_height); - glfwSetWindowMonitor(window, monitor, - 0, 0, mode->width, mode->height, - mode->refreshRate); - } - } - - break; - } - } -} - -static void window_size_callback(GLFWwindow* window, int width, int height) -{ - printf("%0.2f Window resized to %ix%i\n", glfwGetTime(), width, height); -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - printf("%0.2f Framebuffer resized to %ix%i\n", glfwGetTime(), width, height); -} - -static void window_focus_callback(GLFWwindow* window, int focused) -{ - printf("%0.2f Window %s\n", - glfwGetTime(), - focused ? "focused" : "defocused"); -} - -static void window_iconify_callback(GLFWwindow* window, int iconified) -{ - printf("%0.2f Window %s\n", - glfwGetTime(), - iconified ? "iconified" : "uniconified"); -} - -static void window_maximize_callback(GLFWwindow* window, int maximized) -{ - printf("%0.2f Window %s\n", - glfwGetTime(), - maximized ? "maximized" : "unmaximized"); -} - -static void window_refresh_callback(GLFWwindow* window) -{ - printf("%0.2f Window refresh\n", glfwGetTime()); - - glfwMakeContextCurrent(window); - - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(window); -} - -static GLFWwindow* create_window(GLFWmonitor* monitor) -{ - int width, height; - GLFWwindow* window; - - if (monitor) - { - const GLFWvidmode* mode = glfwGetVideoMode(monitor); - - glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate); - glfwWindowHint(GLFW_RED_BITS, mode->redBits); - glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits); - glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits); - - width = mode->width; - height = mode->height; - } - else - { - width = windowed_width; - height = windowed_height; - } - - window = glfwCreateWindow(width, height, "Iconify", monitor, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - gladLoadGL(glfwGetProcAddress); - - return window; -} - -int main(int argc, char** argv) -{ - int ch, i, window_count; - int fullscreen = GLFW_FALSE, all_monitors = GLFW_FALSE; - GLFWwindow** windows; - - while ((ch = getopt(argc, argv, "afhn")) != -1) - { - switch (ch) - { - case 'a': - all_monitors = GLFW_TRUE; - break; - - case 'h': - usage(); - exit(EXIT_SUCCESS); - - case 'f': - fullscreen = GLFW_TRUE; - break; - - default: - usage(); - exit(EXIT_FAILURE); - } - } - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - if (fullscreen && all_monitors) - { - int monitor_count; - GLFWmonitor** monitors = glfwGetMonitors(&monitor_count); - - window_count = monitor_count; - windows = calloc(window_count, sizeof(GLFWwindow*)); - - for (i = 0; i < monitor_count; i++) - { - windows[i] = create_window(monitors[i]); - if (!windows[i]) - break; - } - } - else - { - GLFWmonitor* monitor = NULL; - - if (fullscreen) - monitor = glfwGetPrimaryMonitor(); - - window_count = 1; - windows = calloc(window_count, sizeof(GLFWwindow*)); - windows[0] = create_window(monitor); - } - - for (i = 0; i < window_count; i++) - { - glfwSetKeyCallback(windows[i], key_callback); - glfwSetFramebufferSizeCallback(windows[i], framebuffer_size_callback); - glfwSetWindowSizeCallback(windows[i], window_size_callback); - glfwSetWindowFocusCallback(windows[i], window_focus_callback); - glfwSetWindowIconifyCallback(windows[i], window_iconify_callback); - glfwSetWindowMaximizeCallback(windows[i], window_maximize_callback); - glfwSetWindowRefreshCallback(windows[i], window_refresh_callback); - - window_refresh_callback(windows[i]); - - printf("Window is %s and %s\n", - glfwGetWindowAttrib(windows[i], GLFW_ICONIFIED) ? "iconified" : "restored", - glfwGetWindowAttrib(windows[i], GLFW_FOCUSED) ? "focused" : "defocused"); - } - - for (;;) - { - glfwWaitEvents(); - - for (i = 0; i < window_count; i++) - { - if (glfwWindowShouldClose(windows[i])) - break; - } - - if (i < window_count) - break; - - // Workaround for an issue with msvcrt and mintty - fflush(stdout); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/3rdparty/glfw/source/tests/inputlag.c b/3rdparty/glfw/source/tests/inputlag.c deleted file mode 100644 index 12e693f..0000000 --- a/3rdparty/glfw/source/tests/inputlag.c +++ /dev/null @@ -1,310 +0,0 @@ -//======================================================================== -// Input lag test -// Copyright (c) Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This test renders a marker at the cursor position reported by GLFW to -// check how much it lags behind the hardware mouse cursor -// -//======================================================================== - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#define NK_IMPLEMENTATION -#define NK_INCLUDE_FIXED_TYPES -#define NK_INCLUDE_FONT_BAKING -#define NK_INCLUDE_DEFAULT_FONT -#define NK_INCLUDE_DEFAULT_ALLOCATOR -#define NK_INCLUDE_VERTEX_BUFFER_OUTPUT -#define NK_INCLUDE_STANDARD_VARARGS -#include - -#define NK_GLFW_GL2_IMPLEMENTATION -#include - -#include -#include -#include - -#include "getopt.h" - -void usage(void) -{ - printf("Usage: inputlag [-h] [-f]\n"); - printf("Options:\n"); - printf(" -f create full screen window\n"); - printf(" -h show this help\n"); -} - -struct nk_vec2 cursor_new, cursor_pos, cursor_vel; -enum { cursor_sync_query, cursor_input_message } cursor_method = cursor_sync_query; - -void sample_input(GLFWwindow* window) -{ - float a = .25; // exponential smoothing factor - - if (cursor_method == cursor_sync_query) { - double x, y; - glfwGetCursorPos(window, &x, &y); - cursor_new.x = (float) x; - cursor_new.y = (float) y; - } - - cursor_vel.x = (cursor_new.x - cursor_pos.x) * a + cursor_vel.x * (1 - a); - cursor_vel.y = (cursor_new.y - cursor_pos.y) * a + cursor_vel.y * (1 - a); - cursor_pos = cursor_new; -} - -void cursor_pos_callback(GLFWwindow* window, double xpos, double ypos) -{ - cursor_new.x = (float) xpos; - cursor_new.y = (float) ypos; -} - -int enable_vsync = nk_true; - -void update_vsync() -{ - glfwSwapInterval(enable_vsync == nk_true ? 1 : 0); -} - -int swap_clear = nk_false; -int swap_finish = nk_true; -int swap_occlusion_query = nk_false; -int swap_read_pixels = nk_false; -GLuint occlusion_query; - -void swap_buffers(GLFWwindow* window) -{ - glfwSwapBuffers(window); - - if (swap_clear) - glClear(GL_COLOR_BUFFER_BIT); - - if (swap_finish) - glFinish(); - - if (swap_occlusion_query) { - GLint occlusion_result; - if (!occlusion_query) - glGenQueries(1, &occlusion_query); - glBeginQuery(GL_SAMPLES_PASSED, occlusion_query); - glBegin(GL_POINTS); - glVertex2f(0, 0); - glEnd(); - glEndQuery(GL_SAMPLES_PASSED); - glGetQueryObjectiv(occlusion_query, GL_QUERY_RESULT, &occlusion_result); - } - - if (swap_read_pixels) { - unsigned char rgba[4]; - glReadPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, rgba); - } -} - -void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_ESCAPE: - glfwSetWindowShouldClose(window, 1); - break; - } -} - -void draw_marker(struct nk_command_buffer* canvas, int lead, struct nk_vec2 pos) -{ - struct nk_color colors[4] = { nk_rgb(255,0,0), nk_rgb(255,255,0), nk_rgb(0,255,0), nk_rgb(0,96,255) }; - struct nk_rect rect = { -5 + pos.x, -5 + pos.y, 10, 10 }; - nk_fill_circle(canvas, rect, colors[lead]); -} - -int main(int argc, char** argv) -{ - int ch, width, height; - unsigned long frame_count = 0; - double last_time, current_time; - double frame_rate = 0; - int fullscreen = GLFW_FALSE; - GLFWmonitor* monitor = NULL; - GLFWwindow* window; - struct nk_context* nk; - struct nk_font_atlas* atlas; - - int show_forecasts = nk_true; - - while ((ch = getopt(argc, argv, "fh")) != -1) - { - switch (ch) - { - case 'h': - usage(); - exit(EXIT_SUCCESS); - - case 'f': - fullscreen = GLFW_TRUE; - break; - } - } - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - if (fullscreen) - { - const GLFWvidmode* mode; - - monitor = glfwGetPrimaryMonitor(); - mode = glfwGetVideoMode(monitor); - - width = mode->width; - height = mode->height; - } - else - { - width = 640; - height = 480; - } - - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); - - glfwWindowHint(GLFW_SCALE_TO_MONITOR, GLFW_TRUE); - glfwWindowHint(GLFW_WIN32_KEYBOARD_MENU, GLFW_TRUE); - - window = glfwCreateWindow(width, height, "Input lag test", monitor, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - gladLoadGL(glfwGetProcAddress); - update_vsync(); - - last_time = glfwGetTime(); - - nk = nk_glfw3_init(window, NK_GLFW3_INSTALL_CALLBACKS); - nk_glfw3_font_stash_begin(&atlas); - nk_glfw3_font_stash_end(); - - glfwSetKeyCallback(window, key_callback); - glfwSetCursorPosCallback(window, cursor_pos_callback); - - while (!glfwWindowShouldClose(window)) - { - int width, height; - struct nk_rect area; - - glfwPollEvents(); - sample_input(window); - - glfwGetWindowSize(window, &width, &height); - area = nk_rect(0.f, 0.f, (float) width, (float) height); - - glClear(GL_COLOR_BUFFER_BIT); - nk_glfw3_new_frame(); - if (nk_begin(nk, "", area, 0)) - { - nk_flags align_left = NK_TEXT_ALIGN_LEFT | NK_TEXT_ALIGN_MIDDLE; - struct nk_command_buffer *canvas = nk_window_get_canvas(nk); - int lead; - - for (lead = show_forecasts ? 3 : 0; lead >= 0; lead--) - draw_marker(canvas, lead, nk_vec2(cursor_pos.x + cursor_vel.x * lead, - cursor_pos.y + cursor_vel.y * lead)); - - // print instructions - nk_layout_row_dynamic(nk, 20, 1); - nk_label(nk, "Move mouse uniformly and check marker under cursor:", align_left); - for (lead = 0; lead <= 3; lead++) { - nk_layout_row_begin(nk, NK_STATIC, 12, 2); - nk_layout_row_push(nk, 25); - draw_marker(canvas, lead, nk_layout_space_to_screen(nk, nk_vec2(20, 5))); - nk_label(nk, "", 0); - nk_layout_row_push(nk, 500); - if (lead == 0) - nk_label(nk, "- current cursor position (no input lag)", align_left); - else - nk_labelf(nk, align_left, "- %d-frame forecast (input lag is %d frame)", lead, lead); - nk_layout_row_end(nk); - } - - nk_layout_row_dynamic(nk, 20, 1); - - nk_checkbox_label(nk, "Show forecasts", &show_forecasts); - nk_label(nk, "Input method:", align_left); - if (nk_option_label(nk, "glfwGetCursorPos (sync query)", cursor_method == cursor_sync_query)) - cursor_method = cursor_sync_query; - if (nk_option_label(nk, "glfwSetCursorPosCallback (latest input message)", cursor_method == cursor_input_message)) - cursor_method = cursor_input_message; - - nk_label(nk, "", 0); // separator - - nk_value_float(nk, "FPS", (float) frame_rate); - if (nk_checkbox_label(nk, "Enable vsync", &enable_vsync)) - update_vsync(); - - nk_label(nk, "", 0); // separator - - nk_label(nk, "After swap:", align_left); - nk_checkbox_label(nk, "glClear", &swap_clear); - nk_checkbox_label(nk, "glFinish", &swap_finish); - nk_checkbox_label(nk, "draw with occlusion query", &swap_occlusion_query); - nk_checkbox_label(nk, "glReadPixels", &swap_read_pixels); - } - - nk_end(nk); - nk_glfw3_render(NK_ANTI_ALIASING_ON); - - swap_buffers(window); - - frame_count++; - - current_time = glfwGetTime(); - if (current_time - last_time > 1.0) - { - frame_rate = frame_count / (current_time - last_time); - frame_count = 0; - last_time = current_time; - } - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/3rdparty/glfw/source/tests/joysticks.c b/3rdparty/glfw/source/tests/joysticks.c deleted file mode 100644 index df00021..0000000 --- a/3rdparty/glfw/source/tests/joysticks.c +++ /dev/null @@ -1,346 +0,0 @@ -//======================================================================== -// Joystick input test -// Copyright (c) Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This test displays the state of every button and axis of every connected -// joystick and/or gamepad -// -//======================================================================== - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#define NK_IMPLEMENTATION -#define NK_INCLUDE_FIXED_TYPES -#define NK_INCLUDE_FONT_BAKING -#define NK_INCLUDE_DEFAULT_FONT -#define NK_INCLUDE_DEFAULT_ALLOCATOR -#define NK_INCLUDE_VERTEX_BUFFER_OUTPUT -#define NK_INCLUDE_STANDARD_VARARGS -#define NK_BUTTON_TRIGGER_ON_RELEASE -#include - -#define NK_GLFW_GL2_IMPLEMENTATION -#include - -#include -#include -#include - -#ifdef _MSC_VER -#define strdup(x) _strdup(x) -#endif - -static GLFWwindow* window; -static int joysticks[GLFW_JOYSTICK_LAST + 1]; -static int joystick_count = 0; - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void joystick_callback(int jid, int event) -{ - if (event == GLFW_CONNECTED) - joysticks[joystick_count++] = jid; - else if (event == GLFW_DISCONNECTED) - { - int i; - - for (i = 0; i < joystick_count; i++) - { - if (joysticks[i] == jid) - break; - } - - for (i = i + 1; i < joystick_count; i++) - joysticks[i - 1] = joysticks[i]; - - joystick_count--; - } - - if (!glfwGetWindowAttrib(window, GLFW_FOCUSED)) - glfwRequestWindowAttention(window); -} - -static void drop_callback(GLFWwindow* window, int count, const char* paths[]) -{ - int i; - - for (i = 0; i < count; i++) - { - long size; - char* text; - FILE* stream = fopen(paths[i], "rb"); - if (!stream) - continue; - - fseek(stream, 0, SEEK_END); - size = ftell(stream); - fseek(stream, 0, SEEK_SET); - - text = malloc(size + 1); - text[size] = '\0'; - if (fread(text, 1, size, stream) == size) - glfwUpdateGamepadMappings(text); - - free(text); - fclose(stream); - } -} - -static const char* joystick_label(int jid) -{ - static char label[1024]; - snprintf(label, sizeof(label), "%i: %s", jid + 1, glfwGetJoystickName(jid)); - return label; -} - -static void hat_widget(struct nk_context* nk, unsigned char state) -{ - float radius; - struct nk_rect area; - struct nk_vec2 center; - - if (nk_widget(&area, nk) == NK_WIDGET_INVALID) - return; - - center = nk_vec2(area.x + area.w / 2.f, area.y + area.h / 2.f); - radius = NK_MIN(area.w, area.h) / 2.f; - - nk_stroke_circle(nk_window_get_canvas(nk), - nk_rect(center.x - radius, - center.y - radius, - radius * 2.f, - radius * 2.f), - 1.f, - nk_rgb(175, 175, 175)); - - if (state) - { - const float angles[] = - { - 0.f, 0.f, - NK_PI * 1.5f, NK_PI * 1.75f, - NK_PI, 0.f, - NK_PI * 1.25f, 0.f, - NK_PI * 0.5f, NK_PI * 0.25f, - 0.f, 0.f, - NK_PI * 0.75f, 0.f, - }; - const float cosa = nk_cos(angles[state]); - const float sina = nk_sin(angles[state]); - const struct nk_vec2 p0 = nk_vec2(0.f, -radius); - const struct nk_vec2 p1 = nk_vec2( radius / 2.f, -radius / 3.f); - const struct nk_vec2 p2 = nk_vec2(-radius / 2.f, -radius / 3.f); - - nk_fill_triangle(nk_window_get_canvas(nk), - center.x + cosa * p0.x + sina * p0.y, - center.y + cosa * p0.y - sina * p0.x, - center.x + cosa * p1.x + sina * p1.y, - center.y + cosa * p1.y - sina * p1.x, - center.x + cosa * p2.x + sina * p2.y, - center.y + cosa * p2.y - sina * p2.x, - nk_rgb(175, 175, 175)); - } -} - -int main(void) -{ - int jid, hat_buttons = GLFW_FALSE; - struct nk_context* nk; - struct nk_font_atlas* atlas; - - memset(joysticks, 0, sizeof(joysticks)); - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - glfwWindowHint(GLFW_SCALE_TO_MONITOR, GLFW_TRUE); - glfwWindowHint(GLFW_WIN32_KEYBOARD_MENU, GLFW_TRUE); - - window = glfwCreateWindow(800, 600, "Joystick Test", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - gladLoadGL(glfwGetProcAddress); - glfwSwapInterval(1); - - nk = nk_glfw3_init(window, NK_GLFW3_INSTALL_CALLBACKS); - nk_glfw3_font_stash_begin(&atlas); - nk_glfw3_font_stash_end(); - - for (jid = GLFW_JOYSTICK_1; jid <= GLFW_JOYSTICK_LAST; jid++) - { - if (glfwJoystickPresent(jid)) - joysticks[joystick_count++] = jid; - } - - glfwSetJoystickCallback(joystick_callback); - glfwSetDropCallback(window, drop_callback); - - while (!glfwWindowShouldClose(window)) - { - int i, width, height; - - glfwGetWindowSize(window, &width, &height); - - glClear(GL_COLOR_BUFFER_BIT); - nk_glfw3_new_frame(); - - if (nk_begin(nk, - "Joysticks", - nk_rect(width - 200.f, 0.f, 200.f, (float) height), - NK_WINDOW_MINIMIZABLE | - NK_WINDOW_TITLE)) - { - nk_layout_row_dynamic(nk, 30, 1); - - nk_checkbox_label(nk, "Hat buttons", &hat_buttons); - - if (joystick_count) - { - for (i = 0; i < joystick_count; i++) - { - if (nk_button_label(nk, joystick_label(joysticks[i]))) - nk_window_set_focus(nk, joystick_label(joysticks[i])); - } - } - else - nk_label(nk, "No joysticks connected", NK_TEXT_LEFT); - } - - nk_end(nk); - - for (i = 0; i < joystick_count; i++) - { - if (nk_begin(nk, - joystick_label(joysticks[i]), - nk_rect(i * 20.f, i * 20.f, 550.f, 570.f), - NK_WINDOW_BORDER | - NK_WINDOW_MOVABLE | - NK_WINDOW_SCALABLE | - NK_WINDOW_MINIMIZABLE | - NK_WINDOW_TITLE)) - { - int j, axis_count, button_count, hat_count; - const float* axes; - const unsigned char* buttons; - const unsigned char* hats; - GLFWgamepadstate state; - - nk_layout_row_dynamic(nk, 30, 1); - nk_labelf(nk, NK_TEXT_LEFT, "Hardware GUID %s", - glfwGetJoystickGUID(joysticks[i])); - nk_label(nk, "Joystick state", NK_TEXT_LEFT); - - axes = glfwGetJoystickAxes(joysticks[i], &axis_count); - buttons = glfwGetJoystickButtons(joysticks[i], &button_count); - hats = glfwGetJoystickHats(joysticks[i], &hat_count); - - if (!hat_buttons) - button_count -= hat_count * 4; - - for (j = 0; j < axis_count; j++) - nk_slide_float(nk, -1.f, axes[j], 1.f, 0.1f); - - nk_layout_row_dynamic(nk, 30, 12); - - for (j = 0; j < button_count; j++) - { - char name[16]; - snprintf(name, sizeof(name), "%i", j + 1); - nk_select_label(nk, name, NK_TEXT_CENTERED, buttons[j]); - } - - nk_layout_row_dynamic(nk, 30, 8); - - for (j = 0; j < hat_count; j++) - hat_widget(nk, hats[j]); - - nk_layout_row_dynamic(nk, 30, 1); - - if (glfwGetGamepadState(joysticks[i], &state)) - { - int hat = 0; - const char* names[GLFW_GAMEPAD_BUTTON_LAST + 1 - 4] = - { - "A", "B", "X", "Y", - "LB", "RB", - "Back", "Start", "Guide", - "LT", "RT", - }; - - nk_labelf(nk, NK_TEXT_LEFT, - "Gamepad state: %s", - glfwGetGamepadName(joysticks[i])); - - nk_layout_row_dynamic(nk, 30, 2); - - for (j = 0; j <= GLFW_GAMEPAD_AXIS_LAST; j++) - nk_slide_float(nk, -1.f, state.axes[j], 1.f, 0.1f); - - nk_layout_row_dynamic(nk, 30, GLFW_GAMEPAD_BUTTON_LAST + 1 - 4); - - for (j = 0; j <= GLFW_GAMEPAD_BUTTON_LAST - 4; j++) - nk_select_label(nk, names[j], NK_TEXT_CENTERED, state.buttons[j]); - - if (state.buttons[GLFW_GAMEPAD_BUTTON_DPAD_UP]) - hat |= GLFW_HAT_UP; - if (state.buttons[GLFW_GAMEPAD_BUTTON_DPAD_RIGHT]) - hat |= GLFW_HAT_RIGHT; - if (state.buttons[GLFW_GAMEPAD_BUTTON_DPAD_DOWN]) - hat |= GLFW_HAT_DOWN; - if (state.buttons[GLFW_GAMEPAD_BUTTON_DPAD_LEFT]) - hat |= GLFW_HAT_LEFT; - - nk_layout_row_dynamic(nk, 30, 8); - hat_widget(nk, hat); - } - else - nk_label(nk, "Joystick has no gamepad mapping", NK_TEXT_LEFT); - } - - nk_end(nk); - } - - nk_glfw3_render(NK_ANTI_ALIASING_ON); - - glfwSwapBuffers(window); - glfwPollEvents(); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/3rdparty/glfw/source/tests/monitors.c b/3rdparty/glfw/source/tests/monitors.c deleted file mode 100644 index 1043e66..0000000 --- a/3rdparty/glfw/source/tests/monitors.c +++ /dev/null @@ -1,263 +0,0 @@ -//======================================================================== -// Monitor information tool -// Copyright (c) Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This test prints monitor and video mode information or verifies video -// modes -// -//======================================================================== - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#include -#include -#include - -#include "getopt.h" - -enum Mode -{ - LIST_MODE, - TEST_MODE -}; - -static void usage(void) -{ - printf("Usage: monitors [-t]\n"); - printf(" monitors -h\n"); -} - -static int euclid(int a, int b) -{ - return b ? euclid(b, a % b) : a; -} - -static const char* format_mode(const GLFWvidmode* mode) -{ - static char buffer[512]; - const int gcd = euclid(mode->width, mode->height); - - snprintf(buffer, - sizeof(buffer), - "%i x %i x %i (%i:%i) (%i %i %i) %i Hz", - mode->width, mode->height, - mode->redBits + mode->greenBits + mode->blueBits, - mode->width / gcd, mode->height / gcd, - mode->redBits, mode->greenBits, mode->blueBits, - mode->refreshRate); - - buffer[sizeof(buffer) - 1] = '\0'; - return buffer; -} - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void framebuffer_size_callback(GLFWwindow* window, int width, int height) -{ - printf("Framebuffer resized to %ix%i\n", width, height); - - glViewport(0, 0, width, height); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key == GLFW_KEY_ESCAPE) - glfwSetWindowShouldClose(window, GLFW_TRUE); -} - -static void list_modes(GLFWmonitor* monitor) -{ - int count, x, y, width_mm, height_mm, i; - int workarea_x, workarea_y, workarea_width, workarea_height; - float xscale, yscale; - - const GLFWvidmode* mode = glfwGetVideoMode(monitor); - const GLFWvidmode* modes = glfwGetVideoModes(monitor, &count); - - glfwGetMonitorPos(monitor, &x, &y); - glfwGetMonitorPhysicalSize(monitor, &width_mm, &height_mm); - glfwGetMonitorContentScale(monitor, &xscale, &yscale); - glfwGetMonitorWorkarea(monitor, &workarea_x, &workarea_y, &workarea_width, &workarea_height); - - printf("Name: %s (%s)\n", - glfwGetMonitorName(monitor), - glfwGetPrimaryMonitor() == monitor ? "primary" : "secondary"); - printf("Current mode: %s\n", format_mode(mode)); - printf("Virtual position: %i, %i\n", x, y); - printf("Content scale: %f x %f\n", xscale, yscale); - - printf("Physical size: %i x %i mm (%0.2f dpi at %i x %i)\n", - width_mm, height_mm, mode->width * 25.4f / width_mm, mode->width, mode->height); - printf("Monitor work area: %i x %i starting at %i, %i\n", - workarea_width, workarea_height, workarea_x, workarea_y); - - printf("Modes:\n"); - - for (i = 0; i < count; i++) - { - printf("%3u: %s", (unsigned int) i, format_mode(modes + i)); - - if (memcmp(mode, modes + i, sizeof(GLFWvidmode)) == 0) - printf(" (current mode)"); - - putchar('\n'); - } -} - -static void test_modes(GLFWmonitor* monitor) -{ - int i, count; - GLFWwindow* window; - const GLFWvidmode* modes = glfwGetVideoModes(monitor, &count); - - for (i = 0; i < count; i++) - { - const GLFWvidmode* mode = modes + i; - GLFWvidmode current; - - glfwWindowHint(GLFW_RED_BITS, mode->redBits); - glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits); - glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits); - glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate); - - printf("Testing mode %u on monitor %s: %s\n", - (unsigned int) i, - glfwGetMonitorName(monitor), - format_mode(mode)); - - window = glfwCreateWindow(mode->width, mode->height, - "Video Mode Test", - glfwGetPrimaryMonitor(), - NULL); - if (!window) - { - printf("Failed to enter mode %u: %s\n", - (unsigned int) i, - format_mode(mode)); - continue; - } - - glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); - glfwSetKeyCallback(window, key_callback); - - glfwMakeContextCurrent(window); - gladLoadGL(glfwGetProcAddress); - glfwSwapInterval(1); - - glfwSetTime(0.0); - - while (glfwGetTime() < 5.0) - { - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(window); - glfwPollEvents(); - - if (glfwWindowShouldClose(window)) - { - printf("User terminated program\n"); - - glfwTerminate(); - exit(EXIT_SUCCESS); - } - } - - glGetIntegerv(GL_RED_BITS, ¤t.redBits); - glGetIntegerv(GL_GREEN_BITS, ¤t.greenBits); - glGetIntegerv(GL_BLUE_BITS, ¤t.blueBits); - - glfwGetWindowSize(window, ¤t.width, ¤t.height); - - if (current.redBits != mode->redBits || - current.greenBits != mode->greenBits || - current.blueBits != mode->blueBits) - { - printf("*** Color bit mismatch: (%i %i %i) instead of (%i %i %i)\n", - current.redBits, current.greenBits, current.blueBits, - mode->redBits, mode->greenBits, mode->blueBits); - } - - if (current.width != mode->width || current.height != mode->height) - { - printf("*** Size mismatch: %ix%i instead of %ix%i\n", - current.width, current.height, - mode->width, mode->height); - } - - printf("Closing window\n"); - - glfwDestroyWindow(window); - window = NULL; - - glfwPollEvents(); - } -} - -int main(int argc, char** argv) -{ - int ch, i, count, mode = LIST_MODE; - GLFWmonitor** monitors; - - while ((ch = getopt(argc, argv, "th")) != -1) - { - switch (ch) - { - case 'h': - usage(); - exit(EXIT_SUCCESS); - case 't': - mode = TEST_MODE; - break; - default: - usage(); - exit(EXIT_FAILURE); - } - } - - glfwSetErrorCallback(error_callback); - - glfwInitHint(GLFW_COCOA_MENUBAR, GLFW_FALSE); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - monitors = glfwGetMonitors(&count); - - for (i = 0; i < count; i++) - { - if (mode == LIST_MODE) - list_modes(monitors[i]); - else if (mode == TEST_MODE) - test_modes(monitors[i]); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/3rdparty/glfw/source/tests/msaa.c b/3rdparty/glfw/source/tests/msaa.c deleted file mode 100644 index 10bfa3c..0000000 --- a/3rdparty/glfw/source/tests/msaa.c +++ /dev/null @@ -1,221 +0,0 @@ -//======================================================================== -// Multisample anti-aliasing test -// Copyright (c) Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This test renders two high contrast, slowly rotating quads, one aliased -// and one (hopefully) anti-aliased, thus allowing for visual verification -// of whether MSAA is indeed enabled -// -//======================================================================== - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#if defined(_MSC_VER) - // Make MS math.h define M_PI - #define _USE_MATH_DEFINES -#endif - -#include "linmath.h" - -#include -#include - -#include "getopt.h" - -static const vec2 vertices[4] = -{ - { -0.6f, -0.6f }, - { 0.6f, -0.6f }, - { 0.6f, 0.6f }, - { -0.6f, 0.6f } -}; - -static const char* vertex_shader_text = -"#version 110\n" -"uniform mat4 MVP;\n" -"attribute vec2 vPos;\n" -"void main()\n" -"{\n" -" gl_Position = MVP * vec4(vPos, 0.0, 1.0);\n" -"}\n"; - -static const char* fragment_shader_text = -"#version 110\n" -"void main()\n" -"{\n" -" gl_FragColor = vec4(1.0);\n" -"}\n"; - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_SPACE: - glfwSetTime(0.0); - break; - case GLFW_KEY_ESCAPE: - glfwSetWindowShouldClose(window, GLFW_TRUE); - break; - } -} - -static void usage(void) -{ - printf("Usage: msaa [-h] [-s SAMPLES]\n"); -} - -int main(int argc, char** argv) -{ - int ch, samples = 4; - GLFWwindow* window; - GLuint vertex_buffer, vertex_shader, fragment_shader, program; - GLint mvp_location, vpos_location; - - while ((ch = getopt(argc, argv, "hs:")) != -1) - { - switch (ch) - { - case 'h': - usage(); - exit(EXIT_SUCCESS); - case 's': - samples = atoi(optarg); - break; - default: - usage(); - exit(EXIT_FAILURE); - } - } - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - if (samples) - printf("Requesting MSAA with %i samples\n", samples); - else - printf("Requesting that MSAA not be available\n"); - - glfwWindowHint(GLFW_SAMPLES, samples); - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); - - window = glfwCreateWindow(800, 400, "Aliasing Detector", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwSetKeyCallback(window, key_callback); - - glfwMakeContextCurrent(window); - gladLoadGL(glfwGetProcAddress); - glfwSwapInterval(1); - - glGetIntegerv(GL_SAMPLES, &samples); - if (samples) - printf("Context reports MSAA is available with %i samples\n", samples); - else - printf("Context reports MSAA is unavailable\n"); - - glGenBuffers(1, &vertex_buffer); - glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer); - glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW); - - vertex_shader = glCreateShader(GL_VERTEX_SHADER); - glShaderSource(vertex_shader, 1, &vertex_shader_text, NULL); - glCompileShader(vertex_shader); - - fragment_shader = glCreateShader(GL_FRAGMENT_SHADER); - glShaderSource(fragment_shader, 1, &fragment_shader_text, NULL); - glCompileShader(fragment_shader); - - program = glCreateProgram(); - glAttachShader(program, vertex_shader); - glAttachShader(program, fragment_shader); - glLinkProgram(program); - - mvp_location = glGetUniformLocation(program, "MVP"); - vpos_location = glGetAttribLocation(program, "vPos"); - - glEnableVertexAttribArray(vpos_location); - glVertexAttribPointer(vpos_location, 2, GL_FLOAT, GL_FALSE, - sizeof(vertices[0]), (void*) 0); - - while (!glfwWindowShouldClose(window)) - { - float ratio; - int width, height; - mat4x4 m, p, mvp; - const double angle = glfwGetTime() * M_PI / 180.0; - - glfwGetFramebufferSize(window, &width, &height); - ratio = width / (float) height; - - glViewport(0, 0, width, height); - glClear(GL_COLOR_BUFFER_BIT); - - glUseProgram(program); - - mat4x4_ortho(p, -ratio, ratio, -1.f, 1.f, 0.f, 1.f); - - mat4x4_translate(m, -1.f, 0.f, 0.f); - mat4x4_rotate_Z(m, m, (float) angle); - mat4x4_mul(mvp, p, m); - - glUniformMatrix4fv(mvp_location, 1, GL_FALSE, (const GLfloat*) mvp); - glDisable(GL_MULTISAMPLE); - glDrawArrays(GL_TRIANGLE_FAN, 0, 4); - - mat4x4_translate(m, 1.f, 0.f, 0.f); - mat4x4_rotate_Z(m, m, (float) angle); - mat4x4_mul(mvp, p, m); - - glUniformMatrix4fv(mvp_location, 1, GL_FALSE, (const GLfloat*) mvp); - glEnable(GL_MULTISAMPLE); - glDrawArrays(GL_TRIANGLE_FAN, 0, 4); - - glfwSwapBuffers(window); - glfwPollEvents(); - } - - glfwDestroyWindow(window); - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/3rdparty/glfw/source/tests/reopen.c b/3rdparty/glfw/source/tests/reopen.c deleted file mode 100644 index b458755..0000000 --- a/3rdparty/glfw/source/tests/reopen.c +++ /dev/null @@ -1,241 +0,0 @@ -//======================================================================== -// Window re-opener (open/close stress test) -// Copyright (c) Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This test came about as the result of bug #1262773 -// -// It closes and re-opens the GLFW window every five seconds, alternating -// between windowed and full screen mode -// -// It also times and logs opening and closing actions and attempts to separate -// user initiated window closing from its own -// -//======================================================================== - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#include -#include -#include - -#include "linmath.h" - -static const char* vertex_shader_text = -"#version 110\n" -"uniform mat4 MVP;\n" -"attribute vec2 vPos;\n" -"void main()\n" -"{\n" -" gl_Position = MVP * vec4(vPos, 0.0, 1.0);\n" -"}\n"; - -static const char* fragment_shader_text = -"#version 110\n" -"void main()\n" -"{\n" -" gl_FragColor = vec4(1.0);\n" -"}\n"; - -static const vec2 vertices[4] = -{ - { -0.5f, -0.5f }, - { 0.5f, -0.5f }, - { 0.5f, 0.5f }, - { -0.5f, 0.5f } -}; - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void window_close_callback(GLFWwindow* window) -{ - printf("Close callback triggered\n"); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_Q: - case GLFW_KEY_ESCAPE: - glfwSetWindowShouldClose(window, GLFW_TRUE); - break; - } -} - -static void close_window(GLFWwindow* window) -{ - double base = glfwGetTime(); - glfwDestroyWindow(window); - printf("Closing window took %0.3f seconds\n", glfwGetTime() - base); -} - -int main(int argc, char** argv) -{ - int count = 0; - double base; - GLFWwindow* window; - - srand((unsigned int) time(NULL)); - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); - - for (;;) - { - int width, height; - GLFWmonitor* monitor = NULL; - GLuint vertex_shader, fragment_shader, program, vertex_buffer; - GLint mvp_location, vpos_location; - - if (count & 1) - { - int monitorCount; - GLFWmonitor** monitors = glfwGetMonitors(&monitorCount); - monitor = monitors[rand() % monitorCount]; - } - - if (monitor) - { - const GLFWvidmode* mode = glfwGetVideoMode(monitor); - width = mode->width; - height = mode->height; - } - else - { - width = 640; - height = 480; - } - - base = glfwGetTime(); - - window = glfwCreateWindow(width, height, "Window Re-opener", monitor, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - if (monitor) - { - printf("Opening full screen window on monitor %s took %0.3f seconds\n", - glfwGetMonitorName(monitor), - glfwGetTime() - base); - } - else - { - printf("Opening regular window took %0.3f seconds\n", - glfwGetTime() - base); - } - - glfwSetWindowCloseCallback(window, window_close_callback); - glfwSetKeyCallback(window, key_callback); - - glfwMakeContextCurrent(window); - gladLoadGL(glfwGetProcAddress); - glfwSwapInterval(1); - - vertex_shader = glCreateShader(GL_VERTEX_SHADER); - glShaderSource(vertex_shader, 1, &vertex_shader_text, NULL); - glCompileShader(vertex_shader); - - fragment_shader = glCreateShader(GL_FRAGMENT_SHADER); - glShaderSource(fragment_shader, 1, &fragment_shader_text, NULL); - glCompileShader(fragment_shader); - - program = glCreateProgram(); - glAttachShader(program, vertex_shader); - glAttachShader(program, fragment_shader); - glLinkProgram(program); - - mvp_location = glGetUniformLocation(program, "MVP"); - vpos_location = glGetAttribLocation(program, "vPos"); - - glGenBuffers(1, &vertex_buffer); - glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer); - glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW); - - glEnableVertexAttribArray(vpos_location); - glVertexAttribPointer(vpos_location, 2, GL_FLOAT, GL_FALSE, - sizeof(vertices[0]), (void*) 0); - - glfwSetTime(0.0); - - while (glfwGetTime() < 5.0) - { - float ratio; - int width, height; - mat4x4 m, p, mvp; - - glfwGetFramebufferSize(window, &width, &height); - ratio = width / (float) height; - - glViewport(0, 0, width, height); - glClear(GL_COLOR_BUFFER_BIT); - - mat4x4_ortho(p, -ratio, ratio, -1.f, 1.f, 0.f, 1.f); - - mat4x4_identity(m); - mat4x4_rotate_Z(m, m, (float) glfwGetTime()); - mat4x4_mul(mvp, p, m); - - glUseProgram(program); - glUniformMatrix4fv(mvp_location, 1, GL_FALSE, (const GLfloat*) mvp); - glDrawArrays(GL_TRIANGLE_FAN, 0, 4); - - glfwSwapBuffers(window); - glfwPollEvents(); - - if (glfwWindowShouldClose(window)) - { - close_window(window); - printf("User closed window\n"); - - glfwTerminate(); - exit(EXIT_SUCCESS); - } - } - - printf("Closing window\n"); - close_window(window); - - count++; - } - - glfwTerminate(); -} - diff --git a/3rdparty/glfw/source/tests/tearing.c b/3rdparty/glfw/source/tests/tearing.c deleted file mode 100644 index 5c7893c..0000000 --- a/3rdparty/glfw/source/tests/tearing.c +++ /dev/null @@ -1,251 +0,0 @@ -//======================================================================== -// Vsync enabling test -// Copyright (c) Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This test renders a high contrast, horizontally moving bar, allowing for -// visual verification of whether the set swap interval is indeed obeyed -// -//======================================================================== - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#include -#include -#include - -#include "linmath.h" - -static const struct -{ - float x, y; -} vertices[4] = -{ - { -0.25f, -1.f }, - { 0.25f, -1.f }, - { 0.25f, 1.f }, - { -0.25f, 1.f } -}; - -static const char* vertex_shader_text = -"#version 110\n" -"uniform mat4 MVP;\n" -"attribute vec2 vPos;\n" -"void main()\n" -"{\n" -" gl_Position = MVP * vec4(vPos, 0.0, 1.0);\n" -"}\n"; - -static const char* fragment_shader_text = -"#version 110\n" -"void main()\n" -"{\n" -" gl_FragColor = vec4(1.0);\n" -"}\n"; - -static int swap_tear; -static int swap_interval; -static double frame_rate; - -static void update_window_title(GLFWwindow* window) -{ - char title[256]; - - snprintf(title, sizeof(title), "Tearing detector (interval %i%s, %0.1f Hz)", - swap_interval, - (swap_tear && swap_interval < 0) ? " (swap tear)" : "", - frame_rate); - - glfwSetWindowTitle(window, title); -} - -static void set_swap_interval(GLFWwindow* window, int interval) -{ - swap_interval = interval; - glfwSwapInterval(swap_interval); - update_window_title(window); -} - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (action != GLFW_PRESS) - return; - - switch (key) - { - case GLFW_KEY_UP: - { - if (swap_interval + 1 > swap_interval) - set_swap_interval(window, swap_interval + 1); - break; - } - - case GLFW_KEY_DOWN: - { - if (swap_tear) - { - if (swap_interval - 1 < swap_interval) - set_swap_interval(window, swap_interval - 1); - } - else - { - if (swap_interval - 1 >= 0) - set_swap_interval(window, swap_interval - 1); - } - break; - } - - case GLFW_KEY_ESCAPE: - glfwSetWindowShouldClose(window, 1); - break; - - case GLFW_KEY_F11: - case GLFW_KEY_ENTER: - { - static int x, y, width, height; - - if (mods != GLFW_MOD_ALT) - return; - - if (glfwGetWindowMonitor(window)) - glfwSetWindowMonitor(window, NULL, x, y, width, height, 0); - else - { - GLFWmonitor* monitor = glfwGetPrimaryMonitor(); - const GLFWvidmode* mode = glfwGetVideoMode(monitor); - glfwGetWindowPos(window, &x, &y); - glfwGetWindowSize(window, &width, &height); - glfwSetWindowMonitor(window, monitor, - 0, 0, mode->width, mode->height, - mode->refreshRate); - } - - break; - } - } -} - -int main(int argc, char** argv) -{ - unsigned long frame_count = 0; - double last_time, current_time; - GLFWwindow* window; - GLuint vertex_buffer, vertex_shader, fragment_shader, program; - GLint mvp_location, vpos_location; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); - - window = glfwCreateWindow(640, 480, "Tearing detector", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - gladLoadGL(glfwGetProcAddress); - set_swap_interval(window, 0); - - last_time = glfwGetTime(); - frame_rate = 0.0; - swap_tear = (glfwExtensionSupported("WGL_EXT_swap_control_tear") || - glfwExtensionSupported("GLX_EXT_swap_control_tear")); - - glfwSetKeyCallback(window, key_callback); - - glGenBuffers(1, &vertex_buffer); - glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer); - glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW); - - vertex_shader = glCreateShader(GL_VERTEX_SHADER); - glShaderSource(vertex_shader, 1, &vertex_shader_text, NULL); - glCompileShader(vertex_shader); - - fragment_shader = glCreateShader(GL_FRAGMENT_SHADER); - glShaderSource(fragment_shader, 1, &fragment_shader_text, NULL); - glCompileShader(fragment_shader); - - program = glCreateProgram(); - glAttachShader(program, vertex_shader); - glAttachShader(program, fragment_shader); - glLinkProgram(program); - - mvp_location = glGetUniformLocation(program, "MVP"); - vpos_location = glGetAttribLocation(program, "vPos"); - - glEnableVertexAttribArray(vpos_location); - glVertexAttribPointer(vpos_location, 2, GL_FLOAT, GL_FALSE, - sizeof(vertices[0]), (void*) 0); - - while (!glfwWindowShouldClose(window)) - { - int width, height; - mat4x4 m, p, mvp; - float position = cosf((float) glfwGetTime() * 4.f) * 0.75f; - - glfwGetFramebufferSize(window, &width, &height); - - glViewport(0, 0, width, height); - glClear(GL_COLOR_BUFFER_BIT); - - mat4x4_ortho(p, -1.f, 1.f, -1.f, 1.f, 0.f, 1.f); - mat4x4_translate(m, position, 0.f, 0.f); - mat4x4_mul(mvp, p, m); - - glUseProgram(program); - glUniformMatrix4fv(mvp_location, 1, GL_FALSE, (const GLfloat*) mvp); - glDrawArrays(GL_TRIANGLE_FAN, 0, 4); - - glfwSwapBuffers(window); - glfwPollEvents(); - - frame_count++; - - current_time = glfwGetTime(); - if (current_time - last_time > 1.0) - { - frame_rate = frame_count / (current_time - last_time); - frame_count = 0; - last_time = current_time; - update_window_title(window); - } - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/3rdparty/glfw/source/tests/threads.c b/3rdparty/glfw/source/tests/threads.c deleted file mode 100644 index ec13b00..0000000 --- a/3rdparty/glfw/source/tests/threads.c +++ /dev/null @@ -1,153 +0,0 @@ -//======================================================================== -// Multi-threading test -// Copyright (c) Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This test is intended to verify whether the OpenGL context part of -// the GLFW API is able to be used from multiple threads -// -//======================================================================== - -#include "tinycthread.h" - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#include -#include -#include - -typedef struct -{ - GLFWwindow* window; - const char* title; - float r, g, b; - thrd_t id; -} Thread; - -static volatile int running = GLFW_TRUE; - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) - glfwSetWindowShouldClose(window, GLFW_TRUE); -} - -static int thread_main(void* data) -{ - const Thread* thread = data; - - glfwMakeContextCurrent(thread->window); - glfwSwapInterval(1); - - while (running) - { - const float v = (float) fabs(sin(glfwGetTime() * 2.f)); - glClearColor(thread->r * v, thread->g * v, thread->b * v, 0.f); - - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(thread->window); - } - - glfwMakeContextCurrent(NULL); - return 0; -} - -int main(void) -{ - int i, result; - Thread threads[] = - { - { NULL, "Red", 1.f, 0.f, 0.f, 0 }, - { NULL, "Green", 0.f, 1.f, 0.f, 0 }, - { NULL, "Blue", 0.f, 0.f, 1.f, 0 } - }; - const int count = sizeof(threads) / sizeof(Thread); - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE); - - for (i = 0; i < count; i++) - { - threads[i].window = glfwCreateWindow(200, 200, - threads[i].title, - NULL, NULL); - if (!threads[i].window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwSetKeyCallback(threads[i].window, key_callback); - - glfwSetWindowPos(threads[i].window, 200 + 250 * i, 200); - glfwShowWindow(threads[i].window); - } - - glfwMakeContextCurrent(threads[0].window); - gladLoadGL(glfwGetProcAddress); - glfwMakeContextCurrent(NULL); - - for (i = 0; i < count; i++) - { - if (thrd_create(&threads[i].id, thread_main, threads + i) != - thrd_success) - { - fprintf(stderr, "Failed to create secondary thread\n"); - - glfwTerminate(); - exit(EXIT_FAILURE); - } - } - - while (running) - { - glfwWaitEvents(); - - for (i = 0; i < count; i++) - { - if (glfwWindowShouldClose(threads[i].window)) - running = GLFW_FALSE; - } - } - - for (i = 0; i < count; i++) - glfwHideWindow(threads[i].window); - - for (i = 0; i < count; i++) - thrd_join(threads[i].id, &result); - - exit(EXIT_SUCCESS); -} - diff --git a/3rdparty/glfw/source/tests/timeout.c b/3rdparty/glfw/source/tests/timeout.c deleted file mode 100644 index c273746..0000000 --- a/3rdparty/glfw/source/tests/timeout.c +++ /dev/null @@ -1,99 +0,0 @@ -//======================================================================== -// Event wait timeout test -// Copyright (c) Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This test is intended to verify that waiting for events with timeout works -// -//======================================================================== - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#include -#include -#include -#include - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) -{ - if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) - glfwSetWindowShouldClose(window, GLFW_TRUE); -} - -static float nrand(void) -{ - return (float) rand() / (float) RAND_MAX; -} - -int main(void) -{ - GLFWwindow* window; - - srand((unsigned int) time(NULL)); - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - window = glfwCreateWindow(640, 480, "Event Wait Timeout Test", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - gladLoadGL(glfwGetProcAddress); - glfwSetKeyCallback(window, key_callback); - - while (!glfwWindowShouldClose(window)) - { - int width, height; - float r = nrand(), g = nrand(), b = nrand(); - float l = (float) sqrt(r * r + g * g + b * b); - - glfwGetFramebufferSize(window, &width, &height); - - glViewport(0, 0, width, height); - glClearColor(r / l, g / l, b / l, 1.f); - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(window); - - glfwWaitEventsTimeout(1.0); - } - - glfwDestroyWindow(window); - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/3rdparty/glfw/source/tests/title.c b/3rdparty/glfw/source/tests/title.c deleted file mode 100644 index 08a24e7..0000000 --- a/3rdparty/glfw/source/tests/title.c +++ /dev/null @@ -1,73 +0,0 @@ -//======================================================================== -// UTF-8 window title test -// Copyright (c) Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== -// -// This test sets a UTF-8 window title -// -//======================================================================== - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#include -#include - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -int main(void) -{ - GLFWwindow* window; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - window = glfwCreateWindow(400, 400, "English 日本語 руÑÑкий Ñзык 官話", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - gladLoadGL(glfwGetProcAddress); - glfwSwapInterval(1); - - while (!glfwWindowShouldClose(window)) - { - glClear(GL_COLOR_BUFFER_BIT); - glfwSwapBuffers(window); - glfwWaitEvents(); - } - - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/3rdparty/glfw/source/tests/triangle-vulkan.c b/3rdparty/glfw/source/tests/triangle-vulkan.c deleted file mode 100644 index fb5db3e..0000000 --- a/3rdparty/glfw/source/tests/triangle-vulkan.c +++ /dev/null @@ -1,2129 +0,0 @@ -/* - * Copyright (c) 2015-2016 The Khronos Group Inc. - * Copyright (c) 2015-2016 Valve Corporation - * Copyright (c) 2015-2016 LunarG, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Author: Chia-I Wu - * Author: Cody Northrop - * Author: Courtney Goeltzenleuchter - * Author: Ian Elliott - * Author: Jon Ashburn - * Author: Piers Daniell - * Author: Gwan-gyeong Mun - * Porter: Camilla Löwy - */ -/* - * Draw a textured triangle with depth testing. This is written against Intel - * ICD. It does not do state transition nor object memory binding like it - * should. It also does no error checking. - */ - -#include -#include -#include -#include -#include -#include - -#ifdef _WIN32 -#include -#endif - -#define GLAD_VULKAN_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#define DEMO_TEXTURE_COUNT 1 -#define VERTEX_BUFFER_BIND_ID 0 -#define APP_SHORT_NAME "tri" -#define APP_LONG_NAME "The Vulkan Triangle Demo Program" - -#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) - -#if defined(NDEBUG) && defined(__GNUC__) -#define U_ASSERT_ONLY __attribute__((unused)) -#else -#define U_ASSERT_ONLY -#endif - -#define ERR_EXIT(err_msg, err_class) \ - do { \ - printf(err_msg); \ - fflush(stdout); \ - exit(1); \ - } while (0) - -static const uint32_t fragShaderCode[] = { - 0x07230203,0x00010000,0x00080007,0x00000014,0x00000000,0x00020011,0x00000001,0x0006000b, - 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, - 0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000009,0x00000011,0x00030010, - 0x00000004,0x00000007,0x00030003,0x00000002,0x00000190,0x00090004,0x415f4c47,0x735f4252, - 0x72617065,0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00090004,0x415f4c47, - 0x735f4252,0x69646168,0x6c5f676e,0x75676e61,0x5f656761,0x70303234,0x006b6361,0x00040005, - 0x00000004,0x6e69616d,0x00000000,0x00050005,0x00000009,0x61724675,0x6c6f4367,0x0000726f, - 0x00030005,0x0000000d,0x00786574,0x00050005,0x00000011,0x63786574,0x64726f6f,0x00000000, - 0x00040047,0x00000009,0x0000001e,0x00000000,0x00040047,0x0000000d,0x00000022,0x00000000, - 0x00040047,0x0000000d,0x00000021,0x00000000,0x00040047,0x00000011,0x0000001e,0x00000000, - 0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020, - 0x00040017,0x00000007,0x00000006,0x00000004,0x00040020,0x00000008,0x00000003,0x00000007, - 0x0004003b,0x00000008,0x00000009,0x00000003,0x00090019,0x0000000a,0x00000006,0x00000001, - 0x00000000,0x00000000,0x00000000,0x00000001,0x00000000,0x0003001b,0x0000000b,0x0000000a, - 0x00040020,0x0000000c,0x00000000,0x0000000b,0x0004003b,0x0000000c,0x0000000d,0x00000000, - 0x00040017,0x0000000f,0x00000006,0x00000002,0x00040020,0x00000010,0x00000001,0x0000000f, - 0x0004003b,0x00000010,0x00000011,0x00000001,0x00050036,0x00000002,0x00000004,0x00000000, - 0x00000003,0x000200f8,0x00000005,0x0004003d,0x0000000b,0x0000000e,0x0000000d,0x0004003d, - 0x0000000f,0x00000012,0x00000011,0x00050057,0x00000007,0x00000013,0x0000000e,0x00000012, - 0x0003003e,0x00000009,0x00000013,0x000100fd,0x00010038 -}; - -static const uint32_t vertShaderCode[] = { - 0x07230203,0x00010000,0x00080007,0x00000018,0x00000000,0x00020011,0x00000001,0x0006000b, - 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, - 0x0009000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x00000009,0x0000000b,0x00000010, - 0x00000014,0x00030003,0x00000002,0x00000190,0x00090004,0x415f4c47,0x735f4252,0x72617065, - 0x5f657461,0x64616873,0x6f5f7265,0x63656a62,0x00007374,0x00090004,0x415f4c47,0x735f4252, - 0x69646168,0x6c5f676e,0x75676e61,0x5f656761,0x70303234,0x006b6361,0x00040005,0x00000004, - 0x6e69616d,0x00000000,0x00050005,0x00000009,0x63786574,0x64726f6f,0x00000000,0x00040005, - 0x0000000b,0x72747461,0x00000000,0x00060005,0x0000000e,0x505f6c67,0x65567265,0x78657472, - 0x00000000,0x00060006,0x0000000e,0x00000000,0x505f6c67,0x7469736f,0x006e6f69,0x00030005, - 0x00000010,0x00000000,0x00030005,0x00000014,0x00736f70,0x00040047,0x00000009,0x0000001e, - 0x00000000,0x00040047,0x0000000b,0x0000001e,0x00000001,0x00050048,0x0000000e,0x00000000, - 0x0000000b,0x00000000,0x00030047,0x0000000e,0x00000002,0x00040047,0x00000014,0x0000001e, - 0x00000000,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006, - 0x00000020,0x00040017,0x00000007,0x00000006,0x00000002,0x00040020,0x00000008,0x00000003, - 0x00000007,0x0004003b,0x00000008,0x00000009,0x00000003,0x00040020,0x0000000a,0x00000001, - 0x00000007,0x0004003b,0x0000000a,0x0000000b,0x00000001,0x00040017,0x0000000d,0x00000006, - 0x00000004,0x0003001e,0x0000000e,0x0000000d,0x00040020,0x0000000f,0x00000003,0x0000000e, - 0x0004003b,0x0000000f,0x00000010,0x00000003,0x00040015,0x00000011,0x00000020,0x00000001, - 0x0004002b,0x00000011,0x00000012,0x00000000,0x00040020,0x00000013,0x00000001,0x0000000d, - 0x0004003b,0x00000013,0x00000014,0x00000001,0x00040020,0x00000016,0x00000003,0x0000000d, - 0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003d, - 0x00000007,0x0000000c,0x0000000b,0x0003003e,0x00000009,0x0000000c,0x0004003d,0x0000000d, - 0x00000015,0x00000014,0x00050041,0x00000016,0x00000017,0x00000010,0x00000012,0x0003003e, - 0x00000017,0x00000015,0x000100fd,0x00010038 -}; - -struct texture_object { - VkSampler sampler; - - VkImage image; - VkImageLayout imageLayout; - - VkDeviceMemory mem; - VkImageView view; - int32_t tex_width, tex_height; -}; - -static int validation_error = 0; - -VKAPI_ATTR VkBool32 VKAPI_CALL -BreakCallback(VkFlags msgFlags, VkDebugReportObjectTypeEXT objType, - uint64_t srcObject, size_t location, int32_t msgCode, - const char *pLayerPrefix, const char *pMsg, - void *pUserData) { -#ifdef _WIN32 - DebugBreak(); -#else - raise(SIGTRAP); -#endif - - return false; -} - -typedef struct { - VkImage image; - VkCommandBuffer cmd; - VkImageView view; -} SwapchainBuffers; - -struct demo { - GLFWwindow* window; - VkSurfaceKHR surface; - bool use_staging_buffer; - - VkInstance inst; - VkPhysicalDevice gpu; - VkDevice device; - VkQueue queue; - VkPhysicalDeviceProperties gpu_props; - VkPhysicalDeviceFeatures gpu_features; - VkQueueFamilyProperties *queue_props; - uint32_t graphics_queue_node_index; - - uint32_t enabled_extension_count; - uint32_t enabled_layer_count; - const char *extension_names[64]; - const char *enabled_layers[64]; - - int width, height; - VkFormat format; - VkColorSpaceKHR color_space; - - uint32_t swapchainImageCount; - VkSwapchainKHR swapchain; - SwapchainBuffers *buffers; - - VkCommandPool cmd_pool; - - struct { - VkFormat format; - - VkImage image; - VkDeviceMemory mem; - VkImageView view; - } depth; - - struct texture_object textures[DEMO_TEXTURE_COUNT]; - - struct { - VkBuffer buf; - VkDeviceMemory mem; - - VkPipelineVertexInputStateCreateInfo vi; - VkVertexInputBindingDescription vi_bindings[1]; - VkVertexInputAttributeDescription vi_attrs[2]; - } vertices; - - VkCommandBuffer setup_cmd; // Command Buffer for initialization commands - VkCommandBuffer draw_cmd; // Command Buffer for drawing commands - VkPipelineLayout pipeline_layout; - VkDescriptorSetLayout desc_layout; - VkPipelineCache pipelineCache; - VkRenderPass render_pass; - VkPipeline pipeline; - - VkShaderModule vert_shader_module; - VkShaderModule frag_shader_module; - - VkDescriptorPool desc_pool; - VkDescriptorSet desc_set; - - VkFramebuffer *framebuffers; - - VkPhysicalDeviceMemoryProperties memory_properties; - - int32_t curFrame; - int32_t frameCount; - bool validate; - bool use_break; - VkDebugReportCallbackEXT msg_callback; - - float depthStencil; - float depthIncrement; - - uint32_t current_buffer; - uint32_t queue_count; -}; - -VKAPI_ATTR VkBool32 VKAPI_CALL -dbgFunc(VkFlags msgFlags, VkDebugReportObjectTypeEXT objType, - uint64_t srcObject, size_t location, int32_t msgCode, - const char *pLayerPrefix, const char *pMsg, void *pUserData) { - char *message = (char *)malloc(strlen(pMsg) + 100); - - assert(message); - - validation_error = 1; - - if (msgFlags & VK_DEBUG_REPORT_ERROR_BIT_EXT) { - sprintf(message, "ERROR: [%s] Code %d : %s", pLayerPrefix, msgCode, - pMsg); - } else if (msgFlags & VK_DEBUG_REPORT_WARNING_BIT_EXT) { - sprintf(message, "WARNING: [%s] Code %d : %s", pLayerPrefix, msgCode, - pMsg); - } else { - return false; - } - - printf("%s\n", message); - fflush(stdout); - free(message); - - /* - * false indicates that layer should not bail-out of an - * API call that had validation failures. This may mean that the - * app dies inside the driver due to invalid parameter(s). - * That's what would happen without validation layers, so we'll - * keep that behavior here. - */ - return false; -} - -// Forward declaration: -static void demo_resize(struct demo *demo); - -static bool memory_type_from_properties(struct demo *demo, uint32_t typeBits, - VkFlags requirements_mask, - uint32_t *typeIndex) { - uint32_t i; - // Search memtypes to find first index with those properties - for (i = 0; i < VK_MAX_MEMORY_TYPES; i++) { - if ((typeBits & 1) == 1) { - // Type is available, does it match user properties? - if ((demo->memory_properties.memoryTypes[i].propertyFlags & - requirements_mask) == requirements_mask) { - *typeIndex = i; - return true; - } - } - typeBits >>= 1; - } - // No memory types matched, return failure - return false; -} - -static void demo_flush_init_cmd(struct demo *demo) { - VkResult U_ASSERT_ONLY err; - - if (demo->setup_cmd == VK_NULL_HANDLE) - return; - - err = vkEndCommandBuffer(demo->setup_cmd); - assert(!err); - - const VkCommandBuffer cmd_bufs[] = {demo->setup_cmd}; - VkFence nullFence = {VK_NULL_HANDLE}; - VkSubmitInfo submit_info = {.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO, - .pNext = NULL, - .waitSemaphoreCount = 0, - .pWaitSemaphores = NULL, - .pWaitDstStageMask = NULL, - .commandBufferCount = 1, - .pCommandBuffers = cmd_bufs, - .signalSemaphoreCount = 0, - .pSignalSemaphores = NULL}; - - err = vkQueueSubmit(demo->queue, 1, &submit_info, nullFence); - assert(!err); - - err = vkQueueWaitIdle(demo->queue); - assert(!err); - - vkFreeCommandBuffers(demo->device, demo->cmd_pool, 1, cmd_bufs); - demo->setup_cmd = VK_NULL_HANDLE; -} - -static void demo_set_image_layout(struct demo *demo, VkImage image, - VkImageAspectFlags aspectMask, - VkImageLayout old_image_layout, - VkImageLayout new_image_layout, - VkAccessFlagBits srcAccessMask) { - - VkResult U_ASSERT_ONLY err; - - if (demo->setup_cmd == VK_NULL_HANDLE) { - const VkCommandBufferAllocateInfo cmd = { - .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, - .pNext = NULL, - .commandPool = demo->cmd_pool, - .level = VK_COMMAND_BUFFER_LEVEL_PRIMARY, - .commandBufferCount = 1, - }; - - err = vkAllocateCommandBuffers(demo->device, &cmd, &demo->setup_cmd); - assert(!err); - - VkCommandBufferBeginInfo cmd_buf_info = { - .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, - .pNext = NULL, - .flags = 0, - .pInheritanceInfo = NULL, - }; - err = vkBeginCommandBuffer(demo->setup_cmd, &cmd_buf_info); - assert(!err); - } - - VkImageMemoryBarrier image_memory_barrier = { - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, - .pNext = NULL, - .srcAccessMask = srcAccessMask, - .dstAccessMask = 0, - .oldLayout = old_image_layout, - .newLayout = new_image_layout, - .image = image, - .subresourceRange = {aspectMask, 0, 1, 0, 1}}; - - if (new_image_layout == VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL) { - /* Make sure anything that was copying from this image has completed */ - image_memory_barrier.dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT; - } - - if (new_image_layout == VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL) { - image_memory_barrier.dstAccessMask = - VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT; - } - - if (new_image_layout == VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL) { - image_memory_barrier.dstAccessMask = - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; - } - - if (new_image_layout == VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL) { - /* Make sure any Copy or CPU writes to image are flushed */ - image_memory_barrier.dstAccessMask = - VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_INPUT_ATTACHMENT_READ_BIT; - } - - VkImageMemoryBarrier *pmemory_barrier = &image_memory_barrier; - - VkPipelineStageFlags src_stages = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; - VkPipelineStageFlags dest_stages = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; - - vkCmdPipelineBarrier(demo->setup_cmd, src_stages, dest_stages, 0, 0, NULL, - 0, NULL, 1, pmemory_barrier); -} - -static void demo_draw_build_cmd(struct demo *demo) { - const VkCommandBufferBeginInfo cmd_buf_info = { - .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, - .pNext = NULL, - .flags = 0, - .pInheritanceInfo = NULL, - }; - const VkClearValue clear_values[2] = { - [0] = {.color.float32 = {0.2f, 0.2f, 0.2f, 0.2f}}, - [1] = {.depthStencil = {demo->depthStencil, 0}}, - }; - const VkRenderPassBeginInfo rp_begin = { - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO, - .pNext = NULL, - .renderPass = demo->render_pass, - .framebuffer = demo->framebuffers[demo->current_buffer], - .renderArea.offset.x = 0, - .renderArea.offset.y = 0, - .renderArea.extent.width = demo->width, - .renderArea.extent.height = demo->height, - .clearValueCount = 2, - .pClearValues = clear_values, - }; - VkResult U_ASSERT_ONLY err; - - err = vkBeginCommandBuffer(demo->draw_cmd, &cmd_buf_info); - assert(!err); - - // We can use LAYOUT_UNDEFINED as a wildcard here because we don't care what - // happens to the previous contents of the image - VkImageMemoryBarrier image_memory_barrier = { - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, - .pNext = NULL, - .srcAccessMask = 0, - .dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, - .oldLayout = VK_IMAGE_LAYOUT_UNDEFINED, - .newLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .image = demo->buffers[demo->current_buffer].image, - .subresourceRange = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1}}; - - vkCmdPipelineBarrier(demo->draw_cmd, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, - VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, 0, 0, NULL, 0, - NULL, 1, &image_memory_barrier); - vkCmdBeginRenderPass(demo->draw_cmd, &rp_begin, VK_SUBPASS_CONTENTS_INLINE); - vkCmdBindPipeline(demo->draw_cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, - demo->pipeline); - vkCmdBindDescriptorSets(demo->draw_cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, - demo->pipeline_layout, 0, 1, &demo->desc_set, 0, - NULL); - - VkViewport viewport; - memset(&viewport, 0, sizeof(viewport)); - viewport.height = (float)demo->height; - viewport.width = (float)demo->width; - viewport.minDepth = (float)0.0f; - viewport.maxDepth = (float)1.0f; - vkCmdSetViewport(demo->draw_cmd, 0, 1, &viewport); - - VkRect2D scissor; - memset(&scissor, 0, sizeof(scissor)); - scissor.extent.width = demo->width; - scissor.extent.height = demo->height; - scissor.offset.x = 0; - scissor.offset.y = 0; - vkCmdSetScissor(demo->draw_cmd, 0, 1, &scissor); - - VkDeviceSize offsets[1] = {0}; - vkCmdBindVertexBuffers(demo->draw_cmd, VERTEX_BUFFER_BIND_ID, 1, - &demo->vertices.buf, offsets); - - vkCmdDraw(demo->draw_cmd, 3, 1, 0, 0); - vkCmdEndRenderPass(demo->draw_cmd); - - VkImageMemoryBarrier prePresentBarrier = { - .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, - .pNext = NULL, - .srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, - .dstAccessMask = VK_ACCESS_MEMORY_READ_BIT, - .oldLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - .newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, - .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, - .subresourceRange = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1}}; - - prePresentBarrier.image = demo->buffers[demo->current_buffer].image; - VkImageMemoryBarrier *pmemory_barrier = &prePresentBarrier; - vkCmdPipelineBarrier(demo->draw_cmd, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, - VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, 0, 0, NULL, 0, - NULL, 1, pmemory_barrier); - - err = vkEndCommandBuffer(demo->draw_cmd); - assert(!err); -} - -static void demo_draw(struct demo *demo) { - VkResult U_ASSERT_ONLY err; - VkSemaphore imageAcquiredSemaphore, drawCompleteSemaphore; - VkSemaphoreCreateInfo semaphoreCreateInfo = { - .sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO, - .pNext = NULL, - .flags = 0, - }; - - err = vkCreateSemaphore(demo->device, &semaphoreCreateInfo, - NULL, &imageAcquiredSemaphore); - assert(!err); - - err = vkCreateSemaphore(demo->device, &semaphoreCreateInfo, - NULL, &drawCompleteSemaphore); - assert(!err); - - // Get the index of the next available swapchain image: - err = vkAcquireNextImageKHR(demo->device, demo->swapchain, UINT64_MAX, - imageAcquiredSemaphore, - (VkFence)0, // TODO: Show use of fence - &demo->current_buffer); - if (err == VK_ERROR_OUT_OF_DATE_KHR) { - // demo->swapchain is out of date (e.g. the window was resized) and - // must be recreated: - demo_resize(demo); - demo_draw(demo); - vkDestroySemaphore(demo->device, imageAcquiredSemaphore, NULL); - vkDestroySemaphore(demo->device, drawCompleteSemaphore, NULL); - return; - } else if (err == VK_SUBOPTIMAL_KHR) { - // demo->swapchain is not as optimal as it could be, but the platform's - // presentation engine will still present the image correctly. - } else { - assert(!err); - } - - demo_flush_init_cmd(demo); - - // Wait for the present complete semaphore to be signaled to ensure - // that the image won't be rendered to until the presentation - // engine has fully released ownership to the application, and it is - // okay to render to the image. - - demo_draw_build_cmd(demo); - VkFence nullFence = VK_NULL_HANDLE; - VkPipelineStageFlags pipe_stage_flags = - VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT; - VkSubmitInfo submit_info = {.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO, - .pNext = NULL, - .waitSemaphoreCount = 1, - .pWaitSemaphores = &imageAcquiredSemaphore, - .pWaitDstStageMask = &pipe_stage_flags, - .commandBufferCount = 1, - .pCommandBuffers = &demo->draw_cmd, - .signalSemaphoreCount = 1, - .pSignalSemaphores = &drawCompleteSemaphore}; - - err = vkQueueSubmit(demo->queue, 1, &submit_info, nullFence); - assert(!err); - - VkPresentInfoKHR present = { - .sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR, - .pNext = NULL, - .waitSemaphoreCount = 1, - .pWaitSemaphores = &drawCompleteSemaphore, - .swapchainCount = 1, - .pSwapchains = &demo->swapchain, - .pImageIndices = &demo->current_buffer, - }; - - err = vkQueuePresentKHR(demo->queue, &present); - if (err == VK_ERROR_OUT_OF_DATE_KHR) { - // demo->swapchain is out of date (e.g. the window was resized) and - // must be recreated: - demo_resize(demo); - } else if (err == VK_SUBOPTIMAL_KHR) { - // demo->swapchain is not as optimal as it could be, but the platform's - // presentation engine will still present the image correctly. - } else { - assert(!err); - } - - err = vkQueueWaitIdle(demo->queue); - assert(err == VK_SUCCESS); - - vkDestroySemaphore(demo->device, imageAcquiredSemaphore, NULL); - vkDestroySemaphore(demo->device, drawCompleteSemaphore, NULL); -} - -static void demo_prepare_buffers(struct demo *demo) { - VkResult U_ASSERT_ONLY err; - VkSwapchainKHR oldSwapchain = demo->swapchain; - - // Check the surface capabilities and formats - VkSurfaceCapabilitiesKHR surfCapabilities; - err = vkGetPhysicalDeviceSurfaceCapabilitiesKHR( - demo->gpu, demo->surface, &surfCapabilities); - assert(!err); - - uint32_t presentModeCount; - err = vkGetPhysicalDeviceSurfacePresentModesKHR( - demo->gpu, demo->surface, &presentModeCount, NULL); - assert(!err); - VkPresentModeKHR *presentModes = - (VkPresentModeKHR *)malloc(presentModeCount * sizeof(VkPresentModeKHR)); - assert(presentModes); - err = vkGetPhysicalDeviceSurfacePresentModesKHR( - demo->gpu, demo->surface, &presentModeCount, presentModes); - assert(!err); - - VkExtent2D swapchainExtent; - // width and height are either both 0xFFFFFFFF, or both not 0xFFFFFFFF. - if (surfCapabilities.currentExtent.width == 0xFFFFFFFF) { - // If the surface size is undefined, the size is set to the size - // of the images requested, which must fit within the minimum and - // maximum values. - swapchainExtent.width = demo->width; - swapchainExtent.height = demo->height; - - if (swapchainExtent.width < surfCapabilities.minImageExtent.width) { - swapchainExtent.width = surfCapabilities.minImageExtent.width; - } else if (swapchainExtent.width > surfCapabilities.maxImageExtent.width) { - swapchainExtent.width = surfCapabilities.maxImageExtent.width; - } - - if (swapchainExtent.height < surfCapabilities.minImageExtent.height) { - swapchainExtent.height = surfCapabilities.minImageExtent.height; - } else if (swapchainExtent.height > surfCapabilities.maxImageExtent.height) { - swapchainExtent.height = surfCapabilities.maxImageExtent.height; - } - } else { - // If the surface size is defined, the swap chain size must match - swapchainExtent = surfCapabilities.currentExtent; - demo->width = surfCapabilities.currentExtent.width; - demo->height = surfCapabilities.currentExtent.height; - } - - VkPresentModeKHR swapchainPresentMode = VK_PRESENT_MODE_FIFO_KHR; - - // Determine the number of VkImage's to use in the swap chain. - // Application desires to only acquire 1 image at a time (which is - // "surfCapabilities.minImageCount"). - uint32_t desiredNumOfSwapchainImages = surfCapabilities.minImageCount; - // If maxImageCount is 0, we can ask for as many images as we want; - // otherwise we're limited to maxImageCount - if ((surfCapabilities.maxImageCount > 0) && - (desiredNumOfSwapchainImages > surfCapabilities.maxImageCount)) { - // Application must settle for fewer images than desired: - desiredNumOfSwapchainImages = surfCapabilities.maxImageCount; - } - - VkSurfaceTransformFlagsKHR preTransform; - if (surfCapabilities.supportedTransforms & - VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) { - preTransform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR; - } else { - preTransform = surfCapabilities.currentTransform; - } - - const VkSwapchainCreateInfoKHR swapchain = { - .sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR, - .pNext = NULL, - .surface = demo->surface, - .minImageCount = desiredNumOfSwapchainImages, - .imageFormat = demo->format, - .imageColorSpace = demo->color_space, - .imageExtent = - { - .width = swapchainExtent.width, .height = swapchainExtent.height, - }, - .imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, - .preTransform = preTransform, - .compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR, - .imageArrayLayers = 1, - .imageSharingMode = VK_SHARING_MODE_EXCLUSIVE, - .queueFamilyIndexCount = 0, - .pQueueFamilyIndices = NULL, - .presentMode = swapchainPresentMode, - .oldSwapchain = oldSwapchain, - .clipped = true, - }; - uint32_t i; - - err = vkCreateSwapchainKHR(demo->device, &swapchain, NULL, &demo->swapchain); - assert(!err); - - // If we just re-created an existing swapchain, we should destroy the old - // swapchain at this point. - // Note: destroying the swapchain also cleans up all its associated - // presentable images once the platform is done with them. - if (oldSwapchain != VK_NULL_HANDLE) { - vkDestroySwapchainKHR(demo->device, oldSwapchain, NULL); - } - - err = vkGetSwapchainImagesKHR(demo->device, demo->swapchain, - &demo->swapchainImageCount, NULL); - assert(!err); - - VkImage *swapchainImages = - (VkImage *)malloc(demo->swapchainImageCount * sizeof(VkImage)); - assert(swapchainImages); - err = vkGetSwapchainImagesKHR(demo->device, demo->swapchain, - &demo->swapchainImageCount, - swapchainImages); - assert(!err); - - demo->buffers = (SwapchainBuffers *)malloc(sizeof(SwapchainBuffers) * - demo->swapchainImageCount); - assert(demo->buffers); - - for (i = 0; i < demo->swapchainImageCount; i++) { - VkImageViewCreateInfo color_attachment_view = { - .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, - .pNext = NULL, - .format = demo->format, - .components = - { - .r = VK_COMPONENT_SWIZZLE_R, - .g = VK_COMPONENT_SWIZZLE_G, - .b = VK_COMPONENT_SWIZZLE_B, - .a = VK_COMPONENT_SWIZZLE_A, - }, - .subresourceRange = {.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, - .baseMipLevel = 0, - .levelCount = 1, - .baseArrayLayer = 0, - .layerCount = 1}, - .viewType = VK_IMAGE_VIEW_TYPE_2D, - .flags = 0, - }; - - demo->buffers[i].image = swapchainImages[i]; - - color_attachment_view.image = demo->buffers[i].image; - - err = vkCreateImageView(demo->device, &color_attachment_view, NULL, - &demo->buffers[i].view); - assert(!err); - } - - demo->current_buffer = 0; - - if (NULL != presentModes) { - free(presentModes); - } -} - -static void demo_prepare_depth(struct demo *demo) { - const VkFormat depth_format = VK_FORMAT_D16_UNORM; - const VkImageCreateInfo image = { - .sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, - .pNext = NULL, - .imageType = VK_IMAGE_TYPE_2D, - .format = depth_format, - .extent = {demo->width, demo->height, 1}, - .mipLevels = 1, - .arrayLayers = 1, - .samples = VK_SAMPLE_COUNT_1_BIT, - .tiling = VK_IMAGE_TILING_OPTIMAL, - .usage = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, - .flags = 0, - }; - VkMemoryAllocateInfo mem_alloc = { - .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, - .pNext = NULL, - .allocationSize = 0, - .memoryTypeIndex = 0, - }; - VkImageViewCreateInfo view = { - .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, - .pNext = NULL, - .image = VK_NULL_HANDLE, - .format = depth_format, - .subresourceRange = {.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT, - .baseMipLevel = 0, - .levelCount = 1, - .baseArrayLayer = 0, - .layerCount = 1}, - .flags = 0, - .viewType = VK_IMAGE_VIEW_TYPE_2D, - }; - - VkMemoryRequirements mem_reqs; - VkResult U_ASSERT_ONLY err; - bool U_ASSERT_ONLY pass; - - demo->depth.format = depth_format; - - /* create image */ - err = vkCreateImage(demo->device, &image, NULL, &demo->depth.image); - assert(!err); - - /* get memory requirements for this object */ - vkGetImageMemoryRequirements(demo->device, demo->depth.image, &mem_reqs); - - /* select memory size and type */ - mem_alloc.allocationSize = mem_reqs.size; - pass = memory_type_from_properties(demo, mem_reqs.memoryTypeBits, - 0, /* No requirements */ - &mem_alloc.memoryTypeIndex); - assert(pass); - - /* allocate memory */ - err = vkAllocateMemory(demo->device, &mem_alloc, NULL, &demo->depth.mem); - assert(!err); - - /* bind memory */ - err = - vkBindImageMemory(demo->device, demo->depth.image, demo->depth.mem, 0); - assert(!err); - - demo_set_image_layout(demo, demo->depth.image, VK_IMAGE_ASPECT_DEPTH_BIT, - VK_IMAGE_LAYOUT_UNDEFINED, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, - 0); - - /* create image view */ - view.image = demo->depth.image; - err = vkCreateImageView(demo->device, &view, NULL, &demo->depth.view); - assert(!err); -} - -static void -demo_prepare_texture_image(struct demo *demo, const uint32_t *tex_colors, - struct texture_object *tex_obj, VkImageTiling tiling, - VkImageUsageFlags usage, VkFlags required_props) { - const VkFormat tex_format = VK_FORMAT_B8G8R8A8_UNORM; - const int32_t tex_width = 2; - const int32_t tex_height = 2; - VkResult U_ASSERT_ONLY err; - bool U_ASSERT_ONLY pass; - - tex_obj->tex_width = tex_width; - tex_obj->tex_height = tex_height; - - const VkImageCreateInfo image_create_info = { - .sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, - .pNext = NULL, - .imageType = VK_IMAGE_TYPE_2D, - .format = tex_format, - .extent = {tex_width, tex_height, 1}, - .mipLevels = 1, - .arrayLayers = 1, - .samples = VK_SAMPLE_COUNT_1_BIT, - .tiling = tiling, - .usage = usage, - .flags = 0, - .initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED - }; - VkMemoryAllocateInfo mem_alloc = { - .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, - .pNext = NULL, - .allocationSize = 0, - .memoryTypeIndex = 0, - }; - - VkMemoryRequirements mem_reqs; - - err = - vkCreateImage(demo->device, &image_create_info, NULL, &tex_obj->image); - assert(!err); - - vkGetImageMemoryRequirements(demo->device, tex_obj->image, &mem_reqs); - - mem_alloc.allocationSize = mem_reqs.size; - pass = - memory_type_from_properties(demo, mem_reqs.memoryTypeBits, - required_props, &mem_alloc.memoryTypeIndex); - assert(pass); - - /* allocate memory */ - err = vkAllocateMemory(demo->device, &mem_alloc, NULL, &tex_obj->mem); - assert(!err); - - /* bind memory */ - err = vkBindImageMemory(demo->device, tex_obj->image, tex_obj->mem, 0); - assert(!err); - - if (required_props & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) { - const VkImageSubresource subres = { - .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT, - .mipLevel = 0, - .arrayLayer = 0, - }; - VkSubresourceLayout layout; - void *data; - int32_t x, y; - - vkGetImageSubresourceLayout(demo->device, tex_obj->image, &subres, - &layout); - - err = vkMapMemory(demo->device, tex_obj->mem, 0, - mem_alloc.allocationSize, 0, &data); - assert(!err); - - for (y = 0; y < tex_height; y++) { - uint32_t *row = (uint32_t *)((char *)data + layout.rowPitch * y); - for (x = 0; x < tex_width; x++) - row[x] = tex_colors[(x & 1) ^ (y & 1)]; - } - - vkUnmapMemory(demo->device, tex_obj->mem); - } - - tex_obj->imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; - demo_set_image_layout(demo, tex_obj->image, VK_IMAGE_ASPECT_COLOR_BIT, - VK_IMAGE_LAYOUT_PREINITIALIZED, tex_obj->imageLayout, - VK_ACCESS_HOST_WRITE_BIT); - /* setting the image layout does not reference the actual memory so no need - * to add a mem ref */ -} - -static void demo_destroy_texture_image(struct demo *demo, - struct texture_object *tex_obj) { - /* clean up staging resources */ - vkDestroyImage(demo->device, tex_obj->image, NULL); - vkFreeMemory(demo->device, tex_obj->mem, NULL); -} - -static void demo_prepare_textures(struct demo *demo) { - const VkFormat tex_format = VK_FORMAT_B8G8R8A8_UNORM; - VkFormatProperties props; - const uint32_t tex_colors[DEMO_TEXTURE_COUNT][2] = { - {0xffff0000, 0xff00ff00}, - }; - uint32_t i; - VkResult U_ASSERT_ONLY err; - - vkGetPhysicalDeviceFormatProperties(demo->gpu, tex_format, &props); - - for (i = 0; i < DEMO_TEXTURE_COUNT; i++) { - if ((props.linearTilingFeatures & - VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) && - !demo->use_staging_buffer) { - /* Device can texture using linear textures */ - demo_prepare_texture_image( - demo, tex_colors[i], &demo->textures[i], VK_IMAGE_TILING_LINEAR, - VK_IMAGE_USAGE_SAMPLED_BIT, - VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | - VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); - } else if (props.optimalTilingFeatures & - VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT) { - /* Must use staging buffer to copy linear texture to optimized */ - struct texture_object staging_texture; - - memset(&staging_texture, 0, sizeof(staging_texture)); - demo_prepare_texture_image( - demo, tex_colors[i], &staging_texture, VK_IMAGE_TILING_LINEAR, - VK_IMAGE_USAGE_TRANSFER_SRC_BIT, - VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | - VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); - - demo_prepare_texture_image( - demo, tex_colors[i], &demo->textures[i], - VK_IMAGE_TILING_OPTIMAL, - (VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT), - VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); - - demo_set_image_layout(demo, staging_texture.image, - VK_IMAGE_ASPECT_COLOR_BIT, - staging_texture.imageLayout, - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, - 0); - - demo_set_image_layout(demo, demo->textures[i].image, - VK_IMAGE_ASPECT_COLOR_BIT, - demo->textures[i].imageLayout, - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, - 0); - - VkImageCopy copy_region = { - .srcSubresource = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1}, - .srcOffset = {0, 0, 0}, - .dstSubresource = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 0, 1}, - .dstOffset = {0, 0, 0}, - .extent = {staging_texture.tex_width, - staging_texture.tex_height, 1}, - }; - vkCmdCopyImage( - demo->setup_cmd, staging_texture.image, - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, demo->textures[i].image, - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, ©_region); - - demo_set_image_layout(demo, demo->textures[i].image, - VK_IMAGE_ASPECT_COLOR_BIT, - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, - demo->textures[i].imageLayout, - 0); - - demo_flush_init_cmd(demo); - - demo_destroy_texture_image(demo, &staging_texture); - } else { - /* Can't support VK_FORMAT_B8G8R8A8_UNORM !? */ - assert(!"No support for B8G8R8A8_UNORM as texture image format"); - } - - const VkSamplerCreateInfo sampler = { - .sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO, - .pNext = NULL, - .magFilter = VK_FILTER_NEAREST, - .minFilter = VK_FILTER_NEAREST, - .mipmapMode = VK_SAMPLER_MIPMAP_MODE_NEAREST, - .addressModeU = VK_SAMPLER_ADDRESS_MODE_REPEAT, - .addressModeV = VK_SAMPLER_ADDRESS_MODE_REPEAT, - .addressModeW = VK_SAMPLER_ADDRESS_MODE_REPEAT, - .mipLodBias = 0.0f, - .anisotropyEnable = VK_FALSE, - .maxAnisotropy = 1, - .compareOp = VK_COMPARE_OP_NEVER, - .minLod = 0.0f, - .maxLod = 0.0f, - .borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE, - .unnormalizedCoordinates = VK_FALSE, - }; - VkImageViewCreateInfo view = { - .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, - .pNext = NULL, - .image = VK_NULL_HANDLE, - .viewType = VK_IMAGE_VIEW_TYPE_2D, - .format = tex_format, - .components = - { - VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_G, - VK_COMPONENT_SWIZZLE_B, VK_COMPONENT_SWIZZLE_A, - }, - .subresourceRange = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1}, - .flags = 0, - }; - - /* create sampler */ - err = vkCreateSampler(demo->device, &sampler, NULL, - &demo->textures[i].sampler); - assert(!err); - - /* create image view */ - view.image = demo->textures[i].image; - err = vkCreateImageView(demo->device, &view, NULL, - &demo->textures[i].view); - assert(!err); - } -} - -static void demo_prepare_vertices(struct demo *demo) { - // clang-format off - const float vb[3][5] = { - /* position texcoord */ - { -1.0f, -1.0f, 0.25f, 0.0f, 0.0f }, - { 1.0f, -1.0f, 0.25f, 1.0f, 0.0f }, - { 0.0f, 1.0f, 1.0f, 0.5f, 1.0f }, - }; - // clang-format on - const VkBufferCreateInfo buf_info = { - .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, - .pNext = NULL, - .size = sizeof(vb), - .usage = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, - .flags = 0, - }; - VkMemoryAllocateInfo mem_alloc = { - .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, - .pNext = NULL, - .allocationSize = 0, - .memoryTypeIndex = 0, - }; - VkMemoryRequirements mem_reqs; - VkResult U_ASSERT_ONLY err; - bool U_ASSERT_ONLY pass; - void *data; - - memset(&demo->vertices, 0, sizeof(demo->vertices)); - - err = vkCreateBuffer(demo->device, &buf_info, NULL, &demo->vertices.buf); - assert(!err); - - vkGetBufferMemoryRequirements(demo->device, demo->vertices.buf, &mem_reqs); - assert(!err); - - mem_alloc.allocationSize = mem_reqs.size; - pass = memory_type_from_properties(demo, mem_reqs.memoryTypeBits, - VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | - VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, - &mem_alloc.memoryTypeIndex); - assert(pass); - - err = vkAllocateMemory(demo->device, &mem_alloc, NULL, &demo->vertices.mem); - assert(!err); - - err = vkMapMemory(demo->device, demo->vertices.mem, 0, - mem_alloc.allocationSize, 0, &data); - assert(!err); - - memcpy(data, vb, sizeof(vb)); - - vkUnmapMemory(demo->device, demo->vertices.mem); - - err = vkBindBufferMemory(demo->device, demo->vertices.buf, - demo->vertices.mem, 0); - assert(!err); - - demo->vertices.vi.sType = - VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO; - demo->vertices.vi.pNext = NULL; - demo->vertices.vi.vertexBindingDescriptionCount = 1; - demo->vertices.vi.pVertexBindingDescriptions = demo->vertices.vi_bindings; - demo->vertices.vi.vertexAttributeDescriptionCount = 2; - demo->vertices.vi.pVertexAttributeDescriptions = demo->vertices.vi_attrs; - - demo->vertices.vi_bindings[0].binding = VERTEX_BUFFER_BIND_ID; - demo->vertices.vi_bindings[0].stride = sizeof(vb[0]); - demo->vertices.vi_bindings[0].inputRate = VK_VERTEX_INPUT_RATE_VERTEX; - - demo->vertices.vi_attrs[0].binding = VERTEX_BUFFER_BIND_ID; - demo->vertices.vi_attrs[0].location = 0; - demo->vertices.vi_attrs[0].format = VK_FORMAT_R32G32B32_SFLOAT; - demo->vertices.vi_attrs[0].offset = 0; - - demo->vertices.vi_attrs[1].binding = VERTEX_BUFFER_BIND_ID; - demo->vertices.vi_attrs[1].location = 1; - demo->vertices.vi_attrs[1].format = VK_FORMAT_R32G32_SFLOAT; - demo->vertices.vi_attrs[1].offset = sizeof(float) * 3; -} - -static void demo_prepare_descriptor_layout(struct demo *demo) { - const VkDescriptorSetLayoutBinding layout_binding = { - .binding = 0, - .descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, - .descriptorCount = DEMO_TEXTURE_COUNT, - .stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT, - .pImmutableSamplers = NULL, - }; - const VkDescriptorSetLayoutCreateInfo descriptor_layout = { - .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO, - .pNext = NULL, - .bindingCount = 1, - .pBindings = &layout_binding, - }; - VkResult U_ASSERT_ONLY err; - - err = vkCreateDescriptorSetLayout(demo->device, &descriptor_layout, NULL, - &demo->desc_layout); - assert(!err); - - const VkPipelineLayoutCreateInfo pPipelineLayoutCreateInfo = { - .sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO, - .pNext = NULL, - .setLayoutCount = 1, - .pSetLayouts = &demo->desc_layout, - }; - - err = vkCreatePipelineLayout(demo->device, &pPipelineLayoutCreateInfo, NULL, - &demo->pipeline_layout); - assert(!err); -} - -static void demo_prepare_render_pass(struct demo *demo) { - const VkAttachmentDescription attachments[2] = { - [0] = - { - .format = demo->format, - .samples = VK_SAMPLE_COUNT_1_BIT, - .loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR, - .storeOp = VK_ATTACHMENT_STORE_OP_STORE, - .stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE, - .stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE, - .initialLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - .finalLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - }, - [1] = - { - .format = demo->depth.format, - .samples = VK_SAMPLE_COUNT_1_BIT, - .loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR, - .storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE, - .stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE, - .stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE, - .initialLayout = - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, - .finalLayout = - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, - }, - }; - const VkAttachmentReference color_reference = { - .attachment = 0, .layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - }; - const VkAttachmentReference depth_reference = { - .attachment = 1, - .layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, - }; - const VkSubpassDescription subpass = { - .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, - .flags = 0, - .inputAttachmentCount = 0, - .pInputAttachments = NULL, - .colorAttachmentCount = 1, - .pColorAttachments = &color_reference, - .pResolveAttachments = NULL, - .pDepthStencilAttachment = &depth_reference, - .preserveAttachmentCount = 0, - .pPreserveAttachments = NULL, - }; - const VkRenderPassCreateInfo rp_info = { - .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO, - .pNext = NULL, - .attachmentCount = 2, - .pAttachments = attachments, - .subpassCount = 1, - .pSubpasses = &subpass, - .dependencyCount = 0, - .pDependencies = NULL, - }; - VkResult U_ASSERT_ONLY err; - - err = vkCreateRenderPass(demo->device, &rp_info, NULL, &demo->render_pass); - assert(!err); -} - -static VkShaderModule -demo_prepare_shader_module(struct demo *demo, const void *code, size_t size) { - VkShaderModuleCreateInfo moduleCreateInfo; - VkShaderModule module; - VkResult U_ASSERT_ONLY err; - - moduleCreateInfo.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO; - moduleCreateInfo.pNext = NULL; - - moduleCreateInfo.codeSize = size; - moduleCreateInfo.pCode = code; - moduleCreateInfo.flags = 0; - err = vkCreateShaderModule(demo->device, &moduleCreateInfo, NULL, &module); - assert(!err); - - return module; -} - -static VkShaderModule demo_prepare_vs(struct demo *demo) { - size_t size = sizeof(vertShaderCode); - - demo->vert_shader_module = - demo_prepare_shader_module(demo, vertShaderCode, size); - - return demo->vert_shader_module; -} - -static VkShaderModule demo_prepare_fs(struct demo *demo) { - size_t size = sizeof(fragShaderCode); - - demo->frag_shader_module = - demo_prepare_shader_module(demo, fragShaderCode, size); - - return demo->frag_shader_module; -} - -static void demo_prepare_pipeline(struct demo *demo) { - VkGraphicsPipelineCreateInfo pipeline; - VkPipelineCacheCreateInfo pipelineCache; - - VkPipelineVertexInputStateCreateInfo vi; - VkPipelineInputAssemblyStateCreateInfo ia; - VkPipelineRasterizationStateCreateInfo rs; - VkPipelineColorBlendStateCreateInfo cb; - VkPipelineDepthStencilStateCreateInfo ds; - VkPipelineViewportStateCreateInfo vp; - VkPipelineMultisampleStateCreateInfo ms; - VkDynamicState dynamicStateEnables[(VK_DYNAMIC_STATE_STENCIL_REFERENCE - VK_DYNAMIC_STATE_VIEWPORT + 1)]; - VkPipelineDynamicStateCreateInfo dynamicState; - - VkResult U_ASSERT_ONLY err; - - memset(dynamicStateEnables, 0, sizeof dynamicStateEnables); - memset(&dynamicState, 0, sizeof dynamicState); - dynamicState.sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO; - dynamicState.pDynamicStates = dynamicStateEnables; - - memset(&pipeline, 0, sizeof(pipeline)); - pipeline.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO; - pipeline.layout = demo->pipeline_layout; - - vi = demo->vertices.vi; - - memset(&ia, 0, sizeof(ia)); - ia.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO; - ia.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; - - memset(&rs, 0, sizeof(rs)); - rs.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO; - rs.polygonMode = VK_POLYGON_MODE_FILL; - rs.cullMode = VK_CULL_MODE_BACK_BIT; - rs.frontFace = VK_FRONT_FACE_CLOCKWISE; - rs.depthClampEnable = VK_FALSE; - rs.rasterizerDiscardEnable = VK_FALSE; - rs.depthBiasEnable = VK_FALSE; - rs.lineWidth = 1.0f; - - memset(&cb, 0, sizeof(cb)); - cb.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO; - VkPipelineColorBlendAttachmentState att_state[1]; - memset(att_state, 0, sizeof(att_state)); - att_state[0].colorWriteMask = 0xf; - att_state[0].blendEnable = VK_FALSE; - cb.attachmentCount = 1; - cb.pAttachments = att_state; - - memset(&vp, 0, sizeof(vp)); - vp.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO; - vp.viewportCount = 1; - dynamicStateEnables[dynamicState.dynamicStateCount++] = - VK_DYNAMIC_STATE_VIEWPORT; - vp.scissorCount = 1; - dynamicStateEnables[dynamicState.dynamicStateCount++] = - VK_DYNAMIC_STATE_SCISSOR; - - memset(&ds, 0, sizeof(ds)); - ds.sType = VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO; - ds.depthTestEnable = VK_TRUE; - ds.depthWriteEnable = VK_TRUE; - ds.depthCompareOp = VK_COMPARE_OP_LESS_OR_EQUAL; - ds.depthBoundsTestEnable = VK_FALSE; - ds.back.failOp = VK_STENCIL_OP_KEEP; - ds.back.passOp = VK_STENCIL_OP_KEEP; - ds.back.compareOp = VK_COMPARE_OP_ALWAYS; - ds.stencilTestEnable = VK_FALSE; - ds.front = ds.back; - - memset(&ms, 0, sizeof(ms)); - ms.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO; - ms.pSampleMask = NULL; - ms.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT; - - // Two stages: vs and fs - pipeline.stageCount = 2; - VkPipelineShaderStageCreateInfo shaderStages[2]; - memset(&shaderStages, 0, 2 * sizeof(VkPipelineShaderStageCreateInfo)); - - shaderStages[0].sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; - shaderStages[0].stage = VK_SHADER_STAGE_VERTEX_BIT; - shaderStages[0].module = demo_prepare_vs(demo); - shaderStages[0].pName = "main"; - - shaderStages[1].sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; - shaderStages[1].stage = VK_SHADER_STAGE_FRAGMENT_BIT; - shaderStages[1].module = demo_prepare_fs(demo); - shaderStages[1].pName = "main"; - - pipeline.pVertexInputState = &vi; - pipeline.pInputAssemblyState = &ia; - pipeline.pRasterizationState = &rs; - pipeline.pColorBlendState = &cb; - pipeline.pMultisampleState = &ms; - pipeline.pViewportState = &vp; - pipeline.pDepthStencilState = &ds; - pipeline.pStages = shaderStages; - pipeline.renderPass = demo->render_pass; - pipeline.pDynamicState = &dynamicState; - - memset(&pipelineCache, 0, sizeof(pipelineCache)); - pipelineCache.sType = VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO; - - err = vkCreatePipelineCache(demo->device, &pipelineCache, NULL, - &demo->pipelineCache); - assert(!err); - err = vkCreateGraphicsPipelines(demo->device, demo->pipelineCache, 1, - &pipeline, NULL, &demo->pipeline); - assert(!err); - - vkDestroyPipelineCache(demo->device, demo->pipelineCache, NULL); - - vkDestroyShaderModule(demo->device, demo->frag_shader_module, NULL); - vkDestroyShaderModule(demo->device, demo->vert_shader_module, NULL); -} - -static void demo_prepare_descriptor_pool(struct demo *demo) { - const VkDescriptorPoolSize type_count = { - .type = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, - .descriptorCount = DEMO_TEXTURE_COUNT, - }; - const VkDescriptorPoolCreateInfo descriptor_pool = { - .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO, - .pNext = NULL, - .maxSets = 1, - .poolSizeCount = 1, - .pPoolSizes = &type_count, - }; - VkResult U_ASSERT_ONLY err; - - err = vkCreateDescriptorPool(demo->device, &descriptor_pool, NULL, - &demo->desc_pool); - assert(!err); -} - -static void demo_prepare_descriptor_set(struct demo *demo) { - VkDescriptorImageInfo tex_descs[DEMO_TEXTURE_COUNT]; - VkWriteDescriptorSet write; - VkResult U_ASSERT_ONLY err; - uint32_t i; - - VkDescriptorSetAllocateInfo alloc_info = { - .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO, - .pNext = NULL, - .descriptorPool = demo->desc_pool, - .descriptorSetCount = 1, - .pSetLayouts = &demo->desc_layout}; - err = vkAllocateDescriptorSets(demo->device, &alloc_info, &demo->desc_set); - assert(!err); - - memset(&tex_descs, 0, sizeof(tex_descs)); - for (i = 0; i < DEMO_TEXTURE_COUNT; i++) { - tex_descs[i].sampler = demo->textures[i].sampler; - tex_descs[i].imageView = demo->textures[i].view; - tex_descs[i].imageLayout = VK_IMAGE_LAYOUT_GENERAL; - } - - memset(&write, 0, sizeof(write)); - write.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; - write.dstSet = demo->desc_set; - write.descriptorCount = DEMO_TEXTURE_COUNT; - write.descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; - write.pImageInfo = tex_descs; - - vkUpdateDescriptorSets(demo->device, 1, &write, 0, NULL); -} - -static void demo_prepare_framebuffers(struct demo *demo) { - VkImageView attachments[2]; - attachments[1] = demo->depth.view; - - const VkFramebufferCreateInfo fb_info = { - .sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO, - .pNext = NULL, - .renderPass = demo->render_pass, - .attachmentCount = 2, - .pAttachments = attachments, - .width = demo->width, - .height = demo->height, - .layers = 1, - }; - VkResult U_ASSERT_ONLY err; - uint32_t i; - - demo->framebuffers = (VkFramebuffer *)malloc(demo->swapchainImageCount * - sizeof(VkFramebuffer)); - assert(demo->framebuffers); - - for (i = 0; i < demo->swapchainImageCount; i++) { - attachments[0] = demo->buffers[i].view; - err = vkCreateFramebuffer(demo->device, &fb_info, NULL, - &demo->framebuffers[i]); - assert(!err); - } -} - -static void demo_prepare(struct demo *demo) { - VkResult U_ASSERT_ONLY err; - - const VkCommandPoolCreateInfo cmd_pool_info = { - .sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO, - .pNext = NULL, - .queueFamilyIndex = demo->graphics_queue_node_index, - .flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, - }; - err = vkCreateCommandPool(demo->device, &cmd_pool_info, NULL, - &demo->cmd_pool); - assert(!err); - - const VkCommandBufferAllocateInfo cmd = { - .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, - .pNext = NULL, - .commandPool = demo->cmd_pool, - .level = VK_COMMAND_BUFFER_LEVEL_PRIMARY, - .commandBufferCount = 1, - }; - err = vkAllocateCommandBuffers(demo->device, &cmd, &demo->draw_cmd); - assert(!err); - - demo_prepare_buffers(demo); - demo_prepare_depth(demo); - demo_prepare_textures(demo); - demo_prepare_vertices(demo); - demo_prepare_descriptor_layout(demo); - demo_prepare_render_pass(demo); - demo_prepare_pipeline(demo); - - demo_prepare_descriptor_pool(demo); - demo_prepare_descriptor_set(demo); - - demo_prepare_framebuffers(demo); -} - -static void demo_error_callback(int error, const char* description) { - printf("GLFW error: %s\n", description); - fflush(stdout); -} - -static void demo_key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) { - if (key == GLFW_KEY_ESCAPE && action == GLFW_RELEASE) - glfwSetWindowShouldClose(window, GLFW_TRUE); -} - -static void demo_refresh_callback(GLFWwindow* window) { - struct demo* demo = glfwGetWindowUserPointer(window); - demo_draw(demo); -} - -static void demo_resize_callback(GLFWwindow* window, int width, int height) { - struct demo* demo = glfwGetWindowUserPointer(window); - demo->width = width; - demo->height = height; - demo_resize(demo); -} - -static void demo_run(struct demo *demo) { - while (!glfwWindowShouldClose(demo->window)) { - glfwPollEvents(); - - demo_draw(demo); - - if (demo->depthStencil > 0.99f) - demo->depthIncrement = -0.001f; - if (demo->depthStencil < 0.8f) - demo->depthIncrement = 0.001f; - - demo->depthStencil += demo->depthIncrement; - - // Wait for work to finish before updating MVP. - vkDeviceWaitIdle(demo->device); - demo->curFrame++; - if (demo->frameCount != INT32_MAX && demo->curFrame == demo->frameCount) - glfwSetWindowShouldClose(demo->window, GLFW_TRUE); - } -} - -static void demo_create_window(struct demo *demo) { - glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); - - demo->window = glfwCreateWindow(demo->width, - demo->height, - APP_LONG_NAME, - NULL, - NULL); - if (!demo->window) { - // It didn't work, so try to give a useful error: - printf("Cannot create a window in which to draw!\n"); - fflush(stdout); - exit(1); - } - - glfwSetWindowUserPointer(demo->window, demo); - glfwSetWindowRefreshCallback(demo->window, demo_refresh_callback); - glfwSetFramebufferSizeCallback(demo->window, demo_resize_callback); - glfwSetKeyCallback(demo->window, demo_key_callback); -} - -/* - * Return 1 (true) if all layer names specified in check_names - * can be found in given layer properties. - */ -static VkBool32 demo_check_layers(uint32_t check_count, const char **check_names, - uint32_t layer_count, - VkLayerProperties *layers) { - uint32_t i, j; - for (i = 0; i < check_count; i++) { - VkBool32 found = 0; - for (j = 0; j < layer_count; j++) { - if (!strcmp(check_names[i], layers[j].layerName)) { - found = 1; - break; - } - } - if (!found) { - fprintf(stderr, "Cannot find layer: %s\n", check_names[i]); - return 0; - } - } - return 1; -} - -static void demo_init_vk(struct demo *demo) { - VkResult err; - uint32_t i = 0; - uint32_t required_extension_count = 0; - uint32_t instance_extension_count = 0; - uint32_t instance_layer_count = 0; - uint32_t validation_layer_count = 0; - const char **required_extensions = NULL; - const char **instance_validation_layers = NULL; - demo->enabled_extension_count = 0; - demo->enabled_layer_count = 0; - - char *instance_validation_layers_alt1[] = { - "VK_LAYER_LUNARG_standard_validation" - }; - - char *instance_validation_layers_alt2[] = { - "VK_LAYER_GOOGLE_threading", "VK_LAYER_LUNARG_parameter_validation", - "VK_LAYER_LUNARG_object_tracker", "VK_LAYER_LUNARG_image", - "VK_LAYER_LUNARG_core_validation", "VK_LAYER_LUNARG_swapchain", - "VK_LAYER_GOOGLE_unique_objects" - }; - - /* Look for validation layers */ - VkBool32 validation_found = 0; - if (demo->validate) { - - err = vkEnumerateInstanceLayerProperties(&instance_layer_count, NULL); - assert(!err); - - instance_validation_layers = (const char**) instance_validation_layers_alt1; - if (instance_layer_count > 0) { - VkLayerProperties *instance_layers = - malloc(sizeof (VkLayerProperties) * instance_layer_count); - err = vkEnumerateInstanceLayerProperties(&instance_layer_count, - instance_layers); - assert(!err); - - - validation_found = demo_check_layers( - ARRAY_SIZE(instance_validation_layers_alt1), - instance_validation_layers, instance_layer_count, - instance_layers); - if (validation_found) { - demo->enabled_layer_count = ARRAY_SIZE(instance_validation_layers_alt1); - demo->enabled_layers[0] = "VK_LAYER_LUNARG_standard_validation"; - validation_layer_count = 1; - } else { - // use alternative set of validation layers - instance_validation_layers = - (const char**) instance_validation_layers_alt2; - demo->enabled_layer_count = ARRAY_SIZE(instance_validation_layers_alt2); - validation_found = demo_check_layers( - ARRAY_SIZE(instance_validation_layers_alt2), - instance_validation_layers, instance_layer_count, - instance_layers); - validation_layer_count = - ARRAY_SIZE(instance_validation_layers_alt2); - for (i = 0; i < validation_layer_count; i++) { - demo->enabled_layers[i] = instance_validation_layers[i]; - } - } - free(instance_layers); - } - - if (!validation_found) { - ERR_EXIT("vkEnumerateInstanceLayerProperties failed to find " - "required validation layer.\n\n" - "Please look at the Getting Started guide for additional " - "information.\n", - "vkCreateInstance Failure"); - } - } - - /* Look for instance extensions */ - required_extensions = glfwGetRequiredInstanceExtensions(&required_extension_count); - if (!required_extensions) { - ERR_EXIT("glfwGetRequiredInstanceExtensions failed to find the " - "platform surface extensions.\n\nDo you have a compatible " - "Vulkan installable client driver (ICD) installed?\nPlease " - "look at the Getting Started guide for additional " - "information.\n", - "vkCreateInstance Failure"); - } - - for (i = 0; i < required_extension_count; i++) { - demo->extension_names[demo->enabled_extension_count++] = required_extensions[i]; - assert(demo->enabled_extension_count < 64); - } - - err = vkEnumerateInstanceExtensionProperties( - NULL, &instance_extension_count, NULL); - assert(!err); - - if (instance_extension_count > 0) { - VkExtensionProperties *instance_extensions = - malloc(sizeof(VkExtensionProperties) * instance_extension_count); - err = vkEnumerateInstanceExtensionProperties( - NULL, &instance_extension_count, instance_extensions); - assert(!err); - for (i = 0; i < instance_extension_count; i++) { - if (!strcmp(VK_EXT_DEBUG_REPORT_EXTENSION_NAME, - instance_extensions[i].extensionName)) { - if (demo->validate) { - demo->extension_names[demo->enabled_extension_count++] = - VK_EXT_DEBUG_REPORT_EXTENSION_NAME; - } - } - assert(demo->enabled_extension_count < 64); - } - - free(instance_extensions); - } - - const VkApplicationInfo app = { - .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO, - .pNext = NULL, - .pApplicationName = APP_SHORT_NAME, - .applicationVersion = 0, - .pEngineName = APP_SHORT_NAME, - .engineVersion = 0, - .apiVersion = VK_API_VERSION_1_0, - }; - VkInstanceCreateInfo inst_info = { - .sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, - .pNext = NULL, - .pApplicationInfo = &app, - .enabledLayerCount = demo->enabled_layer_count, - .ppEnabledLayerNames = (const char *const *)instance_validation_layers, - .enabledExtensionCount = demo->enabled_extension_count, - .ppEnabledExtensionNames = (const char *const *)demo->extension_names, - }; - - uint32_t gpu_count; - - err = vkCreateInstance(&inst_info, NULL, &demo->inst); - if (err == VK_ERROR_INCOMPATIBLE_DRIVER) { - ERR_EXIT("Cannot find a compatible Vulkan installable client driver " - "(ICD).\n\nPlease look at the Getting Started guide for " - "additional information.\n", - "vkCreateInstance Failure"); - } else if (err == VK_ERROR_EXTENSION_NOT_PRESENT) { - ERR_EXIT("Cannot find a specified extension library" - ".\nMake sure your layers path is set appropriately\n", - "vkCreateInstance Failure"); - } else if (err) { - ERR_EXIT("vkCreateInstance failed.\n\nDo you have a compatible Vulkan " - "installable client driver (ICD) installed?\nPlease look at " - "the Getting Started guide for additional information.\n", - "vkCreateInstance Failure"); - } - - gladLoadVulkanUserPtr(NULL, (GLADuserptrloadfunc) glfwGetInstanceProcAddress, demo->inst); - - /* Make initial call to query gpu_count, then second call for gpu info*/ - err = vkEnumeratePhysicalDevices(demo->inst, &gpu_count, NULL); - assert(!err && gpu_count > 0); - - if (gpu_count > 0) { - VkPhysicalDevice *physical_devices = - malloc(sizeof(VkPhysicalDevice) * gpu_count); - err = vkEnumeratePhysicalDevices(demo->inst, &gpu_count, - physical_devices); - assert(!err); - /* For tri demo we just grab the first physical device */ - demo->gpu = physical_devices[0]; - free(physical_devices); - } else { - ERR_EXIT("vkEnumeratePhysicalDevices reported zero accessible devices." - "\n\nDo you have a compatible Vulkan installable client" - " driver (ICD) installed?\nPlease look at the Getting Started" - " guide for additional information.\n", - "vkEnumeratePhysicalDevices Failure"); - } - - gladLoadVulkanUserPtr(demo->gpu, (GLADuserptrloadfunc) glfwGetInstanceProcAddress, demo->inst); - - /* Look for device extensions */ - uint32_t device_extension_count = 0; - VkBool32 swapchainExtFound = 0; - demo->enabled_extension_count = 0; - - err = vkEnumerateDeviceExtensionProperties(demo->gpu, NULL, - &device_extension_count, NULL); - assert(!err); - - if (device_extension_count > 0) { - VkExtensionProperties *device_extensions = - malloc(sizeof(VkExtensionProperties) * device_extension_count); - err = vkEnumerateDeviceExtensionProperties( - demo->gpu, NULL, &device_extension_count, device_extensions); - assert(!err); - - for (i = 0; i < device_extension_count; i++) { - if (!strcmp(VK_KHR_SWAPCHAIN_EXTENSION_NAME, - device_extensions[i].extensionName)) { - swapchainExtFound = 1; - demo->extension_names[demo->enabled_extension_count++] = - VK_KHR_SWAPCHAIN_EXTENSION_NAME; - } - assert(demo->enabled_extension_count < 64); - } - - free(device_extensions); - } - - if (!swapchainExtFound) { - ERR_EXIT("vkEnumerateDeviceExtensionProperties failed to find " - "the " VK_KHR_SWAPCHAIN_EXTENSION_NAME - " extension.\n\nDo you have a compatible " - "Vulkan installable client driver (ICD) installed?\nPlease " - "look at the Getting Started guide for additional " - "information.\n", - "vkCreateInstance Failure"); - } - - if (demo->validate) { - VkDebugReportCallbackCreateInfoEXT dbgCreateInfo; - dbgCreateInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT; - dbgCreateInfo.flags = - VK_DEBUG_REPORT_ERROR_BIT_EXT | VK_DEBUG_REPORT_WARNING_BIT_EXT; - dbgCreateInfo.pfnCallback = demo->use_break ? BreakCallback : dbgFunc; - dbgCreateInfo.pUserData = demo; - dbgCreateInfo.pNext = NULL; - err = vkCreateDebugReportCallbackEXT(demo->inst, &dbgCreateInfo, NULL, - &demo->msg_callback); - switch (err) { - case VK_SUCCESS: - break; - case VK_ERROR_OUT_OF_HOST_MEMORY: - ERR_EXIT("CreateDebugReportCallback: out of host memory\n", - "CreateDebugReportCallback Failure"); - break; - default: - ERR_EXIT("CreateDebugReportCallback: unknown failure\n", - "CreateDebugReportCallback Failure"); - break; - } - } - - vkGetPhysicalDeviceProperties(demo->gpu, &demo->gpu_props); - - // Query with NULL data to get count - vkGetPhysicalDeviceQueueFamilyProperties(demo->gpu, &demo->queue_count, - NULL); - - demo->queue_props = (VkQueueFamilyProperties *)malloc( - demo->queue_count * sizeof(VkQueueFamilyProperties)); - vkGetPhysicalDeviceQueueFamilyProperties(demo->gpu, &demo->queue_count, - demo->queue_props); - assert(demo->queue_count >= 1); - - vkGetPhysicalDeviceFeatures(demo->gpu, &demo->gpu_features); - - // Graphics queue and MemMgr queue can be separate. - // TODO: Add support for separate queues, including synchronization, - // and appropriate tracking for QueueSubmit -} - -static void demo_init_device(struct demo *demo) { - VkResult U_ASSERT_ONLY err; - - float queue_priorities[1] = {0.0}; - const VkDeviceQueueCreateInfo queue = { - .sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO, - .pNext = NULL, - .queueFamilyIndex = demo->graphics_queue_node_index, - .queueCount = 1, - .pQueuePriorities = queue_priorities}; - - - VkPhysicalDeviceFeatures features; - memset(&features, 0, sizeof(features)); - if (demo->gpu_features.shaderClipDistance) { - features.shaderClipDistance = VK_TRUE; - } - - VkDeviceCreateInfo device = { - .sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO, - .pNext = NULL, - .queueCreateInfoCount = 1, - .pQueueCreateInfos = &queue, - .enabledLayerCount = 0, - .ppEnabledLayerNames = NULL, - .enabledExtensionCount = demo->enabled_extension_count, - .ppEnabledExtensionNames = (const char *const *)demo->extension_names, - .pEnabledFeatures = &features, - }; - - err = vkCreateDevice(demo->gpu, &device, NULL, &demo->device); - assert(!err); -} - -static void demo_init_vk_swapchain(struct demo *demo) { - VkResult U_ASSERT_ONLY err; - uint32_t i; - - // Create a WSI surface for the window: - glfwCreateWindowSurface(demo->inst, demo->window, NULL, &demo->surface); - - // Iterate over each queue to learn whether it supports presenting: - VkBool32 *supportsPresent = - (VkBool32 *)malloc(demo->queue_count * sizeof(VkBool32)); - for (i = 0; i < demo->queue_count; i++) { - vkGetPhysicalDeviceSurfaceSupportKHR(demo->gpu, i, demo->surface, - &supportsPresent[i]); - } - - // Search for a graphics and a present queue in the array of queue - // families, try to find one that supports both - uint32_t graphicsQueueNodeIndex = UINT32_MAX; - uint32_t presentQueueNodeIndex = UINT32_MAX; - for (i = 0; i < demo->queue_count; i++) { - if ((demo->queue_props[i].queueFlags & VK_QUEUE_GRAPHICS_BIT) != 0) { - if (graphicsQueueNodeIndex == UINT32_MAX) { - graphicsQueueNodeIndex = i; - } - - if (supportsPresent[i] == VK_TRUE) { - graphicsQueueNodeIndex = i; - presentQueueNodeIndex = i; - break; - } - } - } - if (presentQueueNodeIndex == UINT32_MAX) { - // If didn't find a queue that supports both graphics and present, then - // find a separate present queue. - for (i = 0; i < demo->queue_count; ++i) { - if (supportsPresent[i] == VK_TRUE) { - presentQueueNodeIndex = i; - break; - } - } - } - free(supportsPresent); - - // Generate error if could not find both a graphics and a present queue - if (graphicsQueueNodeIndex == UINT32_MAX || - presentQueueNodeIndex == UINT32_MAX) { - ERR_EXIT("Could not find a graphics and a present queue\n", - "Swapchain Initialization Failure"); - } - - // TODO: Add support for separate queues, including presentation, - // synchronization, and appropriate tracking for QueueSubmit. - // NOTE: While it is possible for an application to use a separate graphics - // and a present queues, this demo program assumes it is only using - // one: - if (graphicsQueueNodeIndex != presentQueueNodeIndex) { - ERR_EXIT("Could not find a common graphics and a present queue\n", - "Swapchain Initialization Failure"); - } - - demo->graphics_queue_node_index = graphicsQueueNodeIndex; - - demo_init_device(demo); - - vkGetDeviceQueue(demo->device, demo->graphics_queue_node_index, 0, - &demo->queue); - - // Get the list of VkFormat's that are supported: - uint32_t formatCount; - err = vkGetPhysicalDeviceSurfaceFormatsKHR(demo->gpu, demo->surface, - &formatCount, NULL); - assert(!err); - VkSurfaceFormatKHR *surfFormats = - (VkSurfaceFormatKHR *)malloc(formatCount * sizeof(VkSurfaceFormatKHR)); - err = vkGetPhysicalDeviceSurfaceFormatsKHR(demo->gpu, demo->surface, - &formatCount, surfFormats); - assert(!err); - // If the format list includes just one entry of VK_FORMAT_UNDEFINED, - // the surface has no preferred format. Otherwise, at least one - // supported format will be returned. - if (formatCount == 1 && surfFormats[0].format == VK_FORMAT_UNDEFINED) { - demo->format = VK_FORMAT_B8G8R8A8_UNORM; - } else { - assert(formatCount >= 1); - demo->format = surfFormats[0].format; - } - demo->color_space = surfFormats[0].colorSpace; - - demo->curFrame = 0; - - // Get Memory information and properties - vkGetPhysicalDeviceMemoryProperties(demo->gpu, &demo->memory_properties); -} - -static void demo_init_connection(struct demo *demo) { - glfwSetErrorCallback(demo_error_callback); - - if (!glfwInit()) { - printf("Cannot initialize GLFW.\nExiting ...\n"); - fflush(stdout); - exit(1); - } - - if (!glfwVulkanSupported()) { - printf("GLFW failed to find the Vulkan loader.\nExiting ...\n"); - fflush(stdout); - exit(1); - } - - gladLoadVulkanUserPtr(NULL, (GLADuserptrloadfunc) glfwGetInstanceProcAddress, NULL); -} - -static void demo_init(struct demo *demo, const int argc, const char *argv[]) -{ - int i; - memset(demo, 0, sizeof(*demo)); - demo->frameCount = INT32_MAX; - - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "--use_staging") == 0) { - demo->use_staging_buffer = true; - continue; - } - if (strcmp(argv[i], "--break") == 0) { - demo->use_break = true; - continue; - } - if (strcmp(argv[i], "--validate") == 0) { - demo->validate = true; - continue; - } - if (strcmp(argv[i], "--c") == 0 && demo->frameCount == INT32_MAX && - i < argc - 1 && sscanf(argv[i + 1], "%d", &demo->frameCount) == 1 && - demo->frameCount >= 0) { - i++; - continue; - } - - fprintf(stderr, "Usage:\n %s [--use_staging] [--validate] [--break] " - "[--c ]\n", - APP_SHORT_NAME); - fflush(stderr); - exit(1); - } - - demo_init_connection(demo); - demo_init_vk(demo); - - demo->width = 300; - demo->height = 300; - demo->depthStencil = 1.0; - demo->depthIncrement = -0.01f; -} - -static void demo_cleanup(struct demo *demo) { - uint32_t i; - - for (i = 0; i < demo->swapchainImageCount; i++) { - vkDestroyFramebuffer(demo->device, demo->framebuffers[i], NULL); - } - free(demo->framebuffers); - vkDestroyDescriptorPool(demo->device, demo->desc_pool, NULL); - - if (demo->setup_cmd) { - vkFreeCommandBuffers(demo->device, demo->cmd_pool, 1, &demo->setup_cmd); - } - vkFreeCommandBuffers(demo->device, demo->cmd_pool, 1, &demo->draw_cmd); - vkDestroyCommandPool(demo->device, demo->cmd_pool, NULL); - - vkDestroyPipeline(demo->device, demo->pipeline, NULL); - vkDestroyRenderPass(demo->device, demo->render_pass, NULL); - vkDestroyPipelineLayout(demo->device, demo->pipeline_layout, NULL); - vkDestroyDescriptorSetLayout(demo->device, demo->desc_layout, NULL); - - vkDestroyBuffer(demo->device, demo->vertices.buf, NULL); - vkFreeMemory(demo->device, demo->vertices.mem, NULL); - - for (i = 0; i < DEMO_TEXTURE_COUNT; i++) { - vkDestroyImageView(demo->device, demo->textures[i].view, NULL); - vkDestroyImage(demo->device, demo->textures[i].image, NULL); - vkFreeMemory(demo->device, demo->textures[i].mem, NULL); - vkDestroySampler(demo->device, demo->textures[i].sampler, NULL); - } - - for (i = 0; i < demo->swapchainImageCount; i++) { - vkDestroyImageView(demo->device, demo->buffers[i].view, NULL); - } - - vkDestroyImageView(demo->device, demo->depth.view, NULL); - vkDestroyImage(demo->device, demo->depth.image, NULL); - vkFreeMemory(demo->device, demo->depth.mem, NULL); - - vkDestroySwapchainKHR(demo->device, demo->swapchain, NULL); - free(demo->buffers); - - vkDestroyDevice(demo->device, NULL); - if (demo->validate) { - vkDestroyDebugReportCallbackEXT(demo->inst, demo->msg_callback, NULL); - } - vkDestroySurfaceKHR(demo->inst, demo->surface, NULL); - vkDestroyInstance(demo->inst, NULL); - - free(demo->queue_props); - - glfwDestroyWindow(demo->window); - glfwTerminate(); -} - -static void demo_resize(struct demo *demo) { - uint32_t i; - - // In order to properly resize the window, we must re-create the swapchain - // AND redo the command buffers, etc. - // - // First, perform part of the demo_cleanup() function: - - for (i = 0; i < demo->swapchainImageCount; i++) { - vkDestroyFramebuffer(demo->device, demo->framebuffers[i], NULL); - } - free(demo->framebuffers); - vkDestroyDescriptorPool(demo->device, demo->desc_pool, NULL); - - if (demo->setup_cmd) { - vkFreeCommandBuffers(demo->device, demo->cmd_pool, 1, &demo->setup_cmd); - demo->setup_cmd = VK_NULL_HANDLE; - } - vkFreeCommandBuffers(demo->device, demo->cmd_pool, 1, &demo->draw_cmd); - vkDestroyCommandPool(demo->device, demo->cmd_pool, NULL); - - vkDestroyPipeline(demo->device, demo->pipeline, NULL); - vkDestroyRenderPass(demo->device, demo->render_pass, NULL); - vkDestroyPipelineLayout(demo->device, demo->pipeline_layout, NULL); - vkDestroyDescriptorSetLayout(demo->device, demo->desc_layout, NULL); - - vkDestroyBuffer(demo->device, demo->vertices.buf, NULL); - vkFreeMemory(demo->device, demo->vertices.mem, NULL); - - for (i = 0; i < DEMO_TEXTURE_COUNT; i++) { - vkDestroyImageView(demo->device, demo->textures[i].view, NULL); - vkDestroyImage(demo->device, demo->textures[i].image, NULL); - vkFreeMemory(demo->device, demo->textures[i].mem, NULL); - vkDestroySampler(demo->device, demo->textures[i].sampler, NULL); - } - - for (i = 0; i < demo->swapchainImageCount; i++) { - vkDestroyImageView(demo->device, demo->buffers[i].view, NULL); - } - - vkDestroyImageView(demo->device, demo->depth.view, NULL); - vkDestroyImage(demo->device, demo->depth.image, NULL); - vkFreeMemory(demo->device, demo->depth.mem, NULL); - - free(demo->buffers); - - // Second, re-perform the demo_prepare() function, which will re-create the - // swapchain: - demo_prepare(demo); -} - -int main(const int argc, const char *argv[]) { - struct demo demo; - - demo_init(&demo, argc, argv); - demo_create_window(&demo); - demo_init_vk_swapchain(&demo); - - demo_prepare(&demo); - demo_run(&demo); - - demo_cleanup(&demo); - - return validation_error; -} - diff --git a/3rdparty/glfw/source/tests/window.c b/3rdparty/glfw/source/tests/window.c deleted file mode 100644 index 83baff4..0000000 --- a/3rdparty/glfw/source/tests/window.c +++ /dev/null @@ -1,428 +0,0 @@ -//======================================================================== -// Window properties test -// Copyright (c) Camilla Löwy -// -// This software is provided 'as-is', without any express or implied -// warranty. In no event will the authors be held liable for any damages -// arising from the use of this software. -// -// Permission is granted to anyone to use this software for any purpose, -// including commercial applications, and to alter it and redistribute it -// freely, subject to the following restrictions: -// -// 1. The origin of this software must not be misrepresented; you must not -// claim that you wrote the original software. If you use this software -// in a product, an acknowledgment in the product documentation would -// be appreciated but is not required. -// -// 2. Altered source versions must be plainly marked as such, and must not -// be misrepresented as being the original software. -// -// 3. This notice may not be removed or altered from any source -// distribution. -// -//======================================================================== - -#define GLAD_GL_IMPLEMENTATION -#include -#define GLFW_INCLUDE_NONE -#include - -#include - -#define NK_IMPLEMENTATION -#define NK_INCLUDE_FIXED_TYPES -#define NK_INCLUDE_FONT_BAKING -#define NK_INCLUDE_DEFAULT_FONT -#define NK_INCLUDE_DEFAULT_ALLOCATOR -#define NK_INCLUDE_VERTEX_BUFFER_OUTPUT -#define NK_INCLUDE_STANDARD_VARARGS -#define NK_BUTTON_TRIGGER_ON_RELEASE -#include - -#define NK_GLFW_GL2_IMPLEMENTATION -#include - -#include -#include -#include -#include - -int main(int argc, char** argv) -{ - int windowed_x, windowed_y, windowed_width, windowed_height; - int last_xpos = INT_MIN, last_ypos = INT_MIN; - int last_width = INT_MIN, last_height = INT_MIN; - int limit_aspect_ratio = false, aspect_numer = 1, aspect_denom = 1; - int limit_min_size = false, min_width = 400, min_height = 400; - int limit_max_size = false, max_width = 400, max_height = 400; - char width_buffer[12] = "", height_buffer[12] = ""; - char xpos_buffer[12] = "", ypos_buffer[12] = ""; - char numer_buffer[12] = "", denom_buffer[12] = ""; - char min_width_buffer[12] = "", min_height_buffer[12] = ""; - char max_width_buffer[12] = "", max_height_buffer[12] = ""; - int may_close = true; - - if (!glfwInit()) - exit(EXIT_FAILURE); - - glfwWindowHint(GLFW_SCALE_TO_MONITOR, GLFW_TRUE); - glfwWindowHint(GLFW_WIN32_KEYBOARD_MENU, GLFW_TRUE); - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1); - - GLFWwindow* window = glfwCreateWindow(600, 600, "Window Features", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - gladLoadGL(glfwGetProcAddress); - glfwSwapInterval(0); - - bool position_supported = true; - - glfwGetError(NULL); - glfwGetWindowPos(window, &last_xpos, &last_ypos); - sprintf(xpos_buffer, "%i", last_xpos); - sprintf(ypos_buffer, "%i", last_ypos); - if (glfwGetError(NULL) == GLFW_FEATURE_UNAVAILABLE) - position_supported = false; - - glfwGetWindowSize(window, &last_width, &last_height); - sprintf(width_buffer, "%i", last_width); - sprintf(height_buffer, "%i", last_height); - - sprintf(numer_buffer, "%i", aspect_numer); - sprintf(denom_buffer, "%i", aspect_denom); - - sprintf(min_width_buffer, "%i", min_width); - sprintf(min_height_buffer, "%i", min_height); - sprintf(max_width_buffer, "%i", max_width); - sprintf(max_height_buffer, "%i", max_height); - - struct nk_context* nk = nk_glfw3_init(window, NK_GLFW3_INSTALL_CALLBACKS); - - struct nk_font_atlas* atlas; - nk_glfw3_font_stash_begin(&atlas); - nk_glfw3_font_stash_end(); - - while (!(may_close && glfwWindowShouldClose(window))) - { - int width, height; - - glfwGetWindowSize(window, &width, &height); - - struct nk_rect area = nk_rect(0.f, 0.f, (float) width, (float) height); - nk_window_set_bounds(nk, "main", area); - - nk_glfw3_new_frame(); - if (nk_begin(nk, "main", area, 0)) - { - nk_layout_row_dynamic(nk, 30, 5); - - if (nk_button_label(nk, "Toggle Fullscreen")) - { - if (glfwGetWindowMonitor(window)) - { - glfwSetWindowMonitor(window, NULL, - windowed_x, windowed_y, - windowed_width, windowed_height, 0); - } - else - { - GLFWmonitor* monitor = glfwGetPrimaryMonitor(); - const GLFWvidmode* mode = glfwGetVideoMode(monitor); - glfwGetWindowPos(window, &windowed_x, &windowed_y); - glfwGetWindowSize(window, &windowed_width, &windowed_height); - glfwSetWindowMonitor(window, monitor, - 0, 0, mode->width, mode->height, - mode->refreshRate); - } - } - - if (nk_button_label(nk, "Maximize")) - glfwMaximizeWindow(window); - if (nk_button_label(nk, "Iconify")) - glfwIconifyWindow(window); - if (nk_button_label(nk, "Restore")) - glfwRestoreWindow(window); - if (nk_button_label(nk, "Hide (briefly)")) - { - glfwHideWindow(window); - - const double time = glfwGetTime() + 3.0; - while (glfwGetTime() < time) - glfwWaitEventsTimeout(1.0); - - glfwShowWindow(window); - } - - nk_layout_row_dynamic(nk, 30, 1); - - if (glfwGetWindowAttrib(window, GLFW_MOUSE_PASSTHROUGH)) - { - nk_label(nk, "Press H to disable mouse passthrough", NK_TEXT_CENTERED); - - if (glfwGetKey(window, GLFW_KEY_H)) - glfwSetWindowAttrib(window, GLFW_MOUSE_PASSTHROUGH, false); - } - - nk_label(nk, "Press Enter in a text field to set value", NK_TEXT_CENTERED); - - nk_flags events; - const nk_flags flags = NK_EDIT_FIELD | - NK_EDIT_SIG_ENTER | - NK_EDIT_GOTO_END_ON_ACTIVATE; - - if (position_supported) - { - int xpos, ypos; - glfwGetWindowPos(window, &xpos, &ypos); - - nk_layout_row_dynamic(nk, 30, 3); - nk_label(nk, "Position", NK_TEXT_LEFT); - - events = nk_edit_string_zero_terminated(nk, flags, xpos_buffer, - sizeof(xpos_buffer), - nk_filter_decimal); - if (events & NK_EDIT_COMMITED) - { - xpos = atoi(xpos_buffer); - glfwSetWindowPos(window, xpos, ypos); - } - else if (xpos != last_xpos || (events & NK_EDIT_DEACTIVATED)) - sprintf(xpos_buffer, "%i", xpos); - - events = nk_edit_string_zero_terminated(nk, flags, ypos_buffer, - sizeof(ypos_buffer), - nk_filter_decimal); - if (events & NK_EDIT_COMMITED) - { - ypos = atoi(ypos_buffer); - glfwSetWindowPos(window, xpos, ypos); - } - else if (ypos != last_ypos || (events & NK_EDIT_DEACTIVATED)) - sprintf(ypos_buffer, "%i", ypos); - - last_xpos = xpos; - last_ypos = ypos; - } - else - nk_label(nk, "Position not supported", NK_TEXT_LEFT); - - nk_layout_row_dynamic(nk, 30, 3); - nk_label(nk, "Size", NK_TEXT_LEFT); - - events = nk_edit_string_zero_terminated(nk, flags, width_buffer, - sizeof(width_buffer), - nk_filter_decimal); - if (events & NK_EDIT_COMMITED) - { - width = atoi(width_buffer); - glfwSetWindowSize(window, width, height); - } - else if (width != last_width || (events & NK_EDIT_DEACTIVATED)) - sprintf(width_buffer, "%i", width); - - events = nk_edit_string_zero_terminated(nk, flags, height_buffer, - sizeof(height_buffer), - nk_filter_decimal); - if (events & NK_EDIT_COMMITED) - { - height = atoi(height_buffer); - glfwSetWindowSize(window, width, height); - } - else if (height != last_height || (events & NK_EDIT_DEACTIVATED)) - sprintf(height_buffer, "%i", height); - - last_width = width; - last_height = height; - - bool update_ratio_limit = false; - if (nk_checkbox_label(nk, "Aspect Ratio", &limit_aspect_ratio)) - update_ratio_limit = true; - - events = nk_edit_string_zero_terminated(nk, flags, numer_buffer, - sizeof(numer_buffer), - nk_filter_decimal); - if (events & NK_EDIT_COMMITED) - { - aspect_numer = abs(atoi(numer_buffer)); - update_ratio_limit = true; - } - else if (events & NK_EDIT_DEACTIVATED) - sprintf(numer_buffer, "%i", aspect_numer); - - events = nk_edit_string_zero_terminated(nk, flags, denom_buffer, - sizeof(denom_buffer), - nk_filter_decimal); - if (events & NK_EDIT_COMMITED) - { - aspect_denom = abs(atoi(denom_buffer)); - update_ratio_limit = true; - } - else if (events & NK_EDIT_DEACTIVATED) - sprintf(denom_buffer, "%i", aspect_denom); - - if (update_ratio_limit) - { - if (limit_aspect_ratio) - glfwSetWindowAspectRatio(window, aspect_numer, aspect_denom); - else - glfwSetWindowAspectRatio(window, GLFW_DONT_CARE, GLFW_DONT_CARE); - } - - bool update_size_limit = false; - - if (nk_checkbox_label(nk, "Minimum Size", &limit_min_size)) - update_size_limit = true; - - events = nk_edit_string_zero_terminated(nk, flags, min_width_buffer, - sizeof(min_width_buffer), - nk_filter_decimal); - if (events & NK_EDIT_COMMITED) - { - min_width = abs(atoi(min_width_buffer)); - update_size_limit = true; - } - else if (events & NK_EDIT_DEACTIVATED) - sprintf(min_width_buffer, "%i", min_width); - - events = nk_edit_string_zero_terminated(nk, flags, min_height_buffer, - sizeof(min_height_buffer), - nk_filter_decimal); - if (events & NK_EDIT_COMMITED) - { - min_height = abs(atoi(min_height_buffer)); - update_size_limit = true; - } - else if (events & NK_EDIT_DEACTIVATED) - sprintf(min_height_buffer, "%i", min_height); - - if (nk_checkbox_label(nk, "Maximum Size", &limit_max_size)) - update_size_limit = true; - - events = nk_edit_string_zero_terminated(nk, flags, max_width_buffer, - sizeof(max_width_buffer), - nk_filter_decimal); - if (events & NK_EDIT_COMMITED) - { - max_width = abs(atoi(max_width_buffer)); - update_size_limit = true; - } - else if (events & NK_EDIT_DEACTIVATED) - sprintf(max_width_buffer, "%i", max_width); - - events = nk_edit_string_zero_terminated(nk, flags, max_height_buffer, - sizeof(max_height_buffer), - nk_filter_decimal); - if (events & NK_EDIT_COMMITED) - { - max_height = abs(atoi(max_height_buffer)); - update_size_limit = true; - } - else if (events & NK_EDIT_DEACTIVATED) - sprintf(max_height_buffer, "%i", max_height); - - if (update_size_limit) - { - glfwSetWindowSizeLimits(window, - limit_min_size ? min_width : GLFW_DONT_CARE, - limit_min_size ? min_height : GLFW_DONT_CARE, - limit_max_size ? max_width : GLFW_DONT_CARE, - limit_max_size ? max_height : GLFW_DONT_CARE); - } - - int fb_width, fb_height; - glfwGetFramebufferSize(window, &fb_width, &fb_height); - nk_label(nk, "Framebuffer Size", NK_TEXT_LEFT); - nk_labelf(nk, NK_TEXT_LEFT, "%i", fb_width); - nk_labelf(nk, NK_TEXT_LEFT, "%i", fb_height); - - float xscale, yscale; - glfwGetWindowContentScale(window, &xscale, &yscale); - nk_label(nk, "Content Scale", NK_TEXT_LEFT); - nk_labelf(nk, NK_TEXT_LEFT, "%f", xscale); - nk_labelf(nk, NK_TEXT_LEFT, "%f", yscale); - - nk_layout_row_begin(nk, NK_DYNAMIC, 30, 5); - int frame_left, frame_top, frame_right, frame_bottom; - glfwGetWindowFrameSize(window, &frame_left, &frame_top, &frame_right, &frame_bottom); - nk_layout_row_push(nk, 1.f / 3.f); - nk_label(nk, "Frame Size:", NK_TEXT_LEFT); - nk_layout_row_push(nk, 1.f / 6.f); - nk_labelf(nk, NK_TEXT_LEFT, "%i", frame_left); - nk_layout_row_push(nk, 1.f / 6.f); - nk_labelf(nk, NK_TEXT_LEFT, "%i", frame_top); - nk_layout_row_push(nk, 1.f / 6.f); - nk_labelf(nk, NK_TEXT_LEFT, "%i", frame_right); - nk_layout_row_push(nk, 1.f / 6.f); - nk_labelf(nk, NK_TEXT_LEFT, "%i", frame_bottom); - nk_layout_row_end(nk); - - nk_layout_row_begin(nk, NK_DYNAMIC, 30, 2); - float opacity = glfwGetWindowOpacity(window); - nk_layout_row_push(nk, 1.f / 3.f); - nk_labelf(nk, NK_TEXT_LEFT, "Opacity: %0.3f", opacity); - nk_layout_row_push(nk, 2.f / 3.f); - if (nk_slider_float(nk, 0.f, &opacity, 1.f, 0.001f)) - glfwSetWindowOpacity(window, opacity); - nk_layout_row_end(nk); - - nk_layout_row_begin(nk, NK_DYNAMIC, 30, 2); - int should_close = glfwWindowShouldClose(window); - nk_layout_row_push(nk, 1.f / 3.f); - if (nk_checkbox_label(nk, "Should Close", &should_close)) - glfwSetWindowShouldClose(window, should_close); - nk_layout_row_push(nk, 2.f / 3.f); - nk_checkbox_label(nk, "May Close", &may_close); - nk_layout_row_end(nk); - - nk_layout_row_dynamic(nk, 30, 1); - nk_label(nk, "Attributes", NK_TEXT_CENTERED); - - nk_layout_row_dynamic(nk, 30, width > 200 ? width / 200 : 1); - - int decorated = glfwGetWindowAttrib(window, GLFW_DECORATED); - if (nk_checkbox_label(nk, "Decorated", &decorated)) - glfwSetWindowAttrib(window, GLFW_DECORATED, decorated); - - int resizable = glfwGetWindowAttrib(window, GLFW_RESIZABLE); - if (nk_checkbox_label(nk, "Resizable", &resizable)) - glfwSetWindowAttrib(window, GLFW_RESIZABLE, resizable); - - int floating = glfwGetWindowAttrib(window, GLFW_FLOATING); - if (nk_checkbox_label(nk, "Floating", &floating)) - glfwSetWindowAttrib(window, GLFW_FLOATING, floating); - - int passthrough = glfwGetWindowAttrib(window, GLFW_MOUSE_PASSTHROUGH); - if (nk_checkbox_label(nk, "Mouse Passthrough", &passthrough)) - glfwSetWindowAttrib(window, GLFW_MOUSE_PASSTHROUGH, passthrough); - - int auto_iconify = glfwGetWindowAttrib(window, GLFW_AUTO_ICONIFY); - if (nk_checkbox_label(nk, "Auto Iconify", &auto_iconify)) - glfwSetWindowAttrib(window, GLFW_AUTO_ICONIFY, auto_iconify); - - nk_value_bool(nk, "Focused", glfwGetWindowAttrib(window, GLFW_FOCUSED)); - nk_value_bool(nk, "Hovered", glfwGetWindowAttrib(window, GLFW_HOVERED)); - nk_value_bool(nk, "Visible", glfwGetWindowAttrib(window, GLFW_VISIBLE)); - nk_value_bool(nk, "Iconified", glfwGetWindowAttrib(window, GLFW_ICONIFIED)); - nk_value_bool(nk, "Maximized", glfwGetWindowAttrib(window, GLFW_MAXIMIZED)); - } - nk_end(nk); - - glClear(GL_COLOR_BUFFER_BIT); - nk_glfw3_render(NK_ANTI_ALIASING_ON); - glfwSwapBuffers(window); - - glfwWaitEvents(); - } - - nk_glfw3_shutdown(); - glfwTerminate(); - exit(EXIT_SUCCESS); -} - diff --git a/3rdparty/glm/CMakeLists.txt b/3rdparty/glm/CMakeLists.txt deleted file mode 100644 index 4ba97e3..0000000 --- a/3rdparty/glm/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -add_subdirectory(source) - -set_target_properties(glm -PROPERTIES - UNITY_BUILD OFF -) diff --git a/3rdparty/glm/README.md b/3rdparty/glm/README.md deleted file mode 100644 index b164cb1..0000000 --- a/3rdparty/glm/README.md +++ /dev/null @@ -1,2 +0,0 @@ -The following files are removed from glm's source code: -- docs/ diff --git a/3rdparty/glm/glm.stamp b/3rdparty/glm/glm.stamp deleted file mode 100644 index 48437ff..0000000 --- a/3rdparty/glm/glm.stamp +++ /dev/null @@ -1,2 +0,0 @@ -# Source obtained from https://github.com/g-truc/glm -commit: 6ad79aae3eb5bf809c30bf1168171e9e55857e45 diff --git a/3rdparty/glm/source/.appveyor.yml b/3rdparty/glm/source/.appveyor.yml deleted file mode 100644 index 5ce6028..0000000 --- a/3rdparty/glm/source/.appveyor.yml +++ /dev/null @@ -1,92 +0,0 @@ -shallow_clone: true - -platform: - - x86 - - x64 - -configuration: - - Debug - - Release - -image: - - Visual Studio 2013 - - Visual Studio 2015 - - Visual Studio 2017 - - Visual Studio 2019 - -environment: - matrix: - - GLM_ARGUMENTS: -DGLM_TEST_FORCE_PURE=ON - - GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_SSE2=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON - - GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON - - GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_CXX_14=ON - - GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_CXX_17=ON - -matrix: - exclude: - - image: Visual Studio 2013 - GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON - - image: Visual Studio 2013 - GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_CXX_14=ON - - image: Visual Studio 2013 - GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_CXX_17=ON - - image: Visual Studio 2013 - configuration: Debug - - image: Visual Studio 2015 - GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_SSE2=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON - - image: Visual Studio 2015 - GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_CXX_14=ON - - image: Visual Studio 2015 - GLM_ARGUMENTS: -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_CXX_17=ON - - image: Visual Studio 2015 - platform: x86 - - image: Visual Studio 2015 - configuration: Debug - - image: Visual Studio 2017 - platform: x86 - - image: Visual Studio 2017 - configuration: Debug - - image: Visual Studio 2019 - platform: x64 - -branches: - only: - - master - -before_build: - - ps: | - mkdir build - cd build - - if ("$env:APPVEYOR_JOB_NAME" -match "Image: Visual Studio 2013") { - $env:generator="Visual Studio 12 2013" - } - if ("$env:APPVEYOR_JOB_NAME" -match "Image: Visual Studio 2015") { - $env:generator="Visual Studio 14 2015" - } - if ("$env:APPVEYOR_JOB_NAME" -match "Image: Visual Studio 2017") { - $env:generator="Visual Studio 15 2017" - } - if ("$env:APPVEYOR_JOB_NAME" -match "Image: Visual Studio 2019") { - $env:generator="Visual Studio 16 2019" - } - if ($env:PLATFORM -eq "x64") { - $env:generator="$env:generator Win64" - } - echo generator="$env:generator" - cmake .. -G "$env:generator" -DCMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER/install" -DGLM_QUIET=ON -DGLM_TEST_ENABLE=ON "$env:GLM_ARGUMENTS" - -build_script: - - cmake --build . --parallel --config %CONFIGURATION% -- /m /v:minimal - - cmake --build . --target install --parallel --config %CONFIGURATION% -- /m /v:minimal - -test_script: - - ctest --parallel 4 --verbose -C %CONFIGURATION% - - cd .. - - ps: | - mkdir build_test_cmake - cd build_test_cmake - cmake ..\test\cmake\ -G "$env:generator" -DCMAKE_PREFIX_PATH="$env:APPVEYOR_BUILD_FOLDER/install" - - cmake --build . --parallel --config %CONFIGURATION% -- /m /v:minimal - -deploy: off diff --git a/3rdparty/glm/source/.gitignore b/3rdparty/glm/source/.gitignore deleted file mode 100644 index 9dbd6d8..0000000 --- a/3rdparty/glm/source/.gitignore +++ /dev/null @@ -1,61 +0,0 @@ -# Compiled Object files -*.slo -*.lo -*.o -*.obj - -# Precompiled Headers -*.gch -*.pch - -# Compiled Dynamic libraries -*.so -*.dylib -*.dll - -# Fortran module files -*.mod - -# Compiled Static libraries -*.lai -*.la -*.a -*.lib - -# Executables -*.exe -*.out -*.app - -# CMake -CMakeCache.txt -CMakeFiles -cmake_install.cmake -install_manifest.txt -*.cmake -!glmConfig.cmake -!glmConfig-version.cmake -# ^ May need to add future .cmake files as exceptions - -# Test logs -Testing/* - -# Test input -test/gtc/*.dds - -# Project Files -Makefile -*.cbp -*.user - -# Misc. -*.log - -# local build(s) -build* - -/.vs -/.vscode -/CMakeSettings.json -.DS_Store -*.swp diff --git a/3rdparty/glm/source/.travis.yml b/3rdparty/glm/source/.travis.yml deleted file mode 100644 index 1660ec0..0000000 --- a/3rdparty/glm/source/.travis.yml +++ /dev/null @@ -1,388 +0,0 @@ -language: cpp - -branches: - only: - - master - - stable - -jobs: - include: - - name: "Xcode 7.3 C++98 pure release" - os: osx - osx_image: xcode7.3 - env: - - MATRIX_EVAL="" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_98=ON -DGLM_TEST_FORCE_PURE=ON" - - - name: "Xcode 7.3 C++98 sse2 release" - os: osx - osx_image: xcode7.3 - env: - - MATRIX_EVAL="" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_98=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE2=ON" - - - name: "Xcode 7.3 C++98 ms release" - os: osx - osx_image: xcode7.3 - env: - - MATRIX_EVAL="" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_98=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON" - - - name: "XCode 7.3 C++11 pure release" - os: osx - osx_image: xcode7.3 - env: - - MATRIX_EVAL="" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_FORCE_PURE=ON" - - - name: "XCode 7.3 C++11 sse2 release" - os: osx - osx_image: xcode7.3 - env: - - MATRIX_EVAL="" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE3=ON" - - - name: "XCode 10.3 C++11 sse2 release" - os: osx - osx_image: xcode10.3 - env: - - MATRIX_EVAL="" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE3=ON" - - - name: "XCode 12.2 C++11 sse2 release" - os: osx - osx_image: xcode12.2 - env: - - MATRIX_EVAL="" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE3=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "XCode 12.2 C++11 sse2 debug" - os: osx - osx_image: xcode12.2 - env: - - MATRIX_EVAL="" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE3=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "XCode 12.2 C++11 avx debug" - os: osx - osx_image: xcode12.2 - env: - - MATRIX_EVAL="" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_AVX=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "XCode 12.2 C++14 avx debug" - os: osx - osx_image: xcode12.2 - env: - - MATRIX_EVAL="" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_AVX=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "XCode 12.2 C++14 pure debug" - os: osx - osx_image: xcode12.2 - env: - - MATRIX_EVAL="" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_FORCE_PURE=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "XCode 12.2 C++17 pure debug" - os: osx - osx_image: xcode12.2 - env: - - MATRIX_EVAL="" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_FORCE_PURE=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "XCode 12.2 C++17 sse2 debug" - os: osx - osx_image: xcode12.2 - env: - - MATRIX_EVAL="" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE2=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "XCode 12.2 C++17 sse2 release" - os: osx - osx_image: xcode12.2 - env: - - MATRIX_EVAL="" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE2=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "XCode 12.2 C++17 avx release" - os: osx - osx_image: xcode12.2 - env: - - MATRIX_EVAL="" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_AVX=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "GCC 4.9 C++98 pure release" - os: linux - dist: Xenial - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-4.9 - env: - - MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_98=ON -DGLM_TEST_FORCE_PURE=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "GCC 4.9 C++98 pure debug" - os: linux - dist: Xenial - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-4.9 - env: - - MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_98=ON -DGLM_TEST_FORCE_PURE=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "GCC 4.9 C++98 ms debug" - os: linux - dist: Xenial - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-4.9 - env: - - MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_98=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "GCC 4.9 C++11 ms debug" - os: linux - dist: Xenial - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-4.9 - env: - - MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "GCC 4.9 C++11 pure debug" - os: linux - dist: Xenial - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-4.9 - env: - - MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_11=ON -DGLM_TEST_FORCE_PURE=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "GCC 6 C++14 pure debug" - os: linux - dist: bionic - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-6 - env: - - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_FORCE_PURE=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "GCC 6 C++14 ms debug" - os: linux - dist: bionic - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-6 - env: - - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "GCC 7 C++17 ms debug" - os: linux - dist: bionic - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-7 - env: - - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "GCC 7 C++17 pure debug" - os: linux - dist: bionic - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-7 - env: - - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_FORCE_PURE=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "GCC 10 C++17 pure debug" - os: linux - dist: bionic - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-10 - env: - - MATRIX_EVAL="CC=gcc-10 && CXX=g++-10" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_FORCE_PURE=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "GCC 10 C++17 pure release" - os: linux - dist: bionic - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-10 - env: - - MATRIX_EVAL="CC=gcc-10 && CXX=g++-10" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_FORCE_PURE=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "Clang C++14 pure release" - os: linux - dist: Xenial - env: - - MATRIX_EVAL="CC=clang && CXX=clang++" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_FORCE_PURE=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "Clang C++14 pure debug" - os: linux - dist: Xenial - env: - - MATRIX_EVAL="CC=clang && CXX=clang++" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_FORCE_PURE=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "Clang C++14 sse2 debug" - os: linux - dist: Xenial - env: - - MATRIX_EVAL="CC=clang && CXX=clang++" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE2=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "Clang C++14 sse2 debug" - os: linux - dist: focal - env: - - MATRIX_EVAL="CC=clang && CXX=clang++" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_14=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE2=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "Clang C++17 sse2 debug" - os: linux - dist: focal - env: - - MATRIX_EVAL="CC=clang && CXX=clang++" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_SSE2=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "Clang C++17 avx2 debug" - os: linux - dist: focal - env: - - MATRIX_EVAL="CC=clang && CXX=clang++" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON -DGLM_TEST_ENABLE_SIMD_AVX2=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "Clang C++17 pure debug" - os: linux - dist: focal - env: - - MATRIX_EVAL="CC=clang && CXX=clang++" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Debug -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_FORCE_PURE=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - - - name: "Clang C++17 pure release" - os: linux - dist: focal - env: - - MATRIX_EVAL="CC=clang && CXX=clang++" - - CMAKE_BUILD_ENV="-DCMAKE_BUILD_TYPE=Release -DGLM_TEST_ENABLE=ON -DGLM_TEST_ENABLE_CXX_17=ON -DGLM_TEST_FORCE_PURE=ON" - - CTEST_ENV="--parallel 4 --output-on-failure" - - CMAKE_ENV="--parallel" - -before_script: - - cmake --version - - eval "${MATRIX_EVAL}" - -script: - - ${CC} --version - - mkdir ./build - - cd ./build - - cmake -DCMAKE_INSTALL_PREFIX=$TRAVIS_BUILD_DIR/install -DCMAKE_CXX_COMPILER=$COMPILER ${CMAKE_BUILD_ENV} .. - - cmake --build . ${CMAKE_ENV} - - ctest ${CTEST_ENV} - - cmake --build . --target install ${CMAKE_ENV} - - cd $TRAVIS_BUILD_DIR - - mkdir ./build_test_cmake - - cd ./build_test_cmake - - cmake -DCMAKE_CXX_COMPILER=$COMPILER $TRAVIS_BUILD_DIR/test/cmake/ -DCMAKE_PREFIX_PATH=$TRAVIS_BUILD_DIR/install - - cmake --build . - - diff --git a/3rdparty/glm/source/CMakeLists.txt b/3rdparty/glm/source/CMakeLists.txt deleted file mode 100644 index b7641a2..0000000 --- a/3rdparty/glm/source/CMakeLists.txt +++ /dev/null @@ -1,45 +0,0 @@ -cmake_minimum_required(VERSION 3.2 FATAL_ERROR) -cmake_policy(VERSION 3.2) - - -file(READ "glm/detail/setup.hpp" GLM_SETUP_FILE) -string(REGEX MATCH "#define[ ]+GLM_VERSION_MAJOR[ ]+([0-9]+)" _ ${GLM_SETUP_FILE}) -set(GLM_VERSION_MAJOR "${CMAKE_MATCH_1}") -string(REGEX MATCH "#define[ ]+GLM_VERSION_MINOR[ ]+([0-9]+)" _ ${GLM_SETUP_FILE}) -set(GLM_VERSION_MINOR "${CMAKE_MATCH_1}") -string(REGEX MATCH "#define[ ]+GLM_VERSION_PATCH[ ]+([0-9]+)" _ ${GLM_SETUP_FILE}) -set(GLM_VERSION_PATCH "${CMAKE_MATCH_1}") -string(REGEX MATCH "#define[ ]+GLM_VERSION_REVISION[ ]+([0-9]+)" _ ${GLM_SETUP_FILE}) -set(GLM_VERSION_REVISION "${CMAKE_MATCH_1}") - -set(GLM_VERSION ${GLM_VERSION_MAJOR}.${GLM_VERSION_MINOR}.${GLM_VERSION_PATCH}.${GLM_VERSION_REVISION}) -project(glm VERSION ${GLM_VERSION} LANGUAGES CXX) -message(STATUS "GLM: Version " ${GLM_VERSION}) - -add_subdirectory(glm) -add_library(glm::glm ALIAS glm) - -if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) - - include(CPack) - install(DIRECTORY glm DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} PATTERN "CMakeLists.txt" EXCLUDE) - install(EXPORT glm FILE glmConfig.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/glm NAMESPACE glm::) - include(CMakePackageConfigHelpers) - write_basic_package_version_file("glmConfigVersion.cmake" COMPATIBILITY AnyNewerVersion) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/glmConfigVersion.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/glm) - - include(CTest) - if(BUILD_TESTING) - add_subdirectory(test) - endif() - -endif(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) - -if (NOT TARGET uninstall) -configure_file(cmake/cmake_uninstall.cmake.in - cmake_uninstall.cmake IMMEDIATE @ONLY) - -add_custom_target(uninstall - "${CMAKE_COMMAND}" -P - "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake") -endif() diff --git a/3rdparty/glm/source/cmake/cmake_uninstall.cmake.in b/3rdparty/glm/source/cmake/cmake_uninstall.cmake.in deleted file mode 100644 index c2d34d4..0000000 --- a/3rdparty/glm/source/cmake/cmake_uninstall.cmake.in +++ /dev/null @@ -1,21 +0,0 @@ -if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") - message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt") -endif() - -file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) -string(REGEX REPLACE "\n" ";" files "${files}") -foreach(file ${files}) - message(STATUS "Uninstalling $ENV{DESTDIR}${file}") - if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") - exec_program( - "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" - OUTPUT_VARIABLE rm_out - RETURN_VALUE rm_retval - ) - if(NOT "${rm_retval}" STREQUAL 0) - message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") - endif() - else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") - message(STATUS "File $ENV{DESTDIR}${file} does not exist.") - endif() -endforeach() diff --git a/3rdparty/glm/source/copying.txt b/3rdparty/glm/source/copying.txt deleted file mode 100644 index 779c32f..0000000 --- a/3rdparty/glm/source/copying.txt +++ /dev/null @@ -1,54 +0,0 @@ -================================================================================ -OpenGL Mathematics (GLM) --------------------------------------------------------------------------------- -GLM is licensed under The Happy Bunny License or MIT License - -================================================================================ -The Happy Bunny License (Modified MIT License) --------------------------------------------------------------------------------- -Copyright (c) 2005 - G-Truc Creation - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -Restrictions: - By making use of the Software for military purposes, you choose to make a - Bunny unhappy. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -================================================================================ -The MIT License --------------------------------------------------------------------------------- -Copyright (c) 2005 - G-Truc Creation - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/3rdparty/glm/source/glm/CMakeLists.txt b/3rdparty/glm/source/glm/CMakeLists.txt deleted file mode 100644 index 2d5cff2..0000000 --- a/3rdparty/glm/source/glm/CMakeLists.txt +++ /dev/null @@ -1,78 +0,0 @@ -file(GLOB ROOT_SOURCE *.cpp) -file(GLOB ROOT_INLINE *.inl) -file(GLOB ROOT_HEADER *.hpp) -file(GLOB ROOT_TEXT ../*.txt) -file(GLOB ROOT_MD ../*.md) -file(GLOB ROOT_NAT ../util/glm.natvis) - -file(GLOB_RECURSE CORE_SOURCE ./detail/*.cpp) -file(GLOB_RECURSE CORE_INLINE ./detail/*.inl) -file(GLOB_RECURSE CORE_HEADER ./detail/*.hpp) - -file(GLOB_RECURSE EXT_SOURCE ./ext/*.cpp) -file(GLOB_RECURSE EXT_INLINE ./ext/*.inl) -file(GLOB_RECURSE EXT_HEADER ./ext/*.hpp) - -file(GLOB_RECURSE GTC_SOURCE ./gtc/*.cpp) -file(GLOB_RECURSE GTC_INLINE ./gtc/*.inl) -file(GLOB_RECURSE GTC_HEADER ./gtc/*.hpp) - -file(GLOB_RECURSE GTX_SOURCE ./gtx/*.cpp) -file(GLOB_RECURSE GTX_INLINE ./gtx/*.inl) -file(GLOB_RECURSE GTX_HEADER ./gtx/*.hpp) - -file(GLOB_RECURSE SIMD_SOURCE ./simd/*.cpp) -file(GLOB_RECURSE SIMD_INLINE ./simd/*.inl) -file(GLOB_RECURSE SIMD_HEADER ./simd/*.h) - -source_group("Text Files" FILES ${ROOT_TEXT} ${ROOT_MD}) -source_group("Core Files" FILES ${CORE_SOURCE}) -source_group("Core Files" FILES ${CORE_INLINE}) -source_group("Core Files" FILES ${CORE_HEADER}) -source_group("EXT Files" FILES ${EXT_SOURCE}) -source_group("EXT Files" FILES ${EXT_INLINE}) -source_group("EXT Files" FILES ${EXT_HEADER}) -source_group("GTC Files" FILES ${GTC_SOURCE}) -source_group("GTC Files" FILES ${GTC_INLINE}) -source_group("GTC Files" FILES ${GTC_HEADER}) -source_group("GTX Files" FILES ${GTX_SOURCE}) -source_group("GTX Files" FILES ${GTX_INLINE}) -source_group("GTX Files" FILES ${GTX_HEADER}) -source_group("SIMD Files" FILES ${SIMD_SOURCE}) -source_group("SIMD Files" FILES ${SIMD_INLINE}) -source_group("SIMD Files" FILES ${SIMD_HEADER}) - -add_library(glm INTERFACE) - -include(GNUInstallDirs) - -target_include_directories(glm INTERFACE - $ - $ -) - -install(TARGETS glm EXPORT glm) - -if(BUILD_STATIC_LIBS) -add_library(glm_static STATIC ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT} - ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} - ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} - ${EXT_SOURCE} ${EXT_INLINE} ${EXT_HEADER} - ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} - ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER} - ${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER}) - target_link_libraries(glm_static PUBLIC glm) - add_library(glm::glm_static ALIAS glm_static) -endif() - -if(BUILD_SHARED_LIBS) -add_library(glm_shared SHARED ${ROOT_TEXT} ${ROOT_MD} ${ROOT_NAT} - ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} - ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} - ${EXT_SOURCE} ${EXT_INLINE} ${EXT_HEADER} - ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} - ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER} - ${SIMD_SOURCE} ${SIMD_INLINE} ${SIMD_HEADER}) - target_link_libraries(glm_shared PUBLIC glm) - add_library(glm::glm_shared ALIAS glm_shared) -endif() diff --git a/3rdparty/glm/source/glm/common.hpp b/3rdparty/glm/source/glm/common.hpp deleted file mode 100644 index 0328dc9..0000000 --- a/3rdparty/glm/source/glm/common.hpp +++ /dev/null @@ -1,539 +0,0 @@ -/// @ref core -/// @file glm/common.hpp -/// -/// @see GLSL 4.20.8 specification, section 8.3 Common Functions -/// -/// @defgroup core_func_common Common functions -/// @ingroup core -/// -/// Provides GLSL common functions -/// -/// These all operate component-wise. The description is per component. -/// -/// Include to use these core features. - -#pragma once - -#include "detail/qualifier.hpp" -#include "detail/_fixes.hpp" - -namespace glm -{ - /// @addtogroup core_func_common - /// @{ - - /// Returns x if x >= 0; otherwise, it returns -x. - /// - /// @tparam genType floating-point or signed integer; scalar or vector types. - /// - /// @see GLSL abs man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL GLM_CONSTEXPR genType abs(genType x); - - /// Returns x if x >= 0; otherwise, it returns -x. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or signed integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL abs man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL GLM_CONSTEXPR vec abs(vec const& x); - - /// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL sign man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec sign(vec const& x); - - /// Returns a value equal to the nearest integer that is less then or equal to x. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL floor man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec floor(vec const& x); - - /// Returns a value equal to the nearest integer to x - /// whose absolute value is not larger than the absolute value of x. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL trunc man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec trunc(vec const& x); - - /// Returns a value equal to the nearest integer to x. - /// The fraction 0.5 will round in a direction chosen by the - /// implementation, presumably the direction that is fastest. - /// This includes the possibility that round(x) returns the - /// same value as roundEven(x) for all values of x. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL round man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec round(vec const& x); - - /// Returns a value equal to the nearest integer to x. - /// A fractional part of 0.5 will round toward the nearest even - /// integer. (Both 3.5 and 4.5 for x will return 4.0.) - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL roundEven man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - /// @see New round to even technique - template - GLM_FUNC_DECL vec roundEven(vec const& x); - - /// Returns a value equal to the nearest integer - /// that is greater than or equal to x. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL ceil man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec ceil(vec const& x); - - /// Return x - floor(x). - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL fract man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL genType fract(genType x); - - /// Return x - floor(x). - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL fract man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec fract(vec const& x); - - template - GLM_FUNC_DECL genType mod(genType x, genType y); - - template - GLM_FUNC_DECL vec mod(vec const& x, T y); - - /// Modulus. Returns x - y * floor(x / y) - /// for each component in x using the floating point value y. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types, include glm/gtc/integer for integer scalar types support - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL mod man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec mod(vec const& x, vec const& y); - - /// Returns the fractional part of x and sets i to the integer - /// part (as a whole number floating point value). Both the - /// return value and the output parameter will have the same - /// sign as x. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL modf man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL genType modf(genType x, genType& i); - - /// Returns y if y < x; otherwise, it returns x. - /// - /// @tparam genType Floating-point or integer; scalar or vector types. - /// - /// @see GLSL min man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL GLM_CONSTEXPR genType min(genType x, genType y); - - /// Returns y if y < x; otherwise, it returns x. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL min man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL GLM_CONSTEXPR vec min(vec const& x, T y); - - /// Returns y if y < x; otherwise, it returns x. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL min man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL GLM_CONSTEXPR vec min(vec const& x, vec const& y); - - /// Returns y if x < y; otherwise, it returns x. - /// - /// @tparam genType Floating-point or integer; scalar or vector types. - /// - /// @see GLSL max man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL GLM_CONSTEXPR genType max(genType x, genType y); - - /// Returns y if x < y; otherwise, it returns x. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL max man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL GLM_CONSTEXPR vec max(vec const& x, T y); - - /// Returns y if x < y; otherwise, it returns x. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL max man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL GLM_CONSTEXPR vec max(vec const& x, vec const& y); - - /// Returns min(max(x, minVal), maxVal) for each component in x - /// using the floating-point values minVal and maxVal. - /// - /// @tparam genType Floating-point or integer; scalar or vector types. - /// - /// @see GLSL clamp man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL GLM_CONSTEXPR genType clamp(genType x, genType minVal, genType maxVal); - - /// Returns min(max(x, minVal), maxVal) for each component in x - /// using the floating-point values minVal and maxVal. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL clamp man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL GLM_CONSTEXPR vec clamp(vec const& x, T minVal, T maxVal); - - /// Returns min(max(x, minVal), maxVal) for each component in x - /// using the floating-point values minVal and maxVal. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL clamp man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL GLM_CONSTEXPR vec clamp(vec const& x, vec const& minVal, vec const& maxVal); - - /// If genTypeU is a floating scalar or vector: - /// Returns x * (1.0 - a) + y * a, i.e., the linear blend of - /// x and y using the floating-point value a. - /// The value for a is not restricted to the range [0, 1]. - /// - /// If genTypeU is a boolean scalar or vector: - /// Selects which vector each returned component comes - /// from. For a component of 'a' that is false, the - /// corresponding component of 'x' is returned. For a - /// component of 'a' that is true, the corresponding - /// component of 'y' is returned. Components of 'x' and 'y' that - /// are not selected are allowed to be invalid floating point - /// values and will have no effect on the results. Thus, this - /// provides different functionality than - /// genType mix(genType x, genType y, genType(a)) - /// where a is a Boolean vector. - /// - /// @see GLSL mix man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - /// - /// @param[in] x Value to interpolate. - /// @param[in] y Value to interpolate. - /// @param[in] a Interpolant. - /// - /// @tparam genTypeT Floating point scalar or vector. - /// @tparam genTypeU Floating point or boolean scalar or vector. It can't be a vector if it is the length of genTypeT. - /// - /// @code - /// #include - /// ... - /// float a; - /// bool b; - /// glm::dvec3 e; - /// glm::dvec3 f; - /// glm::vec4 g; - /// glm::vec4 h; - /// ... - /// glm::vec4 r = glm::mix(g, h, a); // Interpolate with a floating-point scalar two vectors. - /// glm::vec4 s = glm::mix(g, h, b); // Returns g or h; - /// glm::dvec3 t = glm::mix(e, f, a); // Types of the third parameter is not required to match with the first and the second. - /// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter. - /// @endcode - template - GLM_FUNC_DECL genTypeT mix(genTypeT x, genTypeT y, genTypeU a); - - template - GLM_FUNC_DECL vec mix(vec const& x, vec const& y, vec const& a); - - template - GLM_FUNC_DECL vec mix(vec const& x, vec const& y, U a); - - /// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType. - /// - /// @see GLSL step man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL genType step(genType edge, genType x); - - /// Returns 0.0 if x < edge, otherwise it returns 1.0. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL step man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec step(T edge, vec const& x); - - /// Returns 0.0 if x < edge, otherwise it returns 1.0. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL step man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec step(vec const& edge, vec const& x); - - /// Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and - /// performs smooth Hermite interpolation between 0 and 1 - /// when edge0 < x < edge1. This is useful in cases where - /// you would want a threshold function with a smooth - /// transition. This is equivalent to: - /// genType t; - /// t = clamp ((x - edge0) / (edge1 - edge0), 0, 1); - /// return t * t * (3 - 2 * t); - /// Results are undefined if edge0 >= edge1. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL smoothstep man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL genType smoothstep(genType edge0, genType edge1, genType x); - - template - GLM_FUNC_DECL vec smoothstep(T edge0, T edge1, vec const& x); - - template - GLM_FUNC_DECL vec smoothstep(vec const& edge0, vec const& edge1, vec const& x); - - /// Returns true if x holds a NaN (not a number) - /// representation in the underlying implementation's set of - /// floating point representations. Returns false otherwise, - /// including for implementations with no NaN - /// representations. - /// - /// /!\ When using compiler fast math, this function may fail. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL isnan man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec isnan(vec const& x); - - /// Returns true if x holds a positive infinity or negative - /// infinity representation in the underlying implementation's - /// set of floating point representations. Returns false - /// otherwise, including for implementations with no infinity - /// representations. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL isinf man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec isinf(vec const& x); - - /// Returns a signed integer value representing - /// the encoding of a floating-point value. The floating-point - /// value's bit-level representation is preserved. - /// - /// @see GLSL floatBitsToInt man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - GLM_FUNC_DECL int floatBitsToInt(float const& v); - - /// Returns a signed integer value representing - /// the encoding of a floating-point value. The floatingpoint - /// value's bit-level representation is preserved. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL floatBitsToInt man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec floatBitsToInt(vec const& v); - - /// Returns a unsigned integer value representing - /// the encoding of a floating-point value. The floatingpoint - /// value's bit-level representation is preserved. - /// - /// @see GLSL floatBitsToUint man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - GLM_FUNC_DECL uint floatBitsToUint(float const& v); - - /// Returns a unsigned integer value representing - /// the encoding of a floating-point value. The floatingpoint - /// value's bit-level representation is preserved. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL floatBitsToUint man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec floatBitsToUint(vec const& v); - - /// Returns a floating-point value corresponding to a signed - /// integer encoding of a floating-point value. - /// If an inf or NaN is passed in, it will not signal, and the - /// resulting floating point value is unspecified. Otherwise, - /// the bit-level representation is preserved. - /// - /// @see GLSL intBitsToFloat man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - GLM_FUNC_DECL float intBitsToFloat(int const& v); - - /// Returns a floating-point value corresponding to a signed - /// integer encoding of a floating-point value. - /// If an inf or NaN is passed in, it will not signal, and the - /// resulting floating point value is unspecified. Otherwise, - /// the bit-level representation is preserved. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL intBitsToFloat man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec intBitsToFloat(vec const& v); - - /// Returns a floating-point value corresponding to a - /// unsigned integer encoding of a floating-point value. - /// If an inf or NaN is passed in, it will not signal, and the - /// resulting floating point value is unspecified. Otherwise, - /// the bit-level representation is preserved. - /// - /// @see GLSL uintBitsToFloat man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - GLM_FUNC_DECL float uintBitsToFloat(uint const& v); - - /// Returns a floating-point value corresponding to a - /// unsigned integer encoding of a floating-point value. - /// If an inf or NaN is passed in, it will not signal, and the - /// resulting floating point value is unspecified. Otherwise, - /// the bit-level representation is preserved. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL uintBitsToFloat man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL vec uintBitsToFloat(vec const& v); - - /// Computes and returns a * b + c. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL fma man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL genType fma(genType const& a, genType const& b, genType const& c); - - /// Splits x into a floating-point significand in the range - /// [0.5, 1.0) and an integral exponent of two, such that: - /// x = significand * exp(2, exponent) - /// - /// The significand is returned by the function and the - /// exponent is returned in the parameter exp. For a - /// floating-point value of zero, the significant and exponent - /// are both zero. For a floating-point value that is an - /// infinity or is not a number, the results are undefined. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL frexp man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL genType frexp(genType x, int& exp); - - template - GLM_FUNC_DECL vec frexp(vec const& v, vec& exp); - - /// Builds a floating-point number from x and the - /// corresponding integral exponent of two in exp, returning: - /// significand * exp(2, exponent) - /// - /// If this product is too large to be represented in the - /// floating-point type, the result is undefined. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL ldexp man page; - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL genType ldexp(genType const& x, int const& exp); - - template - GLM_FUNC_DECL vec ldexp(vec const& v, vec const& exp); - - /// @} -}//namespace glm - -#include "detail/func_common.inl" - diff --git a/3rdparty/glm/source/glm/detail/_features.hpp b/3rdparty/glm/source/glm/detail/_features.hpp deleted file mode 100644 index b0cbe9f..0000000 --- a/3rdparty/glm/source/glm/detail/_features.hpp +++ /dev/null @@ -1,394 +0,0 @@ -#pragma once - -// #define GLM_CXX98_EXCEPTIONS -// #define GLM_CXX98_RTTI - -// #define GLM_CXX11_RVALUE_REFERENCES -// Rvalue references - GCC 4.3 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html - -// GLM_CXX11_TRAILING_RETURN -// Rvalue references for *this - GCC not supported -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm - -// GLM_CXX11_NONSTATIC_MEMBER_INIT -// Initialization of class objects by rvalues - GCC any -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1610.html - -// GLM_CXX11_NONSTATIC_MEMBER_INIT -// Non-static data member initializers - GCC 4.7 -// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2756.htm - -// #define GLM_CXX11_VARIADIC_TEMPLATE -// Variadic templates - GCC 4.3 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf - -// -// Extending variadic template template parameters - GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf - -// #define GLM_CXX11_GENERALIZED_INITIALIZERS -// Initializer lists - GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm - -// #define GLM_CXX11_STATIC_ASSERT -// Static assertions - GCC 4.3 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html - -// #define GLM_CXX11_AUTO_TYPE -// auto-typed variables - GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf - -// #define GLM_CXX11_AUTO_TYPE -// Multi-declarator auto - GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1737.pdf - -// #define GLM_CXX11_AUTO_TYPE -// Removal of auto as a storage-class specifier - GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2546.htm - -// #define GLM_CXX11_AUTO_TYPE -// New function declarator syntax - GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm - -// #define GLM_CXX11_LAMBDAS -// New wording for C++0x lambdas - GCC 4.5 -// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2927.pdf - -// #define GLM_CXX11_DECLTYPE -// Declared type of an expression - GCC 4.3 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf - -// -// Right angle brackets - GCC 4.3 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html - -// -// Default template arguments for function templates DR226 GCC 4.3 -// http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#226 - -// -// Solving the SFINAE problem for expressions DR339 GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html - -// #define GLM_CXX11_ALIAS_TEMPLATE -// Template aliases N2258 GCC 4.7 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf - -// -// Extern templates N1987 Yes -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm - -// #define GLM_CXX11_NULLPTR -// Null pointer constant N2431 GCC 4.6 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf - -// #define GLM_CXX11_STRONG_ENUMS -// Strongly-typed enums N2347 GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf - -// -// Forward declarations for enums N2764 GCC 4.6 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2764.pdf - -// -// Generalized attributes N2761 GCC 4.8 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf - -// -// Generalized constant expressions N2235 GCC 4.6 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf - -// -// Alignment support N2341 GCC 4.8 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf - -// #define GLM_CXX11_DELEGATING_CONSTRUCTORS -// Delegating constructors N1986 GCC 4.7 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf - -// -// Inheriting constructors N2540 GCC 4.8 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm - -// #define GLM_CXX11_EXPLICIT_CONVERSIONS -// Explicit conversion operators N2437 GCC 4.5 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf - -// -// New character types N2249 GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2249.html - -// -// Unicode string literals N2442 GCC 4.5 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm - -// -// Raw string literals N2442 GCC 4.5 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm - -// -// Universal character name literals N2170 GCC 4.5 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html - -// #define GLM_CXX11_USER_LITERALS -// User-defined literals N2765 GCC 4.7 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf - -// -// Standard Layout Types N2342 GCC 4.5 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2342.htm - -// #define GLM_CXX11_DEFAULTED_FUNCTIONS -// #define GLM_CXX11_DELETED_FUNCTIONS -// Defaulted and deleted functions N2346 GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm - -// -// Extended friend declarations N1791 GCC 4.7 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf - -// -// Extending sizeof N2253 GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html - -// #define GLM_CXX11_INLINE_NAMESPACES -// Inline namespaces N2535 GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm - -// #define GLM_CXX11_UNRESTRICTED_UNIONS -// Unrestricted unions N2544 GCC 4.6 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf - -// #define GLM_CXX11_LOCAL_TYPE_TEMPLATE_ARGS -// Local and unnamed types as template arguments N2657 GCC 4.5 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm - -// #define GLM_CXX11_RANGE_FOR -// Range-based for N2930 GCC 4.6 -// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2930.html - -// #define GLM_CXX11_OVERRIDE_CONTROL -// Explicit virtual overrides N2928 N3206 N3272 GCC 4.7 -// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm - -// -// Minimal support for garbage collection and reachability-based leak detection N2670 No -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2670.htm - -// #define GLM_CXX11_NOEXCEPT -// Allowing move constructors to throw [noexcept] N3050 GCC 4.6 (core language only) -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3050.html - -// -// Defining move special member functions N3053 GCC 4.6 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3053.html - -// -// Sequence points N2239 Yes -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html - -// -// Atomic operations N2427 GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html - -// -// Strong Compare and Exchange N2748 GCC 4.5 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html - -// -// Bidirectional Fences N2752 GCC 4.8 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2752.htm - -// -// Memory model N2429 GCC 4.8 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2429.htm - -// -// Data-dependency ordering: atomics and memory model N2664 GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2664.htm - -// -// Propagating exceptions N2179 GCC 4.4 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html - -// -// Abandoning a process and at_quick_exit N2440 GCC 4.8 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2440.htm - -// -// Allow atomics use in signal handlers N2547 Yes -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2547.htm - -// -// Thread-local storage N2659 GCC 4.8 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm - -// -// Dynamic initialization and destruction with concurrency N2660 GCC 4.3 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm - -// -// __func__ predefined identifier N2340 GCC 4.3 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2340.htm - -// -// C99 preprocessor N1653 GCC 4.3 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm - -// -// long long N1811 GCC 4.3 -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf - -// -// Extended integral types N1988 Yes -// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1988.pdf - -#if(GLM_COMPILER & GLM_COMPILER_GCC) - -# define GLM_CXX11_STATIC_ASSERT - -#elif(GLM_COMPILER & GLM_COMPILER_CLANG) -# if(__has_feature(cxx_exceptions)) -# define GLM_CXX98_EXCEPTIONS -# endif - -# if(__has_feature(cxx_rtti)) -# define GLM_CXX98_RTTI -# endif - -# if(__has_feature(cxx_access_control_sfinae)) -# define GLM_CXX11_ACCESS_CONTROL_SFINAE -# endif - -# if(__has_feature(cxx_alias_templates)) -# define GLM_CXX11_ALIAS_TEMPLATE -# endif - -# if(__has_feature(cxx_alignas)) -# define GLM_CXX11_ALIGNAS -# endif - -# if(__has_feature(cxx_attributes)) -# define GLM_CXX11_ATTRIBUTES -# endif - -# if(__has_feature(cxx_constexpr)) -# define GLM_CXX11_CONSTEXPR -# endif - -# if(__has_feature(cxx_decltype)) -# define GLM_CXX11_DECLTYPE -# endif - -# if(__has_feature(cxx_default_function_template_args)) -# define GLM_CXX11_DEFAULT_FUNCTION_TEMPLATE_ARGS -# endif - -# if(__has_feature(cxx_defaulted_functions)) -# define GLM_CXX11_DEFAULTED_FUNCTIONS -# endif - -# if(__has_feature(cxx_delegating_constructors)) -# define GLM_CXX11_DELEGATING_CONSTRUCTORS -# endif - -# if(__has_feature(cxx_deleted_functions)) -# define GLM_CXX11_DELETED_FUNCTIONS -# endif - -# if(__has_feature(cxx_explicit_conversions)) -# define GLM_CXX11_EXPLICIT_CONVERSIONS -# endif - -# if(__has_feature(cxx_generalized_initializers)) -# define GLM_CXX11_GENERALIZED_INITIALIZERS -# endif - -# if(__has_feature(cxx_implicit_moves)) -# define GLM_CXX11_IMPLICIT_MOVES -# endif - -# if(__has_feature(cxx_inheriting_constructors)) -# define GLM_CXX11_INHERITING_CONSTRUCTORS -# endif - -# if(__has_feature(cxx_inline_namespaces)) -# define GLM_CXX11_INLINE_NAMESPACES -# endif - -# if(__has_feature(cxx_lambdas)) -# define GLM_CXX11_LAMBDAS -# endif - -# if(__has_feature(cxx_local_type_template_args)) -# define GLM_CXX11_LOCAL_TYPE_TEMPLATE_ARGS -# endif - -# if(__has_feature(cxx_noexcept)) -# define GLM_CXX11_NOEXCEPT -# endif - -# if(__has_feature(cxx_nonstatic_member_init)) -# define GLM_CXX11_NONSTATIC_MEMBER_INIT -# endif - -# if(__has_feature(cxx_nullptr)) -# define GLM_CXX11_NULLPTR -# endif - -# if(__has_feature(cxx_override_control)) -# define GLM_CXX11_OVERRIDE_CONTROL -# endif - -# if(__has_feature(cxx_reference_qualified_functions)) -# define GLM_CXX11_REFERENCE_QUALIFIED_FUNCTIONS -# endif - -# if(__has_feature(cxx_range_for)) -# define GLM_CXX11_RANGE_FOR -# endif - -# if(__has_feature(cxx_raw_string_literals)) -# define GLM_CXX11_RAW_STRING_LITERALS -# endif - -# if(__has_feature(cxx_rvalue_references)) -# define GLM_CXX11_RVALUE_REFERENCES -# endif - -# if(__has_feature(cxx_static_assert)) -# define GLM_CXX11_STATIC_ASSERT -# endif - -# if(__has_feature(cxx_auto_type)) -# define GLM_CXX11_AUTO_TYPE -# endif - -# if(__has_feature(cxx_strong_enums)) -# define GLM_CXX11_STRONG_ENUMS -# endif - -# if(__has_feature(cxx_trailing_return)) -# define GLM_CXX11_TRAILING_RETURN -# endif - -# if(__has_feature(cxx_unicode_literals)) -# define GLM_CXX11_UNICODE_LITERALS -# endif - -# if(__has_feature(cxx_unrestricted_unions)) -# define GLM_CXX11_UNRESTRICTED_UNIONS -# endif - -# if(__has_feature(cxx_user_literals)) -# define GLM_CXX11_USER_LITERALS -# endif - -# if(__has_feature(cxx_variadic_templates)) -# define GLM_CXX11_VARIADIC_TEMPLATES -# endif - -#endif//(GLM_COMPILER & GLM_COMPILER_CLANG) diff --git a/3rdparty/glm/source/glm/detail/_fixes.hpp b/3rdparty/glm/source/glm/detail/_fixes.hpp deleted file mode 100644 index a503c7c..0000000 --- a/3rdparty/glm/source/glm/detail/_fixes.hpp +++ /dev/null @@ -1,27 +0,0 @@ -#include - -//! Workaround for compatibility with other libraries -#ifdef max -#undef max -#endif - -//! Workaround for compatibility with other libraries -#ifdef min -#undef min -#endif - -//! Workaround for Android -#ifdef isnan -#undef isnan -#endif - -//! Workaround for Android -#ifdef isinf -#undef isinf -#endif - -//! Workaround for Chrone Native Client -#ifdef log2 -#undef log2 -#endif - diff --git a/3rdparty/glm/source/glm/detail/_noise.hpp b/3rdparty/glm/source/glm/detail/_noise.hpp deleted file mode 100644 index 5a874a0..0000000 --- a/3rdparty/glm/source/glm/detail/_noise.hpp +++ /dev/null @@ -1,81 +0,0 @@ -#pragma once - -#include "../common.hpp" - -namespace glm{ -namespace detail -{ - template - GLM_FUNC_QUALIFIER T mod289(T const& x) - { - return x - floor(x * (static_cast(1.0) / static_cast(289.0))) * static_cast(289.0); - } - - template - GLM_FUNC_QUALIFIER T permute(T const& x) - { - return mod289(((x * static_cast(34)) + static_cast(1)) * x); - } - - template - GLM_FUNC_QUALIFIER vec<2, T, Q> permute(vec<2, T, Q> const& x) - { - return mod289(((x * static_cast(34)) + static_cast(1)) * x); - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> permute(vec<3, T, Q> const& x) - { - return mod289(((x * static_cast(34)) + static_cast(1)) * x); - } - - template - GLM_FUNC_QUALIFIER vec<4, T, Q> permute(vec<4, T, Q> const& x) - { - return mod289(((x * static_cast(34)) + static_cast(1)) * x); - } - - template - GLM_FUNC_QUALIFIER T taylorInvSqrt(T const& r) - { - return static_cast(1.79284291400159) - static_cast(0.85373472095314) * r; - } - - template - GLM_FUNC_QUALIFIER vec<2, T, Q> taylorInvSqrt(vec<2, T, Q> const& r) - { - return static_cast(1.79284291400159) - static_cast(0.85373472095314) * r; - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> taylorInvSqrt(vec<3, T, Q> const& r) - { - return static_cast(1.79284291400159) - static_cast(0.85373472095314) * r; - } - - template - GLM_FUNC_QUALIFIER vec<4, T, Q> taylorInvSqrt(vec<4, T, Q> const& r) - { - return static_cast(1.79284291400159) - static_cast(0.85373472095314) * r; - } - - template - GLM_FUNC_QUALIFIER vec<2, T, Q> fade(vec<2, T, Q> const& t) - { - return (t * t * t) * (t * (t * static_cast(6) - static_cast(15)) + static_cast(10)); - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> fade(vec<3, T, Q> const& t) - { - return (t * t * t) * (t * (t * static_cast(6) - static_cast(15)) + static_cast(10)); - } - - template - GLM_FUNC_QUALIFIER vec<4, T, Q> fade(vec<4, T, Q> const& t) - { - return (t * t * t) * (t * (t * static_cast(6) - static_cast(15)) + static_cast(10)); - } -}//namespace detail -}//namespace glm - diff --git a/3rdparty/glm/source/glm/detail/_swizzle.hpp b/3rdparty/glm/source/glm/detail/_swizzle.hpp deleted file mode 100644 index 87896ef..0000000 --- a/3rdparty/glm/source/glm/detail/_swizzle.hpp +++ /dev/null @@ -1,804 +0,0 @@ -#pragma once - -namespace glm{ -namespace detail -{ - // Internal class for implementing swizzle operators - template - struct _swizzle_base0 - { - protected: - GLM_FUNC_QUALIFIER T& elem(size_t i){ return (reinterpret_cast(_buffer))[i]; } - GLM_FUNC_QUALIFIER T const& elem(size_t i) const{ return (reinterpret_cast(_buffer))[i]; } - - // Use an opaque buffer to *ensure* the compiler doesn't call a constructor. - // The size 1 buffer is assumed to aligned to the actual members so that the - // elem() - char _buffer[1]; - }; - - template - struct _swizzle_base1 : public _swizzle_base0 - { - }; - - template - struct _swizzle_base1<2, T, Q, E0,E1,-1,-2, Aligned> : public _swizzle_base0 - { - GLM_FUNC_QUALIFIER vec<2, T, Q> operator ()() const { return vec<2, T, Q>(this->elem(E0), this->elem(E1)); } - }; - - template - struct _swizzle_base1<3, T, Q, E0,E1,E2,-1, Aligned> : public _swizzle_base0 - { - GLM_FUNC_QUALIFIER vec<3, T, Q> operator ()() const { return vec<3, T, Q>(this->elem(E0), this->elem(E1), this->elem(E2)); } - }; - - template - struct _swizzle_base1<4, T, Q, E0,E1,E2,E3, Aligned> : public _swizzle_base0 - { - GLM_FUNC_QUALIFIER vec<4, T, Q> operator ()() const { return vec<4, T, Q>(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); } - }; - - // Internal class for implementing swizzle operators - /* - Template parameters: - - T = type of scalar values (e.g. float, double) - N = number of components in the vector (e.g. 3) - E0...3 = what index the n-th element of this swizzle refers to in the unswizzled vec - - DUPLICATE_ELEMENTS = 1 if there is a repeated element, 0 otherwise (used to specialize swizzles - containing duplicate elements so that they cannot be used as r-values). - */ - template - struct _swizzle_base2 : public _swizzle_base1::value> - { - struct op_equal - { - GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e = t; } - }; - - struct op_minus - { - GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e -= t; } - }; - - struct op_plus - { - GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e += t; } - }; - - struct op_mul - { - GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e *= t; } - }; - - struct op_div - { - GLM_FUNC_QUALIFIER void operator() (T& e, T& t) const{ e /= t; } - }; - - public: - GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const T& t) - { - for (int i = 0; i < N; ++i) - (*this)[i] = t; - return *this; - } - - GLM_FUNC_QUALIFIER _swizzle_base2& operator= (vec const& that) - { - _apply_op(that, op_equal()); - return *this; - } - - GLM_FUNC_QUALIFIER void operator -= (vec const& that) - { - _apply_op(that, op_minus()); - } - - GLM_FUNC_QUALIFIER void operator += (vec const& that) - { - _apply_op(that, op_plus()); - } - - GLM_FUNC_QUALIFIER void operator *= (vec const& that) - { - _apply_op(that, op_mul()); - } - - GLM_FUNC_QUALIFIER void operator /= (vec const& that) - { - _apply_op(that, op_div()); - } - - GLM_FUNC_QUALIFIER T& operator[](size_t i) - { - const int offset_dst[4] = { E0, E1, E2, E3 }; - return this->elem(offset_dst[i]); - } - GLM_FUNC_QUALIFIER T operator[](size_t i) const - { - const int offset_dst[4] = { E0, E1, E2, E3 }; - return this->elem(offset_dst[i]); - } - - protected: - template - GLM_FUNC_QUALIFIER void _apply_op(vec const& that, const U& op) - { - // Make a copy of the data in this == &that. - // The copier should optimize out the copy in cases where the function is - // properly inlined and the copy is not necessary. - T t[N]; - for (int i = 0; i < N; ++i) - t[i] = that[i]; - for (int i = 0; i < N; ++i) - op( (*this)[i], t[i] ); - } - }; - - // Specialization for swizzles containing duplicate elements. These cannot be modified. - template - struct _swizzle_base2 : public _swizzle_base1::value> - { - struct Stub {}; - - GLM_FUNC_QUALIFIER _swizzle_base2& operator= (Stub const&) { return *this; } - - GLM_FUNC_QUALIFIER T operator[] (size_t i) const - { - const int offset_dst[4] = { E0, E1, E2, E3 }; - return this->elem(offset_dst[i]); - } - }; - - template - struct _swizzle : public _swizzle_base2 - { - typedef _swizzle_base2 base_type; - - using base_type::operator=; - - GLM_FUNC_QUALIFIER operator vec () const { return (*this)(); } - }; - -// -// To prevent the C++ syntax from getting entirely overwhelming, define some alias macros -// -#define GLM_SWIZZLE_TEMPLATE1 template -#define GLM_SWIZZLE_TEMPLATE2 template -#define GLM_SWIZZLE_TYPE1 _swizzle -#define GLM_SWIZZLE_TYPE2 _swizzle - -// -// Wrapper for a binary operator (e.g. u.yy + v.zy) -// -#define GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \ - GLM_SWIZZLE_TEMPLATE2 \ - GLM_FUNC_QUALIFIER vec operator OPERAND ( const GLM_SWIZZLE_TYPE1& a, const GLM_SWIZZLE_TYPE2& b) \ - { \ - return a() OPERAND b(); \ - } \ - GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER vec operator OPERAND ( const GLM_SWIZZLE_TYPE1& a, const vec& b) \ - { \ - return a() OPERAND b; \ - } \ - GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER vec operator OPERAND ( const vec& a, const GLM_SWIZZLE_TYPE1& b) \ - { \ - return a OPERAND b(); \ - } - -// -// Wrapper for a operand between a swizzle and a binary (e.g. 1.0f - u.xyz) -// -#define GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \ - GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER vec operator OPERAND ( const GLM_SWIZZLE_TYPE1& a, const T& b) \ - { \ - return a() OPERAND b; \ - } \ - GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER vec operator OPERAND ( const T& a, const GLM_SWIZZLE_TYPE1& b) \ - { \ - return a OPERAND b(); \ - } - -// -// Macro for wrapping a function taking one argument (e.g. abs()) -// -#define GLM_SWIZZLE_FUNCTION_1_ARGS(RETURN_TYPE,FUNCTION) \ - GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a) \ - { \ - return FUNCTION(a()); \ - } - -// -// Macro for wrapping a function taking two vector arguments (e.g. dot()). -// -#define GLM_SWIZZLE_FUNCTION_2_ARGS(RETURN_TYPE,FUNCTION) \ - GLM_SWIZZLE_TEMPLATE2 \ - GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const GLM_SWIZZLE_TYPE2& b) \ - { \ - return FUNCTION(a(), b()); \ - } \ - GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const GLM_SWIZZLE_TYPE1& b) \ - { \ - return FUNCTION(a(), b()); \ - } \ - GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const typename V& b) \ - { \ - return FUNCTION(a(), b); \ - } \ - GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const V& a, const GLM_SWIZZLE_TYPE1& b) \ - { \ - return FUNCTION(a, b()); \ - } - -// -// Macro for wrapping a function take 2 vec arguments followed by a scalar (e.g. mix()). -// -#define GLM_SWIZZLE_FUNCTION_2_ARGS_SCALAR(RETURN_TYPE,FUNCTION) \ - GLM_SWIZZLE_TEMPLATE2 \ - GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const GLM_SWIZZLE_TYPE2& b, const T& c) \ - { \ - return FUNCTION(a(), b(), c); \ - } \ - GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const GLM_SWIZZLE_TYPE1& b, const T& c) \ - { \ - return FUNCTION(a(), b(), c); \ - } \ - GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const GLM_SWIZZLE_TYPE1& a, const typename S0::vec_type& b, const T& c)\ - { \ - return FUNCTION(a(), b, c); \ - } \ - GLM_SWIZZLE_TEMPLATE1 \ - GLM_FUNC_QUALIFIER typename GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const typename V& a, const GLM_SWIZZLE_TYPE1& b, const T& c) \ - { \ - return FUNCTION(a, b(), c); \ - } - -}//namespace detail -}//namespace glm - -namespace glm -{ - namespace detail - { - GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(-) - GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(*) - GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(+) - GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(-) - GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(*) - GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(/) - } - - // - // Swizzles are distinct types from the unswizzled type. The below macros will - // provide template specializations for the swizzle types for the given functions - // so that the compiler does not have any ambiguity to choosing how to handle - // the function. - // - // The alternative is to use the operator()() when calling the function in order - // to explicitly convert the swizzled type to the unswizzled type. - // - - //GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, abs); - //GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, acos); - //GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, acosh); - //GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, all); - //GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, any); - - //GLM_SWIZZLE_FUNCTION_2_ARGS(value_type, dot); - //GLM_SWIZZLE_FUNCTION_2_ARGS(vec_type, cross); - //GLM_SWIZZLE_FUNCTION_2_ARGS(vec_type, step); - //GLM_SWIZZLE_FUNCTION_2_ARGS_SCALAR(vec_type, mix); -} - -#define GLM_SWIZZLE2_2_MEMBERS(T, Q, E0,E1) \ - struct { detail::_swizzle<2, T, Q, 0,0,-1,-2> E0 ## E0; }; \ - struct { detail::_swizzle<2, T, Q, 0,1,-1,-2> E0 ## E1; }; \ - struct { detail::_swizzle<2, T, Q, 1,0,-1,-2> E1 ## E0; }; \ - struct { detail::_swizzle<2, T, Q, 1,1,-1,-2> E1 ## E1; }; - -#define GLM_SWIZZLE2_3_MEMBERS(T, Q, E0,E1) \ - struct { detail::_swizzle<3,T, Q, 0,0,0,-1> E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<3,T, Q, 0,0,1,-1> E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<3,T, Q, 0,1,0,-1> E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<3,T, Q, 0,1,1,-1> E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<3,T, Q, 1,0,0,-1> E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<3,T, Q, 1,0,1,-1> E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<3,T, Q, 1,1,0,-1> E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<3,T, Q, 1,1,1,-1> E1 ## E1 ## E1; }; - -#define GLM_SWIZZLE2_4_MEMBERS(T, Q, E0,E1) \ - struct { detail::_swizzle<4,T, Q, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; - -#define GLM_SWIZZLE3_2_MEMBERS(T, Q, E0,E1,E2) \ - struct { detail::_swizzle<2,T, Q, 0,0,-1,-2> E0 ## E0; }; \ - struct { detail::_swizzle<2,T, Q, 0,1,-1,-2> E0 ## E1; }; \ - struct { detail::_swizzle<2,T, Q, 0,2,-1,-2> E0 ## E2; }; \ - struct { detail::_swizzle<2,T, Q, 1,0,-1,-2> E1 ## E0; }; \ - struct { detail::_swizzle<2,T, Q, 1,1,-1,-2> E1 ## E1; }; \ - struct { detail::_swizzle<2,T, Q, 1,2,-1,-2> E1 ## E2; }; \ - struct { detail::_swizzle<2,T, Q, 2,0,-1,-2> E2 ## E0; }; \ - struct { detail::_swizzle<2,T, Q, 2,1,-1,-2> E2 ## E1; }; \ - struct { detail::_swizzle<2,T, Q, 2,2,-1,-2> E2 ## E2; }; - -#define GLM_SWIZZLE3_3_MEMBERS(T, Q ,E0,E1,E2) \ - struct { detail::_swizzle<3, T, Q, 0,0,0,-1> E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 0,0,1,-1> E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 0,0,2,-1> E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 0,1,0,-1> E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 0,1,1,-1> E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 0,1,2,-1> E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 0,2,0,-1> E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 0,2,1,-1> E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 0,2,2,-1> E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 1,0,0,-1> E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 1,0,1,-1> E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 1,0,2,-1> E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 1,1,0,-1> E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 1,1,1,-1> E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 1,1,2,-1> E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 1,2,0,-1> E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 1,2,1,-1> E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 1,2,2,-1> E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 2,0,0,-1> E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 2,0,1,-1> E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 2,0,2,-1> E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 2,1,0,-1> E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 2,1,1,-1> E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 2,1,2,-1> E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 2,2,0,-1> E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 2,2,1,-1> E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 2,2,2,-1> E2 ## E2 ## E2; }; - -#define GLM_SWIZZLE3_4_MEMBERS(T, Q, E0,E1,E2) \ - struct { detail::_swizzle<4,T, Q, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4,T, Q, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4,T, Q, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4,T, Q, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; - -#define GLM_SWIZZLE4_2_MEMBERS(T, Q, E0,E1,E2,E3) \ - struct { detail::_swizzle<2,T, Q, 0,0,-1,-2> E0 ## E0; }; \ - struct { detail::_swizzle<2,T, Q, 0,1,-1,-2> E0 ## E1; }; \ - struct { detail::_swizzle<2,T, Q, 0,2,-1,-2> E0 ## E2; }; \ - struct { detail::_swizzle<2,T, Q, 0,3,-1,-2> E0 ## E3; }; \ - struct { detail::_swizzle<2,T, Q, 1,0,-1,-2> E1 ## E0; }; \ - struct { detail::_swizzle<2,T, Q, 1,1,-1,-2> E1 ## E1; }; \ - struct { detail::_swizzle<2,T, Q, 1,2,-1,-2> E1 ## E2; }; \ - struct { detail::_swizzle<2,T, Q, 1,3,-1,-2> E1 ## E3; }; \ - struct { detail::_swizzle<2,T, Q, 2,0,-1,-2> E2 ## E0; }; \ - struct { detail::_swizzle<2,T, Q, 2,1,-1,-2> E2 ## E1; }; \ - struct { detail::_swizzle<2,T, Q, 2,2,-1,-2> E2 ## E2; }; \ - struct { detail::_swizzle<2,T, Q, 2,3,-1,-2> E2 ## E3; }; \ - struct { detail::_swizzle<2,T, Q, 3,0,-1,-2> E3 ## E0; }; \ - struct { detail::_swizzle<2,T, Q, 3,1,-1,-2> E3 ## E1; }; \ - struct { detail::_swizzle<2,T, Q, 3,2,-1,-2> E3 ## E2; }; \ - struct { detail::_swizzle<2,T, Q, 3,3,-1,-2> E3 ## E3; }; - -#define GLM_SWIZZLE4_3_MEMBERS(T, Q, E0,E1,E2,E3) \ - struct { detail::_swizzle<3, T, Q, 0,0,0,-1> E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 0,0,1,-1> E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 0,0,2,-1> E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 0,0,3,-1> E0 ## E0 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 0,1,0,-1> E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 0,1,1,-1> E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 0,1,2,-1> E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 0,1,3,-1> E0 ## E1 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 0,2,0,-1> E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 0,2,1,-1> E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 0,2,2,-1> E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 0,2,3,-1> E0 ## E2 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 0,3,0,-1> E0 ## E3 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 0,3,1,-1> E0 ## E3 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 0,3,2,-1> E0 ## E3 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 0,3,3,-1> E0 ## E3 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 1,0,0,-1> E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 1,0,1,-1> E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 1,0,2,-1> E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 1,0,3,-1> E1 ## E0 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 1,1,0,-1> E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 1,1,1,-1> E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 1,1,2,-1> E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 1,1,3,-1> E1 ## E1 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 1,2,0,-1> E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 1,2,1,-1> E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 1,2,2,-1> E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 1,2,3,-1> E1 ## E2 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 1,3,0,-1> E1 ## E3 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 1,3,1,-1> E1 ## E3 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 1,3,2,-1> E1 ## E3 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 1,3,3,-1> E1 ## E3 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 2,0,0,-1> E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 2,0,1,-1> E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 2,0,2,-1> E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 2,0,3,-1> E2 ## E0 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 2,1,0,-1> E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 2,1,1,-1> E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 2,1,2,-1> E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 2,1,3,-1> E2 ## E1 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 2,2,0,-1> E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 2,2,1,-1> E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 2,2,2,-1> E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 2,2,3,-1> E2 ## E2 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 2,3,0,-1> E2 ## E3 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 2,3,1,-1> E2 ## E3 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 2,3,2,-1> E2 ## E3 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 2,3,3,-1> E2 ## E3 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 3,0,0,-1> E3 ## E0 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 3,0,1,-1> E3 ## E0 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 3,0,2,-1> E3 ## E0 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 3,0,3,-1> E3 ## E0 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 3,1,0,-1> E3 ## E1 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 3,1,1,-1> E3 ## E1 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 3,1,2,-1> E3 ## E1 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 3,1,3,-1> E3 ## E1 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 3,2,0,-1> E3 ## E2 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 3,2,1,-1> E3 ## E2 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 3,2,2,-1> E3 ## E2 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 3,2,3,-1> E3 ## E2 ## E3; }; \ - struct { detail::_swizzle<3, T, Q, 3,3,0,-1> E3 ## E3 ## E0; }; \ - struct { detail::_swizzle<3, T, Q, 3,3,1,-1> E3 ## E3 ## E1; }; \ - struct { detail::_swizzle<3, T, Q, 3,3,2,-1> E3 ## E3 ## E2; }; \ - struct { detail::_swizzle<3, T, Q, 3,3,3,-1> E3 ## E3 ## E3; }; - -#define GLM_SWIZZLE4_4_MEMBERS(T, Q, E0,E1,E2,E3) \ - struct { detail::_swizzle<4, T, Q, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,0,3> E0 ## E0 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,1,3> E0 ## E0 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,2,3> E0 ## E0 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,3,0> E0 ## E0 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,3,1> E0 ## E0 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,3,2> E0 ## E0 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,0,3,3> E0 ## E0 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,0,3> E0 ## E1 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,1,3> E0 ## E1 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,2,3> E0 ## E1 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,3,0> E0 ## E1 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,3,1> E0 ## E1 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,3,2> E0 ## E1 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,1,3,3> E0 ## E1 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,0,3> E0 ## E2 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,1,3> E0 ## E2 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,2,3> E0 ## E2 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,3,0> E0 ## E2 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,3,1> E0 ## E2 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,3,2> E0 ## E2 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,2,3,3> E0 ## E2 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,0,0> E0 ## E3 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,0,1> E0 ## E3 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,0,2> E0 ## E3 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,0,3> E0 ## E3 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,1,0> E0 ## E3 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,1,1> E0 ## E3 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,1,2> E0 ## E3 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,1,3> E0 ## E3 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,2,0> E0 ## E3 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,2,1> E0 ## E3 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,2,2> E0 ## E3 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,2,3> E0 ## E3 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,3,0> E0 ## E3 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,3,1> E0 ## E3 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,3,2> E0 ## E3 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 0,3,3,3> E0 ## E3 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,0,3> E1 ## E0 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,1,3> E1 ## E0 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,2,3> E1 ## E0 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,3,0> E1 ## E0 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,3,1> E1 ## E0 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,3,2> E1 ## E0 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,0,3,3> E1 ## E0 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,0,3> E1 ## E1 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,1,3> E1 ## E1 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,2,3> E1 ## E1 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,3,0> E1 ## E1 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,3,1> E1 ## E1 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,3,2> E1 ## E1 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,1,3,3> E1 ## E1 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,0,3> E1 ## E2 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,1,3> E1 ## E2 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,2,3> E1 ## E2 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,3,0> E1 ## E2 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,3,1> E1 ## E2 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,3,2> E1 ## E2 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,2,3,3> E1 ## E2 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,0,0> E1 ## E3 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,0,1> E1 ## E3 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,0,2> E1 ## E3 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,0,3> E1 ## E3 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,1,0> E1 ## E3 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,1,1> E1 ## E3 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,1,2> E1 ## E3 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,1,3> E1 ## E3 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,2,0> E1 ## E3 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,2,1> E1 ## E3 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,2,2> E1 ## E3 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,2,3> E1 ## E3 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,3,0> E1 ## E3 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,3,1> E1 ## E3 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,3,2> E1 ## E3 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 1,3,3,3> E1 ## E3 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,0,3> E2 ## E0 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,1,3> E2 ## E0 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,2,3> E2 ## E0 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,3,0> E2 ## E0 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,3,1> E2 ## E0 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,3,2> E2 ## E0 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,0,3,3> E2 ## E0 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,0,3> E2 ## E1 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,1,3> E2 ## E1 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,2,3> E2 ## E1 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,3,0> E2 ## E1 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,3,1> E2 ## E1 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,3,2> E2 ## E1 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,1,3,3> E2 ## E1 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,0,3> E2 ## E2 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,1,3> E2 ## E2 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,2,3> E2 ## E2 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,3,0> E2 ## E2 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,3,1> E2 ## E2 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,3,2> E2 ## E2 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,2,3,3> E2 ## E2 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,0,0> E2 ## E3 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,0,1> E2 ## E3 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,0,2> E2 ## E3 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,0,3> E2 ## E3 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,1,0> E2 ## E3 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,1,1> E2 ## E3 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,1,2> E2 ## E3 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,1,3> E2 ## E3 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,2,0> E2 ## E3 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,2,1> E2 ## E3 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,2,2> E2 ## E3 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,2,3> E2 ## E3 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,3,0> E2 ## E3 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,3,1> E2 ## E3 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,3,2> E2 ## E3 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 2,3,3,3> E2 ## E3 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,0,0> E3 ## E0 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,0,1> E3 ## E0 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,0,2> E3 ## E0 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,0,3> E3 ## E0 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,1,0> E3 ## E0 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,1,1> E3 ## E0 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,1,2> E3 ## E0 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,1,3> E3 ## E0 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,2,0> E3 ## E0 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,2,1> E3 ## E0 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,2,2> E3 ## E0 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,2,3> E3 ## E0 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,3,0> E3 ## E0 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,3,1> E3 ## E0 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,3,2> E3 ## E0 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,0,3,3> E3 ## E0 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,0,0> E3 ## E1 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,0,1> E3 ## E1 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,0,2> E3 ## E1 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,0,3> E3 ## E1 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,1,0> E3 ## E1 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,1,1> E3 ## E1 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,1,2> E3 ## E1 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,1,3> E3 ## E1 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,2,0> E3 ## E1 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,2,1> E3 ## E1 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,2,2> E3 ## E1 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,2,3> E3 ## E1 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,3,0> E3 ## E1 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,3,1> E3 ## E1 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,3,2> E3 ## E1 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,1,3,3> E3 ## E1 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,0,0> E3 ## E2 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,0,1> E3 ## E2 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,0,2> E3 ## E2 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,0,3> E3 ## E2 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,1,0> E3 ## E2 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,1,1> E3 ## E2 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,1,2> E3 ## E2 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,1,3> E3 ## E2 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,2,0> E3 ## E2 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,2,1> E3 ## E2 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,2,2> E3 ## E2 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,2,3> E3 ## E2 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,3,0> E3 ## E2 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,3,1> E3 ## E2 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,3,2> E3 ## E2 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,2,3,3> E3 ## E2 ## E3 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,0,0> E3 ## E3 ## E0 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,0,1> E3 ## E3 ## E0 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,0,2> E3 ## E3 ## E0 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,0,3> E3 ## E3 ## E0 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,1,0> E3 ## E3 ## E1 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,1,1> E3 ## E3 ## E1 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,1,2> E3 ## E3 ## E1 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,1,3> E3 ## E3 ## E1 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,2,0> E3 ## E3 ## E2 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,2,1> E3 ## E3 ## E2 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,2,2> E3 ## E3 ## E2 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,2,3> E3 ## E3 ## E2 ## E3; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,3,0> E3 ## E3 ## E3 ## E0; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,3,1> E3 ## E3 ## E3 ## E1; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,3,2> E3 ## E3 ## E3 ## E2; }; \ - struct { detail::_swizzle<4, T, Q, 3,3,3,3> E3 ## E3 ## E3 ## E3; }; diff --git a/3rdparty/glm/source/glm/detail/_swizzle_func.hpp b/3rdparty/glm/source/glm/detail/_swizzle_func.hpp deleted file mode 100644 index d93c6af..0000000 --- a/3rdparty/glm/source/glm/detail/_swizzle_func.hpp +++ /dev/null @@ -1,682 +0,0 @@ -#pragma once - -#define GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, CONST, A, B) \ - vec<2, T, Q> A ## B() CONST \ - { \ - return vec<2, T, Q>(this->A, this->B); \ - } - -#define GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, CONST, A, B, C) \ - vec<3, T, Q> A ## B ## C() CONST \ - { \ - return vec<3, T, Q>(this->A, this->B, this->C); \ - } - -#define GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, CONST, A, B, C, D) \ - vec<4, T, Q> A ## B ## C ## D() CONST \ - { \ - return vec<4, T, Q>(this->A, this->B, this->C, this->D); \ - } - -#define GLM_SWIZZLE_GEN_VEC2_ENTRY_DEF(T, P, L, CONST, A, B) \ - template \ - vec vec::A ## B() CONST \ - { \ - return vec<2, T, Q>(this->A, this->B); \ - } - -#define GLM_SWIZZLE_GEN_VEC3_ENTRY_DEF(T, P, L, CONST, A, B, C) \ - template \ - vec<3, T, Q> vec::A ## B ## C() CONST \ - { \ - return vec<3, T, Q>(this->A, this->B, this->C); \ - } - -#define GLM_SWIZZLE_GEN_VEC4_ENTRY_DEF(T, P, L, CONST, A, B, C, D) \ - template \ - vec<4, T, Q> vec::A ## B ## C ## D() CONST \ - { \ - return vec<4, T, Q>(this->A, this->B, this->C, this->D); \ - } - -#define GLM_MUTABLE - -#define GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(T, P, A, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, 2, GLM_MUTABLE, A, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, 2, GLM_MUTABLE, B, A) - -#define GLM_SWIZZLE_GEN_REF_FROM_VEC2(T, P) \ - GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(T, P, x, y) \ - GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(T, P, r, g) \ - GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(T, P, s, t) - -#define GLM_SWIZZLE_GEN_REF2_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, A, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, A, C) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, B, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, B, C) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, C, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, C, B) - -#define GLM_SWIZZLE_GEN_REF3_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, GLM_MUTABLE, A, B, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, GLM_MUTABLE, A, C, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, GLM_MUTABLE, B, A, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, GLM_MUTABLE, B, C, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, GLM_MUTABLE, C, A, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, GLM_MUTABLE, C, B, A) - -#define GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(T, P, A, B, C) \ - GLM_SWIZZLE_GEN_REF3_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ - GLM_SWIZZLE_GEN_REF2_FROM_VEC3_SWIZZLE(T, P, A, B, C) - -#define GLM_SWIZZLE_GEN_REF_FROM_VEC3(T, P) \ - GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(T, P, x, y, z) \ - GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(T, P, r, g, b) \ - GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(T, P, s, t, p) - -#define GLM_SWIZZLE_GEN_REF2_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, A, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, A, C) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, A, D) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, B, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, B, C) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, B, D) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, C, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, C, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, C, D) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, D, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, D, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, GLM_MUTABLE, D, C) - -#define GLM_SWIZZLE_GEN_REF3_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , A, B, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , A, B, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , A, C, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , A, C, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , A, D, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , A, D, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , B, A, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , B, A, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , B, C, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , B, C, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , B, D, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , B, D, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , C, A, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , C, A, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , C, B, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , C, B, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , C, D, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , C, D, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , D, A, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , D, A, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , D, B, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , D, B, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , D, C, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, , D, C, B) - -#define GLM_SWIZZLE_GEN_REF4_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , A, C, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , A, C, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , A, D, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , A, D, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , A, B, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , A, B, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , B, C, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , B, C, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , B, D, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , B, D, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , B, A, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , B, A, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , C, B, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , C, B, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , C, D, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , C, D, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , C, A, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , C, A, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , D, C, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , D, C, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , D, A, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , D, A, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , D, B, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, , D, B, C, A) - -#define GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(T, P, A, B, C, D) \ - GLM_SWIZZLE_GEN_REF2_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ - GLM_SWIZZLE_GEN_REF3_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ - GLM_SWIZZLE_GEN_REF4_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) - -#define GLM_SWIZZLE_GEN_REF_FROM_VEC4(T, P) \ - GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(T, P, x, y, z, w) \ - GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(T, P, r, g, b, a) \ - GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(T, P, s, t, p, q) - -#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC2_SWIZZLE(T, P, A, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, B) - -#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC2_SWIZZLE(T, P, A, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, B) - -#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC2_SWIZZLE(T, P, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, B) - -#define GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(T, P, A, B) \ - GLM_SWIZZLE_GEN_VEC2_FROM_VEC2_SWIZZLE(T, P, A, B) \ - GLM_SWIZZLE_GEN_VEC3_FROM_VEC2_SWIZZLE(T, P, A, B) \ - GLM_SWIZZLE_GEN_VEC4_FROM_VEC2_SWIZZLE(T, P, A, B) - -#define GLM_SWIZZLE_GEN_VEC_FROM_VEC2(T, P) \ - GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(T, P, x, y) \ - GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(T, P, r, g) \ - GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(T, P, s, t) - -#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, C) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, C) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, C) - -#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, C) - -#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, C) - -#define GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(T, P, A, B, C) \ - GLM_SWIZZLE_GEN_VEC2_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ - GLM_SWIZZLE_GEN_VEC3_FROM_VEC3_SWIZZLE(T, P, A, B, C) \ - GLM_SWIZZLE_GEN_VEC4_FROM_VEC3_SWIZZLE(T, P, A, B, C) - -#define GLM_SWIZZLE_GEN_VEC_FROM_VEC3(T, P) \ - GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(T, P, x, y, z) \ - GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(T, P, r, g, b) \ - GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(T, P, s, t, p) - -#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, C) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, A, D) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, C) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, B, D) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, C) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, C, D) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, D, A) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, D, B) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, D, C) \ - GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, const, D, D) - -#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, A, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, B, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, C, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, D, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, D, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, D, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, A, D, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, A, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, B, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, C, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, D, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, D, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, D, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, B, D, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, A, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, B, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, C, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, D, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, D, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, D, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, C, D, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, A, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, A, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, A, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, A, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, B, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, B, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, B, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, B, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, C, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, C, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, C, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, C, D) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, D, A) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, D, B) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, D, C) \ - GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, const, D, D, D) - -#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, A, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, B, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, C, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, A, D, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, A, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, B, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, C, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, B, D, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, A, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, B, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, C, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, C, D, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, A, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, B, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, C, D, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, A, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, A, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, A, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, A, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, B, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, B, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, B, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, B, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, C, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, C, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, C, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, C, D) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, D, A) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, D, B) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, D, C) \ - GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, const, D, D, D, D) - -#define GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(T, P, A, B, C, D) \ - GLM_SWIZZLE_GEN_VEC2_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ - GLM_SWIZZLE_GEN_VEC3_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) \ - GLM_SWIZZLE_GEN_VEC4_FROM_VEC4_SWIZZLE(T, P, A, B, C, D) - -#define GLM_SWIZZLE_GEN_VEC_FROM_VEC4(T, P) \ - GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(T, P, x, y, z, w) \ - GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(T, P, r, g, b, a) \ - GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(T, P, s, t, p, q) - diff --git a/3rdparty/glm/source/glm/detail/_vectorize.hpp b/3rdparty/glm/source/glm/detail/_vectorize.hpp deleted file mode 100644 index 1fcaec3..0000000 --- a/3rdparty/glm/source/glm/detail/_vectorize.hpp +++ /dev/null @@ -1,162 +0,0 @@ -#pragma once - -namespace glm{ -namespace detail -{ - template class vec, length_t L, typename R, typename T, qualifier Q> - struct functor1{}; - - template class vec, typename R, typename T, qualifier Q> - struct functor1 - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<1, R, Q> call(R (*Func) (T x), vec<1, T, Q> const& v) - { - return vec<1, R, Q>(Func(v.x)); - } - }; - - template class vec, typename R, typename T, qualifier Q> - struct functor1 - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<2, R, Q> call(R (*Func) (T x), vec<2, T, Q> const& v) - { - return vec<2, R, Q>(Func(v.x), Func(v.y)); - } - }; - - template class vec, typename R, typename T, qualifier Q> - struct functor1 - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<3, R, Q> call(R (*Func) (T x), vec<3, T, Q> const& v) - { - return vec<3, R, Q>(Func(v.x), Func(v.y), Func(v.z)); - } - }; - - template class vec, typename R, typename T, qualifier Q> - struct functor1 - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, R, Q> call(R (*Func) (T x), vec<4, T, Q> const& v) - { - return vec<4, R, Q>(Func(v.x), Func(v.y), Func(v.z), Func(v.w)); - } - }; - - template class vec, length_t L, typename T, qualifier Q> - struct functor2{}; - - template class vec, typename T, qualifier Q> - struct functor2 - { - GLM_FUNC_QUALIFIER static vec<1, T, Q> call(T (*Func) (T x, T y), vec<1, T, Q> const& a, vec<1, T, Q> const& b) - { - return vec<1, T, Q>(Func(a.x, b.x)); - } - }; - - template class vec, typename T, qualifier Q> - struct functor2 - { - GLM_FUNC_QUALIFIER static vec<2, T, Q> call(T (*Func) (T x, T y), vec<2, T, Q> const& a, vec<2, T, Q> const& b) - { - return vec<2, T, Q>(Func(a.x, b.x), Func(a.y, b.y)); - } - }; - - template class vec, typename T, qualifier Q> - struct functor2 - { - GLM_FUNC_QUALIFIER static vec<3, T, Q> call(T (*Func) (T x, T y), vec<3, T, Q> const& a, vec<3, T, Q> const& b) - { - return vec<3, T, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z)); - } - }; - - template class vec, typename T, qualifier Q> - struct functor2 - { - GLM_FUNC_QUALIFIER static vec<4, T, Q> call(T (*Func) (T x, T y), vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - return vec<4, T, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w)); - } - }; - - template class vec, length_t L, typename T, qualifier Q> - struct functor2_vec_sca{}; - - template class vec, typename T, qualifier Q> - struct functor2_vec_sca - { - GLM_FUNC_QUALIFIER static vec<1, T, Q> call(T (*Func) (T x, T y), vec<1, T, Q> const& a, T b) - { - return vec<1, T, Q>(Func(a.x, b)); - } - }; - - template class vec, typename T, qualifier Q> - struct functor2_vec_sca - { - GLM_FUNC_QUALIFIER static vec<2, T, Q> call(T (*Func) (T x, T y), vec<2, T, Q> const& a, T b) - { - return vec<2, T, Q>(Func(a.x, b), Func(a.y, b)); - } - }; - - template class vec, typename T, qualifier Q> - struct functor2_vec_sca - { - GLM_FUNC_QUALIFIER static vec<3, T, Q> call(T (*Func) (T x, T y), vec<3, T, Q> const& a, T b) - { - return vec<3, T, Q>(Func(a.x, b), Func(a.y, b), Func(a.z, b)); - } - }; - - template class vec, typename T, qualifier Q> - struct functor2_vec_sca - { - GLM_FUNC_QUALIFIER static vec<4, T, Q> call(T (*Func) (T x, T y), vec<4, T, Q> const& a, T b) - { - return vec<4, T, Q>(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b)); - } - }; - - template - struct functor2_vec_int {}; - - template - struct functor2_vec_int<1, T, Q> - { - GLM_FUNC_QUALIFIER static vec<1, int, Q> call(int (*Func) (T x, int y), vec<1, T, Q> const& a, vec<1, int, Q> const& b) - { - return vec<1, int, Q>(Func(a.x, b.x)); - } - }; - - template - struct functor2_vec_int<2, T, Q> - { - GLM_FUNC_QUALIFIER static vec<2, int, Q> call(int (*Func) (T x, int y), vec<2, T, Q> const& a, vec<2, int, Q> const& b) - { - return vec<2, int, Q>(Func(a.x, b.x), Func(a.y, b.y)); - } - }; - - template - struct functor2_vec_int<3, T, Q> - { - GLM_FUNC_QUALIFIER static vec<3, int, Q> call(int (*Func) (T x, int y), vec<3, T, Q> const& a, vec<3, int, Q> const& b) - { - return vec<3, int, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z)); - } - }; - - template - struct functor2_vec_int<4, T, Q> - { - GLM_FUNC_QUALIFIER static vec<4, int, Q> call(int (*Func) (T x, int y), vec<4, T, Q> const& a, vec<4, int, Q> const& b) - { - return vec<4, int, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w)); - } - }; -}//namespace detail -}//namespace glm diff --git a/3rdparty/glm/source/glm/detail/compute_common.hpp b/3rdparty/glm/source/glm/detail/compute_common.hpp deleted file mode 100644 index 7267a49..0000000 --- a/3rdparty/glm/source/glm/detail/compute_common.hpp +++ /dev/null @@ -1,50 +0,0 @@ -#pragma once - -#include "setup.hpp" -#include - -namespace glm{ -namespace detail -{ - template - struct compute_abs - {}; - - template - struct compute_abs - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genFIType call(genFIType x) - { - GLM_STATIC_ASSERT( - std::numeric_limits::is_iec559 || std::numeric_limits::is_signed, - "'abs' only accept floating-point and integer scalar or vector inputs"); - - return x >= genFIType(0) ? x : -x; - // TODO, perf comp with: *(((int *) &x) + 1) &= 0x7fffffff; - } - }; - -#if (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP) - template<> - struct compute_abs - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static float call(float x) - { - return fabsf(x); - } - }; -#endif - - template - struct compute_abs - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genFIType call(genFIType x) - { - GLM_STATIC_ASSERT( - (!std::numeric_limits::is_signed && std::numeric_limits::is_integer), - "'abs' only accept floating-point and integer scalar or vector inputs"); - return x; - } - }; -}//namespace detail -}//namespace glm diff --git a/3rdparty/glm/source/glm/detail/compute_vector_relational.hpp b/3rdparty/glm/source/glm/detail/compute_vector_relational.hpp deleted file mode 100644 index 167b634..0000000 --- a/3rdparty/glm/source/glm/detail/compute_vector_relational.hpp +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once - -//#include "compute_common.hpp" -#include "setup.hpp" -#include - -namespace glm{ -namespace detail -{ - template - struct compute_equal - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(T a, T b) - { - return a == b; - } - }; -/* - template - struct compute_equal - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(T a, T b) - { - return detail::compute_abs::is_signed>::call(b - a) <= static_cast(0); - //return std::memcmp(&a, &b, sizeof(T)) == 0; - } - }; -*/ -}//namespace detail -}//namespace glm diff --git a/3rdparty/glm/source/glm/detail/func_common.inl b/3rdparty/glm/source/glm/detail/func_common.inl deleted file mode 100644 index 86560be..0000000 --- a/3rdparty/glm/source/glm/detail/func_common.inl +++ /dev/null @@ -1,792 +0,0 @@ -/// @ref core -/// @file glm/detail/func_common.inl - -#include "../vector_relational.hpp" -#include "compute_common.hpp" -#include "type_vec1.hpp" -#include "type_vec2.hpp" -#include "type_vec3.hpp" -#include "type_vec4.hpp" -#include "_vectorize.hpp" -#include - -namespace glm -{ - // min - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType min(genType x, genType y) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'min' only accept floating-point or integer inputs"); - return (y < x) ? y : x; - } - - // max - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType max(genType x, genType y) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'max' only accept floating-point or integer inputs"); - - return (x < y) ? y : x; - } - - // abs - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR int abs(int x) - { - int const y = x >> (sizeof(int) * 8 - 1); - return (x ^ y) - y; - } - - // round -# if GLM_HAS_CXX11_STL - using ::std::round; -# else - template - GLM_FUNC_QUALIFIER genType round(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'round' only accept floating-point inputs"); - - return x < static_cast(0) ? static_cast(int(x - static_cast(0.5))) : static_cast(int(x + static_cast(0.5))); - } -# endif - - // trunc -# if GLM_HAS_CXX11_STL - using ::std::trunc; -# else - template - GLM_FUNC_QUALIFIER genType trunc(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'trunc' only accept floating-point inputs"); - - return x < static_cast(0) ? -std::floor(-x) : std::floor(x); - } -# endif - -}//namespace glm - -namespace glm{ -namespace detail -{ - template - struct compute_abs_vector - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec call(vec const& x) - { - return detail::functor1::call(abs, x); - } - }; - - template - struct compute_mix_vector - { - GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, vec const& a) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); - - return vec(vec(x) * (static_cast(1) - a) + vec(y) * a); - } - }; - - template - struct compute_mix_vector - { - GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, vec const& a) - { - vec Result; - for(length_t i = 0; i < x.length(); ++i) - Result[i] = a[i] ? y[i] : x[i]; - return Result; - } - }; - - template - struct compute_mix_scalar - { - GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, U const& a) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); - - return vec(vec(x) * (static_cast(1) - a) + vec(y) * a); - } - }; - - template - struct compute_mix_scalar - { - GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y, bool const& a) - { - return a ? y : x; - } - }; - - template - struct compute_mix - { - GLM_FUNC_QUALIFIER static T call(T const& x, T const& y, U const& a) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); - - return static_cast(static_cast(x) * (static_cast(1) - a) + static_cast(y) * a); - } - }; - - template - struct compute_mix - { - GLM_FUNC_QUALIFIER static T call(T const& x, T const& y, bool const& a) - { - return a ? y : x; - } - }; - - template - struct compute_sign - { - GLM_FUNC_QUALIFIER static vec call(vec const& x) - { - return vec(glm::lessThan(vec(0), x)) - vec(glm::lessThan(x, vec(0))); - } - }; - -# if GLM_ARCH == GLM_ARCH_X86 - template - struct compute_sign - { - GLM_FUNC_QUALIFIER static vec call(vec const& x) - { - T const Shift(static_cast(sizeof(T) * 8 - 1)); - vec const y(vec::type, Q>(-x) >> typename detail::make_unsigned::type(Shift)); - - return (x >> Shift) | y; - } - }; -# endif - - template - struct compute_floor - { - GLM_FUNC_QUALIFIER static vec call(vec const& x) - { - return detail::functor1::call(std::floor, x); - } - }; - - template - struct compute_ceil - { - GLM_FUNC_QUALIFIER static vec call(vec const& x) - { - return detail::functor1::call(std::ceil, x); - } - }; - - template - struct compute_fract - { - GLM_FUNC_QUALIFIER static vec call(vec const& x) - { - return x - floor(x); - } - }; - - template - struct compute_trunc - { - GLM_FUNC_QUALIFIER static vec call(vec const& x) - { - return detail::functor1::call(trunc, x); - } - }; - - template - struct compute_round - { - GLM_FUNC_QUALIFIER static vec call(vec const& x) - { - return detail::functor1::call(round, x); - } - }; - - template - struct compute_mod - { - GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'mod' only accept floating-point inputs. Include for integer inputs."); - return a - b * floor(a / b); - } - }; - - template - struct compute_min_vector - { - GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y) - { - return detail::functor2::call(min, x, y); - } - }; - - template - struct compute_max_vector - { - GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& y) - { - return detail::functor2::call(max, x, y); - } - }; - - template - struct compute_clamp_vector - { - GLM_FUNC_QUALIFIER static vec call(vec const& x, vec const& minVal, vec const& maxVal) - { - return min(max(x, minVal), maxVal); - } - }; - - template - struct compute_step_vector - { - GLM_FUNC_QUALIFIER static vec call(vec const& edge, vec const& x) - { - return mix(vec(1), vec(0), glm::lessThan(x, edge)); - } - }; - - template - struct compute_smoothstep_vector - { - GLM_FUNC_QUALIFIER static vec call(vec const& edge0, vec const& edge1, vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'smoothstep' only accept floating-point inputs"); - vec const tmp(clamp((x - edge0) / (edge1 - edge0), static_cast(0), static_cast(1))); - return tmp * tmp * (static_cast(3) - static_cast(2) * tmp); - } - }; -}//namespace detail - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genFIType abs(genFIType x) - { - return detail::compute_abs::is_signed>::call(x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec abs(vec const& x) - { - return detail::compute_abs_vector::value>::call(x); - } - - // sign - // fast and works for any type - template - GLM_FUNC_QUALIFIER genFIType sign(genFIType x) - { - GLM_STATIC_ASSERT( - std::numeric_limits::is_iec559 || (std::numeric_limits::is_signed && std::numeric_limits::is_integer), - "'sign' only accept signed inputs"); - - return detail::compute_sign<1, genFIType, defaultp, - std::numeric_limits::is_iec559, detail::is_aligned::value>::call(vec<1, genFIType>(x)).x; - } - - template - GLM_FUNC_QUALIFIER vec sign(vec const& x) - { - GLM_STATIC_ASSERT( - std::numeric_limits::is_iec559 || (std::numeric_limits::is_signed && std::numeric_limits::is_integer), - "'sign' only accept signed inputs"); - - return detail::compute_sign::is_iec559, detail::is_aligned::value>::call(x); - } - - // floor - using ::std::floor; - template - GLM_FUNC_QUALIFIER vec floor(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'floor' only accept floating-point inputs."); - return detail::compute_floor::value>::call(x); - } - - template - GLM_FUNC_QUALIFIER vec trunc(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'trunc' only accept floating-point inputs"); - return detail::compute_trunc::value>::call(x); - } - - template - GLM_FUNC_QUALIFIER vec round(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'round' only accept floating-point inputs"); - return detail::compute_round::value>::call(x); - } - -/* - // roundEven - template - GLM_FUNC_QUALIFIER genType roundEven(genType const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'roundEven' only accept floating-point inputs"); - - return genType(int(x + genType(int(x) % 2))); - } -*/ - - // roundEven - template - GLM_FUNC_QUALIFIER genType roundEven(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'roundEven' only accept floating-point inputs"); - - int Integer = static_cast(x); - genType IntegerPart = static_cast(Integer); - genType FractionalPart = fract(x); - - if(FractionalPart > static_cast(0.5) || FractionalPart < static_cast(0.5)) - { - return round(x); - } - else if((Integer % 2) == 0) - { - return IntegerPart; - } - else if(x <= static_cast(0)) // Work around... - { - return IntegerPart - static_cast(1); - } - else - { - return IntegerPart + static_cast(1); - } - //else // Bug on MinGW 4.5.2 - //{ - // return mix(IntegerPart + genType(-1), IntegerPart + genType(1), x <= genType(0)); - //} - } - - template - GLM_FUNC_QUALIFIER vec roundEven(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'roundEven' only accept floating-point inputs"); - return detail::functor1::call(roundEven, x); - } - - // ceil - using ::std::ceil; - template - GLM_FUNC_QUALIFIER vec ceil(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'ceil' only accept floating-point inputs"); - return detail::compute_ceil::value>::call(x); - } - - // fract - template - GLM_FUNC_QUALIFIER genType fract(genType x) - { - return fract(vec<1, genType>(x)).x; - } - - template - GLM_FUNC_QUALIFIER vec fract(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fract' only accept floating-point inputs"); - return detail::compute_fract::value>::call(x); - } - - // mod - template - GLM_FUNC_QUALIFIER genType mod(genType x, genType y) - { -# if (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP) - // Another Cuda compiler bug https://github.com/g-truc/glm/issues/530 - vec<1, genType, defaultp> Result(mod(vec<1, genType, defaultp>(x), y)); - return Result.x; -# else - return mod(vec<1, genType, defaultp>(x), y).x; -# endif - } - - template - GLM_FUNC_QUALIFIER vec mod(vec const& x, T y) - { - return detail::compute_mod::value>::call(x, vec(y)); - } - - template - GLM_FUNC_QUALIFIER vec mod(vec const& x, vec const& y) - { - return detail::compute_mod::value>::call(x, y); - } - - // modf - template - GLM_FUNC_QUALIFIER genType modf(genType x, genType & i) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'modf' only accept floating-point inputs"); - return std::modf(x, &i); - } - - template - GLM_FUNC_QUALIFIER vec<1, T, Q> modf(vec<1, T, Q> const& x, vec<1, T, Q> & i) - { - return vec<1, T, Q>( - modf(x.x, i.x)); - } - - template - GLM_FUNC_QUALIFIER vec<2, T, Q> modf(vec<2, T, Q> const& x, vec<2, T, Q> & i) - { - return vec<2, T, Q>( - modf(x.x, i.x), - modf(x.y, i.y)); - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> modf(vec<3, T, Q> const& x, vec<3, T, Q> & i) - { - return vec<3, T, Q>( - modf(x.x, i.x), - modf(x.y, i.y), - modf(x.z, i.z)); - } - - template - GLM_FUNC_QUALIFIER vec<4, T, Q> modf(vec<4, T, Q> const& x, vec<4, T, Q> & i) - { - return vec<4, T, Q>( - modf(x.x, i.x), - modf(x.y, i.y), - modf(x.z, i.z), - modf(x.w, i.w)); - } - - //// Only valid if (INT_MIN <= x-y <= INT_MAX) - //// min(x,y) - //r = y + ((x - y) & ((x - y) >> (sizeof(int) * - //CHAR_BIT - 1))); - //// max(x,y) - //r = x - ((x - y) & ((x - y) >> (sizeof(int) * - //CHAR_BIT - 1))); - - // min - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec min(vec const& a, T b) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'min' only accept floating-point or integer inputs"); - return detail::compute_min_vector::value>::call(a, vec(b)); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec min(vec const& a, vec const& b) - { - return detail::compute_min_vector::value>::call(a, b); - } - - // max - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec max(vec const& a, T b) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'max' only accept floating-point or integer inputs"); - return detail::compute_max_vector::value>::call(a, vec(b)); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec max(vec const& a, vec const& b) - { - return detail::compute_max_vector::value>::call(a, b); - } - - // clamp - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType clamp(genType x, genType minVal, genType maxVal) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'clamp' only accept floating-point or integer inputs"); - return min(max(x, minVal), maxVal); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec clamp(vec const& x, T minVal, T maxVal) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'clamp' only accept floating-point or integer inputs"); - return detail::compute_clamp_vector::value>::call(x, vec(minVal), vec(maxVal)); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec clamp(vec const& x, vec const& minVal, vec const& maxVal) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'clamp' only accept floating-point or integer inputs"); - return detail::compute_clamp_vector::value>::call(x, minVal, maxVal); - } - - template - GLM_FUNC_QUALIFIER genTypeT mix(genTypeT x, genTypeT y, genTypeU a) - { - return detail::compute_mix::call(x, y, a); - } - - template - GLM_FUNC_QUALIFIER vec mix(vec const& x, vec const& y, U a) - { - return detail::compute_mix_scalar::value>::call(x, y, a); - } - - template - GLM_FUNC_QUALIFIER vec mix(vec const& x, vec const& y, vec const& a) - { - return detail::compute_mix_vector::value>::call(x, y, a); - } - - // step - template - GLM_FUNC_QUALIFIER genType step(genType edge, genType x) - { - return mix(static_cast(1), static_cast(0), x < edge); - } - - template - GLM_FUNC_QUALIFIER vec step(T edge, vec const& x) - { - return detail::compute_step_vector::value>::call(vec(edge), x); - } - - template - GLM_FUNC_QUALIFIER vec step(vec const& edge, vec const& x) - { - return detail::compute_step_vector::value>::call(edge, x); - } - - // smoothstep - template - GLM_FUNC_QUALIFIER genType smoothstep(genType edge0, genType edge1, genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'smoothstep' only accept floating-point inputs"); - - genType const tmp(clamp((x - edge0) / (edge1 - edge0), genType(0), genType(1))); - return tmp * tmp * (genType(3) - genType(2) * tmp); - } - - template - GLM_FUNC_QUALIFIER vec smoothstep(T edge0, T edge1, vec const& x) - { - return detail::compute_smoothstep_vector::value>::call(vec(edge0), vec(edge1), x); - } - - template - GLM_FUNC_QUALIFIER vec smoothstep(vec const& edge0, vec const& edge1, vec const& x) - { - return detail::compute_smoothstep_vector::value>::call(edge0, edge1, x); - } - -# if GLM_HAS_CXX11_STL - using std::isnan; -# else - template - GLM_FUNC_QUALIFIER bool isnan(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isnan' only accept floating-point inputs"); - -# if GLM_HAS_CXX11_STL - return std::isnan(x); -# elif GLM_COMPILER & GLM_COMPILER_VC - return _isnan(x) != 0; -# elif GLM_COMPILER & GLM_COMPILER_INTEL -# if GLM_PLATFORM & GLM_PLATFORM_WINDOWS - return _isnan(x) != 0; -# else - return ::isnan(x) != 0; -# endif -# elif (GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG)) && (GLM_PLATFORM & GLM_PLATFORM_ANDROID) && __cplusplus < 201103L - return _isnan(x) != 0; -# elif (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP) - return ::isnan(x) != 0; -# else - return std::isnan(x); -# endif - } -# endif - - template - GLM_FUNC_QUALIFIER vec isnan(vec const& v) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isnan' only accept floating-point inputs"); - - vec Result; - for (length_t l = 0; l < v.length(); ++l) - Result[l] = glm::isnan(v[l]); - return Result; - } - -# if GLM_HAS_CXX11_STL - using std::isinf; -# else - template - GLM_FUNC_QUALIFIER bool isinf(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isinf' only accept floating-point inputs"); - -# if GLM_HAS_CXX11_STL - return std::isinf(x); -# elif GLM_COMPILER & (GLM_COMPILER_INTEL | GLM_COMPILER_VC) -# if(GLM_PLATFORM & GLM_PLATFORM_WINDOWS) - return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF; -# else - return ::isinf(x); -# endif -# elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG) -# if(GLM_PLATFORM & GLM_PLATFORM_ANDROID && __cplusplus < 201103L) - return _isinf(x) != 0; -# else - return std::isinf(x); -# endif -# elif (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP) - // http://developer.download.nvidia.com/compute/cuda/4_2/rel/toolkit/docs/online/group__CUDA__MATH__DOUBLE_g13431dd2b40b51f9139cbb7f50c18fab.html#g13431dd2b40b51f9139cbb7f50c18fab - return ::isinf(double(x)) != 0; -# else - return std::isinf(x); -# endif - } -# endif - - template - GLM_FUNC_QUALIFIER vec isinf(vec const& v) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isinf' only accept floating-point inputs"); - - vec Result; - for (length_t l = 0; l < v.length(); ++l) - Result[l] = glm::isinf(v[l]); - return Result; - } - - GLM_FUNC_QUALIFIER int floatBitsToInt(float const& v) - { - union - { - float in; - int out; - } u; - - u.in = v; - - return u.out; - } - - template - GLM_FUNC_QUALIFIER vec floatBitsToInt(vec const& v) - { - return reinterpret_cast&>(const_cast&>(v)); - } - - GLM_FUNC_QUALIFIER uint floatBitsToUint(float const& v) - { - union - { - float in; - uint out; - } u; - - u.in = v; - - return u.out; - } - - template - GLM_FUNC_QUALIFIER vec floatBitsToUint(vec const& v) - { - return reinterpret_cast&>(const_cast&>(v)); - } - - GLM_FUNC_QUALIFIER float intBitsToFloat(int const& v) - { - union - { - int in; - float out; - } u; - - u.in = v; - - return u.out; - } - - template - GLM_FUNC_QUALIFIER vec intBitsToFloat(vec const& v) - { - return reinterpret_cast&>(const_cast&>(v)); - } - - GLM_FUNC_QUALIFIER float uintBitsToFloat(uint const& v) - { - union - { - uint in; - float out; - } u; - - u.in = v; - - return u.out; - } - - template - GLM_FUNC_QUALIFIER vec uintBitsToFloat(vec const& v) - { - return reinterpret_cast&>(const_cast&>(v)); - } - -# if GLM_HAS_CXX11_STL - using std::fma; -# else - template - GLM_FUNC_QUALIFIER genType fma(genType const& a, genType const& b, genType const& c) - { - return a * b + c; - } -# endif - - template - GLM_FUNC_QUALIFIER genType frexp(genType x, int& exp) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'frexp' only accept floating-point inputs"); - - return std::frexp(x, &exp); - } - - template - GLM_FUNC_QUALIFIER vec frexp(vec const& v, vec& exp) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'frexp' only accept floating-point inputs"); - - vec Result; - for (length_t l = 0; l < v.length(); ++l) - Result[l] = std::frexp(v[l], &exp[l]); - return Result; - } - - template - GLM_FUNC_QUALIFIER genType ldexp(genType const& x, int const& exp) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'ldexp' only accept floating-point inputs"); - - return std::ldexp(x, exp); - } - - template - GLM_FUNC_QUALIFIER vec ldexp(vec const& v, vec const& exp) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'ldexp' only accept floating-point inputs"); - - vec Result; - for (length_t l = 0; l < v.length(); ++l) - Result[l] = std::ldexp(v[l], exp[l]); - return Result; - } -}//namespace glm - -#if GLM_CONFIG_SIMD == GLM_ENABLE -# include "func_common_simd.inl" -#endif diff --git a/3rdparty/glm/source/glm/detail/func_common_simd.inl b/3rdparty/glm/source/glm/detail/func_common_simd.inl deleted file mode 100644 index ce0032d..0000000 --- a/3rdparty/glm/source/glm/detail/func_common_simd.inl +++ /dev/null @@ -1,231 +0,0 @@ -/// @ref core -/// @file glm/detail/func_common_simd.inl - -#if GLM_ARCH & GLM_ARCH_SSE2_BIT - -#include "../simd/common.h" - -#include - -namespace glm{ -namespace detail -{ - template - struct compute_abs_vector<4, float, Q, true> - { - GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) - { - vec<4, float, Q> result; - result.data = glm_vec4_abs(v.data); - return result; - } - }; - - template - struct compute_abs_vector<4, int, Q, true> - { - GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v) - { - vec<4, int, Q> result; - result.data = glm_ivec4_abs(v.data); - return result; - } - }; - - template - struct compute_floor<4, float, Q, true> - { - GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) - { - vec<4, float, Q> result; - result.data = glm_vec4_floor(v.data); - return result; - } - }; - - template - struct compute_ceil<4, float, Q, true> - { - GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) - { - vec<4, float, Q> result; - result.data = glm_vec4_ceil(v.data); - return result; - } - }; - - template - struct compute_fract<4, float, Q, true> - { - GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) - { - vec<4, float, Q> result; - result.data = glm_vec4_fract(v.data); - return result; - } - }; - - template - struct compute_round<4, float, Q, true> - { - GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) - { - vec<4, float, Q> result; - result.data = glm_vec4_round(v.data); - return result; - } - }; - - template - struct compute_mod<4, float, Q, true> - { - GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& x, vec<4, float, Q> const& y) - { - vec<4, float, Q> result; - result.data = glm_vec4_mod(x.data, y.data); - return result; - } - }; - - template - struct compute_min_vector<4, float, Q, true> - { - GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) - { - vec<4, float, Q> result; - result.data = _mm_min_ps(v1.data, v2.data); - return result; - } - }; - - template - struct compute_min_vector<4, int, Q, true> - { - GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2) - { - vec<4, int, Q> result; - result.data = _mm_min_epi32(v1.data, v2.data); - return result; - } - }; - - template - struct compute_min_vector<4, uint, Q, true> - { - GLM_FUNC_QUALIFIER static vec<4, uint, Q> call(vec<4, uint, Q> const& v1, vec<4, uint, Q> const& v2) - { - vec<4, uint, Q> result; - result.data = _mm_min_epu32(v1.data, v2.data); - return result; - } - }; - - template - struct compute_max_vector<4, float, Q, true> - { - GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) - { - vec<4, float, Q> result; - result.data = _mm_max_ps(v1.data, v2.data); - return result; - } - }; - - template - struct compute_max_vector<4, int, Q, true> - { - GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2) - { - vec<4, int, Q> result; - result.data = _mm_max_epi32(v1.data, v2.data); - return result; - } - }; - - template - struct compute_max_vector<4, uint, Q, true> - { - GLM_FUNC_QUALIFIER static vec<4, uint, Q> call(vec<4, uint, Q> const& v1, vec<4, uint, Q> const& v2) - { - vec<4, uint, Q> result; - result.data = _mm_max_epu32(v1.data, v2.data); - return result; - } - }; - - template - struct compute_clamp_vector<4, float, Q, true> - { - GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& x, vec<4, float, Q> const& minVal, vec<4, float, Q> const& maxVal) - { - vec<4, float, Q> result; - result.data = _mm_min_ps(_mm_max_ps(x.data, minVal.data), maxVal.data); - return result; - } - }; - - template - struct compute_clamp_vector<4, int, Q, true> - { - GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& x, vec<4, int, Q> const& minVal, vec<4, int, Q> const& maxVal) - { - vec<4, int, Q> result; - result.data = _mm_min_epi32(_mm_max_epi32(x.data, minVal.data), maxVal.data); - return result; - } - }; - - template - struct compute_clamp_vector<4, uint, Q, true> - { - GLM_FUNC_QUALIFIER static vec<4, uint, Q> call(vec<4, uint, Q> const& x, vec<4, uint, Q> const& minVal, vec<4, uint, Q> const& maxVal) - { - vec<4, uint, Q> result; - result.data = _mm_min_epu32(_mm_max_epu32(x.data, minVal.data), maxVal.data); - return result; - } - }; - - template - struct compute_mix_vector<4, float, bool, Q, true> - { - GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& x, vec<4, float, Q> const& y, vec<4, bool, Q> const& a) - { - __m128i const Load = _mm_set_epi32(-static_cast(a.w), -static_cast(a.z), -static_cast(a.y), -static_cast(a.x)); - __m128 const Mask = _mm_castsi128_ps(Load); - - vec<4, float, Q> Result; -# if 0 && GLM_ARCH & GLM_ARCH_AVX - Result.data = _mm_blendv_ps(x.data, y.data, Mask); -# else - Result.data = _mm_or_ps(_mm_and_ps(Mask, y.data), _mm_andnot_ps(Mask, x.data)); -# endif - return Result; - } - }; -/* FIXME - template - struct compute_step_vector - { - GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& edge, vec<4, float, Q> const& x) - { - vec<4, float, Q> Result; - result.data = glm_vec4_step(edge.data, x.data); - return result; - } - }; -*/ - template - struct compute_smoothstep_vector<4, float, Q, true> - { - GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& edge0, vec<4, float, Q> const& edge1, vec<4, float, Q> const& x) - { - vec<4, float, Q> Result; - Result.data = glm_vec4_smoothstep(edge0.data, edge1.data, x.data); - return Result; - } - }; -}//namespace detail -}//namespace glm - -#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/3rdparty/glm/source/glm/detail/func_exponential.inl b/3rdparty/glm/source/glm/detail/func_exponential.inl deleted file mode 100644 index 2040d41..0000000 --- a/3rdparty/glm/source/glm/detail/func_exponential.inl +++ /dev/null @@ -1,152 +0,0 @@ -/// @ref core -/// @file glm/detail/func_exponential.inl - -#include "../vector_relational.hpp" -#include "_vectorize.hpp" -#include -#include -#include - -namespace glm{ -namespace detail -{ -# if GLM_HAS_CXX11_STL - using std::log2; -# else - template - genType log2(genType Value) - { - return std::log(Value) * static_cast(1.4426950408889634073599246810019); - } -# endif - - template - struct compute_log2 - { - GLM_FUNC_QUALIFIER static vec call(vec const& v) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'log2' only accept floating-point inputs. Include for integer inputs."); - - return detail::functor1::call(log2, v); - } - }; - - template - struct compute_sqrt - { - GLM_FUNC_QUALIFIER static vec call(vec const& x) - { - return detail::functor1::call(std::sqrt, x); - } - }; - - template - struct compute_inversesqrt - { - GLM_FUNC_QUALIFIER static vec call(vec const& x) - { - return static_cast(1) / sqrt(x); - } - }; - - template - struct compute_inversesqrt - { - GLM_FUNC_QUALIFIER static vec call(vec const& x) - { - vec tmp(x); - vec xhalf(tmp * 0.5f); - vec* p = reinterpret_cast*>(const_cast*>(&x)); - vec i = vec(0x5f375a86) - (*p >> vec(1)); - vec* ptmp = reinterpret_cast*>(&i); - tmp = *ptmp; - tmp = tmp * (1.5f - xhalf * tmp * tmp); - return tmp; - } - }; -}//namespace detail - - // pow - using std::pow; - template - GLM_FUNC_QUALIFIER vec pow(vec const& base, vec const& exponent) - { - return detail::functor2::call(pow, base, exponent); - } - - // exp - using std::exp; - template - GLM_FUNC_QUALIFIER vec exp(vec const& x) - { - return detail::functor1::call(exp, x); - } - - // log - using std::log; - template - GLM_FUNC_QUALIFIER vec log(vec const& x) - { - return detail::functor1::call(log, x); - } - -# if GLM_HAS_CXX11_STL - using std::exp2; -# else - //exp2, ln2 = 0.69314718055994530941723212145818f - template - GLM_FUNC_QUALIFIER genType exp2(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'exp2' only accept floating-point inputs"); - - return std::exp(static_cast(0.69314718055994530941723212145818) * x); - } -# endif - - template - GLM_FUNC_QUALIFIER vec exp2(vec const& x) - { - return detail::functor1::call(exp2, x); - } - - // log2, ln2 = 0.69314718055994530941723212145818f - template - GLM_FUNC_QUALIFIER genType log2(genType x) - { - return log2(vec<1, genType>(x)).x; - } - - template - GLM_FUNC_QUALIFIER vec log2(vec const& x) - { - return detail::compute_log2::is_iec559, detail::is_aligned::value>::call(x); - } - - // sqrt - using std::sqrt; - template - GLM_FUNC_QUALIFIER vec sqrt(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'sqrt' only accept floating-point inputs"); - return detail::compute_sqrt::value>::call(x); - } - - // inversesqrt - template - GLM_FUNC_QUALIFIER genType inversesqrt(genType x) - { - return static_cast(1) / sqrt(x); - } - - template - GLM_FUNC_QUALIFIER vec inversesqrt(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'inversesqrt' only accept floating-point inputs"); - return detail::compute_inversesqrt::value>::call(x); - } -}//namespace glm - -#if GLM_CONFIG_SIMD == GLM_ENABLE -# include "func_exponential_simd.inl" -#endif - diff --git a/3rdparty/glm/source/glm/detail/func_exponential_simd.inl b/3rdparty/glm/source/glm/detail/func_exponential_simd.inl deleted file mode 100644 index fb78951..0000000 --- a/3rdparty/glm/source/glm/detail/func_exponential_simd.inl +++ /dev/null @@ -1,37 +0,0 @@ -/// @ref core -/// @file glm/detail/func_exponential_simd.inl - -#include "../simd/exponential.h" - -#if GLM_ARCH & GLM_ARCH_SSE2_BIT - -namespace glm{ -namespace detail -{ - template - struct compute_sqrt<4, float, Q, true> - { - GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) - { - vec<4, float, Q> Result; - Result.data = _mm_sqrt_ps(v.data); - return Result; - } - }; - -# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE - template<> - struct compute_sqrt<4, float, aligned_lowp, true> - { - GLM_FUNC_QUALIFIER static vec<4, float, aligned_lowp> call(vec<4, float, aligned_lowp> const& v) - { - vec<4, float, aligned_lowp> Result; - Result.data = glm_vec4_sqrt_lowp(v.data); - return Result; - } - }; -# endif -}//namespace detail -}//namespace glm - -#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/3rdparty/glm/source/glm/detail/func_geometric.inl b/3rdparty/glm/source/glm/detail/func_geometric.inl deleted file mode 100644 index 404c990..0000000 --- a/3rdparty/glm/source/glm/detail/func_geometric.inl +++ /dev/null @@ -1,243 +0,0 @@ -#include "../exponential.hpp" -#include "../common.hpp" - -namespace glm{ -namespace detail -{ - template - struct compute_length - { - GLM_FUNC_QUALIFIER static T call(vec const& v) - { - return sqrt(dot(v, v)); - } - }; - - template - struct compute_distance - { - GLM_FUNC_QUALIFIER static T call(vec const& p0, vec const& p1) - { - return length(p1 - p0); - } - }; - - template - struct compute_dot{}; - - template - struct compute_dot, T, Aligned> - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static T call(vec<1, T, Q> const& a, vec<1, T, Q> const& b) - { - return a.x * b.x; - } - }; - - template - struct compute_dot, T, Aligned> - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static T call(vec<2, T, Q> const& a, vec<2, T, Q> const& b) - { - vec<2, T, Q> tmp(a * b); - return tmp.x + tmp.y; - } - }; - - template - struct compute_dot, T, Aligned> - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static T call(vec<3, T, Q> const& a, vec<3, T, Q> const& b) - { - vec<3, T, Q> tmp(a * b); - return tmp.x + tmp.y + tmp.z; - } - }; - - template - struct compute_dot, T, Aligned> - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static T call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - vec<4, T, Q> tmp(a * b); - return (tmp.x + tmp.y) + (tmp.z + tmp.w); - } - }; - - template - struct compute_cross - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<3, T, Q> call(vec<3, T, Q> const& x, vec<3, T, Q> const& y) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'cross' accepts only floating-point inputs"); - - return vec<3, T, Q>( - x.y * y.z - y.y * x.z, - x.z * y.x - y.z * x.x, - x.x * y.y - y.x * x.y); - } - }; - - template - struct compute_normalize - { - GLM_FUNC_QUALIFIER static vec call(vec const& v) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'normalize' accepts only floating-point inputs"); - - return v * inversesqrt(dot(v, v)); - } - }; - - template - struct compute_faceforward - { - GLM_FUNC_QUALIFIER static vec call(vec const& N, vec const& I, vec const& Nref) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'normalize' accepts only floating-point inputs"); - - return dot(Nref, I) < static_cast(0) ? N : -N; - } - }; - - template - struct compute_reflect - { - GLM_FUNC_QUALIFIER static vec call(vec const& I, vec const& N) - { - return I - N * dot(N, I) * static_cast(2); - } - }; - - template - struct compute_refract - { - GLM_FUNC_QUALIFIER static vec call(vec const& I, vec const& N, T eta) - { - T const dotValue(dot(N, I)); - T const k(static_cast(1) - eta * eta * (static_cast(1) - dotValue * dotValue)); - vec const Result = - (k >= static_cast(0)) ? (eta * I - (eta * dotValue + std::sqrt(k)) * N) : vec(0); - return Result; - } - }; -}//namespace detail - - // length - template - GLM_FUNC_QUALIFIER genType length(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'length' accepts only floating-point inputs"); - - return abs(x); - } - - template - GLM_FUNC_QUALIFIER T length(vec const& v) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'length' accepts only floating-point inputs"); - - return detail::compute_length::value>::call(v); - } - - // distance - template - GLM_FUNC_QUALIFIER genType distance(genType const& p0, genType const& p1) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'distance' accepts only floating-point inputs"); - - return length(p1 - p0); - } - - template - GLM_FUNC_QUALIFIER T distance(vec const& p0, vec const& p1) - { - return detail::compute_distance::value>::call(p0, p1); - } - - // dot - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR T dot(T x, T y) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'dot' accepts only floating-point inputs"); - return x * y; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR T dot(vec const& x, vec const& y) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'dot' accepts only floating-point inputs"); - return detail::compute_dot, T, detail::is_aligned::value>::call(x, y); - } - - // cross - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> cross(vec<3, T, Q> const& x, vec<3, T, Q> const& y) - { - return detail::compute_cross::value>::call(x, y); - } -/* - // normalize - template - GLM_FUNC_QUALIFIER genType normalize(genType const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'normalize' accepts only floating-point inputs"); - - return x < genType(0) ? genType(-1) : genType(1); - } -*/ - template - GLM_FUNC_QUALIFIER vec normalize(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'normalize' accepts only floating-point inputs"); - - return detail::compute_normalize::value>::call(x); - } - - // faceforward - template - GLM_FUNC_QUALIFIER genType faceforward(genType const& N, genType const& I, genType const& Nref) - { - return dot(Nref, I) < static_cast(0) ? N : -N; - } - - template - GLM_FUNC_QUALIFIER vec faceforward(vec const& N, vec const& I, vec const& Nref) - { - return detail::compute_faceforward::value>::call(N, I, Nref); - } - - // reflect - template - GLM_FUNC_QUALIFIER genType reflect(genType const& I, genType const& N) - { - return I - N * dot(N, I) * genType(2); - } - - template - GLM_FUNC_QUALIFIER vec reflect(vec const& I, vec const& N) - { - return detail::compute_reflect::value>::call(I, N); - } - - // refract - template - GLM_FUNC_QUALIFIER genType refract(genType const& I, genType const& N, genType eta) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'refract' accepts only floating-point inputs"); - genType const dotValue(dot(N, I)); - genType const k(static_cast(1) - eta * eta * (static_cast(1) - dotValue * dotValue)); - return (eta * I - (eta * dotValue + sqrt(k)) * N) * static_cast(k >= static_cast(0)); - } - - template - GLM_FUNC_QUALIFIER vec refract(vec const& I, vec const& N, T eta) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'refract' accepts only floating-point inputs"); - return detail::compute_refract::value>::call(I, N, eta); - } -}//namespace glm - -#if GLM_CONFIG_SIMD == GLM_ENABLE -# include "func_geometric_simd.inl" -#endif diff --git a/3rdparty/glm/source/glm/detail/func_geometric_simd.inl b/3rdparty/glm/source/glm/detail/func_geometric_simd.inl deleted file mode 100644 index 2076dae..0000000 --- a/3rdparty/glm/source/glm/detail/func_geometric_simd.inl +++ /dev/null @@ -1,163 +0,0 @@ -/// @ref core -/// @file glm/detail/func_geometric_simd.inl - -#include "../simd/geometric.h" - -#if GLM_ARCH & GLM_ARCH_SSE2_BIT - -namespace glm{ -namespace detail -{ - template - struct compute_length<4, float, Q, true> - { - GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& v) - { - return _mm_cvtss_f32(glm_vec4_length(v.data)); - } - }; - - template - struct compute_distance<4, float, Q, true> - { - GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& p0, vec<4, float, Q> const& p1) - { - return _mm_cvtss_f32(glm_vec4_distance(p0.data, p1.data)); - } - }; - - template - struct compute_dot, float, true> - { - GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& x, vec<4, float, Q> const& y) - { - return _mm_cvtss_f32(glm_vec1_dot(x.data, y.data)); - } - }; - - template - struct compute_cross - { - GLM_FUNC_QUALIFIER static vec<3, float, Q> call(vec<3, float, Q> const& a, vec<3, float, Q> const& b) - { - __m128 const set0 = _mm_set_ps(0.0f, a.z, a.y, a.x); - __m128 const set1 = _mm_set_ps(0.0f, b.z, b.y, b.x); - __m128 const xpd0 = glm_vec4_cross(set0, set1); - - vec<4, float, Q> Result; - Result.data = xpd0; - return vec<3, float, Q>(Result); - } - }; - - template - struct compute_normalize<4, float, Q, true> - { - GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) - { - vec<4, float, Q> Result; - Result.data = glm_vec4_normalize(v.data); - return Result; - } - }; - - template - struct compute_faceforward<4, float, Q, true> - { - GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& N, vec<4, float, Q> const& I, vec<4, float, Q> const& Nref) - { - vec<4, float, Q> Result; - Result.data = glm_vec4_faceforward(N.data, I.data, Nref.data); - return Result; - } - }; - - template - struct compute_reflect<4, float, Q, true> - { - GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& I, vec<4, float, Q> const& N) - { - vec<4, float, Q> Result; - Result.data = glm_vec4_reflect(I.data, N.data); - return Result; - } - }; - - template - struct compute_refract<4, float, Q, true> - { - GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& I, vec<4, float, Q> const& N, float eta) - { - vec<4, float, Q> Result; - Result.data = glm_vec4_refract(I.data, N.data, _mm_set1_ps(eta)); - return Result; - } - }; -}//namespace detail -}//namespace glm - -#elif GLM_ARCH & GLM_ARCH_NEON_BIT -namespace glm{ -namespace detail -{ - template - struct compute_length<4, float, Q, true> - { - GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& v) - { - return sqrt(compute_dot, float, true>::call(v, v)); - } - }; - - template - struct compute_distance<4, float, Q, true> - { - GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& p0, vec<4, float, Q> const& p1) - { - return compute_length<4, float, Q, true>::call(p1 - p0); - } - }; - - - template - struct compute_dot, float, true> - { - GLM_FUNC_QUALIFIER static float call(vec<4, float, Q> const& x, vec<4, float, Q> const& y) - { -#if GLM_ARCH & GLM_ARCH_ARMV8_BIT - float32x4_t v = vmulq_f32(x.data, y.data); - return vaddvq_f32(v); -#else // Armv7a with Neon - float32x4_t p = vmulq_f32(x.data, y.data); - float32x2_t v = vpadd_f32(vget_low_f32(p), vget_high_f32(p)); - v = vpadd_f32(v, v); - return vget_lane_f32(v, 0); -#endif - } - }; - - template - struct compute_normalize<4, float, Q, true> - { - GLM_FUNC_QUALIFIER static vec<4, float, Q> call(vec<4, float, Q> const& v) - { - float32x4_t p = vmulq_f32(v.data, v.data); -#if GLM_ARCH & GLM_ARCH_ARMV8_BIT - p = vpaddq_f32(p, p); - p = vpaddq_f32(p, p); -#else - float32x2_t t = vpadd_f32(vget_low_f32(p), vget_high_f32(p)); - t = vpadd_f32(t, t); - p = vcombine_f32(t, t); -#endif - - float32x4_t vd = vrsqrteq_f32(p); - vec<4, float, Q> Result; - Result.data = vmulq_f32(v.data, vd); - return Result; - } - }; -}//namespace detail -}//namespace glm - -#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/3rdparty/glm/source/glm/detail/func_integer.inl b/3rdparty/glm/source/glm/detail/func_integer.inl deleted file mode 100644 index 091e1e0..0000000 --- a/3rdparty/glm/source/glm/detail/func_integer.inl +++ /dev/null @@ -1,372 +0,0 @@ -/// @ref core - -#include "_vectorize.hpp" -#if(GLM_ARCH & GLM_ARCH_X86 && GLM_COMPILER & GLM_COMPILER_VC) -# include -# pragma intrinsic(_BitScanReverse) -#endif//(GLM_ARCH & GLM_ARCH_X86 && GLM_COMPILER & GLM_COMPILER_VC) -#include - -#if !GLM_HAS_EXTENDED_INTEGER_TYPE -# if GLM_COMPILER & GLM_COMPILER_GCC -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -# if (GLM_COMPILER & GLM_COMPILER_CLANG) -# pragma clang diagnostic ignored "-Wc++11-long-long" -# endif -#endif - -namespace glm{ -namespace detail -{ - template - GLM_FUNC_QUALIFIER T mask(T Bits) - { - return Bits >= static_cast(sizeof(T) * 8) ? ~static_cast(0) : (static_cast(1) << Bits) - static_cast(1); - } - - template - struct compute_bitfieldReverseStep - { - GLM_FUNC_QUALIFIER static vec call(vec const& v, T, T) - { - return v; - } - }; - - template - struct compute_bitfieldReverseStep - { - GLM_FUNC_QUALIFIER static vec call(vec const& v, T Mask, T Shift) - { - return (v & Mask) << Shift | (v & (~Mask)) >> Shift; - } - }; - - template - struct compute_bitfieldBitCountStep - { - GLM_FUNC_QUALIFIER static vec call(vec const& v, T, T) - { - return v; - } - }; - - template - struct compute_bitfieldBitCountStep - { - GLM_FUNC_QUALIFIER static vec call(vec const& v, T Mask, T Shift) - { - return (v & Mask) + ((v >> Shift) & Mask); - } - }; - - template - struct compute_findLSB - { - GLM_FUNC_QUALIFIER static int call(genIUType Value) - { - if(Value == 0) - return -1; - - return glm::bitCount(~Value & (Value - static_cast(1))); - } - }; - -# if GLM_HAS_BITSCAN_WINDOWS - template - struct compute_findLSB - { - GLM_FUNC_QUALIFIER static int call(genIUType Value) - { - unsigned long Result(0); - unsigned char IsNotNull = _BitScanForward(&Result, *reinterpret_cast(&Value)); - return IsNotNull ? int(Result) : -1; - } - }; - -# if !((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_MODEL == GLM_MODEL_32)) - template - struct compute_findLSB - { - GLM_FUNC_QUALIFIER static int call(genIUType Value) - { - unsigned long Result(0); - unsigned char IsNotNull = _BitScanForward64(&Result, *reinterpret_cast(&Value)); - return IsNotNull ? int(Result) : -1; - } - }; -# endif -# endif//GLM_HAS_BITSCAN_WINDOWS - - template - struct compute_findMSB_step_vec - { - GLM_FUNC_QUALIFIER static vec call(vec const& x, T Shift) - { - return x | (x >> Shift); - } - }; - - template - struct compute_findMSB_step_vec - { - GLM_FUNC_QUALIFIER static vec call(vec const& x, T) - { - return x; - } - }; - - template - struct compute_findMSB_vec - { - GLM_FUNC_QUALIFIER static vec call(vec const& v) - { - vec x(v); - x = compute_findMSB_step_vec= 8>::call(x, static_cast( 1)); - x = compute_findMSB_step_vec= 8>::call(x, static_cast( 2)); - x = compute_findMSB_step_vec= 8>::call(x, static_cast( 4)); - x = compute_findMSB_step_vec= 16>::call(x, static_cast( 8)); - x = compute_findMSB_step_vec= 32>::call(x, static_cast(16)); - x = compute_findMSB_step_vec= 64>::call(x, static_cast(32)); - return vec(sizeof(T) * 8 - 1) - glm::bitCount(~x); - } - }; - -# if GLM_HAS_BITSCAN_WINDOWS - template - GLM_FUNC_QUALIFIER int compute_findMSB_32(genIUType Value) - { - unsigned long Result(0); - unsigned char IsNotNull = _BitScanReverse(&Result, *reinterpret_cast(&Value)); - return IsNotNull ? int(Result) : -1; - } - - template - struct compute_findMSB_vec - { - GLM_FUNC_QUALIFIER static vec call(vec const& x) - { - return detail::functor1::call(compute_findMSB_32, x); - } - }; - -# if !((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_MODEL == GLM_MODEL_32)) - template - GLM_FUNC_QUALIFIER int compute_findMSB_64(genIUType Value) - { - unsigned long Result(0); - unsigned char IsNotNull = _BitScanReverse64(&Result, *reinterpret_cast(&Value)); - return IsNotNull ? int(Result) : -1; - } - - template - struct compute_findMSB_vec - { - GLM_FUNC_QUALIFIER static vec call(vec const& x) - { - return detail::functor1::call(compute_findMSB_64, x); - } - }; -# endif -# endif//GLM_HAS_BITSCAN_WINDOWS -}//namespace detail - - // uaddCarry - GLM_FUNC_QUALIFIER uint uaddCarry(uint const& x, uint const& y, uint & Carry) - { - detail::uint64 const Value64(static_cast(x) + static_cast(y)); - detail::uint64 const Max32((static_cast(1) << static_cast(32)) - static_cast(1)); - Carry = Value64 > Max32 ? 1u : 0u; - return static_cast(Value64 % (Max32 + static_cast(1))); - } - - template - GLM_FUNC_QUALIFIER vec uaddCarry(vec const& x, vec const& y, vec& Carry) - { - vec Value64(vec(x) + vec(y)); - vec Max32((static_cast(1) << static_cast(32)) - static_cast(1)); - Carry = mix(vec(0), vec(1), greaterThan(Value64, Max32)); - return vec(Value64 % (Max32 + static_cast(1))); - } - - // usubBorrow - GLM_FUNC_QUALIFIER uint usubBorrow(uint const& x, uint const& y, uint & Borrow) - { - Borrow = x >= y ? static_cast(0) : static_cast(1); - if(y >= x) - return y - x; - else - return static_cast((static_cast(1) << static_cast(32)) + (static_cast(y) - static_cast(x))); - } - - template - GLM_FUNC_QUALIFIER vec usubBorrow(vec const& x, vec const& y, vec& Borrow) - { - Borrow = mix(vec(1), vec(0), greaterThanEqual(x, y)); - vec const YgeX(y - x); - vec const XgeY(vec((static_cast(1) << static_cast(32)) + (vec(y) - vec(x)))); - return mix(XgeY, YgeX, greaterThanEqual(y, x)); - } - - // umulExtended - GLM_FUNC_QUALIFIER void umulExtended(uint const& x, uint const& y, uint & msb, uint & lsb) - { - detail::uint64 Value64 = static_cast(x) * static_cast(y); - msb = static_cast(Value64 >> static_cast(32)); - lsb = static_cast(Value64); - } - - template - GLM_FUNC_QUALIFIER void umulExtended(vec const& x, vec const& y, vec& msb, vec& lsb) - { - vec Value64(vec(x) * vec(y)); - msb = vec(Value64 >> static_cast(32)); - lsb = vec(Value64); - } - - // imulExtended - GLM_FUNC_QUALIFIER void imulExtended(int x, int y, int& msb, int& lsb) - { - detail::int64 Value64 = static_cast(x) * static_cast(y); - msb = static_cast(Value64 >> static_cast(32)); - lsb = static_cast(Value64); - } - - template - GLM_FUNC_QUALIFIER void imulExtended(vec const& x, vec const& y, vec& msb, vec& lsb) - { - vec Value64(vec(x) * vec(y)); - lsb = vec(Value64 & static_cast(0xFFFFFFFF)); - msb = vec((Value64 >> static_cast(32)) & static_cast(0xFFFFFFFF)); - } - - // bitfieldExtract - template - GLM_FUNC_QUALIFIER genIUType bitfieldExtract(genIUType Value, int Offset, int Bits) - { - return bitfieldExtract(vec<1, genIUType>(Value), Offset, Bits).x; - } - - template - GLM_FUNC_QUALIFIER vec bitfieldExtract(vec const& Value, int Offset, int Bits) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldExtract' only accept integer inputs"); - - return (Value >> static_cast(Offset)) & static_cast(detail::mask(Bits)); - } - - // bitfieldInsert - template - GLM_FUNC_QUALIFIER genIUType bitfieldInsert(genIUType const& Base, genIUType const& Insert, int Offset, int Bits) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldInsert' only accept integer values"); - - return bitfieldInsert(vec<1, genIUType>(Base), vec<1, genIUType>(Insert), Offset, Bits).x; - } - - template - GLM_FUNC_QUALIFIER vec bitfieldInsert(vec const& Base, vec const& Insert, int Offset, int Bits) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldInsert' only accept integer values"); - - T const Mask = static_cast(detail::mask(Bits) << Offset); - return (Base & ~Mask) | ((Insert << static_cast(Offset)) & Mask); - } - - // bitfieldReverse - template - GLM_FUNC_QUALIFIER genIUType bitfieldReverse(genIUType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldReverse' only accept integer values"); - - return bitfieldReverse(glm::vec<1, genIUType, glm::defaultp>(x)).x; - } - - template - GLM_FUNC_QUALIFIER vec bitfieldReverse(vec const& v) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldReverse' only accept integer values"); - - vec x(v); - x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 2>::call(x, static_cast(0x5555555555555555ull), static_cast( 1)); - x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 4>::call(x, static_cast(0x3333333333333333ull), static_cast( 2)); - x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 8>::call(x, static_cast(0x0F0F0F0F0F0F0F0Full), static_cast( 4)); - x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 16>::call(x, static_cast(0x00FF00FF00FF00FFull), static_cast( 8)); - x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 32>::call(x, static_cast(0x0000FFFF0000FFFFull), static_cast(16)); - x = detail::compute_bitfieldReverseStep::value, sizeof(T) * 8>= 64>::call(x, static_cast(0x00000000FFFFFFFFull), static_cast(32)); - return x; - } - - // bitCount - template - GLM_FUNC_QUALIFIER int bitCount(genIUType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitCount' only accept integer values"); - - return bitCount(glm::vec<1, genIUType, glm::defaultp>(x)).x; - } - - template - GLM_FUNC_QUALIFIER vec bitCount(vec const& v) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitCount' only accept integer values"); - -# if GLM_COMPILER & GLM_COMPILER_VC -# pragma warning(push) -# pragma warning(disable : 4310) //cast truncates constant value -# endif - - vec::type, Q> x(*reinterpret_cast::type, Q> const *>(&v)); - x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 2>::call(x, typename detail::make_unsigned::type(0x5555555555555555ull), typename detail::make_unsigned::type( 1)); - x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 4>::call(x, typename detail::make_unsigned::type(0x3333333333333333ull), typename detail::make_unsigned::type( 2)); - x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 8>::call(x, typename detail::make_unsigned::type(0x0F0F0F0F0F0F0F0Full), typename detail::make_unsigned::type( 4)); - x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 16>::call(x, typename detail::make_unsigned::type(0x00FF00FF00FF00FFull), typename detail::make_unsigned::type( 8)); - x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 32>::call(x, typename detail::make_unsigned::type(0x0000FFFF0000FFFFull), typename detail::make_unsigned::type(16)); - x = detail::compute_bitfieldBitCountStep::type, Q, detail::is_aligned::value, sizeof(T) * 8>= 64>::call(x, typename detail::make_unsigned::type(0x00000000FFFFFFFFull), typename detail::make_unsigned::type(32)); - return vec(x); - -# if GLM_COMPILER & GLM_COMPILER_VC -# pragma warning(pop) -# endif - } - - // findLSB - template - GLM_FUNC_QUALIFIER int findLSB(genIUType Value) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findLSB' only accept integer values"); - - return detail::compute_findLSB::call(Value); - } - - template - GLM_FUNC_QUALIFIER vec findLSB(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findLSB' only accept integer values"); - - return detail::functor1::call(findLSB, x); - } - - // findMSB - template - GLM_FUNC_QUALIFIER int findMSB(genIUType v) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findMSB' only accept integer values"); - - return findMSB(vec<1, genIUType>(v)).x; - } - - template - GLM_FUNC_QUALIFIER vec findMSB(vec const& v) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findMSB' only accept integer values"); - - return detail::compute_findMSB_vec::call(v); - } -}//namespace glm - -#if GLM_CONFIG_SIMD == GLM_ENABLE -# include "func_integer_simd.inl" -#endif - diff --git a/3rdparty/glm/source/glm/detail/func_integer_simd.inl b/3rdparty/glm/source/glm/detail/func_integer_simd.inl deleted file mode 100644 index 8be6c9c..0000000 --- a/3rdparty/glm/source/glm/detail/func_integer_simd.inl +++ /dev/null @@ -1,65 +0,0 @@ -#include "../simd/integer.h" - -#if GLM_ARCH & GLM_ARCH_SSE2_BIT - -namespace glm{ -namespace detail -{ - template - struct compute_bitfieldReverseStep<4, uint, Q, true, true> - { - GLM_FUNC_QUALIFIER static vec<4, uint, Q> call(vec<4, uint, Q> const& v, uint Mask, uint Shift) - { - __m128i const set0 = v.data; - - __m128i const set1 = _mm_set1_epi32(static_cast(Mask)); - __m128i const and1 = _mm_and_si128(set0, set1); - __m128i const sft1 = _mm_slli_epi32(and1, Shift); - - __m128i const set2 = _mm_andnot_si128(set0, _mm_set1_epi32(-1)); - __m128i const and2 = _mm_and_si128(set0, set2); - __m128i const sft2 = _mm_srai_epi32(and2, Shift); - - __m128i const or0 = _mm_or_si128(sft1, sft2); - - return or0; - } - }; - - template - struct compute_bitfieldBitCountStep<4, uint, Q, true, true> - { - GLM_FUNC_QUALIFIER static vec<4, uint, Q> call(vec<4, uint, Q> const& v, uint Mask, uint Shift) - { - __m128i const set0 = v.data; - - __m128i const set1 = _mm_set1_epi32(static_cast(Mask)); - __m128i const and0 = _mm_and_si128(set0, set1); - __m128i const sft0 = _mm_slli_epi32(set0, Shift); - __m128i const and1 = _mm_and_si128(sft0, set1); - __m128i const add0 = _mm_add_epi32(and0, and1); - - return add0; - } - }; -}//namespace detail - -# if GLM_ARCH & GLM_ARCH_AVX_BIT - template<> - GLM_FUNC_QUALIFIER int bitCount(uint x) - { - return _mm_popcnt_u32(x); - } - -# if(GLM_MODEL == GLM_MODEL_64) - template<> - GLM_FUNC_QUALIFIER int bitCount(detail::uint64 x) - { - return static_cast(_mm_popcnt_u64(x)); - } -# endif//GLM_MODEL -# endif//GLM_ARCH - -}//namespace glm - -#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/3rdparty/glm/source/glm/detail/func_matrix.inl b/3rdparty/glm/source/glm/detail/func_matrix.inl deleted file mode 100644 index c2d568f..0000000 --- a/3rdparty/glm/source/glm/detail/func_matrix.inl +++ /dev/null @@ -1,443 +0,0 @@ -#include "../geometric.hpp" -#include - -namespace glm{ -namespace detail -{ - template - struct compute_matrixCompMult - { - GLM_FUNC_QUALIFIER static mat call(mat const& x, mat const& y) - { - mat Result; - for(length_t i = 0; i < Result.length(); ++i) - Result[i] = x[i] * y[i]; - return Result; - } - }; - - template - struct compute_matrixCompMult_type { - GLM_FUNC_QUALIFIER static mat call(mat const& x, mat const& y) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, - "'matrixCompMult' only accept floating-point inputs, include to discard this restriction."); - return detail::compute_matrixCompMult::value>::call(x, y); - } - }; - - template - struct compute_outerProduct { - GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait::type call(vec const& c, vec const& r) - { - typename detail::outerProduct_trait::type m; - for(length_t i = 0; i < m.length(); ++i) - m[i] = c * r[i]; - return m; - } - }; - - template - struct compute_outerProduct_type { - GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait::type call(vec const& c, vec const& r) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, - "'outerProduct' only accept floating-point inputs, include to discard this restriction."); - - return detail::compute_outerProduct::call(c, r); - } - }; - - template - struct compute_transpose{}; - - template - struct compute_transpose<2, 2, T, Q, Aligned> - { - GLM_FUNC_QUALIFIER static mat<2, 2, T, Q> call(mat<2, 2, T, Q> const& m) - { - mat<2, 2, T, Q> Result; - Result[0][0] = m[0][0]; - Result[0][1] = m[1][0]; - Result[1][0] = m[0][1]; - Result[1][1] = m[1][1]; - return Result; - } - }; - - template - struct compute_transpose<2, 3, T, Q, Aligned> - { - GLM_FUNC_QUALIFIER static mat<3, 2, T, Q> call(mat<2, 3, T, Q> const& m) - { - mat<3,2, T, Q> Result; - Result[0][0] = m[0][0]; - Result[0][1] = m[1][0]; - Result[1][0] = m[0][1]; - Result[1][1] = m[1][1]; - Result[2][0] = m[0][2]; - Result[2][1] = m[1][2]; - return Result; - } - }; - - template - struct compute_transpose<2, 4, T, Q, Aligned> - { - GLM_FUNC_QUALIFIER static mat<4, 2, T, Q> call(mat<2, 4, T, Q> const& m) - { - mat<4, 2, T, Q> Result; - Result[0][0] = m[0][0]; - Result[0][1] = m[1][0]; - Result[1][0] = m[0][1]; - Result[1][1] = m[1][1]; - Result[2][0] = m[0][2]; - Result[2][1] = m[1][2]; - Result[3][0] = m[0][3]; - Result[3][1] = m[1][3]; - return Result; - } - }; - - template - struct compute_transpose<3, 2, T, Q, Aligned> - { - GLM_FUNC_QUALIFIER static mat<2, 3, T, Q> call(mat<3, 2, T, Q> const& m) - { - mat<2, 3, T, Q> Result; - Result[0][0] = m[0][0]; - Result[0][1] = m[1][0]; - Result[0][2] = m[2][0]; - Result[1][0] = m[0][1]; - Result[1][1] = m[1][1]; - Result[1][2] = m[2][1]; - return Result; - } - }; - - template - struct compute_transpose<3, 3, T, Q, Aligned> - { - GLM_FUNC_QUALIFIER static mat<3, 3, T, Q> call(mat<3, 3, T, Q> const& m) - { - mat<3, 3, T, Q> Result; - Result[0][0] = m[0][0]; - Result[0][1] = m[1][0]; - Result[0][2] = m[2][0]; - - Result[1][0] = m[0][1]; - Result[1][1] = m[1][1]; - Result[1][2] = m[2][1]; - - Result[2][0] = m[0][2]; - Result[2][1] = m[1][2]; - Result[2][2] = m[2][2]; - return Result; - } - }; - - template - struct compute_transpose<3, 4, T, Q, Aligned> - { - GLM_FUNC_QUALIFIER static mat<4, 3, T, Q> call(mat<3, 4, T, Q> const& m) - { - mat<4, 3, T, Q> Result; - Result[0][0] = m[0][0]; - Result[0][1] = m[1][0]; - Result[0][2] = m[2][0]; - Result[1][0] = m[0][1]; - Result[1][1] = m[1][1]; - Result[1][2] = m[2][1]; - Result[2][0] = m[0][2]; - Result[2][1] = m[1][2]; - Result[2][2] = m[2][2]; - Result[3][0] = m[0][3]; - Result[3][1] = m[1][3]; - Result[3][2] = m[2][3]; - return Result; - } - }; - - template - struct compute_transpose<4, 2, T, Q, Aligned> - { - GLM_FUNC_QUALIFIER static mat<2, 4, T, Q> call(mat<4, 2, T, Q> const& m) - { - mat<2, 4, T, Q> Result; - Result[0][0] = m[0][0]; - Result[0][1] = m[1][0]; - Result[0][2] = m[2][0]; - Result[0][3] = m[3][0]; - Result[1][0] = m[0][1]; - Result[1][1] = m[1][1]; - Result[1][2] = m[2][1]; - Result[1][3] = m[3][1]; - return Result; - } - }; - - template - struct compute_transpose<4, 3, T, Q, Aligned> - { - GLM_FUNC_QUALIFIER static mat<3, 4, T, Q> call(mat<4, 3, T, Q> const& m) - { - mat<3, 4, T, Q> Result; - Result[0][0] = m[0][0]; - Result[0][1] = m[1][0]; - Result[0][2] = m[2][0]; - Result[0][3] = m[3][0]; - Result[1][0] = m[0][1]; - Result[1][1] = m[1][1]; - Result[1][2] = m[2][1]; - Result[1][3] = m[3][1]; - Result[2][0] = m[0][2]; - Result[2][1] = m[1][2]; - Result[2][2] = m[2][2]; - Result[2][3] = m[3][2]; - return Result; - } - }; - - template - struct compute_transpose<4, 4, T, Q, Aligned> - { - GLM_FUNC_QUALIFIER static mat<4, 4, T, Q> call(mat<4, 4, T, Q> const& m) - { - mat<4, 4, T, Q> Result; - Result[0][0] = m[0][0]; - Result[0][1] = m[1][0]; - Result[0][2] = m[2][0]; - Result[0][3] = m[3][0]; - - Result[1][0] = m[0][1]; - Result[1][1] = m[1][1]; - Result[1][2] = m[2][1]; - Result[1][3] = m[3][1]; - - Result[2][0] = m[0][2]; - Result[2][1] = m[1][2]; - Result[2][2] = m[2][2]; - Result[2][3] = m[3][2]; - - Result[3][0] = m[0][3]; - Result[3][1] = m[1][3]; - Result[3][2] = m[2][3]; - Result[3][3] = m[3][3]; - return Result; - } - }; - - template - struct compute_transpose_type { - GLM_FUNC_QUALIFIER static mat call(mat const& m) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, - "'transpose' only accept floating-point inputs, include to discard this restriction."); - return detail::compute_transpose::value>::call(m); - } - }; - - template - struct compute_determinant{}; - - template - struct compute_determinant<2, 2, T, Q, Aligned> - { - GLM_FUNC_QUALIFIER static T call(mat<2, 2, T, Q> const& m) - { - return m[0][0] * m[1][1] - m[1][0] * m[0][1]; - } - }; - - template - struct compute_determinant<3, 3, T, Q, Aligned> - { - GLM_FUNC_QUALIFIER static T call(mat<3, 3, T, Q> const& m) - { - return - + m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2]) - - m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2]) - + m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2]); - } - }; - - template - struct compute_determinant<4, 4, T, Q, Aligned> - { - GLM_FUNC_QUALIFIER static T call(mat<4, 4, T, Q> const& m) - { - T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; - T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; - T SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; - T SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; - T SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; - T SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - - vec<4, T, Q> DetCof( - + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02), - - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04), - + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05), - - (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05)); - - return - m[0][0] * DetCof[0] + m[0][1] * DetCof[1] + - m[0][2] * DetCof[2] + m[0][3] * DetCof[3]; - } - }; - - template - struct compute_determinant_type{ - - GLM_FUNC_QUALIFIER static T call(mat const& m) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, - "'determinant' only accept floating-point inputs, include to discard this restriction."); - return detail::compute_determinant::value>::call(m); - } - }; - - template - struct compute_inverse{}; - - template - struct compute_inverse<2, 2, T, Q, Aligned> - { - GLM_FUNC_QUALIFIER static mat<2, 2, T, Q> call(mat<2, 2, T, Q> const& m) - { - T OneOverDeterminant = static_cast(1) / ( - + m[0][0] * m[1][1] - - m[1][0] * m[0][1]); - - mat<2, 2, T, Q> Inverse( - + m[1][1] * OneOverDeterminant, - - m[0][1] * OneOverDeterminant, - - m[1][0] * OneOverDeterminant, - + m[0][0] * OneOverDeterminant); - - return Inverse; - } - }; - - template - struct compute_inverse<3, 3, T, Q, Aligned> - { - GLM_FUNC_QUALIFIER static mat<3, 3, T, Q> call(mat<3, 3, T, Q> const& m) - { - T OneOverDeterminant = static_cast(1) / ( - + m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2]) - - m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2]) - + m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2])); - - mat<3, 3, T, Q> Inverse; - Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]) * OneOverDeterminant; - Inverse[1][0] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]) * OneOverDeterminant; - Inverse[2][0] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]) * OneOverDeterminant; - Inverse[0][1] = - (m[0][1] * m[2][2] - m[2][1] * m[0][2]) * OneOverDeterminant; - Inverse[1][1] = + (m[0][0] * m[2][2] - m[2][0] * m[0][2]) * OneOverDeterminant; - Inverse[2][1] = - (m[0][0] * m[2][1] - m[2][0] * m[0][1]) * OneOverDeterminant; - Inverse[0][2] = + (m[0][1] * m[1][2] - m[1][1] * m[0][2]) * OneOverDeterminant; - Inverse[1][2] = - (m[0][0] * m[1][2] - m[1][0] * m[0][2]) * OneOverDeterminant; - Inverse[2][2] = + (m[0][0] * m[1][1] - m[1][0] * m[0][1]) * OneOverDeterminant; - - return Inverse; - } - }; - - template - struct compute_inverse<4, 4, T, Q, Aligned> - { - GLM_FUNC_QUALIFIER static mat<4, 4, T, Q> call(mat<4, 4, T, Q> const& m) - { - T Coef00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; - T Coef02 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; - T Coef03 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; - - T Coef04 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; - T Coef06 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; - T Coef07 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; - - T Coef08 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; - T Coef10 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; - T Coef11 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; - - T Coef12 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; - T Coef14 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; - T Coef15 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; - - T Coef16 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; - T Coef18 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; - T Coef19 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; - - T Coef20 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - T Coef22 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; - T Coef23 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; - - vec<4, T, Q> Fac0(Coef00, Coef00, Coef02, Coef03); - vec<4, T, Q> Fac1(Coef04, Coef04, Coef06, Coef07); - vec<4, T, Q> Fac2(Coef08, Coef08, Coef10, Coef11); - vec<4, T, Q> Fac3(Coef12, Coef12, Coef14, Coef15); - vec<4, T, Q> Fac4(Coef16, Coef16, Coef18, Coef19); - vec<4, T, Q> Fac5(Coef20, Coef20, Coef22, Coef23); - - vec<4, T, Q> Vec0(m[1][0], m[0][0], m[0][0], m[0][0]); - vec<4, T, Q> Vec1(m[1][1], m[0][1], m[0][1], m[0][1]); - vec<4, T, Q> Vec2(m[1][2], m[0][2], m[0][2], m[0][2]); - vec<4, T, Q> Vec3(m[1][3], m[0][3], m[0][3], m[0][3]); - - vec<4, T, Q> Inv0(Vec1 * Fac0 - Vec2 * Fac1 + Vec3 * Fac2); - vec<4, T, Q> Inv1(Vec0 * Fac0 - Vec2 * Fac3 + Vec3 * Fac4); - vec<4, T, Q> Inv2(Vec0 * Fac1 - Vec1 * Fac3 + Vec3 * Fac5); - vec<4, T, Q> Inv3(Vec0 * Fac2 - Vec1 * Fac4 + Vec2 * Fac5); - - vec<4, T, Q> SignA(+1, -1, +1, -1); - vec<4, T, Q> SignB(-1, +1, -1, +1); - mat<4, 4, T, Q> Inverse(Inv0 * SignA, Inv1 * SignB, Inv2 * SignA, Inv3 * SignB); - - vec<4, T, Q> Row0(Inverse[0][0], Inverse[1][0], Inverse[2][0], Inverse[3][0]); - - vec<4, T, Q> Dot0(m[0] * Row0); - T Dot1 = (Dot0.x + Dot0.y) + (Dot0.z + Dot0.w); - - T OneOverDeterminant = static_cast(1) / Dot1; - - return Inverse * OneOverDeterminant; - } - }; -}//namespace detail - - template - GLM_FUNC_QUALIFIER mat matrixCompMult(mat const& x, mat const& y) - { - return detail::compute_matrixCompMult_type::is_iec559, detail::is_aligned::value>::call(x, y); - } - - template - GLM_FUNC_QUALIFIER typename detail::outerProduct_trait::type outerProduct(vec const& c, vec const& r) - { - return detail::compute_outerProduct_type::is_iec559>::call(c, r); - } - - template - GLM_FUNC_QUALIFIER typename mat::transpose_type transpose(mat const& m) - { - return detail::compute_transpose_type::is_iec559, detail::is_aligned::value>::call(m); - } - - template - GLM_FUNC_QUALIFIER T determinant(mat const& m) - { - return detail::compute_determinant_type::is_iec559, detail::is_aligned::value>::call(m); - } - - template - GLM_FUNC_QUALIFIER mat inverse(mat const& m) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'inverse' only accept floating-point inputs"); - return detail::compute_inverse::value>::call(m); - } -}//namespace glm - -#if GLM_CONFIG_SIMD == GLM_ENABLE -# include "func_matrix_simd.inl" -#endif - diff --git a/3rdparty/glm/source/glm/detail/func_matrix_simd.inl b/3rdparty/glm/source/glm/detail/func_matrix_simd.inl deleted file mode 100644 index f67ac66..0000000 --- a/3rdparty/glm/source/glm/detail/func_matrix_simd.inl +++ /dev/null @@ -1,249 +0,0 @@ -#if GLM_ARCH & GLM_ARCH_SSE2_BIT - -#include "type_mat4x4.hpp" -#include "../geometric.hpp" -#include "../simd/matrix.h" -#include - -namespace glm{ -namespace detail -{ -# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE - template - struct compute_matrixCompMult<4, 4, float, Q, true> - { - GLM_STATIC_ASSERT(detail::is_aligned::value, "Specialization requires aligned"); - - GLM_FUNC_QUALIFIER static mat<4, 4, float, Q> call(mat<4, 4, float, Q> const& x, mat<4, 4, float, Q> const& y) - { - mat<4, 4, float, Q> Result; - glm_mat4_matrixCompMult( - *static_cast(&x[0].data), - *static_cast(&y[0].data), - *static_cast(&Result[0].data)); - return Result; - } - }; -# endif - - template - struct compute_transpose<4, 4, float, Q, true> - { - GLM_FUNC_QUALIFIER static mat<4, 4, float, Q> call(mat<4, 4, float, Q> const& m) - { - mat<4, 4, float, Q> Result; - glm_mat4_transpose(&m[0].data, &Result[0].data); - return Result; - } - }; - - template - struct compute_determinant<4, 4, float, Q, true> - { - GLM_FUNC_QUALIFIER static float call(mat<4, 4, float, Q> const& m) - { - return _mm_cvtss_f32(glm_mat4_determinant(&m[0].data)); - } - }; - - template - struct compute_inverse<4, 4, float, Q, true> - { - GLM_FUNC_QUALIFIER static mat<4, 4, float, Q> call(mat<4, 4, float, Q> const& m) - { - mat<4, 4, float, Q> Result; - glm_mat4_inverse(&m[0].data, &Result[0].data); - return Result; - } - }; -}//namespace detail - -# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE - template<> - GLM_FUNC_QUALIFIER mat<4, 4, float, aligned_lowp> outerProduct<4, 4, float, aligned_lowp>(vec<4, float, aligned_lowp> const& c, vec<4, float, aligned_lowp> const& r) - { - __m128 NativeResult[4]; - glm_mat4_outerProduct(c.data, r.data, NativeResult); - mat<4, 4, float, aligned_lowp> Result; - std::memcpy(&Result[0], &NativeResult[0], sizeof(Result)); - return Result; - } - - template<> - GLM_FUNC_QUALIFIER mat<4, 4, float, aligned_mediump> outerProduct<4, 4, float, aligned_mediump>(vec<4, float, aligned_mediump> const& c, vec<4, float, aligned_mediump> const& r) - { - __m128 NativeResult[4]; - glm_mat4_outerProduct(c.data, r.data, NativeResult); - mat<4, 4, float, aligned_mediump> Result; - std::memcpy(&Result[0], &NativeResult[0], sizeof(Result)); - return Result; - } - - template<> - GLM_FUNC_QUALIFIER mat<4, 4, float, aligned_highp> outerProduct<4, 4, float, aligned_highp>(vec<4, float, aligned_highp> const& c, vec<4, float, aligned_highp> const& r) - { - __m128 NativeResult[4]; - glm_mat4_outerProduct(c.data, r.data, NativeResult); - mat<4, 4, float, aligned_highp> Result; - std::memcpy(&Result[0], &NativeResult[0], sizeof(Result)); - return Result; - } -# endif -}//namespace glm - -#elif GLM_ARCH & GLM_ARCH_NEON_BIT - -namespace glm { -#if GLM_LANG & GLM_LANG_CXX11_FLAG - template - GLM_FUNC_QUALIFIER - typename std::enable_if::value, mat<4, 4, float, Q>>::type - operator*(mat<4, 4, float, Q> const & m1, mat<4, 4, float, Q> const & m2) - { - auto MulRow = [&](int l) { - float32x4_t const SrcA = m2[l].data; - - float32x4_t r = neon::mul_lane(m1[0].data, SrcA, 0); - r = neon::madd_lane(r, m1[1].data, SrcA, 1); - r = neon::madd_lane(r, m1[2].data, SrcA, 2); - r = neon::madd_lane(r, m1[3].data, SrcA, 3); - - return r; - }; - - mat<4, 4, float, aligned_highp> Result; - Result[0].data = MulRow(0); - Result[1].data = MulRow(1); - Result[2].data = MulRow(2); - Result[3].data = MulRow(3); - - return Result; - } -#endif // CXX11 - - template - struct detail::compute_inverse<4, 4, float, Q, true> - { - GLM_FUNC_QUALIFIER static mat<4, 4, float, Q> call(mat<4, 4, float, Q> const& m) - { - float32x4_t const& m0 = m[0].data; - float32x4_t const& m1 = m[1].data; - float32x4_t const& m2 = m[2].data; - float32x4_t const& m3 = m[3].data; - - // m[2][2] * m[3][3] - m[3][2] * m[2][3]; - // m[2][2] * m[3][3] - m[3][2] * m[2][3]; - // m[1][2] * m[3][3] - m[3][2] * m[1][3]; - // m[1][2] * m[2][3] - m[2][2] * m[1][3]; - - float32x4_t Fac0; - { - float32x4_t w0 = vcombine_f32(neon::dup_lane(m2, 2), neon::dup_lane(m1, 2)); - float32x4_t w1 = neon::copy_lane(neon::dupq_lane(m3, 3), 3, m2, 3); - float32x4_t w2 = neon::copy_lane(neon::dupq_lane(m3, 2), 3, m2, 2); - float32x4_t w3 = vcombine_f32(neon::dup_lane(m2, 3), neon::dup_lane(m1, 3)); - Fac0 = w0 * w1 - w2 * w3; - } - - // m[2][1] * m[3][3] - m[3][1] * m[2][3]; - // m[2][1] * m[3][3] - m[3][1] * m[2][3]; - // m[1][1] * m[3][3] - m[3][1] * m[1][3]; - // m[1][1] * m[2][3] - m[2][1] * m[1][3]; - - float32x4_t Fac1; - { - float32x4_t w0 = vcombine_f32(neon::dup_lane(m2, 1), neon::dup_lane(m1, 1)); - float32x4_t w1 = neon::copy_lane(neon::dupq_lane(m3, 3), 3, m2, 3); - float32x4_t w2 = neon::copy_lane(neon::dupq_lane(m3, 1), 3, m2, 1); - float32x4_t w3 = vcombine_f32(neon::dup_lane(m2, 3), neon::dup_lane(m1, 3)); - Fac1 = w0 * w1 - w2 * w3; - } - - // m[2][1] * m[3][2] - m[3][1] * m[2][2]; - // m[2][1] * m[3][2] - m[3][1] * m[2][2]; - // m[1][1] * m[3][2] - m[3][1] * m[1][2]; - // m[1][1] * m[2][2] - m[2][1] * m[1][2]; - - float32x4_t Fac2; - { - float32x4_t w0 = vcombine_f32(neon::dup_lane(m2, 1), neon::dup_lane(m1, 1)); - float32x4_t w1 = neon::copy_lane(neon::dupq_lane(m3, 2), 3, m2, 2); - float32x4_t w2 = neon::copy_lane(neon::dupq_lane(m3, 1), 3, m2, 1); - float32x4_t w3 = vcombine_f32(neon::dup_lane(m2, 2), neon::dup_lane(m1, 2)); - Fac2 = w0 * w1 - w2 * w3; - } - - // m[2][0] * m[3][3] - m[3][0] * m[2][3]; - // m[2][0] * m[3][3] - m[3][0] * m[2][3]; - // m[1][0] * m[3][3] - m[3][0] * m[1][3]; - // m[1][0] * m[2][3] - m[2][0] * m[1][3]; - - float32x4_t Fac3; - { - float32x4_t w0 = vcombine_f32(neon::dup_lane(m2, 0), neon::dup_lane(m1, 0)); - float32x4_t w1 = neon::copy_lane(neon::dupq_lane(m3, 3), 3, m2, 3); - float32x4_t w2 = neon::copy_lane(neon::dupq_lane(m3, 0), 3, m2, 0); - float32x4_t w3 = vcombine_f32(neon::dup_lane(m2, 3), neon::dup_lane(m1, 3)); - Fac3 = w0 * w1 - w2 * w3; - } - - // m[2][0] * m[3][2] - m[3][0] * m[2][2]; - // m[2][0] * m[3][2] - m[3][0] * m[2][2]; - // m[1][0] * m[3][2] - m[3][0] * m[1][2]; - // m[1][0] * m[2][2] - m[2][0] * m[1][2]; - - float32x4_t Fac4; - { - float32x4_t w0 = vcombine_f32(neon::dup_lane(m2, 0), neon::dup_lane(m1, 0)); - float32x4_t w1 = neon::copy_lane(neon::dupq_lane(m3, 2), 3, m2, 2); - float32x4_t w2 = neon::copy_lane(neon::dupq_lane(m3, 0), 3, m2, 0); - float32x4_t w3 = vcombine_f32(neon::dup_lane(m2, 2), neon::dup_lane(m1, 2)); - Fac4 = w0 * w1 - w2 * w3; - } - - // m[2][0] * m[3][1] - m[3][0] * m[2][1]; - // m[2][0] * m[3][1] - m[3][0] * m[2][1]; - // m[1][0] * m[3][1] - m[3][0] * m[1][1]; - // m[1][0] * m[2][1] - m[2][0] * m[1][1]; - - float32x4_t Fac5; - { - float32x4_t w0 = vcombine_f32(neon::dup_lane(m2, 0), neon::dup_lane(m1, 0)); - float32x4_t w1 = neon::copy_lane(neon::dupq_lane(m3, 1), 3, m2, 1); - float32x4_t w2 = neon::copy_lane(neon::dupq_lane(m3, 0), 3, m2, 0); - float32x4_t w3 = vcombine_f32(neon::dup_lane(m2, 1), neon::dup_lane(m1, 1)); - Fac5 = w0 * w1 - w2 * w3; - } - - float32x4_t Vec0 = neon::copy_lane(neon::dupq_lane(m0, 0), 0, m1, 0); // (m[1][0], m[0][0], m[0][0], m[0][0]); - float32x4_t Vec1 = neon::copy_lane(neon::dupq_lane(m0, 1), 0, m1, 1); // (m[1][1], m[0][1], m[0][1], m[0][1]); - float32x4_t Vec2 = neon::copy_lane(neon::dupq_lane(m0, 2), 0, m1, 2); // (m[1][2], m[0][2], m[0][2], m[0][2]); - float32x4_t Vec3 = neon::copy_lane(neon::dupq_lane(m0, 3), 0, m1, 3); // (m[1][3], m[0][3], m[0][3], m[0][3]); - - float32x4_t Inv0 = Vec1 * Fac0 - Vec2 * Fac1 + Vec3 * Fac2; - float32x4_t Inv1 = Vec0 * Fac0 - Vec2 * Fac3 + Vec3 * Fac4; - float32x4_t Inv2 = Vec0 * Fac1 - Vec1 * Fac3 + Vec3 * Fac5; - float32x4_t Inv3 = Vec0 * Fac2 - Vec1 * Fac4 + Vec2 * Fac5; - - float32x4_t r0 = float32x4_t{-1, +1, -1, +1} * Inv0; - float32x4_t r1 = float32x4_t{+1, -1, +1, -1} * Inv1; - float32x4_t r2 = float32x4_t{-1, +1, -1, +1} * Inv2; - float32x4_t r3 = float32x4_t{+1, -1, +1, -1} * Inv3; - - float32x4_t det = neon::mul_lane(r0, m0, 0); - det = neon::madd_lane(det, r1, m0, 1); - det = neon::madd_lane(det, r2, m0, 2); - det = neon::madd_lane(det, r3, m0, 3); - - float32x4_t rdet = vdupq_n_f32(1 / vgetq_lane_f32(det, 0)); - - mat<4, 4, float, Q> r; - r[0].data = vmulq_f32(r0, rdet); - r[1].data = vmulq_f32(r1, rdet); - r[2].data = vmulq_f32(r2, rdet); - r[3].data = vmulq_f32(r3, rdet); - return r; - } - }; -}//namespace glm -#endif diff --git a/3rdparty/glm/source/glm/detail/func_packing.inl b/3rdparty/glm/source/glm/detail/func_packing.inl deleted file mode 100644 index 234b093..0000000 --- a/3rdparty/glm/source/glm/detail/func_packing.inl +++ /dev/null @@ -1,189 +0,0 @@ -/// @ref core -/// @file glm/detail/func_packing.inl - -#include "../common.hpp" -#include "type_half.hpp" - -namespace glm -{ - GLM_FUNC_QUALIFIER uint packUnorm2x16(vec2 const& v) - { - union - { - unsigned short in[2]; - uint out; - } u; - - vec<2, unsigned short, defaultp> result(round(clamp(v, 0.0f, 1.0f) * 65535.0f)); - - u.in[0] = result[0]; - u.in[1] = result[1]; - - return u.out; - } - - GLM_FUNC_QUALIFIER vec2 unpackUnorm2x16(uint p) - { - union - { - uint in; - unsigned short out[2]; - } u; - - u.in = p; - - return vec2(u.out[0], u.out[1]) * 1.5259021896696421759365224689097e-5f; - } - - GLM_FUNC_QUALIFIER uint packSnorm2x16(vec2 const& v) - { - union - { - signed short in[2]; - uint out; - } u; - - vec<2, short, defaultp> result(round(clamp(v, -1.0f, 1.0f) * 32767.0f)); - - u.in[0] = result[0]; - u.in[1] = result[1]; - - return u.out; - } - - GLM_FUNC_QUALIFIER vec2 unpackSnorm2x16(uint p) - { - union - { - uint in; - signed short out[2]; - } u; - - u.in = p; - - return clamp(vec2(u.out[0], u.out[1]) * 3.0518509475997192297128208258309e-5f, -1.0f, 1.0f); - } - - GLM_FUNC_QUALIFIER uint packUnorm4x8(vec4 const& v) - { - union - { - unsigned char in[4]; - uint out; - } u; - - vec<4, unsigned char, defaultp> result(round(clamp(v, 0.0f, 1.0f) * 255.0f)); - - u.in[0] = result[0]; - u.in[1] = result[1]; - u.in[2] = result[2]; - u.in[3] = result[3]; - - return u.out; - } - - GLM_FUNC_QUALIFIER vec4 unpackUnorm4x8(uint p) - { - union - { - uint in; - unsigned char out[4]; - } u; - - u.in = p; - - return vec4(u.out[0], u.out[1], u.out[2], u.out[3]) * 0.0039215686274509803921568627451f; - } - - GLM_FUNC_QUALIFIER uint packSnorm4x8(vec4 const& v) - { - union - { - signed char in[4]; - uint out; - } u; - - vec<4, signed char, defaultp> result(round(clamp(v, -1.0f, 1.0f) * 127.0f)); - - u.in[0] = result[0]; - u.in[1] = result[1]; - u.in[2] = result[2]; - u.in[3] = result[3]; - - return u.out; - } - - GLM_FUNC_QUALIFIER glm::vec4 unpackSnorm4x8(uint p) - { - union - { - uint in; - signed char out[4]; - } u; - - u.in = p; - - return clamp(vec4(u.out[0], u.out[1], u.out[2], u.out[3]) * 0.0078740157480315f, -1.0f, 1.0f); - } - - GLM_FUNC_QUALIFIER double packDouble2x32(uvec2 const& v) - { - union - { - uint in[2]; - double out; - } u; - - u.in[0] = v[0]; - u.in[1] = v[1]; - - return u.out; - } - - GLM_FUNC_QUALIFIER uvec2 unpackDouble2x32(double v) - { - union - { - double in; - uint out[2]; - } u; - - u.in = v; - - return uvec2(u.out[0], u.out[1]); - } - - GLM_FUNC_QUALIFIER uint packHalf2x16(vec2 const& v) - { - union - { - signed short in[2]; - uint out; - } u; - - u.in[0] = detail::toFloat16(v.x); - u.in[1] = detail::toFloat16(v.y); - - return u.out; - } - - GLM_FUNC_QUALIFIER vec2 unpackHalf2x16(uint v) - { - union - { - uint in; - signed short out[2]; - } u; - - u.in = v; - - return vec2( - detail::toFloat32(u.out[0]), - detail::toFloat32(u.out[1])); - } -}//namespace glm - -#if GLM_CONFIG_SIMD == GLM_ENABLE -# include "func_packing_simd.inl" -#endif - diff --git a/3rdparty/glm/source/glm/detail/func_packing_simd.inl b/3rdparty/glm/source/glm/detail/func_packing_simd.inl deleted file mode 100644 index fd0fe8b..0000000 --- a/3rdparty/glm/source/glm/detail/func_packing_simd.inl +++ /dev/null @@ -1,6 +0,0 @@ -namespace glm{ -namespace detail -{ - -}//namespace detail -}//namespace glm diff --git a/3rdparty/glm/source/glm/detail/func_trigonometric.inl b/3rdparty/glm/source/glm/detail/func_trigonometric.inl deleted file mode 100644 index e129dce..0000000 --- a/3rdparty/glm/source/glm/detail/func_trigonometric.inl +++ /dev/null @@ -1,197 +0,0 @@ -#include "_vectorize.hpp" -#include -#include - -namespace glm -{ - // radians - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType radians(genType degrees) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'radians' only accept floating-point input"); - - return degrees * static_cast(0.01745329251994329576923690768489); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec radians(vec const& v) - { - return detail::functor1::call(radians, v); - } - - // degrees - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType degrees(genType radians) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'degrees' only accept floating-point input"); - - return radians * static_cast(57.295779513082320876798154814105); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec degrees(vec const& v) - { - return detail::functor1::call(degrees, v); - } - - // sin - using ::std::sin; - - template - GLM_FUNC_QUALIFIER vec sin(vec const& v) - { - return detail::functor1::call(sin, v); - } - - // cos - using std::cos; - - template - GLM_FUNC_QUALIFIER vec cos(vec const& v) - { - return detail::functor1::call(cos, v); - } - - // tan - using std::tan; - - template - GLM_FUNC_QUALIFIER vec tan(vec const& v) - { - return detail::functor1::call(tan, v); - } - - // asin - using std::asin; - - template - GLM_FUNC_QUALIFIER vec asin(vec const& v) - { - return detail::functor1::call(asin, v); - } - - // acos - using std::acos; - - template - GLM_FUNC_QUALIFIER vec acos(vec const& v) - { - return detail::functor1::call(acos, v); - } - - // atan - template - GLM_FUNC_QUALIFIER genType atan(genType y, genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'atan' only accept floating-point input"); - - return ::std::atan2(y, x); - } - - template - GLM_FUNC_QUALIFIER vec atan(vec const& a, vec const& b) - { - return detail::functor2::call(::std::atan2, a, b); - } - - using std::atan; - - template - GLM_FUNC_QUALIFIER vec atan(vec const& v) - { - return detail::functor1::call(atan, v); - } - - // sinh - using std::sinh; - - template - GLM_FUNC_QUALIFIER vec sinh(vec const& v) - { - return detail::functor1::call(sinh, v); - } - - // cosh - using std::cosh; - - template - GLM_FUNC_QUALIFIER vec cosh(vec const& v) - { - return detail::functor1::call(cosh, v); - } - - // tanh - using std::tanh; - - template - GLM_FUNC_QUALIFIER vec tanh(vec const& v) - { - return detail::functor1::call(tanh, v); - } - - // asinh -# if GLM_HAS_CXX11_STL - using std::asinh; -# else - template - GLM_FUNC_QUALIFIER genType asinh(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'asinh' only accept floating-point input"); - - return (x < static_cast(0) ? static_cast(-1) : (x > static_cast(0) ? static_cast(1) : static_cast(0))) * log(std::abs(x) + sqrt(static_cast(1) + x * x)); - } -# endif - - template - GLM_FUNC_QUALIFIER vec asinh(vec const& v) - { - return detail::functor1::call(asinh, v); - } - - // acosh -# if GLM_HAS_CXX11_STL - using std::acosh; -# else - template - GLM_FUNC_QUALIFIER genType acosh(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acosh' only accept floating-point input"); - - if(x < static_cast(1)) - return static_cast(0); - return log(x + sqrt(x * x - static_cast(1))); - } -# endif - - template - GLM_FUNC_QUALIFIER vec acosh(vec const& v) - { - return detail::functor1::call(acosh, v); - } - - // atanh -# if GLM_HAS_CXX11_STL - using std::atanh; -# else - template - GLM_FUNC_QUALIFIER genType atanh(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'atanh' only accept floating-point input"); - - if(std::abs(x) >= static_cast(1)) - return 0; - return static_cast(0.5) * log((static_cast(1) + x) / (static_cast(1) - x)); - } -# endif - - template - GLM_FUNC_QUALIFIER vec atanh(vec const& v) - { - return detail::functor1::call(atanh, v); - } -}//namespace glm - -#if GLM_CONFIG_SIMD == GLM_ENABLE -# include "func_trigonometric_simd.inl" -#endif - diff --git a/3rdparty/glm/source/glm/detail/func_trigonometric_simd.inl b/3rdparty/glm/source/glm/detail/func_trigonometric_simd.inl deleted file mode 100644 index e69de29..0000000 diff --git a/3rdparty/glm/source/glm/detail/func_vector_relational.inl b/3rdparty/glm/source/glm/detail/func_vector_relational.inl deleted file mode 100644 index 80c9e87..0000000 --- a/3rdparty/glm/source/glm/detail/func_vector_relational.inl +++ /dev/null @@ -1,87 +0,0 @@ -namespace glm -{ - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec lessThan(vec const& x, vec const& y) - { - vec Result(true); - for(length_t i = 0; i < L; ++i) - Result[i] = x[i] < y[i]; - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec lessThanEqual(vec const& x, vec const& y) - { - vec Result(true); - for(length_t i = 0; i < L; ++i) - Result[i] = x[i] <= y[i]; - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec greaterThan(vec const& x, vec const& y) - { - vec Result(true); - for(length_t i = 0; i < L; ++i) - Result[i] = x[i] > y[i]; - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec greaterThanEqual(vec const& x, vec const& y) - { - vec Result(true); - for(length_t i = 0; i < L; ++i) - Result[i] = x[i] >= y[i]; - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(vec const& x, vec const& y) - { - vec Result(true); - for(length_t i = 0; i < L; ++i) - Result[i] = x[i] == y[i]; - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y) - { - vec Result(true); - for(length_t i = 0; i < L; ++i) - Result[i] = x[i] != y[i]; - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool any(vec const& v) - { - bool Result = false; - for(length_t i = 0; i < L; ++i) - Result = Result || v[i]; - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool all(vec const& v) - { - bool Result = true; - for(length_t i = 0; i < L; ++i) - Result = Result && v[i]; - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec not_(vec const& v) - { - vec Result(true); - for(length_t i = 0; i < L; ++i) - Result[i] = !v[i]; - return Result; - } -}//namespace glm - -#if GLM_CONFIG_SIMD == GLM_ENABLE -# include "func_vector_relational_simd.inl" -#endif diff --git a/3rdparty/glm/source/glm/detail/func_vector_relational_simd.inl b/3rdparty/glm/source/glm/detail/func_vector_relational_simd.inl deleted file mode 100644 index fd0fe8b..0000000 --- a/3rdparty/glm/source/glm/detail/func_vector_relational_simd.inl +++ /dev/null @@ -1,6 +0,0 @@ -namespace glm{ -namespace detail -{ - -}//namespace detail -}//namespace glm diff --git a/3rdparty/glm/source/glm/detail/glm.cpp b/3rdparty/glm/source/glm/detail/glm.cpp deleted file mode 100644 index e0755bd..0000000 --- a/3rdparty/glm/source/glm/detail/glm.cpp +++ /dev/null @@ -1,263 +0,0 @@ -/// @ref core -/// @file glm/glm.cpp - -#ifndef GLM_ENABLE_EXPERIMENTAL -#define GLM_ENABLE_EXPERIMENTAL -#endif -#include -#include -#include -#include -#include -#include - -namespace glm -{ -// tvec1 type explicit instantiation -template struct vec<1, uint8, lowp>; -template struct vec<1, uint16, lowp>; -template struct vec<1, uint32, lowp>; -template struct vec<1, uint64, lowp>; -template struct vec<1, int8, lowp>; -template struct vec<1, int16, lowp>; -template struct vec<1, int32, lowp>; -template struct vec<1, int64, lowp>; -template struct vec<1, float32, lowp>; -template struct vec<1, float64, lowp>; - -template struct vec<1, uint8, mediump>; -template struct vec<1, uint16, mediump>; -template struct vec<1, uint32, mediump>; -template struct vec<1, uint64, mediump>; -template struct vec<1, int8, mediump>; -template struct vec<1, int16, mediump>; -template struct vec<1, int32, mediump>; -template struct vec<1, int64, mediump>; -template struct vec<1, float32, mediump>; -template struct vec<1, float64, mediump>; - -template struct vec<1, uint8, highp>; -template struct vec<1, uint16, highp>; -template struct vec<1, uint32, highp>; -template struct vec<1, uint64, highp>; -template struct vec<1, int8, highp>; -template struct vec<1, int16, highp>; -template struct vec<1, int32, highp>; -template struct vec<1, int64, highp>; -template struct vec<1, float32, highp>; -template struct vec<1, float64, highp>; - -// tvec2 type explicit instantiation -template struct vec<2, uint8, lowp>; -template struct vec<2, uint16, lowp>; -template struct vec<2, uint32, lowp>; -template struct vec<2, uint64, lowp>; -template struct vec<2, int8, lowp>; -template struct vec<2, int16, lowp>; -template struct vec<2, int32, lowp>; -template struct vec<2, int64, lowp>; -template struct vec<2, float32, lowp>; -template struct vec<2, float64, lowp>; - -template struct vec<2, uint8, mediump>; -template struct vec<2, uint16, mediump>; -template struct vec<2, uint32, mediump>; -template struct vec<2, uint64, mediump>; -template struct vec<2, int8, mediump>; -template struct vec<2, int16, mediump>; -template struct vec<2, int32, mediump>; -template struct vec<2, int64, mediump>; -template struct vec<2, float32, mediump>; -template struct vec<2, float64, mediump>; - -template struct vec<2, uint8, highp>; -template struct vec<2, uint16, highp>; -template struct vec<2, uint32, highp>; -template struct vec<2, uint64, highp>; -template struct vec<2, int8, highp>; -template struct vec<2, int16, highp>; -template struct vec<2, int32, highp>; -template struct vec<2, int64, highp>; -template struct vec<2, float32, highp>; -template struct vec<2, float64, highp>; - -// tvec3 type explicit instantiation -template struct vec<3, uint8, lowp>; -template struct vec<3, uint16, lowp>; -template struct vec<3, uint32, lowp>; -template struct vec<3, uint64, lowp>; -template struct vec<3, int8, lowp>; -template struct vec<3, int16, lowp>; -template struct vec<3, int32, lowp>; -template struct vec<3, int64, lowp>; -template struct vec<3, float32, lowp>; -template struct vec<3, float64, lowp>; - -template struct vec<3, uint8, mediump>; -template struct vec<3, uint16, mediump>; -template struct vec<3, uint32, mediump>; -template struct vec<3, uint64, mediump>; -template struct vec<3, int8, mediump>; -template struct vec<3, int16, mediump>; -template struct vec<3, int32, mediump>; -template struct vec<3, int64, mediump>; -template struct vec<3, float32, mediump>; -template struct vec<3, float64, mediump>; - -template struct vec<3, uint8, highp>; -template struct vec<3, uint16, highp>; -template struct vec<3, uint32, highp>; -template struct vec<3, uint64, highp>; -template struct vec<3, int8, highp>; -template struct vec<3, int16, highp>; -template struct vec<3, int32, highp>; -template struct vec<3, int64, highp>; -template struct vec<3, float32, highp>; -template struct vec<3, float64, highp>; - -// tvec4 type explicit instantiation -template struct vec<4, uint8, lowp>; -template struct vec<4, uint16, lowp>; -template struct vec<4, uint32, lowp>; -template struct vec<4, uint64, lowp>; -template struct vec<4, int8, lowp>; -template struct vec<4, int16, lowp>; -template struct vec<4, int32, lowp>; -template struct vec<4, int64, lowp>; -template struct vec<4, float32, lowp>; -template struct vec<4, float64, lowp>; - -template struct vec<4, uint8, mediump>; -template struct vec<4, uint16, mediump>; -template struct vec<4, uint32, mediump>; -template struct vec<4, uint64, mediump>; -template struct vec<4, int8, mediump>; -template struct vec<4, int16, mediump>; -template struct vec<4, int32, mediump>; -template struct vec<4, int64, mediump>; -template struct vec<4, float32, mediump>; -template struct vec<4, float64, mediump>; - -template struct vec<4, uint8, highp>; -template struct vec<4, uint16, highp>; -template struct vec<4, uint32, highp>; -template struct vec<4, uint64, highp>; -template struct vec<4, int8, highp>; -template struct vec<4, int16, highp>; -template struct vec<4, int32, highp>; -template struct vec<4, int64, highp>; -template struct vec<4, float32, highp>; -template struct vec<4, float64, highp>; - -// tmat2x2 type explicit instantiation -template struct mat<2, 2, float32, lowp>; -template struct mat<2, 2, float64, lowp>; - -template struct mat<2, 2, float32, mediump>; -template struct mat<2, 2, float64, mediump>; - -template struct mat<2, 2, float32, highp>; -template struct mat<2, 2, float64, highp>; - -// tmat2x3 type explicit instantiation -template struct mat<2, 3, float32, lowp>; -template struct mat<2, 3, float64, lowp>; - -template struct mat<2, 3, float32, mediump>; -template struct mat<2, 3, float64, mediump>; - -template struct mat<2, 3, float32, highp>; -template struct mat<2, 3, float64, highp>; - -// tmat2x4 type explicit instantiation -template struct mat<2, 4, float32, lowp>; -template struct mat<2, 4, float64, lowp>; - -template struct mat<2, 4, float32, mediump>; -template struct mat<2, 4, float64, mediump>; - -template struct mat<2, 4, float32, highp>; -template struct mat<2, 4, float64, highp>; - -// tmat3x2 type explicit instantiation -template struct mat<3, 2, float32, lowp>; -template struct mat<3, 2, float64, lowp>; - -template struct mat<3, 2, float32, mediump>; -template struct mat<3, 2, float64, mediump>; - -template struct mat<3, 2, float32, highp>; -template struct mat<3, 2, float64, highp>; - -// tmat3x3 type explicit instantiation -template struct mat<3, 3, float32, lowp>; -template struct mat<3, 3, float64, lowp>; - -template struct mat<3, 3, float32, mediump>; -template struct mat<3, 3, float64, mediump>; - -template struct mat<3, 3, float32, highp>; -template struct mat<3, 3, float64, highp>; - -// tmat3x4 type explicit instantiation -template struct mat<3, 4, float32, lowp>; -template struct mat<3, 4, float64, lowp>; - -template struct mat<3, 4, float32, mediump>; -template struct mat<3, 4, float64, mediump>; - -template struct mat<3, 4, float32, highp>; -template struct mat<3, 4, float64, highp>; - -// tmat4x2 type explicit instantiation -template struct mat<4, 2, float32, lowp>; -template struct mat<4, 2, float64, lowp>; - -template struct mat<4, 2, float32, mediump>; -template struct mat<4, 2, float64, mediump>; - -template struct mat<4, 2, float32, highp>; -template struct mat<4, 2, float64, highp>; - -// tmat4x3 type explicit instantiation -template struct mat<4, 3, float32, lowp>; -template struct mat<4, 3, float64, lowp>; - -template struct mat<4, 3, float32, mediump>; -template struct mat<4, 3, float64, mediump>; - -template struct mat<4, 3, float32, highp>; -template struct mat<4, 3, float64, highp>; - -// tmat4x4 type explicit instantiation -template struct mat<4, 4, float32, lowp>; -template struct mat<4, 4, float64, lowp>; - -template struct mat<4, 4, float32, mediump>; -template struct mat<4, 4, float64, mediump>; - -template struct mat<4, 4, float32, highp>; -template struct mat<4, 4, float64, highp>; - -// tquat type explicit instantiation -template struct qua; -template struct qua; - -template struct qua; -template struct qua; - -template struct qua; -template struct qua; - -//tdualquat type explicit instantiation -template struct tdualquat; -template struct tdualquat; - -template struct tdualquat; -template struct tdualquat; - -template struct tdualquat; -template struct tdualquat; - -}//namespace glm - diff --git a/3rdparty/glm/source/glm/detail/qualifier.hpp b/3rdparty/glm/source/glm/detail/qualifier.hpp deleted file mode 100644 index b6c9df0..0000000 --- a/3rdparty/glm/source/glm/detail/qualifier.hpp +++ /dev/null @@ -1,230 +0,0 @@ -#pragma once - -#include "setup.hpp" - -namespace glm -{ - /// Qualify GLM types in term of alignment (packed, aligned) and precision in term of ULPs (lowp, mediump, highp) - enum qualifier - { - packed_highp, ///< Typed data is tightly packed in memory and operations are executed with high precision in term of ULPs - packed_mediump, ///< Typed data is tightly packed in memory and operations are executed with medium precision in term of ULPs for higher performance - packed_lowp, ///< Typed data is tightly packed in memory and operations are executed with low precision in term of ULPs to maximize performance - -# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE - aligned_highp, ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs - aligned_mediump, ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs for higher performance - aligned_lowp, // ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs to maximize performance - aligned = aligned_highp, ///< By default aligned qualifier is also high precision -# endif - - highp = packed_highp, ///< By default highp qualifier is also packed - mediump = packed_mediump, ///< By default mediump qualifier is also packed - lowp = packed_lowp, ///< By default lowp qualifier is also packed - packed = packed_highp, ///< By default packed qualifier is also high precision - -# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE && defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES) - defaultp = aligned_highp -# else - defaultp = highp -# endif - }; - - typedef qualifier precision; - - template struct vec; - template struct mat; - template struct qua; - -# if GLM_HAS_TEMPLATE_ALIASES - template using tvec1 = vec<1, T, Q>; - template using tvec2 = vec<2, T, Q>; - template using tvec3 = vec<3, T, Q>; - template using tvec4 = vec<4, T, Q>; - template using tmat2x2 = mat<2, 2, T, Q>; - template using tmat2x3 = mat<2, 3, T, Q>; - template using tmat2x4 = mat<2, 4, T, Q>; - template using tmat3x2 = mat<3, 2, T, Q>; - template using tmat3x3 = mat<3, 3, T, Q>; - template using tmat3x4 = mat<3, 4, T, Q>; - template using tmat4x2 = mat<4, 2, T, Q>; - template using tmat4x3 = mat<4, 3, T, Q>; - template using tmat4x4 = mat<4, 4, T, Q>; - template using tquat = qua; -# endif - -namespace detail -{ - template - struct is_aligned - { - static const bool value = false; - }; - -# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE - template<> - struct is_aligned - { - static const bool value = true; - }; - - template<> - struct is_aligned - { - static const bool value = true; - }; - - template<> - struct is_aligned - { - static const bool value = true; - }; -# endif - - template - struct storage - { - typedef struct type { - T data[L]; - } type; - }; - -# if GLM_HAS_ALIGNOF - template - struct storage - { - typedef struct alignas(L * sizeof(T)) type { - T data[L]; - } type; - }; - - template - struct storage<3, T, true> - { - typedef struct alignas(4 * sizeof(T)) type { - T data[4]; - } type; - }; -# endif - -# if GLM_ARCH & GLM_ARCH_SSE2_BIT - template<> - struct storage<4, float, true> - { - typedef glm_f32vec4 type; - }; - - template<> - struct storage<4, int, true> - { - typedef glm_i32vec4 type; - }; - - template<> - struct storage<4, unsigned int, true> - { - typedef glm_u32vec4 type; - }; - - template<> - struct storage<2, double, true> - { - typedef glm_f64vec2 type; - }; - - template<> - struct storage<2, detail::int64, true> - { - typedef glm_i64vec2 type; - }; - - template<> - struct storage<2, detail::uint64, true> - { - typedef glm_u64vec2 type; - }; -# endif - -# if (GLM_ARCH & GLM_ARCH_AVX_BIT) - template<> - struct storage<4, double, true> - { - typedef glm_f64vec4 type; - }; -# endif - -# if (GLM_ARCH & GLM_ARCH_AVX2_BIT) - template<> - struct storage<4, detail::int64, true> - { - typedef glm_i64vec4 type; - }; - - template<> - struct storage<4, detail::uint64, true> - { - typedef glm_u64vec4 type; - }; -# endif - -# if GLM_ARCH & GLM_ARCH_NEON_BIT - template<> - struct storage<4, float, true> - { - typedef glm_f32vec4 type; - }; - - template<> - struct storage<4, int, true> - { - typedef glm_i32vec4 type; - }; - - template<> - struct storage<4, unsigned int, true> - { - typedef glm_u32vec4 type; - }; -# endif - - enum genTypeEnum - { - GENTYPE_VEC, - GENTYPE_MAT, - GENTYPE_QUAT - }; - - template - struct genTypeTrait - {}; - - template - struct genTypeTrait > - { - static const genTypeEnum GENTYPE = GENTYPE_MAT; - }; - - template - struct init_gentype - { - }; - - template - struct init_gentype - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genType identity() - { - return genType(1, 0, 0, 0); - } - }; - - template - struct init_gentype - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genType identity() - { - return genType(1); - } - }; -}//namespace detail -}//namespace glm diff --git a/3rdparty/glm/source/glm/detail/setup.hpp b/3rdparty/glm/source/glm/detail/setup.hpp deleted file mode 100644 index 51a6f49..0000000 --- a/3rdparty/glm/source/glm/detail/setup.hpp +++ /dev/null @@ -1,1156 +0,0 @@ -#ifndef GLM_SETUP_INCLUDED - -#include -#include - -#define GLM_VERSION_MAJOR 0 -#define GLM_VERSION_MINOR 9 -#define GLM_VERSION_PATCH 9 -#define GLM_VERSION_REVISION 9 -#define GLM_VERSION 999 -#define GLM_VERSION_MESSAGE "GLM: version 0.9.9.9" - -#define GLM_SETUP_INCLUDED GLM_VERSION - -/////////////////////////////////////////////////////////////////////////////////// -// Active states - -#define GLM_DISABLE 0 -#define GLM_ENABLE 1 - -/////////////////////////////////////////////////////////////////////////////////// -// Messages - -#if defined(GLM_FORCE_MESSAGES) -# define GLM_MESSAGES GLM_ENABLE -#else -# define GLM_MESSAGES GLM_DISABLE -#endif - -/////////////////////////////////////////////////////////////////////////////////// -// Detect the platform - -#include "../simd/platform.h" - -/////////////////////////////////////////////////////////////////////////////////// -// Build model - -#if defined(_M_ARM64) || defined(__LP64__) || defined(_M_X64) || defined(__ppc64__) || defined(__x86_64__) -# define GLM_MODEL GLM_MODEL_64 -#elif defined(__i386__) || defined(__ppc__) || defined(__ILP32__) || defined(_M_ARM) -# define GLM_MODEL GLM_MODEL_32 -#else -# define GLM_MODEL GLM_MODEL_32 -#endif// - -#if !defined(GLM_MODEL) && GLM_COMPILER != 0 -# error "GLM_MODEL undefined, your compiler may not be supported by GLM. Add #define GLM_MODEL 0 to ignore this message." -#endif//GLM_MODEL - -/////////////////////////////////////////////////////////////////////////////////// -// C++ Version - -// User defines: GLM_FORCE_CXX98, GLM_FORCE_CXX03, GLM_FORCE_CXX11, GLM_FORCE_CXX14, GLM_FORCE_CXX17, GLM_FORCE_CXX2A - -#define GLM_LANG_CXX98_FLAG (1 << 1) -#define GLM_LANG_CXX03_FLAG (1 << 2) -#define GLM_LANG_CXX0X_FLAG (1 << 3) -#define GLM_LANG_CXX11_FLAG (1 << 4) -#define GLM_LANG_CXX14_FLAG (1 << 5) -#define GLM_LANG_CXX17_FLAG (1 << 6) -#define GLM_LANG_CXX2A_FLAG (1 << 7) -#define GLM_LANG_CXXMS_FLAG (1 << 8) -#define GLM_LANG_CXXGNU_FLAG (1 << 9) - -#define GLM_LANG_CXX98 GLM_LANG_CXX98_FLAG -#define GLM_LANG_CXX03 (GLM_LANG_CXX98 | GLM_LANG_CXX03_FLAG) -#define GLM_LANG_CXX0X (GLM_LANG_CXX03 | GLM_LANG_CXX0X_FLAG) -#define GLM_LANG_CXX11 (GLM_LANG_CXX0X | GLM_LANG_CXX11_FLAG) -#define GLM_LANG_CXX14 (GLM_LANG_CXX11 | GLM_LANG_CXX14_FLAG) -#define GLM_LANG_CXX17 (GLM_LANG_CXX14 | GLM_LANG_CXX17_FLAG) -#define GLM_LANG_CXX2A (GLM_LANG_CXX17 | GLM_LANG_CXX2A_FLAG) -#define GLM_LANG_CXXMS GLM_LANG_CXXMS_FLAG -#define GLM_LANG_CXXGNU GLM_LANG_CXXGNU_FLAG - -#if (defined(_MSC_EXTENSIONS)) -# define GLM_LANG_EXT GLM_LANG_CXXMS_FLAG -#elif ((GLM_COMPILER & (GLM_COMPILER_CLANG | GLM_COMPILER_GCC)) && (GLM_ARCH & GLM_ARCH_SIMD_BIT)) -# define GLM_LANG_EXT GLM_LANG_CXXMS_FLAG -#else -# define GLM_LANG_EXT 0 -#endif - -#if (defined(GLM_FORCE_CXX_UNKNOWN)) -# define GLM_LANG 0 -#elif defined(GLM_FORCE_CXX2A) -# define GLM_LANG (GLM_LANG_CXX2A | GLM_LANG_EXT) -# define GLM_LANG_STL11_FORCED -#elif defined(GLM_FORCE_CXX17) -# define GLM_LANG (GLM_LANG_CXX17 | GLM_LANG_EXT) -# define GLM_LANG_STL11_FORCED -#elif defined(GLM_FORCE_CXX14) -# define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_EXT) -# define GLM_LANG_STL11_FORCED -#elif defined(GLM_FORCE_CXX11) -# define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_EXT) -# define GLM_LANG_STL11_FORCED -#elif defined(GLM_FORCE_CXX03) -# define GLM_LANG (GLM_LANG_CXX03 | GLM_LANG_EXT) -#elif defined(GLM_FORCE_CXX98) -# define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_EXT) -#else -# if GLM_COMPILER & GLM_COMPILER_VC && defined(_MSVC_LANG) -# if GLM_COMPILER >= GLM_COMPILER_VC15_7 -# define GLM_LANG_PLATFORM _MSVC_LANG -# elif GLM_COMPILER >= GLM_COMPILER_VC15 -# if _MSVC_LANG > 201402L -# define GLM_LANG_PLATFORM 201402L -# else -# define GLM_LANG_PLATFORM _MSVC_LANG -# endif -# else -# define GLM_LANG_PLATFORM 0 -# endif -# else -# define GLM_LANG_PLATFORM 0 -# endif - -# if __cplusplus > 201703L || GLM_LANG_PLATFORM > 201703L -# define GLM_LANG (GLM_LANG_CXX2A | GLM_LANG_EXT) -# elif __cplusplus == 201703L || GLM_LANG_PLATFORM == 201703L -# define GLM_LANG (GLM_LANG_CXX17 | GLM_LANG_EXT) -# elif __cplusplus == 201402L || __cplusplus == 201406L || __cplusplus == 201500L || GLM_LANG_PLATFORM == 201402L -# define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_EXT) -# elif __cplusplus == 201103L || GLM_LANG_PLATFORM == 201103L -# define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_EXT) -# elif defined(__INTEL_CXX11_MODE__) || defined(_MSC_VER) || defined(__GXX_EXPERIMENTAL_CXX0X__) -# define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_EXT) -# elif __cplusplus == 199711L -# define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_EXT) -# else -# define GLM_LANG (0 | GLM_LANG_EXT) -# endif -#endif - -/////////////////////////////////////////////////////////////////////////////////// -// Has of C++ features - -// http://clang.llvm.org/cxx_status.html -// http://gcc.gnu.org/projects/cxx0x.html -// http://msdn.microsoft.com/en-us/library/vstudio/hh567368(v=vs.120).aspx - -// Android has multiple STLs but C++11 STL detection doesn't always work #284 #564 -#if GLM_PLATFORM == GLM_PLATFORM_ANDROID && !defined(GLM_LANG_STL11_FORCED) -# define GLM_HAS_CXX11_STL 0 -#elif (GLM_COMPILER & GLM_COMPILER_CUDA_RTC) == GLM_COMPILER_CUDA_RTC -# define GLM_HAS_CXX11_STL 0 -#elif (GLM_COMPILER & GLM_COMPILER_HIP) -# define GLM_HAS_CXX11_STL 0 -#elif GLM_COMPILER & GLM_COMPILER_CLANG -# if (defined(_LIBCPP_VERSION) || (GLM_LANG & GLM_LANG_CXX11_FLAG) || defined(GLM_LANG_STL11_FORCED)) -# define GLM_HAS_CXX11_STL 1 -# else -# define GLM_HAS_CXX11_STL 0 -# endif -#elif GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_CXX11_STL 1 -#else -# define GLM_HAS_CXX11_STL ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC48)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ - ((GLM_PLATFORM != GLM_PLATFORM_WINDOWS) && (GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL15)))) -#endif - -// N1720 -#if GLM_COMPILER & GLM_COMPILER_CLANG -# define GLM_HAS_STATIC_ASSERT __has_feature(cxx_static_assert) -#elif GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_STATIC_ASSERT 1 -#else -# define GLM_HAS_STATIC_ASSERT ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC)) || \ - ((GLM_COMPILER & GLM_COMPILER_HIP)))) -#endif - -// N1988 -#if GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_EXTENDED_INTEGER_TYPE 1 -#else -# define GLM_HAS_EXTENDED_INTEGER_TYPE (\ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_VC)) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CUDA)) || \ - ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_CLANG)) || \ - ((GLM_COMPILER & GLM_COMPILER_HIP))) -#endif - -// N2672 Initializer lists http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm -#if GLM_COMPILER & GLM_COMPILER_CLANG -# define GLM_HAS_INITIALIZER_LISTS __has_feature(cxx_generalized_initializers) -#elif GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_INITIALIZER_LISTS 1 -#else -# define GLM_HAS_INITIALIZER_LISTS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)) || \ - ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \ - ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ - ((GLM_COMPILER & GLM_COMPILER_HIP)))) -#endif - -// N2544 Unrestricted unions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf -#if GLM_COMPILER & GLM_COMPILER_CLANG -# define GLM_HAS_UNRESTRICTED_UNIONS __has_feature(cxx_unrestricted_unions) -#elif GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_UNRESTRICTED_UNIONS 1 -#else -# define GLM_HAS_UNRESTRICTED_UNIONS (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - (GLM_COMPILER & GLM_COMPILER_VC) || \ - ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ - ((GLM_COMPILER & GLM_COMPILER_HIP))) -#endif - -// N2346 -#if GLM_COMPILER & GLM_COMPILER_CLANG -# define GLM_HAS_DEFAULTED_FUNCTIONS __has_feature(cxx_defaulted_functions) -#elif GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_DEFAULTED_FUNCTIONS 1 -#else -# define GLM_HAS_DEFAULTED_FUNCTIONS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ - ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ - (GLM_COMPILER & GLM_COMPILER_CUDA)) || \ - ((GLM_COMPILER & GLM_COMPILER_HIP))) -#endif - -// N2118 -#if GLM_COMPILER & GLM_COMPILER_CLANG -# define GLM_HAS_RVALUE_REFERENCES __has_feature(cxx_rvalue_references) -#elif GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_RVALUE_REFERENCES 1 -#else -# define GLM_HAS_RVALUE_REFERENCES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_VC)) || \ - ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ - ((GLM_COMPILER & GLM_COMPILER_HIP)))) -#endif - -// N2437 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf -#if GLM_COMPILER & GLM_COMPILER_CLANG -# define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS __has_feature(cxx_explicit_conversions) -#elif GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS 1 -#else -# define GLM_HAS_EXPLICIT_CONVERSION_OPERATORS ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL14)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ - ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ - ((GLM_COMPILER & GLM_COMPILER_HIP)))) -#endif - -// N2258 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf -#if GLM_COMPILER & GLM_COMPILER_CLANG -# define GLM_HAS_TEMPLATE_ALIASES __has_feature(cxx_alias_templates) -#elif GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_TEMPLATE_ALIASES 1 -#else -# define GLM_HAS_TEMPLATE_ALIASES ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ - ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ - ((GLM_COMPILER & GLM_COMPILER_HIP)))) -#endif - -// N2930 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2930.html -#if GLM_COMPILER & GLM_COMPILER_CLANG -# define GLM_HAS_RANGE_FOR __has_feature(cxx_range_for) -#elif GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_RANGE_FOR 1 -#else -# define GLM_HAS_RANGE_FOR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC)) || \ - ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ - ((GLM_COMPILER & GLM_COMPILER_HIP)))) -#endif - -// N2341 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf -#if GLM_COMPILER & GLM_COMPILER_CLANG -# define GLM_HAS_ALIGNOF __has_feature(cxx_alignas) -#elif GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_ALIGNOF 1 -#else -# define GLM_HAS_ALIGNOF ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL15)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC14)) || \ - ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ - ((GLM_COMPILER & GLM_COMPILER_HIP)))) -#endif - -// N2235 Generalized Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf -// N3652 Extended Constant Expressions http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3652.html -#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) // Compiler SIMD intrinsics don't support constexpr... -# define GLM_HAS_CONSTEXPR 0 -#elif (GLM_COMPILER & GLM_COMPILER_CLANG) -# define GLM_HAS_CONSTEXPR __has_feature(cxx_relaxed_constexpr) -#elif (GLM_LANG & GLM_LANG_CXX14_FLAG) -# define GLM_HAS_CONSTEXPR 1 -#else -# define GLM_HAS_CONSTEXPR ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && GLM_HAS_INITIALIZER_LISTS && (\ - ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL17)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)))) -#endif - -#if GLM_HAS_CONSTEXPR -# define GLM_CONSTEXPR constexpr -#else -# define GLM_CONSTEXPR -#endif - -// -#if GLM_HAS_CONSTEXPR -# if (GLM_COMPILER & GLM_COMPILER_CLANG) -# if __has_feature(cxx_if_constexpr) -# define GLM_HAS_IF_CONSTEXPR 1 -# else -# define GLM_HAS_IF_CONSTEXPR 0 -# endif -# elif (GLM_LANG & GLM_LANG_CXX17_FLAG) -# define GLM_HAS_IF_CONSTEXPR 1 -# else -# define GLM_HAS_IF_CONSTEXPR 0 -# endif -#else -# define GLM_HAS_IF_CONSTEXPR 0 -#endif - -#if GLM_HAS_IF_CONSTEXPR -# define GLM_IF_CONSTEXPR if constexpr -#else -# define GLM_IF_CONSTEXPR if -#endif - -// -#if GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_ASSIGNABLE 1 -#else -# define GLM_HAS_ASSIGNABLE ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC15)) || \ - ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC49)))) -#endif - -// -#define GLM_HAS_TRIVIAL_QUERIES 0 - -// -#if GLM_LANG & GLM_LANG_CXX11_FLAG -# define GLM_HAS_MAKE_SIGNED 1 -#else -# define GLM_HAS_MAKE_SIGNED ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12)) || \ - ((GLM_COMPILER & GLM_COMPILER_CUDA)) || \ - ((GLM_COMPILER & GLM_COMPILER_HIP)))) -#endif - -// -#if defined(GLM_FORCE_INTRINSICS) -# define GLM_HAS_BITSCAN_WINDOWS ((GLM_PLATFORM & GLM_PLATFORM_WINDOWS) && (\ - ((GLM_COMPILER & GLM_COMPILER_INTEL)) || \ - ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC14) && (GLM_ARCH & GLM_ARCH_X86_BIT)))) -#else -# define GLM_HAS_BITSCAN_WINDOWS 0 -#endif - -/////////////////////////////////////////////////////////////////////////////////// -// OpenMP -#ifdef _OPENMP -# if GLM_COMPILER & GLM_COMPILER_GCC -# if GLM_COMPILER >= GLM_COMPILER_GCC61 -# define GLM_HAS_OPENMP 45 -# elif GLM_COMPILER >= GLM_COMPILER_GCC49 -# define GLM_HAS_OPENMP 40 -# elif GLM_COMPILER >= GLM_COMPILER_GCC47 -# define GLM_HAS_OPENMP 31 -# else -# define GLM_HAS_OPENMP 0 -# endif -# elif GLM_COMPILER & GLM_COMPILER_CLANG -# if GLM_COMPILER >= GLM_COMPILER_CLANG38 -# define GLM_HAS_OPENMP 31 -# else -# define GLM_HAS_OPENMP 0 -# endif -# elif GLM_COMPILER & GLM_COMPILER_VC -# define GLM_HAS_OPENMP 20 -# elif GLM_COMPILER & GLM_COMPILER_INTEL -# if GLM_COMPILER >= GLM_COMPILER_INTEL16 -# define GLM_HAS_OPENMP 40 -# else -# define GLM_HAS_OPENMP 0 -# endif -# else -# define GLM_HAS_OPENMP 0 -# endif -#else -# define GLM_HAS_OPENMP 0 -#endif - -/////////////////////////////////////////////////////////////////////////////////// -// nullptr - -#if GLM_LANG & GLM_LANG_CXX0X_FLAG -# define GLM_CONFIG_NULLPTR GLM_ENABLE -#else -# define GLM_CONFIG_NULLPTR GLM_DISABLE -#endif - -#if GLM_CONFIG_NULLPTR == GLM_ENABLE -# define GLM_NULLPTR nullptr -#else -# define GLM_NULLPTR 0 -#endif - -/////////////////////////////////////////////////////////////////////////////////// -// Static assert - -#if GLM_HAS_STATIC_ASSERT -# define GLM_STATIC_ASSERT(x, message) static_assert(x, message) -#elif GLM_COMPILER & GLM_COMPILER_VC -# define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1] -#else -# define GLM_STATIC_ASSERT(x, message) assert(x) -#endif//GLM_LANG - -/////////////////////////////////////////////////////////////////////////////////// -// Qualifiers - -#if (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP) -# define GLM_CUDA_FUNC_DEF __device__ __host__ -# define GLM_CUDA_FUNC_DECL __device__ __host__ -#else -# define GLM_CUDA_FUNC_DEF -# define GLM_CUDA_FUNC_DECL -#endif - -#if defined(GLM_FORCE_INLINE) -# if GLM_COMPILER & GLM_COMPILER_VC -# define GLM_INLINE __forceinline -# define GLM_NEVER_INLINE __declspec((noinline)) -# elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG) -# define GLM_INLINE inline __attribute__((__always_inline__)) -# define GLM_NEVER_INLINE __attribute__((__noinline__)) -# elif (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP) -# define GLM_INLINE __forceinline__ -# define GLM_NEVER_INLINE __noinline__ -# else -# define GLM_INLINE inline -# define GLM_NEVER_INLINE -# endif//GLM_COMPILER -#else -# define GLM_INLINE inline -# define GLM_NEVER_INLINE -#endif//defined(GLM_FORCE_INLINE) - -#define GLM_FUNC_DECL GLM_CUDA_FUNC_DECL -#define GLM_FUNC_QUALIFIER GLM_CUDA_FUNC_DEF GLM_INLINE - -/////////////////////////////////////////////////////////////////////////////////// -// Swizzle operators - -// User defines: GLM_FORCE_SWIZZLE - -#define GLM_SWIZZLE_DISABLED 0 -#define GLM_SWIZZLE_OPERATOR 1 -#define GLM_SWIZZLE_FUNCTION 2 - -#if defined(GLM_SWIZZLE) -# pragma message("GLM: GLM_SWIZZLE is deprecated, use GLM_FORCE_SWIZZLE instead.") -# define GLM_FORCE_SWIZZLE -#endif - -#if defined(GLM_FORCE_SWIZZLE) && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && !defined(GLM_FORCE_XYZW_ONLY) -# define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_OPERATOR -#elif defined(GLM_FORCE_SWIZZLE) -# define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_FUNCTION -#else -# define GLM_CONFIG_SWIZZLE GLM_SWIZZLE_DISABLED -#endif - -/////////////////////////////////////////////////////////////////////////////////// -// Allows using not basic types as genType - -// #define GLM_FORCE_UNRESTRICTED_GENTYPE - -#ifdef GLM_FORCE_UNRESTRICTED_GENTYPE -# define GLM_CONFIG_UNRESTRICTED_GENTYPE GLM_ENABLE -#else -# define GLM_CONFIG_UNRESTRICTED_GENTYPE GLM_DISABLE -#endif - -/////////////////////////////////////////////////////////////////////////////////// -// Clip control, define GLM_FORCE_DEPTH_ZERO_TO_ONE before including GLM -// to use a clip space between 0 to 1. -// Coordinate system, define GLM_FORCE_LEFT_HANDED before including GLM -// to use left handed coordinate system by default. - -#define GLM_CLIP_CONTROL_ZO_BIT (1 << 0) // ZERO_TO_ONE -#define GLM_CLIP_CONTROL_NO_BIT (1 << 1) // NEGATIVE_ONE_TO_ONE -#define GLM_CLIP_CONTROL_LH_BIT (1 << 2) // LEFT_HANDED, For DirectX, Metal, Vulkan -#define GLM_CLIP_CONTROL_RH_BIT (1 << 3) // RIGHT_HANDED, For OpenGL, default in GLM - -#define GLM_CLIP_CONTROL_LH_ZO (GLM_CLIP_CONTROL_LH_BIT | GLM_CLIP_CONTROL_ZO_BIT) -#define GLM_CLIP_CONTROL_LH_NO (GLM_CLIP_CONTROL_LH_BIT | GLM_CLIP_CONTROL_NO_BIT) -#define GLM_CLIP_CONTROL_RH_ZO (GLM_CLIP_CONTROL_RH_BIT | GLM_CLIP_CONTROL_ZO_BIT) -#define GLM_CLIP_CONTROL_RH_NO (GLM_CLIP_CONTROL_RH_BIT | GLM_CLIP_CONTROL_NO_BIT) - -#ifdef GLM_FORCE_DEPTH_ZERO_TO_ONE -# ifdef GLM_FORCE_LEFT_HANDED -# define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_LH_ZO -# else -# define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_RH_ZO -# endif -#else -# ifdef GLM_FORCE_LEFT_HANDED -# define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_LH_NO -# else -# define GLM_CONFIG_CLIP_CONTROL GLM_CLIP_CONTROL_RH_NO -# endif -#endif - -/////////////////////////////////////////////////////////////////////////////////// -// Qualifiers - -#if (GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS)) -# define GLM_DEPRECATED __declspec(deprecated) -# define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef __declspec(align(alignment)) type name -#elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG | GLM_COMPILER_INTEL) -# define GLM_DEPRECATED __attribute__((__deprecated__)) -# define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __attribute__((aligned(alignment))) -#elif (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP) -# define GLM_DEPRECATED -# define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __align__(x) -#else -# define GLM_DEPRECATED -# define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name -#endif - -/////////////////////////////////////////////////////////////////////////////////// - -#ifdef GLM_FORCE_EXPLICIT_CTOR -# define GLM_EXPLICIT explicit -#else -# define GLM_EXPLICIT -#endif - -/////////////////////////////////////////////////////////////////////////////////// -// SYCL - -#if GLM_COMPILER==GLM_COMPILER_SYCL - -#include -#include - -namespace glm { -namespace std { - // Import SYCL's functions into the namespace glm::std to force their usages. - // It's important to use the math built-in function (sin, exp, ...) - // of SYCL instead the std ones. - using namespace cl::sycl; - - /////////////////////////////////////////////////////////////////////////////// - // Import some "harmless" std's stuffs used by glm into - // the new glm::std namespace. - template - using numeric_limits = ::std::numeric_limits; - - using ::std::size_t; - - using ::std::uint8_t; - using ::std::uint16_t; - using ::std::uint32_t; - using ::std::uint64_t; - - using ::std::int8_t; - using ::std::int16_t; - using ::std::int32_t; - using ::std::int64_t; - - using ::std::make_unsigned; - /////////////////////////////////////////////////////////////////////////////// -} //namespace std -} //namespace glm - -#endif - -/////////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////////// -// Length type: all length functions returns a length_t type. -// When GLM_FORCE_SIZE_T_LENGTH is defined, length_t is a typedef of size_t otherwise -// length_t is a typedef of int like GLSL defines it. - -#define GLM_LENGTH_INT 1 -#define GLM_LENGTH_SIZE_T 2 - -#ifdef GLM_FORCE_SIZE_T_LENGTH -# define GLM_CONFIG_LENGTH_TYPE GLM_LENGTH_SIZE_T -#else -# define GLM_CONFIG_LENGTH_TYPE GLM_LENGTH_INT -#endif - -namespace glm -{ - using std::size_t; -# if GLM_CONFIG_LENGTH_TYPE == GLM_LENGTH_SIZE_T - typedef size_t length_t; -# else - typedef int length_t; -# endif -}//namespace glm - -/////////////////////////////////////////////////////////////////////////////////// -// constexpr - -#if GLM_HAS_CONSTEXPR -# define GLM_CONFIG_CONSTEXP GLM_ENABLE - - namespace glm - { - template - constexpr std::size_t countof(T const (&)[N]) - { - return N; - } - }//namespace glm -# define GLM_COUNTOF(arr) glm::countof(arr) -#elif defined(_MSC_VER) -# define GLM_CONFIG_CONSTEXP GLM_DISABLE - -# define GLM_COUNTOF(arr) _countof(arr) -#else -# define GLM_CONFIG_CONSTEXP GLM_DISABLE - -# define GLM_COUNTOF(arr) sizeof(arr) / sizeof(arr[0]) -#endif - -/////////////////////////////////////////////////////////////////////////////////// -// uint - -namespace glm{ -namespace detail -{ - template - struct is_int - { - enum test {value = 0}; - }; - - template<> - struct is_int - { - enum test {value = ~0}; - }; - - template<> - struct is_int - { - enum test {value = ~0}; - }; -}//namespace detail - - typedef unsigned int uint; -}//namespace glm - -/////////////////////////////////////////////////////////////////////////////////// -// 64-bit int - -#if GLM_HAS_EXTENDED_INTEGER_TYPE -# include -#endif - -namespace glm{ -namespace detail -{ -# if GLM_HAS_EXTENDED_INTEGER_TYPE - typedef std::uint64_t uint64; - typedef std::int64_t int64; -# elif (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) // C99 detected, 64 bit types available - typedef uint64_t uint64; - typedef int64_t int64; -# elif GLM_COMPILER & GLM_COMPILER_VC - typedef unsigned __int64 uint64; - typedef signed __int64 int64; -# elif GLM_COMPILER & GLM_COMPILER_GCC -# pragma GCC diagnostic ignored "-Wlong-long" - __extension__ typedef unsigned long long uint64; - __extension__ typedef signed long long int64; -# elif (GLM_COMPILER & GLM_COMPILER_CLANG) -# pragma clang diagnostic ignored "-Wc++11-long-long" - typedef unsigned long long uint64; - typedef signed long long int64; -# else//unknown compiler - typedef unsigned long long uint64; - typedef signed long long int64; -# endif -}//namespace detail -}//namespace glm - -/////////////////////////////////////////////////////////////////////////////////// -// make_unsigned - -#if GLM_HAS_MAKE_SIGNED -# include - -namespace glm{ -namespace detail -{ - using std::make_unsigned; -}//namespace detail -}//namespace glm - -#else - -namespace glm{ -namespace detail -{ - template - struct make_unsigned - {}; - - template<> - struct make_unsigned - { - typedef unsigned char type; - }; - - template<> - struct make_unsigned - { - typedef unsigned char type; - }; - - template<> - struct make_unsigned - { - typedef unsigned short type; - }; - - template<> - struct make_unsigned - { - typedef unsigned int type; - }; - - template<> - struct make_unsigned - { - typedef unsigned long type; - }; - - template<> - struct make_unsigned - { - typedef uint64 type; - }; - - template<> - struct make_unsigned - { - typedef unsigned char type; - }; - - template<> - struct make_unsigned - { - typedef unsigned short type; - }; - - template<> - struct make_unsigned - { - typedef unsigned int type; - }; - - template<> - struct make_unsigned - { - typedef unsigned long type; - }; - - template<> - struct make_unsigned - { - typedef uint64 type; - }; -}//namespace detail -}//namespace glm -#endif - -/////////////////////////////////////////////////////////////////////////////////// -// Only use x, y, z, w as vector type components - -#ifdef GLM_FORCE_XYZW_ONLY -# define GLM_CONFIG_XYZW_ONLY GLM_ENABLE -#else -# define GLM_CONFIG_XYZW_ONLY GLM_DISABLE -#endif - -/////////////////////////////////////////////////////////////////////////////////// -// Configure the use of defaulted initialized types - -#define GLM_CTOR_INIT_DISABLE 0 -#define GLM_CTOR_INITIALIZER_LIST 1 -#define GLM_CTOR_INITIALISATION 2 - -#if defined(GLM_FORCE_CTOR_INIT) && GLM_HAS_INITIALIZER_LISTS -# define GLM_CONFIG_CTOR_INIT GLM_CTOR_INITIALIZER_LIST -#elif defined(GLM_FORCE_CTOR_INIT) && !GLM_HAS_INITIALIZER_LISTS -# define GLM_CONFIG_CTOR_INIT GLM_CTOR_INITIALISATION -#else -# define GLM_CONFIG_CTOR_INIT GLM_CTOR_INIT_DISABLE -#endif - -/////////////////////////////////////////////////////////////////////////////////// -// Use SIMD instruction sets - -#if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (GLM_ARCH & GLM_ARCH_SIMD_BIT) -# define GLM_CONFIG_SIMD GLM_ENABLE -#else -# define GLM_CONFIG_SIMD GLM_DISABLE -#endif - -/////////////////////////////////////////////////////////////////////////////////// -// Configure the use of defaulted function - -#if GLM_HAS_DEFAULTED_FUNCTIONS -# define GLM_CONFIG_DEFAULTED_FUNCTIONS GLM_ENABLE -# define GLM_DEFAULT = default -#else -# define GLM_CONFIG_DEFAULTED_FUNCTIONS GLM_DISABLE -# define GLM_DEFAULT -#endif - -#if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INIT_DISABLE && GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE -# define GLM_CONFIG_DEFAULTED_DEFAULT_CTOR GLM_ENABLE -# define GLM_DEFAULT_CTOR GLM_DEFAULT -#else -# define GLM_CONFIG_DEFAULTED_DEFAULT_CTOR GLM_DISABLE -# define GLM_DEFAULT_CTOR -#endif - -/////////////////////////////////////////////////////////////////////////////////// -// Configure the use of aligned gentypes - -#ifdef GLM_FORCE_ALIGNED // Legacy define -# define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES -#endif - -#ifdef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES -# define GLM_FORCE_ALIGNED_GENTYPES -#endif - -#if GLM_HAS_ALIGNOF && (GLM_LANG & GLM_LANG_CXXMS_FLAG) && (defined(GLM_FORCE_ALIGNED_GENTYPES) || (GLM_CONFIG_SIMD == GLM_ENABLE)) -# define GLM_CONFIG_ALIGNED_GENTYPES GLM_ENABLE -#else -# define GLM_CONFIG_ALIGNED_GENTYPES GLM_DISABLE -#endif - -/////////////////////////////////////////////////////////////////////////////////// -// Configure the use of anonymous structure as implementation detail - -#if ((GLM_CONFIG_SIMD == GLM_ENABLE) || (GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR) || (GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE)) -# define GLM_CONFIG_ANONYMOUS_STRUCT GLM_ENABLE -#else -# define GLM_CONFIG_ANONYMOUS_STRUCT GLM_DISABLE -#endif - -/////////////////////////////////////////////////////////////////////////////////// -// Silent warnings - -#ifdef GLM_FORCE_SILENT_WARNINGS -# define GLM_SILENT_WARNINGS GLM_ENABLE -#else -# define GLM_SILENT_WARNINGS GLM_DISABLE -#endif - -/////////////////////////////////////////////////////////////////////////////////// -// Precision - -#define GLM_HIGHP 1 -#define GLM_MEDIUMP 2 -#define GLM_LOWP 3 - -#if defined(GLM_FORCE_PRECISION_HIGHP_BOOL) || defined(GLM_PRECISION_HIGHP_BOOL) -# define GLM_CONFIG_PRECISION_BOOL GLM_HIGHP -#elif defined(GLM_FORCE_PRECISION_MEDIUMP_BOOL) || defined(GLM_PRECISION_MEDIUMP_BOOL) -# define GLM_CONFIG_PRECISION_BOOL GLM_MEDIUMP -#elif defined(GLM_FORCE_PRECISION_LOWP_BOOL) || defined(GLM_PRECISION_LOWP_BOOL) -# define GLM_CONFIG_PRECISION_BOOL GLM_LOWP -#else -# define GLM_CONFIG_PRECISION_BOOL GLM_HIGHP -#endif - -#if defined(GLM_FORCE_PRECISION_HIGHP_INT) || defined(GLM_PRECISION_HIGHP_INT) -# define GLM_CONFIG_PRECISION_INT GLM_HIGHP -#elif defined(GLM_FORCE_PRECISION_MEDIUMP_INT) || defined(GLM_PRECISION_MEDIUMP_INT) -# define GLM_CONFIG_PRECISION_INT GLM_MEDIUMP -#elif defined(GLM_FORCE_PRECISION_LOWP_INT) || defined(GLM_PRECISION_LOWP_INT) -# define GLM_CONFIG_PRECISION_INT GLM_LOWP -#else -# define GLM_CONFIG_PRECISION_INT GLM_HIGHP -#endif - -#if defined(GLM_FORCE_PRECISION_HIGHP_UINT) || defined(GLM_PRECISION_HIGHP_UINT) -# define GLM_CONFIG_PRECISION_UINT GLM_HIGHP -#elif defined(GLM_FORCE_PRECISION_MEDIUMP_UINT) || defined(GLM_PRECISION_MEDIUMP_UINT) -# define GLM_CONFIG_PRECISION_UINT GLM_MEDIUMP -#elif defined(GLM_FORCE_PRECISION_LOWP_UINT) || defined(GLM_PRECISION_LOWP_UINT) -# define GLM_CONFIG_PRECISION_UINT GLM_LOWP -#else -# define GLM_CONFIG_PRECISION_UINT GLM_HIGHP -#endif - -#if defined(GLM_FORCE_PRECISION_HIGHP_FLOAT) || defined(GLM_PRECISION_HIGHP_FLOAT) -# define GLM_CONFIG_PRECISION_FLOAT GLM_HIGHP -#elif defined(GLM_FORCE_PRECISION_MEDIUMP_FLOAT) || defined(GLM_PRECISION_MEDIUMP_FLOAT) -# define GLM_CONFIG_PRECISION_FLOAT GLM_MEDIUMP -#elif defined(GLM_FORCE_PRECISION_LOWP_FLOAT) || defined(GLM_PRECISION_LOWP_FLOAT) -# define GLM_CONFIG_PRECISION_FLOAT GLM_LOWP -#else -# define GLM_CONFIG_PRECISION_FLOAT GLM_HIGHP -#endif - -#if defined(GLM_FORCE_PRECISION_HIGHP_DOUBLE) || defined(GLM_PRECISION_HIGHP_DOUBLE) -# define GLM_CONFIG_PRECISION_DOUBLE GLM_HIGHP -#elif defined(GLM_FORCE_PRECISION_MEDIUMP_DOUBLE) || defined(GLM_PRECISION_MEDIUMP_DOUBLE) -# define GLM_CONFIG_PRECISION_DOUBLE GLM_MEDIUMP -#elif defined(GLM_FORCE_PRECISION_LOWP_DOUBLE) || defined(GLM_PRECISION_LOWP_DOUBLE) -# define GLM_CONFIG_PRECISION_DOUBLE GLM_LOWP -#else -# define GLM_CONFIG_PRECISION_DOUBLE GLM_HIGHP -#endif - -/////////////////////////////////////////////////////////////////////////////////// -// Check inclusions of different versions of GLM - -#elif ((GLM_SETUP_INCLUDED != GLM_VERSION) && !defined(GLM_FORCE_IGNORE_VERSION)) -# error "GLM error: A different version of GLM is already included. Define GLM_FORCE_IGNORE_VERSION before including GLM headers to ignore this error." -#elif GLM_SETUP_INCLUDED == GLM_VERSION - -/////////////////////////////////////////////////////////////////////////////////// -// Messages - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_MESSAGE_DISPLAYED) -# define GLM_MESSAGE_DISPLAYED -# define GLM_STR_HELPER(x) #x -# define GLM_STR(x) GLM_STR_HELPER(x) - - // Report GLM version -# pragma message (GLM_STR(GLM_VERSION_MESSAGE)) - - // Report C++ language -# if (GLM_LANG & GLM_LANG_CXX2A_FLAG) && (GLM_LANG & GLM_LANG_EXT) -# pragma message("GLM: C++ 2A with extensions") -# elif (GLM_LANG & GLM_LANG_CXX2A_FLAG) -# pragma message("GLM: C++ 2A") -# elif (GLM_LANG & GLM_LANG_CXX17_FLAG) && (GLM_LANG & GLM_LANG_EXT) -# pragma message("GLM: C++ 17 with extensions") -# elif (GLM_LANG & GLM_LANG_CXX17_FLAG) -# pragma message("GLM: C++ 17") -# elif (GLM_LANG & GLM_LANG_CXX14_FLAG) && (GLM_LANG & GLM_LANG_EXT) -# pragma message("GLM: C++ 14 with extensions") -# elif (GLM_LANG & GLM_LANG_CXX14_FLAG) -# pragma message("GLM: C++ 14") -# elif (GLM_LANG & GLM_LANG_CXX11_FLAG) && (GLM_LANG & GLM_LANG_EXT) -# pragma message("GLM: C++ 11 with extensions") -# elif (GLM_LANG & GLM_LANG_CXX11_FLAG) -# pragma message("GLM: C++ 11") -# elif (GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_LANG & GLM_LANG_EXT) -# pragma message("GLM: C++ 0x with extensions") -# elif (GLM_LANG & GLM_LANG_CXX0X_FLAG) -# pragma message("GLM: C++ 0x") -# elif (GLM_LANG & GLM_LANG_CXX03_FLAG) && (GLM_LANG & GLM_LANG_EXT) -# pragma message("GLM: C++ 03 with extensions") -# elif (GLM_LANG & GLM_LANG_CXX03_FLAG) -# pragma message("GLM: C++ 03") -# elif (GLM_LANG & GLM_LANG_CXX98_FLAG) && (GLM_LANG & GLM_LANG_EXT) -# pragma message("GLM: C++ 98 with extensions") -# elif (GLM_LANG & GLM_LANG_CXX98_FLAG) -# pragma message("GLM: C++ 98") -# else -# pragma message("GLM: C++ language undetected") -# endif//GLM_LANG - - // Report compiler detection -# if GLM_COMPILER & GLM_COMPILER_CUDA -# pragma message("GLM: CUDA compiler detected") -# elif GLM_COMPILER & GLM_COMPILER_HIP -# pragma message("GLM: HIP compiler detected") -# elif GLM_COMPILER & GLM_COMPILER_VC -# pragma message("GLM: Visual C++ compiler detected") -# elif GLM_COMPILER & GLM_COMPILER_CLANG -# pragma message("GLM: Clang compiler detected") -# elif GLM_COMPILER & GLM_COMPILER_INTEL -# pragma message("GLM: Intel Compiler detected") -# elif GLM_COMPILER & GLM_COMPILER_GCC -# pragma message("GLM: GCC compiler detected") -# else -# pragma message("GLM: Compiler not detected") -# endif - - // Report build target -# if (GLM_ARCH & GLM_ARCH_AVX2_BIT) && (GLM_MODEL == GLM_MODEL_64) -# pragma message("GLM: x86 64 bits with AVX2 instruction set build target") -# elif (GLM_ARCH & GLM_ARCH_AVX2_BIT) && (GLM_MODEL == GLM_MODEL_32) -# pragma message("GLM: x86 32 bits with AVX2 instruction set build target") - -# elif (GLM_ARCH & GLM_ARCH_AVX_BIT) && (GLM_MODEL == GLM_MODEL_64) -# pragma message("GLM: x86 64 bits with AVX instruction set build target") -# elif (GLM_ARCH & GLM_ARCH_AVX_BIT) && (GLM_MODEL == GLM_MODEL_32) -# pragma message("GLM: x86 32 bits with AVX instruction set build target") - -# elif (GLM_ARCH & GLM_ARCH_SSE42_BIT) && (GLM_MODEL == GLM_MODEL_64) -# pragma message("GLM: x86 64 bits with SSE4.2 instruction set build target") -# elif (GLM_ARCH & GLM_ARCH_SSE42_BIT) && (GLM_MODEL == GLM_MODEL_32) -# pragma message("GLM: x86 32 bits with SSE4.2 instruction set build target") - -# elif (GLM_ARCH & GLM_ARCH_SSE41_BIT) && (GLM_MODEL == GLM_MODEL_64) -# pragma message("GLM: x86 64 bits with SSE4.1 instruction set build target") -# elif (GLM_ARCH & GLM_ARCH_SSE41_BIT) && (GLM_MODEL == GLM_MODEL_32) -# pragma message("GLM: x86 32 bits with SSE4.1 instruction set build target") - -# elif (GLM_ARCH & GLM_ARCH_SSSE3_BIT) && (GLM_MODEL == GLM_MODEL_64) -# pragma message("GLM: x86 64 bits with SSSE3 instruction set build target") -# elif (GLM_ARCH & GLM_ARCH_SSSE3_BIT) && (GLM_MODEL == GLM_MODEL_32) -# pragma message("GLM: x86 32 bits with SSSE3 instruction set build target") - -# elif (GLM_ARCH & GLM_ARCH_SSE3_BIT) && (GLM_MODEL == GLM_MODEL_64) -# pragma message("GLM: x86 64 bits with SSE3 instruction set build target") -# elif (GLM_ARCH & GLM_ARCH_SSE3_BIT) && (GLM_MODEL == GLM_MODEL_32) -# pragma message("GLM: x86 32 bits with SSE3 instruction set build target") - -# elif (GLM_ARCH & GLM_ARCH_SSE2_BIT) && (GLM_MODEL == GLM_MODEL_64) -# pragma message("GLM: x86 64 bits with SSE2 instruction set build target") -# elif (GLM_ARCH & GLM_ARCH_SSE2_BIT) && (GLM_MODEL == GLM_MODEL_32) -# pragma message("GLM: x86 32 bits with SSE2 instruction set build target") - -# elif (GLM_ARCH & GLM_ARCH_X86_BIT) && (GLM_MODEL == GLM_MODEL_64) -# pragma message("GLM: x86 64 bits build target") -# elif (GLM_ARCH & GLM_ARCH_X86_BIT) && (GLM_MODEL == GLM_MODEL_32) -# pragma message("GLM: x86 32 bits build target") - -# elif (GLM_ARCH & GLM_ARCH_NEON_BIT) && (GLM_MODEL == GLM_MODEL_64) -# pragma message("GLM: ARM 64 bits with Neon instruction set build target") -# elif (GLM_ARCH & GLM_ARCH_NEON_BIT) && (GLM_MODEL == GLM_MODEL_32) -# pragma message("GLM: ARM 32 bits with Neon instruction set build target") - -# elif (GLM_ARCH & GLM_ARCH_ARM_BIT) && (GLM_MODEL == GLM_MODEL_64) -# pragma message("GLM: ARM 64 bits build target") -# elif (GLM_ARCH & GLM_ARCH_ARM_BIT) && (GLM_MODEL == GLM_MODEL_32) -# pragma message("GLM: ARM 32 bits build target") - -# elif (GLM_ARCH & GLM_ARCH_MIPS_BIT) && (GLM_MODEL == GLM_MODEL_64) -# pragma message("GLM: MIPS 64 bits build target") -# elif (GLM_ARCH & GLM_ARCH_MIPS_BIT) && (GLM_MODEL == GLM_MODEL_32) -# pragma message("GLM: MIPS 32 bits build target") - -# elif (GLM_ARCH & GLM_ARCH_PPC_BIT) && (GLM_MODEL == GLM_MODEL_64) -# pragma message("GLM: PowerPC 64 bits build target") -# elif (GLM_ARCH & GLM_ARCH_PPC_BIT) && (GLM_MODEL == GLM_MODEL_32) -# pragma message("GLM: PowerPC 32 bits build target") -# else -# pragma message("GLM: Unknown build target") -# endif//GLM_ARCH - - // Report platform name -# if(GLM_PLATFORM & GLM_PLATFORM_QNXNTO) -# pragma message("GLM: QNX platform detected") -//# elif(GLM_PLATFORM & GLM_PLATFORM_IOS) -//# pragma message("GLM: iOS platform detected") -# elif(GLM_PLATFORM & GLM_PLATFORM_APPLE) -# pragma message("GLM: Apple platform detected") -# elif(GLM_PLATFORM & GLM_PLATFORM_WINCE) -# pragma message("GLM: WinCE platform detected") -# elif(GLM_PLATFORM & GLM_PLATFORM_WINDOWS) -# pragma message("GLM: Windows platform detected") -# elif(GLM_PLATFORM & GLM_PLATFORM_CHROME_NACL) -# pragma message("GLM: Native Client detected") -# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) -# pragma message("GLM: Android platform detected") -# elif(GLM_PLATFORM & GLM_PLATFORM_LINUX) -# pragma message("GLM: Linux platform detected") -# elif(GLM_PLATFORM & GLM_PLATFORM_UNIX) -# pragma message("GLM: UNIX platform detected") -# elif(GLM_PLATFORM & GLM_PLATFORM_UNKNOWN) -# pragma message("GLM: platform unknown") -# else -# pragma message("GLM: platform not detected") -# endif - - // Report whether only xyzw component are used -# if defined GLM_FORCE_XYZW_ONLY -# pragma message("GLM: GLM_FORCE_XYZW_ONLY is defined. Only x, y, z and w component are available in vector type. This define disables swizzle operators and SIMD instruction sets.") -# endif - - // Report swizzle operator support -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR -# pragma message("GLM: GLM_FORCE_SWIZZLE is defined, swizzling operators enabled.") -# elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION -# pragma message("GLM: GLM_FORCE_SWIZZLE is defined, swizzling functions enabled. Enable compiler C++ language extensions to enable swizzle operators.") -# else -# pragma message("GLM: GLM_FORCE_SWIZZLE is undefined. swizzling functions or operators are disabled.") -# endif - - // Report .length() type -# if GLM_CONFIG_LENGTH_TYPE == GLM_LENGTH_SIZE_T -# pragma message("GLM: GLM_FORCE_SIZE_T_LENGTH is defined. .length() returns a glm::length_t, a typedef of std::size_t.") -# else -# pragma message("GLM: GLM_FORCE_SIZE_T_LENGTH is undefined. .length() returns a glm::length_t, a typedef of int following GLSL.") -# endif - -# if GLM_CONFIG_UNRESTRICTED_GENTYPE == GLM_ENABLE -# pragma message("GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is defined. Removes GLSL restrictions on valid function genTypes.") -# else -# pragma message("GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is undefined. Follows strictly GLSL on valid function genTypes.") -# endif - -# if GLM_SILENT_WARNINGS == GLM_ENABLE -# pragma message("GLM: GLM_FORCE_SILENT_WARNINGS is defined. Ignores C++ warnings from using C++ language extensions.") -# else -# pragma message("GLM: GLM_FORCE_SILENT_WARNINGS is undefined. Shows C++ warnings from using C++ language extensions.") -# endif - -# ifdef GLM_FORCE_SINGLE_ONLY -# pragma message("GLM: GLM_FORCE_SINGLE_ONLY is defined. Using only single precision floating-point types.") -# endif - -# if defined(GLM_FORCE_ALIGNED_GENTYPES) && (GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE) -# undef GLM_FORCE_ALIGNED_GENTYPES -# pragma message("GLM: GLM_FORCE_ALIGNED_GENTYPES is defined, allowing aligned types. This prevents the use of C++ constexpr.") -# elif defined(GLM_FORCE_ALIGNED_GENTYPES) && (GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE) -# undef GLM_FORCE_ALIGNED_GENTYPES -# pragma message("GLM: GLM_FORCE_ALIGNED_GENTYPES is defined but is disabled. It requires C++11 and language extensions.") -# endif - -# if defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES) -# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE -# undef GLM_FORCE_DEFAULT_ALIGNED_GENTYPES -# pragma message("GLM: GLM_FORCE_DEFAULT_ALIGNED_GENTYPES is defined but is disabled. It requires C++11 and language extensions.") -# elif GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE -# pragma message("GLM: GLM_FORCE_DEFAULT_ALIGNED_GENTYPES is defined. All gentypes (e.g. vec3) will be aligned and padded by default.") -# endif -# endif - -# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT -# pragma message("GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is defined. Using zero to one depth clip space.") -# else -# pragma message("GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is undefined. Using negative one to one depth clip space.") -# endif - -# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT -# pragma message("GLM: GLM_FORCE_LEFT_HANDED is defined. Using left handed coordinate system.") -# else -# pragma message("GLM: GLM_FORCE_LEFT_HANDED is undefined. Using right handed coordinate system.") -# endif -#endif//GLM_MESSAGES - -#endif//GLM_SETUP_INCLUDED diff --git a/3rdparty/glm/source/glm/detail/type_float.hpp b/3rdparty/glm/source/glm/detail/type_float.hpp deleted file mode 100644 index c8037eb..0000000 --- a/3rdparty/glm/source/glm/detail/type_float.hpp +++ /dev/null @@ -1,68 +0,0 @@ -#pragma once - -#include "setup.hpp" - -#if GLM_COMPILER == GLM_COMPILER_VC12 -# pragma warning(push) -# pragma warning(disable: 4512) // assignment operator could not be generated -#endif - -namespace glm{ -namespace detail -{ - template - union float_t - {}; - - // https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ - template <> - union float_t - { - typedef int int_type; - typedef float float_type; - - GLM_CONSTEXPR float_t(float_type Num = 0.0f) : f(Num) {} - - GLM_CONSTEXPR float_t& operator=(float_t const& x) - { - f = x.f; - return *this; - } - - // Portable extraction of components. - GLM_CONSTEXPR bool negative() const { return i < 0; } - GLM_CONSTEXPR int_type mantissa() const { return i & ((1 << 23) - 1); } - GLM_CONSTEXPR int_type exponent() const { return (i >> 23) & ((1 << 8) - 1); } - - int_type i; - float_type f; - }; - - template <> - union float_t - { - typedef detail::int64 int_type; - typedef double float_type; - - GLM_CONSTEXPR float_t(float_type Num = static_cast(0)) : f(Num) {} - - GLM_CONSTEXPR float_t& operator=(float_t const& x) - { - f = x.f; - return *this; - } - - // Portable extraction of components. - GLM_CONSTEXPR bool negative() const { return i < 0; } - GLM_CONSTEXPR int_type mantissa() const { return i & ((int_type(1) << 52) - 1); } - GLM_CONSTEXPR int_type exponent() const { return (i >> 52) & ((int_type(1) << 11) - 1); } - - int_type i; - float_type f; - }; -}//namespace detail -}//namespace glm - -#if GLM_COMPILER == GLM_COMPILER_VC12 -# pragma warning(pop) -#endif diff --git a/3rdparty/glm/source/glm/detail/type_half.hpp b/3rdparty/glm/source/glm/detail/type_half.hpp deleted file mode 100644 index 40b8bec..0000000 --- a/3rdparty/glm/source/glm/detail/type_half.hpp +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -#include "setup.hpp" - -namespace glm{ -namespace detail -{ - typedef short hdata; - - GLM_FUNC_DECL float toFloat32(hdata value); - GLM_FUNC_DECL hdata toFloat16(float const& value); - -}//namespace detail -}//namespace glm - -#include "type_half.inl" diff --git a/3rdparty/glm/source/glm/detail/type_half.inl b/3rdparty/glm/source/glm/detail/type_half.inl deleted file mode 100644 index 5d239cf..0000000 --- a/3rdparty/glm/source/glm/detail/type_half.inl +++ /dev/null @@ -1,241 +0,0 @@ -namespace glm{ -namespace detail -{ - GLM_FUNC_QUALIFIER float overflow() - { - volatile float f = 1e10; - - for(int i = 0; i < 10; ++i) - f = f * f; // this will overflow before the for loop terminates - return f; - } - - union uif32 - { - GLM_FUNC_QUALIFIER uif32() : - i(0) - {} - - GLM_FUNC_QUALIFIER uif32(float f_) : - f(f_) - {} - - GLM_FUNC_QUALIFIER uif32(unsigned int i_) : - i(i_) - {} - - float f; - unsigned int i; - }; - - GLM_FUNC_QUALIFIER float toFloat32(hdata value) - { - int s = (value >> 15) & 0x00000001; - int e = (value >> 10) & 0x0000001f; - int m = value & 0x000003ff; - - if(e == 0) - { - if(m == 0) - { - // - // Plus or minus zero - // - - detail::uif32 result; - result.i = static_cast(s << 31); - return result.f; - } - else - { - // - // Denormalized number -- renormalize it - // - - while(!(m & 0x00000400)) - { - m <<= 1; - e -= 1; - } - - e += 1; - m &= ~0x00000400; - } - } - else if(e == 31) - { - if(m == 0) - { - // - // Positive or negative infinity - // - - uif32 result; - result.i = static_cast((s << 31) | 0x7f800000); - return result.f; - } - else - { - // - // Nan -- preserve sign and significand bits - // - - uif32 result; - result.i = static_cast((s << 31) | 0x7f800000 | (m << 13)); - return result.f; - } - } - - // - // Normalized number - // - - e = e + (127 - 15); - m = m << 13; - - // - // Assemble s, e and m. - // - - uif32 Result; - Result.i = static_cast((s << 31) | (e << 23) | m); - return Result.f; - } - - GLM_FUNC_QUALIFIER hdata toFloat16(float const& f) - { - uif32 Entry; - Entry.f = f; - int i = static_cast(Entry.i); - - // - // Our floating point number, f, is represented by the bit - // pattern in integer i. Disassemble that bit pattern into - // the sign, s, the exponent, e, and the significand, m. - // Shift s into the position where it will go in the - // resulting half number. - // Adjust e, accounting for the different exponent bias - // of float and half (127 versus 15). - // - - int s = (i >> 16) & 0x00008000; - int e = ((i >> 23) & 0x000000ff) - (127 - 15); - int m = i & 0x007fffff; - - // - // Now reassemble s, e and m into a half: - // - - if(e <= 0) - { - if(e < -10) - { - // - // E is less than -10. The absolute value of f is - // less than half_MIN (f may be a small normalized - // float, a denormalized float or a zero). - // - // We convert f to a half zero. - // - - return hdata(s); - } - - // - // E is between -10 and 0. F is a normalized float, - // whose magnitude is less than __half_NRM_MIN. - // - // We convert f to a denormalized half. - // - - m = (m | 0x00800000) >> (1 - e); - - // - // Round to nearest, round "0.5" up. - // - // Rounding may cause the significand to overflow and make - // our number normalized. Because of the way a half's bits - // are laid out, we don't have to treat this case separately; - // the code below will handle it correctly. - // - - if(m & 0x00001000) - m += 0x00002000; - - // - // Assemble the half from s, e (zero) and m. - // - - return hdata(s | (m >> 13)); - } - else if(e == 0xff - (127 - 15)) - { - if(m == 0) - { - // - // F is an infinity; convert f to a half - // infinity with the same sign as f. - // - - return hdata(s | 0x7c00); - } - else - { - // - // F is a NAN; we produce a half NAN that preserves - // the sign bit and the 10 leftmost bits of the - // significand of f, with one exception: If the 10 - // leftmost bits are all zero, the NAN would turn - // into an infinity, so we have to set at least one - // bit in the significand. - // - - m >>= 13; - - return hdata(s | 0x7c00 | m | (m == 0)); - } - } - else - { - // - // E is greater than zero. F is a normalized float. - // We try to convert f to a normalized half. - // - - // - // Round to nearest, round "0.5" up - // - - if(m & 0x00001000) - { - m += 0x00002000; - - if(m & 0x00800000) - { - m = 0; // overflow in significand, - e += 1; // adjust exponent - } - } - - // - // Handle exponent overflow - // - - if (e > 30) - { - overflow(); // Cause a hardware floating point overflow; - - return hdata(s | 0x7c00); - // if this returns, the half becomes an - } // infinity with the same sign as f. - - // - // Assemble the half from s, e and m. - // - - return hdata(s | (e << 10) | (m >> 13)); - } - } - -}//namespace detail -}//namespace glm diff --git a/3rdparty/glm/source/glm/detail/type_mat2x2.hpp b/3rdparty/glm/source/glm/detail/type_mat2x2.hpp deleted file mode 100644 index 827022d..0000000 --- a/3rdparty/glm/source/glm/detail/type_mat2x2.hpp +++ /dev/null @@ -1,177 +0,0 @@ -/// @ref core -/// @file glm/detail/type_mat2x2.hpp - -#pragma once - -#include "type_vec2.hpp" -#include -#include - -namespace glm -{ - template - struct mat<2, 2, T, Q> - { - typedef vec<2, T, Q> col_type; - typedef vec<2, T, Q> row_type; - typedef mat<2, 2, T, Q> type; - typedef mat<2, 2, T, Q> transpose_type; - typedef T value_type; - - private: - col_type value[2]; - - public: - // -- Accesses -- - - typedef length_t length_type; - GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 2; } - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; - - // -- Constructors -- - - GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; - template - GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<2, 2, T, P> const& m); - - GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR mat( - T const& x1, T const& y1, - T const& x2, T const& y2); - GLM_FUNC_DECL GLM_CONSTEXPR mat( - col_type const& v1, - col_type const& v2); - - // -- Conversions -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat( - U const& x1, V const& y1, - M const& x2, N const& y2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat( - vec<2, U, Q> const& v1, - vec<2, V, Q> const& v2); - - // -- Matrix conversions -- - - template - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, U, P> const& m); - - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_DECL mat<2, 2, T, Q> & operator=(mat<2, 2, U, Q> const& m); - template - GLM_FUNC_DECL mat<2, 2, T, Q> & operator+=(U s); - template - GLM_FUNC_DECL mat<2, 2, T, Q> & operator+=(mat<2, 2, U, Q> const& m); - template - GLM_FUNC_DECL mat<2, 2, T, Q> & operator-=(U s); - template - GLM_FUNC_DECL mat<2, 2, T, Q> & operator-=(mat<2, 2, U, Q> const& m); - template - GLM_FUNC_DECL mat<2, 2, T, Q> & operator*=(U s); - template - GLM_FUNC_DECL mat<2, 2, T, Q> & operator*=(mat<2, 2, U, Q> const& m); - template - GLM_FUNC_DECL mat<2, 2, T, Q> & operator/=(U s); - template - GLM_FUNC_DECL mat<2, 2, T, Q> & operator/=(mat<2, 2, U, Q> const& m); - - // -- Increment and decrement operators -- - - GLM_FUNC_DECL mat<2, 2, T, Q> & operator++ (); - GLM_FUNC_DECL mat<2, 2, T, Q> & operator-- (); - GLM_FUNC_DECL mat<2, 2, T, Q> operator++(int); - GLM_FUNC_DECL mat<2, 2, T, Q> operator--(int); - }; - - // -- Unary operators -- - - template - GLM_FUNC_DECL mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m); - - template - GLM_FUNC_DECL mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m); - - // -- Binary operators -- - - template - GLM_FUNC_DECL mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<2, 2, T, Q> operator+(T scalar, mat<2, 2, T, Q> const& m); - - template - GLM_FUNC_DECL mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<2, 2, T, Q> operator-(T scalar, mat<2, 2, T, Q> const& m); - - template - GLM_FUNC_DECL mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<2, 2, T, Q> operator*(T scalar, mat<2, 2, T, Q> const& m); - - template - GLM_FUNC_DECL typename mat<2, 2, T, Q>::col_type operator*(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v); - - template - GLM_FUNC_DECL typename mat<2, 2, T, Q>::row_type operator*(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m); - - template - GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<2, 2, T, Q> operator/(T scalar, mat<2, 2, T, Q> const& m); - - template - GLM_FUNC_DECL typename mat<2, 2, T, Q>::col_type operator/(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v); - - template - GLM_FUNC_DECL typename mat<2, 2, T, Q>::row_type operator/(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m); - - template - GLM_FUNC_DECL mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); - - // -- Boolean operators -- - - template - GLM_FUNC_DECL bool operator==(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL bool operator!=(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2); -} //namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_mat2x2.inl" -#endif diff --git a/3rdparty/glm/source/glm/detail/type_mat2x2.inl b/3rdparty/glm/source/glm/detail/type_mat2x2.inl deleted file mode 100644 index 33159a6..0000000 --- a/3rdparty/glm/source/glm/detail/type_mat2x2.inl +++ /dev/null @@ -1,536 +0,0 @@ -#include "../matrix.hpp" - -namespace glm -{ - // -- Constructors -- - -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat() -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST - : value{col_type(1, 0), col_type(0, 1)} -# endif - { -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION - this->value[0] = col_type(1, 0); - this->value[1] = col_type(0, 1); -# endif - } -# endif - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<2, 2, T, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{m[0], m[1]} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = m[0]; - this->value[1] = m[1]; -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(T scalar) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(scalar, 0), col_type(0, scalar)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(scalar, 0); - this->value[1] = col_type(0, scalar); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat - ( - T const& x0, T const& y0, - T const& x1, T const& y1 - ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(x0, y0), col_type(x1, y1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x0, y0); - this->value[1] = col_type(x1, y1); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(col_type const& v0, col_type const& v1) -# if GLM_HAS_INITIALIZER_LISTS - : value{v0, v1} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = v0; - this->value[1] = v1; -# endif - } - - // -- Conversion constructors -- - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat - ( - X1 const& x1, Y1 const& y1, - X2 const& x2, Y2 const& y2 - ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(static_cast(x1), value_type(y1)), col_type(static_cast(x2), value_type(y2)) } -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(static_cast(x1), value_type(y1)); - this->value[1] = col_type(static_cast(x2), value_type(y2)); -# endif - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v1), col_type(v2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); -# endif - } - - // -- mat2x2 matrix conversions -- - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<2, 2, U, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<3, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<4, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } - - // -- Accesses -- - - template - GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::col_type& mat<2, 2, T, Q>::operator[](typename mat<2, 2, T, Q>::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 2, T, Q>::col_type const& mat<2, 2, T, Q>::operator[](typename mat<2, 2, T, Q>::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } - - // -- Unary updatable operators -- - - template - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator=(mat<2, 2, U, Q> const& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator+=(U scalar) - { - this->value[0] += scalar; - this->value[1] += scalar; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator+=(mat<2, 2, U, Q> const& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator-=(U scalar) - { - this->value[0] -= scalar; - this->value[1] -= scalar; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator-=(mat<2, 2, U, Q> const& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator*=(U scalar) - { - this->value[0] *= scalar; - this->value[1] *= scalar; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator*=(mat<2, 2, U, Q> const& m) - { - return (*this = *this * m); - } - - template - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator/=(U scalar) - { - this->value[0] /= scalar; - this->value[1] /= scalar; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator/=(mat<2, 2, U, Q> const& m) - { - return *this *= inverse(m); - } - - // -- Increment and decrement operators -- - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator++() - { - ++this->value[0]; - ++this->value[1]; - return *this; - } - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator--() - { - --this->value[0]; - --this->value[1]; - return *this; - } - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> mat<2, 2, T, Q>::operator++(int) - { - mat<2, 2, T, Q> Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> mat<2, 2, T, Q>::operator--(int) - { - mat<2, 2, T, Q> Result(*this); - --*this; - return Result; - } - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m) - { - return m; - } - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m) - { - return mat<2, 2, T, Q>( - -m[0], - -m[1]); - } - - // -- Binary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m, T scalar) - { - return mat<2, 2, T, Q>( - m[0] + scalar, - m[1] + scalar); - } - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator+(T scalar, mat<2, 2, T, Q> const& m) - { - return mat<2, 2, T, Q>( - m[0] + scalar, - m[1] + scalar); - } - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) - { - return mat<2, 2, T, Q>( - m1[0] + m2[0], - m1[1] + m2[1]); - } - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m, T scalar) - { - return mat<2, 2, T, Q>( - m[0] - scalar, - m[1] - scalar); - } - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator-(T scalar, mat<2, 2, T, Q> const& m) - { - return mat<2, 2, T, Q>( - scalar - m[0], - scalar - m[1]); - } - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) - { - return mat<2, 2, T, Q>( - m1[0] - m2[0], - m1[1] - m2[1]); - } - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m, T scalar) - { - return mat<2, 2, T, Q>( - m[0] * scalar, - m[1] * scalar); - } - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(T scalar, mat<2, 2, T, Q> const& m) - { - return mat<2, 2, T, Q>( - m[0] * scalar, - m[1] * scalar); - } - - template - GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::col_type operator* - ( - mat<2, 2, T, Q> const& m, - typename mat<2, 2, T, Q>::row_type const& v - ) - { - return vec<2, T, Q>( - m[0][0] * v.x + m[1][0] * v.y, - m[0][1] * v.x + m[1][1] * v.y); - } - - template - GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::row_type operator* - ( - typename mat<2, 2, T, Q>::col_type const& v, - mat<2, 2, T, Q> const& m - ) - { - return vec<2, T, Q>( - v.x * m[0][0] + v.y * m[0][1], - v.x * m[1][0] + v.y * m[1][1]); - } - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) - { - return mat<2, 2, T, Q>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1]); - } - - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) - { - return mat<3, 2, T, Q>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], - m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1], - m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1]); - } - - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) - { - return mat<4, 2, T, Q>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], - m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1], - m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1], - m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1], - m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1]); - } - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m, T scalar) - { - return mat<2, 2, T, Q>( - m[0] / scalar, - m[1] / scalar); - } - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator/(T scalar, mat<2, 2, T, Q> const& m) - { - return mat<2, 2, T, Q>( - scalar / m[0], - scalar / m[1]); - } - - template - GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::col_type operator/(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v) - { - return inverse(m) * v; - } - - template - GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::row_type operator/(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m) - { - return v * inverse(m); - } - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) - { - mat<2, 2, T, Q> m1_copy(m1); - return m1_copy /= m2; - } - - // -- Boolean operators -- - - template - GLM_FUNC_QUALIFIER bool operator==(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]); - } - - template - GLM_FUNC_QUALIFIER bool operator!=(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]); - } -} //namespace glm diff --git a/3rdparty/glm/source/glm/detail/type_mat2x3.hpp b/3rdparty/glm/source/glm/detail/type_mat2x3.hpp deleted file mode 100644 index c9303cb..0000000 --- a/3rdparty/glm/source/glm/detail/type_mat2x3.hpp +++ /dev/null @@ -1,159 +0,0 @@ -/// @ref core -/// @file glm/detail/type_mat2x3.hpp - -#pragma once - -#include "type_vec2.hpp" -#include "type_vec3.hpp" -#include -#include - -namespace glm -{ - template - struct mat<2, 3, T, Q> - { - typedef vec<3, T, Q> col_type; - typedef vec<2, T, Q> row_type; - typedef mat<2, 3, T, Q> type; - typedef mat<3, 2, T, Q> transpose_type; - typedef T value_type; - - private: - col_type value[2]; - - public: - // -- Accesses -- - - typedef length_t length_type; - GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 2; } - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; - - // -- Constructors -- - - GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; - template - GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<2, 3, T, P> const& m); - - GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR mat( - T x0, T y0, T z0, - T x1, T y1, T z1); - GLM_FUNC_DECL GLM_CONSTEXPR mat( - col_type const& v0, - col_type const& v1); - - // -- Conversions -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat( - X1 x1, Y1 y1, Z1 z1, - X2 x2, Y2 y2, Z2 z2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat( - vec<3, U, Q> const& v1, - vec<3, V, Q> const& v2); - - // -- Matrix conversions -- - - template - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, U, P> const& m); - - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_DECL mat<2, 3, T, Q> & operator=(mat<2, 3, U, Q> const& m); - template - GLM_FUNC_DECL mat<2, 3, T, Q> & operator+=(U s); - template - GLM_FUNC_DECL mat<2, 3, T, Q> & operator+=(mat<2, 3, U, Q> const& m); - template - GLM_FUNC_DECL mat<2, 3, T, Q> & operator-=(U s); - template - GLM_FUNC_DECL mat<2, 3, T, Q> & operator-=(mat<2, 3, U, Q> const& m); - template - GLM_FUNC_DECL mat<2, 3, T, Q> & operator*=(U s); - template - GLM_FUNC_DECL mat<2, 3, T, Q> & operator/=(U s); - - // -- Increment and decrement operators -- - - GLM_FUNC_DECL mat<2, 3, T, Q> & operator++ (); - GLM_FUNC_DECL mat<2, 3, T, Q> & operator-- (); - GLM_FUNC_DECL mat<2, 3, T, Q> operator++(int); - GLM_FUNC_DECL mat<2, 3, T, Q> operator--(int); - }; - - // -- Unary operators -- - - template - GLM_FUNC_DECL mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m); - - template - GLM_FUNC_DECL mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m); - - // -- Binary operators -- - - template - GLM_FUNC_DECL mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<2, 3, T, Q> operator*(T scalar, mat<2, 3, T, Q> const& m); - - template - GLM_FUNC_DECL typename mat<2, 3, T, Q>::col_type operator*(mat<2, 3, T, Q> const& m, typename mat<2, 3, T, Q>::row_type const& v); - - template - GLM_FUNC_DECL typename mat<2, 3, T, Q>::row_type operator*(typename mat<2, 3, T, Q>::col_type const& v, mat<2, 3, T, Q> const& m); - - template - GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<2, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<3, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<4, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<2, 3, T, Q> operator/(mat<2, 3, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<2, 3, T, Q> operator/(T scalar, mat<2, 3, T, Q> const& m); - - // -- Boolean operators -- - - template - GLM_FUNC_DECL bool operator==(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL bool operator!=(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); -}//namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_mat2x3.inl" -#endif diff --git a/3rdparty/glm/source/glm/detail/type_mat2x3.inl b/3rdparty/glm/source/glm/detail/type_mat2x3.inl deleted file mode 100644 index c158a5d..0000000 --- a/3rdparty/glm/source/glm/detail/type_mat2x3.inl +++ /dev/null @@ -1,510 +0,0 @@ -namespace glm -{ - // -- Constructors -- - -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat() -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST - : value{col_type(1, 0, 0), col_type(0, 1, 0)} -# endif - { -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION - this->value[0] = col_type(1, 0, 0); - this->value[1] = col_type(0, 1, 0); -# endif - } -# endif - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<2, 3, T, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{m.value[0], m.value[1]} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = m.value[0]; - this->value[1] = m.value[1]; -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(T scalar) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(scalar, 0, 0), col_type(0, scalar, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(scalar, 0, 0); - this->value[1] = col_type(0, scalar, 0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat - ( - T x0, T y0, T z0, - T x1, T y1, T z1 - ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(x0, y0, z0), col_type(x1, y1, z1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x0, y0, z0); - this->value[1] = col_type(x1, y1, z1); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(col_type const& v0, col_type const& v1) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v0), col_type(v1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(v0); - this->value[1] = col_type(v1); -# endif - } - - // -- Conversion constructors -- - - template - template< - typename X1, typename Y1, typename Z1, - typename X2, typename Y2, typename Z2> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat - ( - X1 x1, Y1 y1, Z1 z1, - X2 x2, Y2 y2, Z2 z2 - ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(x1, y1, z1), col_type(x2, y2, z2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x1, y1, z1); - this->value[1] = col_type(x2, y2, z2); -# endif - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v1), col_type(v2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); -# endif - } - - // -- Matrix conversions -- - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<2, 3, U, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<3, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 3, T, Q>::mat(mat<4, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } - - // -- Accesses -- - - template - GLM_FUNC_QUALIFIER typename mat<2, 3, T, Q>::col_type & mat<2, 3, T, Q>::operator[](typename mat<2, 3, T, Q>::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 3, T, Q>::col_type const& mat<2, 3, T, Q>::operator[](typename mat<2, 3, T, Q>::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } - - // -- Unary updatable operators -- - - template - template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator=(mat<2, 3, U, Q> const& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator+=(U s) - { - this->value[0] += s; - this->value[1] += s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator+=(mat<2, 3, U, Q> const& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator-=(U s) - { - this->value[0] -= s; - this->value[1] -= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator-=(mat<2, 3, U, Q> const& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator*=(U s) - { - this->value[0] *= s; - this->value[1] *= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator/=(U s) - { - this->value[0] /= s; - this->value[1] /= s; - return *this; - } - - // -- Increment and decrement operators -- - - template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator++() - { - ++this->value[0]; - ++this->value[1]; - return *this; - } - - template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator--() - { - --this->value[0]; - --this->value[1]; - return *this; - } - - template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> mat<2, 3, T, Q>::operator++(int) - { - mat<2, 3, T, Q> Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> mat<2, 3, T, Q>::operator--(int) - { - mat<2, 3, T, Q> Result(*this); - --*this; - return Result; - } - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m) - { - return m; - } - - template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m) - { - return mat<2, 3, T, Q>( - -m[0], - -m[1]); - } - - // -- Binary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m, T scalar) - { - return mat<2, 3, T, Q>( - m[0] + scalar, - m[1] + scalar); - } - - template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) - { - return mat<2, 3, T, Q>( - m1[0] + m2[0], - m1[1] + m2[1]); - } - - template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m, T scalar) - { - return mat<2, 3, T, Q>( - m[0] - scalar, - m[1] - scalar); - } - - template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) - { - return mat<2, 3, T, Q>( - m1[0] - m2[0], - m1[1] - m2[1]); - } - - template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m, T scalar) - { - return mat<2, 3, T, Q>( - m[0] * scalar, - m[1] * scalar); - } - - template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(T scalar, mat<2, 3, T, Q> const& m) - { - return mat<2, 3, T, Q>( - m[0] * scalar, - m[1] * scalar); - } - - template - GLM_FUNC_QUALIFIER typename mat<2, 3, T, Q>::col_type operator* - ( - mat<2, 3, T, Q> const& m, - typename mat<2, 3, T, Q>::row_type const& v) - { - return typename mat<2, 3, T, Q>::col_type( - m[0][0] * v.x + m[1][0] * v.y, - m[0][1] * v.x + m[1][1] * v.y, - m[0][2] * v.x + m[1][2] * v.y); - } - - template - GLM_FUNC_QUALIFIER typename mat<2, 3, T, Q>::row_type operator* - ( - typename mat<2, 3, T, Q>::col_type const& v, - mat<2, 3, T, Q> const& m) - { - return typename mat<2, 3, T, Q>::row_type( - v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2], - v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2]); - } - - template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<2, 2, T, Q> const& m2) - { - return mat<2, 3, T, Q>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], - m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], - m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1]); - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<3, 2, T, Q> const& m2) - { - T SrcA00 = m1[0][0]; - T SrcA01 = m1[0][1]; - T SrcA02 = m1[0][2]; - T SrcA10 = m1[1][0]; - T SrcA11 = m1[1][1]; - T SrcA12 = m1[1][2]; - - T SrcB00 = m2[0][0]; - T SrcB01 = m2[0][1]; - T SrcB10 = m2[1][0]; - T SrcB11 = m2[1][1]; - T SrcB20 = m2[2][0]; - T SrcB21 = m2[2][1]; - - mat<3, 3, T, Q> Result; - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01; - Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11; - Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11; - Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21; - Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21; - Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<4, 2, T, Q> const& m2) - { - return mat<4, 3, T, Q>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], - m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], - m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1], - m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1], - m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1], - m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1], - m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1], - m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1], - m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1]); - } - - template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator/(mat<2, 3, T, Q> const& m, T scalar) - { - return mat<2, 3, T, Q>( - m[0] / scalar, - m[1] / scalar); - } - - template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator/(T scalar, mat<2, 3, T, Q> const& m) - { - return mat<2, 3, T, Q>( - scalar / m[0], - scalar / m[1]); - } - - // -- Boolean operators -- - - template - GLM_FUNC_QUALIFIER bool operator==(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]); - } - - template - GLM_FUNC_QUALIFIER bool operator!=(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]); - } -} //namespace glm diff --git a/3rdparty/glm/source/glm/detail/type_mat2x4.hpp b/3rdparty/glm/source/glm/detail/type_mat2x4.hpp deleted file mode 100644 index f769796..0000000 --- a/3rdparty/glm/source/glm/detail/type_mat2x4.hpp +++ /dev/null @@ -1,161 +0,0 @@ -/// @ref core -/// @file glm/detail/type_mat2x4.hpp - -#pragma once - -#include "type_vec2.hpp" -#include "type_vec4.hpp" -#include -#include - -namespace glm -{ - template - struct mat<2, 4, T, Q> - { - typedef vec<4, T, Q> col_type; - typedef vec<2, T, Q> row_type; - typedef mat<2, 4, T, Q> type; - typedef mat<4, 2, T, Q> transpose_type; - typedef T value_type; - - private: - col_type value[2]; - - public: - // -- Accesses -- - - typedef length_t length_type; - GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 2; } - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; - - // -- Constructors -- - - GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; - template - GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<2, 4, T, P> const& m); - - GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR mat( - T x0, T y0, T z0, T w0, - T x1, T y1, T z1, T w1); - GLM_FUNC_DECL GLM_CONSTEXPR mat( - col_type const& v0, - col_type const& v1); - - // -- Conversions -- - - template< - typename X1, typename Y1, typename Z1, typename W1, - typename X2, typename Y2, typename Z2, typename W2> - GLM_FUNC_DECL GLM_CONSTEXPR mat( - X1 x1, Y1 y1, Z1 z1, W1 w1, - X2 x2, Y2 y2, Z2 z2, W2 w2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat( - vec<4, U, Q> const& v1, - vec<4, V, Q> const& v2); - - // -- Matrix conversions -- - - template - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, U, P> const& m); - - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_DECL mat<2, 4, T, Q> & operator=(mat<2, 4, U, Q> const& m); - template - GLM_FUNC_DECL mat<2, 4, T, Q> & operator+=(U s); - template - GLM_FUNC_DECL mat<2, 4, T, Q> & operator+=(mat<2, 4, U, Q> const& m); - template - GLM_FUNC_DECL mat<2, 4, T, Q> & operator-=(U s); - template - GLM_FUNC_DECL mat<2, 4, T, Q> & operator-=(mat<2, 4, U, Q> const& m); - template - GLM_FUNC_DECL mat<2, 4, T, Q> & operator*=(U s); - template - GLM_FUNC_DECL mat<2, 4, T, Q> & operator/=(U s); - - // -- Increment and decrement operators -- - - GLM_FUNC_DECL mat<2, 4, T, Q> & operator++ (); - GLM_FUNC_DECL mat<2, 4, T, Q> & operator-- (); - GLM_FUNC_DECL mat<2, 4, T, Q> operator++(int); - GLM_FUNC_DECL mat<2, 4, T, Q> operator--(int); - }; - - // -- Unary operators -- - - template - GLM_FUNC_DECL mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m); - - template - GLM_FUNC_DECL mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m); - - // -- Binary operators -- - - template - GLM_FUNC_DECL mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<2, 4, T, Q> operator*(T scalar, mat<2, 4, T, Q> const& m); - - template - GLM_FUNC_DECL typename mat<2, 4, T, Q>::col_type operator*(mat<2, 4, T, Q> const& m, typename mat<2, 4, T, Q>::row_type const& v); - - template - GLM_FUNC_DECL typename mat<2, 4, T, Q>::row_type operator*(typename mat<2, 4, T, Q>::col_type const& v, mat<2, 4, T, Q> const& m); - - template - GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<4, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<2, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<3, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<2, 4, T, Q> operator/(mat<2, 4, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<2, 4, T, Q> operator/(T scalar, mat<2, 4, T, Q> const& m); - - // -- Boolean operators -- - - template - GLM_FUNC_DECL bool operator==(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL bool operator!=(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); -}//namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_mat2x4.inl" -#endif diff --git a/3rdparty/glm/source/glm/detail/type_mat2x4.inl b/3rdparty/glm/source/glm/detail/type_mat2x4.inl deleted file mode 100644 index 2a96d3d..0000000 --- a/3rdparty/glm/source/glm/detail/type_mat2x4.inl +++ /dev/null @@ -1,520 +0,0 @@ -namespace glm -{ - // -- Constructors -- - -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat() -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST - : value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0)} -# endif - { -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION - this->value[0] = col_type(1, 0, 0, 0); - this->value[1] = col_type(0, 1, 0, 0); -# endif - } -# endif - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<2, 4, T, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{m[0], m[1]} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = m[0]; - this->value[1] = m[1]; -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(T s) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(s, 0, 0, 0), col_type(0, s, 0, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(s, 0, 0, 0); - this->value[1] = col_type(0, s, 0, 0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat - ( - T x0, T y0, T z0, T w0, - T x1, T y1, T z1, T w1 - ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(x0, y0, z0, w0), col_type(x1, y1, z1, w1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x0, y0, z0, w0); - this->value[1] = col_type(x1, y1, z1, w1); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(col_type const& v0, col_type const& v1) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v0), col_type(v1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = v0; - this->value[1] = v1; -# endif - } - - // -- Conversion constructors -- - - template - template< - typename X1, typename Y1, typename Z1, typename W1, - typename X2, typename Y2, typename Z2, typename W2> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat - ( - X1 x1, Y1 y1, Z1 z1, W1 w1, - X2 x2, Y2 y2, Z2 z2, W2 w2 - ) -# if GLM_HAS_INITIALIZER_LISTS - : value{ - col_type(x1, y1, z1, w1), - col_type(x2, y2, z2, w2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x1, y1, z1, w1); - this->value[1] = col_type(x2, y2, z2, w2); -# endif - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(vec<4, V1, Q> const& v1, vec<4, V2, Q> const& v2) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v1), col_type(v2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); -# endif - } - - // -- Matrix conversions -- - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<2, 4, U, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<4, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<3, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<2, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); -# endif - } - - // -- Accesses -- - - template - GLM_FUNC_QUALIFIER typename mat<2, 4, T, Q>::col_type & mat<2, 4, T, Q>::operator[](typename mat<2, 4, T, Q>::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<2, 4, T, Q>::col_type const& mat<2, 4, T, Q>::operator[](typename mat<2, 4, T, Q>::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } - - // -- Unary updatable operators -- - - template - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator=(mat<2, 4, U, Q> const& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator+=(U s) - { - this->value[0] += s; - this->value[1] += s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator+=(mat<2, 4, U, Q> const& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator-=(U s) - { - this->value[0] -= s; - this->value[1] -= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator-=(mat<2, 4, U, Q> const& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator*=(U s) - { - this->value[0] *= s; - this->value[1] *= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> & mat<2, 4, T, Q>::operator/=(U s) - { - this->value[0] /= s; - this->value[1] /= s; - return *this; - } - - // -- Increment and decrement operators -- - - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator++() - { - ++this->value[0]; - ++this->value[1]; - return *this; - } - - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator--() - { - --this->value[0]; - --this->value[1]; - return *this; - } - - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> mat<2, 4, T, Q>::operator++(int) - { - mat<2, 4, T, Q> Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> mat<2, 4, T, Q>::operator--(int) - { - mat<2, 4, T, Q> Result(*this); - --*this; - return Result; - } - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m) - { - return m; - } - - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m) - { - return mat<2, 4, T, Q>( - -m[0], - -m[1]); - } - - // -- Binary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m, T scalar) - { - return mat<2, 4, T, Q>( - m[0] + scalar, - m[1] + scalar); - } - - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) - { - return mat<2, 4, T, Q>( - m1[0] + m2[0], - m1[1] + m2[1]); - } - - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m, T scalar) - { - return mat<2, 4, T, Q>( - m[0] - scalar, - m[1] - scalar); - } - - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) - { - return mat<2, 4, T, Q>( - m1[0] - m2[0], - m1[1] - m2[1]); - } - - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m, T scalar) - { - return mat<2, 4, T, Q>( - m[0] * scalar, - m[1] * scalar); - } - - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(T scalar, mat<2, 4, T, Q> const& m) - { - return mat<2, 4, T, Q>( - m[0] * scalar, - m[1] * scalar); - } - - template - GLM_FUNC_QUALIFIER typename mat<2, 4, T, Q>::col_type operator*(mat<2, 4, T, Q> const& m, typename mat<2, 4, T, Q>::row_type const& v) - { - return typename mat<2, 4, T, Q>::col_type( - m[0][0] * v.x + m[1][0] * v.y, - m[0][1] * v.x + m[1][1] * v.y, - m[0][2] * v.x + m[1][2] * v.y, - m[0][3] * v.x + m[1][3] * v.y); - } - - template - GLM_FUNC_QUALIFIER typename mat<2, 4, T, Q>::row_type operator*(typename mat<2, 4, T, Q>::col_type const& v, mat<2, 4, T, Q> const& m) - { - return typename mat<2, 4, T, Q>::row_type( - v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3], - v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2] + v.w * m[1][3]); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<4, 2, T, Q> const& m2) - { - T SrcA00 = m1[0][0]; - T SrcA01 = m1[0][1]; - T SrcA02 = m1[0][2]; - T SrcA03 = m1[0][3]; - T SrcA10 = m1[1][0]; - T SrcA11 = m1[1][1]; - T SrcA12 = m1[1][2]; - T SrcA13 = m1[1][3]; - - T SrcB00 = m2[0][0]; - T SrcB01 = m2[0][1]; - T SrcB10 = m2[1][0]; - T SrcB11 = m2[1][1]; - T SrcB20 = m2[2][0]; - T SrcB21 = m2[2][1]; - T SrcB30 = m2[3][0]; - T SrcB31 = m2[3][1]; - - mat<4, 4, T, Q> Result; - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01; - Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01; - Result[0][3] = SrcA03 * SrcB00 + SrcA13 * SrcB01; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11; - Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11; - Result[1][3] = SrcA03 * SrcB10 + SrcA13 * SrcB11; - Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21; - Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21; - Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21; - Result[2][3] = SrcA03 * SrcB20 + SrcA13 * SrcB21; - Result[3][0] = SrcA00 * SrcB30 + SrcA10 * SrcB31; - Result[3][1] = SrcA01 * SrcB30 + SrcA11 * SrcB31; - Result[3][2] = SrcA02 * SrcB30 + SrcA12 * SrcB31; - Result[3][3] = SrcA03 * SrcB30 + SrcA13 * SrcB31; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<2, 2, T, Q> const& m2) - { - return mat<2, 4, T, Q>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], - m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1], - m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], - m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1], - m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1]); - } - - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<3, 2, T, Q> const& m2) - { - return mat<3, 4, T, Q>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1], - m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1], - m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1], - m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1], - m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1], - m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1], - m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1], - m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1], - m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1]); - } - - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator/(mat<2, 4, T, Q> const& m, T scalar) - { - return mat<2, 4, T, Q>( - m[0] / scalar, - m[1] / scalar); - } - - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator/(T scalar, mat<2, 4, T, Q> const& m) - { - return mat<2, 4, T, Q>( - scalar / m[0], - scalar / m[1]); - } - - // -- Boolean operators -- - - template - GLM_FUNC_QUALIFIER bool operator==(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]); - } - - template - GLM_FUNC_QUALIFIER bool operator!=(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]); - } -} //namespace glm diff --git a/3rdparty/glm/source/glm/detail/type_mat3x2.hpp b/3rdparty/glm/source/glm/detail/type_mat3x2.hpp deleted file mode 100644 index d528af0..0000000 --- a/3rdparty/glm/source/glm/detail/type_mat3x2.hpp +++ /dev/null @@ -1,167 +0,0 @@ -/// @ref core -/// @file glm/detail/type_mat3x2.hpp - -#pragma once - -#include "type_vec2.hpp" -#include "type_vec3.hpp" -#include -#include - -namespace glm -{ - template - struct mat<3, 2, T, Q> - { - typedef vec<2, T, Q> col_type; - typedef vec<3, T, Q> row_type; - typedef mat<3, 2, T, Q> type; - typedef mat<2, 3, T, Q> transpose_type; - typedef T value_type; - - private: - col_type value[3]; - - public: - // -- Accesses -- - - typedef length_t length_type; - GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 3; } - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; - - // -- Constructors -- - - GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; - template - GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<3, 2, T, P> const& m); - - GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR mat( - T x0, T y0, - T x1, T y1, - T x2, T y2); - GLM_FUNC_DECL GLM_CONSTEXPR mat( - col_type const& v0, - col_type const& v1, - col_type const& v2); - - // -- Conversions -- - - template< - typename X1, typename Y1, - typename X2, typename Y2, - typename X3, typename Y3> - GLM_FUNC_DECL GLM_CONSTEXPR mat( - X1 x1, Y1 y1, - X2 x2, Y2 y2, - X3 x3, Y3 y3); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat( - vec<2, V1, Q> const& v1, - vec<2, V2, Q> const& v2, - vec<2, V3, Q> const& v3); - - // -- Matrix conversions -- - - template - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, U, P> const& m); - - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_DECL mat<3, 2, T, Q> & operator=(mat<3, 2, U, Q> const& m); - template - GLM_FUNC_DECL mat<3, 2, T, Q> & operator+=(U s); - template - GLM_FUNC_DECL mat<3, 2, T, Q> & operator+=(mat<3, 2, U, Q> const& m); - template - GLM_FUNC_DECL mat<3, 2, T, Q> & operator-=(U s); - template - GLM_FUNC_DECL mat<3, 2, T, Q> & operator-=(mat<3, 2, U, Q> const& m); - template - GLM_FUNC_DECL mat<3, 2, T, Q> & operator*=(U s); - template - GLM_FUNC_DECL mat<3, 2, T, Q> & operator/=(U s); - - // -- Increment and decrement operators -- - - GLM_FUNC_DECL mat<3, 2, T, Q> & operator++ (); - GLM_FUNC_DECL mat<3, 2, T, Q> & operator-- (); - GLM_FUNC_DECL mat<3, 2, T, Q> operator++(int); - GLM_FUNC_DECL mat<3, 2, T, Q> operator--(int); - }; - - // -- Unary operators -- - - template - GLM_FUNC_DECL mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m); - - template - GLM_FUNC_DECL mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m); - - // -- Binary operators -- - - template - GLM_FUNC_DECL mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<3, 2, T, Q> operator*(T scalar, mat<3, 2, T, Q> const& m); - - template - GLM_FUNC_DECL typename mat<3, 2, T, Q>::col_type operator*(mat<3, 2, T, Q> const& m, typename mat<3, 2, T, Q>::row_type const& v); - - template - GLM_FUNC_DECL typename mat<3, 2, T, Q>::row_type operator*(typename mat<3, 2, T, Q>::col_type const& v, mat<3, 2, T, Q> const& m); - - template - GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<2, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<3, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<4, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<3, 2, T, Q> operator/(mat<3, 2, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<3, 2, T, Q> operator/(T scalar, mat<3, 2, T, Q> const& m); - - // -- Boolean operators -- - - template - GLM_FUNC_DECL bool operator==(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL bool operator!=(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2); - -}//namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_mat3x2.inl" -#endif diff --git a/3rdparty/glm/source/glm/detail/type_mat3x2.inl b/3rdparty/glm/source/glm/detail/type_mat3x2.inl deleted file mode 100644 index 8cf8ed3..0000000 --- a/3rdparty/glm/source/glm/detail/type_mat3x2.inl +++ /dev/null @@ -1,532 +0,0 @@ -namespace glm -{ - // -- Constructors -- - -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat() -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST - : value{col_type(1, 0), col_type(0, 1), col_type(0, 0)} -# endif - { -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION - this->value[0] = col_type(1, 0); - this->value[1] = col_type(0, 1); - this->value[2] = col_type(0, 0); -# endif - } -# endif - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<3, 2, T, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(T s) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(s, 0), col_type(0, s), col_type(0, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(s, 0); - this->value[1] = col_type(0, s); - this->value[2] = col_type(0, 0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat - ( - T x0, T y0, - T x1, T y1, - T x2, T y2 - ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(x0, y0), col_type(x1, y1), col_type(x2, y2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x0, y0); - this->value[1] = col_type(x1, y1); - this->value[2] = col_type(x2, y2); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v0), col_type(v1), col_type(v2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; -# endif - } - - // -- Conversion constructors -- - - template - template< - typename X0, typename Y0, - typename X1, typename Y1, - typename X2, typename Y2> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat - ( - X0 x0, Y0 y0, - X1 x1, Y1 y1, - X2 x2, Y2 y2 - ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(x0, y0), col_type(x1, y1), col_type(x2, y2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x0, y0); - this->value[1] = col_type(x1, y1); - this->value[2] = col_type(x2, y2); -# endif - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(vec<2, V0, Q> const& v0, vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v0), col_type(v1), col_type(v2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(v0); - this->value[1] = col_type(v1); - this->value[2] = col_type(v2); -# endif - } - - // -- Matrix conversions -- - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<3, 2, U, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<2, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = col_type(0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<4, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); -# endif - } - - // -- Accesses -- - - template - GLM_FUNC_QUALIFIER typename mat<3, 2, T, Q>::col_type & mat<3, 2, T, Q>::operator[](typename mat<3, 2, T, Q>::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 2, T, Q>::col_type const& mat<3, 2, T, Q>::operator[](typename mat<3, 2, T, Q>::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } - - // -- Unary updatable operators -- - - template - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator=(mat<3, 2, U, Q> const& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator+=(U s) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator+=(mat<3, 2, U, Q> const& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator-=(U s) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator-=(mat<3, 2, U, Q> const& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator*=(U s) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> & mat<3, 2, T, Q>::operator/=(U s) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - return *this; - } - - // -- Increment and decrement operators -- - - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator++() - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - return *this; - } - - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator--() - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - return *this; - } - - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> mat<3, 2, T, Q>::operator++(int) - { - mat<3, 2, T, Q> Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> mat<3, 2, T, Q>::operator--(int) - { - mat<3, 2, T, Q> Result(*this); - --*this; - return Result; - } - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m) - { - return m; - } - - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m) - { - return mat<3, 2, T, Q>( - -m[0], - -m[1], - -m[2]); - } - - // -- Binary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m, T scalar) - { - return mat<3, 2, T, Q>( - m[0] + scalar, - m[1] + scalar, - m[2] + scalar); - } - - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) - { - return mat<3, 2, T, Q>( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2]); - } - - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m, T scalar) - { - return mat<3, 2, T, Q>( - m[0] - scalar, - m[1] - scalar, - m[2] - scalar); - } - - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) - { - return mat<3, 2, T, Q>( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2]); - } - - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m, T scalar) - { - return mat<3, 2, T, Q>( - m[0] * scalar, - m[1] * scalar, - m[2] * scalar); - } - - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(T scalar, mat<3, 2, T, Q> const& m) - { - return mat<3, 2, T, Q>( - m[0] * scalar, - m[1] * scalar, - m[2] * scalar); - } - - template - GLM_FUNC_QUALIFIER typename mat<3, 2, T, Q>::col_type operator*(mat<3, 2, T, Q> const& m, typename mat<3, 2, T, Q>::row_type const& v) - { - return typename mat<3, 2, T, Q>::col_type( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z); - } - - template - GLM_FUNC_QUALIFIER typename mat<3, 2, T, Q>::row_type operator*(typename mat<3, 2, T, Q>::col_type const& v, mat<3, 2, T, Q> const& m) - { - return typename mat<3, 2, T, Q>::row_type( - v.x * m[0][0] + v.y * m[0][1], - v.x * m[1][0] + v.y * m[1][1], - v.x * m[2][0] + v.y * m[2][1]); - } - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<2, 3, T, Q> const& m2) - { - const T SrcA00 = m1[0][0]; - const T SrcA01 = m1[0][1]; - const T SrcA10 = m1[1][0]; - const T SrcA11 = m1[1][1]; - const T SrcA20 = m1[2][0]; - const T SrcA21 = m1[2][1]; - - const T SrcB00 = m2[0][0]; - const T SrcB01 = m2[0][1]; - const T SrcB02 = m2[0][2]; - const T SrcB10 = m2[1][0]; - const T SrcB11 = m2[1][1]; - const T SrcB12 = m2[1][2]; - - mat<2, 2, T, Q> Result; - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<3, 3, T, Q> const& m2) - { - return mat<3, 2, T, Q>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2], - m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2], - m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2]); - } - - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<4, 3, T, Q> const& m2) - { - return mat<4, 2, T, Q>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2], - m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2], - m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2], - m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1] + m1[2][0] * m2[3][2], - m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2]); - } - - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator/(mat<3, 2, T, Q> const& m, T scalar) - { - return mat<3, 2, T, Q>( - m[0] / scalar, - m[1] / scalar, - m[2] / scalar); - } - - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator/(T scalar, mat<3, 2, T, Q> const& m) - { - return mat<3, 2, T, Q>( - scalar / m[0], - scalar / m[1], - scalar / m[2]); - } - - // -- Boolean operators -- - - template - GLM_FUNC_QUALIFIER bool operator==(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]); - } - - template - GLM_FUNC_QUALIFIER bool operator!=(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]); - } -} //namespace glm diff --git a/3rdparty/glm/source/glm/detail/type_mat3x3.hpp b/3rdparty/glm/source/glm/detail/type_mat3x3.hpp deleted file mode 100644 index 9b435ae..0000000 --- a/3rdparty/glm/source/glm/detail/type_mat3x3.hpp +++ /dev/null @@ -1,184 +0,0 @@ -/// @ref core -/// @file glm/detail/type_mat3x3.hpp - -#pragma once - -#include "type_vec3.hpp" -#include -#include - -namespace glm -{ - template - struct mat<3, 3, T, Q> - { - typedef vec<3, T, Q> col_type; - typedef vec<3, T, Q> row_type; - typedef mat<3, 3, T, Q> type; - typedef mat<3, 3, T, Q> transpose_type; - typedef T value_type; - - private: - col_type value[3]; - - public: - // -- Accesses -- - - typedef length_t length_type; - GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 3; } - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; - - // -- Constructors -- - - GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; - template - GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<3, 3, T, P> const& m); - - GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR mat( - T x0, T y0, T z0, - T x1, T y1, T z1, - T x2, T y2, T z2); - GLM_FUNC_DECL GLM_CONSTEXPR mat( - col_type const& v0, - col_type const& v1, - col_type const& v2); - - // -- Conversions -- - - template< - typename X1, typename Y1, typename Z1, - typename X2, typename Y2, typename Z2, - typename X3, typename Y3, typename Z3> - GLM_FUNC_DECL GLM_CONSTEXPR mat( - X1 x1, Y1 y1, Z1 z1, - X2 x2, Y2 y2, Z2 z2, - X3 x3, Y3 y3, Z3 z3); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat( - vec<3, V1, Q> const& v1, - vec<3, V2, Q> const& v2, - vec<3, V3, Q> const& v3); - - // -- Matrix conversions -- - - template - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, U, P> const& m); - - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_DECL mat<3, 3, T, Q> & operator=(mat<3, 3, U, Q> const& m); - template - GLM_FUNC_DECL mat<3, 3, T, Q> & operator+=(U s); - template - GLM_FUNC_DECL mat<3, 3, T, Q> & operator+=(mat<3, 3, U, Q> const& m); - template - GLM_FUNC_DECL mat<3, 3, T, Q> & operator-=(U s); - template - GLM_FUNC_DECL mat<3, 3, T, Q> & operator-=(mat<3, 3, U, Q> const& m); - template - GLM_FUNC_DECL mat<3, 3, T, Q> & operator*=(U s); - template - GLM_FUNC_DECL mat<3, 3, T, Q> & operator*=(mat<3, 3, U, Q> const& m); - template - GLM_FUNC_DECL mat<3, 3, T, Q> & operator/=(U s); - template - GLM_FUNC_DECL mat<3, 3, T, Q> & operator/=(mat<3, 3, U, Q> const& m); - - // -- Increment and decrement operators -- - - GLM_FUNC_DECL mat<3, 3, T, Q> & operator++(); - GLM_FUNC_DECL mat<3, 3, T, Q> & operator--(); - GLM_FUNC_DECL mat<3, 3, T, Q> operator++(int); - GLM_FUNC_DECL mat<3, 3, T, Q> operator--(int); - }; - - // -- Unary operators -- - - template - GLM_FUNC_DECL mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m); - - template - GLM_FUNC_DECL mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m); - - // -- Binary operators -- - - template - GLM_FUNC_DECL mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<3, 3, T, Q> operator+(T scalar, mat<3, 3, T, Q> const& m); - - template - GLM_FUNC_DECL mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<3, 3, T, Q> operator-(T scalar, mat<3, 3, T, Q> const& m); - - template - GLM_FUNC_DECL mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<3, 3, T, Q> operator*(T scalar, mat<3, 3, T, Q> const& m); - - template - GLM_FUNC_DECL typename mat<3, 3, T, Q>::col_type operator*(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v); - - template - GLM_FUNC_DECL typename mat<3, 3, T, Q>::row_type operator*(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m); - - template - GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<3, 3, T, Q> operator/(T scalar, mat<3, 3, T, Q> const& m); - - template - GLM_FUNC_DECL typename mat<3, 3, T, Q>::col_type operator/(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v); - - template - GLM_FUNC_DECL typename mat<3, 3, T, Q>::row_type operator/(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m); - - template - GLM_FUNC_DECL mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); - - // -- Boolean operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL bool operator!=(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2); -}//namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_mat3x3.inl" -#endif diff --git a/3rdparty/glm/source/glm/detail/type_mat3x3.inl b/3rdparty/glm/source/glm/detail/type_mat3x3.inl deleted file mode 100644 index 4362d84..0000000 --- a/3rdparty/glm/source/glm/detail/type_mat3x3.inl +++ /dev/null @@ -1,601 +0,0 @@ -#include "../matrix.hpp" - -namespace glm -{ - // -- Constructors -- - -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat() -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST - : value{col_type(1, 0, 0), col_type(0, 1, 0), col_type(0, 0, 1)} -# endif - { -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION - this->value[0] = col_type(1, 0, 0); - this->value[1] = col_type(0, 1, 0); - this->value[2] = col_type(0, 0, 1); -# endif - } -# endif - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<3, 3, T, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(T s) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(s, 0, 0), col_type(0, s, 0), col_type(0, 0, s)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(s, 0, 0); - this->value[1] = col_type(0, s, 0); - this->value[2] = col_type(0, 0, s); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat - ( - T x0, T y0, T z0, - T x1, T y1, T z1, - T x2, T y2, T z2 - ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(x0, y0, z0), col_type(x1, y1, z1), col_type(x2, y2, z2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x0, y0, z0); - this->value[1] = col_type(x1, y1, z1); - this->value[2] = col_type(x2, y2, z2); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v0), col_type(v1), col_type(v2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(v0); - this->value[1] = col_type(v1); - this->value[2] = col_type(v2); -# endif - } - - // -- Conversion constructors -- - - template - template< - typename X1, typename Y1, typename Z1, - typename X2, typename Y2, typename Z2, - typename X3, typename Y3, typename Z3> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat - ( - X1 x1, Y1 y1, Z1 z1, - X2 x2, Y2 y2, Z2 z2, - X3 x3, Y3 y3, Z3 z3 - ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(x1, y1, z1), col_type(x2, y2, z2), col_type(x3, y3, z3)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x1, y1, z1); - this->value[1] = col_type(x2, y2, z2); - this->value[2] = col_type(x3, y3, z3); -# endif - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2, vec<3, V3, Q> const& v3) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v1), col_type(v2), col_type(v3)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); - this->value[2] = col_type(v3); -# endif - } - - // -- Matrix conversions -- - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<3, 3, U, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(0, 0, 1); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<2, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0, 0, 1); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 1); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0, 0, 1); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 1); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 3, T, Q>::mat(mat<4, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); -# endif - } - - // -- Accesses -- - - template - GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::col_type & mat<3, 3, T, Q>::operator[](typename mat<3, 3, T, Q>::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 3, T, Q>::col_type const& mat<3, 3, T, Q>::operator[](typename mat<3, 3, T, Q>::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } - - // -- Unary updatable operators -- - - template - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator=(mat<3, 3, U, Q> const& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator+=(U s) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator+=(mat<3, 3, U, Q> const& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator-=(U s) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator-=(mat<3, 3, U, Q> const& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator*=(U s) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator*=(mat<3, 3, U, Q> const& m) - { - return (*this = *this * m); - } - - template - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator/=(U s) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator/=(mat<3, 3, U, Q> const& m) - { - return *this *= inverse(m); - } - - // -- Increment and decrement operators -- - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator++() - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - return *this; - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator--() - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - return *this; - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> mat<3, 3, T, Q>::operator++(int) - { - mat<3, 3, T, Q> Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> mat<3, 3, T, Q>::operator--(int) - { - mat<3, 3, T, Q> Result(*this); - --*this; - return Result; - } - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m) - { - return m; - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m) - { - return mat<3, 3, T, Q>( - -m[0], - -m[1], - -m[2]); - } - - // -- Binary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m, T scalar) - { - return mat<3, 3, T, Q>( - m[0] + scalar, - m[1] + scalar, - m[2] + scalar); - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator+(T scalar, mat<3, 3, T, Q> const& m) - { - return mat<3, 3, T, Q>( - m[0] + scalar, - m[1] + scalar, - m[2] + scalar); - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) - { - return mat<3, 3, T, Q>( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2]); - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m, T scalar) - { - return mat<3, 3, T, Q>( - m[0] - scalar, - m[1] - scalar, - m[2] - scalar); - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(T scalar, mat<3, 3, T, Q> const& m) - { - return mat<3, 3, T, Q>( - scalar - m[0], - scalar - m[1], - scalar - m[2]); - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) - { - return mat<3, 3, T, Q>( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2]); - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m, T scalar) - { - return mat<3, 3, T, Q>( - m[0] * scalar, - m[1] * scalar, - m[2] * scalar); - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(T scalar, mat<3, 3, T, Q> const& m) - { - return mat<3, 3, T, Q>( - m[0] * scalar, - m[1] * scalar, - m[2] * scalar); - } - - template - GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::col_type operator*(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v) - { - return typename mat<3, 3, T, Q>::col_type( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z, - m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z); - } - - template - GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::row_type operator*(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m) - { - return typename mat<3, 3, T, Q>::row_type( - m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z, - m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z, - m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z); - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) - { - T const SrcA00 = m1[0][0]; - T const SrcA01 = m1[0][1]; - T const SrcA02 = m1[0][2]; - T const SrcA10 = m1[1][0]; - T const SrcA11 = m1[1][1]; - T const SrcA12 = m1[1][2]; - T const SrcA20 = m1[2][0]; - T const SrcA21 = m1[2][1]; - T const SrcA22 = m1[2][2]; - - T const SrcB00 = m2[0][0]; - T const SrcB01 = m2[0][1]; - T const SrcB02 = m2[0][2]; - T const SrcB10 = m2[1][0]; - T const SrcB11 = m2[1][1]; - T const SrcB12 = m2[1][2]; - T const SrcB20 = m2[2][0]; - T const SrcB21 = m2[2][1]; - T const SrcB22 = m2[2][2]; - - mat<3, 3, T, Q> Result; - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; - Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; - Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12; - Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22; - Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22; - Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2) - { - return mat<2, 3, T, Q>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], - m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2], - m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2]); - } - - template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) - { - return mat<4, 3, T, Q>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], - m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2], - m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2], - m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2], - m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2], - m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1] + m1[2][2] * m2[2][2], - m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1] + m1[2][0] * m2[3][2], - m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2], - m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1] + m1[2][2] * m2[3][2]); - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m, T scalar) - { - return mat<3, 3, T, Q>( - m[0] / scalar, - m[1] / scalar, - m[2] / scalar); - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator/(T scalar, mat<3, 3, T, Q> const& m) - { - return mat<3, 3, T, Q>( - scalar / m[0], - scalar / m[1], - scalar / m[2]); - } - - template - GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::col_type operator/(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v) - { - return inverse(m) * v; - } - - template - GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::row_type operator/(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m) - { - return v * inverse(m); - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) - { - mat<3, 3, T, Q> m1_copy(m1); - return m1_copy /= m2; - } - - // -- Boolean operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]); - } - - template - GLM_FUNC_QUALIFIER bool operator!=(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]); - } -} //namespace glm diff --git a/3rdparty/glm/source/glm/detail/type_mat3x4.hpp b/3rdparty/glm/source/glm/detail/type_mat3x4.hpp deleted file mode 100644 index 27bc425..0000000 --- a/3rdparty/glm/source/glm/detail/type_mat3x4.hpp +++ /dev/null @@ -1,166 +0,0 @@ -/// @ref core -/// @file glm/detail/type_mat3x4.hpp - -#pragma once - -#include "type_vec3.hpp" -#include "type_vec4.hpp" -#include -#include - -namespace glm -{ - template - struct mat<3, 4, T, Q> - { - typedef vec<4, T, Q> col_type; - typedef vec<3, T, Q> row_type; - typedef mat<3, 4, T, Q> type; - typedef mat<4, 3, T, Q> transpose_type; - typedef T value_type; - - private: - col_type value[3]; - - public: - // -- Accesses -- - - typedef length_t length_type; - GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 3; } - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; - - // -- Constructors -- - - GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; - template - GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<3, 4, T, P> const& m); - - GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR mat( - T x0, T y0, T z0, T w0, - T x1, T y1, T z1, T w1, - T x2, T y2, T z2, T w2); - GLM_FUNC_DECL GLM_CONSTEXPR mat( - col_type const& v0, - col_type const& v1, - col_type const& v2); - - // -- Conversions -- - - template< - typename X1, typename Y1, typename Z1, typename W1, - typename X2, typename Y2, typename Z2, typename W2, - typename X3, typename Y3, typename Z3, typename W3> - GLM_FUNC_DECL GLM_CONSTEXPR mat( - X1 x1, Y1 y1, Z1 z1, W1 w1, - X2 x2, Y2 y2, Z2 z2, W2 w2, - X3 x3, Y3 y3, Z3 z3, W3 w3); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat( - vec<4, V1, Q> const& v1, - vec<4, V2, Q> const& v2, - vec<4, V3, Q> const& v3); - - // -- Matrix conversions -- - - template - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, U, P> const& m); - - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_DECL mat<3, 4, T, Q> & operator=(mat<3, 4, U, Q> const& m); - template - GLM_FUNC_DECL mat<3, 4, T, Q> & operator+=(U s); - template - GLM_FUNC_DECL mat<3, 4, T, Q> & operator+=(mat<3, 4, U, Q> const& m); - template - GLM_FUNC_DECL mat<3, 4, T, Q> & operator-=(U s); - template - GLM_FUNC_DECL mat<3, 4, T, Q> & operator-=(mat<3, 4, U, Q> const& m); - template - GLM_FUNC_DECL mat<3, 4, T, Q> & operator*=(U s); - template - GLM_FUNC_DECL mat<3, 4, T, Q> & operator/=(U s); - - // -- Increment and decrement operators -- - - GLM_FUNC_DECL mat<3, 4, T, Q> & operator++(); - GLM_FUNC_DECL mat<3, 4, T, Q> & operator--(); - GLM_FUNC_DECL mat<3, 4, T, Q> operator++(int); - GLM_FUNC_DECL mat<3, 4, T, Q> operator--(int); - }; - - // -- Unary operators -- - - template - GLM_FUNC_DECL mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m); - - template - GLM_FUNC_DECL mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m); - - // -- Binary operators -- - - template - GLM_FUNC_DECL mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<3, 4, T, Q> operator*(T scalar, mat<3, 4, T, Q> const& m); - - template - GLM_FUNC_DECL typename mat<3, 4, T, Q>::col_type operator*(mat<3, 4, T, Q> const& m, typename mat<3, 4, T, Q>::row_type const& v); - - template - GLM_FUNC_DECL typename mat<3, 4, T, Q>::row_type operator*(typename mat<3, 4, T, Q>::col_type const& v, mat<3, 4, T, Q> const& m); - - template - GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<4, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<2, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<3, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<3, 4, T, Q> operator/(mat<3, 4, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<3, 4, T, Q> operator/(T scalar, mat<3, 4, T, Q> const& m); - - // -- Boolean operators -- - - template - GLM_FUNC_DECL bool operator==(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL bool operator!=(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); -}//namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_mat3x4.inl" -#endif diff --git a/3rdparty/glm/source/glm/detail/type_mat3x4.inl b/3rdparty/glm/source/glm/detail/type_mat3x4.inl deleted file mode 100644 index c1a0fa6..0000000 --- a/3rdparty/glm/source/glm/detail/type_mat3x4.inl +++ /dev/null @@ -1,578 +0,0 @@ -namespace glm -{ - // -- Constructors -- - -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat() -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST - : value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0), col_type(0, 0, 1, 0)} -# endif - { -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION - this->value[0] = col_type(1, 0, 0, 0); - this->value[1] = col_type(0, 1, 0, 0); - this->value[2] = col_type(0, 0, 1, 0); -# endif - } -# endif - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<3, 4, T, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(T s) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(s, 0, 0, 0), col_type(0, s, 0, 0), col_type(0, 0, s, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(s, 0, 0, 0); - this->value[1] = col_type(0, s, 0, 0); - this->value[2] = col_type(0, 0, s, 0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat - ( - T x0, T y0, T z0, T w0, - T x1, T y1, T z1, T w1, - T x2, T y2, T z2, T w2 - ) -# if GLM_HAS_INITIALIZER_LISTS - : value{ - col_type(x0, y0, z0, w0), - col_type(x1, y1, z1, w1), - col_type(x2, y2, z2, w2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x0, y0, z0, w0); - this->value[1] = col_type(x1, y1, z1, w1); - this->value[2] = col_type(x2, y2, z2, w2); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v0), col_type(v1), col_type(v2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; -# endif - } - - // -- Conversion constructors -- - - template - template< - typename X0, typename Y0, typename Z0, typename W0, - typename X1, typename Y1, typename Z1, typename W1, - typename X2, typename Y2, typename Z2, typename W2> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat - ( - X0 x0, Y0 y0, Z0 z0, W0 w0, - X1 x1, Y1 y1, Z1 z1, W1 w1, - X2 x2, Y2 y2, Z2 z2, W2 w2 - ) -# if GLM_HAS_INITIALIZER_LISTS - : value{ - col_type(x0, y0, z0, w0), - col_type(x1, y1, z1, w1), - col_type(x2, y2, z2, w2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x0, y0, z0, w0); - this->value[1] = col_type(x1, y1, z1, w1); - this->value[2] = col_type(x2, y2, z2, w2); -# endif - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(vec<4, V1, Q> const& v0, vec<4, V2, Q> const& v1, vec<4, V3, Q> const& v2) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v0), col_type(v1), col_type(v2)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(v0); - this->value[1] = col_type(v1); - this->value[2] = col_type(v2); -# endif - } - - // -- Matrix conversions -- - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<3, 4, U, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(0, 0, 1, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(0, 0, 1, 0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<4, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(0, 0, 1, 0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(m[2], 1, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(m[2], 1, 0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<2, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0, 0, 1, 0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(m[2], 1, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(m[2], 1, 0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<3, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 0); -# endif - } - - // -- Accesses -- - - template - GLM_FUNC_QUALIFIER typename mat<3, 4, T, Q>::col_type & mat<3, 4, T, Q>::operator[](typename mat<3, 4, T, Q>::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 4, T, Q>::col_type const& mat<3, 4, T, Q>::operator[](typename mat<3, 4, T, Q>::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } - - // -- Unary updatable operators -- - - template - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator=(mat<3, 4, U, Q> const& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator+=(U s) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator+=(mat<3, 4, U, Q> const& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator-=(U s) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator-=(mat<3, 4, U, Q> const& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator*=(U s) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> & mat<3, 4, T, Q>::operator/=(U s) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - return *this; - } - - // -- Increment and decrement operators -- - - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator++() - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - return *this; - } - - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator--() - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - return *this; - } - - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> mat<3, 4, T, Q>::operator++(int) - { - mat<3, 4, T, Q> Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> mat<3, 4, T, Q>::operator--(int) - { - mat<3, 4, T, Q> Result(*this); - --*this; - return Result; - } - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m) - { - return m; - } - - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m) - { - return mat<3, 4, T, Q>( - -m[0], - -m[1], - -m[2]); - } - - // -- Binary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m, T scalar) - { - return mat<3, 4, T, Q>( - m[0] + scalar, - m[1] + scalar, - m[2] + scalar); - } - - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) - { - return mat<3, 4, T, Q>( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2]); - } - - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m, T scalar) - { - return mat<3, 4, T, Q>( - m[0] - scalar, - m[1] - scalar, - m[2] - scalar); - } - - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) - { - return mat<3, 4, T, Q>( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2]); - } - - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m, T scalar) - { - return mat<3, 4, T, Q>( - m[0] * scalar, - m[1] * scalar, - m[2] * scalar); - } - - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(T scalar, mat<3, 4, T, Q> const& m) - { - return mat<3, 4, T, Q>( - m[0] * scalar, - m[1] * scalar, - m[2] * scalar); - } - - template - GLM_FUNC_QUALIFIER typename mat<3, 4, T, Q>::col_type operator* - ( - mat<3, 4, T, Q> const& m, - typename mat<3, 4, T, Q>::row_type const& v - ) - { - return typename mat<3, 4, T, Q>::col_type( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z, - m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z, - m[0][3] * v.x + m[1][3] * v.y + m[2][3] * v.z); - } - - template - GLM_FUNC_QUALIFIER typename mat<3, 4, T, Q>::row_type operator* - ( - typename mat<3, 4, T, Q>::col_type const& v, - mat<3, 4, T, Q> const& m - ) - { - return typename mat<3, 4, T, Q>::row_type( - v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3], - v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2] + v.w * m[1][3], - v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2] + v.w * m[2][3]); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<4, 3, T, Q> const& m2) - { - const T SrcA00 = m1[0][0]; - const T SrcA01 = m1[0][1]; - const T SrcA02 = m1[0][2]; - const T SrcA03 = m1[0][3]; - const T SrcA10 = m1[1][0]; - const T SrcA11 = m1[1][1]; - const T SrcA12 = m1[1][2]; - const T SrcA13 = m1[1][3]; - const T SrcA20 = m1[2][0]; - const T SrcA21 = m1[2][1]; - const T SrcA22 = m1[2][2]; - const T SrcA23 = m1[2][3]; - - const T SrcB00 = m2[0][0]; - const T SrcB01 = m2[0][1]; - const T SrcB02 = m2[0][2]; - const T SrcB10 = m2[1][0]; - const T SrcB11 = m2[1][1]; - const T SrcB12 = m2[1][2]; - const T SrcB20 = m2[2][0]; - const T SrcB21 = m2[2][1]; - const T SrcB22 = m2[2][2]; - const T SrcB30 = m2[3][0]; - const T SrcB31 = m2[3][1]; - const T SrcB32 = m2[3][2]; - - mat<4, 4, T, Q> Result; - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02; - Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02; - Result[0][3] = SrcA03 * SrcB00 + SrcA13 * SrcB01 + SrcA23 * SrcB02; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12; - Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12; - Result[1][3] = SrcA03 * SrcB10 + SrcA13 * SrcB11 + SrcA23 * SrcB12; - Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22; - Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22; - Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22; - Result[2][3] = SrcA03 * SrcB20 + SrcA13 * SrcB21 + SrcA23 * SrcB22; - Result[3][0] = SrcA00 * SrcB30 + SrcA10 * SrcB31 + SrcA20 * SrcB32; - Result[3][1] = SrcA01 * SrcB30 + SrcA11 * SrcB31 + SrcA21 * SrcB32; - Result[3][2] = SrcA02 * SrcB30 + SrcA12 * SrcB31 + SrcA22 * SrcB32; - Result[3][3] = SrcA03 * SrcB30 + SrcA13 * SrcB31 + SrcA23 * SrcB32; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<2, 3, T, Q> const& m2) - { - return mat<2, 4, T, Q>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], - m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2], - m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1] + m1[2][3] * m2[0][2], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2], - m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2], - m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2]); - } - - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<3, 3, T, Q> const& m2) - { - return mat<3, 4, T, Q>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2], - m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2], - m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1] + m1[2][3] * m2[0][2], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2], - m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2], - m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2], - m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2], - m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2], - m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1] + m1[2][2] * m2[2][2], - m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1] + m1[2][3] * m2[2][2]); - } - - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator/(mat<3, 4, T, Q> const& m, T scalar) - { - return mat<3, 4, T, Q>( - m[0] / scalar, - m[1] / scalar, - m[2] / scalar); - } - - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator/(T scalar, mat<3, 4, T, Q> const& m) - { - return mat<3, 4, T, Q>( - scalar / m[0], - scalar / m[1], - scalar / m[2]); - } - - // -- Boolean operators -- - - template - GLM_FUNC_QUALIFIER bool operator==(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]); - } - - template - GLM_FUNC_QUALIFIER bool operator!=(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]); - } -} //namespace glm diff --git a/3rdparty/glm/source/glm/detail/type_mat4x2.hpp b/3rdparty/glm/source/glm/detail/type_mat4x2.hpp deleted file mode 100644 index 56f500d..0000000 --- a/3rdparty/glm/source/glm/detail/type_mat4x2.hpp +++ /dev/null @@ -1,171 +0,0 @@ -/// @ref core -/// @file glm/detail/type_mat4x2.hpp - -#pragma once - -#include "type_vec2.hpp" -#include "type_vec4.hpp" -#include -#include - -namespace glm -{ - template - struct mat<4, 2, T, Q> - { - typedef vec<2, T, Q> col_type; - typedef vec<4, T, Q> row_type; - typedef mat<4, 2, T, Q> type; - typedef mat<2, 4, T, Q> transpose_type; - typedef T value_type; - - private: - col_type value[4]; - - public: - // -- Accesses -- - - typedef length_t length_type; - GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 4; } - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; - - // -- Constructors -- - - GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; - template - GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<4, 2, T, P> const& m); - - GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR mat( - T x0, T y0, - T x1, T y1, - T x2, T y2, - T x3, T y3); - GLM_FUNC_DECL GLM_CONSTEXPR mat( - col_type const& v0, - col_type const& v1, - col_type const& v2, - col_type const& v3); - - // -- Conversions -- - - template< - typename X0, typename Y0, - typename X1, typename Y1, - typename X2, typename Y2, - typename X3, typename Y3> - GLM_FUNC_DECL GLM_CONSTEXPR mat( - X0 x0, Y0 y0, - X1 x1, Y1 y1, - X2 x2, Y2 y2, - X3 x3, Y3 y3); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat( - vec<2, V1, Q> const& v1, - vec<2, V2, Q> const& v2, - vec<2, V3, Q> const& v3, - vec<2, V4, Q> const& v4); - - // -- Matrix conversions -- - - template - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, U, P> const& m); - - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_DECL mat<4, 2, T, Q> & operator=(mat<4, 2, U, Q> const& m); - template - GLM_FUNC_DECL mat<4, 2, T, Q> & operator+=(U s); - template - GLM_FUNC_DECL mat<4, 2, T, Q> & operator+=(mat<4, 2, U, Q> const& m); - template - GLM_FUNC_DECL mat<4, 2, T, Q> & operator-=(U s); - template - GLM_FUNC_DECL mat<4, 2, T, Q> & operator-=(mat<4, 2, U, Q> const& m); - template - GLM_FUNC_DECL mat<4, 2, T, Q> & operator*=(U s); - template - GLM_FUNC_DECL mat<4, 2, T, Q> & operator/=(U s); - - // -- Increment and decrement operators -- - - GLM_FUNC_DECL mat<4, 2, T, Q> & operator++ (); - GLM_FUNC_DECL mat<4, 2, T, Q> & operator-- (); - GLM_FUNC_DECL mat<4, 2, T, Q> operator++(int); - GLM_FUNC_DECL mat<4, 2, T, Q> operator--(int); - }; - - // -- Unary operators -- - - template - GLM_FUNC_DECL mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m); - - template - GLM_FUNC_DECL mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m); - - // -- Binary operators -- - - template - GLM_FUNC_DECL mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<4, 2, T, Q> operator*(T scalar, mat<4, 2, T, Q> const& m); - - template - GLM_FUNC_DECL typename mat<4, 2, T, Q>::col_type operator*(mat<4, 2, T, Q> const& m, typename mat<4, 2, T, Q>::row_type const& v); - - template - GLM_FUNC_DECL typename mat<4, 2, T, Q>::row_type operator*(typename mat<4, 2, T, Q>::col_type const& v, mat<4, 2, T, Q> const& m); - - template - GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<2, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<3, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<4, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<4, 2, T, Q> operator/(mat<4, 2, T, Q> const& m, T scalar); - - template - GLM_FUNC_DECL mat<4, 2, T, Q> operator/(T scalar, mat<4, 2, T, Q> const& m); - - // -- Boolean operators -- - - template - GLM_FUNC_DECL bool operator==(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); - - template - GLM_FUNC_DECL bool operator!=(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2); -}//namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_mat4x2.inl" -#endif diff --git a/3rdparty/glm/source/glm/detail/type_mat4x2.inl b/3rdparty/glm/source/glm/detail/type_mat4x2.inl deleted file mode 100644 index efe5833..0000000 --- a/3rdparty/glm/source/glm/detail/type_mat4x2.inl +++ /dev/null @@ -1,574 +0,0 @@ -namespace glm -{ - // -- Constructors -- - -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat() -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST - : value{col_type(1, 0), col_type(0, 1), col_type(0, 0), col_type(0, 0)} -# endif - { -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION - this->value[0] = col_type(1, 0); - this->value[1] = col_type(0, 1); - this->value[2] = col_type(0, 0); - this->value[3] = col_type(0, 0); -# endif - } -# endif - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<4, 2, T, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(T s) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(s, 0), col_type(0, s), col_type(0, 0), col_type(0, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(s, 0); - this->value[1] = col_type(0, s); - this->value[2] = col_type(0, 0); - this->value[3] = col_type(0, 0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat - ( - T x0, T y0, - T x1, T y1, - T x2, T y2, - T x3, T y3 - ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(x0, y0), col_type(x1, y1), col_type(x2, y2), col_type(x3, y3)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x0, y0); - this->value[1] = col_type(x1, y1); - this->value[2] = col_type(x2, y2); - this->value[3] = col_type(x3, y3); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2, col_type const& v3) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v0), col_type(v1), col_type(v2), col_type(v3)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - this->value[3] = v3; -# endif - } - - // -- Conversion constructors -- - - template - template< - typename X0, typename Y0, - typename X1, typename Y1, - typename X2, typename Y2, - typename X3, typename Y3> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat - ( - X0 x0, Y0 y0, - X1 x1, Y1 y1, - X2 x2, Y2 y2, - X3 x3, Y3 y3 - ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(x0, y0), col_type(x1, y1), col_type(x2, y2), col_type(x3, y3)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x0, y0); - this->value[1] = col_type(x1, y1); - this->value[2] = col_type(x2, y2); - this->value[3] = col_type(x3, y3); -# endif - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(vec<2, V0, Q> const& v0, vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2, vec<2, V3, Q> const& v3) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v0), col_type(v1), col_type(v2), col_type(v3)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(v0); - this->value[1] = col_type(v1); - this->value[2] = col_type(v2); - this->value[3] = col_type(v3); -# endif - } - - // -- Conversion -- - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<4, 2, U, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(m[3]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<2, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(0), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0); - this->value[3] = col_type(0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<3, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<4, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(m[3]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<2, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(0), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0); - this->value[3] = col_type(0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<3, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<2, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(0), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0); - this->value[3] = col_type(0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<4, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(m[3]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 2, T, Q>::mat(mat<3, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(0); -# endif - } - - // -- Accesses -- - - template - GLM_FUNC_QUALIFIER typename mat<4, 2, T, Q>::col_type & mat<4, 2, T, Q>::operator[](typename mat<4, 2, T, Q>::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 2, T, Q>::col_type const& mat<4, 2, T, Q>::operator[](typename mat<4, 2, T, Q>::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } - - // -- Unary updatable operators -- - - template - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q>& mat<4, 2, T, Q>::operator=(mat<4, 2, U, Q> const& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator+=(U s) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - this->value[3] += s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator+=(mat<4, 2, U, Q> const& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - this->value[3] += m[3]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator-=(U s) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - this->value[3] -= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator-=(mat<4, 2, U, Q> const& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - this->value[3] -= m[3]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator*=(U s) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - this->value[3] *= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator/=(U s) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - this->value[3] /= s; - return *this; - } - - // -- Increment and decrement operators -- - - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator++() - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - ++this->value[3]; - return *this; - } - - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator--() - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - --this->value[3]; - return *this; - } - - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> mat<4, 2, T, Q>::operator++(int) - { - mat<4, 2, T, Q> Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> mat<4, 2, T, Q>::operator--(int) - { - mat<4, 2, T, Q> Result(*this); - --*this; - return Result; - } - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m) - { - return m; - } - - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m) - { - return mat<4, 2, T, Q>( - -m[0], - -m[1], - -m[2], - -m[3]); - } - - // -- Binary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m, T scalar) - { - return mat<4, 2, T, Q>( - m[0] + scalar, - m[1] + scalar, - m[2] + scalar, - m[3] + scalar); - } - - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) - { - return mat<4, 2, T, Q>( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2], - m1[3] + m2[3]); - } - - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m, T scalar) - { - return mat<4, 2, T, Q>( - m[0] - scalar, - m[1] - scalar, - m[2] - scalar, - m[3] - scalar); - } - - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) - { - return mat<4, 2, T, Q>( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2], - m1[3] - m2[3]); - } - - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m, T scalar) - { - return mat<4, 2, T, Q>( - m[0] * scalar, - m[1] * scalar, - m[2] * scalar, - m[3] * scalar); - } - - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(T scalar, mat<4, 2, T, Q> const& m) - { - return mat<4, 2, T, Q>( - m[0] * scalar, - m[1] * scalar, - m[2] * scalar, - m[3] * scalar); - } - - template - GLM_FUNC_QUALIFIER typename mat<4, 2, T, Q>::col_type operator*(mat<4, 2, T, Q> const& m, typename mat<4, 2, T, Q>::row_type const& v) - { - return typename mat<4, 2, T, Q>::col_type( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w); - } - - template - GLM_FUNC_QUALIFIER typename mat<4, 2, T, Q>::row_type operator*(typename mat<4, 2, T, Q>::col_type const& v, mat<4, 2, T, Q> const& m) - { - return typename mat<4, 2, T, Q>::row_type( - v.x * m[0][0] + v.y * m[0][1], - v.x * m[1][0] + v.y * m[1][1], - v.x * m[2][0] + v.y * m[2][1], - v.x * m[3][0] + v.y * m[3][1]); - } - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<2, 4, T, Q> const& m2) - { - T const SrcA00 = m1[0][0]; - T const SrcA01 = m1[0][1]; - T const SrcA10 = m1[1][0]; - T const SrcA11 = m1[1][1]; - T const SrcA20 = m1[2][0]; - T const SrcA21 = m1[2][1]; - T const SrcA30 = m1[3][0]; - T const SrcA31 = m1[3][1]; - - T const SrcB00 = m2[0][0]; - T const SrcB01 = m2[0][1]; - T const SrcB02 = m2[0][2]; - T const SrcB03 = m2[0][3]; - T const SrcB10 = m2[1][0]; - T const SrcB11 = m2[1][1]; - T const SrcB12 = m2[1][2]; - T const SrcB13 = m2[1][3]; - - mat<2, 2, T, Q> Result; - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<3, 4, T, Q> const& m2) - { - return mat<3, 2, T, Q>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3], - m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3], - m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3]); - } - - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<4, 4, T, Q> const& m2) - { - return mat<4, 2, T, Q>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3], - m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3], - m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3], - m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1] + m1[2][0] * m2[3][2] + m1[3][0] * m2[3][3], - m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2] + m1[3][1] * m2[3][3]); - } - - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator/(mat<4, 2, T, Q> const& m, T scalar) - { - return mat<4, 2, T, Q>( - m[0] / scalar, - m[1] / scalar, - m[2] / scalar, - m[3] / scalar); - } - - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator/(T scalar, mat<4, 2, T, Q> const& m) - { - return mat<4, 2, T, Q>( - scalar / m[0], - scalar / m[1], - scalar / m[2], - scalar / m[3]); - } - - // -- Boolean operators -- - - template - GLM_FUNC_QUALIFIER bool operator==(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]); - } - - template - GLM_FUNC_QUALIFIER bool operator!=(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]); - } -} //namespace glm diff --git a/3rdparty/glm/source/glm/detail/type_mat4x3.hpp b/3rdparty/glm/source/glm/detail/type_mat4x3.hpp deleted file mode 100644 index 5a4668f..0000000 --- a/3rdparty/glm/source/glm/detail/type_mat4x3.hpp +++ /dev/null @@ -1,171 +0,0 @@ -/// @ref core -/// @file glm/detail/type_mat4x3.hpp - -#pragma once - -#include "type_vec3.hpp" -#include "type_vec4.hpp" -#include -#include - -namespace glm -{ - template - struct mat<4, 3, T, Q> - { - typedef vec<3, T, Q> col_type; - typedef vec<4, T, Q> row_type; - typedef mat<4, 3, T, Q> type; - typedef mat<3, 4, T, Q> transpose_type; - typedef T value_type; - - private: - col_type value[4]; - - public: - // -- Accesses -- - - typedef length_t length_type; - GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 4; } - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; - - // -- Constructors -- - - GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; - template - GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<4, 3, T, P> const& m); - - GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T const& x); - GLM_FUNC_DECL GLM_CONSTEXPR mat( - T const& x0, T const& y0, T const& z0, - T const& x1, T const& y1, T const& z1, - T const& x2, T const& y2, T const& z2, - T const& x3, T const& y3, T const& z3); - GLM_FUNC_DECL GLM_CONSTEXPR mat( - col_type const& v0, - col_type const& v1, - col_type const& v2, - col_type const& v3); - - // -- Conversions -- - - template< - typename X1, typename Y1, typename Z1, - typename X2, typename Y2, typename Z2, - typename X3, typename Y3, typename Z3, - typename X4, typename Y4, typename Z4> - GLM_FUNC_DECL GLM_CONSTEXPR mat( - X1 const& x1, Y1 const& y1, Z1 const& z1, - X2 const& x2, Y2 const& y2, Z2 const& z2, - X3 const& x3, Y3 const& y3, Z3 const& z3, - X4 const& x4, Y4 const& y4, Z4 const& z4); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat( - vec<3, V1, Q> const& v1, - vec<3, V2, Q> const& v2, - vec<3, V3, Q> const& v3, - vec<3, V4, Q> const& v4); - - // -- Matrix conversions -- - - template - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, U, P> const& m); - - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_DECL mat<4, 3, T, Q> & operator=(mat<4, 3, U, Q> const& m); - template - GLM_FUNC_DECL mat<4, 3, T, Q> & operator+=(U s); - template - GLM_FUNC_DECL mat<4, 3, T, Q> & operator+=(mat<4, 3, U, Q> const& m); - template - GLM_FUNC_DECL mat<4, 3, T, Q> & operator-=(U s); - template - GLM_FUNC_DECL mat<4, 3, T, Q> & operator-=(mat<4, 3, U, Q> const& m); - template - GLM_FUNC_DECL mat<4, 3, T, Q> & operator*=(U s); - template - GLM_FUNC_DECL mat<4, 3, T, Q> & operator/=(U s); - - // -- Increment and decrement operators -- - - GLM_FUNC_DECL mat<4, 3, T, Q>& operator++(); - GLM_FUNC_DECL mat<4, 3, T, Q>& operator--(); - GLM_FUNC_DECL mat<4, 3, T, Q> operator++(int); - GLM_FUNC_DECL mat<4, 3, T, Q> operator--(int); - }; - - // -- Unary operators -- - - template - GLM_FUNC_DECL mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m); - - template - GLM_FUNC_DECL mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m); - - // -- Binary operators -- - - template - GLM_FUNC_DECL mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m, T const& s); - - template - GLM_FUNC_DECL mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m, T const& s); - - template - GLM_FUNC_DECL mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m, T const& s); - - template - GLM_FUNC_DECL mat<4, 3, T, Q> operator*(T const& s, mat<4, 3, T, Q> const& m); - - template - GLM_FUNC_DECL typename mat<4, 3, T, Q>::col_type operator*(mat<4, 3, T, Q> const& m, typename mat<4, 3, T, Q>::row_type const& v); - - template - GLM_FUNC_DECL typename mat<4, 3, T, Q>::row_type operator*(typename mat<4, 3, T, Q>::col_type const& v, mat<4, 3, T, Q> const& m); - - template - GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<2, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<3, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<4, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<4, 3, T, Q> operator/(mat<4, 3, T, Q> const& m, T const& s); - - template - GLM_FUNC_DECL mat<4, 3, T, Q> operator/(T const& s, mat<4, 3, T, Q> const& m); - - // -- Boolean operators -- - - template - GLM_FUNC_DECL bool operator==(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); - - template - GLM_FUNC_DECL bool operator!=(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2); -}//namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_mat4x3.inl" -#endif //GLM_EXTERNAL_TEMPLATE diff --git a/3rdparty/glm/source/glm/detail/type_mat4x3.inl b/3rdparty/glm/source/glm/detail/type_mat4x3.inl deleted file mode 100644 index 1249e95..0000000 --- a/3rdparty/glm/source/glm/detail/type_mat4x3.inl +++ /dev/null @@ -1,598 +0,0 @@ -namespace glm -{ - // -- Constructors -- - -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat() -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST - : value{col_type(1, 0, 0), col_type(0, 1, 0), col_type(0, 0, 1), col_type(0, 0, 0)} -# endif - { -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION - this->value[0] = col_type(1, 0, 0); - this->value[1] = col_type(0, 1, 0); - this->value[2] = col_type(0, 0, 1); - this->value[3] = col_type(0, 0, 0); -# endif - } -# endif - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<4, 3, T, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(T const& s) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(s, 0, 0), col_type(0, s, 0), col_type(0, 0, s), col_type(0, 0, 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(s, 0, 0); - this->value[1] = col_type(0, s, 0); - this->value[2] = col_type(0, 0, s); - this->value[3] = col_type(0, 0, 0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat - ( - T const& x0, T const& y0, T const& z0, - T const& x1, T const& y1, T const& z1, - T const& x2, T const& y2, T const& z2, - T const& x3, T const& y3, T const& z3 - ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(x0, y0, z0), col_type(x1, y1, z1), col_type(x2, y2, z2), col_type(x3, y3, z3)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x0, y0, z0); - this->value[1] = col_type(x1, y1, z1); - this->value[2] = col_type(x2, y2, z2); - this->value[3] = col_type(x3, y3, z3); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2, col_type const& v3) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v0), col_type(v1), col_type(v2), col_type(v3)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - this->value[3] = v3; -# endif - } - - // -- Conversion constructors -- - - template - template< - typename X0, typename Y0, typename Z0, - typename X1, typename Y1, typename Z1, - typename X2, typename Y2, typename Z2, - typename X3, typename Y3, typename Z3> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat - ( - X0 const& x0, Y0 const& y0, Z0 const& z0, - X1 const& x1, Y1 const& y1, Z1 const& z1, - X2 const& x2, Y2 const& y2, Z2 const& z2, - X3 const& x3, Y3 const& y3, Z3 const& z3 - ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(x0, y0, z0), col_type(x1, y1, z1), col_type(x2, y2, z2), col_type(x3, y3, z3)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x0, y0, z0); - this->value[1] = col_type(x1, y1, z1); - this->value[2] = col_type(x2, y2, z2); - this->value[3] = col_type(x3, y3, z3); -# endif - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2, vec<3, V3, Q> const& v3, vec<3, V4, Q> const& v4) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v1), col_type(v2), col_type(v3), col_type(v4)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); - this->value[2] = col_type(v3); - this->value[3] = col_type(v4); -# endif - } - - // -- Matrix conversions -- - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<4, 3, U, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(m[3]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<2, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(0, 0, 1); - this->value[3] = col_type(0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<3, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<4, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(m[3]); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<2, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0, 0, 1); - this->value[3] = col_type(0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<3, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 1), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 1); - this->value[3] = col_type(0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<2, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(0, 0, 1); - this->value[3] = col_type(0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<4, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 1), col_type(m[3], 0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 1); - this->value[3] = col_type(m[3], 0); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 3, T, Q>::mat(mat<3, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(0); -# endif - } - - // -- Accesses -- - - template - GLM_FUNC_QUALIFIER typename mat<4, 3, T, Q>::col_type & mat<4, 3, T, Q>::operator[](typename mat<4, 3, T, Q>::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 3, T, Q>::col_type const& mat<4, 3, T, Q>::operator[](typename mat<4, 3, T, Q>::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } - - // -- Unary updatable operators -- - - template - template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q>& mat<4, 3, T, Q>::operator=(mat<4, 3, U, Q> const& m) - { - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator+=(U s) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - this->value[3] += s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator+=(mat<4, 3, U, Q> const& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - this->value[3] += m[3]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator-=(U s) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - this->value[3] -= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator-=(mat<4, 3, U, Q> const& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - this->value[3] -= m[3]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator*=(U s) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - this->value[3] *= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator/=(U s) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - this->value[3] /= s; - return *this; - } - - // -- Increment and decrement operators -- - - template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator++() - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - ++this->value[3]; - return *this; - } - - template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator--() - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - --this->value[3]; - return *this; - } - - template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> mat<4, 3, T, Q>::operator++(int) - { - mat<4, 3, T, Q> Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> mat<4, 3, T, Q>::operator--(int) - { - mat<4, 3, T, Q> Result(*this); - --*this; - return Result; - } - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m) - { - return m; - } - - template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m) - { - return mat<4, 3, T, Q>( - -m[0], - -m[1], - -m[2], - -m[3]); - } - - // -- Binary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m, T const& s) - { - return mat<4, 3, T, Q>( - m[0] + s, - m[1] + s, - m[2] + s, - m[3] + s); - } - - template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) - { - return mat<4, 3, T, Q>( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2], - m1[3] + m2[3]); - } - - template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m, T const& s) - { - return mat<4, 3, T, Q>( - m[0] - s, - m[1] - s, - m[2] - s, - m[3] - s); - } - - template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) - { - return mat<4, 3, T, Q>( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2], - m1[3] - m2[3]); - } - - template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m, T const& s) - { - return mat<4, 3, T, Q>( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); - } - - template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(T const& s, mat<4, 3, T, Q> const& m) - { - return mat<4, 3, T, Q>( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); - } - - template - GLM_FUNC_QUALIFIER typename mat<4, 3, T, Q>::col_type operator* - ( - mat<4, 3, T, Q> const& m, - typename mat<4, 3, T, Q>::row_type const& v) - { - return typename mat<4, 3, T, Q>::col_type( - m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w, - m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w, - m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w); - } - - template - GLM_FUNC_QUALIFIER typename mat<4, 3, T, Q>::row_type operator* - ( - typename mat<4, 3, T, Q>::col_type const& v, - mat<4, 3, T, Q> const& m) - { - return typename mat<4, 3, T, Q>::row_type( - v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2], - v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2], - v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2], - v.x * m[3][0] + v.y * m[3][1] + v.z * m[3][2]); - } - - template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<2, 4, T, Q> const& m2) - { - return mat<2, 3, T, Q>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], - m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3], - m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3]); - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<3, 4, T, Q> const& m2) - { - T const SrcA00 = m1[0][0]; - T const SrcA01 = m1[0][1]; - T const SrcA02 = m1[0][2]; - T const SrcA10 = m1[1][0]; - T const SrcA11 = m1[1][1]; - T const SrcA12 = m1[1][2]; - T const SrcA20 = m1[2][0]; - T const SrcA21 = m1[2][1]; - T const SrcA22 = m1[2][2]; - T const SrcA30 = m1[3][0]; - T const SrcA31 = m1[3][1]; - T const SrcA32 = m1[3][2]; - - T const SrcB00 = m2[0][0]; - T const SrcB01 = m2[0][1]; - T const SrcB02 = m2[0][2]; - T const SrcB03 = m2[0][3]; - T const SrcB10 = m2[1][0]; - T const SrcB11 = m2[1][1]; - T const SrcB12 = m2[1][2]; - T const SrcB13 = m2[1][3]; - T const SrcB20 = m2[2][0]; - T const SrcB21 = m2[2][1]; - T const SrcB22 = m2[2][2]; - T const SrcB23 = m2[2][3]; - - mat<3, 3, T, Q> Result; - Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03; - Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03; - Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02 + SrcA32 * SrcB03; - Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13; - Result[1][1] = SrcA01 * SrcB10 + SrcA11 * SrcB11 + SrcA21 * SrcB12 + SrcA31 * SrcB13; - Result[1][2] = SrcA02 * SrcB10 + SrcA12 * SrcB11 + SrcA22 * SrcB12 + SrcA32 * SrcB13; - Result[2][0] = SrcA00 * SrcB20 + SrcA10 * SrcB21 + SrcA20 * SrcB22 + SrcA30 * SrcB23; - Result[2][1] = SrcA01 * SrcB20 + SrcA11 * SrcB21 + SrcA21 * SrcB22 + SrcA31 * SrcB23; - Result[2][2] = SrcA02 * SrcB20 + SrcA12 * SrcB21 + SrcA22 * SrcB22 + SrcA32 * SrcB23; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<4, 4, T, Q> const& m2) - { - return mat<4, 3, T, Q>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], - m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3], - m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3], - m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3], - m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3], - m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1] + m1[2][2] * m2[2][2] + m1[3][2] * m2[2][3], - m1[0][0] * m2[3][0] + m1[1][0] * m2[3][1] + m1[2][0] * m2[3][2] + m1[3][0] * m2[3][3], - m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2] + m1[3][1] * m2[3][3], - m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1] + m1[2][2] * m2[3][2] + m1[3][2] * m2[3][3]); - } - - template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator/(mat<4, 3, T, Q> const& m, T const& s) - { - return mat<4, 3, T, Q>( - m[0] / s, - m[1] / s, - m[2] / s, - m[3] / s); - } - - template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator/(T const& s, mat<4, 3, T, Q> const& m) - { - return mat<4, 3, T, Q>( - s / m[0], - s / m[1], - s / m[2], - s / m[3]); - } - - // -- Boolean operators -- - - template - GLM_FUNC_QUALIFIER bool operator==(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]); - } - - template - GLM_FUNC_QUALIFIER bool operator!=(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]); - } -} //namespace glm diff --git a/3rdparty/glm/source/glm/detail/type_mat4x4.hpp b/3rdparty/glm/source/glm/detail/type_mat4x4.hpp deleted file mode 100644 index b92e208..0000000 --- a/3rdparty/glm/source/glm/detail/type_mat4x4.hpp +++ /dev/null @@ -1,189 +0,0 @@ -/// @ref core -/// @file glm/detail/type_mat4x4.hpp - -#pragma once - -#include "type_vec4.hpp" -#include -#include - -namespace glm -{ - template - struct mat<4, 4, T, Q> - { - typedef vec<4, T, Q> col_type; - typedef vec<4, T, Q> row_type; - typedef mat<4, 4, T, Q> type; - typedef mat<4, 4, T, Q> transpose_type; - typedef T value_type; - - private: - col_type value[4]; - - public: - // -- Accesses -- - - typedef length_t length_type; - GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;} - - GLM_FUNC_DECL col_type & operator[](length_type i); - GLM_FUNC_DECL GLM_CONSTEXPR col_type const& operator[](length_type i) const; - - // -- Constructors -- - - GLM_FUNC_DECL GLM_CONSTEXPR mat() GLM_DEFAULT_CTOR; - template - GLM_FUNC_DECL GLM_CONSTEXPR mat(mat<4, 4, T, P> const& m); - - GLM_FUNC_DECL explicit GLM_CONSTEXPR mat(T const& x); - GLM_FUNC_DECL GLM_CONSTEXPR mat( - T const& x0, T const& y0, T const& z0, T const& w0, - T const& x1, T const& y1, T const& z1, T const& w1, - T const& x2, T const& y2, T const& z2, T const& w2, - T const& x3, T const& y3, T const& z3, T const& w3); - GLM_FUNC_DECL GLM_CONSTEXPR mat( - col_type const& v0, - col_type const& v1, - col_type const& v2, - col_type const& v3); - - // -- Conversions -- - - template< - typename X1, typename Y1, typename Z1, typename W1, - typename X2, typename Y2, typename Z2, typename W2, - typename X3, typename Y3, typename Z3, typename W3, - typename X4, typename Y4, typename Z4, typename W4> - GLM_FUNC_DECL GLM_CONSTEXPR mat( - X1 const& x1, Y1 const& y1, Z1 const& z1, W1 const& w1, - X2 const& x2, Y2 const& y2, Z2 const& z2, W2 const& w2, - X3 const& x3, Y3 const& y3, Z3 const& z3, W3 const& w3, - X4 const& x4, Y4 const& y4, Z4 const& z4, W4 const& w4); - - template - GLM_FUNC_DECL GLM_CONSTEXPR mat( - vec<4, V1, Q> const& v1, - vec<4, V2, Q> const& v2, - vec<4, V3, Q> const& v3, - vec<4, V4, Q> const& v4); - - // -- Matrix conversions -- - - template - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 4, U, P> const& m); - - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 3, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<2, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 2, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<3, 4, T, Q> const& x); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR mat(mat<4, 3, T, Q> const& x); - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_DECL mat<4, 4, T, Q> & operator=(mat<4, 4, U, Q> const& m); - template - GLM_FUNC_DECL mat<4, 4, T, Q> & operator+=(U s); - template - GLM_FUNC_DECL mat<4, 4, T, Q> & operator+=(mat<4, 4, U, Q> const& m); - template - GLM_FUNC_DECL mat<4, 4, T, Q> & operator-=(U s); - template - GLM_FUNC_DECL mat<4, 4, T, Q> & operator-=(mat<4, 4, U, Q> const& m); - template - GLM_FUNC_DECL mat<4, 4, T, Q> & operator*=(U s); - template - GLM_FUNC_DECL mat<4, 4, T, Q> & operator*=(mat<4, 4, U, Q> const& m); - template - GLM_FUNC_DECL mat<4, 4, T, Q> & operator/=(U s); - template - GLM_FUNC_DECL mat<4, 4, T, Q> & operator/=(mat<4, 4, U, Q> const& m); - - // -- Increment and decrement operators -- - - GLM_FUNC_DECL mat<4, 4, T, Q> & operator++(); - GLM_FUNC_DECL mat<4, 4, T, Q> & operator--(); - GLM_FUNC_DECL mat<4, 4, T, Q> operator++(int); - GLM_FUNC_DECL mat<4, 4, T, Q> operator--(int); - }; - - // -- Unary operators -- - - template - GLM_FUNC_DECL mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m); - - template - GLM_FUNC_DECL mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m); - - // -- Binary operators -- - - template - GLM_FUNC_DECL mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m, T const& s); - - template - GLM_FUNC_DECL mat<4, 4, T, Q> operator+(T const& s, mat<4, 4, T, Q> const& m); - - template - GLM_FUNC_DECL mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m, T const& s); - - template - GLM_FUNC_DECL mat<4, 4, T, Q> operator-(T const& s, mat<4, 4, T, Q> const& m); - - template - GLM_FUNC_DECL mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m, T const& s); - - template - GLM_FUNC_DECL mat<4, 4, T, Q> operator*(T const& s, mat<4, 4, T, Q> const& m); - - template - GLM_FUNC_DECL typename mat<4, 4, T, Q>::col_type operator*(mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v); - - template - GLM_FUNC_DECL typename mat<4, 4, T, Q>::row_type operator*(typename mat<4, 4, T, Q>::col_type const& v, mat<4, 4, T, Q> const& m); - - template - GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m, T const& s); - - template - GLM_FUNC_DECL mat<4, 4, T, Q> operator/(T const& s, mat<4, 4, T, Q> const& m); - - template - GLM_FUNC_DECL typename mat<4, 4, T, Q>::col_type operator/(mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v); - - template - GLM_FUNC_DECL typename mat<4, 4, T, Q>::row_type operator/(typename mat<4, 4, T, Q>::col_type const& v, mat<4, 4, T, Q> const& m); - - template - GLM_FUNC_DECL mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); - - // -- Boolean operators -- - - template - GLM_FUNC_DECL bool operator==(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); - - template - GLM_FUNC_DECL bool operator!=(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2); -}//namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_mat4x4.inl" -#endif//GLM_EXTERNAL_TEMPLATE diff --git a/3rdparty/glm/source/glm/detail/type_mat4x4.inl b/3rdparty/glm/source/glm/detail/type_mat4x4.inl deleted file mode 100644 index 5c2166e..0000000 --- a/3rdparty/glm/source/glm/detail/type_mat4x4.inl +++ /dev/null @@ -1,706 +0,0 @@ -#include "../matrix.hpp" - -namespace glm -{ - // -- Constructors -- - -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat() -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALIZER_LIST - : value{col_type(1, 0, 0, 0), col_type(0, 1, 0, 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} -# endif - { -# if GLM_CONFIG_CTOR_INIT == GLM_CTOR_INITIALISATION - this->value[0] = col_type(1, 0, 0, 0); - this->value[1] = col_type(0, 1, 0, 0); - this->value[2] = col_type(0, 0, 1, 0); - this->value[3] = col_type(0, 0, 0, 1); -# endif - } -# endif - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<4, 4, T, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(T const& s) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(s, 0, 0, 0), col_type(0, s, 0, 0), col_type(0, 0, s, 0), col_type(0, 0, 0, s)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(s, 0, 0, 0); - this->value[1] = col_type(0, s, 0, 0); - this->value[2] = col_type(0, 0, s, 0); - this->value[3] = col_type(0, 0, 0, s); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat - ( - T const& x0, T const& y0, T const& z0, T const& w0, - T const& x1, T const& y1, T const& z1, T const& w1, - T const& x2, T const& y2, T const& z2, T const& w2, - T const& x3, T const& y3, T const& z3, T const& w3 - ) -# if GLM_HAS_INITIALIZER_LISTS - : value{ - col_type(x0, y0, z0, w0), - col_type(x1, y1, z1, w1), - col_type(x2, y2, z2, w2), - col_type(x3, y3, z3, w3)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x0, y0, z0, w0); - this->value[1] = col_type(x1, y1, z1, w1); - this->value[2] = col_type(x2, y2, z2, w2); - this->value[3] = col_type(x3, y3, z3, w3); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(col_type const& v0, col_type const& v1, col_type const& v2, col_type const& v3) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v0), col_type(v1), col_type(v2), col_type(v3)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = v0; - this->value[1] = v1; - this->value[2] = v2; - this->value[3] = v3; -# endif - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<4, 4, U, P> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(m[3])} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0]); - this->value[1] = col_type(m[1]); - this->value[2] = col_type(m[2]); - this->value[3] = col_type(m[3]); -# endif - } - - // -- Conversions -- - - template - template< - typename X1, typename Y1, typename Z1, typename W1, - typename X2, typename Y2, typename Z2, typename W2, - typename X3, typename Y3, typename Z3, typename W3, - typename X4, typename Y4, typename Z4, typename W4> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat - ( - X1 const& x1, Y1 const& y1, Z1 const& z1, W1 const& w1, - X2 const& x2, Y2 const& y2, Z2 const& z2, W2 const& w2, - X3 const& x3, Y3 const& y3, Z3 const& z3, W3 const& w3, - X4 const& x4, Y4 const& y4, Z4 const& z4, W4 const& w4 - ) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(x1, y1, z1, w1), col_type(x2, y2, z2, w2), col_type(x3, y3, z3, w3), col_type(x4, y4, z4, w4)} -# endif - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid."); - - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 5th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 6th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 7th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 8th parameter type invalid."); - - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 9th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 10th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 11th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 12th parameter type invalid."); - - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 13th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 14th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 15th parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 16th parameter type invalid."); - -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(x1, y1, z1, w1); - this->value[1] = col_type(x2, y2, z2, w2); - this->value[2] = col_type(x3, y3, z3, w3); - this->value[3] = col_type(x4, y4, z4, w4); -# endif - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(vec<4, V1, Q> const& v1, vec<4, V2, Q> const& v2, vec<4, V3, Q> const& v3, vec<4, V4, Q> const& v4) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(v1), col_type(v2), col_type(v3), col_type(v4)} -# endif - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid."); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid."); - -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(v1); - this->value[1] = col_type(v2); - this->value[2] = col_type(v3); - this->value[3] = col_type(v4); -# endif - } - - // -- Matrix conversions -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<2, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(0, 0, 1, 0); - this->value[3] = col_type(0, 0, 0, 1); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<3, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0), col_type(0, 0, 0, 1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 0); - this->value[3] = col_type(0, 0, 0, 1); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<2, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(0, 0, 1, 0); - this->value[3] = col_type(0, 0, 0, 1); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<3, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(m[2], 1, 0), col_type(0, 0, 0, 1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(m[2], 1, 0); - this->value[3] = col_type(0, 0, 0, 1); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<2, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = col_type(0, 0, 1, 0); - this->value[3] = col_type(0, 0, 0, 1); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<4, 2, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0, 0), col_type(m[1], 0, 0), col_type(0, 0, 1, 0), col_type(0, 0, 0, 1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0, 0); - this->value[1] = col_type(m[1], 0, 0); - this->value[2] = col_type(0, 0, 1, 0); - this->value[3] = col_type(0, 0, 0, 1); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<3, 4, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0]), col_type(m[1]), col_type(m[2]), col_type(0, 0, 0, 1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = col_type(0, 0, 0, 1); -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR mat<4, 4, T, Q>::mat(mat<4, 3, T, Q> const& m) -# if GLM_HAS_INITIALIZER_LISTS - : value{col_type(m[0], 0), col_type(m[1], 0), col_type(m[2], 0), col_type(m[3], 1)} -# endif - { -# if !GLM_HAS_INITIALIZER_LISTS - this->value[0] = col_type(m[0], 0); - this->value[1] = col_type(m[1], 0); - this->value[2] = col_type(m[2], 0); - this->value[3] = col_type(m[3], 1); -# endif - } - - // -- Accesses -- - - template - GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::col_type & mat<4, 4, T, Q>::operator[](typename mat<4, 4, T, Q>::length_type i) - { - assert(i < this->length()); - return this->value[i]; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 4, T, Q>::col_type const& mat<4, 4, T, Q>::operator[](typename mat<4, 4, T, Q>::length_type i) const - { - assert(i < this->length()); - return this->value[i]; - } - - // -- Unary arithmetic operators -- - - template - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator=(mat<4, 4, U, Q> const& m) - { - //memcpy could be faster - //memcpy(&this->value, &m.value, 16 * sizeof(valType)); - this->value[0] = m[0]; - this->value[1] = m[1]; - this->value[2] = m[2]; - this->value[3] = m[3]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator+=(U s) - { - this->value[0] += s; - this->value[1] += s; - this->value[2] += s; - this->value[3] += s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator+=(mat<4, 4, U, Q> const& m) - { - this->value[0] += m[0]; - this->value[1] += m[1]; - this->value[2] += m[2]; - this->value[3] += m[3]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator-=(U s) - { - this->value[0] -= s; - this->value[1] -= s; - this->value[2] -= s; - this->value[3] -= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator-=(mat<4, 4, U, Q> const& m) - { - this->value[0] -= m[0]; - this->value[1] -= m[1]; - this->value[2] -= m[2]; - this->value[3] -= m[3]; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator*=(U s) - { - this->value[0] *= s; - this->value[1] *= s; - this->value[2] *= s; - this->value[3] *= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator*=(mat<4, 4, U, Q> const& m) - { - return (*this = *this * m); - } - - template - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator/=(U s) - { - this->value[0] /= s; - this->value[1] /= s; - this->value[2] /= s; - this->value[3] /= s; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator/=(mat<4, 4, U, Q> const& m) - { - return *this *= inverse(m); - } - - // -- Increment and decrement operators -- - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator++() - { - ++this->value[0]; - ++this->value[1]; - ++this->value[2]; - ++this->value[3]; - return *this; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator--() - { - --this->value[0]; - --this->value[1]; - --this->value[2]; - --this->value[3]; - return *this; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> mat<4, 4, T, Q>::operator++(int) - { - mat<4, 4, T, Q> Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> mat<4, 4, T, Q>::operator--(int) - { - mat<4, 4, T, Q> Result(*this); - --*this; - return Result; - } - - // -- Unary constant operators -- - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m) - { - return m; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m) - { - return mat<4, 4, T, Q>( - -m[0], - -m[1], - -m[2], - -m[3]); - } - - // -- Binary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m, T const& s) - { - return mat<4, 4, T, Q>( - m[0] + s, - m[1] + s, - m[2] + s, - m[3] + s); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator+(T const& s, mat<4, 4, T, Q> const& m) - { - return mat<4, 4, T, Q>( - m[0] + s, - m[1] + s, - m[2] + s, - m[3] + s); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) - { - return mat<4, 4, T, Q>( - m1[0] + m2[0], - m1[1] + m2[1], - m1[2] + m2[2], - m1[3] + m2[3]); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m, T const& s) - { - return mat<4, 4, T, Q>( - m[0] - s, - m[1] - s, - m[2] - s, - m[3] - s); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator-(T const& s, mat<4, 4, T, Q> const& m) - { - return mat<4, 4, T, Q>( - s - m[0], - s - m[1], - s - m[2], - s - m[3]); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) - { - return mat<4, 4, T, Q>( - m1[0] - m2[0], - m1[1] - m2[1], - m1[2] - m2[2], - m1[3] - m2[3]); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m, T const & s) - { - return mat<4, 4, T, Q>( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(T const& s, mat<4, 4, T, Q> const& m) - { - return mat<4, 4, T, Q>( - m[0] * s, - m[1] * s, - m[2] * s, - m[3] * s); - } - - template - GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::col_type operator* - ( - mat<4, 4, T, Q> const& m, - typename mat<4, 4, T, Q>::row_type const& v - ) - { -/* - __m128 v0 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(0, 0, 0, 0)); - __m128 v1 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(1, 1, 1, 1)); - __m128 v2 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(2, 2, 2, 2)); - __m128 v3 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 m0 = _mm_mul_ps(m[0].data, v0); - __m128 m1 = _mm_mul_ps(m[1].data, v1); - __m128 a0 = _mm_add_ps(m0, m1); - - __m128 m2 = _mm_mul_ps(m[2].data, v2); - __m128 m3 = _mm_mul_ps(m[3].data, v3); - __m128 a1 = _mm_add_ps(m2, m3); - - __m128 a2 = _mm_add_ps(a0, a1); - - return typename mat<4, 4, T, Q>::col_type(a2); -*/ - - typename mat<4, 4, T, Q>::col_type const Mov0(v[0]); - typename mat<4, 4, T, Q>::col_type const Mov1(v[1]); - typename mat<4, 4, T, Q>::col_type const Mul0 = m[0] * Mov0; - typename mat<4, 4, T, Q>::col_type const Mul1 = m[1] * Mov1; - typename mat<4, 4, T, Q>::col_type const Add0 = Mul0 + Mul1; - typename mat<4, 4, T, Q>::col_type const Mov2(v[2]); - typename mat<4, 4, T, Q>::col_type const Mov3(v[3]); - typename mat<4, 4, T, Q>::col_type const Mul2 = m[2] * Mov2; - typename mat<4, 4, T, Q>::col_type const Mul3 = m[3] * Mov3; - typename mat<4, 4, T, Q>::col_type const Add1 = Mul2 + Mul3; - typename mat<4, 4, T, Q>::col_type const Add2 = Add0 + Add1; - return Add2; - -/* - return typename mat<4, 4, T, Q>::col_type( - m[0][0] * v[0] + m[1][0] * v[1] + m[2][0] * v[2] + m[3][0] * v[3], - m[0][1] * v[0] + m[1][1] * v[1] + m[2][1] * v[2] + m[3][1] * v[3], - m[0][2] * v[0] + m[1][2] * v[1] + m[2][2] * v[2] + m[3][2] * v[3], - m[0][3] * v[0] + m[1][3] * v[1] + m[2][3] * v[2] + m[3][3] * v[3]); -*/ - } - - template - GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::row_type operator* - ( - typename mat<4, 4, T, Q>::col_type const& v, - mat<4, 4, T, Q> const& m - ) - { - return typename mat<4, 4, T, Q>::row_type( - m[0][0] * v[0] + m[0][1] * v[1] + m[0][2] * v[2] + m[0][3] * v[3], - m[1][0] * v[0] + m[1][1] * v[1] + m[1][2] * v[2] + m[1][3] * v[3], - m[2][0] * v[0] + m[2][1] * v[1] + m[2][2] * v[2] + m[2][3] * v[3], - m[3][0] * v[0] + m[3][1] * v[1] + m[3][2] * v[2] + m[3][3] * v[3]); - } - - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2) - { - return mat<2, 4, T, Q>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], - m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3], - m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1] + m1[2][3] * m2[0][2] + m1[3][3] * m2[0][3], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3], - m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3], - m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2] + m1[3][3] * m2[1][3]); - } - - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2) - { - return mat<3, 4, T, Q>( - m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3], - m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3], - m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3], - m1[0][3] * m2[0][0] + m1[1][3] * m2[0][1] + m1[2][3] * m2[0][2] + m1[3][3] * m2[0][3], - m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3], - m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1] + m1[2][1] * m2[1][2] + m1[3][1] * m2[1][3], - m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3], - m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2] + m1[3][3] * m2[1][3], - m1[0][0] * m2[2][0] + m1[1][0] * m2[2][1] + m1[2][0] * m2[2][2] + m1[3][0] * m2[2][3], - m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3], - m1[0][2] * m2[2][0] + m1[1][2] * m2[2][1] + m1[2][2] * m2[2][2] + m1[3][2] * m2[2][3], - m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1] + m1[2][3] * m2[2][2] + m1[3][3] * m2[2][3]); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) - { - typename mat<4, 4, T, Q>::col_type const SrcA0 = m1[0]; - typename mat<4, 4, T, Q>::col_type const SrcA1 = m1[1]; - typename mat<4, 4, T, Q>::col_type const SrcA2 = m1[2]; - typename mat<4, 4, T, Q>::col_type const SrcA3 = m1[3]; - - typename mat<4, 4, T, Q>::col_type const SrcB0 = m2[0]; - typename mat<4, 4, T, Q>::col_type const SrcB1 = m2[1]; - typename mat<4, 4, T, Q>::col_type const SrcB2 = m2[2]; - typename mat<4, 4, T, Q>::col_type const SrcB3 = m2[3]; - - mat<4, 4, T, Q> Result; - Result[0] = SrcA0 * SrcB0[0] + SrcA1 * SrcB0[1] + SrcA2 * SrcB0[2] + SrcA3 * SrcB0[3]; - Result[1] = SrcA0 * SrcB1[0] + SrcA1 * SrcB1[1] + SrcA2 * SrcB1[2] + SrcA3 * SrcB1[3]; - Result[2] = SrcA0 * SrcB2[0] + SrcA1 * SrcB2[1] + SrcA2 * SrcB2[2] + SrcA3 * SrcB2[3]; - Result[3] = SrcA0 * SrcB3[0] + SrcA1 * SrcB3[1] + SrcA2 * SrcB3[2] + SrcA3 * SrcB3[3]; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m, T const& s) - { - return mat<4, 4, T, Q>( - m[0] / s, - m[1] / s, - m[2] / s, - m[3] / s); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator/(T const& s, mat<4, 4, T, Q> const& m) - { - return mat<4, 4, T, Q>( - s / m[0], - s / m[1], - s / m[2], - s / m[3]); - } - - template - GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::col_type operator/(mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v) - { - return inverse(m) * v; - } - - template - GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::row_type operator/(typename mat<4, 4, T, Q>::col_type const& v, mat<4, 4, T, Q> const& m) - { - return v * inverse(m); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) - { - mat<4, 4, T, Q> m1_copy(m1); - return m1_copy /= m2; - } - - // -- Boolean operators -- - - template - GLM_FUNC_QUALIFIER bool operator==(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) - { - return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]); - } - - template - GLM_FUNC_QUALIFIER bool operator!=(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2) - { - return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]); - } -}//namespace glm - -#if GLM_CONFIG_SIMD == GLM_ENABLE -# include "type_mat4x4_simd.inl" -#endif diff --git a/3rdparty/glm/source/glm/detail/type_mat4x4_simd.inl b/3rdparty/glm/source/glm/detail/type_mat4x4_simd.inl deleted file mode 100644 index fb3a16f..0000000 --- a/3rdparty/glm/source/glm/detail/type_mat4x4_simd.inl +++ /dev/null @@ -1,6 +0,0 @@ -/// @ref core - -namespace glm -{ - -}//namespace glm diff --git a/3rdparty/glm/source/glm/detail/type_quat.hpp b/3rdparty/glm/source/glm/detail/type_quat.hpp deleted file mode 100644 index 376c0dc..0000000 --- a/3rdparty/glm/source/glm/detail/type_quat.hpp +++ /dev/null @@ -1,191 +0,0 @@ -/// @ref core -/// @file glm/detail/type_quat.hpp - -#pragma once - -// Dependency: -#include "../detail/type_mat3x3.hpp" -#include "../detail/type_mat4x4.hpp" -#include "../detail/type_vec3.hpp" -#include "../detail/type_vec4.hpp" -#include "../ext/vector_relational.hpp" -#include "../ext/quaternion_relational.hpp" -#include "../gtc/constants.hpp" -#include "../gtc/matrix_transform.hpp" - -namespace glm -{ - template - struct qua - { - // -- Implementation detail -- - - typedef qua type; - typedef T value_type; - - // -- Data -- - -# if GLM_SILENT_WARNINGS == GLM_ENABLE -# if GLM_COMPILER & GLM_COMPILER_GCC -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wpedantic" -# elif GLM_COMPILER & GLM_COMPILER_CLANG -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wgnu-anonymous-struct" -# pragma clang diagnostic ignored "-Wnested-anon-types" -# elif GLM_COMPILER & GLM_COMPILER_VC -# pragma warning(push) -# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union -# endif -# endif - -# if GLM_LANG & GLM_LANG_CXXMS_FLAG - union - { -# ifdef GLM_FORCE_QUAT_DATA_XYZW - struct { T x, y, z, w; }; -# else - struct { T w, x, y, z; }; -# endif - - typename detail::storage<4, T, detail::is_aligned::value>::type data; - }; -# else -# ifdef GLM_FORCE_QUAT_DATA_XYZW - T x, y, z, w; -# else - T w, x, y, z; -# endif -# endif - -# if GLM_SILENT_WARNINGS == GLM_ENABLE -# if GLM_COMPILER & GLM_COMPILER_CLANG -# pragma clang diagnostic pop -# elif GLM_COMPILER & GLM_COMPILER_GCC -# pragma GCC diagnostic pop -# elif GLM_COMPILER & GLM_COMPILER_VC -# pragma warning(pop) -# endif -# endif - - // -- Component accesses -- - - typedef length_t length_type; - - /// Return the count of components of a quaternion - GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;} - - GLM_FUNC_DECL GLM_CONSTEXPR T & operator[](length_type i); - GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const; - - // -- Implicit basic constructors -- - - GLM_FUNC_DECL GLM_CONSTEXPR qua() GLM_DEFAULT_CTOR; - GLM_FUNC_DECL GLM_CONSTEXPR qua(qua const& q) GLM_DEFAULT; - template - GLM_FUNC_DECL GLM_CONSTEXPR qua(qua const& q); - - // -- Explicit basic constructors -- - - GLM_FUNC_DECL GLM_CONSTEXPR qua(T s, vec<3, T, Q> const& v); - -# ifdef GLM_FORCE_QUAT_DATA_XYZW - GLM_FUNC_DECL GLM_CONSTEXPR qua(T x, T y, T z, T w); -# else - GLM_FUNC_DECL GLM_CONSTEXPR qua(T w, T x, T y, T z); -# endif - - // -- Conversion constructors -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT qua(qua const& q); - - /// Explicit conversion operators -# if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS - GLM_FUNC_DECL explicit operator mat<3, 3, T, Q>() const; - GLM_FUNC_DECL explicit operator mat<4, 4, T, Q>() const; -# endif - - /// Create a quaternion from two normalized axis - /// - /// @param u A first normalized axis - /// @param v A second normalized axis - /// @see gtc_quaternion - /// @see http://lolengine.net/blog/2013/09/18/beautiful-maths-quaternion-from-vectors - GLM_FUNC_DECL qua(vec<3, T, Q> const& u, vec<3, T, Q> const& v); - - /// Build a quaternion from euler angles (pitch, yaw, roll), in radians. - GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT qua(vec<3, T, Q> const& eulerAngles); - GLM_FUNC_DECL GLM_EXPLICIT qua(mat<3, 3, T, Q> const& q); - GLM_FUNC_DECL GLM_EXPLICIT qua(mat<4, 4, T, Q> const& q); - - // -- Unary arithmetic operators -- - - GLM_FUNC_DECL GLM_CONSTEXPR qua& operator=(qua const& q) GLM_DEFAULT; - - template - GLM_FUNC_DECL GLM_CONSTEXPR qua& operator=(qua const& q); - template - GLM_FUNC_DECL GLM_CONSTEXPR qua& operator+=(qua const& q); - template - GLM_FUNC_DECL GLM_CONSTEXPR qua& operator-=(qua const& q); - template - GLM_FUNC_DECL GLM_CONSTEXPR qua& operator*=(qua const& q); - template - GLM_FUNC_DECL GLM_CONSTEXPR qua& operator*=(U s); - template - GLM_FUNC_DECL GLM_CONSTEXPR qua& operator/=(U s); - }; - - // -- Unary bit operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR qua operator+(qua const& q); - - template - GLM_FUNC_DECL GLM_CONSTEXPR qua operator-(qua const& q); - - // -- Binary operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR qua operator+(qua const& q, qua const& p); - - template - GLM_FUNC_DECL GLM_CONSTEXPR qua operator-(qua const& q, qua const& p); - - template - GLM_FUNC_DECL GLM_CONSTEXPR qua operator*(qua const& q, qua const& p); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(qua const& q, vec<3, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, qua const& q); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(qua const& q, vec<4, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v, qua const& q); - - template - GLM_FUNC_DECL GLM_CONSTEXPR qua operator*(qua const& q, T const& s); - - template - GLM_FUNC_DECL GLM_CONSTEXPR qua operator*(T const& s, qua const& q); - - template - GLM_FUNC_DECL GLM_CONSTEXPR qua operator/(qua const& q, T const& s); - - // -- Boolean operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(qua const& q1, qua const& q2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(qua const& q1, qua const& q2); -} //namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_quat.inl" -#endif//GLM_EXTERNAL_TEMPLATE diff --git a/3rdparty/glm/source/glm/detail/type_quat.inl b/3rdparty/glm/source/glm/detail/type_quat.inl deleted file mode 100644 index 52deed4..0000000 --- a/3rdparty/glm/source/glm/detail/type_quat.inl +++ /dev/null @@ -1,412 +0,0 @@ -#include "../trigonometric.hpp" -#include "../exponential.hpp" -#include "../ext/quaternion_common.hpp" -#include "../ext/quaternion_geometric.hpp" -#include - -namespace glm{ -namespace detail -{ - template - struct genTypeTrait > - { - static const genTypeEnum GENTYPE = GENTYPE_QUAT; - }; - - template - struct compute_dot, T, Aligned> - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static T call(qua const& a, qua const& b) - { - vec<4, T, Q> tmp(a.w * b.w, a.x * b.x, a.y * b.y, a.z * b.z); - return (tmp.x + tmp.y) + (tmp.z + tmp.w); - } - }; - - template - struct compute_quat_add - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static qua call(qua const& q, qua const& p) - { - return qua(q.w + p.w, q.x + p.x, q.y + p.y, q.z + p.z); - } - }; - - template - struct compute_quat_sub - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static qua call(qua const& q, qua const& p) - { - return qua(q.w - p.w, q.x - p.x, q.y - p.y, q.z - p.z); - } - }; - - template - struct compute_quat_mul_scalar - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static qua call(qua const& q, T s) - { - return qua(q.w * s, q.x * s, q.y * s, q.z * s); - } - }; - - template - struct compute_quat_div_scalar - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static qua call(qua const& q, T s) - { - return qua(q.w / s, q.x / s, q.y / s, q.z / s); - } - }; - - template - struct compute_quat_mul_vec4 - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(qua const& q, vec<4, T, Q> const& v) - { - return vec<4, T, Q>(q * vec<3, T, Q>(v), v.w); - } - }; -}//namespace detail - - // -- Component accesses -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR T & qua::operator[](typename qua::length_type i) - { - assert(i >= 0 && i < this->length()); -# ifdef GLM_FORCE_QUAT_DATA_XYZW - return (&x)[i]; -# else - return (&w)[i]; -# endif - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& qua::operator[](typename qua::length_type i) const - { - assert(i >= 0 && i < this->length()); -# ifdef GLM_FORCE_QUAT_DATA_XYZW - return (&x)[i]; -# else - return (&w)[i]; -# endif - } - - // -- Implicit basic constructors -- - -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua() -# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE -# ifdef GLM_FORCE_QUAT_DATA_XYZW - : x(0), y(0), z(0), w(1) -# else - : w(1), x(0), y(0), z(0) -# endif -# endif - {} -# endif - -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(qua const& q) -# ifdef GLM_FORCE_QUAT_DATA_XYZW - : x(q.x), y(q.y), z(q.z), w(q.w) -# else - : w(q.w), x(q.x), y(q.y), z(q.z) -# endif - {} -# endif - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(qua const& q) -# ifdef GLM_FORCE_QUAT_DATA_XYZW - : x(q.x), y(q.y), z(q.z), w(q.w) -# else - : w(q.w), x(q.x), y(q.y), z(q.z) -# endif - {} - - // -- Explicit basic constructors -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(T s, vec<3, T, Q> const& v) -# ifdef GLM_FORCE_QUAT_DATA_XYZW - : x(v.x), y(v.y), z(v.z), w(s) -# else - : w(s), x(v.x), y(v.y), z(v.z) -# endif - {} - - template -# ifdef GLM_FORCE_QUAT_DATA_XYZW - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(T _x, T _y, T _z, T _w) - : x(_x), y(_y), z(_z), w(_w) -# else - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(T _w, T _x, T _y, T _z) - : w(_w), x(_x), y(_y), z(_z) -# endif - {} - - // -- Conversion constructors -- - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(qua const& q) -# ifdef GLM_FORCE_QUAT_DATA_XYZW - : x(static_cast(q.x)), y(static_cast(q.y)), z(static_cast(q.z)), w(static_cast(q.w)) -# else - : w(static_cast(q.w)), x(static_cast(q.x)), y(static_cast(q.y)), z(static_cast(q.z)) -# endif - {} - - //template - //GLM_FUNC_QUALIFIER qua::qua - //( - // valType const& pitch, - // valType const& yaw, - // valType const& roll - //) - //{ - // vec<3, valType> eulerAngle(pitch * valType(0.5), yaw * valType(0.5), roll * valType(0.5)); - // vec<3, valType> c = glm::cos(eulerAngle * valType(0.5)); - // vec<3, valType> s = glm::sin(eulerAngle * valType(0.5)); - // - // this->w = c.x * c.y * c.z + s.x * s.y * s.z; - // this->x = s.x * c.y * c.z - c.x * s.y * s.z; - // this->y = c.x * s.y * c.z + s.x * c.y * s.z; - // this->z = c.x * c.y * s.z - s.x * s.y * c.z; - //} - - template - GLM_FUNC_QUALIFIER qua::qua(vec<3, T, Q> const& u, vec<3, T, Q> const& v) - { - T norm_u_norm_v = sqrt(dot(u, u) * dot(v, v)); - T real_part = norm_u_norm_v + dot(u, v); - vec<3, T, Q> t; - - if(real_part < static_cast(1.e-6f) * norm_u_norm_v) - { - // If u and v are exactly opposite, rotate 180 degrees - // around an arbitrary orthogonal axis. Axis normalisation - // can happen later, when we normalise the quaternion. - real_part = static_cast(0); - t = abs(u.x) > abs(u.z) ? vec<3, T, Q>(-u.y, u.x, static_cast(0)) : vec<3, T, Q>(static_cast(0), -u.z, u.y); - } - else - { - // Otherwise, build quaternion the standard way. - t = cross(u, v); - } - - *this = normalize(qua(real_part, t.x, t.y, t.z)); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua::qua(vec<3, T, Q> const& eulerAngle) - { - vec<3, T, Q> c = glm::cos(eulerAngle * T(0.5)); - vec<3, T, Q> s = glm::sin(eulerAngle * T(0.5)); - - this->w = c.x * c.y * c.z + s.x * s.y * s.z; - this->x = s.x * c.y * c.z - c.x * s.y * s.z; - this->y = c.x * s.y * c.z + s.x * c.y * s.z; - this->z = c.x * c.y * s.z - s.x * s.y * c.z; - } - - template - GLM_FUNC_QUALIFIER qua::qua(mat<3, 3, T, Q> const& m) - { - *this = quat_cast(m); - } - - template - GLM_FUNC_QUALIFIER qua::qua(mat<4, 4, T, Q> const& m) - { - *this = quat_cast(m); - } - -# if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS - template - GLM_FUNC_QUALIFIER qua::operator mat<3, 3, T, Q>() const - { - return mat3_cast(*this); - } - - template - GLM_FUNC_QUALIFIER qua::operator mat<4, 4, T, Q>() const - { - return mat4_cast(*this); - } -# endif//GLM_HAS_EXPLICIT_CONVERSION_OPERATORS - - // -- Unary arithmetic operators -- - -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator=(qua const& q) - { - this->w = q.w; - this->x = q.x; - this->y = q.y; - this->z = q.z; - return *this; - } -# endif - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator=(qua const& q) - { - this->w = static_cast(q.w); - this->x = static_cast(q.x); - this->y = static_cast(q.y); - this->z = static_cast(q.z); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator+=(qua const& q) - { - return (*this = detail::compute_quat_add::value>::call(*this, qua(q))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator-=(qua const& q) - { - return (*this = detail::compute_quat_sub::value>::call(*this, qua(q))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator*=(qua const& r) - { - qua const p(*this); - qua const q(r); - - this->w = p.w * q.w - p.x * q.x - p.y * q.y - p.z * q.z; - this->x = p.w * q.x + p.x * q.w + p.y * q.z - p.z * q.y; - this->y = p.w * q.y + p.y * q.w + p.z * q.x - p.x * q.z; - this->z = p.w * q.z + p.z * q.w + p.x * q.y - p.y * q.x; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator*=(U s) - { - return (*this = detail::compute_quat_mul_scalar::value>::call(*this, static_cast(s))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua & qua::operator/=(U s) - { - return (*this = detail::compute_quat_div_scalar::value>::call(*this, static_cast(s))); - } - - // -- Unary bit operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator+(qua const& q) - { - return q; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator-(qua const& q) - { - return qua(-q.w, -q.x, -q.y, -q.z); - } - - // -- Binary operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator+(qua const& q, qua const& p) - { - return qua(q) += p; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator-(qua const& q, qua const& p) - { - return qua(q) -= p; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator*(qua const& q, qua const& p) - { - return qua(q) *= p; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(qua const& q, vec<3, T, Q> const& v) - { - vec<3, T, Q> const QuatVector(q.x, q.y, q.z); - vec<3, T, Q> const uv(glm::cross(QuatVector, v)); - vec<3, T, Q> const uuv(glm::cross(QuatVector, uv)); - - return v + ((uv * q.w) + uuv) * static_cast(2); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, qua const& q) - { - return glm::inverse(q) * v; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(qua const& q, vec<4, T, Q> const& v) - { - return detail::compute_quat_mul_vec4::value>::call(q, v); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v, qua const& q) - { - return glm::inverse(q) * v; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator*(qua const& q, T const& s) - { - return qua( - q.w * s, q.x * s, q.y * s, q.z * s); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator*(T const& s, qua const& q) - { - return q * s; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua operator/(qua const& q, T const& s) - { - return qua( - q.w / s, q.x / s, q.y / s, q.z / s); - } - - // -- Boolean operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(qua const& q1, qua const& q2) - { - return q1.x == q2.x && q1.y == q2.y && q1.z == q2.z && q1.w == q2.w; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(qua const& q1, qua const& q2) - { - return q1.x != q2.x || q1.y != q2.y || q1.z != q2.z || q1.w != q2.w; - } -}//namespace glm - -#if GLM_CONFIG_SIMD == GLM_ENABLE -# include "type_quat_simd.inl" -#endif - diff --git a/3rdparty/glm/source/glm/detail/type_quat_simd.inl b/3rdparty/glm/source/glm/detail/type_quat_simd.inl deleted file mode 100644 index 3333e59..0000000 --- a/3rdparty/glm/source/glm/detail/type_quat_simd.inl +++ /dev/null @@ -1,188 +0,0 @@ -/// @ref core - -#if GLM_ARCH & GLM_ARCH_SSE2_BIT - -namespace glm{ -namespace detail -{ -/* - template - struct compute_quat_mul - { - static qua call(qua const& q1, qua const& q2) - { - // SSE2 STATS: 11 shuffle, 8 mul, 8 add - // SSE4 STATS: 3 shuffle, 4 mul, 4 dpps - - __m128 const mul0 = _mm_mul_ps(q1.Data, _mm_shuffle_ps(q2.Data, q2.Data, _MM_SHUFFLE(0, 1, 2, 3))); - __m128 const mul1 = _mm_mul_ps(q1.Data, _mm_shuffle_ps(q2.Data, q2.Data, _MM_SHUFFLE(1, 0, 3, 2))); - __m128 const mul2 = _mm_mul_ps(q1.Data, _mm_shuffle_ps(q2.Data, q2.Data, _MM_SHUFFLE(2, 3, 0, 1))); - __m128 const mul3 = _mm_mul_ps(q1.Data, q2.Data); - -# if GLM_ARCH & GLM_ARCH_SSE41_BIT - __m128 const add0 = _mm_dp_ps(mul0, _mm_set_ps(1.0f, -1.0f, 1.0f, 1.0f), 0xff); - __m128 const add1 = _mm_dp_ps(mul1, _mm_set_ps(1.0f, 1.0f, 1.0f, -1.0f), 0xff); - __m128 const add2 = _mm_dp_ps(mul2, _mm_set_ps(1.0f, 1.0f, -1.0f, 1.0f), 0xff); - __m128 const add3 = _mm_dp_ps(mul3, _mm_set_ps(1.0f, -1.0f, -1.0f, -1.0f), 0xff); -# else - __m128 const mul4 = _mm_mul_ps(mul0, _mm_set_ps(1.0f, -1.0f, 1.0f, 1.0f)); - __m128 const add0 = _mm_add_ps(mul0, _mm_movehl_ps(mul4, mul4)); - __m128 const add4 = _mm_add_ss(add0, _mm_shuffle_ps(add0, add0, 1)); - - __m128 const mul5 = _mm_mul_ps(mul1, _mm_set_ps(1.0f, 1.0f, 1.0f, -1.0f)); - __m128 const add1 = _mm_add_ps(mul1, _mm_movehl_ps(mul5, mul5)); - __m128 const add5 = _mm_add_ss(add1, _mm_shuffle_ps(add1, add1, 1)); - - __m128 const mul6 = _mm_mul_ps(mul2, _mm_set_ps(1.0f, 1.0f, -1.0f, 1.0f)); - __m128 const add2 = _mm_add_ps(mul6, _mm_movehl_ps(mul6, mul6)); - __m128 const add6 = _mm_add_ss(add2, _mm_shuffle_ps(add2, add2, 1)); - - __m128 const mul7 = _mm_mul_ps(mul3, _mm_set_ps(1.0f, -1.0f, -1.0f, -1.0f)); - __m128 const add3 = _mm_add_ps(mul3, _mm_movehl_ps(mul7, mul7)); - __m128 const add7 = _mm_add_ss(add3, _mm_shuffle_ps(add3, add3, 1)); - #endif - - // This SIMD code is a politically correct way of doing this, but in every test I've tried it has been slower than - // the final code below. I'll keep this here for reference - maybe somebody else can do something better... - // - //__m128 xxyy = _mm_shuffle_ps(add4, add5, _MM_SHUFFLE(0, 0, 0, 0)); - //__m128 zzww = _mm_shuffle_ps(add6, add7, _MM_SHUFFLE(0, 0, 0, 0)); - // - //return _mm_shuffle_ps(xxyy, zzww, _MM_SHUFFLE(2, 0, 2, 0)); - - qua Result; - _mm_store_ss(&Result.x, add4); - _mm_store_ss(&Result.y, add5); - _mm_store_ss(&Result.z, add6); - _mm_store_ss(&Result.w, add7); - return Result; - } - }; -*/ - - template - struct compute_quat_add - { - static qua call(qua const& q, qua const& p) - { - qua Result; - Result.data = _mm_add_ps(q.data, p.data); - return Result; - } - }; - -# if GLM_ARCH & GLM_ARCH_AVX_BIT - template - struct compute_quat_add - { - static qua call(qua const& a, qua const& b) - { - qua Result; - Result.data = _mm256_add_pd(a.data, b.data); - return Result; - } - }; -# endif - - template - struct compute_quat_sub - { - static qua call(qua const& q, qua const& p) - { - vec<4, float, Q> Result; - Result.data = _mm_sub_ps(q.data, p.data); - return Result; - } - }; - -# if GLM_ARCH & GLM_ARCH_AVX_BIT - template - struct compute_quat_sub - { - static qua call(qua const& a, qua const& b) - { - qua Result; - Result.data = _mm256_sub_pd(a.data, b.data); - return Result; - } - }; -# endif - - template - struct compute_quat_mul_scalar - { - static qua call(qua const& q, float s) - { - vec<4, float, Q> Result; - Result.data = _mm_mul_ps(q.data, _mm_set_ps1(s)); - return Result; - } - }; - -# if GLM_ARCH & GLM_ARCH_AVX_BIT - template - struct compute_quat_mul_scalar - { - static qua call(qua const& q, double s) - { - qua Result; - Result.data = _mm256_mul_pd(q.data, _mm_set_ps1(s)); - return Result; - } - }; -# endif - - template - struct compute_quat_div_scalar - { - static qua call(qua const& q, float s) - { - vec<4, float, Q> Result; - Result.data = _mm_div_ps(q.data, _mm_set_ps1(s)); - return Result; - } - }; - -# if GLM_ARCH & GLM_ARCH_AVX_BIT - template - struct compute_quat_div_scalar - { - static qua call(qua const& q, double s) - { - qua Result; - Result.data = _mm256_div_pd(q.data, _mm_set_ps1(s)); - return Result; - } - }; -# endif - - template - struct compute_quat_mul_vec4 - { - static vec<4, float, Q> call(qua const& q, vec<4, float, Q> const& v) - { - __m128 const q_wwww = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 3, 3, 3)); - __m128 const q_swp0 = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 0, 2, 1)); - __m128 const q_swp1 = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 1, 0, 2)); - __m128 const v_swp0 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(3, 0, 2, 1)); - __m128 const v_swp1 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(3, 1, 0, 2)); - - __m128 uv = _mm_sub_ps(_mm_mul_ps(q_swp0, v_swp1), _mm_mul_ps(q_swp1, v_swp0)); - __m128 uv_swp0 = _mm_shuffle_ps(uv, uv, _MM_SHUFFLE(3, 0, 2, 1)); - __m128 uv_swp1 = _mm_shuffle_ps(uv, uv, _MM_SHUFFLE(3, 1, 0, 2)); - __m128 uuv = _mm_sub_ps(_mm_mul_ps(q_swp0, uv_swp1), _mm_mul_ps(q_swp1, uv_swp0)); - - __m128 const two = _mm_set1_ps(2.0f); - uv = _mm_mul_ps(uv, _mm_mul_ps(q_wwww, two)); - uuv = _mm_mul_ps(uuv, two); - - vec<4, float, Q> Result; - Result.data = _mm_add_ps(v.Data, _mm_add_ps(uv, uuv)); - return Result; - } - }; -}//namespace detail -}//namespace glm - -#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT - diff --git a/3rdparty/glm/source/glm/detail/type_vec1.hpp b/3rdparty/glm/source/glm/detail/type_vec1.hpp deleted file mode 100644 index ed381cc..0000000 --- a/3rdparty/glm/source/glm/detail/type_vec1.hpp +++ /dev/null @@ -1,308 +0,0 @@ -/// @ref core -/// @file glm/detail/type_vec1.hpp - -#pragma once - -#include "qualifier.hpp" -#if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR -# include "_swizzle.hpp" -#elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION -# include "_swizzle_func.hpp" -#endif -#include - -namespace glm -{ - template - struct vec<1, T, Q> - { - // -- Implementation detail -- - - typedef T value_type; - typedef vec<1, T, Q> type; - typedef vec<1, bool, Q> bool_type; - - // -- Data -- - -# if GLM_SILENT_WARNINGS == GLM_ENABLE -# if GLM_COMPILER & GLM_COMPILER_GCC -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wpedantic" -# elif GLM_COMPILER & GLM_COMPILER_CLANG -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wgnu-anonymous-struct" -# pragma clang diagnostic ignored "-Wnested-anon-types" -# elif GLM_COMPILER & GLM_COMPILER_VC -# pragma warning(push) -# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union -# endif -# endif - -# if GLM_CONFIG_XYZW_ONLY - T x; -# elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE - union - { - T x; - T r; - T s; - - typename detail::storage<1, T, detail::is_aligned::value>::type data; -/* -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - _GLM_SWIZZLE1_2_MEMBERS(T, Q, x) - _GLM_SWIZZLE1_2_MEMBERS(T, Q, r) - _GLM_SWIZZLE1_2_MEMBERS(T, Q, s) - _GLM_SWIZZLE1_3_MEMBERS(T, Q, x) - _GLM_SWIZZLE1_3_MEMBERS(T, Q, r) - _GLM_SWIZZLE1_3_MEMBERS(T, Q, s) - _GLM_SWIZZLE1_4_MEMBERS(T, Q, x) - _GLM_SWIZZLE1_4_MEMBERS(T, Q, r) - _GLM_SWIZZLE1_4_MEMBERS(T, Q, s) -# endif -*/ - }; -# else - union {T x, r, s;}; -/* -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION - GLM_SWIZZLE_GEN_VEC_FROM_VEC1(T, Q) -# endif -*/ -# endif - -# if GLM_SILENT_WARNINGS == GLM_ENABLE -# if GLM_COMPILER & GLM_COMPILER_CLANG -# pragma clang diagnostic pop -# elif GLM_COMPILER & GLM_COMPILER_GCC -# pragma GCC diagnostic pop -# elif GLM_COMPILER & GLM_COMPILER_VC -# pragma warning(pop) -# endif -# endif - - // -- Component accesses -- - - /// Return the count of components of the vector - typedef length_t length_type; - GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 1;} - - GLM_FUNC_DECL GLM_CONSTEXPR T & operator[](length_type i); - GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const; - - // -- Implicit basic constructors -- - - GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR; - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const& v) GLM_DEFAULT; - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, T, P> const& v); - - // -- Explicit basic constructors -- - - GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(T scalar); - - // -- Conversion vector constructors -- - - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<2, U, P> const& v); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, P> const& v); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, P> const& v); - - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<1, U, P> const& v); - - // -- Swizzle constructors -- -/* -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<1, T, Q, E0, -1,-2,-3> const& that) - { - *this = that(); - } -# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR -*/ - // -- Unary arithmetic operators -- - - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator=(vec const& v) GLM_DEFAULT; - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator+=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator+=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator-=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator-=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator*=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator*=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator/=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator/=(vec<1, U, Q> const& v); - - // -- Increment and decrement operators -- - - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator++(); - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator--(); - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator++(int); - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator--(int); - - // -- Unary bit operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator%=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator%=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator&=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator&=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator|=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator|=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator^=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator^=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator<<=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator<<=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator>>=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> & operator>>=(vec<1, U, Q> const& v); - }; - - // -- Unary operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v); - - // -- Binary operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(T scalar, vec<1, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(T scalar, vec<1, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator*(T scalar, vec<1, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator/(vec<1, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator/(T scalar, vec<1, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator/(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator%(vec<1, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator%(T scalar, vec<1, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator%(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator&(T scalar, vec<1, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator|(T scalar, vec<1, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator^(T scalar, vec<1, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator<<(vec<1, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator<<(T scalar, vec<1, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator<<(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator>>(vec<1, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator>>(T scalar, vec<1, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator>>(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, T, Q> operator~(vec<1, T, Q> const& v); - - // -- Boolean operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, bool, Q> operator&&(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<1, bool, Q> operator||(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2); -}//namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_vec1.inl" -#endif//GLM_EXTERNAL_TEMPLATE diff --git a/3rdparty/glm/source/glm/detail/type_vec1.inl b/3rdparty/glm/source/glm/detail/type_vec1.inl deleted file mode 100644 index 52a9b3a..0000000 --- a/3rdparty/glm/source/glm/detail/type_vec1.inl +++ /dev/null @@ -1,553 +0,0 @@ -/// @ref core - -#include "./compute_vector_relational.hpp" - -namespace glm -{ - // -- Implicit basic constructors -- - -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec() -# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE - : x(0) -# endif - {} -# endif - -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<1, T, Q> const& v) - : x(v.x) - {} -# endif - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<1, T, P> const& v) - : x(v.x) - {} - - // -- Explicit basic constructors -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(T scalar) - : x(scalar) - {} - - // -- Conversion vector constructors -- - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<1, U, P> const& v) - : x(static_cast(v.x)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<2, U, P> const& v) - : x(static_cast(v.x)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<3, U, P> const& v) - : x(static_cast(v.x)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q>::vec(vec<4, U, P> const& v) - : x(static_cast(v.x)) - {} - - // -- Component accesses -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR T & vec<1, T, Q>::operator[](typename vec<1, T, Q>::length_type) - { - return x; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& vec<1, T, Q>::operator[](typename vec<1, T, Q>::length_type) const - { - return x; - } - - // -- Unary arithmetic operators -- - -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator=(vec<1, T, Q> const& v) - { - this->x = v.x; - return *this; - } -# endif - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator=(vec<1, U, Q> const& v) - { - this->x = static_cast(v.x); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator+=(U scalar) - { - this->x += static_cast(scalar); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator+=(vec<1, U, Q> const& v) - { - this->x += static_cast(v.x); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator-=(U scalar) - { - this->x -= static_cast(scalar); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator-=(vec<1, U, Q> const& v) - { - this->x -= static_cast(v.x); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator*=(U scalar) - { - this->x *= static_cast(scalar); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator*=(vec<1, U, Q> const& v) - { - this->x *= static_cast(v.x); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator/=(U scalar) - { - this->x /= static_cast(scalar); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator/=(vec<1, U, Q> const& v) - { - this->x /= static_cast(v.x); - return *this; - } - - // -- Increment and decrement operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator++() - { - ++this->x; - return *this; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator--() - { - --this->x; - return *this; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> vec<1, T, Q>::operator++(int) - { - vec<1, T, Q> Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> vec<1, T, Q>::operator--(int) - { - vec<1, T, Q> Result(*this); - --*this; - return Result; - } - - // -- Unary bit operators -- - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator%=(U scalar) - { - this->x %= static_cast(scalar); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator%=(vec<1, U, Q> const& v) - { - this->x %= static_cast(v.x); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator&=(U scalar) - { - this->x &= static_cast(scalar); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator&=(vec<1, U, Q> const& v) - { - this->x &= static_cast(v.x); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator|=(U scalar) - { - this->x |= static_cast(scalar); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator|=(vec<1, U, Q> const& v) - { - this->x |= U(v.x); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator^=(U scalar) - { - this->x ^= static_cast(scalar); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator^=(vec<1, U, Q> const& v) - { - this->x ^= static_cast(v.x); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator<<=(U scalar) - { - this->x <<= static_cast(scalar); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator<<=(vec<1, U, Q> const& v) - { - this->x <<= static_cast(v.x); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator>>=(U scalar) - { - this->x >>= static_cast(scalar); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> & vec<1, T, Q>::operator>>=(vec<1, U, Q> const& v) - { - this->x >>= static_cast(v.x); - return *this; - } - - // -- Unary constant operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v) - { - return v; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v) - { - return vec<1, T, Q>( - -v.x); - } - - // -- Binary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v, T scalar) - { - return vec<1, T, Q>( - v.x + scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator+(T scalar, vec<1, T, Q> const& v) - { - return vec<1, T, Q>( - scalar + v.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator+(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<1, T, Q>( - v1.x + v2.x); - } - - //operator- - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v, T scalar) - { - return vec<1, T, Q>( - v.x - scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator-(T scalar, vec<1, T, Q> const& v) - { - return vec<1, T, Q>( - scalar - v.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator-(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<1, T, Q>( - v1.x - v2.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v, T scalar) - { - return vec<1, T, Q>( - v.x * scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator*(T scalar, vec<1, T, Q> const& v) - { - return vec<1, T, Q>( - scalar * v.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator*(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<1, T, Q>( - v1.x * v2.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator/(vec<1, T, Q> const& v, T scalar) - { - return vec<1, T, Q>( - v.x / scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator/(T scalar, vec<1, T, Q> const& v) - { - return vec<1, T, Q>( - scalar / v.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator/(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<1, T, Q>( - v1.x / v2.x); - } - - // -- Binary bit operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator%(vec<1, T, Q> const& v, T scalar) - { - return vec<1, T, Q>( - v.x % scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator%(T scalar, vec<1, T, Q> const& v) - { - return vec<1, T, Q>( - scalar % v.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator%(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<1, T, Q>( - v1.x % v2.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v, T scalar) - { - return vec<1, T, Q>( - v.x & scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator&(T scalar, vec<1, T, Q> const& v) - { - return vec<1, T, Q>( - scalar & v.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator&(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<1, T, Q>( - v1.x & v2.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v, T scalar) - { - return vec<1, T, Q>( - v.x | scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator|(T scalar, vec<1, T, Q> const& v) - { - return vec<1, T, Q>( - scalar | v.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator|(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<1, T, Q>( - v1.x | v2.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v, T scalar) - { - return vec<1, T, Q>( - v.x ^ scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator^(T scalar, vec<1, T, Q> const& v) - { - return vec<1, T, Q>( - scalar ^ v.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator^(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<1, T, Q>( - v1.x ^ v2.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator<<(vec<1, T, Q> const& v, T scalar) - { - return vec<1, T, Q>( - static_cast(v.x << scalar)); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator<<(T scalar, vec<1, T, Q> const& v) - { - return vec<1, T, Q>( - static_cast(scalar << v.x)); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator<<(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<1, T, Q>( - static_cast(v1.x << v2.x)); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator>>(vec<1, T, Q> const& v, T scalar) - { - return vec<1, T, Q>( - static_cast(v.x >> scalar)); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator>>(T scalar, vec<1, T, Q> const& v) - { - return vec<1, T, Q>( - static_cast(scalar >> v.x)); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator>>(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<1, T, Q>( - static_cast(v1.x >> v2.x)); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, Q> operator~(vec<1, T, Q> const& v) - { - return vec<1, T, Q>( - ~v.x); - } - - // -- Boolean operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return detail::compute_equal::is_iec559>::call(v1.x, v2.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return !(v1 == v2); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, bool, Q> operator&&(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2) - { - return vec<1, bool, Q>(v1.x && v2.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, bool, Q> operator||(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2) - { - return vec<1, bool, Q>(v1.x || v2.x); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/detail/type_vec2.hpp b/3rdparty/glm/source/glm/detail/type_vec2.hpp deleted file mode 100644 index 5aa969d..0000000 --- a/3rdparty/glm/source/glm/detail/type_vec2.hpp +++ /dev/null @@ -1,402 +0,0 @@ -/// @ref core -/// @file glm/detail/type_vec2.hpp - -#pragma once - -#include "qualifier.hpp" -#if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR -# include "_swizzle.hpp" -#elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION -# include "_swizzle_func.hpp" -#endif -#include - -namespace glm -{ - template - struct vec<2, T, Q> - { - // -- Implementation detail -- - - typedef T value_type; - typedef vec<2, T, Q> type; - typedef vec<2, bool, Q> bool_type; - - // -- Data -- - -# if GLM_SILENT_WARNINGS == GLM_ENABLE -# if GLM_COMPILER & GLM_COMPILER_GCC -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wpedantic" -# elif GLM_COMPILER & GLM_COMPILER_CLANG -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wgnu-anonymous-struct" -# pragma clang diagnostic ignored "-Wnested-anon-types" -# elif GLM_COMPILER & GLM_COMPILER_VC -# pragma warning(push) -# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union -# endif -# endif - -# if GLM_CONFIG_XYZW_ONLY - T x, y; -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION - GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(T, Q, x, y) -# endif//GLM_CONFIG_SWIZZLE -# elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE - union - { - struct{ T x, y; }; - struct{ T r, g; }; - struct{ T s, t; }; - - typename detail::storage<2, T, detail::is_aligned::value>::type data; - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - GLM_SWIZZLE2_2_MEMBERS(T, Q, x, y) - GLM_SWIZZLE2_2_MEMBERS(T, Q, r, g) - GLM_SWIZZLE2_2_MEMBERS(T, Q, s, t) - GLM_SWIZZLE2_3_MEMBERS(T, Q, x, y) - GLM_SWIZZLE2_3_MEMBERS(T, Q, r, g) - GLM_SWIZZLE2_3_MEMBERS(T, Q, s, t) - GLM_SWIZZLE2_4_MEMBERS(T, Q, x, y) - GLM_SWIZZLE2_4_MEMBERS(T, Q, r, g) - GLM_SWIZZLE2_4_MEMBERS(T, Q, s, t) -# endif - }; -# else - union {T x, r, s;}; - union {T y, g, t;}; - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION - GLM_SWIZZLE_GEN_VEC_FROM_VEC2(T, Q) -# endif//GLM_CONFIG_SWIZZLE -# endif - -# if GLM_SILENT_WARNINGS == GLM_ENABLE -# if GLM_COMPILER & GLM_COMPILER_CLANG -# pragma clang diagnostic pop -# elif GLM_COMPILER & GLM_COMPILER_GCC -# pragma GCC diagnostic pop -# elif GLM_COMPILER & GLM_COMPILER_VC -# pragma warning(pop) -# endif -# endif - - // -- Component accesses -- - - /// Return the count of components of the vector - typedef length_t length_type; - GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 2;} - - GLM_FUNC_DECL GLM_CONSTEXPR T& operator[](length_type i); - GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const; - - // -- Implicit basic constructors -- - - GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR; - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const& v) GLM_DEFAULT; - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, T, P> const& v); - - // -- Explicit basic constructors -- - - GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR vec(T x, T y); - - // -- Conversion constructors -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(vec<1, U, P> const& v); - - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(A x, B y); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const& x, B y); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(A x, vec<1, B, Q> const& y); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const& x, vec<1, B, Q> const& y); - - // -- Conversion vector constructors -- - - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, P> const& v); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, P> const& v); - - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<2, U, P> const& v); - - // -- Swizzle constructors -- -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<2, T, Q, E0, E1,-1,-2> const& that) - { - *this = that(); - } -# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - - // -- Unary arithmetic operators -- - - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator=(vec const& v) GLM_DEFAULT; - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator=(vec<2, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator+=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator+=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator+=(vec<2, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator-=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator-=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator-=(vec<2, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator*=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator*=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator*=(vec<2, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator/=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator/=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator/=(vec<2, U, Q> const& v); - - // -- Increment and decrement operators -- - - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator++(); - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator--(); - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator++(int); - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator--(int); - - // -- Unary bit operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator%=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator%=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator%=(vec<2, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator&=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator&=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator&=(vec<2, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator|=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator|=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator|=(vec<2, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator^=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator^=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator^=(vec<2, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator<<=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator<<=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator<<=(vec<2, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator>>=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator>>=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> & operator>>=(vec<2, U, Q> const& v); - }; - - // -- Unary operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v); - - // -- Binary operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(T scalar, vec<2, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(T scalar, vec<2, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(T scalar, vec<2, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(T scalar, vec<2, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(T scalar, vec<2, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(T scalar, vec<2, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(T scalar, vec<2, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(T scalar, vec<2, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(T scalar, vec<2, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(T scalar, vec<2, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, T, Q> operator~(vec<2, T, Q> const& v); - - // -- Boolean operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, bool, Q> operator&&(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<2, bool, Q> operator||(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2); -}//namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_vec2.inl" -#endif//GLM_EXTERNAL_TEMPLATE diff --git a/3rdparty/glm/source/glm/detail/type_vec2.inl b/3rdparty/glm/source/glm/detail/type_vec2.inl deleted file mode 100644 index 55ab64d..0000000 --- a/3rdparty/glm/source/glm/detail/type_vec2.inl +++ /dev/null @@ -1,915 +0,0 @@ -/// @ref core - -#include "./compute_vector_relational.hpp" - -namespace glm -{ - // -- Implicit basic constructors -- - -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec() -# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE - : x(0), y(0) -# endif - {} -# endif - -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<2, T, Q> const& v) - : x(v.x), y(v.y) - {} -# endif - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<2, T, P> const& v) - : x(v.x), y(v.y) - {} - - // -- Explicit basic constructors -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(T scalar) - : x(scalar), y(scalar) - {} - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(T _x, T _y) - : x(_x), y(_y) - {} - - // -- Conversion scalar constructors -- - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<1, U, P> const& v) - : x(static_cast(v.x)) - , y(static_cast(v.x)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(A _x, B _y) - : x(static_cast(_x)) - , y(static_cast(_y)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<1, A, Q> const& _x, B _y) - : x(static_cast(_x.x)) - , y(static_cast(_y)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(A _x, vec<1, B, Q> const& _y) - : x(static_cast(_x)) - , y(static_cast(_y.x)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<1, A, Q> const& _x, vec<1, B, Q> const& _y) - : x(static_cast(_x.x)) - , y(static_cast(_y.x)) - {} - - // -- Conversion vector constructors -- - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<2, U, P> const& v) - : x(static_cast(v.x)) - , y(static_cast(v.y)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<3, U, P> const& v) - : x(static_cast(v.x)) - , y(static_cast(v.y)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q>::vec(vec<4, U, P> const& v) - : x(static_cast(v.x)) - , y(static_cast(v.y)) - {} - - // -- Component accesses -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR T & vec<2, T, Q>::operator[](typename vec<2, T, Q>::length_type i) - { - assert(i >= 0 && i < this->length()); - switch(i) - { - default: - case 0: - return x; - case 1: - return y; - } - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& vec<2, T, Q>::operator[](typename vec<2, T, Q>::length_type i) const - { - assert(i >= 0 && i < this->length()); - switch(i) - { - default: - case 0: - return x; - case 1: - return y; - } - } - - // -- Unary arithmetic operators -- - -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator=(vec<2, T, Q> const& v) - { - this->x = v.x; - this->y = v.y; - return *this; - } -# endif - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator=(vec<2, U, Q> const& v) - { - this->x = static_cast(v.x); - this->y = static_cast(v.y); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator+=(U scalar) - { - this->x += static_cast(scalar); - this->y += static_cast(scalar); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator+=(vec<1, U, Q> const& v) - { - this->x += static_cast(v.x); - this->y += static_cast(v.x); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator+=(vec<2, U, Q> const& v) - { - this->x += static_cast(v.x); - this->y += static_cast(v.y); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator-=(U scalar) - { - this->x -= static_cast(scalar); - this->y -= static_cast(scalar); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator-=(vec<1, U, Q> const& v) - { - this->x -= static_cast(v.x); - this->y -= static_cast(v.x); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator-=(vec<2, U, Q> const& v) - { - this->x -= static_cast(v.x); - this->y -= static_cast(v.y); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator*=(U scalar) - { - this->x *= static_cast(scalar); - this->y *= static_cast(scalar); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator*=(vec<1, U, Q> const& v) - { - this->x *= static_cast(v.x); - this->y *= static_cast(v.x); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator*=(vec<2, U, Q> const& v) - { - this->x *= static_cast(v.x); - this->y *= static_cast(v.y); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator/=(U scalar) - { - this->x /= static_cast(scalar); - this->y /= static_cast(scalar); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator/=(vec<1, U, Q> const& v) - { - this->x /= static_cast(v.x); - this->y /= static_cast(v.x); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator/=(vec<2, U, Q> const& v) - { - this->x /= static_cast(v.x); - this->y /= static_cast(v.y); - return *this; - } - - // -- Increment and decrement operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator++() - { - ++this->x; - ++this->y; - return *this; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator--() - { - --this->x; - --this->y; - return *this; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> vec<2, T, Q>::operator++(int) - { - vec<2, T, Q> Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> vec<2, T, Q>::operator--(int) - { - vec<2, T, Q> Result(*this); - --*this; - return Result; - } - - // -- Unary bit operators -- - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator%=(U scalar) - { - this->x %= static_cast(scalar); - this->y %= static_cast(scalar); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator%=(vec<1, U, Q> const& v) - { - this->x %= static_cast(v.x); - this->y %= static_cast(v.x); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator%=(vec<2, U, Q> const& v) - { - this->x %= static_cast(v.x); - this->y %= static_cast(v.y); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator&=(U scalar) - { - this->x &= static_cast(scalar); - this->y &= static_cast(scalar); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator&=(vec<1, U, Q> const& v) - { - this->x &= static_cast(v.x); - this->y &= static_cast(v.x); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator&=(vec<2, U, Q> const& v) - { - this->x &= static_cast(v.x); - this->y &= static_cast(v.y); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator|=(U scalar) - { - this->x |= static_cast(scalar); - this->y |= static_cast(scalar); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator|=(vec<1, U, Q> const& v) - { - this->x |= static_cast(v.x); - this->y |= static_cast(v.x); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator|=(vec<2, U, Q> const& v) - { - this->x |= static_cast(v.x); - this->y |= static_cast(v.y); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator^=(U scalar) - { - this->x ^= static_cast(scalar); - this->y ^= static_cast(scalar); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator^=(vec<1, U, Q> const& v) - { - this->x ^= static_cast(v.x); - this->y ^= static_cast(v.x); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator^=(vec<2, U, Q> const& v) - { - this->x ^= static_cast(v.x); - this->y ^= static_cast(v.y); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator<<=(U scalar) - { - this->x <<= static_cast(scalar); - this->y <<= static_cast(scalar); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator<<=(vec<1, U, Q> const& v) - { - this->x <<= static_cast(v.x); - this->y <<= static_cast(v.x); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator<<=(vec<2, U, Q> const& v) - { - this->x <<= static_cast(v.x); - this->y <<= static_cast(v.y); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator>>=(U scalar) - { - this->x >>= static_cast(scalar); - this->y >>= static_cast(scalar); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator>>=(vec<1, U, Q> const& v) - { - this->x >>= static_cast(v.x); - this->y >>= static_cast(v.x); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> & vec<2, T, Q>::operator>>=(vec<2, U, Q> const& v) - { - this->x >>= static_cast(v.x); - this->y >>= static_cast(v.y); - return *this; - } - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v) - { - return v; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v) - { - return vec<2, T, Q>( - -v.x, - -v.y); - } - - // -- Binary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v, T scalar) - { - return vec<2, T, Q>( - v.x + scalar, - v.y + scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x + v2.x, - v1.y + v2.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(T scalar, vec<2, T, Q> const& v) - { - return vec<2, T, Q>( - scalar + v.x, - scalar + v.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x + v2.x, - v1.x + v2.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x + v2.x, - v1.y + v2.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v, T scalar) - { - return vec<2, T, Q>( - v.x - scalar, - v.y - scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x - v2.x, - v1.y - v2.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(T scalar, vec<2, T, Q> const& v) - { - return vec<2, T, Q>( - scalar - v.x, - scalar - v.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x - v2.x, - v1.x - v2.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x - v2.x, - v1.y - v2.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v, T scalar) - { - return vec<2, T, Q>( - v.x * scalar, - v.y * scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x * v2.x, - v1.y * v2.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(T scalar, vec<2, T, Q> const& v) - { - return vec<2, T, Q>( - scalar * v.x, - scalar * v.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x * v2.x, - v1.x * v2.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x * v2.x, - v1.y * v2.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v, T scalar) - { - return vec<2, T, Q>( - v.x / scalar, - v.y / scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x / v2.x, - v1.y / v2.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator/(T scalar, vec<2, T, Q> const& v) - { - return vec<2, T, Q>( - scalar / v.x, - scalar / v.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator/(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x / v2.x, - v1.x / v2.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x / v2.x, - v1.y / v2.y); - } - - // -- Binary bit operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v, T scalar) - { - return vec<2, T, Q>( - v.x % scalar, - v.y % scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x % v2.x, - v1.y % v2.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator%(T scalar, vec<2, T, Q> const& v) - { - return vec<2, T, Q>( - scalar % v.x, - scalar % v.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator%(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x % v2.x, - v1.x % v2.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x % v2.x, - v1.y % v2.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v, T scalar) - { - return vec<2, T, Q>( - v.x & scalar, - v.y & scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x & v2.x, - v1.y & v2.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(T scalar, vec<2, T, Q> const& v) - { - return vec<2, T, Q>( - scalar & v.x, - scalar & v.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x & v2.x, - v1.x & v2.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x & v2.x, - v1.y & v2.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v, T scalar) - { - return vec<2, T, Q>( - v.x | scalar, - v.y | scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x | v2.x, - v1.y | v2.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(T scalar, vec<2, T, Q> const& v) - { - return vec<2, T, Q>( - scalar | v.x, - scalar | v.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x | v2.x, - v1.x | v2.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x | v2.x, - v1.y | v2.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v, T scalar) - { - return vec<2, T, Q>( - v.x ^ scalar, - v.y ^ scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x ^ v2.x, - v1.y ^ v2.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(T scalar, vec<2, T, Q> const& v) - { - return vec<2, T, Q>( - scalar ^ v.x, - scalar ^ v.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x ^ v2.x, - v1.x ^ v2.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x ^ v2.x, - v1.y ^ v2.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v, T scalar) - { - return vec<2, T, Q>( - v.x << scalar, - v.y << scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x << v2.x, - v1.y << v2.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator<<(T scalar, vec<2, T, Q> const& v) - { - return vec<2, T, Q>( - scalar << v.x, - scalar << v.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x << v2.x, - v1.x << v2.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x << v2.x, - v1.y << v2.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v, T scalar) - { - return vec<2, T, Q>( - v.x >> scalar, - v.y >> scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x >> v2.x, - v1.y >> v2.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator>>(T scalar, vec<2, T, Q> const& v) - { - return vec<2, T, Q>( - scalar >> v.x, - scalar >> v.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x >> v2.x, - v1.x >> v2.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) - { - return vec<2, T, Q>( - v1.x >> v2.x, - v1.y >> v2.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, Q> operator~(vec<2, T, Q> const& v) - { - return vec<2, T, Q>( - ~v.x, - ~v.y); - } - - // -- Boolean operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) - { - return - detail::compute_equal::is_iec559>::call(v1.x, v2.x) && - detail::compute_equal::is_iec559>::call(v1.y, v2.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2) - { - return !(v1 == v2); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, bool, Q> operator&&(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2) - { - return vec<2, bool, Q>(v1.x && v2.x, v1.y && v2.y); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, bool, Q> operator||(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2) - { - return vec<2, bool, Q>(v1.x || v2.x, v1.y || v2.y); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/detail/type_vec3.hpp b/3rdparty/glm/source/glm/detail/type_vec3.hpp deleted file mode 100644 index cfc5000..0000000 --- a/3rdparty/glm/source/glm/detail/type_vec3.hpp +++ /dev/null @@ -1,435 +0,0 @@ -/// @ref core -/// @file glm/detail/type_vec3.hpp - -#pragma once - -#include "qualifier.hpp" -#if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR -# include "_swizzle.hpp" -#elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION -# include "_swizzle_func.hpp" -#endif -#include - -namespace glm -{ - template - struct vec<3, T, Q> - { - // -- Implementation detail -- - - typedef T value_type; - typedef vec<3, T, Q> type; - typedef vec<3, bool, Q> bool_type; - - // -- Data -- - -# if GLM_SILENT_WARNINGS == GLM_ENABLE -# if GLM_COMPILER & GLM_COMPILER_GCC -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wpedantic" -# elif GLM_COMPILER & GLM_COMPILER_CLANG -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wgnu-anonymous-struct" -# pragma clang diagnostic ignored "-Wnested-anon-types" -# elif GLM_COMPILER & GLM_COMPILER_VC -# pragma warning(push) -# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union -# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE -# pragma warning(disable: 4324) // structure was padded due to alignment specifier -# endif -# endif -# endif - -# if GLM_CONFIG_XYZW_ONLY - T x, y, z; -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION - GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(T, Q, x, y, z) -# endif//GLM_CONFIG_SWIZZLE -# elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE - union - { - struct{ T x, y, z; }; - struct{ T r, g, b; }; - struct{ T s, t, p; }; - - typename detail::storage<3, T, detail::is_aligned::value>::type data; - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - GLM_SWIZZLE3_2_MEMBERS(T, Q, x, y, z) - GLM_SWIZZLE3_2_MEMBERS(T, Q, r, g, b) - GLM_SWIZZLE3_2_MEMBERS(T, Q, s, t, p) - GLM_SWIZZLE3_3_MEMBERS(T, Q, x, y, z) - GLM_SWIZZLE3_3_MEMBERS(T, Q, r, g, b) - GLM_SWIZZLE3_3_MEMBERS(T, Q, s, t, p) - GLM_SWIZZLE3_4_MEMBERS(T, Q, x, y, z) - GLM_SWIZZLE3_4_MEMBERS(T, Q, r, g, b) - GLM_SWIZZLE3_4_MEMBERS(T, Q, s, t, p) -# endif - }; -# else - union { T x, r, s; }; - union { T y, g, t; }; - union { T z, b, p; }; - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION - GLM_SWIZZLE_GEN_VEC_FROM_VEC3(T, Q) -# endif//GLM_CONFIG_SWIZZLE -# endif//GLM_LANG - -# if GLM_SILENT_WARNINGS == GLM_ENABLE -# if GLM_COMPILER & GLM_COMPILER_CLANG -# pragma clang diagnostic pop -# elif GLM_COMPILER & GLM_COMPILER_GCC -# pragma GCC diagnostic pop -# elif GLM_COMPILER & GLM_COMPILER_VC -# pragma warning(pop) -# endif -# endif - - // -- Component accesses -- - - /// Return the count of components of the vector - typedef length_t length_type; - GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 3;} - - GLM_FUNC_DECL GLM_CONSTEXPR T & operator[](length_type i); - GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const; - - // -- Implicit basic constructors -- - - GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR; - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const& v) GLM_DEFAULT; - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, T, P> const& v); - - // -- Explicit basic constructors -- - - GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR vec(T a, T b, T c); - - // -- Conversion scalar constructors -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(vec<1, U, P> const& v); - - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(X x, Y y, Z z); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, Z _z); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, Z _z); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, Y _y, vec<1, Z, Q> const& _z); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z); - - // -- Conversion vector constructors -- - - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, B _z); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<2, B, P> const& _yz); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, P> const& v); - - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, P> const& v); - - // -- Swizzle constructors -- -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<3, T, Q, E0, E1, E2, -1> const& that) - { - *this = that(); - } - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, T const& scalar) - { - *this = vec(v(), scalar); - } - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(T const& scalar, detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v) - { - *this = vec(scalar, v()); - } -# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - - // -- Unary arithmetic operators -- - - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q>& operator=(vec<3, T, Q> const& v) GLM_DEFAULT; - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator=(vec<3, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator+=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator+=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator+=(vec<3, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator-=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator-=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator-=(vec<3, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator*=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator*=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator*=(vec<3, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator/=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator/=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator/=(vec<3, U, Q> const& v); - - // -- Increment and decrement operators -- - - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator++(); - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator--(); - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator++(int); - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator--(int); - - // -- Unary bit operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator%=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator%=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator%=(vec<3, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator&=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator&=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator&=(vec<3, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator|=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator|=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator|=(vec<3, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator^=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator^=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator^=(vec<3, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator<<=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator<<=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator<<=(vec<3, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator>>=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator>>=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> & operator>>=(vec<3, U, Q> const& v); - }; - - // -- Unary operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v); - - // -- Binary operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(T scalar, vec<3, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(T scalar, vec<3, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(T scalar, vec<3, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(T scalar, vec<3, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(T scalar, vec<3, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(T scalar, vec<3, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(T scalar, vec<3, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(T scalar, vec<3, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(T scalar, vec<3, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(T scalar, vec<3, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> operator~(vec<3, T, Q> const& v); - - // -- Boolean operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, bool, Q> operator&&(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, bool, Q> operator||(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2); -}//namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_vec3.inl" -#endif//GLM_EXTERNAL_TEMPLATE diff --git a/3rdparty/glm/source/glm/detail/type_vec3.inl b/3rdparty/glm/source/glm/detail/type_vec3.inl deleted file mode 100644 index 8d15db8..0000000 --- a/3rdparty/glm/source/glm/detail/type_vec3.inl +++ /dev/null @@ -1,1070 +0,0 @@ -/// @ref core - -#include "compute_vector_relational.hpp" - -namespace glm -{ - // -- Implicit basic constructors -- - -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec() -# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE - : x(0), y(0), z(0) -# endif - {} -# endif - -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<3, T, Q> const& v) - : x(v.x), y(v.y), z(v.z) - {} -# endif - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<3, T, P> const& v) - : x(v.x), y(v.y), z(v.z) - {} - - // -- Explicit basic constructors -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(T scalar) - : x(scalar), y(scalar), z(scalar) - {} - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(T _x, T _y, T _z) - : x(_x), y(_y), z(_z) - {} - - // -- Conversion scalar constructors -- - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<1, U, P> const& v) - : x(static_cast(v.x)) - , y(static_cast(v.x)) - , z(static_cast(v.x)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(X _x, Y _y, Z _z) - : x(static_cast(_x)) - , y(static_cast(_y)) - , z(static_cast(_z)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<1, X, Q> const& _x, Y _y, Z _z) - : x(static_cast(_x.x)) - , y(static_cast(_y)) - , z(static_cast(_z)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(X _x, vec<1, Y, Q> const& _y, Z _z) - : x(static_cast(_x)) - , y(static_cast(_y.x)) - , z(static_cast(_z)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z) - : x(static_cast(_x.x)) - , y(static_cast(_y.x)) - , z(static_cast(_z)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(X _x, Y _y, vec<1, Z, Q> const& _z) - : x(static_cast(_x)) - , y(static_cast(_y)) - , z(static_cast(_z.x)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z) - : x(static_cast(_x.x)) - , y(static_cast(_y)) - , z(static_cast(_z.x)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z) - : x(static_cast(_x)) - , y(static_cast(_y.x)) - , z(static_cast(_z.x)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z) - : x(static_cast(_x.x)) - , y(static_cast(_y.x)) - , z(static_cast(_z.x)) - {} - - // -- Conversion vector constructors -- - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<2, A, P> const& _xy, B _z) - : x(static_cast(_xy.x)) - , y(static_cast(_xy.y)) - , z(static_cast(_z)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z) - : x(static_cast(_xy.x)) - , y(static_cast(_xy.y)) - , z(static_cast(_z.x)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(A _x, vec<2, B, P> const& _yz) - : x(static_cast(_x)) - , y(static_cast(_yz.x)) - , z(static_cast(_yz.y)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz) - : x(static_cast(_x.x)) - , y(static_cast(_yz.x)) - , z(static_cast(_yz.y)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<3, U, P> const& v) - : x(static_cast(v.x)) - , y(static_cast(v.y)) - , z(static_cast(v.z)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>::vec(vec<4, U, P> const& v) - : x(static_cast(v.x)) - , y(static_cast(v.y)) - , z(static_cast(v.z)) - {} - - // -- Component accesses -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR T & vec<3, T, Q>::operator[](typename vec<3, T, Q>::length_type i) - { - assert(i >= 0 && i < this->length()); - switch(i) - { - default: - case 0: - return x; - case 1: - return y; - case 2: - return z; - } - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& vec<3, T, Q>::operator[](typename vec<3, T, Q>::length_type i) const - { - assert(i >= 0 && i < this->length()); - switch(i) - { - default: - case 0: - return x; - case 1: - return y; - case 2: - return z; - } - } - - // -- Unary arithmetic operators -- - -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>& vec<3, T, Q>::operator=(vec<3, T, Q> const& v) - { - this->x = v.x; - this->y = v.y; - this->z = v.z; - return *this; - } -# endif - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q>& vec<3, T, Q>::operator=(vec<3, U, Q> const& v) - { - this->x = static_cast(v.x); - this->y = static_cast(v.y); - this->z = static_cast(v.z); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator+=(U scalar) - { - this->x += static_cast(scalar); - this->y += static_cast(scalar); - this->z += static_cast(scalar); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator+=(vec<1, U, Q> const& v) - { - this->x += static_cast(v.x); - this->y += static_cast(v.x); - this->z += static_cast(v.x); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator+=(vec<3, U, Q> const& v) - { - this->x += static_cast(v.x); - this->y += static_cast(v.y); - this->z += static_cast(v.z); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator-=(U scalar) - { - this->x -= static_cast(scalar); - this->y -= static_cast(scalar); - this->z -= static_cast(scalar); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator-=(vec<1, U, Q> const& v) - { - this->x -= static_cast(v.x); - this->y -= static_cast(v.x); - this->z -= static_cast(v.x); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator-=(vec<3, U, Q> const& v) - { - this->x -= static_cast(v.x); - this->y -= static_cast(v.y); - this->z -= static_cast(v.z); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator*=(U scalar) - { - this->x *= static_cast(scalar); - this->y *= static_cast(scalar); - this->z *= static_cast(scalar); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator*=(vec<1, U, Q> const& v) - { - this->x *= static_cast(v.x); - this->y *= static_cast(v.x); - this->z *= static_cast(v.x); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator*=(vec<3, U, Q> const& v) - { - this->x *= static_cast(v.x); - this->y *= static_cast(v.y); - this->z *= static_cast(v.z); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator/=(U v) - { - this->x /= static_cast(v); - this->y /= static_cast(v); - this->z /= static_cast(v); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator/=(vec<1, U, Q> const& v) - { - this->x /= static_cast(v.x); - this->y /= static_cast(v.x); - this->z /= static_cast(v.x); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator/=(vec<3, U, Q> const& v) - { - this->x /= static_cast(v.x); - this->y /= static_cast(v.y); - this->z /= static_cast(v.z); - return *this; - } - - // -- Increment and decrement operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator++() - { - ++this->x; - ++this->y; - ++this->z; - return *this; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator--() - { - --this->x; - --this->y; - --this->z; - return *this; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> vec<3, T, Q>::operator++(int) - { - vec<3, T, Q> Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> vec<3, T, Q>::operator--(int) - { - vec<3, T, Q> Result(*this); - --*this; - return Result; - } - - // -- Unary bit operators -- - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator%=(U scalar) - { - this->x %= scalar; - this->y %= scalar; - this->z %= scalar; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator%=(vec<1, U, Q> const& v) - { - this->x %= v.x; - this->y %= v.x; - this->z %= v.x; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator%=(vec<3, U, Q> const& v) - { - this->x %= v.x; - this->y %= v.y; - this->z %= v.z; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator&=(U scalar) - { - this->x &= scalar; - this->y &= scalar; - this->z &= scalar; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator&=(vec<1, U, Q> const& v) - { - this->x &= v.x; - this->y &= v.x; - this->z &= v.x; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator&=(vec<3, U, Q> const& v) - { - this->x &= v.x; - this->y &= v.y; - this->z &= v.z; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator|=(U scalar) - { - this->x |= scalar; - this->y |= scalar; - this->z |= scalar; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator|=(vec<1, U, Q> const& v) - { - this->x |= v.x; - this->y |= v.x; - this->z |= v.x; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator|=(vec<3, U, Q> const& v) - { - this->x |= v.x; - this->y |= v.y; - this->z |= v.z; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator^=(U scalar) - { - this->x ^= scalar; - this->y ^= scalar; - this->z ^= scalar; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator^=(vec<1, U, Q> const& v) - { - this->x ^= v.x; - this->y ^= v.x; - this->z ^= v.x; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator^=(vec<3, U, Q> const& v) - { - this->x ^= v.x; - this->y ^= v.y; - this->z ^= v.z; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator<<=(U scalar) - { - this->x <<= scalar; - this->y <<= scalar; - this->z <<= scalar; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator<<=(vec<1, U, Q> const& v) - { - this->x <<= static_cast(v.x); - this->y <<= static_cast(v.x); - this->z <<= static_cast(v.x); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator<<=(vec<3, U, Q> const& v) - { - this->x <<= static_cast(v.x); - this->y <<= static_cast(v.y); - this->z <<= static_cast(v.z); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator>>=(U scalar) - { - this->x >>= static_cast(scalar); - this->y >>= static_cast(scalar); - this->z >>= static_cast(scalar); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator>>=(vec<1, U, Q> const& v) - { - this->x >>= static_cast(v.x); - this->y >>= static_cast(v.x); - this->z >>= static_cast(v.x); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> & vec<3, T, Q>::operator>>=(vec<3, U, Q> const& v) - { - this->x >>= static_cast(v.x); - this->y >>= static_cast(v.y); - this->z >>= static_cast(v.z); - return *this; - } - - // -- Unary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v) - { - return v; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v) - { - return vec<3, T, Q>( - -v.x, - -v.y, - -v.z); - } - - // -- Binary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v, T scalar) - { - return vec<3, T, Q>( - v.x + scalar, - v.y + scalar, - v.z + scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) - { - return vec<3, T, Q>( - v.x + scalar.x, - v.y + scalar.x, - v.z + scalar.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(T scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>( - scalar + v.x, - scalar + v.y, - scalar + v.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>( - scalar.x + v.x, - scalar.x + v.y, - scalar.x + v.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator+(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) - { - return vec<3, T, Q>( - v1.x + v2.x, - v1.y + v2.y, - v1.z + v2.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v, T scalar) - { - return vec<3, T, Q>( - v.x - scalar, - v.y - scalar, - v.z - scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) - { - return vec<3, T, Q>( - v.x - scalar.x, - v.y - scalar.x, - v.z - scalar.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(T scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>( - scalar - v.x, - scalar - v.y, - scalar - v.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>( - scalar.x - v.x, - scalar.x - v.y, - scalar.x - v.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) - { - return vec<3, T, Q>( - v1.x - v2.x, - v1.y - v2.y, - v1.z - v2.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, T scalar) - { - return vec<3, T, Q>( - v.x * scalar, - v.y * scalar, - v.z * scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) - { - return vec<3, T, Q>( - v.x * scalar.x, - v.y * scalar.x, - v.z * scalar.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(T scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>( - scalar * v.x, - scalar * v.y, - scalar * v.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>( - scalar.x * v.x, - scalar.x * v.y, - scalar.x * v.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) - { - return vec<3, T, Q>( - v1.x * v2.x, - v1.y * v2.y, - v1.z * v2.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v, T scalar) - { - return vec<3, T, Q>( - v.x / scalar, - v.y / scalar, - v.z / scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) - { - return vec<3, T, Q>( - v.x / scalar.x, - v.y / scalar.x, - v.z / scalar.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(T scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>( - scalar / v.x, - scalar / v.y, - scalar / v.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>( - scalar.x / v.x, - scalar.x / v.y, - scalar.x / v.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) - { - return vec<3, T, Q>( - v1.x / v2.x, - v1.y / v2.y, - v1.z / v2.z); - } - - // -- Binary bit operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v, T scalar) - { - return vec<3, T, Q>( - v.x % scalar, - v.y % scalar, - v.z % scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) - { - return vec<3, T, Q>( - v.x % scalar.x, - v.y % scalar.x, - v.z % scalar.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(T scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>( - scalar % v.x, - scalar % v.y, - scalar % v.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>( - scalar.x % v.x, - scalar.x % v.y, - scalar.x % v.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) - { - return vec<3, T, Q>( - v1.x % v2.x, - v1.y % v2.y, - v1.z % v2.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v, T scalar) - { - return vec<3, T, Q>( - v.x & scalar, - v.y & scalar, - v.z & scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) - { - return vec<3, T, Q>( - v.x & scalar.x, - v.y & scalar.x, - v.z & scalar.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(T scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>( - scalar & v.x, - scalar & v.y, - scalar & v.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>( - scalar.x & v.x, - scalar.x & v.y, - scalar.x & v.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) - { - return vec<3, T, Q>( - v1.x & v2.x, - v1.y & v2.y, - v1.z & v2.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v, T scalar) - { - return vec<3, T, Q>( - v.x | scalar, - v.y | scalar, - v.z | scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) - { - return vec<3, T, Q>( - v.x | scalar.x, - v.y | scalar.x, - v.z | scalar.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(T scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>( - scalar | v.x, - scalar | v.y, - scalar | v.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>( - scalar.x | v.x, - scalar.x | v.y, - scalar.x | v.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) - { - return vec<3, T, Q>( - v1.x | v2.x, - v1.y | v2.y, - v1.z | v2.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v, T scalar) - { - return vec<3, T, Q>( - v.x ^ scalar, - v.y ^ scalar, - v.z ^ scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) - { - return vec<3, T, Q>( - v.x ^ scalar.x, - v.y ^ scalar.x, - v.z ^ scalar.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(T scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>( - scalar ^ v.x, - scalar ^ v.y, - scalar ^ v.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>( - scalar.x ^ v.x, - scalar.x ^ v.y, - scalar.x ^ v.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) - { - return vec<3, T, Q>( - v1.x ^ v2.x, - v1.y ^ v2.y, - v1.z ^ v2.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v, T scalar) - { - return vec<3, T, Q>( - v.x << scalar, - v.y << scalar, - v.z << scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) - { - return vec<3, T, Q>( - v.x << scalar.x, - v.y << scalar.x, - v.z << scalar.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(T scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>( - scalar << v.x, - scalar << v.y, - scalar << v.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>( - scalar.x << v.x, - scalar.x << v.y, - scalar.x << v.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) - { - return vec<3, T, Q>( - v1.x << v2.x, - v1.y << v2.y, - v1.z << v2.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v, T scalar) - { - return vec<3, T, Q>( - v.x >> scalar, - v.y >> scalar, - v.z >> scalar); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar) - { - return vec<3, T, Q>( - v.x >> scalar.x, - v.y >> scalar.x, - v.z >> scalar.x); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(T scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>( - scalar >> v.x, - scalar >> v.y, - scalar >> v.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<1, T, Q> const& scalar, vec<3, T, Q> const& v) - { - return vec<3, T, Q>( - scalar.x >> v.x, - scalar.x >> v.y, - scalar.x >> v.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) - { - return vec<3, T, Q>( - v1.x >> v2.x, - v1.y >> v2.y, - v1.z >> v2.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> operator~(vec<3, T, Q> const& v) - { - return vec<3, T, Q>( - ~v.x, - ~v.y, - ~v.z); - } - - // -- Boolean operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) - { - return - detail::compute_equal::is_iec559>::call(v1.x, v2.x) && - detail::compute_equal::is_iec559>::call(v1.y, v2.y) && - detail::compute_equal::is_iec559>::call(v1.z, v2.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2) - { - return !(v1 == v2); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, bool, Q> operator&&(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2) - { - return vec<3, bool, Q>(v1.x && v2.x, v1.y && v2.y, v1.z && v2.z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, bool, Q> operator||(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2) - { - return vec<3, bool, Q>(v1.x || v2.x, v1.y || v2.y, v1.z || v2.z); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/detail/type_vec4.hpp b/3rdparty/glm/source/glm/detail/type_vec4.hpp deleted file mode 100644 index fbe8c0e..0000000 --- a/3rdparty/glm/source/glm/detail/type_vec4.hpp +++ /dev/null @@ -1,508 +0,0 @@ -/// @ref core -/// @file glm/detail/type_vec4.hpp - -#pragma once - -#include "qualifier.hpp" -#if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR -# include "_swizzle.hpp" -#elif GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION -# include "_swizzle_func.hpp" -#endif -#include - -namespace glm -{ - template - struct vec<4, T, Q> - { - // -- Implementation detail -- - - typedef T value_type; - typedef vec<4, T, Q> type; - typedef vec<4, bool, Q> bool_type; - - // -- Data -- - -# if GLM_SILENT_WARNINGS == GLM_ENABLE -# if GLM_COMPILER & GLM_COMPILER_GCC -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wpedantic" -# elif GLM_COMPILER & GLM_COMPILER_CLANG -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wgnu-anonymous-struct" -# pragma clang diagnostic ignored "-Wnested-anon-types" -# elif GLM_COMPILER & GLM_COMPILER_VC -# pragma warning(push) -# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union -# endif -# endif - -# if GLM_CONFIG_XYZW_ONLY - T x, y, z, w; -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION - GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(T, Q, x, y, z, w) -# endif//GLM_CONFIG_SWIZZLE -# elif GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE - union - { - struct { T x, y, z, w; }; - struct { T r, g, b, a; }; - struct { T s, t, p, q; }; - - typename detail::storage<4, T, detail::is_aligned::value>::type data; - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - GLM_SWIZZLE4_2_MEMBERS(T, Q, x, y, z, w) - GLM_SWIZZLE4_2_MEMBERS(T, Q, r, g, b, a) - GLM_SWIZZLE4_2_MEMBERS(T, Q, s, t, p, q) - GLM_SWIZZLE4_3_MEMBERS(T, Q, x, y, z, w) - GLM_SWIZZLE4_3_MEMBERS(T, Q, r, g, b, a) - GLM_SWIZZLE4_3_MEMBERS(T, Q, s, t, p, q) - GLM_SWIZZLE4_4_MEMBERS(T, Q, x, y, z, w) - GLM_SWIZZLE4_4_MEMBERS(T, Q, r, g, b, a) - GLM_SWIZZLE4_4_MEMBERS(T, Q, s, t, p, q) -# endif - }; -# else - union { T x, r, s; }; - union { T y, g, t; }; - union { T z, b, p; }; - union { T w, a, q; }; - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION - GLM_SWIZZLE_GEN_VEC_FROM_VEC4(T, Q) -# endif -# endif - -# if GLM_SILENT_WARNINGS == GLM_ENABLE -# if GLM_COMPILER & GLM_COMPILER_CLANG -# pragma clang diagnostic pop -# elif GLM_COMPILER & GLM_COMPILER_GCC -# pragma GCC diagnostic pop -# elif GLM_COMPILER & GLM_COMPILER_VC -# pragma warning(pop) -# endif -# endif - - // -- Component accesses -- - - typedef length_t length_type; - - /// Return the count of components of the vector - GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;} - - GLM_FUNC_DECL GLM_CONSTEXPR T & operator[](length_type i); - GLM_FUNC_DECL GLM_CONSTEXPR T const& operator[](length_type i) const; - - // -- Implicit basic constructors -- - - GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR; - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<4, T, Q> const& v) GLM_DEFAULT; - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<4, T, P> const& v); - - // -- Explicit basic constructors -- - - GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(T scalar); - GLM_FUNC_DECL GLM_CONSTEXPR vec(T x, T y, T z, T w); - - // -- Conversion scalar constructors -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(vec<1, U, P> const& v); - - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, Y _y, Z _z, W _w); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, Z _z, W _w); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, Z _z, W _w); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z, W _w); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, Y _y, vec<1, Z, Q> const& _z, W _w); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z, W _w); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, W _w); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, W _w); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, Z _z, vec<1, W, Q> const& _w); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, Z _z, vec<1, W, Q> const& _w); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z, vec<1, W, Q> const& _w); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, Y _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _Y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w); - - // -- Conversion vector constructors -- - - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, B _z, C _w); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z, C _w); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, B _z, vec<1, C, P> const& _w); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z, vec<1, C, P> const& _w); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<2, B, P> const& _yz, C _w); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz, C _w); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<2, B, P> const& _yz, vec<1, C, P> const& _w); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz, vec<1, C, P> const& _w); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, B _y, vec<2, C, P> const& _zw); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& _x, B _y, vec<2, C, P> const& _zw); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<1, B, P> const& _y, vec<2, C, P> const& _zw); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& _x, vec<1, B, P> const& _y, vec<2, C, P> const& _zw); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, A, P> const& _xyz, B _w); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, A, P> const& _xyz, vec<1, B, P> const& _w); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(A _x, vec<3, B, P> const& _yzw); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const& _x, vec<3, B, P> const& _yzw); - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, P> const& _xy, vec<2, B, P> const& _zw); - - /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) - template - GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, P> const& v); - - // -- Swizzle constructors -- -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<4, T, Q, E0, E1, E2, E3> const& that) - { - *this = that(); - } - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, detail::_swizzle<2, T, Q, F0, F1, -1, -2> const& u) - { - *this = vec<4, T, Q>(v(), u()); - } - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(T const& x, T const& y, detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v) - { - *this = vec<4, T, Q>(x, y, v()); - } - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(T const& x, detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, T const& w) - { - *this = vec<4, T, Q>(x, v(), w); - } - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<2, T, Q, E0, E1, -1, -2> const& v, T const& z, T const& w) - { - *this = vec<4, T, Q>(v(), z, w); - } - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(detail::_swizzle<3, T, Q, E0, E1, E2, -1> const& v, T const& w) - { - *this = vec<4, T, Q>(v(), w); - } - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec(T const& x, detail::_swizzle<3, T, Q, E0, E1, E2, -1> const& v) - { - *this = vec<4, T, Q>(x, v()); - } -# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - - // -- Unary arithmetic operators -- - - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator=(vec<4, T, Q> const& v) GLM_DEFAULT; - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator=(vec<4, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator+=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator+=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator+=(vec<4, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator-=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator-=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator-=(vec<4, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator*=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator*=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator*=(vec<4, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator/=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator/=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q>& operator/=(vec<4, U, Q> const& v); - - // -- Increment and decrement operators -- - - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator++(); - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator--(); - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator++(int); - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator--(int); - - // -- Unary bit operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator%=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator%=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator%=(vec<4, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator&=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator&=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator&=(vec<4, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator|=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator|=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator|=(vec<4, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator^=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator^=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator^=(vec<4, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator<<=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator<<=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator<<=(vec<4, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator>>=(U scalar); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator>>=(vec<1, U, Q> const& v); - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> & operator>>=(vec<4, U, Q> const& v); - }; - - // -- Unary operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v); - - // -- Binary operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v, T const & scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(T scalar, vec<4, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v, T const & scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(T scalar, vec<4, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v, T const & scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(T scalar, vec<4, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v, T const & scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(T scalar, vec<4, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(T scalar, vec<4, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(T scalar, vec<4, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(T scalar, vec<4, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(T scalar, vec<4, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(T scalar, vec<4, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v, T scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(T scalar, vec<4, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, T, Q> operator~(vec<4, T, Q> const& v); - - // -- Boolean operators -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator==(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, bool, Q> operator&&(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2); - - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<4, bool, Q> operator||(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2); -}//namespace glm - -#ifndef GLM_EXTERNAL_TEMPLATE -#include "type_vec4.inl" -#endif//GLM_EXTERNAL_TEMPLATE diff --git a/3rdparty/glm/source/glm/detail/type_vec4.inl b/3rdparty/glm/source/glm/detail/type_vec4.inl deleted file mode 100644 index f520c09..0000000 --- a/3rdparty/glm/source/glm/detail/type_vec4.inl +++ /dev/null @@ -1,1142 +0,0 @@ -/// @ref core - -#include "compute_vector_relational.hpp" - -namespace glm{ -namespace detail -{ - template - struct compute_vec4_add - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - return vec<4, T, Q>(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); - } - }; - - template - struct compute_vec4_sub - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - return vec<4, T, Q>(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w); - } - }; - - template - struct compute_vec4_mul - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - return vec<4, T, Q>(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w); - } - }; - - template - struct compute_vec4_div - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - return vec<4, T, Q>(a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w); - } - }; - - template - struct compute_vec4_mod - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - return vec<4, T, Q>(a.x % b.x, a.y % b.y, a.z % b.z, a.w % b.w); - } - }; - - template - struct compute_vec4_and - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - return vec<4, T, Q>(a.x & b.x, a.y & b.y, a.z & b.z, a.w & b.w); - } - }; - - template - struct compute_vec4_or - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - return vec<4, T, Q>(a.x | b.x, a.y | b.y, a.z | b.z, a.w | b.w); - } - }; - - template - struct compute_vec4_xor - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - return vec<4, T, Q>(a.x ^ b.x, a.y ^ b.y, a.z ^ b.z, a.w ^ b.w); - } - }; - - template - struct compute_vec4_shift_left - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - return vec<4, T, Q>(a.x << b.x, a.y << b.y, a.z << b.z, a.w << b.w); - } - }; - - template - struct compute_vec4_shift_right - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - return vec<4, T, Q>(a.x >> b.x, a.y >> b.y, a.z >> b.z, a.w >> b.w); - } - }; - - template - struct compute_vec4_equal - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return - detail::compute_equal::is_iec559>::call(v1.x, v2.x) && - detail::compute_equal::is_iec559>::call(v1.y, v2.y) && - detail::compute_equal::is_iec559>::call(v1.z, v2.z) && - detail::compute_equal::is_iec559>::call(v1.w, v2.w); - } - }; - - template - struct compute_vec4_nequal - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return !compute_vec4_equal::value, sizeof(T) * 8, detail::is_aligned::value>::call(v1, v2); - } - }; - - template - struct compute_vec4_bitwise_not - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& v) - { - return vec<4, T, Q>(~v.x, ~v.y, ~v.z, ~v.w); - } - }; -}//namespace detail - - // -- Implicit basic constructors -- - -# if GLM_CONFIG_DEFAULTED_DEFAULT_CTOR == GLM_DISABLE - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec() -# if GLM_CONFIG_CTOR_INIT != GLM_CTOR_INIT_DISABLE - : x(0), y(0), z(0), w(0) -# endif - {} -# endif - -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<4, T, Q> const& v) - : x(v.x), y(v.y), z(v.z), w(v.w) - {} -# endif - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<4, T, P> const& v) - : x(v.x), y(v.y), z(v.z), w(v.w) - {} - - // -- Explicit basic constructors -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(T scalar) - : x(scalar), y(scalar), z(scalar), w(scalar) - {} - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(T _x, T _y, T _z, T _w) - : x(_x), y(_y), z(_z), w(_w) - {} - - // -- Conversion scalar constructors -- - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, U, P> const& v) - : x(static_cast(v.x)) - , y(static_cast(v.x)) - , z(static_cast(v.x)) - , w(static_cast(v.x)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, Y _y, Z _z, W _w) - : x(static_cast(_x)) - , y(static_cast(_y)) - , z(static_cast(_z)) - , w(static_cast(_w)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, Y _y, Z _z, W _w) - : x(static_cast(_x.x)) - , y(static_cast(_y)) - , z(static_cast(_z)) - , w(static_cast(_w)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, vec<1, Y, Q> const& _y, Z _z, W _w) - : x(static_cast(_x)) - , y(static_cast(_y.x)) - , z(static_cast(_z)) - , w(static_cast(_w)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z, W _w) - : x(static_cast(_x.x)) - , y(static_cast(_y.x)) - , z(static_cast(_z)) - , w(static_cast(_w)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, Y _y, vec<1, Z, Q> const& _z, W _w) - : x(static_cast(_x)) - , y(static_cast(_y)) - , z(static_cast(_z.x)) - , w(static_cast(_w)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z, W _w) - : x(static_cast(_x.x)) - , y(static_cast(_y)) - , z(static_cast(_z.x)) - , w(static_cast(_w)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, W _w) - : x(static_cast(_x)) - , y(static_cast(_y.x)) - , z(static_cast(_z.x)) - , w(static_cast(_w)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, W _w) - : x(static_cast(_x.x)) - , y(static_cast(_y.x)) - , z(static_cast(_z.x)) - , w(static_cast(_w)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, Y _y, Z _z, vec<1, W, Q> const& _w) - : x(static_cast(_x.x)) - , y(static_cast(_y)) - , z(static_cast(_z)) - , w(static_cast(_w.x)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, vec<1, Y, Q> const& _y, Z _z, vec<1, W, Q> const& _w) - : x(static_cast(_x)) - , y(static_cast(_y.x)) - , z(static_cast(_z)) - , w(static_cast(_w.x)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, Z _z, vec<1, W, Q> const& _w) - : x(static_cast(_x.x)) - , y(static_cast(_y.x)) - , z(static_cast(_z)) - , w(static_cast(_w.x)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, Y _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w) - : x(static_cast(_x)) - , y(static_cast(_y)) - , z(static_cast(_z.x)) - , w(static_cast(_w.x)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, Y _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w) - : x(static_cast(_x.x)) - , y(static_cast(_y)) - , z(static_cast(_z.x)) - , w(static_cast(_w.x)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(X _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w) - : x(static_cast(_x)) - , y(static_cast(_y.x)) - , z(static_cast(_z.x)) - , w(static_cast(_w.x)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w) - : x(static_cast(_x.x)) - , y(static_cast(_y.x)) - , z(static_cast(_z.x)) - , w(static_cast(_w.x)) - {} - - // -- Conversion vector constructors -- - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<2, A, P> const& _xy, B _z, C _w) - : x(static_cast(_xy.x)) - , y(static_cast(_xy.y)) - , z(static_cast(_z)) - , w(static_cast(_w)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z, C _w) - : x(static_cast(_xy.x)) - , y(static_cast(_xy.y)) - , z(static_cast(_z.x)) - , w(static_cast(_w)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<2, A, P> const& _xy, B _z, vec<1, C, P> const& _w) - : x(static_cast(_xy.x)) - , y(static_cast(_xy.y)) - , z(static_cast(_z)) - , w(static_cast(_w.x)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<2, A, P> const& _xy, vec<1, B, P> const& _z, vec<1, C, P> const& _w) - : x(static_cast(_xy.x)) - , y(static_cast(_xy.y)) - , z(static_cast(_z.x)) - , w(static_cast(_w.x)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(A _x, vec<2, B, P> const& _yz, C _w) - : x(static_cast(_x)) - , y(static_cast(_yz.x)) - , z(static_cast(_yz.y)) - , w(static_cast(_w)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz, C _w) - : x(static_cast(_x.x)) - , y(static_cast(_yz.x)) - , z(static_cast(_yz.y)) - , w(static_cast(_w)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(A _x, vec<2, B, P> const& _yz, vec<1, C, P> const& _w) - : x(static_cast(_x)) - , y(static_cast(_yz.x)) - , z(static_cast(_yz.y)) - , w(static_cast(_w.x)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, A, P> const& _x, vec<2, B, P> const& _yz, vec<1, C, P> const& _w) - : x(static_cast(_x.x)) - , y(static_cast(_yz.x)) - , z(static_cast(_yz.y)) - , w(static_cast(_w.x)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(A _x, B _y, vec<2, C, P> const& _zw) - : x(static_cast(_x)) - , y(static_cast(_y)) - , z(static_cast(_zw.x)) - , w(static_cast(_zw.y)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, A, P> const& _x, B _y, vec<2, C, P> const& _zw) - : x(static_cast(_x.x)) - , y(static_cast(_y)) - , z(static_cast(_zw.x)) - , w(static_cast(_zw.y)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(A _x, vec<1, B, P> const& _y, vec<2, C, P> const& _zw) - : x(static_cast(_x)) - , y(static_cast(_y.x)) - , z(static_cast(_zw.x)) - , w(static_cast(_zw.y)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, A, P> const& _x, vec<1, B, P> const& _y, vec<2, C, P> const& _zw) - : x(static_cast(_x.x)) - , y(static_cast(_y.x)) - , z(static_cast(_zw.x)) - , w(static_cast(_zw.y)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<3, A, P> const& _xyz, B _w) - : x(static_cast(_xyz.x)) - , y(static_cast(_xyz.y)) - , z(static_cast(_xyz.z)) - , w(static_cast(_w)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<3, A, P> const& _xyz, vec<1, B, P> const& _w) - : x(static_cast(_xyz.x)) - , y(static_cast(_xyz.y)) - , z(static_cast(_xyz.z)) - , w(static_cast(_w.x)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(A _x, vec<3, B, P> const& _yzw) - : x(static_cast(_x)) - , y(static_cast(_yzw.x)) - , z(static_cast(_yzw.y)) - , w(static_cast(_yzw.z)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<1, A, P> const& _x, vec<3, B, P> const& _yzw) - : x(static_cast(_x.x)) - , y(static_cast(_yzw.x)) - , z(static_cast(_yzw.y)) - , w(static_cast(_yzw.z)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<2, A, P> const& _xy, vec<2, B, P> const& _zw) - : x(static_cast(_xy.x)) - , y(static_cast(_xy.y)) - , z(static_cast(_zw.x)) - , w(static_cast(_zw.y)) - {} - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>::vec(vec<4, U, P> const& v) - : x(static_cast(v.x)) - , y(static_cast(v.y)) - , z(static_cast(v.z)) - , w(static_cast(v.w)) - {} - - // -- Component accesses -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR T& vec<4, T, Q>::operator[](typename vec<4, T, Q>::length_type i) - { - assert(i >= 0 && i < this->length()); - switch(i) - { - default: - case 0: - return x; - case 1: - return y; - case 2: - return z; - case 3: - return w; - } - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& vec<4, T, Q>::operator[](typename vec<4, T, Q>::length_type i) const - { - assert(i >= 0 && i < this->length()); - switch(i) - { - default: - case 0: - return x; - case 1: - return y; - case 2: - return z; - case 3: - return w; - } - } - - // -- Unary arithmetic operators -- - -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>& vec<4, T, Q>::operator=(vec<4, T, Q> const& v) - { - this->x = v.x; - this->y = v.y; - this->z = v.z; - this->w = v.w; - return *this; - } -# endif - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q>& vec<4, T, Q>::operator=(vec<4, U, Q> const& v) - { - this->x = static_cast(v.x); - this->y = static_cast(v.y); - this->z = static_cast(v.z); - this->w = static_cast(v.w); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator+=(U scalar) - { - return (*this = detail::compute_vec4_add::value>::call(*this, vec<4, T, Q>(scalar))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator+=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec4_add::value>::call(*this, vec<4, T, Q>(v.x))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator+=(vec<4, U, Q> const& v) - { - return (*this = detail::compute_vec4_add::value>::call(*this, vec<4, T, Q>(v))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator-=(U scalar) - { - return (*this = detail::compute_vec4_sub::value>::call(*this, vec<4, T, Q>(scalar))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator-=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec4_sub::value>::call(*this, vec<4, T, Q>(v.x))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator-=(vec<4, U, Q> const& v) - { - return (*this = detail::compute_vec4_sub::value>::call(*this, vec<4, T, Q>(v))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator*=(U scalar) - { - return (*this = detail::compute_vec4_mul::value>::call(*this, vec<4, T, Q>(scalar))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator*=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec4_mul::value>::call(*this, vec<4, T, Q>(v.x))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator*=(vec<4, U, Q> const& v) - { - return (*this = detail::compute_vec4_mul::value>::call(*this, vec<4, T, Q>(v))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator/=(U scalar) - { - return (*this = detail::compute_vec4_div::value>::call(*this, vec<4, T, Q>(scalar))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator/=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec4_div::value>::call(*this, vec<4, T, Q>(v.x))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator/=(vec<4, U, Q> const& v) - { - return (*this = detail::compute_vec4_div::value>::call(*this, vec<4, T, Q>(v))); - } - - // -- Increment and decrement operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator++() - { - ++this->x; - ++this->y; - ++this->z; - ++this->w; - return *this; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator--() - { - --this->x; - --this->y; - --this->z; - --this->w; - return *this; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> vec<4, T, Q>::operator++(int) - { - vec<4, T, Q> Result(*this); - ++*this; - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> vec<4, T, Q>::operator--(int) - { - vec<4, T, Q> Result(*this); - --*this; - return Result; - } - - // -- Unary bit operators -- - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator%=(U scalar) - { - return (*this = detail::compute_vec4_mod::value>::call(*this, vec<4, T, Q>(scalar))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator%=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec4_mod::value>::call(*this, vec<4, T, Q>(v))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator%=(vec<4, U, Q> const& v) - { - return (*this = detail::compute_vec4_mod::value>::call(*this, vec<4, T, Q>(v))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator&=(U scalar) - { - return (*this = detail::compute_vec4_and::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator&=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec4_and::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator&=(vec<4, U, Q> const& v) - { - return (*this = detail::compute_vec4_and::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator|=(U scalar) - { - return (*this = detail::compute_vec4_or::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator|=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec4_or::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator|=(vec<4, U, Q> const& v) - { - return (*this = detail::compute_vec4_or::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator^=(U scalar) - { - return (*this = detail::compute_vec4_xor::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator^=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec4_xor::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator^=(vec<4, U, Q> const& v) - { - return (*this = detail::compute_vec4_xor::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator<<=(U scalar) - { - return (*this = detail::compute_vec4_shift_left::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator<<=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec4_shift_left::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator<<=(vec<4, U, Q> const& v) - { - return (*this = detail::compute_vec4_shift_left::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator>>=(U scalar) - { - return (*this = detail::compute_vec4_shift_right::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(scalar))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator>>=(vec<1, U, Q> const& v) - { - return (*this = detail::compute_vec4_shift_right::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); - } - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> & vec<4, T, Q>::operator>>=(vec<4, U, Q> const& v) - { - return (*this = detail::compute_vec4_shift_right::value, sizeof(T) * 8, detail::is_aligned::value>::call(*this, vec<4, T, Q>(v))); - } - - // -- Unary constant operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v) - { - return v; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v) - { - return vec<4, T, Q>(0) -= v; - } - - // -- Binary arithmetic operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v, T const & scalar) - { - return vec<4, T, Q>(v) += scalar; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<4, T, Q>(v1) += v2; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(T scalar, vec<4, T, Q> const& v) - { - return vec<4, T, Q>(v) += scalar; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v2) += v1; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v1) += v2; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v, T const & scalar) - { - return vec<4, T, Q>(v) -= scalar; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<4, T, Q>(v1) -= v2; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(T scalar, vec<4, T, Q> const& v) - { - return vec<4, T, Q>(scalar) -= v; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v1.x) -= v2; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v1) -= v2; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v, T const & scalar) - { - return vec<4, T, Q>(v) *= scalar; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<4, T, Q>(v1) *= v2; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(T scalar, vec<4, T, Q> const& v) - { - return vec<4, T, Q>(v) *= scalar; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v2) *= v1; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v1) *= v2; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v, T const & scalar) - { - return vec<4, T, Q>(v) /= scalar; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<4, T, Q>(v1) /= v2; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(T scalar, vec<4, T, Q> const& v) - { - return vec<4, T, Q>(scalar) /= v; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v1.x) /= v2; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v1) /= v2; - } - - // -- Binary bit operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v, T scalar) - { - return vec<4, T, Q>(v) %= scalar; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<4, T, Q>(v1) %= v2.x; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(T scalar, vec<4, T, Q> const& v) - { - return vec<4, T, Q>(scalar) %= v; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v) - { - return vec<4, T, Q>(scalar.x) %= v; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v1) %= v2; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, T scalar) - { - return vec<4, T, Q>(v) &= scalar; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar) - { - return vec<4, T, Q>(v) &= scalar; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(T scalar, vec<4, T, Q> const& v) - { - return vec<4, T, Q>(scalar) &= v; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v1.x) &= v2; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator&(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v1) &= v2; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v, T scalar) - { - return vec<4, T, Q>(v) |= scalar; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<4, T, Q>(v1) |= v2.x; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(T scalar, vec<4, T, Q> const& v) - { - return vec<4, T, Q>(scalar) |= v; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v1.x) |= v2; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v1) |= v2; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v, T scalar) - { - return vec<4, T, Q>(v) ^= scalar; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<4, T, Q>(v1) ^= v2.x; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(T scalar, vec<4, T, Q> const& v) - { - return vec<4, T, Q>(scalar) ^= v; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v1.x) ^= v2; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v1) ^= v2; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v, T scalar) - { - return vec<4, T, Q>(v) <<= scalar; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<4, T, Q>(v1) <<= v2.x; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(T scalar, vec<4, T, Q> const& v) - { - return vec<4, T, Q>(scalar) <<= v; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v1.x) <<= v2; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v1) <<= v2; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v, T scalar) - { - return vec<4, T, Q>(v) >>= scalar; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2) - { - return vec<4, T, Q>(v1) >>= v2.x; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(T scalar, vec<4, T, Q> const& v) - { - return vec<4, T, Q>(scalar) >>= v; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v1.x) >>= v2; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return vec<4, T, Q>(v1) >>= v2; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, T, Q> operator~(vec<4, T, Q> const& v) - { - return detail::compute_vec4_bitwise_not::value, sizeof(T) * 8, detail::is_aligned::value>::call(v); - } - - // -- Boolean operators -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator==(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return detail::compute_vec4_equal::value, sizeof(T) * 8, detail::is_aligned::value>::call(v1, v2); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool operator!=(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2) - { - return detail::compute_vec4_nequal::value, sizeof(T) * 8, detail::is_aligned::value>::call(v1, v2); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, bool, Q> operator&&(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2) - { - return vec<4, bool, Q>(v1.x && v2.x, v1.y && v2.y, v1.z && v2.z, v1.w && v2.w); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, bool, Q> operator||(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2) - { - return vec<4, bool, Q>(v1.x || v2.x, v1.y || v2.y, v1.z || v2.z, v1.w || v2.w); - } -}//namespace glm - -#if GLM_CONFIG_SIMD == GLM_ENABLE -# include "type_vec4_simd.inl" -#endif diff --git a/3rdparty/glm/source/glm/detail/type_vec4_simd.inl b/3rdparty/glm/source/glm/detail/type_vec4_simd.inl deleted file mode 100644 index 149c413..0000000 --- a/3rdparty/glm/source/glm/detail/type_vec4_simd.inl +++ /dev/null @@ -1,775 +0,0 @@ -#if GLM_ARCH & GLM_ARCH_SSE2_BIT - -namespace glm{ -namespace detail -{ -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - template - struct _swizzle_base1<4, float, Q, E0,E1,E2,E3, true> : public _swizzle_base0 - { - GLM_FUNC_QUALIFIER vec<4, float, Q> operator ()() const - { - __m128 data = *reinterpret_cast<__m128 const*>(&this->_buffer); - - vec<4, float, Q> Result; -# if GLM_ARCH & GLM_ARCH_AVX_BIT - Result.data = _mm_permute_ps(data, _MM_SHUFFLE(E3, E2, E1, E0)); -# else - Result.data = _mm_shuffle_ps(data, data, _MM_SHUFFLE(E3, E2, E1, E0)); -# endif - return Result; - } - }; - - template - struct _swizzle_base1<4, int, Q, E0,E1,E2,E3, true> : public _swizzle_base0 - { - GLM_FUNC_QUALIFIER vec<4, int, Q> operator ()() const - { - __m128i data = *reinterpret_cast<__m128i const*>(&this->_buffer); - - vec<4, int, Q> Result; - Result.data = _mm_shuffle_epi32(data, _MM_SHUFFLE(E3, E2, E1, E0)); - return Result; - } - }; - - template - struct _swizzle_base1<4, uint, Q, E0,E1,E2,E3, true> : public _swizzle_base0 - { - GLM_FUNC_QUALIFIER vec<4, uint, Q> operator ()() const - { - __m128i data = *reinterpret_cast<__m128i const*>(&this->_buffer); - - vec<4, uint, Q> Result; - Result.data = _mm_shuffle_epi32(data, _MM_SHUFFLE(E3, E2, E1, E0)); - return Result; - } - }; -# endif// GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - - template - struct compute_vec4_add - { - static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) - { - vec<4, float, Q> Result; - Result.data = _mm_add_ps(a.data, b.data); - return Result; - } - }; - -# if GLM_ARCH & GLM_ARCH_AVX_BIT - template - struct compute_vec4_add - { - static vec<4, double, Q> call(vec<4, double, Q> const& a, vec<4, double, Q> const& b) - { - vec<4, double, Q> Result; - Result.data = _mm256_add_pd(a.data, b.data); - return Result; - } - }; -# endif - - template - struct compute_vec4_sub - { - static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) - { - vec<4, float, Q> Result; - Result.data = _mm_sub_ps(a.data, b.data); - return Result; - } - }; - -# if GLM_ARCH & GLM_ARCH_AVX_BIT - template - struct compute_vec4_sub - { - static vec<4, double, Q> call(vec<4, double, Q> const& a, vec<4, double, Q> const& b) - { - vec<4, double, Q> Result; - Result.data = _mm256_sub_pd(a.data, b.data); - return Result; - } - }; -# endif - - template - struct compute_vec4_mul - { - static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) - { - vec<4, float, Q> Result; - Result.data = _mm_mul_ps(a.data, b.data); - return Result; - } - }; - -# if GLM_ARCH & GLM_ARCH_AVX_BIT - template - struct compute_vec4_mul - { - static vec<4, double, Q> call(vec<4, double, Q> const& a, vec<4, double, Q> const& b) - { - vec<4, double, Q> Result; - Result.data = _mm256_mul_pd(a.data, b.data); - return Result; - } - }; -# endif - - template - struct compute_vec4_div - { - static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) - { - vec<4, float, Q> Result; - Result.data = _mm_div_ps(a.data, b.data); - return Result; - } - }; - - # if GLM_ARCH & GLM_ARCH_AVX_BIT - template - struct compute_vec4_div - { - static vec<4, double, Q> call(vec<4, double, Q> const& a, vec<4, double, Q> const& b) - { - vec<4, double, Q> Result; - Result.data = _mm256_div_pd(a.data, b.data); - return Result; - } - }; -# endif - - template<> - struct compute_vec4_div - { - static vec<4, float, aligned_lowp> call(vec<4, float, aligned_lowp> const& a, vec<4, float, aligned_lowp> const& b) - { - vec<4, float, aligned_lowp> Result; - Result.data = _mm_mul_ps(a.data, _mm_rcp_ps(b.data)); - return Result; - } - }; - - template - struct compute_vec4_and - { - static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - vec<4, T, Q> Result; - Result.data = _mm_and_si128(a.data, b.data); - return Result; - } - }; - -# if GLM_ARCH & GLM_ARCH_AVX2_BIT - template - struct compute_vec4_and - { - static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - vec<4, T, Q> Result; - Result.data = _mm256_and_si256(a.data, b.data); - return Result; - } - }; -# endif - - template - struct compute_vec4_or - { - static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - vec<4, T, Q> Result; - Result.data = _mm_or_si128(a.data, b.data); - return Result; - } - }; - -# if GLM_ARCH & GLM_ARCH_AVX2_BIT - template - struct compute_vec4_or - { - static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - vec<4, T, Q> Result; - Result.data = _mm256_or_si256(a.data, b.data); - return Result; - } - }; -# endif - - template - struct compute_vec4_xor - { - static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - vec<4, T, Q> Result; - Result.data = _mm_xor_si128(a.data, b.data); - return Result; - } - }; - -# if GLM_ARCH & GLM_ARCH_AVX2_BIT - template - struct compute_vec4_xor - { - static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - vec<4, T, Q> Result; - Result.data = _mm256_xor_si256(a.data, b.data); - return Result; - } - }; -# endif - - template - struct compute_vec4_shift_left - { - static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - vec<4, T, Q> Result; - Result.data = _mm_sll_epi32(a.data, b.data); - return Result; - } - }; - -# if GLM_ARCH & GLM_ARCH_AVX2_BIT - template - struct compute_vec4_shift_left - { - static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - vec<4, T, Q> Result; - Result.data = _mm256_sll_epi64(a.data, b.data); - return Result; - } - }; -# endif - - template - struct compute_vec4_shift_right - { - static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - vec<4, T, Q> Result; - Result.data = _mm_srl_epi32(a.data, b.data); - return Result; - } - }; - -# if GLM_ARCH & GLM_ARCH_AVX2_BIT - template - struct compute_vec4_shift_right - { - static vec<4, T, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b) - { - vec<4, T, Q> Result; - Result.data = _mm256_srl_epi64(a.data, b.data); - return Result; - } - }; -# endif - - template - struct compute_vec4_bitwise_not - { - static vec<4, T, Q> call(vec<4, T, Q> const& v) - { - vec<4, T, Q> Result; - Result.data = _mm_xor_si128(v.data, _mm_set1_epi32(-1)); - return Result; - } - }; - -# if GLM_ARCH & GLM_ARCH_AVX2_BIT - template - struct compute_vec4_bitwise_not - { - static vec<4, T, Q> call(vec<4, T, Q> const& v) - { - vec<4, T, Q> Result; - Result.data = _mm256_xor_si256(v.data, _mm_set1_epi32(-1)); - return Result; - } - }; -# endif - - template - struct compute_vec4_equal - { - static bool call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) - { - return _mm_movemask_ps(_mm_cmpneq_ps(v1.data, v2.data)) == 0; - } - }; - -# if GLM_ARCH & GLM_ARCH_SSE41_BIT - template - struct compute_vec4_equal - { - static bool call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2) - { - //return _mm_movemask_epi8(_mm_cmpeq_epi32(v1.data, v2.data)) != 0; - __m128i neq = _mm_xor_si128(v1.data, v2.data); - return _mm_test_all_zeros(neq, neq) == 0; - } - }; -# endif - - template - struct compute_vec4_nequal - { - static bool call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) - { - return _mm_movemask_ps(_mm_cmpneq_ps(v1.data, v2.data)) != 0; - } - }; - -# if GLM_ARCH & GLM_ARCH_SSE41_BIT - template - struct compute_vec4_nequal - { - static bool call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2) - { - //return _mm_movemask_epi8(_mm_cmpneq_epi32(v1.data, v2.data)) != 0; - __m128i neq = _mm_xor_si128(v1.data, v2.data); - return _mm_test_all_zeros(neq, neq) != 0; - } - }; -# endif -}//namespace detail - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_lowp>::vec(float _s) : - data(_mm_set1_ps(_s)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_mediump>::vec(float _s) : - data(_mm_set1_ps(_s)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(float _s) : - data(_mm_set1_ps(_s)) - {} - -# if GLM_ARCH & GLM_ARCH_AVX_BIT - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, double, aligned_lowp>::vec(double _s) : - data(_mm256_set1_pd(_s)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, double, aligned_mediump>::vec(double _s) : - data(_mm256_set1_pd(_s)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, double, aligned_highp>::vec(double _s) : - data(_mm256_set1_pd(_s)) - {} -# endif - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_lowp>::vec(int _s) : - data(_mm_set1_epi32(_s)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_mediump>::vec(int _s) : - data(_mm_set1_epi32(_s)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_highp>::vec(int _s) : - data(_mm_set1_epi32(_s)) - {} - -# if GLM_ARCH & GLM_ARCH_AVX2_BIT - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, detail::int64, aligned_lowp>::vec(detail::int64 _s) : - data(_mm256_set1_epi64x(_s)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, detail::int64, aligned_mediump>::vec(detail::int64 _s) : - data(_mm256_set1_epi64x(_s)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, detail::int64, aligned_highp>::vec(detail::int64 _s) : - data(_mm256_set1_epi64x(_s)) - {} -# endif - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_lowp>::vec(float _x, float _y, float _z, float _w) : - data(_mm_set_ps(_w, _z, _y, _x)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_mediump>::vec(float _x, float _y, float _z, float _w) : - data(_mm_set_ps(_w, _z, _y, _x)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(float _x, float _y, float _z, float _w) : - data(_mm_set_ps(_w, _z, _y, _x)) - {} - - template<> - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_lowp>::vec(int _x, int _y, int _z, int _w) : - data(_mm_set_epi32(_w, _z, _y, _x)) - {} - - template<> - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_mediump>::vec(int _x, int _y, int _z, int _w) : - data(_mm_set_epi32(_w, _z, _y, _x)) - {} - - template<> - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_highp>::vec(int _x, int _y, int _z, int _w) : - data(_mm_set_epi32(_w, _z, _y, _x)) - {} - - template<> - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_lowp>::vec(int _x, int _y, int _z, int _w) : - data(_mm_cvtepi32_ps(_mm_set_epi32(_w, _z, _y, _x))) - {} - - template<> - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_mediump>::vec(int _x, int _y, int _z, int _w) : - data(_mm_cvtepi32_ps(_mm_set_epi32(_w, _z, _y, _x))) - {} - - template<> - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(int _x, int _y, int _z, int _w) : - data(_mm_cvtepi32_ps(_mm_set_epi32(_w, _z, _y, _x))) - {} -}//namespace glm - -#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT - -#if GLM_ARCH & GLM_ARCH_NEON_BIT -namespace glm { -namespace detail { - - template - struct compute_vec4_add - { - static - vec<4, float, Q> - call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) - { - vec<4, float, Q> Result; - Result.data = vaddq_f32(a.data, b.data); - return Result; - } - }; - - template - struct compute_vec4_add - { - static - vec<4, uint, Q> - call(vec<4, uint, Q> const& a, vec<4, uint, Q> const& b) - { - vec<4, uint, Q> Result; - Result.data = vaddq_u32(a.data, b.data); - return Result; - } - }; - - template - struct compute_vec4_add - { - static - vec<4, int, Q> - call(vec<4, int, Q> const& a, vec<4, int, Q> const& b) - { - vec<4, uint, Q> Result; - Result.data = vaddq_s32(a.data, b.data); - return Result; - } - }; - - template - struct compute_vec4_sub - { - static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) - { - vec<4, float, Q> Result; - Result.data = vsubq_f32(a.data, b.data); - return Result; - } - }; - - template - struct compute_vec4_sub - { - static vec<4, uint, Q> call(vec<4, uint, Q> const& a, vec<4, uint, Q> const& b) - { - vec<4, uint, Q> Result; - Result.data = vsubq_u32(a.data, b.data); - return Result; - } - }; - - template - struct compute_vec4_sub - { - static vec<4, int, Q> call(vec<4, int, Q> const& a, vec<4, int, Q> const& b) - { - vec<4, int, Q> Result; - Result.data = vsubq_s32(a.data, b.data); - return Result; - } - }; - - template - struct compute_vec4_mul - { - static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) - { - vec<4, float, Q> Result; - Result.data = vmulq_f32(a.data, b.data); - return Result; - } - }; - - template - struct compute_vec4_mul - { - static vec<4, uint, Q> call(vec<4, uint, Q> const& a, vec<4, uint, Q> const& b) - { - vec<4, uint, Q> Result; - Result.data = vmulq_u32(a.data, b.data); - return Result; - } - }; - - template - struct compute_vec4_mul - { - static vec<4, int, Q> call(vec<4, int, Q> const& a, vec<4, int, Q> const& b) - { - vec<4, int, Q> Result; - Result.data = vmulq_s32(a.data, b.data); - return Result; - } - }; - - template - struct compute_vec4_div - { - static vec<4, float, Q> call(vec<4, float, Q> const& a, vec<4, float, Q> const& b) - { - vec<4, float, Q> Result; - Result.data = vdivq_f32(a.data, b.data); - return Result; - } - }; - - template - struct compute_vec4_equal - { - static bool call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) - { - uint32x4_t cmp = vceqq_f32(v1.data, v2.data); -#if GLM_ARCH & GLM_ARCH_ARMV8_BIT - cmp = vpminq_u32(cmp, cmp); - cmp = vpminq_u32(cmp, cmp); - uint32_t r = cmp[0]; -#else - uint32x2_t cmpx2 = vpmin_u32(vget_low_f32(cmp), vget_high_f32(cmp)); - cmpx2 = vpmin_u32(cmpx2, cmpx2); - uint32_t r = cmpx2[0]; -#endif - return r == ~0u; - } - }; - - template - struct compute_vec4_equal - { - static bool call(vec<4, uint, Q> const& v1, vec<4, uint, Q> const& v2) - { - uint32x4_t cmp = vceqq_u32(v1.data, v2.data); -#if GLM_ARCH & GLM_ARCH_ARMV8_BIT - cmp = vpminq_u32(cmp, cmp); - cmp = vpminq_u32(cmp, cmp); - uint32_t r = cmp[0]; -#else - uint32x2_t cmpx2 = vpmin_u32(vget_low_f32(cmp), vget_high_f32(cmp)); - cmpx2 = vpmin_u32(cmpx2, cmpx2); - uint32_t r = cmpx2[0]; -#endif - return r == ~0u; - } - }; - - template - struct compute_vec4_equal - { - static bool call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2) - { - uint32x4_t cmp = vceqq_s32(v1.data, v2.data); -#if GLM_ARCH & GLM_ARCH_ARMV8_BIT - cmp = vpminq_u32(cmp, cmp); - cmp = vpminq_u32(cmp, cmp); - uint32_t r = cmp[0]; -#else - uint32x2_t cmpx2 = vpmin_u32(vget_low_f32(cmp), vget_high_f32(cmp)); - cmpx2 = vpmin_u32(cmpx2, cmpx2); - uint32_t r = cmpx2[0]; -#endif - return r == ~0u; - } - }; - - template - struct compute_vec4_nequal - { - static bool call(vec<4, float, Q> const& v1, vec<4, float, Q> const& v2) - { - return !compute_vec4_equal::call(v1, v2); - } - }; - - template - struct compute_vec4_nequal - { - static bool call(vec<4, uint, Q> const& v1, vec<4, uint, Q> const& v2) - { - return !compute_vec4_equal::call(v1, v2); - } - }; - - template - struct compute_vec4_nequal - { - static bool call(vec<4, int, Q> const& v1, vec<4, int, Q> const& v2) - { - return !compute_vec4_equal::call(v1, v2); - } - }; - -}//namespace detail - -#if !GLM_CONFIG_XYZW_ONLY - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_lowp>::vec(float _s) : - data(vdupq_n_f32(_s)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_mediump>::vec(float _s) : - data(vdupq_n_f32(_s)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(float _s) : - data(vdupq_n_f32(_s)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_lowp>::vec(int _s) : - data(vdupq_n_s32(_s)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_mediump>::vec(int _s) : - data(vdupq_n_s32(_s)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, int, aligned_highp>::vec(int _s) : - data(vdupq_n_s32(_s)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, uint, aligned_lowp>::vec(uint _s) : - data(vdupq_n_u32(_s)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, uint, aligned_mediump>::vec(uint _s) : - data(vdupq_n_u32(_s)) - {} - - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, uint, aligned_highp>::vec(uint _s) : - data(vdupq_n_u32(_s)) - {} - - template<> - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(const vec<4, float, aligned_highp>& rhs) : - data(rhs.data) - {} - - template<> - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(const vec<4, int, aligned_highp>& rhs) : - data(vcvtq_f32_s32(rhs.data)) - {} - - template<> - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(const vec<4, uint, aligned_highp>& rhs) : - data(vcvtq_f32_u32(rhs.data)) - {} - - template<> - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_lowp>::vec(int _x, int _y, int _z, int _w) : - data(vcvtq_f32_s32(vec<4, int, aligned_lowp>(_x, _y, _z, _w).data)) - {} - - template<> - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_mediump>::vec(int _x, int _y, int _z, int _w) : - data(vcvtq_f32_s32(vec<4, int, aligned_mediump>(_x, _y, _z, _w).data)) - {} - - template<> - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(int _x, int _y, int _z, int _w) : - data(vcvtq_f32_s32(vec<4, int, aligned_highp>(_x, _y, _z, _w).data)) - {} - - template<> - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_lowp>::vec(uint _x, uint _y, uint _z, uint _w) : - data(vcvtq_f32_u32(vec<4, uint, aligned_lowp>(_x, _y, _z, _w).data)) - {} - - template<> - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_mediump>::vec(uint _x, uint _y, uint _z, uint _w) : - data(vcvtq_f32_u32(vec<4, uint, aligned_mediump>(_x, _y, _z, _w).data)) - {} - - - template<> - template<> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<4, float, aligned_highp>::vec(uint _x, uint _y, uint _z, uint _w) : - data(vcvtq_f32_u32(vec<4, uint, aligned_highp>(_x, _y, _z, _w).data)) - {} - -#endif -}//namespace glm - -#endif diff --git a/3rdparty/glm/source/glm/exponential.hpp b/3rdparty/glm/source/glm/exponential.hpp deleted file mode 100644 index f8fb886..0000000 --- a/3rdparty/glm/source/glm/exponential.hpp +++ /dev/null @@ -1,110 +0,0 @@ -/// @ref core -/// @file glm/exponential.hpp -/// -/// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions -/// -/// @defgroup core_func_exponential Exponential functions -/// @ingroup core -/// -/// Provides GLSL exponential functions -/// -/// These all operate component-wise. The description is per component. -/// -/// Include to use these core features. - -#pragma once - -#include "detail/type_vec1.hpp" -#include "detail/type_vec2.hpp" -#include "detail/type_vec3.hpp" -#include "detail/type_vec4.hpp" -#include - -namespace glm -{ - /// @addtogroup core_func_exponential - /// @{ - - /// Returns 'base' raised to the power 'exponent'. - /// - /// @param base Floating point value. pow function is defined for input values of 'base' defined in the range (inf-, inf+) in the limit of the type qualifier. - /// @param exponent Floating point value representing the 'exponent'. - /// - /// @see GLSL pow man page - /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions - template - GLM_FUNC_DECL vec pow(vec const& base, vec const& exponent); - - /// Returns the natural exponentiation of x, i.e., e^x. - /// - /// @param v exp function is defined for input values of v defined in the range (inf-, inf+) in the limit of the type qualifier. - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Floating-point scalar types. - /// - /// @see GLSL exp man page - /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions - template - GLM_FUNC_DECL vec exp(vec const& v); - - /// Returns the natural logarithm of v, i.e., - /// returns the value y which satisfies the equation x = e^y. - /// Results are undefined if v <= 0. - /// - /// @param v log function is defined for input values of v defined in the range (0, inf+) in the limit of the type qualifier. - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Floating-point scalar types. - /// - /// @see GLSL log man page - /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions - template - GLM_FUNC_DECL vec log(vec const& v); - - /// Returns 2 raised to the v power. - /// - /// @param v exp2 function is defined for input values of v defined in the range (inf-, inf+) in the limit of the type qualifier. - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Floating-point scalar types. - /// - /// @see GLSL exp2 man page - /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions - template - GLM_FUNC_DECL vec exp2(vec const& v); - - /// Returns the base 2 log of x, i.e., returns the value y, - /// which satisfies the equation x = 2 ^ y. - /// - /// @param v log2 function is defined for input values of v defined in the range (0, inf+) in the limit of the type qualifier. - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Floating-point scalar types. - /// - /// @see GLSL log2 man page - /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions - template - GLM_FUNC_DECL vec log2(vec const& v); - - /// Returns the positive square root of v. - /// - /// @param v sqrt function is defined for input values of v defined in the range [0, inf+) in the limit of the type qualifier. - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Floating-point scalar types. - /// - /// @see GLSL sqrt man page - /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions - template - GLM_FUNC_DECL vec sqrt(vec const& v); - - /// Returns the reciprocal of the positive square root of v. - /// - /// @param v inversesqrt function is defined for input values of v defined in the range [0, inf+) in the limit of the type qualifier. - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Floating-point scalar types. - /// - /// @see GLSL inversesqrt man page - /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions - template - GLM_FUNC_DECL vec inversesqrt(vec const& v); - - /// @} -}//namespace glm - -#include "detail/func_exponential.inl" diff --git a/3rdparty/glm/source/glm/ext.hpp b/3rdparty/glm/source/glm/ext.hpp deleted file mode 100644 index 39cabc3..0000000 --- a/3rdparty/glm/source/glm/ext.hpp +++ /dev/null @@ -1,255 +0,0 @@ -/// @file glm/ext.hpp -/// -/// @ref core (Dependence) - -#include "detail/setup.hpp" - -#pragma once - -#include "glm.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_MESSAGE_EXT_INCLUDED_DISPLAYED) -# define GLM_MESSAGE_EXT_INCLUDED_DISPLAYED -# pragma message("GLM: All extensions included (not recommended)") -#endif//GLM_MESSAGES - -#include "./ext/matrix_clip_space.hpp" -#include "./ext/matrix_common.hpp" - -#include "./ext/matrix_double2x2.hpp" -#include "./ext/matrix_double2x2_precision.hpp" -#include "./ext/matrix_double2x3.hpp" -#include "./ext/matrix_double2x3_precision.hpp" -#include "./ext/matrix_double2x4.hpp" -#include "./ext/matrix_double2x4_precision.hpp" -#include "./ext/matrix_double3x2.hpp" -#include "./ext/matrix_double3x2_precision.hpp" -#include "./ext/matrix_double3x3.hpp" -#include "./ext/matrix_double3x3_precision.hpp" -#include "./ext/matrix_double3x4.hpp" -#include "./ext/matrix_double3x4_precision.hpp" -#include "./ext/matrix_double4x2.hpp" -#include "./ext/matrix_double4x2_precision.hpp" -#include "./ext/matrix_double4x3.hpp" -#include "./ext/matrix_double4x3_precision.hpp" -#include "./ext/matrix_double4x4.hpp" -#include "./ext/matrix_double4x4_precision.hpp" - -#include "./ext/matrix_float2x2.hpp" -#include "./ext/matrix_float2x2_precision.hpp" -#include "./ext/matrix_float2x3.hpp" -#include "./ext/matrix_float2x3_precision.hpp" -#include "./ext/matrix_float2x4.hpp" -#include "./ext/matrix_float2x4_precision.hpp" -#include "./ext/matrix_float3x2.hpp" -#include "./ext/matrix_float3x2_precision.hpp" -#include "./ext/matrix_float3x3.hpp" -#include "./ext/matrix_float3x3_precision.hpp" -#include "./ext/matrix_float3x4.hpp" -#include "./ext/matrix_float3x4_precision.hpp" -#include "./ext/matrix_float4x2.hpp" -#include "./ext/matrix_float4x2_precision.hpp" -#include "./ext/matrix_float4x3.hpp" -#include "./ext/matrix_float4x3_precision.hpp" -#include "./ext/matrix_float4x4.hpp" -#include "./ext/matrix_float4x4_precision.hpp" - -#include "./ext/matrix_int2x2.hpp" -#include "./ext/matrix_int2x2_sized.hpp" -#include "./ext/matrix_int2x3.hpp" -#include "./ext/matrix_int2x3_sized.hpp" -#include "./ext/matrix_int2x4.hpp" -#include "./ext/matrix_int2x4_sized.hpp" -#include "./ext/matrix_int3x2.hpp" -#include "./ext/matrix_int3x2_sized.hpp" -#include "./ext/matrix_int3x3.hpp" -#include "./ext/matrix_int3x3_sized.hpp" -#include "./ext/matrix_int3x4.hpp" -#include "./ext/matrix_int3x4_sized.hpp" -#include "./ext/matrix_int4x2.hpp" -#include "./ext/matrix_int4x2_sized.hpp" -#include "./ext/matrix_int4x3.hpp" -#include "./ext/matrix_int4x3_sized.hpp" -#include "./ext/matrix_int4x4.hpp" -#include "./ext/matrix_int4x4_sized.hpp" - -#include "./ext/matrix_uint2x2.hpp" -#include "./ext/matrix_uint2x2_sized.hpp" -#include "./ext/matrix_uint2x3.hpp" -#include "./ext/matrix_uint2x3_sized.hpp" -#include "./ext/matrix_uint2x4.hpp" -#include "./ext/matrix_uint2x4_sized.hpp" -#include "./ext/matrix_uint3x2.hpp" -#include "./ext/matrix_uint3x2_sized.hpp" -#include "./ext/matrix_uint3x3.hpp" -#include "./ext/matrix_uint3x3_sized.hpp" -#include "./ext/matrix_uint3x4.hpp" -#include "./ext/matrix_uint3x4_sized.hpp" -#include "./ext/matrix_uint4x2.hpp" -#include "./ext/matrix_uint4x2_sized.hpp" -#include "./ext/matrix_uint4x3.hpp" -#include "./ext/matrix_uint4x3_sized.hpp" -#include "./ext/matrix_uint4x4.hpp" -#include "./ext/matrix_uint4x4_sized.hpp" - -#include "./ext/matrix_projection.hpp" -#include "./ext/matrix_relational.hpp" -#include "./ext/matrix_transform.hpp" - -#include "./ext/quaternion_common.hpp" -#include "./ext/quaternion_double.hpp" -#include "./ext/quaternion_double_precision.hpp" -#include "./ext/quaternion_float.hpp" -#include "./ext/quaternion_float_precision.hpp" -#include "./ext/quaternion_exponential.hpp" -#include "./ext/quaternion_geometric.hpp" -#include "./ext/quaternion_relational.hpp" -#include "./ext/quaternion_transform.hpp" -#include "./ext/quaternion_trigonometric.hpp" - -#include "./ext/scalar_common.hpp" -#include "./ext/scalar_constants.hpp" -#include "./ext/scalar_integer.hpp" -#include "./ext/scalar_packing.hpp" -#include "./ext/scalar_reciprocal.hpp" -#include "./ext/scalar_relational.hpp" -#include "./ext/scalar_ulp.hpp" - -#include "./ext/scalar_int_sized.hpp" -#include "./ext/scalar_uint_sized.hpp" - -#include "./ext/vector_common.hpp" -#include "./ext/vector_integer.hpp" -#include "./ext/vector_packing.hpp" -#include "./ext/vector_reciprocal.hpp" -#include "./ext/vector_relational.hpp" -#include "./ext/vector_ulp.hpp" - -#include "./ext/vector_bool1.hpp" -#include "./ext/vector_bool1_precision.hpp" -#include "./ext/vector_bool2.hpp" -#include "./ext/vector_bool2_precision.hpp" -#include "./ext/vector_bool3.hpp" -#include "./ext/vector_bool3_precision.hpp" -#include "./ext/vector_bool4.hpp" -#include "./ext/vector_bool4_precision.hpp" - -#include "./ext/vector_double1.hpp" -#include "./ext/vector_double1_precision.hpp" -#include "./ext/vector_double2.hpp" -#include "./ext/vector_double2_precision.hpp" -#include "./ext/vector_double3.hpp" -#include "./ext/vector_double3_precision.hpp" -#include "./ext/vector_double4.hpp" -#include "./ext/vector_double4_precision.hpp" - -#include "./ext/vector_float1.hpp" -#include "./ext/vector_float1_precision.hpp" -#include "./ext/vector_float2.hpp" -#include "./ext/vector_float2_precision.hpp" -#include "./ext/vector_float3.hpp" -#include "./ext/vector_float3_precision.hpp" -#include "./ext/vector_float4.hpp" -#include "./ext/vector_float4_precision.hpp" - -#include "./ext/vector_int1.hpp" -#include "./ext/vector_int1_sized.hpp" -#include "./ext/vector_int2.hpp" -#include "./ext/vector_int2_sized.hpp" -#include "./ext/vector_int3.hpp" -#include "./ext/vector_int3_sized.hpp" -#include "./ext/vector_int4.hpp" -#include "./ext/vector_int4_sized.hpp" - -#include "./ext/vector_uint1.hpp" -#include "./ext/vector_uint1_sized.hpp" -#include "./ext/vector_uint2.hpp" -#include "./ext/vector_uint2_sized.hpp" -#include "./ext/vector_uint3.hpp" -#include "./ext/vector_uint3_sized.hpp" -#include "./ext/vector_uint4.hpp" -#include "./ext/vector_uint4_sized.hpp" - -#include "./gtc/bitfield.hpp" -#include "./gtc/color_space.hpp" -#include "./gtc/constants.hpp" -#include "./gtc/epsilon.hpp" -#include "./gtc/integer.hpp" -#include "./gtc/matrix_access.hpp" -#include "./gtc/matrix_integer.hpp" -#include "./gtc/matrix_inverse.hpp" -#include "./gtc/matrix_transform.hpp" -#include "./gtc/noise.hpp" -#include "./gtc/packing.hpp" -#include "./gtc/quaternion.hpp" -#include "./gtc/random.hpp" -#include "./gtc/reciprocal.hpp" -#include "./gtc/round.hpp" -#include "./gtc/type_precision.hpp" -#include "./gtc/type_ptr.hpp" -#include "./gtc/ulp.hpp" -#include "./gtc/vec1.hpp" -#if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE -# include "./gtc/type_aligned.hpp" -#endif - -#ifdef GLM_ENABLE_EXPERIMENTAL -#include "./gtx/associated_min_max.hpp" -#include "./gtx/bit.hpp" -#include "./gtx/closest_point.hpp" -#include "./gtx/color_encoding.hpp" -#include "./gtx/color_space.hpp" -#include "./gtx/color_space_YCoCg.hpp" -#include "./gtx/compatibility.hpp" -#include "./gtx/component_wise.hpp" -#include "./gtx/dual_quaternion.hpp" -#include "./gtx/euler_angles.hpp" -#include "./gtx/extend.hpp" -#include "./gtx/extended_min_max.hpp" -#include "./gtx/fast_exponential.hpp" -#include "./gtx/fast_square_root.hpp" -#include "./gtx/fast_trigonometry.hpp" -#include "./gtx/functions.hpp" -#include "./gtx/gradient_paint.hpp" -#include "./gtx/handed_coordinate_space.hpp" -#include "./gtx/integer.hpp" -#include "./gtx/intersect.hpp" -#include "./gtx/log_base.hpp" -#include "./gtx/matrix_cross_product.hpp" -#include "./gtx/matrix_interpolation.hpp" -#include "./gtx/matrix_major_storage.hpp" -#include "./gtx/matrix_operation.hpp" -#include "./gtx/matrix_query.hpp" -#include "./gtx/mixed_product.hpp" -#include "./gtx/norm.hpp" -#include "./gtx/normal.hpp" -#include "./gtx/normalize_dot.hpp" -#include "./gtx/number_precision.hpp" -#include "./gtx/optimum_pow.hpp" -#include "./gtx/orthonormalize.hpp" -#include "./gtx/perpendicular.hpp" -#include "./gtx/polar_coordinates.hpp" -#include "./gtx/projection.hpp" -#include "./gtx/quaternion.hpp" -#include "./gtx/raw_data.hpp" -#include "./gtx/rotate_vector.hpp" -#include "./gtx/spline.hpp" -#include "./gtx/std_based_type.hpp" -#if !((GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP)) -# include "./gtx/string_cast.hpp" -#endif -#include "./gtx/transform.hpp" -#include "./gtx/transform2.hpp" -#include "./gtx/vec_swizzle.hpp" -#include "./gtx/vector_angle.hpp" -#include "./gtx/vector_query.hpp" -#include "./gtx/wrap.hpp" - -#if GLM_HAS_TEMPLATE_ALIASES -# include "./gtx/scalar_multiplication.hpp" -#endif - -#if GLM_HAS_RANGE_FOR -# include "./gtx/range.hpp" -#endif -#endif//GLM_ENABLE_EXPERIMENTAL diff --git a/3rdparty/glm/source/glm/ext/matrix_clip_space.hpp b/3rdparty/glm/source/glm/ext/matrix_clip_space.hpp deleted file mode 100644 index c3874f2..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_clip_space.hpp +++ /dev/null @@ -1,522 +0,0 @@ -/// @ref ext_matrix_clip_space -/// @file glm/ext/matrix_clip_space.hpp -/// -/// @defgroup ext_matrix_clip_space GLM_EXT_matrix_clip_space -/// @ingroup ext -/// -/// Defines functions that generate clip space transformation matrices. -/// -/// The matrices generated by this extension use standard OpenGL fixed-function -/// conventions. For example, the lookAt function generates a transform from world -/// space into the specific eye space that the projective matrix functions -/// (perspective, ortho, etc) are designed to expect. The OpenGL compatibility -/// specifications defines the particular layout of this eye space. -/// -/// Include to use the features of this extension. -/// -/// @see ext_matrix_transform -/// @see ext_matrix_projection - -#pragma once - -// Dependencies -#include "../ext/scalar_constants.hpp" -#include "../geometric.hpp" -#include "../trigonometric.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_clip_space extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_clip_space - /// @{ - - /// Creates a matrix for projecting two-dimensional coordinates onto the screen. - /// - /// @tparam T A floating-point scalar type - /// - /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top, T const& zNear, T const& zFar) - /// @see gluOrtho2D man page - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> ortho( - T left, T right, T bottom, T top); - - /// Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @tparam T A floating-point scalar type - /// - /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoLH_ZO( - T left, T right, T bottom, T top, T zNear, T zFar); - - /// Creates a matrix for an orthographic parallel viewing volume using right-handed coordinates. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @tparam T A floating-point scalar type - /// - /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoLH_NO( - T left, T right, T bottom, T top, T zNear, T zFar); - - /// Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @tparam T A floating-point scalar type - /// - /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoRH_ZO( - T left, T right, T bottom, T top, T zNear, T zFar); - - /// Creates a matrix for an orthographic parallel viewing volume, using right-handed coordinates. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @tparam T A floating-point scalar type - /// - /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoRH_NO( - T left, T right, T bottom, T top, T zNear, T zFar); - - /// Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @tparam T A floating-point scalar type - /// - /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoZO( - T left, T right, T bottom, T top, T zNear, T zFar); - - /// Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @tparam T A floating-point scalar type - /// - /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoNO( - T left, T right, T bottom, T top, T zNear, T zFar); - - /// Creates a matrix for an orthographic parallel viewing volume, using left-handed coordinates. - /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @tparam T A floating-point scalar type - /// - /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoLH( - T left, T right, T bottom, T top, T zNear, T zFar); - - /// Creates a matrix for an orthographic parallel viewing volume, using right-handed coordinates. - /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @tparam T A floating-point scalar type - /// - /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoRH( - T left, T right, T bottom, T top, T zNear, T zFar); - - /// Creates a matrix for an orthographic parallel viewing volume, using the default handedness and default near and far clip planes definition. - /// To change default handedness use GLM_FORCE_LEFT_HANDED. To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. - /// - /// @tparam T A floating-point scalar type - /// - /// @see - glm::ortho(T const& left, T const& right, T const& bottom, T const& top) - /// @see glOrtho man page - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> ortho( - T left, T right, T bottom, T top, T zNear, T zFar); - - /// Creates a left handed frustum matrix. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumLH_ZO( - T left, T right, T bottom, T top, T near, T far); - - /// Creates a left handed frustum matrix. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumLH_NO( - T left, T right, T bottom, T top, T near, T far); - - /// Creates a right handed frustum matrix. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumRH_ZO( - T left, T right, T bottom, T top, T near, T far); - - /// Creates a right handed frustum matrix. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumRH_NO( - T left, T right, T bottom, T top, T near, T far); - - /// Creates a frustum matrix using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumZO( - T left, T right, T bottom, T top, T near, T far); - - /// Creates a frustum matrix using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumNO( - T left, T right, T bottom, T top, T near, T far); - - /// Creates a left handed frustum matrix. - /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumLH( - T left, T right, T bottom, T top, T near, T far); - - /// Creates a right handed frustum matrix. - /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumRH( - T left, T right, T bottom, T top, T near, T far); - - /// Creates a frustum matrix with default handedness, using the default handedness and default near and far clip planes definition. - /// To change default handedness use GLM_FORCE_LEFT_HANDED. To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. - /// - /// @tparam T A floating-point scalar type - /// @see glFrustum man page - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> frustum( - T left, T right, T bottom, T top, T near, T far); - - - /// Creates a matrix for a right handed, symetric perspective-view frustum. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveRH_ZO( - T fovy, T aspect, T near, T far); - - /// Creates a matrix for a right handed, symetric perspective-view frustum. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveRH_NO( - T fovy, T aspect, T near, T far); - - /// Creates a matrix for a left handed, symetric perspective-view frustum. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveLH_ZO( - T fovy, T aspect, T near, T far); - - /// Creates a matrix for a left handed, symetric perspective-view frustum. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveLH_NO( - T fovy, T aspect, T near, T far); - - /// Creates a matrix for a symetric perspective-view frustum using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveZO( - T fovy, T aspect, T near, T far); - - /// Creates a matrix for a symetric perspective-view frustum using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveNO( - T fovy, T aspect, T near, T far); - - /// Creates a matrix for a right handed, symetric perspective-view frustum. - /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveRH( - T fovy, T aspect, T near, T far); - - /// Creates a matrix for a left handed, symetric perspective-view frustum. - /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveLH( - T fovy, T aspect, T near, T far); - - /// Creates a matrix for a symetric perspective-view frustum based on the default handedness and default near and far clip planes definition. - /// To change default handedness use GLM_FORCE_LEFT_HANDED. To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. - /// - /// @param fovy Specifies the field of view angle in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// - /// @tparam T A floating-point scalar type - /// @see gluPerspective man page - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspective( - T fovy, T aspect, T near, T far); - - /// Builds a perspective projection matrix based on a field of view using right-handed coordinates. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @param fov Expressed in radians. - /// @param width Width of the viewport - /// @param height Height of the viewport - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovRH_ZO( - T fov, T width, T height, T near, T far); - - /// Builds a perspective projection matrix based on a field of view using right-handed coordinates. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @param fov Expressed in radians. - /// @param width Width of the viewport - /// @param height Height of the viewport - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovRH_NO( - T fov, T width, T height, T near, T far); - - /// Builds a perspective projection matrix based on a field of view using left-handed coordinates. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @param fov Expressed in radians. - /// @param width Width of the viewport - /// @param height Height of the viewport - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovLH_ZO( - T fov, T width, T height, T near, T far); - - /// Builds a perspective projection matrix based on a field of view using left-handed coordinates. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @param fov Expressed in radians. - /// @param width Width of the viewport - /// @param height Height of the viewport - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovLH_NO( - T fov, T width, T height, T near, T far); - - /// Builds a perspective projection matrix based on a field of view using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @param fov Expressed in radians. - /// @param width Width of the viewport - /// @param height Height of the viewport - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovZO( - T fov, T width, T height, T near, T far); - - /// Builds a perspective projection matrix based on a field of view using left-handed coordinates if GLM_FORCE_LEFT_HANDED if defined or right-handed coordinates otherwise. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @param fov Expressed in radians. - /// @param width Width of the viewport - /// @param height Height of the viewport - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovNO( - T fov, T width, T height, T near, T far); - - /// Builds a right handed perspective projection matrix based on a field of view. - /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @param fov Expressed in radians. - /// @param width Width of the viewport - /// @param height Height of the viewport - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovRH( - T fov, T width, T height, T near, T far); - - /// Builds a left handed perspective projection matrix based on a field of view. - /// If GLM_FORCE_DEPTH_ZERO_TO_ONE is defined, the near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// Otherwise, the near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @param fov Expressed in radians. - /// @param width Width of the viewport - /// @param height Height of the viewport - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovLH( - T fov, T width, T height, T near, T far); - - /// Builds a perspective projection matrix based on a field of view and the default handedness and default near and far clip planes definition. - /// To change default handedness use GLM_FORCE_LEFT_HANDED. To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. - /// - /// @param fov Expressed in radians. - /// @param width Width of the viewport - /// @param height Height of the viewport - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param far Specifies the distance from the viewer to the far clipping plane (always positive). - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFov( - T fov, T width, T height, T near, T far); - - /// Creates a matrix for a left handed, symmetric perspective-view frustum with far plane at infinite. - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspectiveLH( - T fovy, T aspect, T near); - - /// Creates a matrix for a right handed, symmetric perspective-view frustum with far plane at infinite. - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspectiveRH( - T fovy, T aspect, T near); - - /// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite with default handedness. - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspective( - T fovy, T aspect, T near); - - /// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping. - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> tweakedInfinitePerspective( - T fovy, T aspect, T near); - - /// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping. - /// - /// @param fovy Specifies the field of view angle, in degrees, in the y direction. Expressed in radians. - /// @param aspect Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height). - /// @param near Specifies the distance from the viewer to the near clipping plane (always positive). - /// @param ep Epsilon - /// - /// @tparam T A floating-point scalar type - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> tweakedInfinitePerspective( - T fovy, T aspect, T near, T ep); - - /// @} -}//namespace glm - -#include "matrix_clip_space.inl" diff --git a/3rdparty/glm/source/glm/ext/matrix_clip_space.inl b/3rdparty/glm/source/glm/ext/matrix_clip_space.inl deleted file mode 100644 index 7e4df33..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_clip_space.inl +++ /dev/null @@ -1,555 +0,0 @@ -namespace glm -{ - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> ortho(T left, T right, T bottom, T top) - { - mat<4, 4, T, defaultp> Result(static_cast(1)); - Result[0][0] = static_cast(2) / (right - left); - Result[1][1] = static_cast(2) / (top - bottom); - Result[2][2] = - static_cast(1); - Result[3][0] = - (right + left) / (right - left); - Result[3][1] = - (top + bottom) / (top - bottom); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoLH_ZO(T left, T right, T bottom, T top, T zNear, T zFar) - { - mat<4, 4, T, defaultp> Result(1); - Result[0][0] = static_cast(2) / (right - left); - Result[1][1] = static_cast(2) / (top - bottom); - Result[2][2] = static_cast(1) / (zFar - zNear); - Result[3][0] = - (right + left) / (right - left); - Result[3][1] = - (top + bottom) / (top - bottom); - Result[3][2] = - zNear / (zFar - zNear); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoLH_NO(T left, T right, T bottom, T top, T zNear, T zFar) - { - mat<4, 4, T, defaultp> Result(1); - Result[0][0] = static_cast(2) / (right - left); - Result[1][1] = static_cast(2) / (top - bottom); - Result[2][2] = static_cast(2) / (zFar - zNear); - Result[3][0] = - (right + left) / (right - left); - Result[3][1] = - (top + bottom) / (top - bottom); - Result[3][2] = - (zFar + zNear) / (zFar - zNear); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoRH_ZO(T left, T right, T bottom, T top, T zNear, T zFar) - { - mat<4, 4, T, defaultp> Result(1); - Result[0][0] = static_cast(2) / (right - left); - Result[1][1] = static_cast(2) / (top - bottom); - Result[2][2] = - static_cast(1) / (zFar - zNear); - Result[3][0] = - (right + left) / (right - left); - Result[3][1] = - (top + bottom) / (top - bottom); - Result[3][2] = - zNear / (zFar - zNear); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoRH_NO(T left, T right, T bottom, T top, T zNear, T zFar) - { - mat<4, 4, T, defaultp> Result(1); - Result[0][0] = static_cast(2) / (right - left); - Result[1][1] = static_cast(2) / (top - bottom); - Result[2][2] = - static_cast(2) / (zFar - zNear); - Result[3][0] = - (right + left) / (right - left); - Result[3][1] = - (top + bottom) / (top - bottom); - Result[3][2] = - (zFar + zNear) / (zFar - zNear); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoZO(T left, T right, T bottom, T top, T zNear, T zFar) - { -# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT - return orthoLH_ZO(left, right, bottom, top, zNear, zFar); -# else - return orthoRH_ZO(left, right, bottom, top, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoNO(T left, T right, T bottom, T top, T zNear, T zFar) - { -# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT - return orthoLH_NO(left, right, bottom, top, zNear, zFar); -# else - return orthoRH_NO(left, right, bottom, top, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoLH(T left, T right, T bottom, T top, T zNear, T zFar) - { -# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT - return orthoLH_ZO(left, right, bottom, top, zNear, zFar); -# else - return orthoLH_NO(left, right, bottom, top, zNear, zFar); -# endif - - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoRH(T left, T right, T bottom, T top, T zNear, T zFar) - { -# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT - return orthoRH_ZO(left, right, bottom, top, zNear, zFar); -# else - return orthoRH_NO(left, right, bottom, top, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> ortho(T left, T right, T bottom, T top, T zNear, T zFar) - { -# if GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO - return orthoLH_ZO(left, right, bottom, top, zNear, zFar); -# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO - return orthoLH_NO(left, right, bottom, top, zNear, zFar); -# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO - return orthoRH_ZO(left, right, bottom, top, zNear, zFar); -# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO - return orthoRH_NO(left, right, bottom, top, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumLH_ZO(T left, T right, T bottom, T top, T nearVal, T farVal) - { - mat<4, 4, T, defaultp> Result(0); - Result[0][0] = (static_cast(2) * nearVal) / (right - left); - Result[1][1] = (static_cast(2) * nearVal) / (top - bottom); - Result[2][0] = (right + left) / (right - left); - Result[2][1] = (top + bottom) / (top - bottom); - Result[2][2] = farVal / (farVal - nearVal); - Result[2][3] = static_cast(1); - Result[3][2] = -(farVal * nearVal) / (farVal - nearVal); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumLH_NO(T left, T right, T bottom, T top, T nearVal, T farVal) - { - mat<4, 4, T, defaultp> Result(0); - Result[0][0] = (static_cast(2) * nearVal) / (right - left); - Result[1][1] = (static_cast(2) * nearVal) / (top - bottom); - Result[2][0] = (right + left) / (right - left); - Result[2][1] = (top + bottom) / (top - bottom); - Result[2][2] = (farVal + nearVal) / (farVal - nearVal); - Result[2][3] = static_cast(1); - Result[3][2] = - (static_cast(2) * farVal * nearVal) / (farVal - nearVal); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumRH_ZO(T left, T right, T bottom, T top, T nearVal, T farVal) - { - mat<4, 4, T, defaultp> Result(0); - Result[0][0] = (static_cast(2) * nearVal) / (right - left); - Result[1][1] = (static_cast(2) * nearVal) / (top - bottom); - Result[2][0] = (right + left) / (right - left); - Result[2][1] = (top + bottom) / (top - bottom); - Result[2][2] = farVal / (nearVal - farVal); - Result[2][3] = static_cast(-1); - Result[3][2] = -(farVal * nearVal) / (farVal - nearVal); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumRH_NO(T left, T right, T bottom, T top, T nearVal, T farVal) - { - mat<4, 4, T, defaultp> Result(0); - Result[0][0] = (static_cast(2) * nearVal) / (right - left); - Result[1][1] = (static_cast(2) * nearVal) / (top - bottom); - Result[2][0] = (right + left) / (right - left); - Result[2][1] = (top + bottom) / (top - bottom); - Result[2][2] = - (farVal + nearVal) / (farVal - nearVal); - Result[2][3] = static_cast(-1); - Result[3][2] = - (static_cast(2) * farVal * nearVal) / (farVal - nearVal); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumZO(T left, T right, T bottom, T top, T nearVal, T farVal) - { -# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT - return frustumLH_ZO(left, right, bottom, top, nearVal, farVal); -# else - return frustumRH_ZO(left, right, bottom, top, nearVal, farVal); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumNO(T left, T right, T bottom, T top, T nearVal, T farVal) - { -# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT - return frustumLH_NO(left, right, bottom, top, nearVal, farVal); -# else - return frustumRH_NO(left, right, bottom, top, nearVal, farVal); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumLH(T left, T right, T bottom, T top, T nearVal, T farVal) - { -# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT - return frustumLH_ZO(left, right, bottom, top, nearVal, farVal); -# else - return frustumLH_NO(left, right, bottom, top, nearVal, farVal); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumRH(T left, T right, T bottom, T top, T nearVal, T farVal) - { -# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT - return frustumRH_ZO(left, right, bottom, top, nearVal, farVal); -# else - return frustumRH_NO(left, right, bottom, top, nearVal, farVal); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustum(T left, T right, T bottom, T top, T nearVal, T farVal) - { -# if GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO - return frustumLH_ZO(left, right, bottom, top, nearVal, farVal); -# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO - return frustumLH_NO(left, right, bottom, top, nearVal, farVal); -# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO - return frustumRH_ZO(left, right, bottom, top, nearVal, farVal); -# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO - return frustumRH_NO(left, right, bottom, top, nearVal, farVal); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveRH_ZO(T fovy, T aspect, T zNear, T zFar) - { - assert(abs(aspect - std::numeric_limits::epsilon()) > static_cast(0)); - - T const tanHalfFovy = tan(fovy / static_cast(2)); - - mat<4, 4, T, defaultp> Result(static_cast(0)); - Result[0][0] = static_cast(1) / (aspect * tanHalfFovy); - Result[1][1] = static_cast(1) / (tanHalfFovy); - Result[2][2] = zFar / (zNear - zFar); - Result[2][3] = - static_cast(1); - Result[3][2] = -(zFar * zNear) / (zFar - zNear); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveRH_NO(T fovy, T aspect, T zNear, T zFar) - { - assert(abs(aspect - std::numeric_limits::epsilon()) > static_cast(0)); - - T const tanHalfFovy = tan(fovy / static_cast(2)); - - mat<4, 4, T, defaultp> Result(static_cast(0)); - Result[0][0] = static_cast(1) / (aspect * tanHalfFovy); - Result[1][1] = static_cast(1) / (tanHalfFovy); - Result[2][2] = - (zFar + zNear) / (zFar - zNear); - Result[2][3] = - static_cast(1); - Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveLH_ZO(T fovy, T aspect, T zNear, T zFar) - { - assert(abs(aspect - std::numeric_limits::epsilon()) > static_cast(0)); - - T const tanHalfFovy = tan(fovy / static_cast(2)); - - mat<4, 4, T, defaultp> Result(static_cast(0)); - Result[0][0] = static_cast(1) / (aspect * tanHalfFovy); - Result[1][1] = static_cast(1) / (tanHalfFovy); - Result[2][2] = zFar / (zFar - zNear); - Result[2][3] = static_cast(1); - Result[3][2] = -(zFar * zNear) / (zFar - zNear); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveLH_NO(T fovy, T aspect, T zNear, T zFar) - { - assert(abs(aspect - std::numeric_limits::epsilon()) > static_cast(0)); - - T const tanHalfFovy = tan(fovy / static_cast(2)); - - mat<4, 4, T, defaultp> Result(static_cast(0)); - Result[0][0] = static_cast(1) / (aspect * tanHalfFovy); - Result[1][1] = static_cast(1) / (tanHalfFovy); - Result[2][2] = (zFar + zNear) / (zFar - zNear); - Result[2][3] = static_cast(1); - Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveZO(T fovy, T aspect, T zNear, T zFar) - { -# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT - return perspectiveLH_ZO(fovy, aspect, zNear, zFar); -# else - return perspectiveRH_ZO(fovy, aspect, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveNO(T fovy, T aspect, T zNear, T zFar) - { -# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT - return perspectiveLH_NO(fovy, aspect, zNear, zFar); -# else - return perspectiveRH_NO(fovy, aspect, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveLH(T fovy, T aspect, T zNear, T zFar) - { -# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT - return perspectiveLH_ZO(fovy, aspect, zNear, zFar); -# else - return perspectiveLH_NO(fovy, aspect, zNear, zFar); -# endif - - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveRH(T fovy, T aspect, T zNear, T zFar) - { -# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT - return perspectiveRH_ZO(fovy, aspect, zNear, zFar); -# else - return perspectiveRH_NO(fovy, aspect, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspective(T fovy, T aspect, T zNear, T zFar) - { -# if GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO - return perspectiveLH_ZO(fovy, aspect, zNear, zFar); -# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO - return perspectiveLH_NO(fovy, aspect, zNear, zFar); -# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO - return perspectiveRH_ZO(fovy, aspect, zNear, zFar); -# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO - return perspectiveRH_NO(fovy, aspect, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovRH_ZO(T fov, T width, T height, T zNear, T zFar) - { - assert(width > static_cast(0)); - assert(height > static_cast(0)); - assert(fov > static_cast(0)); - - T const rad = fov; - T const h = glm::cos(static_cast(0.5) * rad) / glm::sin(static_cast(0.5) * rad); - T const w = h * height / width; ///todo max(width , Height) / min(width , Height)? - - mat<4, 4, T, defaultp> Result(static_cast(0)); - Result[0][0] = w; - Result[1][1] = h; - Result[2][2] = zFar / (zNear - zFar); - Result[2][3] = - static_cast(1); - Result[3][2] = -(zFar * zNear) / (zFar - zNear); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovRH_NO(T fov, T width, T height, T zNear, T zFar) - { - assert(width > static_cast(0)); - assert(height > static_cast(0)); - assert(fov > static_cast(0)); - - T const rad = fov; - T const h = glm::cos(static_cast(0.5) * rad) / glm::sin(static_cast(0.5) * rad); - T const w = h * height / width; ///todo max(width , Height) / min(width , Height)? - - mat<4, 4, T, defaultp> Result(static_cast(0)); - Result[0][0] = w; - Result[1][1] = h; - Result[2][2] = - (zFar + zNear) / (zFar - zNear); - Result[2][3] = - static_cast(1); - Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovLH_ZO(T fov, T width, T height, T zNear, T zFar) - { - assert(width > static_cast(0)); - assert(height > static_cast(0)); - assert(fov > static_cast(0)); - - T const rad = fov; - T const h = glm::cos(static_cast(0.5) * rad) / glm::sin(static_cast(0.5) * rad); - T const w = h * height / width; ///todo max(width , Height) / min(width , Height)? - - mat<4, 4, T, defaultp> Result(static_cast(0)); - Result[0][0] = w; - Result[1][1] = h; - Result[2][2] = zFar / (zFar - zNear); - Result[2][3] = static_cast(1); - Result[3][2] = -(zFar * zNear) / (zFar - zNear); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovLH_NO(T fov, T width, T height, T zNear, T zFar) - { - assert(width > static_cast(0)); - assert(height > static_cast(0)); - assert(fov > static_cast(0)); - - T const rad = fov; - T const h = glm::cos(static_cast(0.5) * rad) / glm::sin(static_cast(0.5) * rad); - T const w = h * height / width; ///todo max(width , Height) / min(width , Height)? - - mat<4, 4, T, defaultp> Result(static_cast(0)); - Result[0][0] = w; - Result[1][1] = h; - Result[2][2] = (zFar + zNear) / (zFar - zNear); - Result[2][3] = static_cast(1); - Result[3][2] = - (static_cast(2) * zFar * zNear) / (zFar - zNear); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovZO(T fov, T width, T height, T zNear, T zFar) - { -# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT - return perspectiveFovLH_ZO(fov, width, height, zNear, zFar); -# else - return perspectiveFovRH_ZO(fov, width, height, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovNO(T fov, T width, T height, T zNear, T zFar) - { -# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT - return perspectiveFovLH_NO(fov, width, height, zNear, zFar); -# else - return perspectiveFovRH_NO(fov, width, height, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovLH(T fov, T width, T height, T zNear, T zFar) - { -# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT - return perspectiveFovLH_ZO(fov, width, height, zNear, zFar); -# else - return perspectiveFovLH_NO(fov, width, height, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovRH(T fov, T width, T height, T zNear, T zFar) - { -# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT - return perspectiveFovRH_ZO(fov, width, height, zNear, zFar); -# else - return perspectiveFovRH_NO(fov, width, height, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFov(T fov, T width, T height, T zNear, T zFar) - { -# if GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO - return perspectiveFovLH_ZO(fov, width, height, zNear, zFar); -# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO - return perspectiveFovLH_NO(fov, width, height, zNear, zFar); -# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO - return perspectiveFovRH_ZO(fov, width, height, zNear, zFar); -# elif GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO - return perspectiveFovRH_NO(fov, width, height, zNear, zFar); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspectiveRH(T fovy, T aspect, T zNear) - { - T const range = tan(fovy / static_cast(2)) * zNear; - T const left = -range * aspect; - T const right = range * aspect; - T const bottom = -range; - T const top = range; - - mat<4, 4, T, defaultp> Result(static_cast(0)); - Result[0][0] = (static_cast(2) * zNear) / (right - left); - Result[1][1] = (static_cast(2) * zNear) / (top - bottom); - Result[2][2] = - static_cast(1); - Result[2][3] = - static_cast(1); - Result[3][2] = - static_cast(2) * zNear; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspectiveLH(T fovy, T aspect, T zNear) - { - T const range = tan(fovy / static_cast(2)) * zNear; - T const left = -range * aspect; - T const right = range * aspect; - T const bottom = -range; - T const top = range; - - mat<4, 4, T, defaultp> Result(T(0)); - Result[0][0] = (static_cast(2) * zNear) / (right - left); - Result[1][1] = (static_cast(2) * zNear) / (top - bottom); - Result[2][2] = static_cast(1); - Result[2][3] = static_cast(1); - Result[3][2] = - static_cast(2) * zNear; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspective(T fovy, T aspect, T zNear) - { -# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT - return infinitePerspectiveLH(fovy, aspect, zNear); -# else - return infinitePerspectiveRH(fovy, aspect, zNear); -# endif - } - - // Infinite projection matrix: http://www.terathon.com/gdc07_lengyel.pdf - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> tweakedInfinitePerspective(T fovy, T aspect, T zNear, T ep) - { - T const range = tan(fovy / static_cast(2)) * zNear; - T const left = -range * aspect; - T const right = range * aspect; - T const bottom = -range; - T const top = range; - - mat<4, 4, T, defaultp> Result(static_cast(0)); - Result[0][0] = (static_cast(2) * zNear) / (right - left); - Result[1][1] = (static_cast(2) * zNear) / (top - bottom); - Result[2][2] = ep - static_cast(1); - Result[2][3] = static_cast(-1); - Result[3][2] = (ep - static_cast(2)) * zNear; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> tweakedInfinitePerspective(T fovy, T aspect, T zNear) - { - return tweakedInfinitePerspective(fovy, aspect, zNear, epsilon()); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_common.hpp b/3rdparty/glm/source/glm/ext/matrix_common.hpp deleted file mode 100644 index 05c3799..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_common.hpp +++ /dev/null @@ -1,36 +0,0 @@ -/// @ref ext_matrix_common -/// @file glm/ext/matrix_common.hpp -/// -/// @defgroup ext_matrix_common GLM_EXT_matrix_common -/// @ingroup ext -/// -/// Defines functions for common matrix operations. -/// -/// Include to use the features of this extension. -/// -/// @see ext_matrix_common - -#pragma once - -#include "../detail/qualifier.hpp" -#include "../detail/_fixes.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_transform extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_common - /// @{ - - template - GLM_FUNC_DECL mat mix(mat const& x, mat const& y, mat const& a); - - template - GLM_FUNC_DECL mat mix(mat const& x, mat const& y, U a); - - /// @} -}//namespace glm - -#include "matrix_common.inl" diff --git a/3rdparty/glm/source/glm/ext/matrix_common.inl b/3rdparty/glm/source/glm/ext/matrix_common.inl deleted file mode 100644 index 9d50848..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_common.inl +++ /dev/null @@ -1,16 +0,0 @@ -#include "../matrix.hpp" - -namespace glm -{ - template - GLM_FUNC_QUALIFIER mat mix(mat const& x, mat const& y, U a) - { - return mat(x) * (static_cast(1) - a) + mat(y) * a; - } - - template - GLM_FUNC_QUALIFIER mat mix(mat const& x, mat const& y, mat const& a) - { - return matrixCompMult(mat(x), static_cast(1) - a) + matrixCompMult(mat(y), a); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_double2x2.hpp b/3rdparty/glm/source/glm/ext/matrix_double2x2.hpp deleted file mode 100644 index 94dca54..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_double2x2.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_double2x2.hpp - -#pragma once -#include "../detail/type_mat2x2.hpp" - -namespace glm -{ - /// @addtogroup core_matrix - /// @{ - - /// 2 columns of 2 components matrix of double-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat<2, 2, double, defaultp> dmat2x2; - - /// 2 columns of 2 components matrix of double-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat<2, 2, double, defaultp> dmat2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_double2x2_precision.hpp b/3rdparty/glm/source/glm/ext/matrix_double2x2_precision.hpp deleted file mode 100644 index 9e2c174..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_double2x2_precision.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_double2x2_precision.hpp - -#pragma once -#include "../detail/type_mat2x2.hpp" - -namespace glm -{ - /// @addtogroup core_matrix_precision - /// @{ - - /// 2 columns of 2 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, double, lowp> lowp_dmat2; - - /// 2 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, double, mediump> mediump_dmat2; - - /// 2 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, double, highp> highp_dmat2; - - /// 2 columns of 2 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, double, lowp> lowp_dmat2x2; - - /// 2 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, double, mediump> mediump_dmat2x2; - - /// 2 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, double, highp> highp_dmat2x2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_double2x3.hpp b/3rdparty/glm/source/glm/ext/matrix_double2x3.hpp deleted file mode 100644 index bfef87a..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_double2x3.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_double2x3.hpp - -#pragma once -#include "../detail/type_mat2x3.hpp" - -namespace glm -{ - /// @addtogroup core_matrix - /// @{ - - /// 2 columns of 3 components matrix of double-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat<2, 3, double, defaultp> dmat2x3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_double2x3_precision.hpp b/3rdparty/glm/source/glm/ext/matrix_double2x3_precision.hpp deleted file mode 100644 index 098fb60..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_double2x3_precision.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_double2x3_precision.hpp - -#pragma once -#include "../detail/type_mat2x3.hpp" - -namespace glm -{ - /// @addtogroup core_matrix_precision - /// @{ - - /// 2 columns of 3 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 3, double, lowp> lowp_dmat2x3; - - /// 2 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 3, double, mediump> mediump_dmat2x3; - - /// 2 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 3, double, highp> highp_dmat2x3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_double2x4.hpp b/3rdparty/glm/source/glm/ext/matrix_double2x4.hpp deleted file mode 100644 index 499284b..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_double2x4.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_double2x4.hpp - -#pragma once -#include "../detail/type_mat2x4.hpp" - -namespace glm -{ - /// @addtogroup core_matrix - /// @{ - - /// 2 columns of 4 components matrix of double-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat<2, 4, double, defaultp> dmat2x4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_double2x4_precision.hpp b/3rdparty/glm/source/glm/ext/matrix_double2x4_precision.hpp deleted file mode 100644 index 9b61ebc..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_double2x4_precision.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_double2x4_precision.hpp - -#pragma once -#include "../detail/type_mat2x4.hpp" - -namespace glm -{ - /// @addtogroup core_matrix_precision - /// @{ - - /// 2 columns of 4 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 4, double, lowp> lowp_dmat2x4; - - /// 2 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 4, double, mediump> mediump_dmat2x4; - - /// 2 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 4, double, highp> highp_dmat2x4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_double3x2.hpp b/3rdparty/glm/source/glm/ext/matrix_double3x2.hpp deleted file mode 100644 index dd23f36..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_double3x2.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_double3x2.hpp - -#pragma once -#include "../detail/type_mat3x2.hpp" - -namespace glm -{ - /// @addtogroup core_matrix - /// @{ - - /// 3 columns of 2 components matrix of double-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat<3, 2, double, defaultp> dmat3x2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_double3x2_precision.hpp b/3rdparty/glm/source/glm/ext/matrix_double3x2_precision.hpp deleted file mode 100644 index 068d9e9..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_double3x2_precision.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_double3x2_precision.hpp - -#pragma once -#include "../detail/type_mat3x2.hpp" - -namespace glm -{ - /// @addtogroup core_matrix_precision - /// @{ - - /// 3 columns of 2 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 2, double, lowp> lowp_dmat3x2; - - /// 3 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 2, double, mediump> mediump_dmat3x2; - - /// 3 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 2, double, highp> highp_dmat3x2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_double3x3.hpp b/3rdparty/glm/source/glm/ext/matrix_double3x3.hpp deleted file mode 100644 index 53572b7..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_double3x3.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_double3x3.hpp - -#pragma once -#include "../detail/type_mat3x3.hpp" - -namespace glm -{ - /// @addtogroup core_matrix - /// @{ - - /// 3 columns of 3 components matrix of double-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat<3, 3, double, defaultp> dmat3x3; - - /// 3 columns of 3 components matrix of double-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat<3, 3, double, defaultp> dmat3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_double3x3_precision.hpp b/3rdparty/glm/source/glm/ext/matrix_double3x3_precision.hpp deleted file mode 100644 index 8691e78..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_double3x3_precision.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_double3x3_precision.hpp - -#pragma once -#include "../detail/type_mat3x3.hpp" - -namespace glm -{ - /// @addtogroup core_matrix_precision - /// @{ - - /// 3 columns of 3 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, double, lowp> lowp_dmat3; - - /// 3 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, double, mediump> mediump_dmat3; - - /// 3 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, double, highp> highp_dmat3; - - /// 3 columns of 3 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, double, lowp> lowp_dmat3x3; - - /// 3 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, double, mediump> mediump_dmat3x3; - - /// 3 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, double, highp> highp_dmat3x3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_double3x4.hpp b/3rdparty/glm/source/glm/ext/matrix_double3x4.hpp deleted file mode 100644 index c572d63..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_double3x4.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_double3x4.hpp - -#pragma once -#include "../detail/type_mat3x4.hpp" - -namespace glm -{ - /// @addtogroup core_matrix - /// @{ - - /// 3 columns of 4 components matrix of double-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat<3, 4, double, defaultp> dmat3x4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_double3x4_precision.hpp b/3rdparty/glm/source/glm/ext/matrix_double3x4_precision.hpp deleted file mode 100644 index f040217..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_double3x4_precision.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_double3x4_precision.hpp - -#pragma once -#include "../detail/type_mat3x4.hpp" - -namespace glm -{ - /// @addtogroup core_matrix_precision - /// @{ - - /// 3 columns of 4 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 4, double, lowp> lowp_dmat3x4; - - /// 3 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 4, double, mediump> mediump_dmat3x4; - - /// 3 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 4, double, highp> highp_dmat3x4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_double4x2.hpp b/3rdparty/glm/source/glm/ext/matrix_double4x2.hpp deleted file mode 100644 index 9b229f4..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_double4x2.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_double4x2.hpp - -#pragma once -#include "../detail/type_mat4x2.hpp" - -namespace glm -{ - /// @addtogroup core_matrix - /// @{ - - /// 4 columns of 2 components matrix of double-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat<4, 2, double, defaultp> dmat4x2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_double4x2_precision.hpp b/3rdparty/glm/source/glm/ext/matrix_double4x2_precision.hpp deleted file mode 100644 index 6ad18ba..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_double4x2_precision.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_double4x2_precision.hpp - -#pragma once -#include "../detail/type_mat4x2.hpp" - -namespace glm -{ - /// @addtogroup core_matrix_precision - /// @{ - - /// 4 columns of 2 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 2, double, lowp> lowp_dmat4x2; - - /// 4 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 2, double, mediump> mediump_dmat4x2; - - /// 4 columns of 2 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 2, double, highp> highp_dmat4x2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_double4x3.hpp b/3rdparty/glm/source/glm/ext/matrix_double4x3.hpp deleted file mode 100644 index dca4cf9..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_double4x3.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_double4x3.hpp - -#pragma once -#include "../detail/type_mat4x3.hpp" - -namespace glm -{ - /// @addtogroup core_matrix - /// @{ - - /// 4 columns of 3 components matrix of double-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat<4, 3, double, defaultp> dmat4x3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_double4x3_precision.hpp b/3rdparty/glm/source/glm/ext/matrix_double4x3_precision.hpp deleted file mode 100644 index f7371de..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_double4x3_precision.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_double4x3_precision.hpp - -#pragma once -#include "../detail/type_mat4x3.hpp" - -namespace glm -{ - /// @addtogroup core_matrix_precision - /// @{ - - /// 4 columns of 3 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 3, double, lowp> lowp_dmat4x3; - - /// 4 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 3, double, mediump> mediump_dmat4x3; - - /// 4 columns of 3 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 3, double, highp> highp_dmat4x3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_double4x4.hpp b/3rdparty/glm/source/glm/ext/matrix_double4x4.hpp deleted file mode 100644 index 81e1bf6..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_double4x4.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_double4x4.hpp - -#pragma once -#include "../detail/type_mat4x4.hpp" - -namespace glm -{ - /// @addtogroup core_matrix - /// @{ - - /// 4 columns of 4 components matrix of double-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat<4, 4, double, defaultp> dmat4x4; - - /// 4 columns of 4 components matrix of double-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat<4, 4, double, defaultp> dmat4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_double4x4_precision.hpp b/3rdparty/glm/source/glm/ext/matrix_double4x4_precision.hpp deleted file mode 100644 index 4c36a84..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_double4x4_precision.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_double4x4_precision.hpp - -#pragma once -#include "../detail/type_mat4x4.hpp" - -namespace glm -{ - /// @addtogroup core_matrix_precision - /// @{ - - /// 4 columns of 4 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, double, lowp> lowp_dmat4; - - /// 4 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, double, mediump> mediump_dmat4; - - /// 4 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, double, highp> highp_dmat4; - - /// 4 columns of 4 components matrix of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, double, lowp> lowp_dmat4x4; - - /// 4 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, double, mediump> mediump_dmat4x4; - - /// 4 columns of 4 components matrix of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, double, highp> highp_dmat4x4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_float2x2.hpp b/3rdparty/glm/source/glm/ext/matrix_float2x2.hpp deleted file mode 100644 index 53df921..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_float2x2.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_float2x2.hpp - -#pragma once -#include "../detail/type_mat2x2.hpp" - -namespace glm -{ - /// @addtogroup core_matrix - /// @{ - - /// 2 columns of 2 components matrix of single-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat<2, 2, float, defaultp> mat2x2; - - /// 2 columns of 2 components matrix of single-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat<2, 2, float, defaultp> mat2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_float2x2_precision.hpp b/3rdparty/glm/source/glm/ext/matrix_float2x2_precision.hpp deleted file mode 100644 index 898b6db..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_float2x2_precision.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_float2x2_precision.hpp - -#pragma once -#include "../detail/type_mat2x2.hpp" - -namespace glm -{ - /// @addtogroup core_matrix_precision - /// @{ - - /// 2 columns of 2 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, float, lowp> lowp_mat2; - - /// 2 columns of 2 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, float, mediump> mediump_mat2; - - /// 2 columns of 2 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, float, highp> highp_mat2; - - /// 2 columns of 2 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, float, lowp> lowp_mat2x2; - - /// 2 columns of 2 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, float, mediump> mediump_mat2x2; - - /// 2 columns of 2 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 2, float, highp> highp_mat2x2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_float2x3.hpp b/3rdparty/glm/source/glm/ext/matrix_float2x3.hpp deleted file mode 100644 index 6f68822..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_float2x3.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_float2x3.hpp - -#pragma once -#include "../detail/type_mat2x3.hpp" - -namespace glm -{ - /// @addtogroup core_matrix - /// @{ - - /// 2 columns of 3 components matrix of single-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat<2, 3, float, defaultp> mat2x3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_float2x3_precision.hpp b/3rdparty/glm/source/glm/ext/matrix_float2x3_precision.hpp deleted file mode 100644 index 50c1032..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_float2x3_precision.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_float2x3_precision.hpp - -#pragma once -#include "../detail/type_mat2x3.hpp" - -namespace glm -{ - /// @addtogroup core_matrix_precision - /// @{ - - /// 2 columns of 3 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 3, float, lowp> lowp_mat2x3; - - /// 2 columns of 3 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 3, float, mediump> mediump_mat2x3; - - /// 2 columns of 3 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 3, float, highp> highp_mat2x3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_float2x4.hpp b/3rdparty/glm/source/glm/ext/matrix_float2x4.hpp deleted file mode 100644 index 30f30de..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_float2x4.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_float2x4.hpp - -#pragma once -#include "../detail/type_mat2x4.hpp" - -namespace glm -{ - /// @addtogroup core_matrix - /// @{ - - /// 2 columns of 4 components matrix of single-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat<2, 4, float, defaultp> mat2x4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_float2x4_precision.hpp b/3rdparty/glm/source/glm/ext/matrix_float2x4_precision.hpp deleted file mode 100644 index 079d638..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_float2x4_precision.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_float2x4_precision.hpp - -#pragma once -#include "../detail/type_mat2x4.hpp" - -namespace glm -{ - /// @addtogroup core_matrix_precision - /// @{ - - /// 2 columns of 4 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 4, float, lowp> lowp_mat2x4; - - /// 2 columns of 4 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 4, float, mediump> mediump_mat2x4; - - /// 2 columns of 4 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<2, 4, float, highp> highp_mat2x4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_float3x2.hpp b/3rdparty/glm/source/glm/ext/matrix_float3x2.hpp deleted file mode 100644 index d39dd2f..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_float3x2.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_float3x2.hpp - -#pragma once -#include "../detail/type_mat3x2.hpp" - -namespace glm -{ - /// @addtogroup core - /// @{ - - /// 3 columns of 2 components matrix of single-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat<3, 2, float, defaultp> mat3x2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_float3x2_precision.hpp b/3rdparty/glm/source/glm/ext/matrix_float3x2_precision.hpp deleted file mode 100644 index 8572c2a..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_float3x2_precision.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_float3x2_precision.hpp - -#pragma once -#include "../detail/type_mat3x2.hpp" - -namespace glm -{ - /// @addtogroup core_matrix_precision - /// @{ - - /// 3 columns of 2 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 2, float, lowp> lowp_mat3x2; - - /// 3 columns of 2 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 2, float, mediump> mediump_mat3x2; - - /// 3 columns of 2 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 2, float, highp> highp_mat3x2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_float3x3.hpp b/3rdparty/glm/source/glm/ext/matrix_float3x3.hpp deleted file mode 100644 index 177d809..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_float3x3.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_float3x3.hpp - -#pragma once -#include "../detail/type_mat3x3.hpp" - -namespace glm -{ - /// @addtogroup core_matrix - /// @{ - - /// 3 columns of 3 components matrix of single-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat<3, 3, float, defaultp> mat3x3; - - /// 3 columns of 3 components matrix of single-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat<3, 3, float, defaultp> mat3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_float3x3_precision.hpp b/3rdparty/glm/source/glm/ext/matrix_float3x3_precision.hpp deleted file mode 100644 index 8a900c1..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_float3x3_precision.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_float3x3_precision.hpp - -#pragma once -#include "../detail/type_mat3x3.hpp" - -namespace glm -{ - /// @addtogroup core_matrix_precision - /// @{ - - /// 3 columns of 3 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, float, lowp> lowp_mat3; - - /// 3 columns of 3 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, float, mediump> mediump_mat3; - - /// 3 columns of 3 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, float, highp> highp_mat3; - - /// 3 columns of 3 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, float, lowp> lowp_mat3x3; - - /// 3 columns of 3 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, float, mediump> mediump_mat3x3; - - /// 3 columns of 3 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 3, float, highp> highp_mat3x3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_float3x4.hpp b/3rdparty/glm/source/glm/ext/matrix_float3x4.hpp deleted file mode 100644 index 64b8459..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_float3x4.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_float3x4.hpp - -#pragma once -#include "../detail/type_mat3x4.hpp" - -namespace glm -{ - /// @addtogroup core_matrix - /// @{ - - /// 3 columns of 4 components matrix of single-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat<3, 4, float, defaultp> mat3x4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_float3x4_precision.hpp b/3rdparty/glm/source/glm/ext/matrix_float3x4_precision.hpp deleted file mode 100644 index bc36bf1..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_float3x4_precision.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_float3x4_precision.hpp - -#pragma once -#include "../detail/type_mat3x4.hpp" - -namespace glm -{ - /// @addtogroup core_matrix_precision - /// @{ - - /// 3 columns of 4 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 4, float, lowp> lowp_mat3x4; - - /// 3 columns of 4 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 4, float, mediump> mediump_mat3x4; - - /// 3 columns of 4 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<3, 4, float, highp> highp_mat3x4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_float4x2.hpp b/3rdparty/glm/source/glm/ext/matrix_float4x2.hpp deleted file mode 100644 index 1ed5227..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_float4x2.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_float4x2.hpp - -#pragma once -#include "../detail/type_mat4x2.hpp" - -namespace glm -{ - /// @addtogroup core_matrix - /// @{ - - /// 4 columns of 2 components matrix of single-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat<4, 2, float, defaultp> mat4x2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_float4x2_precision.hpp b/3rdparty/glm/source/glm/ext/matrix_float4x2_precision.hpp deleted file mode 100644 index 88fd069..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_float4x2_precision.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_float2x2_precision.hpp - -#pragma once -#include "../detail/type_mat2x2.hpp" - -namespace glm -{ - /// @addtogroup core_matrix_precision - /// @{ - - /// 4 columns of 2 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 2, float, lowp> lowp_mat4x2; - - /// 4 columns of 2 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 2, float, mediump> mediump_mat4x2; - - /// 4 columns of 2 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 2, float, highp> highp_mat4x2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_float4x3.hpp b/3rdparty/glm/source/glm/ext/matrix_float4x3.hpp deleted file mode 100644 index 5dbe765..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_float4x3.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_float4x3.hpp - -#pragma once -#include "../detail/type_mat4x3.hpp" - -namespace glm -{ - /// @addtogroup core_matrix - /// @{ - - /// 4 columns of 3 components matrix of single-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat<4, 3, float, defaultp> mat4x3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_float4x3_precision.hpp b/3rdparty/glm/source/glm/ext/matrix_float4x3_precision.hpp deleted file mode 100644 index 846ed4f..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_float4x3_precision.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_float4x3_precision.hpp - -#pragma once -#include "../detail/type_mat4x3.hpp" - -namespace glm -{ - /// @addtogroup core_matrix_precision - /// @{ - - /// 4 columns of 3 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 3, float, lowp> lowp_mat4x3; - - /// 4 columns of 3 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 3, float, mediump> mediump_mat4x3; - - /// 4 columns of 3 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 3, float, highp> highp_mat4x3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_float4x4.hpp b/3rdparty/glm/source/glm/ext/matrix_float4x4.hpp deleted file mode 100644 index 5ba111d..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_float4x4.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_float4x4.hpp - -#pragma once -#include "../detail/type_mat4x4.hpp" - -namespace glm -{ - /// @ingroup core_matrix - /// @{ - - /// 4 columns of 4 components matrix of single-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat<4, 4, float, defaultp> mat4x4; - - /// 4 columns of 4 components matrix of single-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - typedef mat<4, 4, float, defaultp> mat4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_float4x4_precision.hpp b/3rdparty/glm/source/glm/ext/matrix_float4x4_precision.hpp deleted file mode 100644 index 597149b..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_float4x4_precision.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref core -/// @file glm/ext/matrix_float4x4_precision.hpp - -#pragma once -#include "../detail/type_mat4x4.hpp" - -namespace glm -{ - /// @addtogroup core_matrix_precision - /// @{ - - /// 4 columns of 4 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, float, lowp> lowp_mat4; - - /// 4 columns of 4 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, float, mediump> mediump_mat4; - - /// 4 columns of 4 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, float, highp> highp_mat4; - - /// 4 columns of 4 components matrix of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, float, lowp> lowp_mat4x4; - - /// 4 columns of 4 components matrix of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, float, mediump> mediump_mat4x4; - - /// 4 columns of 4 components matrix of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - /// - /// @see GLSL 4.20.8 specification, section 4.1.6 Matrices - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef mat<4, 4, float, highp> highp_mat4x4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_int2x2.hpp b/3rdparty/glm/source/glm/ext/matrix_int2x2.hpp deleted file mode 100644 index c6aa068..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_int2x2.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/// @ref ext_matrix_int2x2 -/// @file glm/ext/matrix_int2x2.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_int2x2 GLM_EXT_matrix_int2x2 -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat2x2.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_int2x2 extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_int2x2 - /// @{ - - /// Signed integer 2x2 matrix. - /// - /// @see ext_matrix_int2x2 - typedef mat<2, 2, int, defaultp> imat2x2; - - /// Signed integer 2x2 matrix. - /// - /// @see ext_matrix_int2x2 - typedef mat<2, 2, int, defaultp> imat2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_int2x2_sized.hpp b/3rdparty/glm/source/glm/ext/matrix_int2x2_sized.hpp deleted file mode 100644 index 70c0c21..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_int2x2_sized.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/// @ref ext_matrix_int2x2_sized -/// @file glm/ext/matrix_int2x2_sized.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_int2x2_sized GLM_EXT_matrix_int2x2_sized -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat2x2.hpp" -#include "../ext/scalar_int_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_int2x2_sized extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_int2x2_sized - /// @{ - - /// 8 bit signed integer 2x2 matrix. - /// - /// @see ext_matrix_int2x2_sized - typedef mat<2, 2, int8, defaultp> i8mat2x2; - - /// 16 bit signed integer 2x2 matrix. - /// - /// @see ext_matrix_int2x2_sized - typedef mat<2, 2, int16, defaultp> i16mat2x2; - - /// 32 bit signed integer 2x2 matrix. - /// - /// @see ext_matrix_int2x2_sized - typedef mat<2, 2, int32, defaultp> i32mat2x2; - - /// 64 bit signed integer 2x2 matrix. - /// - /// @see ext_matrix_int2x2_sized - typedef mat<2, 2, int64, defaultp> i64mat2x2; - - - /// 8 bit signed integer 2x2 matrix. - /// - /// @see ext_matrix_int2x2_sized - typedef mat<2, 2, int8, defaultp> i8mat2; - - /// 16 bit signed integer 2x2 matrix. - /// - /// @see ext_matrix_int2x2_sized - typedef mat<2, 2, int16, defaultp> i16mat2; - - /// 32 bit signed integer 2x2 matrix. - /// - /// @see ext_matrix_int2x2_sized - typedef mat<2, 2, int32, defaultp> i32mat2; - - /// 64 bit signed integer 2x2 matrix. - /// - /// @see ext_matrix_int2x2_sized - typedef mat<2, 2, int64, defaultp> i64mat2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_int2x3.hpp b/3rdparty/glm/source/glm/ext/matrix_int2x3.hpp deleted file mode 100644 index aee415c..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_int2x3.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/// @ref ext_matrix_int2x3 -/// @file glm/ext/matrix_int2x3.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_int2x3 GLM_EXT_matrix_int2x3 -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat2x3.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_int2x3 extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_int2x3 - /// @{ - - /// Signed integer 2x3 matrix. - /// - /// @see ext_matrix_int2x3 - typedef mat<2, 3, int, defaultp> imat2x3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_int2x3_sized.hpp b/3rdparty/glm/source/glm/ext/matrix_int2x3_sized.hpp deleted file mode 100644 index b5526fe..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_int2x3_sized.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref ext_matrix_int2x3_sized -/// @file glm/ext/matrix_int2x3_sized.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_int2x3_sized GLM_EXT_matrix_int2x3_sized -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat2x3.hpp" -#include "../ext/scalar_int_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_int2x3_sized extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_int2x3_sized - /// @{ - - /// 8 bit signed integer 2x3 matrix. - /// - /// @see ext_matrix_int2x3_sized - typedef mat<2, 3, int8, defaultp> i8mat2x3; - - /// 16 bit signed integer 2x3 matrix. - /// - /// @see ext_matrix_int2x3_sized - typedef mat<2, 3, int16, defaultp> i16mat2x3; - - /// 32 bit signed integer 2x3 matrix. - /// - /// @see ext_matrix_int2x3_sized - typedef mat<2, 3, int32, defaultp> i32mat2x3; - - /// 64 bit signed integer 2x3 matrix. - /// - /// @see ext_matrix_int2x3_sized - typedef mat<2, 3, int64, defaultp> i64mat2x3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_int2x4.hpp b/3rdparty/glm/source/glm/ext/matrix_int2x4.hpp deleted file mode 100644 index 4f36331..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_int2x4.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/// @ref ext_matrix_int2x4 -/// @file glm/ext/matrix_int2x4.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_int2x4 GLM_EXT_matrix_int2x4 -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat2x4.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_int2x4 extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_int2x4 - /// @{ - - /// Signed integer 2x4 matrix. - /// - /// @see ext_matrix_int2x4 - typedef mat<2, 4, int, defaultp> imat2x4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_int2x4_sized.hpp b/3rdparty/glm/source/glm/ext/matrix_int2x4_sized.hpp deleted file mode 100644 index a66a5e7..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_int2x4_sized.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref ext_matrix_int2x4_sized -/// @file glm/ext/matrix_int2x4_sized.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_int2x4_sized GLM_EXT_matrix_int2x4_sized -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat2x4.hpp" -#include "../ext/scalar_int_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_int2x4_sized extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_int2x4_sized - /// @{ - - /// 8 bit signed integer 2x4 matrix. - /// - /// @see ext_matrix_int2x4_sized - typedef mat<2, 4, int8, defaultp> i8mat2x4; - - /// 16 bit signed integer 2x4 matrix. - /// - /// @see ext_matrix_int2x4_sized - typedef mat<2, 4, int16, defaultp> i16mat2x4; - - /// 32 bit signed integer 2x4 matrix. - /// - /// @see ext_matrix_int2x4_sized - typedef mat<2, 4, int32, defaultp> i32mat2x4; - - /// 64 bit signed integer 2x4 matrix. - /// - /// @see ext_matrix_int2x4_sized - typedef mat<2, 4, int64, defaultp> i64mat2x4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_int3x2.hpp b/3rdparty/glm/source/glm/ext/matrix_int3x2.hpp deleted file mode 100644 index 3bd563b..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_int3x2.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/// @ref ext_matrix_int3x2 -/// @file glm/ext/matrix_int3x2.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_int3x2 GLM_EXT_matrix_int3x2 -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat3x2.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_int3x2 extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_int3x2 - /// @{ - - /// Signed integer 3x2 matrix. - /// - /// @see ext_matrix_int3x2 - typedef mat<3, 2, int, defaultp> imat3x2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_int3x2_sized.hpp b/3rdparty/glm/source/glm/ext/matrix_int3x2_sized.hpp deleted file mode 100644 index 7e34c52..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_int3x2_sized.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref ext_matrix_int3x2_sized -/// @file glm/ext/matrix_int3x2_sized.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_int3x2_sized GLM_EXT_matrix_int3x2_sized -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat3x2.hpp" -#include "../ext/scalar_int_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_int3x2_sized extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_int3x2_sized - /// @{ - - /// 8 bit signed integer 3x2 matrix. - /// - /// @see ext_matrix_int3x2_sized - typedef mat<3, 2, int8, defaultp> i8mat3x2; - - /// 16 bit signed integer 3x2 matrix. - /// - /// @see ext_matrix_int3x2_sized - typedef mat<3, 2, int16, defaultp> i16mat3x2; - - /// 32 bit signed integer 3x2 matrix. - /// - /// @see ext_matrix_int3x2_sized - typedef mat<3, 2, int32, defaultp> i32mat3x2; - - /// 64 bit signed integer 3x2 matrix. - /// - /// @see ext_matrix_int3x2_sized - typedef mat<3, 2, int64, defaultp> i64mat3x2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_int3x3.hpp b/3rdparty/glm/source/glm/ext/matrix_int3x3.hpp deleted file mode 100644 index 287488d..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_int3x3.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/// @ref ext_matrix_int3x3 -/// @file glm/ext/matrix_int3x3.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_int3x3 GLM_EXT_matrix_int3x3 -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat3x3.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_int3x3 extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_int3x3 - /// @{ - - /// Signed integer 3x3 matrix. - /// - /// @see ext_matrix_int3x3 - typedef mat<3, 3, int, defaultp> imat3x3; - - /// Signed integer 3x3 matrix. - /// - /// @see ext_matrix_int3x3 - typedef mat<3, 3, int, defaultp> imat3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_int3x3_sized.hpp b/3rdparty/glm/source/glm/ext/matrix_int3x3_sized.hpp deleted file mode 100644 index 577e305..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_int3x3_sized.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/// @ref ext_matrix_int3x3_sized -/// @file glm/ext/matrix_int3x3_sized.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_int3x3_sized GLM_EXT_matrix_int3x3_sized -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat3x3.hpp" -#include "../ext/scalar_int_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_int3x3_sized extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_int3x3_sized - /// @{ - - /// 8 bit signed integer 3x3 matrix. - /// - /// @see ext_matrix_int3x3_sized - typedef mat<3, 3, int8, defaultp> i8mat3x3; - - /// 16 bit signed integer 3x3 matrix. - /// - /// @see ext_matrix_int3x3_sized - typedef mat<3, 3, int16, defaultp> i16mat3x3; - - /// 32 bit signed integer 3x3 matrix. - /// - /// @see ext_matrix_int3x3_sized - typedef mat<3, 3, int32, defaultp> i32mat3x3; - - /// 64 bit signed integer 3x3 matrix. - /// - /// @see ext_matrix_int3x3_sized - typedef mat<3, 3, int64, defaultp> i64mat3x3; - - - /// 8 bit signed integer 3x3 matrix. - /// - /// @see ext_matrix_int3x3_sized - typedef mat<3, 3, int8, defaultp> i8mat3; - - /// 16 bit signed integer 3x3 matrix. - /// - /// @see ext_matrix_int3x3_sized - typedef mat<3, 3, int16, defaultp> i16mat3; - - /// 32 bit signed integer 3x3 matrix. - /// - /// @see ext_matrix_int3x3_sized - typedef mat<3, 3, int32, defaultp> i32mat3; - - /// 64 bit signed integer 3x3 matrix. - /// - /// @see ext_matrix_int3x3_sized - typedef mat<3, 3, int64, defaultp> i64mat3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_int3x4.hpp b/3rdparty/glm/source/glm/ext/matrix_int3x4.hpp deleted file mode 100644 index 08e534d..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_int3x4.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/// @ref ext_matrix_int3x4 -/// @file glm/ext/matrix_int3x4.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_int3x4 GLM_EXT_matrix_int3x4 -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat3x4.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_int3x4 extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_int3x4 - /// @{ - - /// Signed integer 3x4 matrix. - /// - /// @see ext_matrix_int3x4 - typedef mat<3, 4, int, defaultp> imat3x4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_int3x4_sized.hpp b/3rdparty/glm/source/glm/ext/matrix_int3x4_sized.hpp deleted file mode 100644 index 692c48c..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_int3x4_sized.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref ext_matrix_int3x4_sized -/// @file glm/ext/matrix_int3x2_sized.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_int3x4_sized GLM_EXT_matrix_int3x4_sized -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat3x4.hpp" -#include "../ext/scalar_int_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_int3x4_sized extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_int3x4_sized - /// @{ - - /// 8 bit signed integer 3x4 matrix. - /// - /// @see ext_matrix_int3x4_sized - typedef mat<3, 4, int8, defaultp> i8mat3x4; - - /// 16 bit signed integer 3x4 matrix. - /// - /// @see ext_matrix_int3x4_sized - typedef mat<3, 4, int16, defaultp> i16mat3x4; - - /// 32 bit signed integer 3x4 matrix. - /// - /// @see ext_matrix_int3x4_sized - typedef mat<3, 4, int32, defaultp> i32mat3x4; - - /// 64 bit signed integer 3x4 matrix. - /// - /// @see ext_matrix_int3x4_sized - typedef mat<3, 4, int64, defaultp> i64mat3x4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_int4x2.hpp b/3rdparty/glm/source/glm/ext/matrix_int4x2.hpp deleted file mode 100644 index f756ef2..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_int4x2.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/// @ref ext_matrix_int4x2 -/// @file glm/ext/matrix_int4x2.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_int4x2 GLM_EXT_matrix_int4x2 -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat4x2.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_int4x2 extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_int4x2 - /// @{ - - /// Signed integer 4x2 matrix. - /// - /// @see ext_matrix_int4x2 - typedef mat<4, 2, int, defaultp> imat4x2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_int4x2_sized.hpp b/3rdparty/glm/source/glm/ext/matrix_int4x2_sized.hpp deleted file mode 100644 index 63a99d6..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_int4x2_sized.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref ext_matrix_int4x2_sized -/// @file glm/ext/matrix_int4x2_sized.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_int4x2_sized GLM_EXT_matrix_int4x2_sized -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat4x2.hpp" -#include "../ext/scalar_int_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_int4x2_sized extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_int4x2_sized - /// @{ - - /// 8 bit signed integer 4x2 matrix. - /// - /// @see ext_matrix_int4x2_sized - typedef mat<4, 2, int8, defaultp> i8mat4x2; - - /// 16 bit signed integer 4x2 matrix. - /// - /// @see ext_matrix_int4x2_sized - typedef mat<4, 2, int16, defaultp> i16mat4x2; - - /// 32 bit signed integer 4x2 matrix. - /// - /// @see ext_matrix_int4x2_sized - typedef mat<4, 2, int32, defaultp> i32mat4x2; - - /// 64 bit signed integer 4x2 matrix. - /// - /// @see ext_matrix_int4x2_sized - typedef mat<4, 2, int64, defaultp> i64mat4x2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_int4x3.hpp b/3rdparty/glm/source/glm/ext/matrix_int4x3.hpp deleted file mode 100644 index d5d97a7..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_int4x3.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/// @ref ext_matrix_int4x3 -/// @file glm/ext/matrix_int4x3.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_int4x3 GLM_EXT_matrix_int4x3 -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat4x3.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_int4x3 extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_int4x3 - /// @{ - - /// Signed integer 4x3 matrix. - /// - /// @see ext_matrix_int4x3 - typedef mat<4, 3, int, defaultp> imat4x3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_int4x3_sized.hpp b/3rdparty/glm/source/glm/ext/matrix_int4x3_sized.hpp deleted file mode 100644 index 55078fa..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_int4x3_sized.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref ext_matrix_int4x3_sized -/// @file glm/ext/matrix_int4x3_sized.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_int4x3_sized GLM_EXT_matrix_int4x3_sized -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat4x3.hpp" -#include "../ext/scalar_int_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_int4x3_sized extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_int4x3_sized - /// @{ - - /// 8 bit signed integer 4x3 matrix. - /// - /// @see ext_matrix_int4x3_sized - typedef mat<4, 3, int8, defaultp> i8mat4x3; - - /// 16 bit signed integer 4x3 matrix. - /// - /// @see ext_matrix_int4x3_sized - typedef mat<4, 3, int16, defaultp> i16mat4x3; - - /// 32 bit signed integer 4x3 matrix. - /// - /// @see ext_matrix_int4x3_sized - typedef mat<4, 3, int32, defaultp> i32mat4x3; - - /// 64 bit signed integer 4x3 matrix. - /// - /// @see ext_matrix_int4x3_sized - typedef mat<4, 3, int64, defaultp> i64mat4x3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_int4x4.hpp b/3rdparty/glm/source/glm/ext/matrix_int4x4.hpp deleted file mode 100644 index e17cff1..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_int4x4.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/// @ref ext_matrix_int4x4 -/// @file glm/ext/matrix_int4x4.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_int4x4 GLM_EXT_matrix_int4x4 -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat4x4.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_int4x4 extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_int4x4 - /// @{ - - /// Signed integer 4x4 matrix. - /// - /// @see ext_matrix_int4x4 - typedef mat<4, 4, int, defaultp> imat4x4; - - /// Signed integer 4x4 matrix. - /// - /// @see ext_matrix_int4x4 - typedef mat<4, 4, int, defaultp> imat4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_int4x4_sized.hpp b/3rdparty/glm/source/glm/ext/matrix_int4x4_sized.hpp deleted file mode 100644 index 4a11203..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_int4x4_sized.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/// @ref ext_matrix_int4x4_sized -/// @file glm/ext/matrix_int4x4_sized.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_int4x4_sized GLM_EXT_matrix_int4x4_sized -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat4x4.hpp" -#include "../ext/scalar_int_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_int4x4_sized extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_int4x4_sized - /// @{ - - /// 8 bit signed integer 4x4 matrix. - /// - /// @see ext_matrix_int4x4_sized - typedef mat<4, 4, int8, defaultp> i8mat4x4; - - /// 16 bit signed integer 4x4 matrix. - /// - /// @see ext_matrix_int4x4_sized - typedef mat<4, 4, int16, defaultp> i16mat4x4; - - /// 32 bit signed integer 4x4 matrix. - /// - /// @see ext_matrix_int4x4_sized - typedef mat<4, 4, int32, defaultp> i32mat4x4; - - /// 64 bit signed integer 4x4 matrix. - /// - /// @see ext_matrix_int4x4_sized - typedef mat<4, 4, int64, defaultp> i64mat4x4; - - - /// 8 bit signed integer 4x4 matrix. - /// - /// @see ext_matrix_int4x4_sized - typedef mat<4, 4, int8, defaultp> i8mat4; - - /// 16 bit signed integer 4x4 matrix. - /// - /// @see ext_matrix_int4x4_sized - typedef mat<4, 4, int16, defaultp> i16mat4; - - /// 32 bit signed integer 4x4 matrix. - /// - /// @see ext_matrix_int4x4_sized - typedef mat<4, 4, int32, defaultp> i32mat4; - - /// 64 bit signed integer 4x4 matrix. - /// - /// @see ext_matrix_int4x4_sized - typedef mat<4, 4, int64, defaultp> i64mat4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_integer.hpp b/3rdparty/glm/source/glm/ext/matrix_integer.hpp deleted file mode 100644 index 7d7dfc5..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_integer.hpp +++ /dev/null @@ -1,91 +0,0 @@ -/// @ref ext_matrix_integer -/// @file glm/ext/matrix_integer.hpp -/// -/// @defgroup ext_matrix_integer GLM_EXT_matrix_integer -/// @ingroup ext -/// -/// Defines functions that generate common transformation matrices. -/// -/// The matrices generated by this extension use standard OpenGL fixed-function -/// conventions. For example, the lookAt function generates a transform from world -/// space into the specific eye space that the projective matrix functions -/// (perspective, ortho, etc) are designed to expect. The OpenGL compatibility -/// specifications defines the particular layout of this eye space. -/// -/// Include to use the features of this extension. -/// -/// @see ext_matrix_projection -/// @see ext_matrix_clip_space - -#pragma once - -// Dependencies -#include "../gtc/constants.hpp" -#include "../geometric.hpp" -#include "../trigonometric.hpp" -#include "../matrix.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_integer extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_integer - /// @{ - - /// Multiply matrix x by matrix y component-wise, i.e., - /// result[i][j] is the scalar product of x[i][j] and y[i][j]. - /// - /// @tparam C Integer between 1 and 4 included that qualify the number a column - /// @tparam R Integer between 1 and 4 included that qualify the number a row - /// @tparam T Floating-point or signed integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL matrixCompMult man page - /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions - template - GLM_FUNC_DECL mat matrixCompMult(mat const& x, mat const& y); - - /// Treats the first parameter c as a column vector - /// and the second parameter r as a row vector - /// and does a linear algebraic matrix multiply c * r. - /// - /// @tparam C Integer between 1 and 4 included that qualify the number a column - /// @tparam R Integer between 1 and 4 included that qualify the number a row - /// @tparam T Floating-point or signed integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL outerProduct man page - /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions - template - GLM_FUNC_DECL typename detail::outerProduct_trait::type outerProduct(vec const& c, vec const& r); - - /// Returns the transposed matrix of x - /// - /// @tparam C Integer between 1 and 4 included that qualify the number a column - /// @tparam R Integer between 1 and 4 included that qualify the number a row - /// @tparam T Floating-point or signed integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL transpose man page - /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions - template - GLM_FUNC_DECL typename mat::transpose_type transpose(mat const& x); - - /// Return the determinant of a squared matrix. - /// - /// @tparam C Integer between 1 and 4 included that qualify the number a column - /// @tparam R Integer between 1 and 4 included that qualify the number a row - /// @tparam T Floating-point or signed integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL determinant man page - /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions - template - GLM_FUNC_DECL T determinant(mat const& m); - - /// @} -}//namespace glm - -#include "matrix_integer.inl" diff --git a/3rdparty/glm/source/glm/ext/matrix_integer.inl b/3rdparty/glm/source/glm/ext/matrix_integer.inl deleted file mode 100644 index 8b377ce..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_integer.inl +++ /dev/null @@ -1,38 +0,0 @@ -namespace glm{ -namespace detail -{ - template - struct compute_matrixCompMult_type { - GLM_FUNC_QUALIFIER static mat call(mat const& x, mat const& y) - { - return detail::compute_matrixCompMult::value>::call(x, y); - } - }; - - template - struct compute_outerProduct_type { - GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait::type call(vec const& c, vec const& r) - { - return detail::compute_outerProduct::call(c, r); - } - }; - - template - struct compute_transpose_type - { - GLM_FUNC_QUALIFIER static mat call(mat const& m) - { - return detail::compute_transpose::value>::call(m); - } - }; - - template - struct compute_determinant_type{ - - GLM_FUNC_QUALIFIER static T call(mat const& m) - { - return detail::compute_determinant::value>::call(m); - } - }; -}//namespace detail -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_projection.hpp b/3rdparty/glm/source/glm/ext/matrix_projection.hpp deleted file mode 100644 index 51fd01b..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_projection.hpp +++ /dev/null @@ -1,149 +0,0 @@ -/// @ref ext_matrix_projection -/// @file glm/ext/matrix_projection.hpp -/// -/// @defgroup ext_matrix_projection GLM_EXT_matrix_projection -/// @ingroup ext -/// -/// Functions that generate common projection transformation matrices. -/// -/// The matrices generated by this extension use standard OpenGL fixed-function -/// conventions. For example, the lookAt function generates a transform from world -/// space into the specific eye space that the projective matrix functions -/// (perspective, ortho, etc) are designed to expect. The OpenGL compatibility -/// specifications defines the particular layout of this eye space. -/// -/// Include to use the features of this extension. -/// -/// @see ext_matrix_transform -/// @see ext_matrix_clip_space - -#pragma once - -// Dependencies -#include "../gtc/constants.hpp" -#include "../geometric.hpp" -#include "../trigonometric.hpp" -#include "../matrix.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_projection extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_projection - /// @{ - - /// Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @param obj Specify the object coordinates. - /// @param model Specifies the current modelview matrix - /// @param proj Specifies the current projection matrix - /// @param viewport Specifies the current viewport - /// @return Return the computed window coordinates. - /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. - /// @tparam U Currently supported: Floating-point types and integer types. - /// - /// @see gluProject man page - template - GLM_FUNC_DECL vec<3, T, Q> projectZO( - vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); - - /// Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @param obj Specify the object coordinates. - /// @param model Specifies the current modelview matrix - /// @param proj Specifies the current projection matrix - /// @param viewport Specifies the current viewport - /// @return Return the computed window coordinates. - /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. - /// @tparam U Currently supported: Floating-point types and integer types. - /// - /// @see gluProject man page - template - GLM_FUNC_DECL vec<3, T, Q> projectNO( - vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); - - /// Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates using default near and far clip planes definition. - /// To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. - /// - /// @param obj Specify the object coordinates. - /// @param model Specifies the current modelview matrix - /// @param proj Specifies the current projection matrix - /// @param viewport Specifies the current viewport - /// @return Return the computed window coordinates. - /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. - /// @tparam U Currently supported: Floating-point types and integer types. - /// - /// @see gluProject man page - template - GLM_FUNC_DECL vec<3, T, Q> project( - vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); - - /// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates. - /// The near and far clip planes correspond to z normalized device coordinates of 0 and +1 respectively. (Direct3D clip volume definition) - /// - /// @param win Specify the window coordinates to be mapped. - /// @param model Specifies the modelview matrix - /// @param proj Specifies the projection matrix - /// @param viewport Specifies the viewport - /// @return Returns the computed object coordinates. - /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. - /// @tparam U Currently supported: Floating-point types and integer types. - /// - /// @see gluUnProject man page - template - GLM_FUNC_DECL vec<3, T, Q> unProjectZO( - vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); - - /// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates. - /// The near and far clip planes correspond to z normalized device coordinates of -1 and +1 respectively. (OpenGL clip volume definition) - /// - /// @param win Specify the window coordinates to be mapped. - /// @param model Specifies the modelview matrix - /// @param proj Specifies the projection matrix - /// @param viewport Specifies the viewport - /// @return Returns the computed object coordinates. - /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. - /// @tparam U Currently supported: Floating-point types and integer types. - /// - /// @see gluUnProject man page - template - GLM_FUNC_DECL vec<3, T, Q> unProjectNO( - vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); - - /// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates using default near and far clip planes definition. - /// To change default near and far clip planes definition use GLM_FORCE_DEPTH_ZERO_TO_ONE. - /// - /// @param win Specify the window coordinates to be mapped. - /// @param model Specifies the modelview matrix - /// @param proj Specifies the projection matrix - /// @param viewport Specifies the viewport - /// @return Returns the computed object coordinates. - /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. - /// @tparam U Currently supported: Floating-point types and integer types. - /// - /// @see gluUnProject man page - template - GLM_FUNC_DECL vec<3, T, Q> unProject( - vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport); - - /// Define a picking region - /// - /// @param center Specify the center of a picking region in window coordinates. - /// @param delta Specify the width and height, respectively, of the picking region in window coordinates. - /// @param viewport Rendering viewport - /// @tparam T Native type used for the computation. Currently supported: half (not recommended), float or double. - /// @tparam U Currently supported: Floating-point types and integer types. - /// - /// @see gluPickMatrix man page - template - GLM_FUNC_DECL mat<4, 4, T, Q> pickMatrix( - vec<2, T, Q> const& center, vec<2, T, Q> const& delta, vec<4, U, Q> const& viewport); - - /// @} -}//namespace glm - -#include "matrix_projection.inl" diff --git a/3rdparty/glm/source/glm/ext/matrix_projection.inl b/3rdparty/glm/source/glm/ext/matrix_projection.inl deleted file mode 100644 index 2f2c196..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_projection.inl +++ /dev/null @@ -1,106 +0,0 @@ -namespace glm -{ - template - GLM_FUNC_QUALIFIER vec<3, T, Q> projectZO(vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) - { - vec<4, T, Q> tmp = vec<4, T, Q>(obj, static_cast(1)); - tmp = model * tmp; - tmp = proj * tmp; - - tmp /= tmp.w; - tmp.x = tmp.x * static_cast(0.5) + static_cast(0.5); - tmp.y = tmp.y * static_cast(0.5) + static_cast(0.5); - - tmp[0] = tmp[0] * T(viewport[2]) + T(viewport[0]); - tmp[1] = tmp[1] * T(viewport[3]) + T(viewport[1]); - - return vec<3, T, Q>(tmp); - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> projectNO(vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) - { - vec<4, T, Q> tmp = vec<4, T, Q>(obj, static_cast(1)); - tmp = model * tmp; - tmp = proj * tmp; - - tmp /= tmp.w; - tmp = tmp * static_cast(0.5) + static_cast(0.5); - tmp[0] = tmp[0] * T(viewport[2]) + T(viewport[0]); - tmp[1] = tmp[1] * T(viewport[3]) + T(viewport[1]); - - return vec<3, T, Q>(tmp); - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> project(vec<3, T, Q> const& obj, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) - { -# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT - return projectZO(obj, model, proj, viewport); -# else - return projectNO(obj, model, proj, viewport); -# endif - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> unProjectZO(vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) - { - mat<4, 4, T, Q> Inverse = inverse(proj * model); - - vec<4, T, Q> tmp = vec<4, T, Q>(win, T(1)); - tmp.x = (tmp.x - T(viewport[0])) / T(viewport[2]); - tmp.y = (tmp.y - T(viewport[1])) / T(viewport[3]); - tmp.x = tmp.x * static_cast(2) - static_cast(1); - tmp.y = tmp.y * static_cast(2) - static_cast(1); - - vec<4, T, Q> obj = Inverse * tmp; - obj /= obj.w; - - return vec<3, T, Q>(obj); - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> unProjectNO(vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) - { - mat<4, 4, T, Q> Inverse = inverse(proj * model); - - vec<4, T, Q> tmp = vec<4, T, Q>(win, T(1)); - tmp.x = (tmp.x - T(viewport[0])) / T(viewport[2]); - tmp.y = (tmp.y - T(viewport[1])) / T(viewport[3]); - tmp = tmp * static_cast(2) - static_cast(1); - - vec<4, T, Q> obj = Inverse * tmp; - obj /= obj.w; - - return vec<3, T, Q>(obj); - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> unProject(vec<3, T, Q> const& win, mat<4, 4, T, Q> const& model, mat<4, 4, T, Q> const& proj, vec<4, U, Q> const& viewport) - { -# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_ZO_BIT - return unProjectZO(win, model, proj, viewport); -# else - return unProjectNO(win, model, proj, viewport); -# endif - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> pickMatrix(vec<2, T, Q> const& center, vec<2, T, Q> const& delta, vec<4, U, Q> const& viewport) - { - assert(delta.x > static_cast(0) && delta.y > static_cast(0)); - mat<4, 4, T, Q> Result(static_cast(1)); - - if(!(delta.x > static_cast(0) && delta.y > static_cast(0))) - return Result; // Error - - vec<3, T, Q> Temp( - (static_cast(viewport[2]) - static_cast(2) * (center.x - static_cast(viewport[0]))) / delta.x, - (static_cast(viewport[3]) - static_cast(2) * (center.y - static_cast(viewport[1]))) / delta.y, - static_cast(0)); - - // Translate and scale the picked region to the entire window - Result = translate(Result, Temp); - return scale(Result, vec<3, T, Q>(static_cast(viewport[2]) / delta.x, static_cast(viewport[3]) / delta.y, static_cast(1))); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_relational.hpp b/3rdparty/glm/source/glm/ext/matrix_relational.hpp deleted file mode 100644 index 20023ad..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_relational.hpp +++ /dev/null @@ -1,132 +0,0 @@ -/// @ref ext_matrix_relational -/// @file glm/ext/matrix_relational.hpp -/// -/// @defgroup ext_matrix_relational GLM_EXT_matrix_relational -/// @ingroup ext -/// -/// Exposes comparison functions for matrix types that take a user defined epsilon values. -/// -/// Include to use the features of this extension. -/// -/// @see ext_vector_relational -/// @see ext_scalar_relational -/// @see ext_quaternion_relational - -#pragma once - -// Dependencies -#include "../detail/qualifier.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_relational extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_relational - /// @{ - - /// Perform a component-wise equal-to comparison of two matrices. - /// Return a boolean vector which components value is True if this expression is satisfied per column of the matrices. - /// - /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix - /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL GLM_CONSTEXPR vec equal(mat const& x, mat const& y); - - /// Perform a component-wise not-equal-to comparison of two matrices. - /// Return a boolean vector which components value is True if this expression is satisfied per column of the matrices. - /// - /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix - /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(mat const& x, mat const& y); - - /// Returns the component-wise comparison of |x - y| < epsilon. - /// True if this expression is satisfied. - /// - /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix - /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL GLM_CONSTEXPR vec equal(mat const& x, mat const& y, T epsilon); - - /// Returns the component-wise comparison of |x - y| < epsilon. - /// True if this expression is satisfied. - /// - /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix - /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL GLM_CONSTEXPR vec equal(mat const& x, mat const& y, vec const& epsilon); - - /// Returns the component-wise comparison of |x - y| < epsilon. - /// True if this expression is not satisfied. - /// - /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix - /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(mat const& x, mat const& y, T epsilon); - - /// Returns the component-wise comparison of |x - y| >= epsilon. - /// True if this expression is not satisfied. - /// - /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix - /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(mat const& x, mat const& y, vec const& epsilon); - - /// Returns the component-wise comparison between two vectors in term of ULPs. - /// True if this expression is satisfied. - /// - /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix - /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix - /// @tparam T Floating-point - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL GLM_CONSTEXPR vec equal(mat const& x, mat const& y, int ULPs); - - /// Returns the component-wise comparison between two vectors in term of ULPs. - /// True if this expression is satisfied. - /// - /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix - /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix - /// @tparam T Floating-point - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL GLM_CONSTEXPR vec equal(mat const& x, mat const& y, vec const& ULPs); - - /// Returns the component-wise comparison between two vectors in term of ULPs. - /// True if this expression is not satisfied. - /// - /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix - /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix - /// @tparam T Floating-point - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(mat const& x, mat const& y, int ULPs); - - /// Returns the component-wise comparison between two vectors in term of ULPs. - /// True if this expression is not satisfied. - /// - /// @tparam C Integer between 1 and 4 included that qualify the number of columns of the matrix - /// @tparam R Integer between 1 and 4 included that qualify the number of rows of the matrix - /// @tparam T Floating-point - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(mat const& x, mat const& y, vec const& ULPs); - - /// @} -}//namespace glm - -#include "matrix_relational.inl" diff --git a/3rdparty/glm/source/glm/ext/matrix_relational.inl b/3rdparty/glm/source/glm/ext/matrix_relational.inl deleted file mode 100644 index 9cd42b7..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_relational.inl +++ /dev/null @@ -1,88 +0,0 @@ -/// @ref ext_vector_relational -/// @file glm/ext/vector_relational.inl - -// Dependency: -#include "../ext/vector_relational.hpp" -#include "../common.hpp" - -namespace glm -{ - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(mat const& a, mat const& b) - { - vec Result(true); - for(length_t i = 0; i < C; ++i) - Result[i] = all(equal(a[i], b[i])); - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(mat const& a, mat const& b, T Epsilon) - { - return equal(a, b, vec(Epsilon)); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(mat const& a, mat const& b, vec const& Epsilon) - { - vec Result(true); - for(length_t i = 0; i < C; ++i) - Result[i] = all(equal(a[i], b[i], Epsilon[i])); - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(mat const& a, mat const& b) - { - vec Result(true); - for(length_t i = 0; i < C; ++i) - Result[i] = any(notEqual(a[i], b[i])); - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(mat const& a, mat const& b, T Epsilon) - { - return notEqual(a, b, vec(Epsilon)); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(mat const& a, mat const& b, vec const& Epsilon) - { - vec Result(true); - for(length_t i = 0; i < C; ++i) - Result[i] = any(notEqual(a[i], b[i], Epsilon[i])); - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(mat const& a, mat const& b, int MaxULPs) - { - return equal(a, b, vec(MaxULPs)); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(mat const& a, mat const& b, vec const& MaxULPs) - { - vec Result(true); - for(length_t i = 0; i < C; ++i) - Result[i] = all(equal(a[i], b[i], MaxULPs[i])); - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(mat const& a, mat const& b, int MaxULPs) - { - return notEqual(a, b, vec(MaxULPs)); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(mat const& a, mat const& b, vec const& MaxULPs) - { - vec Result(true); - for(length_t i = 0; i < C; ++i) - Result[i] = any(notEqual(a[i], b[i], MaxULPs[i])); - return Result; - } - -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_transform.hpp b/3rdparty/glm/source/glm/ext/matrix_transform.hpp deleted file mode 100644 index cbd187e..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_transform.hpp +++ /dev/null @@ -1,144 +0,0 @@ -/// @ref ext_matrix_transform -/// @file glm/ext/matrix_transform.hpp -/// -/// @defgroup ext_matrix_transform GLM_EXT_matrix_transform -/// @ingroup ext -/// -/// Defines functions that generate common transformation matrices. -/// -/// The matrices generated by this extension use standard OpenGL fixed-function -/// conventions. For example, the lookAt function generates a transform from world -/// space into the specific eye space that the projective matrix functions -/// (perspective, ortho, etc) are designed to expect. The OpenGL compatibility -/// specifications defines the particular layout of this eye space. -/// -/// Include to use the features of this extension. -/// -/// @see ext_matrix_projection -/// @see ext_matrix_clip_space - -#pragma once - -// Dependencies -#include "../gtc/constants.hpp" -#include "../geometric.hpp" -#include "../trigonometric.hpp" -#include "../matrix.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_transform extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_transform - /// @{ - - /// Builds an identity matrix. - template - GLM_FUNC_DECL GLM_CONSTEXPR genType identity(); - - /// Builds a translation 4 * 4 matrix created from a vector of 3 components. - /// - /// @param m Input matrix multiplied by this translation matrix. - /// @param v Coordinates of a translation vector. - /// - /// @tparam T A floating-point scalar type - /// @tparam Q A value from qualifier enum - /// - /// @code - /// #include - /// #include - /// ... - /// glm::mat4 m = glm::translate(glm::mat4(1.0f), glm::vec3(1.0f)); - /// // m[0][0] == 1.0f, m[0][1] == 0.0f, m[0][2] == 0.0f, m[0][3] == 0.0f - /// // m[1][0] == 0.0f, m[1][1] == 1.0f, m[1][2] == 0.0f, m[1][3] == 0.0f - /// // m[2][0] == 0.0f, m[2][1] == 0.0f, m[2][2] == 1.0f, m[2][3] == 0.0f - /// // m[3][0] == 1.0f, m[3][1] == 1.0f, m[3][2] == 1.0f, m[3][3] == 1.0f - /// @endcode - /// - /// @see - translate(mat<4, 4, T, Q> const& m, T x, T y, T z) - /// @see - translate(vec<3, T, Q> const& v) - /// @see glTranslate man page - template - GLM_FUNC_DECL mat<4, 4, T, Q> translate( - mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v); - - /// Builds a rotation 4 * 4 matrix created from an axis vector and an angle. - /// - /// @param m Input matrix multiplied by this rotation matrix. - /// @param angle Rotation angle expressed in radians. - /// @param axis Rotation axis, recommended to be normalized. - /// - /// @tparam T A floating-point scalar type - /// @tparam Q A value from qualifier enum - /// - /// @see - rotate(mat<4, 4, T, Q> const& m, T angle, T x, T y, T z) - /// @see - rotate(T angle, vec<3, T, Q> const& v) - /// @see glRotate man page - template - GLM_FUNC_DECL mat<4, 4, T, Q> rotate( - mat<4, 4, T, Q> const& m, T angle, vec<3, T, Q> const& axis); - - /// Builds a scale 4 * 4 matrix created from 3 scalars. - /// - /// @param m Input matrix multiplied by this scale matrix. - /// @param v Ratio of scaling for each axis. - /// - /// @tparam T A floating-point scalar type - /// @tparam Q A value from qualifier enum - /// - /// @see - scale(mat<4, 4, T, Q> const& m, T x, T y, T z) - /// @see - scale(vec<3, T, Q> const& v) - /// @see glScale man page - template - GLM_FUNC_DECL mat<4, 4, T, Q> scale( - mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v); - - /// Build a right handed look at view matrix. - /// - /// @param eye Position of the camera - /// @param center Position where the camera is looking at - /// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) - /// - /// @tparam T A floating-point scalar type - /// @tparam Q A value from qualifier enum - /// - /// @see - frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) - template - GLM_FUNC_DECL mat<4, 4, T, Q> lookAtRH( - vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up); - - /// Build a left handed look at view matrix. - /// - /// @param eye Position of the camera - /// @param center Position where the camera is looking at - /// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) - /// - /// @tparam T A floating-point scalar type - /// @tparam Q A value from qualifier enum - /// - /// @see - frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) - template - GLM_FUNC_DECL mat<4, 4, T, Q> lookAtLH( - vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up); - - /// Build a look at view matrix based on the default handedness. - /// - /// @param eye Position of the camera - /// @param center Position where the camera is looking at - /// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) - /// - /// @tparam T A floating-point scalar type - /// @tparam Q A value from qualifier enum - /// - /// @see - frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) frustum(T const& left, T const& right, T const& bottom, T const& top, T const& nearVal, T const& farVal) - /// @see gluLookAt man page - template - GLM_FUNC_DECL mat<4, 4, T, Q> lookAt( - vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up); - - /// @} -}//namespace glm - -#include "matrix_transform.inl" diff --git a/3rdparty/glm/source/glm/ext/matrix_transform.inl b/3rdparty/glm/source/glm/ext/matrix_transform.inl deleted file mode 100644 index 01cefab..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_transform.inl +++ /dev/null @@ -1,153 +0,0 @@ -namespace glm -{ - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType identity() - { - return detail::init_gentype::GENTYPE>::identity(); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> translate(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v) - { - mat<4, 4, T, Q> Result(m); - Result[3] = m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3]; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rotate(mat<4, 4, T, Q> const& m, T angle, vec<3, T, Q> const& v) - { - T const a = angle; - T const c = cos(a); - T const s = sin(a); - - vec<3, T, Q> axis(normalize(v)); - vec<3, T, Q> temp((T(1) - c) * axis); - - mat<4, 4, T, Q> Rotate; - Rotate[0][0] = c + temp[0] * axis[0]; - Rotate[0][1] = temp[0] * axis[1] + s * axis[2]; - Rotate[0][2] = temp[0] * axis[2] - s * axis[1]; - - Rotate[1][0] = temp[1] * axis[0] - s * axis[2]; - Rotate[1][1] = c + temp[1] * axis[1]; - Rotate[1][2] = temp[1] * axis[2] + s * axis[0]; - - Rotate[2][0] = temp[2] * axis[0] + s * axis[1]; - Rotate[2][1] = temp[2] * axis[1] - s * axis[0]; - Rotate[2][2] = c + temp[2] * axis[2]; - - mat<4, 4, T, Q> Result; - Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2]; - Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2]; - Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2]; - Result[3] = m[3]; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rotate_slow(mat<4, 4, T, Q> const& m, T angle, vec<3, T, Q> const& v) - { - T const a = angle; - T const c = cos(a); - T const s = sin(a); - mat<4, 4, T, Q> Result; - - vec<3, T, Q> axis = normalize(v); - - Result[0][0] = c + (static_cast(1) - c) * axis.x * axis.x; - Result[0][1] = (static_cast(1) - c) * axis.x * axis.y + s * axis.z; - Result[0][2] = (static_cast(1) - c) * axis.x * axis.z - s * axis.y; - Result[0][3] = static_cast(0); - - Result[1][0] = (static_cast(1) - c) * axis.y * axis.x - s * axis.z; - Result[1][1] = c + (static_cast(1) - c) * axis.y * axis.y; - Result[1][2] = (static_cast(1) - c) * axis.y * axis.z + s * axis.x; - Result[1][3] = static_cast(0); - - Result[2][0] = (static_cast(1) - c) * axis.z * axis.x + s * axis.y; - Result[2][1] = (static_cast(1) - c) * axis.z * axis.y - s * axis.x; - Result[2][2] = c + (static_cast(1) - c) * axis.z * axis.z; - Result[2][3] = static_cast(0); - - Result[3] = vec<4, T, Q>(0, 0, 0, 1); - return m * Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scale(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v) - { - mat<4, 4, T, Q> Result; - Result[0] = m[0] * v[0]; - Result[1] = m[1] * v[1]; - Result[2] = m[2] * v[2]; - Result[3] = m[3]; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scale_slow(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v) - { - mat<4, 4, T, Q> Result(T(1)); - Result[0][0] = v.x; - Result[1][1] = v.y; - Result[2][2] = v.z; - return m * Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> lookAtRH(vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up) - { - vec<3, T, Q> const f(normalize(center - eye)); - vec<3, T, Q> const s(normalize(cross(f, up))); - vec<3, T, Q> const u(cross(s, f)); - - mat<4, 4, T, Q> Result(1); - Result[0][0] = s.x; - Result[1][0] = s.y; - Result[2][0] = s.z; - Result[0][1] = u.x; - Result[1][1] = u.y; - Result[2][1] = u.z; - Result[0][2] =-f.x; - Result[1][2] =-f.y; - Result[2][2] =-f.z; - Result[3][0] =-dot(s, eye); - Result[3][1] =-dot(u, eye); - Result[3][2] = dot(f, eye); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> lookAtLH(vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up) - { - vec<3, T, Q> const f(normalize(center - eye)); - vec<3, T, Q> const s(normalize(cross(up, f))); - vec<3, T, Q> const u(cross(f, s)); - - mat<4, 4, T, Q> Result(1); - Result[0][0] = s.x; - Result[1][0] = s.y; - Result[2][0] = s.z; - Result[0][1] = u.x; - Result[1][1] = u.y; - Result[2][1] = u.z; - Result[0][2] = f.x; - Result[1][2] = f.y; - Result[2][2] = f.z; - Result[3][0] = -dot(s, eye); - Result[3][1] = -dot(u, eye); - Result[3][2] = -dot(f, eye); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> lookAt(vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up) - { -# if (GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT) - return lookAtLH(eye, center, up); -# else - return lookAtRH(eye, center, up); -# endif - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_uint2x2.hpp b/3rdparty/glm/source/glm/ext/matrix_uint2x2.hpp deleted file mode 100644 index 034771a..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_uint2x2.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/// @ref ext_matrix_uint2x2 -/// @file glm/ext/matrix_uint2x2.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_uint2x2 GLM_EXT_matrix_uint2x2 -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat2x2.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_uint2x2 extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_uint2x2 - /// @{ - - /// Unsigned integer 2x2 matrix. - /// - /// @see ext_matrix_uint2x2 - typedef mat<2, 2, uint, defaultp> umat2x2; - - /// Unsigned integer 2x2 matrix. - /// - /// @see ext_matrix_uint2x2 - typedef mat<2, 2, uint, defaultp> umat2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_uint2x2_sized.hpp b/3rdparty/glm/source/glm/ext/matrix_uint2x2_sized.hpp deleted file mode 100644 index 4555324..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_uint2x2_sized.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/// @ref ext_matrix_uint2x2_sized -/// @file glm/ext/matrix_uint2x2_sized.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_uint2x2_sized GLM_EXT_matrix_uint2x2_sized -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat2x2.hpp" -#include "../ext/scalar_uint_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_uint2x2_sized extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_uint2x2_sized - /// @{ - - /// 8 bit unsigned integer 2x2 matrix. - /// - /// @see ext_matrix_uint2x2_sized - typedef mat<2, 2, uint8, defaultp> u8mat2x2; - - /// 16 bit unsigned integer 2x2 matrix. - /// - /// @see ext_matrix_uint2x2_sized - typedef mat<2, 2, uint16, defaultp> u16mat2x2; - - /// 32 bit unsigned integer 2x2 matrix. - /// - /// @see ext_matrix_uint2x2_sized - typedef mat<2, 2, uint32, defaultp> u32mat2x2; - - /// 64 bit unsigned integer 2x2 matrix. - /// - /// @see ext_matrix_uint2x2_sized - typedef mat<2, 2, uint64, defaultp> u64mat2x2; - - - /// 8 bit unsigned integer 2x2 matrix. - /// - /// @see ext_matrix_uint2x2_sized - typedef mat<2, 2, uint8, defaultp> u8mat2; - - /// 16 bit unsigned integer 2x2 matrix. - /// - /// @see ext_matrix_uint2x2_sized - typedef mat<2, 2, uint16, defaultp> u16mat2; - - /// 32 bit unsigned integer 2x2 matrix. - /// - /// @see ext_matrix_uint2x2_sized - typedef mat<2, 2, uint32, defaultp> u32mat2; - - /// 64 bit unsigned integer 2x2 matrix. - /// - /// @see ext_matrix_uint2x2_sized - typedef mat<2, 2, uint64, defaultp> u64mat2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_uint2x3.hpp b/3rdparty/glm/source/glm/ext/matrix_uint2x3.hpp deleted file mode 100644 index 7de62f6..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_uint2x3.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/// @ref ext_matrix_uint2x3 -/// @file glm/ext/matrix_uint2x3.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_int2x3 GLM_EXT_matrix_uint2x3 -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat2x3.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_uint2x3 extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_uint2x3 - /// @{ - - /// Unsigned integer 2x3 matrix. - /// - /// @see ext_matrix_uint2x3 - typedef mat<2, 3, uint, defaultp> umat2x3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_uint2x3_sized.hpp b/3rdparty/glm/source/glm/ext/matrix_uint2x3_sized.hpp deleted file mode 100644 index db7939c..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_uint2x3_sized.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref ext_matrix_uint2x3_sized -/// @file glm/ext/matrix_uint2x3_sized.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_uint2x3_sized GLM_EXT_matrix_uint2x3_sized -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat2x3.hpp" -#include "../ext/scalar_uint_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_uint2x3_sized extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_uint2x3_sized - /// @{ - - /// 8 bit unsigned integer 2x3 matrix. - /// - /// @see ext_matrix_uint2x3_sized - typedef mat<2, 3, uint8, defaultp> u8mat2x3; - - /// 16 bit unsigned integer 2x3 matrix. - /// - /// @see ext_matrix_uint2x3_sized - typedef mat<2, 3, uint16, defaultp> u16mat2x3; - - /// 32 bit unsigned integer 2x3 matrix. - /// - /// @see ext_matrix_uint2x3_sized - typedef mat<2, 3, uint32, defaultp> u32mat2x3; - - /// 64 bit unsigned integer 2x3 matrix. - /// - /// @see ext_matrix_uint2x3_sized - typedef mat<2, 3, uint64, defaultp> u64mat2x3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_uint2x4.hpp b/3rdparty/glm/source/glm/ext/matrix_uint2x4.hpp deleted file mode 100644 index 0f99350..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_uint2x4.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/// @ref ext_matrix_uint2x4 -/// @file glm/ext/matrix_uint2x4.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_uint2x4 GLM_EXT_matrix_int2x4 -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat2x4.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_uint2x4 extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_uint2x4 - /// @{ - - /// Unsigned integer 2x4 matrix. - /// - /// @see ext_matrix_uint2x4 - typedef mat<2, 4, uint, defaultp> umat2x4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_uint2x4_sized.hpp b/3rdparty/glm/source/glm/ext/matrix_uint2x4_sized.hpp deleted file mode 100644 index 5cb8e54..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_uint2x4_sized.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref ext_matrix_uint2x4_sized -/// @file glm/ext/matrixu_uint2x4_sized.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_uint2x4_sized GLM_EXT_matrix_uint2x4_sized -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat2x4.hpp" -#include "../ext/scalar_uint_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_uint2x4_sized extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_uint2x4_sized - /// @{ - - /// 8 bit unsigned integer 2x4 matrix. - /// - /// @see ext_matrix_uint2x4_sized - typedef mat<2, 4, uint8, defaultp> u8mat2x4; - - /// 16 bit unsigned integer 2x4 matrix. - /// - /// @see ext_matrix_uint2x4_sized - typedef mat<2, 4, uint16, defaultp> u16mat2x4; - - /// 32 bit unsigned integer 2x4 matrix. - /// - /// @see ext_matrix_uint2x4_sized - typedef mat<2, 4, uint32, defaultp> u32mat2x4; - - /// 64 bit unsigned integer 2x4 matrix. - /// - /// @see ext_matrix_uint2x4_sized - typedef mat<2, 4, uint64, defaultp> u64mat2x4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_uint3x2.hpp b/3rdparty/glm/source/glm/ext/matrix_uint3x2.hpp deleted file mode 100644 index 47f4873..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_uint3x2.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/// @ref ext_matrix_uint3x2 -/// @file glm/ext/matrix_uint3x2.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_int3x2 GLM_EXT_matrix_uint3x2 -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat3x2.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_uint3x2 extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_uint3x2 - /// @{ - - /// Unsigned integer 3x2 matrix. - /// - /// @see ext_matrix_uint3x2 - typedef mat<3, 2, uint, defaultp> umat3x2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_uint3x2_sized.hpp b/3rdparty/glm/source/glm/ext/matrix_uint3x2_sized.hpp deleted file mode 100644 index c81af8f..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_uint3x2_sized.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref ext_matrix_uint3x2_sized -/// @file glm/ext/matrix_uint3x2_sized.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_uint3x2_sized GLM_EXT_matrix_uint3x2_sized -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat3x2.hpp" -#include "../ext/scalar_uint_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_uint3x2_sized extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_uint3x2_sized - /// @{ - - /// 8 bit signed integer 3x2 matrix. - /// - /// @see ext_matrix_uint3x2_sized - typedef mat<3, 2, uint8, defaultp> u8mat3x2; - - /// 16 bit signed integer 3x2 matrix. - /// - /// @see ext_matrix_uint3x2_sized - typedef mat<3, 2, uint16, defaultp> u16mat3x2; - - /// 32 bit signed integer 3x2 matrix. - /// - /// @see ext_matrix_uint3x2_sized - typedef mat<3, 2, uint32, defaultp> u32mat3x2; - - /// 64 bit signed integer 3x2 matrix. - /// - /// @see ext_matrix_uint3x2_sized - typedef mat<3, 2, uint64, defaultp> u64mat3x2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_uint3x3.hpp b/3rdparty/glm/source/glm/ext/matrix_uint3x3.hpp deleted file mode 100644 index 1004c0d..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_uint3x3.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/// @ref ext_matrix_uint3x3 -/// @file glm/ext/matrix_uint3x3.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_uint3x3 GLM_EXT_matrix_uint3x3 -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat3x3.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_uint3x3 extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_uint3x3 - /// @{ - - /// Unsigned integer 3x3 matrix. - /// - /// @see ext_matrix_uint3x3 - typedef mat<3, 3, uint, defaultp> umat3x3; - - /// Unsigned integer 3x3 matrix. - /// - /// @see ext_matrix_uint3x3 - typedef mat<3, 3, uint, defaultp> umat3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_uint3x3_sized.hpp b/3rdparty/glm/source/glm/ext/matrix_uint3x3_sized.hpp deleted file mode 100644 index 41a8be7..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_uint3x3_sized.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/// @ref ext_matrix_uint3x3_sized -/// @file glm/ext/matrix_uint3x3_sized.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_uint3x3_sized GLM_EXT_matrix_uint3x3_sized -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat3x3.hpp" -#include "../ext/scalar_uint_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_uint3x3_sized extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_uint3x3_sized - /// @{ - - /// 8 bit unsigned integer 3x3 matrix. - /// - /// @see ext_matrix_uint3x3_sized - typedef mat<3, 3, uint8, defaultp> u8mat3x3; - - /// 16 bit unsigned integer 3x3 matrix. - /// - /// @see ext_matrix_uint3x3_sized - typedef mat<3, 3, uint16, defaultp> u16mat3x3; - - /// 32 bit unsigned integer 3x3 matrix. - /// - /// @see ext_matrix_uint3x3_sized - typedef mat<3, 3, uint32, defaultp> u32mat3x3; - - /// 64 bit unsigned integer 3x3 matrix. - /// - /// @see ext_matrix_uint3x3_sized - typedef mat<3, 3, uint64, defaultp> u64mat3x3; - - - /// 8 bit unsigned integer 3x3 matrix. - /// - /// @see ext_matrix_uint3x3_sized - typedef mat<3, 3, uint8, defaultp> u8mat3; - - /// 16 bit unsigned integer 3x3 matrix. - /// - /// @see ext_matrix_uint3x3_sized - typedef mat<3, 3, uint16, defaultp> u16mat3; - - /// 32 bit unsigned integer 3x3 matrix. - /// - /// @see ext_matrix_uint3x3_sized - typedef mat<3, 3, uint32, defaultp> u32mat3; - - /// 64 bit unsigned integer 3x3 matrix. - /// - /// @see ext_matrix_uint3x3_sized - typedef mat<3, 3, uint64, defaultp> u64mat3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_uint3x4.hpp b/3rdparty/glm/source/glm/ext/matrix_uint3x4.hpp deleted file mode 100644 index c6dd78c..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_uint3x4.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/// @ref ext_matrix_uint3x4 -/// @file glm/ext/matrix_uint3x4.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_uint3x4 GLM_EXT_matrix_uint3x4 -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat3x4.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_uint3x4 extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_uint3x4 - /// @{ - - /// Signed integer 3x4 matrix. - /// - /// @see ext_matrix_uint3x4 - typedef mat<3, 4, uint, defaultp> umat3x4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_uint3x4_sized.hpp b/3rdparty/glm/source/glm/ext/matrix_uint3x4_sized.hpp deleted file mode 100644 index 2ce28ad..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_uint3x4_sized.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref ext_matrix_uint3x4_sized -/// @file glm/ext/matrix_uint3x2_sized.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_uint3x4_sized GLM_EXT_matrix_uint3x4_sized -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat3x4.hpp" -#include "../ext/scalar_uint_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_uint3x4_sized extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_uint3x4_sized - /// @{ - - /// 8 bit unsigned integer 3x4 matrix. - /// - /// @see ext_matrix_uint3x4_sized - typedef mat<3, 4, uint8, defaultp> u8mat3x4; - - /// 16 bit unsigned integer 3x4 matrix. - /// - /// @see ext_matrix_uint3x4_sized - typedef mat<3, 4, uint16, defaultp> u16mat3x4; - - /// 32 bit unsigned integer 3x4 matrix. - /// - /// @see ext_matrix_uint3x4_sized - typedef mat<3, 4, uint32, defaultp> u32mat3x4; - - /// 64 bit unsigned integer 3x4 matrix. - /// - /// @see ext_matrix_uint3x4_sized - typedef mat<3, 4, uint64, defaultp> u64mat3x4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_uint4x2.hpp b/3rdparty/glm/source/glm/ext/matrix_uint4x2.hpp deleted file mode 100644 index 0446f57..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_uint4x2.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/// @ref ext_matrix_uint4x2 -/// @file glm/ext/matrix_uint4x2.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_uint4x2 GLM_EXT_matrix_uint4x2 -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat4x2.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_uint4x2 extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_uint4x2 - /// @{ - - /// Unsigned integer 4x2 matrix. - /// - /// @see ext_matrix_uint4x2 - typedef mat<4, 2, uint, defaultp> umat4x2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_uint4x2_sized.hpp b/3rdparty/glm/source/glm/ext/matrix_uint4x2_sized.hpp deleted file mode 100644 index 57a66bf..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_uint4x2_sized.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref ext_matrix_uint4x2_sized -/// @file glm/ext/matrix_uint4x2_sized.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_uint4x2_sized GLM_EXT_matrix_uint4x2_sized -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat4x2.hpp" -#include "../ext/scalar_uint_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_uint4x2_sized extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_uint4x2_sized - /// @{ - - /// 8 bit unsigned integer 4x2 matrix. - /// - /// @see ext_matrix_uint4x2_sized - typedef mat<4, 2, uint8, defaultp> u8mat4x2; - - /// 16 bit unsigned integer 4x2 matrix. - /// - /// @see ext_matrix_uint4x2_sized - typedef mat<4, 2, uint16, defaultp> u16mat4x2; - - /// 32 bit unsigned integer 4x2 matrix. - /// - /// @see ext_matrix_uint4x2_sized - typedef mat<4, 2, uint32, defaultp> u32mat4x2; - - /// 64 bit unsigned integer 4x2 matrix. - /// - /// @see ext_matrix_uint4x2_sized - typedef mat<4, 2, uint64, defaultp> u64mat4x2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_uint4x3.hpp b/3rdparty/glm/source/glm/ext/matrix_uint4x3.hpp deleted file mode 100644 index 54c24e4..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_uint4x3.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/// @ref ext_matrix_uint4x3 -/// @file glm/ext/matrix_uint4x3.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_uint4x3 GLM_EXT_matrix_uint4x3 -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat4x3.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_uint4x3 extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_uint4x3 - /// @{ - - /// Unsigned integer 4x3 matrix. - /// - /// @see ext_matrix_uint4x3 - typedef mat<4, 3, uint, defaultp> umat4x3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_uint4x3_sized.hpp b/3rdparty/glm/source/glm/ext/matrix_uint4x3_sized.hpp deleted file mode 100644 index 2e61124..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_uint4x3_sized.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref ext_matrix_uint4x3_sized -/// @file glm/ext/matrix_uint4x3_sized.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_uint4x3_sized GLM_EXT_matrix_uint4x3_sized -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat4x3.hpp" -#include "../ext/scalar_uint_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_uint4x3_sized extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_uint4x3_sized - /// @{ - - /// 8 bit unsigned integer 4x3 matrix. - /// - /// @see ext_matrix_uint4x3_sized - typedef mat<4, 3, uint8, defaultp> u8mat4x3; - - /// 16 bit unsigned integer 4x3 matrix. - /// - /// @see ext_matrix_uint4x3_sized - typedef mat<4, 3, uint16, defaultp> u16mat4x3; - - /// 32 bit unsigned integer 4x3 matrix. - /// - /// @see ext_matrix_uint4x3_sized - typedef mat<4, 3, uint32, defaultp> u32mat4x3; - - /// 64 bit unsigned integer 4x3 matrix. - /// - /// @see ext_matrix_uint4x3_sized - typedef mat<4, 3, uint64, defaultp> u64mat4x3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_uint4x4.hpp b/3rdparty/glm/source/glm/ext/matrix_uint4x4.hpp deleted file mode 100644 index 5cc8455..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_uint4x4.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/// @ref ext_matrix_uint4x4 -/// @file glm/ext/matrix_uint4x4.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_uint4x4 GLM_EXT_matrix_uint4x4 -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat4x4.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_uint4x4 extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_uint4x4 - /// @{ - - /// Unsigned integer 4x4 matrix. - /// - /// @see ext_matrix_uint4x4 - typedef mat<4, 4, uint, defaultp> umat4x4; - - /// Unsigned integer 4x4 matrix. - /// - /// @see ext_matrix_uint4x4 - typedef mat<4, 4, uint, defaultp> umat4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/matrix_uint4x4_sized.hpp b/3rdparty/glm/source/glm/ext/matrix_uint4x4_sized.hpp deleted file mode 100644 index bb10bd2..0000000 --- a/3rdparty/glm/source/glm/ext/matrix_uint4x4_sized.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/// @ref ext_matrix_uint4x4_sized -/// @file glm/ext/matrix_uint4x4_sized.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_matrix_uint4x4_sized GLM_EXT_matrix_uint4x4_sized -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat4x4.hpp" -#include "../ext/scalar_uint_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_matrix_uint4x4_sized extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_matrix_uint4x4_sized - /// @{ - - /// 8 bit unsigned integer 4x4 matrix. - /// - /// @see ext_matrix_uint4x4_sized - typedef mat<4, 4, uint8, defaultp> u8mat4x4; - - /// 16 bit unsigned integer 4x4 matrix. - /// - /// @see ext_matrix_uint4x4_sized - typedef mat<4, 4, uint16, defaultp> u16mat4x4; - - /// 32 bit unsigned integer 4x4 matrix. - /// - /// @see ext_matrix_uint4x4_sized - typedef mat<4, 4, uint32, defaultp> u32mat4x4; - - /// 64 bit unsigned integer 4x4 matrix. - /// - /// @see ext_matrix_uint4x4_sized - typedef mat<4, 4, uint64, defaultp> u64mat4x4; - - - /// 8 bit unsigned integer 4x4 matrix. - /// - /// @see ext_matrix_uint4x4_sized - typedef mat<4, 4, uint8, defaultp> u8mat4; - - /// 16 bit unsigned integer 4x4 matrix. - /// - /// @see ext_matrix_uint4x4_sized - typedef mat<4, 4, uint16, defaultp> u16mat4; - - /// 32 bit unsigned integer 4x4 matrix. - /// - /// @see ext_matrix_uint4x4_sized - typedef mat<4, 4, uint32, defaultp> u32mat4; - - /// 64 bit unsigned integer 4x4 matrix. - /// - /// @see ext_matrix_uint4x4_sized - typedef mat<4, 4, uint64, defaultp> u64mat4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/quaternion_common.hpp b/3rdparty/glm/source/glm/ext/quaternion_common.hpp deleted file mode 100644 index f519d55..0000000 --- a/3rdparty/glm/source/glm/ext/quaternion_common.hpp +++ /dev/null @@ -1,135 +0,0 @@ -/// @ref ext_quaternion_common -/// @file glm/ext/quaternion_common.hpp -/// -/// @defgroup ext_quaternion_common GLM_EXT_quaternion_common -/// @ingroup ext -/// -/// Provides common functions for quaternion types -/// -/// Include to use the features of this extension. -/// -/// @see ext_scalar_common -/// @see ext_vector_common -/// @see ext_quaternion_float -/// @see ext_quaternion_double -/// @see ext_quaternion_exponential -/// @see ext_quaternion_geometric -/// @see ext_quaternion_relational -/// @see ext_quaternion_trigonometric -/// @see ext_quaternion_transform - -#pragma once - -// Dependency: -#include "../ext/scalar_constants.hpp" -#include "../ext/quaternion_geometric.hpp" -#include "../common.hpp" -#include "../trigonometric.hpp" -#include "../exponential.hpp" -#include - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_quaternion_common extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_quaternion_common - /// @{ - - /// Spherical linear interpolation of two quaternions. - /// The interpolation is oriented and the rotation is performed at constant speed. - /// For short path spherical linear interpolation, use the slerp function. - /// - /// @param x A quaternion - /// @param y A quaternion - /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. - /// - /// @tparam T A floating-point scalar type - /// @tparam Q A value from qualifier enum - /// - /// @see - slerp(qua const& x, qua const& y, T const& a) - template - GLM_FUNC_DECL qua mix(qua const& x, qua const& y, T a); - - /// Linear interpolation of two quaternions. - /// The interpolation is oriented. - /// - /// @param x A quaternion - /// @param y A quaternion - /// @param a Interpolation factor. The interpolation is defined in the range [0, 1]. - /// - /// @tparam T A floating-point scalar type - /// @tparam Q A value from qualifier enum - template - GLM_FUNC_DECL qua lerp(qua const& x, qua const& y, T a); - - /// Spherical linear interpolation of two quaternions. - /// The interpolation always take the short path and the rotation is performed at constant speed. - /// - /// @param x A quaternion - /// @param y A quaternion - /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. - /// - /// @tparam T A floating-point scalar type - /// @tparam Q A value from qualifier enum - template - GLM_FUNC_DECL qua slerp(qua const& x, qua const& y, T a); - - /// Spherical linear interpolation of two quaternions with multiple spins over rotation axis. - /// The interpolation always take the short path when the spin count is positive and long path - /// when count is negative. Rotation is performed at constant speed. - /// - /// @param x A quaternion - /// @param y A quaternion - /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. - /// @param k Additional spin count. If Value is negative interpolation will be on "long" path. - /// - /// @tparam T A floating-point scalar type - /// @tparam S An integer scalar type - /// @tparam Q A value from qualifier enum - template - GLM_FUNC_DECL qua slerp(qua const& x, qua const& y, T a, S k); - - /// Returns the q conjugate. - /// - /// @tparam T A floating-point scalar type - /// @tparam Q A value from qualifier enum - template - GLM_FUNC_DECL qua conjugate(qua const& q); - - /// Returns the q inverse. - /// - /// @tparam T A floating-point scalar type - /// @tparam Q A value from qualifier enum - template - GLM_FUNC_DECL qua inverse(qua const& q); - - /// Returns true if x holds a NaN (not a number) - /// representation in the underlying implementation's set of - /// floating point representations. Returns false otherwise, - /// including for implementations with no NaN - /// representations. - /// - /// /!\ When using compiler fast math, this function may fail. - /// - /// @tparam T A floating-point scalar type - /// @tparam Q A value from qualifier enum - template - GLM_FUNC_DECL vec<4, bool, Q> isnan(qua const& x); - - /// Returns true if x holds a positive infinity or negative - /// infinity representation in the underlying implementation's - /// set of floating point representations. Returns false - /// otherwise, including for implementations with no infinity - /// representations. - /// - /// @tparam T A floating-point scalar type - /// @tparam Q A value from qualifier enum - template - GLM_FUNC_DECL vec<4, bool, Q> isinf(qua const& x); - - /// @} -} //namespace glm - -#include "quaternion_common.inl" diff --git a/3rdparty/glm/source/glm/ext/quaternion_common.inl b/3rdparty/glm/source/glm/ext/quaternion_common.inl deleted file mode 100644 index 0e4a3bb..0000000 --- a/3rdparty/glm/source/glm/ext/quaternion_common.inl +++ /dev/null @@ -1,144 +0,0 @@ -namespace glm -{ - template - GLM_FUNC_QUALIFIER qua mix(qua const& x, qua const& y, T a) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'mix' only accept floating-point inputs"); - - T const cosTheta = dot(x, y); - - // Perform a linear interpolation when cosTheta is close to 1 to avoid side effect of sin(angle) becoming a zero denominator - if(cosTheta > static_cast(1) - epsilon()) - { - // Linear interpolation - return qua( - mix(x.w, y.w, a), - mix(x.x, y.x, a), - mix(x.y, y.y, a), - mix(x.z, y.z, a)); - } - else - { - // Essential Mathematics, page 467 - T angle = acos(cosTheta); - return (sin((static_cast(1) - a) * angle) * x + sin(a * angle) * y) / sin(angle); - } - } - - template - GLM_FUNC_QUALIFIER qua lerp(qua const& x, qua const& y, T a) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'lerp' only accept floating-point inputs"); - - // Lerp is only defined in [0, 1] - assert(a >= static_cast(0)); - assert(a <= static_cast(1)); - - return x * (static_cast(1) - a) + (y * a); - } - - template - GLM_FUNC_QUALIFIER qua slerp(qua const& x, qua const& y, T a) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'slerp' only accept floating-point inputs"); - - qua z = y; - - T cosTheta = dot(x, y); - - // If cosTheta < 0, the interpolation will take the long way around the sphere. - // To fix this, one quat must be negated. - if(cosTheta < static_cast(0)) - { - z = -y; - cosTheta = -cosTheta; - } - - // Perform a linear interpolation when cosTheta is close to 1 to avoid side effect of sin(angle) becoming a zero denominator - if(cosTheta > static_cast(1) - epsilon()) - { - // Linear interpolation - return qua( - mix(x.w, z.w, a), - mix(x.x, z.x, a), - mix(x.y, z.y, a), - mix(x.z, z.z, a)); - } - else - { - // Essential Mathematics, page 467 - T angle = acos(cosTheta); - return (sin((static_cast(1) - a) * angle) * x + sin(a * angle) * z) / sin(angle); - } - } - - template - GLM_FUNC_QUALIFIER qua slerp(qua const& x, qua const& y, T a, S k) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'slerp' only accept floating-point inputs"); - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'slerp' only accept integer for spin count"); - - qua z = y; - - T cosTheta = dot(x, y); - - // If cosTheta < 0, the interpolation will take the long way around the sphere. - // To fix this, one quat must be negated. - if (cosTheta < static_cast(0)) - { - z = -y; - cosTheta = -cosTheta; - } - - // Perform a linear interpolation when cosTheta is close to 1 to avoid side effect of sin(angle) becoming a zero denominator - if (cosTheta > static_cast(1) - epsilon()) - { - // Linear interpolation - return qua( - mix(x.w, z.w, a), - mix(x.x, z.x, a), - mix(x.y, z.y, a), - mix(x.z, z.z, a)); - } - else - { - // Graphics Gems III, page 96 - T angle = acos(cosTheta); - T phi = angle + k * glm::pi(); - return (sin(angle - a * phi)* x + sin(a * phi) * z) / sin(angle); - } - } - - template - GLM_FUNC_QUALIFIER qua conjugate(qua const& q) - { - return qua(q.w, -q.x, -q.y, -q.z); - } - - template - GLM_FUNC_QUALIFIER qua inverse(qua const& q) - { - return conjugate(q) / dot(q, q); - } - - template - GLM_FUNC_QUALIFIER vec<4, bool, Q> isnan(qua const& q) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isnan' only accept floating-point inputs"); - - return vec<4, bool, Q>(isnan(q.x), isnan(q.y), isnan(q.z), isnan(q.w)); - } - - template - GLM_FUNC_QUALIFIER vec<4, bool, Q> isinf(qua const& q) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isinf' only accept floating-point inputs"); - - return vec<4, bool, Q>(isinf(q.x), isinf(q.y), isinf(q.z), isinf(q.w)); - } -}//namespace glm - -#if GLM_CONFIG_SIMD == GLM_ENABLE -# include "quaternion_common_simd.inl" -#endif - diff --git a/3rdparty/glm/source/glm/ext/quaternion_common_simd.inl b/3rdparty/glm/source/glm/ext/quaternion_common_simd.inl deleted file mode 100644 index ddfc8a4..0000000 --- a/3rdparty/glm/source/glm/ext/quaternion_common_simd.inl +++ /dev/null @@ -1,18 +0,0 @@ -#if GLM_ARCH & GLM_ARCH_SSE2_BIT - -namespace glm{ -namespace detail -{ - template - struct compute_dot, float, true> - { - static GLM_FUNC_QUALIFIER float call(qua const& x, qua const& y) - { - return _mm_cvtss_f32(glm_vec1_dot(x.data, y.data)); - } - }; -}//namespace detail -}//namespace glm - -#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT - diff --git a/3rdparty/glm/source/glm/ext/quaternion_double.hpp b/3rdparty/glm/source/glm/ext/quaternion_double.hpp deleted file mode 100644 index 63b24de..0000000 --- a/3rdparty/glm/source/glm/ext/quaternion_double.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/// @ref ext_quaternion_double -/// @file glm/ext/quaternion_double.hpp -/// -/// @defgroup ext_quaternion_double GLM_EXT_quaternion_double -/// @ingroup ext -/// -/// Exposes double-precision floating point quaternion type. -/// -/// Include to use the features of this extension. -/// -/// @see ext_quaternion_float -/// @see ext_quaternion_double_precision -/// @see ext_quaternion_common -/// @see ext_quaternion_exponential -/// @see ext_quaternion_geometric -/// @see ext_quaternion_relational -/// @see ext_quaternion_transform -/// @see ext_quaternion_trigonometric - -#pragma once - -// Dependency: -#include "../detail/type_quat.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_quaternion_double extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_quaternion_double - /// @{ - - /// Quaternion of double-precision floating-point numbers. - typedef qua dquat; - - /// @} -} //namespace glm - diff --git a/3rdparty/glm/source/glm/ext/quaternion_double_precision.hpp b/3rdparty/glm/source/glm/ext/quaternion_double_precision.hpp deleted file mode 100644 index 8aa24a1..0000000 --- a/3rdparty/glm/source/glm/ext/quaternion_double_precision.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/// @ref ext_quaternion_double_precision -/// @file glm/ext/quaternion_double_precision.hpp -/// -/// @defgroup ext_quaternion_double_precision GLM_EXT_quaternion_double_precision -/// @ingroup ext -/// -/// Exposes double-precision floating point quaternion type with various precision in term of ULPs. -/// -/// Include to use the features of this extension. - -#pragma once - -// Dependency: -#include "../detail/type_quat.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_quaternion_double_precision extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_quaternion_double_precision - /// @{ - - /// Quaternion of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - /// - /// @see ext_quaternion_double_precision - typedef qua lowp_dquat; - - /// Quaternion of medium double-qualifier floating-point numbers using high precision arithmetic in term of ULPs. - /// - /// @see ext_quaternion_double_precision - typedef qua mediump_dquat; - - /// Quaternion of high double-qualifier floating-point numbers using high precision arithmetic in term of ULPs. - /// - /// @see ext_quaternion_double_precision - typedef qua highp_dquat; - - /// @} -} //namespace glm - diff --git a/3rdparty/glm/source/glm/ext/quaternion_exponential.hpp b/3rdparty/glm/source/glm/ext/quaternion_exponential.hpp deleted file mode 100644 index affe297..0000000 --- a/3rdparty/glm/source/glm/ext/quaternion_exponential.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/// @ref ext_quaternion_exponential -/// @file glm/ext/quaternion_exponential.hpp -/// -/// @defgroup ext_quaternion_exponential GLM_EXT_quaternion_exponential -/// @ingroup ext -/// -/// Provides exponential functions for quaternion types -/// -/// Include to use the features of this extension. -/// -/// @see core_exponential -/// @see ext_quaternion_float -/// @see ext_quaternion_double - -#pragma once - -// Dependency: -#include "../common.hpp" -#include "../trigonometric.hpp" -#include "../geometric.hpp" -#include "../ext/scalar_constants.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_quaternion_exponential extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_quaternion_transform - /// @{ - - /// Returns a exponential of a quaternion. - /// - /// @tparam T A floating-point scalar type - /// @tparam Q A value from qualifier enum - template - GLM_FUNC_DECL qua exp(qua const& q); - - /// Returns a logarithm of a quaternion - /// - /// @tparam T A floating-point scalar type - /// @tparam Q A value from qualifier enum - template - GLM_FUNC_DECL qua log(qua const& q); - - /// Returns a quaternion raised to a power. - /// - /// @tparam T A floating-point scalar type - /// @tparam Q A value from qualifier enum - template - GLM_FUNC_DECL qua pow(qua const& q, T y); - - /// Returns the square root of a quaternion - /// - /// @tparam T A floating-point scalar type - /// @tparam Q A value from qualifier enum - template - GLM_FUNC_DECL qua sqrt(qua const& q); - - /// @} -} //namespace glm - -#include "quaternion_exponential.inl" diff --git a/3rdparty/glm/source/glm/ext/quaternion_exponential.inl b/3rdparty/glm/source/glm/ext/quaternion_exponential.inl deleted file mode 100644 index dd24b6c..0000000 --- a/3rdparty/glm/source/glm/ext/quaternion_exponential.inl +++ /dev/null @@ -1,89 +0,0 @@ -#include "scalar_constants.hpp" - -namespace glm -{ - template - GLM_FUNC_QUALIFIER qua exp(qua const& q) - { - vec<3, T, Q> u(q.x, q.y, q.z); - T const Angle = glm::length(u); - if (Angle < epsilon()) - return qua(); - - vec<3, T, Q> const v(u / Angle); - return qua(cos(Angle), sin(Angle) * v); - } - - template - GLM_FUNC_QUALIFIER qua log(qua const& q) - { - vec<3, T, Q> u(q.x, q.y, q.z); - T Vec3Len = length(u); - - if (Vec3Len < epsilon()) - { - if(q.w > static_cast(0)) - return qua(log(q.w), static_cast(0), static_cast(0), static_cast(0)); - else if(q.w < static_cast(0)) - return qua(log(-q.w), pi(), static_cast(0), static_cast(0)); - else - return qua(std::numeric_limits::infinity(), std::numeric_limits::infinity(), std::numeric_limits::infinity(), std::numeric_limits::infinity()); - } - else - { - T t = atan(Vec3Len, T(q.w)) / Vec3Len; - T QuatLen2 = Vec3Len * Vec3Len + q.w * q.w; - return qua(static_cast(0.5) * log(QuatLen2), t * q.x, t * q.y, t * q.z); - } - } - - template - GLM_FUNC_QUALIFIER qua pow(qua const& x, T y) - { - //Raising to the power of 0 should yield 1 - //Needed to prevent a division by 0 error later on - if(y > -epsilon() && y < epsilon()) - return qua(1,0,0,0); - - //To deal with non-unit quaternions - T magnitude = sqrt(x.x * x.x + x.y * x.y + x.z * x.z + x.w *x.w); - - T Angle; - if(abs(x.w / magnitude) > cos_one_over_two()) - { - //Scalar component is close to 1; using it to recover angle would lose precision - //Instead, we use the non-scalar components since sin() is accurate around 0 - - //Prevent a division by 0 error later on - T VectorMagnitude = x.x * x.x + x.y * x.y + x.z * x.z; - //Despite the compiler might say, we actually want to compare - //VectorMagnitude to 0. here; we could use denorm_int() compiling a - //project with unsafe maths optimizations might make the comparison - //always false, even when VectorMagnitude is 0. - if (VectorMagnitude < std::numeric_limits::min()) { - //Equivalent to raising a real number to a power - return qua(pow(x.w, y), 0, 0, 0); - } - - Angle = asin(sqrt(VectorMagnitude) / magnitude); - } - else - { - //Scalar component is small, shouldn't cause loss of precision - Angle = acos(x.w / magnitude); - } - - T NewAngle = Angle * y; - T Div = sin(NewAngle) / sin(Angle); - T Mag = pow(magnitude, y - static_cast(1)); - return qua(cos(NewAngle) * magnitude * Mag, x.x * Div * Mag, x.y * Div * Mag, x.z * Div * Mag); - } - - template - GLM_FUNC_QUALIFIER qua sqrt(qua const& x) - { - return pow(x, static_cast(0.5)); - } -}//namespace glm - - diff --git a/3rdparty/glm/source/glm/ext/quaternion_float.hpp b/3rdparty/glm/source/glm/ext/quaternion_float.hpp deleted file mode 100644 index ca42a60..0000000 --- a/3rdparty/glm/source/glm/ext/quaternion_float.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/// @ref ext_quaternion_float -/// @file glm/ext/quaternion_float.hpp -/// -/// @defgroup ext_quaternion_float GLM_EXT_quaternion_float -/// @ingroup ext -/// -/// Exposes single-precision floating point quaternion type. -/// -/// Include to use the features of this extension. -/// -/// @see ext_quaternion_double -/// @see ext_quaternion_float_precision -/// @see ext_quaternion_common -/// @see ext_quaternion_exponential -/// @see ext_quaternion_geometric -/// @see ext_quaternion_relational -/// @see ext_quaternion_transform -/// @see ext_quaternion_trigonometric - -#pragma once - -// Dependency: -#include "../detail/type_quat.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_quaternion_float extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_quaternion_float - /// @{ - - /// Quaternion of single-precision floating-point numbers. - typedef qua quat; - - /// @} -} //namespace glm - diff --git a/3rdparty/glm/source/glm/ext/quaternion_float_precision.hpp b/3rdparty/glm/source/glm/ext/quaternion_float_precision.hpp deleted file mode 100644 index f9e4f5c..0000000 --- a/3rdparty/glm/source/glm/ext/quaternion_float_precision.hpp +++ /dev/null @@ -1,36 +0,0 @@ -/// @ref ext_quaternion_float_precision -/// @file glm/ext/quaternion_float_precision.hpp -/// -/// @defgroup ext_quaternion_float_precision GLM_EXT_quaternion_float_precision -/// @ingroup ext -/// -/// Exposes single-precision floating point quaternion type with various precision in term of ULPs. -/// -/// Include to use the features of this extension. - -#pragma once - -// Dependency: -#include "../detail/type_quat.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_quaternion_float_precision extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_quaternion_float_precision - /// @{ - - /// Quaternion of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef qua lowp_quat; - - /// Quaternion of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef qua mediump_quat; - - /// Quaternion of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef qua highp_quat; - - /// @} -} //namespace glm - diff --git a/3rdparty/glm/source/glm/ext/quaternion_geometric.hpp b/3rdparty/glm/source/glm/ext/quaternion_geometric.hpp deleted file mode 100644 index 6d98bbe..0000000 --- a/3rdparty/glm/source/glm/ext/quaternion_geometric.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/// @ref ext_quaternion_geometric -/// @file glm/ext/quaternion_geometric.hpp -/// -/// @defgroup ext_quaternion_geometric GLM_EXT_quaternion_geometric -/// @ingroup ext -/// -/// Provides geometric functions for quaternion types -/// -/// Include to use the features of this extension. -/// -/// @see core_geometric -/// @see ext_quaternion_float -/// @see ext_quaternion_double - -#pragma once - -// Dependency: -#include "../geometric.hpp" -#include "../exponential.hpp" -#include "../ext/vector_relational.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_quaternion_geometric extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_quaternion_geometric - /// @{ - - /// Returns the norm of a quaternions - /// - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see ext_quaternion_geometric - template - GLM_FUNC_DECL T length(qua const& q); - - /// Returns the normalized quaternion. - /// - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see ext_quaternion_geometric - template - GLM_FUNC_DECL qua normalize(qua const& q); - - /// Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ... - /// - /// @tparam T Floating-point scalar types. - /// @tparam Q Value from qualifier enum - /// - /// @see ext_quaternion_geometric - template - GLM_FUNC_DECL T dot(qua const& x, qua const& y); - - /// Compute a cross product. - /// - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see ext_quaternion_geometric - template - GLM_FUNC_QUALIFIER qua cross(qua const& q1, qua const& q2); - - /// @} -} //namespace glm - -#include "quaternion_geometric.inl" diff --git a/3rdparty/glm/source/glm/ext/quaternion_geometric.inl b/3rdparty/glm/source/glm/ext/quaternion_geometric.inl deleted file mode 100644 index e155ac5..0000000 --- a/3rdparty/glm/source/glm/ext/quaternion_geometric.inl +++ /dev/null @@ -1,36 +0,0 @@ -namespace glm -{ - template - GLM_FUNC_QUALIFIER T dot(qua const& x, qua const& y) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'dot' accepts only floating-point inputs"); - return detail::compute_dot, T, detail::is_aligned::value>::call(x, y); - } - - template - GLM_FUNC_QUALIFIER T length(qua const& q) - { - return glm::sqrt(dot(q, q)); - } - - template - GLM_FUNC_QUALIFIER qua normalize(qua const& q) - { - T len = length(q); - if(len <= static_cast(0)) // Problem - return qua(static_cast(1), static_cast(0), static_cast(0), static_cast(0)); - T oneOverLen = static_cast(1) / len; - return qua(q.w * oneOverLen, q.x * oneOverLen, q.y * oneOverLen, q.z * oneOverLen); - } - - template - GLM_FUNC_QUALIFIER qua cross(qua const& q1, qua const& q2) - { - return qua( - q1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z, - q1.w * q2.x + q1.x * q2.w + q1.y * q2.z - q1.z * q2.y, - q1.w * q2.y + q1.y * q2.w + q1.z * q2.x - q1.x * q2.z, - q1.w * q2.z + q1.z * q2.w + q1.x * q2.y - q1.y * q2.x); - } -}//namespace glm - diff --git a/3rdparty/glm/source/glm/ext/quaternion_relational.hpp b/3rdparty/glm/source/glm/ext/quaternion_relational.hpp deleted file mode 100644 index 7aa121d..0000000 --- a/3rdparty/glm/source/glm/ext/quaternion_relational.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/// @ref ext_quaternion_relational -/// @file glm/ext/quaternion_relational.hpp -/// -/// @defgroup ext_quaternion_relational GLM_EXT_quaternion_relational -/// @ingroup ext -/// -/// Exposes comparison functions for quaternion types that take a user defined epsilon values. -/// -/// Include to use the features of this extension. -/// -/// @see core_vector_relational -/// @see ext_vector_relational -/// @see ext_matrix_relational -/// @see ext_quaternion_float -/// @see ext_quaternion_double - -#pragma once - -// Dependency: -#include "../vector_relational.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_quaternion_relational extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_quaternion_relational - /// @{ - - /// Returns the component-wise comparison of result x == y. - /// - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL vec<4, bool, Q> equal(qua const& x, qua const& y); - - /// Returns the component-wise comparison of |x - y| < epsilon. - /// - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL vec<4, bool, Q> equal(qua const& x, qua const& y, T epsilon); - - /// Returns the component-wise comparison of result x != y. - /// - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL vec<4, bool, Q> notEqual(qua const& x, qua const& y); - - /// Returns the component-wise comparison of |x - y| >= epsilon. - /// - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL vec<4, bool, Q> notEqual(qua const& x, qua const& y, T epsilon); - - /// @} -} //namespace glm - -#include "quaternion_relational.inl" diff --git a/3rdparty/glm/source/glm/ext/quaternion_relational.inl b/3rdparty/glm/source/glm/ext/quaternion_relational.inl deleted file mode 100644 index b1713e9..0000000 --- a/3rdparty/glm/source/glm/ext/quaternion_relational.inl +++ /dev/null @@ -1,35 +0,0 @@ -namespace glm -{ - template - GLM_FUNC_QUALIFIER vec<4, bool, Q> equal(qua const& x, qua const& y) - { - vec<4, bool, Q> Result; - for(length_t i = 0; i < x.length(); ++i) - Result[i] = x[i] == y[i]; - return Result; - } - - template - GLM_FUNC_QUALIFIER vec<4, bool, Q> equal(qua const& x, qua const& y, T epsilon) - { - vec<4, T, Q> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); - return lessThan(abs(v), vec<4, T, Q>(epsilon)); - } - - template - GLM_FUNC_QUALIFIER vec<4, bool, Q> notEqual(qua const& x, qua const& y) - { - vec<4, bool, Q> Result; - for(length_t i = 0; i < x.length(); ++i) - Result[i] = x[i] != y[i]; - return Result; - } - - template - GLM_FUNC_QUALIFIER vec<4, bool, Q> notEqual(qua const& x, qua const& y, T epsilon) - { - vec<4, T, Q> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); - return greaterThanEqual(abs(v), vec<4, T, Q>(epsilon)); - } -}//namespace glm - diff --git a/3rdparty/glm/source/glm/ext/quaternion_transform.hpp b/3rdparty/glm/source/glm/ext/quaternion_transform.hpp deleted file mode 100644 index a9cc5c2..0000000 --- a/3rdparty/glm/source/glm/ext/quaternion_transform.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/// @ref ext_quaternion_transform -/// @file glm/ext/quaternion_transform.hpp -/// -/// @defgroup ext_quaternion_transform GLM_EXT_quaternion_transform -/// @ingroup ext -/// -/// Provides transformation functions for quaternion types -/// -/// Include to use the features of this extension. -/// -/// @see ext_quaternion_float -/// @see ext_quaternion_double -/// @see ext_quaternion_exponential -/// @see ext_quaternion_geometric -/// @see ext_quaternion_relational -/// @see ext_quaternion_trigonometric - -#pragma once - -// Dependency: -#include "../common.hpp" -#include "../trigonometric.hpp" -#include "../geometric.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_quaternion_transform extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_quaternion_transform - /// @{ - - /// Rotates a quaternion from a vector of 3 components axis and an angle. - /// - /// @param q Source orientation - /// @param angle Angle expressed in radians. - /// @param axis Axis of the rotation - /// - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL qua rotate(qua const& q, T const& angle, vec<3, T, Q> const& axis); - /// @} -} //namespace glm - -#include "quaternion_transform.inl" diff --git a/3rdparty/glm/source/glm/ext/quaternion_transform.inl b/3rdparty/glm/source/glm/ext/quaternion_transform.inl deleted file mode 100644 index b87ecb6..0000000 --- a/3rdparty/glm/source/glm/ext/quaternion_transform.inl +++ /dev/null @@ -1,24 +0,0 @@ -namespace glm -{ - template - GLM_FUNC_QUALIFIER qua rotate(qua const& q, T const& angle, vec<3, T, Q> const& v) - { - vec<3, T, Q> Tmp = v; - - // Axis of rotation must be normalised - T len = glm::length(Tmp); - if(abs(len - static_cast(1)) > static_cast(0.001)) - { - T oneOverLen = static_cast(1) / len; - Tmp.x *= oneOverLen; - Tmp.y *= oneOverLen; - Tmp.z *= oneOverLen; - } - - T const AngleRad(angle); - T const Sin = sin(AngleRad * static_cast(0.5)); - - return q * qua(cos(AngleRad * static_cast(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin); - } -}//namespace glm - diff --git a/3rdparty/glm/source/glm/ext/quaternion_trigonometric.hpp b/3rdparty/glm/source/glm/ext/quaternion_trigonometric.hpp deleted file mode 100644 index 76cea27..0000000 --- a/3rdparty/glm/source/glm/ext/quaternion_trigonometric.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/// @ref ext_quaternion_trigonometric -/// @file glm/ext/quaternion_trigonometric.hpp -/// -/// @defgroup ext_quaternion_trigonometric GLM_EXT_quaternion_trigonometric -/// @ingroup ext -/// -/// Provides trigonometric functions for quaternion types -/// -/// Include to use the features of this extension. -/// -/// @see ext_quaternion_float -/// @see ext_quaternion_double -/// @see ext_quaternion_exponential -/// @see ext_quaternion_geometric -/// @see ext_quaternion_relational -/// @see ext_quaternion_transform - -#pragma once - -// Dependency: -#include "../trigonometric.hpp" -#include "../exponential.hpp" -#include "scalar_constants.hpp" -#include "vector_relational.hpp" -#include - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_quaternion_trigonometric extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_quaternion_trigonometric - /// @{ - - /// Returns the quaternion rotation angle. - /// - /// @tparam T A floating-point scalar type - /// @tparam Q A value from qualifier enum - template - GLM_FUNC_DECL T angle(qua const& x); - - /// Returns the q rotation axis. - /// - /// @tparam T A floating-point scalar type - /// @tparam Q A value from qualifier enum - template - GLM_FUNC_DECL vec<3, T, Q> axis(qua const& x); - - /// Build a quaternion from an angle and a normalized axis. - /// - /// @param angle Angle expressed in radians. - /// @param axis Axis of the quaternion, must be normalized. - /// - /// @tparam T A floating-point scalar type - /// @tparam Q A value from qualifier enum - template - GLM_FUNC_DECL qua angleAxis(T const& angle, vec<3, T, Q> const& axis); - - /// @} -} //namespace glm - -#include "quaternion_trigonometric.inl" diff --git a/3rdparty/glm/source/glm/ext/quaternion_trigonometric.inl b/3rdparty/glm/source/glm/ext/quaternion_trigonometric.inl deleted file mode 100644 index 896449a..0000000 --- a/3rdparty/glm/source/glm/ext/quaternion_trigonometric.inl +++ /dev/null @@ -1,37 +0,0 @@ -#include "scalar_constants.hpp" - -namespace glm -{ - template - GLM_FUNC_QUALIFIER T angle(qua const& x) - { - if (abs(x.w) > cos_one_over_two()) - { - T const a = asin(sqrt(x.x * x.x + x.y * x.y + x.z * x.z)) * static_cast(2); - if(x.w < static_cast(0)) - return pi() * static_cast(2) - a; - return a; - } - - return acos(x.w) * static_cast(2); - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> axis(qua const& x) - { - T const tmp1 = static_cast(1) - x.w * x.w; - if(tmp1 <= static_cast(0)) - return vec<3, T, Q>(0, 0, 1); - T const tmp2 = static_cast(1) / sqrt(tmp1); - return vec<3, T, Q>(x.x * tmp2, x.y * tmp2, x.z * tmp2); - } - - template - GLM_FUNC_QUALIFIER qua angleAxis(T const& angle, vec<3, T, Q> const& v) - { - T const a(angle); - T const s = glm::sin(a * static_cast(0.5)); - - return qua(glm::cos(a * static_cast(0.5)), v * s); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/scalar_common.hpp b/3rdparty/glm/source/glm/ext/scalar_common.hpp deleted file mode 100644 index df04b6b..0000000 --- a/3rdparty/glm/source/glm/ext/scalar_common.hpp +++ /dev/null @@ -1,181 +0,0 @@ -/// @ref ext_scalar_common -/// @file glm/ext/scalar_common.hpp -/// -/// @defgroup ext_scalar_common GLM_EXT_scalar_common -/// @ingroup ext -/// -/// Exposes min and max functions for 3 to 4 scalar parameters. -/// -/// Include to use the features of this extension. -/// -/// @see core_func_common -/// @see ext_vector_common - -#pragma once - -// Dependency: -#include "../common.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_scalar_common extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_scalar_common - /// @{ - - /// Returns the minimum component-wise values of 3 inputs - /// - /// @tparam T A floating-point scalar type. - /// - /// @see ext_scalar_common - template - GLM_FUNC_DECL T min(T a, T b, T c); - - /// Returns the minimum component-wise values of 4 inputs - /// - /// @tparam T A floating-point scalar type. - /// - /// @see ext_scalar_common - template - GLM_FUNC_DECL T min(T a, T b, T c, T d); - - /// Returns the maximum component-wise values of 3 inputs - /// - /// @tparam T A floating-point scalar type. - /// - /// @see ext_scalar_common - template - GLM_FUNC_DECL T max(T a, T b, T c); - - /// Returns the maximum component-wise values of 4 inputs - /// - /// @tparam T A floating-point scalar type. - /// - /// @see ext_scalar_common - template - GLM_FUNC_DECL T max(T a, T b, T c, T d); - - /// Returns the minimum component-wise values of 2 inputs. If one of the two arguments is NaN, the value of the other argument is returned. - /// - /// @tparam T A floating-point scalar type. - /// - /// @see std::fmin documentation - /// @see ext_scalar_common - template - GLM_FUNC_DECL T fmin(T a, T b); - - /// Returns the minimum component-wise values of 3 inputs. If one of the two arguments is NaN, the value of the other argument is returned. - /// - /// @tparam T A floating-point scalar type. - /// - /// @see std::fmin documentation - /// @see ext_scalar_common - template - GLM_FUNC_DECL T fmin(T a, T b, T c); - - /// Returns the minimum component-wise values of 4 inputs. If one of the two arguments is NaN, the value of the other argument is returned. - /// - /// @tparam T A floating-point scalar type. - /// - /// @see std::fmin documentation - /// @see ext_scalar_common - template - GLM_FUNC_DECL T fmin(T a, T b, T c, T d); - - /// Returns the maximum component-wise values of 2 inputs. If one of the two arguments is NaN, the value of the other argument is returned. - /// - /// @tparam T A floating-point scalar type. - /// - /// @see std::fmax documentation - /// @see ext_scalar_common - template - GLM_FUNC_DECL T fmax(T a, T b); - - /// Returns the maximum component-wise values of 3 inputs. If one of the two arguments is NaN, the value of the other argument is returned. - /// - /// @tparam T A floating-point scalar type. - /// - /// @see std::fmax documentation - /// @see ext_scalar_common - template - GLM_FUNC_DECL T fmax(T a, T b, T C); - - /// Returns the maximum component-wise values of 4 inputs. If one of the two arguments is NaN, the value of the other argument is returned. - /// - /// @tparam T A floating-point scalar type. - /// - /// @see std::fmax documentation - /// @see ext_scalar_common - template - GLM_FUNC_DECL T fmax(T a, T b, T C, T D); - - /// Returns min(max(x, minVal), maxVal) for each component in x. If one of the two arguments is NaN, the value of the other argument is returned. - /// - /// @tparam genType Floating-point scalar types. - /// - /// @see ext_scalar_common - template - GLM_FUNC_DECL genType fclamp(genType x, genType minVal, genType maxVal); - - /// Simulate GL_CLAMP OpenGL wrap mode - /// - /// @tparam genType Floating-point scalar types. - /// - /// @see ext_scalar_common extension. - template - GLM_FUNC_DECL genType clamp(genType const& Texcoord); - - /// Simulate GL_REPEAT OpenGL wrap mode - /// - /// @tparam genType Floating-point scalar types. - /// - /// @see ext_scalar_common extension. - template - GLM_FUNC_DECL genType repeat(genType const& Texcoord); - - /// Simulate GL_MIRRORED_REPEAT OpenGL wrap mode - /// - /// @tparam genType Floating-point scalar types. - /// - /// @see ext_scalar_common extension. - template - GLM_FUNC_DECL genType mirrorClamp(genType const& Texcoord); - - /// Simulate GL_MIRROR_REPEAT OpenGL wrap mode - /// - /// @tparam genType Floating-point scalar types. - /// - /// @see ext_scalar_common extension. - template - GLM_FUNC_DECL genType mirrorRepeat(genType const& Texcoord); - - /// Returns a value equal to the nearest integer to x. - /// The fraction 0.5 will round in a direction chosen by the - /// implementation, presumably the direction that is fastest. - /// - /// @param x The values of the argument must be greater or equal to zero. - /// @tparam genType floating point scalar types. - /// - /// @see GLSL round man page - /// @see ext_scalar_common extension. - template - GLM_FUNC_DECL int iround(genType const& x); - - /// Returns a value equal to the nearest integer to x. - /// The fraction 0.5 will round in a direction chosen by the - /// implementation, presumably the direction that is fastest. - /// - /// @param x The values of the argument must be greater or equal to zero. - /// @tparam genType floating point scalar types. - /// - /// @see GLSL round man page - /// @see ext_scalar_common extension. - template - GLM_FUNC_DECL uint uround(genType const& x); - - /// @} -}//namespace glm - -#include "scalar_common.inl" diff --git a/3rdparty/glm/source/glm/ext/scalar_common.inl b/3rdparty/glm/source/glm/ext/scalar_common.inl deleted file mode 100644 index 2807a37..0000000 --- a/3rdparty/glm/source/glm/ext/scalar_common.inl +++ /dev/null @@ -1,170 +0,0 @@ -namespace glm -{ - template - GLM_FUNC_QUALIFIER T min(T a, T b, T c) - { - return glm::min(glm::min(a, b), c); - } - - template - GLM_FUNC_QUALIFIER T min(T a, T b, T c, T d) - { - return glm::min(glm::min(a, b), glm::min(c, d)); - } - - template - GLM_FUNC_QUALIFIER T max(T a, T b, T c) - { - return glm::max(glm::max(a, b), c); - } - - template - GLM_FUNC_QUALIFIER T max(T a, T b, T c, T d) - { - return glm::max(glm::max(a, b), glm::max(c, d)); - } - -# if GLM_HAS_CXX11_STL - using std::fmin; -# else - template - GLM_FUNC_QUALIFIER T fmin(T a, T b) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point input"); - - if (isnan(a)) - return b; - return min(a, b); - } -# endif - - template - GLM_FUNC_QUALIFIER T fmin(T a, T b, T c) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point input"); - - if (isnan(a)) - return fmin(b, c); - if (isnan(b)) - return fmin(a, c); - if (isnan(c)) - return min(a, b); - return min(a, b, c); - } - - template - GLM_FUNC_QUALIFIER T fmin(T a, T b, T c, T d) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point input"); - - if (isnan(a)) - return fmin(b, c, d); - if (isnan(b)) - return min(a, fmin(c, d)); - if (isnan(c)) - return fmin(min(a, b), d); - if (isnan(d)) - return min(a, b, c); - return min(a, b, c, d); - } - - -# if GLM_HAS_CXX11_STL - using std::fmax; -# else - template - GLM_FUNC_QUALIFIER T fmax(T a, T b) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point input"); - - if (isnan(a)) - return b; - return max(a, b); - } -# endif - - template - GLM_FUNC_QUALIFIER T fmax(T a, T b, T c) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point input"); - - if (isnan(a)) - return fmax(b, c); - if (isnan(b)) - return fmax(a, c); - if (isnan(c)) - return max(a, b); - return max(a, b, c); - } - - template - GLM_FUNC_QUALIFIER T fmax(T a, T b, T c, T d) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point input"); - - if (isnan(a)) - return fmax(b, c, d); - if (isnan(b)) - return max(a, fmax(c, d)); - if (isnan(c)) - return fmax(max(a, b), d); - if (isnan(d)) - return max(a, b, c); - return max(a, b, c, d); - } - - // fclamp - template - GLM_FUNC_QUALIFIER genType fclamp(genType x, genType minVal, genType maxVal) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fclamp' only accept floating-point or integer inputs"); - return fmin(fmax(x, minVal), maxVal); - } - - template - GLM_FUNC_QUALIFIER genType clamp(genType const& Texcoord) - { - return glm::clamp(Texcoord, static_cast(0), static_cast(1)); - } - - template - GLM_FUNC_QUALIFIER genType repeat(genType const& Texcoord) - { - return glm::fract(Texcoord); - } - - template - GLM_FUNC_QUALIFIER genType mirrorClamp(genType const& Texcoord) - { - return glm::fract(glm::abs(Texcoord)); - } - - template - GLM_FUNC_QUALIFIER genType mirrorRepeat(genType const& Texcoord) - { - genType const Abs = glm::abs(Texcoord); - genType const Clamp = glm::mod(glm::floor(Abs), static_cast(2)); - genType const Floor = glm::floor(Abs); - genType const Rest = Abs - Floor; - genType const Mirror = Clamp + Rest; - return mix(Rest, static_cast(1) - Rest, Mirror >= static_cast(1)); - } - - template - GLM_FUNC_QUALIFIER int iround(genType const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'iround' only accept floating-point inputs"); - assert(static_cast(0.0) <= x); - - return static_cast(x + static_cast(0.5)); - } - - template - GLM_FUNC_QUALIFIER uint uround(genType const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'uround' only accept floating-point inputs"); - assert(static_cast(0.0) <= x); - - return static_cast(x + static_cast(0.5)); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/scalar_constants.hpp b/3rdparty/glm/source/glm/ext/scalar_constants.hpp deleted file mode 100644 index 74e210d..0000000 --- a/3rdparty/glm/source/glm/ext/scalar_constants.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/// @ref ext_scalar_constants -/// @file glm/ext/scalar_constants.hpp -/// -/// @defgroup ext_scalar_constants GLM_EXT_scalar_constants -/// @ingroup ext -/// -/// Provides a list of constants and precomputed useful values. -/// -/// Include to use the features of this extension. - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_scalar_constants extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_scalar_constants - /// @{ - - /// Return the epsilon constant for floating point types. - template - GLM_FUNC_DECL GLM_CONSTEXPR genType epsilon(); - - /// Return the pi constant for floating point types. - template - GLM_FUNC_DECL GLM_CONSTEXPR genType pi(); - - /// Return the value of cos(1 / 2) for floating point types. - template - GLM_FUNC_DECL GLM_CONSTEXPR genType cos_one_over_two(); - - /// @} -} //namespace glm - -#include "scalar_constants.inl" diff --git a/3rdparty/glm/source/glm/ext/scalar_constants.inl b/3rdparty/glm/source/glm/ext/scalar_constants.inl deleted file mode 100644 index b475adf..0000000 --- a/3rdparty/glm/source/glm/ext/scalar_constants.inl +++ /dev/null @@ -1,24 +0,0 @@ -#include - -namespace glm -{ - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType epsilon() - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'epsilon' only accepts floating-point inputs"); - return std::numeric_limits::epsilon(); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType pi() - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'pi' only accepts floating-point inputs"); - return static_cast(3.14159265358979323846264338327950288); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType cos_one_over_two() - { - return genType(0.877582561890372716130286068203503191); - } -} //namespace glm diff --git a/3rdparty/glm/source/glm/ext/scalar_int_sized.hpp b/3rdparty/glm/source/glm/ext/scalar_int_sized.hpp deleted file mode 100644 index 8e9c511..0000000 --- a/3rdparty/glm/source/glm/ext/scalar_int_sized.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/// @ref ext_scalar_int_sized -/// @file glm/ext/scalar_int_sized.hpp -/// -/// @defgroup ext_scalar_int_sized GLM_EXT_scalar_int_sized -/// @ingroup ext -/// -/// Exposes sized signed integer scalar types. -/// -/// Include to use the features of this extension. -/// -/// @see ext_scalar_uint_sized - -#pragma once - -#include "../detail/setup.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_scalar_int_sized extension included") -#endif - -namespace glm{ -namespace detail -{ -# if GLM_HAS_EXTENDED_INTEGER_TYPE - typedef std::int8_t int8; - typedef std::int16_t int16; - typedef std::int32_t int32; -# else - typedef signed char int8; - typedef signed short int16; - typedef signed int int32; -#endif// - - template<> - struct is_int - { - enum test {value = ~0}; - }; - - template<> - struct is_int - { - enum test {value = ~0}; - }; - - template<> - struct is_int - { - enum test {value = ~0}; - }; -}//namespace detail - - - /// @addtogroup ext_scalar_int_sized - /// @{ - - /// 8 bit signed integer type. - typedef detail::int8 int8; - - /// 16 bit signed integer type. - typedef detail::int16 int16; - - /// 32 bit signed integer type. - typedef detail::int32 int32; - - /// 64 bit signed integer type. - typedef detail::int64 int64; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/scalar_integer.hpp b/3rdparty/glm/source/glm/ext/scalar_integer.hpp deleted file mode 100644 index a2ca8a2..0000000 --- a/3rdparty/glm/source/glm/ext/scalar_integer.hpp +++ /dev/null @@ -1,92 +0,0 @@ -/// @ref ext_scalar_integer -/// @file glm/ext/scalar_integer.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_scalar_integer GLM_EXT_scalar_integer -/// @ingroup ext -/// -/// Include to use the features of this extension. - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" -#include "../detail/qualifier.hpp" -#include "../detail/_vectorize.hpp" -#include "../detail/type_float.hpp" -#include "../vector_relational.hpp" -#include "../common.hpp" -#include - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_scalar_integer extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_scalar_integer - /// @{ - - /// Return true if the value is a power of two number. - /// - /// @see ext_scalar_integer - template - GLM_FUNC_DECL bool isPowerOfTwo(genIUType v); - - /// Return the power of two number which value is just higher the input value, - /// round up to a power of two. - /// - /// @see ext_scalar_integer - template - GLM_FUNC_DECL genIUType nextPowerOfTwo(genIUType v); - - /// Return the power of two number which value is just lower the input value, - /// round down to a power of two. - /// - /// @see ext_scalar_integer - template - GLM_FUNC_DECL genIUType prevPowerOfTwo(genIUType v); - - /// Return true if the 'Value' is a multiple of 'Multiple'. - /// - /// @see ext_scalar_integer - template - GLM_FUNC_DECL bool isMultiple(genIUType v, genIUType Multiple); - - /// Higher multiple number of Source. - /// - /// @tparam genIUType Integer scalar or vector types. - /// - /// @param v Source value to which is applied the function - /// @param Multiple Must be a null or positive value - /// - /// @see ext_scalar_integer - template - GLM_FUNC_DECL genIUType nextMultiple(genIUType v, genIUType Multiple); - - /// Lower multiple number of Source. - /// - /// @tparam genIUType Integer scalar or vector types. - /// - /// @param v Source value to which is applied the function - /// @param Multiple Must be a null or positive value - /// - /// @see ext_scalar_integer - template - GLM_FUNC_DECL genIUType prevMultiple(genIUType v, genIUType Multiple); - - /// Returns the bit number of the Nth significant bit set to - /// 1 in the binary representation of value. - /// If value bitcount is less than the Nth significant bit, -1 will be returned. - /// - /// @tparam genIUType Signed or unsigned integer scalar types. - /// - /// @see ext_scalar_integer - template - GLM_FUNC_DECL int findNSB(genIUType x, int significantBitCount); - - /// @} -} //namespace glm - -#include "scalar_integer.inl" diff --git a/3rdparty/glm/source/glm/ext/scalar_integer.inl b/3rdparty/glm/source/glm/ext/scalar_integer.inl deleted file mode 100644 index efba960..0000000 --- a/3rdparty/glm/source/glm/ext/scalar_integer.inl +++ /dev/null @@ -1,243 +0,0 @@ -#include "../integer.hpp" - -namespace glm{ -namespace detail -{ - template - struct compute_ceilShift - { - GLM_FUNC_QUALIFIER static vec call(vec const& v, T) - { - return v; - } - }; - - template - struct compute_ceilShift - { - GLM_FUNC_QUALIFIER static vec call(vec const& v, T Shift) - { - return v | (v >> Shift); - } - }; - - template - struct compute_ceilPowerOfTwo - { - GLM_FUNC_QUALIFIER static vec call(vec const& x) - { - GLM_STATIC_ASSERT(!std::numeric_limits::is_iec559, "'ceilPowerOfTwo' only accept integer scalar or vector inputs"); - - vec const Sign(sign(x)); - - vec v(abs(x)); - - v = v - static_cast(1); - v = v | (v >> static_cast(1)); - v = v | (v >> static_cast(2)); - v = v | (v >> static_cast(4)); - v = compute_ceilShift= 2>::call(v, 8); - v = compute_ceilShift= 4>::call(v, 16); - v = compute_ceilShift= 8>::call(v, 32); - return (v + static_cast(1)) * Sign; - } - }; - - template - struct compute_ceilPowerOfTwo - { - GLM_FUNC_QUALIFIER static vec call(vec const& x) - { - GLM_STATIC_ASSERT(!std::numeric_limits::is_iec559, "'ceilPowerOfTwo' only accept integer scalar or vector inputs"); - - vec v(x); - - v = v - static_cast(1); - v = v | (v >> static_cast(1)); - v = v | (v >> static_cast(2)); - v = v | (v >> static_cast(4)); - v = compute_ceilShift= 2>::call(v, 8); - v = compute_ceilShift= 4>::call(v, 16); - v = compute_ceilShift= 8>::call(v, 32); - return v + static_cast(1); - } - }; - - template - struct compute_ceilMultiple{}; - - template<> - struct compute_ceilMultiple - { - template - GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) - { - if(Source > genType(0)) - return Source + (Multiple - std::fmod(Source, Multiple)); - else - return Source + std::fmod(-Source, Multiple); - } - }; - - template<> - struct compute_ceilMultiple - { - template - GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) - { - genType Tmp = Source - genType(1); - return Tmp + (Multiple - (Tmp % Multiple)); - } - }; - - template<> - struct compute_ceilMultiple - { - template - GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) - { - assert(Multiple > genType(0)); - if(Source > genType(0)) - { - genType Tmp = Source - genType(1); - return Tmp + (Multiple - (Tmp % Multiple)); - } - else - return Source + (-Source % Multiple); - } - }; - - template - struct compute_floorMultiple{}; - - template<> - struct compute_floorMultiple - { - template - GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) - { - if(Source >= genType(0)) - return Source - std::fmod(Source, Multiple); - else - return Source - std::fmod(Source, Multiple) - Multiple; - } - }; - - template<> - struct compute_floorMultiple - { - template - GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) - { - if(Source >= genType(0)) - return Source - Source % Multiple; - else - { - genType Tmp = Source + genType(1); - return Tmp - Tmp % Multiple - Multiple; - } - } - }; - - template<> - struct compute_floorMultiple - { - template - GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) - { - if(Source >= genType(0)) - return Source - Source % Multiple; - else - { - genType Tmp = Source + genType(1); - return Tmp - Tmp % Multiple - Multiple; - } - } - }; -}//namespace detail - - template - GLM_FUNC_QUALIFIER bool isPowerOfTwo(genIUType Value) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'isPowerOfTwo' only accept integer inputs"); - - genIUType const Result = glm::abs(Value); - return !(Result & (Result - 1)); - } - - template - GLM_FUNC_QUALIFIER genIUType nextPowerOfTwo(genIUType value) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'nextPowerOfTwo' only accept integer inputs"); - - return detail::compute_ceilPowerOfTwo<1, genIUType, defaultp, std::numeric_limits::is_signed>::call(vec<1, genIUType, defaultp>(value)).x; - } - - template - GLM_FUNC_QUALIFIER genIUType prevPowerOfTwo(genIUType value) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'prevPowerOfTwo' only accept integer inputs"); - - return isPowerOfTwo(value) ? value : static_cast(static_cast(1) << static_cast(findMSB(value))); - } - - template - GLM_FUNC_QUALIFIER bool isMultiple(genIUType Value, genIUType Multiple) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'isMultiple' only accept integer inputs"); - - return isMultiple(vec<1, genIUType>(Value), vec<1, genIUType>(Multiple)).x; - } - - template - GLM_FUNC_QUALIFIER genIUType nextMultiple(genIUType Source, genIUType Multiple) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'nextMultiple' only accept integer inputs"); - - return detail::compute_ceilMultiple::is_iec559, std::numeric_limits::is_signed>::call(Source, Multiple); - } - - template - GLM_FUNC_QUALIFIER genIUType prevMultiple(genIUType Source, genIUType Multiple) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'prevMultiple' only accept integer inputs"); - - return detail::compute_floorMultiple::is_iec559, std::numeric_limits::is_signed>::call(Source, Multiple); - } - - template - GLM_FUNC_QUALIFIER int findNSB(genIUType x, int significantBitCount) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findNSB' only accept integer inputs"); - - if(bitCount(x) < significantBitCount) - return -1; - - genIUType const One = static_cast(1); - int bitPos = 0; - - genIUType key = x; - int nBitCount = significantBitCount; - int Step = sizeof(x) * 8 / 2; - while (key > One) - { - genIUType Mask = static_cast((One << Step) - One); - genIUType currentKey = key & Mask; - int currentBitCount = bitCount(currentKey); - if (nBitCount > currentBitCount) - { - nBitCount -= currentBitCount; - bitPos += Step; - key >>= static_cast(Step); - } - else - { - key = key & Mask; - } - - Step >>= 1; - } - - return static_cast(bitPos); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/scalar_packing.hpp b/3rdparty/glm/source/glm/ext/scalar_packing.hpp deleted file mode 100644 index 18b85b7..0000000 --- a/3rdparty/glm/source/glm/ext/scalar_packing.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/// @ref ext_scalar_packing -/// @file glm/ext/scalar_packing.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_scalar_packing GLM_EXT_scalar_packing -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// This extension provides a set of function to convert scalar values to packed -/// formats. - -#pragma once - -// Dependency: -#include "../detail/qualifier.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_scalar_packing extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_scalar_packing - /// @{ - - - /// @} -}// namespace glm - -#include "scalar_packing.inl" diff --git a/3rdparty/glm/source/glm/ext/scalar_packing.inl b/3rdparty/glm/source/glm/ext/scalar_packing.inl deleted file mode 100644 index e69de29..0000000 diff --git a/3rdparty/glm/source/glm/ext/scalar_reciprocal.hpp b/3rdparty/glm/source/glm/ext/scalar_reciprocal.hpp deleted file mode 100644 index 1c7b81d..0000000 --- a/3rdparty/glm/source/glm/ext/scalar_reciprocal.hpp +++ /dev/null @@ -1,135 +0,0 @@ -/// @ref ext_scalar_reciprocal -/// @file glm/ext/scalar_reciprocal.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_scalar_reciprocal GLM_EXT_scalar_reciprocal -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Define secant, cosecant and cotangent functions. - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_scalar_reciprocal extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_scalar_reciprocal - /// @{ - - /// Secant function. - /// hypotenuse / adjacent or 1 / cos(x) - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see ext_scalar_reciprocal - template - GLM_FUNC_DECL genType sec(genType angle); - - /// Cosecant function. - /// hypotenuse / opposite or 1 / sin(x) - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see ext_scalar_reciprocal - template - GLM_FUNC_DECL genType csc(genType angle); - - /// Cotangent function. - /// adjacent / opposite or 1 / tan(x) - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see ext_scalar_reciprocal - template - GLM_FUNC_DECL genType cot(genType angle); - - /// Inverse secant function. - /// - /// @return Return an angle expressed in radians. - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see ext_scalar_reciprocal - template - GLM_FUNC_DECL genType asec(genType x); - - /// Inverse cosecant function. - /// - /// @return Return an angle expressed in radians. - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see ext_scalar_reciprocal - template - GLM_FUNC_DECL genType acsc(genType x); - - /// Inverse cotangent function. - /// - /// @return Return an angle expressed in radians. - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see ext_scalar_reciprocal - template - GLM_FUNC_DECL genType acot(genType x); - - /// Secant hyperbolic function. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see ext_scalar_reciprocal - template - GLM_FUNC_DECL genType sech(genType angle); - - /// Cosecant hyperbolic function. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see ext_scalar_reciprocal - template - GLM_FUNC_DECL genType csch(genType angle); - - /// Cotangent hyperbolic function. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see ext_scalar_reciprocal - template - GLM_FUNC_DECL genType coth(genType angle); - - /// Inverse secant hyperbolic function. - /// - /// @return Return an angle expressed in radians. - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see ext_scalar_reciprocal - template - GLM_FUNC_DECL genType asech(genType x); - - /// Inverse cosecant hyperbolic function. - /// - /// @return Return an angle expressed in radians. - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see ext_scalar_reciprocal - template - GLM_FUNC_DECL genType acsch(genType x); - - /// Inverse cotangent hyperbolic function. - /// - /// @return Return an angle expressed in radians. - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see ext_scalar_reciprocal - template - GLM_FUNC_DECL genType acoth(genType x); - - /// @} -}//namespace glm - -#include "scalar_reciprocal.inl" diff --git a/3rdparty/glm/source/glm/ext/scalar_reciprocal.inl b/3rdparty/glm/source/glm/ext/scalar_reciprocal.inl deleted file mode 100644 index 570a406..0000000 --- a/3rdparty/glm/source/glm/ext/scalar_reciprocal.inl +++ /dev/null @@ -1,107 +0,0 @@ -/// @ref ext_scalar_reciprocal - -#include "../trigonometric.hpp" -#include - -namespace glm -{ - // sec - template - GLM_FUNC_QUALIFIER genType sec(genType angle) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'sec' only accept floating-point values"); - return genType(1) / glm::cos(angle); - } - - // csc - template - GLM_FUNC_QUALIFIER genType csc(genType angle) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'csc' only accept floating-point values"); - return genType(1) / glm::sin(angle); - } - - // cot - template - GLM_FUNC_QUALIFIER genType cot(genType angle) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'cot' only accept floating-point values"); - - genType const pi_over_2 = genType(3.1415926535897932384626433832795 / 2.0); - return glm::tan(pi_over_2 - angle); - } - - // asec - template - GLM_FUNC_QUALIFIER genType asec(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'asec' only accept floating-point values"); - return acos(genType(1) / x); - } - - // acsc - template - GLM_FUNC_QUALIFIER genType acsc(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acsc' only accept floating-point values"); - return asin(genType(1) / x); - } - - // acot - template - GLM_FUNC_QUALIFIER genType acot(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acot' only accept floating-point values"); - - genType const pi_over_2 = genType(3.1415926535897932384626433832795 / 2.0); - return pi_over_2 - atan(x); - } - - // sech - template - GLM_FUNC_QUALIFIER genType sech(genType angle) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'sech' only accept floating-point values"); - return genType(1) / glm::cosh(angle); - } - - // csch - template - GLM_FUNC_QUALIFIER genType csch(genType angle) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'csch' only accept floating-point values"); - return genType(1) / glm::sinh(angle); - } - - // coth - template - GLM_FUNC_QUALIFIER genType coth(genType angle) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'coth' only accept floating-point values"); - return glm::cosh(angle) / glm::sinh(angle); - } - - // asech - template - GLM_FUNC_QUALIFIER genType asech(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'asech' only accept floating-point values"); - return acosh(genType(1) / x); - } - - // acsch - template - GLM_FUNC_QUALIFIER genType acsch(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acsch' only accept floating-point values"); - return asinh(genType(1) / x); - } - - // acoth - template - GLM_FUNC_QUALIFIER genType acoth(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acoth' only accept floating-point values"); - return atanh(genType(1) / x); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/scalar_relational.hpp b/3rdparty/glm/source/glm/ext/scalar_relational.hpp deleted file mode 100644 index 3076a5e..0000000 --- a/3rdparty/glm/source/glm/ext/scalar_relational.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/// @ref ext_scalar_relational -/// @file glm/ext/scalar_relational.hpp -/// -/// @defgroup ext_scalar_relational GLM_EXT_scalar_relational -/// @ingroup ext -/// -/// Exposes comparison functions for scalar types that take a user defined epsilon values. -/// -/// Include to use the features of this extension. -/// -/// @see core_vector_relational -/// @see ext_vector_relational -/// @see ext_matrix_relational - -#pragma once - -// Dependencies -#include "../detail/qualifier.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_scalar_relational extension included") -#endif - -namespace glm -{ - /// Returns the component-wise comparison of |x - y| < epsilon. - /// True if this expression is satisfied. - /// - /// @tparam genType Floating-point or integer scalar types - template - GLM_FUNC_DECL GLM_CONSTEXPR bool equal(genType const& x, genType const& y, genType const& epsilon); - - /// Returns the component-wise comparison of |x - y| >= epsilon. - /// True if this expression is not satisfied. - /// - /// @tparam genType Floating-point or integer scalar types - template - GLM_FUNC_DECL GLM_CONSTEXPR bool notEqual(genType const& x, genType const& y, genType const& epsilon); - - /// Returns the component-wise comparison between two scalars in term of ULPs. - /// True if this expression is satisfied. - /// - /// @param x First operand. - /// @param y Second operand. - /// @param ULPs Maximum difference in ULPs between the two operators to consider them equal. - /// - /// @tparam genType Floating-point or integer scalar types - template - GLM_FUNC_DECL GLM_CONSTEXPR bool equal(genType const& x, genType const& y, int ULPs); - - /// Returns the component-wise comparison between two scalars in term of ULPs. - /// True if this expression is not satisfied. - /// - /// @param x First operand. - /// @param y Second operand. - /// @param ULPs Maximum difference in ULPs between the two operators to consider them not equal. - /// - /// @tparam genType Floating-point or integer scalar types - template - GLM_FUNC_DECL GLM_CONSTEXPR bool notEqual(genType const& x, genType const& y, int ULPs); - - /// @} -}//namespace glm - -#include "scalar_relational.inl" diff --git a/3rdparty/glm/source/glm/ext/scalar_relational.inl b/3rdparty/glm/source/glm/ext/scalar_relational.inl deleted file mode 100644 index c85583e..0000000 --- a/3rdparty/glm/source/glm/ext/scalar_relational.inl +++ /dev/null @@ -1,40 +0,0 @@ -#include "../common.hpp" -#include "../ext/scalar_int_sized.hpp" -#include "../ext/scalar_uint_sized.hpp" -#include "../detail/type_float.hpp" - -namespace glm -{ - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool equal(genType const& x, genType const& y, genType const& epsilon) - { - return abs(x - y) <= epsilon; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool notEqual(genType const& x, genType const& y, genType const& epsilon) - { - return abs(x - y) > epsilon; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool equal(genType const& x, genType const& y, int MaxULPs) - { - detail::float_t const a(x); - detail::float_t const b(y); - - // Different signs means they do not match. - if(a.negative() != b.negative()) - return false; - - // Find the difference in ULPs. - typename detail::float_t::int_type const DiffULPs = abs(a.i - b.i); - return DiffULPs <= MaxULPs; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR bool notEqual(genType const& x, genType const& y, int ULPs) - { - return !equal(x, y, ULPs); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/scalar_uint_sized.hpp b/3rdparty/glm/source/glm/ext/scalar_uint_sized.hpp deleted file mode 100644 index fd5267f..0000000 --- a/3rdparty/glm/source/glm/ext/scalar_uint_sized.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/// @ref ext_scalar_uint_sized -/// @file glm/ext/scalar_uint_sized.hpp -/// -/// @defgroup ext_scalar_uint_sized GLM_EXT_scalar_uint_sized -/// @ingroup ext -/// -/// Exposes sized unsigned integer scalar types. -/// -/// Include to use the features of this extension. -/// -/// @see ext_scalar_int_sized - -#pragma once - -#include "../detail/setup.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_scalar_uint_sized extension included") -#endif - -namespace glm{ -namespace detail -{ -# if GLM_HAS_EXTENDED_INTEGER_TYPE - typedef std::uint8_t uint8; - typedef std::uint16_t uint16; - typedef std::uint32_t uint32; -# else - typedef unsigned char uint8; - typedef unsigned short uint16; - typedef unsigned int uint32; -#endif - - template<> - struct is_int - { - enum test {value = ~0}; - }; - - template<> - struct is_int - { - enum test {value = ~0}; - }; - - template<> - struct is_int - { - enum test {value = ~0}; - }; -}//namespace detail - - - /// @addtogroup ext_scalar_uint_sized - /// @{ - - /// 8 bit unsigned integer type. - typedef detail::uint8 uint8; - - /// 16 bit unsigned integer type. - typedef detail::uint16 uint16; - - /// 32 bit unsigned integer type. - typedef detail::uint32 uint32; - - /// 64 bit unsigned integer type. - typedef detail::uint64 uint64; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/scalar_ulp.hpp b/3rdparty/glm/source/glm/ext/scalar_ulp.hpp deleted file mode 100644 index 941ada3..0000000 --- a/3rdparty/glm/source/glm/ext/scalar_ulp.hpp +++ /dev/null @@ -1,74 +0,0 @@ -/// @ref ext_scalar_ulp -/// @file glm/ext/scalar_ulp.hpp -/// -/// @defgroup ext_scalar_ulp GLM_EXT_scalar_ulp -/// @ingroup ext -/// -/// Allow the measurement of the accuracy of a function against a reference -/// implementation. This extension works on floating-point data and provide results -/// in ULP. -/// -/// Include to use the features of this extension. -/// -/// @see ext_vector_ulp -/// @see ext_scalar_relational - -#pragma once - -// Dependencies -#include "../ext/scalar_int_sized.hpp" -#include "../common.hpp" -#include "../detail/qualifier.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_scalar_ulp extension included") -#endif - -namespace glm -{ - /// Return the next ULP value(s) after the input value(s). - /// - /// @tparam genType A floating-point scalar type. - /// - /// @see ext_scalar_ulp - template - GLM_FUNC_DECL genType nextFloat(genType x); - - /// Return the previous ULP value(s) before the input value(s). - /// - /// @tparam genType A floating-point scalar type. - /// - /// @see ext_scalar_ulp - template - GLM_FUNC_DECL genType prevFloat(genType x); - - /// Return the value(s) ULP distance after the input value(s). - /// - /// @tparam genType A floating-point scalar type. - /// - /// @see ext_scalar_ulp - template - GLM_FUNC_DECL genType nextFloat(genType x, int ULPs); - - /// Return the value(s) ULP distance before the input value(s). - /// - /// @tparam genType A floating-point scalar type. - /// - /// @see ext_scalar_ulp - template - GLM_FUNC_DECL genType prevFloat(genType x, int ULPs); - - /// Return the distance in the number of ULP between 2 single-precision floating-point scalars. - /// - /// @see ext_scalar_ulp - GLM_FUNC_DECL int floatDistance(float x, float y); - - /// Return the distance in the number of ULP between 2 double-precision floating-point scalars. - /// - /// @see ext_scalar_ulp - GLM_FUNC_DECL int64 floatDistance(double x, double y); - - /// @} -}//namespace glm - -#include "scalar_ulp.inl" diff --git a/3rdparty/glm/source/glm/ext/scalar_ulp.inl b/3rdparty/glm/source/glm/ext/scalar_ulp.inl deleted file mode 100644 index 308df15..0000000 --- a/3rdparty/glm/source/glm/ext/scalar_ulp.inl +++ /dev/null @@ -1,284 +0,0 @@ -/// Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. -/// -/// Developed at SunPro, a Sun Microsystems, Inc. business. -/// Permission to use, copy, modify, and distribute this -/// software is freely granted, provided that this notice -/// is preserved. - -#include "../detail/type_float.hpp" -#include "../ext/scalar_constants.hpp" -#include -#include - -#if(GLM_COMPILER & GLM_COMPILER_VC) -# pragma warning(push) -# pragma warning(disable : 4127) -#endif - -typedef union -{ - float value; - /* FIXME: Assumes 32 bit int. */ - unsigned int word; -} ieee_float_shape_type; - -typedef union -{ - double value; - struct - { - int lsw; - int msw; - } parts; -} ieee_double_shape_type; - -#define GLM_EXTRACT_WORDS(ix0,ix1,d) \ - do { \ - ieee_double_shape_type ew_u; \ - ew_u.value = (d); \ - (ix0) = ew_u.parts.msw; \ - (ix1) = ew_u.parts.lsw; \ - } while (0) - -#define GLM_GET_FLOAT_WORD(i,d) \ - do { \ - ieee_float_shape_type gf_u; \ - gf_u.value = (d); \ - (i) = gf_u.word; \ - } while (0) - -#define GLM_SET_FLOAT_WORD(d,i) \ - do { \ - ieee_float_shape_type sf_u; \ - sf_u.word = (i); \ - (d) = sf_u.value; \ - } while (0) - -#define GLM_INSERT_WORDS(d,ix0,ix1) \ - do { \ - ieee_double_shape_type iw_u; \ - iw_u.parts.msw = (ix0); \ - iw_u.parts.lsw = (ix1); \ - (d) = iw_u.value; \ - } while (0) - -namespace glm{ -namespace detail -{ - GLM_FUNC_QUALIFIER float nextafterf(float x, float y) - { - volatile float t; - int hx, hy, ix, iy; - - GLM_GET_FLOAT_WORD(hx, x); - GLM_GET_FLOAT_WORD(hy, y); - ix = hx & 0x7fffffff; // |x| - iy = hy & 0x7fffffff; // |y| - - if((ix > 0x7f800000) || // x is nan - (iy > 0x7f800000)) // y is nan - return x + y; - if(abs(y - x) <= epsilon()) - return y; // x=y, return y - if(ix == 0) - { // x == 0 - GLM_SET_FLOAT_WORD(x, (hy & 0x80000000) | 1);// return +-minsubnormal - t = x * x; - if(abs(t - x) <= epsilon()) - return t; - else - return x; // raise underflow flag - } - if(hx >= 0) - { // x > 0 - if(hx > hy) // x > y, x -= ulp - hx -= 1; - else // x < y, x += ulp - hx += 1; - } - else - { // x < 0 - if(hy >= 0 || hx > hy) // x < y, x -= ulp - hx -= 1; - else // x > y, x += ulp - hx += 1; - } - hy = hx & 0x7f800000; - if(hy >= 0x7f800000) - return x + x; // overflow - if(hy < 0x00800000) // underflow - { - t = x * x; - if(abs(t - x) > epsilon()) - { // raise underflow flag - GLM_SET_FLOAT_WORD(y, hx); - return y; - } - } - GLM_SET_FLOAT_WORD(x, hx); - return x; - } - - GLM_FUNC_QUALIFIER double nextafter(double x, double y) - { - volatile double t; - int hx, hy, ix, iy; - unsigned int lx, ly; - - GLM_EXTRACT_WORDS(hx, lx, x); - GLM_EXTRACT_WORDS(hy, ly, y); - ix = hx & 0x7fffffff; // |x| - iy = hy & 0x7fffffff; // |y| - - if(((ix >= 0x7ff00000) && ((ix - 0x7ff00000) | lx) != 0) || // x is nan - ((iy >= 0x7ff00000) && ((iy - 0x7ff00000) | ly) != 0)) // y is nan - return x + y; - if(abs(y - x) <= epsilon()) - return y; // x=y, return y - if((ix | lx) == 0) - { // x == 0 - GLM_INSERT_WORDS(x, hy & 0x80000000, 1); // return +-minsubnormal - t = x * x; - if(abs(t - x) <= epsilon()) - return t; - else - return x; // raise underflow flag - } - if(hx >= 0) { // x > 0 - if(hx > hy || ((hx == hy) && (lx > ly))) { // x > y, x -= ulp - if(lx == 0) hx -= 1; - lx -= 1; - } - else { // x < y, x += ulp - lx += 1; - if(lx == 0) hx += 1; - } - } - else { // x < 0 - if(hy >= 0 || hx > hy || ((hx == hy) && (lx > ly))){// x < y, x -= ulp - if(lx == 0) hx -= 1; - lx -= 1; - } - else { // x > y, x += ulp - lx += 1; - if(lx == 0) hx += 1; - } - } - hy = hx & 0x7ff00000; - if(hy >= 0x7ff00000) - return x + x; // overflow - if(hy < 0x00100000) - { // underflow - t = x * x; - if(abs(t - x) > epsilon()) - { // raise underflow flag - GLM_INSERT_WORDS(y, hx, lx); - return y; - } - } - GLM_INSERT_WORDS(x, hx, lx); - return x; - } -}//namespace detail -}//namespace glm - -#if(GLM_COMPILER & GLM_COMPILER_VC) -# pragma warning(pop) -#endif - -namespace glm -{ - template<> - GLM_FUNC_QUALIFIER float nextFloat(float x) - { -# if GLM_HAS_CXX11_STL - return std::nextafter(x, std::numeric_limits::max()); -# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) - return detail::nextafterf(x, FLT_MAX); -# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) - return __builtin_nextafterf(x, FLT_MAX); -# else - return nextafterf(x, FLT_MAX); -# endif - } - - template<> - GLM_FUNC_QUALIFIER double nextFloat(double x) - { -# if GLM_HAS_CXX11_STL - return std::nextafter(x, std::numeric_limits::max()); -# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) - return detail::nextafter(x, std::numeric_limits::max()); -# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) - return __builtin_nextafter(x, DBL_MAX); -# else - return nextafter(x, DBL_MAX); -# endif - } - - template - GLM_FUNC_QUALIFIER T nextFloat(T x, int ULPs) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'next_float' only accept floating-point input"); - assert(ULPs >= 0); - - T temp = x; - for(int i = 0; i < ULPs; ++i) - temp = nextFloat(temp); - return temp; - } - - GLM_FUNC_QUALIFIER float prevFloat(float x) - { -# if GLM_HAS_CXX11_STL - return std::nextafter(x, std::numeric_limits::min()); -# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) - return detail::nextafterf(x, FLT_MIN); -# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) - return __builtin_nextafterf(x, FLT_MIN); -# else - return nextafterf(x, FLT_MIN); -# endif - } - - GLM_FUNC_QUALIFIER double prevFloat(double x) - { -# if GLM_HAS_CXX11_STL - return std::nextafter(x, std::numeric_limits::min()); -# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) - return _nextafter(x, DBL_MIN); -# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) - return __builtin_nextafter(x, DBL_MIN); -# else - return nextafter(x, DBL_MIN); -# endif - } - - template - GLM_FUNC_QUALIFIER T prevFloat(T x, int ULPs) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'prev_float' only accept floating-point input"); - assert(ULPs >= 0); - - T temp = x; - for(int i = 0; i < ULPs; ++i) - temp = prevFloat(temp); - return temp; - } - - GLM_FUNC_QUALIFIER int floatDistance(float x, float y) - { - detail::float_t const a(x); - detail::float_t const b(y); - - return abs(a.i - b.i); - } - - GLM_FUNC_QUALIFIER int64 floatDistance(double x, double y) - { - detail::float_t const a(x); - detail::float_t const b(y); - - return abs(a.i - b.i); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_bool1.hpp b/3rdparty/glm/source/glm/ext/vector_bool1.hpp deleted file mode 100644 index 002c320..0000000 --- a/3rdparty/glm/source/glm/ext/vector_bool1.hpp +++ /dev/null @@ -1,30 +0,0 @@ -/// @ref ext_vector_bool1 -/// @file glm/ext/vector_bool1.hpp -/// -/// @defgroup ext_vector_bool1 GLM_EXT_vector_bool1 -/// @ingroup ext -/// -/// Exposes bvec1 vector type. -/// -/// Include to use the features of this extension. -/// -/// @see ext_vector_bool1_precision extension. - -#pragma once - -#include "../detail/type_vec1.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_vector_bool1 extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_vector_bool1 - /// @{ - - /// 1 components vector of boolean. - typedef vec<1, bool, defaultp> bvec1; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_bool1_precision.hpp b/3rdparty/glm/source/glm/ext/vector_bool1_precision.hpp deleted file mode 100644 index e62d3cf..0000000 --- a/3rdparty/glm/source/glm/ext/vector_bool1_precision.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/// @ref ext_vector_bool1_precision -/// @file glm/ext/vector_bool1_precision.hpp -/// -/// @defgroup ext_vector_bool1_precision GLM_EXT_vector_bool1_precision -/// @ingroup ext -/// -/// Exposes highp_bvec1, mediump_bvec1 and lowp_bvec1 types. -/// -/// Include to use the features of this extension. - -#pragma once - -#include "../detail/type_vec1.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_vector_bool1_precision extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_vector_bool1_precision - /// @{ - - /// 1 component vector of bool values. - typedef vec<1, bool, highp> highp_bvec1; - - /// 1 component vector of bool values. - typedef vec<1, bool, mediump> mediump_bvec1; - - /// 1 component vector of bool values. - typedef vec<1, bool, lowp> lowp_bvec1; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_bool2.hpp b/3rdparty/glm/source/glm/ext/vector_bool2.hpp deleted file mode 100644 index 52288b7..0000000 --- a/3rdparty/glm/source/glm/ext/vector_bool2.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/vector_bool2.hpp - -#pragma once -#include "../detail/type_vec2.hpp" - -namespace glm -{ - /// @addtogroup core_vector - /// @{ - - /// 2 components vector of boolean. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef vec<2, bool, defaultp> bvec2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_bool2_precision.hpp b/3rdparty/glm/source/glm/ext/vector_bool2_precision.hpp deleted file mode 100644 index 4370933..0000000 --- a/3rdparty/glm/source/glm/ext/vector_bool2_precision.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/// @ref core -/// @file glm/ext/vector_bool2_precision.hpp - -#pragma once -#include "../detail/type_vec2.hpp" - -namespace glm -{ - /// @addtogroup core_vector_precision - /// @{ - - /// 2 components vector of high qualifier bool numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<2, bool, highp> highp_bvec2; - - /// 2 components vector of medium qualifier bool numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<2, bool, mediump> mediump_bvec2; - - /// 2 components vector of low qualifier bool numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<2, bool, lowp> lowp_bvec2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_bool3.hpp b/3rdparty/glm/source/glm/ext/vector_bool3.hpp deleted file mode 100644 index 90a0b7e..0000000 --- a/3rdparty/glm/source/glm/ext/vector_bool3.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/vector_bool3.hpp - -#pragma once -#include "../detail/type_vec3.hpp" - -namespace glm -{ - /// @addtogroup core_vector - /// @{ - - /// 3 components vector of boolean. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef vec<3, bool, defaultp> bvec3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_bool3_precision.hpp b/3rdparty/glm/source/glm/ext/vector_bool3_precision.hpp deleted file mode 100644 index 89cd2d3..0000000 --- a/3rdparty/glm/source/glm/ext/vector_bool3_precision.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/// @ref core -/// @file glm/ext/vector_bool3_precision.hpp - -#pragma once -#include "../detail/type_vec3.hpp" - -namespace glm -{ - /// @addtogroup core_vector_precision - /// @{ - - /// 3 components vector of high qualifier bool numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<3, bool, highp> highp_bvec3; - - /// 3 components vector of medium qualifier bool numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<3, bool, mediump> mediump_bvec3; - - /// 3 components vector of low qualifier bool numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<3, bool, lowp> lowp_bvec3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_bool4.hpp b/3rdparty/glm/source/glm/ext/vector_bool4.hpp deleted file mode 100644 index 18aa71b..0000000 --- a/3rdparty/glm/source/glm/ext/vector_bool4.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/vector_bool4.hpp - -#pragma once -#include "../detail/type_vec4.hpp" - -namespace glm -{ - /// @addtogroup core_vector - /// @{ - - /// 4 components vector of boolean. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef vec<4, bool, defaultp> bvec4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_bool4_precision.hpp b/3rdparty/glm/source/glm/ext/vector_bool4_precision.hpp deleted file mode 100644 index 79786e5..0000000 --- a/3rdparty/glm/source/glm/ext/vector_bool4_precision.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/// @ref core -/// @file glm/ext/vector_bool4_precision.hpp - -#pragma once -#include "../detail/type_vec4.hpp" - -namespace glm -{ - /// @addtogroup core_vector_precision - /// @{ - - /// 4 components vector of high qualifier bool numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<4, bool, highp> highp_bvec4; - - /// 4 components vector of medium qualifier bool numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<4, bool, mediump> mediump_bvec4; - - /// 4 components vector of low qualifier bool numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<4, bool, lowp> lowp_bvec4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_common.hpp b/3rdparty/glm/source/glm/ext/vector_common.hpp deleted file mode 100644 index c0a2858..0000000 --- a/3rdparty/glm/source/glm/ext/vector_common.hpp +++ /dev/null @@ -1,228 +0,0 @@ -/// @ref ext_vector_common -/// @file glm/ext/vector_common.hpp -/// -/// @defgroup ext_vector_common GLM_EXT_vector_common -/// @ingroup ext -/// -/// Exposes min and max functions for 3 to 4 vector parameters. -/// -/// Include to use the features of this extension. -/// -/// @see core_common -/// @see ext_scalar_common - -#pragma once - -// Dependency: -#include "../ext/scalar_common.hpp" -#include "../common.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_vector_common extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_vector_common - /// @{ - - /// Return the minimum component-wise values of 3 inputs - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL GLM_CONSTEXPR vec min(vec const& a, vec const& b, vec const& c); - - /// Return the minimum component-wise values of 4 inputs - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL GLM_CONSTEXPR vec min(vec const& a, vec const& b, vec const& c, vec const& d); - - /// Return the maximum component-wise values of 3 inputs - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL GLM_CONSTEXPR vec max(vec const& x, vec const& y, vec const& z); - - /// Return the maximum component-wise values of 4 inputs - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL GLM_CONSTEXPR vec max( vec const& x, vec const& y, vec const& z, vec const& w); - - /// Returns y if y < x; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see std::fmin documentation - template - GLM_FUNC_DECL vec fmin(vec const& x, T y); - - /// Returns y if y < x; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see std::fmin documentation - template - GLM_FUNC_DECL vec fmin(vec const& x, vec const& y); - - /// Returns y if y < x; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see std::fmin documentation - template - GLM_FUNC_DECL vec fmin(vec const& a, vec const& b, vec const& c); - - /// Returns y if y < x; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see std::fmin documentation - template - GLM_FUNC_DECL vec fmin(vec const& a, vec const& b, vec const& c, vec const& d); - - /// Returns y if x < y; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see std::fmax documentation - template - GLM_FUNC_DECL vec fmax(vec const& a, T b); - - /// Returns y if x < y; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see std::fmax documentation - template - GLM_FUNC_DECL vec fmax(vec const& a, vec const& b); - - /// Returns y if x < y; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see std::fmax documentation - template - GLM_FUNC_DECL vec fmax(vec const& a, vec const& b, vec const& c); - - /// Returns y if x < y; otherwise, it returns x. If one of the two arguments is NaN, the value of the other argument is returned. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see std::fmax documentation - template - GLM_FUNC_DECL vec fmax(vec const& a, vec const& b, vec const& c, vec const& d); - - /// Returns min(max(x, minVal), maxVal) for each component in x. If one of the two arguments is NaN, the value of the other argument is returned. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see ext_vector_common - template - GLM_FUNC_DECL vec fclamp(vec const& x, T minVal, T maxVal); - - /// Returns min(max(x, minVal), maxVal) for each component in x. If one of the two arguments is NaN, the value of the other argument is returned. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see ext_vector_common - template - GLM_FUNC_DECL vec fclamp(vec const& x, vec const& minVal, vec const& maxVal); - - /// Simulate GL_CLAMP OpenGL wrap mode - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see ext_vector_common extension. - template - GLM_FUNC_DECL vec clamp(vec const& Texcoord); - - /// Simulate GL_REPEAT OpenGL wrap mode - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see ext_vector_common extension. - template - GLM_FUNC_DECL vec repeat(vec const& Texcoord); - - /// Simulate GL_MIRRORED_REPEAT OpenGL wrap mode - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see ext_vector_common extension. - template - GLM_FUNC_DECL vec mirrorClamp(vec const& Texcoord); - - /// Simulate GL_MIRROR_REPEAT OpenGL wrap mode - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see ext_vector_common extension. - template - GLM_FUNC_DECL vec mirrorRepeat(vec const& Texcoord); - - /// Returns a value equal to the nearest integer to x. - /// The fraction 0.5 will round in a direction chosen by the - /// implementation, presumably the direction that is fastest. - /// - /// @param x The values of the argument must be greater or equal to zero. - /// @tparam T floating point scalar types. - /// - /// @see GLSL round man page - /// @see ext_vector_common extension. - template - GLM_FUNC_DECL vec iround(vec const& x); - - /// Returns a value equal to the nearest integer to x. - /// The fraction 0.5 will round in a direction chosen by the - /// implementation, presumably the direction that is fastest. - /// - /// @param x The values of the argument must be greater or equal to zero. - /// @tparam T floating point scalar types. - /// - /// @see GLSL round man page - /// @see ext_vector_common extension. - template - GLM_FUNC_DECL vec uround(vec const& x); - - /// @} -}//namespace glm - -#include "vector_common.inl" diff --git a/3rdparty/glm/source/glm/ext/vector_common.inl b/3rdparty/glm/source/glm/ext/vector_common.inl deleted file mode 100644 index 67817fc..0000000 --- a/3rdparty/glm/source/glm/ext/vector_common.inl +++ /dev/null @@ -1,147 +0,0 @@ -#include "../detail/_vectorize.hpp" - -namespace glm -{ - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec min(vec const& x, vec const& y, vec const& z) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'min' only accept floating-point or integer inputs"); - return glm::min(glm::min(x, y), z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec min(vec const& x, vec const& y, vec const& z, vec const& w) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'min' only accept floating-point or integer inputs"); - return glm::min(glm::min(x, y), glm::min(z, w)); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec max(vec const& x, vec const& y, vec const& z) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'max' only accept floating-point or integer inputs"); - return glm::max(glm::max(x, y), z); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec max(vec const& x, vec const& y, vec const& z, vec const& w) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559 || std::numeric_limits::is_integer, "'max' only accept floating-point or integer inputs"); - return glm::max(glm::max(x, y), glm::max(z, w)); - } - - template - GLM_FUNC_QUALIFIER vec fmin(vec const& a, T b) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point inputs"); - return detail::functor2::call(fmin, a, vec(b)); - } - - template - GLM_FUNC_QUALIFIER vec fmin(vec const& a, vec const& b) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point inputs"); - return detail::functor2::call(fmin, a, b); - } - - template - GLM_FUNC_QUALIFIER vec fmin(vec const& a, vec const& b, vec const& c) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point inputs"); - return fmin(fmin(a, b), c); - } - - template - GLM_FUNC_QUALIFIER vec fmin(vec const& a, vec const& b, vec const& c, vec const& d) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmin' only accept floating-point inputs"); - return fmin(fmin(a, b), fmin(c, d)); - } - - template - GLM_FUNC_QUALIFIER vec fmax(vec const& a, T b) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point inputs"); - return detail::functor2::call(fmax, a, vec(b)); - } - - template - GLM_FUNC_QUALIFIER vec fmax(vec const& a, vec const& b) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point inputs"); - return detail::functor2::call(fmax, a, b); - } - - template - GLM_FUNC_QUALIFIER vec fmax(vec const& a, vec const& b, vec const& c) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point inputs"); - return fmax(fmax(a, b), c); - } - - template - GLM_FUNC_QUALIFIER vec fmax(vec const& a, vec const& b, vec const& c, vec const& d) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fmax' only accept floating-point inputs"); - return fmax(fmax(a, b), fmax(c, d)); - } - - template - GLM_FUNC_QUALIFIER vec fclamp(vec const& x, T minVal, T maxVal) - { - return fmin(fmax(x, vec(minVal)), vec(maxVal)); - } - - template - GLM_FUNC_QUALIFIER vec fclamp(vec const& x, vec const& minVal, vec const& maxVal) - { - return fmin(fmax(x, minVal), maxVal); - } - - template - GLM_FUNC_QUALIFIER vec clamp(vec const& Texcoord) - { - return glm::clamp(Texcoord, vec(0), vec(1)); - } - - template - GLM_FUNC_QUALIFIER vec repeat(vec const& Texcoord) - { - return glm::fract(Texcoord); - } - - template - GLM_FUNC_QUALIFIER vec mirrorClamp(vec const& Texcoord) - { - return glm::fract(glm::abs(Texcoord)); - } - - template - GLM_FUNC_QUALIFIER vec mirrorRepeat(vec const& Texcoord) - { - vec const Abs = glm::abs(Texcoord); - vec const Clamp = glm::mod(glm::floor(Abs), vec(2)); - vec const Floor = glm::floor(Abs); - vec const Rest = Abs - Floor; - vec const Mirror = Clamp + Rest; - return mix(Rest, vec(1) - Rest, glm::greaterThanEqual(Mirror, vec(1))); - } - - template - GLM_FUNC_QUALIFIER vec iround(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'iround' only accept floating-point inputs"); - assert(all(lessThanEqual(vec(0), x))); - - return vec(x + static_cast(0.5)); - } - - template - GLM_FUNC_QUALIFIER vec uround(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'uround' only accept floating-point inputs"); - assert(all(lessThanEqual(vec(0), x))); - - return vec(x + static_cast(0.5)); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_double1.hpp b/3rdparty/glm/source/glm/ext/vector_double1.hpp deleted file mode 100644 index 3882667..0000000 --- a/3rdparty/glm/source/glm/ext/vector_double1.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/// @ref ext_vector_double1 -/// @file glm/ext/vector_double1.hpp -/// -/// @defgroup ext_vector_double1 GLM_EXT_vector_double1 -/// @ingroup ext -/// -/// Exposes double-precision floating point vector type with one component. -/// -/// Include to use the features of this extension. -/// -/// @see ext_vector_double1_precision extension. -/// @see ext_vector_float1 extension. - -#pragma once - -#include "../detail/type_vec1.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_vector_double1 extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_vector_double1 - /// @{ - - /// 1 components vector of double-precision floating-point numbers. - typedef vec<1, double, defaultp> dvec1; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_double1_precision.hpp b/3rdparty/glm/source/glm/ext/vector_double1_precision.hpp deleted file mode 100644 index 1d47195..0000000 --- a/3rdparty/glm/source/glm/ext/vector_double1_precision.hpp +++ /dev/null @@ -1,36 +0,0 @@ -/// @ref ext_vector_double1_precision -/// @file glm/ext/vector_double1_precision.hpp -/// -/// @defgroup ext_vector_double1_precision GLM_EXT_vector_double1_precision -/// @ingroup ext -/// -/// Exposes highp_dvec1, mediump_dvec1 and lowp_dvec1 types. -/// -/// Include to use the features of this extension. -/// -/// @see ext_vector_double1 - -#pragma once - -#include "../detail/type_vec1.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_vector_double1_precision extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_vector_double1_precision - /// @{ - - /// 1 component vector of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef vec<1, double, highp> highp_dvec1; - - /// 1 component vector of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef vec<1, double, mediump> mediump_dvec1; - - /// 1 component vector of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef vec<1, double, lowp> lowp_dvec1; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_double2.hpp b/3rdparty/glm/source/glm/ext/vector_double2.hpp deleted file mode 100644 index 60e3577..0000000 --- a/3rdparty/glm/source/glm/ext/vector_double2.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/vector_double2.hpp - -#pragma once -#include "../detail/type_vec2.hpp" - -namespace glm -{ - /// @addtogroup core_vector - /// @{ - - /// 2 components vector of double-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef vec<2, double, defaultp> dvec2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_double2_precision.hpp b/3rdparty/glm/source/glm/ext/vector_double2_precision.hpp deleted file mode 100644 index fa53940..0000000 --- a/3rdparty/glm/source/glm/ext/vector_double2_precision.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/// @ref core -/// @file glm/ext/vector_double2_precision.hpp - -#pragma once -#include "../detail/type_vec2.hpp" - -namespace glm -{ - /// @addtogroup core_vector_precision - /// @{ - - /// 2 components vector of high double-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<2, double, highp> highp_dvec2; - - /// 2 components vector of medium double-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<2, double, mediump> mediump_dvec2; - - /// 2 components vector of low double-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<2, double, lowp> lowp_dvec2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_double3.hpp b/3rdparty/glm/source/glm/ext/vector_double3.hpp deleted file mode 100644 index 6dfe4c6..0000000 --- a/3rdparty/glm/source/glm/ext/vector_double3.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/vector_double3.hpp - -#pragma once -#include "../detail/type_vec3.hpp" - -namespace glm -{ - /// @addtogroup core_vector - /// @{ - - /// 3 components vector of double-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef vec<3, double, defaultp> dvec3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_double3_precision.hpp b/3rdparty/glm/source/glm/ext/vector_double3_precision.hpp deleted file mode 100644 index a8cfa37..0000000 --- a/3rdparty/glm/source/glm/ext/vector_double3_precision.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/// @ref core -/// @file glm/ext/vector_double3_precision.hpp - -#pragma once -#include "../detail/type_vec3.hpp" - -namespace glm -{ - /// @addtogroup core_vector_precision - /// @{ - - /// 3 components vector of high double-qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<3, double, highp> highp_dvec3; - - /// 3 components vector of medium double-qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<3, double, mediump> mediump_dvec3; - - /// 3 components vector of low double-qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<3, double, lowp> lowp_dvec3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_double4.hpp b/3rdparty/glm/source/glm/ext/vector_double4.hpp deleted file mode 100644 index 87f225f..0000000 --- a/3rdparty/glm/source/glm/ext/vector_double4.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/vector_double4.hpp - -#pragma once -#include "../detail/type_vec4.hpp" - -namespace glm -{ - /// @addtogroup core_vector - /// @{ - - /// 4 components vector of double-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef vec<4, double, defaultp> dvec4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_double4_precision.hpp b/3rdparty/glm/source/glm/ext/vector_double4_precision.hpp deleted file mode 100644 index 09cafa1..0000000 --- a/3rdparty/glm/source/glm/ext/vector_double4_precision.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/// @ref core -/// @file glm/ext/vector_double4_precision.hpp - -#pragma once -#include "../detail/setup.hpp" -#include "../detail/type_vec4.hpp" - -namespace glm -{ - /// @addtogroup core_vector_precision - /// @{ - - /// 4 components vector of high double-qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<4, double, highp> highp_dvec4; - - /// 4 components vector of medium double-qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<4, double, mediump> mediump_dvec4; - - /// 4 components vector of low double-qualifier floating-point numbers. - /// There is no guarantee on the actual qualifier. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<4, double, lowp> lowp_dvec4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_float1.hpp b/3rdparty/glm/source/glm/ext/vector_float1.hpp deleted file mode 100644 index 28acc2c..0000000 --- a/3rdparty/glm/source/glm/ext/vector_float1.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/// @ref ext_vector_float1 -/// @file glm/ext/vector_float1.hpp -/// -/// @defgroup ext_vector_float1 GLM_EXT_vector_float1 -/// @ingroup ext -/// -/// Exposes single-precision floating point vector type with one component. -/// -/// Include to use the features of this extension. -/// -/// @see ext_vector_float1_precision extension. -/// @see ext_vector_double1 extension. - -#pragma once - -#include "../detail/type_vec1.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_vector_float1 extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_vector_float1 - /// @{ - - /// 1 components vector of single-precision floating-point numbers. - typedef vec<1, float, defaultp> vec1; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_float1_precision.hpp b/3rdparty/glm/source/glm/ext/vector_float1_precision.hpp deleted file mode 100644 index 6e8dad8..0000000 --- a/3rdparty/glm/source/glm/ext/vector_float1_precision.hpp +++ /dev/null @@ -1,36 +0,0 @@ -/// @ref ext_vector_float1_precision -/// @file glm/ext/vector_float1_precision.hpp -/// -/// @defgroup ext_vector_float1_precision GLM_EXT_vector_float1_precision -/// @ingroup ext -/// -/// Exposes highp_vec1, mediump_vec1 and lowp_vec1 types. -/// -/// Include to use the features of this extension. -/// -/// @see ext_vector_float1 extension. - -#pragma once - -#include "../detail/type_vec1.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_vector_float1_precision extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_vector_float1_precision - /// @{ - - /// 1 component vector of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef vec<1, float, highp> highp_vec1; - - /// 1 component vector of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef vec<1, float, mediump> mediump_vec1; - - /// 1 component vector of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef vec<1, float, lowp> lowp_vec1; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_float2.hpp b/3rdparty/glm/source/glm/ext/vector_float2.hpp deleted file mode 100644 index d31545d..0000000 --- a/3rdparty/glm/source/glm/ext/vector_float2.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/vector_float2.hpp - -#pragma once -#include "../detail/type_vec2.hpp" - -namespace glm -{ - /// @addtogroup core_vector - /// @{ - - /// 2 components vector of single-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef vec<2, float, defaultp> vec2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_float2_precision.hpp b/3rdparty/glm/source/glm/ext/vector_float2_precision.hpp deleted file mode 100644 index 23c0820..0000000 --- a/3rdparty/glm/source/glm/ext/vector_float2_precision.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/// @ref core -/// @file glm/ext/vector_float2_precision.hpp - -#pragma once -#include "../detail/type_vec2.hpp" - -namespace glm -{ - /// @addtogroup core_vector_precision - /// @{ - - /// 2 components vector of high single-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<2, float, highp> highp_vec2; - - /// 2 components vector of medium single-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<2, float, mediump> mediump_vec2; - - /// 2 components vector of low single-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<2, float, lowp> lowp_vec2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_float3.hpp b/3rdparty/glm/source/glm/ext/vector_float3.hpp deleted file mode 100644 index cd79a62..0000000 --- a/3rdparty/glm/source/glm/ext/vector_float3.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/vector_float3.hpp - -#pragma once -#include "../detail/type_vec3.hpp" - -namespace glm -{ - /// @addtogroup core_vector - /// @{ - - /// 3 components vector of single-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef vec<3, float, defaultp> vec3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_float3_precision.hpp b/3rdparty/glm/source/glm/ext/vector_float3_precision.hpp deleted file mode 100644 index be640b5..0000000 --- a/3rdparty/glm/source/glm/ext/vector_float3_precision.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/// @ref core -/// @file glm/ext/vector_float3_precision.hpp - -#pragma once -#include "../detail/type_vec3.hpp" - -namespace glm -{ - /// @addtogroup core_vector_precision - /// @{ - - /// 3 components vector of high single-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<3, float, highp> highp_vec3; - - /// 3 components vector of medium single-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<3, float, mediump> mediump_vec3; - - /// 3 components vector of low single-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<3, float, lowp> lowp_vec3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_float4.hpp b/3rdparty/glm/source/glm/ext/vector_float4.hpp deleted file mode 100644 index d84adcc..0000000 --- a/3rdparty/glm/source/glm/ext/vector_float4.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/vector_float4.hpp - -#pragma once -#include "../detail/type_vec4.hpp" - -namespace glm -{ - /// @addtogroup core_vector - /// @{ - - /// 4 components vector of single-precision floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef vec<4, float, defaultp> vec4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_float4_precision.hpp b/3rdparty/glm/source/glm/ext/vector_float4_precision.hpp deleted file mode 100644 index aede838..0000000 --- a/3rdparty/glm/source/glm/ext/vector_float4_precision.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/// @ref core -/// @file glm/ext/vector_float4_precision.hpp - -#pragma once -#include "../detail/type_vec4.hpp" - -namespace glm -{ - /// @addtogroup core_vector_precision - /// @{ - - /// 4 components vector of high single-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<4, float, highp> highp_vec4; - - /// 4 components vector of medium single-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<4, float, mediump> mediump_vec4; - - /// 4 components vector of low single-qualifier floating-point numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - /// @see GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier - typedef vec<4, float, lowp> lowp_vec4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_int1.hpp b/3rdparty/glm/source/glm/ext/vector_int1.hpp deleted file mode 100644 index dc86038..0000000 --- a/3rdparty/glm/source/glm/ext/vector_int1.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/// @ref ext_vector_int1 -/// @file glm/ext/vector_int1.hpp -/// -/// @defgroup ext_vector_int1 GLM_EXT_vector_int1 -/// @ingroup ext -/// -/// Exposes ivec1 vector type. -/// -/// Include to use the features of this extension. -/// -/// @see ext_vector_uint1 extension. -/// @see ext_vector_int1_precision extension. - -#pragma once - -#include "../detail/type_vec1.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_vector_int1 extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_vector_int1 - /// @{ - - /// 1 component vector of signed integer numbers. - typedef vec<1, int, defaultp> ivec1; - - /// @} -}//namespace glm - diff --git a/3rdparty/glm/source/glm/ext/vector_int1_sized.hpp b/3rdparty/glm/source/glm/ext/vector_int1_sized.hpp deleted file mode 100644 index de0d4cf..0000000 --- a/3rdparty/glm/source/glm/ext/vector_int1_sized.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref ext_vector_int1_sized -/// @file glm/ext/vector_int1_sized.hpp -/// -/// @defgroup ext_vector_int1_sized GLM_EXT_vector_int1_sized -/// @ingroup ext -/// -/// Exposes sized signed integer vector types. -/// -/// Include to use the features of this extension. -/// -/// @see ext_scalar_int_sized -/// @see ext_vector_uint1_sized - -#pragma once - -#include "../ext/vector_int1.hpp" -#include "../ext/scalar_int_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_vector_int1_sized extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_vector_int1_sized - /// @{ - - /// 8 bit signed integer vector of 1 component type. - /// - /// @see ext_vector_int1_sized - typedef vec<1, int8, defaultp> i8vec1; - - /// 16 bit signed integer vector of 1 component type. - /// - /// @see ext_vector_int1_sized - typedef vec<1, int16, defaultp> i16vec1; - - /// 32 bit signed integer vector of 1 component type. - /// - /// @see ext_vector_int1_sized - typedef vec<1, int32, defaultp> i32vec1; - - /// 64 bit signed integer vector of 1 component type. - /// - /// @see ext_vector_int1_sized - typedef vec<1, int64, defaultp> i64vec1; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_int2.hpp b/3rdparty/glm/source/glm/ext/vector_int2.hpp deleted file mode 100644 index aef803e..0000000 --- a/3rdparty/glm/source/glm/ext/vector_int2.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/vector_int2.hpp - -#pragma once -#include "../detail/type_vec2.hpp" - -namespace glm -{ - /// @addtogroup core_vector - /// @{ - - /// 2 components vector of signed integer numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef vec<2, int, defaultp> ivec2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_int2_sized.hpp b/3rdparty/glm/source/glm/ext/vector_int2_sized.hpp deleted file mode 100644 index 1fd57ee..0000000 --- a/3rdparty/glm/source/glm/ext/vector_int2_sized.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref ext_vector_int2_sized -/// @file glm/ext/vector_int2_sized.hpp -/// -/// @defgroup ext_vector_int2_sized GLM_EXT_vector_int2_sized -/// @ingroup ext -/// -/// Exposes sized signed integer vector of 2 components type. -/// -/// Include to use the features of this extension. -/// -/// @see ext_scalar_int_sized -/// @see ext_vector_uint2_sized - -#pragma once - -#include "../ext/vector_int2.hpp" -#include "../ext/scalar_int_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_vector_int2_sized extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_vector_int2_sized - /// @{ - - /// 8 bit signed integer vector of 2 components type. - /// - /// @see ext_vector_int2_sized - typedef vec<2, int8, defaultp> i8vec2; - - /// 16 bit signed integer vector of 2 components type. - /// - /// @see ext_vector_int2_sized - typedef vec<2, int16, defaultp> i16vec2; - - /// 32 bit signed integer vector of 2 components type. - /// - /// @see ext_vector_int2_sized - typedef vec<2, int32, defaultp> i32vec2; - - /// 64 bit signed integer vector of 2 components type. - /// - /// @see ext_vector_int2_sized - typedef vec<2, int64, defaultp> i64vec2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_int3.hpp b/3rdparty/glm/source/glm/ext/vector_int3.hpp deleted file mode 100644 index 4767e61..0000000 --- a/3rdparty/glm/source/glm/ext/vector_int3.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/vector_int3.hpp - -#pragma once -#include "../detail/type_vec3.hpp" - -namespace glm -{ - /// @addtogroup core_vector - /// @{ - - /// 3 components vector of signed integer numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef vec<3, int, defaultp> ivec3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_int3_sized.hpp b/3rdparty/glm/source/glm/ext/vector_int3_sized.hpp deleted file mode 100644 index 085a3fe..0000000 --- a/3rdparty/glm/source/glm/ext/vector_int3_sized.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref ext_vector_int3_sized -/// @file glm/ext/vector_int3_sized.hpp -/// -/// @defgroup ext_vector_int3_sized GLM_EXT_vector_int3_sized -/// @ingroup ext -/// -/// Exposes sized signed integer vector of 3 components type. -/// -/// Include to use the features of this extension. -/// -/// @see ext_scalar_int_sized -/// @see ext_vector_uint3_sized - -#pragma once - -#include "../ext/vector_int3.hpp" -#include "../ext/scalar_int_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_vector_int3_sized extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_vector_int3_sized - /// @{ - - /// 8 bit signed integer vector of 3 components type. - /// - /// @see ext_vector_int3_sized - typedef vec<3, int8, defaultp> i8vec3; - - /// 16 bit signed integer vector of 3 components type. - /// - /// @see ext_vector_int3_sized - typedef vec<3, int16, defaultp> i16vec3; - - /// 32 bit signed integer vector of 3 components type. - /// - /// @see ext_vector_int3_sized - typedef vec<3, int32, defaultp> i32vec3; - - /// 64 bit signed integer vector of 3 components type. - /// - /// @see ext_vector_int3_sized - typedef vec<3, int64, defaultp> i64vec3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_int4.hpp b/3rdparty/glm/source/glm/ext/vector_int4.hpp deleted file mode 100644 index bb23adf..0000000 --- a/3rdparty/glm/source/glm/ext/vector_int4.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/vector_int4.hpp - -#pragma once -#include "../detail/type_vec4.hpp" - -namespace glm -{ - /// @addtogroup core_vector - /// @{ - - /// 4 components vector of signed integer numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef vec<4, int, defaultp> ivec4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_int4_sized.hpp b/3rdparty/glm/source/glm/ext/vector_int4_sized.hpp deleted file mode 100644 index c63d465..0000000 --- a/3rdparty/glm/source/glm/ext/vector_int4_sized.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref ext_vector_int4_sized -/// @file glm/ext/vector_int4_sized.hpp -/// -/// @defgroup ext_vector_int4_sized GLM_EXT_vector_int4_sized -/// @ingroup ext -/// -/// Exposes sized signed integer vector of 4 components type. -/// -/// Include to use the features of this extension. -/// -/// @see ext_scalar_int_sized -/// @see ext_vector_uint4_sized - -#pragma once - -#include "../ext/vector_int4.hpp" -#include "../ext/scalar_int_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_vector_int4_sized extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_vector_int4_sized - /// @{ - - /// 8 bit signed integer vector of 4 components type. - /// - /// @see ext_vector_int4_sized - typedef vec<4, int8, defaultp> i8vec4; - - /// 16 bit signed integer vector of 4 components type. - /// - /// @see ext_vector_int4_sized - typedef vec<4, int16, defaultp> i16vec4; - - /// 32 bit signed integer vector of 4 components type. - /// - /// @see ext_vector_int4_sized - typedef vec<4, int32, defaultp> i32vec4; - - /// 64 bit signed integer vector of 4 components type. - /// - /// @see ext_vector_int4_sized - typedef vec<4, int64, defaultp> i64vec4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_integer.hpp b/3rdparty/glm/source/glm/ext/vector_integer.hpp deleted file mode 100644 index 1304dd8..0000000 --- a/3rdparty/glm/source/glm/ext/vector_integer.hpp +++ /dev/null @@ -1,149 +0,0 @@ -/// @ref ext_vector_integer -/// @file glm/ext/vector_integer.hpp -/// -/// @see core (dependence) -/// @see ext_vector_integer (dependence) -/// -/// @defgroup ext_vector_integer GLM_EXT_vector_integer -/// @ingroup ext -/// -/// Include to use the features of this extension. - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" -#include "../detail/qualifier.hpp" -#include "../detail/_vectorize.hpp" -#include "../vector_relational.hpp" -#include "../common.hpp" -#include - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_vector_integer extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_vector_integer - /// @{ - - /// Return true if the value is a power of two number. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Signed or unsigned integer scalar types. - /// @tparam Q Value from qualifier enum - /// - /// @see ext_vector_integer - template - GLM_FUNC_DECL vec isPowerOfTwo(vec const& v); - - /// Return the power of two number which value is just higher the input value, - /// round up to a power of two. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Signed or unsigned integer scalar types. - /// @tparam Q Value from qualifier enum - /// - /// @see ext_vector_integer - template - GLM_FUNC_DECL vec nextPowerOfTwo(vec const& v); - - /// Return the power of two number which value is just lower the input value, - /// round down to a power of two. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Signed or unsigned integer scalar types. - /// @tparam Q Value from qualifier enum - /// - /// @see ext_vector_integer - template - GLM_FUNC_DECL vec prevPowerOfTwo(vec const& v); - - /// Return true if the 'Value' is a multiple of 'Multiple'. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Signed or unsigned integer scalar types. - /// @tparam Q Value from qualifier enum - /// - /// @see ext_vector_integer - template - GLM_FUNC_DECL vec isMultiple(vec const& v, T Multiple); - - /// Return true if the 'Value' is a multiple of 'Multiple'. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Signed or unsigned integer scalar types. - /// @tparam Q Value from qualifier enum - /// - /// @see ext_vector_integer - template - GLM_FUNC_DECL vec isMultiple(vec const& v, vec const& Multiple); - - /// Higher multiple number of Source. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Signed or unsigned integer scalar types. - /// @tparam Q Value from qualifier enum - /// - /// @param v Source values to which is applied the function - /// @param Multiple Must be a null or positive value - /// - /// @see ext_vector_integer - template - GLM_FUNC_DECL vec nextMultiple(vec const& v, T Multiple); - - /// Higher multiple number of Source. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Signed or unsigned integer scalar types. - /// @tparam Q Value from qualifier enum - /// - /// @param v Source values to which is applied the function - /// @param Multiple Must be a null or positive value - /// - /// @see ext_vector_integer - template - GLM_FUNC_DECL vec nextMultiple(vec const& v, vec const& Multiple); - - /// Lower multiple number of Source. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Signed or unsigned integer scalar types. - /// @tparam Q Value from qualifier enum - /// - /// @param v Source values to which is applied the function - /// @param Multiple Must be a null or positive value - /// - /// @see ext_vector_integer - template - GLM_FUNC_DECL vec prevMultiple(vec const& v, T Multiple); - - /// Lower multiple number of Source. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Signed or unsigned integer scalar types. - /// @tparam Q Value from qualifier enum - /// - /// @param v Source values to which is applied the function - /// @param Multiple Must be a null or positive value - /// - /// @see ext_vector_integer - template - GLM_FUNC_DECL vec prevMultiple(vec const& v, vec const& Multiple); - - /// Returns the bit number of the Nth significant bit set to - /// 1 in the binary representation of value. - /// If value bitcount is less than the Nth significant bit, -1 will be returned. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Signed or unsigned integer scalar types. - /// - /// @see ext_vector_integer - template - GLM_FUNC_DECL vec findNSB(vec const& Source, vec SignificantBitCount); - - /// @} -} //namespace glm - -#include "vector_integer.inl" diff --git a/3rdparty/glm/source/glm/ext/vector_integer.inl b/3rdparty/glm/source/glm/ext/vector_integer.inl deleted file mode 100644 index cefb132..0000000 --- a/3rdparty/glm/source/glm/ext/vector_integer.inl +++ /dev/null @@ -1,85 +0,0 @@ -#include "scalar_integer.hpp" - -namespace glm -{ - template - GLM_FUNC_QUALIFIER vec isPowerOfTwo(vec const& Value) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'isPowerOfTwo' only accept integer inputs"); - - vec const Result(abs(Value)); - return equal(Result & (Result - vec(1)), vec(0)); - } - - template - GLM_FUNC_QUALIFIER vec nextPowerOfTwo(vec const& v) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'nextPowerOfTwo' only accept integer inputs"); - - return detail::compute_ceilPowerOfTwo::is_signed>::call(v); - } - - template - GLM_FUNC_QUALIFIER vec prevPowerOfTwo(vec const& v) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'prevPowerOfTwo' only accept integer inputs"); - - return detail::functor1::call(prevPowerOfTwo, v); - } - - template - GLM_FUNC_QUALIFIER vec isMultiple(vec const& Value, T Multiple) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'isMultiple' only accept integer inputs"); - - return equal(Value % Multiple, vec(0)); - } - - template - GLM_FUNC_QUALIFIER vec isMultiple(vec const& Value, vec const& Multiple) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'isMultiple' only accept integer inputs"); - - return equal(Value % Multiple, vec(0)); - } - - template - GLM_FUNC_QUALIFIER vec nextMultiple(vec const& Source, T Multiple) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'nextMultiple' only accept integer inputs"); - - return detail::functor2::call(nextMultiple, Source, vec(Multiple)); - } - - template - GLM_FUNC_QUALIFIER vec nextMultiple(vec const& Source, vec const& Multiple) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'nextMultiple' only accept integer inputs"); - - return detail::functor2::call(nextMultiple, Source, Multiple); - } - - template - GLM_FUNC_QUALIFIER vec prevMultiple(vec const& Source, T Multiple) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'prevMultiple' only accept integer inputs"); - - return detail::functor2::call(prevMultiple, Source, vec(Multiple)); - } - - template - GLM_FUNC_QUALIFIER vec prevMultiple(vec const& Source, vec const& Multiple) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'prevMultiple' only accept integer inputs"); - - return detail::functor2::call(prevMultiple, Source, Multiple); - } - - template - GLM_FUNC_QUALIFIER vec findNSB(vec const& Source, vec SignificantBitCount) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findNSB' only accept integer inputs"); - - return detail::functor2_vec_int::call(findNSB, Source, SignificantBitCount); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_packing.hpp b/3rdparty/glm/source/glm/ext/vector_packing.hpp deleted file mode 100644 index 76e5d0c..0000000 --- a/3rdparty/glm/source/glm/ext/vector_packing.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/// @ref ext_vector_packing -/// @file glm/ext/vector_packing.hpp -/// -/// @see core (dependence) -/// -/// @defgroup ext_vector_packing GLM_EXT_vector_packing -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// This extension provides a set of function to convert vectors to packed -/// formats. - -#pragma once - -// Dependency: -#include "../detail/qualifier.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_vector_packing extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_vector_packing - /// @{ - - - /// @} -}// namespace glm - -#include "vector_packing.inl" diff --git a/3rdparty/glm/source/glm/ext/vector_packing.inl b/3rdparty/glm/source/glm/ext/vector_packing.inl deleted file mode 100644 index e69de29..0000000 diff --git a/3rdparty/glm/source/glm/ext/vector_reciprocal.hpp b/3rdparty/glm/source/glm/ext/vector_reciprocal.hpp deleted file mode 100644 index b383e3c..0000000 --- a/3rdparty/glm/source/glm/ext/vector_reciprocal.hpp +++ /dev/null @@ -1,135 +0,0 @@ -/// @ref ext_vector_reciprocal -/// @file glm/ext/vector_reciprocal.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtc_reciprocal GLM_EXT_vector_reciprocal -/// @ingroup ext -/// -/// Include to use the features of this extension. -/// -/// Define secant, cosecant and cotangent functions. - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_vector_reciprocal extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_vector_reciprocal - /// @{ - - /// Secant function. - /// hypotenuse / adjacent or 1 / cos(x) - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see ext_vector_reciprocal - template - GLM_FUNC_DECL genType sec(genType angle); - - /// Cosecant function. - /// hypotenuse / opposite or 1 / sin(x) - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see ext_vector_reciprocal - template - GLM_FUNC_DECL genType csc(genType angle); - - /// Cotangent function. - /// adjacent / opposite or 1 / tan(x) - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see ext_vector_reciprocal - template - GLM_FUNC_DECL genType cot(genType angle); - - /// Inverse secant function. - /// - /// @return Return an angle expressed in radians. - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see ext_vector_reciprocal - template - GLM_FUNC_DECL genType asec(genType x); - - /// Inverse cosecant function. - /// - /// @return Return an angle expressed in radians. - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see ext_vector_reciprocal - template - GLM_FUNC_DECL genType acsc(genType x); - - /// Inverse cotangent function. - /// - /// @return Return an angle expressed in radians. - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see ext_vector_reciprocal - template - GLM_FUNC_DECL genType acot(genType x); - - /// Secant hyperbolic function. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see ext_vector_reciprocal - template - GLM_FUNC_DECL genType sech(genType angle); - - /// Cosecant hyperbolic function. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see ext_vector_reciprocal - template - GLM_FUNC_DECL genType csch(genType angle); - - /// Cotangent hyperbolic function. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see ext_vector_reciprocal - template - GLM_FUNC_DECL genType coth(genType angle); - - /// Inverse secant hyperbolic function. - /// - /// @return Return an angle expressed in radians. - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see ext_vector_reciprocal - template - GLM_FUNC_DECL genType asech(genType x); - - /// Inverse cosecant hyperbolic function. - /// - /// @return Return an angle expressed in radians. - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see ext_vector_reciprocal - template - GLM_FUNC_DECL genType acsch(genType x); - - /// Inverse cotangent hyperbolic function. - /// - /// @return Return an angle expressed in radians. - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see ext_vector_reciprocal - template - GLM_FUNC_DECL genType acoth(genType x); - - /// @} -}//namespace glm - -#include "vector_reciprocal.inl" diff --git a/3rdparty/glm/source/glm/ext/vector_reciprocal.inl b/3rdparty/glm/source/glm/ext/vector_reciprocal.inl deleted file mode 100644 index 0d3c25f..0000000 --- a/3rdparty/glm/source/glm/ext/vector_reciprocal.inl +++ /dev/null @@ -1,105 +0,0 @@ -/// @ref ext_vector_reciprocal - -#include "../trigonometric.hpp" -#include - -namespace glm -{ - // sec - template - GLM_FUNC_QUALIFIER vec sec(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'sec' only accept floating-point inputs"); - return static_cast(1) / detail::functor1::call(cos, x); - } - - // csc - template - GLM_FUNC_QUALIFIER vec csc(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'csc' only accept floating-point inputs"); - return static_cast(1) / detail::functor1::call(sin, x); - } - - // cot - template - GLM_FUNC_QUALIFIER vec cot(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'cot' only accept floating-point inputs"); - T const pi_over_2 = static_cast(3.1415926535897932384626433832795 / 2.0); - return detail::functor1::call(tan, pi_over_2 - x); - } - - // asec - template - GLM_FUNC_QUALIFIER vec asec(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'asec' only accept floating-point inputs"); - return detail::functor1::call(acos, static_cast(1) / x); - } - - // acsc - template - GLM_FUNC_QUALIFIER vec acsc(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acsc' only accept floating-point inputs"); - return detail::functor1::call(asin, static_cast(1) / x); - } - - // acot - template - GLM_FUNC_QUALIFIER vec acot(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acot' only accept floating-point inputs"); - T const pi_over_2 = static_cast(3.1415926535897932384626433832795 / 2.0); - return pi_over_2 - detail::functor1::call(atan, x); - } - - // sech - template - GLM_FUNC_QUALIFIER vec sech(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'sech' only accept floating-point inputs"); - return static_cast(1) / detail::functor1::call(cosh, x); - } - - // csch - template - GLM_FUNC_QUALIFIER vec csch(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'csch' only accept floating-point inputs"); - return static_cast(1) / detail::functor1::call(sinh, x); - } - - // coth - template - GLM_FUNC_QUALIFIER vec coth(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'coth' only accept floating-point inputs"); - return glm::cosh(x) / glm::sinh(x); - } - - // asech - template - GLM_FUNC_QUALIFIER vec asech(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'asech' only accept floating-point inputs"); - return detail::functor1::call(acosh, static_cast(1) / x); - } - - // acsch - template - GLM_FUNC_QUALIFIER vec acsch(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acsch' only accept floating-point inputs"); - return detail::functor1::call(asinh, static_cast(1) / x); - } - - // acoth - template - GLM_FUNC_QUALIFIER vec acoth(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'acoth' only accept floating-point inputs"); - return detail::functor1::call(atanh, static_cast(1) / x); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_relational.hpp b/3rdparty/glm/source/glm/ext/vector_relational.hpp deleted file mode 100644 index 1c2367d..0000000 --- a/3rdparty/glm/source/glm/ext/vector_relational.hpp +++ /dev/null @@ -1,107 +0,0 @@ -/// @ref ext_vector_relational -/// @file glm/ext/vector_relational.hpp -/// -/// @see core (dependence) -/// @see ext_scalar_integer (dependence) -/// -/// @defgroup ext_vector_relational GLM_EXT_vector_relational -/// @ingroup ext -/// -/// Exposes comparison functions for vector types that take a user defined epsilon values. -/// -/// Include to use the features of this extension. -/// -/// @see core_vector_relational -/// @see ext_scalar_relational -/// @see ext_matrix_relational - -#pragma once - -// Dependencies -#include "../detail/qualifier.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_vector_relational extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_vector_relational - /// @{ - - /// Returns the component-wise comparison of |x - y| < epsilon. - /// True if this expression is satisfied. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL GLM_CONSTEXPR vec equal(vec const& x, vec const& y, T epsilon); - - /// Returns the component-wise comparison of |x - y| < epsilon. - /// True if this expression is satisfied. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL GLM_CONSTEXPR vec equal(vec const& x, vec const& y, vec const& epsilon); - - /// Returns the component-wise comparison of |x - y| >= epsilon. - /// True if this expression is not satisfied. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, T epsilon); - - /// Returns the component-wise comparison of |x - y| >= epsilon. - /// True if this expression is not satisfied. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, vec const& epsilon); - - /// Returns the component-wise comparison between two vectors in term of ULPs. - /// True if this expression is satisfied. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL GLM_CONSTEXPR vec equal(vec const& x, vec const& y, int ULPs); - - /// Returns the component-wise comparison between two vectors in term of ULPs. - /// True if this expression is satisfied. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL GLM_CONSTEXPR vec equal(vec const& x, vec const& y, vec const& ULPs); - - /// Returns the component-wise comparison between two vectors in term of ULPs. - /// True if this expression is not satisfied. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, int ULPs); - - /// Returns the component-wise comparison between two vectors in term of ULPs. - /// True if this expression is not satisfied. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point - /// @tparam Q Value from qualifier enum - template - GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, vec const& ULPs); - - /// @} -}//namespace glm - -#include "vector_relational.inl" diff --git a/3rdparty/glm/source/glm/ext/vector_relational.inl b/3rdparty/glm/source/glm/ext/vector_relational.inl deleted file mode 100644 index 7a39ab5..0000000 --- a/3rdparty/glm/source/glm/ext/vector_relational.inl +++ /dev/null @@ -1,75 +0,0 @@ -#include "../vector_relational.hpp" -#include "../common.hpp" -#include "../detail/qualifier.hpp" -#include "../detail/type_float.hpp" - -namespace glm -{ - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(vec const& x, vec const& y, T Epsilon) - { - return equal(x, y, vec(Epsilon)); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(vec const& x, vec const& y, vec const& Epsilon) - { - return lessThanEqual(abs(x - y), Epsilon); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, T Epsilon) - { - return notEqual(x, y, vec(Epsilon)); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, vec const& Epsilon) - { - return greaterThan(abs(x - y), Epsilon); - } - - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(vec const& x, vec const& y, int MaxULPs) - { - return equal(x, y, vec(MaxULPs)); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec equal(vec const& x, vec const& y, vec const& MaxULPs) - { - vec Result(false); - for(length_t i = 0; i < L; ++i) - { - detail::float_t const a(x[i]); - detail::float_t const b(y[i]); - - // Different signs means they do not match. - if(a.negative() != b.negative()) - { - // Check for equality to make sure +0==-0 - Result[i] = a.mantissa() == b.mantissa() && a.exponent() == b.exponent(); - } - else - { - // Find the difference in ULPs. - typename detail::float_t::int_type const DiffULPs = abs(a.i - b.i); - Result[i] = DiffULPs <= MaxULPs[i]; - } - } - return Result; - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, int MaxULPs) - { - return notEqual(x, y, vec(MaxULPs)); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y, vec const& MaxULPs) - { - return not_(equal(x, y, MaxULPs)); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_uint1.hpp b/3rdparty/glm/source/glm/ext/vector_uint1.hpp deleted file mode 100644 index eb8a704..0000000 --- a/3rdparty/glm/source/glm/ext/vector_uint1.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/// @ref ext_vector_uint1 -/// @file glm/ext/vector_uint1.hpp -/// -/// @defgroup ext_vector_uint1 GLM_EXT_vector_uint1 -/// @ingroup ext -/// -/// Exposes uvec1 vector type. -/// -/// Include to use the features of this extension. -/// -/// @see ext_vector_int1 extension. -/// @see ext_vector_uint1_precision extension. - -#pragma once - -#include "../detail/type_vec1.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_vector_uint1 extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_vector_uint1 - /// @{ - - /// 1 component vector of unsigned integer numbers. - typedef vec<1, unsigned int, defaultp> uvec1; - - /// @} -}//namespace glm - diff --git a/3rdparty/glm/source/glm/ext/vector_uint1_sized.hpp b/3rdparty/glm/source/glm/ext/vector_uint1_sized.hpp deleted file mode 100644 index 2a938bb..0000000 --- a/3rdparty/glm/source/glm/ext/vector_uint1_sized.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref ext_vector_uint1_sized -/// @file glm/ext/vector_uint1_sized.hpp -/// -/// @defgroup ext_vector_uint1_sized GLM_EXT_vector_uint1_sized -/// @ingroup ext -/// -/// Exposes sized unsigned integer vector types. -/// -/// Include to use the features of this extension. -/// -/// @see ext_scalar_uint_sized -/// @see ext_vector_int1_sized - -#pragma once - -#include "../ext/vector_uint1.hpp" -#include "../ext/scalar_uint_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_vector_uint1_sized extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_vector_uint1_sized - /// @{ - - /// 8 bit unsigned integer vector of 1 component type. - /// - /// @see ext_vector_uint1_sized - typedef vec<1, uint8, defaultp> u8vec1; - - /// 16 bit unsigned integer vector of 1 component type. - /// - /// @see ext_vector_uint1_sized - typedef vec<1, uint16, defaultp> u16vec1; - - /// 32 bit unsigned integer vector of 1 component type. - /// - /// @see ext_vector_uint1_sized - typedef vec<1, uint32, defaultp> u32vec1; - - /// 64 bit unsigned integer vector of 1 component type. - /// - /// @see ext_vector_uint1_sized - typedef vec<1, uint64, defaultp> u64vec1; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_uint2.hpp b/3rdparty/glm/source/glm/ext/vector_uint2.hpp deleted file mode 100644 index 03c00f5..0000000 --- a/3rdparty/glm/source/glm/ext/vector_uint2.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/vector_uint2.hpp - -#pragma once -#include "../detail/type_vec2.hpp" - -namespace glm -{ - /// @addtogroup core_vector - /// @{ - - /// 2 components vector of unsigned integer numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef vec<2, unsigned int, defaultp> uvec2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_uint2_sized.hpp b/3rdparty/glm/source/glm/ext/vector_uint2_sized.hpp deleted file mode 100644 index 620fdc6..0000000 --- a/3rdparty/glm/source/glm/ext/vector_uint2_sized.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref ext_vector_uint2_sized -/// @file glm/ext/vector_uint2_sized.hpp -/// -/// @defgroup ext_vector_uint2_sized GLM_EXT_vector_uint2_sized -/// @ingroup ext -/// -/// Exposes sized unsigned integer vector of 2 components type. -/// -/// Include to use the features of this extension. -/// -/// @see ext_scalar_uint_sized -/// @see ext_vector_int2_sized - -#pragma once - -#include "../ext/vector_uint2.hpp" -#include "../ext/scalar_uint_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_vector_uint2_sized extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_vector_uint2_sized - /// @{ - - /// 8 bit unsigned integer vector of 2 components type. - /// - /// @see ext_vector_uint2_sized - typedef vec<2, uint8, defaultp> u8vec2; - - /// 16 bit unsigned integer vector of 2 components type. - /// - /// @see ext_vector_uint2_sized - typedef vec<2, uint16, defaultp> u16vec2; - - /// 32 bit unsigned integer vector of 2 components type. - /// - /// @see ext_vector_uint2_sized - typedef vec<2, uint32, defaultp> u32vec2; - - /// 64 bit unsigned integer vector of 2 components type. - /// - /// @see ext_vector_uint2_sized - typedef vec<2, uint64, defaultp> u64vec2; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_uint3.hpp b/3rdparty/glm/source/glm/ext/vector_uint3.hpp deleted file mode 100644 index f5b41c4..0000000 --- a/3rdparty/glm/source/glm/ext/vector_uint3.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/vector_uint3.hpp - -#pragma once -#include "../detail/type_vec3.hpp" - -namespace glm -{ - /// @addtogroup core_vector - /// @{ - - /// 3 components vector of unsigned integer numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef vec<3, unsigned int, defaultp> uvec3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_uint3_sized.hpp b/3rdparty/glm/source/glm/ext/vector_uint3_sized.hpp deleted file mode 100644 index 6f96b98..0000000 --- a/3rdparty/glm/source/glm/ext/vector_uint3_sized.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref ext_vector_uint3_sized -/// @file glm/ext/vector_uint3_sized.hpp -/// -/// @defgroup ext_vector_uint3_sized GLM_EXT_vector_uint3_sized -/// @ingroup ext -/// -/// Exposes sized unsigned integer vector of 3 components type. -/// -/// Include to use the features of this extension. -/// -/// @see ext_scalar_uint_sized -/// @see ext_vector_int3_sized - -#pragma once - -#include "../ext/vector_uint3.hpp" -#include "../ext/scalar_uint_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_vector_uint3_sized extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_vector_uint3_sized - /// @{ - - /// 8 bit unsigned integer vector of 3 components type. - /// - /// @see ext_vector_uint3_sized - typedef vec<3, uint8, defaultp> u8vec3; - - /// 16 bit unsigned integer vector of 3 components type. - /// - /// @see ext_vector_uint3_sized - typedef vec<3, uint16, defaultp> u16vec3; - - /// 32 bit unsigned integer vector of 3 components type. - /// - /// @see ext_vector_uint3_sized - typedef vec<3, uint32, defaultp> u32vec3; - - /// 64 bit unsigned integer vector of 3 components type. - /// - /// @see ext_vector_uint3_sized - typedef vec<3, uint64, defaultp> u64vec3; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_uint4.hpp b/3rdparty/glm/source/glm/ext/vector_uint4.hpp deleted file mode 100644 index 32ced58..0000000 --- a/3rdparty/glm/source/glm/ext/vector_uint4.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/// @ref core -/// @file glm/ext/vector_uint4.hpp - -#pragma once -#include "../detail/type_vec4.hpp" - -namespace glm -{ - /// @addtogroup core_vector - /// @{ - - /// 4 components vector of unsigned integer numbers. - /// - /// @see GLSL 4.20.8 specification, section 4.1.5 Vectors - typedef vec<4, unsigned int, defaultp> uvec4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_uint4_sized.hpp b/3rdparty/glm/source/glm/ext/vector_uint4_sized.hpp deleted file mode 100644 index da992ea..0000000 --- a/3rdparty/glm/source/glm/ext/vector_uint4_sized.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref ext_vector_uint4_sized -/// @file glm/ext/vector_uint4_sized.hpp -/// -/// @defgroup ext_vector_uint4_sized GLM_EXT_vector_uint4_sized -/// @ingroup ext -/// -/// Exposes sized unsigned integer vector of 4 components type. -/// -/// Include to use the features of this extension. -/// -/// @see ext_scalar_uint_sized -/// @see ext_vector_int4_sized - -#pragma once - -#include "../ext/vector_uint4.hpp" -#include "../ext/scalar_uint_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_vector_uint4_sized extension included") -#endif - -namespace glm -{ - /// @addtogroup ext_vector_uint4_sized - /// @{ - - /// 8 bit unsigned integer vector of 4 components type. - /// - /// @see ext_vector_uint4_sized - typedef vec<4, uint8, defaultp> u8vec4; - - /// 16 bit unsigned integer vector of 4 components type. - /// - /// @see ext_vector_uint4_sized - typedef vec<4, uint16, defaultp> u16vec4; - - /// 32 bit unsigned integer vector of 4 components type. - /// - /// @see ext_vector_uint4_sized - typedef vec<4, uint32, defaultp> u32vec4; - - /// 64 bit unsigned integer vector of 4 components type. - /// - /// @see ext_vector_uint4_sized - typedef vec<4, uint64, defaultp> u64vec4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/ext/vector_ulp.hpp b/3rdparty/glm/source/glm/ext/vector_ulp.hpp deleted file mode 100644 index 6210396..0000000 --- a/3rdparty/glm/source/glm/ext/vector_ulp.hpp +++ /dev/null @@ -1,109 +0,0 @@ -/// @ref ext_vector_ulp -/// @file glm/ext/vector_ulp.hpp -/// -/// @defgroup ext_vector_ulp GLM_EXT_vector_ulp -/// @ingroup ext -/// -/// Allow the measurement of the accuracy of a function against a reference -/// implementation. This extension works on floating-point data and provide results -/// in ULP. -/// -/// Include to use the features of this extension. -/// -/// @see ext_scalar_ulp -/// @see ext_scalar_relational -/// @see ext_vector_relational - -#pragma once - -// Dependencies -#include "../ext/scalar_ulp.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_EXT_vector_ulp extension included") -#endif - -namespace glm -{ - /// Return the next ULP value(s) after the input value(s). - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point - /// @tparam Q Value from qualifier enum - /// - /// @see ext_scalar_ulp - template - GLM_FUNC_DECL vec nextFloat(vec const& x); - - /// Return the value(s) ULP distance after the input value(s). - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point - /// @tparam Q Value from qualifier enum - /// - /// @see ext_scalar_ulp - template - GLM_FUNC_DECL vec nextFloat(vec const& x, int ULPs); - - /// Return the value(s) ULP distance after the input value(s). - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point - /// @tparam Q Value from qualifier enum - /// - /// @see ext_scalar_ulp - template - GLM_FUNC_DECL vec nextFloat(vec const& x, vec const& ULPs); - - /// Return the previous ULP value(s) before the input value(s). - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point - /// @tparam Q Value from qualifier enum - /// - /// @see ext_scalar_ulp - template - GLM_FUNC_DECL vec prevFloat(vec const& x); - - /// Return the value(s) ULP distance before the input value(s). - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point - /// @tparam Q Value from qualifier enum - /// - /// @see ext_scalar_ulp - template - GLM_FUNC_DECL vec prevFloat(vec const& x, int ULPs); - - /// Return the value(s) ULP distance before the input value(s). - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point - /// @tparam Q Value from qualifier enum - /// - /// @see ext_scalar_ulp - template - GLM_FUNC_DECL vec prevFloat(vec const& x, vec const& ULPs); - - /// Return the distance in the number of ULP between 2 single-precision floating-point scalars. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam Q Value from qualifier enum - /// - /// @see ext_scalar_ulp - template - GLM_FUNC_DECL vec floatDistance(vec const& x, vec const& y); - - /// Return the distance in the number of ULP between 2 double-precision floating-point scalars. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam Q Value from qualifier enum - /// - /// @see ext_scalar_ulp - template - GLM_FUNC_DECL vec floatDistance(vec const& x, vec const& y); - - /// @} -}//namespace glm - -#include "vector_ulp.inl" diff --git a/3rdparty/glm/source/glm/ext/vector_ulp.inl b/3rdparty/glm/source/glm/ext/vector_ulp.inl deleted file mode 100644 index 91565ce..0000000 --- a/3rdparty/glm/source/glm/ext/vector_ulp.inl +++ /dev/null @@ -1,74 +0,0 @@ -namespace glm -{ - template - GLM_FUNC_QUALIFIER vec nextFloat(vec const& x) - { - vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = nextFloat(x[i]); - return Result; - } - - template - GLM_FUNC_QUALIFIER vec nextFloat(vec const& x, int ULPs) - { - vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = nextFloat(x[i], ULPs); - return Result; - } - - template - GLM_FUNC_QUALIFIER vec nextFloat(vec const& x, vec const& ULPs) - { - vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = nextFloat(x[i], ULPs[i]); - return Result; - } - - template - GLM_FUNC_QUALIFIER vec prevFloat(vec const& x) - { - vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = prevFloat(x[i]); - return Result; - } - - template - GLM_FUNC_QUALIFIER vec prevFloat(vec const& x, int ULPs) - { - vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = prevFloat(x[i], ULPs); - return Result; - } - - template - GLM_FUNC_QUALIFIER vec prevFloat(vec const& x, vec const& ULPs) - { - vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = prevFloat(x[i], ULPs[i]); - return Result; - } - - template - GLM_FUNC_QUALIFIER vec floatDistance(vec const& x, vec const& y) - { - vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = floatDistance(x[i], y[i]); - return Result; - } - - template - GLM_FUNC_QUALIFIER vec floatDistance(vec const& x, vec const& y) - { - vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = floatDistance(x[i], y[i]); - return Result; - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/fwd.hpp b/3rdparty/glm/source/glm/fwd.hpp deleted file mode 100644 index 89177f4..0000000 --- a/3rdparty/glm/source/glm/fwd.hpp +++ /dev/null @@ -1,1233 +0,0 @@ -#pragma once - -#include "detail/qualifier.hpp" - -namespace glm -{ -#if GLM_HAS_EXTENDED_INTEGER_TYPE - typedef std::int8_t int8; - typedef std::int16_t int16; - typedef std::int32_t int32; - typedef std::int64_t int64; - - typedef std::uint8_t uint8; - typedef std::uint16_t uint16; - typedef std::uint32_t uint32; - typedef std::uint64_t uint64; -#else - typedef signed char int8; - typedef signed short int16; - typedef signed int int32; - typedef detail::int64 int64; - - typedef unsigned char uint8; - typedef unsigned short uint16; - typedef unsigned int uint32; - typedef detail::uint64 uint64; -#endif - - // Scalar int - - typedef int8 lowp_i8; - typedef int8 mediump_i8; - typedef int8 highp_i8; - typedef int8 i8; - - typedef int8 lowp_int8; - typedef int8 mediump_int8; - typedef int8 highp_int8; - - typedef int8 lowp_int8_t; - typedef int8 mediump_int8_t; - typedef int8 highp_int8_t; - typedef int8 int8_t; - - typedef int16 lowp_i16; - typedef int16 mediump_i16; - typedef int16 highp_i16; - typedef int16 i16; - - typedef int16 lowp_int16; - typedef int16 mediump_int16; - typedef int16 highp_int16; - - typedef int16 lowp_int16_t; - typedef int16 mediump_int16_t; - typedef int16 highp_int16_t; - typedef int16 int16_t; - - typedef int32 lowp_i32; - typedef int32 mediump_i32; - typedef int32 highp_i32; - typedef int32 i32; - - typedef int32 lowp_int32; - typedef int32 mediump_int32; - typedef int32 highp_int32; - - typedef int32 lowp_int32_t; - typedef int32 mediump_int32_t; - typedef int32 highp_int32_t; - typedef int32 int32_t; - - typedef int64 lowp_i64; - typedef int64 mediump_i64; - typedef int64 highp_i64; - typedef int64 i64; - - typedef int64 lowp_int64; - typedef int64 mediump_int64; - typedef int64 highp_int64; - - typedef int64 lowp_int64_t; - typedef int64 mediump_int64_t; - typedef int64 highp_int64_t; - typedef int64 int64_t; - - // Scalar uint - - typedef unsigned int uint; - - typedef uint8 lowp_u8; - typedef uint8 mediump_u8; - typedef uint8 highp_u8; - typedef uint8 u8; - - typedef uint8 lowp_uint8; - typedef uint8 mediump_uint8; - typedef uint8 highp_uint8; - - typedef uint8 lowp_uint8_t; - typedef uint8 mediump_uint8_t; - typedef uint8 highp_uint8_t; - typedef uint8 uint8_t; - - typedef uint16 lowp_u16; - typedef uint16 mediump_u16; - typedef uint16 highp_u16; - typedef uint16 u16; - - typedef uint16 lowp_uint16; - typedef uint16 mediump_uint16; - typedef uint16 highp_uint16; - - typedef uint16 lowp_uint16_t; - typedef uint16 mediump_uint16_t; - typedef uint16 highp_uint16_t; - typedef uint16 uint16_t; - - typedef uint32 lowp_u32; - typedef uint32 mediump_u32; - typedef uint32 highp_u32; - typedef uint32 u32; - - typedef uint32 lowp_uint32; - typedef uint32 mediump_uint32; - typedef uint32 highp_uint32; - - typedef uint32 lowp_uint32_t; - typedef uint32 mediump_uint32_t; - typedef uint32 highp_uint32_t; - typedef uint32 uint32_t; - - typedef uint64 lowp_u64; - typedef uint64 mediump_u64; - typedef uint64 highp_u64; - typedef uint64 u64; - - typedef uint64 lowp_uint64; - typedef uint64 mediump_uint64; - typedef uint64 highp_uint64; - - typedef uint64 lowp_uint64_t; - typedef uint64 mediump_uint64_t; - typedef uint64 highp_uint64_t; - typedef uint64 uint64_t; - - // Scalar float - - typedef float lowp_f32; - typedef float mediump_f32; - typedef float highp_f32; - typedef float f32; - - typedef float lowp_float32; - typedef float mediump_float32; - typedef float highp_float32; - typedef float float32; - - typedef float lowp_float32_t; - typedef float mediump_float32_t; - typedef float highp_float32_t; - typedef float float32_t; - - - typedef double lowp_f64; - typedef double mediump_f64; - typedef double highp_f64; - typedef double f64; - - typedef double lowp_float64; - typedef double mediump_float64; - typedef double highp_float64; - typedef double float64; - - typedef double lowp_float64_t; - typedef double mediump_float64_t; - typedef double highp_float64_t; - typedef double float64_t; - - // Vector bool - - typedef vec<1, bool, lowp> lowp_bvec1; - typedef vec<2, bool, lowp> lowp_bvec2; - typedef vec<3, bool, lowp> lowp_bvec3; - typedef vec<4, bool, lowp> lowp_bvec4; - - typedef vec<1, bool, mediump> mediump_bvec1; - typedef vec<2, bool, mediump> mediump_bvec2; - typedef vec<3, bool, mediump> mediump_bvec3; - typedef vec<4, bool, mediump> mediump_bvec4; - - typedef vec<1, bool, highp> highp_bvec1; - typedef vec<2, bool, highp> highp_bvec2; - typedef vec<3, bool, highp> highp_bvec3; - typedef vec<4, bool, highp> highp_bvec4; - - typedef vec<1, bool, defaultp> bvec1; - typedef vec<2, bool, defaultp> bvec2; - typedef vec<3, bool, defaultp> bvec3; - typedef vec<4, bool, defaultp> bvec4; - - // Vector int - - typedef vec<1, int, lowp> lowp_ivec1; - typedef vec<2, int, lowp> lowp_ivec2; - typedef vec<3, int, lowp> lowp_ivec3; - typedef vec<4, int, lowp> lowp_ivec4; - - typedef vec<1, int, mediump> mediump_ivec1; - typedef vec<2, int, mediump> mediump_ivec2; - typedef vec<3, int, mediump> mediump_ivec3; - typedef vec<4, int, mediump> mediump_ivec4; - - typedef vec<1, int, highp> highp_ivec1; - typedef vec<2, int, highp> highp_ivec2; - typedef vec<3, int, highp> highp_ivec3; - typedef vec<4, int, highp> highp_ivec4; - - typedef vec<1, int, defaultp> ivec1; - typedef vec<2, int, defaultp> ivec2; - typedef vec<3, int, defaultp> ivec3; - typedef vec<4, int, defaultp> ivec4; - - typedef vec<1, i8, lowp> lowp_i8vec1; - typedef vec<2, i8, lowp> lowp_i8vec2; - typedef vec<3, i8, lowp> lowp_i8vec3; - typedef vec<4, i8, lowp> lowp_i8vec4; - - typedef vec<1, i8, mediump> mediump_i8vec1; - typedef vec<2, i8, mediump> mediump_i8vec2; - typedef vec<3, i8, mediump> mediump_i8vec3; - typedef vec<4, i8, mediump> mediump_i8vec4; - - typedef vec<1, i8, highp> highp_i8vec1; - typedef vec<2, i8, highp> highp_i8vec2; - typedef vec<3, i8, highp> highp_i8vec3; - typedef vec<4, i8, highp> highp_i8vec4; - - typedef vec<1, i8, defaultp> i8vec1; - typedef vec<2, i8, defaultp> i8vec2; - typedef vec<3, i8, defaultp> i8vec3; - typedef vec<4, i8, defaultp> i8vec4; - - typedef vec<1, i16, lowp> lowp_i16vec1; - typedef vec<2, i16, lowp> lowp_i16vec2; - typedef vec<3, i16, lowp> lowp_i16vec3; - typedef vec<4, i16, lowp> lowp_i16vec4; - - typedef vec<1, i16, mediump> mediump_i16vec1; - typedef vec<2, i16, mediump> mediump_i16vec2; - typedef vec<3, i16, mediump> mediump_i16vec3; - typedef vec<4, i16, mediump> mediump_i16vec4; - - typedef vec<1, i16, highp> highp_i16vec1; - typedef vec<2, i16, highp> highp_i16vec2; - typedef vec<3, i16, highp> highp_i16vec3; - typedef vec<4, i16, highp> highp_i16vec4; - - typedef vec<1, i16, defaultp> i16vec1; - typedef vec<2, i16, defaultp> i16vec2; - typedef vec<3, i16, defaultp> i16vec3; - typedef vec<4, i16, defaultp> i16vec4; - - typedef vec<1, i32, lowp> lowp_i32vec1; - typedef vec<2, i32, lowp> lowp_i32vec2; - typedef vec<3, i32, lowp> lowp_i32vec3; - typedef vec<4, i32, lowp> lowp_i32vec4; - - typedef vec<1, i32, mediump> mediump_i32vec1; - typedef vec<2, i32, mediump> mediump_i32vec2; - typedef vec<3, i32, mediump> mediump_i32vec3; - typedef vec<4, i32, mediump> mediump_i32vec4; - - typedef vec<1, i32, highp> highp_i32vec1; - typedef vec<2, i32, highp> highp_i32vec2; - typedef vec<3, i32, highp> highp_i32vec3; - typedef vec<4, i32, highp> highp_i32vec4; - - typedef vec<1, i32, defaultp> i32vec1; - typedef vec<2, i32, defaultp> i32vec2; - typedef vec<3, i32, defaultp> i32vec3; - typedef vec<4, i32, defaultp> i32vec4; - - typedef vec<1, i64, lowp> lowp_i64vec1; - typedef vec<2, i64, lowp> lowp_i64vec2; - typedef vec<3, i64, lowp> lowp_i64vec3; - typedef vec<4, i64, lowp> lowp_i64vec4; - - typedef vec<1, i64, mediump> mediump_i64vec1; - typedef vec<2, i64, mediump> mediump_i64vec2; - typedef vec<3, i64, mediump> mediump_i64vec3; - typedef vec<4, i64, mediump> mediump_i64vec4; - - typedef vec<1, i64, highp> highp_i64vec1; - typedef vec<2, i64, highp> highp_i64vec2; - typedef vec<3, i64, highp> highp_i64vec3; - typedef vec<4, i64, highp> highp_i64vec4; - - typedef vec<1, i64, defaultp> i64vec1; - typedef vec<2, i64, defaultp> i64vec2; - typedef vec<3, i64, defaultp> i64vec3; - typedef vec<4, i64, defaultp> i64vec4; - - // Vector uint - - typedef vec<1, uint, lowp> lowp_uvec1; - typedef vec<2, uint, lowp> lowp_uvec2; - typedef vec<3, uint, lowp> lowp_uvec3; - typedef vec<4, uint, lowp> lowp_uvec4; - - typedef vec<1, uint, mediump> mediump_uvec1; - typedef vec<2, uint, mediump> mediump_uvec2; - typedef vec<3, uint, mediump> mediump_uvec3; - typedef vec<4, uint, mediump> mediump_uvec4; - - typedef vec<1, uint, highp> highp_uvec1; - typedef vec<2, uint, highp> highp_uvec2; - typedef vec<3, uint, highp> highp_uvec3; - typedef vec<4, uint, highp> highp_uvec4; - - typedef vec<1, uint, defaultp> uvec1; - typedef vec<2, uint, defaultp> uvec2; - typedef vec<3, uint, defaultp> uvec3; - typedef vec<4, uint, defaultp> uvec4; - - typedef vec<1, u8, lowp> lowp_u8vec1; - typedef vec<2, u8, lowp> lowp_u8vec2; - typedef vec<3, u8, lowp> lowp_u8vec3; - typedef vec<4, u8, lowp> lowp_u8vec4; - - typedef vec<1, u8, mediump> mediump_u8vec1; - typedef vec<2, u8, mediump> mediump_u8vec2; - typedef vec<3, u8, mediump> mediump_u8vec3; - typedef vec<4, u8, mediump> mediump_u8vec4; - - typedef vec<1, u8, highp> highp_u8vec1; - typedef vec<2, u8, highp> highp_u8vec2; - typedef vec<3, u8, highp> highp_u8vec3; - typedef vec<4, u8, highp> highp_u8vec4; - - typedef vec<1, u8, defaultp> u8vec1; - typedef vec<2, u8, defaultp> u8vec2; - typedef vec<3, u8, defaultp> u8vec3; - typedef vec<4, u8, defaultp> u8vec4; - - typedef vec<1, u16, lowp> lowp_u16vec1; - typedef vec<2, u16, lowp> lowp_u16vec2; - typedef vec<3, u16, lowp> lowp_u16vec3; - typedef vec<4, u16, lowp> lowp_u16vec4; - - typedef vec<1, u16, mediump> mediump_u16vec1; - typedef vec<2, u16, mediump> mediump_u16vec2; - typedef vec<3, u16, mediump> mediump_u16vec3; - typedef vec<4, u16, mediump> mediump_u16vec4; - - typedef vec<1, u16, highp> highp_u16vec1; - typedef vec<2, u16, highp> highp_u16vec2; - typedef vec<3, u16, highp> highp_u16vec3; - typedef vec<4, u16, highp> highp_u16vec4; - - typedef vec<1, u16, defaultp> u16vec1; - typedef vec<2, u16, defaultp> u16vec2; - typedef vec<3, u16, defaultp> u16vec3; - typedef vec<4, u16, defaultp> u16vec4; - - typedef vec<1, u32, lowp> lowp_u32vec1; - typedef vec<2, u32, lowp> lowp_u32vec2; - typedef vec<3, u32, lowp> lowp_u32vec3; - typedef vec<4, u32, lowp> lowp_u32vec4; - - typedef vec<1, u32, mediump> mediump_u32vec1; - typedef vec<2, u32, mediump> mediump_u32vec2; - typedef vec<3, u32, mediump> mediump_u32vec3; - typedef vec<4, u32, mediump> mediump_u32vec4; - - typedef vec<1, u32, highp> highp_u32vec1; - typedef vec<2, u32, highp> highp_u32vec2; - typedef vec<3, u32, highp> highp_u32vec3; - typedef vec<4, u32, highp> highp_u32vec4; - - typedef vec<1, u32, defaultp> u32vec1; - typedef vec<2, u32, defaultp> u32vec2; - typedef vec<3, u32, defaultp> u32vec3; - typedef vec<4, u32, defaultp> u32vec4; - - typedef vec<1, u64, lowp> lowp_u64vec1; - typedef vec<2, u64, lowp> lowp_u64vec2; - typedef vec<3, u64, lowp> lowp_u64vec3; - typedef vec<4, u64, lowp> lowp_u64vec4; - - typedef vec<1, u64, mediump> mediump_u64vec1; - typedef vec<2, u64, mediump> mediump_u64vec2; - typedef vec<3, u64, mediump> mediump_u64vec3; - typedef vec<4, u64, mediump> mediump_u64vec4; - - typedef vec<1, u64, highp> highp_u64vec1; - typedef vec<2, u64, highp> highp_u64vec2; - typedef vec<3, u64, highp> highp_u64vec3; - typedef vec<4, u64, highp> highp_u64vec4; - - typedef vec<1, u64, defaultp> u64vec1; - typedef vec<2, u64, defaultp> u64vec2; - typedef vec<3, u64, defaultp> u64vec3; - typedef vec<4, u64, defaultp> u64vec4; - - // Vector float - - typedef vec<1, float, lowp> lowp_vec1; - typedef vec<2, float, lowp> lowp_vec2; - typedef vec<3, float, lowp> lowp_vec3; - typedef vec<4, float, lowp> lowp_vec4; - - typedef vec<1, float, mediump> mediump_vec1; - typedef vec<2, float, mediump> mediump_vec2; - typedef vec<3, float, mediump> mediump_vec3; - typedef vec<4, float, mediump> mediump_vec4; - - typedef vec<1, float, highp> highp_vec1; - typedef vec<2, float, highp> highp_vec2; - typedef vec<3, float, highp> highp_vec3; - typedef vec<4, float, highp> highp_vec4; - - typedef vec<1, float, defaultp> vec1; - typedef vec<2, float, defaultp> vec2; - typedef vec<3, float, defaultp> vec3; - typedef vec<4, float, defaultp> vec4; - - typedef vec<1, float, lowp> lowp_fvec1; - typedef vec<2, float, lowp> lowp_fvec2; - typedef vec<3, float, lowp> lowp_fvec3; - typedef vec<4, float, lowp> lowp_fvec4; - - typedef vec<1, float, mediump> mediump_fvec1; - typedef vec<2, float, mediump> mediump_fvec2; - typedef vec<3, float, mediump> mediump_fvec3; - typedef vec<4, float, mediump> mediump_fvec4; - - typedef vec<1, float, highp> highp_fvec1; - typedef vec<2, float, highp> highp_fvec2; - typedef vec<3, float, highp> highp_fvec3; - typedef vec<4, float, highp> highp_fvec4; - - typedef vec<1, f32, defaultp> fvec1; - typedef vec<2, f32, defaultp> fvec2; - typedef vec<3, f32, defaultp> fvec3; - typedef vec<4, f32, defaultp> fvec4; - - typedef vec<1, f32, lowp> lowp_f32vec1; - typedef vec<2, f32, lowp> lowp_f32vec2; - typedef vec<3, f32, lowp> lowp_f32vec3; - typedef vec<4, f32, lowp> lowp_f32vec4; - - typedef vec<1, f32, mediump> mediump_f32vec1; - typedef vec<2, f32, mediump> mediump_f32vec2; - typedef vec<3, f32, mediump> mediump_f32vec3; - typedef vec<4, f32, mediump> mediump_f32vec4; - - typedef vec<1, f32, highp> highp_f32vec1; - typedef vec<2, f32, highp> highp_f32vec2; - typedef vec<3, f32, highp> highp_f32vec3; - typedef vec<4, f32, highp> highp_f32vec4; - - typedef vec<1, f32, defaultp> f32vec1; - typedef vec<2, f32, defaultp> f32vec2; - typedef vec<3, f32, defaultp> f32vec3; - typedef vec<4, f32, defaultp> f32vec4; - - typedef vec<1, f64, lowp> lowp_dvec1; - typedef vec<2, f64, lowp> lowp_dvec2; - typedef vec<3, f64, lowp> lowp_dvec3; - typedef vec<4, f64, lowp> lowp_dvec4; - - typedef vec<1, f64, mediump> mediump_dvec1; - typedef vec<2, f64, mediump> mediump_dvec2; - typedef vec<3, f64, mediump> mediump_dvec3; - typedef vec<4, f64, mediump> mediump_dvec4; - - typedef vec<1, f64, highp> highp_dvec1; - typedef vec<2, f64, highp> highp_dvec2; - typedef vec<3, f64, highp> highp_dvec3; - typedef vec<4, f64, highp> highp_dvec4; - - typedef vec<1, f64, defaultp> dvec1; - typedef vec<2, f64, defaultp> dvec2; - typedef vec<3, f64, defaultp> dvec3; - typedef vec<4, f64, defaultp> dvec4; - - typedef vec<1, f64, lowp> lowp_f64vec1; - typedef vec<2, f64, lowp> lowp_f64vec2; - typedef vec<3, f64, lowp> lowp_f64vec3; - typedef vec<4, f64, lowp> lowp_f64vec4; - - typedef vec<1, f64, mediump> mediump_f64vec1; - typedef vec<2, f64, mediump> mediump_f64vec2; - typedef vec<3, f64, mediump> mediump_f64vec3; - typedef vec<4, f64, mediump> mediump_f64vec4; - - typedef vec<1, f64, highp> highp_f64vec1; - typedef vec<2, f64, highp> highp_f64vec2; - typedef vec<3, f64, highp> highp_f64vec3; - typedef vec<4, f64, highp> highp_f64vec4; - - typedef vec<1, f64, defaultp> f64vec1; - typedef vec<2, f64, defaultp> f64vec2; - typedef vec<3, f64, defaultp> f64vec3; - typedef vec<4, f64, defaultp> f64vec4; - - // Matrix NxN - - typedef mat<2, 2, f32, lowp> lowp_mat2; - typedef mat<3, 3, f32, lowp> lowp_mat3; - typedef mat<4, 4, f32, lowp> lowp_mat4; - - typedef mat<2, 2, f32, mediump> mediump_mat2; - typedef mat<3, 3, f32, mediump> mediump_mat3; - typedef mat<4, 4, f32, mediump> mediump_mat4; - - typedef mat<2, 2, f32, highp> highp_mat2; - typedef mat<3, 3, f32, highp> highp_mat3; - typedef mat<4, 4, f32, highp> highp_mat4; - - typedef mat<2, 2, f32, defaultp> mat2; - typedef mat<3, 3, f32, defaultp> mat3; - typedef mat<4, 4, f32, defaultp> mat4; - - typedef mat<2, 2, f32, lowp> lowp_fmat2; - typedef mat<3, 3, f32, lowp> lowp_fmat3; - typedef mat<4, 4, f32, lowp> lowp_fmat4; - - typedef mat<2, 2, f32, mediump> mediump_fmat2; - typedef mat<3, 3, f32, mediump> mediump_fmat3; - typedef mat<4, 4, f32, mediump> mediump_fmat4; - - typedef mat<2, 2, f32, highp> highp_fmat2; - typedef mat<3, 3, f32, highp> highp_fmat3; - typedef mat<4, 4, f32, highp> highp_fmat4; - - typedef mat<2, 2, f32, defaultp> fmat2; - typedef mat<3, 3, f32, defaultp> fmat3; - typedef mat<4, 4, f32, defaultp> fmat4; - - typedef mat<2, 2, f32, lowp> lowp_f32mat2; - typedef mat<3, 3, f32, lowp> lowp_f32mat3; - typedef mat<4, 4, f32, lowp> lowp_f32mat4; - - typedef mat<2, 2, f32, mediump> mediump_f32mat2; - typedef mat<3, 3, f32, mediump> mediump_f32mat3; - typedef mat<4, 4, f32, mediump> mediump_f32mat4; - - typedef mat<2, 2, f32, highp> highp_f32mat2; - typedef mat<3, 3, f32, highp> highp_f32mat3; - typedef mat<4, 4, f32, highp> highp_f32mat4; - - typedef mat<2, 2, f32, defaultp> f32mat2; - typedef mat<3, 3, f32, defaultp> f32mat3; - typedef mat<4, 4, f32, defaultp> f32mat4; - - typedef mat<2, 2, f64, lowp> lowp_dmat2; - typedef mat<3, 3, f64, lowp> lowp_dmat3; - typedef mat<4, 4, f64, lowp> lowp_dmat4; - - typedef mat<2, 2, f64, mediump> mediump_dmat2; - typedef mat<3, 3, f64, mediump> mediump_dmat3; - typedef mat<4, 4, f64, mediump> mediump_dmat4; - - typedef mat<2, 2, f64, highp> highp_dmat2; - typedef mat<3, 3, f64, highp> highp_dmat3; - typedef mat<4, 4, f64, highp> highp_dmat4; - - typedef mat<2, 2, f64, defaultp> dmat2; - typedef mat<3, 3, f64, defaultp> dmat3; - typedef mat<4, 4, f64, defaultp> dmat4; - - typedef mat<2, 2, f64, lowp> lowp_f64mat2; - typedef mat<3, 3, f64, lowp> lowp_f64mat3; - typedef mat<4, 4, f64, lowp> lowp_f64mat4; - - typedef mat<2, 2, f64, mediump> mediump_f64mat2; - typedef mat<3, 3, f64, mediump> mediump_f64mat3; - typedef mat<4, 4, f64, mediump> mediump_f64mat4; - - typedef mat<2, 2, f64, highp> highp_f64mat2; - typedef mat<3, 3, f64, highp> highp_f64mat3; - typedef mat<4, 4, f64, highp> highp_f64mat4; - - typedef mat<2, 2, f64, defaultp> f64mat2; - typedef mat<3, 3, f64, defaultp> f64mat3; - typedef mat<4, 4, f64, defaultp> f64mat4; - - // Matrix MxN - - typedef mat<2, 2, f32, lowp> lowp_mat2x2; - typedef mat<2, 3, f32, lowp> lowp_mat2x3; - typedef mat<2, 4, f32, lowp> lowp_mat2x4; - typedef mat<3, 2, f32, lowp> lowp_mat3x2; - typedef mat<3, 3, f32, lowp> lowp_mat3x3; - typedef mat<3, 4, f32, lowp> lowp_mat3x4; - typedef mat<4, 2, f32, lowp> lowp_mat4x2; - typedef mat<4, 3, f32, lowp> lowp_mat4x3; - typedef mat<4, 4, f32, lowp> lowp_mat4x4; - - typedef mat<2, 2, f32, mediump> mediump_mat2x2; - typedef mat<2, 3, f32, mediump> mediump_mat2x3; - typedef mat<2, 4, f32, mediump> mediump_mat2x4; - typedef mat<3, 2, f32, mediump> mediump_mat3x2; - typedef mat<3, 3, f32, mediump> mediump_mat3x3; - typedef mat<3, 4, f32, mediump> mediump_mat3x4; - typedef mat<4, 2, f32, mediump> mediump_mat4x2; - typedef mat<4, 3, f32, mediump> mediump_mat4x3; - typedef mat<4, 4, f32, mediump> mediump_mat4x4; - - typedef mat<2, 2, f32, highp> highp_mat2x2; - typedef mat<2, 3, f32, highp> highp_mat2x3; - typedef mat<2, 4, f32, highp> highp_mat2x4; - typedef mat<3, 2, f32, highp> highp_mat3x2; - typedef mat<3, 3, f32, highp> highp_mat3x3; - typedef mat<3, 4, f32, highp> highp_mat3x4; - typedef mat<4, 2, f32, highp> highp_mat4x2; - typedef mat<4, 3, f32, highp> highp_mat4x3; - typedef mat<4, 4, f32, highp> highp_mat4x4; - - typedef mat<2, 2, f32, defaultp> mat2x2; - typedef mat<3, 2, f32, defaultp> mat3x2; - typedef mat<4, 2, f32, defaultp> mat4x2; - typedef mat<2, 3, f32, defaultp> mat2x3; - typedef mat<3, 3, f32, defaultp> mat3x3; - typedef mat<4, 3, f32, defaultp> mat4x3; - typedef mat<2, 4, f32, defaultp> mat2x4; - typedef mat<3, 4, f32, defaultp> mat3x4; - typedef mat<4, 4, f32, defaultp> mat4x4; - - typedef mat<2, 2, f32, lowp> lowp_fmat2x2; - typedef mat<2, 3, f32, lowp> lowp_fmat2x3; - typedef mat<2, 4, f32, lowp> lowp_fmat2x4; - typedef mat<3, 2, f32, lowp> lowp_fmat3x2; - typedef mat<3, 3, f32, lowp> lowp_fmat3x3; - typedef mat<3, 4, f32, lowp> lowp_fmat3x4; - typedef mat<4, 2, f32, lowp> lowp_fmat4x2; - typedef mat<4, 3, f32, lowp> lowp_fmat4x3; - typedef mat<4, 4, f32, lowp> lowp_fmat4x4; - - typedef mat<2, 2, f32, mediump> mediump_fmat2x2; - typedef mat<2, 3, f32, mediump> mediump_fmat2x3; - typedef mat<2, 4, f32, mediump> mediump_fmat2x4; - typedef mat<3, 2, f32, mediump> mediump_fmat3x2; - typedef mat<3, 3, f32, mediump> mediump_fmat3x3; - typedef mat<3, 4, f32, mediump> mediump_fmat3x4; - typedef mat<4, 2, f32, mediump> mediump_fmat4x2; - typedef mat<4, 3, f32, mediump> mediump_fmat4x3; - typedef mat<4, 4, f32, mediump> mediump_fmat4x4; - - typedef mat<2, 2, f32, highp> highp_fmat2x2; - typedef mat<2, 3, f32, highp> highp_fmat2x3; - typedef mat<2, 4, f32, highp> highp_fmat2x4; - typedef mat<3, 2, f32, highp> highp_fmat3x2; - typedef mat<3, 3, f32, highp> highp_fmat3x3; - typedef mat<3, 4, f32, highp> highp_fmat3x4; - typedef mat<4, 2, f32, highp> highp_fmat4x2; - typedef mat<4, 3, f32, highp> highp_fmat4x3; - typedef mat<4, 4, f32, highp> highp_fmat4x4; - - typedef mat<2, 2, f32, defaultp> fmat2x2; - typedef mat<3, 2, f32, defaultp> fmat3x2; - typedef mat<4, 2, f32, defaultp> fmat4x2; - typedef mat<2, 3, f32, defaultp> fmat2x3; - typedef mat<3, 3, f32, defaultp> fmat3x3; - typedef mat<4, 3, f32, defaultp> fmat4x3; - typedef mat<2, 4, f32, defaultp> fmat2x4; - typedef mat<3, 4, f32, defaultp> fmat3x4; - typedef mat<4, 4, f32, defaultp> fmat4x4; - - typedef mat<2, 2, f32, lowp> lowp_f32mat2x2; - typedef mat<2, 3, f32, lowp> lowp_f32mat2x3; - typedef mat<2, 4, f32, lowp> lowp_f32mat2x4; - typedef mat<3, 2, f32, lowp> lowp_f32mat3x2; - typedef mat<3, 3, f32, lowp> lowp_f32mat3x3; - typedef mat<3, 4, f32, lowp> lowp_f32mat3x4; - typedef mat<4, 2, f32, lowp> lowp_f32mat4x2; - typedef mat<4, 3, f32, lowp> lowp_f32mat4x3; - typedef mat<4, 4, f32, lowp> lowp_f32mat4x4; - - typedef mat<2, 2, f32, mediump> mediump_f32mat2x2; - typedef mat<2, 3, f32, mediump> mediump_f32mat2x3; - typedef mat<2, 4, f32, mediump> mediump_f32mat2x4; - typedef mat<3, 2, f32, mediump> mediump_f32mat3x2; - typedef mat<3, 3, f32, mediump> mediump_f32mat3x3; - typedef mat<3, 4, f32, mediump> mediump_f32mat3x4; - typedef mat<4, 2, f32, mediump> mediump_f32mat4x2; - typedef mat<4, 3, f32, mediump> mediump_f32mat4x3; - typedef mat<4, 4, f32, mediump> mediump_f32mat4x4; - - typedef mat<2, 2, f32, highp> highp_f32mat2x2; - typedef mat<2, 3, f32, highp> highp_f32mat2x3; - typedef mat<2, 4, f32, highp> highp_f32mat2x4; - typedef mat<3, 2, f32, highp> highp_f32mat3x2; - typedef mat<3, 3, f32, highp> highp_f32mat3x3; - typedef mat<3, 4, f32, highp> highp_f32mat3x4; - typedef mat<4, 2, f32, highp> highp_f32mat4x2; - typedef mat<4, 3, f32, highp> highp_f32mat4x3; - typedef mat<4, 4, f32, highp> highp_f32mat4x4; - - typedef mat<2, 2, f32, defaultp> f32mat2x2; - typedef mat<3, 2, f32, defaultp> f32mat3x2; - typedef mat<4, 2, f32, defaultp> f32mat4x2; - typedef mat<2, 3, f32, defaultp> f32mat2x3; - typedef mat<3, 3, f32, defaultp> f32mat3x3; - typedef mat<4, 3, f32, defaultp> f32mat4x3; - typedef mat<2, 4, f32, defaultp> f32mat2x4; - typedef mat<3, 4, f32, defaultp> f32mat3x4; - typedef mat<4, 4, f32, defaultp> f32mat4x4; - - typedef mat<2, 2, double, lowp> lowp_dmat2x2; - typedef mat<2, 3, double, lowp> lowp_dmat2x3; - typedef mat<2, 4, double, lowp> lowp_dmat2x4; - typedef mat<3, 2, double, lowp> lowp_dmat3x2; - typedef mat<3, 3, double, lowp> lowp_dmat3x3; - typedef mat<3, 4, double, lowp> lowp_dmat3x4; - typedef mat<4, 2, double, lowp> lowp_dmat4x2; - typedef mat<4, 3, double, lowp> lowp_dmat4x3; - typedef mat<4, 4, double, lowp> lowp_dmat4x4; - - typedef mat<2, 2, double, mediump> mediump_dmat2x2; - typedef mat<2, 3, double, mediump> mediump_dmat2x3; - typedef mat<2, 4, double, mediump> mediump_dmat2x4; - typedef mat<3, 2, double, mediump> mediump_dmat3x2; - typedef mat<3, 3, double, mediump> mediump_dmat3x3; - typedef mat<3, 4, double, mediump> mediump_dmat3x4; - typedef mat<4, 2, double, mediump> mediump_dmat4x2; - typedef mat<4, 3, double, mediump> mediump_dmat4x3; - typedef mat<4, 4, double, mediump> mediump_dmat4x4; - - typedef mat<2, 2, double, highp> highp_dmat2x2; - typedef mat<2, 3, double, highp> highp_dmat2x3; - typedef mat<2, 4, double, highp> highp_dmat2x4; - typedef mat<3, 2, double, highp> highp_dmat3x2; - typedef mat<3, 3, double, highp> highp_dmat3x3; - typedef mat<3, 4, double, highp> highp_dmat3x4; - typedef mat<4, 2, double, highp> highp_dmat4x2; - typedef mat<4, 3, double, highp> highp_dmat4x3; - typedef mat<4, 4, double, highp> highp_dmat4x4; - - typedef mat<2, 2, double, defaultp> dmat2x2; - typedef mat<3, 2, double, defaultp> dmat3x2; - typedef mat<4, 2, double, defaultp> dmat4x2; - typedef mat<2, 3, double, defaultp> dmat2x3; - typedef mat<3, 3, double, defaultp> dmat3x3; - typedef mat<4, 3, double, defaultp> dmat4x3; - typedef mat<2, 4, double, defaultp> dmat2x4; - typedef mat<3, 4, double, defaultp> dmat3x4; - typedef mat<4, 4, double, defaultp> dmat4x4; - - typedef mat<2, 2, f64, lowp> lowp_f64mat2x2; - typedef mat<2, 3, f64, lowp> lowp_f64mat2x3; - typedef mat<2, 4, f64, lowp> lowp_f64mat2x4; - typedef mat<3, 2, f64, lowp> lowp_f64mat3x2; - typedef mat<3, 3, f64, lowp> lowp_f64mat3x3; - typedef mat<3, 4, f64, lowp> lowp_f64mat3x4; - typedef mat<4, 2, f64, lowp> lowp_f64mat4x2; - typedef mat<4, 3, f64, lowp> lowp_f64mat4x3; - typedef mat<4, 4, f64, lowp> lowp_f64mat4x4; - - typedef mat<2, 2, f64, mediump> mediump_f64mat2x2; - typedef mat<2, 3, f64, mediump> mediump_f64mat2x3; - typedef mat<2, 4, f64, mediump> mediump_f64mat2x4; - typedef mat<3, 2, f64, mediump> mediump_f64mat3x2; - typedef mat<3, 3, f64, mediump> mediump_f64mat3x3; - typedef mat<3, 4, f64, mediump> mediump_f64mat3x4; - typedef mat<4, 2, f64, mediump> mediump_f64mat4x2; - typedef mat<4, 3, f64, mediump> mediump_f64mat4x3; - typedef mat<4, 4, f64, mediump> mediump_f64mat4x4; - - typedef mat<2, 2, f64, highp> highp_f64mat2x2; - typedef mat<2, 3, f64, highp> highp_f64mat2x3; - typedef mat<2, 4, f64, highp> highp_f64mat2x4; - typedef mat<3, 2, f64, highp> highp_f64mat3x2; - typedef mat<3, 3, f64, highp> highp_f64mat3x3; - typedef mat<3, 4, f64, highp> highp_f64mat3x4; - typedef mat<4, 2, f64, highp> highp_f64mat4x2; - typedef mat<4, 3, f64, highp> highp_f64mat4x3; - typedef mat<4, 4, f64, highp> highp_f64mat4x4; - - typedef mat<2, 2, f64, defaultp> f64mat2x2; - typedef mat<3, 2, f64, defaultp> f64mat3x2; - typedef mat<4, 2, f64, defaultp> f64mat4x2; - typedef mat<2, 3, f64, defaultp> f64mat2x3; - typedef mat<3, 3, f64, defaultp> f64mat3x3; - typedef mat<4, 3, f64, defaultp> f64mat4x3; - typedef mat<2, 4, f64, defaultp> f64mat2x4; - typedef mat<3, 4, f64, defaultp> f64mat3x4; - typedef mat<4, 4, f64, defaultp> f64mat4x4; - - // Signed integer matrix MxN - - typedef mat<2, 2, int, lowp> lowp_imat2x2; - typedef mat<2, 3, int, lowp> lowp_imat2x3; - typedef mat<2, 4, int, lowp> lowp_imat2x4; - typedef mat<3, 2, int, lowp> lowp_imat3x2; - typedef mat<3, 3, int, lowp> lowp_imat3x3; - typedef mat<3, 4, int, lowp> lowp_imat3x4; - typedef mat<4, 2, int, lowp> lowp_imat4x2; - typedef mat<4, 3, int, lowp> lowp_imat4x3; - typedef mat<4, 4, int, lowp> lowp_imat4x4; - - typedef mat<2, 2, int, mediump> mediump_imat2x2; - typedef mat<2, 3, int, mediump> mediump_imat2x3; - typedef mat<2, 4, int, mediump> mediump_imat2x4; - typedef mat<3, 2, int, mediump> mediump_imat3x2; - typedef mat<3, 3, int, mediump> mediump_imat3x3; - typedef mat<3, 4, int, mediump> mediump_imat3x4; - typedef mat<4, 2, int, mediump> mediump_imat4x2; - typedef mat<4, 3, int, mediump> mediump_imat4x3; - typedef mat<4, 4, int, mediump> mediump_imat4x4; - - typedef mat<2, 2, int, highp> highp_imat2x2; - typedef mat<2, 3, int, highp> highp_imat2x3; - typedef mat<2, 4, int, highp> highp_imat2x4; - typedef mat<3, 2, int, highp> highp_imat3x2; - typedef mat<3, 3, int, highp> highp_imat3x3; - typedef mat<3, 4, int, highp> highp_imat3x4; - typedef mat<4, 2, int, highp> highp_imat4x2; - typedef mat<4, 3, int, highp> highp_imat4x3; - typedef mat<4, 4, int, highp> highp_imat4x4; - - typedef mat<2, 2, int, defaultp> imat2x2; - typedef mat<3, 2, int, defaultp> imat3x2; - typedef mat<4, 2, int, defaultp> imat4x2; - typedef mat<2, 3, int, defaultp> imat2x3; - typedef mat<3, 3, int, defaultp> imat3x3; - typedef mat<4, 3, int, defaultp> imat4x3; - typedef mat<2, 4, int, defaultp> imat2x4; - typedef mat<3, 4, int, defaultp> imat3x4; - typedef mat<4, 4, int, defaultp> imat4x4; - - - typedef mat<2, 2, int8, lowp> lowp_i8mat2x2; - typedef mat<2, 3, int8, lowp> lowp_i8mat2x3; - typedef mat<2, 4, int8, lowp> lowp_i8mat2x4; - typedef mat<3, 2, int8, lowp> lowp_i8mat3x2; - typedef mat<3, 3, int8, lowp> lowp_i8mat3x3; - typedef mat<3, 4, int8, lowp> lowp_i8mat3x4; - typedef mat<4, 2, int8, lowp> lowp_i8mat4x2; - typedef mat<4, 3, int8, lowp> lowp_i8mat4x3; - typedef mat<4, 4, int8, lowp> lowp_i8mat4x4; - - typedef mat<2, 2, int8, mediump> mediump_i8mat2x2; - typedef mat<2, 3, int8, mediump> mediump_i8mat2x3; - typedef mat<2, 4, int8, mediump> mediump_i8mat2x4; - typedef mat<3, 2, int8, mediump> mediump_i8mat3x2; - typedef mat<3, 3, int8, mediump> mediump_i8mat3x3; - typedef mat<3, 4, int8, mediump> mediump_i8mat3x4; - typedef mat<4, 2, int8, mediump> mediump_i8mat4x2; - typedef mat<4, 3, int8, mediump> mediump_i8mat4x3; - typedef mat<4, 4, int8, mediump> mediump_i8mat4x4; - - typedef mat<2, 2, int8, highp> highp_i8mat2x2; - typedef mat<2, 3, int8, highp> highp_i8mat2x3; - typedef mat<2, 4, int8, highp> highp_i8mat2x4; - typedef mat<3, 2, int8, highp> highp_i8mat3x2; - typedef mat<3, 3, int8, highp> highp_i8mat3x3; - typedef mat<3, 4, int8, highp> highp_i8mat3x4; - typedef mat<4, 2, int8, highp> highp_i8mat4x2; - typedef mat<4, 3, int8, highp> highp_i8mat4x3; - typedef mat<4, 4, int8, highp> highp_i8mat4x4; - - typedef mat<2, 2, int8, defaultp> i8mat2x2; - typedef mat<3, 2, int8, defaultp> i8mat3x2; - typedef mat<4, 2, int8, defaultp> i8mat4x2; - typedef mat<2, 3, int8, defaultp> i8mat2x3; - typedef mat<3, 3, int8, defaultp> i8mat3x3; - typedef mat<4, 3, int8, defaultp> i8mat4x3; - typedef mat<2, 4, int8, defaultp> i8mat2x4; - typedef mat<3, 4, int8, defaultp> i8mat3x4; - typedef mat<4, 4, int8, defaultp> i8mat4x4; - - - typedef mat<2, 2, int16, lowp> lowp_i16mat2x2; - typedef mat<2, 3, int16, lowp> lowp_i16mat2x3; - typedef mat<2, 4, int16, lowp> lowp_i16mat2x4; - typedef mat<3, 2, int16, lowp> lowp_i16mat3x2; - typedef mat<3, 3, int16, lowp> lowp_i16mat3x3; - typedef mat<3, 4, int16, lowp> lowp_i16mat3x4; - typedef mat<4, 2, int16, lowp> lowp_i16mat4x2; - typedef mat<4, 3, int16, lowp> lowp_i16mat4x3; - typedef mat<4, 4, int16, lowp> lowp_i16mat4x4; - - typedef mat<2, 2, int16, mediump> mediump_i16mat2x2; - typedef mat<2, 3, int16, mediump> mediump_i16mat2x3; - typedef mat<2, 4, int16, mediump> mediump_i16mat2x4; - typedef mat<3, 2, int16, mediump> mediump_i16mat3x2; - typedef mat<3, 3, int16, mediump> mediump_i16mat3x3; - typedef mat<3, 4, int16, mediump> mediump_i16mat3x4; - typedef mat<4, 2, int16, mediump> mediump_i16mat4x2; - typedef mat<4, 3, int16, mediump> mediump_i16mat4x3; - typedef mat<4, 4, int16, mediump> mediump_i16mat4x4; - - typedef mat<2, 2, int16, highp> highp_i16mat2x2; - typedef mat<2, 3, int16, highp> highp_i16mat2x3; - typedef mat<2, 4, int16, highp> highp_i16mat2x4; - typedef mat<3, 2, int16, highp> highp_i16mat3x2; - typedef mat<3, 3, int16, highp> highp_i16mat3x3; - typedef mat<3, 4, int16, highp> highp_i16mat3x4; - typedef mat<4, 2, int16, highp> highp_i16mat4x2; - typedef mat<4, 3, int16, highp> highp_i16mat4x3; - typedef mat<4, 4, int16, highp> highp_i16mat4x4; - - typedef mat<2, 2, int16, defaultp> i16mat2x2; - typedef mat<3, 2, int16, defaultp> i16mat3x2; - typedef mat<4, 2, int16, defaultp> i16mat4x2; - typedef mat<2, 3, int16, defaultp> i16mat2x3; - typedef mat<3, 3, int16, defaultp> i16mat3x3; - typedef mat<4, 3, int16, defaultp> i16mat4x3; - typedef mat<2, 4, int16, defaultp> i16mat2x4; - typedef mat<3, 4, int16, defaultp> i16mat3x4; - typedef mat<4, 4, int16, defaultp> i16mat4x4; - - - typedef mat<2, 2, int32, lowp> lowp_i32mat2x2; - typedef mat<2, 3, int32, lowp> lowp_i32mat2x3; - typedef mat<2, 4, int32, lowp> lowp_i32mat2x4; - typedef mat<3, 2, int32, lowp> lowp_i32mat3x2; - typedef mat<3, 3, int32, lowp> lowp_i32mat3x3; - typedef mat<3, 4, int32, lowp> lowp_i32mat3x4; - typedef mat<4, 2, int32, lowp> lowp_i32mat4x2; - typedef mat<4, 3, int32, lowp> lowp_i32mat4x3; - typedef mat<4, 4, int32, lowp> lowp_i32mat4x4; - - typedef mat<2, 2, int32, mediump> mediump_i32mat2x2; - typedef mat<2, 3, int32, mediump> mediump_i32mat2x3; - typedef mat<2, 4, int32, mediump> mediump_i32mat2x4; - typedef mat<3, 2, int32, mediump> mediump_i32mat3x2; - typedef mat<3, 3, int32, mediump> mediump_i32mat3x3; - typedef mat<3, 4, int32, mediump> mediump_i32mat3x4; - typedef mat<4, 2, int32, mediump> mediump_i32mat4x2; - typedef mat<4, 3, int32, mediump> mediump_i32mat4x3; - typedef mat<4, 4, int32, mediump> mediump_i32mat4x4; - - typedef mat<2, 2, int32, highp> highp_i32mat2x2; - typedef mat<2, 3, int32, highp> highp_i32mat2x3; - typedef mat<2, 4, int32, highp> highp_i32mat2x4; - typedef mat<3, 2, int32, highp> highp_i32mat3x2; - typedef mat<3, 3, int32, highp> highp_i32mat3x3; - typedef mat<3, 4, int32, highp> highp_i32mat3x4; - typedef mat<4, 2, int32, highp> highp_i32mat4x2; - typedef mat<4, 3, int32, highp> highp_i32mat4x3; - typedef mat<4, 4, int32, highp> highp_i32mat4x4; - - typedef mat<2, 2, int32, defaultp> i32mat2x2; - typedef mat<3, 2, int32, defaultp> i32mat3x2; - typedef mat<4, 2, int32, defaultp> i32mat4x2; - typedef mat<2, 3, int32, defaultp> i32mat2x3; - typedef mat<3, 3, int32, defaultp> i32mat3x3; - typedef mat<4, 3, int32, defaultp> i32mat4x3; - typedef mat<2, 4, int32, defaultp> i32mat2x4; - typedef mat<3, 4, int32, defaultp> i32mat3x4; - typedef mat<4, 4, int32, defaultp> i32mat4x4; - - - typedef mat<2, 2, int64, lowp> lowp_i64mat2x2; - typedef mat<2, 3, int64, lowp> lowp_i64mat2x3; - typedef mat<2, 4, int64, lowp> lowp_i64mat2x4; - typedef mat<3, 2, int64, lowp> lowp_i64mat3x2; - typedef mat<3, 3, int64, lowp> lowp_i64mat3x3; - typedef mat<3, 4, int64, lowp> lowp_i64mat3x4; - typedef mat<4, 2, int64, lowp> lowp_i64mat4x2; - typedef mat<4, 3, int64, lowp> lowp_i64mat4x3; - typedef mat<4, 4, int64, lowp> lowp_i64mat4x4; - - typedef mat<2, 2, int64, mediump> mediump_i64mat2x2; - typedef mat<2, 3, int64, mediump> mediump_i64mat2x3; - typedef mat<2, 4, int64, mediump> mediump_i64mat2x4; - typedef mat<3, 2, int64, mediump> mediump_i64mat3x2; - typedef mat<3, 3, int64, mediump> mediump_i64mat3x3; - typedef mat<3, 4, int64, mediump> mediump_i64mat3x4; - typedef mat<4, 2, int64, mediump> mediump_i64mat4x2; - typedef mat<4, 3, int64, mediump> mediump_i64mat4x3; - typedef mat<4, 4, int64, mediump> mediump_i64mat4x4; - - typedef mat<2, 2, int64, highp> highp_i64mat2x2; - typedef mat<2, 3, int64, highp> highp_i64mat2x3; - typedef mat<2, 4, int64, highp> highp_i64mat2x4; - typedef mat<3, 2, int64, highp> highp_i64mat3x2; - typedef mat<3, 3, int64, highp> highp_i64mat3x3; - typedef mat<3, 4, int64, highp> highp_i64mat3x4; - typedef mat<4, 2, int64, highp> highp_i64mat4x2; - typedef mat<4, 3, int64, highp> highp_i64mat4x3; - typedef mat<4, 4, int64, highp> highp_i64mat4x4; - - typedef mat<2, 2, int64, defaultp> i64mat2x2; - typedef mat<3, 2, int64, defaultp> i64mat3x2; - typedef mat<4, 2, int64, defaultp> i64mat4x2; - typedef mat<2, 3, int64, defaultp> i64mat2x3; - typedef mat<3, 3, int64, defaultp> i64mat3x3; - typedef mat<4, 3, int64, defaultp> i64mat4x3; - typedef mat<2, 4, int64, defaultp> i64mat2x4; - typedef mat<3, 4, int64, defaultp> i64mat3x4; - typedef mat<4, 4, int64, defaultp> i64mat4x4; - - - // Unsigned integer matrix MxN - - typedef mat<2, 2, uint, lowp> lowp_umat2x2; - typedef mat<2, 3, uint, lowp> lowp_umat2x3; - typedef mat<2, 4, uint, lowp> lowp_umat2x4; - typedef mat<3, 2, uint, lowp> lowp_umat3x2; - typedef mat<3, 3, uint, lowp> lowp_umat3x3; - typedef mat<3, 4, uint, lowp> lowp_umat3x4; - typedef mat<4, 2, uint, lowp> lowp_umat4x2; - typedef mat<4, 3, uint, lowp> lowp_umat4x3; - typedef mat<4, 4, uint, lowp> lowp_umat4x4; - - typedef mat<2, 2, uint, mediump> mediump_umat2x2; - typedef mat<2, 3, uint, mediump> mediump_umat2x3; - typedef mat<2, 4, uint, mediump> mediump_umat2x4; - typedef mat<3, 2, uint, mediump> mediump_umat3x2; - typedef mat<3, 3, uint, mediump> mediump_umat3x3; - typedef mat<3, 4, uint, mediump> mediump_umat3x4; - typedef mat<4, 2, uint, mediump> mediump_umat4x2; - typedef mat<4, 3, uint, mediump> mediump_umat4x3; - typedef mat<4, 4, uint, mediump> mediump_umat4x4; - - typedef mat<2, 2, uint, highp> highp_umat2x2; - typedef mat<2, 3, uint, highp> highp_umat2x3; - typedef mat<2, 4, uint, highp> highp_umat2x4; - typedef mat<3, 2, uint, highp> highp_umat3x2; - typedef mat<3, 3, uint, highp> highp_umat3x3; - typedef mat<3, 4, uint, highp> highp_umat3x4; - typedef mat<4, 2, uint, highp> highp_umat4x2; - typedef mat<4, 3, uint, highp> highp_umat4x3; - typedef mat<4, 4, uint, highp> highp_umat4x4; - - typedef mat<2, 2, uint, defaultp> umat2x2; - typedef mat<3, 2, uint, defaultp> umat3x2; - typedef mat<4, 2, uint, defaultp> umat4x2; - typedef mat<2, 3, uint, defaultp> umat2x3; - typedef mat<3, 3, uint, defaultp> umat3x3; - typedef mat<4, 3, uint, defaultp> umat4x3; - typedef mat<2, 4, uint, defaultp> umat2x4; - typedef mat<3, 4, uint, defaultp> umat3x4; - typedef mat<4, 4, uint, defaultp> umat4x4; - - - typedef mat<2, 2, uint8, lowp> lowp_u8mat2x2; - typedef mat<2, 3, uint8, lowp> lowp_u8mat2x3; - typedef mat<2, 4, uint8, lowp> lowp_u8mat2x4; - typedef mat<3, 2, uint8, lowp> lowp_u8mat3x2; - typedef mat<3, 3, uint8, lowp> lowp_u8mat3x3; - typedef mat<3, 4, uint8, lowp> lowp_u8mat3x4; - typedef mat<4, 2, uint8, lowp> lowp_u8mat4x2; - typedef mat<4, 3, uint8, lowp> lowp_u8mat4x3; - typedef mat<4, 4, uint8, lowp> lowp_u8mat4x4; - - typedef mat<2, 2, uint8, mediump> mediump_u8mat2x2; - typedef mat<2, 3, uint8, mediump> mediump_u8mat2x3; - typedef mat<2, 4, uint8, mediump> mediump_u8mat2x4; - typedef mat<3, 2, uint8, mediump> mediump_u8mat3x2; - typedef mat<3, 3, uint8, mediump> mediump_u8mat3x3; - typedef mat<3, 4, uint8, mediump> mediump_u8mat3x4; - typedef mat<4, 2, uint8, mediump> mediump_u8mat4x2; - typedef mat<4, 3, uint8, mediump> mediump_u8mat4x3; - typedef mat<4, 4, uint8, mediump> mediump_u8mat4x4; - - typedef mat<2, 2, uint8, highp> highp_u8mat2x2; - typedef mat<2, 3, uint8, highp> highp_u8mat2x3; - typedef mat<2, 4, uint8, highp> highp_u8mat2x4; - typedef mat<3, 2, uint8, highp> highp_u8mat3x2; - typedef mat<3, 3, uint8, highp> highp_u8mat3x3; - typedef mat<3, 4, uint8, highp> highp_u8mat3x4; - typedef mat<4, 2, uint8, highp> highp_u8mat4x2; - typedef mat<4, 3, uint8, highp> highp_u8mat4x3; - typedef mat<4, 4, uint8, highp> highp_u8mat4x4; - - typedef mat<2, 2, uint8, defaultp> u8mat2x2; - typedef mat<3, 2, uint8, defaultp> u8mat3x2; - typedef mat<4, 2, uint8, defaultp> u8mat4x2; - typedef mat<2, 3, uint8, defaultp> u8mat2x3; - typedef mat<3, 3, uint8, defaultp> u8mat3x3; - typedef mat<4, 3, uint8, defaultp> u8mat4x3; - typedef mat<2, 4, uint8, defaultp> u8mat2x4; - typedef mat<3, 4, uint8, defaultp> u8mat3x4; - typedef mat<4, 4, uint8, defaultp> u8mat4x4; - - - typedef mat<2, 2, uint16, lowp> lowp_u16mat2x2; - typedef mat<2, 3, uint16, lowp> lowp_u16mat2x3; - typedef mat<2, 4, uint16, lowp> lowp_u16mat2x4; - typedef mat<3, 2, uint16, lowp> lowp_u16mat3x2; - typedef mat<3, 3, uint16, lowp> lowp_u16mat3x3; - typedef mat<3, 4, uint16, lowp> lowp_u16mat3x4; - typedef mat<4, 2, uint16, lowp> lowp_u16mat4x2; - typedef mat<4, 3, uint16, lowp> lowp_u16mat4x3; - typedef mat<4, 4, uint16, lowp> lowp_u16mat4x4; - - typedef mat<2, 2, uint16, mediump> mediump_u16mat2x2; - typedef mat<2, 3, uint16, mediump> mediump_u16mat2x3; - typedef mat<2, 4, uint16, mediump> mediump_u16mat2x4; - typedef mat<3, 2, uint16, mediump> mediump_u16mat3x2; - typedef mat<3, 3, uint16, mediump> mediump_u16mat3x3; - typedef mat<3, 4, uint16, mediump> mediump_u16mat3x4; - typedef mat<4, 2, uint16, mediump> mediump_u16mat4x2; - typedef mat<4, 3, uint16, mediump> mediump_u16mat4x3; - typedef mat<4, 4, uint16, mediump> mediump_u16mat4x4; - - typedef mat<2, 2, uint16, highp> highp_u16mat2x2; - typedef mat<2, 3, uint16, highp> highp_u16mat2x3; - typedef mat<2, 4, uint16, highp> highp_u16mat2x4; - typedef mat<3, 2, uint16, highp> highp_u16mat3x2; - typedef mat<3, 3, uint16, highp> highp_u16mat3x3; - typedef mat<3, 4, uint16, highp> highp_u16mat3x4; - typedef mat<4, 2, uint16, highp> highp_u16mat4x2; - typedef mat<4, 3, uint16, highp> highp_u16mat4x3; - typedef mat<4, 4, uint16, highp> highp_u16mat4x4; - - typedef mat<2, 2, uint16, defaultp> u16mat2x2; - typedef mat<3, 2, uint16, defaultp> u16mat3x2; - typedef mat<4, 2, uint16, defaultp> u16mat4x2; - typedef mat<2, 3, uint16, defaultp> u16mat2x3; - typedef mat<3, 3, uint16, defaultp> u16mat3x3; - typedef mat<4, 3, uint16, defaultp> u16mat4x3; - typedef mat<2, 4, uint16, defaultp> u16mat2x4; - typedef mat<3, 4, uint16, defaultp> u16mat3x4; - typedef mat<4, 4, uint16, defaultp> u16mat4x4; - - - typedef mat<2, 2, uint32, lowp> lowp_u32mat2x2; - typedef mat<2, 3, uint32, lowp> lowp_u32mat2x3; - typedef mat<2, 4, uint32, lowp> lowp_u32mat2x4; - typedef mat<3, 2, uint32, lowp> lowp_u32mat3x2; - typedef mat<3, 3, uint32, lowp> lowp_u32mat3x3; - typedef mat<3, 4, uint32, lowp> lowp_u32mat3x4; - typedef mat<4, 2, uint32, lowp> lowp_u32mat4x2; - typedef mat<4, 3, uint32, lowp> lowp_u32mat4x3; - typedef mat<4, 4, uint32, lowp> lowp_u32mat4x4; - - typedef mat<2, 2, uint32, mediump> mediump_u32mat2x2; - typedef mat<2, 3, uint32, mediump> mediump_u32mat2x3; - typedef mat<2, 4, uint32, mediump> mediump_u32mat2x4; - typedef mat<3, 2, uint32, mediump> mediump_u32mat3x2; - typedef mat<3, 3, uint32, mediump> mediump_u32mat3x3; - typedef mat<3, 4, uint32, mediump> mediump_u32mat3x4; - typedef mat<4, 2, uint32, mediump> mediump_u32mat4x2; - typedef mat<4, 3, uint32, mediump> mediump_u32mat4x3; - typedef mat<4, 4, uint32, mediump> mediump_u32mat4x4; - - typedef mat<2, 2, uint32, highp> highp_u32mat2x2; - typedef mat<2, 3, uint32, highp> highp_u32mat2x3; - typedef mat<2, 4, uint32, highp> highp_u32mat2x4; - typedef mat<3, 2, uint32, highp> highp_u32mat3x2; - typedef mat<3, 3, uint32, highp> highp_u32mat3x3; - typedef mat<3, 4, uint32, highp> highp_u32mat3x4; - typedef mat<4, 2, uint32, highp> highp_u32mat4x2; - typedef mat<4, 3, uint32, highp> highp_u32mat4x3; - typedef mat<4, 4, uint32, highp> highp_u32mat4x4; - - typedef mat<2, 2, uint32, defaultp> u32mat2x2; - typedef mat<3, 2, uint32, defaultp> u32mat3x2; - typedef mat<4, 2, uint32, defaultp> u32mat4x2; - typedef mat<2, 3, uint32, defaultp> u32mat2x3; - typedef mat<3, 3, uint32, defaultp> u32mat3x3; - typedef mat<4, 3, uint32, defaultp> u32mat4x3; - typedef mat<2, 4, uint32, defaultp> u32mat2x4; - typedef mat<3, 4, uint32, defaultp> u32mat3x4; - typedef mat<4, 4, uint32, defaultp> u32mat4x4; - - - typedef mat<2, 2, uint64, lowp> lowp_u64mat2x2; - typedef mat<2, 3, uint64, lowp> lowp_u64mat2x3; - typedef mat<2, 4, uint64, lowp> lowp_u64mat2x4; - typedef mat<3, 2, uint64, lowp> lowp_u64mat3x2; - typedef mat<3, 3, uint64, lowp> lowp_u64mat3x3; - typedef mat<3, 4, uint64, lowp> lowp_u64mat3x4; - typedef mat<4, 2, uint64, lowp> lowp_u64mat4x2; - typedef mat<4, 3, uint64, lowp> lowp_u64mat4x3; - typedef mat<4, 4, uint64, lowp> lowp_u64mat4x4; - - typedef mat<2, 2, uint64, mediump> mediump_u64mat2x2; - typedef mat<2, 3, uint64, mediump> mediump_u64mat2x3; - typedef mat<2, 4, uint64, mediump> mediump_u64mat2x4; - typedef mat<3, 2, uint64, mediump> mediump_u64mat3x2; - typedef mat<3, 3, uint64, mediump> mediump_u64mat3x3; - typedef mat<3, 4, uint64, mediump> mediump_u64mat3x4; - typedef mat<4, 2, uint64, mediump> mediump_u64mat4x2; - typedef mat<4, 3, uint64, mediump> mediump_u64mat4x3; - typedef mat<4, 4, uint64, mediump> mediump_u64mat4x4; - - typedef mat<2, 2, uint64, highp> highp_u64mat2x2; - typedef mat<2, 3, uint64, highp> highp_u64mat2x3; - typedef mat<2, 4, uint64, highp> highp_u64mat2x4; - typedef mat<3, 2, uint64, highp> highp_u64mat3x2; - typedef mat<3, 3, uint64, highp> highp_u64mat3x3; - typedef mat<3, 4, uint64, highp> highp_u64mat3x4; - typedef mat<4, 2, uint64, highp> highp_u64mat4x2; - typedef mat<4, 3, uint64, highp> highp_u64mat4x3; - typedef mat<4, 4, uint64, highp> highp_u64mat4x4; - - typedef mat<2, 2, uint64, defaultp> u64mat2x2; - typedef mat<3, 2, uint64, defaultp> u64mat3x2; - typedef mat<4, 2, uint64, defaultp> u64mat4x2; - typedef mat<2, 3, uint64, defaultp> u64mat2x3; - typedef mat<3, 3, uint64, defaultp> u64mat3x3; - typedef mat<4, 3, uint64, defaultp> u64mat4x3; - typedef mat<2, 4, uint64, defaultp> u64mat2x4; - typedef mat<3, 4, uint64, defaultp> u64mat3x4; - typedef mat<4, 4, uint64, defaultp> u64mat4x4; - - // Quaternion - - typedef qua lowp_quat; - typedef qua mediump_quat; - typedef qua highp_quat; - typedef qua quat; - - typedef qua lowp_fquat; - typedef qua mediump_fquat; - typedef qua highp_fquat; - typedef qua fquat; - - typedef qua lowp_f32quat; - typedef qua mediump_f32quat; - typedef qua highp_f32quat; - typedef qua f32quat; - - typedef qua lowp_dquat; - typedef qua mediump_dquat; - typedef qua highp_dquat; - typedef qua dquat; - - typedef qua lowp_f64quat; - typedef qua mediump_f64quat; - typedef qua highp_f64quat; - typedef qua f64quat; -}//namespace glm - - diff --git a/3rdparty/glm/source/glm/geometric.hpp b/3rdparty/glm/source/glm/geometric.hpp deleted file mode 100644 index b704f25..0000000 --- a/3rdparty/glm/source/glm/geometric.hpp +++ /dev/null @@ -1,116 +0,0 @@ -/// @ref core -/// @file glm/geometric.hpp -/// -/// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions -/// -/// @defgroup core_func_geometric Geometric functions -/// @ingroup core -/// -/// These operate on vectors as vectors, not component-wise. -/// -/// Include to use these core features. - -#pragma once - -#include "detail/type_vec3.hpp" - -namespace glm -{ - /// @addtogroup core_func_geometric - /// @{ - - /// Returns the length of x, i.e., sqrt(x * x). - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Floating-point scalar types. - /// - /// @see GLSL length man page - /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions - template - GLM_FUNC_DECL T length(vec const& x); - - /// Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Floating-point scalar types. - /// - /// @see GLSL distance man page - /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions - template - GLM_FUNC_DECL T distance(vec const& p0, vec const& p1); - - /// Returns the dot product of x and y, i.e., result = x * y. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Floating-point scalar types. - /// - /// @see GLSL dot man page - /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions - template - GLM_FUNC_DECL GLM_CONSTEXPR T dot(vec const& x, vec const& y); - - /// Returns the cross product of x and y. - /// - /// @tparam T Floating-point scalar types. - /// - /// @see GLSL cross man page - /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions - template - GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> cross(vec<3, T, Q> const& x, vec<3, T, Q> const& y); - - /// Returns a vector in the same direction as x but with length of 1. - /// According to issue 10 GLSL 1.10 specification, if length(x) == 0 then result is undefined and generate an error. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Floating-point scalar types. - /// - /// @see GLSL normalize man page - /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions - template - GLM_FUNC_DECL vec normalize(vec const& x); - - /// If dot(Nref, I) < 0.0, return N, otherwise, return -N. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Floating-point scalar types. - /// - /// @see GLSL faceforward man page - /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions - template - GLM_FUNC_DECL vec faceforward( - vec const& N, - vec const& I, - vec const& Nref); - - /// For the incident vector I and surface orientation N, - /// returns the reflection direction : result = I - 2.0 * dot(N, I) * N. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Floating-point scalar types. - /// - /// @see GLSL reflect man page - /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions - template - GLM_FUNC_DECL vec reflect( - vec const& I, - vec const& N); - - /// For the incident vector I and surface normal N, - /// and the ratio of indices of refraction eta, - /// return the refraction vector. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Floating-point scalar types. - /// - /// @see GLSL refract man page - /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions - template - GLM_FUNC_DECL vec refract( - vec const& I, - vec const& N, - T eta); - - /// @} -}//namespace glm - -#include "detail/func_geometric.inl" diff --git a/3rdparty/glm/source/glm/glm.hpp b/3rdparty/glm/source/glm/glm.hpp deleted file mode 100644 index 8b61064..0000000 --- a/3rdparty/glm/source/glm/glm.hpp +++ /dev/null @@ -1,136 +0,0 @@ -/// @ref core -/// @file glm/glm.hpp -/// -/// @defgroup core Core features -/// -/// @brief Features that implement in C++ the GLSL specification as closely as possible. -/// -/// The GLM core consists of C++ types that mirror GLSL types and -/// C++ functions that mirror the GLSL functions. -/// -/// The best documentation for GLM Core is the current GLSL specification, -/// version 4.2 -/// (pdf file). -/// -/// GLM core functionalities require to be included to be used. -/// -/// -/// @defgroup core_vector Vector types -/// -/// Vector types of two to four components with an exhaustive set of operators. -/// -/// @ingroup core -/// -/// -/// @defgroup core_vector_precision Vector types with precision qualifiers -/// -/// @brief Vector types with precision qualifiers which may result in various precision in term of ULPs -/// -/// GLSL allows defining qualifiers for particular variables. -/// With OpenGL's GLSL, these qualifiers have no effect; they are there for compatibility, -/// with OpenGL ES's GLSL, these qualifiers do have an effect. -/// -/// C++ has no language equivalent to qualifier qualifiers. So GLM provides the next-best thing: -/// a number of typedefs that use a particular qualifier. -/// -/// None of these types make any guarantees about the actual qualifier used. -/// -/// @ingroup core -/// -/// -/// @defgroup core_matrix Matrix types -/// -/// Matrix types of with C columns and R rows where C and R are values between 2 to 4 included. -/// These types have exhaustive sets of operators. -/// -/// @ingroup core -/// -/// -/// @defgroup core_matrix_precision Matrix types with precision qualifiers -/// -/// @brief Matrix types with precision qualifiers which may result in various precision in term of ULPs -/// -/// GLSL allows defining qualifiers for particular variables. -/// With OpenGL's GLSL, these qualifiers have no effect; they are there for compatibility, -/// with OpenGL ES's GLSL, these qualifiers do have an effect. -/// -/// C++ has no language equivalent to qualifier qualifiers. So GLM provides the next-best thing: -/// a number of typedefs that use a particular qualifier. -/// -/// None of these types make any guarantees about the actual qualifier used. -/// -/// @ingroup core -/// -/// -/// @defgroup ext Stable extensions -/// -/// @brief Additional features not specified by GLSL specification. -/// -/// EXT extensions are fully tested and documented. -/// -/// Even if it's highly unrecommended, it's possible to include all the extensions at once by -/// including . Otherwise, each extension needs to be included a specific file. -/// -/// -/// @defgroup gtc Recommended extensions -/// -/// @brief Additional features not specified by GLSL specification. -/// -/// GTC extensions aim to be stable with tests and documentation. -/// -/// Even if it's highly unrecommended, it's possible to include all the extensions at once by -/// including . Otherwise, each extension needs to be included a specific file. -/// -/// -/// @defgroup gtx Experimental extensions -/// -/// @brief Experimental features not specified by GLSL specification. -/// -/// Experimental extensions are useful functions and types, but the development of -/// their API and functionality is not necessarily stable. They can change -/// substantially between versions. Backwards compatibility is not much of an issue -/// for them. -/// -/// Even if it's highly unrecommended, it's possible to include all the extensions -/// at once by including . Otherwise, each extension needs to be -/// included a specific file. -/// -/// @mainpage OpenGL Mathematics (GLM) -/// - Website: glm.g-truc.net -/// - GLM API documentation -/// - GLM Manual - -#include "detail/_fixes.hpp" - -#include "detail/setup.hpp" - -#pragma once - -#include -#include -#include -#include -#include -#include "fwd.hpp" - -#include "vec2.hpp" -#include "vec3.hpp" -#include "vec4.hpp" -#include "mat2x2.hpp" -#include "mat2x3.hpp" -#include "mat2x4.hpp" -#include "mat3x2.hpp" -#include "mat3x3.hpp" -#include "mat3x4.hpp" -#include "mat4x2.hpp" -#include "mat4x3.hpp" -#include "mat4x4.hpp" - -#include "trigonometric.hpp" -#include "exponential.hpp" -#include "common.hpp" -#include "packing.hpp" -#include "geometric.hpp" -#include "matrix.hpp" -#include "vector_relational.hpp" -#include "integer.hpp" diff --git a/3rdparty/glm/source/glm/gtc/bitfield.hpp b/3rdparty/glm/source/glm/gtc/bitfield.hpp deleted file mode 100644 index 084fbe7..0000000 --- a/3rdparty/glm/source/glm/gtc/bitfield.hpp +++ /dev/null @@ -1,266 +0,0 @@ -/// @ref gtc_bitfield -/// @file glm/gtc/bitfield.hpp -/// -/// @see core (dependence) -/// @see gtc_bitfield (dependence) -/// -/// @defgroup gtc_bitfield GLM_GTC_bitfield -/// @ingroup gtc -/// -/// Include to use the features of this extension. -/// -/// Allow to perform bit operations on integer values - -#include "../detail/setup.hpp" - -#pragma once - -// Dependencies -#include "../ext/scalar_int_sized.hpp" -#include "../ext/scalar_uint_sized.hpp" -#include "../detail/qualifier.hpp" -#include "../detail/_vectorize.hpp" -#include "type_precision.hpp" -#include - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTC_bitfield extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_bitfield - /// @{ - - /// Build a mask of 'count' bits - /// - /// @see gtc_bitfield - template - GLM_FUNC_DECL genIUType mask(genIUType Bits); - - /// Build a mask of 'count' bits - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Signed and unsigned integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see gtc_bitfield - template - GLM_FUNC_DECL vec mask(vec const& v); - - /// Rotate all bits to the right. All the bits dropped in the right side are inserted back on the left side. - /// - /// @see gtc_bitfield - template - GLM_FUNC_DECL genIUType bitfieldRotateRight(genIUType In, int Shift); - - /// Rotate all bits to the right. All the bits dropped in the right side are inserted back on the left side. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Signed and unsigned integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see gtc_bitfield - template - GLM_FUNC_DECL vec bitfieldRotateRight(vec const& In, int Shift); - - /// Rotate all bits to the left. All the bits dropped in the left side are inserted back on the right side. - /// - /// @see gtc_bitfield - template - GLM_FUNC_DECL genIUType bitfieldRotateLeft(genIUType In, int Shift); - - /// Rotate all bits to the left. All the bits dropped in the left side are inserted back on the right side. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Signed and unsigned integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see gtc_bitfield - template - GLM_FUNC_DECL vec bitfieldRotateLeft(vec const& In, int Shift); - - /// Set to 1 a range of bits. - /// - /// @see gtc_bitfield - template - GLM_FUNC_DECL genIUType bitfieldFillOne(genIUType Value, int FirstBit, int BitCount); - - /// Set to 1 a range of bits. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Signed and unsigned integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see gtc_bitfield - template - GLM_FUNC_DECL vec bitfieldFillOne(vec const& Value, int FirstBit, int BitCount); - - /// Set to 0 a range of bits. - /// - /// @see gtc_bitfield - template - GLM_FUNC_DECL genIUType bitfieldFillZero(genIUType Value, int FirstBit, int BitCount); - - /// Set to 0 a range of bits. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Signed and unsigned integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see gtc_bitfield - template - GLM_FUNC_DECL vec bitfieldFillZero(vec const& Value, int FirstBit, int BitCount); - - /// Interleaves the bits of x and y. - /// The first bit is the first bit of x followed by the first bit of y. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL int16 bitfieldInterleave(int8 x, int8 y); - - /// Interleaves the bits of x and y. - /// The first bit is the first bit of x followed by the first bit of y. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL uint16 bitfieldInterleave(uint8 x, uint8 y); - - /// Interleaves the bits of x and y. - /// The first bit is the first bit of v.x followed by the first bit of v.y. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL uint16 bitfieldInterleave(u8vec2 const& v); - - /// Deinterleaves the bits of x. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL glm::u8vec2 bitfieldDeinterleave(glm::uint16 x); - - /// Interleaves the bits of x and y. - /// The first bit is the first bit of x followed by the first bit of y. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL int32 bitfieldInterleave(int16 x, int16 y); - - /// Interleaves the bits of x and y. - /// The first bit is the first bit of x followed by the first bit of y. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL uint32 bitfieldInterleave(uint16 x, uint16 y); - - /// Interleaves the bits of x and y. - /// The first bit is the first bit of v.x followed by the first bit of v.y. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL uint32 bitfieldInterleave(u16vec2 const& v); - - /// Deinterleaves the bits of x. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL glm::u16vec2 bitfieldDeinterleave(glm::uint32 x); - - /// Interleaves the bits of x and y. - /// The first bit is the first bit of x followed by the first bit of y. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL int64 bitfieldInterleave(int32 x, int32 y); - - /// Interleaves the bits of x and y. - /// The first bit is the first bit of x followed by the first bit of y. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y); - - /// Interleaves the bits of x and y. - /// The first bit is the first bit of v.x followed by the first bit of v.y. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL uint64 bitfieldInterleave(u32vec2 const& v); - - /// Deinterleaves the bits of x. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL glm::u32vec2 bitfieldDeinterleave(glm::uint64 x); - - /// Interleaves the bits of x, y and z. - /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL int32 bitfieldInterleave(int8 x, int8 y, int8 z); - - /// Interleaves the bits of x, y and z. - /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z); - - /// Interleaves the bits of x, y and z. - /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL int64 bitfieldInterleave(int16 x, int16 y, int16 z); - - /// Interleaves the bits of x, y and z. - /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z); - - /// Interleaves the bits of x, y and z. - /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL int64 bitfieldInterleave(int32 x, int32 y, int32 z); - - /// Interleaves the bits of x, y and z. - /// The first bit is the first bit of x followed by the first bit of y and the first bit of z. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL uint64 bitfieldInterleave(uint32 x, uint32 y, uint32 z); - - /// Interleaves the bits of x, y, z and w. - /// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL int32 bitfieldInterleave(int8 x, int8 y, int8 z, int8 w); - - /// Interleaves the bits of x, y, z and w. - /// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z, uint8 w); - - /// Interleaves the bits of x, y, z and w. - /// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL int64 bitfieldInterleave(int16 x, int16 y, int16 z, int16 w); - - /// Interleaves the bits of x, y, z and w. - /// The first bit is the first bit of x followed by the first bit of y, the first bit of z and finally the first bit of w. - /// The other bits are interleaved following the previous sequence. - /// - /// @see gtc_bitfield - GLM_FUNC_DECL uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z, uint16 w); - - /// @} -} //namespace glm - -#include "bitfield.inl" diff --git a/3rdparty/glm/source/glm/gtc/bitfield.inl b/3rdparty/glm/source/glm/gtc/bitfield.inl deleted file mode 100644 index 06cf188..0000000 --- a/3rdparty/glm/source/glm/gtc/bitfield.inl +++ /dev/null @@ -1,626 +0,0 @@ -/// @ref gtc_bitfield - -#include "../simd/integer.h" - -namespace glm{ -namespace detail -{ - template - GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y); - - template - GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y, PARAM z); - - template - GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y, PARAM z, PARAM w); - - template<> - GLM_FUNC_QUALIFIER glm::uint16 bitfieldInterleave(glm::uint8 x, glm::uint8 y) - { - glm::uint16 REG1(x); - glm::uint16 REG2(y); - - REG1 = ((REG1 << 4) | REG1) & static_cast(0x0F0F); - REG2 = ((REG2 << 4) | REG2) & static_cast(0x0F0F); - - REG1 = ((REG1 << 2) | REG1) & static_cast(0x3333); - REG2 = ((REG2 << 2) | REG2) & static_cast(0x3333); - - REG1 = ((REG1 << 1) | REG1) & static_cast(0x5555); - REG2 = ((REG2 << 1) | REG2) & static_cast(0x5555); - - return REG1 | static_cast(REG2 << 1); - } - - template<> - GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint16 x, glm::uint16 y) - { - glm::uint32 REG1(x); - glm::uint32 REG2(y); - - REG1 = ((REG1 << 8) | REG1) & static_cast(0x00FF00FF); - REG2 = ((REG2 << 8) | REG2) & static_cast(0x00FF00FF); - - REG1 = ((REG1 << 4) | REG1) & static_cast(0x0F0F0F0F); - REG2 = ((REG2 << 4) | REG2) & static_cast(0x0F0F0F0F); - - REG1 = ((REG1 << 2) | REG1) & static_cast(0x33333333); - REG2 = ((REG2 << 2) | REG2) & static_cast(0x33333333); - - REG1 = ((REG1 << 1) | REG1) & static_cast(0x55555555); - REG2 = ((REG2 << 1) | REG2) & static_cast(0x55555555); - - return REG1 | (REG2 << 1); - } - - template<> - GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint32 x, glm::uint32 y) - { - glm::uint64 REG1(x); - glm::uint64 REG2(y); - - REG1 = ((REG1 << 16) | REG1) & static_cast(0x0000FFFF0000FFFFull); - REG2 = ((REG2 << 16) | REG2) & static_cast(0x0000FFFF0000FFFFull); - - REG1 = ((REG1 << 8) | REG1) & static_cast(0x00FF00FF00FF00FFull); - REG2 = ((REG2 << 8) | REG2) & static_cast(0x00FF00FF00FF00FFull); - - REG1 = ((REG1 << 4) | REG1) & static_cast(0x0F0F0F0F0F0F0F0Full); - REG2 = ((REG2 << 4) | REG2) & static_cast(0x0F0F0F0F0F0F0F0Full); - - REG1 = ((REG1 << 2) | REG1) & static_cast(0x3333333333333333ull); - REG2 = ((REG2 << 2) | REG2) & static_cast(0x3333333333333333ull); - - REG1 = ((REG1 << 1) | REG1) & static_cast(0x5555555555555555ull); - REG2 = ((REG2 << 1) | REG2) & static_cast(0x5555555555555555ull); - - return REG1 | (REG2 << 1); - } - - template<> - GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint8 x, glm::uint8 y, glm::uint8 z) - { - glm::uint32 REG1(x); - glm::uint32 REG2(y); - glm::uint32 REG3(z); - - REG1 = ((REG1 << 16) | REG1) & static_cast(0xFF0000FFu); - REG2 = ((REG2 << 16) | REG2) & static_cast(0xFF0000FFu); - REG3 = ((REG3 << 16) | REG3) & static_cast(0xFF0000FFu); - - REG1 = ((REG1 << 8) | REG1) & static_cast(0x0F00F00Fu); - REG2 = ((REG2 << 8) | REG2) & static_cast(0x0F00F00Fu); - REG3 = ((REG3 << 8) | REG3) & static_cast(0x0F00F00Fu); - - REG1 = ((REG1 << 4) | REG1) & static_cast(0xC30C30C3u); - REG2 = ((REG2 << 4) | REG2) & static_cast(0xC30C30C3u); - REG3 = ((REG3 << 4) | REG3) & static_cast(0xC30C30C3u); - - REG1 = ((REG1 << 2) | REG1) & static_cast(0x49249249u); - REG2 = ((REG2 << 2) | REG2) & static_cast(0x49249249u); - REG3 = ((REG3 << 2) | REG3) & static_cast(0x49249249u); - - return REG1 | (REG2 << 1) | (REG3 << 2); - } - - template<> - GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint16 x, glm::uint16 y, glm::uint16 z) - { - glm::uint64 REG1(x); - glm::uint64 REG2(y); - glm::uint64 REG3(z); - - REG1 = ((REG1 << 32) | REG1) & static_cast(0xFFFF00000000FFFFull); - REG2 = ((REG2 << 32) | REG2) & static_cast(0xFFFF00000000FFFFull); - REG3 = ((REG3 << 32) | REG3) & static_cast(0xFFFF00000000FFFFull); - - REG1 = ((REG1 << 16) | REG1) & static_cast(0x00FF0000FF0000FFull); - REG2 = ((REG2 << 16) | REG2) & static_cast(0x00FF0000FF0000FFull); - REG3 = ((REG3 << 16) | REG3) & static_cast(0x00FF0000FF0000FFull); - - REG1 = ((REG1 << 8) | REG1) & static_cast(0xF00F00F00F00F00Full); - REG2 = ((REG2 << 8) | REG2) & static_cast(0xF00F00F00F00F00Full); - REG3 = ((REG3 << 8) | REG3) & static_cast(0xF00F00F00F00F00Full); - - REG1 = ((REG1 << 4) | REG1) & static_cast(0x30C30C30C30C30C3ull); - REG2 = ((REG2 << 4) | REG2) & static_cast(0x30C30C30C30C30C3ull); - REG3 = ((REG3 << 4) | REG3) & static_cast(0x30C30C30C30C30C3ull); - - REG1 = ((REG1 << 2) | REG1) & static_cast(0x9249249249249249ull); - REG2 = ((REG2 << 2) | REG2) & static_cast(0x9249249249249249ull); - REG3 = ((REG3 << 2) | REG3) & static_cast(0x9249249249249249ull); - - return REG1 | (REG2 << 1) | (REG3 << 2); - } - - template<> - GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint32 x, glm::uint32 y, glm::uint32 z) - { - glm::uint64 REG1(x); - glm::uint64 REG2(y); - glm::uint64 REG3(z); - - REG1 = ((REG1 << 32) | REG1) & static_cast(0xFFFF00000000FFFFull); - REG2 = ((REG2 << 32) | REG2) & static_cast(0xFFFF00000000FFFFull); - REG3 = ((REG3 << 32) | REG3) & static_cast(0xFFFF00000000FFFFull); - - REG1 = ((REG1 << 16) | REG1) & static_cast(0x00FF0000FF0000FFull); - REG2 = ((REG2 << 16) | REG2) & static_cast(0x00FF0000FF0000FFull); - REG3 = ((REG3 << 16) | REG3) & static_cast(0x00FF0000FF0000FFull); - - REG1 = ((REG1 << 8) | REG1) & static_cast(0xF00F00F00F00F00Full); - REG2 = ((REG2 << 8) | REG2) & static_cast(0xF00F00F00F00F00Full); - REG3 = ((REG3 << 8) | REG3) & static_cast(0xF00F00F00F00F00Full); - - REG1 = ((REG1 << 4) | REG1) & static_cast(0x30C30C30C30C30C3ull); - REG2 = ((REG2 << 4) | REG2) & static_cast(0x30C30C30C30C30C3ull); - REG3 = ((REG3 << 4) | REG3) & static_cast(0x30C30C30C30C30C3ull); - - REG1 = ((REG1 << 2) | REG1) & static_cast(0x9249249249249249ull); - REG2 = ((REG2 << 2) | REG2) & static_cast(0x9249249249249249ull); - REG3 = ((REG3 << 2) | REG3) & static_cast(0x9249249249249249ull); - - return REG1 | (REG2 << 1) | (REG3 << 2); - } - - template<> - GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint8 x, glm::uint8 y, glm::uint8 z, glm::uint8 w) - { - glm::uint32 REG1(x); - glm::uint32 REG2(y); - glm::uint32 REG3(z); - glm::uint32 REG4(w); - - REG1 = ((REG1 << 12) | REG1) & static_cast(0x000F000Fu); - REG2 = ((REG2 << 12) | REG2) & static_cast(0x000F000Fu); - REG3 = ((REG3 << 12) | REG3) & static_cast(0x000F000Fu); - REG4 = ((REG4 << 12) | REG4) & static_cast(0x000F000Fu); - - REG1 = ((REG1 << 6) | REG1) & static_cast(0x03030303u); - REG2 = ((REG2 << 6) | REG2) & static_cast(0x03030303u); - REG3 = ((REG3 << 6) | REG3) & static_cast(0x03030303u); - REG4 = ((REG4 << 6) | REG4) & static_cast(0x03030303u); - - REG1 = ((REG1 << 3) | REG1) & static_cast(0x11111111u); - REG2 = ((REG2 << 3) | REG2) & static_cast(0x11111111u); - REG3 = ((REG3 << 3) | REG3) & static_cast(0x11111111u); - REG4 = ((REG4 << 3) | REG4) & static_cast(0x11111111u); - - return REG1 | (REG2 << 1) | (REG3 << 2) | (REG4 << 3); - } - - template<> - GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint16 x, glm::uint16 y, glm::uint16 z, glm::uint16 w) - { - glm::uint64 REG1(x); - glm::uint64 REG2(y); - glm::uint64 REG3(z); - glm::uint64 REG4(w); - - REG1 = ((REG1 << 24) | REG1) & static_cast(0x000000FF000000FFull); - REG2 = ((REG2 << 24) | REG2) & static_cast(0x000000FF000000FFull); - REG3 = ((REG3 << 24) | REG3) & static_cast(0x000000FF000000FFull); - REG4 = ((REG4 << 24) | REG4) & static_cast(0x000000FF000000FFull); - - REG1 = ((REG1 << 12) | REG1) & static_cast(0x000F000F000F000Full); - REG2 = ((REG2 << 12) | REG2) & static_cast(0x000F000F000F000Full); - REG3 = ((REG3 << 12) | REG3) & static_cast(0x000F000F000F000Full); - REG4 = ((REG4 << 12) | REG4) & static_cast(0x000F000F000F000Full); - - REG1 = ((REG1 << 6) | REG1) & static_cast(0x0303030303030303ull); - REG2 = ((REG2 << 6) | REG2) & static_cast(0x0303030303030303ull); - REG3 = ((REG3 << 6) | REG3) & static_cast(0x0303030303030303ull); - REG4 = ((REG4 << 6) | REG4) & static_cast(0x0303030303030303ull); - - REG1 = ((REG1 << 3) | REG1) & static_cast(0x1111111111111111ull); - REG2 = ((REG2 << 3) | REG2) & static_cast(0x1111111111111111ull); - REG3 = ((REG3 << 3) | REG3) & static_cast(0x1111111111111111ull); - REG4 = ((REG4 << 3) | REG4) & static_cast(0x1111111111111111ull); - - return REG1 | (REG2 << 1) | (REG3 << 2) | (REG4 << 3); - } -}//namespace detail - - template - GLM_FUNC_QUALIFIER genIUType mask(genIUType Bits) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'mask' accepts only integer values"); - - return Bits >= sizeof(genIUType) * 8 ? ~static_cast(0) : (static_cast(1) << Bits) - static_cast(1); - } - - template - GLM_FUNC_QUALIFIER vec mask(vec const& v) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'mask' accepts only integer values"); - - return detail::functor1::call(mask, v); - } - - template - GLM_FUNC_QUALIFIER genIType bitfieldRotateRight(genIType In, int Shift) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldRotateRight' accepts only integer values"); - - int const BitSize = static_cast(sizeof(genIType) * 8); - return (In << static_cast(Shift)) | (In >> static_cast(BitSize - Shift)); - } - - template - GLM_FUNC_QUALIFIER vec bitfieldRotateRight(vec const& In, int Shift) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldRotateRight' accepts only integer values"); - - int const BitSize = static_cast(sizeof(T) * 8); - return (In << static_cast(Shift)) | (In >> static_cast(BitSize - Shift)); - } - - template - GLM_FUNC_QUALIFIER genIType bitfieldRotateLeft(genIType In, int Shift) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldRotateLeft' accepts only integer values"); - - int const BitSize = static_cast(sizeof(genIType) * 8); - return (In >> static_cast(Shift)) | (In << static_cast(BitSize - Shift)); - } - - template - GLM_FUNC_QUALIFIER vec bitfieldRotateLeft(vec const& In, int Shift) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldRotateLeft' accepts only integer values"); - - int const BitSize = static_cast(sizeof(T) * 8); - return (In >> static_cast(Shift)) | (In << static_cast(BitSize - Shift)); - } - - template - GLM_FUNC_QUALIFIER genIUType bitfieldFillOne(genIUType Value, int FirstBit, int BitCount) - { - return Value | static_cast(mask(BitCount) << FirstBit); - } - - template - GLM_FUNC_QUALIFIER vec bitfieldFillOne(vec const& Value, int FirstBit, int BitCount) - { - return Value | static_cast(mask(BitCount) << FirstBit); - } - - template - GLM_FUNC_QUALIFIER genIUType bitfieldFillZero(genIUType Value, int FirstBit, int BitCount) - { - return Value & static_cast(~(mask(BitCount) << FirstBit)); - } - - template - GLM_FUNC_QUALIFIER vec bitfieldFillZero(vec const& Value, int FirstBit, int BitCount) - { - return Value & static_cast(~(mask(BitCount) << FirstBit)); - } - - GLM_FUNC_QUALIFIER int16 bitfieldInterleave(int8 x, int8 y) - { - union sign8 - { - int8 i; - uint8 u; - } sign_x, sign_y; - - union sign16 - { - int16 i; - uint16 u; - } result; - - sign_x.i = x; - sign_y.i = y; - result.u = bitfieldInterleave(sign_x.u, sign_y.u); - - return result.i; - } - - GLM_FUNC_QUALIFIER uint16 bitfieldInterleave(uint8 x, uint8 y) - { - return detail::bitfieldInterleave(x, y); - } - - GLM_FUNC_QUALIFIER uint16 bitfieldInterleave(u8vec2 const& v) - { - return detail::bitfieldInterleave(v.x, v.y); - } - - GLM_FUNC_QUALIFIER u8vec2 bitfieldDeinterleave(glm::uint16 x) - { - uint16 REG1(x); - uint16 REG2(x >>= 1); - - REG1 = REG1 & static_cast(0x5555); - REG2 = REG2 & static_cast(0x5555); - - REG1 = ((REG1 >> 1) | REG1) & static_cast(0x3333); - REG2 = ((REG2 >> 1) | REG2) & static_cast(0x3333); - - REG1 = ((REG1 >> 2) | REG1) & static_cast(0x0F0F); - REG2 = ((REG2 >> 2) | REG2) & static_cast(0x0F0F); - - REG1 = ((REG1 >> 4) | REG1) & static_cast(0x00FF); - REG2 = ((REG2 >> 4) | REG2) & static_cast(0x00FF); - - REG1 = ((REG1 >> 8) | REG1) & static_cast(0xFFFF); - REG2 = ((REG2 >> 8) | REG2) & static_cast(0xFFFF); - - return glm::u8vec2(REG1, REG2); - } - - GLM_FUNC_QUALIFIER int32 bitfieldInterleave(int16 x, int16 y) - { - union sign16 - { - int16 i; - uint16 u; - } sign_x, sign_y; - - union sign32 - { - int32 i; - uint32 u; - } result; - - sign_x.i = x; - sign_y.i = y; - result.u = bitfieldInterleave(sign_x.u, sign_y.u); - - return result.i; - } - - GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(uint16 x, uint16 y) - { - return detail::bitfieldInterleave(x, y); - } - - GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(u16vec2 const& v) - { - return detail::bitfieldInterleave(v.x, v.y); - } - - GLM_FUNC_QUALIFIER glm::u16vec2 bitfieldDeinterleave(glm::uint32 x) - { - glm::uint32 REG1(x); - glm::uint32 REG2(x >>= 1); - - REG1 = REG1 & static_cast(0x55555555); - REG2 = REG2 & static_cast(0x55555555); - - REG1 = ((REG1 >> 1) | REG1) & static_cast(0x33333333); - REG2 = ((REG2 >> 1) | REG2) & static_cast(0x33333333); - - REG1 = ((REG1 >> 2) | REG1) & static_cast(0x0F0F0F0F); - REG2 = ((REG2 >> 2) | REG2) & static_cast(0x0F0F0F0F); - - REG1 = ((REG1 >> 4) | REG1) & static_cast(0x00FF00FF); - REG2 = ((REG2 >> 4) | REG2) & static_cast(0x00FF00FF); - - REG1 = ((REG1 >> 8) | REG1) & static_cast(0x0000FFFF); - REG2 = ((REG2 >> 8) | REG2) & static_cast(0x0000FFFF); - - return glm::u16vec2(REG1, REG2); - } - - GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int32 x, int32 y) - { - union sign32 - { - int32 i; - uint32 u; - } sign_x, sign_y; - - union sign64 - { - int64 i; - uint64 u; - } result; - - sign_x.i = x; - sign_y.i = y; - result.u = bitfieldInterleave(sign_x.u, sign_y.u); - - return result.i; - } - - GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint32 x, uint32 y) - { - return detail::bitfieldInterleave(x, y); - } - - GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(u32vec2 const& v) - { - return detail::bitfieldInterleave(v.x, v.y); - } - - GLM_FUNC_QUALIFIER glm::u32vec2 bitfieldDeinterleave(glm::uint64 x) - { - glm::uint64 REG1(x); - glm::uint64 REG2(x >>= 1); - - REG1 = REG1 & static_cast(0x5555555555555555ull); - REG2 = REG2 & static_cast(0x5555555555555555ull); - - REG1 = ((REG1 >> 1) | REG1) & static_cast(0x3333333333333333ull); - REG2 = ((REG2 >> 1) | REG2) & static_cast(0x3333333333333333ull); - - REG1 = ((REG1 >> 2) | REG1) & static_cast(0x0F0F0F0F0F0F0F0Full); - REG2 = ((REG2 >> 2) | REG2) & static_cast(0x0F0F0F0F0F0F0F0Full); - - REG1 = ((REG1 >> 4) | REG1) & static_cast(0x00FF00FF00FF00FFull); - REG2 = ((REG2 >> 4) | REG2) & static_cast(0x00FF00FF00FF00FFull); - - REG1 = ((REG1 >> 8) | REG1) & static_cast(0x0000FFFF0000FFFFull); - REG2 = ((REG2 >> 8) | REG2) & static_cast(0x0000FFFF0000FFFFull); - - REG1 = ((REG1 >> 16) | REG1) & static_cast(0x00000000FFFFFFFFull); - REG2 = ((REG2 >> 16) | REG2) & static_cast(0x00000000FFFFFFFFull); - - return glm::u32vec2(REG1, REG2); - } - - GLM_FUNC_QUALIFIER int32 bitfieldInterleave(int8 x, int8 y, int8 z) - { - union sign8 - { - int8 i; - uint8 u; - } sign_x, sign_y, sign_z; - - union sign32 - { - int32 i; - uint32 u; - } result; - - sign_x.i = x; - sign_y.i = y; - sign_z.i = z; - result.u = bitfieldInterleave(sign_x.u, sign_y.u, sign_z.u); - - return result.i; - } - - GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z) - { - return detail::bitfieldInterleave(x, y, z); - } - - GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(u8vec3 const& v) - { - return detail::bitfieldInterleave(v.x, v.y, v.z); - } - - GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int16 x, int16 y, int16 z) - { - union sign16 - { - int16 i; - uint16 u; - } sign_x, sign_y, sign_z; - - union sign64 - { - int64 i; - uint64 u; - } result; - - sign_x.i = x; - sign_y.i = y; - sign_z.i = z; - result.u = bitfieldInterleave(sign_x.u, sign_y.u, sign_z.u); - - return result.i; - } - - GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z) - { - return detail::bitfieldInterleave(x, y, z); - } - - GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(u16vec3 const& v) - { - return detail::bitfieldInterleave(v.x, v.y, v.z); - } - - GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int32 x, int32 y, int32 z) - { - union sign16 - { - int32 i; - uint32 u; - } sign_x, sign_y, sign_z; - - union sign64 - { - int64 i; - uint64 u; - } result; - - sign_x.i = x; - sign_y.i = y; - sign_z.i = z; - result.u = bitfieldInterleave(sign_x.u, sign_y.u, sign_z.u); - - return result.i; - } - - GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint32 x, uint32 y, uint32 z) - { - return detail::bitfieldInterleave(x, y, z); - } - - GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(u32vec3 const& v) - { - return detail::bitfieldInterleave(v.x, v.y, v.z); - } - - GLM_FUNC_QUALIFIER int32 bitfieldInterleave(int8 x, int8 y, int8 z, int8 w) - { - union sign8 - { - int8 i; - uint8 u; - } sign_x, sign_y, sign_z, sign_w; - - union sign32 - { - int32 i; - uint32 u; - } result; - - sign_x.i = x; - sign_y.i = y; - sign_z.i = z; - sign_w.i = w; - result.u = bitfieldInterleave(sign_x.u, sign_y.u, sign_z.u, sign_w.u); - - return result.i; - } - - GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(uint8 x, uint8 y, uint8 z, uint8 w) - { - return detail::bitfieldInterleave(x, y, z, w); - } - - GLM_FUNC_QUALIFIER uint32 bitfieldInterleave(u8vec4 const& v) - { - return detail::bitfieldInterleave(v.x, v.y, v.z, v.w); - } - - GLM_FUNC_QUALIFIER int64 bitfieldInterleave(int16 x, int16 y, int16 z, int16 w) - { - union sign16 - { - int16 i; - uint16 u; - } sign_x, sign_y, sign_z, sign_w; - - union sign64 - { - int64 i; - uint64 u; - } result; - - sign_x.i = x; - sign_y.i = y; - sign_z.i = z; - sign_w.i = w; - result.u = bitfieldInterleave(sign_x.u, sign_y.u, sign_z.u, sign_w.u); - - return result.i; - } - - GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(uint16 x, uint16 y, uint16 z, uint16 w) - { - return detail::bitfieldInterleave(x, y, z, w); - } - - GLM_FUNC_QUALIFIER uint64 bitfieldInterleave(u16vec4 const& v) - { - return detail::bitfieldInterleave(v.x, v.y, v.z, v.w); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtc/color_space.hpp b/3rdparty/glm/source/glm/gtc/color_space.hpp deleted file mode 100644 index cffd9f0..0000000 --- a/3rdparty/glm/source/glm/gtc/color_space.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/// @ref gtc_color_space -/// @file glm/gtc/color_space.hpp -/// -/// @see core (dependence) -/// @see gtc_color_space (dependence) -/// -/// @defgroup gtc_color_space GLM_GTC_color_space -/// @ingroup gtc -/// -/// Include to use the features of this extension. -/// -/// Allow to perform bit operations on integer values - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" -#include "../detail/qualifier.hpp" -#include "../exponential.hpp" -#include "../vec3.hpp" -#include "../vec4.hpp" -#include - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTC_color_space extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_color_space - /// @{ - - /// Convert a linear color to sRGB color using a standard gamma correction. - /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb - template - GLM_FUNC_DECL vec convertLinearToSRGB(vec const& ColorLinear); - - /// Convert a linear color to sRGB color using a custom gamma correction. - /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb - template - GLM_FUNC_DECL vec convertLinearToSRGB(vec const& ColorLinear, T Gamma); - - /// Convert a sRGB color to linear color using a standard gamma correction. - /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb - template - GLM_FUNC_DECL vec convertSRGBToLinear(vec const& ColorSRGB); - - /// Convert a sRGB color to linear color using a custom gamma correction. - // IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb - template - GLM_FUNC_DECL vec convertSRGBToLinear(vec const& ColorSRGB, T Gamma); - - /// @} -} //namespace glm - -#include "color_space.inl" diff --git a/3rdparty/glm/source/glm/gtc/color_space.inl b/3rdparty/glm/source/glm/gtc/color_space.inl deleted file mode 100644 index 2a90004..0000000 --- a/3rdparty/glm/source/glm/gtc/color_space.inl +++ /dev/null @@ -1,84 +0,0 @@ -/// @ref gtc_color_space - -namespace glm{ -namespace detail -{ - template - struct compute_rgbToSrgb - { - GLM_FUNC_QUALIFIER static vec call(vec const& ColorRGB, T GammaCorrection) - { - vec const ClampedColor(clamp(ColorRGB, static_cast(0), static_cast(1))); - - return mix( - pow(ClampedColor, vec(GammaCorrection)) * static_cast(1.055) - static_cast(0.055), - ClampedColor * static_cast(12.92), - lessThan(ClampedColor, vec(static_cast(0.0031308)))); - } - }; - - template - struct compute_rgbToSrgb<4, T, Q> - { - GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& ColorRGB, T GammaCorrection) - { - return vec<4, T, Q>(compute_rgbToSrgb<3, T, Q>::call(vec<3, T, Q>(ColorRGB), GammaCorrection), ColorRGB.w); - } - }; - - template - struct compute_srgbToRgb - { - GLM_FUNC_QUALIFIER static vec call(vec const& ColorSRGB, T Gamma) - { - return mix( - pow((ColorSRGB + static_cast(0.055)) * static_cast(0.94786729857819905213270142180095), vec(Gamma)), - ColorSRGB * static_cast(0.07739938080495356037151702786378), - lessThanEqual(ColorSRGB, vec(static_cast(0.04045)))); - } - }; - - template - struct compute_srgbToRgb<4, T, Q> - { - GLM_FUNC_QUALIFIER static vec<4, T, Q> call(vec<4, T, Q> const& ColorSRGB, T Gamma) - { - return vec<4, T, Q>(compute_srgbToRgb<3, T, Q>::call(vec<3, T, Q>(ColorSRGB), Gamma), ColorSRGB.w); - } - }; -}//namespace detail - - template - GLM_FUNC_QUALIFIER vec convertLinearToSRGB(vec const& ColorLinear) - { - return detail::compute_rgbToSrgb::call(ColorLinear, static_cast(0.41666)); - } - - // Based on Ian Taylor http://chilliant.blogspot.fr/2012/08/srgb-approximations-for-hlsl.html - template<> - GLM_FUNC_QUALIFIER vec<3, float, lowp> convertLinearToSRGB(vec<3, float, lowp> const& ColorLinear) - { - vec<3, float, lowp> S1 = sqrt(ColorLinear); - vec<3, float, lowp> S2 = sqrt(S1); - vec<3, float, lowp> S3 = sqrt(S2); - return 0.662002687f * S1 + 0.684122060f * S2 - 0.323583601f * S3 - 0.0225411470f * ColorLinear; - } - - template - GLM_FUNC_QUALIFIER vec convertLinearToSRGB(vec const& ColorLinear, T Gamma) - { - return detail::compute_rgbToSrgb::call(ColorLinear, static_cast(1) / Gamma); - } - - template - GLM_FUNC_QUALIFIER vec convertSRGBToLinear(vec const& ColorSRGB) - { - return detail::compute_srgbToRgb::call(ColorSRGB, static_cast(2.4)); - } - - template - GLM_FUNC_QUALIFIER vec convertSRGBToLinear(vec const& ColorSRGB, T Gamma) - { - return detail::compute_srgbToRgb::call(ColorSRGB, Gamma); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtc/constants.hpp b/3rdparty/glm/source/glm/gtc/constants.hpp deleted file mode 100644 index 99f2128..0000000 --- a/3rdparty/glm/source/glm/gtc/constants.hpp +++ /dev/null @@ -1,165 +0,0 @@ -/// @ref gtc_constants -/// @file glm/gtc/constants.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtc_constants GLM_GTC_constants -/// @ingroup gtc -/// -/// Include to use the features of this extension. -/// -/// Provide a list of constants and precomputed useful values. - -#pragma once - -// Dependencies -#include "../ext/scalar_constants.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTC_constants extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_constants - /// @{ - - /// Return 0. - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType zero(); - - /// Return 1. - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType one(); - - /// Return pi * 2. - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType two_pi(); - - /// Return square root of pi. - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType root_pi(); - - /// Return pi / 2. - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType half_pi(); - - /// Return pi / 2 * 3. - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType three_over_two_pi(); - - /// Return pi / 4. - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType quarter_pi(); - - /// Return 1 / pi. - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_pi(); - - /// Return 1 / (pi * 2). - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_two_pi(); - - /// Return 2 / pi. - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType two_over_pi(); - - /// Return 4 / pi. - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType four_over_pi(); - - /// Return 2 / sqrt(pi). - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType two_over_root_pi(); - - /// Return 1 / sqrt(2). - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_root_two(); - - /// Return sqrt(pi / 2). - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType root_half_pi(); - - /// Return sqrt(2 * pi). - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType root_two_pi(); - - /// Return sqrt(ln(4)). - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType root_ln_four(); - - /// Return e constant. - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType e(); - - /// Return Euler's constant. - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType euler(); - - /// Return sqrt(2). - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType root_two(); - - /// Return sqrt(3). - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType root_three(); - - /// Return sqrt(5). - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType root_five(); - - /// Return ln(2). - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType ln_two(); - - /// Return ln(10). - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType ln_ten(); - - /// Return ln(ln(2)). - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType ln_ln_two(); - - /// Return 1 / 3. - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType third(); - - /// Return 2 / 3. - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType two_thirds(); - - /// Return the golden ratio constant. - /// @see gtc_constants - template - GLM_FUNC_DECL GLM_CONSTEXPR genType golden_ratio(); - - /// @} -} //namespace glm - -#include "constants.inl" diff --git a/3rdparty/glm/source/glm/gtc/constants.inl b/3rdparty/glm/source/glm/gtc/constants.inl deleted file mode 100644 index bb98c6b..0000000 --- a/3rdparty/glm/source/glm/gtc/constants.inl +++ /dev/null @@ -1,167 +0,0 @@ -/// @ref gtc_constants - -namespace glm -{ - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType zero() - { - return genType(0); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one() - { - return genType(1); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_pi() - { - return genType(6.28318530717958647692528676655900576); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_pi() - { - return genType(1.772453850905516027); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType half_pi() - { - return genType(1.57079632679489661923132169163975144); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType three_over_two_pi() - { - return genType(4.71238898038468985769396507491925432); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType quarter_pi() - { - return genType(0.785398163397448309615660845819875721); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one_over_pi() - { - return genType(0.318309886183790671537767526745028724); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one_over_two_pi() - { - return genType(0.159154943091895335768883763372514362); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_over_pi() - { - return genType(0.636619772367581343075535053490057448); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType four_over_pi() - { - return genType(1.273239544735162686151070106980114898); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_over_root_pi() - { - return genType(1.12837916709551257389615890312154517); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one_over_root_two() - { - return genType(0.707106781186547524400844362104849039); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_half_pi() - { - return genType(1.253314137315500251); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_two_pi() - { - return genType(2.506628274631000502); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_ln_four() - { - return genType(1.17741002251547469); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType e() - { - return genType(2.71828182845904523536); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType euler() - { - return genType(0.577215664901532860606); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_two() - { - return genType(1.41421356237309504880168872420969808); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_three() - { - return genType(1.73205080756887729352744634150587236); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_five() - { - return genType(2.23606797749978969640917366873127623); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_two() - { - return genType(0.693147180559945309417232121458176568); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_ten() - { - return genType(2.30258509299404568401799145468436421); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_ln_two() - { - return genType(-0.3665129205816643); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType third() - { - return genType(0.3333333333333333333333333333333333333333); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_thirds() - { - return genType(0.666666666666666666666666666666666666667); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType golden_ratio() - { - return genType(1.61803398874989484820458683436563811); - } - -} //namespace glm diff --git a/3rdparty/glm/source/glm/gtc/epsilon.hpp b/3rdparty/glm/source/glm/gtc/epsilon.hpp deleted file mode 100644 index 640439b..0000000 --- a/3rdparty/glm/source/glm/gtc/epsilon.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/// @ref gtc_epsilon -/// @file glm/gtc/epsilon.hpp -/// -/// @see core (dependence) -/// @see gtc_quaternion (dependence) -/// -/// @defgroup gtc_epsilon GLM_GTC_epsilon -/// @ingroup gtc -/// -/// Include to use the features of this extension. -/// -/// Comparison functions for a user defined epsilon values. - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" -#include "../detail/qualifier.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTC_epsilon extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_epsilon - /// @{ - - /// Returns the component-wise comparison of |x - y| < epsilon. - /// True if this expression is satisfied. - /// - /// @see gtc_epsilon - template - GLM_FUNC_DECL vec epsilonEqual(vec const& x, vec const& y, T const& epsilon); - - /// Returns the component-wise comparison of |x - y| < epsilon. - /// True if this expression is satisfied. - /// - /// @see gtc_epsilon - template - GLM_FUNC_DECL bool epsilonEqual(genType const& x, genType const& y, genType const& epsilon); - - /// Returns the component-wise comparison of |x - y| < epsilon. - /// True if this expression is not satisfied. - /// - /// @see gtc_epsilon - template - GLM_FUNC_DECL vec epsilonNotEqual(vec const& x, vec const& y, T const& epsilon); - - /// Returns the component-wise comparison of |x - y| >= epsilon. - /// True if this expression is not satisfied. - /// - /// @see gtc_epsilon - template - GLM_FUNC_DECL bool epsilonNotEqual(genType const& x, genType const& y, genType const& epsilon); - - /// @} -}//namespace glm - -#include "epsilon.inl" diff --git a/3rdparty/glm/source/glm/gtc/epsilon.inl b/3rdparty/glm/source/glm/gtc/epsilon.inl deleted file mode 100644 index 508b9f8..0000000 --- a/3rdparty/glm/source/glm/gtc/epsilon.inl +++ /dev/null @@ -1,80 +0,0 @@ -/// @ref gtc_epsilon - -// Dependency: -#include "../vector_relational.hpp" -#include "../common.hpp" - -namespace glm -{ - template<> - GLM_FUNC_QUALIFIER bool epsilonEqual - ( - float const& x, - float const& y, - float const& epsilon - ) - { - return abs(x - y) < epsilon; - } - - template<> - GLM_FUNC_QUALIFIER bool epsilonEqual - ( - double const& x, - double const& y, - double const& epsilon - ) - { - return abs(x - y) < epsilon; - } - - template - GLM_FUNC_QUALIFIER vec epsilonEqual(vec const& x, vec const& y, T const& epsilon) - { - return lessThan(abs(x - y), vec(epsilon)); - } - - template - GLM_FUNC_QUALIFIER vec epsilonEqual(vec const& x, vec const& y, vec const& epsilon) - { - return lessThan(abs(x - y), vec(epsilon)); - } - - template<> - GLM_FUNC_QUALIFIER bool epsilonNotEqual(float const& x, float const& y, float const& epsilon) - { - return abs(x - y) >= epsilon; - } - - template<> - GLM_FUNC_QUALIFIER bool epsilonNotEqual(double const& x, double const& y, double const& epsilon) - { - return abs(x - y) >= epsilon; - } - - template - GLM_FUNC_QUALIFIER vec epsilonNotEqual(vec const& x, vec const& y, T const& epsilon) - { - return greaterThanEqual(abs(x - y), vec(epsilon)); - } - - template - GLM_FUNC_QUALIFIER vec epsilonNotEqual(vec const& x, vec const& y, vec const& epsilon) - { - return greaterThanEqual(abs(x - y), vec(epsilon)); - } - - template - GLM_FUNC_QUALIFIER vec<4, bool, Q> epsilonEqual(qua const& x, qua const& y, T const& epsilon) - { - vec<4, T, Q> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); - return lessThan(abs(v), vec<4, T, Q>(epsilon)); - } - - template - GLM_FUNC_QUALIFIER vec<4, bool, Q> epsilonNotEqual(qua const& x, qua const& y, T const& epsilon) - { - vec<4, T, Q> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w); - return greaterThanEqual(abs(v), vec<4, T, Q>(epsilon)); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtc/integer.hpp b/3rdparty/glm/source/glm/gtc/integer.hpp deleted file mode 100644 index a2a5bf6..0000000 --- a/3rdparty/glm/source/glm/gtc/integer.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/// @ref gtc_integer -/// @file glm/gtc/integer.hpp -/// -/// @see core (dependence) -/// @see gtc_integer (dependence) -/// -/// @defgroup gtc_integer GLM_GTC_integer -/// @ingroup gtc -/// -/// Include to use the features of this extension. -/// -/// @brief Allow to perform bit operations on integer values - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" -#include "../detail/qualifier.hpp" -#include "../common.hpp" -#include "../integer.hpp" -#include "../exponential.hpp" -#include "../ext/scalar_common.hpp" -#include "../ext/vector_common.hpp" -#include - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTC_integer extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_integer - /// @{ - - /// Returns the log2 of x for integer values. Usefull to compute mipmap count from the texture size. - /// @see gtc_integer - template - GLM_FUNC_DECL genIUType log2(genIUType x); - - /// @} -} //namespace glm - -#include "integer.inl" diff --git a/3rdparty/glm/source/glm/gtc/integer.inl b/3rdparty/glm/source/glm/gtc/integer.inl deleted file mode 100644 index 5f66dfe..0000000 --- a/3rdparty/glm/source/glm/gtc/integer.inl +++ /dev/null @@ -1,33 +0,0 @@ -/// @ref gtc_integer - -namespace glm{ -namespace detail -{ - template - struct compute_log2 - { - GLM_FUNC_QUALIFIER static vec call(vec const& v) - { - //Equivalent to return findMSB(vec); but save one function call in ASM with VC - //return findMSB(vec); - return vec(detail::compute_findMSB_vec::call(v)); - } - }; - -# if GLM_HAS_BITSCAN_WINDOWS - template - struct compute_log2<4, int, Q, false, Aligned> - { - GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v) - { - vec<4, int, Q> Result; - _BitScanReverse(reinterpret_cast(&Result.x), v.x); - _BitScanReverse(reinterpret_cast(&Result.y), v.y); - _BitScanReverse(reinterpret_cast(&Result.z), v.z); - _BitScanReverse(reinterpret_cast(&Result.w), v.w); - return Result; - } - }; -# endif//GLM_HAS_BITSCAN_WINDOWS -}//namespace detail -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtc/matrix_access.hpp b/3rdparty/glm/source/glm/gtc/matrix_access.hpp deleted file mode 100644 index 4935ba7..0000000 --- a/3rdparty/glm/source/glm/gtc/matrix_access.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/// @ref gtc_matrix_access -/// @file glm/gtc/matrix_access.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtc_matrix_access GLM_GTC_matrix_access -/// @ingroup gtc -/// -/// Include to use the features of this extension. -/// -/// Defines functions to access rows or columns of a matrix easily. - -#pragma once - -// Dependency: -#include "../detail/setup.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTC_matrix_access extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_matrix_access - /// @{ - - /// Get a specific row of a matrix. - /// @see gtc_matrix_access - template - GLM_FUNC_DECL typename genType::row_type row( - genType const& m, - length_t index); - - /// Set a specific row to a matrix. - /// @see gtc_matrix_access - template - GLM_FUNC_DECL genType row( - genType const& m, - length_t index, - typename genType::row_type const& x); - - /// Get a specific column of a matrix. - /// @see gtc_matrix_access - template - GLM_FUNC_DECL typename genType::col_type column( - genType const& m, - length_t index); - - /// Set a specific column to a matrix. - /// @see gtc_matrix_access - template - GLM_FUNC_DECL genType column( - genType const& m, - length_t index, - typename genType::col_type const& x); - - /// @} -}//namespace glm - -#include "matrix_access.inl" diff --git a/3rdparty/glm/source/glm/gtc/matrix_access.inl b/3rdparty/glm/source/glm/gtc/matrix_access.inl deleted file mode 100644 index 09fcc10..0000000 --- a/3rdparty/glm/source/glm/gtc/matrix_access.inl +++ /dev/null @@ -1,62 +0,0 @@ -/// @ref gtc_matrix_access - -namespace glm -{ - template - GLM_FUNC_QUALIFIER genType row - ( - genType const& m, - length_t index, - typename genType::row_type const& x - ) - { - assert(index >= 0 && index < m[0].length()); - - genType Result = m; - for(length_t i = 0; i < m.length(); ++i) - Result[i][index] = x[i]; - return Result; - } - - template - GLM_FUNC_QUALIFIER typename genType::row_type row - ( - genType const& m, - length_t index - ) - { - assert(index >= 0 && index < m[0].length()); - - typename genType::row_type Result(0); - for(length_t i = 0; i < m.length(); ++i) - Result[i] = m[i][index]; - return Result; - } - - template - GLM_FUNC_QUALIFIER genType column - ( - genType const& m, - length_t index, - typename genType::col_type const& x - ) - { - assert(index >= 0 && index < m.length()); - - genType Result = m; - Result[index] = x; - return Result; - } - - template - GLM_FUNC_QUALIFIER typename genType::col_type column - ( - genType const& m, - length_t index - ) - { - assert(index >= 0 && index < m.length()); - - return m[index]; - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtc/matrix_integer.hpp b/3rdparty/glm/source/glm/gtc/matrix_integer.hpp deleted file mode 100644 index d7ebdc7..0000000 --- a/3rdparty/glm/source/glm/gtc/matrix_integer.hpp +++ /dev/null @@ -1,433 +0,0 @@ -/// @ref gtc_matrix_integer -/// @file glm/gtc/matrix_integer.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtc_matrix_integer GLM_GTC_matrix_integer -/// @ingroup gtc -/// -/// Include to use the features of this extension. -/// -/// Defines a number of matrices with integer types. - -#pragma once - -// Dependency: -#include "../mat2x2.hpp" -#include "../mat2x3.hpp" -#include "../mat2x4.hpp" -#include "../mat3x2.hpp" -#include "../mat3x3.hpp" -#include "../mat3x4.hpp" -#include "../mat4x2.hpp" -#include "../mat4x3.hpp" -#include "../mat4x4.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTC_matrix_integer extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_matrix_integer - /// @{ - - /// High-qualifier signed integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 2, int, highp> highp_imat2; - - /// High-qualifier signed integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 3, int, highp> highp_imat3; - - /// High-qualifier signed integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 4, int, highp> highp_imat4; - - /// High-qualifier signed integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 2, int, highp> highp_imat2x2; - - /// High-qualifier signed integer 2x3 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 3, int, highp> highp_imat2x3; - - /// High-qualifier signed integer 2x4 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 4, int, highp> highp_imat2x4; - - /// High-qualifier signed integer 3x2 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 2, int, highp> highp_imat3x2; - - /// High-qualifier signed integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 3, int, highp> highp_imat3x3; - - /// High-qualifier signed integer 3x4 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 4, int, highp> highp_imat3x4; - - /// High-qualifier signed integer 4x2 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 2, int, highp> highp_imat4x2; - - /// High-qualifier signed integer 4x3 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 3, int, highp> highp_imat4x3; - - /// High-qualifier signed integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 4, int, highp> highp_imat4x4; - - - /// Medium-qualifier signed integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 2, int, mediump> mediump_imat2; - - /// Medium-qualifier signed integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 3, int, mediump> mediump_imat3; - - /// Medium-qualifier signed integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 4, int, mediump> mediump_imat4; - - - /// Medium-qualifier signed integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 2, int, mediump> mediump_imat2x2; - - /// Medium-qualifier signed integer 2x3 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 3, int, mediump> mediump_imat2x3; - - /// Medium-qualifier signed integer 2x4 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 4, int, mediump> mediump_imat2x4; - - /// Medium-qualifier signed integer 3x2 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 2, int, mediump> mediump_imat3x2; - - /// Medium-qualifier signed integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 3, int, mediump> mediump_imat3x3; - - /// Medium-qualifier signed integer 3x4 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 4, int, mediump> mediump_imat3x4; - - /// Medium-qualifier signed integer 4x2 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 2, int, mediump> mediump_imat4x2; - - /// Medium-qualifier signed integer 4x3 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 3, int, mediump> mediump_imat4x3; - - /// Medium-qualifier signed integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 4, int, mediump> mediump_imat4x4; - - - /// Low-qualifier signed integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 2, int, lowp> lowp_imat2; - - /// Low-qualifier signed integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 3, int, lowp> lowp_imat3; - - /// Low-qualifier signed integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 4, int, lowp> lowp_imat4; - - - /// Low-qualifier signed integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 2, int, lowp> lowp_imat2x2; - - /// Low-qualifier signed integer 2x3 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 3, int, lowp> lowp_imat2x3; - - /// Low-qualifier signed integer 2x4 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 4, int, lowp> lowp_imat2x4; - - /// Low-qualifier signed integer 3x2 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 2, int, lowp> lowp_imat3x2; - - /// Low-qualifier signed integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 3, int, lowp> lowp_imat3x3; - - /// Low-qualifier signed integer 3x4 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 4, int, lowp> lowp_imat3x4; - - /// Low-qualifier signed integer 4x2 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 2, int, lowp> lowp_imat4x2; - - /// Low-qualifier signed integer 4x3 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 3, int, lowp> lowp_imat4x3; - - /// Low-qualifier signed integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 4, int, lowp> lowp_imat4x4; - - - /// High-qualifier unsigned integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 2, uint, highp> highp_umat2; - - /// High-qualifier unsigned integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 3, uint, highp> highp_umat3; - - /// High-qualifier unsigned integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 4, uint, highp> highp_umat4; - - /// High-qualifier unsigned integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 2, uint, highp> highp_umat2x2; - - /// High-qualifier unsigned integer 2x3 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 3, uint, highp> highp_umat2x3; - - /// High-qualifier unsigned integer 2x4 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 4, uint, highp> highp_umat2x4; - - /// High-qualifier unsigned integer 3x2 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 2, uint, highp> highp_umat3x2; - - /// High-qualifier unsigned integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 3, uint, highp> highp_umat3x3; - - /// High-qualifier unsigned integer 3x4 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 4, uint, highp> highp_umat3x4; - - /// High-qualifier unsigned integer 4x2 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 2, uint, highp> highp_umat4x2; - - /// High-qualifier unsigned integer 4x3 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 3, uint, highp> highp_umat4x3; - - /// High-qualifier unsigned integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 4, uint, highp> highp_umat4x4; - - - /// Medium-qualifier unsigned integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 2, uint, mediump> mediump_umat2; - - /// Medium-qualifier unsigned integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 3, uint, mediump> mediump_umat3; - - /// Medium-qualifier unsigned integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 4, uint, mediump> mediump_umat4; - - - /// Medium-qualifier unsigned integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 2, uint, mediump> mediump_umat2x2; - - /// Medium-qualifier unsigned integer 2x3 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 3, uint, mediump> mediump_umat2x3; - - /// Medium-qualifier unsigned integer 2x4 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 4, uint, mediump> mediump_umat2x4; - - /// Medium-qualifier unsigned integer 3x2 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 2, uint, mediump> mediump_umat3x2; - - /// Medium-qualifier unsigned integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 3, uint, mediump> mediump_umat3x3; - - /// Medium-qualifier unsigned integer 3x4 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 4, uint, mediump> mediump_umat3x4; - - /// Medium-qualifier unsigned integer 4x2 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 2, uint, mediump> mediump_umat4x2; - - /// Medium-qualifier unsigned integer 4x3 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 3, uint, mediump> mediump_umat4x3; - - /// Medium-qualifier unsigned integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 4, uint, mediump> mediump_umat4x4; - - - /// Low-qualifier unsigned integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 2, uint, lowp> lowp_umat2; - - /// Low-qualifier unsigned integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 3, uint, lowp> lowp_umat3; - - /// Low-qualifier unsigned integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 4, uint, lowp> lowp_umat4; - - - /// Low-qualifier unsigned integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 2, uint, lowp> lowp_umat2x2; - - /// Low-qualifier unsigned integer 2x3 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 3, uint, lowp> lowp_umat2x3; - - /// Low-qualifier unsigned integer 2x4 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 4, uint, lowp> lowp_umat2x4; - - /// Low-qualifier unsigned integer 3x2 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 2, uint, lowp> lowp_umat3x2; - - /// Low-qualifier unsigned integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 3, uint, lowp> lowp_umat3x3; - - /// Low-qualifier unsigned integer 3x4 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 4, uint, lowp> lowp_umat3x4; - - /// Low-qualifier unsigned integer 4x2 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 2, uint, lowp> lowp_umat4x2; - - /// Low-qualifier unsigned integer 4x3 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 3, uint, lowp> lowp_umat4x3; - - /// Low-qualifier unsigned integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 4, uint, lowp> lowp_umat4x4; - - - - /// Signed integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 2, int, defaultp> imat2; - - /// Signed integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 3, int, defaultp> imat3; - - /// Signed integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 4, int, defaultp> imat4; - - /// Signed integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 2, int, defaultp> imat2x2; - - /// Signed integer 2x3 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 3, int, defaultp> imat2x3; - - /// Signed integer 2x4 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 4, int, defaultp> imat2x4; - - /// Signed integer 3x2 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 2, int, defaultp> imat3x2; - - /// Signed integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 3, int, defaultp> imat3x3; - - /// Signed integer 3x4 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 4, int, defaultp> imat3x4; - - /// Signed integer 4x2 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 2, int, defaultp> imat4x2; - - /// Signed integer 4x3 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 3, int, defaultp> imat4x3; - - /// Signed integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 4, int, defaultp> imat4x4; - - - - /// Unsigned integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 2, uint, defaultp> umat2; - - /// Unsigned integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 3, uint, defaultp> umat3; - - /// Unsigned integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 4, uint, defaultp> umat4; - - /// Unsigned integer 2x2 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 2, uint, defaultp> umat2x2; - - /// Unsigned integer 2x3 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 3, uint, defaultp> umat2x3; - - /// Unsigned integer 2x4 matrix. - /// @see gtc_matrix_integer - typedef mat<2, 4, uint, defaultp> umat2x4; - - /// Unsigned integer 3x2 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 2, uint, defaultp> umat3x2; - - /// Unsigned integer 3x3 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 3, uint, defaultp> umat3x3; - - /// Unsigned integer 3x4 matrix. - /// @see gtc_matrix_integer - typedef mat<3, 4, uint, defaultp> umat3x4; - - /// Unsigned integer 4x2 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 2, uint, defaultp> umat4x2; - - /// Unsigned integer 4x3 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 3, uint, defaultp> umat4x3; - - /// Unsigned integer 4x4 matrix. - /// @see gtc_matrix_integer - typedef mat<4, 4, uint, defaultp> umat4x4; - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtc/matrix_inverse.hpp b/3rdparty/glm/source/glm/gtc/matrix_inverse.hpp deleted file mode 100644 index 8f77860..0000000 --- a/3rdparty/glm/source/glm/gtc/matrix_inverse.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/// @ref gtc_matrix_inverse -/// @file glm/gtc/matrix_inverse.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtc_matrix_inverse GLM_GTC_matrix_inverse -/// @ingroup gtc -/// -/// Include to use the features of this extension. -/// -/// Defines additional matrix inverting functions. - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" -#include "../matrix.hpp" -#include "../mat2x2.hpp" -#include "../mat3x3.hpp" -#include "../mat4x4.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTC_matrix_inverse extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_matrix_inverse - /// @{ - - /// Fast matrix inverse for affine matrix. - /// - /// @param m Input matrix to invert. - /// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-qualifier floating point value is highly innacurate. - /// @see gtc_matrix_inverse - template - GLM_FUNC_DECL genType affineInverse(genType const& m); - - /// Compute the inverse transpose of a matrix. - /// - /// @param m Input matrix to invert transpose. - /// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-qualifier floating point value is highly innacurate. - /// @see gtc_matrix_inverse - template - GLM_FUNC_DECL genType inverseTranspose(genType const& m); - - /// @} -}//namespace glm - -#include "matrix_inverse.inl" diff --git a/3rdparty/glm/source/glm/gtc/matrix_inverse.inl b/3rdparty/glm/source/glm/gtc/matrix_inverse.inl deleted file mode 100644 index c004b9e..0000000 --- a/3rdparty/glm/source/glm/gtc/matrix_inverse.inl +++ /dev/null @@ -1,118 +0,0 @@ -/// @ref gtc_matrix_inverse - -namespace glm -{ - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> affineInverse(mat<3, 3, T, Q> const& m) - { - mat<2, 2, T, Q> const Inv(inverse(mat<2, 2, T, Q>(m))); - - return mat<3, 3, T, Q>( - vec<3, T, Q>(Inv[0], static_cast(0)), - vec<3, T, Q>(Inv[1], static_cast(0)), - vec<3, T, Q>(-Inv * vec<2, T, Q>(m[2]), static_cast(1))); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> affineInverse(mat<4, 4, T, Q> const& m) - { - mat<3, 3, T, Q> const Inv(inverse(mat<3, 3, T, Q>(m))); - - return mat<4, 4, T, Q>( - vec<4, T, Q>(Inv[0], static_cast(0)), - vec<4, T, Q>(Inv[1], static_cast(0)), - vec<4, T, Q>(Inv[2], static_cast(0)), - vec<4, T, Q>(-Inv * vec<3, T, Q>(m[3]), static_cast(1))); - } - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> inverseTranspose(mat<2, 2, T, Q> const& m) - { - T Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1]; - - mat<2, 2, T, Q> Inverse( - + m[1][1] / Determinant, - - m[0][1] / Determinant, - - m[1][0] / Determinant, - + m[0][0] / Determinant); - - return Inverse; - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> inverseTranspose(mat<3, 3, T, Q> const& m) - { - T Determinant = - + m[0][0] * (m[1][1] * m[2][2] - m[1][2] * m[2][1]) - - m[0][1] * (m[1][0] * m[2][2] - m[1][2] * m[2][0]) - + m[0][2] * (m[1][0] * m[2][1] - m[1][1] * m[2][0]); - - mat<3, 3, T, Q> Inverse; - Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]); - Inverse[0][1] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]); - Inverse[0][2] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]); - Inverse[1][0] = - (m[0][1] * m[2][2] - m[2][1] * m[0][2]); - Inverse[1][1] = + (m[0][0] * m[2][2] - m[2][0] * m[0][2]); - Inverse[1][2] = - (m[0][0] * m[2][1] - m[2][0] * m[0][1]); - Inverse[2][0] = + (m[0][1] * m[1][2] - m[1][1] * m[0][2]); - Inverse[2][1] = - (m[0][0] * m[1][2] - m[1][0] * m[0][2]); - Inverse[2][2] = + (m[0][0] * m[1][1] - m[1][0] * m[0][1]); - Inverse /= Determinant; - - return Inverse; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> inverseTranspose(mat<4, 4, T, Q> const& m) - { - T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; - T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; - T SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; - T SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; - T SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; - T SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - T SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; - T SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; - T SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; - T SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; - T SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; - T SubFactor11 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; - T SubFactor12 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; - T SubFactor13 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; - T SubFactor14 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; - T SubFactor15 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; - T SubFactor16 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; - T SubFactor17 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; - - mat<4, 4, T, Q> Inverse; - Inverse[0][0] = + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02); - Inverse[0][1] = - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04); - Inverse[0][2] = + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05); - Inverse[0][3] = - (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05); - - Inverse[1][0] = - (m[0][1] * SubFactor00 - m[0][2] * SubFactor01 + m[0][3] * SubFactor02); - Inverse[1][1] = + (m[0][0] * SubFactor00 - m[0][2] * SubFactor03 + m[0][3] * SubFactor04); - Inverse[1][2] = - (m[0][0] * SubFactor01 - m[0][1] * SubFactor03 + m[0][3] * SubFactor05); - Inverse[1][3] = + (m[0][0] * SubFactor02 - m[0][1] * SubFactor04 + m[0][2] * SubFactor05); - - Inverse[2][0] = + (m[0][1] * SubFactor06 - m[0][2] * SubFactor07 + m[0][3] * SubFactor08); - Inverse[2][1] = - (m[0][0] * SubFactor06 - m[0][2] * SubFactor09 + m[0][3] * SubFactor10); - Inverse[2][2] = + (m[0][0] * SubFactor07 - m[0][1] * SubFactor09 + m[0][3] * SubFactor11); - Inverse[2][3] = - (m[0][0] * SubFactor08 - m[0][1] * SubFactor10 + m[0][2] * SubFactor11); - - Inverse[3][0] = - (m[0][1] * SubFactor12 - m[0][2] * SubFactor13 + m[0][3] * SubFactor14); - Inverse[3][1] = + (m[0][0] * SubFactor12 - m[0][2] * SubFactor15 + m[0][3] * SubFactor16); - Inverse[3][2] = - (m[0][0] * SubFactor13 - m[0][1] * SubFactor15 + m[0][3] * SubFactor17); - Inverse[3][3] = + (m[0][0] * SubFactor14 - m[0][1] * SubFactor16 + m[0][2] * SubFactor17); - - T Determinant = - + m[0][0] * Inverse[0][0] - + m[0][1] * Inverse[0][1] - + m[0][2] * Inverse[0][2] - + m[0][3] * Inverse[0][3]; - - Inverse /= Determinant; - - return Inverse; - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtc/matrix_transform.hpp b/3rdparty/glm/source/glm/gtc/matrix_transform.hpp deleted file mode 100644 index 612418f..0000000 --- a/3rdparty/glm/source/glm/gtc/matrix_transform.hpp +++ /dev/null @@ -1,36 +0,0 @@ -/// @ref gtc_matrix_transform -/// @file glm/gtc/matrix_transform.hpp -/// -/// @see core (dependence) -/// @see gtx_transform -/// @see gtx_transform2 -/// -/// @defgroup gtc_matrix_transform GLM_GTC_matrix_transform -/// @ingroup gtc -/// -/// Include to use the features of this extension. -/// -/// Defines functions that generate common transformation matrices. -/// -/// The matrices generated by this extension use standard OpenGL fixed-function -/// conventions. For example, the lookAt function generates a transform from world -/// space into the specific eye space that the projective matrix functions -/// (perspective, ortho, etc) are designed to expect. The OpenGL compatibility -/// specifications defines the particular layout of this eye space. - -#pragma once - -// Dependencies -#include "../mat4x4.hpp" -#include "../vec2.hpp" -#include "../vec3.hpp" -#include "../vec4.hpp" -#include "../ext/matrix_projection.hpp" -#include "../ext/matrix_clip_space.hpp" -#include "../ext/matrix_transform.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTC_matrix_transform extension included") -#endif - -#include "matrix_transform.inl" diff --git a/3rdparty/glm/source/glm/gtc/matrix_transform.inl b/3rdparty/glm/source/glm/gtc/matrix_transform.inl deleted file mode 100644 index 15b46bc..0000000 --- a/3rdparty/glm/source/glm/gtc/matrix_transform.inl +++ /dev/null @@ -1,3 +0,0 @@ -#include "../geometric.hpp" -#include "../trigonometric.hpp" -#include "../matrix.hpp" diff --git a/3rdparty/glm/source/glm/gtc/noise.hpp b/3rdparty/glm/source/glm/gtc/noise.hpp deleted file mode 100644 index ab1772e..0000000 --- a/3rdparty/glm/source/glm/gtc/noise.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/// @ref gtc_noise -/// @file glm/gtc/noise.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtc_noise GLM_GTC_noise -/// @ingroup gtc -/// -/// Include to use the features of this extension. -/// -/// Defines 2D, 3D and 4D procedural noise functions -/// Based on the work of Stefan Gustavson and Ashima Arts on "webgl-noise": -/// https://github.com/ashima/webgl-noise -/// Following Stefan Gustavson's paper "Simplex noise demystified": -/// http://www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" -#include "../detail/qualifier.hpp" -#include "../detail/_noise.hpp" -#include "../geometric.hpp" -#include "../common.hpp" -#include "../vector_relational.hpp" -#include "../vec2.hpp" -#include "../vec3.hpp" -#include "../vec4.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTC_noise extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_noise - /// @{ - - /// Classic perlin noise. - /// @see gtc_noise - template - GLM_FUNC_DECL T perlin( - vec const& p); - - /// Periodic perlin noise. - /// @see gtc_noise - template - GLM_FUNC_DECL T perlin( - vec const& p, - vec const& rep); - - /// Simplex noise. - /// @see gtc_noise - template - GLM_FUNC_DECL T simplex( - vec const& p); - - /// @} -}//namespace glm - -#include "noise.inl" diff --git a/3rdparty/glm/source/glm/gtc/noise.inl b/3rdparty/glm/source/glm/gtc/noise.inl deleted file mode 100644 index 30d0b27..0000000 --- a/3rdparty/glm/source/glm/gtc/noise.inl +++ /dev/null @@ -1,807 +0,0 @@ -/// @ref gtc_noise -/// -// Based on the work of Stefan Gustavson and Ashima Arts on "webgl-noise": -// https://github.com/ashima/webgl-noise -// Following Stefan Gustavson's paper "Simplex noise demystified": -// http://www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf - -namespace glm{ -namespace gtc -{ - template - GLM_FUNC_QUALIFIER vec<4, T, Q> grad4(T const& j, vec<4, T, Q> const& ip) - { - vec<3, T, Q> pXYZ = floor(fract(vec<3, T, Q>(j) * vec<3, T, Q>(ip)) * T(7)) * ip[2] - T(1); - T pW = static_cast(1.5) - dot(abs(pXYZ), vec<3, T, Q>(1)); - vec<4, T, Q> s = vec<4, T, Q>(lessThan(vec<4, T, Q>(pXYZ, pW), vec<4, T, Q>(0.0))); - pXYZ = pXYZ + (vec<3, T, Q>(s) * T(2) - T(1)) * s.w; - return vec<4, T, Q>(pXYZ, pW); - } -}//namespace gtc - - // Classic Perlin noise - template - GLM_FUNC_QUALIFIER T perlin(vec<2, T, Q> const& Position) - { - vec<4, T, Q> Pi = glm::floor(vec<4, T, Q>(Position.x, Position.y, Position.x, Position.y)) + vec<4, T, Q>(0.0, 0.0, 1.0, 1.0); - vec<4, T, Q> Pf = glm::fract(vec<4, T, Q>(Position.x, Position.y, Position.x, Position.y)) - vec<4, T, Q>(0.0, 0.0, 1.0, 1.0); - Pi = mod(Pi, vec<4, T, Q>(289)); // To avoid truncation effects in permutation - vec<4, T, Q> ix(Pi.x, Pi.z, Pi.x, Pi.z); - vec<4, T, Q> iy(Pi.y, Pi.y, Pi.w, Pi.w); - vec<4, T, Q> fx(Pf.x, Pf.z, Pf.x, Pf.z); - vec<4, T, Q> fy(Pf.y, Pf.y, Pf.w, Pf.w); - - vec<4, T, Q> i = detail::permute(detail::permute(ix) + iy); - - vec<4, T, Q> gx = static_cast(2) * glm::fract(i / T(41)) - T(1); - vec<4, T, Q> gy = glm::abs(gx) - T(0.5); - vec<4, T, Q> tx = glm::floor(gx + T(0.5)); - gx = gx - tx; - - vec<2, T, Q> g00(gx.x, gy.x); - vec<2, T, Q> g10(gx.y, gy.y); - vec<2, T, Q> g01(gx.z, gy.z); - vec<2, T, Q> g11(gx.w, gy.w); - - vec<4, T, Q> norm = detail::taylorInvSqrt(vec<4, T, Q>(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11))); - g00 *= norm.x; - g01 *= norm.y; - g10 *= norm.z; - g11 *= norm.w; - - T n00 = dot(g00, vec<2, T, Q>(fx.x, fy.x)); - T n10 = dot(g10, vec<2, T, Q>(fx.y, fy.y)); - T n01 = dot(g01, vec<2, T, Q>(fx.z, fy.z)); - T n11 = dot(g11, vec<2, T, Q>(fx.w, fy.w)); - - vec<2, T, Q> fade_xy = detail::fade(vec<2, T, Q>(Pf.x, Pf.y)); - vec<2, T, Q> n_x = mix(vec<2, T, Q>(n00, n01), vec<2, T, Q>(n10, n11), fade_xy.x); - T n_xy = mix(n_x.x, n_x.y, fade_xy.y); - return T(2.3) * n_xy; - } - - // Classic Perlin noise - template - GLM_FUNC_QUALIFIER T perlin(vec<3, T, Q> const& Position) - { - vec<3, T, Q> Pi0 = floor(Position); // Integer part for indexing - vec<3, T, Q> Pi1 = Pi0 + T(1); // Integer part + 1 - Pi0 = detail::mod289(Pi0); - Pi1 = detail::mod289(Pi1); - vec<3, T, Q> Pf0 = fract(Position); // Fractional part for interpolation - vec<3, T, Q> Pf1 = Pf0 - T(1); // Fractional part - 1.0 - vec<4, T, Q> ix(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - vec<4, T, Q> iy = vec<4, T, Q>(vec<2, T, Q>(Pi0.y), vec<2, T, Q>(Pi1.y)); - vec<4, T, Q> iz0(Pi0.z); - vec<4, T, Q> iz1(Pi1.z); - - vec<4, T, Q> ixy = detail::permute(detail::permute(ix) + iy); - vec<4, T, Q> ixy0 = detail::permute(ixy + iz0); - vec<4, T, Q> ixy1 = detail::permute(ixy + iz1); - - vec<4, T, Q> gx0 = ixy0 * T(1.0 / 7.0); - vec<4, T, Q> gy0 = fract(floor(gx0) * T(1.0 / 7.0)) - T(0.5); - gx0 = fract(gx0); - vec<4, T, Q> gz0 = vec<4, T, Q>(0.5) - abs(gx0) - abs(gy0); - vec<4, T, Q> sz0 = step(gz0, vec<4, T, Q>(0.0)); - gx0 -= sz0 * (step(T(0), gx0) - T(0.5)); - gy0 -= sz0 * (step(T(0), gy0) - T(0.5)); - - vec<4, T, Q> gx1 = ixy1 * T(1.0 / 7.0); - vec<4, T, Q> gy1 = fract(floor(gx1) * T(1.0 / 7.0)) - T(0.5); - gx1 = fract(gx1); - vec<4, T, Q> gz1 = vec<4, T, Q>(0.5) - abs(gx1) - abs(gy1); - vec<4, T, Q> sz1 = step(gz1, vec<4, T, Q>(0.0)); - gx1 -= sz1 * (step(T(0), gx1) - T(0.5)); - gy1 -= sz1 * (step(T(0), gy1) - T(0.5)); - - vec<3, T, Q> g000(gx0.x, gy0.x, gz0.x); - vec<3, T, Q> g100(gx0.y, gy0.y, gz0.y); - vec<3, T, Q> g010(gx0.z, gy0.z, gz0.z); - vec<3, T, Q> g110(gx0.w, gy0.w, gz0.w); - vec<3, T, Q> g001(gx1.x, gy1.x, gz1.x); - vec<3, T, Q> g101(gx1.y, gy1.y, gz1.y); - vec<3, T, Q> g011(gx1.z, gy1.z, gz1.z); - vec<3, T, Q> g111(gx1.w, gy1.w, gz1.w); - - vec<4, T, Q> norm0 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); - g000 *= norm0.x; - g010 *= norm0.y; - g100 *= norm0.z; - g110 *= norm0.w; - vec<4, T, Q> norm1 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); - g001 *= norm1.x; - g011 *= norm1.y; - g101 *= norm1.z; - g111 *= norm1.w; - - T n000 = dot(g000, Pf0); - T n100 = dot(g100, vec<3, T, Q>(Pf1.x, Pf0.y, Pf0.z)); - T n010 = dot(g010, vec<3, T, Q>(Pf0.x, Pf1.y, Pf0.z)); - T n110 = dot(g110, vec<3, T, Q>(Pf1.x, Pf1.y, Pf0.z)); - T n001 = dot(g001, vec<3, T, Q>(Pf0.x, Pf0.y, Pf1.z)); - T n101 = dot(g101, vec<3, T, Q>(Pf1.x, Pf0.y, Pf1.z)); - T n011 = dot(g011, vec<3, T, Q>(Pf0.x, Pf1.y, Pf1.z)); - T n111 = dot(g111, Pf1); - - vec<3, T, Q> fade_xyz = detail::fade(Pf0); - vec<4, T, Q> n_z = mix(vec<4, T, Q>(n000, n100, n010, n110), vec<4, T, Q>(n001, n101, n011, n111), fade_xyz.z); - vec<2, T, Q> n_yz = mix(vec<2, T, Q>(n_z.x, n_z.y), vec<2, T, Q>(n_z.z, n_z.w), fade_xyz.y); - T n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); - return T(2.2) * n_xyz; - } - /* - // Classic Perlin noise - template - GLM_FUNC_QUALIFIER T perlin(vec<3, T, Q> const& P) - { - vec<3, T, Q> Pi0 = floor(P); // Integer part for indexing - vec<3, T, Q> Pi1 = Pi0 + T(1); // Integer part + 1 - Pi0 = mod(Pi0, T(289)); - Pi1 = mod(Pi1, T(289)); - vec<3, T, Q> Pf0 = fract(P); // Fractional part for interpolation - vec<3, T, Q> Pf1 = Pf0 - T(1); // Fractional part - 1.0 - vec<4, T, Q> ix(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - vec<4, T, Q> iy(Pi0.y, Pi0.y, Pi1.y, Pi1.y); - vec<4, T, Q> iz0(Pi0.z); - vec<4, T, Q> iz1(Pi1.z); - - vec<4, T, Q> ixy = permute(permute(ix) + iy); - vec<4, T, Q> ixy0 = permute(ixy + iz0); - vec<4, T, Q> ixy1 = permute(ixy + iz1); - - vec<4, T, Q> gx0 = ixy0 / T(7); - vec<4, T, Q> gy0 = fract(floor(gx0) / T(7)) - T(0.5); - gx0 = fract(gx0); - vec<4, T, Q> gz0 = vec<4, T, Q>(0.5) - abs(gx0) - abs(gy0); - vec<4, T, Q> sz0 = step(gz0, vec<4, T, Q>(0.0)); - gx0 -= sz0 * (step(0.0, gx0) - T(0.5)); - gy0 -= sz0 * (step(0.0, gy0) - T(0.5)); - - vec<4, T, Q> gx1 = ixy1 / T(7); - vec<4, T, Q> gy1 = fract(floor(gx1) / T(7)) - T(0.5); - gx1 = fract(gx1); - vec<4, T, Q> gz1 = vec<4, T, Q>(0.5) - abs(gx1) - abs(gy1); - vec<4, T, Q> sz1 = step(gz1, vec<4, T, Q>(0.0)); - gx1 -= sz1 * (step(T(0), gx1) - T(0.5)); - gy1 -= sz1 * (step(T(0), gy1) - T(0.5)); - - vec<3, T, Q> g000(gx0.x, gy0.x, gz0.x); - vec<3, T, Q> g100(gx0.y, gy0.y, gz0.y); - vec<3, T, Q> g010(gx0.z, gy0.z, gz0.z); - vec<3, T, Q> g110(gx0.w, gy0.w, gz0.w); - vec<3, T, Q> g001(gx1.x, gy1.x, gz1.x); - vec<3, T, Q> g101(gx1.y, gy1.y, gz1.y); - vec<3, T, Q> g011(gx1.z, gy1.z, gz1.z); - vec<3, T, Q> g111(gx1.w, gy1.w, gz1.w); - - vec<4, T, Q> norm0 = taylorInvSqrt(vec<4, T, Q>(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); - g000 *= norm0.x; - g010 *= norm0.y; - g100 *= norm0.z; - g110 *= norm0.w; - vec<4, T, Q> norm1 = taylorInvSqrt(vec<4, T, Q>(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); - g001 *= norm1.x; - g011 *= norm1.y; - g101 *= norm1.z; - g111 *= norm1.w; - - T n000 = dot(g000, Pf0); - T n100 = dot(g100, vec<3, T, Q>(Pf1.x, Pf0.y, Pf0.z)); - T n010 = dot(g010, vec<3, T, Q>(Pf0.x, Pf1.y, Pf0.z)); - T n110 = dot(g110, vec<3, T, Q>(Pf1.x, Pf1.y, Pf0.z)); - T n001 = dot(g001, vec<3, T, Q>(Pf0.x, Pf0.y, Pf1.z)); - T n101 = dot(g101, vec<3, T, Q>(Pf1.x, Pf0.y, Pf1.z)); - T n011 = dot(g011, vec<3, T, Q>(Pf0.x, Pf1.y, Pf1.z)); - T n111 = dot(g111, Pf1); - - vec<3, T, Q> fade_xyz = fade(Pf0); - vec<4, T, Q> n_z = mix(vec<4, T, Q>(n000, n100, n010, n110), vec<4, T, Q>(n001, n101, n011, n111), fade_xyz.z); - vec<2, T, Q> n_yz = mix( - vec<2, T, Q>(n_z.x, n_z.y), - vec<2, T, Q>(n_z.z, n_z.w), fade_xyz.y); - T n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); - return T(2.2) * n_xyz; - } - */ - // Classic Perlin noise - template - GLM_FUNC_QUALIFIER T perlin(vec<4, T, Q> const& Position) - { - vec<4, T, Q> Pi0 = floor(Position); // Integer part for indexing - vec<4, T, Q> Pi1 = Pi0 + T(1); // Integer part + 1 - Pi0 = mod(Pi0, vec<4, T, Q>(289)); - Pi1 = mod(Pi1, vec<4, T, Q>(289)); - vec<4, T, Q> Pf0 = fract(Position); // Fractional part for interpolation - vec<4, T, Q> Pf1 = Pf0 - T(1); // Fractional part - 1.0 - vec<4, T, Q> ix(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - vec<4, T, Q> iy(Pi0.y, Pi0.y, Pi1.y, Pi1.y); - vec<4, T, Q> iz0(Pi0.z); - vec<4, T, Q> iz1(Pi1.z); - vec<4, T, Q> iw0(Pi0.w); - vec<4, T, Q> iw1(Pi1.w); - - vec<4, T, Q> ixy = detail::permute(detail::permute(ix) + iy); - vec<4, T, Q> ixy0 = detail::permute(ixy + iz0); - vec<4, T, Q> ixy1 = detail::permute(ixy + iz1); - vec<4, T, Q> ixy00 = detail::permute(ixy0 + iw0); - vec<4, T, Q> ixy01 = detail::permute(ixy0 + iw1); - vec<4, T, Q> ixy10 = detail::permute(ixy1 + iw0); - vec<4, T, Q> ixy11 = detail::permute(ixy1 + iw1); - - vec<4, T, Q> gx00 = ixy00 / T(7); - vec<4, T, Q> gy00 = floor(gx00) / T(7); - vec<4, T, Q> gz00 = floor(gy00) / T(6); - gx00 = fract(gx00) - T(0.5); - gy00 = fract(gy00) - T(0.5); - gz00 = fract(gz00) - T(0.5); - vec<4, T, Q> gw00 = vec<4, T, Q>(0.75) - abs(gx00) - abs(gy00) - abs(gz00); - vec<4, T, Q> sw00 = step(gw00, vec<4, T, Q>(0.0)); - gx00 -= sw00 * (step(T(0), gx00) - T(0.5)); - gy00 -= sw00 * (step(T(0), gy00) - T(0.5)); - - vec<4, T, Q> gx01 = ixy01 / T(7); - vec<4, T, Q> gy01 = floor(gx01) / T(7); - vec<4, T, Q> gz01 = floor(gy01) / T(6); - gx01 = fract(gx01) - T(0.5); - gy01 = fract(gy01) - T(0.5); - gz01 = fract(gz01) - T(0.5); - vec<4, T, Q> gw01 = vec<4, T, Q>(0.75) - abs(gx01) - abs(gy01) - abs(gz01); - vec<4, T, Q> sw01 = step(gw01, vec<4, T, Q>(0.0)); - gx01 -= sw01 * (step(T(0), gx01) - T(0.5)); - gy01 -= sw01 * (step(T(0), gy01) - T(0.5)); - - vec<4, T, Q> gx10 = ixy10 / T(7); - vec<4, T, Q> gy10 = floor(gx10) / T(7); - vec<4, T, Q> gz10 = floor(gy10) / T(6); - gx10 = fract(gx10) - T(0.5); - gy10 = fract(gy10) - T(0.5); - gz10 = fract(gz10) - T(0.5); - vec<4, T, Q> gw10 = vec<4, T, Q>(0.75) - abs(gx10) - abs(gy10) - abs(gz10); - vec<4, T, Q> sw10 = step(gw10, vec<4, T, Q>(0)); - gx10 -= sw10 * (step(T(0), gx10) - T(0.5)); - gy10 -= sw10 * (step(T(0), gy10) - T(0.5)); - - vec<4, T, Q> gx11 = ixy11 / T(7); - vec<4, T, Q> gy11 = floor(gx11) / T(7); - vec<4, T, Q> gz11 = floor(gy11) / T(6); - gx11 = fract(gx11) - T(0.5); - gy11 = fract(gy11) - T(0.5); - gz11 = fract(gz11) - T(0.5); - vec<4, T, Q> gw11 = vec<4, T, Q>(0.75) - abs(gx11) - abs(gy11) - abs(gz11); - vec<4, T, Q> sw11 = step(gw11, vec<4, T, Q>(0.0)); - gx11 -= sw11 * (step(T(0), gx11) - T(0.5)); - gy11 -= sw11 * (step(T(0), gy11) - T(0.5)); - - vec<4, T, Q> g0000(gx00.x, gy00.x, gz00.x, gw00.x); - vec<4, T, Q> g1000(gx00.y, gy00.y, gz00.y, gw00.y); - vec<4, T, Q> g0100(gx00.z, gy00.z, gz00.z, gw00.z); - vec<4, T, Q> g1100(gx00.w, gy00.w, gz00.w, gw00.w); - vec<4, T, Q> g0010(gx10.x, gy10.x, gz10.x, gw10.x); - vec<4, T, Q> g1010(gx10.y, gy10.y, gz10.y, gw10.y); - vec<4, T, Q> g0110(gx10.z, gy10.z, gz10.z, gw10.z); - vec<4, T, Q> g1110(gx10.w, gy10.w, gz10.w, gw10.w); - vec<4, T, Q> g0001(gx01.x, gy01.x, gz01.x, gw01.x); - vec<4, T, Q> g1001(gx01.y, gy01.y, gz01.y, gw01.y); - vec<4, T, Q> g0101(gx01.z, gy01.z, gz01.z, gw01.z); - vec<4, T, Q> g1101(gx01.w, gy01.w, gz01.w, gw01.w); - vec<4, T, Q> g0011(gx11.x, gy11.x, gz11.x, gw11.x); - vec<4, T, Q> g1011(gx11.y, gy11.y, gz11.y, gw11.y); - vec<4, T, Q> g0111(gx11.z, gy11.z, gz11.z, gw11.z); - vec<4, T, Q> g1111(gx11.w, gy11.w, gz11.w, gw11.w); - - vec<4, T, Q> norm00 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100))); - g0000 *= norm00.x; - g0100 *= norm00.y; - g1000 *= norm00.z; - g1100 *= norm00.w; - - vec<4, T, Q> norm01 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101))); - g0001 *= norm01.x; - g0101 *= norm01.y; - g1001 *= norm01.z; - g1101 *= norm01.w; - - vec<4, T, Q> norm10 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110))); - g0010 *= norm10.x; - g0110 *= norm10.y; - g1010 *= norm10.z; - g1110 *= norm10.w; - - vec<4, T, Q> norm11 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111))); - g0011 *= norm11.x; - g0111 *= norm11.y; - g1011 *= norm11.z; - g1111 *= norm11.w; - - T n0000 = dot(g0000, Pf0); - T n1000 = dot(g1000, vec<4, T, Q>(Pf1.x, Pf0.y, Pf0.z, Pf0.w)); - T n0100 = dot(g0100, vec<4, T, Q>(Pf0.x, Pf1.y, Pf0.z, Pf0.w)); - T n1100 = dot(g1100, vec<4, T, Q>(Pf1.x, Pf1.y, Pf0.z, Pf0.w)); - T n0010 = dot(g0010, vec<4, T, Q>(Pf0.x, Pf0.y, Pf1.z, Pf0.w)); - T n1010 = dot(g1010, vec<4, T, Q>(Pf1.x, Pf0.y, Pf1.z, Pf0.w)); - T n0110 = dot(g0110, vec<4, T, Q>(Pf0.x, Pf1.y, Pf1.z, Pf0.w)); - T n1110 = dot(g1110, vec<4, T, Q>(Pf1.x, Pf1.y, Pf1.z, Pf0.w)); - T n0001 = dot(g0001, vec<4, T, Q>(Pf0.x, Pf0.y, Pf0.z, Pf1.w)); - T n1001 = dot(g1001, vec<4, T, Q>(Pf1.x, Pf0.y, Pf0.z, Pf1.w)); - T n0101 = dot(g0101, vec<4, T, Q>(Pf0.x, Pf1.y, Pf0.z, Pf1.w)); - T n1101 = dot(g1101, vec<4, T, Q>(Pf1.x, Pf1.y, Pf0.z, Pf1.w)); - T n0011 = dot(g0011, vec<4, T, Q>(Pf0.x, Pf0.y, Pf1.z, Pf1.w)); - T n1011 = dot(g1011, vec<4, T, Q>(Pf1.x, Pf0.y, Pf1.z, Pf1.w)); - T n0111 = dot(g0111, vec<4, T, Q>(Pf0.x, Pf1.y, Pf1.z, Pf1.w)); - T n1111 = dot(g1111, Pf1); - - vec<4, T, Q> fade_xyzw = detail::fade(Pf0); - vec<4, T, Q> n_0w = mix(vec<4, T, Q>(n0000, n1000, n0100, n1100), vec<4, T, Q>(n0001, n1001, n0101, n1101), fade_xyzw.w); - vec<4, T, Q> n_1w = mix(vec<4, T, Q>(n0010, n1010, n0110, n1110), vec<4, T, Q>(n0011, n1011, n0111, n1111), fade_xyzw.w); - vec<4, T, Q> n_zw = mix(n_0w, n_1w, fade_xyzw.z); - vec<2, T, Q> n_yzw = mix(vec<2, T, Q>(n_zw.x, n_zw.y), vec<2, T, Q>(n_zw.z, n_zw.w), fade_xyzw.y); - T n_xyzw = mix(n_yzw.x, n_yzw.y, fade_xyzw.x); - return T(2.2) * n_xyzw; - } - - // Classic Perlin noise, periodic variant - template - GLM_FUNC_QUALIFIER T perlin(vec<2, T, Q> const& Position, vec<2, T, Q> const& rep) - { - vec<4, T, Q> Pi = floor(vec<4, T, Q>(Position.x, Position.y, Position.x, Position.y)) + vec<4, T, Q>(0.0, 0.0, 1.0, 1.0); - vec<4, T, Q> Pf = fract(vec<4, T, Q>(Position.x, Position.y, Position.x, Position.y)) - vec<4, T, Q>(0.0, 0.0, 1.0, 1.0); - Pi = mod(Pi, vec<4, T, Q>(rep.x, rep.y, rep.x, rep.y)); // To create noise with explicit period - Pi = mod(Pi, vec<4, T, Q>(289)); // To avoid truncation effects in permutation - vec<4, T, Q> ix(Pi.x, Pi.z, Pi.x, Pi.z); - vec<4, T, Q> iy(Pi.y, Pi.y, Pi.w, Pi.w); - vec<4, T, Q> fx(Pf.x, Pf.z, Pf.x, Pf.z); - vec<4, T, Q> fy(Pf.y, Pf.y, Pf.w, Pf.w); - - vec<4, T, Q> i = detail::permute(detail::permute(ix) + iy); - - vec<4, T, Q> gx = static_cast(2) * fract(i / T(41)) - T(1); - vec<4, T, Q> gy = abs(gx) - T(0.5); - vec<4, T, Q> tx = floor(gx + T(0.5)); - gx = gx - tx; - - vec<2, T, Q> g00(gx.x, gy.x); - vec<2, T, Q> g10(gx.y, gy.y); - vec<2, T, Q> g01(gx.z, gy.z); - vec<2, T, Q> g11(gx.w, gy.w); - - vec<4, T, Q> norm = detail::taylorInvSqrt(vec<4, T, Q>(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11))); - g00 *= norm.x; - g01 *= norm.y; - g10 *= norm.z; - g11 *= norm.w; - - T n00 = dot(g00, vec<2, T, Q>(fx.x, fy.x)); - T n10 = dot(g10, vec<2, T, Q>(fx.y, fy.y)); - T n01 = dot(g01, vec<2, T, Q>(fx.z, fy.z)); - T n11 = dot(g11, vec<2, T, Q>(fx.w, fy.w)); - - vec<2, T, Q> fade_xy = detail::fade(vec<2, T, Q>(Pf.x, Pf.y)); - vec<2, T, Q> n_x = mix(vec<2, T, Q>(n00, n01), vec<2, T, Q>(n10, n11), fade_xy.x); - T n_xy = mix(n_x.x, n_x.y, fade_xy.y); - return T(2.3) * n_xy; - } - - // Classic Perlin noise, periodic variant - template - GLM_FUNC_QUALIFIER T perlin(vec<3, T, Q> const& Position, vec<3, T, Q> const& rep) - { - vec<3, T, Q> Pi0 = mod(floor(Position), rep); // Integer part, modulo period - vec<3, T, Q> Pi1 = mod(Pi0 + vec<3, T, Q>(T(1)), rep); // Integer part + 1, mod period - Pi0 = mod(Pi0, vec<3, T, Q>(289)); - Pi1 = mod(Pi1, vec<3, T, Q>(289)); - vec<3, T, Q> Pf0 = fract(Position); // Fractional part for interpolation - vec<3, T, Q> Pf1 = Pf0 - vec<3, T, Q>(T(1)); // Fractional part - 1.0 - vec<4, T, Q> ix = vec<4, T, Q>(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - vec<4, T, Q> iy = vec<4, T, Q>(Pi0.y, Pi0.y, Pi1.y, Pi1.y); - vec<4, T, Q> iz0(Pi0.z); - vec<4, T, Q> iz1(Pi1.z); - - vec<4, T, Q> ixy = detail::permute(detail::permute(ix) + iy); - vec<4, T, Q> ixy0 = detail::permute(ixy + iz0); - vec<4, T, Q> ixy1 = detail::permute(ixy + iz1); - - vec<4, T, Q> gx0 = ixy0 / T(7); - vec<4, T, Q> gy0 = fract(floor(gx0) / T(7)) - T(0.5); - gx0 = fract(gx0); - vec<4, T, Q> gz0 = vec<4, T, Q>(0.5) - abs(gx0) - abs(gy0); - vec<4, T, Q> sz0 = step(gz0, vec<4, T, Q>(0)); - gx0 -= sz0 * (step(T(0), gx0) - T(0.5)); - gy0 -= sz0 * (step(T(0), gy0) - T(0.5)); - - vec<4, T, Q> gx1 = ixy1 / T(7); - vec<4, T, Q> gy1 = fract(floor(gx1) / T(7)) - T(0.5); - gx1 = fract(gx1); - vec<4, T, Q> gz1 = vec<4, T, Q>(0.5) - abs(gx1) - abs(gy1); - vec<4, T, Q> sz1 = step(gz1, vec<4, T, Q>(T(0))); - gx1 -= sz1 * (step(T(0), gx1) - T(0.5)); - gy1 -= sz1 * (step(T(0), gy1) - T(0.5)); - - vec<3, T, Q> g000 = vec<3, T, Q>(gx0.x, gy0.x, gz0.x); - vec<3, T, Q> g100 = vec<3, T, Q>(gx0.y, gy0.y, gz0.y); - vec<3, T, Q> g010 = vec<3, T, Q>(gx0.z, gy0.z, gz0.z); - vec<3, T, Q> g110 = vec<3, T, Q>(gx0.w, gy0.w, gz0.w); - vec<3, T, Q> g001 = vec<3, T, Q>(gx1.x, gy1.x, gz1.x); - vec<3, T, Q> g101 = vec<3, T, Q>(gx1.y, gy1.y, gz1.y); - vec<3, T, Q> g011 = vec<3, T, Q>(gx1.z, gy1.z, gz1.z); - vec<3, T, Q> g111 = vec<3, T, Q>(gx1.w, gy1.w, gz1.w); - - vec<4, T, Q> norm0 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); - g000 *= norm0.x; - g010 *= norm0.y; - g100 *= norm0.z; - g110 *= norm0.w; - vec<4, T, Q> norm1 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); - g001 *= norm1.x; - g011 *= norm1.y; - g101 *= norm1.z; - g111 *= norm1.w; - - T n000 = dot(g000, Pf0); - T n100 = dot(g100, vec<3, T, Q>(Pf1.x, Pf0.y, Pf0.z)); - T n010 = dot(g010, vec<3, T, Q>(Pf0.x, Pf1.y, Pf0.z)); - T n110 = dot(g110, vec<3, T, Q>(Pf1.x, Pf1.y, Pf0.z)); - T n001 = dot(g001, vec<3, T, Q>(Pf0.x, Pf0.y, Pf1.z)); - T n101 = dot(g101, vec<3, T, Q>(Pf1.x, Pf0.y, Pf1.z)); - T n011 = dot(g011, vec<3, T, Q>(Pf0.x, Pf1.y, Pf1.z)); - T n111 = dot(g111, Pf1); - - vec<3, T, Q> fade_xyz = detail::fade(Pf0); - vec<4, T, Q> n_z = mix(vec<4, T, Q>(n000, n100, n010, n110), vec<4, T, Q>(n001, n101, n011, n111), fade_xyz.z); - vec<2, T, Q> n_yz = mix(vec<2, T, Q>(n_z.x, n_z.y), vec<2, T, Q>(n_z.z, n_z.w), fade_xyz.y); - T n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); - return T(2.2) * n_xyz; - } - - // Classic Perlin noise, periodic version - template - GLM_FUNC_QUALIFIER T perlin(vec<4, T, Q> const& Position, vec<4, T, Q> const& rep) - { - vec<4, T, Q> Pi0 = mod(floor(Position), rep); // Integer part modulo rep - vec<4, T, Q> Pi1 = mod(Pi0 + T(1), rep); // Integer part + 1 mod rep - vec<4, T, Q> Pf0 = fract(Position); // Fractional part for interpolation - vec<4, T, Q> Pf1 = Pf0 - T(1); // Fractional part - 1.0 - vec<4, T, Q> ix = vec<4, T, Q>(Pi0.x, Pi1.x, Pi0.x, Pi1.x); - vec<4, T, Q> iy = vec<4, T, Q>(Pi0.y, Pi0.y, Pi1.y, Pi1.y); - vec<4, T, Q> iz0(Pi0.z); - vec<4, T, Q> iz1(Pi1.z); - vec<4, T, Q> iw0(Pi0.w); - vec<4, T, Q> iw1(Pi1.w); - - vec<4, T, Q> ixy = detail::permute(detail::permute(ix) + iy); - vec<4, T, Q> ixy0 = detail::permute(ixy + iz0); - vec<4, T, Q> ixy1 = detail::permute(ixy + iz1); - vec<4, T, Q> ixy00 = detail::permute(ixy0 + iw0); - vec<4, T, Q> ixy01 = detail::permute(ixy0 + iw1); - vec<4, T, Q> ixy10 = detail::permute(ixy1 + iw0); - vec<4, T, Q> ixy11 = detail::permute(ixy1 + iw1); - - vec<4, T, Q> gx00 = ixy00 / T(7); - vec<4, T, Q> gy00 = floor(gx00) / T(7); - vec<4, T, Q> gz00 = floor(gy00) / T(6); - gx00 = fract(gx00) - T(0.5); - gy00 = fract(gy00) - T(0.5); - gz00 = fract(gz00) - T(0.5); - vec<4, T, Q> gw00 = vec<4, T, Q>(0.75) - abs(gx00) - abs(gy00) - abs(gz00); - vec<4, T, Q> sw00 = step(gw00, vec<4, T, Q>(0)); - gx00 -= sw00 * (step(T(0), gx00) - T(0.5)); - gy00 -= sw00 * (step(T(0), gy00) - T(0.5)); - - vec<4, T, Q> gx01 = ixy01 / T(7); - vec<4, T, Q> gy01 = floor(gx01) / T(7); - vec<4, T, Q> gz01 = floor(gy01) / T(6); - gx01 = fract(gx01) - T(0.5); - gy01 = fract(gy01) - T(0.5); - gz01 = fract(gz01) - T(0.5); - vec<4, T, Q> gw01 = vec<4, T, Q>(0.75) - abs(gx01) - abs(gy01) - abs(gz01); - vec<4, T, Q> sw01 = step(gw01, vec<4, T, Q>(0.0)); - gx01 -= sw01 * (step(T(0), gx01) - T(0.5)); - gy01 -= sw01 * (step(T(0), gy01) - T(0.5)); - - vec<4, T, Q> gx10 = ixy10 / T(7); - vec<4, T, Q> gy10 = floor(gx10) / T(7); - vec<4, T, Q> gz10 = floor(gy10) / T(6); - gx10 = fract(gx10) - T(0.5); - gy10 = fract(gy10) - T(0.5); - gz10 = fract(gz10) - T(0.5); - vec<4, T, Q> gw10 = vec<4, T, Q>(0.75) - abs(gx10) - abs(gy10) - abs(gz10); - vec<4, T, Q> sw10 = step(gw10, vec<4, T, Q>(0.0)); - gx10 -= sw10 * (step(T(0), gx10) - T(0.5)); - gy10 -= sw10 * (step(T(0), gy10) - T(0.5)); - - vec<4, T, Q> gx11 = ixy11 / T(7); - vec<4, T, Q> gy11 = floor(gx11) / T(7); - vec<4, T, Q> gz11 = floor(gy11) / T(6); - gx11 = fract(gx11) - T(0.5); - gy11 = fract(gy11) - T(0.5); - gz11 = fract(gz11) - T(0.5); - vec<4, T, Q> gw11 = vec<4, T, Q>(0.75) - abs(gx11) - abs(gy11) - abs(gz11); - vec<4, T, Q> sw11 = step(gw11, vec<4, T, Q>(T(0))); - gx11 -= sw11 * (step(T(0), gx11) - T(0.5)); - gy11 -= sw11 * (step(T(0), gy11) - T(0.5)); - - vec<4, T, Q> g0000(gx00.x, gy00.x, gz00.x, gw00.x); - vec<4, T, Q> g1000(gx00.y, gy00.y, gz00.y, gw00.y); - vec<4, T, Q> g0100(gx00.z, gy00.z, gz00.z, gw00.z); - vec<4, T, Q> g1100(gx00.w, gy00.w, gz00.w, gw00.w); - vec<4, T, Q> g0010(gx10.x, gy10.x, gz10.x, gw10.x); - vec<4, T, Q> g1010(gx10.y, gy10.y, gz10.y, gw10.y); - vec<4, T, Q> g0110(gx10.z, gy10.z, gz10.z, gw10.z); - vec<4, T, Q> g1110(gx10.w, gy10.w, gz10.w, gw10.w); - vec<4, T, Q> g0001(gx01.x, gy01.x, gz01.x, gw01.x); - vec<4, T, Q> g1001(gx01.y, gy01.y, gz01.y, gw01.y); - vec<4, T, Q> g0101(gx01.z, gy01.z, gz01.z, gw01.z); - vec<4, T, Q> g1101(gx01.w, gy01.w, gz01.w, gw01.w); - vec<4, T, Q> g0011(gx11.x, gy11.x, gz11.x, gw11.x); - vec<4, T, Q> g1011(gx11.y, gy11.y, gz11.y, gw11.y); - vec<4, T, Q> g0111(gx11.z, gy11.z, gz11.z, gw11.z); - vec<4, T, Q> g1111(gx11.w, gy11.w, gz11.w, gw11.w); - - vec<4, T, Q> norm00 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100))); - g0000 *= norm00.x; - g0100 *= norm00.y; - g1000 *= norm00.z; - g1100 *= norm00.w; - - vec<4, T, Q> norm01 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101))); - g0001 *= norm01.x; - g0101 *= norm01.y; - g1001 *= norm01.z; - g1101 *= norm01.w; - - vec<4, T, Q> norm10 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110))); - g0010 *= norm10.x; - g0110 *= norm10.y; - g1010 *= norm10.z; - g1110 *= norm10.w; - - vec<4, T, Q> norm11 = detail::taylorInvSqrt(vec<4, T, Q>(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111))); - g0011 *= norm11.x; - g0111 *= norm11.y; - g1011 *= norm11.z; - g1111 *= norm11.w; - - T n0000 = dot(g0000, Pf0); - T n1000 = dot(g1000, vec<4, T, Q>(Pf1.x, Pf0.y, Pf0.z, Pf0.w)); - T n0100 = dot(g0100, vec<4, T, Q>(Pf0.x, Pf1.y, Pf0.z, Pf0.w)); - T n1100 = dot(g1100, vec<4, T, Q>(Pf1.x, Pf1.y, Pf0.z, Pf0.w)); - T n0010 = dot(g0010, vec<4, T, Q>(Pf0.x, Pf0.y, Pf1.z, Pf0.w)); - T n1010 = dot(g1010, vec<4, T, Q>(Pf1.x, Pf0.y, Pf1.z, Pf0.w)); - T n0110 = dot(g0110, vec<4, T, Q>(Pf0.x, Pf1.y, Pf1.z, Pf0.w)); - T n1110 = dot(g1110, vec<4, T, Q>(Pf1.x, Pf1.y, Pf1.z, Pf0.w)); - T n0001 = dot(g0001, vec<4, T, Q>(Pf0.x, Pf0.y, Pf0.z, Pf1.w)); - T n1001 = dot(g1001, vec<4, T, Q>(Pf1.x, Pf0.y, Pf0.z, Pf1.w)); - T n0101 = dot(g0101, vec<4, T, Q>(Pf0.x, Pf1.y, Pf0.z, Pf1.w)); - T n1101 = dot(g1101, vec<4, T, Q>(Pf1.x, Pf1.y, Pf0.z, Pf1.w)); - T n0011 = dot(g0011, vec<4, T, Q>(Pf0.x, Pf0.y, Pf1.z, Pf1.w)); - T n1011 = dot(g1011, vec<4, T, Q>(Pf1.x, Pf0.y, Pf1.z, Pf1.w)); - T n0111 = dot(g0111, vec<4, T, Q>(Pf0.x, Pf1.y, Pf1.z, Pf1.w)); - T n1111 = dot(g1111, Pf1); - - vec<4, T, Q> fade_xyzw = detail::fade(Pf0); - vec<4, T, Q> n_0w = mix(vec<4, T, Q>(n0000, n1000, n0100, n1100), vec<4, T, Q>(n0001, n1001, n0101, n1101), fade_xyzw.w); - vec<4, T, Q> n_1w = mix(vec<4, T, Q>(n0010, n1010, n0110, n1110), vec<4, T, Q>(n0011, n1011, n0111, n1111), fade_xyzw.w); - vec<4, T, Q> n_zw = mix(n_0w, n_1w, fade_xyzw.z); - vec<2, T, Q> n_yzw = mix(vec<2, T, Q>(n_zw.x, n_zw.y), vec<2, T, Q>(n_zw.z, n_zw.w), fade_xyzw.y); - T n_xyzw = mix(n_yzw.x, n_yzw.y, fade_xyzw.x); - return T(2.2) * n_xyzw; - } - - template - GLM_FUNC_QUALIFIER T simplex(glm::vec<2, T, Q> const& v) - { - vec<4, T, Q> const C = vec<4, T, Q>( - T( 0.211324865405187), // (3.0 - sqrt(3.0)) / 6.0 - T( 0.366025403784439), // 0.5 * (sqrt(3.0) - 1.0) - T(-0.577350269189626), // -1.0 + 2.0 * C.x - T( 0.024390243902439)); // 1.0 / 41.0 - - // First corner - vec<2, T, Q> i = floor(v + dot(v, vec<2, T, Q>(C[1]))); - vec<2, T, Q> x0 = v - i + dot(i, vec<2, T, Q>(C[0])); - - // Other corners - //i1.x = step( x0.y, x0.x ); // x0.x > x0.y ? 1.0 : 0.0 - //i1.y = 1.0 - i1.x; - vec<2, T, Q> i1 = (x0.x > x0.y) ? vec<2, T, Q>(1, 0) : vec<2, T, Q>(0, 1); - // x0 = x0 - 0.0 + 0.0 * C.xx ; - // x1 = x0 - i1 + 1.0 * C.xx ; - // x2 = x0 - 1.0 + 2.0 * C.xx ; - vec<4, T, Q> x12 = vec<4, T, Q>(x0.x, x0.y, x0.x, x0.y) + vec<4, T, Q>(C.x, C.x, C.z, C.z); - x12 = vec<4, T, Q>(vec<2, T, Q>(x12) - i1, x12.z, x12.w); - - // Permutations - i = mod(i, vec<2, T, Q>(289)); // Avoid truncation effects in permutation - vec<3, T, Q> p = detail::permute( - detail::permute(i.y + vec<3, T, Q>(T(0), i1.y, T(1))) - + i.x + vec<3, T, Q>(T(0), i1.x, T(1))); - - vec<3, T, Q> m = max(vec<3, T, Q>(0.5) - vec<3, T, Q>( - dot(x0, x0), - dot(vec<2, T, Q>(x12.x, x12.y), vec<2, T, Q>(x12.x, x12.y)), - dot(vec<2, T, Q>(x12.z, x12.w), vec<2, T, Q>(x12.z, x12.w))), vec<3, T, Q>(0)); - m = m * m ; - m = m * m ; - - // Gradients: 41 points uniformly over a line, mapped onto a diamond. - // The ring size 17*17 = 289 is close to a multiple of 41 (41*7 = 287) - - vec<3, T, Q> x = static_cast(2) * fract(p * C.w) - T(1); - vec<3, T, Q> h = abs(x) - T(0.5); - vec<3, T, Q> ox = floor(x + T(0.5)); - vec<3, T, Q> a0 = x - ox; - - // Normalise gradients implicitly by scaling m - // Inlined for speed: m *= taylorInvSqrt( a0*a0 + h*h ); - m *= static_cast(1.79284291400159) - T(0.85373472095314) * (a0 * a0 + h * h); - - // Compute final noise value at P - vec<3, T, Q> g; - g.x = a0.x * x0.x + h.x * x0.y; - //g.yz = a0.yz * x12.xz + h.yz * x12.yw; - g.y = a0.y * x12.x + h.y * x12.y; - g.z = a0.z * x12.z + h.z * x12.w; - return T(130) * dot(m, g); - } - - template - GLM_FUNC_QUALIFIER T simplex(vec<3, T, Q> const& v) - { - vec<2, T, Q> const C(1.0 / 6.0, 1.0 / 3.0); - vec<4, T, Q> const D(0.0, 0.5, 1.0, 2.0); - - // First corner - vec<3, T, Q> i(floor(v + dot(v, vec<3, T, Q>(C.y)))); - vec<3, T, Q> x0(v - i + dot(i, vec<3, T, Q>(C.x))); - - // Other corners - vec<3, T, Q> g(step(vec<3, T, Q>(x0.y, x0.z, x0.x), x0)); - vec<3, T, Q> l(T(1) - g); - vec<3, T, Q> i1(min(g, vec<3, T, Q>(l.z, l.x, l.y))); - vec<3, T, Q> i2(max(g, vec<3, T, Q>(l.z, l.x, l.y))); - - // x0 = x0 - 0.0 + 0.0 * C.xxx; - // x1 = x0 - i1 + 1.0 * C.xxx; - // x2 = x0 - i2 + 2.0 * C.xxx; - // x3 = x0 - 1.0 + 3.0 * C.xxx; - vec<3, T, Q> x1(x0 - i1 + C.x); - vec<3, T, Q> x2(x0 - i2 + C.y); // 2.0*C.x = 1/3 = C.y - vec<3, T, Q> x3(x0 - D.y); // -1.0+3.0*C.x = -0.5 = -D.y - - // Permutations - i = detail::mod289(i); - vec<4, T, Q> p(detail::permute(detail::permute(detail::permute( - i.z + vec<4, T, Q>(T(0), i1.z, i2.z, T(1))) + - i.y + vec<4, T, Q>(T(0), i1.y, i2.y, T(1))) + - i.x + vec<4, T, Q>(T(0), i1.x, i2.x, T(1)))); - - // Gradients: 7x7 points over a square, mapped onto an octahedron. - // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294) - T n_ = static_cast(0.142857142857); // 1.0/7.0 - vec<3, T, Q> ns(n_ * vec<3, T, Q>(D.w, D.y, D.z) - vec<3, T, Q>(D.x, D.z, D.x)); - - vec<4, T, Q> j(p - T(49) * floor(p * ns.z * ns.z)); // mod(p,7*7) - - vec<4, T, Q> x_(floor(j * ns.z)); - vec<4, T, Q> y_(floor(j - T(7) * x_)); // mod(j,N) - - vec<4, T, Q> x(x_ * ns.x + ns.y); - vec<4, T, Q> y(y_ * ns.x + ns.y); - vec<4, T, Q> h(T(1) - abs(x) - abs(y)); - - vec<4, T, Q> b0(x.x, x.y, y.x, y.y); - vec<4, T, Q> b1(x.z, x.w, y.z, y.w); - - // vec4 s0 = vec4(lessThan(b0,0.0))*2.0 - 1.0; - // vec4 s1 = vec4(lessThan(b1,0.0))*2.0 - 1.0; - vec<4, T, Q> s0(floor(b0) * T(2) + T(1)); - vec<4, T, Q> s1(floor(b1) * T(2) + T(1)); - vec<4, T, Q> sh(-step(h, vec<4, T, Q>(0.0))); - - vec<4, T, Q> a0 = vec<4, T, Q>(b0.x, b0.z, b0.y, b0.w) + vec<4, T, Q>(s0.x, s0.z, s0.y, s0.w) * vec<4, T, Q>(sh.x, sh.x, sh.y, sh.y); - vec<4, T, Q> a1 = vec<4, T, Q>(b1.x, b1.z, b1.y, b1.w) + vec<4, T, Q>(s1.x, s1.z, s1.y, s1.w) * vec<4, T, Q>(sh.z, sh.z, sh.w, sh.w); - - vec<3, T, Q> p0(a0.x, a0.y, h.x); - vec<3, T, Q> p1(a0.z, a0.w, h.y); - vec<3, T, Q> p2(a1.x, a1.y, h.z); - vec<3, T, Q> p3(a1.z, a1.w, h.w); - - // Normalise gradients - vec<4, T, Q> norm = detail::taylorInvSqrt(vec<4, T, Q>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3))); - p0 *= norm.x; - p1 *= norm.y; - p2 *= norm.z; - p3 *= norm.w; - - // Mix final noise value - vec<4, T, Q> m = max(T(0.6) - vec<4, T, Q>(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), vec<4, T, Q>(0)); - m = m * m; - return T(42) * dot(m * m, vec<4, T, Q>(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3))); - } - - template - GLM_FUNC_QUALIFIER T simplex(vec<4, T, Q> const& v) - { - vec<4, T, Q> const C( - 0.138196601125011, // (5 - sqrt(5))/20 G4 - 0.276393202250021, // 2 * G4 - 0.414589803375032, // 3 * G4 - -0.447213595499958); // -1 + 4 * G4 - - // (sqrt(5) - 1)/4 = F4, used once below - T const F4 = static_cast(0.309016994374947451); - - // First corner - vec<4, T, Q> i = floor(v + dot(v, vec<4, T, Q>(F4))); - vec<4, T, Q> x0 = v - i + dot(i, vec<4, T, Q>(C.x)); - - // Other corners - - // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI) - vec<4, T, Q> i0; - vec<3, T, Q> isX = step(vec<3, T, Q>(x0.y, x0.z, x0.w), vec<3, T, Q>(x0.x)); - vec<3, T, Q> isYZ = step(vec<3, T, Q>(x0.z, x0.w, x0.w), vec<3, T, Q>(x0.y, x0.y, x0.z)); - // i0.x = dot(isX, vec3(1.0)); - //i0.x = isX.x + isX.y + isX.z; - //i0.yzw = static_cast(1) - isX; - i0 = vec<4, T, Q>(isX.x + isX.y + isX.z, T(1) - isX); - // i0.y += dot(isYZ.xy, vec2(1.0)); - i0.y += isYZ.x + isYZ.y; - //i0.zw += 1.0 - vec<2, T, Q>(isYZ.x, isYZ.y); - i0.z += static_cast(1) - isYZ.x; - i0.w += static_cast(1) - isYZ.y; - i0.z += isYZ.z; - i0.w += static_cast(1) - isYZ.z; - - // i0 now contains the unique values 0,1,2,3 in each channel - vec<4, T, Q> i3 = clamp(i0, T(0), T(1)); - vec<4, T, Q> i2 = clamp(i0 - T(1), T(0), T(1)); - vec<4, T, Q> i1 = clamp(i0 - T(2), T(0), T(1)); - - // x0 = x0 - 0.0 + 0.0 * C.xxxx - // x1 = x0 - i1 + 0.0 * C.xxxx - // x2 = x0 - i2 + 0.0 * C.xxxx - // x3 = x0 - i3 + 0.0 * C.xxxx - // x4 = x0 - 1.0 + 4.0 * C.xxxx - vec<4, T, Q> x1 = x0 - i1 + C.x; - vec<4, T, Q> x2 = x0 - i2 + C.y; - vec<4, T, Q> x3 = x0 - i3 + C.z; - vec<4, T, Q> x4 = x0 + C.w; - - // Permutations - i = mod(i, vec<4, T, Q>(289)); - T j0 = detail::permute(detail::permute(detail::permute(detail::permute(i.w) + i.z) + i.y) + i.x); - vec<4, T, Q> j1 = detail::permute(detail::permute(detail::permute(detail::permute( - i.w + vec<4, T, Q>(i1.w, i2.w, i3.w, T(1))) + - i.z + vec<4, T, Q>(i1.z, i2.z, i3.z, T(1))) + - i.y + vec<4, T, Q>(i1.y, i2.y, i3.y, T(1))) + - i.x + vec<4, T, Q>(i1.x, i2.x, i3.x, T(1))); - - // Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope - // 7*7*6 = 294, which is close to the ring size 17*17 = 289. - vec<4, T, Q> ip = vec<4, T, Q>(T(1) / T(294), T(1) / T(49), T(1) / T(7), T(0)); - - vec<4, T, Q> p0 = gtc::grad4(j0, ip); - vec<4, T, Q> p1 = gtc::grad4(j1.x, ip); - vec<4, T, Q> p2 = gtc::grad4(j1.y, ip); - vec<4, T, Q> p3 = gtc::grad4(j1.z, ip); - vec<4, T, Q> p4 = gtc::grad4(j1.w, ip); - - // Normalise gradients - vec<4, T, Q> norm = detail::taylorInvSqrt(vec<4, T, Q>(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3))); - p0 *= norm.x; - p1 *= norm.y; - p2 *= norm.z; - p3 *= norm.w; - p4 *= detail::taylorInvSqrt(dot(p4, p4)); - - // Mix contributions from the five corners - vec<3, T, Q> m0 = max(T(0.6) - vec<3, T, Q>(dot(x0, x0), dot(x1, x1), dot(x2, x2)), vec<3, T, Q>(0)); - vec<2, T, Q> m1 = max(T(0.6) - vec<2, T, Q>(dot(x3, x3), dot(x4, x4) ), vec<2, T, Q>(0)); - m0 = m0 * m0; - m1 = m1 * m1; - return T(49) * - (dot(m0 * m0, vec<3, T, Q>(dot(p0, x0), dot(p1, x1), dot(p2, x2))) + - dot(m1 * m1, vec<2, T, Q>(dot(p3, x3), dot(p4, x4)))); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtc/packing.hpp b/3rdparty/glm/source/glm/gtc/packing.hpp deleted file mode 100644 index 8e416b3..0000000 --- a/3rdparty/glm/source/glm/gtc/packing.hpp +++ /dev/null @@ -1,728 +0,0 @@ -/// @ref gtc_packing -/// @file glm/gtc/packing.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtc_packing GLM_GTC_packing -/// @ingroup gtc -/// -/// Include to use the features of this extension. -/// -/// This extension provides a set of function to convert vertors to packed -/// formats. - -#pragma once - -// Dependency: -#include "type_precision.hpp" -#include "../ext/vector_packing.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTC_packing extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_packing - /// @{ - - /// First, converts the normalized floating-point value v into a 8-bit integer value. - /// Then, the results are packed into the returned 8-bit unsigned integer. - /// - /// The conversion for component c of v to fixed point is done as follows: - /// packUnorm1x8: round(clamp(c, 0, +1) * 255.0) - /// - /// @see gtc_packing - /// @see uint16 packUnorm2x8(vec2 const& v) - /// @see uint32 packUnorm4x8(vec4 const& v) - /// @see GLSL packUnorm4x8 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL uint8 packUnorm1x8(float v); - - /// Convert a single 8-bit integer to a normalized floating-point value. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackUnorm4x8: f / 255.0 - /// - /// @see gtc_packing - /// @see vec2 unpackUnorm2x8(uint16 p) - /// @see vec4 unpackUnorm4x8(uint32 p) - /// @see GLSL unpackUnorm4x8 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL float unpackUnorm1x8(uint8 p); - - /// First, converts each component of the normalized floating-point value v into 8-bit integer values. - /// Then, the results are packed into the returned 16-bit unsigned integer. - /// - /// The conversion for component c of v to fixed point is done as follows: - /// packUnorm2x8: round(clamp(c, 0, +1) * 255.0) - /// - /// The first component of the vector will be written to the least significant bits of the output; - /// the last component will be written to the most significant bits. - /// - /// @see gtc_packing - /// @see uint8 packUnorm1x8(float const& v) - /// @see uint32 packUnorm4x8(vec4 const& v) - /// @see GLSL packUnorm4x8 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL uint16 packUnorm2x8(vec2 const& v); - - /// First, unpacks a single 16-bit unsigned integer p into a pair of 8-bit unsigned integers. - /// Then, each component is converted to a normalized floating-point value to generate the returned two-component vector. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackUnorm4x8: f / 255.0 - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see gtc_packing - /// @see float unpackUnorm1x8(uint8 v) - /// @see vec4 unpackUnorm4x8(uint32 p) - /// @see GLSL unpackUnorm4x8 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL vec2 unpackUnorm2x8(uint16 p); - - /// First, converts the normalized floating-point value v into 8-bit integer value. - /// Then, the results are packed into the returned 8-bit unsigned integer. - /// - /// The conversion to fixed point is done as follows: - /// packSnorm1x8: round(clamp(s, -1, +1) * 127.0) - /// - /// @see gtc_packing - /// @see uint16 packSnorm2x8(vec2 const& v) - /// @see uint32 packSnorm4x8(vec4 const& v) - /// @see GLSL packSnorm4x8 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL uint8 packSnorm1x8(float s); - - /// First, unpacks a single 8-bit unsigned integer p into a single 8-bit signed integers. - /// Then, the value is converted to a normalized floating-point value to generate the returned scalar. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackSnorm1x8: clamp(f / 127.0, -1, +1) - /// - /// @see gtc_packing - /// @see vec2 unpackSnorm2x8(uint16 p) - /// @see vec4 unpackSnorm4x8(uint32 p) - /// @see GLSL unpackSnorm4x8 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL float unpackSnorm1x8(uint8 p); - - /// First, converts each component of the normalized floating-point value v into 8-bit integer values. - /// Then, the results are packed into the returned 16-bit unsigned integer. - /// - /// The conversion for component c of v to fixed point is done as follows: - /// packSnorm2x8: round(clamp(c, -1, +1) * 127.0) - /// - /// The first component of the vector will be written to the least significant bits of the output; - /// the last component will be written to the most significant bits. - /// - /// @see gtc_packing - /// @see uint8 packSnorm1x8(float const& v) - /// @see uint32 packSnorm4x8(vec4 const& v) - /// @see GLSL packSnorm4x8 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL uint16 packSnorm2x8(vec2 const& v); - - /// First, unpacks a single 16-bit unsigned integer p into a pair of 8-bit signed integers. - /// Then, each component is converted to a normalized floating-point value to generate the returned two-component vector. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackSnorm2x8: clamp(f / 127.0, -1, +1) - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see gtc_packing - /// @see float unpackSnorm1x8(uint8 p) - /// @see vec4 unpackSnorm4x8(uint32 p) - /// @see GLSL unpackSnorm4x8 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL vec2 unpackSnorm2x8(uint16 p); - - /// First, converts the normalized floating-point value v into a 16-bit integer value. - /// Then, the results are packed into the returned 16-bit unsigned integer. - /// - /// The conversion for component c of v to fixed point is done as follows: - /// packUnorm1x16: round(clamp(c, 0, +1) * 65535.0) - /// - /// @see gtc_packing - /// @see uint16 packSnorm1x16(float const& v) - /// @see uint64 packSnorm4x16(vec4 const& v) - /// @see GLSL packUnorm4x8 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL uint16 packUnorm1x16(float v); - - /// First, unpacks a single 16-bit unsigned integer p into a of 16-bit unsigned integers. - /// Then, the value is converted to a normalized floating-point value to generate the returned scalar. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackUnorm1x16: f / 65535.0 - /// - /// @see gtc_packing - /// @see vec2 unpackUnorm2x16(uint32 p) - /// @see vec4 unpackUnorm4x16(uint64 p) - /// @see GLSL unpackUnorm2x16 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL float unpackUnorm1x16(uint16 p); - - /// First, converts each component of the normalized floating-point value v into 16-bit integer values. - /// Then, the results are packed into the returned 64-bit unsigned integer. - /// - /// The conversion for component c of v to fixed point is done as follows: - /// packUnorm4x16: round(clamp(c, 0, +1) * 65535.0) - /// - /// The first component of the vector will be written to the least significant bits of the output; - /// the last component will be written to the most significant bits. - /// - /// @see gtc_packing - /// @see uint16 packUnorm1x16(float const& v) - /// @see uint32 packUnorm2x16(vec2 const& v) - /// @see GLSL packUnorm4x8 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL uint64 packUnorm4x16(vec4 const& v); - - /// First, unpacks a single 64-bit unsigned integer p into four 16-bit unsigned integers. - /// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackUnormx4x16: f / 65535.0 - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see gtc_packing - /// @see float unpackUnorm1x16(uint16 p) - /// @see vec2 unpackUnorm2x16(uint32 p) - /// @see GLSL unpackUnorm2x16 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL vec4 unpackUnorm4x16(uint64 p); - - /// First, converts the normalized floating-point value v into 16-bit integer value. - /// Then, the results are packed into the returned 16-bit unsigned integer. - /// - /// The conversion to fixed point is done as follows: - /// packSnorm1x8: round(clamp(s, -1, +1) * 32767.0) - /// - /// @see gtc_packing - /// @see uint32 packSnorm2x16(vec2 const& v) - /// @see uint64 packSnorm4x16(vec4 const& v) - /// @see GLSL packSnorm4x8 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL uint16 packSnorm1x16(float v); - - /// First, unpacks a single 16-bit unsigned integer p into a single 16-bit signed integers. - /// Then, each component is converted to a normalized floating-point value to generate the returned scalar. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackSnorm1x16: clamp(f / 32767.0, -1, +1) - /// - /// @see gtc_packing - /// @see vec2 unpackSnorm2x16(uint32 p) - /// @see vec4 unpackSnorm4x16(uint64 p) - /// @see GLSL unpackSnorm4x8 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL float unpackSnorm1x16(uint16 p); - - /// First, converts each component of the normalized floating-point value v into 16-bit integer values. - /// Then, the results are packed into the returned 64-bit unsigned integer. - /// - /// The conversion for component c of v to fixed point is done as follows: - /// packSnorm2x8: round(clamp(c, -1, +1) * 32767.0) - /// - /// The first component of the vector will be written to the least significant bits of the output; - /// the last component will be written to the most significant bits. - /// - /// @see gtc_packing - /// @see uint16 packSnorm1x16(float const& v) - /// @see uint32 packSnorm2x16(vec2 const& v) - /// @see GLSL packSnorm4x8 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL uint64 packSnorm4x16(vec4 const& v); - - /// First, unpacks a single 64-bit unsigned integer p into four 16-bit signed integers. - /// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackSnorm4x16: clamp(f / 32767.0, -1, +1) - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see gtc_packing - /// @see float unpackSnorm1x16(uint16 p) - /// @see vec2 unpackSnorm2x16(uint32 p) - /// @see GLSL unpackSnorm4x8 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL vec4 unpackSnorm4x16(uint64 p); - - /// Returns an unsigned integer obtained by converting the components of a floating-point scalar - /// to the 16-bit floating-point representation found in the OpenGL Specification, - /// and then packing this 16-bit value into a 16-bit unsigned integer. - /// - /// @see gtc_packing - /// @see uint32 packHalf2x16(vec2 const& v) - /// @see uint64 packHalf4x16(vec4 const& v) - /// @see GLSL packHalf2x16 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL uint16 packHalf1x16(float v); - - /// Returns a floating-point scalar with components obtained by unpacking a 16-bit unsigned integer into a 16-bit value, - /// interpreted as a 16-bit floating-point number according to the OpenGL Specification, - /// and converting it to 32-bit floating-point values. - /// - /// @see gtc_packing - /// @see vec2 unpackHalf2x16(uint32 const& v) - /// @see vec4 unpackHalf4x16(uint64 const& v) - /// @see GLSL unpackHalf2x16 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL float unpackHalf1x16(uint16 v); - - /// Returns an unsigned integer obtained by converting the components of a four-component floating-point vector - /// to the 16-bit floating-point representation found in the OpenGL Specification, - /// and then packing these four 16-bit values into a 64-bit unsigned integer. - /// The first vector component specifies the 16 least-significant bits of the result; - /// the forth component specifies the 16 most-significant bits. - /// - /// @see gtc_packing - /// @see uint16 packHalf1x16(float const& v) - /// @see uint32 packHalf2x16(vec2 const& v) - /// @see GLSL packHalf2x16 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL uint64 packHalf4x16(vec4 const& v); - - /// Returns a four-component floating-point vector with components obtained by unpacking a 64-bit unsigned integer into four 16-bit values, - /// interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification, - /// and converting them to 32-bit floating-point values. - /// The first component of the vector is obtained from the 16 least-significant bits of v; - /// the forth component is obtained from the 16 most-significant bits of v. - /// - /// @see gtc_packing - /// @see float unpackHalf1x16(uint16 const& v) - /// @see vec2 unpackHalf2x16(uint32 const& v) - /// @see GLSL unpackHalf2x16 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL vec4 unpackHalf4x16(uint64 p); - - /// Returns an unsigned integer obtained by converting the components of a four-component signed integer vector - /// to the 10-10-10-2-bit signed integer representation found in the OpenGL Specification, - /// and then packing these four values into a 32-bit unsigned integer. - /// The first vector component specifies the 10 least-significant bits of the result; - /// the forth component specifies the 2 most-significant bits. - /// - /// @see gtc_packing - /// @see uint32 packI3x10_1x2(uvec4 const& v) - /// @see uint32 packSnorm3x10_1x2(vec4 const& v) - /// @see uint32 packUnorm3x10_1x2(vec4 const& v) - /// @see ivec4 unpackI3x10_1x2(uint32 const& p) - GLM_FUNC_DECL uint32 packI3x10_1x2(ivec4 const& v); - - /// Unpacks a single 32-bit unsigned integer p into three 10-bit and one 2-bit signed integers. - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see gtc_packing - /// @see uint32 packU3x10_1x2(uvec4 const& v) - /// @see vec4 unpackSnorm3x10_1x2(uint32 const& p); - /// @see uvec4 unpackI3x10_1x2(uint32 const& p); - GLM_FUNC_DECL ivec4 unpackI3x10_1x2(uint32 p); - - /// Returns an unsigned integer obtained by converting the components of a four-component unsigned integer vector - /// to the 10-10-10-2-bit unsigned integer representation found in the OpenGL Specification, - /// and then packing these four values into a 32-bit unsigned integer. - /// The first vector component specifies the 10 least-significant bits of the result; - /// the forth component specifies the 2 most-significant bits. - /// - /// @see gtc_packing - /// @see uint32 packI3x10_1x2(ivec4 const& v) - /// @see uint32 packSnorm3x10_1x2(vec4 const& v) - /// @see uint32 packUnorm3x10_1x2(vec4 const& v) - /// @see ivec4 unpackU3x10_1x2(uint32 const& p) - GLM_FUNC_DECL uint32 packU3x10_1x2(uvec4 const& v); - - /// Unpacks a single 32-bit unsigned integer p into three 10-bit and one 2-bit unsigned integers. - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see gtc_packing - /// @see uint32 packU3x10_1x2(uvec4 const& v) - /// @see vec4 unpackSnorm3x10_1x2(uint32 const& p); - /// @see uvec4 unpackI3x10_1x2(uint32 const& p); - GLM_FUNC_DECL uvec4 unpackU3x10_1x2(uint32 p); - - /// First, converts the first three components of the normalized floating-point value v into 10-bit signed integer values. - /// Then, converts the forth component of the normalized floating-point value v into 2-bit signed integer values. - /// Then, the results are packed into the returned 32-bit unsigned integer. - /// - /// The conversion for component c of v to fixed point is done as follows: - /// packSnorm3x10_1x2(xyz): round(clamp(c, -1, +1) * 511.0) - /// packSnorm3x10_1x2(w): round(clamp(c, -1, +1) * 1.0) - /// - /// The first vector component specifies the 10 least-significant bits of the result; - /// the forth component specifies the 2 most-significant bits. - /// - /// @see gtc_packing - /// @see vec4 unpackSnorm3x10_1x2(uint32 const& p) - /// @see uint32 packUnorm3x10_1x2(vec4 const& v) - /// @see uint32 packU3x10_1x2(uvec4 const& v) - /// @see uint32 packI3x10_1x2(ivec4 const& v) - GLM_FUNC_DECL uint32 packSnorm3x10_1x2(vec4 const& v); - - /// First, unpacks a single 32-bit unsigned integer p into four 16-bit signed integers. - /// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackSnorm3x10_1x2(xyz): clamp(f / 511.0, -1, +1) - /// unpackSnorm3x10_1x2(w): clamp(f / 511.0, -1, +1) - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see gtc_packing - /// @see uint32 packSnorm3x10_1x2(vec4 const& v) - /// @see vec4 unpackUnorm3x10_1x2(uint32 const& p)) - /// @see uvec4 unpackI3x10_1x2(uint32 const& p) - /// @see uvec4 unpackU3x10_1x2(uint32 const& p) - GLM_FUNC_DECL vec4 unpackSnorm3x10_1x2(uint32 p); - - /// First, converts the first three components of the normalized floating-point value v into 10-bit unsigned integer values. - /// Then, converts the forth component of the normalized floating-point value v into 2-bit signed uninteger values. - /// Then, the results are packed into the returned 32-bit unsigned integer. - /// - /// The conversion for component c of v to fixed point is done as follows: - /// packUnorm3x10_1x2(xyz): round(clamp(c, 0, +1) * 1023.0) - /// packUnorm3x10_1x2(w): round(clamp(c, 0, +1) * 3.0) - /// - /// The first vector component specifies the 10 least-significant bits of the result; - /// the forth component specifies the 2 most-significant bits. - /// - /// @see gtc_packing - /// @see vec4 unpackUnorm3x10_1x2(uint32 const& p) - /// @see uint32 packUnorm3x10_1x2(vec4 const& v) - /// @see uint32 packU3x10_1x2(uvec4 const& v) - /// @see uint32 packI3x10_1x2(ivec4 const& v) - GLM_FUNC_DECL uint32 packUnorm3x10_1x2(vec4 const& v); - - /// First, unpacks a single 32-bit unsigned integer p into four 16-bit signed integers. - /// Then, each component is converted to a normalized floating-point value to generate the returned four-component vector. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackSnorm3x10_1x2(xyz): clamp(f / 1023.0, 0, +1) - /// unpackSnorm3x10_1x2(w): clamp(f / 3.0, 0, +1) - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see gtc_packing - /// @see uint32 packSnorm3x10_1x2(vec4 const& v) - /// @see vec4 unpackInorm3x10_1x2(uint32 const& p)) - /// @see uvec4 unpackI3x10_1x2(uint32 const& p) - /// @see uvec4 unpackU3x10_1x2(uint32 const& p) - GLM_FUNC_DECL vec4 unpackUnorm3x10_1x2(uint32 p); - - /// First, converts the first two components of the normalized floating-point value v into 11-bit signless floating-point values. - /// Then, converts the third component of the normalized floating-point value v into a 10-bit signless floating-point value. - /// Then, the results are packed into the returned 32-bit unsigned integer. - /// - /// The first vector component specifies the 11 least-significant bits of the result; - /// the last component specifies the 10 most-significant bits. - /// - /// @see gtc_packing - /// @see vec3 unpackF2x11_1x10(uint32 const& p) - GLM_FUNC_DECL uint32 packF2x11_1x10(vec3 const& v); - - /// First, unpacks a single 32-bit unsigned integer p into two 11-bit signless floating-point values and one 10-bit signless floating-point value . - /// Then, each component is converted to a normalized floating-point value to generate the returned three-component vector. - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see gtc_packing - /// @see uint32 packF2x11_1x10(vec3 const& v) - GLM_FUNC_DECL vec3 unpackF2x11_1x10(uint32 p); - - - /// First, converts the first two components of the normalized floating-point value v into 11-bit signless floating-point values. - /// Then, converts the third component of the normalized floating-point value v into a 10-bit signless floating-point value. - /// Then, the results are packed into the returned 32-bit unsigned integer. - /// - /// The first vector component specifies the 11 least-significant bits of the result; - /// the last component specifies the 10 most-significant bits. - /// - /// packF3x9_E1x5 allows encoding into RGBE / RGB9E5 format - /// - /// @see gtc_packing - /// @see vec3 unpackF3x9_E1x5(uint32 const& p) - GLM_FUNC_DECL uint32 packF3x9_E1x5(vec3 const& v); - - /// First, unpacks a single 32-bit unsigned integer p into two 11-bit signless floating-point values and one 10-bit signless floating-point value . - /// Then, each component is converted to a normalized floating-point value to generate the returned three-component vector. - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// unpackF3x9_E1x5 allows decoding RGBE / RGB9E5 data - /// - /// @see gtc_packing - /// @see uint32 packF3x9_E1x5(vec3 const& v) - GLM_FUNC_DECL vec3 unpackF3x9_E1x5(uint32 p); - - /// Returns an unsigned integer vector obtained by converting the components of a floating-point vector - /// to the 16-bit floating-point representation found in the OpenGL Specification. - /// The first vector component specifies the 16 least-significant bits of the result; - /// the forth component specifies the 16 most-significant bits. - /// - /// @see gtc_packing - /// @see vec<3, T, Q> unpackRGBM(vec<4, T, Q> const& p) - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - template - GLM_FUNC_DECL vec<4, T, Q> packRGBM(vec<3, T, Q> const& rgb); - - /// Returns a floating-point vector with components obtained by reinterpreting an integer vector as 16-bit floating-point numbers and converting them to 32-bit floating-point values. - /// The first component of the vector is obtained from the 16 least-significant bits of v; - /// the forth component is obtained from the 16 most-significant bits of v. - /// - /// @see gtc_packing - /// @see vec<4, T, Q> packRGBM(vec<3, float, Q> const& v) - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - template - GLM_FUNC_DECL vec<3, T, Q> unpackRGBM(vec<4, T, Q> const& rgbm); - - /// Returns an unsigned integer vector obtained by converting the components of a floating-point vector - /// to the 16-bit floating-point representation found in the OpenGL Specification. - /// The first vector component specifies the 16 least-significant bits of the result; - /// the forth component specifies the 16 most-significant bits. - /// - /// @see gtc_packing - /// @see vec unpackHalf(vec const& p) - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - template - GLM_FUNC_DECL vec packHalf(vec const& v); - - /// Returns a floating-point vector with components obtained by reinterpreting an integer vector as 16-bit floating-point numbers and converting them to 32-bit floating-point values. - /// The first component of the vector is obtained from the 16 least-significant bits of v; - /// the forth component is obtained from the 16 most-significant bits of v. - /// - /// @see gtc_packing - /// @see vec packHalf(vec const& v) - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - template - GLM_FUNC_DECL vec unpackHalf(vec const& p); - - /// Convert each component of the normalized floating-point vector into unsigned integer values. - /// - /// @see gtc_packing - /// @see vec unpackUnorm(vec const& p); - template - GLM_FUNC_DECL vec packUnorm(vec const& v); - - /// Convert a packed integer to a normalized floating-point vector. - /// - /// @see gtc_packing - /// @see vec packUnorm(vec const& v) - template - GLM_FUNC_DECL vec unpackUnorm(vec const& v); - - /// Convert each component of the normalized floating-point vector into signed integer values. - /// - /// @see gtc_packing - /// @see vec unpackSnorm(vec const& p); - template - GLM_FUNC_DECL vec packSnorm(vec const& v); - - /// Convert a packed integer to a normalized floating-point vector. - /// - /// @see gtc_packing - /// @see vec packSnorm(vec const& v) - template - GLM_FUNC_DECL vec unpackSnorm(vec const& v); - - /// Convert each component of the normalized floating-point vector into unsigned integer values. - /// - /// @see gtc_packing - /// @see vec2 unpackUnorm2x4(uint8 p) - GLM_FUNC_DECL uint8 packUnorm2x4(vec2 const& v); - - /// Convert a packed integer to a normalized floating-point vector. - /// - /// @see gtc_packing - /// @see uint8 packUnorm2x4(vec2 const& v) - GLM_FUNC_DECL vec2 unpackUnorm2x4(uint8 p); - - /// Convert each component of the normalized floating-point vector into unsigned integer values. - /// - /// @see gtc_packing - /// @see vec4 unpackUnorm4x4(uint16 p) - GLM_FUNC_DECL uint16 packUnorm4x4(vec4 const& v); - - /// Convert a packed integer to a normalized floating-point vector. - /// - /// @see gtc_packing - /// @see uint16 packUnorm4x4(vec4 const& v) - GLM_FUNC_DECL vec4 unpackUnorm4x4(uint16 p); - - /// Convert each component of the normalized floating-point vector into unsigned integer values. - /// - /// @see gtc_packing - /// @see vec3 unpackUnorm1x5_1x6_1x5(uint16 p) - GLM_FUNC_DECL uint16 packUnorm1x5_1x6_1x5(vec3 const& v); - - /// Convert a packed integer to a normalized floating-point vector. - /// - /// @see gtc_packing - /// @see uint16 packUnorm1x5_1x6_1x5(vec3 const& v) - GLM_FUNC_DECL vec3 unpackUnorm1x5_1x6_1x5(uint16 p); - - /// Convert each component of the normalized floating-point vector into unsigned integer values. - /// - /// @see gtc_packing - /// @see vec4 unpackUnorm3x5_1x1(uint16 p) - GLM_FUNC_DECL uint16 packUnorm3x5_1x1(vec4 const& v); - - /// Convert a packed integer to a normalized floating-point vector. - /// - /// @see gtc_packing - /// @see uint16 packUnorm3x5_1x1(vec4 const& v) - GLM_FUNC_DECL vec4 unpackUnorm3x5_1x1(uint16 p); - - /// Convert each component of the normalized floating-point vector into unsigned integer values. - /// - /// @see gtc_packing - /// @see vec3 unpackUnorm2x3_1x2(uint8 p) - GLM_FUNC_DECL uint8 packUnorm2x3_1x2(vec3 const& v); - - /// Convert a packed integer to a normalized floating-point vector. - /// - /// @see gtc_packing - /// @see uint8 packUnorm2x3_1x2(vec3 const& v) - GLM_FUNC_DECL vec3 unpackUnorm2x3_1x2(uint8 p); - - - - /// Convert each component from an integer vector into a packed integer. - /// - /// @see gtc_packing - /// @see i8vec2 unpackInt2x8(int16 p) - GLM_FUNC_DECL int16 packInt2x8(i8vec2 const& v); - - /// Convert a packed integer into an integer vector. - /// - /// @see gtc_packing - /// @see int16 packInt2x8(i8vec2 const& v) - GLM_FUNC_DECL i8vec2 unpackInt2x8(int16 p); - - /// Convert each component from an integer vector into a packed unsigned integer. - /// - /// @see gtc_packing - /// @see u8vec2 unpackInt2x8(uint16 p) - GLM_FUNC_DECL uint16 packUint2x8(u8vec2 const& v); - - /// Convert a packed integer into an integer vector. - /// - /// @see gtc_packing - /// @see uint16 packInt2x8(u8vec2 const& v) - GLM_FUNC_DECL u8vec2 unpackUint2x8(uint16 p); - - /// Convert each component from an integer vector into a packed integer. - /// - /// @see gtc_packing - /// @see i8vec4 unpackInt4x8(int32 p) - GLM_FUNC_DECL int32 packInt4x8(i8vec4 const& v); - - /// Convert a packed integer into an integer vector. - /// - /// @see gtc_packing - /// @see int32 packInt2x8(i8vec4 const& v) - GLM_FUNC_DECL i8vec4 unpackInt4x8(int32 p); - - /// Convert each component from an integer vector into a packed unsigned integer. - /// - /// @see gtc_packing - /// @see u8vec4 unpackUint4x8(uint32 p) - GLM_FUNC_DECL uint32 packUint4x8(u8vec4 const& v); - - /// Convert a packed integer into an integer vector. - /// - /// @see gtc_packing - /// @see uint32 packUint4x8(u8vec2 const& v) - GLM_FUNC_DECL u8vec4 unpackUint4x8(uint32 p); - - /// Convert each component from an integer vector into a packed integer. - /// - /// @see gtc_packing - /// @see i16vec2 unpackInt2x16(int p) - GLM_FUNC_DECL int packInt2x16(i16vec2 const& v); - - /// Convert a packed integer into an integer vector. - /// - /// @see gtc_packing - /// @see int packInt2x16(i16vec2 const& v) - GLM_FUNC_DECL i16vec2 unpackInt2x16(int p); - - /// Convert each component from an integer vector into a packed integer. - /// - /// @see gtc_packing - /// @see i16vec4 unpackInt4x16(int64 p) - GLM_FUNC_DECL int64 packInt4x16(i16vec4 const& v); - - /// Convert a packed integer into an integer vector. - /// - /// @see gtc_packing - /// @see int64 packInt4x16(i16vec4 const& v) - GLM_FUNC_DECL i16vec4 unpackInt4x16(int64 p); - - /// Convert each component from an integer vector into a packed unsigned integer. - /// - /// @see gtc_packing - /// @see u16vec2 unpackUint2x16(uint p) - GLM_FUNC_DECL uint packUint2x16(u16vec2 const& v); - - /// Convert a packed integer into an integer vector. - /// - /// @see gtc_packing - /// @see uint packUint2x16(u16vec2 const& v) - GLM_FUNC_DECL u16vec2 unpackUint2x16(uint p); - - /// Convert each component from an integer vector into a packed unsigned integer. - /// - /// @see gtc_packing - /// @see u16vec4 unpackUint4x16(uint64 p) - GLM_FUNC_DECL uint64 packUint4x16(u16vec4 const& v); - - /// Convert a packed integer into an integer vector. - /// - /// @see gtc_packing - /// @see uint64 packUint4x16(u16vec4 const& v) - GLM_FUNC_DECL u16vec4 unpackUint4x16(uint64 p); - - /// Convert each component from an integer vector into a packed integer. - /// - /// @see gtc_packing - /// @see i32vec2 unpackInt2x32(int p) - GLM_FUNC_DECL int64 packInt2x32(i32vec2 const& v); - - /// Convert a packed integer into an integer vector. - /// - /// @see gtc_packing - /// @see int packInt2x16(i32vec2 const& v) - GLM_FUNC_DECL i32vec2 unpackInt2x32(int64 p); - - /// Convert each component from an integer vector into a packed unsigned integer. - /// - /// @see gtc_packing - /// @see u32vec2 unpackUint2x32(int p) - GLM_FUNC_DECL uint64 packUint2x32(u32vec2 const& v); - - /// Convert a packed integer into an integer vector. - /// - /// @see gtc_packing - /// @see int packUint2x16(u32vec2 const& v) - GLM_FUNC_DECL u32vec2 unpackUint2x32(uint64 p); - - /// @} -}// namespace glm - -#include "packing.inl" diff --git a/3rdparty/glm/source/glm/gtc/packing.inl b/3rdparty/glm/source/glm/gtc/packing.inl deleted file mode 100644 index 84ad60c..0000000 --- a/3rdparty/glm/source/glm/gtc/packing.inl +++ /dev/null @@ -1,938 +0,0 @@ -/// @ref gtc_packing - -#include "../ext/scalar_relational.hpp" -#include "../ext/vector_relational.hpp" -#include "../common.hpp" -#include "../vec2.hpp" -#include "../vec3.hpp" -#include "../vec4.hpp" -#include "../detail/type_half.hpp" -#include -#include - -namespace glm{ -namespace detail -{ - GLM_FUNC_QUALIFIER glm::uint16 float2half(glm::uint32 f) - { - // 10 bits => EE EEEFFFFF - // 11 bits => EEE EEFFFFFF - // Half bits => SEEEEEFF FFFFFFFF - // Float bits => SEEEEEEE EFFFFFFF FFFFFFFF FFFFFFFF - - // 0x00007c00 => 00000000 00000000 01111100 00000000 - // 0x000003ff => 00000000 00000000 00000011 11111111 - // 0x38000000 => 00111000 00000000 00000000 00000000 - // 0x7f800000 => 01111111 10000000 00000000 00000000 - // 0x00008000 => 00000000 00000000 10000000 00000000 - return - ((f >> 16) & 0x8000) | // sign - ((((f & 0x7f800000) - 0x38000000) >> 13) & 0x7c00) | // exponential - ((f >> 13) & 0x03ff); // Mantissa - } - - GLM_FUNC_QUALIFIER glm::uint32 float2packed11(glm::uint32 f) - { - // 10 bits => EE EEEFFFFF - // 11 bits => EEE EEFFFFFF - // Half bits => SEEEEEFF FFFFFFFF - // Float bits => SEEEEEEE EFFFFFFF FFFFFFFF FFFFFFFF - - // 0x000007c0 => 00000000 00000000 00000111 11000000 - // 0x00007c00 => 00000000 00000000 01111100 00000000 - // 0x000003ff => 00000000 00000000 00000011 11111111 - // 0x38000000 => 00111000 00000000 00000000 00000000 - // 0x7f800000 => 01111111 10000000 00000000 00000000 - // 0x00008000 => 00000000 00000000 10000000 00000000 - return - ((((f & 0x7f800000) - 0x38000000) >> 17) & 0x07c0) | // exponential - ((f >> 17) & 0x003f); // Mantissa - } - - GLM_FUNC_QUALIFIER glm::uint32 packed11ToFloat(glm::uint32 p) - { - // 10 bits => EE EEEFFFFF - // 11 bits => EEE EEFFFFFF - // Half bits => SEEEEEFF FFFFFFFF - // Float bits => SEEEEEEE EFFFFFFF FFFFFFFF FFFFFFFF - - // 0x000007c0 => 00000000 00000000 00000111 11000000 - // 0x00007c00 => 00000000 00000000 01111100 00000000 - // 0x000003ff => 00000000 00000000 00000011 11111111 - // 0x38000000 => 00111000 00000000 00000000 00000000 - // 0x7f800000 => 01111111 10000000 00000000 00000000 - // 0x00008000 => 00000000 00000000 10000000 00000000 - return - ((((p & 0x07c0) << 17) + 0x38000000) & 0x7f800000) | // exponential - ((p & 0x003f) << 17); // Mantissa - } - - GLM_FUNC_QUALIFIER glm::uint32 float2packed10(glm::uint32 f) - { - // 10 bits => EE EEEFFFFF - // 11 bits => EEE EEFFFFFF - // Half bits => SEEEEEFF FFFFFFFF - // Float bits => SEEEEEEE EFFFFFFF FFFFFFFF FFFFFFFF - - // 0x0000001F => 00000000 00000000 00000000 00011111 - // 0x0000003F => 00000000 00000000 00000000 00111111 - // 0x000003E0 => 00000000 00000000 00000011 11100000 - // 0x000007C0 => 00000000 00000000 00000111 11000000 - // 0x00007C00 => 00000000 00000000 01111100 00000000 - // 0x000003FF => 00000000 00000000 00000011 11111111 - // 0x38000000 => 00111000 00000000 00000000 00000000 - // 0x7f800000 => 01111111 10000000 00000000 00000000 - // 0x00008000 => 00000000 00000000 10000000 00000000 - return - ((((f & 0x7f800000) - 0x38000000) >> 18) & 0x03E0) | // exponential - ((f >> 18) & 0x001f); // Mantissa - } - - GLM_FUNC_QUALIFIER glm::uint32 packed10ToFloat(glm::uint32 p) - { - // 10 bits => EE EEEFFFFF - // 11 bits => EEE EEFFFFFF - // Half bits => SEEEEEFF FFFFFFFF - // Float bits => SEEEEEEE EFFFFFFF FFFFFFFF FFFFFFFF - - // 0x0000001F => 00000000 00000000 00000000 00011111 - // 0x0000003F => 00000000 00000000 00000000 00111111 - // 0x000003E0 => 00000000 00000000 00000011 11100000 - // 0x000007C0 => 00000000 00000000 00000111 11000000 - // 0x00007C00 => 00000000 00000000 01111100 00000000 - // 0x000003FF => 00000000 00000000 00000011 11111111 - // 0x38000000 => 00111000 00000000 00000000 00000000 - // 0x7f800000 => 01111111 10000000 00000000 00000000 - // 0x00008000 => 00000000 00000000 10000000 00000000 - return - ((((p & 0x03E0) << 18) + 0x38000000) & 0x7f800000) | // exponential - ((p & 0x001f) << 18); // Mantissa - } - - GLM_FUNC_QUALIFIER glm::uint half2float(glm::uint h) - { - return ((h & 0x8000) << 16) | ((( h & 0x7c00) + 0x1C000) << 13) | ((h & 0x03FF) << 13); - } - - GLM_FUNC_QUALIFIER glm::uint floatTo11bit(float x) - { - if(x == 0.0f) - return 0u; - else if(glm::isnan(x)) - return ~0u; - else if(glm::isinf(x)) - return 0x1Fu << 6u; - - uint Pack = 0u; - memcpy(&Pack, &x, sizeof(Pack)); - return float2packed11(Pack); - } - - GLM_FUNC_QUALIFIER float packed11bitToFloat(glm::uint x) - { - if(x == 0) - return 0.0f; - else if(x == ((1 << 11) - 1)) - return ~0;//NaN - else if(x == (0x1f << 6)) - return ~0;//Inf - - uint Result = packed11ToFloat(x); - - float Temp = 0; - memcpy(&Temp, &Result, sizeof(Temp)); - return Temp; - } - - GLM_FUNC_QUALIFIER glm::uint floatTo10bit(float x) - { - if(x == 0.0f) - return 0u; - else if(glm::isnan(x)) - return ~0u; - else if(glm::isinf(x)) - return 0x1Fu << 5u; - - uint Pack = 0; - memcpy(&Pack, &x, sizeof(Pack)); - return float2packed10(Pack); - } - - GLM_FUNC_QUALIFIER float packed10bitToFloat(glm::uint x) - { - if(x == 0) - return 0.0f; - else if(x == ((1 << 10) - 1)) - return ~0;//NaN - else if(x == (0x1f << 5)) - return ~0;//Inf - - uint Result = packed10ToFloat(x); - - float Temp = 0; - memcpy(&Temp, &Result, sizeof(Temp)); - return Temp; - } - -// GLM_FUNC_QUALIFIER glm::uint f11_f11_f10(float x, float y, float z) -// { -// return ((floatTo11bit(x) & ((1 << 11) - 1)) << 0) | ((floatTo11bit(y) & ((1 << 11) - 1)) << 11) | ((floatTo10bit(z) & ((1 << 10) - 1)) << 22); -// } - - union u3u3u2 - { - struct - { - uint x : 3; - uint y : 3; - uint z : 2; - } data; - uint8 pack; - }; - - union u4u4 - { - struct - { - uint x : 4; - uint y : 4; - } data; - uint8 pack; - }; - - union u4u4u4u4 - { - struct - { - uint x : 4; - uint y : 4; - uint z : 4; - uint w : 4; - } data; - uint16 pack; - }; - - union u5u6u5 - { - struct - { - uint x : 5; - uint y : 6; - uint z : 5; - } data; - uint16 pack; - }; - - union u5u5u5u1 - { - struct - { - uint x : 5; - uint y : 5; - uint z : 5; - uint w : 1; - } data; - uint16 pack; - }; - - union u10u10u10u2 - { - struct - { - uint x : 10; - uint y : 10; - uint z : 10; - uint w : 2; - } data; - uint32 pack; - }; - - union i10i10i10i2 - { - struct - { - int x : 10; - int y : 10; - int z : 10; - int w : 2; - } data; - uint32 pack; - }; - - union u9u9u9e5 - { - struct - { - uint x : 9; - uint y : 9; - uint z : 9; - uint w : 5; - } data; - uint32 pack; - }; - - template - struct compute_half - {}; - - template - struct compute_half<1, Q> - { - GLM_FUNC_QUALIFIER static vec<1, uint16, Q> pack(vec<1, float, Q> const& v) - { - int16 const Unpack(detail::toFloat16(v.x)); - u16vec1 Packed; - memcpy(&Packed, &Unpack, sizeof(Packed)); - return Packed; - } - - GLM_FUNC_QUALIFIER static vec<1, float, Q> unpack(vec<1, uint16, Q> const& v) - { - i16vec1 Unpack; - memcpy(&Unpack, &v, sizeof(Unpack)); - return vec<1, float, Q>(detail::toFloat32(v.x)); - } - }; - - template - struct compute_half<2, Q> - { - GLM_FUNC_QUALIFIER static vec<2, uint16, Q> pack(vec<2, float, Q> const& v) - { - vec<2, int16, Q> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y)); - u16vec2 Packed; - memcpy(&Packed, &Unpack, sizeof(Packed)); - return Packed; - } - - GLM_FUNC_QUALIFIER static vec<2, float, Q> unpack(vec<2, uint16, Q> const& v) - { - i16vec2 Unpack; - memcpy(&Unpack, &v, sizeof(Unpack)); - return vec<2, float, Q>(detail::toFloat32(v.x), detail::toFloat32(v.y)); - } - }; - - template - struct compute_half<3, Q> - { - GLM_FUNC_QUALIFIER static vec<3, uint16, Q> pack(vec<3, float, Q> const& v) - { - vec<3, int16, Q> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y), detail::toFloat16(v.z)); - u16vec3 Packed; - memcpy(&Packed, &Unpack, sizeof(Packed)); - return Packed; - } - - GLM_FUNC_QUALIFIER static vec<3, float, Q> unpack(vec<3, uint16, Q> const& v) - { - i16vec3 Unpack; - memcpy(&Unpack, &v, sizeof(Unpack)); - return vec<3, float, Q>(detail::toFloat32(v.x), detail::toFloat32(v.y), detail::toFloat32(v.z)); - } - }; - - template - struct compute_half<4, Q> - { - GLM_FUNC_QUALIFIER static vec<4, uint16, Q> pack(vec<4, float, Q> const& v) - { - vec<4, int16, Q> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y), detail::toFloat16(v.z), detail::toFloat16(v.w)); - u16vec4 Packed; - memcpy(&Packed, &Unpack, sizeof(Packed)); - return Packed; - } - - GLM_FUNC_QUALIFIER static vec<4, float, Q> unpack(vec<4, uint16, Q> const& v) - { - i16vec4 Unpack; - memcpy(&Unpack, &v, sizeof(Unpack)); - return vec<4, float, Q>(detail::toFloat32(v.x), detail::toFloat32(v.y), detail::toFloat32(v.z), detail::toFloat32(v.w)); - } - }; -}//namespace detail - - GLM_FUNC_QUALIFIER uint8 packUnorm1x8(float v) - { - return static_cast(round(clamp(v, 0.0f, 1.0f) * 255.0f)); - } - - GLM_FUNC_QUALIFIER float unpackUnorm1x8(uint8 p) - { - float const Unpack(p); - return Unpack * static_cast(0.0039215686274509803921568627451); // 1 / 255 - } - - GLM_FUNC_QUALIFIER uint16 packUnorm2x8(vec2 const& v) - { - u8vec2 const Topack(round(clamp(v, 0.0f, 1.0f) * 255.0f)); - - uint16 Unpack = 0; - memcpy(&Unpack, &Topack, sizeof(Unpack)); - return Unpack; - } - - GLM_FUNC_QUALIFIER vec2 unpackUnorm2x8(uint16 p) - { - u8vec2 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); - return vec2(Unpack) * float(0.0039215686274509803921568627451); // 1 / 255 - } - - GLM_FUNC_QUALIFIER uint8 packSnorm1x8(float v) - { - int8 const Topack(static_cast(round(clamp(v ,-1.0f, 1.0f) * 127.0f))); - uint8 Packed = 0; - memcpy(&Packed, &Topack, sizeof(Packed)); - return Packed; - } - - GLM_FUNC_QUALIFIER float unpackSnorm1x8(uint8 p) - { - int8 Unpack = 0; - memcpy(&Unpack, &p, sizeof(Unpack)); - return clamp( - static_cast(Unpack) * 0.00787401574803149606299212598425f, // 1.0f / 127.0f - -1.0f, 1.0f); - } - - GLM_FUNC_QUALIFIER uint16 packSnorm2x8(vec2 const& v) - { - i8vec2 const Topack(round(clamp(v, -1.0f, 1.0f) * 127.0f)); - uint16 Packed = 0; - memcpy(&Packed, &Topack, sizeof(Packed)); - return Packed; - } - - GLM_FUNC_QUALIFIER vec2 unpackSnorm2x8(uint16 p) - { - i8vec2 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); - return clamp( - vec2(Unpack) * 0.00787401574803149606299212598425f, // 1.0f / 127.0f - -1.0f, 1.0f); - } - - GLM_FUNC_QUALIFIER uint16 packUnorm1x16(float s) - { - return static_cast(round(clamp(s, 0.0f, 1.0f) * 65535.0f)); - } - - GLM_FUNC_QUALIFIER float unpackUnorm1x16(uint16 p) - { - float const Unpack(p); - return Unpack * 1.5259021896696421759365224689097e-5f; // 1.0 / 65535.0 - } - - GLM_FUNC_QUALIFIER uint64 packUnorm4x16(vec4 const& v) - { - u16vec4 const Topack(round(clamp(v , 0.0f, 1.0f) * 65535.0f)); - uint64 Packed = 0; - memcpy(&Packed, &Topack, sizeof(Packed)); - return Packed; - } - - GLM_FUNC_QUALIFIER vec4 unpackUnorm4x16(uint64 p) - { - u16vec4 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); - return vec4(Unpack) * 1.5259021896696421759365224689097e-5f; // 1.0 / 65535.0 - } - - GLM_FUNC_QUALIFIER uint16 packSnorm1x16(float v) - { - int16 const Topack = static_cast(round(clamp(v ,-1.0f, 1.0f) * 32767.0f)); - uint16 Packed = 0; - memcpy(&Packed, &Topack, sizeof(Packed)); - return Packed; - } - - GLM_FUNC_QUALIFIER float unpackSnorm1x16(uint16 p) - { - int16 Unpack = 0; - memcpy(&Unpack, &p, sizeof(Unpack)); - return clamp( - static_cast(Unpack) * 3.0518509475997192297128208258309e-5f, //1.0f / 32767.0f, - -1.0f, 1.0f); - } - - GLM_FUNC_QUALIFIER uint64 packSnorm4x16(vec4 const& v) - { - i16vec4 const Topack(round(clamp(v ,-1.0f, 1.0f) * 32767.0f)); - uint64 Packed = 0; - memcpy(&Packed, &Topack, sizeof(Packed)); - return Packed; - } - - GLM_FUNC_QUALIFIER vec4 unpackSnorm4x16(uint64 p) - { - i16vec4 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); - return clamp( - vec4(Unpack) * 3.0518509475997192297128208258309e-5f, //1.0f / 32767.0f, - -1.0f, 1.0f); - } - - GLM_FUNC_QUALIFIER uint16 packHalf1x16(float v) - { - int16 const Topack(detail::toFloat16(v)); - uint16 Packed = 0; - memcpy(&Packed, &Topack, sizeof(Packed)); - return Packed; - } - - GLM_FUNC_QUALIFIER float unpackHalf1x16(uint16 v) - { - int16 Unpack = 0; - memcpy(&Unpack, &v, sizeof(Unpack)); - return detail::toFloat32(Unpack); - } - - GLM_FUNC_QUALIFIER uint64 packHalf4x16(glm::vec4 const& v) - { - i16vec4 const Unpack( - detail::toFloat16(v.x), - detail::toFloat16(v.y), - detail::toFloat16(v.z), - detail::toFloat16(v.w)); - uint64 Packed = 0; - memcpy(&Packed, &Unpack, sizeof(Packed)); - return Packed; - } - - GLM_FUNC_QUALIFIER glm::vec4 unpackHalf4x16(uint64 v) - { - i16vec4 Unpack; - memcpy(&Unpack, &v, sizeof(Unpack)); - return vec4( - detail::toFloat32(Unpack.x), - detail::toFloat32(Unpack.y), - detail::toFloat32(Unpack.z), - detail::toFloat32(Unpack.w)); - } - - GLM_FUNC_QUALIFIER uint32 packI3x10_1x2(ivec4 const& v) - { - detail::i10i10i10i2 Result; - Result.data.x = v.x; - Result.data.y = v.y; - Result.data.z = v.z; - Result.data.w = v.w; - return Result.pack; - } - - GLM_FUNC_QUALIFIER ivec4 unpackI3x10_1x2(uint32 v) - { - detail::i10i10i10i2 Unpack; - Unpack.pack = v; - return ivec4( - Unpack.data.x, - Unpack.data.y, - Unpack.data.z, - Unpack.data.w); - } - - GLM_FUNC_QUALIFIER uint32 packU3x10_1x2(uvec4 const& v) - { - detail::u10u10u10u2 Result; - Result.data.x = v.x; - Result.data.y = v.y; - Result.data.z = v.z; - Result.data.w = v.w; - return Result.pack; - } - - GLM_FUNC_QUALIFIER uvec4 unpackU3x10_1x2(uint32 v) - { - detail::u10u10u10u2 Unpack; - Unpack.pack = v; - return uvec4( - Unpack.data.x, - Unpack.data.y, - Unpack.data.z, - Unpack.data.w); - } - - GLM_FUNC_QUALIFIER uint32 packSnorm3x10_1x2(vec4 const& v) - { - ivec4 const Pack(round(clamp(v,-1.0f, 1.0f) * vec4(511.f, 511.f, 511.f, 1.f))); - - detail::i10i10i10i2 Result; - Result.data.x = Pack.x; - Result.data.y = Pack.y; - Result.data.z = Pack.z; - Result.data.w = Pack.w; - return Result.pack; - } - - GLM_FUNC_QUALIFIER vec4 unpackSnorm3x10_1x2(uint32 v) - { - detail::i10i10i10i2 Unpack; - Unpack.pack = v; - - vec4 const Result(Unpack.data.x, Unpack.data.y, Unpack.data.z, Unpack.data.w); - - return clamp(Result * vec4(1.f / 511.f, 1.f / 511.f, 1.f / 511.f, 1.f), -1.0f, 1.0f); - } - - GLM_FUNC_QUALIFIER uint32 packUnorm3x10_1x2(vec4 const& v) - { - uvec4 const Unpack(round(clamp(v, 0.0f, 1.0f) * vec4(1023.f, 1023.f, 1023.f, 3.f))); - - detail::u10u10u10u2 Result; - Result.data.x = Unpack.x; - Result.data.y = Unpack.y; - Result.data.z = Unpack.z; - Result.data.w = Unpack.w; - return Result.pack; - } - - GLM_FUNC_QUALIFIER vec4 unpackUnorm3x10_1x2(uint32 v) - { - vec4 const ScaleFactors(1.0f / 1023.f, 1.0f / 1023.f, 1.0f / 1023.f, 1.0f / 3.f); - - detail::u10u10u10u2 Unpack; - Unpack.pack = v; - return vec4(Unpack.data.x, Unpack.data.y, Unpack.data.z, Unpack.data.w) * ScaleFactors; - } - - GLM_FUNC_QUALIFIER uint32 packF2x11_1x10(vec3 const& v) - { - return - ((detail::floatTo11bit(v.x) & ((1 << 11) - 1)) << 0) | - ((detail::floatTo11bit(v.y) & ((1 << 11) - 1)) << 11) | - ((detail::floatTo10bit(v.z) & ((1 << 10) - 1)) << 22); - } - - GLM_FUNC_QUALIFIER vec3 unpackF2x11_1x10(uint32 v) - { - return vec3( - detail::packed11bitToFloat(v >> 0), - detail::packed11bitToFloat(v >> 11), - detail::packed10bitToFloat(v >> 22)); - } - - GLM_FUNC_QUALIFIER uint32 packF3x9_E1x5(vec3 const& v) - { - float const SharedExpMax = (pow(2.0f, 9.0f - 1.0f) / pow(2.0f, 9.0f)) * pow(2.0f, 31.f - 15.f); - vec3 const Color = clamp(v, 0.0f, SharedExpMax); - float const MaxColor = max(Color.x, max(Color.y, Color.z)); - - float const ExpSharedP = max(-15.f - 1.f, floor(log2(MaxColor))) + 1.0f + 15.f; - float const MaxShared = floor(MaxColor / pow(2.0f, (ExpSharedP - 15.f - 9.f)) + 0.5f); - float const ExpShared = equal(MaxShared, pow(2.0f, 9.0f), epsilon()) ? ExpSharedP + 1.0f : ExpSharedP; - - uvec3 const ColorComp(floor(Color / pow(2.f, (ExpShared - 15.f - 9.f)) + 0.5f)); - - detail::u9u9u9e5 Unpack; - Unpack.data.x = ColorComp.x; - Unpack.data.y = ColorComp.y; - Unpack.data.z = ColorComp.z; - Unpack.data.w = uint(ExpShared); - return Unpack.pack; - } - - GLM_FUNC_QUALIFIER vec3 unpackF3x9_E1x5(uint32 v) - { - detail::u9u9u9e5 Unpack; - Unpack.pack = v; - - return vec3(Unpack.data.x, Unpack.data.y, Unpack.data.z) * pow(2.0f, Unpack.data.w - 15.f - 9.f); - } - - // Based on Brian Karis http://graphicrants.blogspot.fr/2009/04/rgbm-color-encoding.html - template - GLM_FUNC_QUALIFIER vec<4, T, Q> packRGBM(vec<3, T, Q> const& rgb) - { - vec<3, T, Q> const Color(rgb * static_cast(1.0 / 6.0)); - T Alpha = clamp(max(max(Color.x, Color.y), max(Color.z, static_cast(1e-6))), static_cast(0), static_cast(1)); - Alpha = ceil(Alpha * static_cast(255.0)) / static_cast(255.0); - return vec<4, T, Q>(Color / Alpha, Alpha); - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> unpackRGBM(vec<4, T, Q> const& rgbm) - { - return vec<3, T, Q>(rgbm.x, rgbm.y, rgbm.z) * rgbm.w * static_cast(6); - } - - template - GLM_FUNC_QUALIFIER vec packHalf(vec const& v) - { - return detail::compute_half::pack(v); - } - - template - GLM_FUNC_QUALIFIER vec unpackHalf(vec const& v) - { - return detail::compute_half::unpack(v); - } - - template - GLM_FUNC_QUALIFIER vec packUnorm(vec const& v) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "uintType must be an integer type"); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "floatType must be a floating point type"); - - return vec(round(clamp(v, static_cast(0), static_cast(1)) * static_cast(std::numeric_limits::max()))); - } - - template - GLM_FUNC_QUALIFIER vec unpackUnorm(vec const& v) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "uintType must be an integer type"); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "floatType must be a floating point type"); - - return vec(v) * (static_cast(1) / static_cast(std::numeric_limits::max())); - } - - template - GLM_FUNC_QUALIFIER vec packSnorm(vec const& v) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "uintType must be an integer type"); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "floatType must be a floating point type"); - - return vec(round(clamp(v , static_cast(-1), static_cast(1)) * static_cast(std::numeric_limits::max()))); - } - - template - GLM_FUNC_QUALIFIER vec unpackSnorm(vec const& v) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "uintType must be an integer type"); - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "floatType must be a floating point type"); - - return clamp(vec(v) * (static_cast(1) / static_cast(std::numeric_limits::max())), static_cast(-1), static_cast(1)); - } - - GLM_FUNC_QUALIFIER uint8 packUnorm2x4(vec2 const& v) - { - u32vec2 const Unpack(round(clamp(v, 0.0f, 1.0f) * 15.0f)); - detail::u4u4 Result; - Result.data.x = Unpack.x; - Result.data.y = Unpack.y; - return Result.pack; - } - - GLM_FUNC_QUALIFIER vec2 unpackUnorm2x4(uint8 v) - { - float const ScaleFactor(1.f / 15.f); - detail::u4u4 Unpack; - Unpack.pack = v; - return vec2(Unpack.data.x, Unpack.data.y) * ScaleFactor; - } - - GLM_FUNC_QUALIFIER uint16 packUnorm4x4(vec4 const& v) - { - u32vec4 const Unpack(round(clamp(v, 0.0f, 1.0f) * 15.0f)); - detail::u4u4u4u4 Result; - Result.data.x = Unpack.x; - Result.data.y = Unpack.y; - Result.data.z = Unpack.z; - Result.data.w = Unpack.w; - return Result.pack; - } - - GLM_FUNC_QUALIFIER vec4 unpackUnorm4x4(uint16 v) - { - float const ScaleFactor(1.f / 15.f); - detail::u4u4u4u4 Unpack; - Unpack.pack = v; - return vec4(Unpack.data.x, Unpack.data.y, Unpack.data.z, Unpack.data.w) * ScaleFactor; - } - - GLM_FUNC_QUALIFIER uint16 packUnorm1x5_1x6_1x5(vec3 const& v) - { - u32vec3 const Unpack(round(clamp(v, 0.0f, 1.0f) * vec3(31.f, 63.f, 31.f))); - detail::u5u6u5 Result; - Result.data.x = Unpack.x; - Result.data.y = Unpack.y; - Result.data.z = Unpack.z; - return Result.pack; - } - - GLM_FUNC_QUALIFIER vec3 unpackUnorm1x5_1x6_1x5(uint16 v) - { - vec3 const ScaleFactor(1.f / 31.f, 1.f / 63.f, 1.f / 31.f); - detail::u5u6u5 Unpack; - Unpack.pack = v; - return vec3(Unpack.data.x, Unpack.data.y, Unpack.data.z) * ScaleFactor; - } - - GLM_FUNC_QUALIFIER uint16 packUnorm3x5_1x1(vec4 const& v) - { - u32vec4 const Unpack(round(clamp(v, 0.0f, 1.0f) * vec4(31.f, 31.f, 31.f, 1.f))); - detail::u5u5u5u1 Result; - Result.data.x = Unpack.x; - Result.data.y = Unpack.y; - Result.data.z = Unpack.z; - Result.data.w = Unpack.w; - return Result.pack; - } - - GLM_FUNC_QUALIFIER vec4 unpackUnorm3x5_1x1(uint16 v) - { - vec4 const ScaleFactor(1.f / 31.f, 1.f / 31.f, 1.f / 31.f, 1.f); - detail::u5u5u5u1 Unpack; - Unpack.pack = v; - return vec4(Unpack.data.x, Unpack.data.y, Unpack.data.z, Unpack.data.w) * ScaleFactor; - } - - GLM_FUNC_QUALIFIER uint8 packUnorm2x3_1x2(vec3 const& v) - { - u32vec3 const Unpack(round(clamp(v, 0.0f, 1.0f) * vec3(7.f, 7.f, 3.f))); - detail::u3u3u2 Result; - Result.data.x = Unpack.x; - Result.data.y = Unpack.y; - Result.data.z = Unpack.z; - return Result.pack; - } - - GLM_FUNC_QUALIFIER vec3 unpackUnorm2x3_1x2(uint8 v) - { - vec3 const ScaleFactor(1.f / 7.f, 1.f / 7.f, 1.f / 3.f); - detail::u3u3u2 Unpack; - Unpack.pack = v; - return vec3(Unpack.data.x, Unpack.data.y, Unpack.data.z) * ScaleFactor; - } - - GLM_FUNC_QUALIFIER int16 packInt2x8(i8vec2 const& v) - { - int16 Pack = 0; - memcpy(&Pack, &v, sizeof(Pack)); - return Pack; - } - - GLM_FUNC_QUALIFIER i8vec2 unpackInt2x8(int16 p) - { - i8vec2 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); - return Unpack; - } - - GLM_FUNC_QUALIFIER uint16 packUint2x8(u8vec2 const& v) - { - uint16 Pack = 0; - memcpy(&Pack, &v, sizeof(Pack)); - return Pack; - } - - GLM_FUNC_QUALIFIER u8vec2 unpackUint2x8(uint16 p) - { - u8vec2 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); - return Unpack; - } - - GLM_FUNC_QUALIFIER int32 packInt4x8(i8vec4 const& v) - { - int32 Pack = 0; - memcpy(&Pack, &v, sizeof(Pack)); - return Pack; - } - - GLM_FUNC_QUALIFIER i8vec4 unpackInt4x8(int32 p) - { - i8vec4 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); - return Unpack; - } - - GLM_FUNC_QUALIFIER uint32 packUint4x8(u8vec4 const& v) - { - uint32 Pack = 0; - memcpy(&Pack, &v, sizeof(Pack)); - return Pack; - } - - GLM_FUNC_QUALIFIER u8vec4 unpackUint4x8(uint32 p) - { - u8vec4 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); - return Unpack; - } - - GLM_FUNC_QUALIFIER int packInt2x16(i16vec2 const& v) - { - int Pack = 0; - memcpy(&Pack, &v, sizeof(Pack)); - return Pack; - } - - GLM_FUNC_QUALIFIER i16vec2 unpackInt2x16(int p) - { - i16vec2 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); - return Unpack; - } - - GLM_FUNC_QUALIFIER int64 packInt4x16(i16vec4 const& v) - { - int64 Pack = 0; - memcpy(&Pack, &v, sizeof(Pack)); - return Pack; - } - - GLM_FUNC_QUALIFIER i16vec4 unpackInt4x16(int64 p) - { - i16vec4 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); - return Unpack; - } - - GLM_FUNC_QUALIFIER uint packUint2x16(u16vec2 const& v) - { - uint Pack = 0; - memcpy(&Pack, &v, sizeof(Pack)); - return Pack; - } - - GLM_FUNC_QUALIFIER u16vec2 unpackUint2x16(uint p) - { - u16vec2 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); - return Unpack; - } - - GLM_FUNC_QUALIFIER uint64 packUint4x16(u16vec4 const& v) - { - uint64 Pack = 0; - memcpy(&Pack, &v, sizeof(Pack)); - return Pack; - } - - GLM_FUNC_QUALIFIER u16vec4 unpackUint4x16(uint64 p) - { - u16vec4 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); - return Unpack; - } - - GLM_FUNC_QUALIFIER int64 packInt2x32(i32vec2 const& v) - { - int64 Pack = 0; - memcpy(&Pack, &v, sizeof(Pack)); - return Pack; - } - - GLM_FUNC_QUALIFIER i32vec2 unpackInt2x32(int64 p) - { - i32vec2 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); - return Unpack; - } - - GLM_FUNC_QUALIFIER uint64 packUint2x32(u32vec2 const& v) - { - uint64 Pack = 0; - memcpy(&Pack, &v, sizeof(Pack)); - return Pack; - } - - GLM_FUNC_QUALIFIER u32vec2 unpackUint2x32(uint64 p) - { - u32vec2 Unpack; - memcpy(&Unpack, &p, sizeof(Unpack)); - return Unpack; - } -}//namespace glm - diff --git a/3rdparty/glm/source/glm/gtc/quaternion.hpp b/3rdparty/glm/source/glm/gtc/quaternion.hpp deleted file mode 100644 index 359e072..0000000 --- a/3rdparty/glm/source/glm/gtc/quaternion.hpp +++ /dev/null @@ -1,173 +0,0 @@ -/// @ref gtc_quaternion -/// @file glm/gtc/quaternion.hpp -/// -/// @see core (dependence) -/// @see gtc_constants (dependence) -/// -/// @defgroup gtc_quaternion GLM_GTC_quaternion -/// @ingroup gtc -/// -/// Include to use the features of this extension. -/// -/// Defines a templated quaternion type and several quaternion operations. - -#pragma once - -// Dependency: -#include "../gtc/constants.hpp" -#include "../gtc/matrix_transform.hpp" -#include "../ext/vector_relational.hpp" -#include "../ext/quaternion_common.hpp" -#include "../ext/quaternion_float.hpp" -#include "../ext/quaternion_float_precision.hpp" -#include "../ext/quaternion_double.hpp" -#include "../ext/quaternion_double_precision.hpp" -#include "../ext/quaternion_relational.hpp" -#include "../ext/quaternion_geometric.hpp" -#include "../ext/quaternion_trigonometric.hpp" -#include "../ext/quaternion_transform.hpp" -#include "../detail/type_mat3x3.hpp" -#include "../detail/type_mat4x4.hpp" -#include "../detail/type_vec3.hpp" -#include "../detail/type_vec4.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTC_quaternion extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_quaternion - /// @{ - - /// Returns euler angles, pitch as x, yaw as y, roll as z. - /// The result is expressed in radians. - /// - /// @tparam T Floating-point scalar types. - /// - /// @see gtc_quaternion - template - GLM_FUNC_DECL vec<3, T, Q> eulerAngles(qua const& x); - - /// Returns roll value of euler angles expressed in radians. - /// - /// @tparam T Floating-point scalar types. - /// - /// @see gtc_quaternion - template - GLM_FUNC_DECL T roll(qua const& x); - - /// Returns pitch value of euler angles expressed in radians. - /// - /// @tparam T Floating-point scalar types. - /// - /// @see gtc_quaternion - template - GLM_FUNC_DECL T pitch(qua const& x); - - /// Returns yaw value of euler angles expressed in radians. - /// - /// @tparam T Floating-point scalar types. - /// - /// @see gtc_quaternion - template - GLM_FUNC_DECL T yaw(qua const& x); - - /// Converts a quaternion to a 3 * 3 matrix. - /// - /// @tparam T Floating-point scalar types. - /// - /// @see gtc_quaternion - template - GLM_FUNC_DECL mat<3, 3, T, Q> mat3_cast(qua const& x); - - /// Converts a quaternion to a 4 * 4 matrix. - /// - /// @tparam T Floating-point scalar types. - /// - /// @see gtc_quaternion - template - GLM_FUNC_DECL mat<4, 4, T, Q> mat4_cast(qua const& x); - - /// Converts a pure rotation 3 * 3 matrix to a quaternion. - /// - /// @tparam T Floating-point scalar types. - /// - /// @see gtc_quaternion - template - GLM_FUNC_DECL qua quat_cast(mat<3, 3, T, Q> const& x); - - /// Converts a pure rotation 4 * 4 matrix to a quaternion. - /// - /// @tparam T Floating-point scalar types. - /// - /// @see gtc_quaternion - template - GLM_FUNC_DECL qua quat_cast(mat<4, 4, T, Q> const& x); - - /// Returns the component-wise comparison result of x < y. - /// - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see ext_quaternion_relational - template - GLM_FUNC_DECL vec<4, bool, Q> lessThan(qua const& x, qua const& y); - - /// Returns the component-wise comparison of result x <= y. - /// - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see ext_quaternion_relational - template - GLM_FUNC_DECL vec<4, bool, Q> lessThanEqual(qua const& x, qua const& y); - - /// Returns the component-wise comparison of result x > y. - /// - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see ext_quaternion_relational - template - GLM_FUNC_DECL vec<4, bool, Q> greaterThan(qua const& x, qua const& y); - - /// Returns the component-wise comparison of result x >= y. - /// - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see ext_quaternion_relational - template - GLM_FUNC_DECL vec<4, bool, Q> greaterThanEqual(qua const& x, qua const& y); - - /// Build a look at quaternion based on the default handedness. - /// - /// @param direction Desired forward direction. Needs to be normalized. - /// @param up Up vector, how the camera is oriented. Typically (0, 1, 0). - template - GLM_FUNC_DECL qua quatLookAt( - vec<3, T, Q> const& direction, - vec<3, T, Q> const& up); - - /// Build a right-handed look at quaternion. - /// - /// @param direction Desired forward direction onto which the -z-axis gets mapped. Needs to be normalized. - /// @param up Up vector, how the camera is oriented. Typically (0, 1, 0). - template - GLM_FUNC_DECL qua quatLookAtRH( - vec<3, T, Q> const& direction, - vec<3, T, Q> const& up); - - /// Build a left-handed look at quaternion. - /// - /// @param direction Desired forward direction onto which the +z-axis gets mapped. Needs to be normalized. - /// @param up Up vector, how the camera is oriented. Typically (0, 1, 0). - template - GLM_FUNC_DECL qua quatLookAtLH( - vec<3, T, Q> const& direction, - vec<3, T, Q> const& up); - /// @} -} //namespace glm - -#include "quaternion.inl" diff --git a/3rdparty/glm/source/glm/gtc/quaternion.inl b/3rdparty/glm/source/glm/gtc/quaternion.inl deleted file mode 100644 index e1ef032..0000000 --- a/3rdparty/glm/source/glm/gtc/quaternion.inl +++ /dev/null @@ -1,208 +0,0 @@ -#include "../trigonometric.hpp" -#include "../geometric.hpp" -#include "../exponential.hpp" -#include "epsilon.hpp" -#include - -namespace glm -{ - template - GLM_FUNC_QUALIFIER vec<3, T, Q> eulerAngles(qua const& x) - { - return vec<3, T, Q>(pitch(x), yaw(x), roll(x)); - } - - template - GLM_FUNC_QUALIFIER T roll(qua const& q) - { - T const y = static_cast(2) * (q.x * q.y + q.w * q.z); - T const x = q.w * q.w + q.x * q.x - q.y * q.y - q.z * q.z; - - if(all(equal(vec<2, T, Q>(x, y), vec<2, T, Q>(0), epsilon()))) //avoid atan2(0,0) - handle singularity - Matiis - return static_cast(0); - - return static_cast(atan(y, x)); - } - - template - GLM_FUNC_QUALIFIER T pitch(qua const& q) - { - //return T(atan(T(2) * (q.y * q.z + q.w * q.x), q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z)); - T const y = static_cast(2) * (q.y * q.z + q.w * q.x); - T const x = q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z; - - if(all(equal(vec<2, T, Q>(x, y), vec<2, T, Q>(0), epsilon()))) //avoid atan2(0,0) - handle singularity - Matiis - return static_cast(static_cast(2) * atan(q.x, q.w)); - - return static_cast(atan(y, x)); - } - - template - GLM_FUNC_QUALIFIER T yaw(qua const& q) - { - return asin(clamp(static_cast(-2) * (q.x * q.z - q.w * q.y), static_cast(-1), static_cast(1))); - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> mat3_cast(qua const& q) - { - mat<3, 3, T, Q> Result(T(1)); - T qxx(q.x * q.x); - T qyy(q.y * q.y); - T qzz(q.z * q.z); - T qxz(q.x * q.z); - T qxy(q.x * q.y); - T qyz(q.y * q.z); - T qwx(q.w * q.x); - T qwy(q.w * q.y); - T qwz(q.w * q.z); - - Result[0][0] = T(1) - T(2) * (qyy + qzz); - Result[0][1] = T(2) * (qxy + qwz); - Result[0][2] = T(2) * (qxz - qwy); - - Result[1][0] = T(2) * (qxy - qwz); - Result[1][1] = T(1) - T(2) * (qxx + qzz); - Result[1][2] = T(2) * (qyz + qwx); - - Result[2][0] = T(2) * (qxz + qwy); - Result[2][1] = T(2) * (qyz - qwx); - Result[2][2] = T(1) - T(2) * (qxx + qyy); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> mat4_cast(qua const& q) - { - return mat<4, 4, T, Q>(mat3_cast(q)); - } - - template - GLM_FUNC_QUALIFIER qua quat_cast(mat<3, 3, T, Q> const& m) - { - T fourXSquaredMinus1 = m[0][0] - m[1][1] - m[2][2]; - T fourYSquaredMinus1 = m[1][1] - m[0][0] - m[2][2]; - T fourZSquaredMinus1 = m[2][2] - m[0][0] - m[1][1]; - T fourWSquaredMinus1 = m[0][0] + m[1][1] + m[2][2]; - - int biggestIndex = 0; - T fourBiggestSquaredMinus1 = fourWSquaredMinus1; - if(fourXSquaredMinus1 > fourBiggestSquaredMinus1) - { - fourBiggestSquaredMinus1 = fourXSquaredMinus1; - biggestIndex = 1; - } - if(fourYSquaredMinus1 > fourBiggestSquaredMinus1) - { - fourBiggestSquaredMinus1 = fourYSquaredMinus1; - biggestIndex = 2; - } - if(fourZSquaredMinus1 > fourBiggestSquaredMinus1) - { - fourBiggestSquaredMinus1 = fourZSquaredMinus1; - biggestIndex = 3; - } - - T biggestVal = sqrt(fourBiggestSquaredMinus1 + static_cast(1)) * static_cast(0.5); - T mult = static_cast(0.25) / biggestVal; - - switch(biggestIndex) - { - case 0: - return qua(biggestVal, (m[1][2] - m[2][1]) * mult, (m[2][0] - m[0][2]) * mult, (m[0][1] - m[1][0]) * mult); - case 1: - return qua((m[1][2] - m[2][1]) * mult, biggestVal, (m[0][1] + m[1][0]) * mult, (m[2][0] + m[0][2]) * mult); - case 2: - return qua((m[2][0] - m[0][2]) * mult, (m[0][1] + m[1][0]) * mult, biggestVal, (m[1][2] + m[2][1]) * mult); - case 3: - return qua((m[0][1] - m[1][0]) * mult, (m[2][0] + m[0][2]) * mult, (m[1][2] + m[2][1]) * mult, biggestVal); - default: // Silence a -Wswitch-default warning in GCC. Should never actually get here. Assert is just for sanity. - assert(false); - return qua(1, 0, 0, 0); - } - } - - template - GLM_FUNC_QUALIFIER qua quat_cast(mat<4, 4, T, Q> const& m4) - { - return quat_cast(mat<3, 3, T, Q>(m4)); - } - - template - GLM_FUNC_QUALIFIER vec<4, bool, Q> lessThan(qua const& x, qua const& y) - { - vec<4, bool, Q> Result; - for(length_t i = 0; i < x.length(); ++i) - Result[i] = x[i] < y[i]; - return Result; - } - - template - GLM_FUNC_QUALIFIER vec<4, bool, Q> lessThanEqual(qua const& x, qua const& y) - { - vec<4, bool, Q> Result; - for(length_t i = 0; i < x.length(); ++i) - Result[i] = x[i] <= y[i]; - return Result; - } - - template - GLM_FUNC_QUALIFIER vec<4, bool, Q> greaterThan(qua const& x, qua const& y) - { - vec<4, bool, Q> Result; - for(length_t i = 0; i < x.length(); ++i) - Result[i] = x[i] > y[i]; - return Result; - } - - template - GLM_FUNC_QUALIFIER vec<4, bool, Q> greaterThanEqual(qua const& x, qua const& y) - { - vec<4, bool, Q> Result; - for(length_t i = 0; i < x.length(); ++i) - Result[i] = x[i] >= y[i]; - return Result; - } - - - template - GLM_FUNC_QUALIFIER qua quatLookAt(vec<3, T, Q> const& direction, vec<3, T, Q> const& up) - { -# if GLM_CONFIG_CLIP_CONTROL & GLM_CLIP_CONTROL_LH_BIT - return quatLookAtLH(direction, up); -# else - return quatLookAtRH(direction, up); -# endif - } - - template - GLM_FUNC_QUALIFIER qua quatLookAtRH(vec<3, T, Q> const& direction, vec<3, T, Q> const& up) - { - mat<3, 3, T, Q> Result; - - Result[2] = -direction; - vec<3, T, Q> const& Right = cross(up, Result[2]); - Result[0] = Right * inversesqrt(max(static_cast(0.00001), dot(Right, Right))); - Result[1] = cross(Result[2], Result[0]); - - return quat_cast(Result); - } - - template - GLM_FUNC_QUALIFIER qua quatLookAtLH(vec<3, T, Q> const& direction, vec<3, T, Q> const& up) - { - mat<3, 3, T, Q> Result; - - Result[2] = direction; - vec<3, T, Q> const& Right = cross(up, Result[2]); - Result[0] = Right * inversesqrt(max(static_cast(0.00001), dot(Right, Right))); - Result[1] = cross(Result[2], Result[0]); - - return quat_cast(Result); - } -}//namespace glm - -#if GLM_CONFIG_SIMD == GLM_ENABLE -# include "quaternion_simd.inl" -#endif - diff --git a/3rdparty/glm/source/glm/gtc/quaternion_simd.inl b/3rdparty/glm/source/glm/gtc/quaternion_simd.inl deleted file mode 100644 index e69de29..0000000 diff --git a/3rdparty/glm/source/glm/gtc/random.hpp b/3rdparty/glm/source/glm/gtc/random.hpp deleted file mode 100644 index 9a85958..0000000 --- a/3rdparty/glm/source/glm/gtc/random.hpp +++ /dev/null @@ -1,82 +0,0 @@ -/// @ref gtc_random -/// @file glm/gtc/random.hpp -/// -/// @see core (dependence) -/// @see gtx_random (extended) -/// -/// @defgroup gtc_random GLM_GTC_random -/// @ingroup gtc -/// -/// Include to use the features of this extension. -/// -/// Generate random number from various distribution methods. - -#pragma once - -// Dependency: -#include "../ext/scalar_int_sized.hpp" -#include "../ext/scalar_uint_sized.hpp" -#include "../detail/qualifier.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTC_random extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_random - /// @{ - - /// Generate random numbers in the interval [Min, Max], according a linear distribution - /// - /// @param Min Minimum value included in the sampling - /// @param Max Maximum value included in the sampling - /// @tparam genType Value type. Currently supported: float or double scalars. - /// @see gtc_random - template - GLM_FUNC_DECL genType linearRand(genType Min, genType Max); - - /// Generate random numbers in the interval [Min, Max], according a linear distribution - /// - /// @param Min Minimum value included in the sampling - /// @param Max Maximum value included in the sampling - /// @tparam T Value type. Currently supported: float or double. - /// - /// @see gtc_random - template - GLM_FUNC_DECL vec linearRand(vec const& Min, vec const& Max); - - /// Generate random numbers in the interval [Min, Max], according a gaussian distribution - /// - /// @see gtc_random - template - GLM_FUNC_DECL genType gaussRand(genType Mean, genType Deviation); - - /// Generate a random 2D vector which coordinates are regulary distributed on a circle of a given radius - /// - /// @see gtc_random - template - GLM_FUNC_DECL vec<2, T, defaultp> circularRand(T Radius); - - /// Generate a random 3D vector which coordinates are regulary distributed on a sphere of a given radius - /// - /// @see gtc_random - template - GLM_FUNC_DECL vec<3, T, defaultp> sphericalRand(T Radius); - - /// Generate a random 2D vector which coordinates are regulary distributed within the area of a disk of a given radius - /// - /// @see gtc_random - template - GLM_FUNC_DECL vec<2, T, defaultp> diskRand(T Radius); - - /// Generate a random 3D vector which coordinates are regulary distributed within the volume of a ball of a given radius - /// - /// @see gtc_random - template - GLM_FUNC_DECL vec<3, T, defaultp> ballRand(T Radius); - - /// @} -}//namespace glm - -#include "random.inl" diff --git a/3rdparty/glm/source/glm/gtc/random.inl b/3rdparty/glm/source/glm/gtc/random.inl deleted file mode 100644 index 7048509..0000000 --- a/3rdparty/glm/source/glm/gtc/random.inl +++ /dev/null @@ -1,303 +0,0 @@ -#include "../geometric.hpp" -#include "../exponential.hpp" -#include "../trigonometric.hpp" -#include "../detail/type_vec1.hpp" -#include -#include -#include -#include - -namespace glm{ -namespace detail -{ - template - struct compute_rand - { - GLM_FUNC_QUALIFIER static vec call(); - }; - - template - struct compute_rand<1, uint8, P> - { - GLM_FUNC_QUALIFIER static vec<1, uint8, P> call() - { - return vec<1, uint8, P>( - std::rand() % std::numeric_limits::max()); - } - }; - - template - struct compute_rand<2, uint8, P> - { - GLM_FUNC_QUALIFIER static vec<2, uint8, P> call() - { - return vec<2, uint8, P>( - std::rand() % std::numeric_limits::max(), - std::rand() % std::numeric_limits::max()); - } - }; - - template - struct compute_rand<3, uint8, P> - { - GLM_FUNC_QUALIFIER static vec<3, uint8, P> call() - { - return vec<3, uint8, P>( - std::rand() % std::numeric_limits::max(), - std::rand() % std::numeric_limits::max(), - std::rand() % std::numeric_limits::max()); - } - }; - - template - struct compute_rand<4, uint8, P> - { - GLM_FUNC_QUALIFIER static vec<4, uint8, P> call() - { - return vec<4, uint8, P>( - std::rand() % std::numeric_limits::max(), - std::rand() % std::numeric_limits::max(), - std::rand() % std::numeric_limits::max(), - std::rand() % std::numeric_limits::max()); - } - }; - - template - struct compute_rand - { - GLM_FUNC_QUALIFIER static vec call() - { - return - (vec(compute_rand::call()) << static_cast(8)) | - (vec(compute_rand::call()) << static_cast(0)); - } - }; - - template - struct compute_rand - { - GLM_FUNC_QUALIFIER static vec call() - { - return - (vec(compute_rand::call()) << static_cast(16)) | - (vec(compute_rand::call()) << static_cast(0)); - } - }; - - template - struct compute_rand - { - GLM_FUNC_QUALIFIER static vec call() - { - return - (vec(compute_rand::call()) << static_cast(32)) | - (vec(compute_rand::call()) << static_cast(0)); - } - }; - - template - struct compute_linearRand - { - GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max); - }; - - template - struct compute_linearRand - { - GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) - { - return (vec(compute_rand::call() % vec(Max + static_cast(1) - Min))) + Min; - } - }; - - template - struct compute_linearRand - { - GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) - { - return (compute_rand::call() % (Max + static_cast(1) - Min)) + Min; - } - }; - - template - struct compute_linearRand - { - GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) - { - return (vec(compute_rand::call() % vec(Max + static_cast(1) - Min))) + Min; - } - }; - - template - struct compute_linearRand - { - GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) - { - return (compute_rand::call() % (Max + static_cast(1) - Min)) + Min; - } - }; - - template - struct compute_linearRand - { - GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) - { - return (vec(compute_rand::call() % vec(Max + static_cast(1) - Min))) + Min; - } - }; - - template - struct compute_linearRand - { - GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) - { - return (compute_rand::call() % (Max + static_cast(1) - Min)) + Min; - } - }; - - template - struct compute_linearRand - { - GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) - { - return (vec(compute_rand::call() % vec(Max + static_cast(1) - Min))) + Min; - } - }; - - template - struct compute_linearRand - { - GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) - { - return (compute_rand::call() % (Max + static_cast(1) - Min)) + Min; - } - }; - - template - struct compute_linearRand - { - GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) - { - return vec(compute_rand::call()) / static_cast(std::numeric_limits::max()) * (Max - Min) + Min; - } - }; - - template - struct compute_linearRand - { - GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) - { - return vec(compute_rand::call()) / static_cast(std::numeric_limits::max()) * (Max - Min) + Min; - } - }; - - template - struct compute_linearRand - { - GLM_FUNC_QUALIFIER static vec call(vec const& Min, vec const& Max) - { - return vec(compute_rand::call()) / static_cast(std::numeric_limits::max()) * (Max - Min) + Min; - } - }; -}//namespace detail - - template - GLM_FUNC_QUALIFIER genType linearRand(genType Min, genType Max) - { - return detail::compute_linearRand<1, genType, highp>::call( - vec<1, genType, highp>(Min), - vec<1, genType, highp>(Max)).x; - } - - template - GLM_FUNC_QUALIFIER vec linearRand(vec const& Min, vec const& Max) - { - return detail::compute_linearRand::call(Min, Max); - } - - template - GLM_FUNC_QUALIFIER genType gaussRand(genType Mean, genType Deviation) - { - genType w, x1, x2; - - do - { - x1 = linearRand(genType(-1), genType(1)); - x2 = linearRand(genType(-1), genType(1)); - - w = x1 * x1 + x2 * x2; - } while(w > genType(1)); - - return static_cast(x2 * Deviation * Deviation * sqrt((genType(-2) * log(w)) / w) + Mean); - } - - template - GLM_FUNC_QUALIFIER vec gaussRand(vec const& Mean, vec const& Deviation) - { - return detail::functor2::call(gaussRand, Mean, Deviation); - } - - template - GLM_FUNC_QUALIFIER vec<2, T, defaultp> diskRand(T Radius) - { - assert(Radius > static_cast(0)); - - vec<2, T, defaultp> Result(T(0)); - T LenRadius(T(0)); - - do - { - Result = linearRand( - vec<2, T, defaultp>(-Radius), - vec<2, T, defaultp>(Radius)); - LenRadius = length(Result); - } - while(LenRadius > Radius); - - return Result; - } - - template - GLM_FUNC_QUALIFIER vec<3, T, defaultp> ballRand(T Radius) - { - assert(Radius > static_cast(0)); - - vec<3, T, defaultp> Result(T(0)); - T LenRadius(T(0)); - - do - { - Result = linearRand( - vec<3, T, defaultp>(-Radius), - vec<3, T, defaultp>(Radius)); - LenRadius = length(Result); - } - while(LenRadius > Radius); - - return Result; - } - - template - GLM_FUNC_QUALIFIER vec<2, T, defaultp> circularRand(T Radius) - { - assert(Radius > static_cast(0)); - - T a = linearRand(T(0), static_cast(6.283185307179586476925286766559)); - return vec<2, T, defaultp>(glm::cos(a), glm::sin(a)) * Radius; - } - - template - GLM_FUNC_QUALIFIER vec<3, T, defaultp> sphericalRand(T Radius) - { - assert(Radius > static_cast(0)); - - T theta = linearRand(T(0), T(6.283185307179586476925286766559f)); - T phi = std::acos(linearRand(T(-1.0f), T(1.0f))); - - T x = std::sin(phi) * std::cos(theta); - T y = std::sin(phi) * std::sin(theta); - T z = std::cos(phi); - - return vec<3, T, defaultp>(x, y, z) * Radius; - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtc/reciprocal.hpp b/3rdparty/glm/source/glm/gtc/reciprocal.hpp deleted file mode 100644 index 4d0fc91..0000000 --- a/3rdparty/glm/source/glm/gtc/reciprocal.hpp +++ /dev/null @@ -1,24 +0,0 @@ -/// @ref gtc_reciprocal -/// @file glm/gtc/reciprocal.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtc_reciprocal GLM_GTC_reciprocal -/// @ingroup gtc -/// -/// Include to use the features of this extension. -/// -/// Define secant, cosecant and cotangent functions. - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTC_reciprocal extension included") -#endif - -#include "../ext/scalar_reciprocal.hpp" -#include "../ext/vector_reciprocal.hpp" - diff --git a/3rdparty/glm/source/glm/gtc/round.hpp b/3rdparty/glm/source/glm/gtc/round.hpp deleted file mode 100644 index 56edbbc..0000000 --- a/3rdparty/glm/source/glm/gtc/round.hpp +++ /dev/null @@ -1,160 +0,0 @@ -/// @ref gtc_round -/// @file glm/gtc/round.hpp -/// -/// @see core (dependence) -/// @see gtc_round (dependence) -/// -/// @defgroup gtc_round GLM_GTC_round -/// @ingroup gtc -/// -/// Include to use the features of this extension. -/// -/// Rounding value to specific boundings - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" -#include "../detail/qualifier.hpp" -#include "../detail/_vectorize.hpp" -#include "../vector_relational.hpp" -#include "../common.hpp" -#include - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTC_round extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_round - /// @{ - - /// Return the power of two number which value is just higher the input value, - /// round up to a power of two. - /// - /// @see gtc_round - template - GLM_FUNC_DECL genIUType ceilPowerOfTwo(genIUType v); - - /// Return the power of two number which value is just higher the input value, - /// round up to a power of two. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see gtc_round - template - GLM_FUNC_DECL vec ceilPowerOfTwo(vec const& v); - - /// Return the power of two number which value is just lower the input value, - /// round down to a power of two. - /// - /// @see gtc_round - template - GLM_FUNC_DECL genIUType floorPowerOfTwo(genIUType v); - - /// Return the power of two number which value is just lower the input value, - /// round down to a power of two. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see gtc_round - template - GLM_FUNC_DECL vec floorPowerOfTwo(vec const& v); - - /// Return the power of two number which value is the closet to the input value. - /// - /// @see gtc_round - template - GLM_FUNC_DECL genIUType roundPowerOfTwo(genIUType v); - - /// Return the power of two number which value is the closet to the input value. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see gtc_round - template - GLM_FUNC_DECL vec roundPowerOfTwo(vec const& v); - - /// Higher multiple number of Source. - /// - /// @tparam genType Floating-point or integer scalar or vector types. - /// - /// @param v Source value to which is applied the function - /// @param Multiple Must be a null or positive value - /// - /// @see gtc_round - template - GLM_FUNC_DECL genType ceilMultiple(genType v, genType Multiple); - - /// Higher multiple number of Source. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @param v Source values to which is applied the function - /// @param Multiple Must be a null or positive value - /// - /// @see gtc_round - template - GLM_FUNC_DECL vec ceilMultiple(vec const& v, vec const& Multiple); - - /// Lower multiple number of Source. - /// - /// @tparam genType Floating-point or integer scalar or vector types. - /// - /// @param v Source value to which is applied the function - /// @param Multiple Must be a null or positive value - /// - /// @see gtc_round - template - GLM_FUNC_DECL genType floorMultiple(genType v, genType Multiple); - - /// Lower multiple number of Source. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @param v Source values to which is applied the function - /// @param Multiple Must be a null or positive value - /// - /// @see gtc_round - template - GLM_FUNC_DECL vec floorMultiple(vec const& v, vec const& Multiple); - - /// Lower multiple number of Source. - /// - /// @tparam genType Floating-point or integer scalar or vector types. - /// - /// @param v Source value to which is applied the function - /// @param Multiple Must be a null or positive value - /// - /// @see gtc_round - template - GLM_FUNC_DECL genType roundMultiple(genType v, genType Multiple); - - /// Lower multiple number of Source. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @param v Source values to which is applied the function - /// @param Multiple Must be a null or positive value - /// - /// @see gtc_round - template - GLM_FUNC_DECL vec roundMultiple(vec const& v, vec const& Multiple); - - /// @} -} //namespace glm - -#include "round.inl" diff --git a/3rdparty/glm/source/glm/gtc/round.inl b/3rdparty/glm/source/glm/gtc/round.inl deleted file mode 100644 index 48411e4..0000000 --- a/3rdparty/glm/source/glm/gtc/round.inl +++ /dev/null @@ -1,155 +0,0 @@ -/// @ref gtc_round - -#include "../integer.hpp" -#include "../ext/vector_integer.hpp" - -namespace glm{ -namespace detail -{ - template - struct compute_roundMultiple {}; - - template<> - struct compute_roundMultiple - { - template - GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) - { - if (Source >= genType(0)) - return Source - std::fmod(Source, Multiple); - else - { - genType Tmp = Source + genType(1); - return Tmp - std::fmod(Tmp, Multiple) - Multiple; - } - } - }; - - template<> - struct compute_roundMultiple - { - template - GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) - { - if (Source >= genType(0)) - return Source - Source % Multiple; - else - { - genType Tmp = Source + genType(1); - return Tmp - Tmp % Multiple - Multiple; - } - } - }; - - template<> - struct compute_roundMultiple - { - template - GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) - { - if (Source >= genType(0)) - return Source - Source % Multiple; - else - { - genType Tmp = Source + genType(1); - return Tmp - Tmp % Multiple - Multiple; - } - } - }; -}//namespace detail - - ////////////////// - // ceilPowerOfTwo - - template - GLM_FUNC_QUALIFIER genType ceilPowerOfTwo(genType value) - { - return detail::compute_ceilPowerOfTwo<1, genType, defaultp, std::numeric_limits::is_signed>::call(vec<1, genType, defaultp>(value)).x; - } - - template - GLM_FUNC_QUALIFIER vec ceilPowerOfTwo(vec const& v) - { - return detail::compute_ceilPowerOfTwo::is_signed>::call(v); - } - - /////////////////// - // floorPowerOfTwo - - template - GLM_FUNC_QUALIFIER genType floorPowerOfTwo(genType value) - { - return isPowerOfTwo(value) ? value : static_cast(1) << findMSB(value); - } - - template - GLM_FUNC_QUALIFIER vec floorPowerOfTwo(vec const& v) - { - return detail::functor1::call(floorPowerOfTwo, v); - } - - /////////////////// - // roundPowerOfTwo - - template - GLM_FUNC_QUALIFIER genIUType roundPowerOfTwo(genIUType value) - { - if(isPowerOfTwo(value)) - return value; - - genIUType const prev = static_cast(1) << findMSB(value); - genIUType const next = prev << static_cast(1); - return (next - value) < (value - prev) ? next : prev; - } - - template - GLM_FUNC_QUALIFIER vec roundPowerOfTwo(vec const& v) - { - return detail::functor1::call(roundPowerOfTwo, v); - } - - ////////////////////// - // ceilMultiple - - template - GLM_FUNC_QUALIFIER genType ceilMultiple(genType Source, genType Multiple) - { - return detail::compute_ceilMultiple::is_iec559, std::numeric_limits::is_signed>::call(Source, Multiple); - } - - template - GLM_FUNC_QUALIFIER vec ceilMultiple(vec const& Source, vec const& Multiple) - { - return detail::functor2::call(ceilMultiple, Source, Multiple); - } - - ////////////////////// - // floorMultiple - - template - GLM_FUNC_QUALIFIER genType floorMultiple(genType Source, genType Multiple) - { - return detail::compute_floorMultiple::is_iec559, std::numeric_limits::is_signed>::call(Source, Multiple); - } - - template - GLM_FUNC_QUALIFIER vec floorMultiple(vec const& Source, vec const& Multiple) - { - return detail::functor2::call(floorMultiple, Source, Multiple); - } - - ////////////////////// - // roundMultiple - - template - GLM_FUNC_QUALIFIER genType roundMultiple(genType Source, genType Multiple) - { - return detail::compute_roundMultiple::is_iec559, std::numeric_limits::is_signed>::call(Source, Multiple); - } - - template - GLM_FUNC_QUALIFIER vec roundMultiple(vec const& Source, vec const& Multiple) - { - return detail::functor2::call(roundMultiple, Source, Multiple); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtc/type_aligned.hpp b/3rdparty/glm/source/glm/gtc/type_aligned.hpp deleted file mode 100644 index 5403abf..0000000 --- a/3rdparty/glm/source/glm/gtc/type_aligned.hpp +++ /dev/null @@ -1,1315 +0,0 @@ -/// @ref gtc_type_aligned -/// @file glm/gtc/type_aligned.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtc_type_aligned GLM_GTC_type_aligned -/// @ingroup gtc -/// -/// Include to use the features of this extension. -/// -/// Aligned types allowing SIMD optimizations of vectors and matrices types - -#pragma once - -#if (GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE) -# error "GLM: Aligned gentypes require to enable C++ language extensions. Define GLM_FORCE_ALIGNED_GENTYPES before including GLM headers to use aligned types." -#endif - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTC_type_aligned extension included") -#endif - -#include "../mat4x4.hpp" -#include "../mat4x3.hpp" -#include "../mat4x2.hpp" -#include "../mat3x4.hpp" -#include "../mat3x3.hpp" -#include "../mat3x2.hpp" -#include "../mat2x4.hpp" -#include "../mat2x3.hpp" -#include "../mat2x2.hpp" -#include "../gtc/vec1.hpp" -#include "../vec2.hpp" -#include "../vec3.hpp" -#include "../vec4.hpp" - -namespace glm -{ - /// @addtogroup gtc_type_aligned - /// @{ - - // -- *vec1 -- - - /// 1 component vector aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef vec<1, float, aligned_highp> aligned_highp_vec1; - - /// 1 component vector aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef vec<1, float, aligned_mediump> aligned_mediump_vec1; - - /// 1 component vector aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef vec<1, float, aligned_lowp> aligned_lowp_vec1; - - /// 1 component vector aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef vec<1, double, aligned_highp> aligned_highp_dvec1; - - /// 1 component vector aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef vec<1, double, aligned_mediump> aligned_mediump_dvec1; - - /// 1 component vector aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef vec<1, double, aligned_lowp> aligned_lowp_dvec1; - - /// 1 component vector aligned in memory of signed integer numbers. - typedef vec<1, int, aligned_highp> aligned_highp_ivec1; - - /// 1 component vector aligned in memory of signed integer numbers. - typedef vec<1, int, aligned_mediump> aligned_mediump_ivec1; - - /// 1 component vector aligned in memory of signed integer numbers. - typedef vec<1, int, aligned_lowp> aligned_lowp_ivec1; - - /// 1 component vector aligned in memory of unsigned integer numbers. - typedef vec<1, uint, aligned_highp> aligned_highp_uvec1; - - /// 1 component vector aligned in memory of unsigned integer numbers. - typedef vec<1, uint, aligned_mediump> aligned_mediump_uvec1; - - /// 1 component vector aligned in memory of unsigned integer numbers. - typedef vec<1, uint, aligned_lowp> aligned_lowp_uvec1; - - /// 1 component vector aligned in memory of bool values. - typedef vec<1, bool, aligned_highp> aligned_highp_bvec1; - - /// 1 component vector aligned in memory of bool values. - typedef vec<1, bool, aligned_mediump> aligned_mediump_bvec1; - - /// 1 component vector aligned in memory of bool values. - typedef vec<1, bool, aligned_lowp> aligned_lowp_bvec1; - - /// 1 component vector tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef vec<1, float, packed_highp> packed_highp_vec1; - - /// 1 component vector tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef vec<1, float, packed_mediump> packed_mediump_vec1; - - /// 1 component vector tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef vec<1, float, packed_lowp> packed_lowp_vec1; - - /// 1 component vector tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef vec<1, double, packed_highp> packed_highp_dvec1; - - /// 1 component vector tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef vec<1, double, packed_mediump> packed_mediump_dvec1; - - /// 1 component vector tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef vec<1, double, packed_lowp> packed_lowp_dvec1; - - /// 1 component vector tightly packed in memory of signed integer numbers. - typedef vec<1, int, packed_highp> packed_highp_ivec1; - - /// 1 component vector tightly packed in memory of signed integer numbers. - typedef vec<1, int, packed_mediump> packed_mediump_ivec1; - - /// 1 component vector tightly packed in memory of signed integer numbers. - typedef vec<1, int, packed_lowp> packed_lowp_ivec1; - - /// 1 component vector tightly packed in memory of unsigned integer numbers. - typedef vec<1, uint, packed_highp> packed_highp_uvec1; - - /// 1 component vector tightly packed in memory of unsigned integer numbers. - typedef vec<1, uint, packed_mediump> packed_mediump_uvec1; - - /// 1 component vector tightly packed in memory of unsigned integer numbers. - typedef vec<1, uint, packed_lowp> packed_lowp_uvec1; - - /// 1 component vector tightly packed in memory of bool values. - typedef vec<1, bool, packed_highp> packed_highp_bvec1; - - /// 1 component vector tightly packed in memory of bool values. - typedef vec<1, bool, packed_mediump> packed_mediump_bvec1; - - /// 1 component vector tightly packed in memory of bool values. - typedef vec<1, bool, packed_lowp> packed_lowp_bvec1; - - // -- *vec2 -- - - /// 2 components vector aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef vec<2, float, aligned_highp> aligned_highp_vec2; - - /// 2 components vector aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef vec<2, float, aligned_mediump> aligned_mediump_vec2; - - /// 2 components vector aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef vec<2, float, aligned_lowp> aligned_lowp_vec2; - - /// 2 components vector aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef vec<2, double, aligned_highp> aligned_highp_dvec2; - - /// 2 components vector aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef vec<2, double, aligned_mediump> aligned_mediump_dvec2; - - /// 2 components vector aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef vec<2, double, aligned_lowp> aligned_lowp_dvec2; - - /// 2 components vector aligned in memory of signed integer numbers. - typedef vec<2, int, aligned_highp> aligned_highp_ivec2; - - /// 2 components vector aligned in memory of signed integer numbers. - typedef vec<2, int, aligned_mediump> aligned_mediump_ivec2; - - /// 2 components vector aligned in memory of signed integer numbers. - typedef vec<2, int, aligned_lowp> aligned_lowp_ivec2; - - /// 2 components vector aligned in memory of unsigned integer numbers. - typedef vec<2, uint, aligned_highp> aligned_highp_uvec2; - - /// 2 components vector aligned in memory of unsigned integer numbers. - typedef vec<2, uint, aligned_mediump> aligned_mediump_uvec2; - - /// 2 components vector aligned in memory of unsigned integer numbers. - typedef vec<2, uint, aligned_lowp> aligned_lowp_uvec2; - - /// 2 components vector aligned in memory of bool values. - typedef vec<2, bool, aligned_highp> aligned_highp_bvec2; - - /// 2 components vector aligned in memory of bool values. - typedef vec<2, bool, aligned_mediump> aligned_mediump_bvec2; - - /// 2 components vector aligned in memory of bool values. - typedef vec<2, bool, aligned_lowp> aligned_lowp_bvec2; - - /// 2 components vector tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef vec<2, float, packed_highp> packed_highp_vec2; - - /// 2 components vector tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef vec<2, float, packed_mediump> packed_mediump_vec2; - - /// 2 components vector tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef vec<2, float, packed_lowp> packed_lowp_vec2; - - /// 2 components vector tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef vec<2, double, packed_highp> packed_highp_dvec2; - - /// 2 components vector tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef vec<2, double, packed_mediump> packed_mediump_dvec2; - - /// 2 components vector tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef vec<2, double, packed_lowp> packed_lowp_dvec2; - - /// 2 components vector tightly packed in memory of signed integer numbers. - typedef vec<2, int, packed_highp> packed_highp_ivec2; - - /// 2 components vector tightly packed in memory of signed integer numbers. - typedef vec<2, int, packed_mediump> packed_mediump_ivec2; - - /// 2 components vector tightly packed in memory of signed integer numbers. - typedef vec<2, int, packed_lowp> packed_lowp_ivec2; - - /// 2 components vector tightly packed in memory of unsigned integer numbers. - typedef vec<2, uint, packed_highp> packed_highp_uvec2; - - /// 2 components vector tightly packed in memory of unsigned integer numbers. - typedef vec<2, uint, packed_mediump> packed_mediump_uvec2; - - /// 2 components vector tightly packed in memory of unsigned integer numbers. - typedef vec<2, uint, packed_lowp> packed_lowp_uvec2; - - /// 2 components vector tightly packed in memory of bool values. - typedef vec<2, bool, packed_highp> packed_highp_bvec2; - - /// 2 components vector tightly packed in memory of bool values. - typedef vec<2, bool, packed_mediump> packed_mediump_bvec2; - - /// 2 components vector tightly packed in memory of bool values. - typedef vec<2, bool, packed_lowp> packed_lowp_bvec2; - - // -- *vec3 -- - - /// 3 components vector aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef vec<3, float, aligned_highp> aligned_highp_vec3; - - /// 3 components vector aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef vec<3, float, aligned_mediump> aligned_mediump_vec3; - - /// 3 components vector aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef vec<3, float, aligned_lowp> aligned_lowp_vec3; - - /// 3 components vector aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef vec<3, double, aligned_highp> aligned_highp_dvec3; - - /// 3 components vector aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef vec<3, double, aligned_mediump> aligned_mediump_dvec3; - - /// 3 components vector aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef vec<3, double, aligned_lowp> aligned_lowp_dvec3; - - /// 3 components vector aligned in memory of signed integer numbers. - typedef vec<3, int, aligned_highp> aligned_highp_ivec3; - - /// 3 components vector aligned in memory of signed integer numbers. - typedef vec<3, int, aligned_mediump> aligned_mediump_ivec3; - - /// 3 components vector aligned in memory of signed integer numbers. - typedef vec<3, int, aligned_lowp> aligned_lowp_ivec3; - - /// 3 components vector aligned in memory of unsigned integer numbers. - typedef vec<3, uint, aligned_highp> aligned_highp_uvec3; - - /// 3 components vector aligned in memory of unsigned integer numbers. - typedef vec<3, uint, aligned_mediump> aligned_mediump_uvec3; - - /// 3 components vector aligned in memory of unsigned integer numbers. - typedef vec<3, uint, aligned_lowp> aligned_lowp_uvec3; - - /// 3 components vector aligned in memory of bool values. - typedef vec<3, bool, aligned_highp> aligned_highp_bvec3; - - /// 3 components vector aligned in memory of bool values. - typedef vec<3, bool, aligned_mediump> aligned_mediump_bvec3; - - /// 3 components vector aligned in memory of bool values. - typedef vec<3, bool, aligned_lowp> aligned_lowp_bvec3; - - /// 3 components vector tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef vec<3, float, packed_highp> packed_highp_vec3; - - /// 3 components vector tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef vec<3, float, packed_mediump> packed_mediump_vec3; - - /// 3 components vector tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef vec<3, float, packed_lowp> packed_lowp_vec3; - - /// 3 components vector tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef vec<3, double, packed_highp> packed_highp_dvec3; - - /// 3 components vector tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef vec<3, double, packed_mediump> packed_mediump_dvec3; - - /// 3 components vector tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef vec<3, double, packed_lowp> packed_lowp_dvec3; - - /// 3 components vector tightly packed in memory of signed integer numbers. - typedef vec<3, int, packed_highp> packed_highp_ivec3; - - /// 3 components vector tightly packed in memory of signed integer numbers. - typedef vec<3, int, packed_mediump> packed_mediump_ivec3; - - /// 3 components vector tightly packed in memory of signed integer numbers. - typedef vec<3, int, packed_lowp> packed_lowp_ivec3; - - /// 3 components vector tightly packed in memory of unsigned integer numbers. - typedef vec<3, uint, packed_highp> packed_highp_uvec3; - - /// 3 components vector tightly packed in memory of unsigned integer numbers. - typedef vec<3, uint, packed_mediump> packed_mediump_uvec3; - - /// 3 components vector tightly packed in memory of unsigned integer numbers. - typedef vec<3, uint, packed_lowp> packed_lowp_uvec3; - - /// 3 components vector tightly packed in memory of bool values. - typedef vec<3, bool, packed_highp> packed_highp_bvec3; - - /// 3 components vector tightly packed in memory of bool values. - typedef vec<3, bool, packed_mediump> packed_mediump_bvec3; - - /// 3 components vector tightly packed in memory of bool values. - typedef vec<3, bool, packed_lowp> packed_lowp_bvec3; - - // -- *vec4 -- - - /// 4 components vector aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef vec<4, float, aligned_highp> aligned_highp_vec4; - - /// 4 components vector aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef vec<4, float, aligned_mediump> aligned_mediump_vec4; - - /// 4 components vector aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef vec<4, float, aligned_lowp> aligned_lowp_vec4; - - /// 4 components vector aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef vec<4, double, aligned_highp> aligned_highp_dvec4; - - /// 4 components vector aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef vec<4, double, aligned_mediump> aligned_mediump_dvec4; - - /// 4 components vector aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef vec<4, double, aligned_lowp> aligned_lowp_dvec4; - - /// 4 components vector aligned in memory of signed integer numbers. - typedef vec<4, int, aligned_highp> aligned_highp_ivec4; - - /// 4 components vector aligned in memory of signed integer numbers. - typedef vec<4, int, aligned_mediump> aligned_mediump_ivec4; - - /// 4 components vector aligned in memory of signed integer numbers. - typedef vec<4, int, aligned_lowp> aligned_lowp_ivec4; - - /// 4 components vector aligned in memory of unsigned integer numbers. - typedef vec<4, uint, aligned_highp> aligned_highp_uvec4; - - /// 4 components vector aligned in memory of unsigned integer numbers. - typedef vec<4, uint, aligned_mediump> aligned_mediump_uvec4; - - /// 4 components vector aligned in memory of unsigned integer numbers. - typedef vec<4, uint, aligned_lowp> aligned_lowp_uvec4; - - /// 4 components vector aligned in memory of bool values. - typedef vec<4, bool, aligned_highp> aligned_highp_bvec4; - - /// 4 components vector aligned in memory of bool values. - typedef vec<4, bool, aligned_mediump> aligned_mediump_bvec4; - - /// 4 components vector aligned in memory of bool values. - typedef vec<4, bool, aligned_lowp> aligned_lowp_bvec4; - - /// 4 components vector tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef vec<4, float, packed_highp> packed_highp_vec4; - - /// 4 components vector tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef vec<4, float, packed_mediump> packed_mediump_vec4; - - /// 4 components vector tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef vec<4, float, packed_lowp> packed_lowp_vec4; - - /// 4 components vector tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef vec<4, double, packed_highp> packed_highp_dvec4; - - /// 4 components vector tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef vec<4, double, packed_mediump> packed_mediump_dvec4; - - /// 4 components vector tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef vec<4, double, packed_lowp> packed_lowp_dvec4; - - /// 4 components vector tightly packed in memory of signed integer numbers. - typedef vec<4, int, packed_highp> packed_highp_ivec4; - - /// 4 components vector tightly packed in memory of signed integer numbers. - typedef vec<4, int, packed_mediump> packed_mediump_ivec4; - - /// 4 components vector tightly packed in memory of signed integer numbers. - typedef vec<4, int, packed_lowp> packed_lowp_ivec4; - - /// 4 components vector tightly packed in memory of unsigned integer numbers. - typedef vec<4, uint, packed_highp> packed_highp_uvec4; - - /// 4 components vector tightly packed in memory of unsigned integer numbers. - typedef vec<4, uint, packed_mediump> packed_mediump_uvec4; - - /// 4 components vector tightly packed in memory of unsigned integer numbers. - typedef vec<4, uint, packed_lowp> packed_lowp_uvec4; - - /// 4 components vector tightly packed in memory of bool values. - typedef vec<4, bool, packed_highp> packed_highp_bvec4; - - /// 4 components vector tightly packed in memory of bool values. - typedef vec<4, bool, packed_mediump> packed_mediump_bvec4; - - /// 4 components vector tightly packed in memory of bool values. - typedef vec<4, bool, packed_lowp> packed_lowp_bvec4; - - // -- *mat2 -- - - /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<2, 2, float, aligned_highp> aligned_highp_mat2; - - /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<2, 2, float, aligned_mediump> aligned_mediump_mat2; - - /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<2, 2, float, aligned_lowp> aligned_lowp_mat2; - - /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<2, 2, double, aligned_highp> aligned_highp_dmat2; - - /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<2, 2, double, aligned_mediump> aligned_mediump_dmat2; - - /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<2, 2, double, aligned_lowp> aligned_lowp_dmat2; - - /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<2, 2, float, packed_highp> packed_highp_mat2; - - /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<2, 2, float, packed_mediump> packed_mediump_mat2; - - /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<2, 2, float, packed_lowp> packed_lowp_mat2; - - /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<2, 2, double, packed_highp> packed_highp_dmat2; - - /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<2, 2, double, packed_mediump> packed_mediump_dmat2; - - /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<2, 2, double, packed_lowp> packed_lowp_dmat2; - - // -- *mat3 -- - - /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<3, 3, float, aligned_highp> aligned_highp_mat3; - - /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<3, 3, float, aligned_mediump> aligned_mediump_mat3; - - /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<3, 3, float, aligned_lowp> aligned_lowp_mat3; - - /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<3, 3, double, aligned_highp> aligned_highp_dmat3; - - /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<3, 3, double, aligned_mediump> aligned_mediump_dmat3; - - /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<3, 3, double, aligned_lowp> aligned_lowp_dmat3; - - /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<3, 3, float, packed_highp> packed_highp_mat3; - - /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<3, 3, float, packed_mediump> packed_mediump_mat3; - - /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<3, 3, float, packed_lowp> packed_lowp_mat3; - - /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<3, 3, double, packed_highp> packed_highp_dmat3; - - /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<3, 3, double, packed_mediump> packed_mediump_dmat3; - - /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<3, 3, double, packed_lowp> packed_lowp_dmat3; - - // -- *mat4 -- - - /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<4, 4, float, aligned_highp> aligned_highp_mat4; - - /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<4, 4, float, aligned_mediump> aligned_mediump_mat4; - - /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<4, 4, float, aligned_lowp> aligned_lowp_mat4; - - /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<4, 4, double, aligned_highp> aligned_highp_dmat4; - - /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<4, 4, double, aligned_mediump> aligned_mediump_dmat4; - - /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<4, 4, double, aligned_lowp> aligned_lowp_dmat4; - - /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<4, 4, float, packed_highp> packed_highp_mat4; - - /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<4, 4, float, packed_mediump> packed_mediump_mat4; - - /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<4, 4, float, packed_lowp> packed_lowp_mat4; - - /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<4, 4, double, packed_highp> packed_highp_dmat4; - - /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<4, 4, double, packed_mediump> packed_mediump_dmat4; - - /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<4, 4, double, packed_lowp> packed_lowp_dmat4; - - // -- *mat2x2 -- - - /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<2, 2, float, aligned_highp> aligned_highp_mat2x2; - - /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<2, 2, float, aligned_mediump> aligned_mediump_mat2x2; - - /// 2 by 2 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<2, 2, float, aligned_lowp> aligned_lowp_mat2x2; - - /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<2, 2, double, aligned_highp> aligned_highp_dmat2x2; - - /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<2, 2, double, aligned_mediump> aligned_mediump_dmat2x2; - - /// 2 by 2 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<2, 2, double, aligned_lowp> aligned_lowp_dmat2x2; - - /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<2, 2, float, packed_highp> packed_highp_mat2x2; - - /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<2, 2, float, packed_mediump> packed_mediump_mat2x2; - - /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<2, 2, float, packed_lowp> packed_lowp_mat2x2; - - /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<2, 2, double, packed_highp> packed_highp_dmat2x2; - - /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<2, 2, double, packed_mediump> packed_mediump_dmat2x2; - - /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<2, 2, double, packed_lowp> packed_lowp_dmat2x2; - - // -- *mat2x3 -- - - /// 2 by 3 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<2, 3, float, aligned_highp> aligned_highp_mat2x3; - - /// 2 by 3 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<2, 3, float, aligned_mediump> aligned_mediump_mat2x3; - - /// 2 by 3 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<2, 3, float, aligned_lowp> aligned_lowp_mat2x3; - - /// 2 by 3 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<2, 3, double, aligned_highp> aligned_highp_dmat2x3; - - /// 2 by 3 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<2, 3, double, aligned_mediump> aligned_mediump_dmat2x3; - - /// 2 by 3 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<2, 3, double, aligned_lowp> aligned_lowp_dmat2x3; - - /// 2 by 3 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<2, 3, float, packed_highp> packed_highp_mat2x3; - - /// 2 by 3 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<2, 3, float, packed_mediump> packed_mediump_mat2x3; - - /// 2 by 3 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<2, 3, float, packed_lowp> packed_lowp_mat2x3; - - /// 2 by 3 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<2, 3, double, packed_highp> packed_highp_dmat2x3; - - /// 2 by 3 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<2, 3, double, packed_mediump> packed_mediump_dmat2x3; - - /// 2 by 3 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<2, 3, double, packed_lowp> packed_lowp_dmat2x3; - - // -- *mat2x4 -- - - /// 2 by 4 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<2, 4, float, aligned_highp> aligned_highp_mat2x4; - - /// 2 by 4 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<2, 4, float, aligned_mediump> aligned_mediump_mat2x4; - - /// 2 by 4 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<2, 4, float, aligned_lowp> aligned_lowp_mat2x4; - - /// 2 by 4 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<2, 4, double, aligned_highp> aligned_highp_dmat2x4; - - /// 2 by 4 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<2, 4, double, aligned_mediump> aligned_mediump_dmat2x4; - - /// 2 by 4 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<2, 4, double, aligned_lowp> aligned_lowp_dmat2x4; - - /// 2 by 4 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<2, 4, float, packed_highp> packed_highp_mat2x4; - - /// 2 by 4 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<2, 4, float, packed_mediump> packed_mediump_mat2x4; - - /// 2 by 4 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<2, 4, float, packed_lowp> packed_lowp_mat2x4; - - /// 2 by 4 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<2, 4, double, packed_highp> packed_highp_dmat2x4; - - /// 2 by 4 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<2, 4, double, packed_mediump> packed_mediump_dmat2x4; - - /// 2 by 4 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<2, 4, double, packed_lowp> packed_lowp_dmat2x4; - - // -- *mat3x2 -- - - /// 3 by 2 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<3, 2, float, aligned_highp> aligned_highp_mat3x2; - - /// 3 by 2 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<3, 2, float, aligned_mediump> aligned_mediump_mat3x2; - - /// 3 by 2 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<3, 2, float, aligned_lowp> aligned_lowp_mat3x2; - - /// 3 by 2 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<3, 2, double, aligned_highp> aligned_highp_dmat3x2; - - /// 3 by 2 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<3, 2, double, aligned_mediump> aligned_mediump_dmat3x2; - - /// 3 by 2 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<3, 2, double, aligned_lowp> aligned_lowp_dmat3x2; - - /// 3 by 2 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<3, 2, float, packed_highp> packed_highp_mat3x2; - - /// 3 by 2 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<3, 2, float, packed_mediump> packed_mediump_mat3x2; - - /// 3 by 2 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<3, 2, float, packed_lowp> packed_lowp_mat3x2; - - /// 3 by 2 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<3, 2, double, packed_highp> packed_highp_dmat3x2; - - /// 3 by 2 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<3, 2, double, packed_mediump> packed_mediump_dmat3x2; - - /// 3 by 2 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<3, 2, double, packed_lowp> packed_lowp_dmat3x2; - - // -- *mat3x3 -- - - /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<3, 3, float, aligned_highp> aligned_highp_mat3x3; - - /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<3, 3, float, aligned_mediump> aligned_mediump_mat3x3; - - /// 3 by 3 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<3, 3, float, aligned_lowp> aligned_lowp_mat3x3; - - /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<3, 3, double, aligned_highp> aligned_highp_dmat3x3; - - /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<3, 3, double, aligned_mediump> aligned_mediump_dmat3x3; - - /// 3 by 3 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<3, 3, double, aligned_lowp> aligned_lowp_dmat3x3; - - /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<3, 3, float, packed_highp> packed_highp_mat3x3; - - /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<3, 3, float, packed_mediump> packed_mediump_mat3x3; - - /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<3, 3, float, packed_lowp> packed_lowp_mat3x3; - - /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<3, 3, double, packed_highp> packed_highp_dmat3x3; - - /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<3, 3, double, packed_mediump> packed_mediump_dmat3x3; - - /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<3, 3, double, packed_lowp> packed_lowp_dmat3x3; - - // -- *mat3x4 -- - - /// 3 by 4 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<3, 4, float, aligned_highp> aligned_highp_mat3x4; - - /// 3 by 4 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<3, 4, float, aligned_mediump> aligned_mediump_mat3x4; - - /// 3 by 4 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<3, 4, float, aligned_lowp> aligned_lowp_mat3x4; - - /// 3 by 4 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<3, 4, double, aligned_highp> aligned_highp_dmat3x4; - - /// 3 by 4 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<3, 4, double, aligned_mediump> aligned_mediump_dmat3x4; - - /// 3 by 4 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<3, 4, double, aligned_lowp> aligned_lowp_dmat3x4; - - /// 3 by 4 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<3, 4, float, packed_highp> packed_highp_mat3x4; - - /// 3 by 4 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<3, 4, float, packed_mediump> packed_mediump_mat3x4; - - /// 3 by 4 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<3, 4, float, packed_lowp> packed_lowp_mat3x4; - - /// 3 by 4 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<3, 4, double, packed_highp> packed_highp_dmat3x4; - - /// 3 by 4 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<3, 4, double, packed_mediump> packed_mediump_dmat3x4; - - /// 3 by 4 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<3, 4, double, packed_lowp> packed_lowp_dmat3x4; - - // -- *mat4x2 -- - - /// 4 by 2 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<4, 2, float, aligned_highp> aligned_highp_mat4x2; - - /// 4 by 2 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<4, 2, float, aligned_mediump> aligned_mediump_mat4x2; - - /// 4 by 2 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<4, 2, float, aligned_lowp> aligned_lowp_mat4x2; - - /// 4 by 2 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<4, 2, double, aligned_highp> aligned_highp_dmat4x2; - - /// 4 by 2 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<4, 2, double, aligned_mediump> aligned_mediump_dmat4x2; - - /// 4 by 2 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<4, 2, double, aligned_lowp> aligned_lowp_dmat4x2; - - /// 4 by 2 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<4, 2, float, packed_highp> packed_highp_mat4x2; - - /// 4 by 2 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<4, 2, float, packed_mediump> packed_mediump_mat4x2; - - /// 4 by 2 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<4, 2, float, packed_lowp> packed_lowp_mat4x2; - - /// 4 by 2 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<4, 2, double, packed_highp> packed_highp_dmat4x2; - - /// 4 by 2 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<4, 2, double, packed_mediump> packed_mediump_dmat4x2; - - /// 4 by 2 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<4, 2, double, packed_lowp> packed_lowp_dmat4x2; - - // -- *mat4x3 -- - - /// 4 by 3 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<4, 3, float, aligned_highp> aligned_highp_mat4x3; - - /// 4 by 3 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<4, 3, float, aligned_mediump> aligned_mediump_mat4x3; - - /// 4 by 3 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<4, 3, float, aligned_lowp> aligned_lowp_mat4x3; - - /// 4 by 3 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<4, 3, double, aligned_highp> aligned_highp_dmat4x3; - - /// 4 by 3 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<4, 3, double, aligned_mediump> aligned_mediump_dmat4x3; - - /// 4 by 3 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<4, 3, double, aligned_lowp> aligned_lowp_dmat4x3; - - /// 4 by 3 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<4, 3, float, packed_highp> packed_highp_mat4x3; - - /// 4 by 3 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<4, 3, float, packed_mediump> packed_mediump_mat4x3; - - /// 4 by 3 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<4, 3, float, packed_lowp> packed_lowp_mat4x3; - - /// 4 by 3 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<4, 3, double, packed_highp> packed_highp_dmat4x3; - - /// 4 by 3 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<4, 3, double, packed_mediump> packed_mediump_dmat4x3; - - /// 4 by 3 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<4, 3, double, packed_lowp> packed_lowp_dmat4x3; - - // -- *mat4x4 -- - - /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<4, 4, float, aligned_highp> aligned_highp_mat4x4; - - /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<4, 4, float, aligned_mediump> aligned_mediump_mat4x4; - - /// 4 by 4 matrix aligned in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<4, 4, float, aligned_lowp> aligned_lowp_mat4x4; - - /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<4, 4, double, aligned_highp> aligned_highp_dmat4x4; - - /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<4, 4, double, aligned_mediump> aligned_mediump_dmat4x4; - - /// 4 by 4 matrix aligned in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<4, 4, double, aligned_lowp> aligned_lowp_dmat4x4; - - /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<4, 4, float, packed_highp> packed_highp_mat4x4; - - /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<4, 4, float, packed_mediump> packed_mediump_mat4x4; - - /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<4, 4, float, packed_lowp> packed_lowp_mat4x4; - - /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using high precision arithmetic in term of ULPs. - typedef mat<4, 4, double, packed_highp> packed_highp_dmat4x4; - - /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using medium precision arithmetic in term of ULPs. - typedef mat<4, 4, double, packed_mediump> packed_mediump_dmat4x4; - - /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers using low precision arithmetic in term of ULPs. - typedef mat<4, 4, double, packed_lowp> packed_lowp_dmat4x4; - - // -- default -- - -#if(defined(GLM_PRECISION_LOWP_FLOAT)) - typedef aligned_lowp_vec1 aligned_vec1; - typedef aligned_lowp_vec2 aligned_vec2; - typedef aligned_lowp_vec3 aligned_vec3; - typedef aligned_lowp_vec4 aligned_vec4; - typedef packed_lowp_vec1 packed_vec1; - typedef packed_lowp_vec2 packed_vec2; - typedef packed_lowp_vec3 packed_vec3; - typedef packed_lowp_vec4 packed_vec4; - - typedef aligned_lowp_mat2 aligned_mat2; - typedef aligned_lowp_mat3 aligned_mat3; - typedef aligned_lowp_mat4 aligned_mat4; - typedef packed_lowp_mat2 packed_mat2; - typedef packed_lowp_mat3 packed_mat3; - typedef packed_lowp_mat4 packed_mat4; - - typedef aligned_lowp_mat2x2 aligned_mat2x2; - typedef aligned_lowp_mat2x3 aligned_mat2x3; - typedef aligned_lowp_mat2x4 aligned_mat2x4; - typedef aligned_lowp_mat3x2 aligned_mat3x2; - typedef aligned_lowp_mat3x3 aligned_mat3x3; - typedef aligned_lowp_mat3x4 aligned_mat3x4; - typedef aligned_lowp_mat4x2 aligned_mat4x2; - typedef aligned_lowp_mat4x3 aligned_mat4x3; - typedef aligned_lowp_mat4x4 aligned_mat4x4; - typedef packed_lowp_mat2x2 packed_mat2x2; - typedef packed_lowp_mat2x3 packed_mat2x3; - typedef packed_lowp_mat2x4 packed_mat2x4; - typedef packed_lowp_mat3x2 packed_mat3x2; - typedef packed_lowp_mat3x3 packed_mat3x3; - typedef packed_lowp_mat3x4 packed_mat3x4; - typedef packed_lowp_mat4x2 packed_mat4x2; - typedef packed_lowp_mat4x3 packed_mat4x3; - typedef packed_lowp_mat4x4 packed_mat4x4; -#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT)) - typedef aligned_mediump_vec1 aligned_vec1; - typedef aligned_mediump_vec2 aligned_vec2; - typedef aligned_mediump_vec3 aligned_vec3; - typedef aligned_mediump_vec4 aligned_vec4; - typedef packed_mediump_vec1 packed_vec1; - typedef packed_mediump_vec2 packed_vec2; - typedef packed_mediump_vec3 packed_vec3; - typedef packed_mediump_vec4 packed_vec4; - - typedef aligned_mediump_mat2 aligned_mat2; - typedef aligned_mediump_mat3 aligned_mat3; - typedef aligned_mediump_mat4 aligned_mat4; - typedef packed_mediump_mat2 packed_mat2; - typedef packed_mediump_mat3 packed_mat3; - typedef packed_mediump_mat4 packed_mat4; - - typedef aligned_mediump_mat2x2 aligned_mat2x2; - typedef aligned_mediump_mat2x3 aligned_mat2x3; - typedef aligned_mediump_mat2x4 aligned_mat2x4; - typedef aligned_mediump_mat3x2 aligned_mat3x2; - typedef aligned_mediump_mat3x3 aligned_mat3x3; - typedef aligned_mediump_mat3x4 aligned_mat3x4; - typedef aligned_mediump_mat4x2 aligned_mat4x2; - typedef aligned_mediump_mat4x3 aligned_mat4x3; - typedef aligned_mediump_mat4x4 aligned_mat4x4; - typedef packed_mediump_mat2x2 packed_mat2x2; - typedef packed_mediump_mat2x3 packed_mat2x3; - typedef packed_mediump_mat2x4 packed_mat2x4; - typedef packed_mediump_mat3x2 packed_mat3x2; - typedef packed_mediump_mat3x3 packed_mat3x3; - typedef packed_mediump_mat3x4 packed_mat3x4; - typedef packed_mediump_mat4x2 packed_mat4x2; - typedef packed_mediump_mat4x3 packed_mat4x3; - typedef packed_mediump_mat4x4 packed_mat4x4; -#else //defined(GLM_PRECISION_HIGHP_FLOAT) - /// 1 component vector aligned in memory of single-precision floating-point numbers. - typedef aligned_highp_vec1 aligned_vec1; - - /// 2 components vector aligned in memory of single-precision floating-point numbers. - typedef aligned_highp_vec2 aligned_vec2; - - /// 3 components vector aligned in memory of single-precision floating-point numbers. - typedef aligned_highp_vec3 aligned_vec3; - - /// 4 components vector aligned in memory of single-precision floating-point numbers. - typedef aligned_highp_vec4 aligned_vec4; - - /// 1 component vector tightly packed in memory of single-precision floating-point numbers. - typedef packed_highp_vec1 packed_vec1; - - /// 2 components vector tightly packed in memory of single-precision floating-point numbers. - typedef packed_highp_vec2 packed_vec2; - - /// 3 components vector tightly packed in memory of single-precision floating-point numbers. - typedef packed_highp_vec3 packed_vec3; - - /// 4 components vector tightly packed in memory of single-precision floating-point numbers. - typedef packed_highp_vec4 packed_vec4; - - /// 2 by 2 matrix tightly aligned in memory of single-precision floating-point numbers. - typedef aligned_highp_mat2 aligned_mat2; - - /// 3 by 3 matrix tightly aligned in memory of single-precision floating-point numbers. - typedef aligned_highp_mat3 aligned_mat3; - - /// 4 by 4 matrix tightly aligned in memory of single-precision floating-point numbers. - typedef aligned_highp_mat4 aligned_mat4; - - /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers. - typedef packed_highp_mat2 packed_mat2; - - /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers. - typedef packed_highp_mat3 packed_mat3; - - /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers. - typedef packed_highp_mat4 packed_mat4; - - /// 2 by 2 matrix tightly aligned in memory of single-precision floating-point numbers. - typedef aligned_highp_mat2x2 aligned_mat2x2; - - /// 2 by 3 matrix tightly aligned in memory of single-precision floating-point numbers. - typedef aligned_highp_mat2x3 aligned_mat2x3; - - /// 2 by 4 matrix tightly aligned in memory of single-precision floating-point numbers. - typedef aligned_highp_mat2x4 aligned_mat2x4; - - /// 3 by 2 matrix tightly aligned in memory of single-precision floating-point numbers. - typedef aligned_highp_mat3x2 aligned_mat3x2; - - /// 3 by 3 matrix tightly aligned in memory of single-precision floating-point numbers. - typedef aligned_highp_mat3x3 aligned_mat3x3; - - /// 3 by 4 matrix tightly aligned in memory of single-precision floating-point numbers. - typedef aligned_highp_mat3x4 aligned_mat3x4; - - /// 4 by 2 matrix tightly aligned in memory of single-precision floating-point numbers. - typedef aligned_highp_mat4x2 aligned_mat4x2; - - /// 4 by 3 matrix tightly aligned in memory of single-precision floating-point numbers. - typedef aligned_highp_mat4x3 aligned_mat4x3; - - /// 4 by 4 matrix tightly aligned in memory of single-precision floating-point numbers. - typedef aligned_highp_mat4x4 aligned_mat4x4; - - /// 2 by 2 matrix tightly packed in memory of single-precision floating-point numbers. - typedef packed_highp_mat2x2 packed_mat2x2; - - /// 2 by 3 matrix tightly packed in memory of single-precision floating-point numbers. - typedef packed_highp_mat2x3 packed_mat2x3; - - /// 2 by 4 matrix tightly packed in memory of single-precision floating-point numbers. - typedef packed_highp_mat2x4 packed_mat2x4; - - /// 3 by 2 matrix tightly packed in memory of single-precision floating-point numbers. - typedef packed_highp_mat3x2 packed_mat3x2; - - /// 3 by 3 matrix tightly packed in memory of single-precision floating-point numbers. - typedef packed_highp_mat3x3 packed_mat3x3; - - /// 3 by 4 matrix tightly packed in memory of single-precision floating-point numbers. - typedef packed_highp_mat3x4 packed_mat3x4; - - /// 4 by 2 matrix tightly packed in memory of single-precision floating-point numbers. - typedef packed_highp_mat4x2 packed_mat4x2; - - /// 4 by 3 matrix tightly packed in memory of single-precision floating-point numbers. - typedef packed_highp_mat4x3 packed_mat4x3; - - /// 4 by 4 matrix tightly packed in memory of single-precision floating-point numbers. - typedef packed_highp_mat4x4 packed_mat4x4; -#endif//GLM_PRECISION - -#if(defined(GLM_PRECISION_LOWP_DOUBLE)) - typedef aligned_lowp_dvec1 aligned_dvec1; - typedef aligned_lowp_dvec2 aligned_dvec2; - typedef aligned_lowp_dvec3 aligned_dvec3; - typedef aligned_lowp_dvec4 aligned_dvec4; - typedef packed_lowp_dvec1 packed_dvec1; - typedef packed_lowp_dvec2 packed_dvec2; - typedef packed_lowp_dvec3 packed_dvec3; - typedef packed_lowp_dvec4 packed_dvec4; - - typedef aligned_lowp_dmat2 aligned_dmat2; - typedef aligned_lowp_dmat3 aligned_dmat3; - typedef aligned_lowp_dmat4 aligned_dmat4; - typedef packed_lowp_dmat2 packed_dmat2; - typedef packed_lowp_dmat3 packed_dmat3; - typedef packed_lowp_dmat4 packed_dmat4; - - typedef aligned_lowp_dmat2x2 aligned_dmat2x2; - typedef aligned_lowp_dmat2x3 aligned_dmat2x3; - typedef aligned_lowp_dmat2x4 aligned_dmat2x4; - typedef aligned_lowp_dmat3x2 aligned_dmat3x2; - typedef aligned_lowp_dmat3x3 aligned_dmat3x3; - typedef aligned_lowp_dmat3x4 aligned_dmat3x4; - typedef aligned_lowp_dmat4x2 aligned_dmat4x2; - typedef aligned_lowp_dmat4x3 aligned_dmat4x3; - typedef aligned_lowp_dmat4x4 aligned_dmat4x4; - typedef packed_lowp_dmat2x2 packed_dmat2x2; - typedef packed_lowp_dmat2x3 packed_dmat2x3; - typedef packed_lowp_dmat2x4 packed_dmat2x4; - typedef packed_lowp_dmat3x2 packed_dmat3x2; - typedef packed_lowp_dmat3x3 packed_dmat3x3; - typedef packed_lowp_dmat3x4 packed_dmat3x4; - typedef packed_lowp_dmat4x2 packed_dmat4x2; - typedef packed_lowp_dmat4x3 packed_dmat4x3; - typedef packed_lowp_dmat4x4 packed_dmat4x4; -#elif(defined(GLM_PRECISION_MEDIUMP_DOUBLE)) - typedef aligned_mediump_dvec1 aligned_dvec1; - typedef aligned_mediump_dvec2 aligned_dvec2; - typedef aligned_mediump_dvec3 aligned_dvec3; - typedef aligned_mediump_dvec4 aligned_dvec4; - typedef packed_mediump_dvec1 packed_dvec1; - typedef packed_mediump_dvec2 packed_dvec2; - typedef packed_mediump_dvec3 packed_dvec3; - typedef packed_mediump_dvec4 packed_dvec4; - - typedef aligned_mediump_dmat2 aligned_dmat2; - typedef aligned_mediump_dmat3 aligned_dmat3; - typedef aligned_mediump_dmat4 aligned_dmat4; - typedef packed_mediump_dmat2 packed_dmat2; - typedef packed_mediump_dmat3 packed_dmat3; - typedef packed_mediump_dmat4 packed_dmat4; - - typedef aligned_mediump_dmat2x2 aligned_dmat2x2; - typedef aligned_mediump_dmat2x3 aligned_dmat2x3; - typedef aligned_mediump_dmat2x4 aligned_dmat2x4; - typedef aligned_mediump_dmat3x2 aligned_dmat3x2; - typedef aligned_mediump_dmat3x3 aligned_dmat3x3; - typedef aligned_mediump_dmat3x4 aligned_dmat3x4; - typedef aligned_mediump_dmat4x2 aligned_dmat4x2; - typedef aligned_mediump_dmat4x3 aligned_dmat4x3; - typedef aligned_mediump_dmat4x4 aligned_dmat4x4; - typedef packed_mediump_dmat2x2 packed_dmat2x2; - typedef packed_mediump_dmat2x3 packed_dmat2x3; - typedef packed_mediump_dmat2x4 packed_dmat2x4; - typedef packed_mediump_dmat3x2 packed_dmat3x2; - typedef packed_mediump_dmat3x3 packed_dmat3x3; - typedef packed_mediump_dmat3x4 packed_dmat3x4; - typedef packed_mediump_dmat4x2 packed_dmat4x2; - typedef packed_mediump_dmat4x3 packed_dmat4x3; - typedef packed_mediump_dmat4x4 packed_dmat4x4; -#else //defined(GLM_PRECISION_HIGHP_DOUBLE) - /// 1 component vector aligned in memory of double-precision floating-point numbers. - typedef aligned_highp_dvec1 aligned_dvec1; - - /// 2 components vector aligned in memory of double-precision floating-point numbers. - typedef aligned_highp_dvec2 aligned_dvec2; - - /// 3 components vector aligned in memory of double-precision floating-point numbers. - typedef aligned_highp_dvec3 aligned_dvec3; - - /// 4 components vector aligned in memory of double-precision floating-point numbers. - typedef aligned_highp_dvec4 aligned_dvec4; - - /// 1 component vector tightly packed in memory of double-precision floating-point numbers. - typedef packed_highp_dvec1 packed_dvec1; - - /// 2 components vector tightly packed in memory of double-precision floating-point numbers. - typedef packed_highp_dvec2 packed_dvec2; - - /// 3 components vector tightly packed in memory of double-precision floating-point numbers. - typedef packed_highp_dvec3 packed_dvec3; - - /// 4 components vector tightly packed in memory of double-precision floating-point numbers. - typedef packed_highp_dvec4 packed_dvec4; - - /// 2 by 2 matrix tightly aligned in memory of double-precision floating-point numbers. - typedef aligned_highp_dmat2 aligned_dmat2; - - /// 3 by 3 matrix tightly aligned in memory of double-precision floating-point numbers. - typedef aligned_highp_dmat3 aligned_dmat3; - - /// 4 by 4 matrix tightly aligned in memory of double-precision floating-point numbers. - typedef aligned_highp_dmat4 aligned_dmat4; - - /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers. - typedef packed_highp_dmat2 packed_dmat2; - - /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers. - typedef packed_highp_dmat3 packed_dmat3; - - /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers. - typedef packed_highp_dmat4 packed_dmat4; - - /// 2 by 2 matrix tightly aligned in memory of double-precision floating-point numbers. - typedef aligned_highp_dmat2x2 aligned_dmat2x2; - - /// 2 by 3 matrix tightly aligned in memory of double-precision floating-point numbers. - typedef aligned_highp_dmat2x3 aligned_dmat2x3; - - /// 2 by 4 matrix tightly aligned in memory of double-precision floating-point numbers. - typedef aligned_highp_dmat2x4 aligned_dmat2x4; - - /// 3 by 2 matrix tightly aligned in memory of double-precision floating-point numbers. - typedef aligned_highp_dmat3x2 aligned_dmat3x2; - - /// 3 by 3 matrix tightly aligned in memory of double-precision floating-point numbers. - typedef aligned_highp_dmat3x3 aligned_dmat3x3; - - /// 3 by 4 matrix tightly aligned in memory of double-precision floating-point numbers. - typedef aligned_highp_dmat3x4 aligned_dmat3x4; - - /// 4 by 2 matrix tightly aligned in memory of double-precision floating-point numbers. - typedef aligned_highp_dmat4x2 aligned_dmat4x2; - - /// 4 by 3 matrix tightly aligned in memory of double-precision floating-point numbers. - typedef aligned_highp_dmat4x3 aligned_dmat4x3; - - /// 4 by 4 matrix tightly aligned in memory of double-precision floating-point numbers. - typedef aligned_highp_dmat4x4 aligned_dmat4x4; - - /// 2 by 2 matrix tightly packed in memory of double-precision floating-point numbers. - typedef packed_highp_dmat2x2 packed_dmat2x2; - - /// 2 by 3 matrix tightly packed in memory of double-precision floating-point numbers. - typedef packed_highp_dmat2x3 packed_dmat2x3; - - /// 2 by 4 matrix tightly packed in memory of double-precision floating-point numbers. - typedef packed_highp_dmat2x4 packed_dmat2x4; - - /// 3 by 2 matrix tightly packed in memory of double-precision floating-point numbers. - typedef packed_highp_dmat3x2 packed_dmat3x2; - - /// 3 by 3 matrix tightly packed in memory of double-precision floating-point numbers. - typedef packed_highp_dmat3x3 packed_dmat3x3; - - /// 3 by 4 matrix tightly packed in memory of double-precision floating-point numbers. - typedef packed_highp_dmat3x4 packed_dmat3x4; - - /// 4 by 2 matrix tightly packed in memory of double-precision floating-point numbers. - typedef packed_highp_dmat4x2 packed_dmat4x2; - - /// 4 by 3 matrix tightly packed in memory of double-precision floating-point numbers. - typedef packed_highp_dmat4x3 packed_dmat4x3; - - /// 4 by 4 matrix tightly packed in memory of double-precision floating-point numbers. - typedef packed_highp_dmat4x4 packed_dmat4x4; -#endif//GLM_PRECISION - -#if(defined(GLM_PRECISION_LOWP_INT)) - typedef aligned_lowp_ivec1 aligned_ivec1; - typedef aligned_lowp_ivec2 aligned_ivec2; - typedef aligned_lowp_ivec3 aligned_ivec3; - typedef aligned_lowp_ivec4 aligned_ivec4; -#elif(defined(GLM_PRECISION_MEDIUMP_INT)) - typedef aligned_mediump_ivec1 aligned_ivec1; - typedef aligned_mediump_ivec2 aligned_ivec2; - typedef aligned_mediump_ivec3 aligned_ivec3; - typedef aligned_mediump_ivec4 aligned_ivec4; -#else //defined(GLM_PRECISION_HIGHP_INT) - /// 1 component vector aligned in memory of signed integer numbers. - typedef aligned_highp_ivec1 aligned_ivec1; - - /// 2 components vector aligned in memory of signed integer numbers. - typedef aligned_highp_ivec2 aligned_ivec2; - - /// 3 components vector aligned in memory of signed integer numbers. - typedef aligned_highp_ivec3 aligned_ivec3; - - /// 4 components vector aligned in memory of signed integer numbers. - typedef aligned_highp_ivec4 aligned_ivec4; - - /// 1 component vector tightly packed in memory of signed integer numbers. - typedef packed_highp_ivec1 packed_ivec1; - - /// 2 components vector tightly packed in memory of signed integer numbers. - typedef packed_highp_ivec2 packed_ivec2; - - /// 3 components vector tightly packed in memory of signed integer numbers. - typedef packed_highp_ivec3 packed_ivec3; - - /// 4 components vector tightly packed in memory of signed integer numbers. - typedef packed_highp_ivec4 packed_ivec4; -#endif//GLM_PRECISION - - // -- Unsigned integer definition -- - -#if(defined(GLM_PRECISION_LOWP_UINT)) - typedef aligned_lowp_uvec1 aligned_uvec1; - typedef aligned_lowp_uvec2 aligned_uvec2; - typedef aligned_lowp_uvec3 aligned_uvec3; - typedef aligned_lowp_uvec4 aligned_uvec4; -#elif(defined(GLM_PRECISION_MEDIUMP_UINT)) - typedef aligned_mediump_uvec1 aligned_uvec1; - typedef aligned_mediump_uvec2 aligned_uvec2; - typedef aligned_mediump_uvec3 aligned_uvec3; - typedef aligned_mediump_uvec4 aligned_uvec4; -#else //defined(GLM_PRECISION_HIGHP_UINT) - /// 1 component vector aligned in memory of unsigned integer numbers. - typedef aligned_highp_uvec1 aligned_uvec1; - - /// 2 components vector aligned in memory of unsigned integer numbers. - typedef aligned_highp_uvec2 aligned_uvec2; - - /// 3 components vector aligned in memory of unsigned integer numbers. - typedef aligned_highp_uvec3 aligned_uvec3; - - /// 4 components vector aligned in memory of unsigned integer numbers. - typedef aligned_highp_uvec4 aligned_uvec4; - - /// 1 component vector tightly packed in memory of unsigned integer numbers. - typedef packed_highp_uvec1 packed_uvec1; - - /// 2 components vector tightly packed in memory of unsigned integer numbers. - typedef packed_highp_uvec2 packed_uvec2; - - /// 3 components vector tightly packed in memory of unsigned integer numbers. - typedef packed_highp_uvec3 packed_uvec3; - - /// 4 components vector tightly packed in memory of unsigned integer numbers. - typedef packed_highp_uvec4 packed_uvec4; -#endif//GLM_PRECISION - -#if(defined(GLM_PRECISION_LOWP_BOOL)) - typedef aligned_lowp_bvec1 aligned_bvec1; - typedef aligned_lowp_bvec2 aligned_bvec2; - typedef aligned_lowp_bvec3 aligned_bvec3; - typedef aligned_lowp_bvec4 aligned_bvec4; -#elif(defined(GLM_PRECISION_MEDIUMP_BOOL)) - typedef aligned_mediump_bvec1 aligned_bvec1; - typedef aligned_mediump_bvec2 aligned_bvec2; - typedef aligned_mediump_bvec3 aligned_bvec3; - typedef aligned_mediump_bvec4 aligned_bvec4; -#else //defined(GLM_PRECISION_HIGHP_BOOL) - /// 1 component vector aligned in memory of bool values. - typedef aligned_highp_bvec1 aligned_bvec1; - - /// 2 components vector aligned in memory of bool values. - typedef aligned_highp_bvec2 aligned_bvec2; - - /// 3 components vector aligned in memory of bool values. - typedef aligned_highp_bvec3 aligned_bvec3; - - /// 4 components vector aligned in memory of bool values. - typedef aligned_highp_bvec4 aligned_bvec4; - - /// 1 components vector tightly packed in memory of bool values. - typedef packed_highp_bvec1 packed_bvec1; - - /// 2 components vector tightly packed in memory of bool values. - typedef packed_highp_bvec2 packed_bvec2; - - /// 3 components vector tightly packed in memory of bool values. - typedef packed_highp_bvec3 packed_bvec3; - - /// 4 components vector tightly packed in memory of bool values. - typedef packed_highp_bvec4 packed_bvec4; -#endif//GLM_PRECISION - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtc/type_precision.hpp b/3rdparty/glm/source/glm/gtc/type_precision.hpp deleted file mode 100644 index 775e2f4..0000000 --- a/3rdparty/glm/source/glm/gtc/type_precision.hpp +++ /dev/null @@ -1,2094 +0,0 @@ -/// @ref gtc_type_precision -/// @file glm/gtc/type_precision.hpp -/// -/// @see core (dependence) -/// @see gtc_quaternion (dependence) -/// -/// @defgroup gtc_type_precision GLM_GTC_type_precision -/// @ingroup gtc -/// -/// Include to use the features of this extension. -/// -/// Defines specific C++-based qualifier types. - -#pragma once - -// Dependency: -#include "../gtc/quaternion.hpp" -#include "../gtc/vec1.hpp" -#include "../ext/vector_int1_sized.hpp" -#include "../ext/vector_int2_sized.hpp" -#include "../ext/vector_int3_sized.hpp" -#include "../ext/vector_int4_sized.hpp" -#include "../ext/scalar_int_sized.hpp" -#include "../ext/vector_uint1_sized.hpp" -#include "../ext/vector_uint2_sized.hpp" -#include "../ext/vector_uint3_sized.hpp" -#include "../ext/vector_uint4_sized.hpp" -#include "../ext/scalar_uint_sized.hpp" -#include "../detail/type_vec2.hpp" -#include "../detail/type_vec3.hpp" -#include "../detail/type_vec4.hpp" -#include "../detail/type_mat2x2.hpp" -#include "../detail/type_mat2x3.hpp" -#include "../detail/type_mat2x4.hpp" -#include "../detail/type_mat3x2.hpp" -#include "../detail/type_mat3x3.hpp" -#include "../detail/type_mat3x4.hpp" -#include "../detail/type_mat4x2.hpp" -#include "../detail/type_mat4x3.hpp" -#include "../detail/type_mat4x4.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTC_type_precision extension included") -#endif - -namespace glm -{ - /////////////////////////// - // Signed int vector types - - /// @addtogroup gtc_type_precision - /// @{ - - /// Low qualifier 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 lowp_int8; - - /// Low qualifier 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 lowp_int16; - - /// Low qualifier 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 lowp_int32; - - /// Low qualifier 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 lowp_int64; - - /// Low qualifier 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 lowp_int8_t; - - /// Low qualifier 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 lowp_int16_t; - - /// Low qualifier 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 lowp_int32_t; - - /// Low qualifier 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 lowp_int64_t; - - /// Low qualifier 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 lowp_i8; - - /// Low qualifier 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 lowp_i16; - - /// Low qualifier 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 lowp_i32; - - /// Low qualifier 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 lowp_i64; - - /// Medium qualifier 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 mediump_int8; - - /// Medium qualifier 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 mediump_int16; - - /// Medium qualifier 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 mediump_int32; - - /// Medium qualifier 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 mediump_int64; - - /// Medium qualifier 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 mediump_int8_t; - - /// Medium qualifier 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 mediump_int16_t; - - /// Medium qualifier 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 mediump_int32_t; - - /// Medium qualifier 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 mediump_int64_t; - - /// Medium qualifier 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 mediump_i8; - - /// Medium qualifier 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 mediump_i16; - - /// Medium qualifier 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 mediump_i32; - - /// Medium qualifier 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 mediump_i64; - - /// High qualifier 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 highp_int8; - - /// High qualifier 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 highp_int16; - - /// High qualifier 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 highp_int32; - - /// High qualifier 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 highp_int64; - - /// High qualifier 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 highp_int8_t; - - /// High qualifier 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 highp_int16_t; - - /// 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 highp_int32_t; - - /// High qualifier 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 highp_int64_t; - - /// High qualifier 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 highp_i8; - - /// High qualifier 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 highp_i16; - - /// High qualifier 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 highp_i32; - - /// High qualifier 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 highp_i64; - - -#if GLM_HAS_EXTENDED_INTEGER_TYPE - using std::int8_t; - using std::int16_t; - using std::int32_t; - using std::int64_t; -#else - /// 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 int8_t; - - /// 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 int16_t; - - /// 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 int32_t; - - /// 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 int64_t; -#endif - - /// 8 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int8 i8; - - /// 16 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int16 i16; - - /// 32 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int32 i32; - - /// 64 bit signed integer type. - /// @see gtc_type_precision - typedef detail::int64 i64; - - ///////////////////////////// - // Unsigned int vector types - - /// Low qualifier 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 lowp_uint8; - - /// Low qualifier 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 lowp_uint16; - - /// Low qualifier 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 lowp_uint32; - - /// Low qualifier 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 lowp_uint64; - - /// Low qualifier 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 lowp_uint8_t; - - /// Low qualifier 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 lowp_uint16_t; - - /// Low qualifier 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 lowp_uint32_t; - - /// Low qualifier 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 lowp_uint64_t; - - /// Low qualifier 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 lowp_u8; - - /// Low qualifier 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 lowp_u16; - - /// Low qualifier 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 lowp_u32; - - /// Low qualifier 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 lowp_u64; - - /// Medium qualifier 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 mediump_uint8; - - /// Medium qualifier 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 mediump_uint16; - - /// Medium qualifier 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 mediump_uint32; - - /// Medium qualifier 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 mediump_uint64; - - /// Medium qualifier 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 mediump_uint8_t; - - /// Medium qualifier 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 mediump_uint16_t; - - /// Medium qualifier 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 mediump_uint32_t; - - /// Medium qualifier 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 mediump_uint64_t; - - /// Medium qualifier 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 mediump_u8; - - /// Medium qualifier 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 mediump_u16; - - /// Medium qualifier 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 mediump_u32; - - /// Medium qualifier 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 mediump_u64; - - /// High qualifier 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 highp_uint8; - - /// High qualifier 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 highp_uint16; - - /// High qualifier 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 highp_uint32; - - /// High qualifier 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 highp_uint64; - - /// High qualifier 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 highp_uint8_t; - - /// High qualifier 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 highp_uint16_t; - - /// High qualifier 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 highp_uint32_t; - - /// High qualifier 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 highp_uint64_t; - - /// High qualifier 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 highp_u8; - - /// High qualifier 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 highp_u16; - - /// High qualifier 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 highp_u32; - - /// High qualifier 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 highp_u64; - -#if GLM_HAS_EXTENDED_INTEGER_TYPE - using std::uint8_t; - using std::uint16_t; - using std::uint32_t; - using std::uint64_t; -#else - /// Default qualifier 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 uint8_t; - - /// Default qualifier 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 uint16_t; - - /// Default qualifier 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 uint32_t; - - /// Default qualifier 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 uint64_t; -#endif - - /// Default qualifier 8 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint8 u8; - - /// Default qualifier 16 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint16 u16; - - /// Default qualifier 32 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint32 u32; - - /// Default qualifier 64 bit unsigned integer type. - /// @see gtc_type_precision - typedef detail::uint64 u64; - - - - - - ////////////////////// - // Float vector types - - /// Single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float float32; - - /// Double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef double float64; - - /// Low 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float32 lowp_float32; - - /// Low 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float64 lowp_float64; - - /// Low 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float32 lowp_float32_t; - - /// Low 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float64 lowp_float64_t; - - /// Low 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float32 lowp_f32; - - /// Low 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float64 lowp_f64; - - /// Low 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float32 lowp_float32; - - /// Low 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float64 lowp_float64; - - /// Low 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float32 lowp_float32_t; - - /// Low 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float64 lowp_float64_t; - - /// Low 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float32 lowp_f32; - - /// Low 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float64 lowp_f64; - - - /// Low 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float32 lowp_float32; - - /// Low 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float64 lowp_float64; - - /// Low 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float32 lowp_float32_t; - - /// Low 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float64 lowp_float64_t; - - /// Low 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float32 lowp_f32; - - /// Low 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float64 lowp_f64; - - - /// Medium 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float32 mediump_float32; - - /// Medium 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float64 mediump_float64; - - /// Medium 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float32 mediump_float32_t; - - /// Medium 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float64 mediump_float64_t; - - /// Medium 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float32 mediump_f32; - - /// Medium 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float64 mediump_f64; - - - /// High 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float32 highp_float32; - - /// High 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float64 highp_float64; - - /// High 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float32 highp_float32_t; - - /// High 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float64 highp_float64_t; - - /// High 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float32 highp_f32; - - /// High 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float64 highp_f64; - - -#if(defined(GLM_PRECISION_LOWP_FLOAT)) - /// Default 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef lowp_float32_t float32_t; - - /// Default 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef lowp_float64_t float64_t; - - /// Default 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef lowp_f32 f32; - - /// Default 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef lowp_f64 f64; - -#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT)) - /// Default 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef mediump_float32 float32_t; - - /// Default 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef mediump_float64 float64_t; - - /// Default 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef mediump_float32 f32; - - /// Default 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef mediump_float64 f64; - -#else//(defined(GLM_PRECISION_HIGHP_FLOAT)) - - /// Default 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef highp_float32_t float32_t; - - /// Default 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef highp_float64_t float64_t; - - /// Default 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef highp_float32_t f32; - - /// Default 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef highp_float64_t f64; -#endif - - - /// Low single-qualifier floating-point vector of 1 component. - /// @see gtc_type_precision - typedef vec<1, float, lowp> lowp_fvec1; - - /// Low single-qualifier floating-point vector of 2 components. - /// @see gtc_type_precision - typedef vec<2, float, lowp> lowp_fvec2; - - /// Low single-qualifier floating-point vector of 3 components. - /// @see gtc_type_precision - typedef vec<3, float, lowp> lowp_fvec3; - - /// Low single-qualifier floating-point vector of 4 components. - /// @see gtc_type_precision - typedef vec<4, float, lowp> lowp_fvec4; - - - /// Medium single-qualifier floating-point vector of 1 component. - /// @see gtc_type_precision - typedef vec<1, float, mediump> mediump_fvec1; - - /// Medium Single-qualifier floating-point vector of 2 components. - /// @see gtc_type_precision - typedef vec<2, float, mediump> mediump_fvec2; - - /// Medium Single-qualifier floating-point vector of 3 components. - /// @see gtc_type_precision - typedef vec<3, float, mediump> mediump_fvec3; - - /// Medium Single-qualifier floating-point vector of 4 components. - /// @see gtc_type_precision - typedef vec<4, float, mediump> mediump_fvec4; - - - /// High single-qualifier floating-point vector of 1 component. - /// @see gtc_type_precision - typedef vec<1, float, highp> highp_fvec1; - - /// High Single-qualifier floating-point vector of 2 components. - /// @see core_precision - typedef vec<2, float, highp> highp_fvec2; - - /// High Single-qualifier floating-point vector of 3 components. - /// @see core_precision - typedef vec<3, float, highp> highp_fvec3; - - /// High Single-qualifier floating-point vector of 4 components. - /// @see core_precision - typedef vec<4, float, highp> highp_fvec4; - - - /// Low single-qualifier floating-point vector of 1 component. - /// @see gtc_type_precision - typedef vec<1, f32, lowp> lowp_f32vec1; - - /// Low single-qualifier floating-point vector of 2 components. - /// @see core_precision - typedef vec<2, f32, lowp> lowp_f32vec2; - - /// Low single-qualifier floating-point vector of 3 components. - /// @see core_precision - typedef vec<3, f32, lowp> lowp_f32vec3; - - /// Low single-qualifier floating-point vector of 4 components. - /// @see core_precision - typedef vec<4, f32, lowp> lowp_f32vec4; - - /// Medium single-qualifier floating-point vector of 1 component. - /// @see gtc_type_precision - typedef vec<1, f32, mediump> mediump_f32vec1; - - /// Medium single-qualifier floating-point vector of 2 components. - /// @see core_precision - typedef vec<2, f32, mediump> mediump_f32vec2; - - /// Medium single-qualifier floating-point vector of 3 components. - /// @see core_precision - typedef vec<3, f32, mediump> mediump_f32vec3; - - /// Medium single-qualifier floating-point vector of 4 components. - /// @see core_precision - typedef vec<4, f32, mediump> mediump_f32vec4; - - /// High single-qualifier floating-point vector of 1 component. - /// @see gtc_type_precision - typedef vec<1, f32, highp> highp_f32vec1; - - /// High single-qualifier floating-point vector of 2 components. - /// @see gtc_type_precision - typedef vec<2, f32, highp> highp_f32vec2; - - /// High single-qualifier floating-point vector of 3 components. - /// @see gtc_type_precision - typedef vec<3, f32, highp> highp_f32vec3; - - /// High single-qualifier floating-point vector of 4 components. - /// @see gtc_type_precision - typedef vec<4, f32, highp> highp_f32vec4; - - - /// Low double-qualifier floating-point vector of 1 component. - /// @see gtc_type_precision - typedef vec<1, f64, lowp> lowp_f64vec1; - - /// Low double-qualifier floating-point vector of 2 components. - /// @see gtc_type_precision - typedef vec<2, f64, lowp> lowp_f64vec2; - - /// Low double-qualifier floating-point vector of 3 components. - /// @see gtc_type_precision - typedef vec<3, f64, lowp> lowp_f64vec3; - - /// Low double-qualifier floating-point vector of 4 components. - /// @see gtc_type_precision - typedef vec<4, f64, lowp> lowp_f64vec4; - - /// Medium double-qualifier floating-point vector of 1 component. - /// @see gtc_type_precision - typedef vec<1, f64, mediump> mediump_f64vec1; - - /// Medium double-qualifier floating-point vector of 2 components. - /// @see gtc_type_precision - typedef vec<2, f64, mediump> mediump_f64vec2; - - /// Medium double-qualifier floating-point vector of 3 components. - /// @see gtc_type_precision - typedef vec<3, f64, mediump> mediump_f64vec3; - - /// Medium double-qualifier floating-point vector of 4 components. - /// @see gtc_type_precision - typedef vec<4, f64, mediump> mediump_f64vec4; - - /// High double-qualifier floating-point vector of 1 component. - /// @see gtc_type_precision - typedef vec<1, f64, highp> highp_f64vec1; - - /// High double-qualifier floating-point vector of 2 components. - /// @see gtc_type_precision - typedef vec<2, f64, highp> highp_f64vec2; - - /// High double-qualifier floating-point vector of 3 components. - /// @see gtc_type_precision - typedef vec<3, f64, highp> highp_f64vec3; - - /// High double-qualifier floating-point vector of 4 components. - /// @see gtc_type_precision - typedef vec<4, f64, highp> highp_f64vec4; - - - - ////////////////////// - // Float matrix types - - /// Low single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef lowp_f32 lowp_fmat1x1; - - /// Low single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mat<2, 2, f32, lowp> lowp_fmat2x2; - - /// Low single-qualifier floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef mat<2, 3, f32, lowp> lowp_fmat2x3; - - /// Low single-qualifier floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef mat<2, 4, f32, lowp> lowp_fmat2x4; - - /// Low single-qualifier floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef mat<3, 2, f32, lowp> lowp_fmat3x2; - - /// Low single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mat<3, 3, f32, lowp> lowp_fmat3x3; - - /// Low single-qualifier floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef mat<3, 4, f32, lowp> lowp_fmat3x4; - - /// Low single-qualifier floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef mat<4, 2, f32, lowp> lowp_fmat4x2; - - /// Low single-qualifier floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef mat<4, 3, f32, lowp> lowp_fmat4x3; - - /// Low single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mat<4, 4, f32, lowp> lowp_fmat4x4; - - /// Low single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef lowp_fmat1x1 lowp_fmat1; - - /// Low single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef lowp_fmat2x2 lowp_fmat2; - - /// Low single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef lowp_fmat3x3 lowp_fmat3; - - /// Low single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef lowp_fmat4x4 lowp_fmat4; - - - /// Medium single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef mediump_f32 mediump_fmat1x1; - - /// Medium single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mat<2, 2, f32, mediump> mediump_fmat2x2; - - /// Medium single-qualifier floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef mat<2, 3, f32, mediump> mediump_fmat2x3; - - /// Medium single-qualifier floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef mat<2, 4, f32, mediump> mediump_fmat2x4; - - /// Medium single-qualifier floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef mat<3, 2, f32, mediump> mediump_fmat3x2; - - /// Medium single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mat<3, 3, f32, mediump> mediump_fmat3x3; - - /// Medium single-qualifier floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef mat<3, 4, f32, mediump> mediump_fmat3x4; - - /// Medium single-qualifier floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef mat<4, 2, f32, mediump> mediump_fmat4x2; - - /// Medium single-qualifier floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef mat<4, 3, f32, mediump> mediump_fmat4x3; - - /// Medium single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mat<4, 4, f32, mediump> mediump_fmat4x4; - - /// Medium single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef mediump_fmat1x1 mediump_fmat1; - - /// Medium single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mediump_fmat2x2 mediump_fmat2; - - /// Medium single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mediump_fmat3x3 mediump_fmat3; - - /// Medium single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mediump_fmat4x4 mediump_fmat4; - - - /// High single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef highp_f32 highp_fmat1x1; - - /// High single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mat<2, 2, f32, highp> highp_fmat2x2; - - /// High single-qualifier floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef mat<2, 3, f32, highp> highp_fmat2x3; - - /// High single-qualifier floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef mat<2, 4, f32, highp> highp_fmat2x4; - - /// High single-qualifier floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef mat<3, 2, f32, highp> highp_fmat3x2; - - /// High single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mat<3, 3, f32, highp> highp_fmat3x3; - - /// High single-qualifier floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef mat<3, 4, f32, highp> highp_fmat3x4; - - /// High single-qualifier floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef mat<4, 2, f32, highp> highp_fmat4x2; - - /// High single-qualifier floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef mat<4, 3, f32, highp> highp_fmat4x3; - - /// High single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mat<4, 4, f32, highp> highp_fmat4x4; - - /// High single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef highp_fmat1x1 highp_fmat1; - - /// High single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef highp_fmat2x2 highp_fmat2; - - /// High single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef highp_fmat3x3 highp_fmat3; - - /// High single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef highp_fmat4x4 highp_fmat4; - - - /// Low single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef f32 lowp_f32mat1x1; - - /// Low single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mat<2, 2, f32, lowp> lowp_f32mat2x2; - - /// Low single-qualifier floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef mat<2, 3, f32, lowp> lowp_f32mat2x3; - - /// Low single-qualifier floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef mat<2, 4, f32, lowp> lowp_f32mat2x4; - - /// Low single-qualifier floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef mat<3, 2, f32, lowp> lowp_f32mat3x2; - - /// Low single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mat<3, 3, f32, lowp> lowp_f32mat3x3; - - /// Low single-qualifier floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef mat<3, 4, f32, lowp> lowp_f32mat3x4; - - /// Low single-qualifier floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef mat<4, 2, f32, lowp> lowp_f32mat4x2; - - /// Low single-qualifier floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef mat<4, 3, f32, lowp> lowp_f32mat4x3; - - /// Low single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mat<4, 4, f32, lowp> lowp_f32mat4x4; - - /// Low single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef detail::tmat1x1 lowp_f32mat1; - - /// Low single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef lowp_f32mat2x2 lowp_f32mat2; - - /// Low single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef lowp_f32mat3x3 lowp_f32mat3; - - /// Low single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef lowp_f32mat4x4 lowp_f32mat4; - - - /// High single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef f32 mediump_f32mat1x1; - - /// Low single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mat<2, 2, f32, mediump> mediump_f32mat2x2; - - /// Medium single-qualifier floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef mat<2, 3, f32, mediump> mediump_f32mat2x3; - - /// Medium single-qualifier floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef mat<2, 4, f32, mediump> mediump_f32mat2x4; - - /// Medium single-qualifier floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef mat<3, 2, f32, mediump> mediump_f32mat3x2; - - /// Medium single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mat<3, 3, f32, mediump> mediump_f32mat3x3; - - /// Medium single-qualifier floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef mat<3, 4, f32, mediump> mediump_f32mat3x4; - - /// Medium single-qualifier floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef mat<4, 2, f32, mediump> mediump_f32mat4x2; - - /// Medium single-qualifier floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef mat<4, 3, f32, mediump> mediump_f32mat4x3; - - /// Medium single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mat<4, 4, f32, mediump> mediump_f32mat4x4; - - /// Medium single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef detail::tmat1x1 f32mat1; - - /// Medium single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mediump_f32mat2x2 mediump_f32mat2; - - /// Medium single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mediump_f32mat3x3 mediump_f32mat3; - - /// Medium single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mediump_f32mat4x4 mediump_f32mat4; - - - /// High single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef f32 highp_f32mat1x1; - - /// High single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mat<2, 2, f32, highp> highp_f32mat2x2; - - /// High single-qualifier floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef mat<2, 3, f32, highp> highp_f32mat2x3; - - /// High single-qualifier floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef mat<2, 4, f32, highp> highp_f32mat2x4; - - /// High single-qualifier floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef mat<3, 2, f32, highp> highp_f32mat3x2; - - /// High single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mat<3, 3, f32, highp> highp_f32mat3x3; - - /// High single-qualifier floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef mat<3, 4, f32, highp> highp_f32mat3x4; - - /// High single-qualifier floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef mat<4, 2, f32, highp> highp_f32mat4x2; - - /// High single-qualifier floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef mat<4, 3, f32, highp> highp_f32mat4x3; - - /// High single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mat<4, 4, f32, highp> highp_f32mat4x4; - - /// High single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef detail::tmat1x1 f32mat1; - - /// High single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef highp_f32mat2x2 highp_f32mat2; - - /// High single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef highp_f32mat3x3 highp_f32mat3; - - /// High single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef highp_f32mat4x4 highp_f32mat4; - - - /// Low double-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef f64 lowp_f64mat1x1; - - /// Low double-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mat<2, 2, f64, lowp> lowp_f64mat2x2; - - /// Low double-qualifier floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef mat<2, 3, f64, lowp> lowp_f64mat2x3; - - /// Low double-qualifier floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef mat<2, 4, f64, lowp> lowp_f64mat2x4; - - /// Low double-qualifier floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef mat<3, 2, f64, lowp> lowp_f64mat3x2; - - /// Low double-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mat<3, 3, f64, lowp> lowp_f64mat3x3; - - /// Low double-qualifier floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef mat<3, 4, f64, lowp> lowp_f64mat3x4; - - /// Low double-qualifier floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef mat<4, 2, f64, lowp> lowp_f64mat4x2; - - /// Low double-qualifier floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef mat<4, 3, f64, lowp> lowp_f64mat4x3; - - /// Low double-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mat<4, 4, f64, lowp> lowp_f64mat4x4; - - /// Low double-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef lowp_f64mat1x1 lowp_f64mat1; - - /// Low double-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef lowp_f64mat2x2 lowp_f64mat2; - - /// Low double-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef lowp_f64mat3x3 lowp_f64mat3; - - /// Low double-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef lowp_f64mat4x4 lowp_f64mat4; - - - /// Medium double-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef f64 Highp_f64mat1x1; - - /// Medium double-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mat<2, 2, f64, mediump> mediump_f64mat2x2; - - /// Medium double-qualifier floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef mat<2, 3, f64, mediump> mediump_f64mat2x3; - - /// Medium double-qualifier floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef mat<2, 4, f64, mediump> mediump_f64mat2x4; - - /// Medium double-qualifier floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef mat<3, 2, f64, mediump> mediump_f64mat3x2; - - /// Medium double-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mat<3, 3, f64, mediump> mediump_f64mat3x3; - - /// Medium double-qualifier floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef mat<3, 4, f64, mediump> mediump_f64mat3x4; - - /// Medium double-qualifier floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef mat<4, 2, f64, mediump> mediump_f64mat4x2; - - /// Medium double-qualifier floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef mat<4, 3, f64, mediump> mediump_f64mat4x3; - - /// Medium double-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mat<4, 4, f64, mediump> mediump_f64mat4x4; - - /// Medium double-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef mediump_f64mat1x1 mediump_f64mat1; - - /// Medium double-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mediump_f64mat2x2 mediump_f64mat2; - - /// Medium double-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mediump_f64mat3x3 mediump_f64mat3; - - /// Medium double-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mediump_f64mat4x4 mediump_f64mat4; - - /// High double-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef f64 highp_f64mat1x1; - - /// High double-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mat<2, 2, f64, highp> highp_f64mat2x2; - - /// High double-qualifier floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef mat<2, 3, f64, highp> highp_f64mat2x3; - - /// High double-qualifier floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef mat<2, 4, f64, highp> highp_f64mat2x4; - - /// High double-qualifier floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef mat<3, 2, f64, highp> highp_f64mat3x2; - - /// High double-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mat<3, 3, f64, highp> highp_f64mat3x3; - - /// High double-qualifier floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef mat<3, 4, f64, highp> highp_f64mat3x4; - - /// High double-qualifier floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef mat<4, 2, f64, highp> highp_f64mat4x2; - - /// High double-qualifier floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef mat<4, 3, f64, highp> highp_f64mat4x3; - - /// High double-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mat<4, 4, f64, highp> highp_f64mat4x4; - - /// High double-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef highp_f64mat1x1 highp_f64mat1; - - /// High double-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef highp_f64mat2x2 highp_f64mat2; - - /// High double-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef highp_f64mat3x3 highp_f64mat3; - - /// High double-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef highp_f64mat4x4 highp_f64mat4; - - - ///////////////////////////// - // Signed int vector types - - /// Low qualifier signed integer vector of 1 component type. - /// @see gtc_type_precision - typedef vec<1, int, lowp> lowp_ivec1; - - /// Low qualifier signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, int, lowp> lowp_ivec2; - - /// Low qualifier signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, int, lowp> lowp_ivec3; - - /// Low qualifier signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, int, lowp> lowp_ivec4; - - - /// Medium qualifier signed integer vector of 1 component type. - /// @see gtc_type_precision - typedef vec<1, int, mediump> mediump_ivec1; - - /// Medium qualifier signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, int, mediump> mediump_ivec2; - - /// Medium qualifier signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, int, mediump> mediump_ivec3; - - /// Medium qualifier signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, int, mediump> mediump_ivec4; - - - /// High qualifier signed integer vector of 1 component type. - /// @see gtc_type_precision - typedef vec<1, int, highp> highp_ivec1; - - /// High qualifier signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, int, highp> highp_ivec2; - - /// High qualifier signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, int, highp> highp_ivec3; - - /// High qualifier signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, int, highp> highp_ivec4; - - - /// Low qualifier 8 bit signed integer vector of 1 component type. - /// @see gtc_type_precision - typedef vec<1, i8, lowp> lowp_i8vec1; - - /// Low qualifier 8 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, i8, lowp> lowp_i8vec2; - - /// Low qualifier 8 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, i8, lowp> lowp_i8vec3; - - /// Low qualifier 8 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, i8, lowp> lowp_i8vec4; - - - /// Medium qualifier 8 bit signed integer scalar type. - /// @see gtc_type_precision - typedef vec<1, i8, mediump> mediump_i8vec1; - - /// Medium qualifier 8 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, i8, mediump> mediump_i8vec2; - - /// Medium qualifier 8 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, i8, mediump> mediump_i8vec3; - - /// Medium qualifier 8 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, i8, mediump> mediump_i8vec4; - - - /// High qualifier 8 bit signed integer scalar type. - /// @see gtc_type_precision - typedef vec<1, i8, highp> highp_i8vec1; - - /// High qualifier 8 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, i8, highp> highp_i8vec2; - - /// High qualifier 8 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, i8, highp> highp_i8vec3; - - /// High qualifier 8 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, i8, highp> highp_i8vec4; - - - /// Low qualifier 16 bit signed integer scalar type. - /// @see gtc_type_precision - typedef vec<1, i16, lowp> lowp_i16vec1; - - /// Low qualifier 16 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, i16, lowp> lowp_i16vec2; - - /// Low qualifier 16 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, i16, lowp> lowp_i16vec3; - - /// Low qualifier 16 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, i16, lowp> lowp_i16vec4; - - - /// Medium qualifier 16 bit signed integer scalar type. - /// @see gtc_type_precision - typedef vec<1, i16, mediump> mediump_i16vec1; - - /// Medium qualifier 16 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, i16, mediump> mediump_i16vec2; - - /// Medium qualifier 16 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, i16, mediump> mediump_i16vec3; - - /// Medium qualifier 16 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, i16, mediump> mediump_i16vec4; - - - /// High qualifier 16 bit signed integer scalar type. - /// @see gtc_type_precision - typedef vec<1, i16, highp> highp_i16vec1; - - /// High qualifier 16 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, i16, highp> highp_i16vec2; - - /// High qualifier 16 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, i16, highp> highp_i16vec3; - - /// High qualifier 16 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, i16, highp> highp_i16vec4; - - - /// Low qualifier 32 bit signed integer scalar type. - /// @see gtc_type_precision - typedef vec<1, i32, lowp> lowp_i32vec1; - - /// Low qualifier 32 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, i32, lowp> lowp_i32vec2; - - /// Low qualifier 32 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, i32, lowp> lowp_i32vec3; - - /// Low qualifier 32 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, i32, lowp> lowp_i32vec4; - - - /// Medium qualifier 32 bit signed integer scalar type. - /// @see gtc_type_precision - typedef vec<1, i32, mediump> mediump_i32vec1; - - /// Medium qualifier 32 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, i32, mediump> mediump_i32vec2; - - /// Medium qualifier 32 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, i32, mediump> mediump_i32vec3; - - /// Medium qualifier 32 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, i32, mediump> mediump_i32vec4; - - - /// High qualifier 32 bit signed integer scalar type. - /// @see gtc_type_precision - typedef vec<1, i32, highp> highp_i32vec1; - - /// High qualifier 32 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, i32, highp> highp_i32vec2; - - /// High qualifier 32 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, i32, highp> highp_i32vec3; - - /// High qualifier 32 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, i32, highp> highp_i32vec4; - - - /// Low qualifier 64 bit signed integer scalar type. - /// @see gtc_type_precision - typedef vec<1, i64, lowp> lowp_i64vec1; - - /// Low qualifier 64 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, i64, lowp> lowp_i64vec2; - - /// Low qualifier 64 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, i64, lowp> lowp_i64vec3; - - /// Low qualifier 64 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, i64, lowp> lowp_i64vec4; - - - /// Medium qualifier 64 bit signed integer scalar type. - /// @see gtc_type_precision - typedef vec<1, i64, mediump> mediump_i64vec1; - - /// Medium qualifier 64 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, i64, mediump> mediump_i64vec2; - - /// Medium qualifier 64 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, i64, mediump> mediump_i64vec3; - - /// Medium qualifier 64 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, i64, mediump> mediump_i64vec4; - - - /// High qualifier 64 bit signed integer scalar type. - /// @see gtc_type_precision - typedef vec<1, i64, highp> highp_i64vec1; - - /// High qualifier 64 bit signed integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, i64, highp> highp_i64vec2; - - /// High qualifier 64 bit signed integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, i64, highp> highp_i64vec3; - - /// High qualifier 64 bit signed integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, i64, highp> highp_i64vec4; - - - ///////////////////////////// - // Unsigned int vector types - - /// Low qualifier unsigned integer vector of 1 component type. - /// @see gtc_type_precision - typedef vec<1, uint, lowp> lowp_uvec1; - - /// Low qualifier unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, uint, lowp> lowp_uvec2; - - /// Low qualifier unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, uint, lowp> lowp_uvec3; - - /// Low qualifier unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, uint, lowp> lowp_uvec4; - - - /// Medium qualifier unsigned integer vector of 1 component type. - /// @see gtc_type_precision - typedef vec<1, uint, mediump> mediump_uvec1; - - /// Medium qualifier unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, uint, mediump> mediump_uvec2; - - /// Medium qualifier unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, uint, mediump> mediump_uvec3; - - /// Medium qualifier unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, uint, mediump> mediump_uvec4; - - - /// High qualifier unsigned integer vector of 1 component type. - /// @see gtc_type_precision - typedef vec<1, uint, highp> highp_uvec1; - - /// High qualifier unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, uint, highp> highp_uvec2; - - /// High qualifier unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, uint, highp> highp_uvec3; - - /// High qualifier unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, uint, highp> highp_uvec4; - - - /// Low qualifier 8 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u8, lowp> lowp_u8vec1; - - /// Low qualifier 8 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u8, lowp> lowp_u8vec2; - - /// Low qualifier 8 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u8, lowp> lowp_u8vec3; - - /// Low qualifier 8 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u8, lowp> lowp_u8vec4; - - - /// Medium qualifier 8 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u8, mediump> mediump_u8vec1; - - /// Medium qualifier 8 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u8, mediump> mediump_u8vec2; - - /// Medium qualifier 8 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u8, mediump> mediump_u8vec3; - - /// Medium qualifier 8 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u8, mediump> mediump_u8vec4; - - - /// High qualifier 8 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u8, highp> highp_u8vec1; - - /// High qualifier 8 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u8, highp> highp_u8vec2; - - /// High qualifier 8 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u8, highp> highp_u8vec3; - - /// High qualifier 8 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u8, highp> highp_u8vec4; - - - /// Low qualifier 16 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u16, lowp> lowp_u16vec1; - - /// Low qualifier 16 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u16, lowp> lowp_u16vec2; - - /// Low qualifier 16 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u16, lowp> lowp_u16vec3; - - /// Low qualifier 16 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u16, lowp> lowp_u16vec4; - - - /// Medium qualifier 16 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u16, mediump> mediump_u16vec1; - - /// Medium qualifier 16 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u16, mediump> mediump_u16vec2; - - /// Medium qualifier 16 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u16, mediump> mediump_u16vec3; - - /// Medium qualifier 16 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u16, mediump> mediump_u16vec4; - - - /// High qualifier 16 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u16, highp> highp_u16vec1; - - /// High qualifier 16 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u16, highp> highp_u16vec2; - - /// High qualifier 16 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u16, highp> highp_u16vec3; - - /// High qualifier 16 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u16, highp> highp_u16vec4; - - - /// Low qualifier 32 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u32, lowp> lowp_u32vec1; - - /// Low qualifier 32 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u32, lowp> lowp_u32vec2; - - /// Low qualifier 32 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u32, lowp> lowp_u32vec3; - - /// Low qualifier 32 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u32, lowp> lowp_u32vec4; - - - /// Medium qualifier 32 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u32, mediump> mediump_u32vec1; - - /// Medium qualifier 32 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u32, mediump> mediump_u32vec2; - - /// Medium qualifier 32 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u32, mediump> mediump_u32vec3; - - /// Medium qualifier 32 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u32, mediump> mediump_u32vec4; - - - /// High qualifier 32 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u32, highp> highp_u32vec1; - - /// High qualifier 32 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u32, highp> highp_u32vec2; - - /// High qualifier 32 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u32, highp> highp_u32vec3; - - /// High qualifier 32 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u32, highp> highp_u32vec4; - - - /// Low qualifier 64 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u64, lowp> lowp_u64vec1; - - /// Low qualifier 64 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u64, lowp> lowp_u64vec2; - - /// Low qualifier 64 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u64, lowp> lowp_u64vec3; - - /// Low qualifier 64 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u64, lowp> lowp_u64vec4; - - - /// Medium qualifier 64 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u64, mediump> mediump_u64vec1; - - /// Medium qualifier 64 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u64, mediump> mediump_u64vec2; - - /// Medium qualifier 64 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u64, mediump> mediump_u64vec3; - - /// Medium qualifier 64 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u64, mediump> mediump_u64vec4; - - - /// High qualifier 64 bit unsigned integer scalar type. - /// @see gtc_type_precision - typedef vec<1, u64, highp> highp_u64vec1; - - /// High qualifier 64 bit unsigned integer vector of 2 components type. - /// @see gtc_type_precision - typedef vec<2, u64, highp> highp_u64vec2; - - /// High qualifier 64 bit unsigned integer vector of 3 components type. - /// @see gtc_type_precision - typedef vec<3, u64, highp> highp_u64vec3; - - /// High qualifier 64 bit unsigned integer vector of 4 components type. - /// @see gtc_type_precision - typedef vec<4, u64, highp> highp_u64vec4; - - - ////////////////////// - // Float vector types - - /// 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float32 float32_t; - - /// 32 bit single-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float32 f32; - -# ifndef GLM_FORCE_SINGLE_ONLY - - /// 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float64 float64_t; - - /// 64 bit double-qualifier floating-point scalar. - /// @see gtc_type_precision - typedef float64 f64; -# endif//GLM_FORCE_SINGLE_ONLY - - /// Single-qualifier floating-point vector of 1 component. - /// @see gtc_type_precision - typedef vec<1, float, defaultp> fvec1; - - /// Single-qualifier floating-point vector of 2 components. - /// @see gtc_type_precision - typedef vec<2, float, defaultp> fvec2; - - /// Single-qualifier floating-point vector of 3 components. - /// @see gtc_type_precision - typedef vec<3, float, defaultp> fvec3; - - /// Single-qualifier floating-point vector of 4 components. - /// @see gtc_type_precision - typedef vec<4, float, defaultp> fvec4; - - - /// Single-qualifier floating-point vector of 1 component. - /// @see gtc_type_precision - typedef vec<1, f32, defaultp> f32vec1; - - /// Single-qualifier floating-point vector of 2 components. - /// @see gtc_type_precision - typedef vec<2, f32, defaultp> f32vec2; - - /// Single-qualifier floating-point vector of 3 components. - /// @see gtc_type_precision - typedef vec<3, f32, defaultp> f32vec3; - - /// Single-qualifier floating-point vector of 4 components. - /// @see gtc_type_precision - typedef vec<4, f32, defaultp> f32vec4; - -# ifndef GLM_FORCE_SINGLE_ONLY - /// Double-qualifier floating-point vector of 1 component. - /// @see gtc_type_precision - typedef vec<1, f64, defaultp> f64vec1; - - /// Double-qualifier floating-point vector of 2 components. - /// @see gtc_type_precision - typedef vec<2, f64, defaultp> f64vec2; - - /// Double-qualifier floating-point vector of 3 components. - /// @see gtc_type_precision - typedef vec<3, f64, defaultp> f64vec3; - - /// Double-qualifier floating-point vector of 4 components. - /// @see gtc_type_precision - typedef vec<4, f64, defaultp> f64vec4; -# endif//GLM_FORCE_SINGLE_ONLY - - - ////////////////////// - // Float matrix types - - /// Single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef detail::tmat1x1 fmat1; - - /// Single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mat<2, 2, f32, defaultp> fmat2; - - /// Single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mat<3, 3, f32, defaultp> fmat3; - - /// Single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mat<4, 4, f32, defaultp> fmat4; - - - /// Single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef f32 fmat1x1; - - /// Single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mat<2, 2, f32, defaultp> fmat2x2; - - /// Single-qualifier floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef mat<2, 3, f32, defaultp> fmat2x3; - - /// Single-qualifier floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef mat<2, 4, f32, defaultp> fmat2x4; - - /// Single-qualifier floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef mat<3, 2, f32, defaultp> fmat3x2; - - /// Single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mat<3, 3, f32, defaultp> fmat3x3; - - /// Single-qualifier floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef mat<3, 4, f32, defaultp> fmat3x4; - - /// Single-qualifier floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef mat<4, 2, f32, defaultp> fmat4x2; - - /// Single-qualifier floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef mat<4, 3, f32, defaultp> fmat4x3; - - /// Single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mat<4, 4, f32, defaultp> fmat4x4; - - - /// Single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef detail::tmat1x1 f32mat1; - - /// Single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mat<2, 2, f32, defaultp> f32mat2; - - /// Single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mat<3, 3, f32, defaultp> f32mat3; - - /// Single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mat<4, 4, f32, defaultp> f32mat4; - - - /// Single-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef f32 f32mat1x1; - - /// Single-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mat<2, 2, f32, defaultp> f32mat2x2; - - /// Single-qualifier floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef mat<2, 3, f32, defaultp> f32mat2x3; - - /// Single-qualifier floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef mat<2, 4, f32, defaultp> f32mat2x4; - - /// Single-qualifier floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef mat<3, 2, f32, defaultp> f32mat3x2; - - /// Single-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mat<3, 3, f32, defaultp> f32mat3x3; - - /// Single-qualifier floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef mat<3, 4, f32, defaultp> f32mat3x4; - - /// Single-qualifier floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef mat<4, 2, f32, defaultp> f32mat4x2; - - /// Single-qualifier floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef mat<4, 3, f32, defaultp> f32mat4x3; - - /// Single-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mat<4, 4, f32, defaultp> f32mat4x4; - - -# ifndef GLM_FORCE_SINGLE_ONLY - - /// Double-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef detail::tmat1x1 f64mat1; - - /// Double-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mat<2, 2, f64, defaultp> f64mat2; - - /// Double-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mat<3, 3, f64, defaultp> f64mat3; - - /// Double-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mat<4, 4, f64, defaultp> f64mat4; - - - /// Double-qualifier floating-point 1x1 matrix. - /// @see gtc_type_precision - //typedef f64 f64mat1x1; - - /// Double-qualifier floating-point 2x2 matrix. - /// @see gtc_type_precision - typedef mat<2, 2, f64, defaultp> f64mat2x2; - - /// Double-qualifier floating-point 2x3 matrix. - /// @see gtc_type_precision - typedef mat<2, 3, f64, defaultp> f64mat2x3; - - /// Double-qualifier floating-point 2x4 matrix. - /// @see gtc_type_precision - typedef mat<2, 4, f64, defaultp> f64mat2x4; - - /// Double-qualifier floating-point 3x2 matrix. - /// @see gtc_type_precision - typedef mat<3, 2, f64, defaultp> f64mat3x2; - - /// Double-qualifier floating-point 3x3 matrix. - /// @see gtc_type_precision - typedef mat<3, 3, f64, defaultp> f64mat3x3; - - /// Double-qualifier floating-point 3x4 matrix. - /// @see gtc_type_precision - typedef mat<3, 4, f64, defaultp> f64mat3x4; - - /// Double-qualifier floating-point 4x2 matrix. - /// @see gtc_type_precision - typedef mat<4, 2, f64, defaultp> f64mat4x2; - - /// Double-qualifier floating-point 4x3 matrix. - /// @see gtc_type_precision - typedef mat<4, 3, f64, defaultp> f64mat4x3; - - /// Double-qualifier floating-point 4x4 matrix. - /// @see gtc_type_precision - typedef mat<4, 4, f64, defaultp> f64mat4x4; - -# endif//GLM_FORCE_SINGLE_ONLY - - ////////////////////////// - // Quaternion types - - /// Single-qualifier floating-point quaternion. - /// @see gtc_type_precision - typedef qua f32quat; - - /// Low single-qualifier floating-point quaternion. - /// @see gtc_type_precision - typedef qua lowp_f32quat; - - /// Low double-qualifier floating-point quaternion. - /// @see gtc_type_precision - typedef qua lowp_f64quat; - - /// Medium single-qualifier floating-point quaternion. - /// @see gtc_type_precision - typedef qua mediump_f32quat; - -# ifndef GLM_FORCE_SINGLE_ONLY - - /// Medium double-qualifier floating-point quaternion. - /// @see gtc_type_precision - typedef qua mediump_f64quat; - - /// High single-qualifier floating-point quaternion. - /// @see gtc_type_precision - typedef qua highp_f32quat; - - /// High double-qualifier floating-point quaternion. - /// @see gtc_type_precision - typedef qua highp_f64quat; - - /// Double-qualifier floating-point quaternion. - /// @see gtc_type_precision - typedef qua f64quat; - -# endif//GLM_FORCE_SINGLE_ONLY - - /// @} -}//namespace glm - -#include "type_precision.inl" diff --git a/3rdparty/glm/source/glm/gtc/type_precision.inl b/3rdparty/glm/source/glm/gtc/type_precision.inl deleted file mode 100644 index ae80912..0000000 --- a/3rdparty/glm/source/glm/gtc/type_precision.inl +++ /dev/null @@ -1,6 +0,0 @@ -/// @ref gtc_precision - -namespace glm -{ - -} diff --git a/3rdparty/glm/source/glm/gtc/type_ptr.hpp b/3rdparty/glm/source/glm/gtc/type_ptr.hpp deleted file mode 100644 index d7e625a..0000000 --- a/3rdparty/glm/source/glm/gtc/type_ptr.hpp +++ /dev/null @@ -1,230 +0,0 @@ -/// @ref gtc_type_ptr -/// @file glm/gtc/type_ptr.hpp -/// -/// @see core (dependence) -/// @see gtc_quaternion (dependence) -/// -/// @defgroup gtc_type_ptr GLM_GTC_type_ptr -/// @ingroup gtc -/// -/// Include to use the features of this extension. -/// -/// Handles the interaction between pointers and vector, matrix types. -/// -/// This extension defines an overloaded function, glm::value_ptr. It returns -/// a pointer to the memory layout of the object. Matrix types store their values -/// in column-major order. -/// -/// This is useful for uploading data to matrices or copying data to buffer objects. -/// -/// Example: -/// @code -/// #include -/// #include -/// -/// glm::vec3 aVector(3); -/// glm::mat4 someMatrix(1.0); -/// -/// glUniform3fv(uniformLoc, 1, glm::value_ptr(aVector)); -/// glUniformMatrix4fv(uniformMatrixLoc, 1, GL_FALSE, glm::value_ptr(someMatrix)); -/// @endcode -/// -/// need to be included to use the features of this extension. - -#pragma once - -// Dependency: -#include "../gtc/quaternion.hpp" -#include "../gtc/vec1.hpp" -#include "../vec2.hpp" -#include "../vec3.hpp" -#include "../vec4.hpp" -#include "../mat2x2.hpp" -#include "../mat2x3.hpp" -#include "../mat2x4.hpp" -#include "../mat3x2.hpp" -#include "../mat3x3.hpp" -#include "../mat3x4.hpp" -#include "../mat4x2.hpp" -#include "../mat4x3.hpp" -#include "../mat4x4.hpp" -#include - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTC_type_ptr extension included") -#endif - -namespace glm -{ - /// @addtogroup gtc_type_ptr - /// @{ - - /// Return the constant address to the data of the input parameter. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL typename genType::value_type const * value_ptr(genType const& v); - - /// Build a vector from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<1, T, Q> const& v); - - /// Build a vector from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<2, T, Q> const& v); - - /// Build a vector from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<3, T, Q> const& v); - - /// Build a vector from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<4, T, Q> const& v); - - /// Build a vector from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<1, T, Q> const& v); - - /// Build a vector from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<2, T, Q> const& v); - - /// Build a vector from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<3, T, Q> const& v); - - /// Build a vector from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<4, T, Q> const& v); - - /// Build a vector from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<1, T, Q> const& v); - - /// Build a vector from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<2, T, Q> const& v); - - /// Build a vector from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<3, T, Q> const& v); - - /// Build a vector from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<4, T, Q> const& v); - - /// Build a vector from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<1, T, Q> const& v); - - /// Build a vector from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<2, T, Q> const& v); - - /// Build a vector from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<3, T, Q> const& v); - - /// Build a vector from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<4, T, Q> const& v); - - /// Build a vector from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL vec<2, T, defaultp> make_vec2(T const * const ptr); - - /// Build a vector from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL vec<3, T, defaultp> make_vec3(T const * const ptr); - - /// Build a vector from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL vec<4, T, defaultp> make_vec4(T const * const ptr); - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL mat<2, 2, T, defaultp> make_mat2x2(T const * const ptr); - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL mat<2, 3, T, defaultp> make_mat2x3(T const * const ptr); - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL mat<2, 4, T, defaultp> make_mat2x4(T const * const ptr); - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL mat<3, 2, T, defaultp> make_mat3x2(T const * const ptr); - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL mat<3, 3, T, defaultp> make_mat3x3(T const * const ptr); - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL mat<3, 4, T, defaultp> make_mat3x4(T const * const ptr); - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL mat<4, 2, T, defaultp> make_mat4x2(T const * const ptr); - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL mat<4, 3, T, defaultp> make_mat4x3(T const * const ptr); - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> make_mat4x4(T const * const ptr); - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL mat<2, 2, T, defaultp> make_mat2(T const * const ptr); - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL mat<3, 3, T, defaultp> make_mat3(T const * const ptr); - - /// Build a matrix from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> make_mat4(T const * const ptr); - - /// Build a quaternion from a pointer. - /// @see gtc_type_ptr - template - GLM_FUNC_DECL qua make_quat(T const * const ptr); - - /// @} -}//namespace glm - -#include "type_ptr.inl" diff --git a/3rdparty/glm/source/glm/gtc/type_ptr.inl b/3rdparty/glm/source/glm/gtc/type_ptr.inl deleted file mode 100644 index 26b20b5..0000000 --- a/3rdparty/glm/source/glm/gtc/type_ptr.inl +++ /dev/null @@ -1,386 +0,0 @@ -/// @ref gtc_type_ptr - -#include - -namespace glm -{ - /// @addtogroup gtc_type_ptr - /// @{ - - template - GLM_FUNC_QUALIFIER T const* value_ptr(vec<2, T, Q> const& v) - { - return &(v.x); - } - - template - GLM_FUNC_QUALIFIER T* value_ptr(vec<2, T, Q>& v) - { - return &(v.x); - } - - template - GLM_FUNC_QUALIFIER T const * value_ptr(vec<3, T, Q> const& v) - { - return &(v.x); - } - - template - GLM_FUNC_QUALIFIER T* value_ptr(vec<3, T, Q>& v) - { - return &(v.x); - } - - template - GLM_FUNC_QUALIFIER T const* value_ptr(vec<4, T, Q> const& v) - { - return &(v.x); - } - - template - GLM_FUNC_QUALIFIER T* value_ptr(vec<4, T, Q>& v) - { - return &(v.x); - } - - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 2, T, Q> const& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 2, T, Q>& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 3, T, Q> const& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 3, T, Q>& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 4, T, Q> const& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T* value_ptr(mat<4, 4, T, Q>& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 3, T, Q> const& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 3, T, Q>& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 2, T, Q> const& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 2, T, Q>& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 4, T, Q> const& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 4, T, Q>& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 2, T, Q> const& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T* value_ptr(mat<4, 2, T, Q>& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 4, T, Q> const& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 4, T, Q>& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 3, T, Q> const& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T * value_ptr(mat<4, 3, T, Q>& m) - { - return &(m[0].x); - } - - template - GLM_FUNC_QUALIFIER T const * value_ptr(qua const& q) - { - return &(q[0]); - } - - template - GLM_FUNC_QUALIFIER T* value_ptr(qua& q) - { - return &(q[0]); - } - - template - GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<1, T, Q> const& v) - { - return v; - } - - template - GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<2, T, Q> const& v) - { - return vec<1, T, Q>(v); - } - - template - GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<3, T, Q> const& v) - { - return vec<1, T, Q>(v); - } - - template - GLM_FUNC_DECL vec<1, T, Q> make_vec1(vec<4, T, Q> const& v) - { - return vec<1, T, Q>(v); - } - - template - GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<1, T, Q> const& v) - { - return vec<2, T, Q>(v.x, static_cast(0)); - } - - template - GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<2, T, Q> const& v) - { - return v; - } - - template - GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<3, T, Q> const& v) - { - return vec<2, T, Q>(v); - } - - template - GLM_FUNC_DECL vec<2, T, Q> make_vec2(vec<4, T, Q> const& v) - { - return vec<2, T, Q>(v); - } - - template - GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<1, T, Q> const& v) - { - return vec<3, T, Q>(v.x, static_cast(0), static_cast(0)); - } - - template - GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<2, T, Q> const& v) - { - return vec<3, T, Q>(v.x, v.y, static_cast(0)); - } - - template - GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<3, T, Q> const& v) - { - return v; - } - - template - GLM_FUNC_DECL vec<3, T, Q> make_vec3(vec<4, T, Q> const& v) - { - return vec<3, T, Q>(v); - } - - template - GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<1, T, Q> const& v) - { - return vec<4, T, Q>(v.x, static_cast(0), static_cast(0), static_cast(1)); - } - - template - GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<2, T, Q> const& v) - { - return vec<4, T, Q>(v.x, v.y, static_cast(0), static_cast(1)); - } - - template - GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<3, T, Q> const& v) - { - return vec<4, T, Q>(v.x, v.y, v.z, static_cast(1)); - } - - template - GLM_FUNC_DECL vec<4, T, Q> make_vec4(vec<4, T, Q> const& v) - { - return v; - } - - template - GLM_FUNC_QUALIFIER vec<2, T, defaultp> make_vec2(T const *const ptr) - { - vec<2, T, defaultp> Result; - memcpy(value_ptr(Result), ptr, sizeof(vec<2, T, defaultp>)); - return Result; - } - - template - GLM_FUNC_QUALIFIER vec<3, T, defaultp> make_vec3(T const *const ptr) - { - vec<3, T, defaultp> Result; - memcpy(value_ptr(Result), ptr, sizeof(vec<3, T, defaultp>)); - return Result; - } - - template - GLM_FUNC_QUALIFIER vec<4, T, defaultp> make_vec4(T const *const ptr) - { - vec<4, T, defaultp> Result; - memcpy(value_ptr(Result), ptr, sizeof(vec<4, T, defaultp>)); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, defaultp> make_mat2x2(T const *const ptr) - { - mat<2, 2, T, defaultp> Result; - memcpy(value_ptr(Result), ptr, sizeof(mat<2, 2, T, defaultp>)); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<2, 3, T, defaultp> make_mat2x3(T const *const ptr) - { - mat<2, 3, T, defaultp> Result; - memcpy(value_ptr(Result), ptr, sizeof(mat<2, 3, T, defaultp>)); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<2, 4, T, defaultp> make_mat2x4(T const *const ptr) - { - mat<2, 4, T, defaultp> Result; - memcpy(value_ptr(Result), ptr, sizeof(mat<2, 4, T, defaultp>)); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<3, 2, T, defaultp> make_mat3x2(T const *const ptr) - { - mat<3, 2, T, defaultp> Result; - memcpy(value_ptr(Result), ptr, sizeof(mat<3, 2, T, defaultp>)); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, defaultp> make_mat3x3(T const *const ptr) - { - mat<3, 3, T, defaultp> Result; - memcpy(value_ptr(Result), ptr, sizeof(mat<3, 3, T, defaultp>)); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<3, 4, T, defaultp> make_mat3x4(T const *const ptr) - { - mat<3, 4, T, defaultp> Result; - memcpy(value_ptr(Result), ptr, sizeof(mat<3, 4, T, defaultp>)); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 2, T, defaultp> make_mat4x2(T const *const ptr) - { - mat<4, 2, T, defaultp> Result; - memcpy(value_ptr(Result), ptr, sizeof(mat<4, 2, T, defaultp>)); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 3, T, defaultp> make_mat4x3(T const *const ptr) - { - mat<4, 3, T, defaultp> Result; - memcpy(value_ptr(Result), ptr, sizeof(mat<4, 3, T, defaultp>)); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> make_mat4x4(T const *const ptr) - { - mat<4, 4, T, defaultp> Result; - memcpy(value_ptr(Result), ptr, sizeof(mat<4, 4, T, defaultp>)); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, defaultp> make_mat2(T const *const ptr) - { - return make_mat2x2(ptr); - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, defaultp> make_mat3(T const *const ptr) - { - return make_mat3x3(ptr); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> make_mat4(T const *const ptr) - { - return make_mat4x4(ptr); - } - - template - GLM_FUNC_QUALIFIER qua make_quat(T const *const ptr) - { - qua Result; - memcpy(value_ptr(Result), ptr, sizeof(qua)); - return Result; - } - - /// @} -}//namespace glm - diff --git a/3rdparty/glm/source/glm/gtc/ulp.hpp b/3rdparty/glm/source/glm/gtc/ulp.hpp deleted file mode 100644 index 0d80a75..0000000 --- a/3rdparty/glm/source/glm/gtc/ulp.hpp +++ /dev/null @@ -1,152 +0,0 @@ -/// @ref gtc_ulp -/// @file glm/gtc/ulp.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtc_ulp GLM_GTC_ulp -/// @ingroup gtc -/// -/// Include to use the features of this extension. -/// -/// Allow the measurement of the accuracy of a function against a reference -/// implementation. This extension works on floating-point data and provide results -/// in ULP. - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" -#include "../detail/qualifier.hpp" -#include "../detail/_vectorize.hpp" -#include "../ext/scalar_int_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTC_ulp extension included") -#endif - -namespace glm -{ - /// Return the next ULP value(s) after the input value(s). - /// - /// @tparam genType A floating-point scalar type. - /// - /// @see gtc_ulp - template - GLM_FUNC_DECL genType next_float(genType x); - - /// Return the previous ULP value(s) before the input value(s). - /// - /// @tparam genType A floating-point scalar type. - /// - /// @see gtc_ulp - template - GLM_FUNC_DECL genType prev_float(genType x); - - /// Return the value(s) ULP distance after the input value(s). - /// - /// @tparam genType A floating-point scalar type. - /// - /// @see gtc_ulp - template - GLM_FUNC_DECL genType next_float(genType x, int ULPs); - - /// Return the value(s) ULP distance before the input value(s). - /// - /// @tparam genType A floating-point scalar type. - /// - /// @see gtc_ulp - template - GLM_FUNC_DECL genType prev_float(genType x, int ULPs); - - /// Return the distance in the number of ULP between 2 single-precision floating-point scalars. - /// - /// @see gtc_ulp - GLM_FUNC_DECL int float_distance(float x, float y); - - /// Return the distance in the number of ULP between 2 double-precision floating-point scalars. - /// - /// @see gtc_ulp - GLM_FUNC_DECL int64 float_distance(double x, double y); - - /// Return the next ULP value(s) after the input value(s). - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point - /// @tparam Q Value from qualifier enum - /// - /// @see gtc_ulp - template - GLM_FUNC_DECL vec next_float(vec const& x); - - /// Return the value(s) ULP distance after the input value(s). - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point - /// @tparam Q Value from qualifier enum - /// - /// @see gtc_ulp - template - GLM_FUNC_DECL vec next_float(vec const& x, int ULPs); - - /// Return the value(s) ULP distance after the input value(s). - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point - /// @tparam Q Value from qualifier enum - /// - /// @see gtc_ulp - template - GLM_FUNC_DECL vec next_float(vec const& x, vec const& ULPs); - - /// Return the previous ULP value(s) before the input value(s). - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point - /// @tparam Q Value from qualifier enum - /// - /// @see gtc_ulp - template - GLM_FUNC_DECL vec prev_float(vec const& x); - - /// Return the value(s) ULP distance before the input value(s). - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point - /// @tparam Q Value from qualifier enum - /// - /// @see gtc_ulp - template - GLM_FUNC_DECL vec prev_float(vec const& x, int ULPs); - - /// Return the value(s) ULP distance before the input value(s). - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point - /// @tparam Q Value from qualifier enum - /// - /// @see gtc_ulp - template - GLM_FUNC_DECL vec prev_float(vec const& x, vec const& ULPs); - - /// Return the distance in the number of ULP between 2 single-precision floating-point scalars. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam Q Value from qualifier enum - /// - /// @see gtc_ulp - template - GLM_FUNC_DECL vec float_distance(vec const& x, vec const& y); - - /// Return the distance in the number of ULP between 2 double-precision floating-point scalars. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam Q Value from qualifier enum - /// - /// @see gtc_ulp - template - GLM_FUNC_DECL vec float_distance(vec const& x, vec const& y); - - /// @} -}//namespace glm - -#include "ulp.inl" diff --git a/3rdparty/glm/source/glm/gtc/ulp.inl b/3rdparty/glm/source/glm/gtc/ulp.inl deleted file mode 100644 index 4ecbd3f..0000000 --- a/3rdparty/glm/source/glm/gtc/ulp.inl +++ /dev/null @@ -1,173 +0,0 @@ -/// @ref gtc_ulp - -#include "../ext/scalar_ulp.hpp" - -namespace glm -{ - template<> - GLM_FUNC_QUALIFIER float next_float(float x) - { -# if GLM_HAS_CXX11_STL - return std::nextafter(x, std::numeric_limits::max()); -# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) - return detail::nextafterf(x, FLT_MAX); -# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) - return __builtin_nextafterf(x, FLT_MAX); -# else - return nextafterf(x, FLT_MAX); -# endif - } - - template<> - GLM_FUNC_QUALIFIER double next_float(double x) - { -# if GLM_HAS_CXX11_STL - return std::nextafter(x, std::numeric_limits::max()); -# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) - return detail::nextafter(x, std::numeric_limits::max()); -# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) - return __builtin_nextafter(x, DBL_MAX); -# else - return nextafter(x, DBL_MAX); -# endif - } - - template - GLM_FUNC_QUALIFIER T next_float(T x, int ULPs) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'next_float' only accept floating-point input"); - assert(ULPs >= 0); - - T temp = x; - for (int i = 0; i < ULPs; ++i) - temp = next_float(temp); - return temp; - } - - GLM_FUNC_QUALIFIER float prev_float(float x) - { -# if GLM_HAS_CXX11_STL - return std::nextafter(x, std::numeric_limits::min()); -# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) - return detail::nextafterf(x, FLT_MIN); -# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) - return __builtin_nextafterf(x, FLT_MIN); -# else - return nextafterf(x, FLT_MIN); -# endif - } - - GLM_FUNC_QUALIFIER double prev_float(double x) - { -# if GLM_HAS_CXX11_STL - return std::nextafter(x, std::numeric_limits::min()); -# elif((GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))) - return _nextafter(x, DBL_MIN); -# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID) - return __builtin_nextafter(x, DBL_MIN); -# else - return nextafter(x, DBL_MIN); -# endif - } - - template - GLM_FUNC_QUALIFIER T prev_float(T x, int ULPs) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'prev_float' only accept floating-point input"); - assert(ULPs >= 0); - - T temp = x; - for (int i = 0; i < ULPs; ++i) - temp = prev_float(temp); - return temp; - } - - GLM_FUNC_QUALIFIER int float_distance(float x, float y) - { - detail::float_t const a(x); - detail::float_t const b(y); - - return abs(a.i - b.i); - } - - GLM_FUNC_QUALIFIER int64 float_distance(double x, double y) - { - detail::float_t const a(x); - detail::float_t const b(y); - - return abs(a.i - b.i); - } - - template - GLM_FUNC_QUALIFIER vec next_float(vec const& x) - { - vec Result; - for (length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = next_float(x[i]); - return Result; - } - - template - GLM_FUNC_QUALIFIER vec next_float(vec const& x, int ULPs) - { - vec Result; - for (length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = next_float(x[i], ULPs); - return Result; - } - - template - GLM_FUNC_QUALIFIER vec next_float(vec const& x, vec const& ULPs) - { - vec Result; - for (length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = next_float(x[i], ULPs[i]); - return Result; - } - - template - GLM_FUNC_QUALIFIER vec prev_float(vec const& x) - { - vec Result; - for (length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = prev_float(x[i]); - return Result; - } - - template - GLM_FUNC_QUALIFIER vec prev_float(vec const& x, int ULPs) - { - vec Result; - for (length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = prev_float(x[i], ULPs); - return Result; - } - - template - GLM_FUNC_QUALIFIER vec prev_float(vec const& x, vec const& ULPs) - { - vec Result; - for (length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = prev_float(x[i], ULPs[i]); - return Result; - } - - template - GLM_FUNC_QUALIFIER vec float_distance(vec const& x, vec const& y) - { - vec Result; - for (length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = float_distance(x[i], y[i]); - return Result; - } - - template - GLM_FUNC_QUALIFIER vec float_distance(vec const& x, vec const& y) - { - vec Result; - for (length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = float_distance(x[i], y[i]); - return Result; - } -}//namespace glm - diff --git a/3rdparty/glm/source/glm/gtc/vec1.hpp b/3rdparty/glm/source/glm/gtc/vec1.hpp deleted file mode 100644 index 63697a2..0000000 --- a/3rdparty/glm/source/glm/gtc/vec1.hpp +++ /dev/null @@ -1,30 +0,0 @@ -/// @ref gtc_vec1 -/// @file glm/gtc/vec1.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtc_vec1 GLM_GTC_vec1 -/// @ingroup gtc -/// -/// Include to use the features of this extension. -/// -/// Add vec1, ivec1, uvec1 and bvec1 types. - -#pragma once - -// Dependency: -#include "../ext/vector_bool1.hpp" -#include "../ext/vector_bool1_precision.hpp" -#include "../ext/vector_float1.hpp" -#include "../ext/vector_float1_precision.hpp" -#include "../ext/vector_double1.hpp" -#include "../ext/vector_double1_precision.hpp" -#include "../ext/vector_int1.hpp" -#include "../ext/vector_int1_sized.hpp" -#include "../ext/vector_uint1.hpp" -#include "../ext/vector_uint1_sized.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# pragma message("GLM: GLM_GTC_vec1 extension included") -#endif - diff --git a/3rdparty/glm/source/glm/gtx/associated_min_max.hpp b/3rdparty/glm/source/glm/gtx/associated_min_max.hpp deleted file mode 100644 index d1a41c0..0000000 --- a/3rdparty/glm/source/glm/gtx/associated_min_max.hpp +++ /dev/null @@ -1,207 +0,0 @@ -/// @ref gtx_associated_min_max -/// @file glm/gtx/associated_min_max.hpp -/// -/// @see core (dependence) -/// @see gtx_extented_min_max (dependence) -/// -/// @defgroup gtx_associated_min_max GLM_GTX_associated_min_max -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// @brief Min and max functions that return associated values not the compared onces. - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_associated_min_max is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_associated_min_max extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_associated_min_max - /// @{ - - /// Minimum comparison between 2 variables and returns 2 associated variable values - /// @see gtx_associated_min_max - template - GLM_FUNC_DECL U associatedMin(T x, U a, T y, U b); - - /// Minimum comparison between 2 variables and returns 2 associated variable values - /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec<2, U, Q> associatedMin( - vec const& x, vec const& a, - vec const& y, vec const& b); - - /// Minimum comparison between 2 variables and returns 2 associated variable values - /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMin( - T x, const vec& a, - T y, const vec& b); - - /// Minimum comparison between 2 variables and returns 2 associated variable values - /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMin( - vec const& x, U a, - vec const& y, U b); - - /// Minimum comparison between 3 variables and returns 3 associated variable values - /// @see gtx_associated_min_max - template - GLM_FUNC_DECL U associatedMin( - T x, U a, - T y, U b, - T z, U c); - - /// Minimum comparison between 3 variables and returns 3 associated variable values - /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMin( - vec const& x, vec const& a, - vec const& y, vec const& b, - vec const& z, vec const& c); - - /// Minimum comparison between 4 variables and returns 4 associated variable values - /// @see gtx_associated_min_max - template - GLM_FUNC_DECL U associatedMin( - T x, U a, - T y, U b, - T z, U c, - T w, U d); - - /// Minimum comparison between 4 variables and returns 4 associated variable values - /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMin( - vec const& x, vec const& a, - vec const& y, vec const& b, - vec const& z, vec const& c, - vec const& w, vec const& d); - - /// Minimum comparison between 4 variables and returns 4 associated variable values - /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMin( - T x, vec const& a, - T y, vec const& b, - T z, vec const& c, - T w, vec const& d); - - /// Minimum comparison between 4 variables and returns 4 associated variable values - /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMin( - vec const& x, U a, - vec const& y, U b, - vec const& z, U c, - vec const& w, U d); - - /// Maximum comparison between 2 variables and returns 2 associated variable values - /// @see gtx_associated_min_max - template - GLM_FUNC_DECL U associatedMax(T x, U a, T y, U b); - - /// Maximum comparison between 2 variables and returns 2 associated variable values - /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec<2, U, Q> associatedMax( - vec const& x, vec const& a, - vec const& y, vec const& b); - - /// Maximum comparison between 2 variables and returns 2 associated variable values - /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMax( - T x, vec const& a, - T y, vec const& b); - - /// Maximum comparison between 2 variables and returns 2 associated variable values - /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMax( - vec const& x, U a, - vec const& y, U b); - - /// Maximum comparison between 3 variables and returns 3 associated variable values - /// @see gtx_associated_min_max - template - GLM_FUNC_DECL U associatedMax( - T x, U a, - T y, U b, - T z, U c); - - /// Maximum comparison between 3 variables and returns 3 associated variable values - /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMax( - vec const& x, vec const& a, - vec const& y, vec const& b, - vec const& z, vec const& c); - - /// Maximum comparison between 3 variables and returns 3 associated variable values - /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMax( - T x, vec const& a, - T y, vec const& b, - T z, vec const& c); - - /// Maximum comparison between 3 variables and returns 3 associated variable values - /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMax( - vec const& x, U a, - vec const& y, U b, - vec const& z, U c); - - /// Maximum comparison between 4 variables and returns 4 associated variable values - /// @see gtx_associated_min_max - template - GLM_FUNC_DECL U associatedMax( - T x, U a, - T y, U b, - T z, U c, - T w, U d); - - /// Maximum comparison between 4 variables and returns 4 associated variable values - /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMax( - vec const& x, vec const& a, - vec const& y, vec const& b, - vec const& z, vec const& c, - vec const& w, vec const& d); - - /// Maximum comparison between 4 variables and returns 4 associated variable values - /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMax( - T x, vec const& a, - T y, vec const& b, - T z, vec const& c, - T w, vec const& d); - - /// Maximum comparison between 4 variables and returns 4 associated variable values - /// @see gtx_associated_min_max - template - GLM_FUNC_DECL vec associatedMax( - vec const& x, U a, - vec const& y, U b, - vec const& z, U c, - vec const& w, U d); - - /// @} -} //namespace glm - -#include "associated_min_max.inl" diff --git a/3rdparty/glm/source/glm/gtx/associated_min_max.inl b/3rdparty/glm/source/glm/gtx/associated_min_max.inl deleted file mode 100644 index 5186c47..0000000 --- a/3rdparty/glm/source/glm/gtx/associated_min_max.inl +++ /dev/null @@ -1,354 +0,0 @@ -/// @ref gtx_associated_min_max - -namespace glm{ - -// Min comparison between 2 variables -template -GLM_FUNC_QUALIFIER U associatedMin(T x, U a, T y, U b) -{ - return x < y ? a : b; -} - -template -GLM_FUNC_QUALIFIER vec<2, U, Q> associatedMin -( - vec const& x, vec const& a, - vec const& y, vec const& b -) -{ - vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = x[i] < y[i] ? a[i] : b[i]; - return Result; -} - -template -GLM_FUNC_QUALIFIER vec associatedMin -( - T x, const vec& a, - T y, const vec& b -) -{ - vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = x < y ? a[i] : b[i]; - return Result; -} - -template -GLM_FUNC_QUALIFIER vec associatedMin -( - vec const& x, U a, - vec const& y, U b -) -{ - vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = x[i] < y[i] ? a : b; - return Result; -} - -// Min comparison between 3 variables -template -GLM_FUNC_QUALIFIER U associatedMin -( - T x, U a, - T y, U b, - T z, U c -) -{ - U Result = x < y ? (x < z ? a : c) : (y < z ? b : c); - return Result; -} - -template -GLM_FUNC_QUALIFIER vec associatedMin -( - vec const& x, vec const& a, - vec const& y, vec const& b, - vec const& z, vec const& c -) -{ - vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = x[i] < y[i] ? (x[i] < z[i] ? a[i] : c[i]) : (y[i] < z[i] ? b[i] : c[i]); - return Result; -} - -// Min comparison between 4 variables -template -GLM_FUNC_QUALIFIER U associatedMin -( - T x, U a, - T y, U b, - T z, U c, - T w, U d -) -{ - T Test1 = min(x, y); - T Test2 = min(z, w); - U Result1 = x < y ? a : b; - U Result2 = z < w ? c : d; - U Result = Test1 < Test2 ? Result1 : Result2; - return Result; -} - -// Min comparison between 4 variables -template -GLM_FUNC_QUALIFIER vec associatedMin -( - vec const& x, vec const& a, - vec const& y, vec const& b, - vec const& z, vec const& c, - vec const& w, vec const& d -) -{ - vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - { - T Test1 = min(x[i], y[i]); - T Test2 = min(z[i], w[i]); - U Result1 = x[i] < y[i] ? a[i] : b[i]; - U Result2 = z[i] < w[i] ? c[i] : d[i]; - Result[i] = Test1 < Test2 ? Result1 : Result2; - } - return Result; -} - -// Min comparison between 4 variables -template -GLM_FUNC_QUALIFIER vec associatedMin -( - T x, vec const& a, - T y, vec const& b, - T z, vec const& c, - T w, vec const& d -) -{ - T Test1 = min(x, y); - T Test2 = min(z, w); - - vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - { - U Result1 = x < y ? a[i] : b[i]; - U Result2 = z < w ? c[i] : d[i]; - Result[i] = Test1 < Test2 ? Result1 : Result2; - } - return Result; -} - -// Min comparison between 4 variables -template -GLM_FUNC_QUALIFIER vec associatedMin -( - vec const& x, U a, - vec const& y, U b, - vec const& z, U c, - vec const& w, U d -) -{ - vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - { - T Test1 = min(x[i], y[i]); - T Test2 = min(z[i], w[i]); - U Result1 = x[i] < y[i] ? a : b; - U Result2 = z[i] < w[i] ? c : d; - Result[i] = Test1 < Test2 ? Result1 : Result2; - } - return Result; -} - -// Max comparison between 2 variables -template -GLM_FUNC_QUALIFIER U associatedMax(T x, U a, T y, U b) -{ - return x > y ? a : b; -} - -// Max comparison between 2 variables -template -GLM_FUNC_QUALIFIER vec<2, U, Q> associatedMax -( - vec const& x, vec const& a, - vec const& y, vec const& b -) -{ - vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = x[i] > y[i] ? a[i] : b[i]; - return Result; -} - -// Max comparison between 2 variables -template -GLM_FUNC_QUALIFIER vec associatedMax -( - T x, vec const& a, - T y, vec const& b -) -{ - vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = x > y ? a[i] : b[i]; - return Result; -} - -// Max comparison between 2 variables -template -GLM_FUNC_QUALIFIER vec associatedMax -( - vec const& x, U a, - vec const& y, U b -) -{ - vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = x[i] > y[i] ? a : b; - return Result; -} - -// Max comparison between 3 variables -template -GLM_FUNC_QUALIFIER U associatedMax -( - T x, U a, - T y, U b, - T z, U c -) -{ - U Result = x > y ? (x > z ? a : c) : (y > z ? b : c); - return Result; -} - -// Max comparison between 3 variables -template -GLM_FUNC_QUALIFIER vec associatedMax -( - vec const& x, vec const& a, - vec const& y, vec const& b, - vec const& z, vec const& c -) -{ - vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a[i] : c[i]) : (y[i] > z[i] ? b[i] : c[i]); - return Result; -} - -// Max comparison between 3 variables -template -GLM_FUNC_QUALIFIER vec associatedMax -( - T x, vec const& a, - T y, vec const& b, - T z, vec const& c -) -{ - vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = x > y ? (x > z ? a[i] : c[i]) : (y > z ? b[i] : c[i]); - return Result; -} - -// Max comparison between 3 variables -template -GLM_FUNC_QUALIFIER vec associatedMax -( - vec const& x, U a, - vec const& y, U b, - vec const& z, U c -) -{ - vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a : c) : (y[i] > z[i] ? b : c); - return Result; -} - -// Max comparison between 4 variables -template -GLM_FUNC_QUALIFIER U associatedMax -( - T x, U a, - T y, U b, - T z, U c, - T w, U d -) -{ - T Test1 = max(x, y); - T Test2 = max(z, w); - U Result1 = x > y ? a : b; - U Result2 = z > w ? c : d; - U Result = Test1 > Test2 ? Result1 : Result2; - return Result; -} - -// Max comparison between 4 variables -template -GLM_FUNC_QUALIFIER vec associatedMax -( - vec const& x, vec const& a, - vec const& y, vec const& b, - vec const& z, vec const& c, - vec const& w, vec const& d -) -{ - vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - { - T Test1 = max(x[i], y[i]); - T Test2 = max(z[i], w[i]); - U Result1 = x[i] > y[i] ? a[i] : b[i]; - U Result2 = z[i] > w[i] ? c[i] : d[i]; - Result[i] = Test1 > Test2 ? Result1 : Result2; - } - return Result; -} - -// Max comparison between 4 variables -template -GLM_FUNC_QUALIFIER vec associatedMax -( - T x, vec const& a, - T y, vec const& b, - T z, vec const& c, - T w, vec const& d -) -{ - T Test1 = max(x, y); - T Test2 = max(z, w); - - vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - { - U Result1 = x > y ? a[i] : b[i]; - U Result2 = z > w ? c[i] : d[i]; - Result[i] = Test1 > Test2 ? Result1 : Result2; - } - return Result; -} - -// Max comparison between 4 variables -template -GLM_FUNC_QUALIFIER vec associatedMax -( - vec const& x, U a, - vec const& y, U b, - vec const& z, U c, - vec const& w, U d -) -{ - vec Result; - for(length_t i = 0, n = Result.length(); i < n; ++i) - { - T Test1 = max(x[i], y[i]); - T Test2 = max(z[i], w[i]); - U Result1 = x[i] > y[i] ? a : b; - U Result2 = z[i] > w[i] ? c : d; - Result[i] = Test1 > Test2 ? Result1 : Result2; - } - return Result; -} -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/bit.hpp b/3rdparty/glm/source/glm/gtx/bit.hpp deleted file mode 100644 index 60a7aef..0000000 --- a/3rdparty/glm/source/glm/gtx/bit.hpp +++ /dev/null @@ -1,98 +0,0 @@ -/// @ref gtx_bit -/// @file glm/gtx/bit.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_bit GLM_GTX_bit -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Allow to perform bit operations on integer values - -#pragma once - -// Dependencies -#include "../gtc/bitfield.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_bit is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_bit extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_bit - /// @{ - - /// @see gtx_bit - template - GLM_FUNC_DECL genIUType highestBitValue(genIUType Value); - - /// @see gtx_bit - template - GLM_FUNC_DECL genIUType lowestBitValue(genIUType Value); - - /// Find the highest bit set to 1 in a integer variable and return its value. - /// - /// @see gtx_bit - template - GLM_FUNC_DECL vec highestBitValue(vec const& value); - - /// Return the power of two number which value is just higher the input value. - /// Deprecated, use ceilPowerOfTwo from GTC_round instead - /// - /// @see gtc_round - /// @see gtx_bit - template - GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoAbove(genIUType Value); - - /// Return the power of two number which value is just higher the input value. - /// Deprecated, use ceilPowerOfTwo from GTC_round instead - /// - /// @see gtc_round - /// @see gtx_bit - template - GLM_DEPRECATED GLM_FUNC_DECL vec powerOfTwoAbove(vec const& value); - - /// Return the power of two number which value is just lower the input value. - /// Deprecated, use floorPowerOfTwo from GTC_round instead - /// - /// @see gtc_round - /// @see gtx_bit - template - GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoBelow(genIUType Value); - - /// Return the power of two number which value is just lower the input value. - /// Deprecated, use floorPowerOfTwo from GTC_round instead - /// - /// @see gtc_round - /// @see gtx_bit - template - GLM_DEPRECATED GLM_FUNC_DECL vec powerOfTwoBelow(vec const& value); - - /// Return the power of two number which value is the closet to the input value. - /// Deprecated, use roundPowerOfTwo from GTC_round instead - /// - /// @see gtc_round - /// @see gtx_bit - template - GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoNearest(genIUType Value); - - /// Return the power of two number which value is the closet to the input value. - /// Deprecated, use roundPowerOfTwo from GTC_round instead - /// - /// @see gtc_round - /// @see gtx_bit - template - GLM_DEPRECATED GLM_FUNC_DECL vec powerOfTwoNearest(vec const& value); - - /// @} -} //namespace glm - - -#include "bit.inl" - diff --git a/3rdparty/glm/source/glm/gtx/bit.inl b/3rdparty/glm/source/glm/gtx/bit.inl deleted file mode 100644 index 621b626..0000000 --- a/3rdparty/glm/source/glm/gtx/bit.inl +++ /dev/null @@ -1,92 +0,0 @@ -/// @ref gtx_bit - -namespace glm -{ - /////////////////// - // highestBitValue - - template - GLM_FUNC_QUALIFIER genIUType highestBitValue(genIUType Value) - { - genIUType tmp = Value; - genIUType result = genIUType(0); - while(tmp) - { - result = (tmp & (~tmp + 1)); // grab lowest bit - tmp &= ~result; // clear lowest bit - } - return result; - } - - template - GLM_FUNC_QUALIFIER vec highestBitValue(vec const& v) - { - return detail::functor1::call(highestBitValue, v); - } - - /////////////////// - // lowestBitValue - - template - GLM_FUNC_QUALIFIER genIUType lowestBitValue(genIUType Value) - { - return (Value & (~Value + 1)); - } - - template - GLM_FUNC_QUALIFIER vec lowestBitValue(vec const& v) - { - return detail::functor1::call(lowestBitValue, v); - } - - /////////////////// - // powerOfTwoAbove - - template - GLM_FUNC_QUALIFIER genType powerOfTwoAbove(genType value) - { - return isPowerOfTwo(value) ? value : highestBitValue(value) << 1; - } - - template - GLM_FUNC_QUALIFIER vec powerOfTwoAbove(vec const& v) - { - return detail::functor1::call(powerOfTwoAbove, v); - } - - /////////////////// - // powerOfTwoBelow - - template - GLM_FUNC_QUALIFIER genType powerOfTwoBelow(genType value) - { - return isPowerOfTwo(value) ? value : highestBitValue(value); - } - - template - GLM_FUNC_QUALIFIER vec powerOfTwoBelow(vec const& v) - { - return detail::functor1::call(powerOfTwoBelow, v); - } - - ///////////////////// - // powerOfTwoNearest - - template - GLM_FUNC_QUALIFIER genType powerOfTwoNearest(genType value) - { - if(isPowerOfTwo(value)) - return value; - - genType const prev = highestBitValue(value); - genType const next = prev << 1; - return (next - value) < (value - prev) ? next : prev; - } - - template - GLM_FUNC_QUALIFIER vec powerOfTwoNearest(vec const& v) - { - return detail::functor1::call(powerOfTwoNearest, v); - } - -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/closest_point.hpp b/3rdparty/glm/source/glm/gtx/closest_point.hpp deleted file mode 100644 index de6dbbf..0000000 --- a/3rdparty/glm/source/glm/gtx/closest_point.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref gtx_closest_point -/// @file glm/gtx/closest_point.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_closest_point GLM_GTX_closest_point -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Find the point on a straight line which is the closet of a point. - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_closest_point is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_closest_point extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_closest_point - /// @{ - - /// Find the point on a straight line which is the closet of a point. - /// @see gtx_closest_point - template - GLM_FUNC_DECL vec<3, T, Q> closestPointOnLine( - vec<3, T, Q> const& point, - vec<3, T, Q> const& a, - vec<3, T, Q> const& b); - - /// 2d lines work as well - template - GLM_FUNC_DECL vec<2, T, Q> closestPointOnLine( - vec<2, T, Q> const& point, - vec<2, T, Q> const& a, - vec<2, T, Q> const& b); - - /// @} -}// namespace glm - -#include "closest_point.inl" diff --git a/3rdparty/glm/source/glm/gtx/closest_point.inl b/3rdparty/glm/source/glm/gtx/closest_point.inl deleted file mode 100644 index 0a39b04..0000000 --- a/3rdparty/glm/source/glm/gtx/closest_point.inl +++ /dev/null @@ -1,45 +0,0 @@ -/// @ref gtx_closest_point - -namespace glm -{ - template - GLM_FUNC_QUALIFIER vec<3, T, Q> closestPointOnLine - ( - vec<3, T, Q> const& point, - vec<3, T, Q> const& a, - vec<3, T, Q> const& b - ) - { - T LineLength = distance(a, b); - vec<3, T, Q> Vector = point - a; - vec<3, T, Q> LineDirection = (b - a) / LineLength; - - // Project Vector to LineDirection to get the distance of point from a - T Distance = dot(Vector, LineDirection); - - if(Distance <= T(0)) return a; - if(Distance >= LineLength) return b; - return a + LineDirection * Distance; - } - - template - GLM_FUNC_QUALIFIER vec<2, T, Q> closestPointOnLine - ( - vec<2, T, Q> const& point, - vec<2, T, Q> const& a, - vec<2, T, Q> const& b - ) - { - T LineLength = distance(a, b); - vec<2, T, Q> Vector = point - a; - vec<2, T, Q> LineDirection = (b - a) / LineLength; - - // Project Vector to LineDirection to get the distance of point from a - T Distance = dot(Vector, LineDirection); - - if(Distance <= T(0)) return a; - if(Distance >= LineLength) return b; - return a + LineDirection * Distance; - } - -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/color_encoding.hpp b/3rdparty/glm/source/glm/gtx/color_encoding.hpp deleted file mode 100644 index 96ded2a..0000000 --- a/3rdparty/glm/source/glm/gtx/color_encoding.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/// @ref gtx_color_encoding -/// @file glm/gtx/color_encoding.hpp -/// -/// @see core (dependence) -/// @see gtx_color_encoding (dependence) -/// -/// @defgroup gtx_color_encoding GLM_GTX_color_encoding -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// @brief Allow to perform bit operations on integer values - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" -#include "../detail/qualifier.hpp" -#include "../vec3.hpp" -#include - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTC_color_encoding is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTC_color_encoding extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_color_encoding - /// @{ - - /// Convert a linear sRGB color to D65 YUV. - template - GLM_FUNC_DECL vec<3, T, Q> convertLinearSRGBToD65XYZ(vec<3, T, Q> const& ColorLinearSRGB); - - /// Convert a linear sRGB color to D50 YUV. - template - GLM_FUNC_DECL vec<3, T, Q> convertLinearSRGBToD50XYZ(vec<3, T, Q> const& ColorLinearSRGB); - - /// Convert a D65 YUV color to linear sRGB. - template - GLM_FUNC_DECL vec<3, T, Q> convertD65XYZToLinearSRGB(vec<3, T, Q> const& ColorD65XYZ); - - /// Convert a D65 YUV color to D50 YUV. - template - GLM_FUNC_DECL vec<3, T, Q> convertD65XYZToD50XYZ(vec<3, T, Q> const& ColorD65XYZ); - - /// @} -} //namespace glm - -#include "color_encoding.inl" diff --git a/3rdparty/glm/source/glm/gtx/color_encoding.inl b/3rdparty/glm/source/glm/gtx/color_encoding.inl deleted file mode 100644 index e50fa3e..0000000 --- a/3rdparty/glm/source/glm/gtx/color_encoding.inl +++ /dev/null @@ -1,45 +0,0 @@ -/// @ref gtx_color_encoding - -namespace glm -{ - template - GLM_FUNC_QUALIFIER vec<3, T, Q> convertLinearSRGBToD65XYZ(vec<3, T, Q> const& ColorLinearSRGB) - { - vec<3, T, Q> const M(0.490f, 0.17697f, 0.2f); - vec<3, T, Q> const N(0.31f, 0.8124f, 0.01063f); - vec<3, T, Q> const O(0.490f, 0.01f, 0.99f); - - return (M * ColorLinearSRGB + N * ColorLinearSRGB + O * ColorLinearSRGB) * static_cast(5.650675255693055f); - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> convertLinearSRGBToD50XYZ(vec<3, T, Q> const& ColorLinearSRGB) - { - vec<3, T, Q> const M(0.436030342570117f, 0.222438466210245f, 0.013897440074263f); - vec<3, T, Q> const N(0.385101860087134f, 0.716942745571917f, 0.097076381494207f); - vec<3, T, Q> const O(0.143067806654203f, 0.060618777416563f, 0.713926257896652f); - - return M * ColorLinearSRGB + N * ColorLinearSRGB + O * ColorLinearSRGB; - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> convertD65XYZToLinearSRGB(vec<3, T, Q> const& ColorD65XYZ) - { - vec<3, T, Q> const M(0.41847f, -0.091169f, 0.0009209f); - vec<3, T, Q> const N(-0.15866f, 0.25243f, 0.015708f); - vec<3, T, Q> const O(0.0009209f, -0.0025498f, 0.1786f); - - return M * ColorD65XYZ + N * ColorD65XYZ + O * ColorD65XYZ; - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> convertD65XYZToD50XYZ(vec<3, T, Q> const& ColorD65XYZ) - { - vec<3, T, Q> const M(+1.047844353856414f, +0.029549007606644f, -0.009250984365223f); - vec<3, T, Q> const N(+0.022898981050086f, +0.990508028941971f, +0.015072338237051f); - vec<3, T, Q> const O(-0.050206647741605f, -0.017074711360960f, +0.751717835079977f); - - return M * ColorD65XYZ + N * ColorD65XYZ + O * ColorD65XYZ; - } - -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/color_space.hpp b/3rdparty/glm/source/glm/gtx/color_space.hpp deleted file mode 100644 index a634392..0000000 --- a/3rdparty/glm/source/glm/gtx/color_space.hpp +++ /dev/null @@ -1,72 +0,0 @@ -/// @ref gtx_color_space -/// @file glm/gtx/color_space.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_color_space GLM_GTX_color_space -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Related to RGB to HSV conversions and operations. - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_color_space is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_color_space extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_color_space - /// @{ - - /// Converts a color from HSV color space to its color in RGB color space. - /// @see gtx_color_space - template - GLM_FUNC_DECL vec<3, T, Q> rgbColor( - vec<3, T, Q> const& hsvValue); - - /// Converts a color from RGB color space to its color in HSV color space. - /// @see gtx_color_space - template - GLM_FUNC_DECL vec<3, T, Q> hsvColor( - vec<3, T, Q> const& rgbValue); - - /// Build a saturation matrix. - /// @see gtx_color_space - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> saturation( - T const s); - - /// Modify the saturation of a color. - /// @see gtx_color_space - template - GLM_FUNC_DECL vec<3, T, Q> saturation( - T const s, - vec<3, T, Q> const& color); - - /// Modify the saturation of a color. - /// @see gtx_color_space - template - GLM_FUNC_DECL vec<4, T, Q> saturation( - T const s, - vec<4, T, Q> const& color); - - /// Compute color luminosity associating ratios (0.33, 0.59, 0.11) to RGB canals. - /// @see gtx_color_space - template - GLM_FUNC_DECL T luminosity( - vec<3, T, Q> const& color); - - /// @} -}//namespace glm - -#include "color_space.inl" diff --git a/3rdparty/glm/source/glm/gtx/color_space.inl b/3rdparty/glm/source/glm/gtx/color_space.inl deleted file mode 100644 index f698afe..0000000 --- a/3rdparty/glm/source/glm/gtx/color_space.inl +++ /dev/null @@ -1,141 +0,0 @@ -/// @ref gtx_color_space - -namespace glm -{ - template - GLM_FUNC_QUALIFIER vec<3, T, Q> rgbColor(const vec<3, T, Q>& hsvColor) - { - vec<3, T, Q> hsv = hsvColor; - vec<3, T, Q> rgbColor; - - if(hsv.y == static_cast(0)) - // achromatic (grey) - rgbColor = vec<3, T, Q>(hsv.z); - else - { - T sector = floor(hsv.x * (T(1) / T(60))); - T frac = (hsv.x * (T(1) / T(60))) - sector; - // factorial part of h - T o = hsv.z * (T(1) - hsv.y); - T p = hsv.z * (T(1) - hsv.y * frac); - T q = hsv.z * (T(1) - hsv.y * (T(1) - frac)); - - switch(int(sector)) - { - default: - case 0: - rgbColor.r = hsv.z; - rgbColor.g = q; - rgbColor.b = o; - break; - case 1: - rgbColor.r = p; - rgbColor.g = hsv.z; - rgbColor.b = o; - break; - case 2: - rgbColor.r = o; - rgbColor.g = hsv.z; - rgbColor.b = q; - break; - case 3: - rgbColor.r = o; - rgbColor.g = p; - rgbColor.b = hsv.z; - break; - case 4: - rgbColor.r = q; - rgbColor.g = o; - rgbColor.b = hsv.z; - break; - case 5: - rgbColor.r = hsv.z; - rgbColor.g = o; - rgbColor.b = p; - break; - } - } - - return rgbColor; - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> hsvColor(const vec<3, T, Q>& rgbColor) - { - vec<3, T, Q> hsv = rgbColor; - float Min = min(min(rgbColor.r, rgbColor.g), rgbColor.b); - float Max = max(max(rgbColor.r, rgbColor.g), rgbColor.b); - float Delta = Max - Min; - - hsv.z = Max; - - if(Max != static_cast(0)) - { - hsv.y = Delta / hsv.z; - T h = static_cast(0); - - if(rgbColor.r == Max) - // between yellow & magenta - h = static_cast(0) + T(60) * (rgbColor.g - rgbColor.b) / Delta; - else if(rgbColor.g == Max) - // between cyan & yellow - h = static_cast(120) + T(60) * (rgbColor.b - rgbColor.r) / Delta; - else - // between magenta & cyan - h = static_cast(240) + T(60) * (rgbColor.r - rgbColor.g) / Delta; - - if(h < T(0)) - hsv.x = h + T(360); - else - hsv.x = h; - } - else - { - // If r = g = b = 0 then s = 0, h is undefined - hsv.y = static_cast(0); - hsv.x = static_cast(0); - } - - return hsv; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> saturation(T const s) - { - vec<3, T, defaultp> rgbw = vec<3, T, defaultp>(T(0.2126), T(0.7152), T(0.0722)); - - vec<3, T, defaultp> const col((T(1) - s) * rgbw); - - mat<4, 4, T, defaultp> result(T(1)); - result[0][0] = col.x + s; - result[0][1] = col.x; - result[0][2] = col.x; - result[1][0] = col.y; - result[1][1] = col.y + s; - result[1][2] = col.y; - result[2][0] = col.z; - result[2][1] = col.z; - result[2][2] = col.z + s; - - return result; - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> saturation(const T s, const vec<3, T, Q>& color) - { - return vec<3, T, Q>(saturation(s) * vec<4, T, Q>(color, T(0))); - } - - template - GLM_FUNC_QUALIFIER vec<4, T, Q> saturation(const T s, const vec<4, T, Q>& color) - { - return saturation(s) * color; - } - - template - GLM_FUNC_QUALIFIER T luminosity(const vec<3, T, Q>& color) - { - const vec<3, T, Q> tmp = vec<3, T, Q>(0.33, 0.59, 0.11); - return dot(color, tmp); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/color_space_YCoCg.hpp b/3rdparty/glm/source/glm/gtx/color_space_YCoCg.hpp deleted file mode 100644 index dd2b771..0000000 --- a/3rdparty/glm/source/glm/gtx/color_space_YCoCg.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/// @ref gtx_color_space_YCoCg -/// @file glm/gtx/color_space_YCoCg.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_color_space_YCoCg GLM_GTX_color_space_YCoCg -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// RGB to YCoCg conversions and operations - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_color_space_YCoCg is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_color_space_YCoCg extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_color_space_YCoCg - /// @{ - - /// Convert a color from RGB color space to YCoCg color space. - /// @see gtx_color_space_YCoCg - template - GLM_FUNC_DECL vec<3, T, Q> rgb2YCoCg( - vec<3, T, Q> const& rgbColor); - - /// Convert a color from YCoCg color space to RGB color space. - /// @see gtx_color_space_YCoCg - template - GLM_FUNC_DECL vec<3, T, Q> YCoCg2rgb( - vec<3, T, Q> const& YCoCgColor); - - /// Convert a color from RGB color space to YCoCgR color space. - /// @see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range" - /// @see gtx_color_space_YCoCg - template - GLM_FUNC_DECL vec<3, T, Q> rgb2YCoCgR( - vec<3, T, Q> const& rgbColor); - - /// Convert a color from YCoCgR color space to RGB color space. - /// @see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range" - /// @see gtx_color_space_YCoCg - template - GLM_FUNC_DECL vec<3, T, Q> YCoCgR2rgb( - vec<3, T, Q> const& YCoCgColor); - - /// @} -}//namespace glm - -#include "color_space_YCoCg.inl" diff --git a/3rdparty/glm/source/glm/gtx/color_space_YCoCg.inl b/3rdparty/glm/source/glm/gtx/color_space_YCoCg.inl deleted file mode 100644 index 83ba857..0000000 --- a/3rdparty/glm/source/glm/gtx/color_space_YCoCg.inl +++ /dev/null @@ -1,107 +0,0 @@ -/// @ref gtx_color_space_YCoCg - -namespace glm -{ - template - GLM_FUNC_QUALIFIER vec<3, T, Q> rgb2YCoCg - ( - vec<3, T, Q> const& rgbColor - ) - { - vec<3, T, Q> result; - result.x/*Y */ = rgbColor.r / T(4) + rgbColor.g / T(2) + rgbColor.b / T(4); - result.y/*Co*/ = rgbColor.r / T(2) + rgbColor.g * T(0) - rgbColor.b / T(2); - result.z/*Cg*/ = - rgbColor.r / T(4) + rgbColor.g / T(2) - rgbColor.b / T(4); - return result; - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> YCoCg2rgb - ( - vec<3, T, Q> const& YCoCgColor - ) - { - vec<3, T, Q> result; - result.r = YCoCgColor.x + YCoCgColor.y - YCoCgColor.z; - result.g = YCoCgColor.x + YCoCgColor.z; - result.b = YCoCgColor.x - YCoCgColor.y - YCoCgColor.z; - return result; - } - - template - class compute_YCoCgR { - public: - static GLM_FUNC_QUALIFIER vec<3, T, Q> rgb2YCoCgR - ( - vec<3, T, Q> const& rgbColor - ) - { - vec<3, T, Q> result; - result.x/*Y */ = rgbColor.g * static_cast(0.5) + (rgbColor.r + rgbColor.b) * static_cast(0.25); - result.y/*Co*/ = rgbColor.r - rgbColor.b; - result.z/*Cg*/ = rgbColor.g - (rgbColor.r + rgbColor.b) * static_cast(0.5); - return result; - } - - static GLM_FUNC_QUALIFIER vec<3, T, Q> YCoCgR2rgb - ( - vec<3, T, Q> const& YCoCgRColor - ) - { - vec<3, T, Q> result; - T tmp = YCoCgRColor.x - (YCoCgRColor.z * static_cast(0.5)); - result.g = YCoCgRColor.z + tmp; - result.b = tmp - (YCoCgRColor.y * static_cast(0.5)); - result.r = result.b + YCoCgRColor.y; - return result; - } - }; - - template - class compute_YCoCgR { - public: - static GLM_FUNC_QUALIFIER vec<3, T, Q> rgb2YCoCgR - ( - vec<3, T, Q> const& rgbColor - ) - { - vec<3, T, Q> result; - result.y/*Co*/ = rgbColor.r - rgbColor.b; - T tmp = rgbColor.b + (result.y >> 1); - result.z/*Cg*/ = rgbColor.g - tmp; - result.x/*Y */ = tmp + (result.z >> 1); - return result; - } - - static GLM_FUNC_QUALIFIER vec<3, T, Q> YCoCgR2rgb - ( - vec<3, T, Q> const& YCoCgRColor - ) - { - vec<3, T, Q> result; - T tmp = YCoCgRColor.x - (YCoCgRColor.z >> 1); - result.g = YCoCgRColor.z + tmp; - result.b = tmp - (YCoCgRColor.y >> 1); - result.r = result.b + YCoCgRColor.y; - return result; - } - }; - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> rgb2YCoCgR - ( - vec<3, T, Q> const& rgbColor - ) - { - return compute_YCoCgR::is_integer>::rgb2YCoCgR(rgbColor); - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> YCoCgR2rgb - ( - vec<3, T, Q> const& YCoCgRColor - ) - { - return compute_YCoCgR::is_integer>::YCoCgR2rgb(YCoCgRColor); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/common.hpp b/3rdparty/glm/source/glm/gtx/common.hpp deleted file mode 100644 index 254ada2..0000000 --- a/3rdparty/glm/source/glm/gtx/common.hpp +++ /dev/null @@ -1,76 +0,0 @@ -/// @ref gtx_common -/// @file glm/gtx/common.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_common GLM_GTX_common -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// @brief Provide functions to increase the compatibility with Cg and HLSL languages - -#pragma once - -// Dependencies: -#include "../vec2.hpp" -#include "../vec3.hpp" -#include "../vec4.hpp" -#include "../gtc/vec1.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_common is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_common extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_common - /// @{ - - /// Returns true if x is a denormalized number - /// Numbers whose absolute value is too small to be represented in the normal format are represented in an alternate, denormalized format. - /// This format is less precise but can represent values closer to zero. - /// - /// @tparam genType Floating-point scalar or vector types. - /// - /// @see GLSL isnan man page - /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template - GLM_FUNC_DECL typename genType::bool_type isdenormal(genType const& x); - - /// Similar to 'mod' but with a different rounding and integer support. - /// Returns 'x - y * trunc(x/y)' instead of 'x - y * floor(x/y)' - /// - /// @see GLSL mod vs HLSL fmod - /// @see GLSL mod man page - template - GLM_FUNC_DECL vec fmod(vec const& v); - - /// Returns whether vector components values are within an interval. A open interval excludes its endpoints, and is denoted with square brackets. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see ext_vector_relational - template - GLM_FUNC_DECL vec openBounded(vec const& Value, vec const& Min, vec const& Max); - - /// Returns whether vector components values are within an interval. A closed interval includes its endpoints, and is denoted with square brackets. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or integer scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see ext_vector_relational - template - GLM_FUNC_DECL vec closeBounded(vec const& Value, vec const& Min, vec const& Max); - - /// @} -}//namespace glm - -#include "common.inl" diff --git a/3rdparty/glm/source/glm/gtx/common.inl b/3rdparty/glm/source/glm/gtx/common.inl deleted file mode 100644 index 4ad2126..0000000 --- a/3rdparty/glm/source/glm/gtx/common.inl +++ /dev/null @@ -1,125 +0,0 @@ -/// @ref gtx_common - -#include -#include "../gtc/epsilon.hpp" -#include "../gtc/constants.hpp" - -namespace glm{ -namespace detail -{ - template - struct compute_fmod - { - GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) - { - return detail::functor2::call(std::fmod, a, b); - } - }; - - template - struct compute_fmod - { - GLM_FUNC_QUALIFIER static vec call(vec const& a, vec const& b) - { - return a % b; - } - }; -}//namespace detail - - template - GLM_FUNC_QUALIFIER bool isdenormal(T const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isdenormal' only accept floating-point inputs"); - -# if GLM_HAS_CXX11_STL - return std::fpclassify(x) == FP_SUBNORMAL; -# else - return epsilonNotEqual(x, static_cast(0), epsilon()) && std::fabs(x) < std::numeric_limits::min(); -# endif - } - - template - GLM_FUNC_QUALIFIER typename vec<1, T, Q>::bool_type isdenormal - ( - vec<1, T, Q> const& x - ) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isdenormal' only accept floating-point inputs"); - - return typename vec<1, T, Q>::bool_type( - isdenormal(x.x)); - } - - template - GLM_FUNC_QUALIFIER typename vec<2, T, Q>::bool_type isdenormal - ( - vec<2, T, Q> const& x - ) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isdenormal' only accept floating-point inputs"); - - return typename vec<2, T, Q>::bool_type( - isdenormal(x.x), - isdenormal(x.y)); - } - - template - GLM_FUNC_QUALIFIER typename vec<3, T, Q>::bool_type isdenormal - ( - vec<3, T, Q> const& x - ) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isdenormal' only accept floating-point inputs"); - - return typename vec<3, T, Q>::bool_type( - isdenormal(x.x), - isdenormal(x.y), - isdenormal(x.z)); - } - - template - GLM_FUNC_QUALIFIER typename vec<4, T, Q>::bool_type isdenormal - ( - vec<4, T, Q> const& x - ) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isdenormal' only accept floating-point inputs"); - - return typename vec<4, T, Q>::bool_type( - isdenormal(x.x), - isdenormal(x.y), - isdenormal(x.z), - isdenormal(x.w)); - } - - // fmod - template - GLM_FUNC_QUALIFIER genType fmod(genType x, genType y) - { - return fmod(vec<1, genType>(x), y).x; - } - - template - GLM_FUNC_QUALIFIER vec fmod(vec const& x, T y) - { - return detail::compute_fmod::is_iec559>::call(x, vec(y)); - } - - template - GLM_FUNC_QUALIFIER vec fmod(vec const& x, vec const& y) - { - return detail::compute_fmod::is_iec559>::call(x, y); - } - - template - GLM_FUNC_QUALIFIER vec openBounded(vec const& Value, vec const& Min, vec const& Max) - { - return greaterThan(Value, Min) && lessThan(Value, Max); - } - - template - GLM_FUNC_QUALIFIER vec closeBounded(vec const& Value, vec const& Min, vec const& Max) - { - return greaterThanEqual(Value, Min) && lessThanEqual(Value, Max); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/compatibility.hpp b/3rdparty/glm/source/glm/gtx/compatibility.hpp deleted file mode 100644 index f1b00a6..0000000 --- a/3rdparty/glm/source/glm/gtx/compatibility.hpp +++ /dev/null @@ -1,133 +0,0 @@ -/// @ref gtx_compatibility -/// @file glm/gtx/compatibility.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_compatibility GLM_GTX_compatibility -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Provide functions to increase the compatibility with Cg and HLSL languages - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtc/quaternion.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_compatibility is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_compatibility extension included") -# endif -#endif - -#if GLM_COMPILER & GLM_COMPILER_VC -# include -#elif GLM_COMPILER & GLM_COMPILER_GCC -# include -# if(GLM_PLATFORM & GLM_PLATFORM_ANDROID) -# undef isfinite -# endif -#endif//GLM_COMPILER - -namespace glm -{ - /// @addtogroup gtx_compatibility - /// @{ - - template GLM_FUNC_QUALIFIER T lerp(T x, T y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER vec<2, T, Q> lerp(const vec<2, T, Q>& x, const vec<2, T, Q>& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - - template GLM_FUNC_QUALIFIER vec<3, T, Q> lerp(const vec<3, T, Q>& x, const vec<3, T, Q>& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER vec<4, T, Q> lerp(const vec<4, T, Q>& x, const vec<4, T, Q>& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER vec<2, T, Q> lerp(const vec<2, T, Q>& x, const vec<2, T, Q>& y, const vec<2, T, Q>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER vec<3, T, Q> lerp(const vec<3, T, Q>& x, const vec<3, T, Q>& y, const vec<3, T, Q>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER vec<4, T, Q> lerp(const vec<4, T, Q>& x, const vec<4, T, Q>& y, const vec<4, T, Q>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility) - - template GLM_FUNC_QUALIFIER T saturate(T x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER vec<2, T, Q> saturate(const vec<2, T, Q>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER vec<3, T, Q> saturate(const vec<3, T, Q>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER vec<4, T, Q> saturate(const vec<4, T, Q>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility) - - template GLM_FUNC_QUALIFIER T atan2(T x, T y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER vec<2, T, Q> atan2(const vec<2, T, Q>& x, const vec<2, T, Q>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER vec<3, T, Q> atan2(const vec<3, T, Q>& x, const vec<3, T, Q>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) - template GLM_FUNC_QUALIFIER vec<4, T, Q> atan2(const vec<4, T, Q>& x, const vec<4, T, Q>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility) - - template GLM_FUNC_DECL bool isfinite(genType const& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) - template GLM_FUNC_DECL vec<1, bool, Q> isfinite(const vec<1, T, Q>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) - template GLM_FUNC_DECL vec<2, bool, Q> isfinite(const vec<2, T, Q>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) - template GLM_FUNC_DECL vec<3, bool, Q> isfinite(const vec<3, T, Q>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) - template GLM_FUNC_DECL vec<4, bool, Q> isfinite(const vec<4, T, Q>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility) - - typedef bool bool1; //!< \brief boolean type with 1 component. (From GLM_GTX_compatibility extension) - typedef vec<2, bool, highp> bool2; //!< \brief boolean type with 2 components. (From GLM_GTX_compatibility extension) - typedef vec<3, bool, highp> bool3; //!< \brief boolean type with 3 components. (From GLM_GTX_compatibility extension) - typedef vec<4, bool, highp> bool4; //!< \brief boolean type with 4 components. (From GLM_GTX_compatibility extension) - - typedef bool bool1x1; //!< \brief boolean matrix with 1 x 1 component. (From GLM_GTX_compatibility extension) - typedef mat<2, 2, bool, highp> bool2x2; //!< \brief boolean matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) - typedef mat<2, 3, bool, highp> bool2x3; //!< \brief boolean matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) - typedef mat<2, 4, bool, highp> bool2x4; //!< \brief boolean matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) - typedef mat<3, 2, bool, highp> bool3x2; //!< \brief boolean matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) - typedef mat<3, 3, bool, highp> bool3x3; //!< \brief boolean matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) - typedef mat<3, 4, bool, highp> bool3x4; //!< \brief boolean matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) - typedef mat<4, 2, bool, highp> bool4x2; //!< \brief boolean matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) - typedef mat<4, 3, bool, highp> bool4x3; //!< \brief boolean matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) - typedef mat<4, 4, bool, highp> bool4x4; //!< \brief boolean matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) - - typedef int int1; //!< \brief integer vector with 1 component. (From GLM_GTX_compatibility extension) - typedef vec<2, int, highp> int2; //!< \brief integer vector with 2 components. (From GLM_GTX_compatibility extension) - typedef vec<3, int, highp> int3; //!< \brief integer vector with 3 components. (From GLM_GTX_compatibility extension) - typedef vec<4, int, highp> int4; //!< \brief integer vector with 4 components. (From GLM_GTX_compatibility extension) - - typedef int int1x1; //!< \brief integer matrix with 1 component. (From GLM_GTX_compatibility extension) - typedef mat<2, 2, int, highp> int2x2; //!< \brief integer matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) - typedef mat<2, 3, int, highp> int2x3; //!< \brief integer matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) - typedef mat<2, 4, int, highp> int2x4; //!< \brief integer matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) - typedef mat<3, 2, int, highp> int3x2; //!< \brief integer matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) - typedef mat<3, 3, int, highp> int3x3; //!< \brief integer matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) - typedef mat<3, 4, int, highp> int3x4; //!< \brief integer matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) - typedef mat<4, 2, int, highp> int4x2; //!< \brief integer matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) - typedef mat<4, 3, int, highp> int4x3; //!< \brief integer matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) - typedef mat<4, 4, int, highp> int4x4; //!< \brief integer matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) - - typedef float float1; //!< \brief single-qualifier floating-point vector with 1 component. (From GLM_GTX_compatibility extension) - typedef vec<2, float, highp> float2; //!< \brief single-qualifier floating-point vector with 2 components. (From GLM_GTX_compatibility extension) - typedef vec<3, float, highp> float3; //!< \brief single-qualifier floating-point vector with 3 components. (From GLM_GTX_compatibility extension) - typedef vec<4, float, highp> float4; //!< \brief single-qualifier floating-point vector with 4 components. (From GLM_GTX_compatibility extension) - - typedef float float1x1; //!< \brief single-qualifier floating-point matrix with 1 component. (From GLM_GTX_compatibility extension) - typedef mat<2, 2, float, highp> float2x2; //!< \brief single-qualifier floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) - typedef mat<2, 3, float, highp> float2x3; //!< \brief single-qualifier floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) - typedef mat<2, 4, float, highp> float2x4; //!< \brief single-qualifier floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) - typedef mat<3, 2, float, highp> float3x2; //!< \brief single-qualifier floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) - typedef mat<3, 3, float, highp> float3x3; //!< \brief single-qualifier floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) - typedef mat<3, 4, float, highp> float3x4; //!< \brief single-qualifier floating-point matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) - typedef mat<4, 2, float, highp> float4x2; //!< \brief single-qualifier floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) - typedef mat<4, 3, float, highp> float4x3; //!< \brief single-qualifier floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) - typedef mat<4, 4, float, highp> float4x4; //!< \brief single-qualifier floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) - - typedef double double1; //!< \brief double-qualifier floating-point vector with 1 component. (From GLM_GTX_compatibility extension) - typedef vec<2, double, highp> double2; //!< \brief double-qualifier floating-point vector with 2 components. (From GLM_GTX_compatibility extension) - typedef vec<3, double, highp> double3; //!< \brief double-qualifier floating-point vector with 3 components. (From GLM_GTX_compatibility extension) - typedef vec<4, double, highp> double4; //!< \brief double-qualifier floating-point vector with 4 components. (From GLM_GTX_compatibility extension) - - typedef double double1x1; //!< \brief double-qualifier floating-point matrix with 1 component. (From GLM_GTX_compatibility extension) - typedef mat<2, 2, double, highp> double2x2; //!< \brief double-qualifier floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) - typedef mat<2, 3, double, highp> double2x3; //!< \brief double-qualifier floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) - typedef mat<2, 4, double, highp> double2x4; //!< \brief double-qualifier floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) - typedef mat<3, 2, double, highp> double3x2; //!< \brief double-qualifier floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) - typedef mat<3, 3, double, highp> double3x3; //!< \brief double-qualifier floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) - typedef mat<3, 4, double, highp> double3x4; //!< \brief double-qualifier floating-point matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) - typedef mat<4, 2, double, highp> double4x2; //!< \brief double-qualifier floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) - typedef mat<4, 3, double, highp> double4x3; //!< \brief double-qualifier floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) - typedef mat<4, 4, double, highp> double4x4; //!< \brief double-qualifier floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) - - /// @} -}//namespace glm - -#include "compatibility.inl" diff --git a/3rdparty/glm/source/glm/gtx/compatibility.inl b/3rdparty/glm/source/glm/gtx/compatibility.inl deleted file mode 100644 index 1d49496..0000000 --- a/3rdparty/glm/source/glm/gtx/compatibility.inl +++ /dev/null @@ -1,62 +0,0 @@ -#include - -namespace glm -{ - // isfinite - template - GLM_FUNC_QUALIFIER bool isfinite( - genType const& x) - { -# if GLM_HAS_CXX11_STL - return std::isfinite(x) != 0; -# elif GLM_COMPILER & GLM_COMPILER_VC - return _finite(x) != 0; -# elif GLM_COMPILER & GLM_COMPILER_GCC && GLM_PLATFORM & GLM_PLATFORM_ANDROID - return _isfinite(x) != 0; -# else - if (std::numeric_limits::is_integer || std::denorm_absent == std::numeric_limits::has_denorm) - return std::numeric_limits::min() <= x && std::numeric_limits::max() >= x; - else - return -std::numeric_limits::max() <= x && std::numeric_limits::max() >= x; -# endif - } - - template - GLM_FUNC_QUALIFIER vec<1, bool, Q> isfinite( - vec<1, T, Q> const& x) - { - return vec<1, bool, Q>( - isfinite(x.x)); - } - - template - GLM_FUNC_QUALIFIER vec<2, bool, Q> isfinite( - vec<2, T, Q> const& x) - { - return vec<2, bool, Q>( - isfinite(x.x), - isfinite(x.y)); - } - - template - GLM_FUNC_QUALIFIER vec<3, bool, Q> isfinite( - vec<3, T, Q> const& x) - { - return vec<3, bool, Q>( - isfinite(x.x), - isfinite(x.y), - isfinite(x.z)); - } - - template - GLM_FUNC_QUALIFIER vec<4, bool, Q> isfinite( - vec<4, T, Q> const& x) - { - return vec<4, bool, Q>( - isfinite(x.x), - isfinite(x.y), - isfinite(x.z), - isfinite(x.w)); - } - -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/component_wise.hpp b/3rdparty/glm/source/glm/gtx/component_wise.hpp deleted file mode 100644 index 34a2b0a..0000000 --- a/3rdparty/glm/source/glm/gtx/component_wise.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/// @ref gtx_component_wise -/// @file glm/gtx/component_wise.hpp -/// @date 2007-05-21 / 2011-06-07 -/// @author Christophe Riccio -/// -/// @see core (dependence) -/// -/// @defgroup gtx_component_wise GLM_GTX_component_wise -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Operations between components of a type - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" -#include "../detail/qualifier.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_component_wise is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_component_wise extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_component_wise - /// @{ - - /// Convert an integer vector to a normalized float vector. - /// If the parameter value type is already a floating qualifier type, the value is passed through. - /// @see gtx_component_wise - template - GLM_FUNC_DECL vec compNormalize(vec const& v); - - /// Convert a normalized float vector to an integer vector. - /// If the parameter value type is already a floating qualifier type, the value is passed through. - /// @see gtx_component_wise - template - GLM_FUNC_DECL vec compScale(vec const& v); - - /// Add all vector components together. - /// @see gtx_component_wise - template - GLM_FUNC_DECL typename genType::value_type compAdd(genType const& v); - - /// Multiply all vector components together. - /// @see gtx_component_wise - template - GLM_FUNC_DECL typename genType::value_type compMul(genType const& v); - - /// Find the minimum value between single vector components. - /// @see gtx_component_wise - template - GLM_FUNC_DECL typename genType::value_type compMin(genType const& v); - - /// Find the maximum value between single vector components. - /// @see gtx_component_wise - template - GLM_FUNC_DECL typename genType::value_type compMax(genType const& v); - - /// @} -}//namespace glm - -#include "component_wise.inl" diff --git a/3rdparty/glm/source/glm/gtx/component_wise.inl b/3rdparty/glm/source/glm/gtx/component_wise.inl deleted file mode 100644 index cbbc7d4..0000000 --- a/3rdparty/glm/source/glm/gtx/component_wise.inl +++ /dev/null @@ -1,127 +0,0 @@ -/// @ref gtx_component_wise - -#include - -namespace glm{ -namespace detail -{ - template - struct compute_compNormalize - {}; - - template - struct compute_compNormalize - { - GLM_FUNC_QUALIFIER static vec call(vec const& v) - { - floatType const Min = static_cast(std::numeric_limits::min()); - floatType const Max = static_cast(std::numeric_limits::max()); - return (vec(v) - Min) / (Max - Min) * static_cast(2) - static_cast(1); - } - }; - - template - struct compute_compNormalize - { - GLM_FUNC_QUALIFIER static vec call(vec const& v) - { - return vec(v) / static_cast(std::numeric_limits::max()); - } - }; - - template - struct compute_compNormalize - { - GLM_FUNC_QUALIFIER static vec call(vec const& v) - { - return v; - } - }; - - template - struct compute_compScale - {}; - - template - struct compute_compScale - { - GLM_FUNC_QUALIFIER static vec call(vec const& v) - { - floatType const Max = static_cast(std::numeric_limits::max()) + static_cast(0.5); - vec const Scaled(v * Max); - vec const Result(Scaled - static_cast(0.5)); - return Result; - } - }; - - template - struct compute_compScale - { - GLM_FUNC_QUALIFIER static vec call(vec const& v) - { - return vec(vec(v) * static_cast(std::numeric_limits::max())); - } - }; - - template - struct compute_compScale - { - GLM_FUNC_QUALIFIER static vec call(vec const& v) - { - return v; - } - }; -}//namespace detail - - template - GLM_FUNC_QUALIFIER vec compNormalize(vec const& v) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'compNormalize' accepts only floating-point types for 'floatType' template parameter"); - - return detail::compute_compNormalize::is_integer, std::numeric_limits::is_signed>::call(v); - } - - template - GLM_FUNC_QUALIFIER vec compScale(vec const& v) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'compScale' accepts only floating-point types for 'floatType' template parameter"); - - return detail::compute_compScale::is_integer, std::numeric_limits::is_signed>::call(v); - } - - template - GLM_FUNC_QUALIFIER T compAdd(vec const& v) - { - T Result(0); - for(length_t i = 0, n = v.length(); i < n; ++i) - Result += v[i]; - return Result; - } - - template - GLM_FUNC_QUALIFIER T compMul(vec const& v) - { - T Result(1); - for(length_t i = 0, n = v.length(); i < n; ++i) - Result *= v[i]; - return Result; - } - - template - GLM_FUNC_QUALIFIER T compMin(vec const& v) - { - T Result(v[0]); - for(length_t i = 1, n = v.length(); i < n; ++i) - Result = min(Result, v[i]); - return Result; - } - - template - GLM_FUNC_QUALIFIER T compMax(vec const& v) - { - T Result(v[0]); - for(length_t i = 1, n = v.length(); i < n; ++i) - Result = max(Result, v[i]); - return Result; - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/dual_quaternion.hpp b/3rdparty/glm/source/glm/gtx/dual_quaternion.hpp deleted file mode 100644 index 6a51ab7..0000000 --- a/3rdparty/glm/source/glm/gtx/dual_quaternion.hpp +++ /dev/null @@ -1,274 +0,0 @@ -/// @ref gtx_dual_quaternion -/// @file glm/gtx/dual_quaternion.hpp -/// @author Maksim Vorobiev (msomeone@gmail.com) -/// -/// @see core (dependence) -/// @see gtc_constants (dependence) -/// @see gtc_quaternion (dependence) -/// -/// @defgroup gtx_dual_quaternion GLM_GTX_dual_quaternion -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Defines a templated dual-quaternion type and several dual-quaternion operations. - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtc/constants.hpp" -#include "../gtc/quaternion.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_dual_quaternion is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_dual_quaternion extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_dual_quaternion - /// @{ - - template - struct tdualquat - { - // -- Implementation detail -- - - typedef T value_type; - typedef qua part_type; - - // -- Data -- - - qua real, dual; - - // -- Component accesses -- - - typedef length_t length_type; - /// Return the count of components of a dual quaternion - GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 2;} - - GLM_FUNC_DECL part_type & operator[](length_type i); - GLM_FUNC_DECL part_type const& operator[](length_type i) const; - - // -- Implicit basic constructors -- - - GLM_FUNC_DECL GLM_CONSTEXPR tdualquat() GLM_DEFAULT; - GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat const& d) GLM_DEFAULT; - template - GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat const& d); - - // -- Explicit basic constructors -- - - GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(qua const& real); - GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(qua const& orientation, vec<3, T, Q> const& translation); - GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(qua const& real, qua const& dual); - - // -- Conversion constructors -- - - template - GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tdualquat(tdualquat const& q); - - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR tdualquat(mat<2, 4, T, Q> const& holder_mat); - GLM_FUNC_DECL GLM_EXPLICIT GLM_CONSTEXPR tdualquat(mat<3, 4, T, Q> const& aug_mat); - - // -- Unary arithmetic operators -- - - GLM_FUNC_DECL tdualquat & operator=(tdualquat const& m) GLM_DEFAULT; - - template - GLM_FUNC_DECL tdualquat & operator=(tdualquat const& m); - template - GLM_FUNC_DECL tdualquat & operator*=(U s); - template - GLM_FUNC_DECL tdualquat & operator/=(U s); - }; - - // -- Unary bit operators -- - - template - GLM_FUNC_DECL tdualquat operator+(tdualquat const& q); - - template - GLM_FUNC_DECL tdualquat operator-(tdualquat const& q); - - // -- Binary operators -- - - template - GLM_FUNC_DECL tdualquat operator+(tdualquat const& q, tdualquat const& p); - - template - GLM_FUNC_DECL tdualquat operator*(tdualquat const& q, tdualquat const& p); - - template - GLM_FUNC_DECL vec<3, T, Q> operator*(tdualquat const& q, vec<3, T, Q> const& v); - - template - GLM_FUNC_DECL vec<3, T, Q> operator*(vec<3, T, Q> const& v, tdualquat const& q); - - template - GLM_FUNC_DECL vec<4, T, Q> operator*(tdualquat const& q, vec<4, T, Q> const& v); - - template - GLM_FUNC_DECL vec<4, T, Q> operator*(vec<4, T, Q> const& v, tdualquat const& q); - - template - GLM_FUNC_DECL tdualquat operator*(tdualquat const& q, T const& s); - - template - GLM_FUNC_DECL tdualquat operator*(T const& s, tdualquat const& q); - - template - GLM_FUNC_DECL tdualquat operator/(tdualquat const& q, T const& s); - - // -- Boolean operators -- - - template - GLM_FUNC_DECL bool operator==(tdualquat const& q1, tdualquat const& q2); - - template - GLM_FUNC_DECL bool operator!=(tdualquat const& q1, tdualquat const& q2); - - /// Creates an identity dual quaternion. - /// - /// @see gtx_dual_quaternion - template - GLM_FUNC_DECL tdualquat dual_quat_identity(); - - /// Returns the normalized quaternion. - /// - /// @see gtx_dual_quaternion - template - GLM_FUNC_DECL tdualquat normalize(tdualquat const& q); - - /// Returns the linear interpolation of two dual quaternion. - /// - /// @see gtc_dual_quaternion - template - GLM_FUNC_DECL tdualquat lerp(tdualquat const& x, tdualquat const& y, T const& a); - - /// Returns the q inverse. - /// - /// @see gtx_dual_quaternion - template - GLM_FUNC_DECL tdualquat inverse(tdualquat const& q); - - /// Converts a quaternion to a 2 * 4 matrix. - /// - /// @see gtx_dual_quaternion - template - GLM_FUNC_DECL mat<2, 4, T, Q> mat2x4_cast(tdualquat const& x); - - /// Converts a quaternion to a 3 * 4 matrix. - /// - /// @see gtx_dual_quaternion - template - GLM_FUNC_DECL mat<3, 4, T, Q> mat3x4_cast(tdualquat const& x); - - /// Converts a 2 * 4 matrix (matrix which holds real and dual parts) to a quaternion. - /// - /// @see gtx_dual_quaternion - template - GLM_FUNC_DECL tdualquat dualquat_cast(mat<2, 4, T, Q> const& x); - - /// Converts a 3 * 4 matrix (augmented matrix rotation + translation) to a quaternion. - /// - /// @see gtx_dual_quaternion - template - GLM_FUNC_DECL tdualquat dualquat_cast(mat<3, 4, T, Q> const& x); - - - /// Dual-quaternion of low single-qualifier floating-point numbers. - /// - /// @see gtx_dual_quaternion - typedef tdualquat lowp_dualquat; - - /// Dual-quaternion of medium single-qualifier floating-point numbers. - /// - /// @see gtx_dual_quaternion - typedef tdualquat mediump_dualquat; - - /// Dual-quaternion of high single-qualifier floating-point numbers. - /// - /// @see gtx_dual_quaternion - typedef tdualquat highp_dualquat; - - - /// Dual-quaternion of low single-qualifier floating-point numbers. - /// - /// @see gtx_dual_quaternion - typedef tdualquat lowp_fdualquat; - - /// Dual-quaternion of medium single-qualifier floating-point numbers. - /// - /// @see gtx_dual_quaternion - typedef tdualquat mediump_fdualquat; - - /// Dual-quaternion of high single-qualifier floating-point numbers. - /// - /// @see gtx_dual_quaternion - typedef tdualquat highp_fdualquat; - - - /// Dual-quaternion of low double-qualifier floating-point numbers. - /// - /// @see gtx_dual_quaternion - typedef tdualquat lowp_ddualquat; - - /// Dual-quaternion of medium double-qualifier floating-point numbers. - /// - /// @see gtx_dual_quaternion - typedef tdualquat mediump_ddualquat; - - /// Dual-quaternion of high double-qualifier floating-point numbers. - /// - /// @see gtx_dual_quaternion - typedef tdualquat highp_ddualquat; - - -#if(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) - /// Dual-quaternion of floating-point numbers. - /// - /// @see gtx_dual_quaternion - typedef highp_fdualquat dualquat; - - /// Dual-quaternion of single-qualifier floating-point numbers. - /// - /// @see gtx_dual_quaternion - typedef highp_fdualquat fdualquat; -#elif(defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) - typedef highp_fdualquat dualquat; - typedef highp_fdualquat fdualquat; -#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT)) - typedef mediump_fdualquat dualquat; - typedef mediump_fdualquat fdualquat; -#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && defined(GLM_PRECISION_LOWP_FLOAT)) - typedef lowp_fdualquat dualquat; - typedef lowp_fdualquat fdualquat; -#else -# error "GLM error: multiple default precision requested for single-precision floating-point types" -#endif - - -#if(!defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE)) - /// Dual-quaternion of default double-qualifier floating-point numbers. - /// - /// @see gtx_dual_quaternion - typedef highp_ddualquat ddualquat; -#elif(defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE)) - typedef highp_ddualquat ddualquat; -#elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && defined(GLM_PRECISION_MEDIUMP_DOUBLE) && !defined(GLM_PRECISION_LOWP_DOUBLE)) - typedef mediump_ddualquat ddualquat; -#elif(!defined(GLM_PRECISION_HIGHP_DOUBLE) && !defined(GLM_PRECISION_MEDIUMP_DOUBLE) && defined(GLM_PRECISION_LOWP_DOUBLE)) - typedef lowp_ddualquat ddualquat; -#else -# error "GLM error: Multiple default precision requested for double-precision floating-point types" -#endif - - /// @} -} //namespace glm - -#include "dual_quaternion.inl" diff --git a/3rdparty/glm/source/glm/gtx/dual_quaternion.inl b/3rdparty/glm/source/glm/gtx/dual_quaternion.inl deleted file mode 100644 index fad07ea..0000000 --- a/3rdparty/glm/source/glm/gtx/dual_quaternion.inl +++ /dev/null @@ -1,352 +0,0 @@ -/// @ref gtx_dual_quaternion - -#include "../geometric.hpp" -#include - -namespace glm -{ - // -- Component accesses -- - - template - GLM_FUNC_QUALIFIER typename tdualquat::part_type & tdualquat::operator[](typename tdualquat::length_type i) - { - assert(i >= 0 && i < this->length()); - return (&real)[i]; - } - - template - GLM_FUNC_QUALIFIER typename tdualquat::part_type const& tdualquat::operator[](typename tdualquat::length_type i) const - { - assert(i >= 0 && i < this->length()); - return (&real)[i]; - } - - // -- Implicit basic constructors -- - -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat() -# if GLM_CONFIG_DEFAULTED_FUNCTIONS != GLM_DISABLE - : real(qua()) - , dual(qua(0, 0, 0, 0)) -# endif - {} - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tdualquat const& d) - : real(d.real) - , dual(d.dual) - {} -# endif - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tdualquat const& d) - : real(d.real) - , dual(d.dual) - {} - - // -- Explicit basic constructors -- - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(qua const& r) - : real(r), dual(qua(0, 0, 0, 0)) - {} - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(qua const& q, vec<3, T, Q> const& p) - : real(q), dual( - T(-0.5) * ( p.x*q.x + p.y*q.y + p.z*q.z), - T(+0.5) * ( p.x*q.w + p.y*q.z - p.z*q.y), - T(+0.5) * (-p.x*q.z + p.y*q.w + p.z*q.x), - T(+0.5) * ( p.x*q.y - p.y*q.x + p.z*q.w)) - {} - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(qua const& r, qua const& d) - : real(r), dual(d) - {} - - // -- Conversion constructors -- - - template - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(tdualquat const& q) - : real(q.real) - , dual(q.dual) - {} - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(mat<2, 4, T, Q> const& m) - { - *this = dualquat_cast(m); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tdualquat::tdualquat(mat<3, 4, T, Q> const& m) - { - *this = dualquat_cast(m); - } - - // -- Unary arithmetic operators -- - -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_DISABLE - template - GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator=(tdualquat const& q) - { - this->real = q.real; - this->dual = q.dual; - return *this; - } -# endif - - template - template - GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator=(tdualquat const& q) - { - this->real = q.real; - this->dual = q.dual; - return *this; - } - - template - template - GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator*=(U s) - { - this->real *= static_cast(s); - this->dual *= static_cast(s); - return *this; - } - - template - template - GLM_FUNC_QUALIFIER tdualquat & tdualquat::operator/=(U s) - { - this->real /= static_cast(s); - this->dual /= static_cast(s); - return *this; - } - - // -- Unary bit operators -- - - template - GLM_FUNC_QUALIFIER tdualquat operator+(tdualquat const& q) - { - return q; - } - - template - GLM_FUNC_QUALIFIER tdualquat operator-(tdualquat const& q) - { - return tdualquat(-q.real, -q.dual); - } - - // -- Binary operators -- - - template - GLM_FUNC_QUALIFIER tdualquat operator+(tdualquat const& q, tdualquat const& p) - { - return tdualquat(q.real + p.real,q.dual + p.dual); - } - - template - GLM_FUNC_QUALIFIER tdualquat operator*(tdualquat const& p, tdualquat const& o) - { - return tdualquat(p.real * o.real,p.real * o.dual + p.dual * o.real); - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator*(tdualquat const& q, vec<3, T, Q> const& v) - { - vec<3, T, Q> const real_v3(q.real.x,q.real.y,q.real.z); - vec<3, T, Q> const dual_v3(q.dual.x,q.dual.y,q.dual.z); - return (cross(real_v3, cross(real_v3,v) + v * q.real.w + dual_v3) + dual_v3 * q.real.w - real_v3 * q.dual.w) * T(2) + v; - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> operator*(vec<3, T, Q> const& v, tdualquat const& q) - { - return glm::inverse(q) * v; - } - - template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator*(tdualquat const& q, vec<4, T, Q> const& v) - { - return vec<4, T, Q>(q * vec<3, T, Q>(v), v.w); - } - - template - GLM_FUNC_QUALIFIER vec<4, T, Q> operator*(vec<4, T, Q> const& v, tdualquat const& q) - { - return glm::inverse(q) * v; - } - - template - GLM_FUNC_QUALIFIER tdualquat operator*(tdualquat const& q, T const& s) - { - return tdualquat(q.real * s, q.dual * s); - } - - template - GLM_FUNC_QUALIFIER tdualquat operator*(T const& s, tdualquat const& q) - { - return q * s; - } - - template - GLM_FUNC_QUALIFIER tdualquat operator/(tdualquat const& q, T const& s) - { - return tdualquat(q.real / s, q.dual / s); - } - - // -- Boolean operators -- - - template - GLM_FUNC_QUALIFIER bool operator==(tdualquat const& q1, tdualquat const& q2) - { - return (q1.real == q2.real) && (q1.dual == q2.dual); - } - - template - GLM_FUNC_QUALIFIER bool operator!=(tdualquat const& q1, tdualquat const& q2) - { - return (q1.real != q2.real) || (q1.dual != q2.dual); - } - - // -- Operations -- - - template - GLM_FUNC_QUALIFIER tdualquat dual_quat_identity() - { - return tdualquat( - qua(static_cast(1), static_cast(0), static_cast(0), static_cast(0)), - qua(static_cast(0), static_cast(0), static_cast(0), static_cast(0))); - } - - template - GLM_FUNC_QUALIFIER tdualquat normalize(tdualquat const& q) - { - return q / length(q.real); - } - - template - GLM_FUNC_QUALIFIER tdualquat lerp(tdualquat const& x, tdualquat const& y, T const& a) - { - // Dual Quaternion Linear blend aka DLB: - // Lerp is only defined in [0, 1] - assert(a >= static_cast(0)); - assert(a <= static_cast(1)); - T const k = dot(x.real,y.real) < static_cast(0) ? -a : a; - T const one(1); - return tdualquat(x * (one - a) + y * k); - } - - template - GLM_FUNC_QUALIFIER tdualquat inverse(tdualquat const& q) - { - const glm::qua real = conjugate(q.real); - const glm::qua dual = conjugate(q.dual); - return tdualquat(real, dual + (real * (-2.0f * dot(real,dual)))); - } - - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> mat2x4_cast(tdualquat const& x) - { - return mat<2, 4, T, Q>( x[0].x, x[0].y, x[0].z, x[0].w, x[1].x, x[1].y, x[1].z, x[1].w ); - } - - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> mat3x4_cast(tdualquat const& x) - { - qua r = x.real / length2(x.real); - - qua const rr(r.w * x.real.w, r.x * x.real.x, r.y * x.real.y, r.z * x.real.z); - r *= static_cast(2); - - T const xy = r.x * x.real.y; - T const xz = r.x * x.real.z; - T const yz = r.y * x.real.z; - T const wx = r.w * x.real.x; - T const wy = r.w * x.real.y; - T const wz = r.w * x.real.z; - - vec<4, T, Q> const a( - rr.w + rr.x - rr.y - rr.z, - xy - wz, - xz + wy, - -(x.dual.w * r.x - x.dual.x * r.w + x.dual.y * r.z - x.dual.z * r.y)); - - vec<4, T, Q> const b( - xy + wz, - rr.w + rr.y - rr.x - rr.z, - yz - wx, - -(x.dual.w * r.y - x.dual.x * r.z - x.dual.y * r.w + x.dual.z * r.x)); - - vec<4, T, Q> const c( - xz - wy, - yz + wx, - rr.w + rr.z - rr.x - rr.y, - -(x.dual.w * r.z + x.dual.x * r.y - x.dual.y * r.x - x.dual.z * r.w)); - - return mat<3, 4, T, Q>(a, b, c); - } - - template - GLM_FUNC_QUALIFIER tdualquat dualquat_cast(mat<2, 4, T, Q> const& x) - { - return tdualquat( - qua( x[0].w, x[0].x, x[0].y, x[0].z ), - qua( x[1].w, x[1].x, x[1].y, x[1].z )); - } - - template - GLM_FUNC_QUALIFIER tdualquat dualquat_cast(mat<3, 4, T, Q> const& x) - { - qua real; - - T const trace = x[0].x + x[1].y + x[2].z; - if(trace > static_cast(0)) - { - T const r = sqrt(T(1) + trace); - T const invr = static_cast(0.5) / r; - real.w = static_cast(0.5) * r; - real.x = (x[2].y - x[1].z) * invr; - real.y = (x[0].z - x[2].x) * invr; - real.z = (x[1].x - x[0].y) * invr; - } - else if(x[0].x > x[1].y && x[0].x > x[2].z) - { - T const r = sqrt(T(1) + x[0].x - x[1].y - x[2].z); - T const invr = static_cast(0.5) / r; - real.x = static_cast(0.5)*r; - real.y = (x[1].x + x[0].y) * invr; - real.z = (x[0].z + x[2].x) * invr; - real.w = (x[2].y - x[1].z) * invr; - } - else if(x[1].y > x[2].z) - { - T const r = sqrt(T(1) + x[1].y - x[0].x - x[2].z); - T const invr = static_cast(0.5) / r; - real.x = (x[1].x + x[0].y) * invr; - real.y = static_cast(0.5) * r; - real.z = (x[2].y + x[1].z) * invr; - real.w = (x[0].z - x[2].x) * invr; - } - else - { - T const r = sqrt(T(1) + x[2].z - x[0].x - x[1].y); - T const invr = static_cast(0.5) / r; - real.x = (x[0].z + x[2].x) * invr; - real.y = (x[2].y + x[1].z) * invr; - real.z = static_cast(0.5) * r; - real.w = (x[1].x - x[0].y) * invr; - } - - qua dual; - dual.x = static_cast(0.5) * ( x[0].w * real.w + x[1].w * real.z - x[2].w * real.y); - dual.y = static_cast(0.5) * (-x[0].w * real.z + x[1].w * real.w + x[2].w * real.x); - dual.z = static_cast(0.5) * ( x[0].w * real.y - x[1].w * real.x + x[2].w * real.w); - dual.w = -static_cast(0.5) * ( x[0].w * real.x + x[1].w * real.y + x[2].w * real.z); - return tdualquat(real, dual); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/easing.hpp b/3rdparty/glm/source/glm/gtx/easing.hpp deleted file mode 100644 index 57f3d61..0000000 --- a/3rdparty/glm/source/glm/gtx/easing.hpp +++ /dev/null @@ -1,219 +0,0 @@ -/// @ref gtx_easing -/// @file glm/gtx/easing.hpp -/// @author Robert Chisholm -/// -/// @see core (dependence) -/// -/// @defgroup gtx_easing GLM_GTX_easing -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Easing functions for animations and transitons -/// All functions take a parameter x in the range [0.0,1.0] -/// -/// Based on the AHEasing project of Warren Moore (https://github.com/warrenm/AHEasing) - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtc/constants.hpp" -#include "../detail/qualifier.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_easing is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_easing extension included") -# endif -#endif - -namespace glm{ - /// @addtogroup gtx_easing - /// @{ - - /// Modelled after the line y = x - /// @see gtx_easing - template - GLM_FUNC_DECL genType linearInterpolation(genType const & a); - - /// Modelled after the parabola y = x^2 - /// @see gtx_easing - template - GLM_FUNC_DECL genType quadraticEaseIn(genType const & a); - - /// Modelled after the parabola y = -x^2 + 2x - /// @see gtx_easing - template - GLM_FUNC_DECL genType quadraticEaseOut(genType const & a); - - /// Modelled after the piecewise quadratic - /// y = (1/2)((2x)^2) ; [0, 0.5) - /// y = -(1/2)((2x-1)*(2x-3) - 1) ; [0.5, 1] - /// @see gtx_easing - template - GLM_FUNC_DECL genType quadraticEaseInOut(genType const & a); - - /// Modelled after the cubic y = x^3 - template - GLM_FUNC_DECL genType cubicEaseIn(genType const & a); - - /// Modelled after the cubic y = (x - 1)^3 + 1 - /// @see gtx_easing - template - GLM_FUNC_DECL genType cubicEaseOut(genType const & a); - - /// Modelled after the piecewise cubic - /// y = (1/2)((2x)^3) ; [0, 0.5) - /// y = (1/2)((2x-2)^3 + 2) ; [0.5, 1] - /// @see gtx_easing - template - GLM_FUNC_DECL genType cubicEaseInOut(genType const & a); - - /// Modelled after the quartic x^4 - /// @see gtx_easing - template - GLM_FUNC_DECL genType quarticEaseIn(genType const & a); - - /// Modelled after the quartic y = 1 - (x - 1)^4 - /// @see gtx_easing - template - GLM_FUNC_DECL genType quarticEaseOut(genType const & a); - - /// Modelled after the piecewise quartic - /// y = (1/2)((2x)^4) ; [0, 0.5) - /// y = -(1/2)((2x-2)^4 - 2) ; [0.5, 1] - /// @see gtx_easing - template - GLM_FUNC_DECL genType quarticEaseInOut(genType const & a); - - /// Modelled after the quintic y = x^5 - /// @see gtx_easing - template - GLM_FUNC_DECL genType quinticEaseIn(genType const & a); - - /// Modelled after the quintic y = (x - 1)^5 + 1 - /// @see gtx_easing - template - GLM_FUNC_DECL genType quinticEaseOut(genType const & a); - - /// Modelled after the piecewise quintic - /// y = (1/2)((2x)^5) ; [0, 0.5) - /// y = (1/2)((2x-2)^5 + 2) ; [0.5, 1] - /// @see gtx_easing - template - GLM_FUNC_DECL genType quinticEaseInOut(genType const & a); - - /// Modelled after quarter-cycle of sine wave - /// @see gtx_easing - template - GLM_FUNC_DECL genType sineEaseIn(genType const & a); - - /// Modelled after quarter-cycle of sine wave (different phase) - /// @see gtx_easing - template - GLM_FUNC_DECL genType sineEaseOut(genType const & a); - - /// Modelled after half sine wave - /// @see gtx_easing - template - GLM_FUNC_DECL genType sineEaseInOut(genType const & a); - - /// Modelled after shifted quadrant IV of unit circle - /// @see gtx_easing - template - GLM_FUNC_DECL genType circularEaseIn(genType const & a); - - /// Modelled after shifted quadrant II of unit circle - /// @see gtx_easing - template - GLM_FUNC_DECL genType circularEaseOut(genType const & a); - - /// Modelled after the piecewise circular function - /// y = (1/2)(1 - sqrt(1 - 4x^2)) ; [0, 0.5) - /// y = (1/2)(sqrt(-(2x - 3)*(2x - 1)) + 1) ; [0.5, 1] - /// @see gtx_easing - template - GLM_FUNC_DECL genType circularEaseInOut(genType const & a); - - /// Modelled after the exponential function y = 2^(10(x - 1)) - /// @see gtx_easing - template - GLM_FUNC_DECL genType exponentialEaseIn(genType const & a); - - /// Modelled after the exponential function y = -2^(-10x) + 1 - /// @see gtx_easing - template - GLM_FUNC_DECL genType exponentialEaseOut(genType const & a); - - /// Modelled after the piecewise exponential - /// y = (1/2)2^(10(2x - 1)) ; [0,0.5) - /// y = -(1/2)*2^(-10(2x - 1))) + 1 ; [0.5,1] - /// @see gtx_easing - template - GLM_FUNC_DECL genType exponentialEaseInOut(genType const & a); - - /// Modelled after the damped sine wave y = sin(13pi/2*x)*pow(2, 10 * (x - 1)) - /// @see gtx_easing - template - GLM_FUNC_DECL genType elasticEaseIn(genType const & a); - - /// Modelled after the damped sine wave y = sin(-13pi/2*(x + 1))*pow(2, -10x) + 1 - /// @see gtx_easing - template - GLM_FUNC_DECL genType elasticEaseOut(genType const & a); - - /// Modelled after the piecewise exponentially-damped sine wave: - /// y = (1/2)*sin(13pi/2*(2*x))*pow(2, 10 * ((2*x) - 1)) ; [0,0.5) - /// y = (1/2)*(sin(-13pi/2*((2x-1)+1))*pow(2,-10(2*x-1)) + 2) ; [0.5, 1] - /// @see gtx_easing - template - GLM_FUNC_DECL genType elasticEaseInOut(genType const & a); - - /// @see gtx_easing - template - GLM_FUNC_DECL genType backEaseIn(genType const& a); - - /// @see gtx_easing - template - GLM_FUNC_DECL genType backEaseOut(genType const& a); - - /// @see gtx_easing - template - GLM_FUNC_DECL genType backEaseInOut(genType const& a); - - /// @param a parameter - /// @param o Optional overshoot modifier - /// @see gtx_easing - template - GLM_FUNC_DECL genType backEaseIn(genType const& a, genType const& o); - - /// @param a parameter - /// @param o Optional overshoot modifier - /// @see gtx_easing - template - GLM_FUNC_DECL genType backEaseOut(genType const& a, genType const& o); - - /// @param a parameter - /// @param o Optional overshoot modifier - /// @see gtx_easing - template - GLM_FUNC_DECL genType backEaseInOut(genType const& a, genType const& o); - - /// @see gtx_easing - template - GLM_FUNC_DECL genType bounceEaseIn(genType const& a); - - /// @see gtx_easing - template - GLM_FUNC_DECL genType bounceEaseOut(genType const& a); - - /// @see gtx_easing - template - GLM_FUNC_DECL genType bounceEaseInOut(genType const& a); - - /// @} -}//namespace glm - -#include "easing.inl" diff --git a/3rdparty/glm/source/glm/gtx/easing.inl b/3rdparty/glm/source/glm/gtx/easing.inl deleted file mode 100644 index 4b7d05b..0000000 --- a/3rdparty/glm/source/glm/gtx/easing.inl +++ /dev/null @@ -1,436 +0,0 @@ -/// @ref gtx_easing - -#include - -namespace glm{ - - template - GLM_FUNC_QUALIFIER genType linearInterpolation(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - return a; - } - - template - GLM_FUNC_QUALIFIER genType quadraticEaseIn(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - return a * a; - } - - template - GLM_FUNC_QUALIFIER genType quadraticEaseOut(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - return -(a * (a - static_cast(2))); - } - - template - GLM_FUNC_QUALIFIER genType quadraticEaseInOut(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - if(a < static_cast(0.5)) - { - return static_cast(2) * a * a; - } - else - { - return (-static_cast(2) * a * a) + (4 * a) - one(); - } - } - - template - GLM_FUNC_QUALIFIER genType cubicEaseIn(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - return a * a * a; - } - - template - GLM_FUNC_QUALIFIER genType cubicEaseOut(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - genType const f = a - one(); - return f * f * f + one(); - } - - template - GLM_FUNC_QUALIFIER genType cubicEaseInOut(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - if (a < static_cast(0.5)) - { - return static_cast(4) * a * a * a; - } - else - { - genType const f = ((static_cast(2) * a) - static_cast(2)); - return static_cast(0.5) * f * f * f + one(); - } - } - - template - GLM_FUNC_QUALIFIER genType quarticEaseIn(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - return a * a * a * a; - } - - template - GLM_FUNC_QUALIFIER genType quarticEaseOut(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - genType const f = (a - one()); - return f * f * f * (one() - a) + one(); - } - - template - GLM_FUNC_QUALIFIER genType quarticEaseInOut(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - if(a < static_cast(0.5)) - { - return static_cast(8) * a * a * a * a; - } - else - { - genType const f = (a - one()); - return -static_cast(8) * f * f * f * f + one(); - } - } - - template - GLM_FUNC_QUALIFIER genType quinticEaseIn(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - return a * a * a * a * a; - } - - template - GLM_FUNC_QUALIFIER genType quinticEaseOut(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - genType const f = (a - one()); - return f * f * f * f * f + one(); - } - - template - GLM_FUNC_QUALIFIER genType quinticEaseInOut(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - if(a < static_cast(0.5)) - { - return static_cast(16) * a * a * a * a * a; - } - else - { - genType const f = ((static_cast(2) * a) - static_cast(2)); - return static_cast(0.5) * f * f * f * f * f + one(); - } - } - - template - GLM_FUNC_QUALIFIER genType sineEaseIn(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - return sin((a - one()) * half_pi()) + one(); - } - - template - GLM_FUNC_QUALIFIER genType sineEaseOut(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - return sin(a * half_pi()); - } - - template - GLM_FUNC_QUALIFIER genType sineEaseInOut(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - return static_cast(0.5) * (one() - cos(a * pi())); - } - - template - GLM_FUNC_QUALIFIER genType circularEaseIn(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - return one() - sqrt(one() - (a * a)); - } - - template - GLM_FUNC_QUALIFIER genType circularEaseOut(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - return sqrt((static_cast(2) - a) * a); - } - - template - GLM_FUNC_QUALIFIER genType circularEaseInOut(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - if(a < static_cast(0.5)) - { - return static_cast(0.5) * (one() - std::sqrt(one() - static_cast(4) * (a * a))); - } - else - { - return static_cast(0.5) * (std::sqrt(-((static_cast(2) * a) - static_cast(3)) * ((static_cast(2) * a) - one())) + one()); - } - } - - template - GLM_FUNC_QUALIFIER genType exponentialEaseIn(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - if(a <= zero()) - return a; - else - { - genType const Complementary = a - one(); - genType const Two = static_cast(2); - - return glm::pow(Two, Complementary * static_cast(10)); - } - } - - template - GLM_FUNC_QUALIFIER genType exponentialEaseOut(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - if(a >= one()) - return a; - else - { - return one() - glm::pow(static_cast(2), -static_cast(10) * a); - } - } - - template - GLM_FUNC_QUALIFIER genType exponentialEaseInOut(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - if(a < static_cast(0.5)) - return static_cast(0.5) * glm::pow(static_cast(2), (static_cast(20) * a) - static_cast(10)); - else - return -static_cast(0.5) * glm::pow(static_cast(2), (-static_cast(20) * a) + static_cast(10)) + one(); - } - - template - GLM_FUNC_QUALIFIER genType elasticEaseIn(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - return std::sin(static_cast(13) * half_pi() * a) * glm::pow(static_cast(2), static_cast(10) * (a - one())); - } - - template - GLM_FUNC_QUALIFIER genType elasticEaseOut(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - return std::sin(-static_cast(13) * half_pi() * (a + one())) * glm::pow(static_cast(2), -static_cast(10) * a) + one(); - } - - template - GLM_FUNC_QUALIFIER genType elasticEaseInOut(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - if(a < static_cast(0.5)) - return static_cast(0.5) * std::sin(static_cast(13) * half_pi() * (static_cast(2) * a)) * glm::pow(static_cast(2), static_cast(10) * ((static_cast(2) * a) - one())); - else - return static_cast(0.5) * (std::sin(-static_cast(13) * half_pi() * ((static_cast(2) * a - one()) + one())) * glm::pow(static_cast(2), -static_cast(10) * (static_cast(2) * a - one())) + static_cast(2)); - } - - template - GLM_FUNC_QUALIFIER genType backEaseIn(genType const& a, genType const& o) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - genType z = ((o + one()) * a) - o; - return (a * a * z); - } - - template - GLM_FUNC_QUALIFIER genType backEaseOut(genType const& a, genType const& o) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - genType n = a - one(); - genType z = ((o + one()) * n) + o; - return (n * n * z) + one(); - } - - template - GLM_FUNC_QUALIFIER genType backEaseInOut(genType const& a, genType const& o) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - genType s = o * static_cast(1.525); - genType x = static_cast(0.5); - genType n = a / static_cast(0.5); - - if (n < static_cast(1)) - { - genType z = ((s + static_cast(1)) * n) - s; - genType m = n * n * z; - return x * m; - } - else - { - n -= static_cast(2); - genType z = ((s + static_cast(1)) * n) + s; - genType m = (n*n*z) + static_cast(2); - return x * m; - } - } - - template - GLM_FUNC_QUALIFIER genType backEaseIn(genType const& a) - { - return backEaseIn(a, static_cast(1.70158)); - } - - template - GLM_FUNC_QUALIFIER genType backEaseOut(genType const& a) - { - return backEaseOut(a, static_cast(1.70158)); - } - - template - GLM_FUNC_QUALIFIER genType backEaseInOut(genType const& a) - { - return backEaseInOut(a, static_cast(1.70158)); - } - - template - GLM_FUNC_QUALIFIER genType bounceEaseOut(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - if(a < static_cast(4.0 / 11.0)) - { - return (static_cast(121) * a * a) / static_cast(16); - } - else if(a < static_cast(8.0 / 11.0)) - { - return (static_cast(363.0 / 40.0) * a * a) - (static_cast(99.0 / 10.0) * a) + static_cast(17.0 / 5.0); - } - else if(a < static_cast(9.0 / 10.0)) - { - return (static_cast(4356.0 / 361.0) * a * a) - (static_cast(35442.0 / 1805.0) * a) + static_cast(16061.0 / 1805.0); - } - else - { - return (static_cast(54.0 / 5.0) * a * a) - (static_cast(513.0 / 25.0) * a) + static_cast(268.0 / 25.0); - } - } - - template - GLM_FUNC_QUALIFIER genType bounceEaseIn(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - return one() - bounceEaseOut(one() - a); - } - - template - GLM_FUNC_QUALIFIER genType bounceEaseInOut(genType const& a) - { - // Only defined in [0, 1] - assert(a >= zero()); - assert(a <= one()); - - if(a < static_cast(0.5)) - { - return static_cast(0.5) * (one() - bounceEaseOut(a * static_cast(2))); - } - else - { - return static_cast(0.5) * bounceEaseOut(a * static_cast(2) - one()) + static_cast(0.5); - } - } - -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/euler_angles.hpp b/3rdparty/glm/source/glm/gtx/euler_angles.hpp deleted file mode 100644 index 2723697..0000000 --- a/3rdparty/glm/source/glm/gtx/euler_angles.hpp +++ /dev/null @@ -1,335 +0,0 @@ -/// @ref gtx_euler_angles -/// @file glm/gtx/euler_angles.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_euler_angles GLM_GTX_euler_angles -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Build matrices from Euler angles. -/// -/// Extraction of Euler angles from rotation matrix. -/// Based on the original paper 2014 Mike Day - Extracting Euler Angles from a Rotation Matrix. - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_euler_angles is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_euler_angles extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_euler_angles - /// @{ - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle X. - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleX( - T const& angleX); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle Y. - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleY( - T const& angleY); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from an euler angle Z. - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZ( - T const& angleZ); - - /// Creates a 3D 4 * 4 homogeneous derived matrix from the rotation matrix about X-axis. - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> derivedEulerAngleX( - T const & angleX, T const & angularVelocityX); - - /// Creates a 3D 4 * 4 homogeneous derived matrix from the rotation matrix about Y-axis. - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> derivedEulerAngleY( - T const & angleY, T const & angularVelocityY); - - /// Creates a 3D 4 * 4 homogeneous derived matrix from the rotation matrix about Z-axis. - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> derivedEulerAngleZ( - T const & angleZ, T const & angularVelocityZ); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Y). - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleXY( - T const& angleX, - T const& angleY); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X). - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleYX( - T const& angleY, - T const& angleX); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Z). - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleXZ( - T const& angleX, - T const& angleZ); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * X). - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZX( - T const& angle, - T const& angleX); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * Z). - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleYZ( - T const& angleY, - T const& angleZ); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * Y). - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZY( - T const& angleZ, - T const& angleY); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Y * Z). - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleXYZ( - T const& t1, - T const& t2, - T const& t3); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z). - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleYXZ( - T const& yaw, - T const& pitch, - T const& roll); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Z * X). - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleXZX( - T const & t1, - T const & t2, - T const & t3); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Y * X). - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleXYX( - T const & t1, - T const & t2, - T const & t3); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Y). - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleYXY( - T const & t1, - T const & t2, - T const & t3); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * Z * Y). - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleYZY( - T const & t1, - T const & t2, - T const & t3); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * Y * Z). - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZYZ( - T const & t1, - T const & t2, - T const & t3); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * X * Z). - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZXZ( - T const & t1, - T const & t2, - T const & t3); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (X * Z * Y). - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleXZY( - T const & t1, - T const & t2, - T const & t3); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * Z * X). - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleYZX( - T const & t1, - T const & t2, - T const & t3); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * Y * X). - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZYX( - T const & t1, - T const & t2, - T const & t3); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Z * X * Y). - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> eulerAngleZXY( - T const & t1, - T const & t2, - T const & t3); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z). - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, defaultp> yawPitchRoll( - T const& yaw, - T const& pitch, - T const& roll); - - /// Creates a 2D 2 * 2 rotation matrix from an euler angle. - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<2, 2, T, defaultp> orientate2(T const& angle); - - /// Creates a 2D 4 * 4 homogeneous rotation matrix from an euler angle. - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<3, 3, T, defaultp> orientate3(T const& angle); - - /// Creates a 3D 3 * 3 rotation matrix from euler angles (Y * X * Z). - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<3, 3, T, Q> orientate3(vec<3, T, Q> const& angles); - - /// Creates a 3D 4 * 4 homogeneous rotation matrix from euler angles (Y * X * Z). - /// @see gtx_euler_angles - template - GLM_FUNC_DECL mat<4, 4, T, Q> orientate4(vec<3, T, Q> const& angles); - - /// Extracts the (X * Y * Z) Euler angles from the rotation matrix M - /// @see gtx_euler_angles - template - GLM_FUNC_DECL void extractEulerAngleXYZ(mat<4, 4, T, defaultp> const& M, - T & t1, - T & t2, - T & t3); - - /// Extracts the (Y * X * Z) Euler angles from the rotation matrix M - /// @see gtx_euler_angles - template - GLM_FUNC_DECL void extractEulerAngleYXZ(mat<4, 4, T, defaultp> const & M, - T & t1, - T & t2, - T & t3); - - /// Extracts the (X * Z * X) Euler angles from the rotation matrix M - /// @see gtx_euler_angles - template - GLM_FUNC_DECL void extractEulerAngleXZX(mat<4, 4, T, defaultp> const & M, - T & t1, - T & t2, - T & t3); - - /// Extracts the (X * Y * X) Euler angles from the rotation matrix M - /// @see gtx_euler_angles - template - GLM_FUNC_DECL void extractEulerAngleXYX(mat<4, 4, T, defaultp> const & M, - T & t1, - T & t2, - T & t3); - - /// Extracts the (Y * X * Y) Euler angles from the rotation matrix M - /// @see gtx_euler_angles - template - GLM_FUNC_DECL void extractEulerAngleYXY(mat<4, 4, T, defaultp> const & M, - T & t1, - T & t2, - T & t3); - - /// Extracts the (Y * Z * Y) Euler angles from the rotation matrix M - /// @see gtx_euler_angles - template - GLM_FUNC_DECL void extractEulerAngleYZY(mat<4, 4, T, defaultp> const & M, - T & t1, - T & t2, - T & t3); - - /// Extracts the (Z * Y * Z) Euler angles from the rotation matrix M - /// @see gtx_euler_angles - template - GLM_FUNC_DECL void extractEulerAngleZYZ(mat<4, 4, T, defaultp> const & M, - T & t1, - T & t2, - T & t3); - - /// Extracts the (Z * X * Z) Euler angles from the rotation matrix M - /// @see gtx_euler_angles - template - GLM_FUNC_DECL void extractEulerAngleZXZ(mat<4, 4, T, defaultp> const & M, - T & t1, - T & t2, - T & t3); - - /// Extracts the (X * Z * Y) Euler angles from the rotation matrix M - /// @see gtx_euler_angles - template - GLM_FUNC_DECL void extractEulerAngleXZY(mat<4, 4, T, defaultp> const & M, - T & t1, - T & t2, - T & t3); - - /// Extracts the (Y * Z * X) Euler angles from the rotation matrix M - /// @see gtx_euler_angles - template - GLM_FUNC_DECL void extractEulerAngleYZX(mat<4, 4, T, defaultp> const & M, - T & t1, - T & t2, - T & t3); - - /// Extracts the (Z * Y * X) Euler angles from the rotation matrix M - /// @see gtx_euler_angles - template - GLM_FUNC_DECL void extractEulerAngleZYX(mat<4, 4, T, defaultp> const & M, - T & t1, - T & t2, - T & t3); - - /// Extracts the (Z * X * Y) Euler angles from the rotation matrix M - /// @see gtx_euler_angles - template - GLM_FUNC_DECL void extractEulerAngleZXY(mat<4, 4, T, defaultp> const & M, - T & t1, - T & t2, - T & t3); - - /// @} -}//namespace glm - -#include "euler_angles.inl" diff --git a/3rdparty/glm/source/glm/gtx/euler_angles.inl b/3rdparty/glm/source/glm/gtx/euler_angles.inl deleted file mode 100644 index 3f13df6..0000000 --- a/3rdparty/glm/source/glm/gtx/euler_angles.inl +++ /dev/null @@ -1,899 +0,0 @@ -/// @ref gtx_euler_angles - -#include "compatibility.hpp" // glm::atan2 - -namespace glm -{ - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleX - ( - T const& angleX - ) - { - T cosX = glm::cos(angleX); - T sinX = glm::sin(angleX); - - return mat<4, 4, T, defaultp>( - T(1), T(0), T(0), T(0), - T(0), cosX, sinX, T(0), - T(0),-sinX, cosX, T(0), - T(0), T(0), T(0), T(1)); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleY - ( - T const& angleY - ) - { - T cosY = glm::cos(angleY); - T sinY = glm::sin(angleY); - - return mat<4, 4, T, defaultp>( - cosY, T(0), -sinY, T(0), - T(0), T(1), T(0), T(0), - sinY, T(0), cosY, T(0), - T(0), T(0), T(0), T(1)); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZ - ( - T const& angleZ - ) - { - T cosZ = glm::cos(angleZ); - T sinZ = glm::sin(angleZ); - - return mat<4, 4, T, defaultp>( - cosZ, sinZ, T(0), T(0), - -sinZ, cosZ, T(0), T(0), - T(0), T(0), T(1), T(0), - T(0), T(0), T(0), T(1)); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> derivedEulerAngleX - ( - T const & angleX, - T const & angularVelocityX - ) - { - T cosX = glm::cos(angleX) * angularVelocityX; - T sinX = glm::sin(angleX) * angularVelocityX; - - return mat<4, 4, T, defaultp>( - T(0), T(0), T(0), T(0), - T(0),-sinX, cosX, T(0), - T(0),-cosX,-sinX, T(0), - T(0), T(0), T(0), T(0)); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> derivedEulerAngleY - ( - T const & angleY, - T const & angularVelocityY - ) - { - T cosY = glm::cos(angleY) * angularVelocityY; - T sinY = glm::sin(angleY) * angularVelocityY; - - return mat<4, 4, T, defaultp>( - -sinY, T(0), -cosY, T(0), - T(0), T(0), T(0), T(0), - cosY, T(0), -sinY, T(0), - T(0), T(0), T(0), T(0)); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> derivedEulerAngleZ - ( - T const & angleZ, - T const & angularVelocityZ - ) - { - T cosZ = glm::cos(angleZ) * angularVelocityZ; - T sinZ = glm::sin(angleZ) * angularVelocityZ; - - return mat<4, 4, T, defaultp>( - -sinZ, cosZ, T(0), T(0), - -cosZ, -sinZ, T(0), T(0), - T(0), T(0), T(0), T(0), - T(0), T(0), T(0), T(0)); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleXY - ( - T const& angleX, - T const& angleY - ) - { - T cosX = glm::cos(angleX); - T sinX = glm::sin(angleX); - T cosY = glm::cos(angleY); - T sinY = glm::sin(angleY); - - return mat<4, 4, T, defaultp>( - cosY, -sinX * -sinY, cosX * -sinY, T(0), - T(0), cosX, sinX, T(0), - sinY, -sinX * cosY, cosX * cosY, T(0), - T(0), T(0), T(0), T(1)); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleYX - ( - T const& angleY, - T const& angleX - ) - { - T cosX = glm::cos(angleX); - T sinX = glm::sin(angleX); - T cosY = glm::cos(angleY); - T sinY = glm::sin(angleY); - - return mat<4, 4, T, defaultp>( - cosY, 0, -sinY, T(0), - sinY * sinX, cosX, cosY * sinX, T(0), - sinY * cosX, -sinX, cosY * cosX, T(0), - T(0), T(0), T(0), T(1)); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleXZ - ( - T const& angleX, - T const& angleZ - ) - { - return eulerAngleX(angleX) * eulerAngleZ(angleZ); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZX - ( - T const& angleZ, - T const& angleX - ) - { - return eulerAngleZ(angleZ) * eulerAngleX(angleX); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleYZ - ( - T const& angleY, - T const& angleZ - ) - { - return eulerAngleY(angleY) * eulerAngleZ(angleZ); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZY - ( - T const& angleZ, - T const& angleY - ) - { - return eulerAngleZ(angleZ) * eulerAngleY(angleY); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleXYZ - ( - T const& t1, - T const& t2, - T const& t3 - ) - { - T c1 = glm::cos(-t1); - T c2 = glm::cos(-t2); - T c3 = glm::cos(-t3); - T s1 = glm::sin(-t1); - T s2 = glm::sin(-t2); - T s3 = glm::sin(-t3); - - mat<4, 4, T, defaultp> Result; - Result[0][0] = c2 * c3; - Result[0][1] =-c1 * s3 + s1 * s2 * c3; - Result[0][2] = s1 * s3 + c1 * s2 * c3; - Result[0][3] = static_cast(0); - Result[1][0] = c2 * s3; - Result[1][1] = c1 * c3 + s1 * s2 * s3; - Result[1][2] =-s1 * c3 + c1 * s2 * s3; - Result[1][3] = static_cast(0); - Result[2][0] =-s2; - Result[2][1] = s1 * c2; - Result[2][2] = c1 * c2; - Result[2][3] = static_cast(0); - Result[3][0] = static_cast(0); - Result[3][1] = static_cast(0); - Result[3][2] = static_cast(0); - Result[3][3] = static_cast(1); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleYXZ - ( - T const& yaw, - T const& pitch, - T const& roll - ) - { - T tmp_ch = glm::cos(yaw); - T tmp_sh = glm::sin(yaw); - T tmp_cp = glm::cos(pitch); - T tmp_sp = glm::sin(pitch); - T tmp_cb = glm::cos(roll); - T tmp_sb = glm::sin(roll); - - mat<4, 4, T, defaultp> Result; - Result[0][0] = tmp_ch * tmp_cb + tmp_sh * tmp_sp * tmp_sb; - Result[0][1] = tmp_sb * tmp_cp; - Result[0][2] = -tmp_sh * tmp_cb + tmp_ch * tmp_sp * tmp_sb; - Result[0][3] = static_cast(0); - Result[1][0] = -tmp_ch * tmp_sb + tmp_sh * tmp_sp * tmp_cb; - Result[1][1] = tmp_cb * tmp_cp; - Result[1][2] = tmp_sb * tmp_sh + tmp_ch * tmp_sp * tmp_cb; - Result[1][3] = static_cast(0); - Result[2][0] = tmp_sh * tmp_cp; - Result[2][1] = -tmp_sp; - Result[2][2] = tmp_ch * tmp_cp; - Result[2][3] = static_cast(0); - Result[3][0] = static_cast(0); - Result[3][1] = static_cast(0); - Result[3][2] = static_cast(0); - Result[3][3] = static_cast(1); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleXZX - ( - T const & t1, - T const & t2, - T const & t3 - ) - { - T c1 = glm::cos(t1); - T s1 = glm::sin(t1); - T c2 = glm::cos(t2); - T s2 = glm::sin(t2); - T c3 = glm::cos(t3); - T s3 = glm::sin(t3); - - mat<4, 4, T, defaultp> Result; - Result[0][0] = c2; - Result[0][1] = c1 * s2; - Result[0][2] = s1 * s2; - Result[0][3] = static_cast(0); - Result[1][0] =-c3 * s2; - Result[1][1] = c1 * c2 * c3 - s1 * s3; - Result[1][2] = c1 * s3 + c2 * c3 * s1; - Result[1][3] = static_cast(0); - Result[2][0] = s2 * s3; - Result[2][1] =-c3 * s1 - c1 * c2 * s3; - Result[2][2] = c1 * c3 - c2 * s1 * s3; - Result[2][3] = static_cast(0); - Result[3][0] = static_cast(0); - Result[3][1] = static_cast(0); - Result[3][2] = static_cast(0); - Result[3][3] = static_cast(1); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleXYX - ( - T const & t1, - T const & t2, - T const & t3 - ) - { - T c1 = glm::cos(t1); - T s1 = glm::sin(t1); - T c2 = glm::cos(t2); - T s2 = glm::sin(t2); - T c3 = glm::cos(t3); - T s3 = glm::sin(t3); - - mat<4, 4, T, defaultp> Result; - Result[0][0] = c2; - Result[0][1] = s1 * s2; - Result[0][2] =-c1 * s2; - Result[0][3] = static_cast(0); - Result[1][0] = s2 * s3; - Result[1][1] = c1 * c3 - c2 * s1 * s3; - Result[1][2] = c3 * s1 + c1 * c2 * s3; - Result[1][3] = static_cast(0); - Result[2][0] = c3 * s2; - Result[2][1] =-c1 * s3 - c2 * c3 * s1; - Result[2][2] = c1 * c2 * c3 - s1 * s3; - Result[2][3] = static_cast(0); - Result[3][0] = static_cast(0); - Result[3][1] = static_cast(0); - Result[3][2] = static_cast(0); - Result[3][3] = static_cast(1); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleYXY - ( - T const & t1, - T const & t2, - T const & t3 - ) - { - T c1 = glm::cos(t1); - T s1 = glm::sin(t1); - T c2 = glm::cos(t2); - T s2 = glm::sin(t2); - T c3 = glm::cos(t3); - T s3 = glm::sin(t3); - - mat<4, 4, T, defaultp> Result; - Result[0][0] = c1 * c3 - c2 * s1 * s3; - Result[0][1] = s2* s3; - Result[0][2] =-c3 * s1 - c1 * c2 * s3; - Result[0][3] = static_cast(0); - Result[1][0] = s1 * s2; - Result[1][1] = c2; - Result[1][2] = c1 * s2; - Result[1][3] = static_cast(0); - Result[2][0] = c1 * s3 + c2 * c3 * s1; - Result[2][1] =-c3 * s2; - Result[2][2] = c1 * c2 * c3 - s1 * s3; - Result[2][3] = static_cast(0); - Result[3][0] = static_cast(0); - Result[3][1] = static_cast(0); - Result[3][2] = static_cast(0); - Result[3][3] = static_cast(1); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleYZY - ( - T const & t1, - T const & t2, - T const & t3 - ) - { - T c1 = glm::cos(t1); - T s1 = glm::sin(t1); - T c2 = glm::cos(t2); - T s2 = glm::sin(t2); - T c3 = glm::cos(t3); - T s3 = glm::sin(t3); - - mat<4, 4, T, defaultp> Result; - Result[0][0] = c1 * c2 * c3 - s1 * s3; - Result[0][1] = c3 * s2; - Result[0][2] =-c1 * s3 - c2 * c3 * s1; - Result[0][3] = static_cast(0); - Result[1][0] =-c1 * s2; - Result[1][1] = c2; - Result[1][2] = s1 * s2; - Result[1][3] = static_cast(0); - Result[2][0] = c3 * s1 + c1 * c2 * s3; - Result[2][1] = s2 * s3; - Result[2][2] = c1 * c3 - c2 * s1 * s3; - Result[2][3] = static_cast(0); - Result[3][0] = static_cast(0); - Result[3][1] = static_cast(0); - Result[3][2] = static_cast(0); - Result[3][3] = static_cast(1); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZYZ - ( - T const & t1, - T const & t2, - T const & t3 - ) - { - T c1 = glm::cos(t1); - T s1 = glm::sin(t1); - T c2 = glm::cos(t2); - T s2 = glm::sin(t2); - T c3 = glm::cos(t3); - T s3 = glm::sin(t3); - - mat<4, 4, T, defaultp> Result; - Result[0][0] = c1 * c2 * c3 - s1 * s3; - Result[0][1] = c1 * s3 + c2 * c3 * s1; - Result[0][2] =-c3 * s2; - Result[0][3] = static_cast(0); - Result[1][0] =-c3 * s1 - c1 * c2 * s3; - Result[1][1] = c1 * c3 - c2 * s1 * s3; - Result[1][2] = s2 * s3; - Result[1][3] = static_cast(0); - Result[2][0] = c1 * s2; - Result[2][1] = s1 * s2; - Result[2][2] = c2; - Result[2][3] = static_cast(0); - Result[3][0] = static_cast(0); - Result[3][1] = static_cast(0); - Result[3][2] = static_cast(0); - Result[3][3] = static_cast(1); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZXZ - ( - T const & t1, - T const & t2, - T const & t3 - ) - { - T c1 = glm::cos(t1); - T s1 = glm::sin(t1); - T c2 = glm::cos(t2); - T s2 = glm::sin(t2); - T c3 = glm::cos(t3); - T s3 = glm::sin(t3); - - mat<4, 4, T, defaultp> Result; - Result[0][0] = c1 * c3 - c2 * s1 * s3; - Result[0][1] = c3 * s1 + c1 * c2 * s3; - Result[0][2] = s2 *s3; - Result[0][3] = static_cast(0); - Result[1][0] =-c1 * s3 - c2 * c3 * s1; - Result[1][1] = c1 * c2 * c3 - s1 * s3; - Result[1][2] = c3 * s2; - Result[1][3] = static_cast(0); - Result[2][0] = s1 * s2; - Result[2][1] =-c1 * s2; - Result[2][2] = c2; - Result[2][3] = static_cast(0); - Result[3][0] = static_cast(0); - Result[3][1] = static_cast(0); - Result[3][2] = static_cast(0); - Result[3][3] = static_cast(1); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleXZY - ( - T const & t1, - T const & t2, - T const & t3 - ) - { - T c1 = glm::cos(t1); - T s1 = glm::sin(t1); - T c2 = glm::cos(t2); - T s2 = glm::sin(t2); - T c3 = glm::cos(t3); - T s3 = glm::sin(t3); - - mat<4, 4, T, defaultp> Result; - Result[0][0] = c2 * c3; - Result[0][1] = s1 * s3 + c1 * c3 * s2; - Result[0][2] = c3 * s1 * s2 - c1 * s3; - Result[0][3] = static_cast(0); - Result[1][0] =-s2; - Result[1][1] = c1 * c2; - Result[1][2] = c2 * s1; - Result[1][3] = static_cast(0); - Result[2][0] = c2 * s3; - Result[2][1] = c1 * s2 * s3 - c3 * s1; - Result[2][2] = c1 * c3 + s1 * s2 *s3; - Result[2][3] = static_cast(0); - Result[3][0] = static_cast(0); - Result[3][1] = static_cast(0); - Result[3][2] = static_cast(0); - Result[3][3] = static_cast(1); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleYZX - ( - T const & t1, - T const & t2, - T const & t3 - ) - { - T c1 = glm::cos(t1); - T s1 = glm::sin(t1); - T c2 = glm::cos(t2); - T s2 = glm::sin(t2); - T c3 = glm::cos(t3); - T s3 = glm::sin(t3); - - mat<4, 4, T, defaultp> Result; - Result[0][0] = c1 * c2; - Result[0][1] = s2; - Result[0][2] =-c2 * s1; - Result[0][3] = static_cast(0); - Result[1][0] = s1 * s3 - c1 * c3 * s2; - Result[1][1] = c2 * c3; - Result[1][2] = c1 * s3 + c3 * s1 * s2; - Result[1][3] = static_cast(0); - Result[2][0] = c3 * s1 + c1 * s2 * s3; - Result[2][1] =-c2 * s3; - Result[2][2] = c1 * c3 - s1 * s2 * s3; - Result[2][3] = static_cast(0); - Result[3][0] = static_cast(0); - Result[3][1] = static_cast(0); - Result[3][2] = static_cast(0); - Result[3][3] = static_cast(1); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZYX - ( - T const & t1, - T const & t2, - T const & t3 - ) - { - T c1 = glm::cos(t1); - T s1 = glm::sin(t1); - T c2 = glm::cos(t2); - T s2 = glm::sin(t2); - T c3 = glm::cos(t3); - T s3 = glm::sin(t3); - - mat<4, 4, T, defaultp> Result; - Result[0][0] = c1 * c2; - Result[0][1] = c2 * s1; - Result[0][2] =-s2; - Result[0][3] = static_cast(0); - Result[1][0] = c1 * s2 * s3 - c3 * s1; - Result[1][1] = c1 * c3 + s1 * s2 * s3; - Result[1][2] = c2 * s3; - Result[1][3] = static_cast(0); - Result[2][0] = s1 * s3 + c1 * c3 * s2; - Result[2][1] = c3 * s1 * s2 - c1 * s3; - Result[2][2] = c2 * c3; - Result[2][3] = static_cast(0); - Result[3][0] = static_cast(0); - Result[3][1] = static_cast(0); - Result[3][2] = static_cast(0); - Result[3][3] = static_cast(1); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> eulerAngleZXY - ( - T const & t1, - T const & t2, - T const & t3 - ) - { - T c1 = glm::cos(t1); - T s1 = glm::sin(t1); - T c2 = glm::cos(t2); - T s2 = glm::sin(t2); - T c3 = glm::cos(t3); - T s3 = glm::sin(t3); - - mat<4, 4, T, defaultp> Result; - Result[0][0] = c1 * c3 - s1 * s2 * s3; - Result[0][1] = c3 * s1 + c1 * s2 * s3; - Result[0][2] =-c2 * s3; - Result[0][3] = static_cast(0); - Result[1][0] =-c2 * s1; - Result[1][1] = c1 * c2; - Result[1][2] = s2; - Result[1][3] = static_cast(0); - Result[2][0] = c1 * s3 + c3 * s1 * s2; - Result[2][1] = s1 * s3 - c1 * c3 * s2; - Result[2][2] = c2 * c3; - Result[2][3] = static_cast(0); - Result[3][0] = static_cast(0); - Result[3][1] = static_cast(0); - Result[3][2] = static_cast(0); - Result[3][3] = static_cast(1); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> yawPitchRoll - ( - T const& yaw, - T const& pitch, - T const& roll - ) - { - T tmp_ch = glm::cos(yaw); - T tmp_sh = glm::sin(yaw); - T tmp_cp = glm::cos(pitch); - T tmp_sp = glm::sin(pitch); - T tmp_cb = glm::cos(roll); - T tmp_sb = glm::sin(roll); - - mat<4, 4, T, defaultp> Result; - Result[0][0] = tmp_ch * tmp_cb + tmp_sh * tmp_sp * tmp_sb; - Result[0][1] = tmp_sb * tmp_cp; - Result[0][2] = -tmp_sh * tmp_cb + tmp_ch * tmp_sp * tmp_sb; - Result[0][3] = static_cast(0); - Result[1][0] = -tmp_ch * tmp_sb + tmp_sh * tmp_sp * tmp_cb; - Result[1][1] = tmp_cb * tmp_cp; - Result[1][2] = tmp_sb * tmp_sh + tmp_ch * tmp_sp * tmp_cb; - Result[1][3] = static_cast(0); - Result[2][0] = tmp_sh * tmp_cp; - Result[2][1] = -tmp_sp; - Result[2][2] = tmp_ch * tmp_cp; - Result[2][3] = static_cast(0); - Result[3][0] = static_cast(0); - Result[3][1] = static_cast(0); - Result[3][2] = static_cast(0); - Result[3][3] = static_cast(1); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, defaultp> orientate2 - ( - T const& angle - ) - { - T c = glm::cos(angle); - T s = glm::sin(angle); - - mat<2, 2, T, defaultp> Result; - Result[0][0] = c; - Result[0][1] = s; - Result[1][0] = -s; - Result[1][1] = c; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, defaultp> orientate3 - ( - T const& angle - ) - { - T c = glm::cos(angle); - T s = glm::sin(angle); - - mat<3, 3, T, defaultp> Result; - Result[0][0] = c; - Result[0][1] = s; - Result[0][2] = T(0.0); - Result[1][0] = -s; - Result[1][1] = c; - Result[1][2] = T(0.0); - Result[2][0] = T(0.0); - Result[2][1] = T(0.0); - Result[2][2] = T(1.0); - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> orientate3 - ( - vec<3, T, Q> const& angles - ) - { - return mat<3, 3, T, Q>(yawPitchRoll(angles.z, angles.x, angles.y)); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> orientate4 - ( - vec<3, T, Q> const& angles - ) - { - return yawPitchRoll(angles.z, angles.x, angles.y); - } - - template - GLM_FUNC_DECL void extractEulerAngleXYZ(mat<4, 4, T, defaultp> const& M, - T & t1, - T & t2, - T & t3) - { - T T1 = glm::atan2(M[2][1], M[2][2]); - T C2 = glm::sqrt(M[0][0]*M[0][0] + M[1][0]*M[1][0]); - T T2 = glm::atan2(-M[2][0], C2); - T S1 = glm::sin(T1); - T C1 = glm::cos(T1); - T T3 = glm::atan2(S1*M[0][2] - C1*M[0][1], C1*M[1][1] - S1*M[1][2 ]); - t1 = -T1; - t2 = -T2; - t3 = -T3; - } - - template - GLM_FUNC_QUALIFIER void extractEulerAngleYXZ(mat<4, 4, T, defaultp> const & M, - T & t1, - T & t2, - T & t3) - { - T T1 = glm::atan2(M[2][0], M[2][2]); - T C2 = glm::sqrt(M[0][1]*M[0][1] + M[1][1]*M[1][1]); - T T2 = glm::atan2(-M[2][1], C2); - T S1 = glm::sin(T1); - T C1 = glm::cos(T1); - T T3 = glm::atan2(S1*M[1][2] - C1*M[1][0], C1*M[0][0] - S1*M[0][2]); - t1 = T1; - t2 = T2; - t3 = T3; - } - - template - GLM_FUNC_QUALIFIER void extractEulerAngleXZX(mat<4, 4, T, defaultp> const & M, - T & t1, - T & t2, - T & t3) - { - T T1 = glm::atan2(M[0][2], M[0][1]); - T S2 = glm::sqrt(M[1][0]*M[1][0] + M[2][0]*M[2][0]); - T T2 = glm::atan2(S2, M[0][0]); - T S1 = glm::sin(T1); - T C1 = glm::cos(T1); - T T3 = glm::atan2(C1*M[1][2] - S1*M[1][1], C1*M[2][2] - S1*M[2][1]); - t1 = T1; - t2 = T2; - t3 = T3; - } - - template - GLM_FUNC_QUALIFIER void extractEulerAngleXYX(mat<4, 4, T, defaultp> const & M, - T & t1, - T & t2, - T & t3) - { - T T1 = glm::atan2(M[0][1], -M[0][2]); - T S2 = glm::sqrt(M[1][0]*M[1][0] + M[2][0]*M[2][0]); - T T2 = glm::atan2(S2, M[0][0]); - T S1 = glm::sin(T1); - T C1 = glm::cos(T1); - T T3 = glm::atan2(-C1*M[2][1] - S1*M[2][2], C1*M[1][1] + S1*M[1][2]); - t1 = T1; - t2 = T2; - t3 = T3; - } - - template - GLM_FUNC_QUALIFIER void extractEulerAngleYXY(mat<4, 4, T, defaultp> const & M, - T & t1, - T & t2, - T & t3) - { - T T1 = glm::atan2(M[1][0], M[1][2]); - T S2 = glm::sqrt(M[0][1]*M[0][1] + M[2][1]*M[2][1]); - T T2 = glm::atan2(S2, M[1][1]); - T S1 = glm::sin(T1); - T C1 = glm::cos(T1); - T T3 = glm::atan2(C1*M[2][0] - S1*M[2][2], C1*M[0][0] - S1*M[0][2]); - t1 = T1; - t2 = T2; - t3 = T3; - } - - template - GLM_FUNC_QUALIFIER void extractEulerAngleYZY(mat<4, 4, T, defaultp> const & M, - T & t1, - T & t2, - T & t3) - { - T T1 = glm::atan2(M[1][2], -M[1][0]); - T S2 = glm::sqrt(M[0][1]*M[0][1] + M[2][1]*M[2][1]); - T T2 = glm::atan2(S2, M[1][1]); - T S1 = glm::sin(T1); - T C1 = glm::cos(T1); - T T3 = glm::atan2(-S1*M[0][0] - C1*M[0][2], S1*M[2][0] + C1*M[2][2]); - t1 = T1; - t2 = T2; - t3 = T3; - } - - template - GLM_FUNC_QUALIFIER void extractEulerAngleZYZ(mat<4, 4, T, defaultp> const & M, - T & t1, - T & t2, - T & t3) - { - T T1 = glm::atan2(M[2][1], M[2][0]); - T S2 = glm::sqrt(M[0][2]*M[0][2] + M[1][2]*M[1][2]); - T T2 = glm::atan2(S2, M[2][2]); - T S1 = glm::sin(T1); - T C1 = glm::cos(T1); - T T3 = glm::atan2(C1*M[0][1] - S1*M[0][0], C1*M[1][1] - S1*M[1][0]); - t1 = T1; - t2 = T2; - t3 = T3; - } - - template - GLM_FUNC_QUALIFIER void extractEulerAngleZXZ(mat<4, 4, T, defaultp> const & M, - T & t1, - T & t2, - T & t3) - { - T T1 = glm::atan2(M[2][0], -M[2][1]); - T S2 = glm::sqrt(M[0][2]*M[0][2] + M[1][2]*M[1][2]); - T T2 = glm::atan2(S2, M[2][2]); - T S1 = glm::sin(T1); - T C1 = glm::cos(T1); - T T3 = glm::atan2(-C1*M[1][0] - S1*M[1][1], C1*M[0][0] + S1*M[0][1]); - t1 = T1; - t2 = T2; - t3 = T3; - } - - template - GLM_FUNC_QUALIFIER void extractEulerAngleXZY(mat<4, 4, T, defaultp> const & M, - T & t1, - T & t2, - T & t3) - { - T T1 = glm::atan2(M[1][2], M[1][1]); - T C2 = glm::sqrt(M[0][0]*M[0][0] + M[2][0]*M[2][0]); - T T2 = glm::atan2(-M[1][0], C2); - T S1 = glm::sin(T1); - T C1 = glm::cos(T1); - T T3 = glm::atan2(S1*M[0][1] - C1*M[0][2], C1*M[2][2] - S1*M[2][1]); - t1 = T1; - t2 = T2; - t3 = T3; - } - - template - GLM_FUNC_QUALIFIER void extractEulerAngleYZX(mat<4, 4, T, defaultp> const & M, - T & t1, - T & t2, - T & t3) - { - T T1 = glm::atan2(-M[0][2], M[0][0]); - T C2 = glm::sqrt(M[1][1]*M[1][1] + M[2][1]*M[2][1]); - T T2 = glm::atan2(M[0][1], C2); - T S1 = glm::sin(T1); - T C1 = glm::cos(T1); - T T3 = glm::atan2(S1*M[1][0] + C1*M[1][2], S1*M[2][0] + C1*M[2][2]); - t1 = T1; - t2 = T2; - t3 = T3; - } - - template - GLM_FUNC_QUALIFIER void extractEulerAngleZYX(mat<4, 4, T, defaultp> const & M, - T & t1, - T & t2, - T & t3) - { - T T1 = glm::atan2(M[0][1], M[0][0]); - T C2 = glm::sqrt(M[1][2]*M[1][2] + M[2][2]*M[2][2]); - T T2 = glm::atan2(-M[0][2], C2); - T S1 = glm::sin(T1); - T C1 = glm::cos(T1); - T T3 = glm::atan2(S1*M[2][0] - C1*M[2][1], C1*M[1][1] - S1*M[1][0]); - t1 = T1; - t2 = T2; - t3 = T3; - } - - template - GLM_FUNC_QUALIFIER void extractEulerAngleZXY(mat<4, 4, T, defaultp> const & M, - T & t1, - T & t2, - T & t3) - { - T T1 = glm::atan2(-M[1][0], M[1][1]); - T C2 = glm::sqrt(M[0][2]*M[0][2] + M[2][2]*M[2][2]); - T T2 = glm::atan2(M[1][2], C2); - T S1 = glm::sin(T1); - T C1 = glm::cos(T1); - T T3 = glm::atan2(C1*M[2][0] + S1*M[2][1], C1*M[0][0] + S1*M[0][1]); - t1 = T1; - t2 = T2; - t3 = T3; - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/extend.hpp b/3rdparty/glm/source/glm/gtx/extend.hpp deleted file mode 100644 index 28b7c5c..0000000 --- a/3rdparty/glm/source/glm/gtx/extend.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/// @ref gtx_extend -/// @file glm/gtx/extend.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_extend GLM_GTX_extend -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Extend a position from a source to a position at a defined length. - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_extend is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_extend extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_extend - /// @{ - - /// Extends of Length the Origin position using the (Source - Origin) direction. - /// @see gtx_extend - template - GLM_FUNC_DECL genType extend( - genType const& Origin, - genType const& Source, - typename genType::value_type const Length); - - /// @} -}//namespace glm - -#include "extend.inl" diff --git a/3rdparty/glm/source/glm/gtx/extend.inl b/3rdparty/glm/source/glm/gtx/extend.inl deleted file mode 100644 index 32128eb..0000000 --- a/3rdparty/glm/source/glm/gtx/extend.inl +++ /dev/null @@ -1,48 +0,0 @@ -/// @ref gtx_extend - -namespace glm -{ - template - GLM_FUNC_QUALIFIER genType extend - ( - genType const& Origin, - genType const& Source, - genType const& Distance - ) - { - return Origin + (Source - Origin) * Distance; - } - - template - GLM_FUNC_QUALIFIER vec<2, T, Q> extend - ( - vec<2, T, Q> const& Origin, - vec<2, T, Q> const& Source, - T const& Distance - ) - { - return Origin + (Source - Origin) * Distance; - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> extend - ( - vec<3, T, Q> const& Origin, - vec<3, T, Q> const& Source, - T const& Distance - ) - { - return Origin + (Source - Origin) * Distance; - } - - template - GLM_FUNC_QUALIFIER vec<4, T, Q> extend - ( - vec<4, T, Q> const& Origin, - vec<4, T, Q> const& Source, - T const& Distance - ) - { - return Origin + (Source - Origin) * Distance; - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/extended_min_max.hpp b/3rdparty/glm/source/glm/gtx/extended_min_max.hpp deleted file mode 100644 index 025eda2..0000000 --- a/3rdparty/glm/source/glm/gtx/extended_min_max.hpp +++ /dev/null @@ -1,137 +0,0 @@ -/// @ref gtx_extended_min_max -/// @file glm/gtx/extended_min_max.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_extended_min_max GLM_GTX_extented_min_max -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Min and max functions for 3 to 4 parameters. - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../ext/vector_common.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_extented_min_max is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_extented_min_max extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_extended_min_max - /// @{ - - /// Return the minimum component-wise values of 3 inputs - /// @see gtx_extented_min_max - template - GLM_FUNC_DECL T min( - T const& x, - T const& y, - T const& z); - - /// Return the minimum component-wise values of 3 inputs - /// @see gtx_extented_min_max - template class C> - GLM_FUNC_DECL C min( - C const& x, - typename C::T const& y, - typename C::T const& z); - - /// Return the minimum component-wise values of 3 inputs - /// @see gtx_extented_min_max - template class C> - GLM_FUNC_DECL C min( - C const& x, - C const& y, - C const& z); - - /// Return the minimum component-wise values of 4 inputs - /// @see gtx_extented_min_max - template - GLM_FUNC_DECL T min( - T const& x, - T const& y, - T const& z, - T const& w); - - /// Return the minimum component-wise values of 4 inputs - /// @see gtx_extented_min_max - template class C> - GLM_FUNC_DECL C min( - C const& x, - typename C::T const& y, - typename C::T const& z, - typename C::T const& w); - - /// Return the minimum component-wise values of 4 inputs - /// @see gtx_extented_min_max - template class C> - GLM_FUNC_DECL C min( - C const& x, - C const& y, - C const& z, - C const& w); - - /// Return the maximum component-wise values of 3 inputs - /// @see gtx_extented_min_max - template - GLM_FUNC_DECL T max( - T const& x, - T const& y, - T const& z); - - /// Return the maximum component-wise values of 3 inputs - /// @see gtx_extented_min_max - template class C> - GLM_FUNC_DECL C max( - C const& x, - typename C::T const& y, - typename C::T const& z); - - /// Return the maximum component-wise values of 3 inputs - /// @see gtx_extented_min_max - template class C> - GLM_FUNC_DECL C max( - C const& x, - C const& y, - C const& z); - - /// Return the maximum component-wise values of 4 inputs - /// @see gtx_extented_min_max - template - GLM_FUNC_DECL T max( - T const& x, - T const& y, - T const& z, - T const& w); - - /// Return the maximum component-wise values of 4 inputs - /// @see gtx_extented_min_max - template class C> - GLM_FUNC_DECL C max( - C const& x, - typename C::T const& y, - typename C::T const& z, - typename C::T const& w); - - /// Return the maximum component-wise values of 4 inputs - /// @see gtx_extented_min_max - template class C> - GLM_FUNC_DECL C max( - C const& x, - C const& y, - C const& z, - C const& w); - - /// @} -}//namespace glm - -#include "extended_min_max.inl" diff --git a/3rdparty/glm/source/glm/gtx/extended_min_max.inl b/3rdparty/glm/source/glm/gtx/extended_min_max.inl deleted file mode 100644 index de5998f..0000000 --- a/3rdparty/glm/source/glm/gtx/extended_min_max.inl +++ /dev/null @@ -1,138 +0,0 @@ -/// @ref gtx_extended_min_max - -namespace glm -{ - template - GLM_FUNC_QUALIFIER T min( - T const& x, - T const& y, - T const& z) - { - return glm::min(glm::min(x, y), z); - } - - template class C> - GLM_FUNC_QUALIFIER C min - ( - C const& x, - typename C::T const& y, - typename C::T const& z - ) - { - return glm::min(glm::min(x, y), z); - } - - template class C> - GLM_FUNC_QUALIFIER C min - ( - C const& x, - C const& y, - C const& z - ) - { - return glm::min(glm::min(x, y), z); - } - - template - GLM_FUNC_QUALIFIER T min - ( - T const& x, - T const& y, - T const& z, - T const& w - ) - { - return glm::min(glm::min(x, y), glm::min(z, w)); - } - - template class C> - GLM_FUNC_QUALIFIER C min - ( - C const& x, - typename C::T const& y, - typename C::T const& z, - typename C::T const& w - ) - { - return glm::min(glm::min(x, y), glm::min(z, w)); - } - - template class C> - GLM_FUNC_QUALIFIER C min - ( - C const& x, - C const& y, - C const& z, - C const& w - ) - { - return glm::min(glm::min(x, y), glm::min(z, w)); - } - - template - GLM_FUNC_QUALIFIER T max( - T const& x, - T const& y, - T const& z) - { - return glm::max(glm::max(x, y), z); - } - - template class C> - GLM_FUNC_QUALIFIER C max - ( - C const& x, - typename C::T const& y, - typename C::T const& z - ) - { - return glm::max(glm::max(x, y), z); - } - - template class C> - GLM_FUNC_QUALIFIER C max - ( - C const& x, - C const& y, - C const& z - ) - { - return glm::max(glm::max(x, y), z); - } - - template - GLM_FUNC_QUALIFIER T max - ( - T const& x, - T const& y, - T const& z, - T const& w - ) - { - return glm::max(glm::max(x, y), glm::max(z, w)); - } - - template class C> - GLM_FUNC_QUALIFIER C max - ( - C const& x, - typename C::T const& y, - typename C::T const& z, - typename C::T const& w - ) - { - return glm::max(glm::max(x, y), glm::max(z, w)); - } - - template class C> - GLM_FUNC_QUALIFIER C max - ( - C const& x, - C const& y, - C const& z, - C const& w - ) - { - return glm::max(glm::max(x, y), glm::max(z, w)); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/exterior_product.hpp b/3rdparty/glm/source/glm/gtx/exterior_product.hpp deleted file mode 100644 index 5522df7..0000000 --- a/3rdparty/glm/source/glm/gtx/exterior_product.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/// @ref gtx_exterior_product -/// @file glm/gtx/exterior_product.hpp -/// -/// @see core (dependence) -/// @see gtx_exterior_product (dependence) -/// -/// @defgroup gtx_exterior_product GLM_GTX_exterior_product -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// @brief Allow to perform bit operations on integer values - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" -#include "../detail/qualifier.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_exterior_product is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_exterior_product extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_exterior_product - /// @{ - - /// Returns the cross product of x and y. - /// - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see Exterior product - template - GLM_FUNC_DECL T cross(vec<2, T, Q> const& v, vec<2, T, Q> const& u); - - /// @} -} //namespace glm - -#include "exterior_product.inl" diff --git a/3rdparty/glm/source/glm/gtx/exterior_product.inl b/3rdparty/glm/source/glm/gtx/exterior_product.inl deleted file mode 100644 index 93661fd..0000000 --- a/3rdparty/glm/source/glm/gtx/exterior_product.inl +++ /dev/null @@ -1,26 +0,0 @@ -/// @ref gtx_exterior_product - -#include - -namespace glm { -namespace detail -{ - template - struct compute_cross_vec2 - { - GLM_FUNC_QUALIFIER static T call(vec<2, T, Q> const& v, vec<2, T, Q> const& u) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'cross' accepts only floating-point inputs"); - - return v.x * u.y - u.x * v.y; - } - }; -}//namespace detail - - template - GLM_FUNC_QUALIFIER T cross(vec<2, T, Q> const& x, vec<2, T, Q> const& y) - { - return detail::compute_cross_vec2::value>::call(x, y); - } -}//namespace glm - diff --git a/3rdparty/glm/source/glm/gtx/fast_exponential.hpp b/3rdparty/glm/source/glm/gtx/fast_exponential.hpp deleted file mode 100644 index 6fb7286..0000000 --- a/3rdparty/glm/source/glm/gtx/fast_exponential.hpp +++ /dev/null @@ -1,95 +0,0 @@ -/// @ref gtx_fast_exponential -/// @file glm/gtx/fast_exponential.hpp -/// -/// @see core (dependence) -/// @see gtx_half_float (dependence) -/// -/// @defgroup gtx_fast_exponential GLM_GTX_fast_exponential -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Fast but less accurate implementations of exponential based functions. - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_fast_exponential is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_fast_exponential extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_fast_exponential - /// @{ - - /// Faster than the common pow function but less accurate. - /// @see gtx_fast_exponential - template - GLM_FUNC_DECL genType fastPow(genType x, genType y); - - /// Faster than the common pow function but less accurate. - /// @see gtx_fast_exponential - template - GLM_FUNC_DECL vec fastPow(vec const& x, vec const& y); - - /// Faster than the common pow function but less accurate. - /// @see gtx_fast_exponential - template - GLM_FUNC_DECL genTypeT fastPow(genTypeT x, genTypeU y); - - /// Faster than the common pow function but less accurate. - /// @see gtx_fast_exponential - template - GLM_FUNC_DECL vec fastPow(vec const& x); - - /// Faster than the common exp function but less accurate. - /// @see gtx_fast_exponential - template - GLM_FUNC_DECL T fastExp(T x); - - /// Faster than the common exp function but less accurate. - /// @see gtx_fast_exponential - template - GLM_FUNC_DECL vec fastExp(vec const& x); - - /// Faster than the common log function but less accurate. - /// @see gtx_fast_exponential - template - GLM_FUNC_DECL T fastLog(T x); - - /// Faster than the common exp2 function but less accurate. - /// @see gtx_fast_exponential - template - GLM_FUNC_DECL vec fastLog(vec const& x); - - /// Faster than the common exp2 function but less accurate. - /// @see gtx_fast_exponential - template - GLM_FUNC_DECL T fastExp2(T x); - - /// Faster than the common exp2 function but less accurate. - /// @see gtx_fast_exponential - template - GLM_FUNC_DECL vec fastExp2(vec const& x); - - /// Faster than the common log2 function but less accurate. - /// @see gtx_fast_exponential - template - GLM_FUNC_DECL T fastLog2(T x); - - /// Faster than the common log2 function but less accurate. - /// @see gtx_fast_exponential - template - GLM_FUNC_DECL vec fastLog2(vec const& x); - - /// @} -}//namespace glm - -#include "fast_exponential.inl" diff --git a/3rdparty/glm/source/glm/gtx/fast_exponential.inl b/3rdparty/glm/source/glm/gtx/fast_exponential.inl deleted file mode 100644 index 5b11742..0000000 --- a/3rdparty/glm/source/glm/gtx/fast_exponential.inl +++ /dev/null @@ -1,136 +0,0 @@ -/// @ref gtx_fast_exponential - -namespace glm -{ - // fastPow: - template - GLM_FUNC_QUALIFIER genType fastPow(genType x, genType y) - { - return exp(y * log(x)); - } - - template - GLM_FUNC_QUALIFIER vec fastPow(vec const& x, vec const& y) - { - return exp(y * log(x)); - } - - template - GLM_FUNC_QUALIFIER T fastPow(T x, int y) - { - T f = static_cast(1); - for(int i = 0; i < y; ++i) - f *= x; - return f; - } - - template - GLM_FUNC_QUALIFIER vec fastPow(vec const& x, vec const& y) - { - vec Result; - for(length_t i = 0, n = x.length(); i < n; ++i) - Result[i] = fastPow(x[i], y[i]); - return Result; - } - - // fastExp - // Note: This function provides accurate results only for value between -1 and 1, else avoid it. - template - GLM_FUNC_QUALIFIER T fastExp(T x) - { - // This has a better looking and same performance in release mode than the following code. However, in debug mode it's slower. - // return 1.0f + x * (1.0f + x * 0.5f * (1.0f + x * 0.3333333333f * (1.0f + x * 0.25 * (1.0f + x * 0.2f)))); - T x2 = x * x; - T x3 = x2 * x; - T x4 = x3 * x; - T x5 = x4 * x; - return T(1) + x + (x2 * T(0.5)) + (x3 * T(0.1666666667)) + (x4 * T(0.041666667)) + (x5 * T(0.008333333333)); - } - /* // Try to handle all values of float... but often shower than std::exp, glm::floor and the loop kill the performance - GLM_FUNC_QUALIFIER float fastExp(float x) - { - const float e = 2.718281828f; - const float IntegerPart = floor(x); - const float FloatPart = x - IntegerPart; - float z = 1.f; - - for(int i = 0; i < int(IntegerPart); ++i) - z *= e; - - const float x2 = FloatPart * FloatPart; - const float x3 = x2 * FloatPart; - const float x4 = x3 * FloatPart; - const float x5 = x4 * FloatPart; - return z * (1.0f + FloatPart + (x2 * 0.5f) + (x3 * 0.1666666667f) + (x4 * 0.041666667f) + (x5 * 0.008333333333f)); - } - - // Increase accuracy on number bigger that 1 and smaller than -1 but it's not enough for high and negative numbers - GLM_FUNC_QUALIFIER float fastExp(float x) - { - // This has a better looking and same performance in release mode than the following code. However, in debug mode it's slower. - // return 1.0f + x * (1.0f + x * 0.5f * (1.0f + x * 0.3333333333f * (1.0f + x * 0.25 * (1.0f + x * 0.2f)))); - float x2 = x * x; - float x3 = x2 * x; - float x4 = x3 * x; - float x5 = x4 * x; - float x6 = x5 * x; - float x7 = x6 * x; - float x8 = x7 * x; - return 1.0f + x + (x2 * 0.5f) + (x3 * 0.1666666667f) + (x4 * 0.041666667f) + (x5 * 0.008333333333f)+ (x6 * 0.00138888888888f) + (x7 * 0.000198412698f) + (x8 * 0.0000248015873f);; - } - */ - - template - GLM_FUNC_QUALIFIER vec fastExp(vec const& x) - { - return detail::functor1::call(fastExp, x); - } - - // fastLog - template - GLM_FUNC_QUALIFIER genType fastLog(genType x) - { - return std::log(x); - } - - /* Slower than the VC7.1 function... - GLM_FUNC_QUALIFIER float fastLog(float x) - { - float y1 = (x - 1.0f) / (x + 1.0f); - float y2 = y1 * y1; - return 2.0f * y1 * (1.0f + y2 * (0.3333333333f + y2 * (0.2f + y2 * 0.1428571429f))); - } - */ - - template - GLM_FUNC_QUALIFIER vec fastLog(vec const& x) - { - return detail::functor1::call(fastLog, x); - } - - //fastExp2, ln2 = 0.69314718055994530941723212145818f - template - GLM_FUNC_QUALIFIER genType fastExp2(genType x) - { - return fastExp(static_cast(0.69314718055994530941723212145818) * x); - } - - template - GLM_FUNC_QUALIFIER vec fastExp2(vec const& x) - { - return detail::functor1::call(fastExp2, x); - } - - // fastLog2, ln2 = 0.69314718055994530941723212145818f - template - GLM_FUNC_QUALIFIER genType fastLog2(genType x) - { - return fastLog(x) / static_cast(0.69314718055994530941723212145818); - } - - template - GLM_FUNC_QUALIFIER vec fastLog2(vec const& x) - { - return detail::functor1::call(fastLog2, x); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/fast_square_root.hpp b/3rdparty/glm/source/glm/gtx/fast_square_root.hpp deleted file mode 100644 index ac42a9c..0000000 --- a/3rdparty/glm/source/glm/gtx/fast_square_root.hpp +++ /dev/null @@ -1,98 +0,0 @@ -/// @ref gtx_fast_square_root -/// @file glm/gtx/fast_square_root.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_fast_square_root GLM_GTX_fast_square_root -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Fast but less accurate implementations of square root based functions. -/// - Sqrt optimisation based on Newton's method, -/// www.gamedev.net/community/forums/topic.asp?topic id=139956 - -#pragma once - -// Dependency: -#include "../common.hpp" -#include "../exponential.hpp" -#include "../geometric.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_fast_square_root is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_fast_square_root extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_fast_square_root - /// @{ - - /// Faster than the common sqrt function but less accurate. - /// - /// @see gtx_fast_square_root extension. - template - GLM_FUNC_DECL genType fastSqrt(genType x); - - /// Faster than the common sqrt function but less accurate. - /// - /// @see gtx_fast_square_root extension. - template - GLM_FUNC_DECL vec fastSqrt(vec const& x); - - /// Faster than the common inversesqrt function but less accurate. - /// - /// @see gtx_fast_square_root extension. - template - GLM_FUNC_DECL genType fastInverseSqrt(genType x); - - /// Faster than the common inversesqrt function but less accurate. - /// - /// @see gtx_fast_square_root extension. - template - GLM_FUNC_DECL vec fastInverseSqrt(vec const& x); - - /// Faster than the common length function but less accurate. - /// - /// @see gtx_fast_square_root extension. - template - GLM_FUNC_DECL genType fastLength(genType x); - - /// Faster than the common length function but less accurate. - /// - /// @see gtx_fast_square_root extension. - template - GLM_FUNC_DECL T fastLength(vec const& x); - - /// Faster than the common distance function but less accurate. - /// - /// @see gtx_fast_square_root extension. - template - GLM_FUNC_DECL genType fastDistance(genType x, genType y); - - /// Faster than the common distance function but less accurate. - /// - /// @see gtx_fast_square_root extension. - template - GLM_FUNC_DECL T fastDistance(vec const& x, vec const& y); - - /// Faster than the common normalize function but less accurate. - /// - /// @see gtx_fast_square_root extension. - template - GLM_FUNC_DECL genType fastNormalize(genType x); - - /// Faster than the common normalize function but less accurate. - /// - /// @see gtx_fast_square_root extension. - template - GLM_FUNC_DECL vec fastNormalize(vec const& x); - - /// @} -}// namespace glm - -#include "fast_square_root.inl" diff --git a/3rdparty/glm/source/glm/gtx/fast_square_root.inl b/3rdparty/glm/source/glm/gtx/fast_square_root.inl deleted file mode 100644 index 4e6c6de..0000000 --- a/3rdparty/glm/source/glm/gtx/fast_square_root.inl +++ /dev/null @@ -1,75 +0,0 @@ -/// @ref gtx_fast_square_root - -namespace glm -{ - // fastSqrt - template - GLM_FUNC_QUALIFIER genType fastSqrt(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fastSqrt' only accept floating-point input"); - - return genType(1) / fastInverseSqrt(x); - } - - template - GLM_FUNC_QUALIFIER vec fastSqrt(vec const& x) - { - return detail::functor1::call(fastSqrt, x); - } - - // fastInversesqrt - template - GLM_FUNC_QUALIFIER genType fastInverseSqrt(genType x) - { - return detail::compute_inversesqrt<1, genType, lowp, detail::is_aligned::value>::call(vec<1, genType, lowp>(x)).x; - } - - template - GLM_FUNC_QUALIFIER vec fastInverseSqrt(vec const& x) - { - return detail::compute_inversesqrt::value>::call(x); - } - - // fastLength - template - GLM_FUNC_QUALIFIER genType fastLength(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fastLength' only accept floating-point inputs"); - - return abs(x); - } - - template - GLM_FUNC_QUALIFIER T fastLength(vec const& x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'fastLength' only accept floating-point inputs"); - - return fastSqrt(dot(x, x)); - } - - // fastDistance - template - GLM_FUNC_QUALIFIER genType fastDistance(genType x, genType y) - { - return fastLength(y - x); - } - - template - GLM_FUNC_QUALIFIER T fastDistance(vec const& x, vec const& y) - { - return fastLength(y - x); - } - - // fastNormalize - template - GLM_FUNC_QUALIFIER genType fastNormalize(genType x) - { - return x > genType(0) ? genType(1) : -genType(1); - } - - template - GLM_FUNC_QUALIFIER vec fastNormalize(vec const& x) - { - return x * fastInverseSqrt(dot(x, x)); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/fast_trigonometry.hpp b/3rdparty/glm/source/glm/gtx/fast_trigonometry.hpp deleted file mode 100644 index 2650d6e..0000000 --- a/3rdparty/glm/source/glm/gtx/fast_trigonometry.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/// @ref gtx_fast_trigonometry -/// @file glm/gtx/fast_trigonometry.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_fast_trigonometry GLM_GTX_fast_trigonometry -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Fast but less accurate implementations of trigonometric functions. - -#pragma once - -// Dependency: -#include "../gtc/constants.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_fast_trigonometry is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_fast_trigonometry extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_fast_trigonometry - /// @{ - - /// Wrap an angle to [0 2pi[ - /// From GLM_GTX_fast_trigonometry extension. - template - GLM_FUNC_DECL T wrapAngle(T angle); - - /// Faster than the common sin function but less accurate. - /// From GLM_GTX_fast_trigonometry extension. - template - GLM_FUNC_DECL T fastSin(T angle); - - /// Faster than the common cos function but less accurate. - /// From GLM_GTX_fast_trigonometry extension. - template - GLM_FUNC_DECL T fastCos(T angle); - - /// Faster than the common tan function but less accurate. - /// Defined between -2pi and 2pi. - /// From GLM_GTX_fast_trigonometry extension. - template - GLM_FUNC_DECL T fastTan(T angle); - - /// Faster than the common asin function but less accurate. - /// Defined between -2pi and 2pi. - /// From GLM_GTX_fast_trigonometry extension. - template - GLM_FUNC_DECL T fastAsin(T angle); - - /// Faster than the common acos function but less accurate. - /// Defined between -2pi and 2pi. - /// From GLM_GTX_fast_trigonometry extension. - template - GLM_FUNC_DECL T fastAcos(T angle); - - /// Faster than the common atan function but less accurate. - /// Defined between -2pi and 2pi. - /// From GLM_GTX_fast_trigonometry extension. - template - GLM_FUNC_DECL T fastAtan(T y, T x); - - /// Faster than the common atan function but less accurate. - /// Defined between -2pi and 2pi. - /// From GLM_GTX_fast_trigonometry extension. - template - GLM_FUNC_DECL T fastAtan(T angle); - - /// @} -}//namespace glm - -#include "fast_trigonometry.inl" diff --git a/3rdparty/glm/source/glm/gtx/fast_trigonometry.inl b/3rdparty/glm/source/glm/gtx/fast_trigonometry.inl deleted file mode 100644 index 1a710cb..0000000 --- a/3rdparty/glm/source/glm/gtx/fast_trigonometry.inl +++ /dev/null @@ -1,142 +0,0 @@ -/// @ref gtx_fast_trigonometry - -namespace glm{ -namespace detail -{ - template - GLM_FUNC_QUALIFIER vec taylorCos(vec const& x) - { - return static_cast(1) - - (x * x) * (1.f / 2.f) - + ((x * x) * (x * x)) * (1.f / 24.f) - - (((x * x) * (x * x)) * (x * x)) * (1.f / 720.f) - + (((x * x) * (x * x)) * ((x * x) * (x * x))) * (1.f / 40320.f); - } - - template - GLM_FUNC_QUALIFIER T cos_52s(T x) - { - T const xx(x * x); - return (T(0.9999932946) + xx * (T(-0.4999124376) + xx * (T(0.0414877472) + xx * T(-0.0012712095)))); - } - - template - GLM_FUNC_QUALIFIER vec cos_52s(vec const& x) - { - return detail::functor1::call(cos_52s, x); - } -}//namespace detail - - // wrapAngle - template - GLM_FUNC_QUALIFIER T wrapAngle(T angle) - { - return abs(mod(angle, two_pi())); - } - - template - GLM_FUNC_QUALIFIER vec wrapAngle(vec const& x) - { - return detail::functor1::call(wrapAngle, x); - } - - // cos - template - GLM_FUNC_QUALIFIER T fastCos(T x) - { - T const angle(wrapAngle(x)); - - if(angle < half_pi()) - return detail::cos_52s(angle); - if(angle < pi()) - return -detail::cos_52s(pi() - angle); - if(angle < (T(3) * half_pi())) - return -detail::cos_52s(angle - pi()); - - return detail::cos_52s(two_pi() - angle); - } - - template - GLM_FUNC_QUALIFIER vec fastCos(vec const& x) - { - return detail::functor1::call(fastCos, x); - } - - // sin - template - GLM_FUNC_QUALIFIER T fastSin(T x) - { - return fastCos(half_pi() - x); - } - - template - GLM_FUNC_QUALIFIER vec fastSin(vec const& x) - { - return detail::functor1::call(fastSin, x); - } - - // tan - template - GLM_FUNC_QUALIFIER T fastTan(T x) - { - return x + (x * x * x * T(0.3333333333)) + (x * x * x * x * x * T(0.1333333333333)) + (x * x * x * x * x * x * x * T(0.0539682539)); - } - - template - GLM_FUNC_QUALIFIER vec fastTan(vec const& x) - { - return detail::functor1::call(fastTan, x); - } - - // asin - template - GLM_FUNC_QUALIFIER T fastAsin(T x) - { - return x + (x * x * x * T(0.166666667)) + (x * x * x * x * x * T(0.075)) + (x * x * x * x * x * x * x * T(0.0446428571)) + (x * x * x * x * x * x * x * x * x * T(0.0303819444));// + (x * x * x * x * x * x * x * x * x * x * x * T(0.022372159)); - } - - template - GLM_FUNC_QUALIFIER vec fastAsin(vec const& x) - { - return detail::functor1::call(fastAsin, x); - } - - // acos - template - GLM_FUNC_QUALIFIER T fastAcos(T x) - { - return T(1.5707963267948966192313216916398) - fastAsin(x); //(PI / 2) - } - - template - GLM_FUNC_QUALIFIER vec fastAcos(vec const& x) - { - return detail::functor1::call(fastAcos, x); - } - - // atan - template - GLM_FUNC_QUALIFIER T fastAtan(T y, T x) - { - T sgn = sign(y) * sign(x); - return abs(fastAtan(y / x)) * sgn; - } - - template - GLM_FUNC_QUALIFIER vec fastAtan(vec const& y, vec const& x) - { - return detail::functor2::call(fastAtan, y, x); - } - - template - GLM_FUNC_QUALIFIER T fastAtan(T x) - { - return x - (x * x * x * T(0.333333333333)) + (x * x * x * x * x * T(0.2)) - (x * x * x * x * x * x * x * T(0.1428571429)) + (x * x * x * x * x * x * x * x * x * T(0.111111111111)) - (x * x * x * x * x * x * x * x * x * x * x * T(0.0909090909)); - } - - template - GLM_FUNC_QUALIFIER vec fastAtan(vec const& x) - { - return detail::functor1::call(fastAtan, x); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/float_notmalize.inl b/3rdparty/glm/source/glm/gtx/float_notmalize.inl deleted file mode 100644 index 8cdbc5a..0000000 --- a/3rdparty/glm/source/glm/gtx/float_notmalize.inl +++ /dev/null @@ -1,13 +0,0 @@ -/// @ref gtx_float_normalize - -#include - -namespace glm -{ - template - GLM_FUNC_QUALIFIER vec floatNormalize(vec const& v) - { - return vec(v) / static_cast(std::numeric_limits::max()); - } - -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/functions.hpp b/3rdparty/glm/source/glm/gtx/functions.hpp deleted file mode 100644 index 9f4166c..0000000 --- a/3rdparty/glm/source/glm/gtx/functions.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/// @ref gtx_functions -/// @file glm/gtx/functions.hpp -/// -/// @see core (dependence) -/// @see gtc_quaternion (dependence) -/// -/// @defgroup gtx_functions GLM_GTX_functions -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// List of useful common functions. - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" -#include "../detail/qualifier.hpp" -#include "../detail/type_vec2.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_functions is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_functions extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_functions - /// @{ - - /// 1D gauss function - /// - /// @see gtc_epsilon - template - GLM_FUNC_DECL T gauss( - T x, - T ExpectedValue, - T StandardDeviation); - - /// 2D gauss function - /// - /// @see gtc_epsilon - template - GLM_FUNC_DECL T gauss( - vec<2, T, Q> const& Coord, - vec<2, T, Q> const& ExpectedValue, - vec<2, T, Q> const& StandardDeviation); - - /// @} -}//namespace glm - -#include "functions.inl" - diff --git a/3rdparty/glm/source/glm/gtx/functions.inl b/3rdparty/glm/source/glm/gtx/functions.inl deleted file mode 100644 index 29cbb20..0000000 --- a/3rdparty/glm/source/glm/gtx/functions.inl +++ /dev/null @@ -1,30 +0,0 @@ -/// @ref gtx_functions - -#include "../exponential.hpp" - -namespace glm -{ - template - GLM_FUNC_QUALIFIER T gauss - ( - T x, - T ExpectedValue, - T StandardDeviation - ) - { - return exp(-((x - ExpectedValue) * (x - ExpectedValue)) / (static_cast(2) * StandardDeviation * StandardDeviation)) / (StandardDeviation * sqrt(static_cast(6.28318530717958647692528676655900576))); - } - - template - GLM_FUNC_QUALIFIER T gauss - ( - vec<2, T, Q> const& Coord, - vec<2, T, Q> const& ExpectedValue, - vec<2, T, Q> const& StandardDeviation - ) - { - vec<2, T, Q> const Squared = ((Coord - ExpectedValue) * (Coord - ExpectedValue)) / (static_cast(2) * StandardDeviation * StandardDeviation); - return exp(-(Squared.x + Squared.y)); - } -}//namespace glm - diff --git a/3rdparty/glm/source/glm/gtx/gradient_paint.hpp b/3rdparty/glm/source/glm/gtx/gradient_paint.hpp deleted file mode 100644 index 6f85bf4..0000000 --- a/3rdparty/glm/source/glm/gtx/gradient_paint.hpp +++ /dev/null @@ -1,53 +0,0 @@ -/// @ref gtx_gradient_paint -/// @file glm/gtx/gradient_paint.hpp -/// -/// @see core (dependence) -/// @see gtx_optimum_pow (dependence) -/// -/// @defgroup gtx_gradient_paint GLM_GTX_gradient_paint -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Functions that return the color of procedural gradient for specific coordinates. - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtx/optimum_pow.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_gradient_paint is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_gradient_paint extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_gradient_paint - /// @{ - - /// Return a color from a radial gradient. - /// @see - gtx_gradient_paint - template - GLM_FUNC_DECL T radialGradient( - vec<2, T, Q> const& Center, - T const& Radius, - vec<2, T, Q> const& Focal, - vec<2, T, Q> const& Position); - - /// Return a color from a linear gradient. - /// @see - gtx_gradient_paint - template - GLM_FUNC_DECL T linearGradient( - vec<2, T, Q> const& Point0, - vec<2, T, Q> const& Point1, - vec<2, T, Q> const& Position); - - /// @} -}// namespace glm - -#include "gradient_paint.inl" diff --git a/3rdparty/glm/source/glm/gtx/gradient_paint.inl b/3rdparty/glm/source/glm/gtx/gradient_paint.inl deleted file mode 100644 index 4c495e6..0000000 --- a/3rdparty/glm/source/glm/gtx/gradient_paint.inl +++ /dev/null @@ -1,36 +0,0 @@ -/// @ref gtx_gradient_paint - -namespace glm -{ - template - GLM_FUNC_QUALIFIER T radialGradient - ( - vec<2, T, Q> const& Center, - T const& Radius, - vec<2, T, Q> const& Focal, - vec<2, T, Q> const& Position - ) - { - vec<2, T, Q> F = Focal - Center; - vec<2, T, Q> D = Position - Focal; - T Radius2 = pow2(Radius); - T Fx2 = pow2(F.x); - T Fy2 = pow2(F.y); - - T Numerator = (D.x * F.x + D.y * F.y) + sqrt(Radius2 * (pow2(D.x) + pow2(D.y)) - pow2(D.x * F.y - D.y * F.x)); - T Denominator = Radius2 - (Fx2 + Fy2); - return Numerator / Denominator; - } - - template - GLM_FUNC_QUALIFIER T linearGradient - ( - vec<2, T, Q> const& Point0, - vec<2, T, Q> const& Point1, - vec<2, T, Q> const& Position - ) - { - vec<2, T, Q> Dist = Point1 - Point0; - return (Dist.x * (Position.x - Point0.x) + Dist.y * (Position.y - Point0.y)) / glm::dot(Dist, Dist); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/handed_coordinate_space.hpp b/3rdparty/glm/source/glm/gtx/handed_coordinate_space.hpp deleted file mode 100644 index 3c85968..0000000 --- a/3rdparty/glm/source/glm/gtx/handed_coordinate_space.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/// @ref gtx_handed_coordinate_space -/// @file glm/gtx/handed_coordinate_space.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_handed_coordinate_space GLM_GTX_handed_coordinate_space -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// To know if a set of three basis vectors defines a right or left-handed coordinate system. - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_handed_coordinate_space is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_handed_coordinate_space extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_handed_coordinate_space - /// @{ - - //! Return if a trihedron right handed or not. - //! From GLM_GTX_handed_coordinate_space extension. - template - GLM_FUNC_DECL bool rightHanded( - vec<3, T, Q> const& tangent, - vec<3, T, Q> const& binormal, - vec<3, T, Q> const& normal); - - //! Return if a trihedron left handed or not. - //! From GLM_GTX_handed_coordinate_space extension. - template - GLM_FUNC_DECL bool leftHanded( - vec<3, T, Q> const& tangent, - vec<3, T, Q> const& binormal, - vec<3, T, Q> const& normal); - - /// @} -}// namespace glm - -#include "handed_coordinate_space.inl" diff --git a/3rdparty/glm/source/glm/gtx/handed_coordinate_space.inl b/3rdparty/glm/source/glm/gtx/handed_coordinate_space.inl deleted file mode 100644 index e43c17b..0000000 --- a/3rdparty/glm/source/glm/gtx/handed_coordinate_space.inl +++ /dev/null @@ -1,26 +0,0 @@ -/// @ref gtx_handed_coordinate_space - -namespace glm -{ - template - GLM_FUNC_QUALIFIER bool rightHanded - ( - vec<3, T, Q> const& tangent, - vec<3, T, Q> const& binormal, - vec<3, T, Q> const& normal - ) - { - return dot(cross(normal, tangent), binormal) > T(0); - } - - template - GLM_FUNC_QUALIFIER bool leftHanded - ( - vec<3, T, Q> const& tangent, - vec<3, T, Q> const& binormal, - vec<3, T, Q> const& normal - ) - { - return dot(cross(normal, tangent), binormal) < T(0); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/hash.hpp b/3rdparty/glm/source/glm/gtx/hash.hpp deleted file mode 100644 index 05dae9f..0000000 --- a/3rdparty/glm/source/glm/gtx/hash.hpp +++ /dev/null @@ -1,142 +0,0 @@ -/// @ref gtx_hash -/// @file glm/gtx/hash.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_hash GLM_GTX_hash -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Add std::hash support for glm types - -#pragma once - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_hash is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_hash extension included") -# endif -#endif - -#include - -#include "../vec2.hpp" -#include "../vec3.hpp" -#include "../vec4.hpp" -#include "../gtc/vec1.hpp" - -#include "../gtc/quaternion.hpp" -#include "../gtx/dual_quaternion.hpp" - -#include "../mat2x2.hpp" -#include "../mat2x3.hpp" -#include "../mat2x4.hpp" - -#include "../mat3x2.hpp" -#include "../mat3x3.hpp" -#include "../mat3x4.hpp" - -#include "../mat4x2.hpp" -#include "../mat4x3.hpp" -#include "../mat4x4.hpp" - -#if !GLM_HAS_CXX11_STL -# error "GLM_GTX_hash requires C++11 standard library support" -#endif - -namespace std -{ - template - struct hash > - { - GLM_FUNC_DECL size_t operator()(glm::vec<1, T, Q> const& v) const; - }; - - template - struct hash > - { - GLM_FUNC_DECL size_t operator()(glm::vec<2, T, Q> const& v) const; - }; - - template - struct hash > - { - GLM_FUNC_DECL size_t operator()(glm::vec<3, T, Q> const& v) const; - }; - - template - struct hash > - { - GLM_FUNC_DECL size_t operator()(glm::vec<4, T, Q> const& v) const; - }; - - template - struct hash> - { - GLM_FUNC_DECL size_t operator()(glm::qua const& q) const; - }; - - template - struct hash > - { - GLM_FUNC_DECL size_t operator()(glm::tdualquat const& q) const; - }; - - template - struct hash > - { - GLM_FUNC_DECL size_t operator()(glm::mat<2, 2, T,Q> const& m) const; - }; - - template - struct hash > - { - GLM_FUNC_DECL size_t operator()(glm::mat<2, 3, T,Q> const& m) const; - }; - - template - struct hash > - { - GLM_FUNC_DECL size_t operator()(glm::mat<2, 4, T,Q> const& m) const; - }; - - template - struct hash > - { - GLM_FUNC_DECL size_t operator()(glm::mat<3, 2, T,Q> const& m) const; - }; - - template - struct hash > - { - GLM_FUNC_DECL size_t operator()(glm::mat<3, 3, T,Q> const& m) const; - }; - - template - struct hash > - { - GLM_FUNC_DECL size_t operator()(glm::mat<3, 4, T,Q> const& m) const; - }; - - template - struct hash > - { - GLM_FUNC_DECL size_t operator()(glm::mat<4, 2, T,Q> const& m) const; - }; - - template - struct hash > - { - GLM_FUNC_DECL size_t operator()(glm::mat<4, 3, T,Q> const& m) const; - }; - - template - struct hash > - { - GLM_FUNC_DECL size_t operator()(glm::mat<4, 4, T,Q> const& m) const; - }; -} // namespace std - -#include "hash.inl" diff --git a/3rdparty/glm/source/glm/gtx/hash.inl b/3rdparty/glm/source/glm/gtx/hash.inl deleted file mode 100644 index ff71ca9..0000000 --- a/3rdparty/glm/source/glm/gtx/hash.inl +++ /dev/null @@ -1,184 +0,0 @@ -/// @ref gtx_hash -/// -/// @see core (dependence) -/// -/// @defgroup gtx_hash GLM_GTX_hash -/// @ingroup gtx -/// -/// @brief Add std::hash support for glm types -/// -/// need to be included to use the features of this extension. - -namespace glm { -namespace detail -{ - GLM_INLINE void hash_combine(size_t &seed, size_t hash) - { - hash += 0x9e3779b9 + (seed << 6) + (seed >> 2); - seed ^= hash; - } -}} - -namespace std -{ - template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::vec<1, T, Q> const& v) const - { - hash hasher; - return hasher(v.x); - } - - template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::vec<2, T, Q> const& v) const - { - size_t seed = 0; - hash hasher; - glm::detail::hash_combine(seed, hasher(v.x)); - glm::detail::hash_combine(seed, hasher(v.y)); - return seed; - } - - template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::vec<3, T, Q> const& v) const - { - size_t seed = 0; - hash hasher; - glm::detail::hash_combine(seed, hasher(v.x)); - glm::detail::hash_combine(seed, hasher(v.y)); - glm::detail::hash_combine(seed, hasher(v.z)); - return seed; - } - - template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::vec<4, T, Q> const& v) const - { - size_t seed = 0; - hash hasher; - glm::detail::hash_combine(seed, hasher(v.x)); - glm::detail::hash_combine(seed, hasher(v.y)); - glm::detail::hash_combine(seed, hasher(v.z)); - glm::detail::hash_combine(seed, hasher(v.w)); - return seed; - } - - template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::qua const& q) const - { - size_t seed = 0; - hash hasher; - glm::detail::hash_combine(seed, hasher(q.x)); - glm::detail::hash_combine(seed, hasher(q.y)); - glm::detail::hash_combine(seed, hasher(q.z)); - glm::detail::hash_combine(seed, hasher(q.w)); - return seed; - } - - template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::tdualquat const& q) const - { - size_t seed = 0; - hash> hasher; - glm::detail::hash_combine(seed, hasher(q.real)); - glm::detail::hash_combine(seed, hasher(q.dual)); - return seed; - } - - template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<2, 2, T, Q> const& m) const - { - size_t seed = 0; - hash> hasher; - glm::detail::hash_combine(seed, hasher(m[0])); - glm::detail::hash_combine(seed, hasher(m[1])); - return seed; - } - - template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<2, 3, T, Q> const& m) const - { - size_t seed = 0; - hash> hasher; - glm::detail::hash_combine(seed, hasher(m[0])); - glm::detail::hash_combine(seed, hasher(m[1])); - return seed; - } - - template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<2, 4, T, Q> const& m) const - { - size_t seed = 0; - hash> hasher; - glm::detail::hash_combine(seed, hasher(m[0])); - glm::detail::hash_combine(seed, hasher(m[1])); - return seed; - } - - template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<3, 2, T, Q> const& m) const - { - size_t seed = 0; - hash> hasher; - glm::detail::hash_combine(seed, hasher(m[0])); - glm::detail::hash_combine(seed, hasher(m[1])); - glm::detail::hash_combine(seed, hasher(m[2])); - return seed; - } - - template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<3, 3, T, Q> const& m) const - { - size_t seed = 0; - hash> hasher; - glm::detail::hash_combine(seed, hasher(m[0])); - glm::detail::hash_combine(seed, hasher(m[1])); - glm::detail::hash_combine(seed, hasher(m[2])); - return seed; - } - - template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<3, 4, T, Q> const& m) const - { - size_t seed = 0; - hash> hasher; - glm::detail::hash_combine(seed, hasher(m[0])); - glm::detail::hash_combine(seed, hasher(m[1])); - glm::detail::hash_combine(seed, hasher(m[2])); - return seed; - } - - template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<4, 2, T,Q> const& m) const - { - size_t seed = 0; - hash> hasher; - glm::detail::hash_combine(seed, hasher(m[0])); - glm::detail::hash_combine(seed, hasher(m[1])); - glm::detail::hash_combine(seed, hasher(m[2])); - glm::detail::hash_combine(seed, hasher(m[3])); - return seed; - } - - template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<4, 3, T,Q> const& m) const - { - size_t seed = 0; - hash> hasher; - glm::detail::hash_combine(seed, hasher(m[0])); - glm::detail::hash_combine(seed, hasher(m[1])); - glm::detail::hash_combine(seed, hasher(m[2])); - glm::detail::hash_combine(seed, hasher(m[3])); - return seed; - } - - template - GLM_FUNC_QUALIFIER size_t hash>::operator()(glm::mat<4, 4, T, Q> const& m) const - { - size_t seed = 0; - hash> hasher; - glm::detail::hash_combine(seed, hasher(m[0])); - glm::detail::hash_combine(seed, hasher(m[1])); - glm::detail::hash_combine(seed, hasher(m[2])); - glm::detail::hash_combine(seed, hasher(m[3])); - return seed; - } -} diff --git a/3rdparty/glm/source/glm/gtx/integer.hpp b/3rdparty/glm/source/glm/gtx/integer.hpp deleted file mode 100644 index d0b4c61..0000000 --- a/3rdparty/glm/source/glm/gtx/integer.hpp +++ /dev/null @@ -1,76 +0,0 @@ -/// @ref gtx_integer -/// @file glm/gtx/integer.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_integer GLM_GTX_integer -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Add support for integer for core functions - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtc/integer.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_integer is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_integer extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_integer - /// @{ - - //! Returns x raised to the y power. - //! From GLM_GTX_integer extension. - GLM_FUNC_DECL int pow(int x, uint y); - - //! Returns the positive square root of x. - //! From GLM_GTX_integer extension. - GLM_FUNC_DECL int sqrt(int x); - - //! Returns the floor log2 of x. - //! From GLM_GTX_integer extension. - GLM_FUNC_DECL unsigned int floor_log2(unsigned int x); - - //! Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. - //! From GLM_GTX_integer extension. - GLM_FUNC_DECL int mod(int x, int y); - - //! Return the factorial value of a number (!12 max, integer only) - //! From GLM_GTX_integer extension. - template - GLM_FUNC_DECL genType factorial(genType const& x); - - //! 32bit signed integer. - //! From GLM_GTX_integer extension. - typedef signed int sint; - - //! Returns x raised to the y power. - //! From GLM_GTX_integer extension. - GLM_FUNC_DECL uint pow(uint x, uint y); - - //! Returns the positive square root of x. - //! From GLM_GTX_integer extension. - GLM_FUNC_DECL uint sqrt(uint x); - - //! Modulus. Returns x - y * floor(x / y) for each component in x using the floating point value y. - //! From GLM_GTX_integer extension. - GLM_FUNC_DECL uint mod(uint x, uint y); - - //! Returns the number of leading zeros. - //! From GLM_GTX_integer extension. - GLM_FUNC_DECL uint nlz(uint x); - - /// @} -}//namespace glm - -#include "integer.inl" diff --git a/3rdparty/glm/source/glm/gtx/integer.inl b/3rdparty/glm/source/glm/gtx/integer.inl deleted file mode 100644 index 956366b..0000000 --- a/3rdparty/glm/source/glm/gtx/integer.inl +++ /dev/null @@ -1,185 +0,0 @@ -/// @ref gtx_integer - -namespace glm -{ - // pow - GLM_FUNC_QUALIFIER int pow(int x, uint y) - { - if(y == 0) - return x >= 0 ? 1 : -1; - - int result = x; - for(uint i = 1; i < y; ++i) - result *= x; - return result; - } - - // sqrt: From Christopher J. Musial, An integer square root, Graphics Gems, 1990, page 387 - GLM_FUNC_QUALIFIER int sqrt(int x) - { - if(x <= 1) return x; - - int NextTrial = x >> 1; - int CurrentAnswer; - - do - { - CurrentAnswer = NextTrial; - NextTrial = (NextTrial + x / NextTrial) >> 1; - } while(NextTrial < CurrentAnswer); - - return CurrentAnswer; - } - -// Henry Gordon Dietz: http://aggregate.org/MAGIC/ -namespace detail -{ - GLM_FUNC_QUALIFIER unsigned int ones32(unsigned int x) - { - /* 32-bit recursive reduction using SWAR... - but first step is mapping 2-bit values - into sum of 2 1-bit values in sneaky way - */ - x -= ((x >> 1) & 0x55555555); - x = (((x >> 2) & 0x33333333) + (x & 0x33333333)); - x = (((x >> 4) + x) & 0x0f0f0f0f); - x += (x >> 8); - x += (x >> 16); - return(x & 0x0000003f); - } -}//namespace detail - - // Henry Gordon Dietz: http://aggregate.org/MAGIC/ -/* - GLM_FUNC_QUALIFIER unsigned int floor_log2(unsigned int x) - { - x |= (x >> 1); - x |= (x >> 2); - x |= (x >> 4); - x |= (x >> 8); - x |= (x >> 16); - - return _detail::ones32(x) >> 1; - } -*/ - // mod - GLM_FUNC_QUALIFIER int mod(int x, int y) - { - return ((x % y) + y) % y; - } - - // factorial (!12 max, integer only) - template - GLM_FUNC_QUALIFIER genType factorial(genType const& x) - { - genType Temp = x; - genType Result; - for(Result = 1; Temp > 1; --Temp) - Result *= Temp; - return Result; - } - - template - GLM_FUNC_QUALIFIER vec<2, T, Q> factorial( - vec<2, T, Q> const& x) - { - return vec<2, T, Q>( - factorial(x.x), - factorial(x.y)); - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> factorial( - vec<3, T, Q> const& x) - { - return vec<3, T, Q>( - factorial(x.x), - factorial(x.y), - factorial(x.z)); - } - - template - GLM_FUNC_QUALIFIER vec<4, T, Q> factorial( - vec<4, T, Q> const& x) - { - return vec<4, T, Q>( - factorial(x.x), - factorial(x.y), - factorial(x.z), - factorial(x.w)); - } - - GLM_FUNC_QUALIFIER uint pow(uint x, uint y) - { - if (y == 0) - return 1u; - - uint result = x; - for(uint i = 1; i < y; ++i) - result *= x; - return result; - } - - GLM_FUNC_QUALIFIER uint sqrt(uint x) - { - if(x <= 1) return x; - - uint NextTrial = x >> 1; - uint CurrentAnswer; - - do - { - CurrentAnswer = NextTrial; - NextTrial = (NextTrial + x / NextTrial) >> 1; - } while(NextTrial < CurrentAnswer); - - return CurrentAnswer; - } - - GLM_FUNC_QUALIFIER uint mod(uint x, uint y) - { - return x - y * (x / y); - } - -#if(GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_GCC)) - - GLM_FUNC_QUALIFIER unsigned int nlz(unsigned int x) - { - return 31u - findMSB(x); - } - -#else - - // Hackers Delight: http://www.hackersdelight.org/HDcode/nlz.c.txt - GLM_FUNC_QUALIFIER unsigned int nlz(unsigned int x) - { - int y, m, n; - - y = -int(x >> 16); // If left half of x is 0, - m = (y >> 16) & 16; // set n = 16. If left half - n = 16 - m; // is nonzero, set n = 0 and - x = x >> m; // shift x right 16. - // Now x is of the form 0000xxxx. - y = x - 0x100; // If positions 8-15 are 0, - m = (y >> 16) & 8; // add 8 to n and shift x left 8. - n = n + m; - x = x << m; - - y = x - 0x1000; // If positions 12-15 are 0, - m = (y >> 16) & 4; // add 4 to n and shift x left 4. - n = n + m; - x = x << m; - - y = x - 0x4000; // If positions 14-15 are 0, - m = (y >> 16) & 2; // add 2 to n and shift x left 2. - n = n + m; - x = x << m; - - y = x >> 14; // Set y = 0, 1, 2, or 3. - m = y & ~(y >> 1); // Set m = 0, 1, 2, or 2 resp. - return unsigned(n + 2 - m); - } - -#endif//(GLM_COMPILER) - -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/intersect.hpp b/3rdparty/glm/source/glm/gtx/intersect.hpp deleted file mode 100644 index f5c0621..0000000 --- a/3rdparty/glm/source/glm/gtx/intersect.hpp +++ /dev/null @@ -1,92 +0,0 @@ -/// @ref gtx_intersect -/// @file glm/gtx/intersect.hpp -/// -/// @see core (dependence) -/// @see gtx_closest_point (dependence) -/// -/// @defgroup gtx_intersect GLM_GTX_intersect -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Add intersection functions - -#pragma once - -// Dependency: -#include -#include -#include "../glm.hpp" -#include "../geometric.hpp" -#include "../gtx/closest_point.hpp" -#include "../gtx/vector_query.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_closest_point is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_closest_point extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_intersect - /// @{ - - //! Compute the intersection of a ray and a plane. - //! Ray direction and plane normal must be unit length. - //! From GLM_GTX_intersect extension. - template - GLM_FUNC_DECL bool intersectRayPlane( - genType const& orig, genType const& dir, - genType const& planeOrig, genType const& planeNormal, - typename genType::value_type & intersectionDistance); - - //! Compute the intersection of a ray and a triangle. - /// Based om Tomas Möller implementation http://fileadmin.cs.lth.se/cs/Personal/Tomas_Akenine-Moller/raytri/ - //! From GLM_GTX_intersect extension. - template - GLM_FUNC_DECL bool intersectRayTriangle( - vec<3, T, Q> const& orig, vec<3, T, Q> const& dir, - vec<3, T, Q> const& v0, vec<3, T, Q> const& v1, vec<3, T, Q> const& v2, - vec<2, T, Q>& baryPosition, T& distance); - - //! Compute the intersection of a line and a triangle. - //! From GLM_GTX_intersect extension. - template - GLM_FUNC_DECL bool intersectLineTriangle( - genType const& orig, genType const& dir, - genType const& vert0, genType const& vert1, genType const& vert2, - genType & position); - - //! Compute the intersection distance of a ray and a sphere. - //! The ray direction vector is unit length. - //! From GLM_GTX_intersect extension. - template - GLM_FUNC_DECL bool intersectRaySphere( - genType const& rayStarting, genType const& rayNormalizedDirection, - genType const& sphereCenter, typename genType::value_type const sphereRadiusSquared, - typename genType::value_type & intersectionDistance); - - //! Compute the intersection of a ray and a sphere. - //! From GLM_GTX_intersect extension. - template - GLM_FUNC_DECL bool intersectRaySphere( - genType const& rayStarting, genType const& rayNormalizedDirection, - genType const& sphereCenter, const typename genType::value_type sphereRadius, - genType & intersectionPosition, genType & intersectionNormal); - - //! Compute the intersection of a line and a sphere. - //! From GLM_GTX_intersect extension - template - GLM_FUNC_DECL bool intersectLineSphere( - genType const& point0, genType const& point1, - genType const& sphereCenter, typename genType::value_type sphereRadius, - genType & intersectionPosition1, genType & intersectionNormal1, - genType & intersectionPosition2 = genType(), genType & intersectionNormal2 = genType()); - - /// @} -}//namespace glm - -#include "intersect.inl" diff --git a/3rdparty/glm/source/glm/gtx/intersect.inl b/3rdparty/glm/source/glm/gtx/intersect.inl deleted file mode 100644 index d242a61..0000000 --- a/3rdparty/glm/source/glm/gtx/intersect.inl +++ /dev/null @@ -1,200 +0,0 @@ -/// @ref gtx_intersect - -namespace glm -{ - template - GLM_FUNC_QUALIFIER bool intersectRayPlane - ( - genType const& orig, genType const& dir, - genType const& planeOrig, genType const& planeNormal, - typename genType::value_type & intersectionDistance - ) - { - typename genType::value_type d = glm::dot(dir, planeNormal); - typename genType::value_type Epsilon = std::numeric_limits::epsilon(); - - if(glm::abs(d) > Epsilon) // if dir and planeNormal are not perpendicular - { - typename genType::value_type const tmp_intersectionDistance = glm::dot(planeOrig - orig, planeNormal) / d; - if (tmp_intersectionDistance > static_cast(0)) { // allow only intersections - intersectionDistance = tmp_intersectionDistance; - return true; - } - } - - return false; - } - - template - GLM_FUNC_QUALIFIER bool intersectRayTriangle - ( - vec<3, T, Q> const& orig, vec<3, T, Q> const& dir, - vec<3, T, Q> const& vert0, vec<3, T, Q> const& vert1, vec<3, T, Q> const& vert2, - vec<2, T, Q>& baryPosition, T& distance - ) - { - // find vectors for two edges sharing vert0 - vec<3, T, Q> const edge1 = vert1 - vert0; - vec<3, T, Q> const edge2 = vert2 - vert0; - - // begin calculating determinant - also used to calculate U parameter - vec<3, T, Q> const p = glm::cross(dir, edge2); - - // if determinant is near zero, ray lies in plane of triangle - T const det = glm::dot(edge1, p); - - vec<3, T, Q> Perpendicular(0); - - if(det > std::numeric_limits::epsilon()) - { - // calculate distance from vert0 to ray origin - vec<3, T, Q> const dist = orig - vert0; - - // calculate U parameter and test bounds - baryPosition.x = glm::dot(dist, p); - if(baryPosition.x < static_cast(0) || baryPosition.x > det) - return false; - - // prepare to test V parameter - Perpendicular = glm::cross(dist, edge1); - - // calculate V parameter and test bounds - baryPosition.y = glm::dot(dir, Perpendicular); - if((baryPosition.y < static_cast(0)) || ((baryPosition.x + baryPosition.y) > det)) - return false; - } - else if(det < -std::numeric_limits::epsilon()) - { - // calculate distance from vert0 to ray origin - vec<3, T, Q> const dist = orig - vert0; - - // calculate U parameter and test bounds - baryPosition.x = glm::dot(dist, p); - if((baryPosition.x > static_cast(0)) || (baryPosition.x < det)) - return false; - - // prepare to test V parameter - Perpendicular = glm::cross(dist, edge1); - - // calculate V parameter and test bounds - baryPosition.y = glm::dot(dir, Perpendicular); - if((baryPosition.y > static_cast(0)) || (baryPosition.x + baryPosition.y < det)) - return false; - } - else - return false; // ray is parallel to the plane of the triangle - - T inv_det = static_cast(1) / det; - - // calculate distance, ray intersects triangle - distance = glm::dot(edge2, Perpendicular) * inv_det; - baryPosition *= inv_det; - - return true; - } - - template - GLM_FUNC_QUALIFIER bool intersectLineTriangle - ( - genType const& orig, genType const& dir, - genType const& vert0, genType const& vert1, genType const& vert2, - genType & position - ) - { - typename genType::value_type Epsilon = std::numeric_limits::epsilon(); - - genType edge1 = vert1 - vert0; - genType edge2 = vert2 - vert0; - - genType Perpendicular = cross(dir, edge2); - - typename genType::value_type det = dot(edge1, Perpendicular); - - if (det > -Epsilon && det < Epsilon) - return false; - typename genType::value_type inv_det = typename genType::value_type(1) / det; - - genType Tengant = orig - vert0; - - position.y = dot(Tengant, Perpendicular) * inv_det; - if (position.y < typename genType::value_type(0) || position.y > typename genType::value_type(1)) - return false; - - genType Cotengant = cross(Tengant, edge1); - - position.z = dot(dir, Cotengant) * inv_det; - if (position.z < typename genType::value_type(0) || position.y + position.z > typename genType::value_type(1)) - return false; - - position.x = dot(edge2, Cotengant) * inv_det; - - return true; - } - - template - GLM_FUNC_QUALIFIER bool intersectRaySphere - ( - genType const& rayStarting, genType const& rayNormalizedDirection, - genType const& sphereCenter, const typename genType::value_type sphereRadiusSquared, - typename genType::value_type & intersectionDistance - ) - { - typename genType::value_type Epsilon = std::numeric_limits::epsilon(); - genType diff = sphereCenter - rayStarting; - typename genType::value_type t0 = dot(diff, rayNormalizedDirection); - typename genType::value_type dSquared = dot(diff, diff) - t0 * t0; - if( dSquared > sphereRadiusSquared ) - { - return false; - } - typename genType::value_type t1 = sqrt( sphereRadiusSquared - dSquared ); - intersectionDistance = t0 > t1 + Epsilon ? t0 - t1 : t0 + t1; - return intersectionDistance > Epsilon; - } - - template - GLM_FUNC_QUALIFIER bool intersectRaySphere - ( - genType const& rayStarting, genType const& rayNormalizedDirection, - genType const& sphereCenter, const typename genType::value_type sphereRadius, - genType & intersectionPosition, genType & intersectionNormal - ) - { - typename genType::value_type distance; - if( intersectRaySphere( rayStarting, rayNormalizedDirection, sphereCenter, sphereRadius * sphereRadius, distance ) ) - { - intersectionPosition = rayStarting + rayNormalizedDirection * distance; - intersectionNormal = (intersectionPosition - sphereCenter) / sphereRadius; - return true; - } - return false; - } - - template - GLM_FUNC_QUALIFIER bool intersectLineSphere - ( - genType const& point0, genType const& point1, - genType const& sphereCenter, typename genType::value_type sphereRadius, - genType & intersectionPoint1, genType & intersectionNormal1, - genType & intersectionPoint2, genType & intersectionNormal2 - ) - { - typename genType::value_type Epsilon = std::numeric_limits::epsilon(); - genType dir = normalize(point1 - point0); - genType diff = sphereCenter - point0; - typename genType::value_type t0 = dot(diff, dir); - typename genType::value_type dSquared = dot(diff, diff) - t0 * t0; - if( dSquared > sphereRadius * sphereRadius ) - { - return false; - } - typename genType::value_type t1 = sqrt( sphereRadius * sphereRadius - dSquared ); - if( t0 < t1 + Epsilon ) - t1 = -t1; - intersectionPoint1 = point0 + dir * (t0 - t1); - intersectionNormal1 = (intersectionPoint1 - sphereCenter) / sphereRadius; - intersectionPoint2 = point0 + dir * (t0 + t1); - intersectionNormal2 = (intersectionPoint2 - sphereCenter) / sphereRadius; - return true; - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/io.hpp b/3rdparty/glm/source/glm/gtx/io.hpp deleted file mode 100644 index 8d974f0..0000000 --- a/3rdparty/glm/source/glm/gtx/io.hpp +++ /dev/null @@ -1,201 +0,0 @@ -/// @ref gtx_io -/// @file glm/gtx/io.hpp -/// @author Jan P Springer (regnirpsj@gmail.com) -/// -/// @see core (dependence) -/// @see gtc_matrix_access (dependence) -/// @see gtc_quaternion (dependence) -/// -/// @defgroup gtx_io GLM_GTX_io -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// std::[w]ostream support for glm types -/// -/// std::[w]ostream support for glm types + qualifier/width/etc. manipulators -/// based on howard hinnant's std::chrono io proposal -/// [http://home.roadrunner.com/~hinnant/bloomington/chrono_io.html] - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtx/quaternion.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_io is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_io extension included") -# endif -#endif - -#include // std::basic_ostream<> (fwd) -#include // std::locale, std::locale::facet, std::locale::id -#include // std::pair<> - -namespace glm -{ - /// @addtogroup gtx_io - /// @{ - - namespace io - { - enum order_type { column_major, row_major}; - - template - class format_punct : public std::locale::facet - { - typedef CTy char_type; - - public: - - static std::locale::id id; - - bool formatted; - unsigned precision; - unsigned width; - char_type separator; - char_type delim_left; - char_type delim_right; - char_type space; - char_type newline; - order_type order; - - GLM_FUNC_DECL explicit format_punct(size_t a = 0); - GLM_FUNC_DECL explicit format_punct(format_punct const&); - }; - - template > - class basic_state_saver { - - public: - - GLM_FUNC_DECL explicit basic_state_saver(std::basic_ios&); - GLM_FUNC_DECL ~basic_state_saver(); - - private: - - typedef ::std::basic_ios state_type; - typedef typename state_type::char_type char_type; - typedef ::std::ios_base::fmtflags flags_type; - typedef ::std::streamsize streamsize_type; - typedef ::std::locale const locale_type; - - state_type& state_; - flags_type flags_; - streamsize_type precision_; - streamsize_type width_; - char_type fill_; - locale_type locale_; - - GLM_FUNC_DECL basic_state_saver& operator=(basic_state_saver const&); - }; - - typedef basic_state_saver state_saver; - typedef basic_state_saver wstate_saver; - - template > - class basic_format_saver - { - public: - - GLM_FUNC_DECL explicit basic_format_saver(std::basic_ios&); - GLM_FUNC_DECL ~basic_format_saver(); - - private: - - basic_state_saver const bss_; - - GLM_FUNC_DECL basic_format_saver& operator=(basic_format_saver const&); - }; - - typedef basic_format_saver format_saver; - typedef basic_format_saver wformat_saver; - - struct precision - { - unsigned value; - - GLM_FUNC_DECL explicit precision(unsigned); - }; - - struct width - { - unsigned value; - - GLM_FUNC_DECL explicit width(unsigned); - }; - - template - struct delimeter - { - CTy value[3]; - - GLM_FUNC_DECL explicit delimeter(CTy /* left */, CTy /* right */, CTy /* separator */ = ','); - }; - - struct order - { - order_type value; - - GLM_FUNC_DECL explicit order(order_type); - }; - - // functions, inlined (inline) - - template - FTy const& get_facet(std::basic_ios&); - template - std::basic_ios& formatted(std::basic_ios&); - template - std::basic_ios& unformattet(std::basic_ios&); - - template - std::basic_ostream& operator<<(std::basic_ostream&, precision const&); - template - std::basic_ostream& operator<<(std::basic_ostream&, width const&); - template - std::basic_ostream& operator<<(std::basic_ostream&, delimeter const&); - template - std::basic_ostream& operator<<(std::basic_ostream&, order const&); - }//namespace io - - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, qua const&); - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<1, T, Q> const&); - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<2, T, Q> const&); - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<3, T, Q> const&); - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, vec<4, T, Q> const&); - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<2, 2, T, Q> const&); - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<2, 3, T, Q> const&); - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<2, 4, T, Q> const&); - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<3, 2, T, Q> const&); - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<3, 3, T, Q> const&); - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<3, 4, T, Q> const&); - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<4, 2, T, Q> const&); - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<4, 3, T, Q> const&); - template - GLM_FUNC_DECL std::basic_ostream& operator<<(std::basic_ostream&, mat<4, 4, T, Q> const&); - - template - GLM_FUNC_DECL std::basic_ostream & operator<<(std::basic_ostream &, - std::pair const, mat<4, 4, T, Q> const> const&); - - /// @} -}//namespace glm - -#include "io.inl" diff --git a/3rdparty/glm/source/glm/gtx/io.inl b/3rdparty/glm/source/glm/gtx/io.inl deleted file mode 100644 index a3a1bb6..0000000 --- a/3rdparty/glm/source/glm/gtx/io.inl +++ /dev/null @@ -1,440 +0,0 @@ -/// @ref gtx_io -/// @author Jan P Springer (regnirpsj@gmail.com) - -#include // std::fixed, std::setfill<>, std::setprecision, std::right, std::setw -#include // std::basic_ostream<> -#include "../gtc/matrix_access.hpp" // glm::col, glm::row -#include "../gtx/type_trait.hpp" // glm::type<> - -namespace glm{ -namespace io -{ - template - GLM_FUNC_QUALIFIER format_punct::format_punct(size_t a) - : std::locale::facet(a) - , formatted(true) - , precision(3) - , width(1 + 4 + 1 + precision) - , separator(',') - , delim_left('[') - , delim_right(']') - , space(' ') - , newline('\n') - , order(column_major) - {} - - template - GLM_FUNC_QUALIFIER format_punct::format_punct(format_punct const& a) - : std::locale::facet(0) - , formatted(a.formatted) - , precision(a.precision) - , width(a.width) - , separator(a.separator) - , delim_left(a.delim_left) - , delim_right(a.delim_right) - , space(a.space) - , newline(a.newline) - , order(a.order) - {} - - template std::locale::id format_punct::id; - - template - GLM_FUNC_QUALIFIER basic_state_saver::basic_state_saver(std::basic_ios& a) - : state_(a) - , flags_(a.flags()) - , precision_(a.precision()) - , width_(a.width()) - , fill_(a.fill()) - , locale_(a.getloc()) - {} - - template - GLM_FUNC_QUALIFIER basic_state_saver::~basic_state_saver() - { - state_.imbue(locale_); - state_.fill(fill_); - state_.width(width_); - state_.precision(precision_); - state_.flags(flags_); - } - - template - GLM_FUNC_QUALIFIER basic_format_saver::basic_format_saver(std::basic_ios& a) - : bss_(a) - { - a.imbue(std::locale(a.getloc(), new format_punct(get_facet >(a)))); - } - - template - GLM_FUNC_QUALIFIER - basic_format_saver::~basic_format_saver() - {} - - GLM_FUNC_QUALIFIER precision::precision(unsigned a) - : value(a) - {} - - GLM_FUNC_QUALIFIER width::width(unsigned a) - : value(a) - {} - - template - GLM_FUNC_QUALIFIER delimeter::delimeter(CTy a, CTy b, CTy c) - : value() - { - value[0] = a; - value[1] = b; - value[2] = c; - } - - GLM_FUNC_QUALIFIER order::order(order_type a) - : value(a) - {} - - template - GLM_FUNC_QUALIFIER FTy const& get_facet(std::basic_ios& ios) - { - if(!std::has_facet(ios.getloc())) - ios.imbue(std::locale(ios.getloc(), new FTy)); - - return std::use_facet(ios.getloc()); - } - - template - GLM_FUNC_QUALIFIER std::basic_ios& formatted(std::basic_ios& ios) - { - const_cast&>(get_facet >(ios)).formatted = true; - return ios; - } - - template - GLM_FUNC_QUALIFIER std::basic_ios& unformatted(std::basic_ios& ios) - { - const_cast&>(get_facet >(ios)).formatted = false; - return ios; - } - - template - GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, precision const& a) - { - const_cast&>(get_facet >(os)).precision = a.value; - return os; - } - - template - GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, width const& a) - { - const_cast&>(get_facet >(os)).width = a.value; - return os; - } - - template - GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, delimeter const& a) - { - format_punct & fmt(const_cast&>(get_facet >(os))); - - fmt.delim_left = a.value[0]; - fmt.delim_right = a.value[1]; - fmt.separator = a.value[2]; - - return os; - } - - template - GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, order const& a) - { - const_cast&>(get_facet >(os)).order = a.value; - return os; - } -} // namespace io - -namespace detail -{ - template - GLM_FUNC_QUALIFIER std::basic_ostream& - print_vector_on(std::basic_ostream& os, V const& a) - { - typename std::basic_ostream::sentry const cerberus(os); - - if(cerberus) - { - io::format_punct const& fmt(io::get_facet >(os)); - - length_t const& components(type::components); - - if(fmt.formatted) - { - io::basic_state_saver const bss(os); - - os << std::fixed << std::right << std::setprecision(fmt.precision) << std::setfill(fmt.space) << fmt.delim_left; - - for(length_t i(0); i < components; ++i) - { - os << std::setw(fmt.width) << a[i]; - if(components-1 != i) - os << fmt.separator; - } - - os << fmt.delim_right; - } - else - { - for(length_t i(0); i < components; ++i) - { - os << a[i]; - - if(components-1 != i) - os << fmt.space; - } - } - } - - return os; - } -}//namespace detail - - template - GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, qua const& a) - { - return detail::print_vector_on(os, a); - } - - template - GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, vec<1, T, Q> const& a) - { - return detail::print_vector_on(os, a); - } - - template - GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, vec<2, T, Q> const& a) - { - return detail::print_vector_on(os, a); - } - - template - GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, vec<3, T, Q> const& a) - { - return detail::print_vector_on(os, a); - } - - template - GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, vec<4, T, Q> const& a) - { - return detail::print_vector_on(os, a); - } - -namespace detail -{ - template class M, length_t C, length_t R, typename T, qualifier Q> - GLM_FUNC_QUALIFIER std::basic_ostream& print_matrix_on(std::basic_ostream& os, M const& a) - { - typename std::basic_ostream::sentry const cerberus(os); - - if(cerberus) - { - io::format_punct const& fmt(io::get_facet >(os)); - - length_t const& cols(type >::cols); - length_t const& rows(type >::rows); - - if(fmt.formatted) - { - os << fmt.newline << fmt.delim_left; - - switch(fmt.order) - { - case io::column_major: - { - for(length_t i(0); i < rows; ++i) - { - if (0 != i) - os << fmt.space; - - os << row(a, i); - - if(rows-1 != i) - os << fmt.newline; - } - } - break; - - case io::row_major: - { - for(length_t i(0); i < cols; ++i) - { - if(0 != i) - os << fmt.space; - - os << column(a, i); - - if(cols-1 != i) - os << fmt.newline; - } - } - break; - } - - os << fmt.delim_right; - } - else - { - switch (fmt.order) - { - case io::column_major: - { - for(length_t i(0); i < cols; ++i) - { - os << column(a, i); - - if(cols - 1 != i) - os << fmt.space; - } - } - break; - - case io::row_major: - { - for (length_t i(0); i < rows; ++i) - { - os << row(a, i); - - if (rows-1 != i) - os << fmt.space; - } - } - break; - } - } - } - - return os; - } -}//namespace detail - - template - GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, mat<2, 2, T, Q> const& a) - { - return detail::print_matrix_on(os, a); - } - - template - GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, mat<2, 3, T, Q> const& a) - { - return detail::print_matrix_on(os, a); - } - - template - GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, mat<2, 4, T, Q> const& a) - { - return detail::print_matrix_on(os, a); - } - - template - GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, mat<3, 2, T, Q> const& a) - { - return detail::print_matrix_on(os, a); - } - - template - GLM_FUNC_QUALIFIER std::basic_ostream& operator<<(std::basic_ostream& os, mat<3, 3, T, Q> const& a) - { - return detail::print_matrix_on(os, a); - } - - template - GLM_FUNC_QUALIFIER std::basic_ostream & operator<<(std::basic_ostream& os, mat<3, 4, T, Q> const& a) - { - return detail::print_matrix_on(os, a); - } - - template - GLM_FUNC_QUALIFIER std::basic_ostream & operator<<(std::basic_ostream& os, mat<4, 2, T, Q> const& a) - { - return detail::print_matrix_on(os, a); - } - - template - GLM_FUNC_QUALIFIER std::basic_ostream & operator<<(std::basic_ostream& os, mat<4, 3, T, Q> const& a) - { - return detail::print_matrix_on(os, a); - } - - template - GLM_FUNC_QUALIFIER std::basic_ostream & operator<<(std::basic_ostream& os, mat<4, 4, T, Q> const& a) - { - return detail::print_matrix_on(os, a); - } - -namespace detail -{ - template class M, length_t C, length_t R, typename T, qualifier Q> - GLM_FUNC_QUALIFIER std::basic_ostream& print_matrix_pair_on(std::basic_ostream& os, std::pair const, M const> const& a) - { - typename std::basic_ostream::sentry const cerberus(os); - - if(cerberus) - { - io::format_punct const& fmt(io::get_facet >(os)); - M const& ml(a.first); - M const& mr(a.second); - length_t const& cols(type >::cols); - length_t const& rows(type >::rows); - - if(fmt.formatted) - { - os << fmt.newline << fmt.delim_left; - - switch(fmt.order) - { - case io::column_major: - { - for(length_t i(0); i < rows; ++i) - { - if(0 != i) - os << fmt.space; - - os << row(ml, i) << ((rows-1 != i) ? fmt.space : fmt.delim_right) << fmt.space << ((0 != i) ? fmt.space : fmt.delim_left) << row(mr, i); - - if(rows-1 != i) - os << fmt.newline; - } - } - break; - case io::row_major: - { - for(length_t i(0); i < cols; ++i) - { - if(0 != i) - os << fmt.space; - - os << column(ml, i) << ((cols-1 != i) ? fmt.space : fmt.delim_right) << fmt.space << ((0 != i) ? fmt.space : fmt.delim_left) << column(mr, i); - - if(cols-1 != i) - os << fmt.newline; - } - } - break; - } - - os << fmt.delim_right; - } - else - { - os << ml << fmt.space << mr; - } - } - - return os; - } -}//namespace detail - - template - GLM_FUNC_QUALIFIER std::basic_ostream& operator<<( - std::basic_ostream & os, - std::pair const, - mat<4, 4, T, Q> const> const& a) - { - return detail::print_matrix_pair_on(os, a); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/log_base.hpp b/3rdparty/glm/source/glm/gtx/log_base.hpp deleted file mode 100644 index ba28c9d..0000000 --- a/3rdparty/glm/source/glm/gtx/log_base.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/// @ref gtx_log_base -/// @file glm/gtx/log_base.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_log_base GLM_GTX_log_base -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Logarithm for any base. base can be a vector or a scalar. - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_log_base is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_log_base extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_log_base - /// @{ - - /// Logarithm for any base. - /// From GLM_GTX_log_base. - template - GLM_FUNC_DECL genType log( - genType const& x, - genType const& base); - - /// Logarithm for any base. - /// From GLM_GTX_log_base. - template - GLM_FUNC_DECL vec sign( - vec const& x, - vec const& base); - - /// @} -}//namespace glm - -#include "log_base.inl" diff --git a/3rdparty/glm/source/glm/gtx/log_base.inl b/3rdparty/glm/source/glm/gtx/log_base.inl deleted file mode 100644 index 4bbb8e8..0000000 --- a/3rdparty/glm/source/glm/gtx/log_base.inl +++ /dev/null @@ -1,16 +0,0 @@ -/// @ref gtx_log_base - -namespace glm -{ - template - GLM_FUNC_QUALIFIER genType log(genType const& x, genType const& base) - { - return glm::log(x) / glm::log(base); - } - - template - GLM_FUNC_QUALIFIER vec log(vec const& x, vec const& base) - { - return glm::log(x) / glm::log(base); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/matrix_cross_product.hpp b/3rdparty/glm/source/glm/gtx/matrix_cross_product.hpp deleted file mode 100644 index 1e585f9..0000000 --- a/3rdparty/glm/source/glm/gtx/matrix_cross_product.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/// @ref gtx_matrix_cross_product -/// @file glm/gtx/matrix_cross_product.hpp -/// -/// @see core (dependence) -/// @see gtx_extented_min_max (dependence) -/// -/// @defgroup gtx_matrix_cross_product GLM_GTX_matrix_cross_product -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Build cross product matrices - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_matrix_cross_product is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_matrix_cross_product extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_matrix_cross_product - /// @{ - - //! Build a cross product matrix. - //! From GLM_GTX_matrix_cross_product extension. - template - GLM_FUNC_DECL mat<3, 3, T, Q> matrixCross3( - vec<3, T, Q> const& x); - - //! Build a cross product matrix. - //! From GLM_GTX_matrix_cross_product extension. - template - GLM_FUNC_DECL mat<4, 4, T, Q> matrixCross4( - vec<3, T, Q> const& x); - - /// @} -}//namespace glm - -#include "matrix_cross_product.inl" diff --git a/3rdparty/glm/source/glm/gtx/matrix_cross_product.inl b/3rdparty/glm/source/glm/gtx/matrix_cross_product.inl deleted file mode 100644 index 3a15397..0000000 --- a/3rdparty/glm/source/glm/gtx/matrix_cross_product.inl +++ /dev/null @@ -1,37 +0,0 @@ -/// @ref gtx_matrix_cross_product - -namespace glm -{ - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> matrixCross3 - ( - vec<3, T, Q> const& x - ) - { - mat<3, 3, T, Q> Result(T(0)); - Result[0][1] = x.z; - Result[1][0] = -x.z; - Result[0][2] = -x.y; - Result[2][0] = x.y; - Result[1][2] = x.x; - Result[2][1] = -x.x; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> matrixCross4 - ( - vec<3, T, Q> const& x - ) - { - mat<4, 4, T, Q> Result(T(0)); - Result[0][1] = x.z; - Result[1][0] = -x.z; - Result[0][2] = -x.y; - Result[2][0] = x.y; - Result[1][2] = x.x; - Result[2][1] = -x.x; - return Result; - } - -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/matrix_decompose.hpp b/3rdparty/glm/source/glm/gtx/matrix_decompose.hpp deleted file mode 100644 index acd7a7f..0000000 --- a/3rdparty/glm/source/glm/gtx/matrix_decompose.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/// @ref gtx_matrix_decompose -/// @file glm/gtx/matrix_decompose.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_matrix_decompose GLM_GTX_matrix_decompose -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Decomposes a model matrix to translations, rotation and scale components - -#pragma once - -// Dependencies -#include "../mat4x4.hpp" -#include "../vec3.hpp" -#include "../vec4.hpp" -#include "../geometric.hpp" -#include "../gtc/quaternion.hpp" -#include "../gtc/matrix_transform.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_matrix_decompose is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_matrix_decompose extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_matrix_decompose - /// @{ - - /// Decomposes a model matrix to translations, rotation and scale components - /// @see gtx_matrix_decompose - template - GLM_FUNC_DECL bool decompose( - mat<4, 4, T, Q> const& modelMatrix, - vec<3, T, Q> & scale, qua & orientation, vec<3, T, Q> & translation, vec<3, T, Q> & skew, vec<4, T, Q> & perspective); - - /// @} -}//namespace glm - -#include "matrix_decompose.inl" diff --git a/3rdparty/glm/source/glm/gtx/matrix_decompose.inl b/3rdparty/glm/source/glm/gtx/matrix_decompose.inl deleted file mode 100644 index aa4386a..0000000 --- a/3rdparty/glm/source/glm/gtx/matrix_decompose.inl +++ /dev/null @@ -1,192 +0,0 @@ -/// @ref gtx_matrix_decompose - -#include "../gtc/constants.hpp" -#include "../gtc/epsilon.hpp" - -namespace glm{ -namespace detail -{ - /// Make a linear combination of two vectors and return the result. - // result = (a * ascl) + (b * bscl) - template - GLM_FUNC_QUALIFIER vec<3, T, Q> combine( - vec<3, T, Q> const& a, - vec<3, T, Q> const& b, - T ascl, T bscl) - { - return (a * ascl) + (b * bscl); - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> scale(vec<3, T, Q> const& v, T desiredLength) - { - return v * desiredLength / length(v); - } -}//namespace detail - - // Matrix decompose - // http://www.opensource.apple.com/source/WebCore/WebCore-514/platform/graphics/transforms/TransformationMatrix.cpp - // Decomposes the mode matrix to translations,rotation scale components - - template - GLM_FUNC_QUALIFIER bool decompose(mat<4, 4, T, Q> const& ModelMatrix, vec<3, T, Q> & Scale, qua & Orientation, vec<3, T, Q> & Translation, vec<3, T, Q> & Skew, vec<4, T, Q> & Perspective) - { - mat<4, 4, T, Q> LocalMatrix(ModelMatrix); - - // Normalize the matrix. - if(epsilonEqual(LocalMatrix[3][3], static_cast(0), epsilon())) - return false; - - for(length_t i = 0; i < 4; ++i) - for(length_t j = 0; j < 4; ++j) - LocalMatrix[i][j] /= LocalMatrix[3][3]; - - // perspectiveMatrix is used to solve for perspective, but it also provides - // an easy way to test for singularity of the upper 3x3 component. - mat<4, 4, T, Q> PerspectiveMatrix(LocalMatrix); - - for(length_t i = 0; i < 3; i++) - PerspectiveMatrix[i][3] = static_cast(0); - PerspectiveMatrix[3][3] = static_cast(1); - - /// TODO: Fixme! - if(epsilonEqual(determinant(PerspectiveMatrix), static_cast(0), epsilon())) - return false; - - // First, isolate perspective. This is the messiest. - if( - epsilonNotEqual(LocalMatrix[0][3], static_cast(0), epsilon()) || - epsilonNotEqual(LocalMatrix[1][3], static_cast(0), epsilon()) || - epsilonNotEqual(LocalMatrix[2][3], static_cast(0), epsilon())) - { - // rightHandSide is the right hand side of the equation. - vec<4, T, Q> RightHandSide; - RightHandSide[0] = LocalMatrix[0][3]; - RightHandSide[1] = LocalMatrix[1][3]; - RightHandSide[2] = LocalMatrix[2][3]; - RightHandSide[3] = LocalMatrix[3][3]; - - // Solve the equation by inverting PerspectiveMatrix and multiplying - // rightHandSide by the inverse. (This is the easiest way, not - // necessarily the best.) - mat<4, 4, T, Q> InversePerspectiveMatrix = glm::inverse(PerspectiveMatrix);// inverse(PerspectiveMatrix, inversePerspectiveMatrix); - mat<4, 4, T, Q> TransposedInversePerspectiveMatrix = glm::transpose(InversePerspectiveMatrix);// transposeMatrix4(inversePerspectiveMatrix, transposedInversePerspectiveMatrix); - - Perspective = TransposedInversePerspectiveMatrix * RightHandSide; - // v4MulPointByMatrix(rightHandSide, transposedInversePerspectiveMatrix, perspectivePoint); - - // Clear the perspective partition - LocalMatrix[0][3] = LocalMatrix[1][3] = LocalMatrix[2][3] = static_cast(0); - LocalMatrix[3][3] = static_cast(1); - } - else - { - // No perspective. - Perspective = vec<4, T, Q>(0, 0, 0, 1); - } - - // Next take care of translation (easy). - Translation = vec<3, T, Q>(LocalMatrix[3]); - LocalMatrix[3] = vec<4, T, Q>(0, 0, 0, LocalMatrix[3].w); - - vec<3, T, Q> Row[3], Pdum3; - - // Now get scale and shear. - for(length_t i = 0; i < 3; ++i) - for(length_t j = 0; j < 3; ++j) - Row[i][j] = LocalMatrix[i][j]; - - // Compute X scale factor and normalize first row. - Scale.x = length(Row[0]);// v3Length(Row[0]); - - Row[0] = detail::scale(Row[0], static_cast(1)); - - // Compute XY shear factor and make 2nd row orthogonal to 1st. - Skew.z = dot(Row[0], Row[1]); - Row[1] = detail::combine(Row[1], Row[0], static_cast(1), -Skew.z); - - // Now, compute Y scale and normalize 2nd row. - Scale.y = length(Row[1]); - Row[1] = detail::scale(Row[1], static_cast(1)); - Skew.z /= Scale.y; - - // Compute XZ and YZ shears, orthogonalize 3rd row. - Skew.y = glm::dot(Row[0], Row[2]); - Row[2] = detail::combine(Row[2], Row[0], static_cast(1), -Skew.y); - Skew.x = glm::dot(Row[1], Row[2]); - Row[2] = detail::combine(Row[2], Row[1], static_cast(1), -Skew.x); - - // Next, get Z scale and normalize 3rd row. - Scale.z = length(Row[2]); - Row[2] = detail::scale(Row[2], static_cast(1)); - Skew.y /= Scale.z; - Skew.x /= Scale.z; - - // At this point, the matrix (in rows[]) is orthonormal. - // Check for a coordinate system flip. If the determinant - // is -1, then negate the matrix and the scaling factors. - Pdum3 = cross(Row[1], Row[2]); // v3Cross(row[1], row[2], Pdum3); - if(dot(Row[0], Pdum3) < 0) - { - for(length_t i = 0; i < 3; i++) - { - Scale[i] *= static_cast(-1); - Row[i] *= static_cast(-1); - } - } - - // Now, get the rotations out, as described in the gem. - - // FIXME - Add the ability to return either quaternions (which are - // easier to recompose with) or Euler angles (rx, ry, rz), which - // are easier for authors to deal with. The latter will only be useful - // when we fix https://bugs.webkit.org/show_bug.cgi?id=23799, so I - // will leave the Euler angle code here for now. - - // ret.rotateY = asin(-Row[0][2]); - // if (cos(ret.rotateY) != 0) { - // ret.rotateX = atan2(Row[1][2], Row[2][2]); - // ret.rotateZ = atan2(Row[0][1], Row[0][0]); - // } else { - // ret.rotateX = atan2(-Row[2][0], Row[1][1]); - // ret.rotateZ = 0; - // } - - int i, j, k = 0; - T root, trace = Row[0].x + Row[1].y + Row[2].z; - if(trace > static_cast(0)) - { - root = sqrt(trace + static_cast(1.0)); - Orientation.w = static_cast(0.5) * root; - root = static_cast(0.5) / root; - Orientation.x = root * (Row[1].z - Row[2].y); - Orientation.y = root * (Row[2].x - Row[0].z); - Orientation.z = root * (Row[0].y - Row[1].x); - } // End if > 0 - else - { - static int Next[3] = {1, 2, 0}; - i = 0; - if(Row[1].y > Row[0].x) i = 1; - if(Row[2].z > Row[i][i]) i = 2; - j = Next[i]; - k = Next[j]; - -# ifdef GLM_FORCE_QUAT_DATA_XYZW - int off = 0; -# else - int off = 1; -# endif - - root = sqrt(Row[i][i] - Row[j][j] - Row[k][k] + static_cast(1.0)); - - Orientation[i + off] = static_cast(0.5) * root; - root = static_cast(0.5) / root; - Orientation[j + off] = root * (Row[i][j] + Row[j][i]); - Orientation[k + off] = root * (Row[i][k] + Row[k][i]); - Orientation.w = root * (Row[j][k] - Row[k][j]); - } // End if <= 0 - - return true; - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/matrix_factorisation.hpp b/3rdparty/glm/source/glm/gtx/matrix_factorisation.hpp deleted file mode 100644 index 5a975d6..0000000 --- a/3rdparty/glm/source/glm/gtx/matrix_factorisation.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/// @ref gtx_matrix_factorisation -/// @file glm/gtx/matrix_factorisation.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_matrix_factorisation GLM_GTX_matrix_factorisation -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Functions to factor matrices in various forms - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_matrix_factorisation is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_matrix_factorisation extension included") -# endif -#endif - -/* -Suggestions: - - Move helper functions flipud and fliplr to another file: They may be helpful in more general circumstances. - - Implement other types of matrix factorisation, such as: QL and LQ, L(D)U, eigendecompositions, etc... -*/ - -namespace glm -{ - /// @addtogroup gtx_matrix_factorisation - /// @{ - - /// Flips the matrix rows up and down. - /// - /// From GLM_GTX_matrix_factorisation extension. - template - GLM_FUNC_DECL mat flipud(mat const& in); - - /// Flips the matrix columns right and left. - /// - /// From GLM_GTX_matrix_factorisation extension. - template - GLM_FUNC_DECL mat fliplr(mat const& in); - - /// Performs QR factorisation of a matrix. - /// Returns 2 matrices, q and r, such that the columns of q are orthonormal and span the same subspace than those of the input matrix, r is an upper triangular matrix, and q*r=in. - /// Given an n-by-m input matrix, q has dimensions min(n,m)-by-m, and r has dimensions n-by-min(n,m). - /// - /// From GLM_GTX_matrix_factorisation extension. - template - GLM_FUNC_DECL void qr_decompose(mat const& in, mat<(C < R ? C : R), R, T, Q>& q, mat& r); - - /// Performs RQ factorisation of a matrix. - /// Returns 2 matrices, r and q, such that r is an upper triangular matrix, the rows of q are orthonormal and span the same subspace than those of the input matrix, and r*q=in. - /// Note that in the context of RQ factorisation, the diagonal is seen as starting in the lower-right corner of the matrix, instead of the usual upper-left. - /// Given an n-by-m input matrix, r has dimensions min(n,m)-by-m, and q has dimensions n-by-min(n,m). - /// - /// From GLM_GTX_matrix_factorisation extension. - template - GLM_FUNC_DECL void rq_decompose(mat const& in, mat<(C < R ? C : R), R, T, Q>& r, mat& q); - - /// @} -} - -#include "matrix_factorisation.inl" diff --git a/3rdparty/glm/source/glm/gtx/matrix_factorisation.inl b/3rdparty/glm/source/glm/gtx/matrix_factorisation.inl deleted file mode 100644 index c479b8a..0000000 --- a/3rdparty/glm/source/glm/gtx/matrix_factorisation.inl +++ /dev/null @@ -1,84 +0,0 @@ -/// @ref gtx_matrix_factorisation - -namespace glm -{ - template - GLM_FUNC_QUALIFIER mat flipud(mat const& in) - { - mat tin = transpose(in); - tin = fliplr(tin); - mat out = transpose(tin); - - return out; - } - - template - GLM_FUNC_QUALIFIER mat fliplr(mat const& in) - { - mat out; - for (length_t i = 0; i < C; i++) - { - out[i] = in[(C - i) - 1]; - } - - return out; - } - - template - GLM_FUNC_QUALIFIER void qr_decompose(mat const& in, mat<(C < R ? C : R), R, T, Q>& q, mat& r) - { - // Uses modified Gram-Schmidt method - // Source: https://en.wikipedia.org/wiki/Gram–Schmidt_process - // And https://en.wikipedia.org/wiki/QR_decomposition - - //For all the linearly independs columns of the input... - // (there can be no more linearly independents columns than there are rows.) - for (length_t i = 0; i < (C < R ? C : R); i++) - { - //Copy in Q the input's i-th column. - q[i] = in[i]; - - //j = [0,i[ - // Make that column orthogonal to all the previous ones by substracting to it the non-orthogonal projection of all the previous columns. - // Also: Fill the zero elements of R - for (length_t j = 0; j < i; j++) - { - q[i] -= dot(q[i], q[j])*q[j]; - r[j][i] = 0; - } - - //Now, Q i-th column is orthogonal to all the previous columns. Normalize it. - q[i] = normalize(q[i]); - - //j = [i,C[ - //Finally, compute the corresponding coefficients of R by computing the projection of the resulting column on the other columns of the input. - for (length_t j = i; j < C; j++) - { - r[j][i] = dot(in[j], q[i]); - } - } - } - - template - GLM_FUNC_QUALIFIER void rq_decompose(mat const& in, mat<(C < R ? C : R), R, T, Q>& r, mat& q) - { - // From https://en.wikipedia.org/wiki/QR_decomposition: - // The RQ decomposition transforms a matrix A into the product of an upper triangular matrix R (also known as right-triangular) and an orthogonal matrix Q. The only difference from QR decomposition is the order of these matrices. - // QR decomposition is Gram–Schmidt orthogonalization of columns of A, started from the first column. - // RQ decomposition is Gram–Schmidt orthogonalization of rows of A, started from the last row. - - mat tin = transpose(in); - tin = fliplr(tin); - - mat tr; - mat<(C < R ? C : R), C, T, Q> tq; - qr_decompose(tin, tq, tr); - - tr = fliplr(tr); - r = transpose(tr); - r = fliplr(r); - - tq = fliplr(tq); - q = transpose(tq); - } -} //namespace glm diff --git a/3rdparty/glm/source/glm/gtx/matrix_interpolation.hpp b/3rdparty/glm/source/glm/gtx/matrix_interpolation.hpp deleted file mode 100644 index 7d5ad4c..0000000 --- a/3rdparty/glm/source/glm/gtx/matrix_interpolation.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/// @ref gtx_matrix_interpolation -/// @file glm/gtx/matrix_interpolation.hpp -/// @author Ghenadii Ursachi (the.asteroth@gmail.com) -/// -/// @see core (dependence) -/// -/// @defgroup gtx_matrix_interpolation GLM_GTX_matrix_interpolation -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Allows to directly interpolate two matrices. - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_matrix_interpolation is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_matrix_interpolation extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_matrix_interpolation - /// @{ - - /// Get the axis and angle of the rotation from a matrix. - /// From GLM_GTX_matrix_interpolation extension. - template - GLM_FUNC_DECL void axisAngle( - mat<4, 4, T, Q> const& Mat, vec<3, T, Q> & Axis, T & Angle); - - /// Build a matrix from axis and angle. - /// From GLM_GTX_matrix_interpolation extension. - template - GLM_FUNC_DECL mat<4, 4, T, Q> axisAngleMatrix( - vec<3, T, Q> const& Axis, T const Angle); - - /// Extracts the rotation part of a matrix. - /// From GLM_GTX_matrix_interpolation extension. - template - GLM_FUNC_DECL mat<4, 4, T, Q> extractMatrixRotation( - mat<4, 4, T, Q> const& Mat); - - /// Build a interpolation of 4 * 4 matrixes. - /// From GLM_GTX_matrix_interpolation extension. - /// Warning! works only with rotation and/or translation matrixes, scale will generate unexpected results. - template - GLM_FUNC_DECL mat<4, 4, T, Q> interpolate( - mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2, T const Delta); - - /// @} -}//namespace glm - -#include "matrix_interpolation.inl" diff --git a/3rdparty/glm/source/glm/gtx/matrix_interpolation.inl b/3rdparty/glm/source/glm/gtx/matrix_interpolation.inl deleted file mode 100644 index f4ba3a6..0000000 --- a/3rdparty/glm/source/glm/gtx/matrix_interpolation.inl +++ /dev/null @@ -1,146 +0,0 @@ -/// @ref gtx_matrix_interpolation - -#include "../ext/scalar_constants.hpp" - -#include - -namespace glm -{ - template - GLM_FUNC_QUALIFIER void axisAngle(mat<4, 4, T, Q> const& m, vec<3, T, Q>& axis, T& angle) - { - T const epsilon = - std::numeric_limits::epsilon() * static_cast(1e2); - - bool const nearSymmetrical = - abs(m[1][0] - m[0][1]) < epsilon && - abs(m[2][0] - m[0][2]) < epsilon && - abs(m[2][1] - m[1][2]) < epsilon; - - if(nearSymmetrical) - { - bool const nearIdentity = - abs(m[1][0] + m[0][1]) < epsilon && - abs(m[2][0] + m[0][2]) < epsilon && - abs(m[2][1] + m[1][2]) < epsilon && - abs(m[0][0] + m[1][1] + m[2][2] - T(3.0)) < epsilon; - if (nearIdentity) - { - angle = static_cast(0.0); - axis = vec<3, T, Q>( - static_cast(1.0), static_cast(0.0), static_cast(0.0)); - return; - } - angle = pi(); - T xx = (m[0][0] + static_cast(1.0)) * static_cast(0.5); - T yy = (m[1][1] + static_cast(1.0)) * static_cast(0.5); - T zz = (m[2][2] + static_cast(1.0)) * static_cast(0.5); - T xy = (m[1][0] + m[0][1]) * static_cast(0.25); - T xz = (m[2][0] + m[0][2]) * static_cast(0.25); - T yz = (m[2][1] + m[1][2]) * static_cast(0.25); - if((xx > yy) && (xx > zz)) - { - if(xx < epsilon) - { - axis.x = static_cast(0.0); - axis.y = static_cast(0.7071); - axis.z = static_cast(0.7071); - } - else - { - axis.x = sqrt(xx); - axis.y = xy / axis.x; - axis.z = xz / axis.x; - } - } - else if (yy > zz) - { - if(yy < epsilon) - { - axis.x = static_cast(0.7071); - axis.y = static_cast(0.0); - axis.z = static_cast(0.7071); - } - else - { - axis.y = sqrt(yy); - axis.x = xy / axis.y; - axis.z = yz / axis.y; - } - } - else - { - if (zz < epsilon) - { - axis.x = static_cast(0.7071); - axis.y = static_cast(0.7071); - axis.z = static_cast(0.0); - } - else - { - axis.z = sqrt(zz); - axis.x = xz / axis.z; - axis.y = yz / axis.z; - } - } - return; - } - - T const angleCos = (m[0][0] + m[1][1] + m[2][2] - static_cast(1)) * static_cast(0.5); - if(angleCos >= static_cast(1.0)) - { - angle = static_cast(0.0); - } - else if (angleCos <= static_cast(-1.0)) - { - angle = pi(); - } - else - { - angle = acos(angleCos); - } - - axis = glm::normalize(glm::vec<3, T, Q>( - m[1][2] - m[2][1], m[2][0] - m[0][2], m[0][1] - m[1][0])); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> axisAngleMatrix(vec<3, T, Q> const& axis, T const angle) - { - T c = cos(angle); - T s = sin(angle); - T t = static_cast(1) - c; - vec<3, T, Q> n = normalize(axis); - - return mat<4, 4, T, Q>( - t * n.x * n.x + c, t * n.x * n.y + n.z * s, t * n.x * n.z - n.y * s, static_cast(0.0), - t * n.x * n.y - n.z * s, t * n.y * n.y + c, t * n.y * n.z + n.x * s, static_cast(0.0), - t * n.x * n.z + n.y * s, t * n.y * n.z - n.x * s, t * n.z * n.z + c, static_cast(0.0), - static_cast(0.0), static_cast(0.0), static_cast(0.0), static_cast(1.0)); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> extractMatrixRotation(mat<4, 4, T, Q> const& m) - { - return mat<4, 4, T, Q>( - m[0][0], m[0][1], m[0][2], static_cast(0.0), - m[1][0], m[1][1], m[1][2], static_cast(0.0), - m[2][0], m[2][1], m[2][2], static_cast(0.0), - static_cast(0.0), static_cast(0.0), static_cast(0.0), static_cast(1.0)); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> interpolate(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2, T const delta) - { - mat<4, 4, T, Q> m1rot = extractMatrixRotation(m1); - mat<4, 4, T, Q> dltRotation = m2 * transpose(m1rot); - vec<3, T, Q> dltAxis; - T dltAngle; - axisAngle(dltRotation, dltAxis, dltAngle); - mat<4, 4, T, Q> out = axisAngleMatrix(dltAxis, dltAngle * delta) * m1rot; - out[3][0] = m1[3][0] + delta * (m2[3][0] - m1[3][0]); - out[3][1] = m1[3][1] + delta * (m2[3][1] - m1[3][1]); - out[3][2] = m1[3][2] + delta * (m2[3][2] - m1[3][2]); - return out; - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/matrix_major_storage.hpp b/3rdparty/glm/source/glm/gtx/matrix_major_storage.hpp deleted file mode 100644 index 8c6bc22..0000000 --- a/3rdparty/glm/source/glm/gtx/matrix_major_storage.hpp +++ /dev/null @@ -1,119 +0,0 @@ -/// @ref gtx_matrix_major_storage -/// @file glm/gtx/matrix_major_storage.hpp -/// -/// @see core (dependence) -/// @see gtx_extented_min_max (dependence) -/// -/// @defgroup gtx_matrix_major_storage GLM_GTX_matrix_major_storage -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Build matrices with specific matrix order, row or column - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_matrix_major_storage is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_matrix_major_storage extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_matrix_major_storage - /// @{ - - //! Build a row major matrix from row vectors. - //! From GLM_GTX_matrix_major_storage extension. - template - GLM_FUNC_DECL mat<2, 2, T, Q> rowMajor2( - vec<2, T, Q> const& v1, - vec<2, T, Q> const& v2); - - //! Build a row major matrix from other matrix. - //! From GLM_GTX_matrix_major_storage extension. - template - GLM_FUNC_DECL mat<2, 2, T, Q> rowMajor2( - mat<2, 2, T, Q> const& m); - - //! Build a row major matrix from row vectors. - //! From GLM_GTX_matrix_major_storage extension. - template - GLM_FUNC_DECL mat<3, 3, T, Q> rowMajor3( - vec<3, T, Q> const& v1, - vec<3, T, Q> const& v2, - vec<3, T, Q> const& v3); - - //! Build a row major matrix from other matrix. - //! From GLM_GTX_matrix_major_storage extension. - template - GLM_FUNC_DECL mat<3, 3, T, Q> rowMajor3( - mat<3, 3, T, Q> const& m); - - //! Build a row major matrix from row vectors. - //! From GLM_GTX_matrix_major_storage extension. - template - GLM_FUNC_DECL mat<4, 4, T, Q> rowMajor4( - vec<4, T, Q> const& v1, - vec<4, T, Q> const& v2, - vec<4, T, Q> const& v3, - vec<4, T, Q> const& v4); - - //! Build a row major matrix from other matrix. - //! From GLM_GTX_matrix_major_storage extension. - template - GLM_FUNC_DECL mat<4, 4, T, Q> rowMajor4( - mat<4, 4, T, Q> const& m); - - //! Build a column major matrix from column vectors. - //! From GLM_GTX_matrix_major_storage extension. - template - GLM_FUNC_DECL mat<2, 2, T, Q> colMajor2( - vec<2, T, Q> const& v1, - vec<2, T, Q> const& v2); - - //! Build a column major matrix from other matrix. - //! From GLM_GTX_matrix_major_storage extension. - template - GLM_FUNC_DECL mat<2, 2, T, Q> colMajor2( - mat<2, 2, T, Q> const& m); - - //! Build a column major matrix from column vectors. - //! From GLM_GTX_matrix_major_storage extension. - template - GLM_FUNC_DECL mat<3, 3, T, Q> colMajor3( - vec<3, T, Q> const& v1, - vec<3, T, Q> const& v2, - vec<3, T, Q> const& v3); - - //! Build a column major matrix from other matrix. - //! From GLM_GTX_matrix_major_storage extension. - template - GLM_FUNC_DECL mat<3, 3, T, Q> colMajor3( - mat<3, 3, T, Q> const& m); - - //! Build a column major matrix from column vectors. - //! From GLM_GTX_matrix_major_storage extension. - template - GLM_FUNC_DECL mat<4, 4, T, Q> colMajor4( - vec<4, T, Q> const& v1, - vec<4, T, Q> const& v2, - vec<4, T, Q> const& v3, - vec<4, T, Q> const& v4); - - //! Build a column major matrix from other matrix. - //! From GLM_GTX_matrix_major_storage extension. - template - GLM_FUNC_DECL mat<4, 4, T, Q> colMajor4( - mat<4, 4, T, Q> const& m); - - /// @} -}//namespace glm - -#include "matrix_major_storage.inl" diff --git a/3rdparty/glm/source/glm/gtx/matrix_major_storage.inl b/3rdparty/glm/source/glm/gtx/matrix_major_storage.inl deleted file mode 100644 index 279dd34..0000000 --- a/3rdparty/glm/source/glm/gtx/matrix_major_storage.inl +++ /dev/null @@ -1,166 +0,0 @@ -/// @ref gtx_matrix_major_storage - -namespace glm -{ - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> rowMajor2 - ( - vec<2, T, Q> const& v1, - vec<2, T, Q> const& v2 - ) - { - mat<2, 2, T, Q> Result; - Result[0][0] = v1.x; - Result[1][0] = v1.y; - Result[0][1] = v2.x; - Result[1][1] = v2.y; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> rowMajor2( - const mat<2, 2, T, Q>& m) - { - mat<2, 2, T, Q> Result; - Result[0][0] = m[0][0]; - Result[0][1] = m[1][0]; - Result[1][0] = m[0][1]; - Result[1][1] = m[1][1]; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> rowMajor3( - const vec<3, T, Q>& v1, - const vec<3, T, Q>& v2, - const vec<3, T, Q>& v3) - { - mat<3, 3, T, Q> Result; - Result[0][0] = v1.x; - Result[1][0] = v1.y; - Result[2][0] = v1.z; - Result[0][1] = v2.x; - Result[1][1] = v2.y; - Result[2][1] = v2.z; - Result[0][2] = v3.x; - Result[1][2] = v3.y; - Result[2][2] = v3.z; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> rowMajor3( - const mat<3, 3, T, Q>& m) - { - mat<3, 3, T, Q> Result; - Result[0][0] = m[0][0]; - Result[0][1] = m[1][0]; - Result[0][2] = m[2][0]; - Result[1][0] = m[0][1]; - Result[1][1] = m[1][1]; - Result[1][2] = m[2][1]; - Result[2][0] = m[0][2]; - Result[2][1] = m[1][2]; - Result[2][2] = m[2][2]; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rowMajor4( - const vec<4, T, Q>& v1, - const vec<4, T, Q>& v2, - const vec<4, T, Q>& v3, - const vec<4, T, Q>& v4) - { - mat<4, 4, T, Q> Result; - Result[0][0] = v1.x; - Result[1][0] = v1.y; - Result[2][0] = v1.z; - Result[3][0] = v1.w; - Result[0][1] = v2.x; - Result[1][1] = v2.y; - Result[2][1] = v2.z; - Result[3][1] = v2.w; - Result[0][2] = v3.x; - Result[1][2] = v3.y; - Result[2][2] = v3.z; - Result[3][2] = v3.w; - Result[0][3] = v4.x; - Result[1][3] = v4.y; - Result[2][3] = v4.z; - Result[3][3] = v4.w; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rowMajor4( - const mat<4, 4, T, Q>& m) - { - mat<4, 4, T, Q> Result; - Result[0][0] = m[0][0]; - Result[0][1] = m[1][0]; - Result[0][2] = m[2][0]; - Result[0][3] = m[3][0]; - Result[1][0] = m[0][1]; - Result[1][1] = m[1][1]; - Result[1][2] = m[2][1]; - Result[1][3] = m[3][1]; - Result[2][0] = m[0][2]; - Result[2][1] = m[1][2]; - Result[2][2] = m[2][2]; - Result[2][3] = m[3][2]; - Result[3][0] = m[0][3]; - Result[3][1] = m[1][3]; - Result[3][2] = m[2][3]; - Result[3][3] = m[3][3]; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> colMajor2( - const vec<2, T, Q>& v1, - const vec<2, T, Q>& v2) - { - return mat<2, 2, T, Q>(v1, v2); - } - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> colMajor2( - const mat<2, 2, T, Q>& m) - { - return mat<2, 2, T, Q>(m); - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> colMajor3( - const vec<3, T, Q>& v1, - const vec<3, T, Q>& v2, - const vec<3, T, Q>& v3) - { - return mat<3, 3, T, Q>(v1, v2, v3); - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> colMajor3( - const mat<3, 3, T, Q>& m) - { - return mat<3, 3, T, Q>(m); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> colMajor4( - const vec<4, T, Q>& v1, - const vec<4, T, Q>& v2, - const vec<4, T, Q>& v3, - const vec<4, T, Q>& v4) - { - return mat<4, 4, T, Q>(v1, v2, v3, v4); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> colMajor4( - const mat<4, 4, T, Q>& m) - { - return mat<4, 4, T, Q>(m); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/matrix_operation.hpp b/3rdparty/glm/source/glm/gtx/matrix_operation.hpp deleted file mode 100644 index de6ff1f..0000000 --- a/3rdparty/glm/source/glm/gtx/matrix_operation.hpp +++ /dev/null @@ -1,103 +0,0 @@ -/// @ref gtx_matrix_operation -/// @file glm/gtx/matrix_operation.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_matrix_operation GLM_GTX_matrix_operation -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Build diagonal matrices from vectors. - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_matrix_operation is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_matrix_operation extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_matrix_operation - /// @{ - - //! Build a diagonal matrix. - //! From GLM_GTX_matrix_operation extension. - template - GLM_FUNC_DECL mat<2, 2, T, Q> diagonal2x2( - vec<2, T, Q> const& v); - - //! Build a diagonal matrix. - //! From GLM_GTX_matrix_operation extension. - template - GLM_FUNC_DECL mat<2, 3, T, Q> diagonal2x3( - vec<2, T, Q> const& v); - - //! Build a diagonal matrix. - //! From GLM_GTX_matrix_operation extension. - template - GLM_FUNC_DECL mat<2, 4, T, Q> diagonal2x4( - vec<2, T, Q> const& v); - - //! Build a diagonal matrix. - //! From GLM_GTX_matrix_operation extension. - template - GLM_FUNC_DECL mat<3, 2, T, Q> diagonal3x2( - vec<2, T, Q> const& v); - - //! Build a diagonal matrix. - //! From GLM_GTX_matrix_operation extension. - template - GLM_FUNC_DECL mat<3, 3, T, Q> diagonal3x3( - vec<3, T, Q> const& v); - - //! Build a diagonal matrix. - //! From GLM_GTX_matrix_operation extension. - template - GLM_FUNC_DECL mat<3, 4, T, Q> diagonal3x4( - vec<3, T, Q> const& v); - - //! Build a diagonal matrix. - //! From GLM_GTX_matrix_operation extension. - template - GLM_FUNC_DECL mat<4, 2, T, Q> diagonal4x2( - vec<2, T, Q> const& v); - - //! Build a diagonal matrix. - //! From GLM_GTX_matrix_operation extension. - template - GLM_FUNC_DECL mat<4, 3, T, Q> diagonal4x3( - vec<3, T, Q> const& v); - - //! Build a diagonal matrix. - //! From GLM_GTX_matrix_operation extension. - template - GLM_FUNC_DECL mat<4, 4, T, Q> diagonal4x4( - vec<4, T, Q> const& v); - - /// Build an adjugate matrix. - /// From GLM_GTX_matrix_operation extension. - template - GLM_FUNC_DECL mat<2, 2, T, Q> adjugate(mat<2, 2, T, Q> const& m); - - /// Build an adjugate matrix. - /// From GLM_GTX_matrix_operation extension. - template - GLM_FUNC_DECL mat<3, 3, T, Q> adjugate(mat<3, 3, T, Q> const& m); - - /// Build an adjugate matrix. - /// From GLM_GTX_matrix_operation extension. - template - GLM_FUNC_DECL mat<4, 4, T, Q> adjugate(mat<4, 4, T, Q> const& m); - - /// @} -}//namespace glm - -#include "matrix_operation.inl" diff --git a/3rdparty/glm/source/glm/gtx/matrix_operation.inl b/3rdparty/glm/source/glm/gtx/matrix_operation.inl deleted file mode 100644 index a4f4a85..0000000 --- a/3rdparty/glm/source/glm/gtx/matrix_operation.inl +++ /dev/null @@ -1,176 +0,0 @@ -/// @ref gtx_matrix_operation - -namespace glm -{ - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> diagonal2x2 - ( - vec<2, T, Q> const& v - ) - { - mat<2, 2, T, Q> Result(static_cast(1)); - Result[0][0] = v[0]; - Result[1][1] = v[1]; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<2, 3, T, Q> diagonal2x3 - ( - vec<2, T, Q> const& v - ) - { - mat<2, 3, T, Q> Result(static_cast(1)); - Result[0][0] = v[0]; - Result[1][1] = v[1]; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<2, 4, T, Q> diagonal2x4 - ( - vec<2, T, Q> const& v - ) - { - mat<2, 4, T, Q> Result(static_cast(1)); - Result[0][0] = v[0]; - Result[1][1] = v[1]; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<3, 2, T, Q> diagonal3x2 - ( - vec<2, T, Q> const& v - ) - { - mat<3, 2, T, Q> Result(static_cast(1)); - Result[0][0] = v[0]; - Result[1][1] = v[1]; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> diagonal3x3 - ( - vec<3, T, Q> const& v - ) - { - mat<3, 3, T, Q> Result(static_cast(1)); - Result[0][0] = v[0]; - Result[1][1] = v[1]; - Result[2][2] = v[2]; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<3, 4, T, Q> diagonal3x4 - ( - vec<3, T, Q> const& v - ) - { - mat<3, 4, T, Q> Result(static_cast(1)); - Result[0][0] = v[0]; - Result[1][1] = v[1]; - Result[2][2] = v[2]; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> diagonal4x4 - ( - vec<4, T, Q> const& v - ) - { - mat<4, 4, T, Q> Result(static_cast(1)); - Result[0][0] = v[0]; - Result[1][1] = v[1]; - Result[2][2] = v[2]; - Result[3][3] = v[3]; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 3, T, Q> diagonal4x3 - ( - vec<3, T, Q> const& v - ) - { - mat<4, 3, T, Q> Result(static_cast(1)); - Result[0][0] = v[0]; - Result[1][1] = v[1]; - Result[2][2] = v[2]; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 2, T, Q> diagonal4x2 - ( - vec<2, T, Q> const& v - ) - { - mat<4, 2, T, Q> Result(static_cast(1)); - Result[0][0] = v[0]; - Result[1][1] = v[1]; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<2, 2, T, Q> adjugate(mat<2, 2, T, Q> const& m) - { - return mat<2, 2, T, Q>( - +m[1][1], -m[0][1], - -m[1][0], +m[0][0]); - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> adjugate(mat<3, 3, T, Q> const& m) - { - T const m00 = determinant(mat<2, 2, T, Q>(m[1][1], m[2][1], m[1][2], m[2][2])); - T const m01 = determinant(mat<2, 2, T, Q>(m[0][1], m[2][1], m[0][2], m[2][2])); - T const m02 = determinant(mat<2, 2, T, Q>(m[0][1], m[1][1], m[0][2], m[1][2])); - - T const m10 = determinant(mat<2, 2, T, Q>(m[1][0], m[2][0], m[1][2], m[2][2])); - T const m11 = determinant(mat<2, 2, T, Q>(m[0][0], m[2][0], m[0][2], m[2][2])); - T const m12 = determinant(mat<2, 2, T, Q>(m[0][0], m[1][0], m[0][2], m[1][2])); - - T const m20 = determinant(mat<2, 2, T, Q>(m[1][0], m[2][0], m[1][1], m[2][1])); - T const m21 = determinant(mat<2, 2, T, Q>(m[0][0], m[2][0], m[0][1], m[2][1])); - T const m22 = determinant(mat<2, 2, T, Q>(m[0][0], m[1][0], m[0][1], m[1][1])); - - return mat<3, 3, T, Q>( - +m00, -m01, +m02, - -m10, +m11, -m12, - +m20, -m21, +m22); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> adjugate(mat<4, 4, T, Q> const& m) - { - T const m00 = determinant(mat<3, 3, T, Q>(m[1][1], m[1][2], m[1][3], m[2][1], m[2][2], m[2][3], m[3][1], m[3][2], m[3][3])); - T const m01 = determinant(mat<3, 3, T, Q>(m[1][0], m[1][2], m[1][3], m[2][0], m[2][2], m[2][3], m[3][0], m[3][2], m[3][3])); - T const m02 = determinant(mat<3, 3, T, Q>(m[1][0], m[1][1], m[1][3], m[2][0], m[2][1], m[2][3], m[3][0], m[3][1], m[3][3])); - T const m03 = determinant(mat<3, 3, T, Q>(m[1][0], m[1][1], m[1][2], m[2][0], m[2][1], m[2][2], m[3][0], m[3][1], m[3][2])); - - T const m10 = determinant(mat<3, 3, T, Q>(m[0][1], m[0][2], m[0][3], m[2][1], m[2][2], m[2][3], m[3][1], m[3][2], m[3][3])); - T const m11 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][2], m[0][3], m[2][0], m[2][2], m[2][3], m[3][0], m[3][2], m[3][3])); - T const m12 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][1], m[0][3], m[2][0], m[2][1], m[2][3], m[3][0], m[3][1], m[3][3])); - T const m13 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][1], m[0][2], m[2][0], m[2][1], m[2][2], m[3][0], m[3][1], m[3][2])); - - T const m20 = determinant(mat<3, 3, T, Q>(m[0][1], m[0][2], m[0][3], m[1][1], m[1][2], m[1][3], m[3][1], m[3][2], m[3][3])); - T const m21 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][2], m[0][3], m[1][0], m[1][2], m[1][3], m[3][0], m[3][2], m[3][3])); - T const m22 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][1], m[0][3], m[1][0], m[1][1], m[1][3], m[3][0], m[3][1], m[3][3])); - T const m23 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][1], m[0][2], m[1][0], m[1][1], m[1][2], m[3][0], m[3][1], m[3][2])); - - T const m30 = determinant(mat<3, 3, T, Q>(m[0][1], m[0][2], m[0][3], m[1][1], m[1][2], m[1][3], m[2][1], m[2][2], m[2][3])); - T const m31 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][2], m[0][3], m[1][0], m[1][2], m[1][3], m[2][0], m[2][2], m[2][3])); - T const m32 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][1], m[0][3], m[1][0], m[1][1], m[1][3], m[2][0], m[2][1], m[2][3])); - T const m33 = determinant(mat<3, 3, T, Q>(m[0][0], m[0][1], m[0][2], m[1][0], m[1][1], m[1][2], m[2][0], m[2][1], m[2][2])); - - return mat<4, 4, T, Q>( - +m00, -m10, +m20, -m30, - -m01, +m11, -m21, +m31, - +m02, -m12, +m22, -m32, - -m03, +m13, -m23, +m33); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/matrix_query.hpp b/3rdparty/glm/source/glm/gtx/matrix_query.hpp deleted file mode 100644 index 8011b2b..0000000 --- a/3rdparty/glm/source/glm/gtx/matrix_query.hpp +++ /dev/null @@ -1,77 +0,0 @@ -/// @ref gtx_matrix_query -/// @file glm/gtx/matrix_query.hpp -/// -/// @see core (dependence) -/// @see gtx_vector_query (dependence) -/// -/// @defgroup gtx_matrix_query GLM_GTX_matrix_query -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Query to evaluate matrix properties - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtx/vector_query.hpp" -#include - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_matrix_query is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_matrix_query extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_matrix_query - /// @{ - - /// Return whether a matrix a null matrix. - /// From GLM_GTX_matrix_query extension. - template - GLM_FUNC_DECL bool isNull(mat<2, 2, T, Q> const& m, T const& epsilon); - - /// Return whether a matrix a null matrix. - /// From GLM_GTX_matrix_query extension. - template - GLM_FUNC_DECL bool isNull(mat<3, 3, T, Q> const& m, T const& epsilon); - - /// Return whether a matrix is a null matrix. - /// From GLM_GTX_matrix_query extension. - template - GLM_FUNC_DECL bool isNull(mat<4, 4, T, Q> const& m, T const& epsilon); - - /// Return whether a matrix is an identity matrix. - /// From GLM_GTX_matrix_query extension. - template class matType> - GLM_FUNC_DECL bool isIdentity(matType const& m, T const& epsilon); - - /// Return whether a matrix is a normalized matrix. - /// From GLM_GTX_matrix_query extension. - template - GLM_FUNC_DECL bool isNormalized(mat<2, 2, T, Q> const& m, T const& epsilon); - - /// Return whether a matrix is a normalized matrix. - /// From GLM_GTX_matrix_query extension. - template - GLM_FUNC_DECL bool isNormalized(mat<3, 3, T, Q> const& m, T const& epsilon); - - /// Return whether a matrix is a normalized matrix. - /// From GLM_GTX_matrix_query extension. - template - GLM_FUNC_DECL bool isNormalized(mat<4, 4, T, Q> const& m, T const& epsilon); - - /// Return whether a matrix is an orthonormalized matrix. - /// From GLM_GTX_matrix_query extension. - template class matType> - GLM_FUNC_DECL bool isOrthogonal(matType const& m, T const& epsilon); - - /// @} -}//namespace glm - -#include "matrix_query.inl" diff --git a/3rdparty/glm/source/glm/gtx/matrix_query.inl b/3rdparty/glm/source/glm/gtx/matrix_query.inl deleted file mode 100644 index b763c1a..0000000 --- a/3rdparty/glm/source/glm/gtx/matrix_query.inl +++ /dev/null @@ -1,113 +0,0 @@ -/// @ref gtx_matrix_query - -namespace glm -{ - template - GLM_FUNC_QUALIFIER bool isNull(mat<2, 2, T, Q> const& m, T const& epsilon) - { - bool result = true; - for(length_t i = 0; result && i < m.length() ; ++i) - result = isNull(m[i], epsilon); - return result; - } - - template - GLM_FUNC_QUALIFIER bool isNull(mat<3, 3, T, Q> const& m, T const& epsilon) - { - bool result = true; - for(length_t i = 0; result && i < m.length() ; ++i) - result = isNull(m[i], epsilon); - return result; - } - - template - GLM_FUNC_QUALIFIER bool isNull(mat<4, 4, T, Q> const& m, T const& epsilon) - { - bool result = true; - for(length_t i = 0; result && i < m.length() ; ++i) - result = isNull(m[i], epsilon); - return result; - } - - template - GLM_FUNC_QUALIFIER bool isIdentity(mat const& m, T const& epsilon) - { - bool result = true; - for(length_t i = 0; result && i < m.length(); ++i) - { - for(length_t j = 0; result && j < glm::min(i, m[0].length()); ++j) - result = abs(m[i][j]) <= epsilon; - if(result && i < m[0].length()) - result = abs(m[i][i] - 1) <= epsilon; - for(length_t j = i + 1; result && j < m[0].length(); ++j) - result = abs(m[i][j]) <= epsilon; - } - return result; - } - - template - GLM_FUNC_QUALIFIER bool isNormalized(mat<2, 2, T, Q> const& m, T const& epsilon) - { - bool result(true); - for(length_t i = 0; result && i < m.length(); ++i) - result = isNormalized(m[i], epsilon); - for(length_t i = 0; result && i < m.length(); ++i) - { - typename mat<2, 2, T, Q>::col_type v; - for(length_t j = 0; j < m.length(); ++j) - v[j] = m[j][i]; - result = isNormalized(v, epsilon); - } - return result; - } - - template - GLM_FUNC_QUALIFIER bool isNormalized(mat<3, 3, T, Q> const& m, T const& epsilon) - { - bool result(true); - for(length_t i = 0; result && i < m.length(); ++i) - result = isNormalized(m[i], epsilon); - for(length_t i = 0; result && i < m.length(); ++i) - { - typename mat<3, 3, T, Q>::col_type v; - for(length_t j = 0; j < m.length(); ++j) - v[j] = m[j][i]; - result = isNormalized(v, epsilon); - } - return result; - } - - template - GLM_FUNC_QUALIFIER bool isNormalized(mat<4, 4, T, Q> const& m, T const& epsilon) - { - bool result(true); - for(length_t i = 0; result && i < m.length(); ++i) - result = isNormalized(m[i], epsilon); - for(length_t i = 0; result && i < m.length(); ++i) - { - typename mat<4, 4, T, Q>::col_type v; - for(length_t j = 0; j < m.length(); ++j) - v[j] = m[j][i]; - result = isNormalized(v, epsilon); - } - return result; - } - - template - GLM_FUNC_QUALIFIER bool isOrthogonal(mat const& m, T const& epsilon) - { - bool result = true; - for(length_t i(0); result && i < m.length() - 1; ++i) - for(length_t j(i + 1); result && j < m.length(); ++j) - result = areOrthogonal(m[i], m[j], epsilon); - - if(result) - { - mat tmp = transpose(m); - for(length_t i(0); result && i < m.length() - 1 ; ++i) - for(length_t j(i + 1); result && j < m.length(); ++j) - result = areOrthogonal(tmp[i], tmp[j], epsilon); - } - return result; - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/matrix_transform_2d.hpp b/3rdparty/glm/source/glm/gtx/matrix_transform_2d.hpp deleted file mode 100644 index 5f9c540..0000000 --- a/3rdparty/glm/source/glm/gtx/matrix_transform_2d.hpp +++ /dev/null @@ -1,81 +0,0 @@ -/// @ref gtx_matrix_transform_2d -/// @file glm/gtx/matrix_transform_2d.hpp -/// @author Miguel Ãngel Pérez Martínez -/// -/// @see core (dependence) -/// -/// @defgroup gtx_matrix_transform_2d GLM_GTX_matrix_transform_2d -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Defines functions that generate common 2d transformation matrices. - -#pragma once - -// Dependency: -#include "../mat3x3.hpp" -#include "../vec2.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_matrix_transform_2d is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_matrix_transform_2d extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_matrix_transform_2d - /// @{ - - /// Builds a translation 3 * 3 matrix created from a vector of 2 components. - /// - /// @param m Input matrix multiplied by this translation matrix. - /// @param v Coordinates of a translation vector. - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> translate( - mat<3, 3, T, Q> const& m, - vec<2, T, Q> const& v); - - /// Builds a rotation 3 * 3 matrix created from an angle. - /// - /// @param m Input matrix multiplied by this translation matrix. - /// @param angle Rotation angle expressed in radians. - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> rotate( - mat<3, 3, T, Q> const& m, - T angle); - - /// Builds a scale 3 * 3 matrix created from a vector of 2 components. - /// - /// @param m Input matrix multiplied by this translation matrix. - /// @param v Coordinates of a scale vector. - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> scale( - mat<3, 3, T, Q> const& m, - vec<2, T, Q> const& v); - - /// Builds an horizontal (parallel to the x axis) shear 3 * 3 matrix. - /// - /// @param m Input matrix multiplied by this translation matrix. - /// @param y Shear factor. - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> shearX( - mat<3, 3, T, Q> const& m, - T y); - - /// Builds a vertical (parallel to the y axis) shear 3 * 3 matrix. - /// - /// @param m Input matrix multiplied by this translation matrix. - /// @param x Shear factor. - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> shearY( - mat<3, 3, T, Q> const& m, - T x); - - /// @} -}//namespace glm - -#include "matrix_transform_2d.inl" diff --git a/3rdparty/glm/source/glm/gtx/matrix_transform_2d.inl b/3rdparty/glm/source/glm/gtx/matrix_transform_2d.inl deleted file mode 100644 index a68d24d..0000000 --- a/3rdparty/glm/source/glm/gtx/matrix_transform_2d.inl +++ /dev/null @@ -1,68 +0,0 @@ -/// @ref gtx_matrix_transform_2d -/// @author Miguel Ãngel Pérez Martínez - -#include "../trigonometric.hpp" - -namespace glm -{ - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> translate( - mat<3, 3, T, Q> const& m, - vec<2, T, Q> const& v) - { - mat<3, 3, T, Q> Result(m); - Result[2] = m[0] * v[0] + m[1] * v[1] + m[2]; - return Result; - } - - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> rotate( - mat<3, 3, T, Q> const& m, - T angle) - { - T const a = angle; - T const c = cos(a); - T const s = sin(a); - - mat<3, 3, T, Q> Result; - Result[0] = m[0] * c + m[1] * s; - Result[1] = m[0] * -s + m[1] * c; - Result[2] = m[2]; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> scale( - mat<3, 3, T, Q> const& m, - vec<2, T, Q> const& v) - { - mat<3, 3, T, Q> Result; - Result[0] = m[0] * v[0]; - Result[1] = m[1] * v[1]; - Result[2] = m[2]; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> shearX( - mat<3, 3, T, Q> const& m, - T y) - { - mat<3, 3, T, Q> Result(1); - Result[0][1] = y; - return m * Result; - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> shearY( - mat<3, 3, T, Q> const& m, - T x) - { - mat<3, 3, T, Q> Result(1); - Result[1][0] = x; - return m * Result; - } - -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/mixed_product.hpp b/3rdparty/glm/source/glm/gtx/mixed_product.hpp deleted file mode 100644 index b242e35..0000000 --- a/3rdparty/glm/source/glm/gtx/mixed_product.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/// @ref gtx_mixed_product -/// @file glm/gtx/mixed_product.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_mixed_product GLM_GTX_mixed_producte -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Mixed product of 3 vectors. - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_mixed_product is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_mixed_product extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_mixed_product - /// @{ - - /// @brief Mixed product of 3 vectors (from GLM_GTX_mixed_product extension) - template - GLM_FUNC_DECL T mixedProduct( - vec<3, T, Q> const& v1, - vec<3, T, Q> const& v2, - vec<3, T, Q> const& v3); - - /// @} -}// namespace glm - -#include "mixed_product.inl" diff --git a/3rdparty/glm/source/glm/gtx/mixed_product.inl b/3rdparty/glm/source/glm/gtx/mixed_product.inl deleted file mode 100644 index e5cdbdb..0000000 --- a/3rdparty/glm/source/glm/gtx/mixed_product.inl +++ /dev/null @@ -1,15 +0,0 @@ -/// @ref gtx_mixed_product - -namespace glm -{ - template - GLM_FUNC_QUALIFIER T mixedProduct - ( - vec<3, T, Q> const& v1, - vec<3, T, Q> const& v2, - vec<3, T, Q> const& v3 - ) - { - return dot(cross(v1, v2), v3); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/norm.hpp b/3rdparty/glm/source/glm/gtx/norm.hpp deleted file mode 100644 index dfaebb7..0000000 --- a/3rdparty/glm/source/glm/gtx/norm.hpp +++ /dev/null @@ -1,88 +0,0 @@ -/// @ref gtx_norm -/// @file glm/gtx/norm.hpp -/// -/// @see core (dependence) -/// @see gtx_quaternion (dependence) -/// @see gtx_component_wise (dependence) -/// -/// @defgroup gtx_norm GLM_GTX_norm -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Various ways to compute vector norms. - -#pragma once - -// Dependency: -#include "../geometric.hpp" -#include "../gtx/quaternion.hpp" -#include "../gtx/component_wise.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_norm is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_norm extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_norm - /// @{ - - /// Returns the squared length of x. - /// From GLM_GTX_norm extension. - template - GLM_FUNC_DECL T length2(vec const& x); - - /// Returns the squared distance between p0 and p1, i.e., length2(p0 - p1). - /// From GLM_GTX_norm extension. - template - GLM_FUNC_DECL T distance2(vec const& p0, vec const& p1); - - //! Returns the L1 norm between x and y. - //! From GLM_GTX_norm extension. - template - GLM_FUNC_DECL T l1Norm(vec<3, T, Q> const& x, vec<3, T, Q> const& y); - - //! Returns the L1 norm of v. - //! From GLM_GTX_norm extension. - template - GLM_FUNC_DECL T l1Norm(vec<3, T, Q> const& v); - - //! Returns the L2 norm between x and y. - //! From GLM_GTX_norm extension. - template - GLM_FUNC_DECL T l2Norm(vec<3, T, Q> const& x, vec<3, T, Q> const& y); - - //! Returns the L2 norm of v. - //! From GLM_GTX_norm extension. - template - GLM_FUNC_DECL T l2Norm(vec<3, T, Q> const& x); - - //! Returns the L norm between x and y. - //! From GLM_GTX_norm extension. - template - GLM_FUNC_DECL T lxNorm(vec<3, T, Q> const& x, vec<3, T, Q> const& y, unsigned int Depth); - - //! Returns the L norm of v. - //! From GLM_GTX_norm extension. - template - GLM_FUNC_DECL T lxNorm(vec<3, T, Q> const& x, unsigned int Depth); - - //! Returns the LMax norm between x and y. - //! From GLM_GTX_norm extension. - template - GLM_FUNC_DECL T lMaxNorm(vec<3, T, Q> const& x, vec<3, T, Q> const& y); - - //! Returns the LMax norm of v. - //! From GLM_GTX_norm extension. - template - GLM_FUNC_DECL T lMaxNorm(vec<3, T, Q> const& x); - - /// @} -}//namespace glm - -#include "norm.inl" diff --git a/3rdparty/glm/source/glm/gtx/norm.inl b/3rdparty/glm/source/glm/gtx/norm.inl deleted file mode 100644 index 6db561b..0000000 --- a/3rdparty/glm/source/glm/gtx/norm.inl +++ /dev/null @@ -1,95 +0,0 @@ -/// @ref gtx_norm - -#include "../detail/qualifier.hpp" - -namespace glm{ -namespace detail -{ - template - struct compute_length2 - { - GLM_FUNC_QUALIFIER static T call(vec const& v) - { - return dot(v, v); - } - }; -}//namespace detail - - template - GLM_FUNC_QUALIFIER genType length2(genType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'length2' accepts only floating-point inputs"); - return x * x; - } - - template - GLM_FUNC_QUALIFIER T length2(vec const& v) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'length2' accepts only floating-point inputs"); - return detail::compute_length2::value>::call(v); - } - - template - GLM_FUNC_QUALIFIER T distance2(T p0, T p1) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'distance2' accepts only floating-point inputs"); - return length2(p1 - p0); - } - - template - GLM_FUNC_QUALIFIER T distance2(vec const& p0, vec const& p1) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'distance2' accepts only floating-point inputs"); - return length2(p1 - p0); - } - - template - GLM_FUNC_QUALIFIER T l1Norm(vec<3, T, Q> const& a, vec<3, T, Q> const& b) - { - return abs(b.x - a.x) + abs(b.y - a.y) + abs(b.z - a.z); - } - - template - GLM_FUNC_QUALIFIER T l1Norm(vec<3, T, Q> const& v) - { - return abs(v.x) + abs(v.y) + abs(v.z); - } - - template - GLM_FUNC_QUALIFIER T l2Norm(vec<3, T, Q> const& a, vec<3, T, Q> const& b - ) - { - return length(b - a); - } - - template - GLM_FUNC_QUALIFIER T l2Norm(vec<3, T, Q> const& v) - { - return length(v); - } - - template - GLM_FUNC_QUALIFIER T lxNorm(vec<3, T, Q> const& x, vec<3, T, Q> const& y, unsigned int Depth) - { - return pow(pow(abs(y.x - x.x), T(Depth)) + pow(abs(y.y - x.y), T(Depth)) + pow(abs(y.z - x.z), T(Depth)), T(1) / T(Depth)); - } - - template - GLM_FUNC_QUALIFIER T lxNorm(vec<3, T, Q> const& v, unsigned int Depth) - { - return pow(pow(abs(v.x), T(Depth)) + pow(abs(v.y), T(Depth)) + pow(abs(v.z), T(Depth)), T(1) / T(Depth)); - } - - template - GLM_FUNC_QUALIFIER T lMaxNorm(vec<3, T, Q> const& a, vec<3, T, Q> const& b) - { - return compMax(abs(b - a)); - } - - template - GLM_FUNC_QUALIFIER T lMaxNorm(vec<3, T, Q> const& v) - { - return compMax(abs(v)); - } - -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/normal.hpp b/3rdparty/glm/source/glm/gtx/normal.hpp deleted file mode 100644 index 068682f..0000000 --- a/3rdparty/glm/source/glm/gtx/normal.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/// @ref gtx_normal -/// @file glm/gtx/normal.hpp -/// -/// @see core (dependence) -/// @see gtx_extented_min_max (dependence) -/// -/// @defgroup gtx_normal GLM_GTX_normal -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Compute the normal of a triangle. - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_normal is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_normal extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_normal - /// @{ - - /// Computes triangle normal from triangle points. - /// - /// @see gtx_normal - template - GLM_FUNC_DECL vec<3, T, Q> triangleNormal(vec<3, T, Q> const& p1, vec<3, T, Q> const& p2, vec<3, T, Q> const& p3); - - /// @} -}//namespace glm - -#include "normal.inl" diff --git a/3rdparty/glm/source/glm/gtx/normal.inl b/3rdparty/glm/source/glm/gtx/normal.inl deleted file mode 100644 index 74f9fc9..0000000 --- a/3rdparty/glm/source/glm/gtx/normal.inl +++ /dev/null @@ -1,15 +0,0 @@ -/// @ref gtx_normal - -namespace glm -{ - template - GLM_FUNC_QUALIFIER vec<3, T, Q> triangleNormal - ( - vec<3, T, Q> const& p1, - vec<3, T, Q> const& p2, - vec<3, T, Q> const& p3 - ) - { - return normalize(cross(p1 - p2, p1 - p3)); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/normalize_dot.hpp b/3rdparty/glm/source/glm/gtx/normalize_dot.hpp deleted file mode 100644 index 5195802..0000000 --- a/3rdparty/glm/source/glm/gtx/normalize_dot.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref gtx_normalize_dot -/// @file glm/gtx/normalize_dot.hpp -/// -/// @see core (dependence) -/// @see gtx_fast_square_root (dependence) -/// -/// @defgroup gtx_normalize_dot GLM_GTX_normalize_dot -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Dot product of vectors that need to be normalize with a single square root. - -#pragma once - -// Dependency: -#include "../gtx/fast_square_root.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_normalize_dot is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_normalize_dot extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_normalize_dot - /// @{ - - /// Normalize parameters and returns the dot product of x and y. - /// It's faster that dot(normalize(x), normalize(y)). - /// - /// @see gtx_normalize_dot extension. - template - GLM_FUNC_DECL T normalizeDot(vec const& x, vec const& y); - - /// Normalize parameters and returns the dot product of x and y. - /// Faster that dot(fastNormalize(x), fastNormalize(y)). - /// - /// @see gtx_normalize_dot extension. - template - GLM_FUNC_DECL T fastNormalizeDot(vec const& x, vec const& y); - - /// @} -}//namespace glm - -#include "normalize_dot.inl" diff --git a/3rdparty/glm/source/glm/gtx/normalize_dot.inl b/3rdparty/glm/source/glm/gtx/normalize_dot.inl deleted file mode 100644 index 7bcd9a5..0000000 --- a/3rdparty/glm/source/glm/gtx/normalize_dot.inl +++ /dev/null @@ -1,16 +0,0 @@ -/// @ref gtx_normalize_dot - -namespace glm -{ - template - GLM_FUNC_QUALIFIER T normalizeDot(vec const& x, vec const& y) - { - return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); - } - - template - GLM_FUNC_QUALIFIER T fastNormalizeDot(vec const& x, vec const& y) - { - return glm::dot(x, y) * glm::fastInverseSqrt(glm::dot(x, x) * glm::dot(y, y)); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/number_precision.hpp b/3rdparty/glm/source/glm/gtx/number_precision.hpp deleted file mode 100644 index 3a606bd..0000000 --- a/3rdparty/glm/source/glm/gtx/number_precision.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/// @ref gtx_number_precision -/// @file glm/gtx/number_precision.hpp -/// -/// @see core (dependence) -/// @see gtc_type_precision (dependence) -/// @see gtc_quaternion (dependence) -/// -/// @defgroup gtx_number_precision GLM_GTX_number_precision -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Defined size types. - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtc/type_precision.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_number_precision is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_number_precision extension included") -# endif -#endif - -namespace glm{ -namespace gtx -{ - ///////////////////////////// - // Unsigned int vector types - - /// @addtogroup gtx_number_precision - /// @{ - - typedef u8 u8vec1; //!< \brief 8bit unsigned integer scalar. (from GLM_GTX_number_precision extension) - typedef u16 u16vec1; //!< \brief 16bit unsigned integer scalar. (from GLM_GTX_number_precision extension) - typedef u32 u32vec1; //!< \brief 32bit unsigned integer scalar. (from GLM_GTX_number_precision extension) - typedef u64 u64vec1; //!< \brief 64bit unsigned integer scalar. (from GLM_GTX_number_precision extension) - - ////////////////////// - // Float vector types - - typedef f32 f32vec1; //!< \brief Single-qualifier floating-point scalar. (from GLM_GTX_number_precision extension) - typedef f64 f64vec1; //!< \brief Single-qualifier floating-point scalar. (from GLM_GTX_number_precision extension) - - ////////////////////// - // Float matrix types - - typedef f32 f32mat1; //!< \brief Single-qualifier floating-point scalar. (from GLM_GTX_number_precision extension) - typedef f32 f32mat1x1; //!< \brief Single-qualifier floating-point scalar. (from GLM_GTX_number_precision extension) - typedef f64 f64mat1; //!< \brief Double-qualifier floating-point scalar. (from GLM_GTX_number_precision extension) - typedef f64 f64mat1x1; //!< \brief Double-qualifier floating-point scalar. (from GLM_GTX_number_precision extension) - - /// @} -}//namespace gtx -}//namespace glm - -#include "number_precision.inl" diff --git a/3rdparty/glm/source/glm/gtx/number_precision.inl b/3rdparty/glm/source/glm/gtx/number_precision.inl deleted file mode 100644 index b39d71c..0000000 --- a/3rdparty/glm/source/glm/gtx/number_precision.inl +++ /dev/null @@ -1,6 +0,0 @@ -/// @ref gtx_number_precision - -namespace glm -{ - -} diff --git a/3rdparty/glm/source/glm/gtx/optimum_pow.hpp b/3rdparty/glm/source/glm/gtx/optimum_pow.hpp deleted file mode 100644 index 9284a47..0000000 --- a/3rdparty/glm/source/glm/gtx/optimum_pow.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/// @ref gtx_optimum_pow -/// @file glm/gtx/optimum_pow.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_optimum_pow GLM_GTX_optimum_pow -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Integer exponentiation of power functions. - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_optimum_pow is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_optimum_pow extension included") -# endif -#endif - -namespace glm{ -namespace gtx -{ - /// @addtogroup gtx_optimum_pow - /// @{ - - /// Returns x raised to the power of 2. - /// - /// @see gtx_optimum_pow - template - GLM_FUNC_DECL genType pow2(genType const& x); - - /// Returns x raised to the power of 3. - /// - /// @see gtx_optimum_pow - template - GLM_FUNC_DECL genType pow3(genType const& x); - - /// Returns x raised to the power of 4. - /// - /// @see gtx_optimum_pow - template - GLM_FUNC_DECL genType pow4(genType const& x); - - /// @} -}//namespace gtx -}//namespace glm - -#include "optimum_pow.inl" diff --git a/3rdparty/glm/source/glm/gtx/optimum_pow.inl b/3rdparty/glm/source/glm/gtx/optimum_pow.inl deleted file mode 100644 index a26c19c..0000000 --- a/3rdparty/glm/source/glm/gtx/optimum_pow.inl +++ /dev/null @@ -1,22 +0,0 @@ -/// @ref gtx_optimum_pow - -namespace glm -{ - template - GLM_FUNC_QUALIFIER genType pow2(genType const& x) - { - return x * x; - } - - template - GLM_FUNC_QUALIFIER genType pow3(genType const& x) - { - return x * x * x; - } - - template - GLM_FUNC_QUALIFIER genType pow4(genType const& x) - { - return (x * x) * (x * x); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/orthonormalize.hpp b/3rdparty/glm/source/glm/gtx/orthonormalize.hpp deleted file mode 100644 index 3e004fb..0000000 --- a/3rdparty/glm/source/glm/gtx/orthonormalize.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/// @ref gtx_orthonormalize -/// @file glm/gtx/orthonormalize.hpp -/// -/// @see core (dependence) -/// @see gtx_extented_min_max (dependence) -/// -/// @defgroup gtx_orthonormalize GLM_GTX_orthonormalize -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Orthonormalize matrices. - -#pragma once - -// Dependency: -#include "../vec3.hpp" -#include "../mat3x3.hpp" -#include "../geometric.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_orthonormalize is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_orthonormalize extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_orthonormalize - /// @{ - - /// Returns the orthonormalized matrix of m. - /// - /// @see gtx_orthonormalize - template - GLM_FUNC_DECL mat<3, 3, T, Q> orthonormalize(mat<3, 3, T, Q> const& m); - - /// Orthonormalizes x according y. - /// - /// @see gtx_orthonormalize - template - GLM_FUNC_DECL vec<3, T, Q> orthonormalize(vec<3, T, Q> const& x, vec<3, T, Q> const& y); - - /// @} -}//namespace glm - -#include "orthonormalize.inl" diff --git a/3rdparty/glm/source/glm/gtx/orthonormalize.inl b/3rdparty/glm/source/glm/gtx/orthonormalize.inl deleted file mode 100644 index cb553ba..0000000 --- a/3rdparty/glm/source/glm/gtx/orthonormalize.inl +++ /dev/null @@ -1,29 +0,0 @@ -/// @ref gtx_orthonormalize - -namespace glm -{ - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> orthonormalize(mat<3, 3, T, Q> const& m) - { - mat<3, 3, T, Q> r = m; - - r[0] = normalize(r[0]); - - T d0 = dot(r[0], r[1]); - r[1] -= r[0] * d0; - r[1] = normalize(r[1]); - - T d1 = dot(r[1], r[2]); - d0 = dot(r[0], r[2]); - r[2] -= r[0] * d0 + r[1] * d1; - r[2] = normalize(r[2]); - - return r; - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> orthonormalize(vec<3, T, Q> const& x, vec<3, T, Q> const& y) - { - return normalize(x - y * dot(y, x)); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/pca.hpp b/3rdparty/glm/source/glm/gtx/pca.hpp deleted file mode 100644 index 93da745..0000000 --- a/3rdparty/glm/source/glm/gtx/pca.hpp +++ /dev/null @@ -1,111 +0,0 @@ -/// @ref gtx_pca -/// @file glm/gtx/pca.hpp -/// -/// @see core (dependence) -/// @see ext_scalar_relational (dependence) -/// -/// @defgroup gtx_pca GLM_GTX_pca -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Implements functions required for fundamental 'princple component analysis' in 2D, 3D, and 4D: -/// 1) Computing a covariance matrics from a list of _relative_ position vectors -/// 2) Compute the eigenvalues and eigenvectors of the covariance matrics -/// This is useful, e.g., to compute an object-aligned bounding box from vertices of an object. -/// https://en.wikipedia.org/wiki/Principal_component_analysis -/// -/// Example: -/// ``` -/// std::vector ptData; -/// // ... fill ptData with some point data, e.g. vertices -/// -/// glm::dvec3 center = computeCenter(ptData); -/// -/// glm::dmat3 covarMat = glm::computeCovarianceMatrix(ptData.data(), ptData.size(), center); -/// -/// glm::dvec3 evals; -/// glm::dmat3 evecs; -/// int evcnt = glm::findEigenvaluesSymReal(covarMat, evals, evecs); -/// -/// if(evcnt != 3) -/// // ... error handling -/// -/// glm::sortEigenvalues(evals, evecs); -/// -/// // ... now evecs[0] points in the direction (symmetric) of the largest spatial distribuion within ptData -/// ``` - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../ext/scalar_relational.hpp" - - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_pca is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_pca extension included") -# endif -#endif - -namespace glm { - /// @addtogroup gtx_pca - /// @{ - - /// Compute a covariance matrix form an array of relative coordinates `v` (e.g., relative to the center of gravity of the object) - /// @param v Points to a memory holding `n` times vectors - template - GLM_INLINE mat computeCovarianceMatrix(vec const* v, size_t n); - - /// Compute a covariance matrix form an array of absolute coordinates `v` and a precomputed center of gravity `c` - /// @param v Points to a memory holding `n` times vectors - template - GLM_INLINE mat computeCovarianceMatrix(vec const* v, size_t n, vec const& c); - - /// Compute a covariance matrix form a pair of iterators `b` (begin) and `e` (end) of a container with relative coordinates (e.g., relative to the center of gravity of the object) - /// Dereferencing an iterator of type I must yield a `vec<D, T, Q%gt;` - template - GLM_FUNC_DECL mat computeCovarianceMatrix(I const& b, I const& e); - - /// Compute a covariance matrix form a pair of iterators `b` (begin) and `e` (end) of a container with absolute coordinates and a precomputed center of gravity `c` - /// Dereferencing an iterator of type I must yield a `vec<D, T, Q%gt;` - template - GLM_FUNC_DECL mat computeCovarianceMatrix(I const& b, I const& e, vec const& c); - - /// Assuming the provided covariance matrix `covarMat` is symmetric and real-valued, this function find the `D` Eigenvalues of the matrix, and also provides the corresponding Eigenvectors. - /// Note: the data in `outEigenvalues` and `outEigenvectors` are in matching order, i.e. `outEigenvector[i]` is the Eigenvector of the Eigenvalue `outEigenvalue[i]`. - /// This is a numeric implementation to find the Eigenvalues, using 'QL decomposition` (variant of QR decomposition: https://en.wikipedia.org/wiki/QR_decomposition). - /// @param covarMat A symmetric, real-valued covariance matrix, e.g. computed from `computeCovarianceMatrix`. - /// @param outEigenvalues Vector to receive the found eigenvalues - /// @param outEigenvectors Matrix to receive the found eigenvectors corresponding to the found eigenvalues, as column vectors - /// @return The number of eigenvalues found, usually D if the precondition of the covariance matrix is met. - template - GLM_FUNC_DECL unsigned int findEigenvaluesSymReal - ( - mat const& covarMat, - vec& outEigenvalues, - mat& outEigenvectors - ); - - /// Sorts a group of Eigenvalues&Eigenvectors, for largest Eigenvalue to smallest Eigenvalue. - /// The data in `outEigenvalues` and `outEigenvectors` are assumed to be matching order, i.e. `outEigenvector[i]` is the Eigenvector of the Eigenvalue `outEigenvalue[i]`. - template - GLM_INLINE void sortEigenvalues(vec<2, T, Q>& eigenvalues, mat<2, 2, T, Q>& eigenvectors); - - /// Sorts a group of Eigenvalues&Eigenvectors, for largest Eigenvalue to smallest Eigenvalue. - /// The data in `outEigenvalues` and `outEigenvectors` are assumed to be matching order, i.e. `outEigenvector[i]` is the Eigenvector of the Eigenvalue `outEigenvalue[i]`. - template - GLM_INLINE void sortEigenvalues(vec<3, T, Q>& eigenvalues, mat<3, 3, T, Q>& eigenvectors); - - /// Sorts a group of Eigenvalues&Eigenvectors, for largest Eigenvalue to smallest Eigenvalue. - /// The data in `outEigenvalues` and `outEigenvectors` are assumed to be matching order, i.e. `outEigenvector[i]` is the Eigenvector of the Eigenvalue `outEigenvalue[i]`. - template - GLM_INLINE void sortEigenvalues(vec<4, T, Q>& eigenvalues, mat<4, 4, T, Q>& eigenvectors); - - /// @} -}//namespace glm - -#include "pca.inl" diff --git a/3rdparty/glm/source/glm/gtx/pca.inl b/3rdparty/glm/source/glm/gtx/pca.inl deleted file mode 100644 index d5a24b7..0000000 --- a/3rdparty/glm/source/glm/gtx/pca.inl +++ /dev/null @@ -1,343 +0,0 @@ -/// @ref gtx_pca - -#ifndef GLM_HAS_CXX11_STL -#include -#else -#include -#endif - -namespace glm { - - - template - GLM_INLINE mat computeCovarianceMatrix(vec const* v, size_t n) - { - return computeCovarianceMatrix const*>(v, v + n); - } - - - template - GLM_INLINE mat computeCovarianceMatrix(vec const* v, size_t n, vec const& c) - { - return computeCovarianceMatrix const*>(v, v + n, c); - } - - - template - GLM_FUNC_DECL mat computeCovarianceMatrix(I const& b, I const& e) - { - glm::mat m(0); - - size_t cnt = 0; - for(I i = b; i != e; i++) - { - vec const& v = *i; - for(length_t x = 0; x < D; ++x) - for(length_t y = 0; y < D; ++y) - m[x][y] += static_cast(v[x] * v[y]); - cnt++; - } - if(cnt > 0) - m /= static_cast(cnt); - - return m; - } - - - template - GLM_FUNC_DECL mat computeCovarianceMatrix(I const& b, I const& e, vec const& c) - { - glm::mat m(0); - glm::vec v; - - size_t cnt = 0; - for(I i = b; i != e; i++) - { - v = *i - c; - for(length_t x = 0; x < D; ++x) - for(length_t y = 0; y < D; ++y) - m[x][y] += static_cast(v[x] * v[y]); - cnt++; - } - if(cnt > 0) - m /= static_cast(cnt); - - return m; - } - - namespace _internal_ - { - - template - GLM_INLINE T transferSign(T const& v, T const& s) - { - return ((s) >= 0 ? glm::abs(v) : -glm::abs(v)); - } - - template - GLM_INLINE T pythag(T const& a, T const& b) { - static const T epsilon = static_cast(0.0000001); - T absa = glm::abs(a); - T absb = glm::abs(b); - if(absa > absb) { - absb /= absa; - absb *= absb; - return absa * glm::sqrt(static_cast(1) + absb); - } - if(glm::equal(absb, 0, epsilon)) return static_cast(0); - absa /= absb; - absa *= absa; - return absb * glm::sqrt(static_cast(1) + absa); - } - - } - - template - GLM_FUNC_DECL unsigned int findEigenvaluesSymReal - ( - mat const& covarMat, - vec& outEigenvalues, - mat& outEigenvectors - ) - { - using _internal_::transferSign; - using _internal_::pythag; - - T a[D * D]; // matrix -- input and workspace for algorithm (will be changed inplace) - T d[D]; // diagonal elements - T e[D]; // off-diagonal elements - - for(length_t r = 0; r < D; r++) - for(length_t c = 0; c < D; c++) - a[(r) * D + (c)] = covarMat[c][r]; - - // 1. Householder reduction. - length_t l, k, j, i; - T scale, hh, h, g, f; - static const T epsilon = static_cast(0.0000001); - - for(i = D; i >= 2; i--) - { - l = i - 1; - h = scale = 0; - if(l > 1) - { - for(k = 1; k <= l; k++) - { - scale += glm::abs(a[(i - 1) * D + (k - 1)]); - } - if(glm::equal(scale, 0, epsilon)) - { - e[i - 1] = a[(i - 1) * D + (l - 1)]; - } - else - { - for(k = 1; k <= l; k++) - { - a[(i - 1) * D + (k - 1)] /= scale; - h += a[(i - 1) * D + (k - 1)] * a[(i - 1) * D + (k - 1)]; - } - f = a[(i - 1) * D + (l - 1)]; - g = ((f >= 0) ? -glm::sqrt(h) : glm::sqrt(h)); - e[i - 1] = scale * g; - h -= f * g; - a[(i - 1) * D + (l - 1)] = f - g; - f = 0; - for(j = 1; j <= l; j++) - { - a[(j - 1) * D + (i - 1)] = a[(i - 1) * D + (j - 1)] / h; - g = 0; - for(k = 1; k <= j; k++) - { - g += a[(j - 1) * D + (k - 1)] * a[(i - 1) * D + (k - 1)]; - } - for(k = j + 1; k <= l; k++) - { - g += a[(k - 1) * D + (j - 1)] * a[(i - 1) * D + (k - 1)]; - } - e[j - 1] = g / h; - f += e[j - 1] * a[(i - 1) * D + (j - 1)]; - } - hh = f / (h + h); - for(j = 1; j <= l; j++) - { - f = a[(i - 1) * D + (j - 1)]; - e[j - 1] = g = e[j - 1] - hh * f; - for(k = 1; k <= j; k++) - { - a[(j - 1) * D + (k - 1)] -= (f * e[k - 1] + g * a[(i - 1) * D + (k - 1)]); - } - } - } - } - else - { - e[i - 1] = a[(i - 1) * D + (l - 1)]; - } - d[i - 1] = h; - } - d[0] = 0; - e[0] = 0; - for(i = 1; i <= D; i++) - { - l = i - 1; - if(!glm::equal(d[i - 1], 0, epsilon)) - { - for(j = 1; j <= l; j++) - { - g = 0; - for(k = 1; k <= l; k++) - { - g += a[(i - 1) * D + (k - 1)] * a[(k - 1) * D + (j - 1)]; - } - for(k = 1; k <= l; k++) - { - a[(k - 1) * D + (j - 1)] -= g * a[(k - 1) * D + (i - 1)]; - } - } - } - d[i - 1] = a[(i - 1) * D + (i - 1)]; - a[(i - 1) * D + (i - 1)] = 1; - for(j = 1; j <= l; j++) - { - a[(j - 1) * D + (i - 1)] = a[(i - 1) * D + (j - 1)] = 0; - } - } - - // 2. Calculation of eigenvalues and eigenvectors (QL algorithm) - length_t m, iter; - T s, r, p, dd, c, b; - const length_t MAX_ITER = 30; - - for(i = 2; i <= D; i++) - { - e[i - 2] = e[i - 1]; - } - e[D - 1] = 0; - - for(l = 1; l <= D; l++) - { - iter = 0; - do - { - for(m = l; m <= D - 1; m++) - { - dd = glm::abs(d[m - 1]) + glm::abs(d[m - 1 + 1]); - if(glm::equal(glm::abs(e[m - 1]) + dd, dd, epsilon)) - break; - } - if(m != l) - { - if(iter++ == MAX_ITER) - { - return 0; // Too many iterations in FindEigenvalues - } - g = (d[l - 1 + 1] - d[l - 1]) / (2 * e[l - 1]); - r = pythag(g, 1); - g = d[m - 1] - d[l - 1] + e[l - 1] / (g + transferSign(r, g)); - s = c = 1; - p = 0; - for(i = m - 1; i >= l; i--) - { - f = s * e[i - 1]; - b = c * e[i - 1]; - e[i - 1 + 1] = r = pythag(f, g); - if(glm::equal(r, 0, epsilon)) - { - d[i - 1 + 1] -= p; - e[m - 1] = 0; - break; - } - s = f / r; - c = g / r; - g = d[i - 1 + 1] - p; - r = (d[i - 1] - g) * s + 2 * c * b; - d[i - 1 + 1] = g + (p = s * r); - g = c * r - b; - for(k = 1; k <= D; k++) - { - f = a[(k - 1) * D + (i - 1 + 1)]; - a[(k - 1) * D + (i - 1 + 1)] = s * a[(k - 1) * D + (i - 1)] + c * f; - a[(k - 1) * D + (i - 1)] = c * a[(k - 1) * D + (i - 1)] - s * f; - } - } - if(glm::equal(r, 0, epsilon) && (i >= l)) - continue; - d[l - 1] -= p; - e[l - 1] = g; - e[m - 1] = 0; - } - } while(m != l); - } - - // 3. output - for(i = 0; i < D; i++) - outEigenvalues[i] = d[i]; - for(i = 0; i < D; i++) - for(j = 0; j < D; j++) - outEigenvectors[i][j] = a[(j) * D + (i)]; - - return D; - } - - template - GLM_INLINE void sortEigenvalues(vec<2, T, Q>& eigenvalues, mat<2, 2, T, Q>& eigenvectors) - { - if (eigenvalues[0] < eigenvalues[1]) - { - std::swap(eigenvalues[0], eigenvalues[1]); - std::swap(eigenvectors[0], eigenvectors[1]); - } - } - - template - GLM_INLINE void sortEigenvalues(vec<3, T, Q>& eigenvalues, mat<3, 3, T, Q>& eigenvectors) - { - if (eigenvalues[0] < eigenvalues[1]) - { - std::swap(eigenvalues[0], eigenvalues[1]); - std::swap(eigenvectors[0], eigenvectors[1]); - } - if (eigenvalues[0] < eigenvalues[2]) - { - std::swap(eigenvalues[0], eigenvalues[2]); - std::swap(eigenvectors[0], eigenvectors[2]); - } - if (eigenvalues[1] < eigenvalues[2]) - { - std::swap(eigenvalues[1], eigenvalues[2]); - std::swap(eigenvectors[1], eigenvectors[2]); - } - } - - template - GLM_INLINE void sortEigenvalues(vec<4, T, Q>& eigenvalues, mat<4, 4, T, Q>& eigenvectors) - { - if (eigenvalues[0] < eigenvalues[2]) - { - std::swap(eigenvalues[0], eigenvalues[2]); - std::swap(eigenvectors[0], eigenvectors[2]); - } - if (eigenvalues[1] < eigenvalues[3]) - { - std::swap(eigenvalues[1], eigenvalues[3]); - std::swap(eigenvectors[1], eigenvectors[3]); - } - if (eigenvalues[0] < eigenvalues[1]) - { - std::swap(eigenvalues[0], eigenvalues[1]); - std::swap(eigenvectors[0], eigenvectors[1]); - } - if (eigenvalues[2] < eigenvalues[3]) - { - std::swap(eigenvalues[2], eigenvalues[3]); - std::swap(eigenvectors[2], eigenvectors[3]); - } - if (eigenvalues[1] < eigenvalues[2]) - { - std::swap(eigenvalues[1], eigenvalues[2]); - std::swap(eigenvectors[1], eigenvectors[2]); - } - } - -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/perpendicular.hpp b/3rdparty/glm/source/glm/gtx/perpendicular.hpp deleted file mode 100644 index 72b77b6..0000000 --- a/3rdparty/glm/source/glm/gtx/perpendicular.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/// @ref gtx_perpendicular -/// @file glm/gtx/perpendicular.hpp -/// -/// @see core (dependence) -/// @see gtx_projection (dependence) -/// -/// @defgroup gtx_perpendicular GLM_GTX_perpendicular -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Perpendicular of a vector from other one - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtx/projection.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_perpendicular is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_perpendicular extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_perpendicular - /// @{ - - //! Projects x a perpendicular axis of Normal. - //! From GLM_GTX_perpendicular extension. - template - GLM_FUNC_DECL genType perp(genType const& x, genType const& Normal); - - /// @} -}//namespace glm - -#include "perpendicular.inl" diff --git a/3rdparty/glm/source/glm/gtx/perpendicular.inl b/3rdparty/glm/source/glm/gtx/perpendicular.inl deleted file mode 100644 index 1e72f33..0000000 --- a/3rdparty/glm/source/glm/gtx/perpendicular.inl +++ /dev/null @@ -1,10 +0,0 @@ -/// @ref gtx_perpendicular - -namespace glm -{ - template - GLM_FUNC_QUALIFIER genType perp(genType const& x, genType const& Normal) - { - return x - proj(x, Normal); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/polar_coordinates.hpp b/3rdparty/glm/source/glm/gtx/polar_coordinates.hpp deleted file mode 100644 index 76beb82..0000000 --- a/3rdparty/glm/source/glm/gtx/polar_coordinates.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/// @ref gtx_polar_coordinates -/// @file glm/gtx/polar_coordinates.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_polar_coordinates GLM_GTX_polar_coordinates -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Conversion from Euclidean space to polar space and revert. - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_polar_coordinates is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_polar_coordinates extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_polar_coordinates - /// @{ - - /// Convert Euclidean to Polar coordinates, x is the latitude, y the longitude and z the xz distance. - /// - /// @see gtx_polar_coordinates - template - GLM_FUNC_DECL vec<3, T, Q> polar( - vec<3, T, Q> const& euclidean); - - /// Convert Polar to Euclidean coordinates. - /// - /// @see gtx_polar_coordinates - template - GLM_FUNC_DECL vec<3, T, Q> euclidean( - vec<2, T, Q> const& polar); - - /// @} -}//namespace glm - -#include "polar_coordinates.inl" diff --git a/3rdparty/glm/source/glm/gtx/polar_coordinates.inl b/3rdparty/glm/source/glm/gtx/polar_coordinates.inl deleted file mode 100644 index 371c8dd..0000000 --- a/3rdparty/glm/source/glm/gtx/polar_coordinates.inl +++ /dev/null @@ -1,36 +0,0 @@ -/// @ref gtx_polar_coordinates - -namespace glm -{ - template - GLM_FUNC_QUALIFIER vec<3, T, Q> polar - ( - vec<3, T, Q> const& euclidean - ) - { - T const Length(length(euclidean)); - vec<3, T, Q> const tmp(euclidean / Length); - T const xz_dist(sqrt(tmp.x * tmp.x + tmp.z * tmp.z)); - - return vec<3, T, Q>( - asin(tmp.y), // latitude - atan(tmp.x, tmp.z), // longitude - xz_dist); // xz distance - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> euclidean - ( - vec<2, T, Q> const& polar - ) - { - T const latitude(polar.x); - T const longitude(polar.y); - - return vec<3, T, Q>( - cos(latitude) * sin(longitude), - sin(latitude), - cos(latitude) * cos(longitude)); - } - -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/projection.hpp b/3rdparty/glm/source/glm/gtx/projection.hpp deleted file mode 100644 index 678f3ad..0000000 --- a/3rdparty/glm/source/glm/gtx/projection.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/// @ref gtx_projection -/// @file glm/gtx/projection.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_projection GLM_GTX_projection -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Projection of a vector to other one - -#pragma once - -// Dependency: -#include "../geometric.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_projection is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_projection extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_projection - /// @{ - - /// Projects x on Normal. - /// - /// @param[in] x A vector to project - /// @param[in] Normal A normal that doesn't need to be of unit length. - /// - /// @see gtx_projection - template - GLM_FUNC_DECL genType proj(genType const& x, genType const& Normal); - - /// @} -}//namespace glm - -#include "projection.inl" diff --git a/3rdparty/glm/source/glm/gtx/projection.inl b/3rdparty/glm/source/glm/gtx/projection.inl deleted file mode 100644 index f23f884..0000000 --- a/3rdparty/glm/source/glm/gtx/projection.inl +++ /dev/null @@ -1,10 +0,0 @@ -/// @ref gtx_projection - -namespace glm -{ - template - GLM_FUNC_QUALIFIER genType proj(genType const& x, genType const& Normal) - { - return glm::dot(x, Normal) / glm::dot(Normal, Normal) * Normal; - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/quaternion.hpp b/3rdparty/glm/source/glm/gtx/quaternion.hpp deleted file mode 100644 index 5c2b5ad..0000000 --- a/3rdparty/glm/source/glm/gtx/quaternion.hpp +++ /dev/null @@ -1,174 +0,0 @@ -/// @ref gtx_quaternion -/// @file glm/gtx/quaternion.hpp -/// -/// @see core (dependence) -/// @see gtx_extented_min_max (dependence) -/// -/// @defgroup gtx_quaternion GLM_GTX_quaternion -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Extented quaternion types and functions - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtc/constants.hpp" -#include "../gtc/quaternion.hpp" -#include "../ext/quaternion_exponential.hpp" -#include "../gtx/norm.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_quaternion is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_quaternion extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_quaternion - /// @{ - - /// Create an identity quaternion. - /// - /// @see gtx_quaternion - template - GLM_FUNC_DECL GLM_CONSTEXPR qua quat_identity(); - - /// Compute a cross product between a quaternion and a vector. - /// - /// @see gtx_quaternion - template - GLM_FUNC_DECL vec<3, T, Q> cross( - qua const& q, - vec<3, T, Q> const& v); - - //! Compute a cross product between a vector and a quaternion. - /// - /// @see gtx_quaternion - template - GLM_FUNC_DECL vec<3, T, Q> cross( - vec<3, T, Q> const& v, - qua const& q); - - //! Compute a point on a path according squad equation. - //! q1 and q2 are control points; s1 and s2 are intermediate control points. - /// - /// @see gtx_quaternion - template - GLM_FUNC_DECL qua squad( - qua const& q1, - qua const& q2, - qua const& s1, - qua const& s2, - T const& h); - - //! Returns an intermediate control point for squad interpolation. - /// - /// @see gtx_quaternion - template - GLM_FUNC_DECL qua intermediate( - qua const& prev, - qua const& curr, - qua const& next); - - //! Returns quarternion square root. - /// - /// @see gtx_quaternion - //template - //qua sqrt( - // qua const& q); - - //! Rotates a 3 components vector by a quaternion. - /// - /// @see gtx_quaternion - template - GLM_FUNC_DECL vec<3, T, Q> rotate( - qua const& q, - vec<3, T, Q> const& v); - - /// Rotates a 4 components vector by a quaternion. - /// - /// @see gtx_quaternion - template - GLM_FUNC_DECL vec<4, T, Q> rotate( - qua const& q, - vec<4, T, Q> const& v); - - /// Extract the real component of a quaternion. - /// - /// @see gtx_quaternion - template - GLM_FUNC_DECL T extractRealComponent( - qua const& q); - - /// Converts a quaternion to a 3 * 3 matrix. - /// - /// @see gtx_quaternion - template - GLM_FUNC_DECL mat<3, 3, T, Q> toMat3( - qua const& x){return mat3_cast(x);} - - /// Converts a quaternion to a 4 * 4 matrix. - /// - /// @see gtx_quaternion - template - GLM_FUNC_DECL mat<4, 4, T, Q> toMat4( - qua const& x){return mat4_cast(x);} - - /// Converts a 3 * 3 matrix to a quaternion. - /// - /// @see gtx_quaternion - template - GLM_FUNC_DECL qua toQuat( - mat<3, 3, T, Q> const& x){return quat_cast(x);} - - /// Converts a 4 * 4 matrix to a quaternion. - /// - /// @see gtx_quaternion - template - GLM_FUNC_DECL qua toQuat( - mat<4, 4, T, Q> const& x){return quat_cast(x);} - - /// Quaternion interpolation using the rotation short path. - /// - /// @see gtx_quaternion - template - GLM_FUNC_DECL qua shortMix( - qua const& x, - qua const& y, - T const& a); - - /// Quaternion normalized linear interpolation. - /// - /// @see gtx_quaternion - template - GLM_FUNC_DECL qua fastMix( - qua const& x, - qua const& y, - T const& a); - - /// Compute the rotation between two vectors. - /// @param orig vector, needs to be normalized - /// @param dest vector, needs to be normalized - /// - /// @see gtx_quaternion - template - GLM_FUNC_DECL qua rotation( - vec<3, T, Q> const& orig, - vec<3, T, Q> const& dest); - - /// Returns the squared length of x. - /// - /// @see gtx_quaternion - template - GLM_FUNC_DECL GLM_CONSTEXPR T length2(qua const& q); - - /// @} -}//namespace glm - -#include "quaternion.inl" diff --git a/3rdparty/glm/source/glm/gtx/quaternion.inl b/3rdparty/glm/source/glm/gtx/quaternion.inl deleted file mode 100644 index d125bcc..0000000 --- a/3rdparty/glm/source/glm/gtx/quaternion.inl +++ /dev/null @@ -1,159 +0,0 @@ -/// @ref gtx_quaternion - -#include -#include "../gtc/constants.hpp" - -namespace glm -{ - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua quat_identity() - { - return qua(static_cast(1), static_cast(0), static_cast(0), static_cast(0)); - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> cross(vec<3, T, Q> const& v, qua const& q) - { - return inverse(q) * v; - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> cross(qua const& q, vec<3, T, Q> const& v) - { - return q * v; - } - - template - GLM_FUNC_QUALIFIER qua squad - ( - qua const& q1, - qua const& q2, - qua const& s1, - qua const& s2, - T const& h) - { - return mix(mix(q1, q2, h), mix(s1, s2, h), static_cast(2) * (static_cast(1) - h) * h); - } - - template - GLM_FUNC_QUALIFIER qua intermediate - ( - qua const& prev, - qua const& curr, - qua const& next - ) - { - qua invQuat = inverse(curr); - return exp((log(next * invQuat) + log(prev * invQuat)) / static_cast(-4)) * curr; - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> rotate(qua const& q, vec<3, T, Q> const& v) - { - return q * v; - } - - template - GLM_FUNC_QUALIFIER vec<4, T, Q> rotate(qua const& q, vec<4, T, Q> const& v) - { - return q * v; - } - - template - GLM_FUNC_QUALIFIER T extractRealComponent(qua const& q) - { - T w = static_cast(1) - q.x * q.x - q.y * q.y - q.z * q.z; - if(w < T(0)) - return T(0); - else - return -sqrt(w); - } - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR T length2(qua const& q) - { - return q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w; - } - - template - GLM_FUNC_QUALIFIER qua shortMix(qua const& x, qua const& y, T const& a) - { - if(a <= static_cast(0)) return x; - if(a >= static_cast(1)) return y; - - T fCos = dot(x, y); - qua y2(y); //BUG!!! qua y2; - if(fCos < static_cast(0)) - { - y2 = -y; - fCos = -fCos; - } - - //if(fCos > 1.0f) // problem - T k0, k1; - if(fCos > (static_cast(1) - epsilon())) - { - k0 = static_cast(1) - a; - k1 = static_cast(0) + a; //BUG!!! 1.0f + a; - } - else - { - T fSin = sqrt(T(1) - fCos * fCos); - T fAngle = atan(fSin, fCos); - T fOneOverSin = static_cast(1) / fSin; - k0 = sin((static_cast(1) - a) * fAngle) * fOneOverSin; - k1 = sin((static_cast(0) + a) * fAngle) * fOneOverSin; - } - - return qua( - k0 * x.w + k1 * y2.w, - k0 * x.x + k1 * y2.x, - k0 * x.y + k1 * y2.y, - k0 * x.z + k1 * y2.z); - } - - template - GLM_FUNC_QUALIFIER qua fastMix(qua const& x, qua const& y, T const& a) - { - return glm::normalize(x * (static_cast(1) - a) + (y * a)); - } - - template - GLM_FUNC_QUALIFIER qua rotation(vec<3, T, Q> const& orig, vec<3, T, Q> const& dest) - { - T cosTheta = dot(orig, dest); - vec<3, T, Q> rotationAxis; - - if(cosTheta >= static_cast(1) - epsilon()) { - // orig and dest point in the same direction - return quat_identity(); - } - - if(cosTheta < static_cast(-1) + epsilon()) - { - // special case when vectors in opposite directions : - // there is no "ideal" rotation axis - // So guess one; any will do as long as it's perpendicular to start - // This implementation favors a rotation around the Up axis (Y), - // since it's often what you want to do. - rotationAxis = cross(vec<3, T, Q>(0, 0, 1), orig); - if(length2(rotationAxis) < epsilon()) // bad luck, they were parallel, try again! - rotationAxis = cross(vec<3, T, Q>(1, 0, 0), orig); - - rotationAxis = normalize(rotationAxis); - return angleAxis(pi(), rotationAxis); - } - - // Implementation from Stan Melax's Game Programming Gems 1 article - rotationAxis = cross(orig, dest); - - T s = sqrt((T(1) + cosTheta) * static_cast(2)); - T invs = static_cast(1) / s; - - return qua( - s * static_cast(0.5f), - rotationAxis.x * invs, - rotationAxis.y * invs, - rotationAxis.z * invs); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/range.hpp b/3rdparty/glm/source/glm/gtx/range.hpp deleted file mode 100644 index 93bcb9a..0000000 --- a/3rdparty/glm/source/glm/gtx/range.hpp +++ /dev/null @@ -1,98 +0,0 @@ -/// @ref gtx_range -/// @file glm/gtx/range.hpp -/// @author Joshua Moerman -/// -/// @defgroup gtx_range GLM_GTX_range -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Defines begin and end for vectors and matrices. Useful for range-based for loop. -/// The range is defined over the elements, not over columns or rows (e.g. mat4 has 16 elements). - -#pragma once - -// Dependencies -#include "../detail/setup.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_range is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_range extension included") -# endif -#endif - -#include "../gtc/type_ptr.hpp" -#include "../gtc/vec1.hpp" - -namespace glm -{ - /// @addtogroup gtx_range - /// @{ - -# if GLM_COMPILER & GLM_COMPILER_VC -# pragma warning(push) -# pragma warning(disable : 4100) // unreferenced formal parameter -# endif - - template - inline length_t components(vec<1, T, Q> const& v) - { - return v.length(); - } - - template - inline length_t components(vec<2, T, Q> const& v) - { - return v.length(); - } - - template - inline length_t components(vec<3, T, Q> const& v) - { - return v.length(); - } - - template - inline length_t components(vec<4, T, Q> const& v) - { - return v.length(); - } - - template - inline length_t components(genType const& m) - { - return m.length() * m[0].length(); - } - - template - inline typename genType::value_type const * begin(genType const& v) - { - return value_ptr(v); - } - - template - inline typename genType::value_type const * end(genType const& v) - { - return begin(v) + components(v); - } - - template - inline typename genType::value_type * begin(genType& v) - { - return value_ptr(v); - } - - template - inline typename genType::value_type * end(genType& v) - { - return begin(v) + components(v); - } - -# if GLM_COMPILER & GLM_COMPILER_VC -# pragma warning(pop) -# endif - - /// @} -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/raw_data.hpp b/3rdparty/glm/source/glm/gtx/raw_data.hpp deleted file mode 100644 index 86cbe77..0000000 --- a/3rdparty/glm/source/glm/gtx/raw_data.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/// @ref gtx_raw_data -/// @file glm/gtx/raw_data.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_raw_data GLM_GTX_raw_data -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Projection of a vector to other one - -#pragma once - -// Dependencies -#include "../ext/scalar_uint_sized.hpp" -#include "../detail/setup.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_raw_data is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_raw_data extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_raw_data - /// @{ - - //! Type for byte numbers. - //! From GLM_GTX_raw_data extension. - typedef detail::uint8 byte; - - //! Type for word numbers. - //! From GLM_GTX_raw_data extension. - typedef detail::uint16 word; - - //! Type for dword numbers. - //! From GLM_GTX_raw_data extension. - typedef detail::uint32 dword; - - //! Type for qword numbers. - //! From GLM_GTX_raw_data extension. - typedef detail::uint64 qword; - - /// @} -}// namespace glm - -#include "raw_data.inl" diff --git a/3rdparty/glm/source/glm/gtx/raw_data.inl b/3rdparty/glm/source/glm/gtx/raw_data.inl deleted file mode 100644 index c740317..0000000 --- a/3rdparty/glm/source/glm/gtx/raw_data.inl +++ /dev/null @@ -1,2 +0,0 @@ -/// @ref gtx_raw_data - diff --git a/3rdparty/glm/source/glm/gtx/rotate_normalized_axis.hpp b/3rdparty/glm/source/glm/gtx/rotate_normalized_axis.hpp deleted file mode 100644 index 2103ca0..0000000 --- a/3rdparty/glm/source/glm/gtx/rotate_normalized_axis.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/// @ref gtx_rotate_normalized_axis -/// @file glm/gtx/rotate_normalized_axis.hpp -/// -/// @see core (dependence) -/// @see gtc_matrix_transform -/// @see gtc_quaternion -/// -/// @defgroup gtx_rotate_normalized_axis GLM_GTX_rotate_normalized_axis -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Quaternions and matrices rotations around normalized axis. - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtc/epsilon.hpp" -#include "../gtc/quaternion.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_rotate_normalized_axis is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_rotate_normalized_axis extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_rotate_normalized_axis - /// @{ - - /// Builds a rotation 4 * 4 matrix created from a normalized axis and an angle. - /// - /// @param m Input matrix multiplied by this rotation matrix. - /// @param angle Rotation angle expressed in radians. - /// @param axis Rotation axis, must be normalized. - /// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double. - /// - /// @see gtx_rotate_normalized_axis - /// @see - rotate(T angle, T x, T y, T z) - /// @see - rotate(mat<4, 4, T, Q> const& m, T angle, T x, T y, T z) - /// @see - rotate(T angle, vec<3, T, Q> const& v) - template - GLM_FUNC_DECL mat<4, 4, T, Q> rotateNormalizedAxis( - mat<4, 4, T, Q> const& m, - T const& angle, - vec<3, T, Q> const& axis); - - /// Rotates a quaternion from a vector of 3 components normalized axis and an angle. - /// - /// @param q Source orientation - /// @param angle Angle expressed in radians. - /// @param axis Normalized axis of the rotation, must be normalized. - /// - /// @see gtx_rotate_normalized_axis - template - GLM_FUNC_DECL qua rotateNormalizedAxis( - qua const& q, - T const& angle, - vec<3, T, Q> const& axis); - - /// @} -}//namespace glm - -#include "rotate_normalized_axis.inl" diff --git a/3rdparty/glm/source/glm/gtx/rotate_normalized_axis.inl b/3rdparty/glm/source/glm/gtx/rotate_normalized_axis.inl deleted file mode 100644 index b2e9278..0000000 --- a/3rdparty/glm/source/glm/gtx/rotate_normalized_axis.inl +++ /dev/null @@ -1,58 +0,0 @@ -/// @ref gtx_rotate_normalized_axis - -namespace glm -{ - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rotateNormalizedAxis - ( - mat<4, 4, T, Q> const& m, - T const& angle, - vec<3, T, Q> const& v - ) - { - T const a = angle; - T const c = cos(a); - T const s = sin(a); - - vec<3, T, Q> const axis(v); - - vec<3, T, Q> const temp((static_cast(1) - c) * axis); - - mat<4, 4, T, Q> Rotate; - Rotate[0][0] = c + temp[0] * axis[0]; - Rotate[0][1] = 0 + temp[0] * axis[1] + s * axis[2]; - Rotate[0][2] = 0 + temp[0] * axis[2] - s * axis[1]; - - Rotate[1][0] = 0 + temp[1] * axis[0] - s * axis[2]; - Rotate[1][1] = c + temp[1] * axis[1]; - Rotate[1][2] = 0 + temp[1] * axis[2] + s * axis[0]; - - Rotate[2][0] = 0 + temp[2] * axis[0] + s * axis[1]; - Rotate[2][1] = 0 + temp[2] * axis[1] - s * axis[0]; - Rotate[2][2] = c + temp[2] * axis[2]; - - mat<4, 4, T, Q> Result; - Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2]; - Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2]; - Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2]; - Result[3] = m[3]; - return Result; - } - - template - GLM_FUNC_QUALIFIER qua rotateNormalizedAxis - ( - qua const& q, - T const& angle, - vec<3, T, Q> const& v - ) - { - vec<3, T, Q> const Tmp(v); - - T const AngleRad(angle); - T const Sin = sin(AngleRad * T(0.5)); - - return q * qua(cos(AngleRad * static_cast(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin); - //return gtc::quaternion::cross(q, tquat(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin)); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/rotate_vector.hpp b/3rdparty/glm/source/glm/gtx/rotate_vector.hpp deleted file mode 100644 index dcd5b95..0000000 --- a/3rdparty/glm/source/glm/gtx/rotate_vector.hpp +++ /dev/null @@ -1,123 +0,0 @@ -/// @ref gtx_rotate_vector -/// @file glm/gtx/rotate_vector.hpp -/// -/// @see core (dependence) -/// @see gtx_transform (dependence) -/// -/// @defgroup gtx_rotate_vector GLM_GTX_rotate_vector -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Function to directly rotate a vector - -#pragma once - -// Dependency: -#include "../gtx/transform.hpp" -#include "../gtc/epsilon.hpp" -#include "../ext/vector_relational.hpp" -#include "../glm.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_rotate_vector is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_rotate_vector extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_rotate_vector - /// @{ - - /// Returns Spherical interpolation between two vectors - /// - /// @param x A first vector - /// @param y A second vector - /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. - /// - /// @see gtx_rotate_vector - template - GLM_FUNC_DECL vec<3, T, Q> slerp( - vec<3, T, Q> const& x, - vec<3, T, Q> const& y, - T const& a); - - //! Rotate a two dimensional vector. - //! From GLM_GTX_rotate_vector extension. - template - GLM_FUNC_DECL vec<2, T, Q> rotate( - vec<2, T, Q> const& v, - T const& angle); - - //! Rotate a three dimensional vector around an axis. - //! From GLM_GTX_rotate_vector extension. - template - GLM_FUNC_DECL vec<3, T, Q> rotate( - vec<3, T, Q> const& v, - T const& angle, - vec<3, T, Q> const& normal); - - //! Rotate a four dimensional vector around an axis. - //! From GLM_GTX_rotate_vector extension. - template - GLM_FUNC_DECL vec<4, T, Q> rotate( - vec<4, T, Q> const& v, - T const& angle, - vec<3, T, Q> const& normal); - - //! Rotate a three dimensional vector around the X axis. - //! From GLM_GTX_rotate_vector extension. - template - GLM_FUNC_DECL vec<3, T, Q> rotateX( - vec<3, T, Q> const& v, - T const& angle); - - //! Rotate a three dimensional vector around the Y axis. - //! From GLM_GTX_rotate_vector extension. - template - GLM_FUNC_DECL vec<3, T, Q> rotateY( - vec<3, T, Q> const& v, - T const& angle); - - //! Rotate a three dimensional vector around the Z axis. - //! From GLM_GTX_rotate_vector extension. - template - GLM_FUNC_DECL vec<3, T, Q> rotateZ( - vec<3, T, Q> const& v, - T const& angle); - - //! Rotate a four dimensional vector around the X axis. - //! From GLM_GTX_rotate_vector extension. - template - GLM_FUNC_DECL vec<4, T, Q> rotateX( - vec<4, T, Q> const& v, - T const& angle); - - //! Rotate a four dimensional vector around the Y axis. - //! From GLM_GTX_rotate_vector extension. - template - GLM_FUNC_DECL vec<4, T, Q> rotateY( - vec<4, T, Q> const& v, - T const& angle); - - //! Rotate a four dimensional vector around the Z axis. - //! From GLM_GTX_rotate_vector extension. - template - GLM_FUNC_DECL vec<4, T, Q> rotateZ( - vec<4, T, Q> const& v, - T const& angle); - - //! Build a rotation matrix from a normal and a up vector. - //! From GLM_GTX_rotate_vector extension. - template - GLM_FUNC_DECL mat<4, 4, T, Q> orientation( - vec<3, T, Q> const& Normal, - vec<3, T, Q> const& Up); - - /// @} -}//namespace glm - -#include "rotate_vector.inl" diff --git a/3rdparty/glm/source/glm/gtx/rotate_vector.inl b/3rdparty/glm/source/glm/gtx/rotate_vector.inl deleted file mode 100644 index f8136e7..0000000 --- a/3rdparty/glm/source/glm/gtx/rotate_vector.inl +++ /dev/null @@ -1,187 +0,0 @@ -/// @ref gtx_rotate_vector - -namespace glm -{ - template - GLM_FUNC_QUALIFIER vec<3, T, Q> slerp - ( - vec<3, T, Q> const& x, - vec<3, T, Q> const& y, - T const& a - ) - { - // get cosine of angle between vectors (-1 -> 1) - T CosAlpha = dot(x, y); - // get angle (0 -> pi) - T Alpha = acos(CosAlpha); - // get sine of angle between vectors (0 -> 1) - T SinAlpha = sin(Alpha); - // this breaks down when SinAlpha = 0, i.e. Alpha = 0 or pi - T t1 = sin((static_cast(1) - a) * Alpha) / SinAlpha; - T t2 = sin(a * Alpha) / SinAlpha; - - // interpolate src vectors - return x * t1 + y * t2; - } - - template - GLM_FUNC_QUALIFIER vec<2, T, Q> rotate - ( - vec<2, T, Q> const& v, - T const& angle - ) - { - vec<2, T, Q> Result; - T const Cos(cos(angle)); - T const Sin(sin(angle)); - - Result.x = v.x * Cos - v.y * Sin; - Result.y = v.x * Sin + v.y * Cos; - return Result; - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> rotate - ( - vec<3, T, Q> const& v, - T const& angle, - vec<3, T, Q> const& normal - ) - { - return mat<3, 3, T, Q>(glm::rotate(angle, normal)) * v; - } - /* - template - GLM_FUNC_QUALIFIER vec<3, T, Q> rotateGTX( - const vec<3, T, Q>& x, - T angle, - const vec<3, T, Q>& normal) - { - const T Cos = cos(radians(angle)); - const T Sin = sin(radians(angle)); - return x * Cos + ((x * normal) * (T(1) - Cos)) * normal + cross(x, normal) * Sin; - } - */ - template - GLM_FUNC_QUALIFIER vec<4, T, Q> rotate - ( - vec<4, T, Q> const& v, - T const& angle, - vec<3, T, Q> const& normal - ) - { - return rotate(angle, normal) * v; - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> rotateX - ( - vec<3, T, Q> const& v, - T const& angle - ) - { - vec<3, T, Q> Result(v); - T const Cos(cos(angle)); - T const Sin(sin(angle)); - - Result.y = v.y * Cos - v.z * Sin; - Result.z = v.y * Sin + v.z * Cos; - return Result; - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> rotateY - ( - vec<3, T, Q> const& v, - T const& angle - ) - { - vec<3, T, Q> Result = v; - T const Cos(cos(angle)); - T const Sin(sin(angle)); - - Result.x = v.x * Cos + v.z * Sin; - Result.z = -v.x * Sin + v.z * Cos; - return Result; - } - - template - GLM_FUNC_QUALIFIER vec<3, T, Q> rotateZ - ( - vec<3, T, Q> const& v, - T const& angle - ) - { - vec<3, T, Q> Result = v; - T const Cos(cos(angle)); - T const Sin(sin(angle)); - - Result.x = v.x * Cos - v.y * Sin; - Result.y = v.x * Sin + v.y * Cos; - return Result; - } - - template - GLM_FUNC_QUALIFIER vec<4, T, Q> rotateX - ( - vec<4, T, Q> const& v, - T const& angle - ) - { - vec<4, T, Q> Result = v; - T const Cos(cos(angle)); - T const Sin(sin(angle)); - - Result.y = v.y * Cos - v.z * Sin; - Result.z = v.y * Sin + v.z * Cos; - return Result; - } - - template - GLM_FUNC_QUALIFIER vec<4, T, Q> rotateY - ( - vec<4, T, Q> const& v, - T const& angle - ) - { - vec<4, T, Q> Result = v; - T const Cos(cos(angle)); - T const Sin(sin(angle)); - - Result.x = v.x * Cos + v.z * Sin; - Result.z = -v.x * Sin + v.z * Cos; - return Result; - } - - template - GLM_FUNC_QUALIFIER vec<4, T, Q> rotateZ - ( - vec<4, T, Q> const& v, - T const& angle - ) - { - vec<4, T, Q> Result = v; - T const Cos(cos(angle)); - T const Sin(sin(angle)); - - Result.x = v.x * Cos - v.y * Sin; - Result.y = v.x * Sin + v.y * Cos; - return Result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> orientation - ( - vec<3, T, Q> const& Normal, - vec<3, T, Q> const& Up - ) - { - if(all(equal(Normal, Up, epsilon()))) - return mat<4, 4, T, Q>(static_cast(1)); - - vec<3, T, Q> RotationAxis = cross(Up, Normal); - T Angle = acos(dot(Normal, Up)); - - return rotate(Angle, RotationAxis); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/scalar_multiplication.hpp b/3rdparty/glm/source/glm/gtx/scalar_multiplication.hpp deleted file mode 100644 index 496ba19..0000000 --- a/3rdparty/glm/source/glm/gtx/scalar_multiplication.hpp +++ /dev/null @@ -1,75 +0,0 @@ -/// @ref gtx -/// @file glm/gtx/scalar_multiplication.hpp -/// @author Joshua Moerman -/// -/// Include to use the features of this extension. -/// -/// Enables scalar multiplication for all types -/// -/// Since GLSL is very strict about types, the following (often used) combinations do not work: -/// double * vec4 -/// int * vec4 -/// vec4 / int -/// So we'll fix that! Of course "float * vec4" should remain the same (hence the enable_if magic) - -#pragma once - -#include "../detail/setup.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_scalar_multiplication is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_scalar_multiplication extension included") -# endif -#endif - -#include "../vec2.hpp" -#include "../vec3.hpp" -#include "../vec4.hpp" -#include "../mat2x2.hpp" -#include - -namespace glm -{ - template - using return_type_scalar_multiplication = typename std::enable_if< - !std::is_same::value // T may not be a float - && std::is_arithmetic::value, Vec // But it may be an int or double (no vec3 or mat3, ...) - >::type; - -#define GLM_IMPLEMENT_SCAL_MULT(Vec) \ - template \ - return_type_scalar_multiplication \ - operator*(T const& s, Vec rh){ \ - return rh *= static_cast(s); \ - } \ - \ - template \ - return_type_scalar_multiplication \ - operator*(Vec lh, T const& s){ \ - return lh *= static_cast(s); \ - } \ - \ - template \ - return_type_scalar_multiplication \ - operator/(Vec lh, T const& s){ \ - return lh *= 1.0f / static_cast(s); \ - } - -GLM_IMPLEMENT_SCAL_MULT(vec2) -GLM_IMPLEMENT_SCAL_MULT(vec3) -GLM_IMPLEMENT_SCAL_MULT(vec4) - -GLM_IMPLEMENT_SCAL_MULT(mat2) -GLM_IMPLEMENT_SCAL_MULT(mat2x3) -GLM_IMPLEMENT_SCAL_MULT(mat2x4) -GLM_IMPLEMENT_SCAL_MULT(mat3x2) -GLM_IMPLEMENT_SCAL_MULT(mat3) -GLM_IMPLEMENT_SCAL_MULT(mat3x4) -GLM_IMPLEMENT_SCAL_MULT(mat4x2) -GLM_IMPLEMENT_SCAL_MULT(mat4x3) -GLM_IMPLEMENT_SCAL_MULT(mat4) - -#undef GLM_IMPLEMENT_SCAL_MULT -} // namespace glm diff --git a/3rdparty/glm/source/glm/gtx/scalar_relational.hpp b/3rdparty/glm/source/glm/gtx/scalar_relational.hpp deleted file mode 100644 index 8be9c57..0000000 --- a/3rdparty/glm/source/glm/gtx/scalar_relational.hpp +++ /dev/null @@ -1,36 +0,0 @@ -/// @ref gtx_scalar_relational -/// @file glm/gtx/scalar_relational.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_scalar_relational GLM_GTX_scalar_relational -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Extend a position from a source to a position at a defined length. - -#pragma once - -// Dependency: -#include "../glm.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_extend is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_extend extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_scalar_relational - /// @{ - - - - /// @} -}//namespace glm - -#include "scalar_relational.inl" diff --git a/3rdparty/glm/source/glm/gtx/scalar_relational.inl b/3rdparty/glm/source/glm/gtx/scalar_relational.inl deleted file mode 100644 index c2a121c..0000000 --- a/3rdparty/glm/source/glm/gtx/scalar_relational.inl +++ /dev/null @@ -1,88 +0,0 @@ -/// @ref gtx_scalar_relational - -namespace glm -{ - template - GLM_FUNC_QUALIFIER bool lessThan - ( - T const& x, - T const& y - ) - { - return x < y; - } - - template - GLM_FUNC_QUALIFIER bool lessThanEqual - ( - T const& x, - T const& y - ) - { - return x <= y; - } - - template - GLM_FUNC_QUALIFIER bool greaterThan - ( - T const& x, - T const& y - ) - { - return x > y; - } - - template - GLM_FUNC_QUALIFIER bool greaterThanEqual - ( - T const& x, - T const& y - ) - { - return x >= y; - } - - template - GLM_FUNC_QUALIFIER bool equal - ( - T const& x, - T const& y - ) - { - return detail::compute_equal::is_iec559>::call(x, y); - } - - template - GLM_FUNC_QUALIFIER bool notEqual - ( - T const& x, - T const& y - ) - { - return !detail::compute_equal::is_iec559>::call(x, y); - } - - GLM_FUNC_QUALIFIER bool any - ( - bool const& x - ) - { - return x; - } - - GLM_FUNC_QUALIFIER bool all - ( - bool const& x - ) - { - return x; - } - - GLM_FUNC_QUALIFIER bool not_ - ( - bool const& x - ) - { - return !x; - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/spline.hpp b/3rdparty/glm/source/glm/gtx/spline.hpp deleted file mode 100644 index 731c979..0000000 --- a/3rdparty/glm/source/glm/gtx/spline.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/// @ref gtx_spline -/// @file glm/gtx/spline.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_spline GLM_GTX_spline -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Spline functions - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtx/optimum_pow.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_spline is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_spline extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_spline - /// @{ - - /// Return a point from a catmull rom curve. - /// @see gtx_spline extension. - template - GLM_FUNC_DECL genType catmullRom( - genType const& v1, - genType const& v2, - genType const& v3, - genType const& v4, - typename genType::value_type const& s); - - /// Return a point from a hermite curve. - /// @see gtx_spline extension. - template - GLM_FUNC_DECL genType hermite( - genType const& v1, - genType const& t1, - genType const& v2, - genType const& t2, - typename genType::value_type const& s); - - /// Return a point from a cubic curve. - /// @see gtx_spline extension. - template - GLM_FUNC_DECL genType cubic( - genType const& v1, - genType const& v2, - genType const& v3, - genType const& v4, - typename genType::value_type const& s); - - /// @} -}//namespace glm - -#include "spline.inl" diff --git a/3rdparty/glm/source/glm/gtx/spline.inl b/3rdparty/glm/source/glm/gtx/spline.inl deleted file mode 100644 index c3fd056..0000000 --- a/3rdparty/glm/source/glm/gtx/spline.inl +++ /dev/null @@ -1,60 +0,0 @@ -/// @ref gtx_spline - -namespace glm -{ - template - GLM_FUNC_QUALIFIER genType catmullRom - ( - genType const& v1, - genType const& v2, - genType const& v3, - genType const& v4, - typename genType::value_type const& s - ) - { - typename genType::value_type s2 = pow2(s); - typename genType::value_type s3 = pow3(s); - - typename genType::value_type f1 = -s3 + typename genType::value_type(2) * s2 - s; - typename genType::value_type f2 = typename genType::value_type(3) * s3 - typename genType::value_type(5) * s2 + typename genType::value_type(2); - typename genType::value_type f3 = typename genType::value_type(-3) * s3 + typename genType::value_type(4) * s2 + s; - typename genType::value_type f4 = s3 - s2; - - return (f1 * v1 + f2 * v2 + f3 * v3 + f4 * v4) / typename genType::value_type(2); - - } - - template - GLM_FUNC_QUALIFIER genType hermite - ( - genType const& v1, - genType const& t1, - genType const& v2, - genType const& t2, - typename genType::value_type const& s - ) - { - typename genType::value_type s2 = pow2(s); - typename genType::value_type s3 = pow3(s); - - typename genType::value_type f1 = typename genType::value_type(2) * s3 - typename genType::value_type(3) * s2 + typename genType::value_type(1); - typename genType::value_type f2 = typename genType::value_type(-2) * s3 + typename genType::value_type(3) * s2; - typename genType::value_type f3 = s3 - typename genType::value_type(2) * s2 + s; - typename genType::value_type f4 = s3 - s2; - - return f1 * v1 + f2 * v2 + f3 * t1 + f4 * t2; - } - - template - GLM_FUNC_QUALIFIER genType cubic - ( - genType const& v1, - genType const& v2, - genType const& v3, - genType const& v4, - typename genType::value_type const& s - ) - { - return ((v1 * s + v2) * s + v3) * s + v4; - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/std_based_type.hpp b/3rdparty/glm/source/glm/gtx/std_based_type.hpp deleted file mode 100644 index cd3be8c..0000000 --- a/3rdparty/glm/source/glm/gtx/std_based_type.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/// @ref gtx_std_based_type -/// @file glm/gtx/std_based_type.hpp -/// -/// @see core (dependence) -/// @see gtx_extented_min_max (dependence) -/// -/// @defgroup gtx_std_based_type GLM_GTX_std_based_type -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Adds vector types based on STL value types. - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_std_based_type is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_std_based_type extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_std_based_type - /// @{ - - /// Vector type based of one std::size_t component. - /// @see GLM_GTX_std_based_type - typedef vec<1, std::size_t, defaultp> size1; - - /// Vector type based of two std::size_t components. - /// @see GLM_GTX_std_based_type - typedef vec<2, std::size_t, defaultp> size2; - - /// Vector type based of three std::size_t components. - /// @see GLM_GTX_std_based_type - typedef vec<3, std::size_t, defaultp> size3; - - /// Vector type based of four std::size_t components. - /// @see GLM_GTX_std_based_type - typedef vec<4, std::size_t, defaultp> size4; - - /// Vector type based of one std::size_t component. - /// @see GLM_GTX_std_based_type - typedef vec<1, std::size_t, defaultp> size1_t; - - /// Vector type based of two std::size_t components. - /// @see GLM_GTX_std_based_type - typedef vec<2, std::size_t, defaultp> size2_t; - - /// Vector type based of three std::size_t components. - /// @see GLM_GTX_std_based_type - typedef vec<3, std::size_t, defaultp> size3_t; - - /// Vector type based of four std::size_t components. - /// @see GLM_GTX_std_based_type - typedef vec<4, std::size_t, defaultp> size4_t; - - /// @} -}//namespace glm - -#include "std_based_type.inl" diff --git a/3rdparty/glm/source/glm/gtx/std_based_type.inl b/3rdparty/glm/source/glm/gtx/std_based_type.inl deleted file mode 100644 index 9c34bdb..0000000 --- a/3rdparty/glm/source/glm/gtx/std_based_type.inl +++ /dev/null @@ -1,6 +0,0 @@ -/// @ref gtx_std_based_type - -namespace glm -{ - -} diff --git a/3rdparty/glm/source/glm/gtx/string_cast.hpp b/3rdparty/glm/source/glm/gtx/string_cast.hpp deleted file mode 100644 index 71f6ece..0000000 --- a/3rdparty/glm/source/glm/gtx/string_cast.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/// @ref gtx_string_cast -/// @file glm/gtx/string_cast.hpp -/// -/// @see core (dependence) -/// @see gtx_integer (dependence) -/// @see gtx_quaternion (dependence) -/// -/// @defgroup gtx_string_cast GLM_GTX_string_cast -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Setup strings for GLM type values - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtc/type_precision.hpp" -#include "../gtc/quaternion.hpp" -#include "../gtx/dual_quaternion.hpp" -#include -#include - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_string_cast is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_string_cast extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_string_cast - /// @{ - - /// Create a string from a GLM vector or matrix typed variable. - /// @see gtx_string_cast extension. - template - GLM_FUNC_DECL std::string to_string(genType const& x); - - /// @} -}//namespace glm - -#include "string_cast.inl" diff --git a/3rdparty/glm/source/glm/gtx/string_cast.inl b/3rdparty/glm/source/glm/gtx/string_cast.inl deleted file mode 100644 index f67751d..0000000 --- a/3rdparty/glm/source/glm/gtx/string_cast.inl +++ /dev/null @@ -1,492 +0,0 @@ -/// @ref gtx_string_cast - -#include -#include - -namespace glm{ -namespace detail -{ - template - struct cast - { - typedef T value_type; - }; - - template <> - struct cast - { - typedef double value_type; - }; - - GLM_FUNC_QUALIFIER std::string format(const char* msg, ...) - { - std::size_t const STRING_BUFFER(4096); - char text[STRING_BUFFER]; - va_list list; - - if(msg == GLM_NULLPTR) - return std::string(); - - va_start(list, msg); -# if (GLM_COMPILER & GLM_COMPILER_VC) - vsprintf_s(text, STRING_BUFFER, msg, list); -# else// - std::vsprintf(text, msg, list); -# endif// - va_end(list); - - return std::string(text); - } - - static const char* LabelTrue = "true"; - static const char* LabelFalse = "false"; - - template - struct literal - { - GLM_FUNC_QUALIFIER static char const * value() {return "%d";} - }; - - template - struct literal - { - GLM_FUNC_QUALIFIER static char const * value() {return "%f";} - }; - -# if GLM_MODEL == GLM_MODEL_32 && GLM_COMPILER && GLM_COMPILER_VC - template<> - struct literal - { - GLM_FUNC_QUALIFIER static char const * value() {return "%lld";} - }; - - template<> - struct literal - { - GLM_FUNC_QUALIFIER static char const * value() {return "%lld";} - }; -# endif//GLM_MODEL == GLM_MODEL_32 && GLM_COMPILER && GLM_COMPILER_VC - - template - struct prefix{}; - - template<> - struct prefix - { - GLM_FUNC_QUALIFIER static char const * value() {return "";} - }; - - template<> - struct prefix - { - GLM_FUNC_QUALIFIER static char const * value() {return "d";} - }; - - template<> - struct prefix - { - GLM_FUNC_QUALIFIER static char const * value() {return "b";} - }; - - template<> - struct prefix - { - GLM_FUNC_QUALIFIER static char const * value() {return "u8";} - }; - - template<> - struct prefix - { - GLM_FUNC_QUALIFIER static char const * value() {return "i8";} - }; - - template<> - struct prefix - { - GLM_FUNC_QUALIFIER static char const * value() {return "u16";} - }; - - template<> - struct prefix - { - GLM_FUNC_QUALIFIER static char const * value() {return "i16";} - }; - - template<> - struct prefix - { - GLM_FUNC_QUALIFIER static char const * value() {return "u";} - }; - - template<> - struct prefix - { - GLM_FUNC_QUALIFIER static char const * value() {return "i";} - }; - - template<> - struct prefix - { - GLM_FUNC_QUALIFIER static char const * value() {return "u64";} - }; - - template<> - struct prefix - { - GLM_FUNC_QUALIFIER static char const * value() {return "i64";} - }; - - template - struct compute_to_string - {}; - - template - struct compute_to_string > - { - GLM_FUNC_QUALIFIER static std::string call(vec<1, bool, Q> const& x) - { - return detail::format("bvec1(%s)", - x[0] ? detail::LabelTrue : detail::LabelFalse); - } - }; - - template - struct compute_to_string > - { - GLM_FUNC_QUALIFIER static std::string call(vec<2, bool, Q> const& x) - { - return detail::format("bvec2(%s, %s)", - x[0] ? detail::LabelTrue : detail::LabelFalse, - x[1] ? detail::LabelTrue : detail::LabelFalse); - } - }; - - template - struct compute_to_string > - { - GLM_FUNC_QUALIFIER static std::string call(vec<3, bool, Q> const& x) - { - return detail::format("bvec3(%s, %s, %s)", - x[0] ? detail::LabelTrue : detail::LabelFalse, - x[1] ? detail::LabelTrue : detail::LabelFalse, - x[2] ? detail::LabelTrue : detail::LabelFalse); - } - }; - - template - struct compute_to_string > - { - GLM_FUNC_QUALIFIER static std::string call(vec<4, bool, Q> const& x) - { - return detail::format("bvec4(%s, %s, %s, %s)", - x[0] ? detail::LabelTrue : detail::LabelFalse, - x[1] ? detail::LabelTrue : detail::LabelFalse, - x[2] ? detail::LabelTrue : detail::LabelFalse, - x[3] ? detail::LabelTrue : detail::LabelFalse); - } - }; - - template - struct compute_to_string > - { - GLM_FUNC_QUALIFIER static std::string call(vec<1, T, Q> const& x) - { - char const * PrefixStr = prefix::value(); - char const * LiteralStr = literal::is_iec559>::value(); - std::string FormatStr(detail::format("%svec1(%s)", - PrefixStr, - LiteralStr)); - - return detail::format(FormatStr.c_str(), - static_cast::value_type>(x[0])); - } - }; - - template - struct compute_to_string > - { - GLM_FUNC_QUALIFIER static std::string call(vec<2, T, Q> const& x) - { - char const * PrefixStr = prefix::value(); - char const * LiteralStr = literal::is_iec559>::value(); - std::string FormatStr(detail::format("%svec2(%s, %s)", - PrefixStr, - LiteralStr, LiteralStr)); - - return detail::format(FormatStr.c_str(), - static_cast::value_type>(x[0]), - static_cast::value_type>(x[1])); - } - }; - - template - struct compute_to_string > - { - GLM_FUNC_QUALIFIER static std::string call(vec<3, T, Q> const& x) - { - char const * PrefixStr = prefix::value(); - char const * LiteralStr = literal::is_iec559>::value(); - std::string FormatStr(detail::format("%svec3(%s, %s, %s)", - PrefixStr, - LiteralStr, LiteralStr, LiteralStr)); - - return detail::format(FormatStr.c_str(), - static_cast::value_type>(x[0]), - static_cast::value_type>(x[1]), - static_cast::value_type>(x[2])); - } - }; - - template - struct compute_to_string > - { - GLM_FUNC_QUALIFIER static std::string call(vec<4, T, Q> const& x) - { - char const * PrefixStr = prefix::value(); - char const * LiteralStr = literal::is_iec559>::value(); - std::string FormatStr(detail::format("%svec4(%s, %s, %s, %s)", - PrefixStr, - LiteralStr, LiteralStr, LiteralStr, LiteralStr)); - - return detail::format(FormatStr.c_str(), - static_cast::value_type>(x[0]), - static_cast::value_type>(x[1]), - static_cast::value_type>(x[2]), - static_cast::value_type>(x[3])); - } - }; - - - template - struct compute_to_string > - { - GLM_FUNC_QUALIFIER static std::string call(mat<2, 2, T, Q> const& x) - { - char const * PrefixStr = prefix::value(); - char const * LiteralStr = literal::is_iec559>::value(); - std::string FormatStr(detail::format("%smat2x2((%s, %s), (%s, %s))", - PrefixStr, - LiteralStr, LiteralStr, - LiteralStr, LiteralStr)); - - return detail::format(FormatStr.c_str(), - static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), - static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1])); - } - }; - - template - struct compute_to_string > - { - GLM_FUNC_QUALIFIER static std::string call(mat<2, 3, T, Q> const& x) - { - char const * PrefixStr = prefix::value(); - char const * LiteralStr = literal::is_iec559>::value(); - std::string FormatStr(detail::format("%smat2x3((%s, %s, %s), (%s, %s, %s))", - PrefixStr, - LiteralStr, LiteralStr, LiteralStr, - LiteralStr, LiteralStr, LiteralStr)); - - return detail::format(FormatStr.c_str(), - static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), static_cast::value_type>(x[0][2]), - static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1]), static_cast::value_type>(x[1][2])); - } - }; - - template - struct compute_to_string > - { - GLM_FUNC_QUALIFIER static std::string call(mat<2, 4, T, Q> const& x) - { - char const * PrefixStr = prefix::value(); - char const * LiteralStr = literal::is_iec559>::value(); - std::string FormatStr(detail::format("%smat2x4((%s, %s, %s, %s), (%s, %s, %s, %s))", - PrefixStr, - LiteralStr, LiteralStr, LiteralStr, LiteralStr, - LiteralStr, LiteralStr, LiteralStr, LiteralStr)); - - return detail::format(FormatStr.c_str(), - static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), static_cast::value_type>(x[0][2]), static_cast::value_type>(x[0][3]), - static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1]), static_cast::value_type>(x[1][2]), static_cast::value_type>(x[1][3])); - } - }; - - template - struct compute_to_string > - { - GLM_FUNC_QUALIFIER static std::string call(mat<3, 2, T, Q> const& x) - { - char const * PrefixStr = prefix::value(); - char const * LiteralStr = literal::is_iec559>::value(); - std::string FormatStr(detail::format("%smat3x2((%s, %s), (%s, %s), (%s, %s))", - PrefixStr, - LiteralStr, LiteralStr, - LiteralStr, LiteralStr, - LiteralStr, LiteralStr)); - - return detail::format(FormatStr.c_str(), - static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), - static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1]), - static_cast::value_type>(x[2][0]), static_cast::value_type>(x[2][1])); - } - }; - - template - struct compute_to_string > - { - GLM_FUNC_QUALIFIER static std::string call(mat<3, 3, T, Q> const& x) - { - char const * PrefixStr = prefix::value(); - char const * LiteralStr = literal::is_iec559>::value(); - std::string FormatStr(detail::format("%smat3x3((%s, %s, %s), (%s, %s, %s), (%s, %s, %s))", - PrefixStr, - LiteralStr, LiteralStr, LiteralStr, - LiteralStr, LiteralStr, LiteralStr, - LiteralStr, LiteralStr, LiteralStr)); - - return detail::format(FormatStr.c_str(), - static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), static_cast::value_type>(x[0][2]), - static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1]), static_cast::value_type>(x[1][2]), - static_cast::value_type>(x[2][0]), static_cast::value_type>(x[2][1]), static_cast::value_type>(x[2][2])); - } - }; - - template - struct compute_to_string > - { - GLM_FUNC_QUALIFIER static std::string call(mat<3, 4, T, Q> const& x) - { - char const * PrefixStr = prefix::value(); - char const * LiteralStr = literal::is_iec559>::value(); - std::string FormatStr(detail::format("%smat3x4((%s, %s, %s, %s), (%s, %s, %s, %s), (%s, %s, %s, %s))", - PrefixStr, - LiteralStr, LiteralStr, LiteralStr, LiteralStr, - LiteralStr, LiteralStr, LiteralStr, LiteralStr, - LiteralStr, LiteralStr, LiteralStr, LiteralStr)); - - return detail::format(FormatStr.c_str(), - static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), static_cast::value_type>(x[0][2]), static_cast::value_type>(x[0][3]), - static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1]), static_cast::value_type>(x[1][2]), static_cast::value_type>(x[1][3]), - static_cast::value_type>(x[2][0]), static_cast::value_type>(x[2][1]), static_cast::value_type>(x[2][2]), static_cast::value_type>(x[2][3])); - } - }; - - template - struct compute_to_string > - { - GLM_FUNC_QUALIFIER static std::string call(mat<4, 2, T, Q> const& x) - { - char const * PrefixStr = prefix::value(); - char const * LiteralStr = literal::is_iec559>::value(); - std::string FormatStr(detail::format("%smat4x2((%s, %s), (%s, %s), (%s, %s), (%s, %s))", - PrefixStr, - LiteralStr, LiteralStr, - LiteralStr, LiteralStr, - LiteralStr, LiteralStr, - LiteralStr, LiteralStr)); - - return detail::format(FormatStr.c_str(), - static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), - static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1]), - static_cast::value_type>(x[2][0]), static_cast::value_type>(x[2][1]), - static_cast::value_type>(x[3][0]), static_cast::value_type>(x[3][1])); - } - }; - - template - struct compute_to_string > - { - GLM_FUNC_QUALIFIER static std::string call(mat<4, 3, T, Q> const& x) - { - char const * PrefixStr = prefix::value(); - char const * LiteralStr = literal::is_iec559>::value(); - std::string FormatStr(detail::format("%smat4x3((%s, %s, %s), (%s, %s, %s), (%s, %s, %s), (%s, %s, %s))", - PrefixStr, - LiteralStr, LiteralStr, LiteralStr, - LiteralStr, LiteralStr, LiteralStr, - LiteralStr, LiteralStr, LiteralStr, - LiteralStr, LiteralStr, LiteralStr)); - - return detail::format(FormatStr.c_str(), - static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), static_cast::value_type>(x[0][2]), - static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1]), static_cast::value_type>(x[1][2]), - static_cast::value_type>(x[2][0]), static_cast::value_type>(x[2][1]), static_cast::value_type>(x[2][2]), - static_cast::value_type>(x[3][0]), static_cast::value_type>(x[3][1]), static_cast::value_type>(x[3][2])); - } - }; - - template - struct compute_to_string > - { - GLM_FUNC_QUALIFIER static std::string call(mat<4, 4, T, Q> const& x) - { - char const * PrefixStr = prefix::value(); - char const * LiteralStr = literal::is_iec559>::value(); - std::string FormatStr(detail::format("%smat4x4((%s, %s, %s, %s), (%s, %s, %s, %s), (%s, %s, %s, %s), (%s, %s, %s, %s))", - PrefixStr, - LiteralStr, LiteralStr, LiteralStr, LiteralStr, - LiteralStr, LiteralStr, LiteralStr, LiteralStr, - LiteralStr, LiteralStr, LiteralStr, LiteralStr, - LiteralStr, LiteralStr, LiteralStr, LiteralStr)); - - return detail::format(FormatStr.c_str(), - static_cast::value_type>(x[0][0]), static_cast::value_type>(x[0][1]), static_cast::value_type>(x[0][2]), static_cast::value_type>(x[0][3]), - static_cast::value_type>(x[1][0]), static_cast::value_type>(x[1][1]), static_cast::value_type>(x[1][2]), static_cast::value_type>(x[1][3]), - static_cast::value_type>(x[2][0]), static_cast::value_type>(x[2][1]), static_cast::value_type>(x[2][2]), static_cast::value_type>(x[2][3]), - static_cast::value_type>(x[3][0]), static_cast::value_type>(x[3][1]), static_cast::value_type>(x[3][2]), static_cast::value_type>(x[3][3])); - } - }; - - - template - struct compute_to_string > - { - GLM_FUNC_QUALIFIER static std::string call(qua const& q) - { - char const * PrefixStr = prefix::value(); - char const * LiteralStr = literal::is_iec559>::value(); - std::string FormatStr(detail::format("%squat(%s, {%s, %s, %s})", - PrefixStr, - LiteralStr, LiteralStr, LiteralStr, LiteralStr)); - - return detail::format(FormatStr.c_str(), - static_cast::value_type>(q.w), - static_cast::value_type>(q.x), - static_cast::value_type>(q.y), - static_cast::value_type>(q.z)); - } - }; - - template - struct compute_to_string > - { - GLM_FUNC_QUALIFIER static std::string call(tdualquat const& x) - { - char const * PrefixStr = prefix::value(); - char const * LiteralStr = literal::is_iec559>::value(); - std::string FormatStr(detail::format("%sdualquat((%s, {%s, %s, %s}), (%s, {%s, %s, %s}))", - PrefixStr, - LiteralStr, LiteralStr, LiteralStr, LiteralStr, - LiteralStr, LiteralStr, LiteralStr, LiteralStr)); - - return detail::format(FormatStr.c_str(), - static_cast::value_type>(x.real.w), - static_cast::value_type>(x.real.x), - static_cast::value_type>(x.real.y), - static_cast::value_type>(x.real.z), - static_cast::value_type>(x.dual.w), - static_cast::value_type>(x.dual.x), - static_cast::value_type>(x.dual.y), - static_cast::value_type>(x.dual.z)); - } - }; - -}//namespace detail - -template -GLM_FUNC_QUALIFIER std::string to_string(matType const& x) -{ - return detail::compute_to_string::call(x); -} - -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/texture.hpp b/3rdparty/glm/source/glm/gtx/texture.hpp deleted file mode 100644 index 20585e6..0000000 --- a/3rdparty/glm/source/glm/gtx/texture.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/// @ref gtx_texture -/// @file glm/gtx/texture.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_texture GLM_GTX_texture -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Wrapping mode of texture coordinates. - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtc/integer.hpp" -#include "../gtx/component_wise.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_texture is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_texture extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_texture - /// @{ - - /// Compute the number of mipmaps levels necessary to create a mipmap complete texture - /// - /// @param Extent Extent of the texture base level mipmap - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point or signed integer scalar types - /// @tparam Q Value from qualifier enum - template - T levels(vec const& Extent); - - /// @} -}// namespace glm - -#include "texture.inl" - diff --git a/3rdparty/glm/source/glm/gtx/texture.inl b/3rdparty/glm/source/glm/gtx/texture.inl deleted file mode 100644 index 593c826..0000000 --- a/3rdparty/glm/source/glm/gtx/texture.inl +++ /dev/null @@ -1,17 +0,0 @@ -/// @ref gtx_texture - -namespace glm -{ - template - inline T levels(vec const& Extent) - { - return glm::log2(compMax(Extent)) + static_cast(1); - } - - template - inline T levels(T Extent) - { - return vec<1, T, defaultp>(Extent).x; - } -}//namespace glm - diff --git a/3rdparty/glm/source/glm/gtx/transform.hpp b/3rdparty/glm/source/glm/gtx/transform.hpp deleted file mode 100644 index 0279fc8..0000000 --- a/3rdparty/glm/source/glm/gtx/transform.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/// @ref gtx_transform -/// @file glm/gtx/transform.hpp -/// -/// @see core (dependence) -/// @see gtc_matrix_transform (dependence) -/// @see gtx_transform -/// @see gtx_transform2 -/// -/// @defgroup gtx_transform GLM_GTX_transform -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Add transformation matrices - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtc/matrix_transform.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_transform is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_transform extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_transform - /// @{ - - /// Transforms a matrix with a translation 4 * 4 matrix created from 3 scalars. - /// @see gtc_matrix_transform - /// @see gtx_transform - template - GLM_FUNC_DECL mat<4, 4, T, Q> translate( - vec<3, T, Q> const& v); - - /// Builds a rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in radians. - /// @see gtc_matrix_transform - /// @see gtx_transform - template - GLM_FUNC_DECL mat<4, 4, T, Q> rotate( - T angle, - vec<3, T, Q> const& v); - - /// Transforms a matrix with a scale 4 * 4 matrix created from a vector of 3 components. - /// @see gtc_matrix_transform - /// @see gtx_transform - template - GLM_FUNC_DECL mat<4, 4, T, Q> scale( - vec<3, T, Q> const& v); - - /// @} -}// namespace glm - -#include "transform.inl" diff --git a/3rdparty/glm/source/glm/gtx/transform.inl b/3rdparty/glm/source/glm/gtx/transform.inl deleted file mode 100644 index 48ee680..0000000 --- a/3rdparty/glm/source/glm/gtx/transform.inl +++ /dev/null @@ -1,23 +0,0 @@ -/// @ref gtx_transform - -namespace glm -{ - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> translate(vec<3, T, Q> const& v) - { - return translate(mat<4, 4, T, Q>(static_cast(1)), v); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rotate(T angle, vec<3, T, Q> const& v) - { - return rotate(mat<4, 4, T, Q>(static_cast(1)), angle, v); - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scale(vec<3, T, Q> const& v) - { - return scale(mat<4, 4, T, Q>(static_cast(1)), v); - } - -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/transform2.hpp b/3rdparty/glm/source/glm/gtx/transform2.hpp deleted file mode 100644 index 0d8ba9d..0000000 --- a/3rdparty/glm/source/glm/gtx/transform2.hpp +++ /dev/null @@ -1,89 +0,0 @@ -/// @ref gtx_transform2 -/// @file glm/gtx/transform2.hpp -/// -/// @see core (dependence) -/// @see gtx_transform (dependence) -/// -/// @defgroup gtx_transform2 GLM_GTX_transform2 -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Add extra transformation matrices - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtx/transform.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_transform2 is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_transform2 extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_transform2 - /// @{ - - //! Transforms a matrix with a shearing on X axis. - //! From GLM_GTX_transform2 extension. - template - GLM_FUNC_DECL mat<3, 3, T, Q> shearX2D(mat<3, 3, T, Q> const& m, T y); - - //! Transforms a matrix with a shearing on Y axis. - //! From GLM_GTX_transform2 extension. - template - GLM_FUNC_DECL mat<3, 3, T, Q> shearY2D(mat<3, 3, T, Q> const& m, T x); - - //! Transforms a matrix with a shearing on X axis - //! From GLM_GTX_transform2 extension. - template - GLM_FUNC_DECL mat<4, 4, T, Q> shearX3D(mat<4, 4, T, Q> const& m, T y, T z); - - //! Transforms a matrix with a shearing on Y axis. - //! From GLM_GTX_transform2 extension. - template - GLM_FUNC_DECL mat<4, 4, T, Q> shearY3D(mat<4, 4, T, Q> const& m, T x, T z); - - //! Transforms a matrix with a shearing on Z axis. - //! From GLM_GTX_transform2 extension. - template - GLM_FUNC_DECL mat<4, 4, T, Q> shearZ3D(mat<4, 4, T, Q> const& m, T x, T y); - - //template GLM_FUNC_QUALIFIER mat<4, 4, T, Q> shear(const mat<4, 4, T, Q> & m, shearPlane, planePoint, angle) - // Identity + tan(angle) * cross(Normal, OnPlaneVector) 0 - // - dot(PointOnPlane, normal) * OnPlaneVector 1 - - // Reflect functions seem to don't work - //template mat<3, 3, T, Q> reflect2D(const mat<3, 3, T, Q> & m, const vec<3, T, Q>& normal){return reflect2DGTX(m, normal);} //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension) - //template mat<4, 4, T, Q> reflect3D(const mat<4, 4, T, Q> & m, const vec<3, T, Q>& normal){return reflect3DGTX(m, normal);} //!< \brief Build a reflection matrix (from GLM_GTX_transform2 extension) - - //! Build planar projection matrix along normal axis. - //! From GLM_GTX_transform2 extension. - template - GLM_FUNC_DECL mat<3, 3, T, Q> proj2D(mat<3, 3, T, Q> const& m, vec<3, T, Q> const& normal); - - //! Build planar projection matrix along normal axis. - //! From GLM_GTX_transform2 extension. - template - GLM_FUNC_DECL mat<4, 4, T, Q> proj3D(mat<4, 4, T, Q> const & m, vec<3, T, Q> const& normal); - - //! Build a scale bias matrix. - //! From GLM_GTX_transform2 extension. - template - GLM_FUNC_DECL mat<4, 4, T, Q> scaleBias(T scale, T bias); - - //! Build a scale bias matrix. - //! From GLM_GTX_transform2 extension. - template - GLM_FUNC_DECL mat<4, 4, T, Q> scaleBias(mat<4, 4, T, Q> const& m, T scale, T bias); - - /// @} -}// namespace glm - -#include "transform2.inl" diff --git a/3rdparty/glm/source/glm/gtx/transform2.inl b/3rdparty/glm/source/glm/gtx/transform2.inl deleted file mode 100644 index 0118ab0..0000000 --- a/3rdparty/glm/source/glm/gtx/transform2.inl +++ /dev/null @@ -1,125 +0,0 @@ -/// @ref gtx_transform2 - -namespace glm -{ - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> shearX2D(mat<3, 3, T, Q> const& m, T s) - { - mat<3, 3, T, Q> r(1); - r[1][0] = s; - return m * r; - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> shearY2D(mat<3, 3, T, Q> const& m, T s) - { - mat<3, 3, T, Q> r(1); - r[0][1] = s; - return m * r; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> shearX3D(mat<4, 4, T, Q> const& m, T s, T t) - { - mat<4, 4, T, Q> r(1); - r[0][1] = s; - r[0][2] = t; - return m * r; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> shearY3D(mat<4, 4, T, Q> const& m, T s, T t) - { - mat<4, 4, T, Q> r(1); - r[1][0] = s; - r[1][2] = t; - return m * r; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> shearZ3D(mat<4, 4, T, Q> const& m, T s, T t) - { - mat<4, 4, T, Q> r(1); - r[2][0] = s; - r[2][1] = t; - return m * r; - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> reflect2D(mat<3, 3, T, Q> const& m, vec<3, T, Q> const& normal) - { - mat<3, 3, T, Q> r(static_cast(1)); - r[0][0] = static_cast(1) - static_cast(2) * normal.x * normal.x; - r[0][1] = -static_cast(2) * normal.x * normal.y; - r[1][0] = -static_cast(2) * normal.x * normal.y; - r[1][1] = static_cast(1) - static_cast(2) * normal.y * normal.y; - return m * r; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> reflect3D(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& normal) - { - mat<4, 4, T, Q> r(static_cast(1)); - r[0][0] = static_cast(1) - static_cast(2) * normal.x * normal.x; - r[0][1] = -static_cast(2) * normal.x * normal.y; - r[0][2] = -static_cast(2) * normal.x * normal.z; - - r[1][0] = -static_cast(2) * normal.x * normal.y; - r[1][1] = static_cast(1) - static_cast(2) * normal.y * normal.y; - r[1][2] = -static_cast(2) * normal.y * normal.z; - - r[2][0] = -static_cast(2) * normal.x * normal.z; - r[2][1] = -static_cast(2) * normal.y * normal.z; - r[2][2] = static_cast(1) - static_cast(2) * normal.z * normal.z; - return m * r; - } - - template - GLM_FUNC_QUALIFIER mat<3, 3, T, Q> proj2D( - const mat<3, 3, T, Q>& m, - const vec<3, T, Q>& normal) - { - mat<3, 3, T, Q> r(static_cast(1)); - r[0][0] = static_cast(1) - normal.x * normal.x; - r[0][1] = - normal.x * normal.y; - r[1][0] = - normal.x * normal.y; - r[1][1] = static_cast(1) - normal.y * normal.y; - return m * r; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> proj3D( - const mat<4, 4, T, Q>& m, - const vec<3, T, Q>& normal) - { - mat<4, 4, T, Q> r(static_cast(1)); - r[0][0] = static_cast(1) - normal.x * normal.x; - r[0][1] = - normal.x * normal.y; - r[0][2] = - normal.x * normal.z; - r[1][0] = - normal.x * normal.y; - r[1][1] = static_cast(1) - normal.y * normal.y; - r[1][2] = - normal.y * normal.z; - r[2][0] = - normal.x * normal.z; - r[2][1] = - normal.y * normal.z; - r[2][2] = static_cast(1) - normal.z * normal.z; - return m * r; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scaleBias(T scale, T bias) - { - mat<4, 4, T, Q> result; - result[3] = vec<4, T, Q>(vec<3, T, Q>(bias), static_cast(1)); - result[0][0] = scale; - result[1][1] = scale; - result[2][2] = scale; - return result; - } - - template - GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scaleBias(mat<4, 4, T, Q> const& m, T scale, T bias) - { - return m * scaleBias(scale, bias); - } -}//namespace glm - diff --git a/3rdparty/glm/source/glm/gtx/type_aligned.hpp b/3rdparty/glm/source/glm/gtx/type_aligned.hpp deleted file mode 100644 index 2ae522c..0000000 --- a/3rdparty/glm/source/glm/gtx/type_aligned.hpp +++ /dev/null @@ -1,982 +0,0 @@ -/// @ref gtx_type_aligned -/// @file glm/gtx/type_aligned.hpp -/// -/// @see core (dependence) -/// @see gtc_quaternion (dependence) -/// -/// @defgroup gtx_type_aligned GLM_GTX_type_aligned -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Defines aligned types. - -#pragma once - -// Dependency: -#include "../gtc/type_precision.hpp" -#include "../gtc/quaternion.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_type_aligned is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_type_aligned extension included") -# endif -#endif - -namespace glm -{ - /////////////////////////// - // Signed int vector types - - /// @addtogroup gtx_type_aligned - /// @{ - - /// Low qualifier 8 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_int8, aligned_lowp_int8, 1); - - /// Low qualifier 16 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_int16, aligned_lowp_int16, 2); - - /// Low qualifier 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_int32, aligned_lowp_int32, 4); - - /// Low qualifier 64 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_int64, aligned_lowp_int64, 8); - - - /// Low qualifier 8 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_int8_t, aligned_lowp_int8_t, 1); - - /// Low qualifier 16 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_int16_t, aligned_lowp_int16_t, 2); - - /// Low qualifier 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_int32_t, aligned_lowp_int32_t, 4); - - /// Low qualifier 64 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_int64_t, aligned_lowp_int64_t, 8); - - - /// Low qualifier 8 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_i8, aligned_lowp_i8, 1); - - /// Low qualifier 16 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_i16, aligned_lowp_i16, 2); - - /// Low qualifier 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_i32, aligned_lowp_i32, 4); - - /// Low qualifier 64 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_i64, aligned_lowp_i64, 8); - - - /// Medium qualifier 8 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_int8, aligned_mediump_int8, 1); - - /// Medium qualifier 16 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_int16, aligned_mediump_int16, 2); - - /// Medium qualifier 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_int32, aligned_mediump_int32, 4); - - /// Medium qualifier 64 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_int64, aligned_mediump_int64, 8); - - - /// Medium qualifier 8 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_int8_t, aligned_mediump_int8_t, 1); - - /// Medium qualifier 16 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_int16_t, aligned_mediump_int16_t, 2); - - /// Medium qualifier 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_int32_t, aligned_mediump_int32_t, 4); - - /// Medium qualifier 64 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_int64_t, aligned_mediump_int64_t, 8); - - - /// Medium qualifier 8 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_i8, aligned_mediump_i8, 1); - - /// Medium qualifier 16 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_i16, aligned_mediump_i16, 2); - - /// Medium qualifier 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_i32, aligned_mediump_i32, 4); - - /// Medium qualifier 64 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_i64, aligned_mediump_i64, 8); - - - /// High qualifier 8 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_int8, aligned_highp_int8, 1); - - /// High qualifier 16 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_int16, aligned_highp_int16, 2); - - /// High qualifier 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_int32, aligned_highp_int32, 4); - - /// High qualifier 64 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_int64, aligned_highp_int64, 8); - - - /// High qualifier 8 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_int8_t, aligned_highp_int8_t, 1); - - /// High qualifier 16 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_int16_t, aligned_highp_int16_t, 2); - - /// High qualifier 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_int32_t, aligned_highp_int32_t, 4); - - /// High qualifier 64 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_int64_t, aligned_highp_int64_t, 8); - - - /// High qualifier 8 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_i8, aligned_highp_i8, 1); - - /// High qualifier 16 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_i16, aligned_highp_i16, 2); - - /// High qualifier 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_i32, aligned_highp_i32, 4); - - /// High qualifier 64 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_i64, aligned_highp_i64, 8); - - - /// Default qualifier 8 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(int8, aligned_int8, 1); - - /// Default qualifier 16 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(int16, aligned_int16, 2); - - /// Default qualifier 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(int32, aligned_int32, 4); - - /// Default qualifier 64 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(int64, aligned_int64, 8); - - - /// Default qualifier 8 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(int8_t, aligned_int8_t, 1); - - /// Default qualifier 16 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(int16_t, aligned_int16_t, 2); - - /// Default qualifier 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(int32_t, aligned_int32_t, 4); - - /// Default qualifier 64 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(int64_t, aligned_int64_t, 8); - - - /// Default qualifier 8 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i8, aligned_i8, 1); - - /// Default qualifier 16 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i16, aligned_i16, 2); - - /// Default qualifier 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i32, aligned_i32, 4); - - /// Default qualifier 64 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i64, aligned_i64, 8); - - - /// Default qualifier 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(ivec1, aligned_ivec1, 4); - - /// Default qualifier 32 bit signed integer aligned vector of 2 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(ivec2, aligned_ivec2, 8); - - /// Default qualifier 32 bit signed integer aligned vector of 3 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(ivec3, aligned_ivec3, 16); - - /// Default qualifier 32 bit signed integer aligned vector of 4 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(ivec4, aligned_ivec4, 16); - - - /// Default qualifier 8 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i8vec1, aligned_i8vec1, 1); - - /// Default qualifier 8 bit signed integer aligned vector of 2 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i8vec2, aligned_i8vec2, 2); - - /// Default qualifier 8 bit signed integer aligned vector of 3 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i8vec3, aligned_i8vec3, 4); - - /// Default qualifier 8 bit signed integer aligned vector of 4 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i8vec4, aligned_i8vec4, 4); - - - /// Default qualifier 16 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i16vec1, aligned_i16vec1, 2); - - /// Default qualifier 16 bit signed integer aligned vector of 2 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i16vec2, aligned_i16vec2, 4); - - /// Default qualifier 16 bit signed integer aligned vector of 3 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i16vec3, aligned_i16vec3, 8); - - /// Default qualifier 16 bit signed integer aligned vector of 4 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i16vec4, aligned_i16vec4, 8); - - - /// Default qualifier 32 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i32vec1, aligned_i32vec1, 4); - - /// Default qualifier 32 bit signed integer aligned vector of 2 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i32vec2, aligned_i32vec2, 8); - - /// Default qualifier 32 bit signed integer aligned vector of 3 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i32vec3, aligned_i32vec3, 16); - - /// Default qualifier 32 bit signed integer aligned vector of 4 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i32vec4, aligned_i32vec4, 16); - - - /// Default qualifier 64 bit signed integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i64vec1, aligned_i64vec1, 8); - - /// Default qualifier 64 bit signed integer aligned vector of 2 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i64vec2, aligned_i64vec2, 16); - - /// Default qualifier 64 bit signed integer aligned vector of 3 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i64vec3, aligned_i64vec3, 32); - - /// Default qualifier 64 bit signed integer aligned vector of 4 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(i64vec4, aligned_i64vec4, 32); - - - ///////////////////////////// - // Unsigned int vector types - - /// Low qualifier 8 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_uint8, aligned_lowp_uint8, 1); - - /// Low qualifier 16 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_uint16, aligned_lowp_uint16, 2); - - /// Low qualifier 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_uint32, aligned_lowp_uint32, 4); - - /// Low qualifier 64 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_uint64, aligned_lowp_uint64, 8); - - - /// Low qualifier 8 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_uint8_t, aligned_lowp_uint8_t, 1); - - /// Low qualifier 16 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_uint16_t, aligned_lowp_uint16_t, 2); - - /// Low qualifier 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_uint32_t, aligned_lowp_uint32_t, 4); - - /// Low qualifier 64 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_uint64_t, aligned_lowp_uint64_t, 8); - - - /// Low qualifier 8 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_u8, aligned_lowp_u8, 1); - - /// Low qualifier 16 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_u16, aligned_lowp_u16, 2); - - /// Low qualifier 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_u32, aligned_lowp_u32, 4); - - /// Low qualifier 64 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(lowp_u64, aligned_lowp_u64, 8); - - - /// Medium qualifier 8 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_uint8, aligned_mediump_uint8, 1); - - /// Medium qualifier 16 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_uint16, aligned_mediump_uint16, 2); - - /// Medium qualifier 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_uint32, aligned_mediump_uint32, 4); - - /// Medium qualifier 64 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_uint64, aligned_mediump_uint64, 8); - - - /// Medium qualifier 8 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_uint8_t, aligned_mediump_uint8_t, 1); - - /// Medium qualifier 16 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_uint16_t, aligned_mediump_uint16_t, 2); - - /// Medium qualifier 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_uint32_t, aligned_mediump_uint32_t, 4); - - /// Medium qualifier 64 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_uint64_t, aligned_mediump_uint64_t, 8); - - - /// Medium qualifier 8 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_u8, aligned_mediump_u8, 1); - - /// Medium qualifier 16 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_u16, aligned_mediump_u16, 2); - - /// Medium qualifier 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_u32, aligned_mediump_u32, 4); - - /// Medium qualifier 64 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mediump_u64, aligned_mediump_u64, 8); - - - /// High qualifier 8 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_uint8, aligned_highp_uint8, 1); - - /// High qualifier 16 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_uint16, aligned_highp_uint16, 2); - - /// High qualifier 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_uint32, aligned_highp_uint32, 4); - - /// High qualifier 64 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_uint64, aligned_highp_uint64, 8); - - - /// High qualifier 8 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_uint8_t, aligned_highp_uint8_t, 1); - - /// High qualifier 16 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_uint16_t, aligned_highp_uint16_t, 2); - - /// High qualifier 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_uint32_t, aligned_highp_uint32_t, 4); - - /// High qualifier 64 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_uint64_t, aligned_highp_uint64_t, 8); - - - /// High qualifier 8 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_u8, aligned_highp_u8, 1); - - /// High qualifier 16 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_u16, aligned_highp_u16, 2); - - /// High qualifier 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_u32, aligned_highp_u32, 4); - - /// High qualifier 64 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(highp_u64, aligned_highp_u64, 8); - - - /// Default qualifier 8 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(uint8, aligned_uint8, 1); - - /// Default qualifier 16 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(uint16, aligned_uint16, 2); - - /// Default qualifier 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(uint32, aligned_uint32, 4); - - /// Default qualifier 64 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(uint64, aligned_uint64, 8); - - - /// Default qualifier 8 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(uint8_t, aligned_uint8_t, 1); - - /// Default qualifier 16 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(uint16_t, aligned_uint16_t, 2); - - /// Default qualifier 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(uint32_t, aligned_uint32_t, 4); - - /// Default qualifier 64 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(uint64_t, aligned_uint64_t, 8); - - - /// Default qualifier 8 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u8, aligned_u8, 1); - - /// Default qualifier 16 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u16, aligned_u16, 2); - - /// Default qualifier 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u32, aligned_u32, 4); - - /// Default qualifier 64 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u64, aligned_u64, 8); - - - /// Default qualifier 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(uvec1, aligned_uvec1, 4); - - /// Default qualifier 32 bit unsigned integer aligned vector of 2 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(uvec2, aligned_uvec2, 8); - - /// Default qualifier 32 bit unsigned integer aligned vector of 3 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(uvec3, aligned_uvec3, 16); - - /// Default qualifier 32 bit unsigned integer aligned vector of 4 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(uvec4, aligned_uvec4, 16); - - - /// Default qualifier 8 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u8vec1, aligned_u8vec1, 1); - - /// Default qualifier 8 bit unsigned integer aligned vector of 2 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u8vec2, aligned_u8vec2, 2); - - /// Default qualifier 8 bit unsigned integer aligned vector of 3 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u8vec3, aligned_u8vec3, 4); - - /// Default qualifier 8 bit unsigned integer aligned vector of 4 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u8vec4, aligned_u8vec4, 4); - - - /// Default qualifier 16 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u16vec1, aligned_u16vec1, 2); - - /// Default qualifier 16 bit unsigned integer aligned vector of 2 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u16vec2, aligned_u16vec2, 4); - - /// Default qualifier 16 bit unsigned integer aligned vector of 3 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u16vec3, aligned_u16vec3, 8); - - /// Default qualifier 16 bit unsigned integer aligned vector of 4 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u16vec4, aligned_u16vec4, 8); - - - /// Default qualifier 32 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u32vec1, aligned_u32vec1, 4); - - /// Default qualifier 32 bit unsigned integer aligned vector of 2 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u32vec2, aligned_u32vec2, 8); - - /// Default qualifier 32 bit unsigned integer aligned vector of 3 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u32vec3, aligned_u32vec3, 16); - - /// Default qualifier 32 bit unsigned integer aligned vector of 4 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u32vec4, aligned_u32vec4, 16); - - - /// Default qualifier 64 bit unsigned integer aligned scalar type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u64vec1, aligned_u64vec1, 8); - - /// Default qualifier 64 bit unsigned integer aligned vector of 2 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u64vec2, aligned_u64vec2, 16); - - /// Default qualifier 64 bit unsigned integer aligned vector of 3 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u64vec3, aligned_u64vec3, 32); - - /// Default qualifier 64 bit unsigned integer aligned vector of 4 components type. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(u64vec4, aligned_u64vec4, 32); - - - ////////////////////// - // Float vector types - - /// 32 bit single-qualifier floating-point aligned scalar. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(float32, aligned_float32, 4); - - /// 32 bit single-qualifier floating-point aligned scalar. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(float32_t, aligned_float32_t, 4); - - /// 32 bit single-qualifier floating-point aligned scalar. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(float32, aligned_f32, 4); - -# ifndef GLM_FORCE_SINGLE_ONLY - - /// 64 bit double-qualifier floating-point aligned scalar. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(float64, aligned_float64, 8); - - /// 64 bit double-qualifier floating-point aligned scalar. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(float64_t, aligned_float64_t, 8); - - /// 64 bit double-qualifier floating-point aligned scalar. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(float64, aligned_f64, 8); - -# endif//GLM_FORCE_SINGLE_ONLY - - - /// Single-qualifier floating-point aligned vector of 1 component. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(vec1, aligned_vec1, 4); - - /// Single-qualifier floating-point aligned vector of 2 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(vec2, aligned_vec2, 8); - - /// Single-qualifier floating-point aligned vector of 3 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(vec3, aligned_vec3, 16); - - /// Single-qualifier floating-point aligned vector of 4 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(vec4, aligned_vec4, 16); - - - /// Single-qualifier floating-point aligned vector of 1 component. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fvec1, aligned_fvec1, 4); - - /// Single-qualifier floating-point aligned vector of 2 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fvec2, aligned_fvec2, 8); - - /// Single-qualifier floating-point aligned vector of 3 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fvec3, aligned_fvec3, 16); - - /// Single-qualifier floating-point aligned vector of 4 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fvec4, aligned_fvec4, 16); - - - /// Single-qualifier floating-point aligned vector of 1 component. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32vec1, aligned_f32vec1, 4); - - /// Single-qualifier floating-point aligned vector of 2 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32vec2, aligned_f32vec2, 8); - - /// Single-qualifier floating-point aligned vector of 3 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32vec3, aligned_f32vec3, 16); - - /// Single-qualifier floating-point aligned vector of 4 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32vec4, aligned_f32vec4, 16); - - - /// Double-qualifier floating-point aligned vector of 1 component. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(dvec1, aligned_dvec1, 8); - - /// Double-qualifier floating-point aligned vector of 2 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(dvec2, aligned_dvec2, 16); - - /// Double-qualifier floating-point aligned vector of 3 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(dvec3, aligned_dvec3, 32); - - /// Double-qualifier floating-point aligned vector of 4 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(dvec4, aligned_dvec4, 32); - - -# ifndef GLM_FORCE_SINGLE_ONLY - - /// Double-qualifier floating-point aligned vector of 1 component. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64vec1, aligned_f64vec1, 8); - - /// Double-qualifier floating-point aligned vector of 2 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64vec2, aligned_f64vec2, 16); - - /// Double-qualifier floating-point aligned vector of 3 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64vec3, aligned_f64vec3, 32); - - /// Double-qualifier floating-point aligned vector of 4 components. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64vec4, aligned_f64vec4, 32); - -# endif//GLM_FORCE_SINGLE_ONLY - - ////////////////////// - // Float matrix types - - /// Single-qualifier floating-point aligned 1x1 matrix. - /// @see gtx_type_aligned - //typedef detail::tmat1 mat1; - - /// Single-qualifier floating-point aligned 2x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mat2, aligned_mat2, 16); - - /// Single-qualifier floating-point aligned 3x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mat3, aligned_mat3, 16); - - /// Single-qualifier floating-point aligned 4x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mat4, aligned_mat4, 16); - - - /// Single-qualifier floating-point aligned 1x1 matrix. - /// @see gtx_type_aligned - //typedef detail::tmat1x1 mat1; - - /// Single-qualifier floating-point aligned 2x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mat2x2, aligned_mat2x2, 16); - - /// Single-qualifier floating-point aligned 3x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mat3x3, aligned_mat3x3, 16); - - /// Single-qualifier floating-point aligned 4x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(mat4x4, aligned_mat4x4, 16); - - - /// Single-qualifier floating-point aligned 1x1 matrix. - /// @see gtx_type_aligned - //typedef detail::tmat1x1 fmat1; - - /// Single-qualifier floating-point aligned 2x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fmat2x2, aligned_fmat2, 16); - - /// Single-qualifier floating-point aligned 3x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fmat3x3, aligned_fmat3, 16); - - /// Single-qualifier floating-point aligned 4x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fmat4x4, aligned_fmat4, 16); - - - /// Single-qualifier floating-point aligned 1x1 matrix. - /// @see gtx_type_aligned - //typedef f32 fmat1x1; - - /// Single-qualifier floating-point aligned 2x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fmat2x2, aligned_fmat2x2, 16); - - /// Single-qualifier floating-point aligned 2x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fmat2x3, aligned_fmat2x3, 16); - - /// Single-qualifier floating-point aligned 2x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fmat2x4, aligned_fmat2x4, 16); - - /// Single-qualifier floating-point aligned 3x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fmat3x2, aligned_fmat3x2, 16); - - /// Single-qualifier floating-point aligned 3x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fmat3x3, aligned_fmat3x3, 16); - - /// Single-qualifier floating-point aligned 3x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fmat3x4, aligned_fmat3x4, 16); - - /// Single-qualifier floating-point aligned 4x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fmat4x2, aligned_fmat4x2, 16); - - /// Single-qualifier floating-point aligned 4x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fmat4x3, aligned_fmat4x3, 16); - - /// Single-qualifier floating-point aligned 4x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(fmat4x4, aligned_fmat4x4, 16); - - - /// Single-qualifier floating-point aligned 1x1 matrix. - /// @see gtx_type_aligned - //typedef detail::tmat1x1 f32mat1; - - /// Single-qualifier floating-point aligned 2x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32mat2x2, aligned_f32mat2, 16); - - /// Single-qualifier floating-point aligned 3x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32mat3x3, aligned_f32mat3, 16); - - /// Single-qualifier floating-point aligned 4x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32mat4x4, aligned_f32mat4, 16); - - - /// Single-qualifier floating-point aligned 1x1 matrix. - /// @see gtx_type_aligned - //typedef f32 f32mat1x1; - - /// Single-qualifier floating-point aligned 2x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32mat2x2, aligned_f32mat2x2, 16); - - /// Single-qualifier floating-point aligned 2x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32mat2x3, aligned_f32mat2x3, 16); - - /// Single-qualifier floating-point aligned 2x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32mat2x4, aligned_f32mat2x4, 16); - - /// Single-qualifier floating-point aligned 3x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32mat3x2, aligned_f32mat3x2, 16); - - /// Single-qualifier floating-point aligned 3x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32mat3x3, aligned_f32mat3x3, 16); - - /// Single-qualifier floating-point aligned 3x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32mat3x4, aligned_f32mat3x4, 16); - - /// Single-qualifier floating-point aligned 4x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32mat4x2, aligned_f32mat4x2, 16); - - /// Single-qualifier floating-point aligned 4x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32mat4x3, aligned_f32mat4x3, 16); - - /// Single-qualifier floating-point aligned 4x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32mat4x4, aligned_f32mat4x4, 16); - - -# ifndef GLM_FORCE_SINGLE_ONLY - - /// Double-qualifier floating-point aligned 1x1 matrix. - /// @see gtx_type_aligned - //typedef detail::tmat1x1 f64mat1; - - /// Double-qualifier floating-point aligned 2x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64mat2x2, aligned_f64mat2, 32); - - /// Double-qualifier floating-point aligned 3x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64mat3x3, aligned_f64mat3, 32); - - /// Double-qualifier floating-point aligned 4x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64mat4x4, aligned_f64mat4, 32); - - - /// Double-qualifier floating-point aligned 1x1 matrix. - /// @see gtx_type_aligned - //typedef f64 f64mat1x1; - - /// Double-qualifier floating-point aligned 2x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64mat2x2, aligned_f64mat2x2, 32); - - /// Double-qualifier floating-point aligned 2x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64mat2x3, aligned_f64mat2x3, 32); - - /// Double-qualifier floating-point aligned 2x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64mat2x4, aligned_f64mat2x4, 32); - - /// Double-qualifier floating-point aligned 3x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64mat3x2, aligned_f64mat3x2, 32); - - /// Double-qualifier floating-point aligned 3x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64mat3x3, aligned_f64mat3x3, 32); - - /// Double-qualifier floating-point aligned 3x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64mat3x4, aligned_f64mat3x4, 32); - - /// Double-qualifier floating-point aligned 4x2 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64mat4x2, aligned_f64mat4x2, 32); - - /// Double-qualifier floating-point aligned 4x3 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64mat4x3, aligned_f64mat4x3, 32); - - /// Double-qualifier floating-point aligned 4x4 matrix. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64mat4x4, aligned_f64mat4x4, 32); - -# endif//GLM_FORCE_SINGLE_ONLY - - - ////////////////////////// - // Quaternion types - - /// Single-qualifier floating-point aligned quaternion. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(quat, aligned_quat, 16); - - /// Single-qualifier floating-point aligned quaternion. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(quat, aligned_fquat, 16); - - /// Double-qualifier floating-point aligned quaternion. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(dquat, aligned_dquat, 32); - - /// Single-qualifier floating-point aligned quaternion. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f32quat, aligned_f32quat, 16); - -# ifndef GLM_FORCE_SINGLE_ONLY - - /// Double-qualifier floating-point aligned quaternion. - /// @see gtx_type_aligned - GLM_ALIGNED_TYPEDEF(f64quat, aligned_f64quat, 32); - -# endif//GLM_FORCE_SINGLE_ONLY - - /// @} -}//namespace glm - -#include "type_aligned.inl" diff --git a/3rdparty/glm/source/glm/gtx/type_aligned.inl b/3rdparty/glm/source/glm/gtx/type_aligned.inl deleted file mode 100644 index 54c1b81..0000000 --- a/3rdparty/glm/source/glm/gtx/type_aligned.inl +++ /dev/null @@ -1,6 +0,0 @@ -/// @ref gtc_type_aligned - -namespace glm -{ - -} diff --git a/3rdparty/glm/source/glm/gtx/type_trait.hpp b/3rdparty/glm/source/glm/gtx/type_trait.hpp deleted file mode 100644 index 56685c8..0000000 --- a/3rdparty/glm/source/glm/gtx/type_trait.hpp +++ /dev/null @@ -1,85 +0,0 @@ -/// @ref gtx_type_trait -/// @file glm/gtx/type_trait.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_type_trait GLM_GTX_type_trait -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Defines traits for each type. - -#pragma once - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_type_trait is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_type_trait extension included") -# endif -#endif - -// Dependency: -#include "../detail/qualifier.hpp" -#include "../gtc/quaternion.hpp" -#include "../gtx/dual_quaternion.hpp" - -namespace glm -{ - /// @addtogroup gtx_type_trait - /// @{ - - template - struct type - { - static bool const is_vec = false; - static bool const is_mat = false; - static bool const is_quat = false; - static length_t const components = 0; - static length_t const cols = 0; - static length_t const rows = 0; - }; - - template - struct type > - { - static bool const is_vec = true; - static bool const is_mat = false; - static bool const is_quat = false; - static length_t const components = L; - }; - - template - struct type > - { - static bool const is_vec = false; - static bool const is_mat = true; - static bool const is_quat = false; - static length_t const components = C; - static length_t const cols = C; - static length_t const rows = R; - }; - - template - struct type > - { - static bool const is_vec = false; - static bool const is_mat = false; - static bool const is_quat = true; - static length_t const components = 4; - }; - - template - struct type > - { - static bool const is_vec = false; - static bool const is_mat = false; - static bool const is_quat = true; - static length_t const components = 8; - }; - - /// @} -}//namespace glm - -#include "type_trait.inl" diff --git a/3rdparty/glm/source/glm/gtx/type_trait.inl b/3rdparty/glm/source/glm/gtx/type_trait.inl deleted file mode 100644 index 045de95..0000000 --- a/3rdparty/glm/source/glm/gtx/type_trait.inl +++ /dev/null @@ -1,61 +0,0 @@ -/// @ref gtx_type_trait - -namespace glm -{ - template - bool const type::is_vec; - template - bool const type::is_mat; - template - bool const type::is_quat; - template - length_t const type::components; - template - length_t const type::cols; - template - length_t const type::rows; - - // vec - template - bool const type >::is_vec; - template - bool const type >::is_mat; - template - bool const type >::is_quat; - template - length_t const type >::components; - - // mat - template - bool const type >::is_vec; - template - bool const type >::is_mat; - template - bool const type >::is_quat; - template - length_t const type >::components; - template - length_t const type >::cols; - template - length_t const type >::rows; - - // tquat - template - bool const type >::is_vec; - template - bool const type >::is_mat; - template - bool const type >::is_quat; - template - length_t const type >::components; - - // tdualquat - template - bool const type >::is_vec; - template - bool const type >::is_mat; - template - bool const type >::is_quat; - template - length_t const type >::components; -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/vec_swizzle.hpp b/3rdparty/glm/source/glm/gtx/vec_swizzle.hpp deleted file mode 100644 index 1c49abc..0000000 --- a/3rdparty/glm/source/glm/gtx/vec_swizzle.hpp +++ /dev/null @@ -1,2782 +0,0 @@ -/// @ref gtx_vec_swizzle -/// @file glm/gtx/vec_swizzle.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_vec_swizzle GLM_GTX_vec_swizzle -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Functions to perform swizzle operation. - -#pragma once - -#include "../glm.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_vec_swizzle is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_vec_swizzle extension included") -# endif -#endif - -namespace glm { - // xx - template - GLM_INLINE glm::vec<2, T, Q> xx(const glm::vec<1, T, Q> &v) { - return glm::vec<2, T, Q>(v.x, v.x); - } - - template - GLM_INLINE glm::vec<2, T, Q> xx(const glm::vec<2, T, Q> &v) { - return glm::vec<2, T, Q>(v.x, v.x); - } - - template - GLM_INLINE glm::vec<2, T, Q> xx(const glm::vec<3, T, Q> &v) { - return glm::vec<2, T, Q>(v.x, v.x); - } - - template - GLM_INLINE glm::vec<2, T, Q> xx(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.x, v.x); - } - - // xy - template - GLM_INLINE glm::vec<2, T, Q> xy(const glm::vec<2, T, Q> &v) { - return glm::vec<2, T, Q>(v.x, v.y); - } - - template - GLM_INLINE glm::vec<2, T, Q> xy(const glm::vec<3, T, Q> &v) { - return glm::vec<2, T, Q>(v.x, v.y); - } - - template - GLM_INLINE glm::vec<2, T, Q> xy(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.x, v.y); - } - - // xz - template - GLM_INLINE glm::vec<2, T, Q> xz(const glm::vec<3, T, Q> &v) { - return glm::vec<2, T, Q>(v.x, v.z); - } - - template - GLM_INLINE glm::vec<2, T, Q> xz(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.x, v.z); - } - - // xw - template - GLM_INLINE glm::vec<2, T, Q> xw(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.x, v.w); - } - - // yx - template - GLM_INLINE glm::vec<2, T, Q> yx(const glm::vec<2, T, Q> &v) { - return glm::vec<2, T, Q>(v.y, v.x); - } - - template - GLM_INLINE glm::vec<2, T, Q> yx(const glm::vec<3, T, Q> &v) { - return glm::vec<2, T, Q>(v.y, v.x); - } - - template - GLM_INLINE glm::vec<2, T, Q> yx(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.y, v.x); - } - - // yy - template - GLM_INLINE glm::vec<2, T, Q> yy(const glm::vec<2, T, Q> &v) { - return glm::vec<2, T, Q>(v.y, v.y); - } - - template - GLM_INLINE glm::vec<2, T, Q> yy(const glm::vec<3, T, Q> &v) { - return glm::vec<2, T, Q>(v.y, v.y); - } - - template - GLM_INLINE glm::vec<2, T, Q> yy(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.y, v.y); - } - - // yz - template - GLM_INLINE glm::vec<2, T, Q> yz(const glm::vec<3, T, Q> &v) { - return glm::vec<2, T, Q>(v.y, v.z); - } - - template - GLM_INLINE glm::vec<2, T, Q> yz(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.y, v.z); - } - - // yw - template - GLM_INLINE glm::vec<2, T, Q> yw(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.y, v.w); - } - - // zx - template - GLM_INLINE glm::vec<2, T, Q> zx(const glm::vec<3, T, Q> &v) { - return glm::vec<2, T, Q>(v.z, v.x); - } - - template - GLM_INLINE glm::vec<2, T, Q> zx(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.z, v.x); - } - - // zy - template - GLM_INLINE glm::vec<2, T, Q> zy(const glm::vec<3, T, Q> &v) { - return glm::vec<2, T, Q>(v.z, v.y); - } - - template - GLM_INLINE glm::vec<2, T, Q> zy(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.z, v.y); - } - - // zz - template - GLM_INLINE glm::vec<2, T, Q> zz(const glm::vec<3, T, Q> &v) { - return glm::vec<2, T, Q>(v.z, v.z); - } - - template - GLM_INLINE glm::vec<2, T, Q> zz(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.z, v.z); - } - - // zw - template - GLM_INLINE glm::vec<2, T, Q> zw(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.z, v.w); - } - - // wx - template - GLM_INLINE glm::vec<2, T, Q> wx(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.w, v.x); - } - - // wy - template - GLM_INLINE glm::vec<2, T, Q> wy(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.w, v.y); - } - - // wz - template - GLM_INLINE glm::vec<2, T, Q> wz(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.w, v.z); - } - - // ww - template - GLM_INLINE glm::vec<2, T, Q> ww(const glm::vec<4, T, Q> &v) { - return glm::vec<2, T, Q>(v.w, v.w); - } - - // xxx - template - GLM_INLINE glm::vec<3, T, Q> xxx(const glm::vec<1, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.x, v.x); - } - - template - GLM_INLINE glm::vec<3, T, Q> xxx(const glm::vec<2, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.x, v.x); - } - - template - GLM_INLINE glm::vec<3, T, Q> xxx(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.x, v.x); - } - - template - GLM_INLINE glm::vec<3, T, Q> xxx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.x, v.x); - } - - // xxy - template - GLM_INLINE glm::vec<3, T, Q> xxy(const glm::vec<2, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.x, v.y); - } - - template - GLM_INLINE glm::vec<3, T, Q> xxy(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.x, v.y); - } - - template - GLM_INLINE glm::vec<3, T, Q> xxy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.x, v.y); - } - - // xxz - template - GLM_INLINE glm::vec<3, T, Q> xxz(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.x, v.z); - } - - template - GLM_INLINE glm::vec<3, T, Q> xxz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.x, v.z); - } - - // xxw - template - GLM_INLINE glm::vec<3, T, Q> xxw(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.x, v.w); - } - - // xyx - template - GLM_INLINE glm::vec<3, T, Q> xyx(const glm::vec<2, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.y, v.x); - } - - template - GLM_INLINE glm::vec<3, T, Q> xyx(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.y, v.x); - } - - template - GLM_INLINE glm::vec<3, T, Q> xyx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.y, v.x); - } - - // xyy - template - GLM_INLINE glm::vec<3, T, Q> xyy(const glm::vec<2, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.y, v.y); - } - - template - GLM_INLINE glm::vec<3, T, Q> xyy(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.y, v.y); - } - - template - GLM_INLINE glm::vec<3, T, Q> xyy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.y, v.y); - } - - // xyz - template - GLM_INLINE glm::vec<3, T, Q> xyz(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.y, v.z); - } - - template - GLM_INLINE glm::vec<3, T, Q> xyz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.y, v.z); - } - - // xyw - template - GLM_INLINE glm::vec<3, T, Q> xyw(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.y, v.w); - } - - // xzx - template - GLM_INLINE glm::vec<3, T, Q> xzx(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.z, v.x); - } - - template - GLM_INLINE glm::vec<3, T, Q> xzx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.z, v.x); - } - - // xzy - template - GLM_INLINE glm::vec<3, T, Q> xzy(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.z, v.y); - } - - template - GLM_INLINE glm::vec<3, T, Q> xzy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.z, v.y); - } - - // xzz - template - GLM_INLINE glm::vec<3, T, Q> xzz(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.z, v.z); - } - - template - GLM_INLINE glm::vec<3, T, Q> xzz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.z, v.z); - } - - // xzw - template - GLM_INLINE glm::vec<3, T, Q> xzw(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.z, v.w); - } - - // xwx - template - GLM_INLINE glm::vec<3, T, Q> xwx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.w, v.x); - } - - // xwy - template - GLM_INLINE glm::vec<3, T, Q> xwy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.w, v.y); - } - - // xwz - template - GLM_INLINE glm::vec<3, T, Q> xwz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.w, v.z); - } - - // xww - template - GLM_INLINE glm::vec<3, T, Q> xww(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.x, v.w, v.w); - } - - // yxx - template - GLM_INLINE glm::vec<3, T, Q> yxx(const glm::vec<2, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.x, v.x); - } - - template - GLM_INLINE glm::vec<3, T, Q> yxx(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.x, v.x); - } - - template - GLM_INLINE glm::vec<3, T, Q> yxx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.x, v.x); - } - - // yxy - template - GLM_INLINE glm::vec<3, T, Q> yxy(const glm::vec<2, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.x, v.y); - } - - template - GLM_INLINE glm::vec<3, T, Q> yxy(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.x, v.y); - } - - template - GLM_INLINE glm::vec<3, T, Q> yxy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.x, v.y); - } - - // yxz - template - GLM_INLINE glm::vec<3, T, Q> yxz(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.x, v.z); - } - - template - GLM_INLINE glm::vec<3, T, Q> yxz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.x, v.z); - } - - // yxw - template - GLM_INLINE glm::vec<3, T, Q> yxw(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.x, v.w); - } - - // yyx - template - GLM_INLINE glm::vec<3, T, Q> yyx(const glm::vec<2, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.y, v.x); - } - - template - GLM_INLINE glm::vec<3, T, Q> yyx(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.y, v.x); - } - - template - GLM_INLINE glm::vec<3, T, Q> yyx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.y, v.x); - } - - // yyy - template - GLM_INLINE glm::vec<3, T, Q> yyy(const glm::vec<2, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.y, v.y); - } - - template - GLM_INLINE glm::vec<3, T, Q> yyy(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.y, v.y); - } - - template - GLM_INLINE glm::vec<3, T, Q> yyy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.y, v.y); - } - - // yyz - template - GLM_INLINE glm::vec<3, T, Q> yyz(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.y, v.z); - } - - template - GLM_INLINE glm::vec<3, T, Q> yyz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.y, v.z); - } - - // yyw - template - GLM_INLINE glm::vec<3, T, Q> yyw(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.y, v.w); - } - - // yzx - template - GLM_INLINE glm::vec<3, T, Q> yzx(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.z, v.x); - } - - template - GLM_INLINE glm::vec<3, T, Q> yzx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.z, v.x); - } - - // yzy - template - GLM_INLINE glm::vec<3, T, Q> yzy(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.z, v.y); - } - - template - GLM_INLINE glm::vec<3, T, Q> yzy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.z, v.y); - } - - // yzz - template - GLM_INLINE glm::vec<3, T, Q> yzz(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.z, v.z); - } - - template - GLM_INLINE glm::vec<3, T, Q> yzz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.z, v.z); - } - - // yzw - template - GLM_INLINE glm::vec<3, T, Q> yzw(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.z, v.w); - } - - // ywx - template - GLM_INLINE glm::vec<3, T, Q> ywx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.w, v.x); - } - - // ywy - template - GLM_INLINE glm::vec<3, T, Q> ywy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.w, v.y); - } - - // ywz - template - GLM_INLINE glm::vec<3, T, Q> ywz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.w, v.z); - } - - // yww - template - GLM_INLINE glm::vec<3, T, Q> yww(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.y, v.w, v.w); - } - - // zxx - template - GLM_INLINE glm::vec<3, T, Q> zxx(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.x, v.x); - } - - template - GLM_INLINE glm::vec<3, T, Q> zxx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.x, v.x); - } - - // zxy - template - GLM_INLINE glm::vec<3, T, Q> zxy(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.x, v.y); - } - - template - GLM_INLINE glm::vec<3, T, Q> zxy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.x, v.y); - } - - // zxz - template - GLM_INLINE glm::vec<3, T, Q> zxz(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.x, v.z); - } - - template - GLM_INLINE glm::vec<3, T, Q> zxz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.x, v.z); - } - - // zxw - template - GLM_INLINE glm::vec<3, T, Q> zxw(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.x, v.w); - } - - // zyx - template - GLM_INLINE glm::vec<3, T, Q> zyx(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.y, v.x); - } - - template - GLM_INLINE glm::vec<3, T, Q> zyx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.y, v.x); - } - - // zyy - template - GLM_INLINE glm::vec<3, T, Q> zyy(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.y, v.y); - } - - template - GLM_INLINE glm::vec<3, T, Q> zyy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.y, v.y); - } - - // zyz - template - GLM_INLINE glm::vec<3, T, Q> zyz(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.y, v.z); - } - - template - GLM_INLINE glm::vec<3, T, Q> zyz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.y, v.z); - } - - // zyw - template - GLM_INLINE glm::vec<3, T, Q> zyw(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.y, v.w); - } - - // zzx - template - GLM_INLINE glm::vec<3, T, Q> zzx(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.z, v.x); - } - - template - GLM_INLINE glm::vec<3, T, Q> zzx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.z, v.x); - } - - // zzy - template - GLM_INLINE glm::vec<3, T, Q> zzy(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.z, v.y); - } - - template - GLM_INLINE glm::vec<3, T, Q> zzy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.z, v.y); - } - - // zzz - template - GLM_INLINE glm::vec<3, T, Q> zzz(const glm::vec<3, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.z, v.z); - } - - template - GLM_INLINE glm::vec<3, T, Q> zzz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.z, v.z); - } - - // zzw - template - GLM_INLINE glm::vec<3, T, Q> zzw(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.z, v.w); - } - - // zwx - template - GLM_INLINE glm::vec<3, T, Q> zwx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.w, v.x); - } - - // zwy - template - GLM_INLINE glm::vec<3, T, Q> zwy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.w, v.y); - } - - // zwz - template - GLM_INLINE glm::vec<3, T, Q> zwz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.w, v.z); - } - - // zww - template - GLM_INLINE glm::vec<3, T, Q> zww(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.z, v.w, v.w); - } - - // wxx - template - GLM_INLINE glm::vec<3, T, Q> wxx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.x, v.x); - } - - // wxy - template - GLM_INLINE glm::vec<3, T, Q> wxy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.x, v.y); - } - - // wxz - template - GLM_INLINE glm::vec<3, T, Q> wxz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.x, v.z); - } - - // wxw - template - GLM_INLINE glm::vec<3, T, Q> wxw(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.x, v.w); - } - - // wyx - template - GLM_INLINE glm::vec<3, T, Q> wyx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.y, v.x); - } - - // wyy - template - GLM_INLINE glm::vec<3, T, Q> wyy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.y, v.y); - } - - // wyz - template - GLM_INLINE glm::vec<3, T, Q> wyz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.y, v.z); - } - - // wyw - template - GLM_INLINE glm::vec<3, T, Q> wyw(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.y, v.w); - } - - // wzx - template - GLM_INLINE glm::vec<3, T, Q> wzx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.z, v.x); - } - - // wzy - template - GLM_INLINE glm::vec<3, T, Q> wzy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.z, v.y); - } - - // wzz - template - GLM_INLINE glm::vec<3, T, Q> wzz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.z, v.z); - } - - // wzw - template - GLM_INLINE glm::vec<3, T, Q> wzw(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.z, v.w); - } - - // wwx - template - GLM_INLINE glm::vec<3, T, Q> wwx(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.w, v.x); - } - - // wwy - template - GLM_INLINE glm::vec<3, T, Q> wwy(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.w, v.y); - } - - // wwz - template - GLM_INLINE glm::vec<3, T, Q> wwz(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.w, v.z); - } - - // www - template - GLM_INLINE glm::vec<3, T, Q> www(const glm::vec<4, T, Q> &v) { - return glm::vec<3, T, Q>(v.w, v.w, v.w); - } - - // xxxx - template - GLM_INLINE glm::vec<4, T, Q> xxxx(const glm::vec<1, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.x, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> xxxx(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.x, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> xxxx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.x, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> xxxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.x, v.x); - } - - // xxxy - template - GLM_INLINE glm::vec<4, T, Q> xxxy(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.x, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> xxxy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.x, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> xxxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.x, v.y); - } - - // xxxz - template - GLM_INLINE glm::vec<4, T, Q> xxxz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.x, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> xxxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.x, v.z); - } - - // xxxw - template - GLM_INLINE glm::vec<4, T, Q> xxxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.x, v.w); - } - - // xxyx - template - GLM_INLINE glm::vec<4, T, Q> xxyx(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.y, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> xxyx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.y, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> xxyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.y, v.x); - } - - // xxyy - template - GLM_INLINE glm::vec<4, T, Q> xxyy(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.y, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> xxyy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.y, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> xxyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.y, v.y); - } - - // xxyz - template - GLM_INLINE glm::vec<4, T, Q> xxyz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.y, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> xxyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.y, v.z); - } - - // xxyw - template - GLM_INLINE glm::vec<4, T, Q> xxyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.y, v.w); - } - - // xxzx - template - GLM_INLINE glm::vec<4, T, Q> xxzx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.z, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> xxzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.z, v.x); - } - - // xxzy - template - GLM_INLINE glm::vec<4, T, Q> xxzy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.z, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> xxzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.z, v.y); - } - - // xxzz - template - GLM_INLINE glm::vec<4, T, Q> xxzz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.z, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> xxzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.z, v.z); - } - - // xxzw - template - GLM_INLINE glm::vec<4, T, Q> xxzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.z, v.w); - } - - // xxwx - template - GLM_INLINE glm::vec<4, T, Q> xxwx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.w, v.x); - } - - // xxwy - template - GLM_INLINE glm::vec<4, T, Q> xxwy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.w, v.y); - } - - // xxwz - template - GLM_INLINE glm::vec<4, T, Q> xxwz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.w, v.z); - } - - // xxww - template - GLM_INLINE glm::vec<4, T, Q> xxww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.x, v.w, v.w); - } - - // xyxx - template - GLM_INLINE glm::vec<4, T, Q> xyxx(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.x, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> xyxx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.x, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> xyxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.x, v.x); - } - - // xyxy - template - GLM_INLINE glm::vec<4, T, Q> xyxy(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.x, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> xyxy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.x, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> xyxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.x, v.y); - } - - // xyxz - template - GLM_INLINE glm::vec<4, T, Q> xyxz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.x, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> xyxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.x, v.z); - } - - // xyxw - template - GLM_INLINE glm::vec<4, T, Q> xyxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.x, v.w); - } - - // xyyx - template - GLM_INLINE glm::vec<4, T, Q> xyyx(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.y, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> xyyx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.y, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> xyyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.y, v.x); - } - - // xyyy - template - GLM_INLINE glm::vec<4, T, Q> xyyy(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.y, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> xyyy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.y, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> xyyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.y, v.y); - } - - // xyyz - template - GLM_INLINE glm::vec<4, T, Q> xyyz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.y, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> xyyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.y, v.z); - } - - // xyyw - template - GLM_INLINE glm::vec<4, T, Q> xyyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.y, v.w); - } - - // xyzx - template - GLM_INLINE glm::vec<4, T, Q> xyzx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.z, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> xyzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.z, v.x); - } - - // xyzy - template - GLM_INLINE glm::vec<4, T, Q> xyzy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.z, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> xyzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.z, v.y); - } - - // xyzz - template - GLM_INLINE glm::vec<4, T, Q> xyzz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.z, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> xyzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.z, v.z); - } - - // xyzw - template - GLM_INLINE glm::vec<4, T, Q> xyzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.z, v.w); - } - - // xywx - template - GLM_INLINE glm::vec<4, T, Q> xywx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.w, v.x); - } - - // xywy - template - GLM_INLINE glm::vec<4, T, Q> xywy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.w, v.y); - } - - // xywz - template - GLM_INLINE glm::vec<4, T, Q> xywz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.w, v.z); - } - - // xyww - template - GLM_INLINE glm::vec<4, T, Q> xyww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.y, v.w, v.w); - } - - // xzxx - template - GLM_INLINE glm::vec<4, T, Q> xzxx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.x, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> xzxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.x, v.x); - } - - // xzxy - template - GLM_INLINE glm::vec<4, T, Q> xzxy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.x, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> xzxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.x, v.y); - } - - // xzxz - template - GLM_INLINE glm::vec<4, T, Q> xzxz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.x, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> xzxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.x, v.z); - } - - // xzxw - template - GLM_INLINE glm::vec<4, T, Q> xzxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.x, v.w); - } - - // xzyx - template - GLM_INLINE glm::vec<4, T, Q> xzyx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.y, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> xzyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.y, v.x); - } - - // xzyy - template - GLM_INLINE glm::vec<4, T, Q> xzyy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.y, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> xzyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.y, v.y); - } - - // xzyz - template - GLM_INLINE glm::vec<4, T, Q> xzyz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.y, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> xzyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.y, v.z); - } - - // xzyw - template - GLM_INLINE glm::vec<4, T, Q> xzyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.y, v.w); - } - - // xzzx - template - GLM_INLINE glm::vec<4, T, Q> xzzx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.z, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> xzzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.z, v.x); - } - - // xzzy - template - GLM_INLINE glm::vec<4, T, Q> xzzy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.z, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> xzzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.z, v.y); - } - - // xzzz - template - GLM_INLINE glm::vec<4, T, Q> xzzz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.z, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> xzzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.z, v.z); - } - - // xzzw - template - GLM_INLINE glm::vec<4, T, Q> xzzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.z, v.w); - } - - // xzwx - template - GLM_INLINE glm::vec<4, T, Q> xzwx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.w, v.x); - } - - // xzwy - template - GLM_INLINE glm::vec<4, T, Q> xzwy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.w, v.y); - } - - // xzwz - template - GLM_INLINE glm::vec<4, T, Q> xzwz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.w, v.z); - } - - // xzww - template - GLM_INLINE glm::vec<4, T, Q> xzww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.z, v.w, v.w); - } - - // xwxx - template - GLM_INLINE glm::vec<4, T, Q> xwxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.x, v.x); - } - - // xwxy - template - GLM_INLINE glm::vec<4, T, Q> xwxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.x, v.y); - } - - // xwxz - template - GLM_INLINE glm::vec<4, T, Q> xwxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.x, v.z); - } - - // xwxw - template - GLM_INLINE glm::vec<4, T, Q> xwxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.x, v.w); - } - - // xwyx - template - GLM_INLINE glm::vec<4, T, Q> xwyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.y, v.x); - } - - // xwyy - template - GLM_INLINE glm::vec<4, T, Q> xwyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.y, v.y); - } - - // xwyz - template - GLM_INLINE glm::vec<4, T, Q> xwyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.y, v.z); - } - - // xwyw - template - GLM_INLINE glm::vec<4, T, Q> xwyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.y, v.w); - } - - // xwzx - template - GLM_INLINE glm::vec<4, T, Q> xwzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.z, v.x); - } - - // xwzy - template - GLM_INLINE glm::vec<4, T, Q> xwzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.z, v.y); - } - - // xwzz - template - GLM_INLINE glm::vec<4, T, Q> xwzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.z, v.z); - } - - // xwzw - template - GLM_INLINE glm::vec<4, T, Q> xwzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.z, v.w); - } - - // xwwx - template - GLM_INLINE glm::vec<4, T, Q> xwwx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.w, v.x); - } - - // xwwy - template - GLM_INLINE glm::vec<4, T, Q> xwwy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.w, v.y); - } - - // xwwz - template - GLM_INLINE glm::vec<4, T, Q> xwwz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.w, v.z); - } - - // xwww - template - GLM_INLINE glm::vec<4, T, Q> xwww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.x, v.w, v.w, v.w); - } - - // yxxx - template - GLM_INLINE glm::vec<4, T, Q> yxxx(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.x, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> yxxx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.x, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> yxxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.x, v.x); - } - - // yxxy - template - GLM_INLINE glm::vec<4, T, Q> yxxy(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.x, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> yxxy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.x, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> yxxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.x, v.y); - } - - // yxxz - template - GLM_INLINE glm::vec<4, T, Q> yxxz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.x, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> yxxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.x, v.z); - } - - // yxxw - template - GLM_INLINE glm::vec<4, T, Q> yxxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.x, v.w); - } - - // yxyx - template - GLM_INLINE glm::vec<4, T, Q> yxyx(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.y, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> yxyx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.y, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> yxyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.y, v.x); - } - - // yxyy - template - GLM_INLINE glm::vec<4, T, Q> yxyy(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.y, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> yxyy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.y, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> yxyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.y, v.y); - } - - // yxyz - template - GLM_INLINE glm::vec<4, T, Q> yxyz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.y, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> yxyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.y, v.z); - } - - // yxyw - template - GLM_INLINE glm::vec<4, T, Q> yxyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.y, v.w); - } - - // yxzx - template - GLM_INLINE glm::vec<4, T, Q> yxzx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.z, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> yxzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.z, v.x); - } - - // yxzy - template - GLM_INLINE glm::vec<4, T, Q> yxzy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.z, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> yxzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.z, v.y); - } - - // yxzz - template - GLM_INLINE glm::vec<4, T, Q> yxzz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.z, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> yxzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.z, v.z); - } - - // yxzw - template - GLM_INLINE glm::vec<4, T, Q> yxzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.z, v.w); - } - - // yxwx - template - GLM_INLINE glm::vec<4, T, Q> yxwx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.w, v.x); - } - - // yxwy - template - GLM_INLINE glm::vec<4, T, Q> yxwy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.w, v.y); - } - - // yxwz - template - GLM_INLINE glm::vec<4, T, Q> yxwz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.w, v.z); - } - - // yxww - template - GLM_INLINE glm::vec<4, T, Q> yxww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.x, v.w, v.w); - } - - // yyxx - template - GLM_INLINE glm::vec<4, T, Q> yyxx(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.x, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> yyxx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.x, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> yyxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.x, v.x); - } - - // yyxy - template - GLM_INLINE glm::vec<4, T, Q> yyxy(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.x, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> yyxy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.x, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> yyxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.x, v.y); - } - - // yyxz - template - GLM_INLINE glm::vec<4, T, Q> yyxz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.x, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> yyxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.x, v.z); - } - - // yyxw - template - GLM_INLINE glm::vec<4, T, Q> yyxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.x, v.w); - } - - // yyyx - template - GLM_INLINE glm::vec<4, T, Q> yyyx(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.y, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> yyyx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.y, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> yyyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.y, v.x); - } - - // yyyy - template - GLM_INLINE glm::vec<4, T, Q> yyyy(const glm::vec<2, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.y, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> yyyy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.y, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> yyyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.y, v.y); - } - - // yyyz - template - GLM_INLINE glm::vec<4, T, Q> yyyz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.y, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> yyyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.y, v.z); - } - - // yyyw - template - GLM_INLINE glm::vec<4, T, Q> yyyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.y, v.w); - } - - // yyzx - template - GLM_INLINE glm::vec<4, T, Q> yyzx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.z, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> yyzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.z, v.x); - } - - // yyzy - template - GLM_INLINE glm::vec<4, T, Q> yyzy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.z, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> yyzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.z, v.y); - } - - // yyzz - template - GLM_INLINE glm::vec<4, T, Q> yyzz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.z, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> yyzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.z, v.z); - } - - // yyzw - template - GLM_INLINE glm::vec<4, T, Q> yyzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.z, v.w); - } - - // yywx - template - GLM_INLINE glm::vec<4, T, Q> yywx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.w, v.x); - } - - // yywy - template - GLM_INLINE glm::vec<4, T, Q> yywy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.w, v.y); - } - - // yywz - template - GLM_INLINE glm::vec<4, T, Q> yywz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.w, v.z); - } - - // yyww - template - GLM_INLINE glm::vec<4, T, Q> yyww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.y, v.w, v.w); - } - - // yzxx - template - GLM_INLINE glm::vec<4, T, Q> yzxx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.x, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> yzxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.x, v.x); - } - - // yzxy - template - GLM_INLINE glm::vec<4, T, Q> yzxy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.x, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> yzxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.x, v.y); - } - - // yzxz - template - GLM_INLINE glm::vec<4, T, Q> yzxz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.x, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> yzxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.x, v.z); - } - - // yzxw - template - GLM_INLINE glm::vec<4, T, Q> yzxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.x, v.w); - } - - // yzyx - template - GLM_INLINE glm::vec<4, T, Q> yzyx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.y, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> yzyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.y, v.x); - } - - // yzyy - template - GLM_INLINE glm::vec<4, T, Q> yzyy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.y, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> yzyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.y, v.y); - } - - // yzyz - template - GLM_INLINE glm::vec<4, T, Q> yzyz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.y, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> yzyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.y, v.z); - } - - // yzyw - template - GLM_INLINE glm::vec<4, T, Q> yzyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.y, v.w); - } - - // yzzx - template - GLM_INLINE glm::vec<4, T, Q> yzzx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.z, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> yzzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.z, v.x); - } - - // yzzy - template - GLM_INLINE glm::vec<4, T, Q> yzzy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.z, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> yzzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.z, v.y); - } - - // yzzz - template - GLM_INLINE glm::vec<4, T, Q> yzzz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.z, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> yzzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.z, v.z); - } - - // yzzw - template - GLM_INLINE glm::vec<4, T, Q> yzzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.z, v.w); - } - - // yzwx - template - GLM_INLINE glm::vec<4, T, Q> yzwx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.w, v.x); - } - - // yzwy - template - GLM_INLINE glm::vec<4, T, Q> yzwy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.w, v.y); - } - - // yzwz - template - GLM_INLINE glm::vec<4, T, Q> yzwz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.w, v.z); - } - - // yzww - template - GLM_INLINE glm::vec<4, T, Q> yzww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.z, v.w, v.w); - } - - // ywxx - template - GLM_INLINE glm::vec<4, T, Q> ywxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.x, v.x); - } - - // ywxy - template - GLM_INLINE glm::vec<4, T, Q> ywxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.x, v.y); - } - - // ywxz - template - GLM_INLINE glm::vec<4, T, Q> ywxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.x, v.z); - } - - // ywxw - template - GLM_INLINE glm::vec<4, T, Q> ywxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.x, v.w); - } - - // ywyx - template - GLM_INLINE glm::vec<4, T, Q> ywyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.y, v.x); - } - - // ywyy - template - GLM_INLINE glm::vec<4, T, Q> ywyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.y, v.y); - } - - // ywyz - template - GLM_INLINE glm::vec<4, T, Q> ywyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.y, v.z); - } - - // ywyw - template - GLM_INLINE glm::vec<4, T, Q> ywyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.y, v.w); - } - - // ywzx - template - GLM_INLINE glm::vec<4, T, Q> ywzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.z, v.x); - } - - // ywzy - template - GLM_INLINE glm::vec<4, T, Q> ywzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.z, v.y); - } - - // ywzz - template - GLM_INLINE glm::vec<4, T, Q> ywzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.z, v.z); - } - - // ywzw - template - GLM_INLINE glm::vec<4, T, Q> ywzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.z, v.w); - } - - // ywwx - template - GLM_INLINE glm::vec<4, T, Q> ywwx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.w, v.x); - } - - // ywwy - template - GLM_INLINE glm::vec<4, T, Q> ywwy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.w, v.y); - } - - // ywwz - template - GLM_INLINE glm::vec<4, T, Q> ywwz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.w, v.z); - } - - // ywww - template - GLM_INLINE glm::vec<4, T, Q> ywww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.y, v.w, v.w, v.w); - } - - // zxxx - template - GLM_INLINE glm::vec<4, T, Q> zxxx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.x, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> zxxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.x, v.x); - } - - // zxxy - template - GLM_INLINE glm::vec<4, T, Q> zxxy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.x, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> zxxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.x, v.y); - } - - // zxxz - template - GLM_INLINE glm::vec<4, T, Q> zxxz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.x, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> zxxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.x, v.z); - } - - // zxxw - template - GLM_INLINE glm::vec<4, T, Q> zxxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.x, v.w); - } - - // zxyx - template - GLM_INLINE glm::vec<4, T, Q> zxyx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.y, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> zxyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.y, v.x); - } - - // zxyy - template - GLM_INLINE glm::vec<4, T, Q> zxyy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.y, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> zxyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.y, v.y); - } - - // zxyz - template - GLM_INLINE glm::vec<4, T, Q> zxyz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.y, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> zxyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.y, v.z); - } - - // zxyw - template - GLM_INLINE glm::vec<4, T, Q> zxyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.y, v.w); - } - - // zxzx - template - GLM_INLINE glm::vec<4, T, Q> zxzx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.z, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> zxzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.z, v.x); - } - - // zxzy - template - GLM_INLINE glm::vec<4, T, Q> zxzy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.z, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> zxzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.z, v.y); - } - - // zxzz - template - GLM_INLINE glm::vec<4, T, Q> zxzz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.z, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> zxzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.z, v.z); - } - - // zxzw - template - GLM_INLINE glm::vec<4, T, Q> zxzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.z, v.w); - } - - // zxwx - template - GLM_INLINE glm::vec<4, T, Q> zxwx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.w, v.x); - } - - // zxwy - template - GLM_INLINE glm::vec<4, T, Q> zxwy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.w, v.y); - } - - // zxwz - template - GLM_INLINE glm::vec<4, T, Q> zxwz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.w, v.z); - } - - // zxww - template - GLM_INLINE glm::vec<4, T, Q> zxww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.x, v.w, v.w); - } - - // zyxx - template - GLM_INLINE glm::vec<4, T, Q> zyxx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.x, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> zyxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.x, v.x); - } - - // zyxy - template - GLM_INLINE glm::vec<4, T, Q> zyxy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.x, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> zyxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.x, v.y); - } - - // zyxz - template - GLM_INLINE glm::vec<4, T, Q> zyxz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.x, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> zyxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.x, v.z); - } - - // zyxw - template - GLM_INLINE glm::vec<4, T, Q> zyxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.x, v.w); - } - - // zyyx - template - GLM_INLINE glm::vec<4, T, Q> zyyx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.y, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> zyyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.y, v.x); - } - - // zyyy - template - GLM_INLINE glm::vec<4, T, Q> zyyy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.y, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> zyyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.y, v.y); - } - - // zyyz - template - GLM_INLINE glm::vec<4, T, Q> zyyz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.y, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> zyyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.y, v.z); - } - - // zyyw - template - GLM_INLINE glm::vec<4, T, Q> zyyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.y, v.w); - } - - // zyzx - template - GLM_INLINE glm::vec<4, T, Q> zyzx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.z, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> zyzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.z, v.x); - } - - // zyzy - template - GLM_INLINE glm::vec<4, T, Q> zyzy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.z, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> zyzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.z, v.y); - } - - // zyzz - template - GLM_INLINE glm::vec<4, T, Q> zyzz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.z, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> zyzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.z, v.z); - } - - // zyzw - template - GLM_INLINE glm::vec<4, T, Q> zyzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.z, v.w); - } - - // zywx - template - GLM_INLINE glm::vec<4, T, Q> zywx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.w, v.x); - } - - // zywy - template - GLM_INLINE glm::vec<4, T, Q> zywy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.w, v.y); - } - - // zywz - template - GLM_INLINE glm::vec<4, T, Q> zywz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.w, v.z); - } - - // zyww - template - GLM_INLINE glm::vec<4, T, Q> zyww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.y, v.w, v.w); - } - - // zzxx - template - GLM_INLINE glm::vec<4, T, Q> zzxx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.x, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> zzxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.x, v.x); - } - - // zzxy - template - GLM_INLINE glm::vec<4, T, Q> zzxy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.x, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> zzxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.x, v.y); - } - - // zzxz - template - GLM_INLINE glm::vec<4, T, Q> zzxz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.x, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> zzxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.x, v.z); - } - - // zzxw - template - GLM_INLINE glm::vec<4, T, Q> zzxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.x, v.w); - } - - // zzyx - template - GLM_INLINE glm::vec<4, T, Q> zzyx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.y, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> zzyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.y, v.x); - } - - // zzyy - template - GLM_INLINE glm::vec<4, T, Q> zzyy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.y, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> zzyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.y, v.y); - } - - // zzyz - template - GLM_INLINE glm::vec<4, T, Q> zzyz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.y, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> zzyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.y, v.z); - } - - // zzyw - template - GLM_INLINE glm::vec<4, T, Q> zzyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.y, v.w); - } - - // zzzx - template - GLM_INLINE glm::vec<4, T, Q> zzzx(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.z, v.x); - } - - template - GLM_INLINE glm::vec<4, T, Q> zzzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.z, v.x); - } - - // zzzy - template - GLM_INLINE glm::vec<4, T, Q> zzzy(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.z, v.y); - } - - template - GLM_INLINE glm::vec<4, T, Q> zzzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.z, v.y); - } - - // zzzz - template - GLM_INLINE glm::vec<4, T, Q> zzzz(const glm::vec<3, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.z, v.z); - } - - template - GLM_INLINE glm::vec<4, T, Q> zzzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.z, v.z); - } - - // zzzw - template - GLM_INLINE glm::vec<4, T, Q> zzzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.z, v.w); - } - - // zzwx - template - GLM_INLINE glm::vec<4, T, Q> zzwx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.w, v.x); - } - - // zzwy - template - GLM_INLINE glm::vec<4, T, Q> zzwy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.w, v.y); - } - - // zzwz - template - GLM_INLINE glm::vec<4, T, Q> zzwz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.w, v.z); - } - - // zzww - template - GLM_INLINE glm::vec<4, T, Q> zzww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.z, v.w, v.w); - } - - // zwxx - template - GLM_INLINE glm::vec<4, T, Q> zwxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.x, v.x); - } - - // zwxy - template - GLM_INLINE glm::vec<4, T, Q> zwxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.x, v.y); - } - - // zwxz - template - GLM_INLINE glm::vec<4, T, Q> zwxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.x, v.z); - } - - // zwxw - template - GLM_INLINE glm::vec<4, T, Q> zwxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.x, v.w); - } - - // zwyx - template - GLM_INLINE glm::vec<4, T, Q> zwyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.y, v.x); - } - - // zwyy - template - GLM_INLINE glm::vec<4, T, Q> zwyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.y, v.y); - } - - // zwyz - template - GLM_INLINE glm::vec<4, T, Q> zwyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.y, v.z); - } - - // zwyw - template - GLM_INLINE glm::vec<4, T, Q> zwyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.y, v.w); - } - - // zwzx - template - GLM_INLINE glm::vec<4, T, Q> zwzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.z, v.x); - } - - // zwzy - template - GLM_INLINE glm::vec<4, T, Q> zwzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.z, v.y); - } - - // zwzz - template - GLM_INLINE glm::vec<4, T, Q> zwzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.z, v.z); - } - - // zwzw - template - GLM_INLINE glm::vec<4, T, Q> zwzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.z, v.w); - } - - // zwwx - template - GLM_INLINE glm::vec<4, T, Q> zwwx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.w, v.x); - } - - // zwwy - template - GLM_INLINE glm::vec<4, T, Q> zwwy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.w, v.y); - } - - // zwwz - template - GLM_INLINE glm::vec<4, T, Q> zwwz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.w, v.z); - } - - // zwww - template - GLM_INLINE glm::vec<4, T, Q> zwww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.z, v.w, v.w, v.w); - } - - // wxxx - template - GLM_INLINE glm::vec<4, T, Q> wxxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.x, v.x); - } - - // wxxy - template - GLM_INLINE glm::vec<4, T, Q> wxxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.x, v.y); - } - - // wxxz - template - GLM_INLINE glm::vec<4, T, Q> wxxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.x, v.z); - } - - // wxxw - template - GLM_INLINE glm::vec<4, T, Q> wxxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.x, v.w); - } - - // wxyx - template - GLM_INLINE glm::vec<4, T, Q> wxyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.y, v.x); - } - - // wxyy - template - GLM_INLINE glm::vec<4, T, Q> wxyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.y, v.y); - } - - // wxyz - template - GLM_INLINE glm::vec<4, T, Q> wxyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.y, v.z); - } - - // wxyw - template - GLM_INLINE glm::vec<4, T, Q> wxyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.y, v.w); - } - - // wxzx - template - GLM_INLINE glm::vec<4, T, Q> wxzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.z, v.x); - } - - // wxzy - template - GLM_INLINE glm::vec<4, T, Q> wxzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.z, v.y); - } - - // wxzz - template - GLM_INLINE glm::vec<4, T, Q> wxzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.z, v.z); - } - - // wxzw - template - GLM_INLINE glm::vec<4, T, Q> wxzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.z, v.w); - } - - // wxwx - template - GLM_INLINE glm::vec<4, T, Q> wxwx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.w, v.x); - } - - // wxwy - template - GLM_INLINE glm::vec<4, T, Q> wxwy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.w, v.y); - } - - // wxwz - template - GLM_INLINE glm::vec<4, T, Q> wxwz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.w, v.z); - } - - // wxww - template - GLM_INLINE glm::vec<4, T, Q> wxww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.x, v.w, v.w); - } - - // wyxx - template - GLM_INLINE glm::vec<4, T, Q> wyxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.x, v.x); - } - - // wyxy - template - GLM_INLINE glm::vec<4, T, Q> wyxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.x, v.y); - } - - // wyxz - template - GLM_INLINE glm::vec<4, T, Q> wyxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.x, v.z); - } - - // wyxw - template - GLM_INLINE glm::vec<4, T, Q> wyxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.x, v.w); - } - - // wyyx - template - GLM_INLINE glm::vec<4, T, Q> wyyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.y, v.x); - } - - // wyyy - template - GLM_INLINE glm::vec<4, T, Q> wyyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.y, v.y); - } - - // wyyz - template - GLM_INLINE glm::vec<4, T, Q> wyyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.y, v.z); - } - - // wyyw - template - GLM_INLINE glm::vec<4, T, Q> wyyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.y, v.w); - } - - // wyzx - template - GLM_INLINE glm::vec<4, T, Q> wyzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.z, v.x); - } - - // wyzy - template - GLM_INLINE glm::vec<4, T, Q> wyzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.z, v.y); - } - - // wyzz - template - GLM_INLINE glm::vec<4, T, Q> wyzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.z, v.z); - } - - // wyzw - template - GLM_INLINE glm::vec<4, T, Q> wyzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.z, v.w); - } - - // wywx - template - GLM_INLINE glm::vec<4, T, Q> wywx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.w, v.x); - } - - // wywy - template - GLM_INLINE glm::vec<4, T, Q> wywy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.w, v.y); - } - - // wywz - template - GLM_INLINE glm::vec<4, T, Q> wywz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.w, v.z); - } - - // wyww - template - GLM_INLINE glm::vec<4, T, Q> wyww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.y, v.w, v.w); - } - - // wzxx - template - GLM_INLINE glm::vec<4, T, Q> wzxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.x, v.x); - } - - // wzxy - template - GLM_INLINE glm::vec<4, T, Q> wzxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.x, v.y); - } - - // wzxz - template - GLM_INLINE glm::vec<4, T, Q> wzxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.x, v.z); - } - - // wzxw - template - GLM_INLINE glm::vec<4, T, Q> wzxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.x, v.w); - } - - // wzyx - template - GLM_INLINE glm::vec<4, T, Q> wzyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.y, v.x); - } - - // wzyy - template - GLM_INLINE glm::vec<4, T, Q> wzyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.y, v.y); - } - - // wzyz - template - GLM_INLINE glm::vec<4, T, Q> wzyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.y, v.z); - } - - // wzyw - template - GLM_INLINE glm::vec<4, T, Q> wzyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.y, v.w); - } - - // wzzx - template - GLM_INLINE glm::vec<4, T, Q> wzzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.z, v.x); - } - - // wzzy - template - GLM_INLINE glm::vec<4, T, Q> wzzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.z, v.y); - } - - // wzzz - template - GLM_INLINE glm::vec<4, T, Q> wzzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.z, v.z); - } - - // wzzw - template - GLM_INLINE glm::vec<4, T, Q> wzzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.z, v.w); - } - - // wzwx - template - GLM_INLINE glm::vec<4, T, Q> wzwx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.w, v.x); - } - - // wzwy - template - GLM_INLINE glm::vec<4, T, Q> wzwy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.w, v.y); - } - - // wzwz - template - GLM_INLINE glm::vec<4, T, Q> wzwz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.w, v.z); - } - - // wzww - template - GLM_INLINE glm::vec<4, T, Q> wzww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.z, v.w, v.w); - } - - // wwxx - template - GLM_INLINE glm::vec<4, T, Q> wwxx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.x, v.x); - } - - // wwxy - template - GLM_INLINE glm::vec<4, T, Q> wwxy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.x, v.y); - } - - // wwxz - template - GLM_INLINE glm::vec<4, T, Q> wwxz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.x, v.z); - } - - // wwxw - template - GLM_INLINE glm::vec<4, T, Q> wwxw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.x, v.w); - } - - // wwyx - template - GLM_INLINE glm::vec<4, T, Q> wwyx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.y, v.x); - } - - // wwyy - template - GLM_INLINE glm::vec<4, T, Q> wwyy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.y, v.y); - } - - // wwyz - template - GLM_INLINE glm::vec<4, T, Q> wwyz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.y, v.z); - } - - // wwyw - template - GLM_INLINE glm::vec<4, T, Q> wwyw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.y, v.w); - } - - // wwzx - template - GLM_INLINE glm::vec<4, T, Q> wwzx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.z, v.x); - } - - // wwzy - template - GLM_INLINE glm::vec<4, T, Q> wwzy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.z, v.y); - } - - // wwzz - template - GLM_INLINE glm::vec<4, T, Q> wwzz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.z, v.z); - } - - // wwzw - template - GLM_INLINE glm::vec<4, T, Q> wwzw(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.z, v.w); - } - - // wwwx - template - GLM_INLINE glm::vec<4, T, Q> wwwx(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.w, v.x); - } - - // wwwy - template - GLM_INLINE glm::vec<4, T, Q> wwwy(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.w, v.y); - } - - // wwwz - template - GLM_INLINE glm::vec<4, T, Q> wwwz(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.w, v.z); - } - - // wwww - template - GLM_INLINE glm::vec<4, T, Q> wwww(const glm::vec<4, T, Q> &v) { - return glm::vec<4, T, Q>(v.w, v.w, v.w, v.w); - } - -} diff --git a/3rdparty/glm/source/glm/gtx/vector_angle.hpp b/3rdparty/glm/source/glm/gtx/vector_angle.hpp deleted file mode 100644 index 9ae4371..0000000 --- a/3rdparty/glm/source/glm/gtx/vector_angle.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/// @ref gtx_vector_angle -/// @file glm/gtx/vector_angle.hpp -/// -/// @see core (dependence) -/// @see gtx_quaternion (dependence) -/// @see gtx_epsilon (dependence) -/// -/// @defgroup gtx_vector_angle GLM_GTX_vector_angle -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Compute angle between vectors - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../gtc/epsilon.hpp" -#include "../gtx/quaternion.hpp" -#include "../gtx/rotate_vector.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_vector_angle is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_vector_angle extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_vector_angle - /// @{ - - //! Returns the absolute angle between two vectors. - //! Parameters need to be normalized. - /// @see gtx_vector_angle extension. - template - GLM_FUNC_DECL T angle(vec const& x, vec const& y); - - //! Returns the oriented angle between two 2d vectors. - //! Parameters need to be normalized. - /// @see gtx_vector_angle extension. - template - GLM_FUNC_DECL T orientedAngle(vec<2, T, Q> const& x, vec<2, T, Q> const& y); - - //! Returns the oriented angle between two 3d vectors based from a reference axis. - //! Parameters need to be normalized. - /// @see gtx_vector_angle extension. - template - GLM_FUNC_DECL T orientedAngle(vec<3, T, Q> const& x, vec<3, T, Q> const& y, vec<3, T, Q> const& ref); - - /// @} -}// namespace glm - -#include "vector_angle.inl" diff --git a/3rdparty/glm/source/glm/gtx/vector_angle.inl b/3rdparty/glm/source/glm/gtx/vector_angle.inl deleted file mode 100644 index 878160d..0000000 --- a/3rdparty/glm/source/glm/gtx/vector_angle.inl +++ /dev/null @@ -1,45 +0,0 @@ -/// @ref gtx_vector_angle - -namespace glm -{ - template - GLM_FUNC_QUALIFIER genType angle - ( - genType const& x, - genType const& y - ) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'angle' only accept floating-point inputs"); - return acos(clamp(dot(x, y), genType(-1), genType(1))); - } - - template - GLM_FUNC_QUALIFIER T angle(vec const& x, vec const& y) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'angle' only accept floating-point inputs"); - return acos(clamp(dot(x, y), T(-1), T(1))); - } - - template - GLM_FUNC_QUALIFIER T orientedAngle(vec<2, T, Q> const& x, vec<2, T, Q> const& y) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'orientedAngle' only accept floating-point inputs"); - T const Angle(acos(clamp(dot(x, y), T(-1), T(1)))); - - T const partialCross = x.x * y.y - y.x * x.y; - - if (partialCross > T(0)) - return Angle; - else - return -Angle; - } - - template - GLM_FUNC_QUALIFIER T orientedAngle(vec<3, T, Q> const& x, vec<3, T, Q> const& y, vec<3, T, Q> const& ref) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'orientedAngle' only accept floating-point inputs"); - - T const Angle(acos(clamp(dot(x, y), T(-1), T(1)))); - return mix(Angle, -Angle, dot(ref, cross(x, y)) < T(0)); - } -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/vector_query.hpp b/3rdparty/glm/source/glm/gtx/vector_query.hpp deleted file mode 100644 index 77c7b97..0000000 --- a/3rdparty/glm/source/glm/gtx/vector_query.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/// @ref gtx_vector_query -/// @file glm/gtx/vector_query.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_vector_query GLM_GTX_vector_query -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Query informations of vector types - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include -#include - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_vector_query is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_vector_query extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_vector_query - /// @{ - - //! Check whether two vectors are collinears. - /// @see gtx_vector_query extensions. - template - GLM_FUNC_DECL bool areCollinear(vec const& v0, vec const& v1, T const& epsilon); - - //! Check whether two vectors are orthogonals. - /// @see gtx_vector_query extensions. - template - GLM_FUNC_DECL bool areOrthogonal(vec const& v0, vec const& v1, T const& epsilon); - - //! Check whether a vector is normalized. - /// @see gtx_vector_query extensions. - template - GLM_FUNC_DECL bool isNormalized(vec const& v, T const& epsilon); - - //! Check whether a vector is null. - /// @see gtx_vector_query extensions. - template - GLM_FUNC_DECL bool isNull(vec const& v, T const& epsilon); - - //! Check whether a each component of a vector is null. - /// @see gtx_vector_query extensions. - template - GLM_FUNC_DECL vec isCompNull(vec const& v, T const& epsilon); - - //! Check whether two vectors are orthonormal. - /// @see gtx_vector_query extensions. - template - GLM_FUNC_DECL bool areOrthonormal(vec const& v0, vec const& v1, T const& epsilon); - - /// @} -}// namespace glm - -#include "vector_query.inl" diff --git a/3rdparty/glm/source/glm/gtx/vector_query.inl b/3rdparty/glm/source/glm/gtx/vector_query.inl deleted file mode 100644 index d1a5c9b..0000000 --- a/3rdparty/glm/source/glm/gtx/vector_query.inl +++ /dev/null @@ -1,154 +0,0 @@ -/// @ref gtx_vector_query - -#include - -namespace glm{ -namespace detail -{ - template - struct compute_areCollinear{}; - - template - struct compute_areCollinear<2, T, Q> - { - GLM_FUNC_QUALIFIER static bool call(vec<2, T, Q> const& v0, vec<2, T, Q> const& v1, T const& epsilon) - { - return length(cross(vec<3, T, Q>(v0, static_cast(0)), vec<3, T, Q>(v1, static_cast(0)))) < epsilon; - } - }; - - template - struct compute_areCollinear<3, T, Q> - { - GLM_FUNC_QUALIFIER static bool call(vec<3, T, Q> const& v0, vec<3, T, Q> const& v1, T const& epsilon) - { - return length(cross(v0, v1)) < epsilon; - } - }; - - template - struct compute_areCollinear<4, T, Q> - { - GLM_FUNC_QUALIFIER static bool call(vec<4, T, Q> const& v0, vec<4, T, Q> const& v1, T const& epsilon) - { - return length(cross(vec<3, T, Q>(v0), vec<3, T, Q>(v1))) < epsilon; - } - }; - - template - struct compute_isCompNull{}; - - template - struct compute_isCompNull<2, T, Q> - { - GLM_FUNC_QUALIFIER static vec<2, bool, Q> call(vec<2, T, Q> const& v, T const& epsilon) - { - return vec<2, bool, Q>( - (abs(v.x) < epsilon), - (abs(v.y) < epsilon)); - } - }; - - template - struct compute_isCompNull<3, T, Q> - { - GLM_FUNC_QUALIFIER static vec<3, bool, Q> call(vec<3, T, Q> const& v, T const& epsilon) - { - return vec<3, bool, Q>( - (abs(v.x) < epsilon), - (abs(v.y) < epsilon), - (abs(v.z) < epsilon)); - } - }; - - template - struct compute_isCompNull<4, T, Q> - { - GLM_FUNC_QUALIFIER static vec<4, bool, Q> call(vec<4, T, Q> const& v, T const& epsilon) - { - return vec<4, bool, Q>( - (abs(v.x) < epsilon), - (abs(v.y) < epsilon), - (abs(v.z) < epsilon), - (abs(v.w) < epsilon)); - } - }; - -}//namespace detail - - template - GLM_FUNC_QUALIFIER bool areCollinear(vec const& v0, vec const& v1, T const& epsilon) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'areCollinear' only accept floating-point inputs"); - - return detail::compute_areCollinear::call(v0, v1, epsilon); - } - - template - GLM_FUNC_QUALIFIER bool areOrthogonal(vec const& v0, vec const& v1, T const& epsilon) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'areOrthogonal' only accept floating-point inputs"); - - return abs(dot(v0, v1)) <= max( - static_cast(1), - length(v0)) * max(static_cast(1), length(v1)) * epsilon; - } - - template - GLM_FUNC_QUALIFIER bool isNormalized(vec const& v, T const& epsilon) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isNormalized' only accept floating-point inputs"); - - return abs(length(v) - static_cast(1)) <= static_cast(2) * epsilon; - } - - template - GLM_FUNC_QUALIFIER bool isNull(vec const& v, T const& epsilon) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isNull' only accept floating-point inputs"); - - return length(v) <= epsilon; - } - - template - GLM_FUNC_QUALIFIER vec isCompNull(vec const& v, T const& epsilon) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_iec559, "'isCompNull' only accept floating-point inputs"); - - return detail::compute_isCompNull::call(v, epsilon); - } - - template - GLM_FUNC_QUALIFIER vec<2, bool, Q> isCompNull(vec<2, T, Q> const& v, T const& epsilon) - { - return vec<2, bool, Q>( - abs(v.x) < epsilon, - abs(v.y) < epsilon); - } - - template - GLM_FUNC_QUALIFIER vec<3, bool, Q> isCompNull(vec<3, T, Q> const& v, T const& epsilon) - { - return vec<3, bool, Q>( - abs(v.x) < epsilon, - abs(v.y) < epsilon, - abs(v.z) < epsilon); - } - - template - GLM_FUNC_QUALIFIER vec<4, bool, Q> isCompNull(vec<4, T, Q> const& v, T const& epsilon) - { - return vec<4, bool, Q>( - abs(v.x) < epsilon, - abs(v.y) < epsilon, - abs(v.z) < epsilon, - abs(v.w) < epsilon); - } - - template - GLM_FUNC_QUALIFIER bool areOrthonormal(vec const& v0, vec const& v1, T const& epsilon) - { - return isNormalized(v0, epsilon) && isNormalized(v1, epsilon) && (abs(dot(v0, v1)) <= epsilon); - } - -}//namespace glm diff --git a/3rdparty/glm/source/glm/gtx/wrap.hpp b/3rdparty/glm/source/glm/gtx/wrap.hpp deleted file mode 100644 index ad4eb3f..0000000 --- a/3rdparty/glm/source/glm/gtx/wrap.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/// @ref gtx_wrap -/// @file glm/gtx/wrap.hpp -/// -/// @see core (dependence) -/// -/// @defgroup gtx_wrap GLM_GTX_wrap -/// @ingroup gtx -/// -/// Include to use the features of this extension. -/// -/// Wrapping mode of texture coordinates. - -#pragma once - -// Dependency: -#include "../glm.hpp" -#include "../ext/scalar_common.hpp" -#include "../ext/vector_common.hpp" -#include "../gtc/vec1.hpp" - -#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED) -# ifndef GLM_ENABLE_EXPERIMENTAL -# pragma message("GLM: GLM_GTX_wrap is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.") -# else -# pragma message("GLM: GLM_GTX_wrap extension included") -# endif -#endif - -namespace glm -{ - /// @addtogroup gtx_wrap - /// @{ - - /// @} -}// namespace glm - -#include "wrap.inl" diff --git a/3rdparty/glm/source/glm/gtx/wrap.inl b/3rdparty/glm/source/glm/gtx/wrap.inl deleted file mode 100644 index 4be3b4c..0000000 --- a/3rdparty/glm/source/glm/gtx/wrap.inl +++ /dev/null @@ -1,6 +0,0 @@ -/// @ref gtx_wrap - -namespace glm -{ - -}//namespace glm diff --git a/3rdparty/glm/source/glm/integer.hpp b/3rdparty/glm/source/glm/integer.hpp deleted file mode 100644 index 8817db3..0000000 --- a/3rdparty/glm/source/glm/integer.hpp +++ /dev/null @@ -1,212 +0,0 @@ -/// @ref core -/// @file glm/integer.hpp -/// -/// @see GLSL 4.20.8 specification, section 8.8 Integer Functions -/// -/// @defgroup core_func_integer Integer functions -/// @ingroup core -/// -/// Provides GLSL functions on integer types -/// -/// These all operate component-wise. The description is per component. -/// The notation [a, b] means the set of bits from bit-number a through bit-number -/// b, inclusive. The lowest-order bit is bit 0. -/// -/// Include to use these core features. - -#pragma once - -#include "detail/qualifier.hpp" -#include "common.hpp" -#include "vector_relational.hpp" - -namespace glm -{ - /// @addtogroup core_func_integer - /// @{ - - /// Adds 32-bit unsigned integer x and y, returning the sum - /// modulo pow(2, 32). The value carry is set to 0 if the sum was - /// less than pow(2, 32), or to 1 otherwise. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// - /// @see GLSL uaddCarry man page - /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions - template - GLM_FUNC_DECL vec uaddCarry( - vec const& x, - vec const& y, - vec & carry); - - /// Subtracts the 32-bit unsigned integer y from x, returning - /// the difference if non-negative, or pow(2, 32) plus the difference - /// otherwise. The value borrow is set to 0 if x >= y, or to 1 otherwise. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// - /// @see GLSL usubBorrow man page - /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions - template - GLM_FUNC_DECL vec usubBorrow( - vec const& x, - vec const& y, - vec & borrow); - - /// Multiplies 32-bit integers x and y, producing a 64-bit - /// result. The 32 least-significant bits are returned in lsb. - /// The 32 most-significant bits are returned in msb. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// - /// @see GLSL umulExtended man page - /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions - template - GLM_FUNC_DECL void umulExtended( - vec const& x, - vec const& y, - vec & msb, - vec & lsb); - - /// Multiplies 32-bit integers x and y, producing a 64-bit - /// result. The 32 least-significant bits are returned in lsb. - /// The 32 most-significant bits are returned in msb. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// - /// @see GLSL imulExtended man page - /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions - template - GLM_FUNC_DECL void imulExtended( - vec const& x, - vec const& y, - vec & msb, - vec & lsb); - - /// Extracts bits [offset, offset + bits - 1] from value, - /// returning them in the least significant bits of the result. - /// For unsigned data types, the most significant bits of the - /// result will be set to zero. For signed data types, the - /// most significant bits will be set to the value of bit offset + base - 1. - /// - /// If bits is zero, the result will be zero. The result will be - /// undefined if offset or bits is negative, or if the sum of - /// offset and bits is greater than the number of bits used - /// to store the operand. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Signed or unsigned integer scalar types. - /// - /// @see GLSL bitfieldExtract man page - /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions - template - GLM_FUNC_DECL vec bitfieldExtract( - vec const& Value, - int Offset, - int Bits); - - /// Returns the insertion the bits least-significant bits of insert into base. - /// - /// The result will have bits [offset, offset + bits - 1] taken - /// from bits [0, bits - 1] of insert, and all other bits taken - /// directly from the corresponding bits of base. If bits is - /// zero, the result will simply be base. The result will be - /// undefined if offset or bits is negative, or if the sum of - /// offset and bits is greater than the number of bits used to - /// store the operand. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Signed or unsigned integer scalar or vector types. - /// - /// @see GLSL bitfieldInsert man page - /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions - template - GLM_FUNC_DECL vec bitfieldInsert( - vec const& Base, - vec const& Insert, - int Offset, - int Bits); - - /// Returns the reversal of the bits of value. - /// The bit numbered n of the result will be taken from bit (bits - 1) - n of value, - /// where bits is the total number of bits used to represent value. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Signed or unsigned integer scalar or vector types. - /// - /// @see GLSL bitfieldReverse man page - /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions - template - GLM_FUNC_DECL vec bitfieldReverse(vec const& v); - - /// Returns the number of bits set to 1 in the binary representation of value. - /// - /// @tparam genType Signed or unsigned integer scalar or vector types. - /// - /// @see GLSL bitCount man page - /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions - template - GLM_FUNC_DECL int bitCount(genType v); - - /// Returns the number of bits set to 1 in the binary representation of value. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Signed or unsigned integer scalar or vector types. - /// - /// @see GLSL bitCount man page - /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions - template - GLM_FUNC_DECL vec bitCount(vec const& v); - - /// Returns the bit number of the least significant bit set to - /// 1 in the binary representation of value. - /// If value is zero, -1 will be returned. - /// - /// @tparam genIUType Signed or unsigned integer scalar types. - /// - /// @see GLSL findLSB man page - /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions - template - GLM_FUNC_DECL int findLSB(genIUType x); - - /// Returns the bit number of the least significant bit set to - /// 1 in the binary representation of value. - /// If value is zero, -1 will be returned. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Signed or unsigned integer scalar types. - /// - /// @see GLSL findLSB man page - /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions - template - GLM_FUNC_DECL vec findLSB(vec const& v); - - /// Returns the bit number of the most significant bit in the binary representation of value. - /// For positive integers, the result will be the bit number of the most significant bit set to 1. - /// For negative integers, the result will be the bit number of the most significant - /// bit set to 0. For a value of zero or negative one, -1 will be returned. - /// - /// @tparam genIUType Signed or unsigned integer scalar types. - /// - /// @see GLSL findMSB man page - /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions - template - GLM_FUNC_DECL int findMSB(genIUType x); - - /// Returns the bit number of the most significant bit in the binary representation of value. - /// For positive integers, the result will be the bit number of the most significant bit set to 1. - /// For negative integers, the result will be the bit number of the most significant - /// bit set to 0. For a value of zero or negative one, -1 will be returned. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Signed or unsigned integer scalar types. - /// - /// @see GLSL findMSB man page - /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions - template - GLM_FUNC_DECL vec findMSB(vec const& v); - - /// @} -}//namespace glm - -#include "detail/func_integer.inl" diff --git a/3rdparty/glm/source/glm/mat2x2.hpp b/3rdparty/glm/source/glm/mat2x2.hpp deleted file mode 100644 index 96bec96..0000000 --- a/3rdparty/glm/source/glm/mat2x2.hpp +++ /dev/null @@ -1,9 +0,0 @@ -/// @ref core -/// @file glm/mat2x2.hpp - -#pragma once -#include "./ext/matrix_double2x2.hpp" -#include "./ext/matrix_double2x2_precision.hpp" -#include "./ext/matrix_float2x2.hpp" -#include "./ext/matrix_float2x2_precision.hpp" - diff --git a/3rdparty/glm/source/glm/mat2x3.hpp b/3rdparty/glm/source/glm/mat2x3.hpp deleted file mode 100644 index d68dc25..0000000 --- a/3rdparty/glm/source/glm/mat2x3.hpp +++ /dev/null @@ -1,9 +0,0 @@ -/// @ref core -/// @file glm/mat2x3.hpp - -#pragma once -#include "./ext/matrix_double2x3.hpp" -#include "./ext/matrix_double2x3_precision.hpp" -#include "./ext/matrix_float2x3.hpp" -#include "./ext/matrix_float2x3_precision.hpp" - diff --git a/3rdparty/glm/source/glm/mat2x4.hpp b/3rdparty/glm/source/glm/mat2x4.hpp deleted file mode 100644 index b04b738..0000000 --- a/3rdparty/glm/source/glm/mat2x4.hpp +++ /dev/null @@ -1,9 +0,0 @@ -/// @ref core -/// @file glm/mat2x4.hpp - -#pragma once -#include "./ext/matrix_double2x4.hpp" -#include "./ext/matrix_double2x4_precision.hpp" -#include "./ext/matrix_float2x4.hpp" -#include "./ext/matrix_float2x4_precision.hpp" - diff --git a/3rdparty/glm/source/glm/mat3x2.hpp b/3rdparty/glm/source/glm/mat3x2.hpp deleted file mode 100644 index c853153..0000000 --- a/3rdparty/glm/source/glm/mat3x2.hpp +++ /dev/null @@ -1,9 +0,0 @@ -/// @ref core -/// @file glm/mat3x2.hpp - -#pragma once -#include "./ext/matrix_double3x2.hpp" -#include "./ext/matrix_double3x2_precision.hpp" -#include "./ext/matrix_float3x2.hpp" -#include "./ext/matrix_float3x2_precision.hpp" - diff --git a/3rdparty/glm/source/glm/mat3x3.hpp b/3rdparty/glm/source/glm/mat3x3.hpp deleted file mode 100644 index fd4fa31..0000000 --- a/3rdparty/glm/source/glm/mat3x3.hpp +++ /dev/null @@ -1,8 +0,0 @@ -/// @ref core -/// @file glm/mat3x3.hpp - -#pragma once -#include "./ext/matrix_double3x3.hpp" -#include "./ext/matrix_double3x3_precision.hpp" -#include "./ext/matrix_float3x3.hpp" -#include "./ext/matrix_float3x3_precision.hpp" diff --git a/3rdparty/glm/source/glm/mat3x4.hpp b/3rdparty/glm/source/glm/mat3x4.hpp deleted file mode 100644 index 6342bf5..0000000 --- a/3rdparty/glm/source/glm/mat3x4.hpp +++ /dev/null @@ -1,8 +0,0 @@ -/// @ref core -/// @file glm/mat3x4.hpp - -#pragma once -#include "./ext/matrix_double3x4.hpp" -#include "./ext/matrix_double3x4_precision.hpp" -#include "./ext/matrix_float3x4.hpp" -#include "./ext/matrix_float3x4_precision.hpp" diff --git a/3rdparty/glm/source/glm/mat4x2.hpp b/3rdparty/glm/source/glm/mat4x2.hpp deleted file mode 100644 index e013e46..0000000 --- a/3rdparty/glm/source/glm/mat4x2.hpp +++ /dev/null @@ -1,9 +0,0 @@ -/// @ref core -/// @file glm/mat4x2.hpp - -#pragma once -#include "./ext/matrix_double4x2.hpp" -#include "./ext/matrix_double4x2_precision.hpp" -#include "./ext/matrix_float4x2.hpp" -#include "./ext/matrix_float4x2_precision.hpp" - diff --git a/3rdparty/glm/source/glm/mat4x3.hpp b/3rdparty/glm/source/glm/mat4x3.hpp deleted file mode 100644 index 205725a..0000000 --- a/3rdparty/glm/source/glm/mat4x3.hpp +++ /dev/null @@ -1,8 +0,0 @@ -/// @ref core -/// @file glm/mat4x3.hpp - -#pragma once -#include "./ext/matrix_double4x3.hpp" -#include "./ext/matrix_double4x3_precision.hpp" -#include "./ext/matrix_float4x3.hpp" -#include "./ext/matrix_float4x3_precision.hpp" diff --git a/3rdparty/glm/source/glm/mat4x4.hpp b/3rdparty/glm/source/glm/mat4x4.hpp deleted file mode 100644 index 3515f7f..0000000 --- a/3rdparty/glm/source/glm/mat4x4.hpp +++ /dev/null @@ -1,9 +0,0 @@ -/// @ref core -/// @file glm/mat4x4.hpp - -#pragma once -#include "./ext/matrix_double4x4.hpp" -#include "./ext/matrix_double4x4_precision.hpp" -#include "./ext/matrix_float4x4.hpp" -#include "./ext/matrix_float4x4_precision.hpp" - diff --git a/3rdparty/glm/source/glm/matrix.hpp b/3rdparty/glm/source/glm/matrix.hpp deleted file mode 100644 index 4584c92..0000000 --- a/3rdparty/glm/source/glm/matrix.hpp +++ /dev/null @@ -1,161 +0,0 @@ -/// @ref core -/// @file glm/matrix.hpp -/// -/// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions -/// -/// @defgroup core_func_matrix Matrix functions -/// @ingroup core -/// -/// Provides GLSL matrix functions. -/// -/// Include to use these core features. - -#pragma once - -// Dependencies -#include "detail/qualifier.hpp" -#include "detail/setup.hpp" -#include "vec2.hpp" -#include "vec3.hpp" -#include "vec4.hpp" -#include "mat2x2.hpp" -#include "mat2x3.hpp" -#include "mat2x4.hpp" -#include "mat3x2.hpp" -#include "mat3x3.hpp" -#include "mat3x4.hpp" -#include "mat4x2.hpp" -#include "mat4x3.hpp" -#include "mat4x4.hpp" - -namespace glm { -namespace detail -{ - template - struct outerProduct_trait{}; - - template - struct outerProduct_trait<2, 2, T, Q> - { - typedef mat<2, 2, T, Q> type; - }; - - template - struct outerProduct_trait<2, 3, T, Q> - { - typedef mat<3, 2, T, Q> type; - }; - - template - struct outerProduct_trait<2, 4, T, Q> - { - typedef mat<4, 2, T, Q> type; - }; - - template - struct outerProduct_trait<3, 2, T, Q> - { - typedef mat<2, 3, T, Q> type; - }; - - template - struct outerProduct_trait<3, 3, T, Q> - { - typedef mat<3, 3, T, Q> type; - }; - - template - struct outerProduct_trait<3, 4, T, Q> - { - typedef mat<4, 3, T, Q> type; - }; - - template - struct outerProduct_trait<4, 2, T, Q> - { - typedef mat<2, 4, T, Q> type; - }; - - template - struct outerProduct_trait<4, 3, T, Q> - { - typedef mat<3, 4, T, Q> type; - }; - - template - struct outerProduct_trait<4, 4, T, Q> - { - typedef mat<4, 4, T, Q> type; - }; -}//namespace detail - - /// @addtogroup core_func_matrix - /// @{ - - /// Multiply matrix x by matrix y component-wise, i.e., - /// result[i][j] is the scalar product of x[i][j] and y[i][j]. - /// - /// @tparam C Integer between 1 and 4 included that qualify the number a column - /// @tparam R Integer between 1 and 4 included that qualify the number a row - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL matrixCompMult man page - /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions - template - GLM_FUNC_DECL mat matrixCompMult(mat const& x, mat const& y); - - /// Treats the first parameter c as a column vector - /// and the second parameter r as a row vector - /// and does a linear algebraic matrix multiply c * r. - /// - /// @tparam C Integer between 1 and 4 included that qualify the number a column - /// @tparam R Integer between 1 and 4 included that qualify the number a row - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL outerProduct man page - /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions - template - GLM_FUNC_DECL typename detail::outerProduct_trait::type outerProduct(vec const& c, vec const& r); - - /// Returns the transposed matrix of x - /// - /// @tparam C Integer between 1 and 4 included that qualify the number a column - /// @tparam R Integer between 1 and 4 included that qualify the number a row - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL transpose man page - /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions - template - GLM_FUNC_DECL typename mat::transpose_type transpose(mat const& x); - - /// Return the determinant of a squared matrix. - /// - /// @tparam C Integer between 1 and 4 included that qualify the number a column - /// @tparam R Integer between 1 and 4 included that qualify the number a row - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL determinant man page - /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions - template - GLM_FUNC_DECL T determinant(mat const& m); - - /// Return the inverse of a squared matrix. - /// - /// @tparam C Integer between 1 and 4 included that qualify the number a column - /// @tparam R Integer between 1 and 4 included that qualify the number a row - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL inverse man page - /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions - template - GLM_FUNC_DECL mat inverse(mat const& m); - - /// @} -}//namespace glm - -#include "detail/func_matrix.inl" diff --git a/3rdparty/glm/source/glm/packing.hpp b/3rdparty/glm/source/glm/packing.hpp deleted file mode 100644 index ca83ac1..0000000 --- a/3rdparty/glm/source/glm/packing.hpp +++ /dev/null @@ -1,173 +0,0 @@ -/// @ref core -/// @file glm/packing.hpp -/// -/// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions -/// @see gtc_packing -/// -/// @defgroup core_func_packing Floating-Point Pack and Unpack Functions -/// @ingroup core -/// -/// Provides GLSL functions to pack and unpack half, single and double-precision floating point values into more compact integer types. -/// -/// These functions do not operate component-wise, rather as described in each case. -/// -/// Include to use these core features. - -#pragma once - -#include "./ext/vector_uint2.hpp" -#include "./ext/vector_float2.hpp" -#include "./ext/vector_float4.hpp" - -namespace glm -{ - /// @addtogroup core_func_packing - /// @{ - - /// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. - /// Then, the results are packed into the returned 32-bit unsigned integer. - /// - /// The conversion for component c of v to fixed point is done as follows: - /// packUnorm2x16: round(clamp(c, 0, +1) * 65535.0) - /// - /// The first component of the vector will be written to the least significant bits of the output; - /// the last component will be written to the most significant bits. - /// - /// @see GLSL packUnorm2x16 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL uint packUnorm2x16(vec2 const& v); - - /// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. - /// Then, the results are packed into the returned 32-bit unsigned integer. - /// - /// The conversion for component c of v to fixed point is done as follows: - /// packSnorm2x16: round(clamp(v, -1, +1) * 32767.0) - /// - /// The first component of the vector will be written to the least significant bits of the output; - /// the last component will be written to the most significant bits. - /// - /// @see GLSL packSnorm2x16 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL uint packSnorm2x16(vec2 const& v); - - /// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. - /// Then, the results are packed into the returned 32-bit unsigned integer. - /// - /// The conversion for component c of v to fixed point is done as follows: - /// packUnorm4x8: round(clamp(c, 0, +1) * 255.0) - /// - /// The first component of the vector will be written to the least significant bits of the output; - /// the last component will be written to the most significant bits. - /// - /// @see GLSL packUnorm4x8 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL uint packUnorm4x8(vec4 const& v); - - /// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. - /// Then, the results are packed into the returned 32-bit unsigned integer. - /// - /// The conversion for component c of v to fixed point is done as follows: - /// packSnorm4x8: round(clamp(c, -1, +1) * 127.0) - /// - /// The first component of the vector will be written to the least significant bits of the output; - /// the last component will be written to the most significant bits. - /// - /// @see GLSL packSnorm4x8 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL uint packSnorm4x8(vec4 const& v); - - /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. - /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackUnorm2x16: f / 65535.0 - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see GLSL unpackUnorm2x16 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL vec2 unpackUnorm2x16(uint p); - - /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. - /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackSnorm2x16: clamp(f / 32767.0, -1, +1) - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see GLSL unpackSnorm2x16 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL vec2 unpackSnorm2x16(uint p); - - /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. - /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackUnorm4x8: f / 255.0 - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see GLSL unpackUnorm4x8 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL vec4 unpackUnorm4x8(uint p); - - /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. - /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. - /// - /// The conversion for unpacked fixed-point value f to floating point is done as follows: - /// unpackSnorm4x8: clamp(f / 127.0, -1, +1) - /// - /// The first component of the returned vector will be extracted from the least significant bits of the input; - /// the last component will be extracted from the most significant bits. - /// - /// @see GLSL unpackSnorm4x8 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL vec4 unpackSnorm4x8(uint p); - - /// Returns a double-qualifier value obtained by packing the components of v into a 64-bit value. - /// If an IEEE 754 Inf or NaN is created, it will not signal, and the resulting floating point value is unspecified. - /// Otherwise, the bit- level representation of v is preserved. - /// The first vector component specifies the 32 least significant bits; - /// the second component specifies the 32 most significant bits. - /// - /// @see GLSL packDouble2x32 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL double packDouble2x32(uvec2 const& v); - - /// Returns a two-component unsigned integer vector representation of v. - /// The bit-level representation of v is preserved. - /// The first component of the vector contains the 32 least significant bits of the double; - /// the second component consists the 32 most significant bits. - /// - /// @see GLSL unpackDouble2x32 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL uvec2 unpackDouble2x32(double v); - - /// Returns an unsigned integer obtained by converting the components of a two-component floating-point vector - /// to the 16-bit floating-point representation found in the OpenGL Specification, - /// and then packing these two 16- bit integers into a 32-bit unsigned integer. - /// The first vector component specifies the 16 least-significant bits of the result; - /// the second component specifies the 16 most-significant bits. - /// - /// @see GLSL packHalf2x16 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL uint packHalf2x16(vec2 const& v); - - /// Returns a two-component floating-point vector with components obtained by unpacking a 32-bit unsigned integer into a pair of 16-bit values, - /// interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification, - /// and converting them to 32-bit floating-point values. - /// The first component of the vector is obtained from the 16 least-significant bits of v; - /// the second component is obtained from the 16 most-significant bits of v. - /// - /// @see GLSL unpackHalf2x16 man page - /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - GLM_FUNC_DECL vec2 unpackHalf2x16(uint v); - - /// @} -}//namespace glm - -#include "detail/func_packing.inl" diff --git a/3rdparty/glm/source/glm/simd/common.h b/3rdparty/glm/source/glm/simd/common.h deleted file mode 100644 index 9b017cb..0000000 --- a/3rdparty/glm/source/glm/simd/common.h +++ /dev/null @@ -1,240 +0,0 @@ -/// @ref simd -/// @file glm/simd/common.h - -#pragma once - -#include "platform.h" - -#if GLM_ARCH & GLM_ARCH_SSE2_BIT - -GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_add(glm_f32vec4 a, glm_f32vec4 b) -{ - return _mm_add_ps(a, b); -} - -GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_add(glm_f32vec4 a, glm_f32vec4 b) -{ - return _mm_add_ss(a, b); -} - -GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_sub(glm_f32vec4 a, glm_f32vec4 b) -{ - return _mm_sub_ps(a, b); -} - -GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_sub(glm_f32vec4 a, glm_f32vec4 b) -{ - return _mm_sub_ss(a, b); -} - -GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_mul(glm_f32vec4 a, glm_f32vec4 b) -{ - return _mm_mul_ps(a, b); -} - -GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_mul(glm_f32vec4 a, glm_f32vec4 b) -{ - return _mm_mul_ss(a, b); -} - -GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_div(glm_f32vec4 a, glm_f32vec4 b) -{ - return _mm_div_ps(a, b); -} - -GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_div(glm_f32vec4 a, glm_f32vec4 b) -{ - return _mm_div_ss(a, b); -} - -GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_div_lowp(glm_f32vec4 a, glm_f32vec4 b) -{ - return glm_vec4_mul(a, _mm_rcp_ps(b)); -} - -GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_swizzle_xyzw(glm_f32vec4 a) -{ -# if GLM_ARCH & GLM_ARCH_AVX2_BIT - return _mm_permute_ps(a, _MM_SHUFFLE(3, 2, 1, 0)); -# else - return _mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 2, 1, 0)); -# endif -} - -GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_fma(glm_f32vec4 a, glm_f32vec4 b, glm_f32vec4 c) -{ -# if (GLM_ARCH & GLM_ARCH_AVX2_BIT) && !(GLM_COMPILER & GLM_COMPILER_CLANG) - return _mm_fmadd_ss(a, b, c); -# else - return _mm_add_ss(_mm_mul_ss(a, b), c); -# endif -} - -GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_fma(glm_f32vec4 a, glm_f32vec4 b, glm_f32vec4 c) -{ -# if (GLM_ARCH & GLM_ARCH_AVX2_BIT) && !(GLM_COMPILER & GLM_COMPILER_CLANG) - return _mm_fmadd_ps(a, b, c); -# else - return glm_vec4_add(glm_vec4_mul(a, b), c); -# endif -} - -GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_abs(glm_f32vec4 x) -{ - return _mm_and_ps(x, _mm_castsi128_ps(_mm_set1_epi32(0x7FFFFFFF))); -} - -GLM_FUNC_QUALIFIER glm_ivec4 glm_ivec4_abs(glm_ivec4 x) -{ -# if GLM_ARCH & GLM_ARCH_SSSE3_BIT - return _mm_sign_epi32(x, x); -# else - glm_ivec4 const sgn0 = _mm_srai_epi32(x, 31); - glm_ivec4 const inv0 = _mm_xor_si128(x, sgn0); - glm_ivec4 const sub0 = _mm_sub_epi32(inv0, sgn0); - return sub0; -# endif -} - -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_sign(glm_vec4 x) -{ - glm_vec4 const zro0 = _mm_setzero_ps(); - glm_vec4 const cmp0 = _mm_cmplt_ps(x, zro0); - glm_vec4 const cmp1 = _mm_cmpgt_ps(x, zro0); - glm_vec4 const and0 = _mm_and_ps(cmp0, _mm_set1_ps(-1.0f)); - glm_vec4 const and1 = _mm_and_ps(cmp1, _mm_set1_ps(1.0f)); - glm_vec4 const or0 = _mm_or_ps(and0, and1); - return or0; -} - -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_round(glm_vec4 x) -{ -# if GLM_ARCH & GLM_ARCH_SSE41_BIT - return _mm_round_ps(x, _MM_FROUND_TO_NEAREST_INT); -# else - glm_vec4 const sgn0 = _mm_castsi128_ps(_mm_set1_epi32(int(0x80000000))); - glm_vec4 const and0 = _mm_and_ps(sgn0, x); - glm_vec4 const or0 = _mm_or_ps(and0, _mm_set_ps1(8388608.0f)); - glm_vec4 const add0 = glm_vec4_add(x, or0); - glm_vec4 const sub0 = glm_vec4_sub(add0, or0); - return sub0; -# endif -} - -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_floor(glm_vec4 x) -{ -# if GLM_ARCH & GLM_ARCH_SSE41_BIT - return _mm_floor_ps(x); -# else - glm_vec4 const rnd0 = glm_vec4_round(x); - glm_vec4 const cmp0 = _mm_cmplt_ps(x, rnd0); - glm_vec4 const and0 = _mm_and_ps(cmp0, _mm_set1_ps(1.0f)); - glm_vec4 const sub0 = glm_vec4_sub(rnd0, and0); - return sub0; -# endif -} - -/* trunc TODO -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_trunc(glm_vec4 x) -{ - return glm_vec4(); -} -*/ - -//roundEven -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_roundEven(glm_vec4 x) -{ - glm_vec4 const sgn0 = _mm_castsi128_ps(_mm_set1_epi32(int(0x80000000))); - glm_vec4 const and0 = _mm_and_ps(sgn0, x); - glm_vec4 const or0 = _mm_or_ps(and0, _mm_set_ps1(8388608.0f)); - glm_vec4 const add0 = glm_vec4_add(x, or0); - glm_vec4 const sub0 = glm_vec4_sub(add0, or0); - return sub0; -} - -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_ceil(glm_vec4 x) -{ -# if GLM_ARCH & GLM_ARCH_SSE41_BIT - return _mm_ceil_ps(x); -# else - glm_vec4 const rnd0 = glm_vec4_round(x); - glm_vec4 const cmp0 = _mm_cmpgt_ps(x, rnd0); - glm_vec4 const and0 = _mm_and_ps(cmp0, _mm_set1_ps(1.0f)); - glm_vec4 const add0 = glm_vec4_add(rnd0, and0); - return add0; -# endif -} - -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_fract(glm_vec4 x) -{ - glm_vec4 const flr0 = glm_vec4_floor(x); - glm_vec4 const sub0 = glm_vec4_sub(x, flr0); - return sub0; -} - -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_mod(glm_vec4 x, glm_vec4 y) -{ - glm_vec4 const div0 = glm_vec4_div(x, y); - glm_vec4 const flr0 = glm_vec4_floor(div0); - glm_vec4 const mul0 = glm_vec4_mul(y, flr0); - glm_vec4 const sub0 = glm_vec4_sub(x, mul0); - return sub0; -} - -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_clamp(glm_vec4 v, glm_vec4 minVal, glm_vec4 maxVal) -{ - glm_vec4 const min0 = _mm_min_ps(v, maxVal); - glm_vec4 const max0 = _mm_max_ps(min0, minVal); - return max0; -} - -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_mix(glm_vec4 v1, glm_vec4 v2, glm_vec4 a) -{ - glm_vec4 const sub0 = glm_vec4_sub(_mm_set1_ps(1.0f), a); - glm_vec4 const mul0 = glm_vec4_mul(v1, sub0); - glm_vec4 const mad0 = glm_vec4_fma(v2, a, mul0); - return mad0; -} - -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_step(glm_vec4 edge, glm_vec4 x) -{ - glm_vec4 const cmp = _mm_cmple_ps(x, edge); - return _mm_movemask_ps(cmp) == 0 ? _mm_set1_ps(1.0f) : _mm_setzero_ps(); -} - -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_smoothstep(glm_vec4 edge0, glm_vec4 edge1, glm_vec4 x) -{ - glm_vec4 const sub0 = glm_vec4_sub(x, edge0); - glm_vec4 const sub1 = glm_vec4_sub(edge1, edge0); - glm_vec4 const div0 = glm_vec4_sub(sub0, sub1); - glm_vec4 const clp0 = glm_vec4_clamp(div0, _mm_setzero_ps(), _mm_set1_ps(1.0f)); - glm_vec4 const mul0 = glm_vec4_mul(_mm_set1_ps(2.0f), clp0); - glm_vec4 const sub2 = glm_vec4_sub(_mm_set1_ps(3.0f), mul0); - glm_vec4 const mul1 = glm_vec4_mul(clp0, clp0); - glm_vec4 const mul2 = glm_vec4_mul(mul1, sub2); - return mul2; -} - -// Agner Fog method -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_nan(glm_vec4 x) -{ - glm_ivec4 const t1 = _mm_castps_si128(x); // reinterpret as 32-bit integer - glm_ivec4 const t2 = _mm_sll_epi32(t1, _mm_cvtsi32_si128(1)); // shift out sign bit - glm_ivec4 const t3 = _mm_set1_epi32(int(0xFF000000)); // exponent mask - glm_ivec4 const t4 = _mm_and_si128(t2, t3); // exponent - glm_ivec4 const t5 = _mm_andnot_si128(t3, t2); // fraction - glm_ivec4 const Equal = _mm_cmpeq_epi32(t3, t4); - glm_ivec4 const Nequal = _mm_cmpeq_epi32(t5, _mm_setzero_si128()); - glm_ivec4 const And = _mm_and_si128(Equal, Nequal); - return _mm_castsi128_ps(And); // exponent = all 1s and fraction != 0 -} - -// Agner Fog method -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_inf(glm_vec4 x) -{ - glm_ivec4 const t1 = _mm_castps_si128(x); // reinterpret as 32-bit integer - glm_ivec4 const t2 = _mm_sll_epi32(t1, _mm_cvtsi32_si128(1)); // shift out sign bit - return _mm_castsi128_ps(_mm_cmpeq_epi32(t2, _mm_set1_epi32(int(0xFF000000)))); // exponent is all 1s, fraction is 0 -} - -#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/3rdparty/glm/source/glm/simd/exponential.h b/3rdparty/glm/source/glm/simd/exponential.h deleted file mode 100644 index bc351d0..0000000 --- a/3rdparty/glm/source/glm/simd/exponential.h +++ /dev/null @@ -1,20 +0,0 @@ -/// @ref simd -/// @file glm/simd/experimental.h - -#pragma once - -#include "platform.h" - -#if GLM_ARCH & GLM_ARCH_SSE2_BIT - -GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec1_sqrt_lowp(glm_f32vec4 x) -{ - return _mm_mul_ss(_mm_rsqrt_ss(x), x); -} - -GLM_FUNC_QUALIFIER glm_f32vec4 glm_vec4_sqrt_lowp(glm_f32vec4 x) -{ - return _mm_mul_ps(_mm_rsqrt_ps(x), x); -} - -#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/3rdparty/glm/source/glm/simd/geometric.h b/3rdparty/glm/source/glm/simd/geometric.h deleted file mode 100644 index 07d7cbc..0000000 --- a/3rdparty/glm/source/glm/simd/geometric.h +++ /dev/null @@ -1,124 +0,0 @@ -/// @ref simd -/// @file glm/simd/geometric.h - -#pragma once - -#include "common.h" - -#if GLM_ARCH & GLM_ARCH_SSE2_BIT - -GLM_FUNC_DECL glm_vec4 glm_vec4_dot(glm_vec4 v1, glm_vec4 v2); -GLM_FUNC_DECL glm_vec4 glm_vec1_dot(glm_vec4 v1, glm_vec4 v2); - -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_length(glm_vec4 x) -{ - glm_vec4 const dot0 = glm_vec4_dot(x, x); - glm_vec4 const sqt0 = _mm_sqrt_ps(dot0); - return sqt0; -} - -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_distance(glm_vec4 p0, glm_vec4 p1) -{ - glm_vec4 const sub0 = _mm_sub_ps(p0, p1); - glm_vec4 const len0 = glm_vec4_length(sub0); - return len0; -} - -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_dot(glm_vec4 v1, glm_vec4 v2) -{ -# if GLM_ARCH & GLM_ARCH_AVX_BIT - return _mm_dp_ps(v1, v2, 0xff); -# elif GLM_ARCH & GLM_ARCH_SSE3_BIT - glm_vec4 const mul0 = _mm_mul_ps(v1, v2); - glm_vec4 const hadd0 = _mm_hadd_ps(mul0, mul0); - glm_vec4 const hadd1 = _mm_hadd_ps(hadd0, hadd0); - return hadd1; -# else - glm_vec4 const mul0 = _mm_mul_ps(v1, v2); - glm_vec4 const swp0 = _mm_shuffle_ps(mul0, mul0, _MM_SHUFFLE(2, 3, 0, 1)); - glm_vec4 const add0 = _mm_add_ps(mul0, swp0); - glm_vec4 const swp1 = _mm_shuffle_ps(add0, add0, _MM_SHUFFLE(0, 1, 2, 3)); - glm_vec4 const add1 = _mm_add_ps(add0, swp1); - return add1; -# endif -} - -GLM_FUNC_QUALIFIER glm_vec4 glm_vec1_dot(glm_vec4 v1, glm_vec4 v2) -{ -# if GLM_ARCH & GLM_ARCH_AVX_BIT - return _mm_dp_ps(v1, v2, 0xff); -# elif GLM_ARCH & GLM_ARCH_SSE3_BIT - glm_vec4 const mul0 = _mm_mul_ps(v1, v2); - glm_vec4 const had0 = _mm_hadd_ps(mul0, mul0); - glm_vec4 const had1 = _mm_hadd_ps(had0, had0); - return had1; -# else - glm_vec4 const mul0 = _mm_mul_ps(v1, v2); - glm_vec4 const mov0 = _mm_movehl_ps(mul0, mul0); - glm_vec4 const add0 = _mm_add_ps(mov0, mul0); - glm_vec4 const swp1 = _mm_shuffle_ps(add0, add0, 1); - glm_vec4 const add1 = _mm_add_ss(add0, swp1); - return add1; -# endif -} - -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_cross(glm_vec4 v1, glm_vec4 v2) -{ - glm_vec4 const swp0 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 0, 2, 1)); - glm_vec4 const swp1 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 1, 0, 2)); - glm_vec4 const swp2 = _mm_shuffle_ps(v2, v2, _MM_SHUFFLE(3, 0, 2, 1)); - glm_vec4 const swp3 = _mm_shuffle_ps(v2, v2, _MM_SHUFFLE(3, 1, 0, 2)); - glm_vec4 const mul0 = _mm_mul_ps(swp0, swp3); - glm_vec4 const mul1 = _mm_mul_ps(swp1, swp2); - glm_vec4 const sub0 = _mm_sub_ps(mul0, mul1); - return sub0; -} - -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_normalize(glm_vec4 v) -{ - glm_vec4 const dot0 = glm_vec4_dot(v, v); - glm_vec4 const isr0 = _mm_rsqrt_ps(dot0); - glm_vec4 const mul0 = _mm_mul_ps(v, isr0); - return mul0; -} - -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_faceforward(glm_vec4 N, glm_vec4 I, glm_vec4 Nref) -{ - glm_vec4 const dot0 = glm_vec4_dot(Nref, I); - glm_vec4 const sgn0 = glm_vec4_sign(dot0); - glm_vec4 const mul0 = _mm_mul_ps(sgn0, _mm_set1_ps(-1.0f)); - glm_vec4 const mul1 = _mm_mul_ps(N, mul0); - return mul1; -} - -GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_reflect(glm_vec4 I, glm_vec4 N) -{ - glm_vec4 const dot0 = glm_vec4_dot(N, I); - glm_vec4 const mul0 = _mm_mul_ps(N, dot0); - glm_vec4 const mul1 = _mm_mul_ps(mul0, _mm_set1_ps(2.0f)); - glm_vec4 const sub0 = _mm_sub_ps(I, mul1); - return sub0; -} - -GLM_FUNC_QUALIFIER __m128 glm_vec4_refract(glm_vec4 I, glm_vec4 N, glm_vec4 eta) -{ - glm_vec4 const dot0 = glm_vec4_dot(N, I); - glm_vec4 const mul0 = _mm_mul_ps(eta, eta); - glm_vec4 const mul1 = _mm_mul_ps(dot0, dot0); - glm_vec4 const sub0 = _mm_sub_ps(_mm_set1_ps(1.0f), mul0); - glm_vec4 const sub1 = _mm_sub_ps(_mm_set1_ps(1.0f), mul1); - glm_vec4 const mul2 = _mm_mul_ps(sub0, sub1); - - if(_mm_movemask_ps(_mm_cmplt_ss(mul2, _mm_set1_ps(0.0f))) == 0) - return _mm_set1_ps(0.0f); - - glm_vec4 const sqt0 = _mm_sqrt_ps(mul2); - glm_vec4 const mad0 = glm_vec4_fma(eta, dot0, sqt0); - glm_vec4 const mul4 = _mm_mul_ps(mad0, N); - glm_vec4 const mul5 = _mm_mul_ps(eta, I); - glm_vec4 const sub2 = _mm_sub_ps(mul5, mul4); - - return sub2; -} - -#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/3rdparty/glm/source/glm/simd/integer.h b/3rdparty/glm/source/glm/simd/integer.h deleted file mode 100644 index 9381418..0000000 --- a/3rdparty/glm/source/glm/simd/integer.h +++ /dev/null @@ -1,115 +0,0 @@ -/// @ref simd -/// @file glm/simd/integer.h - -#pragma once - -#if GLM_ARCH & GLM_ARCH_SSE2_BIT - -GLM_FUNC_QUALIFIER glm_uvec4 glm_i128_interleave(glm_uvec4 x) -{ - glm_uvec4 const Mask4 = _mm_set1_epi32(0x0000FFFF); - glm_uvec4 const Mask3 = _mm_set1_epi32(0x00FF00FF); - glm_uvec4 const Mask2 = _mm_set1_epi32(0x0F0F0F0F); - glm_uvec4 const Mask1 = _mm_set1_epi32(0x33333333); - glm_uvec4 const Mask0 = _mm_set1_epi32(0x55555555); - - glm_uvec4 Reg1; - glm_uvec4 Reg2; - - // REG1 = x; - // REG2 = y; - //Reg1 = _mm_unpacklo_epi64(x, y); - Reg1 = x; - - //REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF); - //REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF); - Reg2 = _mm_slli_si128(Reg1, 2); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask4); - - //REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF); - //REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF); - Reg2 = _mm_slli_si128(Reg1, 1); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask3); - - //REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F); - //REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F); - Reg2 = _mm_slli_epi32(Reg1, 4); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask2); - - //REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333); - //REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333); - Reg2 = _mm_slli_epi32(Reg1, 2); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask1); - - //REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555); - //REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555); - Reg2 = _mm_slli_epi32(Reg1, 1); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask0); - - //return REG1 | (REG2 << 1); - Reg2 = _mm_slli_epi32(Reg1, 1); - Reg2 = _mm_srli_si128(Reg2, 8); - Reg1 = _mm_or_si128(Reg1, Reg2); - - return Reg1; -} - -GLM_FUNC_QUALIFIER glm_uvec4 glm_i128_interleave2(glm_uvec4 x, glm_uvec4 y) -{ - glm_uvec4 const Mask4 = _mm_set1_epi32(0x0000FFFF); - glm_uvec4 const Mask3 = _mm_set1_epi32(0x00FF00FF); - glm_uvec4 const Mask2 = _mm_set1_epi32(0x0F0F0F0F); - glm_uvec4 const Mask1 = _mm_set1_epi32(0x33333333); - glm_uvec4 const Mask0 = _mm_set1_epi32(0x55555555); - - glm_uvec4 Reg1; - glm_uvec4 Reg2; - - // REG1 = x; - // REG2 = y; - Reg1 = _mm_unpacklo_epi64(x, y); - - //REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF); - //REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF); - Reg2 = _mm_slli_si128(Reg1, 2); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask4); - - //REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF); - //REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF); - Reg2 = _mm_slli_si128(Reg1, 1); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask3); - - //REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F); - //REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F); - Reg2 = _mm_slli_epi32(Reg1, 4); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask2); - - //REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333); - //REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333); - Reg2 = _mm_slli_epi32(Reg1, 2); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask1); - - //REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555); - //REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555); - Reg2 = _mm_slli_epi32(Reg1, 1); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask0); - - //return REG1 | (REG2 << 1); - Reg2 = _mm_slli_epi32(Reg1, 1); - Reg2 = _mm_srli_si128(Reg2, 8); - Reg1 = _mm_or_si128(Reg1, Reg2); - - return Reg1; -} - -#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/3rdparty/glm/source/glm/simd/matrix.h b/3rdparty/glm/source/glm/simd/matrix.h deleted file mode 100644 index b6c42ea..0000000 --- a/3rdparty/glm/source/glm/simd/matrix.h +++ /dev/null @@ -1,1028 +0,0 @@ -/// @ref simd -/// @file glm/simd/matrix.h - -#pragma once - -#include "geometric.h" - -#if GLM_ARCH & GLM_ARCH_SSE2_BIT - -GLM_FUNC_QUALIFIER void glm_mat4_matrixCompMult(glm_vec4 const in1[4], glm_vec4 const in2[4], glm_vec4 out[4]) -{ - out[0] = _mm_mul_ps(in1[0], in2[0]); - out[1] = _mm_mul_ps(in1[1], in2[1]); - out[2] = _mm_mul_ps(in1[2], in2[2]); - out[3] = _mm_mul_ps(in1[3], in2[3]); -} - -GLM_FUNC_QUALIFIER void glm_mat4_add(glm_vec4 const in1[4], glm_vec4 const in2[4], glm_vec4 out[4]) -{ - out[0] = _mm_add_ps(in1[0], in2[0]); - out[1] = _mm_add_ps(in1[1], in2[1]); - out[2] = _mm_add_ps(in1[2], in2[2]); - out[3] = _mm_add_ps(in1[3], in2[3]); -} - -GLM_FUNC_QUALIFIER void glm_mat4_sub(glm_vec4 const in1[4], glm_vec4 const in2[4], glm_vec4 out[4]) -{ - out[0] = _mm_sub_ps(in1[0], in2[0]); - out[1] = _mm_sub_ps(in1[1], in2[1]); - out[2] = _mm_sub_ps(in1[2], in2[2]); - out[3] = _mm_sub_ps(in1[3], in2[3]); -} - -GLM_FUNC_QUALIFIER glm_vec4 glm_mat4_mul_vec4(glm_vec4 const m[4], glm_vec4 v) -{ - __m128 v0 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(0, 0, 0, 0)); - __m128 v1 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(1, 1, 1, 1)); - __m128 v2 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(2, 2, 2, 2)); - __m128 v3 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 m0 = _mm_mul_ps(m[0], v0); - __m128 m1 = _mm_mul_ps(m[1], v1); - __m128 m2 = _mm_mul_ps(m[2], v2); - __m128 m3 = _mm_mul_ps(m[3], v3); - - __m128 a0 = _mm_add_ps(m0, m1); - __m128 a1 = _mm_add_ps(m2, m3); - __m128 a2 = _mm_add_ps(a0, a1); - - return a2; -} - -GLM_FUNC_QUALIFIER __m128 glm_vec4_mul_mat4(glm_vec4 v, glm_vec4 const m[4]) -{ - __m128 i0 = m[0]; - __m128 i1 = m[1]; - __m128 i2 = m[2]; - __m128 i3 = m[3]; - - __m128 m0 = _mm_mul_ps(v, i0); - __m128 m1 = _mm_mul_ps(v, i1); - __m128 m2 = _mm_mul_ps(v, i2); - __m128 m3 = _mm_mul_ps(v, i3); - - __m128 u0 = _mm_unpacklo_ps(m0, m1); - __m128 u1 = _mm_unpackhi_ps(m0, m1); - __m128 a0 = _mm_add_ps(u0, u1); - - __m128 u2 = _mm_unpacklo_ps(m2, m3); - __m128 u3 = _mm_unpackhi_ps(m2, m3); - __m128 a1 = _mm_add_ps(u2, u3); - - __m128 f0 = _mm_movelh_ps(a0, a1); - __m128 f1 = _mm_movehl_ps(a1, a0); - __m128 f2 = _mm_add_ps(f0, f1); - - return f2; -} - -GLM_FUNC_QUALIFIER void glm_mat4_mul(glm_vec4 const in1[4], glm_vec4 const in2[4], glm_vec4 out[4]) -{ - { - __m128 e0 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 e1 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 e2 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 e3 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 m0 = _mm_mul_ps(in1[0], e0); - __m128 m1 = _mm_mul_ps(in1[1], e1); - __m128 m2 = _mm_mul_ps(in1[2], e2); - __m128 m3 = _mm_mul_ps(in1[3], e3); - - __m128 a0 = _mm_add_ps(m0, m1); - __m128 a1 = _mm_add_ps(m2, m3); - __m128 a2 = _mm_add_ps(a0, a1); - - out[0] = a2; - } - - { - __m128 e0 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 e1 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 e2 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 e3 = _mm_shuffle_ps(in2[1], in2[1], _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 m0 = _mm_mul_ps(in1[0], e0); - __m128 m1 = _mm_mul_ps(in1[1], e1); - __m128 m2 = _mm_mul_ps(in1[2], e2); - __m128 m3 = _mm_mul_ps(in1[3], e3); - - __m128 a0 = _mm_add_ps(m0, m1); - __m128 a1 = _mm_add_ps(m2, m3); - __m128 a2 = _mm_add_ps(a0, a1); - - out[1] = a2; - } - - { - __m128 e0 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 e1 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 e2 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 e3 = _mm_shuffle_ps(in2[2], in2[2], _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 m0 = _mm_mul_ps(in1[0], e0); - __m128 m1 = _mm_mul_ps(in1[1], e1); - __m128 m2 = _mm_mul_ps(in1[2], e2); - __m128 m3 = _mm_mul_ps(in1[3], e3); - - __m128 a0 = _mm_add_ps(m0, m1); - __m128 a1 = _mm_add_ps(m2, m3); - __m128 a2 = _mm_add_ps(a0, a1); - - out[2] = a2; - } - - { - //(__m128&)_mm_shuffle_epi32(__m128i&)in2[0], _MM_SHUFFLE(3, 3, 3, 3)) - __m128 e0 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 e1 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 e2 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 e3 = _mm_shuffle_ps(in2[3], in2[3], _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 m0 = _mm_mul_ps(in1[0], e0); - __m128 m1 = _mm_mul_ps(in1[1], e1); - __m128 m2 = _mm_mul_ps(in1[2], e2); - __m128 m3 = _mm_mul_ps(in1[3], e3); - - __m128 a0 = _mm_add_ps(m0, m1); - __m128 a1 = _mm_add_ps(m2, m3); - __m128 a2 = _mm_add_ps(a0, a1); - - out[3] = a2; - } -} - -GLM_FUNC_QUALIFIER void glm_mat4_transpose(glm_vec4 const in[4], glm_vec4 out[4]) -{ - __m128 tmp0 = _mm_shuffle_ps(in[0], in[1], 0x44); - __m128 tmp2 = _mm_shuffle_ps(in[0], in[1], 0xEE); - __m128 tmp1 = _mm_shuffle_ps(in[2], in[3], 0x44); - __m128 tmp3 = _mm_shuffle_ps(in[2], in[3], 0xEE); - - out[0] = _mm_shuffle_ps(tmp0, tmp1, 0x88); - out[1] = _mm_shuffle_ps(tmp0, tmp1, 0xDD); - out[2] = _mm_shuffle_ps(tmp2, tmp3, 0x88); - out[3] = _mm_shuffle_ps(tmp2, tmp3, 0xDD); -} - -GLM_FUNC_QUALIFIER glm_vec4 glm_mat4_determinant_highp(glm_vec4 const in[4]) -{ - __m128 Fac0; - { - // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; - // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; - // valType SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; - // valType SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac0 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 Fac1; - { - // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; - // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; - // valType SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; - // valType SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac1 = _mm_sub_ps(Mul00, Mul01); - } - - - __m128 Fac2; - { - // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; - // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; - // valType SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; - // valType SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac2 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 Fac3; - { - // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; - // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; - // valType SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; - // valType SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac3 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 Fac4; - { - // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; - // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; - // valType SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; - // valType SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac4 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 Fac5; - { - // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - // valType SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; - // valType SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac5 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 SignA = _mm_set_ps( 1.0f,-1.0f, 1.0f,-1.0f); - __m128 SignB = _mm_set_ps(-1.0f, 1.0f,-1.0f, 1.0f); - - // m[1][0] - // m[0][0] - // m[0][0] - // m[0][0] - __m128 Temp0 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Vec0 = _mm_shuffle_ps(Temp0, Temp0, _MM_SHUFFLE(2, 2, 2, 0)); - - // m[1][1] - // m[0][1] - // m[0][1] - // m[0][1] - __m128 Temp1 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 Vec1 = _mm_shuffle_ps(Temp1, Temp1, _MM_SHUFFLE(2, 2, 2, 0)); - - // m[1][2] - // m[0][2] - // m[0][2] - // m[0][2] - __m128 Temp2 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Vec2 = _mm_shuffle_ps(Temp2, Temp2, _MM_SHUFFLE(2, 2, 2, 0)); - - // m[1][3] - // m[0][3] - // m[0][3] - // m[0][3] - __m128 Temp3 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Vec3 = _mm_shuffle_ps(Temp3, Temp3, _MM_SHUFFLE(2, 2, 2, 0)); - - // col0 - // + (Vec1[0] * Fac0[0] - Vec2[0] * Fac1[0] + Vec3[0] * Fac2[0]), - // - (Vec1[1] * Fac0[1] - Vec2[1] * Fac1[1] + Vec3[1] * Fac2[1]), - // + (Vec1[2] * Fac0[2] - Vec2[2] * Fac1[2] + Vec3[2] * Fac2[2]), - // - (Vec1[3] * Fac0[3] - Vec2[3] * Fac1[3] + Vec3[3] * Fac2[3]), - __m128 Mul00 = _mm_mul_ps(Vec1, Fac0); - __m128 Mul01 = _mm_mul_ps(Vec2, Fac1); - __m128 Mul02 = _mm_mul_ps(Vec3, Fac2); - __m128 Sub00 = _mm_sub_ps(Mul00, Mul01); - __m128 Add00 = _mm_add_ps(Sub00, Mul02); - __m128 Inv0 = _mm_mul_ps(SignB, Add00); - - // col1 - // - (Vec0[0] * Fac0[0] - Vec2[0] * Fac3[0] + Vec3[0] * Fac4[0]), - // + (Vec0[0] * Fac0[1] - Vec2[1] * Fac3[1] + Vec3[1] * Fac4[1]), - // - (Vec0[0] * Fac0[2] - Vec2[2] * Fac3[2] + Vec3[2] * Fac4[2]), - // + (Vec0[0] * Fac0[3] - Vec2[3] * Fac3[3] + Vec3[3] * Fac4[3]), - __m128 Mul03 = _mm_mul_ps(Vec0, Fac0); - __m128 Mul04 = _mm_mul_ps(Vec2, Fac3); - __m128 Mul05 = _mm_mul_ps(Vec3, Fac4); - __m128 Sub01 = _mm_sub_ps(Mul03, Mul04); - __m128 Add01 = _mm_add_ps(Sub01, Mul05); - __m128 Inv1 = _mm_mul_ps(SignA, Add01); - - // col2 - // + (Vec0[0] * Fac1[0] - Vec1[0] * Fac3[0] + Vec3[0] * Fac5[0]), - // - (Vec0[0] * Fac1[1] - Vec1[1] * Fac3[1] + Vec3[1] * Fac5[1]), - // + (Vec0[0] * Fac1[2] - Vec1[2] * Fac3[2] + Vec3[2] * Fac5[2]), - // - (Vec0[0] * Fac1[3] - Vec1[3] * Fac3[3] + Vec3[3] * Fac5[3]), - __m128 Mul06 = _mm_mul_ps(Vec0, Fac1); - __m128 Mul07 = _mm_mul_ps(Vec1, Fac3); - __m128 Mul08 = _mm_mul_ps(Vec3, Fac5); - __m128 Sub02 = _mm_sub_ps(Mul06, Mul07); - __m128 Add02 = _mm_add_ps(Sub02, Mul08); - __m128 Inv2 = _mm_mul_ps(SignB, Add02); - - // col3 - // - (Vec1[0] * Fac2[0] - Vec1[0] * Fac4[0] + Vec2[0] * Fac5[0]), - // + (Vec1[0] * Fac2[1] - Vec1[1] * Fac4[1] + Vec2[1] * Fac5[1]), - // - (Vec1[0] * Fac2[2] - Vec1[2] * Fac4[2] + Vec2[2] * Fac5[2]), - // + (Vec1[0] * Fac2[3] - Vec1[3] * Fac4[3] + Vec2[3] * Fac5[3])); - __m128 Mul09 = _mm_mul_ps(Vec0, Fac2); - __m128 Mul10 = _mm_mul_ps(Vec1, Fac4); - __m128 Mul11 = _mm_mul_ps(Vec2, Fac5); - __m128 Sub03 = _mm_sub_ps(Mul09, Mul10); - __m128 Add03 = _mm_add_ps(Sub03, Mul11); - __m128 Inv3 = _mm_mul_ps(SignA, Add03); - - __m128 Row0 = _mm_shuffle_ps(Inv0, Inv1, _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Row1 = _mm_shuffle_ps(Inv2, Inv3, _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Row2 = _mm_shuffle_ps(Row0, Row1, _MM_SHUFFLE(2, 0, 2, 0)); - - // valType Determinant = m[0][0] * Inverse[0][0] - // + m[0][1] * Inverse[1][0] - // + m[0][2] * Inverse[2][0] - // + m[0][3] * Inverse[3][0]; - __m128 Det0 = glm_vec4_dot(in[0], Row2); - return Det0; -} - -GLM_FUNC_QUALIFIER glm_vec4 glm_mat4_determinant_lowp(glm_vec4 const m[4]) -{ - // _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128( - - //T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; - //T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; - //T SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; - //T SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; - //T SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; - //T SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - - // First 2 columns - __m128 Swp2A = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[2]), _MM_SHUFFLE(0, 1, 1, 2))); - __m128 Swp3A = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[3]), _MM_SHUFFLE(3, 2, 3, 3))); - __m128 MulA = _mm_mul_ps(Swp2A, Swp3A); - - // Second 2 columns - __m128 Swp2B = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[2]), _MM_SHUFFLE(3, 2, 3, 3))); - __m128 Swp3B = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[3]), _MM_SHUFFLE(0, 1, 1, 2))); - __m128 MulB = _mm_mul_ps(Swp2B, Swp3B); - - // Columns subtraction - __m128 SubE = _mm_sub_ps(MulA, MulB); - - // Last 2 rows - __m128 Swp2C = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[2]), _MM_SHUFFLE(0, 0, 1, 2))); - __m128 Swp3C = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[3]), _MM_SHUFFLE(1, 2, 0, 0))); - __m128 MulC = _mm_mul_ps(Swp2C, Swp3C); - __m128 SubF = _mm_sub_ps(_mm_movehl_ps(MulC, MulC), MulC); - - //vec<4, T, Q> DetCof( - // + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02), - // - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04), - // + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05), - // - (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05)); - - __m128 SubFacA = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(SubE), _MM_SHUFFLE(2, 1, 0, 0))); - __m128 SwpFacA = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[1]), _MM_SHUFFLE(0, 0, 0, 1))); - __m128 MulFacA = _mm_mul_ps(SwpFacA, SubFacA); - - __m128 SubTmpB = _mm_shuffle_ps(SubE, SubF, _MM_SHUFFLE(0, 0, 3, 1)); - __m128 SubFacB = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(SubTmpB), _MM_SHUFFLE(3, 1, 1, 0)));//SubF[0], SubE[3], SubE[3], SubE[1]; - __m128 SwpFacB = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[1]), _MM_SHUFFLE(1, 1, 2, 2))); - __m128 MulFacB = _mm_mul_ps(SwpFacB, SubFacB); - - __m128 SubRes = _mm_sub_ps(MulFacA, MulFacB); - - __m128 SubTmpC = _mm_shuffle_ps(SubE, SubF, _MM_SHUFFLE(1, 0, 2, 2)); - __m128 SubFacC = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(SubTmpC), _MM_SHUFFLE(3, 3, 2, 0))); - __m128 SwpFacC = _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(m[1]), _MM_SHUFFLE(2, 3, 3, 3))); - __m128 MulFacC = _mm_mul_ps(SwpFacC, SubFacC); - - __m128 AddRes = _mm_add_ps(SubRes, MulFacC); - __m128 DetCof = _mm_mul_ps(AddRes, _mm_setr_ps( 1.0f,-1.0f, 1.0f,-1.0f)); - - //return m[0][0] * DetCof[0] - // + m[0][1] * DetCof[1] - // + m[0][2] * DetCof[2] - // + m[0][3] * DetCof[3]; - - return glm_vec4_dot(m[0], DetCof); -} - -GLM_FUNC_QUALIFIER glm_vec4 glm_mat4_determinant(glm_vec4 const m[4]) -{ - // _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(add) - - //T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; - //T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; - //T SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; - //T SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; - //T SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; - //T SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - - // First 2 columns - __m128 Swp2A = _mm_shuffle_ps(m[2], m[2], _MM_SHUFFLE(0, 1, 1, 2)); - __m128 Swp3A = _mm_shuffle_ps(m[3], m[3], _MM_SHUFFLE(3, 2, 3, 3)); - __m128 MulA = _mm_mul_ps(Swp2A, Swp3A); - - // Second 2 columns - __m128 Swp2B = _mm_shuffle_ps(m[2], m[2], _MM_SHUFFLE(3, 2, 3, 3)); - __m128 Swp3B = _mm_shuffle_ps(m[3], m[3], _MM_SHUFFLE(0, 1, 1, 2)); - __m128 MulB = _mm_mul_ps(Swp2B, Swp3B); - - // Columns subtraction - __m128 SubE = _mm_sub_ps(MulA, MulB); - - // Last 2 rows - __m128 Swp2C = _mm_shuffle_ps(m[2], m[2], _MM_SHUFFLE(0, 0, 1, 2)); - __m128 Swp3C = _mm_shuffle_ps(m[3], m[3], _MM_SHUFFLE(1, 2, 0, 0)); - __m128 MulC = _mm_mul_ps(Swp2C, Swp3C); - __m128 SubF = _mm_sub_ps(_mm_movehl_ps(MulC, MulC), MulC); - - //vec<4, T, Q> DetCof( - // + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02), - // - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04), - // + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05), - // - (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05)); - - __m128 SubFacA = _mm_shuffle_ps(SubE, SubE, _MM_SHUFFLE(2, 1, 0, 0)); - __m128 SwpFacA = _mm_shuffle_ps(m[1], m[1], _MM_SHUFFLE(0, 0, 0, 1)); - __m128 MulFacA = _mm_mul_ps(SwpFacA, SubFacA); - - __m128 SubTmpB = _mm_shuffle_ps(SubE, SubF, _MM_SHUFFLE(0, 0, 3, 1)); - __m128 SubFacB = _mm_shuffle_ps(SubTmpB, SubTmpB, _MM_SHUFFLE(3, 1, 1, 0));//SubF[0], SubE[3], SubE[3], SubE[1]; - __m128 SwpFacB = _mm_shuffle_ps(m[1], m[1], _MM_SHUFFLE(1, 1, 2, 2)); - __m128 MulFacB = _mm_mul_ps(SwpFacB, SubFacB); - - __m128 SubRes = _mm_sub_ps(MulFacA, MulFacB); - - __m128 SubTmpC = _mm_shuffle_ps(SubE, SubF, _MM_SHUFFLE(1, 0, 2, 2)); - __m128 SubFacC = _mm_shuffle_ps(SubTmpC, SubTmpC, _MM_SHUFFLE(3, 3, 2, 0)); - __m128 SwpFacC = _mm_shuffle_ps(m[1], m[1], _MM_SHUFFLE(2, 3, 3, 3)); - __m128 MulFacC = _mm_mul_ps(SwpFacC, SubFacC); - - __m128 AddRes = _mm_add_ps(SubRes, MulFacC); - __m128 DetCof = _mm_mul_ps(AddRes, _mm_setr_ps( 1.0f,-1.0f, 1.0f,-1.0f)); - - //return m[0][0] * DetCof[0] - // + m[0][1] * DetCof[1] - // + m[0][2] * DetCof[2] - // + m[0][3] * DetCof[3]; - - return glm_vec4_dot(m[0], DetCof); -} - -GLM_FUNC_QUALIFIER void glm_mat4_inverse(glm_vec4 const in[4], glm_vec4 out[4]) -{ - __m128 Fac0; - { - // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; - // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; - // valType SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; - // valType SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac0 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 Fac1; - { - // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; - // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; - // valType SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; - // valType SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac1 = _mm_sub_ps(Mul00, Mul01); - } - - - __m128 Fac2; - { - // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; - // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; - // valType SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; - // valType SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac2 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 Fac3; - { - // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; - // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; - // valType SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; - // valType SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac3 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 Fac4; - { - // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; - // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; - // valType SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; - // valType SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac4 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 Fac5; - { - // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - // valType SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; - // valType SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac5 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 SignA = _mm_set_ps( 1.0f,-1.0f, 1.0f,-1.0f); - __m128 SignB = _mm_set_ps(-1.0f, 1.0f,-1.0f, 1.0f); - - // m[1][0] - // m[0][0] - // m[0][0] - // m[0][0] - __m128 Temp0 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Vec0 = _mm_shuffle_ps(Temp0, Temp0, _MM_SHUFFLE(2, 2, 2, 0)); - - // m[1][1] - // m[0][1] - // m[0][1] - // m[0][1] - __m128 Temp1 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 Vec1 = _mm_shuffle_ps(Temp1, Temp1, _MM_SHUFFLE(2, 2, 2, 0)); - - // m[1][2] - // m[0][2] - // m[0][2] - // m[0][2] - __m128 Temp2 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Vec2 = _mm_shuffle_ps(Temp2, Temp2, _MM_SHUFFLE(2, 2, 2, 0)); - - // m[1][3] - // m[0][3] - // m[0][3] - // m[0][3] - __m128 Temp3 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Vec3 = _mm_shuffle_ps(Temp3, Temp3, _MM_SHUFFLE(2, 2, 2, 0)); - - // col0 - // + (Vec1[0] * Fac0[0] - Vec2[0] * Fac1[0] + Vec3[0] * Fac2[0]), - // - (Vec1[1] * Fac0[1] - Vec2[1] * Fac1[1] + Vec3[1] * Fac2[1]), - // + (Vec1[2] * Fac0[2] - Vec2[2] * Fac1[2] + Vec3[2] * Fac2[2]), - // - (Vec1[3] * Fac0[3] - Vec2[3] * Fac1[3] + Vec3[3] * Fac2[3]), - __m128 Mul00 = _mm_mul_ps(Vec1, Fac0); - __m128 Mul01 = _mm_mul_ps(Vec2, Fac1); - __m128 Mul02 = _mm_mul_ps(Vec3, Fac2); - __m128 Sub00 = _mm_sub_ps(Mul00, Mul01); - __m128 Add00 = _mm_add_ps(Sub00, Mul02); - __m128 Inv0 = _mm_mul_ps(SignB, Add00); - - // col1 - // - (Vec0[0] * Fac0[0] - Vec2[0] * Fac3[0] + Vec3[0] * Fac4[0]), - // + (Vec0[0] * Fac0[1] - Vec2[1] * Fac3[1] + Vec3[1] * Fac4[1]), - // - (Vec0[0] * Fac0[2] - Vec2[2] * Fac3[2] + Vec3[2] * Fac4[2]), - // + (Vec0[0] * Fac0[3] - Vec2[3] * Fac3[3] + Vec3[3] * Fac4[3]), - __m128 Mul03 = _mm_mul_ps(Vec0, Fac0); - __m128 Mul04 = _mm_mul_ps(Vec2, Fac3); - __m128 Mul05 = _mm_mul_ps(Vec3, Fac4); - __m128 Sub01 = _mm_sub_ps(Mul03, Mul04); - __m128 Add01 = _mm_add_ps(Sub01, Mul05); - __m128 Inv1 = _mm_mul_ps(SignA, Add01); - - // col2 - // + (Vec0[0] * Fac1[0] - Vec1[0] * Fac3[0] + Vec3[0] * Fac5[0]), - // - (Vec0[0] * Fac1[1] - Vec1[1] * Fac3[1] + Vec3[1] * Fac5[1]), - // + (Vec0[0] * Fac1[2] - Vec1[2] * Fac3[2] + Vec3[2] * Fac5[2]), - // - (Vec0[0] * Fac1[3] - Vec1[3] * Fac3[3] + Vec3[3] * Fac5[3]), - __m128 Mul06 = _mm_mul_ps(Vec0, Fac1); - __m128 Mul07 = _mm_mul_ps(Vec1, Fac3); - __m128 Mul08 = _mm_mul_ps(Vec3, Fac5); - __m128 Sub02 = _mm_sub_ps(Mul06, Mul07); - __m128 Add02 = _mm_add_ps(Sub02, Mul08); - __m128 Inv2 = _mm_mul_ps(SignB, Add02); - - // col3 - // - (Vec1[0] * Fac2[0] - Vec1[0] * Fac4[0] + Vec2[0] * Fac5[0]), - // + (Vec1[0] * Fac2[1] - Vec1[1] * Fac4[1] + Vec2[1] * Fac5[1]), - // - (Vec1[0] * Fac2[2] - Vec1[2] * Fac4[2] + Vec2[2] * Fac5[2]), - // + (Vec1[0] * Fac2[3] - Vec1[3] * Fac4[3] + Vec2[3] * Fac5[3])); - __m128 Mul09 = _mm_mul_ps(Vec0, Fac2); - __m128 Mul10 = _mm_mul_ps(Vec1, Fac4); - __m128 Mul11 = _mm_mul_ps(Vec2, Fac5); - __m128 Sub03 = _mm_sub_ps(Mul09, Mul10); - __m128 Add03 = _mm_add_ps(Sub03, Mul11); - __m128 Inv3 = _mm_mul_ps(SignA, Add03); - - __m128 Row0 = _mm_shuffle_ps(Inv0, Inv1, _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Row1 = _mm_shuffle_ps(Inv2, Inv3, _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Row2 = _mm_shuffle_ps(Row0, Row1, _MM_SHUFFLE(2, 0, 2, 0)); - - // valType Determinant = m[0][0] * Inverse[0][0] - // + m[0][1] * Inverse[1][0] - // + m[0][2] * Inverse[2][0] - // + m[0][3] * Inverse[3][0]; - __m128 Det0 = glm_vec4_dot(in[0], Row2); - __m128 Rcp0 = _mm_div_ps(_mm_set1_ps(1.0f), Det0); - //__m128 Rcp0 = _mm_rcp_ps(Det0); - - // Inverse /= Determinant; - out[0] = _mm_mul_ps(Inv0, Rcp0); - out[1] = _mm_mul_ps(Inv1, Rcp0); - out[2] = _mm_mul_ps(Inv2, Rcp0); - out[3] = _mm_mul_ps(Inv3, Rcp0); -} - -GLM_FUNC_QUALIFIER void glm_mat4_inverse_lowp(glm_vec4 const in[4], glm_vec4 out[4]) -{ - __m128 Fac0; - { - // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; - // valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; - // valType SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; - // valType SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac0 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 Fac1; - { - // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; - // valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; - // valType SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; - // valType SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac1 = _mm_sub_ps(Mul00, Mul01); - } - - - __m128 Fac2; - { - // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; - // valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; - // valType SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; - // valType SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac2 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 Fac3; - { - // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; - // valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; - // valType SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; - // valType SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(3, 3, 3, 3)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac3 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 Fac4; - { - // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; - // valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; - // valType SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; - // valType SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(2, 2, 2, 2)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac4 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 Fac5; - { - // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - // valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; - // valType SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; - // valType SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; - - __m128 Swp0a = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 Swp0b = _mm_shuffle_ps(in[3], in[2], _MM_SHUFFLE(0, 0, 0, 0)); - - __m128 Swp00 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Swp01 = _mm_shuffle_ps(Swp0a, Swp0a, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp02 = _mm_shuffle_ps(Swp0b, Swp0b, _MM_SHUFFLE(2, 0, 0, 0)); - __m128 Swp03 = _mm_shuffle_ps(in[2], in[1], _MM_SHUFFLE(1, 1, 1, 1)); - - __m128 Mul00 = _mm_mul_ps(Swp00, Swp01); - __m128 Mul01 = _mm_mul_ps(Swp02, Swp03); - Fac5 = _mm_sub_ps(Mul00, Mul01); - } - - __m128 SignA = _mm_set_ps( 1.0f,-1.0f, 1.0f,-1.0f); - __m128 SignB = _mm_set_ps(-1.0f, 1.0f,-1.0f, 1.0f); - - // m[1][0] - // m[0][0] - // m[0][0] - // m[0][0] - __m128 Temp0 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Vec0 = _mm_shuffle_ps(Temp0, Temp0, _MM_SHUFFLE(2, 2, 2, 0)); - - // m[1][1] - // m[0][1] - // m[0][1] - // m[0][1] - __m128 Temp1 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(1, 1, 1, 1)); - __m128 Vec1 = _mm_shuffle_ps(Temp1, Temp1, _MM_SHUFFLE(2, 2, 2, 0)); - - // m[1][2] - // m[0][2] - // m[0][2] - // m[0][2] - __m128 Temp2 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(2, 2, 2, 2)); - __m128 Vec2 = _mm_shuffle_ps(Temp2, Temp2, _MM_SHUFFLE(2, 2, 2, 0)); - - // m[1][3] - // m[0][3] - // m[0][3] - // m[0][3] - __m128 Temp3 = _mm_shuffle_ps(in[1], in[0], _MM_SHUFFLE(3, 3, 3, 3)); - __m128 Vec3 = _mm_shuffle_ps(Temp3, Temp3, _MM_SHUFFLE(2, 2, 2, 0)); - - // col0 - // + (Vec1[0] * Fac0[0] - Vec2[0] * Fac1[0] + Vec3[0] * Fac2[0]), - // - (Vec1[1] * Fac0[1] - Vec2[1] * Fac1[1] + Vec3[1] * Fac2[1]), - // + (Vec1[2] * Fac0[2] - Vec2[2] * Fac1[2] + Vec3[2] * Fac2[2]), - // - (Vec1[3] * Fac0[3] - Vec2[3] * Fac1[3] + Vec3[3] * Fac2[3]), - __m128 Mul00 = _mm_mul_ps(Vec1, Fac0); - __m128 Mul01 = _mm_mul_ps(Vec2, Fac1); - __m128 Mul02 = _mm_mul_ps(Vec3, Fac2); - __m128 Sub00 = _mm_sub_ps(Mul00, Mul01); - __m128 Add00 = _mm_add_ps(Sub00, Mul02); - __m128 Inv0 = _mm_mul_ps(SignB, Add00); - - // col1 - // - (Vec0[0] * Fac0[0] - Vec2[0] * Fac3[0] + Vec3[0] * Fac4[0]), - // + (Vec0[0] * Fac0[1] - Vec2[1] * Fac3[1] + Vec3[1] * Fac4[1]), - // - (Vec0[0] * Fac0[2] - Vec2[2] * Fac3[2] + Vec3[2] * Fac4[2]), - // + (Vec0[0] * Fac0[3] - Vec2[3] * Fac3[3] + Vec3[3] * Fac4[3]), - __m128 Mul03 = _mm_mul_ps(Vec0, Fac0); - __m128 Mul04 = _mm_mul_ps(Vec2, Fac3); - __m128 Mul05 = _mm_mul_ps(Vec3, Fac4); - __m128 Sub01 = _mm_sub_ps(Mul03, Mul04); - __m128 Add01 = _mm_add_ps(Sub01, Mul05); - __m128 Inv1 = _mm_mul_ps(SignA, Add01); - - // col2 - // + (Vec0[0] * Fac1[0] - Vec1[0] * Fac3[0] + Vec3[0] * Fac5[0]), - // - (Vec0[0] * Fac1[1] - Vec1[1] * Fac3[1] + Vec3[1] * Fac5[1]), - // + (Vec0[0] * Fac1[2] - Vec1[2] * Fac3[2] + Vec3[2] * Fac5[2]), - // - (Vec0[0] * Fac1[3] - Vec1[3] * Fac3[3] + Vec3[3] * Fac5[3]), - __m128 Mul06 = _mm_mul_ps(Vec0, Fac1); - __m128 Mul07 = _mm_mul_ps(Vec1, Fac3); - __m128 Mul08 = _mm_mul_ps(Vec3, Fac5); - __m128 Sub02 = _mm_sub_ps(Mul06, Mul07); - __m128 Add02 = _mm_add_ps(Sub02, Mul08); - __m128 Inv2 = _mm_mul_ps(SignB, Add02); - - // col3 - // - (Vec1[0] * Fac2[0] - Vec1[0] * Fac4[0] + Vec2[0] * Fac5[0]), - // + (Vec1[0] * Fac2[1] - Vec1[1] * Fac4[1] + Vec2[1] * Fac5[1]), - // - (Vec1[0] * Fac2[2] - Vec1[2] * Fac4[2] + Vec2[2] * Fac5[2]), - // + (Vec1[0] * Fac2[3] - Vec1[3] * Fac4[3] + Vec2[3] * Fac5[3])); - __m128 Mul09 = _mm_mul_ps(Vec0, Fac2); - __m128 Mul10 = _mm_mul_ps(Vec1, Fac4); - __m128 Mul11 = _mm_mul_ps(Vec2, Fac5); - __m128 Sub03 = _mm_sub_ps(Mul09, Mul10); - __m128 Add03 = _mm_add_ps(Sub03, Mul11); - __m128 Inv3 = _mm_mul_ps(SignA, Add03); - - __m128 Row0 = _mm_shuffle_ps(Inv0, Inv1, _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Row1 = _mm_shuffle_ps(Inv2, Inv3, _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Row2 = _mm_shuffle_ps(Row0, Row1, _MM_SHUFFLE(2, 0, 2, 0)); - - // valType Determinant = m[0][0] * Inverse[0][0] - // + m[0][1] * Inverse[1][0] - // + m[0][2] * Inverse[2][0] - // + m[0][3] * Inverse[3][0]; - __m128 Det0 = glm_vec4_dot(in[0], Row2); - __m128 Rcp0 = _mm_rcp_ps(Det0); - //__m128 Rcp0 = _mm_div_ps(one, Det0); - // Inverse /= Determinant; - out[0] = _mm_mul_ps(Inv0, Rcp0); - out[1] = _mm_mul_ps(Inv1, Rcp0); - out[2] = _mm_mul_ps(Inv2, Rcp0); - out[3] = _mm_mul_ps(Inv3, Rcp0); -} -/* -GLM_FUNC_QUALIFIER void glm_mat4_rotate(__m128 const in[4], float Angle, float const v[3], __m128 out[4]) -{ - float a = glm::radians(Angle); - float c = cos(a); - float s = sin(a); - - glm::vec4 AxisA(v[0], v[1], v[2], float(0)); - __m128 AxisB = _mm_set_ps(AxisA.w, AxisA.z, AxisA.y, AxisA.x); - __m128 AxisC = detail::sse_nrm_ps(AxisB); - - __m128 Cos0 = _mm_set_ss(c); - __m128 CosA = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(0, 0, 0, 0)); - __m128 Sin0 = _mm_set_ss(s); - __m128 SinA = _mm_shuffle_ps(Sin0, Sin0, _MM_SHUFFLE(0, 0, 0, 0)); - - // vec<3, T, Q> temp = (valType(1) - c) * axis; - __m128 Temp0 = _mm_sub_ps(one, CosA); - __m128 Temp1 = _mm_mul_ps(Temp0, AxisC); - - //Rotate[0][0] = c + temp[0] * axis[0]; - //Rotate[0][1] = 0 + temp[0] * axis[1] + s * axis[2]; - //Rotate[0][2] = 0 + temp[0] * axis[2] - s * axis[1]; - __m128 Axis0 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(0, 0, 0, 0)); - __m128 TmpA0 = _mm_mul_ps(Axis0, AxisC); - __m128 CosA0 = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(1, 1, 1, 0)); - __m128 TmpA1 = _mm_add_ps(CosA0, TmpA0); - __m128 SinA0 = SinA;//_mm_set_ps(0.0f, s, -s, 0.0f); - __m128 TmpA2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(3, 1, 2, 3)); - __m128 TmpA3 = _mm_mul_ps(SinA0, TmpA2); - __m128 TmpA4 = _mm_add_ps(TmpA1, TmpA3); - - //Rotate[1][0] = 0 + temp[1] * axis[0] - s * axis[2]; - //Rotate[1][1] = c + temp[1] * axis[1]; - //Rotate[1][2] = 0 + temp[1] * axis[2] + s * axis[0]; - __m128 Axis1 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(1, 1, 1, 1)); - __m128 TmpB0 = _mm_mul_ps(Axis1, AxisC); - __m128 CosA1 = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(1, 1, 0, 1)); - __m128 TmpB1 = _mm_add_ps(CosA1, TmpB0); - __m128 SinB0 = SinA;//_mm_set_ps(-s, 0.0f, s, 0.0f); - __m128 TmpB2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(3, 0, 3, 2)); - __m128 TmpB3 = _mm_mul_ps(SinA0, TmpB2); - __m128 TmpB4 = _mm_add_ps(TmpB1, TmpB3); - - //Rotate[2][0] = 0 + temp[2] * axis[0] + s * axis[1]; - //Rotate[2][1] = 0 + temp[2] * axis[1] - s * axis[0]; - //Rotate[2][2] = c + temp[2] * axis[2]; - __m128 Axis2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(2, 2, 2, 2)); - __m128 TmpC0 = _mm_mul_ps(Axis2, AxisC); - __m128 CosA2 = _mm_shuffle_ps(Cos0, Cos0, _MM_SHUFFLE(1, 0, 1, 1)); - __m128 TmpC1 = _mm_add_ps(CosA2, TmpC0); - __m128 SinC0 = SinA;//_mm_set_ps(s, -s, 0.0f, 0.0f); - __m128 TmpC2 = _mm_shuffle_ps(AxisC, AxisC, _MM_SHUFFLE(3, 3, 0, 1)); - __m128 TmpC3 = _mm_mul_ps(SinA0, TmpC2); - __m128 TmpC4 = _mm_add_ps(TmpC1, TmpC3); - - __m128 Result[4]; - Result[0] = TmpA4; - Result[1] = TmpB4; - Result[2] = TmpC4; - Result[3] = _mm_set_ps(1, 0, 0, 0); - - //mat<4, 4, valType> Result; - //Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2]; - //Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2]; - //Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2]; - //Result[3] = m[3]; - //return Result; - sse_mul_ps(in, Result, out); -} -*/ -GLM_FUNC_QUALIFIER void glm_mat4_outerProduct(__m128 const& c, __m128 const& r, __m128 out[4]) -{ - out[0] = _mm_mul_ps(c, _mm_shuffle_ps(r, r, _MM_SHUFFLE(0, 0, 0, 0))); - out[1] = _mm_mul_ps(c, _mm_shuffle_ps(r, r, _MM_SHUFFLE(1, 1, 1, 1))); - out[2] = _mm_mul_ps(c, _mm_shuffle_ps(r, r, _MM_SHUFFLE(2, 2, 2, 2))); - out[3] = _mm_mul_ps(c, _mm_shuffle_ps(r, r, _MM_SHUFFLE(3, 3, 3, 3))); -} - -#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/3rdparty/glm/source/glm/simd/neon.h b/3rdparty/glm/source/glm/simd/neon.h deleted file mode 100644 index f85947f..0000000 --- a/3rdparty/glm/source/glm/simd/neon.h +++ /dev/null @@ -1,155 +0,0 @@ -/// @ref simd_neon -/// @file glm/simd/neon.h - -#pragma once - -#if GLM_ARCH & GLM_ARCH_NEON_BIT -#include - -namespace glm { - namespace neon { - static inline float32x4_t dupq_lane(float32x4_t vsrc, int lane) { - switch(lane) { -#if GLM_ARCH & GLM_ARCH_ARMV8_BIT - case 0: return vdupq_laneq_f32(vsrc, 0); - case 1: return vdupq_laneq_f32(vsrc, 1); - case 2: return vdupq_laneq_f32(vsrc, 2); - case 3: return vdupq_laneq_f32(vsrc, 3); -#else - case 0: return vdupq_n_f32(vgetq_lane_f32(vsrc, 0)); - case 1: return vdupq_n_f32(vgetq_lane_f32(vsrc, 1)); - case 2: return vdupq_n_f32(vgetq_lane_f32(vsrc, 2)); - case 3: return vdupq_n_f32(vgetq_lane_f32(vsrc, 3)); -#endif - } - assert(!"Unreachable code executed!"); - return vdupq_n_f32(0.0f); - } - - static inline float32x2_t dup_lane(float32x4_t vsrc, int lane) { - switch(lane) { -#if GLM_ARCH & GLM_ARCH_ARMV8_BIT - case 0: return vdup_laneq_f32(vsrc, 0); - case 1: return vdup_laneq_f32(vsrc, 1); - case 2: return vdup_laneq_f32(vsrc, 2); - case 3: return vdup_laneq_f32(vsrc, 3); -#else - case 0: return vdup_n_f32(vgetq_lane_f32(vsrc, 0)); - case 1: return vdup_n_f32(vgetq_lane_f32(vsrc, 1)); - case 2: return vdup_n_f32(vgetq_lane_f32(vsrc, 2)); - case 3: return vdup_n_f32(vgetq_lane_f32(vsrc, 3)); -#endif - } - assert(!"Unreachable code executed!"); - return vdup_n_f32(0.0f); - } - - static inline float32x4_t copy_lane(float32x4_t vdst, int dlane, float32x4_t vsrc, int slane) { -#if GLM_ARCH & GLM_ARCH_ARMV8_BIT - switch(dlane) { - case 0: - switch(slane) { - case 0: return vcopyq_laneq_f32(vdst, 0, vsrc, 0); - case 1: return vcopyq_laneq_f32(vdst, 0, vsrc, 1); - case 2: return vcopyq_laneq_f32(vdst, 0, vsrc, 2); - case 3: return vcopyq_laneq_f32(vdst, 0, vsrc, 3); - } - assert(!"Unreachable code executed!"); - case 1: - switch(slane) { - case 0: return vcopyq_laneq_f32(vdst, 1, vsrc, 0); - case 1: return vcopyq_laneq_f32(vdst, 1, vsrc, 1); - case 2: return vcopyq_laneq_f32(vdst, 1, vsrc, 2); - case 3: return vcopyq_laneq_f32(vdst, 1, vsrc, 3); - } - assert(!"Unreachable code executed!"); - case 2: - switch(slane) { - case 0: return vcopyq_laneq_f32(vdst, 2, vsrc, 0); - case 1: return vcopyq_laneq_f32(vdst, 2, vsrc, 1); - case 2: return vcopyq_laneq_f32(vdst, 2, vsrc, 2); - case 3: return vcopyq_laneq_f32(vdst, 2, vsrc, 3); - } - assert(!"Unreachable code executed!"); - case 3: - switch(slane) { - case 0: return vcopyq_laneq_f32(vdst, 3, vsrc, 0); - case 1: return vcopyq_laneq_f32(vdst, 3, vsrc, 1); - case 2: return vcopyq_laneq_f32(vdst, 3, vsrc, 2); - case 3: return vcopyq_laneq_f32(vdst, 3, vsrc, 3); - } - assert(!"Unreachable code executed!"); - } -#else - - float l; - switch(slane) { - case 0: l = vgetq_lane_f32(vsrc, 0); break; - case 1: l = vgetq_lane_f32(vsrc, 1); break; - case 2: l = vgetq_lane_f32(vsrc, 2); break; - case 3: l = vgetq_lane_f32(vsrc, 3); break; - default: - assert(!"Unreachable code executed!"); - } - switch(dlane) { - case 0: return vsetq_lane_f32(l, vdst, 0); - case 1: return vsetq_lane_f32(l, vdst, 1); - case 2: return vsetq_lane_f32(l, vdst, 2); - case 3: return vsetq_lane_f32(l, vdst, 3); - } -#endif - assert(!"Unreachable code executed!"); - return vdupq_n_f32(0.0f); - } - - static inline float32x4_t mul_lane(float32x4_t v, float32x4_t vlane, int lane) { -#if GLM_ARCH & GLM_ARCH_ARMV8_BIT - switch(lane) { - case 0: return vmulq_laneq_f32(v, vlane, 0); break; - case 1: return vmulq_laneq_f32(v, vlane, 1); break; - case 2: return vmulq_laneq_f32(v, vlane, 2); break; - case 3: return vmulq_laneq_f32(v, vlane, 3); break; - default: - assert(!"Unreachable code executed!"); - } - assert(!"Unreachable code executed!"); - return vdupq_n_f32(0.0f); -#else - return vmulq_f32(v, dupq_lane(vlane, lane)); -#endif - } - - static inline float32x4_t madd_lane(float32x4_t acc, float32x4_t v, float32x4_t vlane, int lane) { -#if GLM_ARCH & GLM_ARCH_ARMV8_BIT -#ifdef GLM_CONFIG_FORCE_FMA -# define FMADD_LANE(acc, x, y, L) do { asm volatile ("fmla %0.4s, %1.4s, %2.4s" : "+w"(acc) : "w"(x), "w"(dup_lane(y, L))); } while(0) -#else -# define FMADD_LANE(acc, x, y, L) do { acc = vmlaq_laneq_f32(acc, x, y, L); } while(0) -#endif - - switch(lane) { - case 0: - FMADD_LANE(acc, v, vlane, 0); - return acc; - case 1: - FMADD_LANE(acc, v, vlane, 1); - return acc; - case 2: - FMADD_LANE(acc, v, vlane, 2); - return acc; - case 3: - FMADD_LANE(acc, v, vlane, 3); - return acc; - default: - assert(!"Unreachable code executed!"); - } - assert(!"Unreachable code executed!"); - return vdupq_n_f32(0.0f); -# undef FMADD_LANE -#else - return vaddq_f32(acc, vmulq_f32(v, dupq_lane(vlane, lane))); -#endif - } - } //namespace neon -} // namespace glm -#endif // GLM_ARCH & GLM_ARCH_NEON_BIT diff --git a/3rdparty/glm/source/glm/simd/packing.h b/3rdparty/glm/source/glm/simd/packing.h deleted file mode 100644 index 609163e..0000000 --- a/3rdparty/glm/source/glm/simd/packing.h +++ /dev/null @@ -1,8 +0,0 @@ -/// @ref simd -/// @file glm/simd/packing.h - -#pragma once - -#if GLM_ARCH & GLM_ARCH_SSE2_BIT - -#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/3rdparty/glm/source/glm/simd/platform.h b/3rdparty/glm/source/glm/simd/platform.h deleted file mode 100644 index 12a7b72..0000000 --- a/3rdparty/glm/source/glm/simd/platform.h +++ /dev/null @@ -1,408 +0,0 @@ -#pragma once - -/////////////////////////////////////////////////////////////////////////////////// -// Platform - -#define GLM_PLATFORM_UNKNOWN 0x00000000 -#define GLM_PLATFORM_WINDOWS 0x00010000 -#define GLM_PLATFORM_LINUX 0x00020000 -#define GLM_PLATFORM_APPLE 0x00040000 -//#define GLM_PLATFORM_IOS 0x00080000 -#define GLM_PLATFORM_ANDROID 0x00100000 -#define GLM_PLATFORM_CHROME_NACL 0x00200000 -#define GLM_PLATFORM_UNIX 0x00400000 -#define GLM_PLATFORM_QNXNTO 0x00800000 -#define GLM_PLATFORM_WINCE 0x01000000 -#define GLM_PLATFORM_CYGWIN 0x02000000 - -#ifdef GLM_FORCE_PLATFORM_UNKNOWN -# define GLM_PLATFORM GLM_PLATFORM_UNKNOWN -#elif defined(__CYGWIN__) -# define GLM_PLATFORM GLM_PLATFORM_CYGWIN -#elif defined(__QNXNTO__) -# define GLM_PLATFORM GLM_PLATFORM_QNXNTO -#elif defined(__APPLE__) -# define GLM_PLATFORM GLM_PLATFORM_APPLE -#elif defined(WINCE) -# define GLM_PLATFORM GLM_PLATFORM_WINCE -#elif defined(_WIN32) -# define GLM_PLATFORM GLM_PLATFORM_WINDOWS -#elif defined(__native_client__) -# define GLM_PLATFORM GLM_PLATFORM_CHROME_NACL -#elif defined(__ANDROID__) -# define GLM_PLATFORM GLM_PLATFORM_ANDROID -#elif defined(__linux) -# define GLM_PLATFORM GLM_PLATFORM_LINUX -#elif defined(__unix) -# define GLM_PLATFORM GLM_PLATFORM_UNIX -#else -# define GLM_PLATFORM GLM_PLATFORM_UNKNOWN -#endif// - -/////////////////////////////////////////////////////////////////////////////////// -// Compiler - -#define GLM_COMPILER_UNKNOWN 0x00000000 - -// Intel -#define GLM_COMPILER_INTEL 0x00100000 -#define GLM_COMPILER_INTEL14 0x00100040 -#define GLM_COMPILER_INTEL15 0x00100050 -#define GLM_COMPILER_INTEL16 0x00100060 -#define GLM_COMPILER_INTEL17 0x00100070 - -// Visual C++ defines -#define GLM_COMPILER_VC 0x01000000 -#define GLM_COMPILER_VC12 0x01000001 -#define GLM_COMPILER_VC14 0x01000002 -#define GLM_COMPILER_VC15 0x01000003 -#define GLM_COMPILER_VC15_3 0x01000004 -#define GLM_COMPILER_VC15_5 0x01000005 -#define GLM_COMPILER_VC15_6 0x01000006 -#define GLM_COMPILER_VC15_7 0x01000007 -#define GLM_COMPILER_VC15_8 0x01000008 -#define GLM_COMPILER_VC15_9 0x01000009 -#define GLM_COMPILER_VC16 0x0100000A - -// GCC defines -#define GLM_COMPILER_GCC 0x02000000 -#define GLM_COMPILER_GCC46 0x020000D0 -#define GLM_COMPILER_GCC47 0x020000E0 -#define GLM_COMPILER_GCC48 0x020000F0 -#define GLM_COMPILER_GCC49 0x02000100 -#define GLM_COMPILER_GCC5 0x02000200 -#define GLM_COMPILER_GCC6 0x02000300 -#define GLM_COMPILER_GCC7 0x02000400 -#define GLM_COMPILER_GCC8 0x02000500 - -// CUDA -#define GLM_COMPILER_CUDA 0x10000000 -#define GLM_COMPILER_CUDA75 0x10000001 -#define GLM_COMPILER_CUDA80 0x10000002 -#define GLM_COMPILER_CUDA90 0x10000004 -#define GLM_COMPILER_CUDA_RTC 0x10000100 - -// SYCL -#define GLM_COMPILER_SYCL 0x00300000 - -// Clang -#define GLM_COMPILER_CLANG 0x20000000 -#define GLM_COMPILER_CLANG34 0x20000050 -#define GLM_COMPILER_CLANG35 0x20000060 -#define GLM_COMPILER_CLANG36 0x20000070 -#define GLM_COMPILER_CLANG37 0x20000080 -#define GLM_COMPILER_CLANG38 0x20000090 -#define GLM_COMPILER_CLANG39 0x200000A0 -#define GLM_COMPILER_CLANG40 0x200000B0 -#define GLM_COMPILER_CLANG41 0x200000C0 -#define GLM_COMPILER_CLANG42 0x200000D0 - -// HIP -#define GLM_COMPILER_HIP 0x40000000 - -// Build model -#define GLM_MODEL_32 0x00000010 -#define GLM_MODEL_64 0x00000020 - -// Force generic C++ compiler -#ifdef GLM_FORCE_COMPILER_UNKNOWN -# define GLM_COMPILER GLM_COMPILER_UNKNOWN - -#elif defined(__INTEL_COMPILER) -# if __INTEL_COMPILER >= 1700 -# define GLM_COMPILER GLM_COMPILER_INTEL17 -# elif __INTEL_COMPILER >= 1600 -# define GLM_COMPILER GLM_COMPILER_INTEL16 -# elif __INTEL_COMPILER >= 1500 -# define GLM_COMPILER GLM_COMPILER_INTEL15 -# elif __INTEL_COMPILER >= 1400 -# define GLM_COMPILER GLM_COMPILER_INTEL14 -# elif __INTEL_COMPILER < 1400 -# error "GLM requires ICC 2013 SP1 or newer" -# endif - -// CUDA -#elif defined(__CUDACC__) -# if !defined(CUDA_VERSION) && !defined(GLM_FORCE_CUDA) -# include // make sure version is defined since nvcc does not define it itself! -# endif -# if defined(__CUDACC_RTC__) -# define GLM_COMPILER GLM_COMPILER_CUDA_RTC -# elif CUDA_VERSION >= 8000 -# define GLM_COMPILER GLM_COMPILER_CUDA80 -# elif CUDA_VERSION >= 7500 -# define GLM_COMPILER GLM_COMPILER_CUDA75 -# elif CUDA_VERSION >= 7000 -# define GLM_COMPILER GLM_COMPILER_CUDA70 -# elif CUDA_VERSION < 7000 -# error "GLM requires CUDA 7.0 or higher" -# endif - -// HIP -#elif defined(__HIP__) -# define GLM_COMPILER GLM_COMPILER_HIP - -// SYCL -#elif defined(__SYCL_DEVICE_ONLY__) -# define GLM_COMPILER GLM_COMPILER_SYCL - -// Clang -#elif defined(__clang__) -# if defined(__apple_build_version__) -# if (__clang_major__ < 6) -# error "GLM requires Clang 3.4 / Apple Clang 6.0 or higher" -# elif __clang_major__ == 6 && __clang_minor__ == 0 -# define GLM_COMPILER GLM_COMPILER_CLANG35 -# elif __clang_major__ == 6 && __clang_minor__ >= 1 -# define GLM_COMPILER GLM_COMPILER_CLANG36 -# elif __clang_major__ >= 7 -# define GLM_COMPILER GLM_COMPILER_CLANG37 -# endif -# else -# if ((__clang_major__ == 3) && (__clang_minor__ < 4)) || (__clang_major__ < 3) -# error "GLM requires Clang 3.4 or higher" -# elif __clang_major__ == 3 && __clang_minor__ == 4 -# define GLM_COMPILER GLM_COMPILER_CLANG34 -# elif __clang_major__ == 3 && __clang_minor__ == 5 -# define GLM_COMPILER GLM_COMPILER_CLANG35 -# elif __clang_major__ == 3 && __clang_minor__ == 6 -# define GLM_COMPILER GLM_COMPILER_CLANG36 -# elif __clang_major__ == 3 && __clang_minor__ == 7 -# define GLM_COMPILER GLM_COMPILER_CLANG37 -# elif __clang_major__ == 3 && __clang_minor__ == 8 -# define GLM_COMPILER GLM_COMPILER_CLANG38 -# elif __clang_major__ == 3 && __clang_minor__ >= 9 -# define GLM_COMPILER GLM_COMPILER_CLANG39 -# elif __clang_major__ == 4 && __clang_minor__ == 0 -# define GLM_COMPILER GLM_COMPILER_CLANG40 -# elif __clang_major__ == 4 && __clang_minor__ == 1 -# define GLM_COMPILER GLM_COMPILER_CLANG41 -# elif __clang_major__ == 4 && __clang_minor__ >= 2 -# define GLM_COMPILER GLM_COMPILER_CLANG42 -# elif __clang_major__ >= 4 -# define GLM_COMPILER GLM_COMPILER_CLANG42 -# endif -# endif - -// Visual C++ -#elif defined(_MSC_VER) -# if _MSC_VER >= 1920 -# define GLM_COMPILER GLM_COMPILER_VC16 -# elif _MSC_VER >= 1916 -# define GLM_COMPILER GLM_COMPILER_VC15_9 -# elif _MSC_VER >= 1915 -# define GLM_COMPILER GLM_COMPILER_VC15_8 -# elif _MSC_VER >= 1914 -# define GLM_COMPILER GLM_COMPILER_VC15_7 -# elif _MSC_VER >= 1913 -# define GLM_COMPILER GLM_COMPILER_VC15_6 -# elif _MSC_VER >= 1912 -# define GLM_COMPILER GLM_COMPILER_VC15_5 -# elif _MSC_VER >= 1911 -# define GLM_COMPILER GLM_COMPILER_VC15_3 -# elif _MSC_VER >= 1910 -# define GLM_COMPILER GLM_COMPILER_VC15 -# elif _MSC_VER >= 1900 -# define GLM_COMPILER GLM_COMPILER_VC14 -# elif _MSC_VER >= 1800 -# define GLM_COMPILER GLM_COMPILER_VC12 -# elif _MSC_VER < 1800 -# error "GLM requires Visual C++ 12 - 2013 or higher" -# endif//_MSC_VER - -// G++ -#elif defined(__GNUC__) || defined(__MINGW32__) -# if __GNUC__ >= 8 -# define GLM_COMPILER GLM_COMPILER_GCC8 -# elif __GNUC__ >= 7 -# define GLM_COMPILER GLM_COMPILER_GCC7 -# elif __GNUC__ >= 6 -# define GLM_COMPILER GLM_COMPILER_GCC6 -# elif __GNUC__ >= 5 -# define GLM_COMPILER GLM_COMPILER_GCC5 -# elif __GNUC__ == 4 && __GNUC_MINOR__ >= 9 -# define GLM_COMPILER GLM_COMPILER_GCC49 -# elif __GNUC__ == 4 && __GNUC_MINOR__ >= 8 -# define GLM_COMPILER GLM_COMPILER_GCC48 -# elif __GNUC__ == 4 && __GNUC_MINOR__ >= 7 -# define GLM_COMPILER GLM_COMPILER_GCC47 -# elif __GNUC__ == 4 && __GNUC_MINOR__ >= 6 -# define GLM_COMPILER GLM_COMPILER_GCC46 -# elif ((__GNUC__ == 4) && (__GNUC_MINOR__ < 6)) || (__GNUC__ < 4) -# error "GLM requires GCC 4.6 or higher" -# endif - -#else -# define GLM_COMPILER GLM_COMPILER_UNKNOWN -#endif - -#ifndef GLM_COMPILER -# error "GLM_COMPILER undefined, your compiler may not be supported by GLM. Add #define GLM_COMPILER 0 to ignore this message." -#endif//GLM_COMPILER - -/////////////////////////////////////////////////////////////////////////////////// -// Instruction sets - -// User defines: GLM_FORCE_PURE GLM_FORCE_INTRINSICS GLM_FORCE_SSE2 GLM_FORCE_SSE3 GLM_FORCE_AVX GLM_FORCE_AVX2 GLM_FORCE_AVX2 - -#define GLM_ARCH_MIPS_BIT (0x10000000) -#define GLM_ARCH_PPC_BIT (0x20000000) -#define GLM_ARCH_ARM_BIT (0x40000000) -#define GLM_ARCH_ARMV8_BIT (0x01000000) -#define GLM_ARCH_X86_BIT (0x80000000) - -#define GLM_ARCH_SIMD_BIT (0x00001000) - -#define GLM_ARCH_NEON_BIT (0x00000001) -#define GLM_ARCH_SSE_BIT (0x00000002) -#define GLM_ARCH_SSE2_BIT (0x00000004) -#define GLM_ARCH_SSE3_BIT (0x00000008) -#define GLM_ARCH_SSSE3_BIT (0x00000010) -#define GLM_ARCH_SSE41_BIT (0x00000020) -#define GLM_ARCH_SSE42_BIT (0x00000040) -#define GLM_ARCH_AVX_BIT (0x00000080) -#define GLM_ARCH_AVX2_BIT (0x00000100) - -#define GLM_ARCH_UNKNOWN (0) -#define GLM_ARCH_X86 (GLM_ARCH_X86_BIT) -#define GLM_ARCH_SSE (GLM_ARCH_SSE_BIT | GLM_ARCH_SIMD_BIT | GLM_ARCH_X86) -#define GLM_ARCH_SSE2 (GLM_ARCH_SSE2_BIT | GLM_ARCH_SSE) -#define GLM_ARCH_SSE3 (GLM_ARCH_SSE3_BIT | GLM_ARCH_SSE2) -#define GLM_ARCH_SSSE3 (GLM_ARCH_SSSE3_BIT | GLM_ARCH_SSE3) -#define GLM_ARCH_SSE41 (GLM_ARCH_SSE41_BIT | GLM_ARCH_SSSE3) -#define GLM_ARCH_SSE42 (GLM_ARCH_SSE42_BIT | GLM_ARCH_SSE41) -#define GLM_ARCH_AVX (GLM_ARCH_AVX_BIT | GLM_ARCH_SSE42) -#define GLM_ARCH_AVX2 (GLM_ARCH_AVX2_BIT | GLM_ARCH_AVX) -#define GLM_ARCH_ARM (GLM_ARCH_ARM_BIT) -#define GLM_ARCH_ARMV8 (GLM_ARCH_NEON_BIT | GLM_ARCH_SIMD_BIT | GLM_ARCH_ARM | GLM_ARCH_ARMV8_BIT) -#define GLM_ARCH_NEON (GLM_ARCH_NEON_BIT | GLM_ARCH_SIMD_BIT | GLM_ARCH_ARM) -#define GLM_ARCH_MIPS (GLM_ARCH_MIPS_BIT) -#define GLM_ARCH_PPC (GLM_ARCH_PPC_BIT) - -#if defined(GLM_FORCE_ARCH_UNKNOWN) || defined(GLM_FORCE_PURE) -# define GLM_ARCH GLM_ARCH_UNKNOWN -#elif defined(GLM_FORCE_NEON) -# if __ARM_ARCH >= 8 -# define GLM_ARCH (GLM_ARCH_ARMV8) -# else -# define GLM_ARCH (GLM_ARCH_NEON) -# endif -# define GLM_FORCE_INTRINSICS -#elif defined(GLM_FORCE_AVX2) -# define GLM_ARCH (GLM_ARCH_AVX2) -# define GLM_FORCE_INTRINSICS -#elif defined(GLM_FORCE_AVX) -# define GLM_ARCH (GLM_ARCH_AVX) -# define GLM_FORCE_INTRINSICS -#elif defined(GLM_FORCE_SSE42) -# define GLM_ARCH (GLM_ARCH_SSE42) -# define GLM_FORCE_INTRINSICS -#elif defined(GLM_FORCE_SSE41) -# define GLM_ARCH (GLM_ARCH_SSE41) -# define GLM_FORCE_INTRINSICS -#elif defined(GLM_FORCE_SSSE3) -# define GLM_ARCH (GLM_ARCH_SSSE3) -# define GLM_FORCE_INTRINSICS -#elif defined(GLM_FORCE_SSE3) -# define GLM_ARCH (GLM_ARCH_SSE3) -# define GLM_FORCE_INTRINSICS -#elif defined(GLM_FORCE_SSE2) -# define GLM_ARCH (GLM_ARCH_SSE2) -# define GLM_FORCE_INTRINSICS -#elif defined(GLM_FORCE_SSE) -# define GLM_ARCH (GLM_ARCH_SSE) -# define GLM_FORCE_INTRINSICS -#elif defined(GLM_FORCE_INTRINSICS) && !defined(GLM_FORCE_XYZW_ONLY) -# if defined(__AVX2__) -# define GLM_ARCH (GLM_ARCH_AVX2) -# elif defined(__AVX__) -# define GLM_ARCH (GLM_ARCH_AVX) -# elif defined(__SSE4_2__) -# define GLM_ARCH (GLM_ARCH_SSE42) -# elif defined(__SSE4_1__) -# define GLM_ARCH (GLM_ARCH_SSE41) -# elif defined(__SSSE3__) -# define GLM_ARCH (GLM_ARCH_SSSE3) -# elif defined(__SSE3__) -# define GLM_ARCH (GLM_ARCH_SSE3) -# elif defined(__SSE2__) || defined(__x86_64__) || defined(_M_X64) || defined(_M_IX86_FP) -# define GLM_ARCH (GLM_ARCH_SSE2) -# elif defined(__i386__) -# define GLM_ARCH (GLM_ARCH_X86) -# elif defined(__ARM_ARCH) && (__ARM_ARCH >= 8) -# define GLM_ARCH (GLM_ARCH_ARMV8) -# elif defined(__ARM_NEON) -# define GLM_ARCH (GLM_ARCH_ARM | GLM_ARCH_NEON) -# elif defined(__arm__ ) || defined(_M_ARM) -# define GLM_ARCH (GLM_ARCH_ARM) -# elif defined(__mips__ ) -# define GLM_ARCH (GLM_ARCH_MIPS) -# elif defined(__powerpc__ ) || defined(_M_PPC) -# define GLM_ARCH (GLM_ARCH_PPC) -# else -# define GLM_ARCH (GLM_ARCH_UNKNOWN) -# endif -#else -# if defined(__x86_64__) || defined(_M_X64) || defined(_M_IX86) || defined(__i386__) -# define GLM_ARCH (GLM_ARCH_X86) -# elif defined(__arm__) || defined(_M_ARM) -# define GLM_ARCH (GLM_ARCH_ARM) -# elif defined(__powerpc__) || defined(_M_PPC) -# define GLM_ARCH (GLM_ARCH_PPC) -# elif defined(__mips__) -# define GLM_ARCH (GLM_ARCH_MIPS) -# else -# define GLM_ARCH (GLM_ARCH_UNKNOWN) -# endif -#endif - -#if GLM_ARCH & GLM_ARCH_AVX2_BIT -# include -#elif GLM_ARCH & GLM_ARCH_AVX_BIT -# include -#elif GLM_ARCH & GLM_ARCH_SSE42_BIT -# if GLM_COMPILER & GLM_COMPILER_CLANG -# include -# endif -# include -#elif GLM_ARCH & GLM_ARCH_SSE41_BIT -# include -#elif GLM_ARCH & GLM_ARCH_SSSE3_BIT -# include -#elif GLM_ARCH & GLM_ARCH_SSE3_BIT -# include -#elif GLM_ARCH & GLM_ARCH_SSE2_BIT -# include -#elif GLM_ARCH & GLM_ARCH_NEON_BIT -# include "neon.h" -#endif//GLM_ARCH - -#if GLM_ARCH & GLM_ARCH_SSE2_BIT - typedef __m128 glm_f32vec4; - typedef __m128i glm_i32vec4; - typedef __m128i glm_u32vec4; - typedef __m128d glm_f64vec2; - typedef __m128i glm_i64vec2; - typedef __m128i glm_u64vec2; - - typedef glm_f32vec4 glm_vec4; - typedef glm_i32vec4 glm_ivec4; - typedef glm_u32vec4 glm_uvec4; - typedef glm_f64vec2 glm_dvec2; -#endif - -#if GLM_ARCH & GLM_ARCH_AVX_BIT - typedef __m256d glm_f64vec4; - typedef glm_f64vec4 glm_dvec4; -#endif - -#if GLM_ARCH & GLM_ARCH_AVX2_BIT - typedef __m256i glm_i64vec4; - typedef __m256i glm_u64vec4; -#endif - -#if GLM_ARCH & GLM_ARCH_NEON_BIT - typedef float32x4_t glm_f32vec4; - typedef int32x4_t glm_i32vec4; - typedef uint32x4_t glm_u32vec4; -#endif diff --git a/3rdparty/glm/source/glm/simd/trigonometric.h b/3rdparty/glm/source/glm/simd/trigonometric.h deleted file mode 100644 index 739b796..0000000 --- a/3rdparty/glm/source/glm/simd/trigonometric.h +++ /dev/null @@ -1,9 +0,0 @@ -/// @ref simd -/// @file glm/simd/trigonometric.h - -#pragma once - -#if GLM_ARCH & GLM_ARCH_SSE2_BIT - -#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT - diff --git a/3rdparty/glm/source/glm/simd/vector_relational.h b/3rdparty/glm/source/glm/simd/vector_relational.h deleted file mode 100644 index f7385e9..0000000 --- a/3rdparty/glm/source/glm/simd/vector_relational.h +++ /dev/null @@ -1,8 +0,0 @@ -/// @ref simd -/// @file glm/simd/vector_relational.h - -#pragma once - -#if GLM_ARCH & GLM_ARCH_SSE2_BIT - -#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT diff --git a/3rdparty/glm/source/glm/trigonometric.hpp b/3rdparty/glm/source/glm/trigonometric.hpp deleted file mode 100644 index 51d49c1..0000000 --- a/3rdparty/glm/source/glm/trigonometric.hpp +++ /dev/null @@ -1,210 +0,0 @@ -/// @ref core -/// @file glm/trigonometric.hpp -/// -/// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions -/// -/// @defgroup core_func_trigonometric Angle and Trigonometry Functions -/// @ingroup core -/// -/// Function parameters specified as angle are assumed to be in units of radians. -/// In no case will any of these functions result in a divide by zero error. If -/// the divisor of a ratio is 0, then results will be undefined. -/// -/// These all operate component-wise. The description is per component. -/// -/// Include to use these core features. -/// -/// @see ext_vector_trigonometric - -#pragma once - -#include "detail/setup.hpp" -#include "detail/qualifier.hpp" - -namespace glm -{ - /// @addtogroup core_func_trigonometric - /// @{ - - /// Converts degrees to radians and returns the result. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL radians man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL GLM_CONSTEXPR vec radians(vec const& degrees); - - /// Converts radians to degrees and returns the result. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL degrees man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL GLM_CONSTEXPR vec degrees(vec const& radians); - - /// The standard trigonometric sine function. - /// The values returned by this function will range from [-1, 1]. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL sin man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL vec sin(vec const& angle); - - /// The standard trigonometric cosine function. - /// The values returned by this function will range from [-1, 1]. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL cos man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL vec cos(vec const& angle); - - /// The standard trigonometric tangent function. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL tan man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL vec tan(vec const& angle); - - /// Arc sine. Returns an angle whose sine is x. - /// The range of values returned by this function is [-PI/2, PI/2]. - /// Results are undefined if |x| > 1. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL asin man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL vec asin(vec const& x); - - /// Arc cosine. Returns an angle whose cosine is x. - /// The range of values returned by this function is [0, PI]. - /// Results are undefined if |x| > 1. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL acos man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL vec acos(vec const& x); - - /// Arc tangent. Returns an angle whose tangent is y/x. - /// The signs of x and y are used to determine what - /// quadrant the angle is in. The range of values returned - /// by this function is [-PI, PI]. Results are undefined - /// if x and y are both 0. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL atan man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL vec atan(vec const& y, vec const& x); - - /// Arc tangent. Returns an angle whose tangent is y_over_x. - /// The range of values returned by this function is [-PI/2, PI/2]. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL atan man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL vec atan(vec const& y_over_x); - - /// Returns the hyperbolic sine function, (exp(x) - exp(-x)) / 2 - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL sinh man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL vec sinh(vec const& angle); - - /// Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2 - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL cosh man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL vec cosh(vec const& angle); - - /// Returns the hyperbolic tangent function, sinh(angle) / cosh(angle) - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL tanh man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL vec tanh(vec const& angle); - - /// Arc hyperbolic sine; returns the inverse of sinh. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL asinh man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL vec asinh(vec const& x); - - /// Arc hyperbolic cosine; returns the non-negative inverse - /// of cosh. Results are undefined if x < 1. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL acosh man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL vec acosh(vec const& x); - - /// Arc hyperbolic tangent; returns the inverse of tanh. - /// Results are undefined if abs(x) >= 1. - /// - /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector - /// @tparam T Floating-point scalar types - /// @tparam Q Value from qualifier enum - /// - /// @see GLSL atanh man page - /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template - GLM_FUNC_DECL vec atanh(vec const& x); - - /// @} -}//namespace glm - -#include "detail/func_trigonometric.inl" diff --git a/3rdparty/glm/source/glm/vec2.hpp b/3rdparty/glm/source/glm/vec2.hpp deleted file mode 100644 index cd4e070..0000000 --- a/3rdparty/glm/source/glm/vec2.hpp +++ /dev/null @@ -1,14 +0,0 @@ -/// @ref core -/// @file glm/vec2.hpp - -#pragma once -#include "./ext/vector_bool2.hpp" -#include "./ext/vector_bool2_precision.hpp" -#include "./ext/vector_float2.hpp" -#include "./ext/vector_float2_precision.hpp" -#include "./ext/vector_double2.hpp" -#include "./ext/vector_double2_precision.hpp" -#include "./ext/vector_int2.hpp" -#include "./ext/vector_int2_sized.hpp" -#include "./ext/vector_uint2.hpp" -#include "./ext/vector_uint2_sized.hpp" diff --git a/3rdparty/glm/source/glm/vec3.hpp b/3rdparty/glm/source/glm/vec3.hpp deleted file mode 100644 index f5a927d..0000000 --- a/3rdparty/glm/source/glm/vec3.hpp +++ /dev/null @@ -1,14 +0,0 @@ -/// @ref core -/// @file glm/vec3.hpp - -#pragma once -#include "./ext/vector_bool3.hpp" -#include "./ext/vector_bool3_precision.hpp" -#include "./ext/vector_float3.hpp" -#include "./ext/vector_float3_precision.hpp" -#include "./ext/vector_double3.hpp" -#include "./ext/vector_double3_precision.hpp" -#include "./ext/vector_int3.hpp" -#include "./ext/vector_int3_sized.hpp" -#include "./ext/vector_uint3.hpp" -#include "./ext/vector_uint3_sized.hpp" diff --git a/3rdparty/glm/source/glm/vec4.hpp b/3rdparty/glm/source/glm/vec4.hpp deleted file mode 100644 index c6ea9f1..0000000 --- a/3rdparty/glm/source/glm/vec4.hpp +++ /dev/null @@ -1,15 +0,0 @@ -/// @ref core -/// @file glm/vec4.hpp - -#pragma once -#include "./ext/vector_bool4.hpp" -#include "./ext/vector_bool4_precision.hpp" -#include "./ext/vector_float4.hpp" -#include "./ext/vector_float4_precision.hpp" -#include "./ext/vector_double4.hpp" -#include "./ext/vector_double4_precision.hpp" -#include "./ext/vector_int4.hpp" -#include "./ext/vector_int4_sized.hpp" -#include "./ext/vector_uint4.hpp" -#include "./ext/vector_uint4_sized.hpp" - diff --git a/3rdparty/glm/source/glm/vector_relational.hpp b/3rdparty/glm/source/glm/vector_relational.hpp deleted file mode 100644 index a0fe17e..0000000 --- a/3rdparty/glm/source/glm/vector_relational.hpp +++ /dev/null @@ -1,121 +0,0 @@ -/// @ref core -/// @file glm/vector_relational.hpp -/// -/// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions -/// -/// @defgroup core_func_vector_relational Vector Relational Functions -/// @ingroup core -/// -/// Relational and equality operators (<, <=, >, >=, ==, !=) are defined to -/// operate on scalars and produce scalar Boolean results. For vector results, -/// use the following built-in functions. -/// -/// In all cases, the sizes of all the input and return vectors for any particular -/// call must match. -/// -/// Include to use these core features. -/// -/// @see ext_vector_relational - -#pragma once - -#include "detail/qualifier.hpp" -#include "detail/setup.hpp" - -namespace glm -{ - /// @addtogroup core_func_vector_relational - /// @{ - - /// Returns the component-wise comparison result of x < y. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T A floating-point or integer scalar type. - /// - /// @see GLSL lessThan man page - /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions - template - GLM_FUNC_DECL GLM_CONSTEXPR vec lessThan(vec const& x, vec const& y); - - /// Returns the component-wise comparison of result x <= y. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T A floating-point or integer scalar type. - /// - /// @see GLSL lessThanEqual man page - /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions - template - GLM_FUNC_DECL GLM_CONSTEXPR vec lessThanEqual(vec const& x, vec const& y); - - /// Returns the component-wise comparison of result x > y. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T A floating-point or integer scalar type. - /// - /// @see GLSL greaterThan man page - /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions - template - GLM_FUNC_DECL GLM_CONSTEXPR vec greaterThan(vec const& x, vec const& y); - - /// Returns the component-wise comparison of result x >= y. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T A floating-point or integer scalar type. - /// - /// @see GLSL greaterThanEqual man page - /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions - template - GLM_FUNC_DECL GLM_CONSTEXPR vec greaterThanEqual(vec const& x, vec const& y); - - /// Returns the component-wise comparison of result x == y. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T A floating-point, integer or bool scalar type. - /// - /// @see GLSL equal man page - /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions - template - GLM_FUNC_DECL GLM_CONSTEXPR vec equal(vec const& x, vec const& y); - - /// Returns the component-wise comparison of result x != y. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T A floating-point, integer or bool scalar type. - /// - /// @see GLSL notEqual man page - /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions - template - GLM_FUNC_DECL GLM_CONSTEXPR vec notEqual(vec const& x, vec const& y); - - /// Returns true if any component of x is true. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// - /// @see GLSL any man page - /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions - template - GLM_FUNC_DECL GLM_CONSTEXPR bool any(vec const& v); - - /// Returns true if all components of x are true. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// - /// @see GLSL all man page - /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions - template - GLM_FUNC_DECL GLM_CONSTEXPR bool all(vec const& v); - - /// Returns the component-wise logical complement of x. - /// /!\ Because of language incompatibilities between C++ and GLSL, GLM defines the function not but not_ instead. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// - /// @see GLSL not man page - /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions - template - GLM_FUNC_DECL GLM_CONSTEXPR vec not_(vec const& v); - - /// @} -}//namespace glm - -#include "detail/func_vector_relational.inl" diff --git a/3rdparty/glm/source/manual.md b/3rdparty/glm/source/manual.md deleted file mode 100644 index f98c24b..0000000 --- a/3rdparty/glm/source/manual.md +++ /dev/null @@ -1,2430 +0,0 @@ -![Alt](./doc/manual/logo-mini.png "GLM Logo") - -# GLM 0.9.9 Manual - -![Alt](./doc/manual/g-truc.png "G-Truc Logo") - ---- -
- -## Table of Contents -+ [0. Licenses](#section0) -+ [1. Getting started](#section1) -+ [1.1. Using global headers](#section1_1) -+ [1.2. Using separated headers](#section1_2) -+ [1.3. Using extension headers](#section1_3) -+ [1.4. Dependencies](#section1_4) -+ [1.5. Finding GLM with CMake](#section1_5) -+ [2. Preprocessor configurations](#section2) -+ [2.1. GLM\_FORCE\_MESSAGES: Platform auto detection and default configuration](#section2_1) -+ [2.2. GLM\_FORCE\_PLATFORM\_UNKNOWN: Force GLM to no detect the build platform](#section2_2) -+ [2.3. GLM\_FORCE\_COMPILER\_UNKNOWN: Force GLM to no detect the C++ compiler](#section2_3) -+ [2.4. GLM\_FORCE\_ARCH\_UNKNOWN: Force GLM to no detect the build architecture](#section2_4) -+ [2.5. GLM\_FORCE\_CXX\_UNKNOWN: Force GLM to no detect the C++ standard](#section2_5) -+ [2.6. GLM\_FORCE\_CXX**: C++ language detection](#section2_6) -+ [2.7. GLM\_FORCE\_EXPLICIT\_CTOR: Requiring explicit conversions](#section2_7) -+ [2.8. GLM\_FORCE\_INLINE: Force inline](#section2_8) -+ [2.9. GLM\_FORCE\_ALIGNED\_GENTYPES: Force GLM to enable aligned types](#section2_9) -+ [2.10. GLM\_FORCE\_DEFAULT\_ALIGNED\_GENTYPES: Force GLM to use aligned types by default](#section2_10) -+ [2.11. GLM\_FORCE\_INTRINSICS: Using SIMD optimizations](#section2_11) -+ [2.12. GLM\_FORCE\_PRECISION\_**: Default precision](#section2_12) -+ [2.13. GLM\_FORCE\_SINGLE\_ONLY: Removed explicit 64-bits floating point types](#section2_13) -+ [2.14. GLM\_FORCE\_SWIZZLE: Enable swizzle operators](#section2_14) -+ [2.15. GLM\_FORCE\_XYZW\_ONLY: Only exposes x, y, z and w components](#section2_15) -+ [2.16. GLM\_FORCE\_LEFT\_HANDED: Force left handed coordinate system](#section2_16) -+ [2.17. GLM\_FORCE\_DEPTH\_ZERO\_TO\_ONE: Force the use of a clip space between 0 to 1](#section2_17) -+ [2.18. GLM\_FORCE\_SIZE\_T\_LENGTH: Vector and matrix static size type](#section2_18) -+ [2.19. GLM\_FORCE\_UNRESTRICTED\_GENTYPE: Removing genType restriction](#section2_19) -+ [2.20. GLM\_FORCE\_SILENT\_WARNINGS: Silent C++ warnings from language extensions](#section2_20) -+ [2.21. GLM\_FORCE\_QUAT\_DATA\_WXYZ: Force GLM to store quat data as w,x,y,z instead of x,y,z,w](#section2_21) -+ [3. Stable extensions](#section3) -+ [3.1. Scalar types](#section3_1) -+ [3.2. Scalar functions](#section3_2) -+ [3.3. Vector types](#section3_3) -+ [3.4. Vector types with precision qualifiers](#section3_4) -+ [3.5. Vector functions](#section3_5) -+ [3.6. Matrix types](#section3_6) -+ [3.7. Matrix types with precision qualifiers](#section3_7) -+ [3.8. Matrix functions](#section3_8) -+ [3.9. Quaternion types](#section3_9) -+ [3.10. Quaternion types with precision qualifiers](#section3_10) -+ [3.11. Quaternion functions](#section3_11) -+ [4. Recommended extensions](#section4) -+ [4.1. GLM_GTC_bitfield](#section4_1) -+ [4.2. GLM_GTC_color_space](#section4_2) -+ [4.3. GLM_GTC_constants](#section4_3) -+ [4.4. GLM_GTC_epsilon](#section4_4) -+ [4.5. GLM_GTC_integer](#section4_5) -+ [4.6. GLM_GTC_matrix_access](#section4_6) -+ [4.7. GLM_GTC_matrix_integer](#section4_7) -+ [4.8. GLM_GTC_matrix_inverse](#section4_8) -+ [4.9. GLM_GTC_matrix_transform](#section4_9) -+ [4.10. GLM_GTC_noise](#section4_10) -+ [4.11. GLM_GTC_packing](#section4_11) -+ [4.12. GLM_GTC_quaternion](#section4_12) -+ [4.13. GLM_GTC_random](#section4_13) -+ [4.14. GLM_GTC_reciprocal](#section4_14) -+ [4.15. GLM_GTC_round](#section4_15) -+ [4.16. GLM_GTC_type_alignment](#section4_16) -+ [4.17. GLM_GTC_type_precision](#section4_17) -+ [4.18. GLM_GTC_type_ptr](#section4_18) -+ [4.19. GLM_GTC_ulp](#section4_19) -+ [4.20. GLM_GTC_vec1](#section4_20) -+ [5. OpenGL interoperability](#section5) -+ [5.1. GLM Replacements for deprecated OpenGL functions](#section5_1) -+ [5.2. GLM Replacements for GLU functions](#section5_2) -+ [6. Known issues](#section6) -+ [6.1. Not function](#section6_1) -+ [6.2. Precision qualifiers support](#section6_2) -+ [7. FAQ](#section7) -+ [7.1 Why GLM follows GLSL specification and conventions?](#section7_1) -+ [7.2. Does GLM run GLSL programs?](#section7_2) -+ [7.3. Does a GLSL compiler build GLM codes?](#section7_3) -+ [7.4. Should I use ‘GTX’ extensions?](#section7_4) -+ [7.5. Where can I ask my questions?](#section7_5) -+ [7.6. Where can I find the documentation of extensions?](#section7_6) -+ [7.7. Should I use 'using namespace glm;'?](#section7_7) -+ [7.8. Is GLM fast?](#section7_8) -+ [7.9. When I build with Visual C++ with /w4 warning level, I have warnings...](#section7_9) -+ [7.10. Why some GLM functions can crash because of division by zero?](#section7_10) -+ [7.11. What unit for angles us used in GLM?](#section7_11) -+ [7.12. Windows headers cause build errors...](#section7_12) -+ [7.13. Constant expressions support](#section7_13) -+ [8. Code samples](#section8) -+ [8.1. Compute a triangle normal](#section8_1) -+ [8.2. Matrix transform](#section8_2) -+ [8.3. Vector types](#section8_3) -+ [8.4. Lighting](#section8_4) -+ [9. Contributing to GLM](#section9) -+ [9.1. Submitting bug reports](#section9_1) -+ [9.2. Contributing to GLM with pull request](#section9_2) -+ [9.3. Coding style](#section9_3) -+ [10. References](#section10) -+ [10.1. OpenGL specifications](#section10_1) -+ [10.2. External links](#section10_2) -+ [10.3. Projects using GLM](#section10_3) -+ [10.4. Tutorials using GLM](#section10_4) -+ [10.5. Equivalent for other languages](#section10_5) -+ [10.6. Alternatives to GLM](#section10_6) -+ [10.7. Acknowledgements](#section10_7) - ---- -
- -## Licenses - -### The Happy Bunny License (Modified MIT License) - -Copyright (c) 2005 - G-Truc Creation - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -Restrictions: By making use of the Software for military purposes, you -choose to make a Bunny unhappy. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -![](./doc/manual/frontpage1.png) - -### The MIT License - -Copyright (c) 2005 - G-Truc Creation - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -![](./doc/manual/frontpage2.png) - ---- -
- -## 1. Getting started -### 1.1. Using global headers - -GLM is a header-only library, and thus does not need to be compiled. We can use GLM's implementation of GLSL's mathematics functionality by including the `` header: - -```cpp -#include -``` - -To extend the feature set supported by GLM and keeping the library as close to GLSL as possible, new features are implemented as extensions that can be included thought a separated header: -```cpp -// Include all GLM core / GLSL features -#include // vec2, vec3, mat4, radians - -// Include all GLM extensions -#include // perspective, translate, rotate - -glm::mat4 transform(glm::vec2 const& Orientation, glm::vec3 const& Translate, glm::vec3 const& Up) -{ - glm::mat4 Proj = glm::perspective(glm::radians(45.f), 1.33f, 0.1f, 10.f); - glm::mat4 ViewTranslate = glm::translate(glm::mat4(1.f), Translate); - glm::mat4 ViewRotateX = glm::rotate(ViewTranslate, Orientation.y, Up); - glm::mat4 View = glm::rotate(ViewRotateX, Orientation.x, Up); - glm::mat4 Model = glm::mat4(1.0f); - return Proj * View * Model; -} -``` - -*Note: Including `` and `` is convenient but pull a lot of code which will significantly increase build time, particularly if these files are included in all source files. We may prefer to use the approaches describe in the two following sections to keep the project build fast.* - -### 1.2. Using separated headers - -GLM relies on C++ templates heavily, and may significantly increase compilation times for projects that use it. Hence, user projects could only include the features they actually use. Following is the list of all the core features, based on GLSL specification, headers: -```cpp -#include // vec2, bvec2, dvec2, ivec2 and uvec2 -#include // vec3, bvec3, dvec3, ivec3 and uvec3 -#include // vec4, bvec4, dvec4, ivec4 and uvec4 -#include // mat2, dmat2 -#include // mat2x3, dmat2x3 -#include // mat2x4, dmat2x4 -#include // mat3x2, dmat3x2 -#include // mat3, dmat3 -#include // mat3x4, dmat2 -#include // mat4x2, dmat4x2 -#include // mat4x3, dmat4x3 -#include // mat4, dmat4 -#include // all the GLSL common functions: abs, min, mix, isnan, fma, etc. -#include // all the GLSL exponential functions: pow, log, exp2, sqrt, etc. -#include // all the GLSL geometry functions: dot, cross, reflect, etc. -#include // all the GLSL integer functions: findMSB, bitfieldExtract, etc. -#include // all the GLSL matrix functions: transpose, inverse, etc. -#include // all the GLSL packing functions: packUnorm4x8, unpackHalf2x16, etc. -#include // all the GLSL trigonometric functions: radians, cos, asin, etc. -#include // all the GLSL vector relational functions: equal, less, etc. -``` - -The following is a code sample using separated core headers and an extension: -```cpp -// Include GLM core features -#include // vec2 -#include // vec3 -#include // mat4 -#include //radians - -// Include GLM extension -#include // perspective, translate, rotate - -glm::mat4 transform(glm::vec2 const& Orientation, glm::vec3 const& Translate, glm::vec3 const& Up) -{ - glm::mat4 Proj = glm::perspective(glm::radians(45.f), 1.33f, 0.1f, 10.f); - glm::mat4 ViewTranslate = glm::translate(glm::mat4(1.f), Translate); - glm::mat4 ViewRotateX = glm::rotate(ViewTranslate, Orientation.y, Up); - glm::mat4 View = glm::rotate(ViewRotateX, Orientation.x, Up); - glm::mat4 Model = glm::mat4(1.0f); - return Proj * View * Model; -} -``` - -### 1.3. Using extension headers - -Using GLM through split headers to minimize the project build time: -```cpp -// Include GLM vector extensions: -#include // vec2 -#include // vec3 -#include // radians - -// Include GLM matrix extensions: -#include // mat4 -#include // perspective, translate, rotate - -glm::mat4 transform(glm::vec2 const& Orientation, glm::vec3 const& Translate, glm::vec3 const& Up) -{ - glm::mat4 Proj = glm::perspective(glm::radians(45.f), 1.33f, 0.1f, 10.f); - glm::mat4 ViewTranslate = glm::translate(glm::mat4(1.f), Translate); - glm::mat4 ViewRotateX = glm::rotate(ViewTranslate, Orientation.y, Up); - glm::mat4 View = glm::rotate(ViewRotateX, Orientation.x, Up); - glm::mat4 Model = glm::mat4(1.0f); - return Proj * View * Model; -} -``` - -### 1.4. Dependencies - -GLM does not depend on external libraries or headers such as ``, [``](http://www.opengl.org/registry/api/GL/glcorearb.h), ``, ``, or ``. - -### 1.5. Finding GLM with CMake - -When installed, GLM provides the CMake package configuration files `glmConfig.cmake` and `glmConfigVersion.cmake`. - -To use these configurations files, you may need to set the `glm_DIR` variable to the directory containing the configuration files `/lib/cmake/glm/`. - -Use the `find_package` CMake command to load the configurations into your project. Lastly, either link your executable against the `glm::glm` target or add `${GLM_INCLUDE_DIRS}` to your target's include directories: - -```cmake -set(glm_DIR /lib/cmake/glm) # if necessary -find_package(glm REQUIRED) -target_link_libraries( glm::glm) -``` - -To use GLM as a submodule in a project instead, use `add_subdirectory` to expose the same target, or add the directory to your target's - -```cmake -add_subdirectory(glm) -target_link_libraries( glm::glm) -# or -target_include_directories( glm) -``` - ---- -
- -## 2. Preprocessor configurations - -### 2.1. GLM\_FORCE\_MESSAGES: Platform auto detection and default configuration - -When included, GLM will first automatically detect the compiler used, the C++ standard supported, the compiler arguments used to configure itself matching the build environment. - -For example, if the compiler arguments request AVX code generation, GLM will rely on its code path providing AVX optimizations when available. - -We can change GLM configuration using specific C++ preprocessor defines that must be declared before including any GLM headers. - -Using `GLM_FORCE_MESSAGES`, GLM will report the configuration as part of the build log. - -```cpp -#define GLM_FORCE_MESSAGES // Or defined when building (e.g. -DGLM_FORCE_SWIZZLE) -#include -``` - -Example of configuration log generated by `GLM_FORCE_MESSAGES`: -```cpp -GLM: version 0.9.9.1 -GLM: C++ 17 with extensions -GLM: Clang compiler detected -GLM: x86 64 bits with AVX instruction set build target -GLM: Linux platform detected -GLM: GLM_FORCE_SWIZZLE is undefined. swizzling functions or operators are disabled. -GLM: GLM_FORCE_SIZE_T_LENGTH is undefined. .length() returns a glm::length_t, a typedef of int following GLSL. -GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is undefined. Follows strictly GLSL on valid function genTypes. -GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is undefined. Using negative one to one depth clip space. -GLM: GLM_FORCE_LEFT_HANDED is undefined. Using right handed coordinate system. -``` - -The following subsections describe each configurations and defines. - -### 2.2. GLM\_FORCE\_PLATFORM\_UNKNOWN: Force GLM to no detect the build platform - -`GLM_FORCE_PLATFORM_UNKNOWN` prevents GLM from detecting the build platform. - -### 2.3. GLM\_FORCE\_COMPILER\_UNKNOWN: Force GLM to no detect the C++ compiler - -`GLM_FORCE_COMPILER_UNKNOWN` prevents GLM from detecting the C++ compiler. - -### 2.4. GLM\_FORCE\_ARCH\_UNKNOWN: Force GLM to no detect the build architecture - -`GLM_FORCE_ARCH_UNKNOWN` prevents GLM from detecting the build target architecture. - -### 2.5. GLM\_FORCE\_CXX\_UNKNOWN: Force GLM to no detect the C++ standard - -`GLM_FORCE_CSS_UNKNOWN` prevents GLM from detecting the C++ compiler standard support. - -### 2.6. GLM\_FORCE\_CXX**: C++ language detection - -GLM will automatically take advantage of compilers’ language extensions when enabled. To increase cross platform compatibility and to avoid compiler extensions, a programmer can define `GLM_FORCE_CXX98` before -any inclusion of `` to restrict the language feature set C++98: - -```cpp -#define GLM_FORCE_CXX98 -#include -``` - -For C++11, C++14, and C++17 equivalent defines are available: -* `GLM_FORCE_CXX11` -* `GLM_FORCE_CXX14` -* `GLM_FORCE_CXX17` - -```cpp -#define GLM_FORCE_CXX11 -#include - -// If the compiler doesn’t support C++11, compiler errors will happen. -``` - -`GLM_FORCE_CXX17` overrides `GLM_FORCE_CXX14`; `GLM_FORCE_CXX14` overrides `GLM_FORCE_CXX11`; and `GLM_FORCE_CXX11` overrides `GLM_FORCE_CXX98` defines. - -### 2.7. GLM\_FORCE\_EXPLICIT\_CTOR: Requiring explicit conversions - -GLSL supports implicit conversions of vector and matrix types. For example, an ivec4 can be implicitly converted into `vec4`. - -Often, this behaviour is not desirable but following the spirit of the library, this is the default behavior in GLM. However, GLM 0.9.6 introduced the define `GLM_FORCE_EXPLICIT_CTOR` to require explicit conversion for GLM types. - -```cpp -#include - -void foo() -{ - glm::ivec4 a; - ... - - glm::vec4 b(a); // Explicit conversion, OK - glm::vec4 c = a; // Implicit conversion, OK - ... -} -``` - -With `GLM_FORCE_EXPLICIT_CTOR` define, implicit conversions are not allowed: - -```cpp -#define GLM_FORCE_EXPLICIT_CTOR -#include - -void foo() -{ - glm::ivec4 a; - { - glm::vec4 b(a); // Explicit conversion, OK - glm::vec4 c = a; // Implicit conversion, ERROR - ... -} -``` - -### 2.8. GLM\_FORCE\_INLINE: Force inline - -To push further the software performance, a programmer can define `GLM_FORCE_INLINE` before any inclusion of `` to force the compiler to inline GLM code. - -```cpp -#define GLM_FORCE_INLINE -#include -``` - -### 2.9. GLM\_FORCE\_ALIGNED\_GENTYPES: Force GLM to enable aligned types - -Every object type has the property called alignment requirement, which is an integer value (of type `std::size_t`, always a power of 2) representing the number of bytes between successive addresses at which objects of this type can be allocated. The alignment requirement of a type can be queried with alignof or `std::alignment_of`. The pointer alignment function `std::align` can be used to obtain a suitably-aligned pointer within some buffer, and `std::aligned_storage` can be used to obtain suitably-aligned storage. - -Each object type imposes its alignment requirement on every object of that type; stricter alignment (with larger alignment requirement) can be requested using C++11 `alignas`. - -In order to satisfy alignment requirements of all non-static members of a class, padding may be inserted after some of its members. - -GLM supports both packed and aligned types. Packed types allow filling data structure without inserting extra padding. Aligned GLM types align addresses based on the size of the value type of a GLM type. - -```cpp -#define GLM_FORCE_ALIGNED_GENTYPES -#include -#include - -typedef glm::aligned_vec4 vec4a; -typedef glm::packed_vec4 vec4p; -``` - -### 2.10. GLM\_FORCE\_DEFAULT\_ALIGNED\_GENTYPES: Force GLM to use aligned types by default - -GLM allows using aligned types by default for vector types using `GLM_FORCE_DEFAULT_ALIGNED_GENTYPES`: - -```cpp -#define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES -#include - -struct MyStruct -{ - glm::vec4 a; - float b; - glm::vec3 c; -}; - -void foo() -{ - printf("MyStruct requires memory padding: %d bytes\n", sizeof(MyStruct)); -} - ->>> MyStruct requires memory padding: 48 bytes -``` - -```cpp -#include - -struct MyStruct -{ - glm::vec4 a; - float b; - glm::vec3 c; -}; - -void foo() -{ - printf("MyStruct is tightly packed: %d bytes\n", sizeof(MyStruct)); -} - ->>> MyStruct is tightly packed: 32 bytes -``` - -*Note: GLM SIMD optimizations require the use of aligned types* - -### 2.11. GLM\_FORCE\_INTRINSICS: Using SIMD optimizations - -GLM provides some SIMD optimizations based on [compiler intrinsics](https://msdn.microsoft.com/en-us/library/26td21ds.aspx). -These optimizations will be automatically thanks to compiler arguments when `GLM_FORCE_INTRINSICS` is defined before including GLM files. -For example, if a program is compiled with Visual Studio using `/arch:AVX`, GLM will detect this argument and generate code using AVX instructions automatically when available. - -It’s possible to avoid the instruction set detection by forcing the use of a specific instruction set with one of the fallowing define: -`GLM_FORCE_SSE2`, `GLM_FORCE_SSE3`, `GLM_FORCE_SSSE3`, `GLM_FORCE_SSE41`, `GLM_FORCE_SSE42`, `GLM_FORCE_AVX`, `GLM_FORCE_AVX2` or `GLM_FORCE_AVX512`. - -The use of intrinsic functions by GLM implementation can be avoided using the define `GLM_FORCE_PURE` before any inclusion of GLM headers. This can be particularly useful if we want to rely on C++14 `constexpr`. - -```cpp -#define GLM_FORCE_PURE -#include - -static_assert(glm::vec4::length() == 4, "Using GLM C++ 14 constexpr support for compile time tests"); - -// GLM code will be compiled using pure C++ code without any intrinsics -``` - -```cpp -#define GLM_FORCE_SIMD_AVX2 -#include - -// If the compiler doesn’t support AVX2 instrinsics, compiler errors will happen. -``` - -Additionally, GLM provides a low level SIMD API in glm/simd directory for users who are really interested in writing fast algorithms. - -### 2.12. GLM\_FORCE\_PRECISION\_**: Default precision - -C++ does not provide a way to implement GLSL default precision selection (as defined in GLSL 4.10 specification section 4.5.3) with GLSL-like syntax. - -```glsl -precision mediump int; -precision highp float; -``` - -To use the default precision functionality, GLM provides some defines that need to added before any include of `glm.hpp`: - -```cpp -#define GLM_FORCE_PRECISION_MEDIUMP_INT -#define GLM_FORCE_PRECISION_HIGHP_FLOAT -#include -``` - -Available defines for floating point types (`glm::vec\*`, `glm::mat\*`): - -* `GLM_FORCE_PRECISION_LOWP_FLOAT`: Low precision -* `GLM_FORCE_PRECISION_MEDIUMP_FLOAT`: Medium precision -* `GLM_FORCE_PRECISION_HIGHP_FLOAT`: High precision (default) - -Available defines for floating point types (`glm::dvec\*`, `glm::dmat\*`): - -* `GLM_FORCE_PRECISION_LOWP_DOUBLE`: Low precision -* `GLM_FORCE_PRECISION_MEDIUMP_DOUBLE`: Medium precision -* `GLM_FORCE_PRECISION_HIGHP_DOUBLE`: High precision (default) - -Available defines for signed integer types (`glm::ivec\*`): - -* `GLM_FORCE_PRECISION_LOWP_INT`: Low precision -* `GLM_FORCE_PRECISION_MEDIUMP_INT`: Medium precision -* `GLM_FORCE_PRECISION_HIGHP_INT`: High precision (default) - -Available defines for unsigned integer types (`glm::uvec\*`): - -* `GLM_FORCE_PRECISION_LOWP_UINT`: Low precision -* `GLM_FORCE_PRECISION_MEDIUMP_UINT`: Medium precision -* `GLM_FORCE_PRECISION_HIGHP_UINT`: High precision (default) - -### 2.13. GLM\_FORCE\_SINGLE\_ONLY: Removed explicit 64-bits floating point types - -Some platforms (Dreamcast) doesn't support double precision floating point values. To compile on such platforms, GCC has the `--m4-single-only` build argument. When defining `GLM_FORCE_SINGLE_ONLY` before including GLM headers, GLM releases the requirement of double precision floating point values support. Effectivement, all the float64 types are no longer defined and double behaves like float. - -### 2.14. GLM\_FORCE\_SWIZZLE: Enable swizzle operators - -Shader languages like GLSL often feature so-called swizzle expressions, which may be used to freely select and arrange a vector's components. For example, `variable.x`, `variable.xzy` and `variable.zxyy` respectively form a scalar, a 3D vector and a 4D vector. The result of a swizzle expression in GLSL can be either an R-value or an L-value. Swizzle expressions can be written with characters from exactly one of `xyzw` (usually for positions), `rgba` (usually for colors), and `stpq` (usually for texture coordinates). - -```glsl -vec4 A; -vec2 B; - -B.yx = A.wy; -B = A.xx; -vec3 C = A.bgr; -vec3 D = B.rsz; // Invalid, won't compile -``` - -GLM supports some of this functionality. Swizzling can be enabled by defining `GLM_FORCE_SWIZZLE`. - -*Note: Enabling swizzle expressions will massively increase the size of your binaries and the time it takes to compile them!* - -GLM has two levels of swizzling support described in the following subsections. - -#### 2.14.1. Swizzle functions for standard C++ 98 - -When compiling GLM as C++98, R-value swizzle expressions are simulated through member functions of each vector type. - -```cpp -#define GLM_FORCE_SWIZZLE // Or defined when building (e.g. -DGLM_FORCE_SWIZZLE) -#include - -void foo() -{ - glm::vec4 const ColorRGBA = glm::vec4(1.0f, 0.5f, 0.0f, 1.0f); - glm::vec3 const ColorBGR = ColorRGBA.bgr(); - - glm::vec3 const PositionA = glm::vec3(1.0f, 0.5f, 0.0f); - glm::vec3 const PositionB = PositionXYZ.xyz() * 2.0f; - - glm::vec2 const TexcoordST = glm::vec2(1.0f, 0.5f); - glm::vec4 const TexcoordSTPQ = TexcoordST.stst(); -} -``` - -Swizzle operators return a **copy** of the component values, and thus *can't* be used as L-values to change a vector's values. - -```cpp -#define GLM_FORCE_SWIZZLE -#include - -void foo() -{ - glm::vec3 const A = glm::vec3(1.0f, 0.5f, 0.0f); - - // No compiler error, but A is not modified. - // An anonymous copy is being modified (and then discarded). - A.bgr() = glm::vec3(2.0f, 1.5f, 1.0f); // A is not modified! -} -``` - -#### 2.14.2. Swizzle operations for C++ 98 with language extensions - -Visual C++, GCC and Clang support, as a _non-standard language extension_, anonymous `struct`s as `union` members. This permits a powerful swizzling implementation that both allows L-value swizzle expressions and GLSL-like syntax. To use this feature, the language extension must be enabled by a supporting compiler and `GLM_FORCE_SWIZZLE` must be `#define`d. - -```cpp -#define GLM_FORCE_SWIZZLE -#include - -// Only guaranteed to work with Visual C++! -// Some compilers that support Microsoft extensions may compile this. -void foo() -{ - glm::vec4 ColorRGBA = glm::vec4(1.0f, 0.5f, 0.0f, 1.0f); - - // l-value: - glm::vec4 ColorBGRA = ColorRGBA.bgra; - - // r-value: - ColorRGBA.bgra = ColorRGBA; - - // Both l-value and r-value - ColorRGBA.bgra = ColorRGBA.rgba; -} -``` - -This version returns implementation-specific objects that _implicitly convert_ to their respective vector types. As a consequence of this design, these extra types **can't be directly used** as C++ function arguments; they must be converted through constructors or `operator()`. - -```cpp -#define GLM_FORCE_SWIZZLE -#include - -using namespace glm; - -void foo() -{ - vec4 Color = vec4(1.0f, 0.5f, 0.0f, 1.0f); - - // Generates compiler errors. Color.rgba is not a vector type. - vec4 ClampedA = clamp(Color.rgba, 0.f, 1.f); // ERROR - - // Explicit conversion through a constructor - vec4 ClampedB = clamp(vec4(Color.rgba), 0.f, 1.f); // OK - - // Explicit conversion through operator() - vec4 ClampedC = clamp(Color.rgba(), 0.f, 1.f); // OK -} -``` - -*Note: The implementation has a caveat: Swizzle operator types must be different on both size of the equal operator or the operation will fail. There is no known fix for this issue to date* - -### 2.15. GLM\_FORCE\_XYZW\_ONLY: Only exposes x, y, z and w components - -Following GLSL specifications, GLM supports three sets of components to access vector types member: x, y, z, w; r, g, b, a; and s, t, p, q. -Also, this is making vector component very expressive in the code, it may make debugging vector types a little cubersom as the debuggers will typically display three time the values for each compoenents due to the existence of the three sets. - -To simplify vector types, GLM allows exposing only x, y, z and w components thanks to `GLM_FORCE_XYZW_ONLY` define. - -### 2.16. GLM\_FORCE\_LEFT\_HANDED: Force left handed coordinate system - -By default, OpenGL is using a right handed coordinate system. However, others APIs such as Direct3D have done different choice and relies on the left handed coordinate system. - -GLM allows switching the coordinate system to left handed by defining `GLM_FORCE_LEFT_HANDED`. - -### 2.17. GLM\_FORCE\_DEPTH\_ZERO\_TO\_ONE: Force the use of a clip space between 0 to 1 - -By default, OpenGL is using a -1 to 1 clip space in Z-axis. However, others APIs such as Direct3D relies on a clip space between 0 to 1 in Z-axis. - -GLM allows switching the clip space in Z-axis to 0 to 1 by defining `GLM_FORCE_DEPTH_ZERO_TO_ONE`. - -### 2.18. GLM\_FORCE\_SIZE\_T\_LENGTH: Vector and matrix static size - -GLSL supports the member function .length() for all vector and matrix types. - -```cpp -#include - -void foo(vec4 const& v) -{ - int Length = v.length(); - ... -} -``` - -This function returns an `int` however this function typically interacts with STL `size_t` based code. GLM provides `GLM_FORCE_SIZE_T_LENGTH` pre-processor configuration so that member functions `length()` return a `size_t`. - -Additionally, GLM defines the type `glm::length_t` to identify `length()` returned type, independently from `GLM_FORCE_SIZE_T_LENGTH`. - -```cpp -#define GLM_FORCE_SIZE_T_LENGTH -#include - -void foo(vec4 const& v) -{ - glm::length_t Length = v.length(); - ... -} -``` - -### 2.19. GLM\_FORCE\_UNRESTRICTED\_GENTYPE: Removing genType restriction - -GLSL has restrictions on types supported by certain functions that may appear excessive. -By default, GLM follows the GLSL specification as accurately as possible however it's possible to relax these rules using `GLM_FORCE_UNRESTRICTED_GENTYPE` define. - -```cpp -#include - -float average(float const A, float const B) -{ - return glm::mix(A, B, 0.5f); // By default glm::mix only supports floating-point types -} -``` - -By defining GLM\_FORCE\_UNRESTRICTED\_GENTYPE, we allow using integer types: - -```cpp -#define GLM_FORCE_UNRESTRICTED_GENTYPE -#include - -int average(int const A, int const B) -{ - return glm::mix(A, B, 0.5f); // integers are ok thanks to GLM_FORCE_UNRESTRICTED_GENTYPE -} -``` - -### 2.20. GLM\_FORCE\_SILENT\_WARNINGS: Silent C++ warnings from language extensions - -When using /W4 on Visual C++ or -Wpedantic on GCC, for example, the compilers will generate warnings for using C++ language extensions (/Za with Visual C++) such as anonymous struct. -GLM relies on anonymous structs for swizzle operators and aligned vector types. To silent those warnings define `GLM_FORCE_SILENT_WARNINGS` before including GLM headers. - - -### 2.21. GLM\_FORCE\_QUAT\_DATA\_WXYZ: Force GLM to store quat data as w,x,y,z instead of x,y,z,w - -By default GLM store quaternion components with the x, y, z, w order. `GLM_FORCE_QUAT_DATA_WXYZ` allows switching the quaternion data storage to the w, x, y, z order. - ---- -
- -## 3. Stable extensions - -### 3.1. Scalar types - -#### 3.1.1. GLM_EXT_scalar_int_sized - -This extension exposes sized and signed integer types. - -Include `` to use these features. - -#### 3.1.2. GLM_EXT_scalar_uint_sized - -This extension exposes sized and unsigned integer types. - -```cpp -#include - -glm::uint64 pack(glm::uint32 A, glm::uint16 B, glm::uint8 C, glm::uint8 D) -{ - glm::uint64 ShiftA = 0; - glm::uint64 ShiftB = sizeof(glm::uint32) * 8; - glm::uint64 ShiftC = (sizeof(glm::uint32) + sizeof(glm::uint16)) * 8; - glm::uint64 ShiftD = (sizeof(glm::uint32) + sizeof(glm::uint16) + sizeof(glm::uint8)) * 8; - return (glm::uint64(A) << ShiftA) | (glm::uint64(B) << ShiftB) | (glm::uint64(C) << ShiftC) | (glm::uint64(D) << ShiftD); -} -``` - -Include `` to use these features. - -### 3.2. Scalar functions - -#### 3.2.1. GLM_EXT_scalar_common - -This extension exposes support for `min` and `max` functions taking more than two scalar arguments. Also, it adds `fmin` and `fmax` variants which prevents `NaN` propagation. - -```cpp -#include - -float positiveMax(float const a, float const b) -{ - return glm::fmax(a, b, 0.0f); -} -``` - -Include `` to use these features. - -#### 3.2.2. GLM_EXT_scalar_relational - -This extension exposes `equal` and `notEqual` scalar variants which takes an epsilon argument. - -```cpp -#include - -bool epsilonEqual(float const a, float const b) -{ - float const CustomEpsilon = 0.0001f; - return glm::equal(a, b, CustomEpsilon); -} -``` - -Include `` to use these features. - -#### 3.2.3. GLM_EXT_scalar_constants - -This extension exposes useful constants such as `epsilon` and `pi`. - -```cpp -#include - -float circumference(float const Diameter) -{ - return glm::pi() * Diameter; -} -``` - -```cpp -#include // abs -#include // epsilon - -bool equalULP1(float const a, float const b) -{ - return glm::abs(a - b) <= glm::epsilon(); -} -``` - -Include `` to use these features. - -#### 3.2.4. GLM_EXT_scalar_ulp - -This extension exposes function that measure of accuracy in numeric calculations. - -```cpp -#include - -bool test_ulp(float x) -{ - float const a = glm::next_float(x); // return a float a ULP away from the float argument. - return float_distance(a, x) == 1; // check both float are a single ULP away. -} -``` - -Include `` to use these features. - -### 3.3. Vector types - -#### 3.3.1. GLM_EXT_vector_float1 - -This extension exposes single-precision floating point vector with 1 component: `vec1`. - -Include `` to use these features. - -#### 3.3.2. GLM_EXT_vector_float2 - -This extension exposes single-precision floating point vector with 2 components: `vec2`. - -Include `` to use these features. - -#### 3.3.3. GLM_EXT_vector_float3 - -This extension exposes single-precision floating point vector with 3 components: `vec3`. - -Include `` to use these features. - -#### 3.3.4. GLM_EXT_vector_float4 - -This extension exposes single-precision floating point vector with 4 components: `vec4`. - -Include `` to use these features. - -#### 3.3.5. GLM_EXT_vector_double1 - -This extension exposes double-precision floating point vector with 1 component: `dvec1`. - -Include `` to use these features. - -#### 3.3.6. GLM_EXT_vector_double2 - -This extension exposes double-precision floating point vector with 2 components: `dvec2`. - -Include `` to use these features. - -#### 3.3.7. GLM_EXT_vector_double3 - -This extension exposes double-precision floating point vector with 3 components: `dvec3`. - -Include `` to use these features. - -#### 3.3.8. GLM_EXT_vector_double4 - -This extension exposes double-precision floating point vector with 4 components: `dvec4`. - -Include `` to use these features. - -#### 3.3.9. GLM_EXT_vector_int1 - -This extension exposes signed integer vector with 1 component: `ivec1`. - -Include `` to use these features. - -#### 3.3.10. GLM_EXT_vector_int2 - -This extension exposes signed integer vector with 2 components: `ivec2`. - -Include `` to use these features. - -#### 3.3.11. GLM_EXT_vector_int3 - -This extension exposes signed integer vector with 3 components: `ivec3`. - -Include `` to use these features. - -#### 3.3.12. GLM_EXT_vector_int4 - -This extension exposes signed integer vector with 4 components: `ivec4`. - -Include `` to use these features. - -#### 3.3.13. GLM_EXT_vector_int1 - -This extension exposes unsigned integer vector with 1 component: `uvec1`. - -Include `` to use these features. - -#### 3.3.14. GLM_EXT_vector_uint2 - -This extension exposes unsigned integer vector with 2 components: `uvec2`. - -Include `` to use these features. - -#### 3.3.15. GLM_EXT_vector_uint3 - -This extension exposes unsigned integer vector with 3 components: `uvec3`. - -Include `` to use these features. - -#### 3.3.16. GLM_EXT_vector_uint4 - -This extension exposes unsigned integer vector with 4 components: `uvec4`. - -Include `` to use these features. - -#### 3.3.17. GLM_EXT_vector_bool1 - -This extension exposes boolean vector with 1 component: `bvec1`. - -Include `` to use these features. - -#### 3.3.18. GLM_EXT_vector_bool2 - -This extension exposes boolean vector with 2 components: `bvec2`. - -Include `` to use these features. - -#### 3.3.19. GLM_EXT_vector_bool3 - -This extension exposes boolean vector with 3 components: `bvec3`. - -Include `` to use these features. - -#### 3.3.20. GLM_EXT_vector_bool4 - -This extension exposes boolean vector with 4 components: `bvec4`. - -Include `` to use these features. - -### 3.4. Vector types with precision qualifiers - -#### 3.4.1. GLM_EXT_vector_float1_precision - -This extension exposes single-precision floating point vector with 1 component using various precision in term of ULPs: `lowp_vec1`, `mediump_vec1` and `highp_vec1`. - -Include `` to use these features. - -#### 3.4.2. GLM_EXT_vector_float2_precision - -This extension exposes single-precision floating point vector with 2 components using various precision in term of ULPs: `lowp_vec2`, `mediump_vec2` and `highp_vec2`. - -Include `` to use these features. - -#### 3.4.3. GLM_EXT_vector_float3_precision - -This extension exposes single-precision floating point vector with 3 components using various precision in term of ULPs: `lowp_vec3`, `mediump_vec3` and `highp_vec3`. - -Include `` to use these features. - -#### 3.4.4. GLM_EXT_vector_float4_precision - -This extension exposes single-precision floating point vector with 4 components using various precision in term of ULPs: `lowp_vec4`, `mediump_vec4` and `highp_vec4`. - -Include `` to use these features. - -#### 3.4.5. GLM_EXT_vector_double1_precision - -This extension exposes double-precision floating point vector with 1 component using various precision in term of ULPs: `lowp_dvec1`, `mediump_dvec1` and `highp_dvec1`. - -Include `` to use these features. - -#### 3.4.6. GLM_EXT_vector_double2_precision - -This extension exposes double-precision floating point vector with 2 components using various precision in term of ULPs: `lowp_dvec2`, `mediump_dvec2` and `highp_dvec2`. - -Include `` to use these features. - -#### 3.4.7. GLM_EXT_vector_double3_precision - -This extension exposes double-precision floating point vector with 3 components using various precision in term of ULPs: `lowp_dvec3`, `mediump_dvec3` and `highp_dvec3`. - -Include `` to use these features. - -#### 3.4.8. GLM_EXT_vector_double4_precision - -This extension exposes double-precision floating point vector with 4 components using various precision in term of ULPs: `lowp_dvec4`, `mediump_dvec4` and `highp_dvec4`. - -Include `` to use these features. - -### 3.5. Vector functions - -#### 3.5.1. GLM_EXT_vector_common - -This extension exposes support for `min` and `max` functions taking more than two vector arguments. Also, it adds `fmin` and `fmax` variants which prevents `NaN` propagation. - -```cpp -#include // vec2 -#include // fmax - -float positiveMax(float const a, float const b) -{ - return glm::fmax(a, b, 0.0f); -} -``` - -Include `` to use these features. - -#### 3.5.2. GLM_EXT_vector_relational - -This extension exposes `equal` and `notEqual` vector variants which takes an epsilon argument. - -```cpp -#include // vec2 -#include // equal, all - -bool epsilonEqual(glm::vec2 const& A, glm::vec2 const& B) -{ - float const CustomEpsilon = 0.0001f; - return glm::all(glm::equal(A, B, CustomEpsilon)); -} -``` - -Include `` to use these features. - -#### 3.5.3. GLM_EXT_vector_ulp - -This extension exposes function that measure of accuracy in numeric calculations. - -```cpp -#include -#include -#include - -bool test_ulp(glm::vec4 const& x) -{ - glm::vec4 const a = glm::next_float(x); // return a float a ULP away from the float argument. - return glm::all(float_distance(a, x) == glm::ivec4(1)); // check both float are a single ULP away. -} -``` - -Include `` to use these features. - -### 3.6. Matrix types - -#### 3.6.1. GLM_EXT_matrix_float2x2 - -This extension exposes single-precision floating point vector with 2 columns by 2 rows: `mat2x2`. - -Include `` to use these features. - -#### 3.6.2. GLM_EXT_matrix_float2x3 - -This extension exposes single-precision floating point vector with 2 columns by 3 rows: `mat2x3`. - -Include `` to use these features. - -#### 3.6.3. GLM_EXT_matrix_float2x4 - -This extension exposes single-precision floating point vector with 2 columns by 4 rows: `mat2x4`. - -Include `` to use these features. - -#### 3.6.4. GLM_EXT_matrix_float3x2 - -This extension exposes single-precision floating point vector with 3 columns by 2 rows: `mat3x2`. - -Include `` to use these features. - -#### 3.6.5. GLM_EXT_matrix_float3x3 - -This extension exposes single-precision floating point vector with 3 columns by 3 rows: `mat3x3`. - -Include `` to use these features. - -#### 3.6.6. GLM_EXT_matrix_float3x4 - -This extension exposes single-precision floating point vector with 3 columns by 4 rows: `mat3x4`. - -Include `` to use these features. - -#### 3.6.7. GLM_EXT_matrix_float4x2 - -This extension exposes single-precision floating point vector with 4 columns by 2 rows: `mat4x2`. - -Include `` to use these features. - -#### 3.6.8. GLM_EXT_matrix_float4x3 - -This extension exposes single-precision floating point vector with 4 columns by 3 rows: `mat4x3`. - -Include `` to use these features. - -#### 3.6.9. GLM_EXT_matrix_float4x4 - -This extension exposes single-precision floating point vector with 4 columns by 4 rows: `mat4x4`. - -Include `` to use these features. - -#### 3.6.10. GLM_EXT_matrix_double2x2 - -This extension exposes double-precision floating point vector with 2 columns by 2 rows: `dmat2x2`. - -Include `` to use these features. - -#### 3.6.11. GLM_EXT_matrix_double2x3 - -This extension exposes double-precision floating point vector with 2 columns by 3 rows: `dmat2x3`. - -Include `` to use these features. - -#### 3.6.12. GLM_EXT_matrix_double2x4 - -This extension exposes double-precision floating point vector with 2 columns by 4 rows: `dmat2x4`. - -Include `` to use these features. - -#### 3.6.13. GLM_EXT_matrix_double3x2 - -This extension exposes double-precision floating point vector with 3 columns by 2 rows: `dmat3x2`. - -Include `` to use these features. - -#### 3.6.14. GLM_EXT_matrix_double3x3 - -This extension exposes double-precision floating point vector with 3 columns by 3 rows: `dmat3x3`. - -Include `` to use these features. - -#### 3.6.15. GLM_EXT_matrix_double3x4 - -This extension exposes double-precision floating point vector with 3 columns by 4 rows: `dmat3x4`. - -Include `` to use these features. - -#### 3.6.16. GLM_EXT_matrix_double4x2 - -This extension exposes double-precision floating point vector with 4 columns by 2 rows: `dmat4x2`. - -Include `` to use these features. - -#### 3.6.17. GLM_EXT_matrix_double4x3 - -This extension exposes double-precision floating point vector with 4 columns by 3 rows: `dmat4x3`. - -Include `` to use these features. - -#### 3.6.18. GLM_EXT_matrix_double4x4 - -This extension exposes double-precision floating point vector with 4 columns by 4 rows: `dmat4x4`. - -Include `` to use these features. - -### 3.7. Matrix types with precision qualifiers - -#### 3.7.1. GLM_EXT_matrix_float2x2_precision - -This extension exposes single-precision floating point vector with 2 columns by 2 rows using various precision in term of ULPs: `lowp_mat2x2`, `mediump_mat2x2` and `highp_mat2x2`. - -Include `` to use these features. - -#### 3.7.2. GLM_EXT_matrix_float2x3_precision - -This extension exposes single-precision floating point vector with 2 columns by 3 rows using various precision in term of ULPs: `lowp_mat2x3`, `mediump_mat2x3` and `highp_mat2x3`. - -Include `` to use these features. - -#### 3.7.3. GLM_EXT_matrix_float2x4_precision - -This extension exposes single-precision floating point vector with 2 columns by 4 rows using various precision in term of ULPs: `lowp_mat2x4`, `mediump_mat2x4` and `highp_mat2x4`. - -Include `` to use these features. - -#### 3.7.4. GLM_EXT_matrix_float3x2_precision - -This extension exposes single-precision floating point vector with 3 columns by 2 rows using various precision in term of ULPs: `lowp_mat3x2`, `mediump_mat3x2` and `highp_mat3x2`. - -Include `` to use these features. - -#### 3.7.5. GLM_EXT_matrix_float3x3_precision - -This extension exposes single-precision floating point vector with 3 columns by 3 rows using various precision in term of ULPs: `lowp_mat3x3`, `mediump_mat3x3` and `highp_mat3x3`. - -Include `` to use these features. - -#### 3.7.6. GLM_EXT_matrix_float3x4_precision - -This extension exposes single-precision floating point vector with 3 columns by 4 rows using various precision in term of ULPs: `lowp_mat3x4`, `mediump_mat3x4` and `highp_mat3x4`. - -Include `` to use these features. - -#### 3.7.7. GLM_EXT_matrix_float4x2_precision - -This extension exposes single-precision floating point vector with 4 columns by 2 rows using various precision in term of ULPs: `lowp_mat4x2`, `mediump_mat4x2` and `highp_mat4x2`. - -Include `` to use these features. - -#### 3.7.8. GLM_EXT_matrix_float4x3_precision - -This extension exposes single-precision floating point vector with 4 columns by 3 rows using various precision in term of ULPs: `lowp_mat4x3`, `mediump_mat4x3` and `highp_mat4x3`. - -Include `` to use these features. - -#### 3.7.9. GLM_EXT_matrix_float4x4_precision - -This extension exposes single-precision floating point vector with 4 columns by 4 rows using various precision in term of ULPs: `lowp_mat4x4`, `mediump_mat4x4` and `highp_mat4x4`. - -Include `` to use these features. - -#### 3.7.10. GLM_EXT_matrix_double2x2_precision - -This extension exposes double-precision floating point vector with 2 columns by 2 rows using various precision in term of ULPs: `lowp_dmat2x2`, `mediump_dmat2x2` and `highp_dmat2x2`. - -Include `` to use these features. - -#### 3.7.11. GLM_EXT_matrix_double2x3_precision - -This extension exposes double-precision floating point vector with 2 columns by 3 rows using various precision in term of ULPs: `lowp_dmat2x3`, `mediump_dmat2x3` and `highp_dmat2x3`. - -Include `` to use these features. - -#### 3.7.12. GLM_EXT_matrix_double2x4_precision - -This extension exposes double-precision floating point vector with 2 columns by 4 rows using various precision in term of ULPs: `lowp_dmat2x4`, `mediump_dmat2x4` and `highp_dmat2x4`. - -Include `` to use these features. - -#### 3.7.13. GLM_EXT_matrix_double3x2_precision - -This extension exposes double-precision floating point vector with 3 columns by 2 rows using various precision in term of ULPs: `lowp_dmat3x2`, `mediump_dmat3x2` and `highp_dmat3x2`. - -Include `` to use these features. - -#### 3.7.14. GLM_EXT_matrix_double3x3_precision - -This extension exposes double-precision floating point vector with 3 columns by 3 rows using various precision in term of ULPs: `lowp_dmat3x3`, `mediump_dmat3x3` and `highp_dmat3x3`. - -Include `` to use these features. - -#### 3.7.15. GLM_EXT_matrix_double3x4_precision - -This extension exposes double-precision floating point vector with 3 columns by 4 rows using various precision in term of ULPs: `lowp_dmat3x4`, `mediump_dmat3x4` and `highp_dmat3x4`. - -Include `` to use these features. - -#### 3.7.16. GLM_EXT_matrix_double4x2_precision - -This extension exposes double-precision floating point vector with 4 columns by 2 rows using various precision in term of ULPs: `lowp_dmat4x2`, `mediump_dmat4x2` and `highp_dmat4x2`. - -Include `` to use these features. - -#### 3.7.17. GLM_EXT_matrix_double4x3_precision - -This extension exposes double-precision floating point vector with 4 columns by 3 rows using various precision in term of ULPs: `lowp_dmat4x3`, `mediump_dmat4x3` and `highp_dmat4x3`. - -Include `` to use these features. - -#### 3.7.18. GLM_EXT_matrix_double4x4_precision - -This extension exposes double-precision floating point vector with 4 columns by 4 rows using various precision in term of ULPs: `lowp_dmat4x4`, `mediump_dmat4x4` and `highp_dmat4x4`. - -Include `` to use these features. - -### 3.8. Matrix functions - -#### 3.8.1. GLM_EXT_matrix_relational - -This extension exposes `equal` and `notEqual` matrix variants which takes an optional epsilon argument. - -```cpp -#include // bvec4 -#include // mat4 -#include // equal, all - -bool epsilonEqual(glm::mat4 const& A, glm::mat4 const& B) -{ - float const CustomEpsilon = 0.0001f; - glm::bvec4 const ColumnEqual = glm::equal(A, B, CustomEpsilon); // Evaluation per column - return glm::all(ColumnEqual); -} -``` - -Include `` to use these features. - -#### 3.8.2. GLM_EXT_matrix_transform - -This extension exposes matrix transformation functions: `translate`, `rotate` and `scale`. - -```cpp -#include // vec2 -#include // vec3 -#include // mat4x4 -#include // translate, rotate, scale, identity - -glm::mat4 computeModelViewMatrix(float Translate, glm::vec2 const & Rotate) -{ - glm::mat4 View = glm::translate(glm::identity(), glm::vec3(0.0f, 0.0f, -Translate)); - View = glm::rotate(View, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f)); - View = glm::rotate(View, Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f)); - glm::mat4 Model = glm::scale(glm::identity(), glm::vec3(0.5f)); - return View * Model; -} -``` - -Include `` to use these features. - -#### 3.8.3. GLM_EXT_matrix_clip_space - -This extension exposes functions to transform scenes into the clip space. - -```cpp -#include // mat4x4 -#include // perspective -#include // radians - -glm::mat4 computeProjection(float Width, float Height) -{ - return glm::perspective(glm::radians(45.0f), Width / Height, 0.1f, 100.f); -} -``` - -Include `` to use these features. - -#### 3.8.4. GLM_EXT_matrix_projection - -This extension exposes functions to map object coordinates into window coordinates and reverse - -Include `` to use these features. - -### 3.9. Quaternion types - -#### 3.9.1. GLM_EXT_quaternion_float - -This extension exposes single-precision floating point quaternion: `quat`. - -Include `` to use these features. - -#### 3.9.2. GLM_EXT_quaternion_double - -This extension exposes double-precision floating point quaternion: `dquat`. - -Include `` to use these features. - -### 3.10. Quaternion types with precision qualifiers - -#### 3.10.1. GLM_EXT_quaternion_float_precision - -This extension exposes single-precision floating point quaternion using various precision in term of ULPs: `lowp_quat`, `mediump_quat` and `highp_quat`. - -Include `` to use these features. - -#### 3.10.2. GLM_EXT_quaternion_double_precision - -This extension exposes double-precision floating point quaternion using various precision in term of ULPs: `lowp_dquat`, `mediump_dquat` and `highp_dquat`. - -Include `` to use these features. - -### 3.11. Quaternion functions - -#### 3.11.1. GLM_EXT_quaternion_common - -This extension exposes common quaternion functions such as `slerp`, `conjugate` and `inverse`. - -Include `` to use these features. - -#### 3.11.2. GLM_EXT_quaternion_geometric - -This extension exposes geometric quaternion functions such as `length`, `normalize`, `dot` and `cross`. - -Include `` to use these features. - -#### 3.11.3. GLM_EXT_quaternion_trigonometric - -This extension exposes trigonometric quaternion functions such as `angle` and `axis`. - -Include `` to use these features. - -#### 3.11.4. GLM_EXT_quaternion_exponential - -This extensions expose exponential functions for quaternions such as `exp`, `log`, `pow` and `sqrt`. - -Include `` to use these features. - -#### 3.11.5. GLM_EXT_quaternion_relational - -This extension exposes relational functions to compare quaternions. - -Include `` to use these features. - -#### 3.11.6. GLM_EXT_quaternion_transform - -This extension exposes functions to transform objects. - -Include `` to use these features. - ---- -
- -## 4. Recommended extensions - -GLM extends the core GLSL feature set with extensions. These extensions include: quaternion, transformation, spline, matrix inverse, color spaces, etc. - -To include an extension, we only need to include the dedicated header file. Once included, the features are added to the GLM namespace. - -```cpp -#include -#include - -int foo() -{ - glm::vec4 Position = glm::vec4(glm:: vec3(0.0f), 1.0f); - glm::mat4 Model = glm::translate(glm::mat4(1.0f), glm::vec3(1.0f)); - - glm::vec4 Transformed = Model * Position; - ... - - return 0; -} -``` - -When an extension is included, all the dependent core functionalities and extensions will be included as well. - -### 4.1. GLM_GTC_bitfield - -Fast bitfield operations on scalar and vector variables. - -`` need to be included to use these features. - -### 4.2. GLM_GTC_color_space - -Conversion between linear RGB and sRGB color spaces. - -`` need to be included to use these features. - -### 4.3. GLM_GTC_constants - -Provide a list of built-in constants. - -`` need to be included to use these features. - -### 4.4. GLM\_GTC\_epsilon - -Approximate equality comparisons for floating-point numbers, possibly with a user-defined epsilon. - -`` need to be included to use these features. - -### 4.5. GLM\_GTC\_integer - -Integer variants of core GLM functions. - -`` need to be included to use these features. - -### 4.6. GLM\_GTC\_matrix\_access - -Functions to conveniently access the individual rows or columns of a matrix. - -`` need to be included to use these features. - -### 4.7. GLM\_GTC\_matrix\_integer - -Integer matrix types similar to the core floating-point matrices. Some operations (such as inverse and determinant) are not supported. - -`` need to be included to use these features. - -### 4.8. GLM\_GTC\_matrix\_inverse - -Additional matrix inverse functions. - -`` need to be included to use these features. - -### 4.9. GLM\_GTC\_matrix\_transform - -Matrix transformation functions that follow the OpenGL fixed-function conventions. - -For example, the `lookAt` function generates a transformation matrix that projects world coordinates into eye coordinates suitable for projection matrices (e.g. `perspective`, `ortho`). See the OpenGL compatibility specifications for more information about the layout of these generated matrices. - -The matrices generated by this extension use standard OpenGL fixed-function conventions. For example, the `lookAt` function generates a transform from world space into the specific eye space that the -projective matrix functions (`perspective`, `ortho`, etc) are designed to expect. The OpenGL compatibility specifications define the particular layout of this eye space. - -`` need to be included to use these features. - -### 4.10. GLM\_GTC\_noise - -Define 2D, 3D and 4D procedural noise functions. - -<`glm/gtc/noise.hpp>` need to be included to use these features. - -![](/doc/manual/noise-simplex1.jpg) - -Figure 4.10.1: glm::simplex(glm::vec2(x / 16.f, y / 16.f)); - -![](/doc/manual/noise-simplex2.jpg) - -Figure 4.10.2: glm::simplex(glm::vec3(x / 16.f, y / 16.f, 0.5f)); - -![](/doc/manual/noise-simplex3.jpg) - -Figure 4.10.3: glm::simplex(glm::vec4(x / 16.f, y / 16.f, 0.5f, 0.5f)); - -![](/doc/manual/noise-perlin1.jpg) - -Figure 4.10.4: glm::perlin(glm::vec2(x / 16.f, y / 16.f)); - -![](/doc/manual/noise-perlin2.jpg) - -Figure 4.10.5: glm::perlin(glm::vec3(x / 16.f, y / 16.f, 0.5f)); - -![](/doc/manual/noise-perlin3.jpg) - -Figure 4.10.6: glm::perlin(glm::vec4(x / 16.f, y / 16.f, 0.5f, 0.5f))); - -![](/doc/manual/noise-perlin4.png) - -Figure 4.10.7: glm::perlin(glm::vec2(x / 16.f, y / 16.f), glm::vec2(2.0f)); - -![](/doc/manual/noise-perlin5.png) - -Figure 4.10.8: glm::perlin(glm::vec3(x / 16.f, y / 16.f, 0.5f), glm::vec3(2.0f)); - -![](/doc/manual/noise-perlin6.png) - -Figure 4.10.9: glm::perlin(glm::vec4(x / 16.f, y / 16.f, glm::vec2(0.5f)), glm::vec4(2.0f)); - -### 4.11. GLM\_GTC\_packing - -Convert scalar and vector types to and from packed formats, saving space at the cost of precision. However, packing a value into a format that it was previously unpacked from is guaranteed to be lossless. - -`` need to be included to use these features. - -### 4.12. GLM\_GTC\_quaternion - -Quaternions and operations upon thereof. - -`` need to be included to use these features. - -### 4.13. GLM\_GTC\_random - -Probability distributions in up to four dimensions. - -`` need to be included to use these features. - -![](/doc/manual/random-linearrand.png) - -Figure 4.13.1: glm::vec4(glm::linearRand(glm::vec2(-1), glm::vec2(1)), 0, 1); - -![](/doc/manual/random-circularrand.png) - -Figure 4.13.2: glm::vec4(glm::circularRand(1.0f), 0, 1); - -![](/doc/manual/random-sphericalrand.png) - -Figure 4.13.3: glm::vec4(glm::sphericalRand(1.0f), 1); - -![](/doc/manual/random-diskrand.png) - -Figure 4.13.4: glm::vec4(glm::diskRand(1.0f), 0, 1); - -![](/doc/manual/random-ballrand.png) - -Figure 4.13.5: glm::vec4(glm::ballRand(1.0f), 1); - -![](/doc/manual/random-gaussrand.png) - -Figure 4.13.6: glm::vec4(glm::gaussRand(glm::vec3(0), glm::vec3(1)), 1); - -### 4.14. GLM\_GTC\_reciprocal - -Reciprocal trigonometric functions (e.g. secant, cosecant, tangent). - -`` need to be included to use the features of this extension. - -### 4.15. GLM\_GTC\_round - -Various rounding operations and common special cases thereof. - -`` need to be included to use the features of this extension. - -### 4.16. GLM\_GTC\_type\_aligned - -Aligned vector types. - -`` need to be included to use the features of this extension. - -### 4.17. GLM\_GTC\_type\_precision - -Vector and matrix types with defined precisions, e.g. `i8vec4`, which is a 4D vector of signed 8-bit integers. - -`` need to be included to use the features of this extension. - -### 4.18. GLM\_GTC\_type\_ptr - -Facilitate interactions between pointers to basic types (e.g. `float*`) and GLM types (e.g. `mat4`). - -This extension defines an overloaded function, `glm::value_ptr`, which returns a pointer to the memory layout of any GLM vector or matrix (`vec3`, `mat4`, etc.). Matrix types store their values in column-major order. This is useful for uploading data to matrices or for copying data to buffer objects. - -```cpp -// GLM_GTC_type_ptr provides a safe solution: -#include -#include - -void foo() -{ - glm::vec4 v(0.0f); - glm::mat4 m(1.0f); - ... - glVertex3fv(glm::value_ptr(v)) - glLoadMatrixfv(glm::value_ptr(m)); -} - -// Another solution, this one inspired by the STL: -#include - -void foo() -{ - glm::vec4 v(0.0f); - glm::mat4 m(1.0f); - ... - glVertex3fv(&v[0]); - glLoadMatrixfv(&m[0][0]); -} -``` - -*Note: It would be possible to implement [`glVertex3fv`](http://www.opengl.org/sdk/docs/man2/xhtml/glVertex.xml)(glm::vec3(0)) in C++ with the appropriate cast operator that would result as an -implicit cast in this example. However cast operators may produce programs running with unexpected behaviours without build error or any form of notification. * - -`` need to be included to use these features. - -### 4.19. GLM\_GTC\_ulp - -Measure a function's accuracy given a reference implementation of it. This extension works on floating-point data and provides results in [ULP](http://ljk.imag.fr/membres/Carine.Lucas/TPScilab/JMMuller/ulp-toms.pdf). - -`` need to be included to use these features. - -### 4.20. GLM\_GTC\_vec1 - -Add \*vec1 types. - -`` need to be included to use these features. - ---- -
- -## 5. OpenGL interoperability - -### 5.1. GLM replacements for deprecated OpenGL functions - -OpenGL 3.1 specification has deprecated some features that have been removed from OpenGL 3.2 core profile specification. GLM provides some replacement functions. - -[***glRotate{f, d}:***](https://www.opengl.org/sdk/docs/man2/xhtml/glRotate.xml) - -```cpp -glm::mat4 glm::rotate(glm::mat4 const& m, float angle, glm::vec3 const& axis); -glm::dmat4 glm::rotate(glm::dmat4 const& m, double angle, glm::dvec3 const& axis); -``` - -From `GLM_GTC_matrix_transform` extension: <glm/gtc/matrix\_transform.hpp> - -[***glScale{f, d}:***](http://www.opengl.org/sdk/docs/man2/xhtml/glScale.xml) - -```cpp -glm::mat4 glm::scale(glm::mat4 const& m, glm::vec3 const& factors); -glm::dmat4 glm::scale(glm::dmat4 const& m, glm::dvec3 const& factors); -``` - -From `GLM_GTC_matrix_transform` extension: <glm/gtc/matrix\_transform.hpp> - -[***glTranslate{f, d}:***](https://www.opengl.org/sdk/docs/man2/xhtml/glTranslate.xml) - -```cpp -glm::mat4 glm::translate(glm::mat4 const& m, glm::vec3 const& translation); -glm::dmat4 glm::translate(glm::dmat4 const& m, glm::dvec3 const& translation); -``` - -From `GLM_GTC_matrix_transform` extension: <glm/gtc/matrix\_transform.hpp> - -[***glLoadIdentity:***](https://www.opengl.org/sdk/docs/man2/xhtml/glLoadIdentity.xml) - -```cpp -glm::mat4(1.0) or glm::mat4(); -glm::dmat4(1.0) or glm::dmat4(); -``` - -From GLM core library: `` - -[***glMultMatrix{f, d}:***](https://www.opengl.org/sdk/docs/man2/xhtml/glMultMatrix.xml) - -```cpp -glm::mat4() * glm::mat4(); -glm::dmat4() * glm::dmat4(); -``` - -From GLM core library: `` - -[***glLoadTransposeMatrix{f, d}:***](https://www.opengl.org/sdk/docs/man2/xhtml/glLoadTransposeMatrix.xml) - -```cpp -glm::transpose(glm::mat4()); -glm::transpose(glm::dmat4()); -``` - -From GLM core library: `` - -[***glMultTransposeMatrix{f, d}:***](https://www.opengl.org/sdk/docs/man2/xhtml/glMultTransposeMatrix.xml) - -```cpp -glm::mat4() * glm::transpose(glm::mat4()); -glm::dmat4() * glm::transpose(glm::dmat4()); -``` - -From GLM core library: `` - -[***glFrustum:***](http://www.opengl.org/sdk/docs/man2/xhtml/glFrustum.xml) - -```cpp -glm::mat4 glm::frustum(float left, float right, float bottom, float top, float zNear, float zFar); -glm::dmat4 glm::frustum(double left, double right, double bottom, double top, double zNear, double zFar); -``` - -From `GLM_GTC_matrix_transform` extension: `` - -[***glOrtho:***](https://www.opengl.org/sdk/docs/man2/xhtml/glOrtho.xml) - -```cpp -glm::mat4 glm::ortho(float left, float right, float bottom, float top, float zNear, float zFar); -glm::dmat4 glm::ortho(double left, double right, double bottom, double top, double zNear, double zFar); -``` - -From `GLM_GTC_matrix_transform` extension: `` - -### 5.2. GLM replacements for GLU functions - -[***gluLookAt:***](https://www.opengl.org/sdk/docs/man2/xhtml/gluLookAt.xml) - -```cpp -glm::mat4 glm::lookAt(glm::vec3 const& eye, glm::vec3 const& center, glm::vec3 const& up); -glm::dmat4 glm::lookAt(glm::dvec3 const& eye, glm::dvec3 const& center, glm::dvec3 const& up); -``` - -From `GLM_GTC_matrix_transform` extension: `` - -[***gluOrtho2D:***](https://www.opengl.org/sdk/docs/man2/xhtml/gluOrtho2D.xml) - -```cpp -glm::mat4 glm::ortho(float left, float right, float bottom, float top); -glm::dmat4 glm::ortho(double left, double right, double bottom, double top); -``` - -From `GLM_GTC_matrix_transform` extension: `` - -[***gluPerspective:***](https://www.opengl.org/sdk/docs/man2/xhtml/gluPerspective.xml) - -```cpp -glm::mat4 perspective(float fovy, float aspect, float zNear, float zFar); -glm::dmat4 perspective(double fovy, double aspect, double zNear, double zFar); -``` - -Note that in GLM, fovy is expressed in radians, not degrees. - -From `GLM_GTC_matrix_transform` extension: `` - -[***gluPickMatrix:***](https://www.opengl.org/sdk/docs/man2/xhtml/gluPickMatrix.xml) - -```cpp -glm::mat4 pickMatrix(glm::vec2 const& center, glm::vec2 const& delta, glm::ivec4 const& viewport); -glm::dmat4 pickMatrix(glm::dvec2 const& center, glm::dvec2 const& delta, glm::ivec4 const& viewport); -``` - -From `GLM_GTC_matrix_transform` extension: `` - -[***gluProject:***](http://www.opengl.org/sdk/docs/man2/xhtml/gluProject.xml) - -```cpp -glm::vec3 project(glm::vec3 const& obj, glm::mat4 const& model, glm::mat4 const& proj, glm::ivec4 const& viewport); -glm::dvec3 project(glm::dvec3 const& obj, glm::dmat4 const& model, glm::dmat4 const& proj, glm::ivec4 const& viewport); -``` - -From `GLM_GTC_matrix_transform` extension: `` - -[***gluUnProject:***](https://www.opengl.org/sdk/docs/man2/xhtml/gluUnProject.xml) - -```cpp -glm::vec3 unProject(glm::vec3 const& win, glm::mat4 const& model, glm::mat4 const& proj, glm::ivec4 const& viewport); -glm::dvec3 unProject(glm::dvec3 const& win, glm::dmat4 const& model, glm::dmat4 const& proj, glm::ivec4 const& viewport); -``` - -From `GLM_GTC_matrix_transform` extension: `` - ---- -
- -## 6. Known issues - -This section reports GLSL features that GLM can't accurately emulate due to language restrictions. - -### 6.1. not function - -The GLSL function 'not' is a keyword in C++. To prevent name collisions and ensure a consistent API, the name `not\_` (note the underscore) is used instead. - -### 6.2. Precision qualifiers support - -GLM supports GLSL precision qualifiers through prefixes instead of qualifiers. For example, GLM exposes \verb|lowp_vec4|, \verb|mediump_vec4| and \verb|highp_vec4| as variations of \verb|vec4|. - -Similarly to GLSL, GLM precision qualifiers are used to trade precision of operations in term of [ULPs](http://en.wikipedia.org/wiki/Unit_in_the_last_place) for better performance. By default, all the types use high precision. - -```cpp -// Using precision qualifier in GLSL: - -ivec3 foo(in vec4 v) -{ - highp vec4 a = v; - mediump vec4 b = a; - lowp ivec3 c = ivec3(b); - return c; -} - -// Using precision qualifier in GLM: - -#include - -ivec3 foo(const vec4 & v) -{ - highp_vec4 a = v; - medium_vec4 b = a; - lowp_ivec3 c = glm::ivec3(b); - return c; -} -``` - ---- -
- -## 7. FAQ - -### 7.1 Why GLM follows GLSL specification and conventions? - -Following GLSL conventions is a really strict policy of GLM. It has been designed following the idea that everyone does its own math library with his own conventions. The idea is that brilliant developers (the OpenGL ARB) worked together and agreed to make GLSL. Following GLSL conventions -is a way to find consensus. Moreover, basically when a developer knows GLSL, he knows GLM. - -### 7.2. Does GLM run GLSL program? - -No, GLM is a C++ implementation of a subset of GLSL. - -### 7.3. Does a GLSL compiler build GLM codes? - -No, this is not what GLM attends to do. - -### 7.4. Should I use ‘GTX’ extensions? - -GTX extensions are qualified to be experimental extensions. In GLM this means that these extensions might change from version to version without any restriction. In practice, it doesn’t really change except time to -time. GTC extensions are stabled, tested and perfectly reliable in time. Many GTX extensions extend GTC extensions and provide a way to explore features and implementations and APIs and then are promoted to GTC -extensions. This is fairly the way OpenGL features are developed; through extensions. - -Stating with GLM 0.9.9, to use experimental extensions, an application must define GLM_ENABLE_EXPERIMENTAL. - -### 7.5. Where can I ask my questions? - -A good place is [stackoverflow](http://stackoverflow.com/search?q=GLM) using the GLM tag. - -### 7.6. Where can I find the documentation of extensions? - -The Doxygen generated documentation includes a complete list of all extensions available. Explore this [*API documentation*](http://glm.g-truc.net/html/index.html) to get a complete -view of all GLM capabilities! - -### 7.7. Should I use ‘using namespace glm;’? - -NO! Chances are that if using namespace glm; is called, especially in a header file, name collisions will happen as GLM is based on GLSL which uses common tokens for types and functions. Avoiding using namespace -glm; will a higher compatibility with third party library and SDKs. - -### 7.8. Is GLM fast? - -GLM is mainly designed to be convenient and that's why it is written against the GLSL specification. - -Following the Pareto principle where 20% of the code consumes 80% of the execution time, GLM operates perfectly on the 80% of the code that consumes 20% of the performances. Furthermore, thanks to the lowp, -mediump and highp qualifiers, GLM provides approximations which trade precision for performance. Finally, GLM can automatically produce SIMD optimized code for functions of its implementation. - -However, on performance critical code paths, we should expect that dedicated algorithms should be written to reach peak performance. - -### 7.9. When I build with Visual C++ with /W4 warning level, I have warnings... - -You should not have any warnings even in `/W4` mode. However, if you expect such level for your code, then you should ask for the same level to the compiler by at least disabling the Visual C++ language extensions -(`/Za`) which generates warnings when used. If these extensions are enabled, then GLM will take advantage of them and the compiler will generate warnings. - -### 7.10. Why some GLM functions can crash because of division by zero? - -GLM functions crashing is the result of a domain error. Such behavior follows the precedent set by C and C++'s standard library. For example, it’s a domain error to pass a null vector (all zeroes) to glm::normalize function, or to pass a negative number into std::sqrt. - -### 7.11. What unit for angles is used in GLM? - -GLSL is using radians but GLU is using degrees to express angles. This has caused GLM to use inconsistent units for angles. Starting with GLM 0.9.6, all GLM functions are using radians. For more information, follow -the [link](http://www.g-truc.net/post-0693.html#menu). - -### 7.12. Windows headers cause build errors... - -Some Windows headers define min and max as macros which may cause compatibility with third party libraries such as GLM. -It is highly recommended to [`define NOMINMAX`](http://stackoverflow.com/questions/4913922/possible-problems-with-nominmax-on-visual-c) before including Windows headers to workaround this issue. -To workaround the incompatibility with these macros, GLM will systematically undef these macros if they are defined. - -### 7.13. Constant expressions support - -GLM has some C++ constant expressions support. However, GLM automatically detects the use of SIMD instruction sets through compiler arguments to populate its implementation with SIMD intrinsics. -Unfortunately, GCC and Clang doesn't support SIMD instrinsics as constant expressions. To allow constant expressions on all vectors and matrices types, define `GLM_FORCE_PURE` before including GLM headers. - ---- -
- -## 8. Code samples - -This series of samples only shows various GLM features without consideration of any sort. - -### 8.1. Compute a triangle normal - -```cpp -#include // vec3 normalize cross - -glm::vec3 computeNormal(glm::vec3 const& a, glm::vec3 const& b, glm::vec3 const& c) -{ - return glm::normalize(glm::cross(c - a, b - a)); -} - -// A much faster but less accurate alternative: -#include // vec3 cross -#include // fastNormalize - -glm::vec3 computeNormal(glm::vec3 const& a, glm::vec3 const& b, glm::vec3 const& c) -{ - return glm::fastNormalize(glm::cross(c - a, b - a)); -} -``` - -### 8.2. Matrix transform - -```cpp -#include // vec3, vec4, ivec4, mat4 -#include // translate, rotate, scale, perspective -#include // value_ptr - -void setUniformMVP(GLuint Location, glm::vec3 const& Translate, glm::vec3 const& Rotate) -{ - glm::mat4 Projection = glm::perspective(45.0f, 4.0f / 3.0f, 0.1f, 100.f); - glm::mat4 ViewTranslate = glm::translate( - glm::mat4(1.0f), Translate); - glm::mat4 ViewRotateX = glm::rotate( - ViewTranslate, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f)); - glm::mat4 View = glm::rotate(ViewRotateX, - Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f)); - glm::mat4 Model = glm::scale( - glm::mat4(1.0f), glm::vec3(0.5f)); - glm::mat4 MVP = Projection * View * Model; - glUniformMatrix4fv(Location, 1, GL_FALSE, glm::value_ptr(MVP)); -} -``` - -### 8.3. Vector types - -```cpp -#include // vec2 -#include // hvec2, i8vec2, i32vec2 - -std::size_t const VertexCount = 4; - -// Float quad geometry -std::size_t const PositionSizeF32 = VertexCount * sizeof(glm::vec2); -glm::vec2 const PositionDataF32[VertexCount] = -{ - glm::vec2(-1.0f,-1.0f), - glm::vec2( 1.0f,-1.0f), - glm::vec2( 1.0f, 1.0f), - glm::vec2(-1.0f, 1.0f) -}; - -// Half-float quad geometry -std::size_t const PositionSizeF16 = VertexCount * sizeof(glm::hvec2); -glm::hvec2 const PositionDataF16[VertexCount] = -{ - glm::hvec2(-1.0f, -1.0f), - glm::hvec2( 1.0f, -1.0f), - glm::hvec2( 1.0f, 1.0f), - glm::hvec2(-1.0f, 1.0f) -}; - -// 8 bits signed integer quad geometry -std::size_t const PositionSizeI8 = VertexCount * sizeof(glm::i8vec2); -glm::i8vec2 const PositionDataI8[VertexCount] = -{ - glm::i8vec2(-1,-1), - glm::i8vec2( 1,-1), - glm::i8vec2( 1, 1), - glm::i8vec2(-1, 1) -}; - -// 32 bits signed integer quad geometry -std::size_t const PositionSizeI32 = VertexCount * sizeof(glm::i32vec2); -glm::i32vec2 const PositionDataI32[VertexCount] = -{ - glm::i32vec2(-1,-1), - glm::i32vec2( 1,-1), - glm::i32vec2( 1, 1), - glm::i32vec2(-1, 1) -}; -``` - -### 8.4. Lighting - -```cpp -#include // vec3 normalize reflect dot pow -#include // ballRand - -// vecRand3, generate a random and equiprobable normalized vec3 -glm::vec3 lighting(intersection const& Intersection, material const& Material, light const& Light, glm::vec3 const& View) -{ - glm::vec3 Color = glm::vec3(0.0f); - glm::vec3 LightVertor = glm::normalize( - Light.position() - Intersection.globalPosition() + - glm::ballRand(0.0f, Light.inaccuracy()); - - if(!shadow(Intersection.globalPosition(), Light.position(), LightVertor)) - { - float Diffuse = glm::dot(Intersection.normal(), LightVector); - if(Diffuse <= 0.0f) - return Color; - - if(Material.isDiffuse()) - Color += Light.color() * Material.diffuse() * Diffuse; - - if(Material.isSpecular()) - { - glm::vec3 Reflect = glm::reflect(-LightVector, Intersection.normal()); - float Dot = glm::dot(Reflect, View); - float Base = Dot > 0.0f ? Dot : 0.0f; - float Specular = glm::pow(Base, Material.exponent()); - Color += Material.specular() \* Specular; - } - } - - return Color; -} -``` - ---- -
- -## 9. Contributing to GLM - -### 9.1. Submitting bug reports - -Bug should be reported on Github using the [issue page](https://github.com/g-truc/glm/issues). - -A minimal code to reproduce the issue will help. - -Additional, bugs can be configuration specific. We can report the configuration by defining `GLM_FORCE_MESSAGES` before including GLM headers then build and copy paste the build messages GLM will output. - -```cpp -#define GLM_FORCE_MESSAGES -#include -``` - -An example of build messages generated by GLM: -``` -GLM: 0.9.9.1 -GLM: C++ 17 with extensions -GLM: GCC compiler detected" -GLM: x86 64 bits with AVX instruction set build target -GLM: Linux platform detected -GLM: GLM_FORCE_SWIZZLE is undefined. swizzling functions or operators are disabled. -GLM: GLM_FORCE_SIZE_T_LENGTH is undefined. .length() returns a glm::length_t, a typedef of int following GLSL. -GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is undefined. Follows strictly GLSL on valid function genTypes. -GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is undefined. Using negative one to one depth clip space. -GLM: GLM_FORCE_LEFT_HANDED is undefined. Using right handed coordinate system. -``` - -### 9.2. Contributing to GLM with pull request - -This tutorial will show us how to successfully contribute a bug-fix to GLM using GitHub's Pull Request workflow. - -We will be typing git commands in the Terminal. Mac and Linux users may have git pre-installed. You can download git from [here](http://git-scm.com/downloads). - -The tutorial assumes you have some basic understanding of git concepts - repositories, branches, commits, etc. Explaining it all from scratch is beyond the scope of this tutorial. Some good links to learn git basics are: [Link 1](http://git-scm.com/book/en/Getting-Started-Git-Basics), [Link 2](https://www.atlassian.com/git/tutorial/git-basics) - -#### Step 1: Setup our GLM Fork - -We will make our changes in our own copy of the GLM sitory. On the GLM GitHub repo and we press the Fork button. -We need to download a copy of our fork to our local machine. In the terminal, type: - -``` ->>> git clone -``` - -This will clone our fork repository into the current folder. - -We can find our repository git url on the Github reposotory page. The url looks like this: `https://github.com//.git` - -#### Step 2: Synchronizing our fork - -We can use the following command to add `upstream` (original project repository) as a remote repository so that we can fetch the latest GLM commits into our branch and keep our forked copy is synchronized. - -``` ->>> git remote add upstream https://github.com/processing/processing.git -``` - -To synchronize our fork to the latest commit in the GLM repository, we can use the following command: - -``` ->>> git fetch upstream -``` - -Then, we can merge the remote master branch to our current branch: - -``` ->>> git merge upstream/master -``` - -Now our local copy of our fork has been synchronized. However, the fork's copy is not updated on GitHub's servers yet. To do that, use: - -``` ->>> git push origin master -``` - -#### Step 3: Modifying our GLM Fork - -Our fork is now setup and we are ready to modify GLM to fix a bug. - -It's a good practice to make changes in our fork in a separate branch than the master branch because we can submit only one pull request per branch. - -Before creating a new branch, it's best to synchronize our fork and then create a new branch from the latest master branch. - -If we are not on the master branch, we should switch to it using: -``` ->>> git checkout master -``` - -To create a new branch called `bugifx`, we use: -``` -git branch bugfix -``` - -Once the code changes for the fix is done, we need to commit the changes: -``` ->>> git commit -m "Resolve the issue that caused problem with a specific fix #432" -``` - -The commit message should be as specific as possible and finished by the bug number in the [GLM GitHub issue page](https://github.com/g-truc/glm/issues) - -Finally, we need to push our changes in our branch to our GitHub fork using: -``` ->>> git push origin bugfix -``` - -Some things to keep in mind for a pull request: -* Keep it minimal: Try to make the minimum required changes to fix the issue. If we have added any debugging code, we should remove it. -* A fix at a time: The pull request should deal with one issue at a time only, unless two issue are so interlinked they must be fixed together. -* Write a test: GLM is largely unit tests. Unit tests are in `glm/test` directory. We should also add tests for the fixes we provide to ensure future regression doesn't happen. -* No whitespace changes: Avoid unnecessary formatting or whitespace changes in other parts of the code. Be careful with auto-format options in the code editor which can cause wide scale formatting changes. -* Follow [GLM Code Style](#section9_3) for consistency. -* Tests passes: Make sure GLM build and tests don't fail because of the changes. - -#### Step 4: Submitting a Pull Request - -We need to submit a pull request from the `bugfix` branch to GLM's master branch. - -On the fork github page, we can click on the *Pull Request* button. Then we can describe our pull request. Finally we press *Send Pull Request*. - -Please be patient and give them some time to go through it. - -The pull request review may suggest additional changes. So we can make those changes in our branch, and push those changes to our fork repository. Our pull request will always include the latest changes in our branch on GitHub, so we don't need to resubmit the pull request. - -Once your changes have been accepted, a project maintainer will merge our pull request. - -We are grateful to the users for their time and effort in contributing fixes. - -### 9.3. Coding style - -#### Indentation - -Always tabs. Never spaces. - -#### Spacing - -No space after if. Use if(blah) not if (blah). Example if/else block: - -```cpp -if(blah) -{ - // yes like this -} -else -{ - // something besides -} -``` - -Single line if blocks: -```cpp -if(blah) - // yes like this -else - // something besides -``` - -No spaces inside parens: -```cpp -if (blah) // No -if( blah ) // No -if ( blah ) // No -if(blah) // Yes -``` - -Use spaces before/after commas: -```cpp -someFunction(apple,bear,cat); // No -someFunction(apple, bear, cat); // Yes -``` - -Use spaces before/after use of `+, -, *, /, %, >>, <<, |, &, ^, ||, &&` operators: -```cpp -vec4 v = a + b; -``` - -#### Blank lines - -One blank line after the function blocks. - -#### Comments - -Always one space after the // in single line comments - -One space before // at the end of a line (that has code as well) - -Try to use // comments inside functions, to make it easier to remove a whole block via /* */ - -#### Cases - -```cpp -#define GLM_MY_DEFINE 76 - -class myClass -{}; - -myClass const MyClass; - -namespace glm{ // glm namespace is for public code -namespace detail // glm::detail namespace is for implementation detail -{ - float myFunction(vec2 const& V) - { - return V.x + V.y; - } - - float myFunction(vec2 const* const V) - { - return V->x + V->y; - } -}//namespace detail -}//namespace glm -``` - ---- -
- -## 10. References - -### 10.1. OpenGL specifications - -* OpenGL 4.3 core specification -* [GLSL 4.30 specification](http://www.opengl.org/registry/doc/GLSLangSpec.4.30.7.diff.pdf) -![](media/image21.png){width="2.859722222222222in" height="1.6083333333333334in"}- [*GLU 1.3 specification*](http://www.opengl.org/documentation/specs/glu/glu1_3.pdf) - -### 10.2. External links - -* [GLM on stackoverflow](http://stackoverflow.com/search?q=GLM) - -### 10.3. Projects using GLM - -***[Leo’s Fortune](http://www.leosfortune.com/)*** - -Leo’s Fortune is a platform adventure game where you hunt down the cunning and mysterious thief that stole your gold. Available on PS4, Xbox One, PC, Mac, iOS and Android. - -Beautifully hand-crafted levels bring the story of Leo to life in this epic adventure. - -“I just returned home to find all my gold has been stolen! For some devious purpose, the thief has dropped pieces of my gold like breadcrumbs through the woods.†- -“Despite this pickle of a trap, I am left with no choice but to follow the trail.†- -“Whatever lies ahead, I must recover my fortune.†-Leopold - -![](/doc/manual/references-leosfortune.jpeg) - -![](/doc/manual/references-leosfortune2.jpg) - -[***OpenGL 4.0 Shading Language Cookbook***](http://www.packtpub.com/opengl-4-0-shading-language-cookbook/book?tag=rk/opengl4-abr1/0811) - -A set of recipes that demonstrates a wide of techniques for producing high-quality, real-time 3D graphics with GLSL 4.0, such as: - -* Using GLSL 4.0 to implement lighting and shading techniques. -* Using the new features of GLSL 4.0 including tessellation and geometry shaders. -* Using textures in GLSL as part of a wide variety of techniques from basic texture mapping to deferred shading. - -Simple, easy-to-follow examples with GLSL source code are provided, as well as a basic description of the theory behind each technique. - -![](/doc/manual/references-glsl4book.jpg) - -[***Outerra***](http://outerra.com/) - -A 3D planetary engine for seamless planet rendering from space down to the surface. Can use arbitrary resolution of elevation data, refining it to centimetre resolution using fractal algorithms. - -![](/doc/manual/references-outerra1.jpg) - -![](/doc/manual/references-outerra2.jpg) - -![](/doc/manual/references-outerra3.jpg) - -![](/doc/manual/references-outerra4.jpg) - -[***Falcor***](https://github.com/NVIDIA/Falcor) - -Real-time rendering research framework by NVIDIA. - -[***Cinder***](https://libcinder.org/) - -Cinder is a free and open source library for professional-quality creative coding in C++. - -Cinder is a C++ library for programming with aesthetic intent - the sort of development often called creative coding. This includes domains like graphics, audio, video, and computational geometry. Cinder is cross-platform, with official support for OS X, Windows, iOS, and WinRT. - -Cinder is production-proven, powerful enough to be the primary tool for professionals, but still suitable for learning and experimentation. Cinder is released under the [2-Clause BSD License](http://opensource.org/licenses/BSD-2-Clause). - -![](/doc/manual/references-cinder.png) - -[***opencloth***](https://github.com/mmmovania/opencloth/) - -A collection of source codes implementing cloth simulation algorithms in OpenGL. - -Simple, easy-to-follow examples with GLSL source code, as well as a basic description of the theory behind each technique. - -![](/doc/manual/references-opencloth1.png) - -![](/doc/manual/references-opencloth3.png) - -[***LibreOffice***](https://www.libreoffice.org/) - -LibreOffice includes several applications that make it the most powerful Free and Open Source office suite on the market. - -[***Are you using GLM in a project?***](mailto:glm@g-truc.net) - -### 10.4. Tutorials using GLM - -* [Sascha Willems' Vulkan examples](https://github.com/SaschaWillems/Vulkan), Examples and demos for the new Vulkan API -* [VKTS](https://github.com/McNopper/Vulkan) Vulkan examples using VulKan ToolS (VKTS) -* [*The OpenGL Samples Pack*](http://www.g-truc.net/project-0026.html#menu), samples that show how to set up all the different new features -* [*Learning Modern 3D Graphics programming*](http://www.arcsynthesis.org/gltut/), a great OpenGL tutorial using GLM by Jason L. McKesson -* [*Morten Nobel-Jørgensen’s*](http://blog.nobel-joergensen.com/2011/04/02/glm-brilliant-math-library-for-opengl/) review and use an [*OpenGL renderer*](https://github.com/mortennobel/RenderE) -* [*Swiftless’ OpenGL tutorial*](http://www.swiftless.com/opengltuts.html) using GLM by Donald Urquhart -* [*Rastergrid*](http://rastergrid.com/blog/), many technical articles with companion programs using GLM by Daniel Rákos\ -* [*OpenGL Tutorial*](http://www.opengl-tutorial.org), tutorials for OpenGL 3.1 and later -* [*OpenGL Programming on Wikibooks*](http://en.wikibooks.org/wiki/OpenGL_Programming): For beginners who are discovering OpenGL. -* [*3D Game Engine Programming*](http://3dgep.com/): Learning the latest 3D Game Engine Programming techniques. -* [Game Tutorials](http://www.gametutorials.com/opengl-4-matrices-and-glm/), graphics and game programming. -* [open.gl](https://open.gl/), OpenGL tutorial -* [c-jump](http://www.c-jump.com/bcc/common/Talk3/Math/GLM/GLM.html), GLM tutorial -* [Learn OpenGL](http://learnopengl.com/), OpenGL tutorial -* [***Are you using GLM in a tutorial?***](mailto:glm@g-truc.net) - -### 10.5. Equivalent for other languages - -* [*cglm*](https://github.com/recp/cglm): OpenGL Mathematics (glm) for C. -* [*GlmSharp*](https://github.com/Philip-Trettner/GlmSharp): Open-source semi-generated GLM-flavored math library for .NET/C\#. -* [glm-js](https://github.com/humbletim/glm-js): JavaScript adaptation of the OpenGL Mathematics (GLM) C++ library interfaces -* [JVM OpenGL Mathematics (GLM)](https://github.com/kotlin-graphics/glm): written in Kotlin, Java compatible -* [JGLM](https://github.com/jroyalty/jglm) - Java OpenGL Mathematics Library -* [SwiftGL Math Library](https://github.com/SwiftGL/Math/blob/master/Sources/glm.swift) GLM for Swift -* [glm-go](https://github.com/jbowtie/glm-go): Simple linear algebra library similar in spirit to GLM -* [openll](https://github.com/Polkm/openll): Lua bindings for OpenGL, GLM, GLFW, OpenAL, SOIL and PhysicsFS -* [glm-rs](https://github.com/dche/glm-rs): GLSL mathematics for Rust programming language -* [glmpython](https://github.com/Queatz/glmpython): GLM math library for Python - -### 10.6. Alternatives to GLM - -* [*CML*](http://cmldev.net/): The CML (Configurable Math Library) is a free C++ math library for games and graphics. -* [*Eigen*](http://eigen.tuxfamily.org/): A more heavy weight math library for general linear algebra in C++. -* [*glhlib*](http://glhlib.sourceforge.net/): A much more than glu C library. -* Are you using or developing an alternative library to GLM? - -### 10.7. Acknowledgements - -GLM is developed and maintained by [*Christophe Riccio*](http://www.g-truc.net) but many contributors have made this project what it is. - -Special thanks to: -* Ashima Arts and Stefan Gustavson for their work on [*webgl-noise*](https://github.com/ashima/webgl-noise) which has been used for GLM noises implementation. -* [*Arthur Winters*](http://athile.net/library/wiki/index.php?title=Athile_Technologies) for the C++11 and Visual C++ swizzle operators implementation and tests. -* Joshua Smith and Christoph Schied for the discussions and the experiments around the swizzle operators implementation issues. -* Guillaume Chevallereau for providing and maintaining the [*nightlight build system*](http://my.cdash.org/index.php?project=GLM). -* Ghenadii Ursachi for GLM\_GTX\_matrix\_interpolation implementation. -* Mathieu Roumillac for providing some implementation ideas. -* [*Grant James*](http://www.zeuscmd.com/) for the implementation of all combination of none-squared matrix products. -* Jesse Talavera-Greenberg for his work on the manual amount other things. -* All the GLM users that have report bugs and hence help GLM to become a great library! diff --git a/3rdparty/glm/source/readme.md b/3rdparty/glm/source/readme.md deleted file mode 100644 index 55b9678..0000000 --- a/3rdparty/glm/source/readme.md +++ /dev/null @@ -1,1231 +0,0 @@ -![glm](/doc/manual/logo-mini.png) - -[OpenGL Mathematics](http://glm.g-truc.net/) (*GLM*) is a header only C++ mathematics library for graphics software based on the [OpenGL Shading Language (GLSL) specifications](https://www.opengl.org/registry/doc/GLSLangSpec.4.50.diff.pdf). - -*GLM* provides classes and functions designed and implemented with the same naming conventions and functionality than *GLSL* so that anyone who knows *GLSL*, can use *GLM* as well in C++. - -This project isn't limited to *GLSL* features. An extension system, based on the *GLSL* extension conventions, provides extended capabilities: matrix transformations, quaternions, data packing, random numbers, noise, etc... - -This library works perfectly with *[OpenGL](https://www.opengl.org)* but it also ensures interoperability with other third party libraries and SDK. It is a good candidate for software rendering (raytracing / rasterisation), image processing, physics simulations and any development context that requires a simple and convenient mathematics library. - -*GLM* is written in C++98 but can take advantage of C++11 when supported by the compiler. It is a platform independent library with no dependence and it officially supports the following compilers: -- [*GCC*](http://gcc.gnu.org/) 4.7 and higher -- [*Intel C++ Compose*](https://software.intel.com/en-us/intel-compilers) XE 2013 and higher -- [*Clang*](http://llvm.org/) 3.4 and higher -- [*Apple Clang 6.0*](https://developer.apple.com/library/mac/documentation/CompilerTools/Conceptual/LLVMCompilerOverview/index.html) and higher -- [*Visual C++*](http://www.visualstudio.com/) 2013 and higher -- [*CUDA*](https://developer.nvidia.com/about-cuda) 9.0 and higher (experimental) -- [*SYCL*](https://www.khronos.org/sycl/) (experimental: only [ComputeCpp](https://codeplay.com/products/computesuite/computecpp) implementation has been tested). -- Any C++11 compiler - -For more information about *GLM*, please have a look at the [manual](manual.md) and the [API reference documentation](http://glm.g-truc.net/0.9.8/api/index.html). -The source code and the documentation are licensed under either the [Happy Bunny License (Modified MIT) or the MIT License](manual.md#section0). - -Thanks for contributing to the project by [submitting pull requests](https://github.com/g-truc/glm/pulls). - -```cpp -#include // glm::vec3 -#include // glm::vec4 -#include // glm::mat4 -#include // glm::translate, glm::rotate, glm::scale -#include // glm::perspective -#include // glm::pi - -glm::mat4 camera(float Translate, glm::vec2 const& Rotate) -{ - glm::mat4 Projection = glm::perspective(glm::pi() * 0.25f, 4.0f / 3.0f, 0.1f, 100.f); - glm::mat4 View = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 0.0f, -Translate)); - View = glm::rotate(View, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f)); - View = glm::rotate(View, Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f)); - glm::mat4 Model = glm::scale(glm::mat4(1.0f), glm::vec3(0.5f)); - return Projection * View * Model; -} -``` - -## [Lastest release](https://github.com/g-truc/glm/releases/latest) - -## Project Health - -| Service | System | Compiler | Status | -| ------- | ------ | -------- | ------ | -| [Travis CI](https://travis-ci.org/g-truc/glm)| MacOSX, Linux 64 bits | Clang 3.6, Clang 5.0, GCC 4.9, GCC 7.3 | [![Travis CI](https://travis-ci.org/g-truc/glm.svg?branch=master)](https://travis-ci.org/g-truc/glm) -| [AppVeyor](https://ci.appveyor.com/project/Groovounet/glm)| Windows 32 and 64 | Visual Studio 2013, Visual Studio 2015, Visual Studio 2017 | [![AppVeyor](https://ci.appveyor.com/api/projects/status/32r7s2skrgm9ubva?svg=true)](https://ci.appveyor.com/project/Groovounet/glm) - -## Release notes - -### [GLM 0.9.9.9](https://github.com/g-truc/glm/releases/tag/0.9.9.9) - 2020-XX-XX -#### Features: -- Added *GLM_EXT_scalar_reciprocal* with tests -- Added *GLM_EXT_vector_reciprocal* with tests -- Added `glm::iround` and `glm::uround` to *GLM_EXT_scalar_common* and *GLM_EXT_vector_common* -- Added *GLM_EXT_matrix_integer* with tests - -#### Improvements: -- Added `constexpr` qualifier for `cross` product #1040 -- Added `constexpr` qualifier for `dot` product #1040 - -#### Fixes: -- Fixed incorrect assertion for `glm::min` and `glm::max` #1009 -- Fixed quaternion orientation in `glm::decompose` #1012 -- Fixed singularity in quaternion to euler angle roll conversion #1019 -- Fixed `quat` `glm::pow` handling of small magnitude quaternions #1022 -- Fixed `glm::fastNormalize` build error #1033 -- Fixed `glm::isMultiple` build error #1034 -- Fixed `glm::adjugate` calculation #1035 -- Fixed `glm::angle` discards the sign of result for angles in range (2*pi-1, 2*pi) #1038 -- Removed ban on using `glm::string_cast` with *CUDA* host code #1041 - -### [GLM 0.9.9.8](https://github.com/g-truc/glm/releases/tag/0.9.9.8) - 2020-04-13 -#### Features: -- Added *GLM_EXT_vector_intX* and *GLM_EXT_vector_uintX* extensions -- Added *GLM_EXT_matrix_intX* and *GLM_EXT_matrix_uintX* extensions - -#### Improvements: -- Added `glm::clamp`, `glm::repeat`, `glm::mirrorClamp` and `glm::mirrorRepeat` function to `GLM_EXT_scalar_commond` and `GLM_EXT_vector_commond` extensions with tests - -#### Fixes: -- Fixed unnecessary warnings from `matrix_projection.inl` #995 -- Fixed quaternion `glm::slerp` overload which interpolates with extra spins #996 -- Fixed for `glm::length` using arch64 #992 -- Fixed singularity check for `glm::quatLookAt` #770 - -### [GLM 0.9.9.7](https://github.com/g-truc/glm/releases/tag/0.9.9.7) - 2020-01-05 -#### Improvements: -- Improved *Neon* support with more functions optimized #950 -- Added *CMake* *GLM* interface #963 -- Added `glm::fma` implementation based on `std::fma` #969 -- Added missing quat constexpr #955 -- Added `GLM_FORCE_QUAT_DATA_WXYZ` to store quat data as w,x,y,z instead of x,y,z,w #983 - -#### Fixes: -- Fixed equal *ULP* variation when using negative sign #965 -- Fixed for intersection ray/plane and added related tests #953 -- Fixed ARM 64bit detection #949 -- Fixed *GLM_EXT_matrix_clip_space* warnings #980 -- Fixed Wimplicit-int-float-conversion warnings with clang 10+ #986 -- Fixed *GLM_EXT_matrix_clip_space* `perspectiveFov` - -### [GLM 0.9.9.6](https://github.com/g-truc/glm/releases/tag/0.9.9.6) - 2019-09-08 -#### Features: -- Added *Neon* support #945 -- Added *SYCL* support #914 -- Added *GLM_EXT_scalar_integer* extension with power of two and multiple scalar functions -- Added *GLM_EXT_vector_integer* extension with power of two and multiple vector functions - -#### Improvements: -- Added *Visual C++ 2019* detection -- Added *Visual C++ 2017* 15.8 and 15.9 detection -- Added missing genType check for `glm::bitCount` and `glm::bitfieldReverse` #893 - -#### Fixes: -- Fixed for g++6 where -std=c++1z sets __cplusplus to 201500 instead of 201402 #921 -- Fixed hash hashes qua instead of tquat #919 -- Fixed `.natvis` as structs renamed #915 -- Fixed `glm::ldexp` and `glm::frexp` declaration #895 -- Fixed missing const to quaternion conversion operators #890 -- Fixed *GLM_EXT_scalar_ulp* and *GLM_EXT_vector_ulp* API coding style -- Fixed quaternion componant order: `w, {x, y, z}` #916 -- Fixed `GLM_HAS_CXX11_STL` broken on Clang with Linux #926 -- Fixed *Clang* or *GCC* build due to wrong `GLM_HAS_IF_CONSTEXPR` definition #907 -- Fixed *CUDA* 9 build #910 - -#### Deprecation: - - Removed CMake install and uninstall scripts - -### [GLM 0.9.9.5](https://github.com/g-truc/glm/releases/tag/0.9.9.5) - 2019-04-01 -#### Fixes: -- Fixed build errors when defining `GLM_ENABLE_EXPERIMENTAL` #884 #883 -- Fixed `if constexpr` warning #887 -- Fixed missing declarations for `glm::frexp` and `glm::ldexp` #886 - -### [GLM 0.9.9.4](https://github.com/g-truc/glm/releases/tag/0.9.9.4) - 2019-03-19 -#### Features: -- Added `glm::mix` implementation for matrices in *GLM_EXT_matrix_common/ #842 -- Added *CMake* `BUILD_SHARED_LIBS` and `BUILD_STATIC_LIBS` build options #871 - -#### Improvements: -- Added GLM_FORCE_INTRINSICS to enable SIMD instruction code path. By default, it's disabled allowing constexpr support by default. #865 -- Optimized inverseTransform #867 - -#### Fixes: -- Fixed in `glm::mat4x3` conversion #829 -- Fixed `constexpr` issue on GCC #832 #865 -- Fixed `glm::mix` implementation to improve GLSL conformance #866 -- Fixed `glm::int8` being defined as unsigned char with some compiler #839 -- Fixed `glm::vec1` include #856 -- Ignore `.vscode` #848 - -### [GLM 0.9.9.3](https://github.com/g-truc/glm/releases/tag/0.9.9.3) - 2018-10-31 -#### Features: -- Added `glm::equal` and `glm::notEqual` overload with max ULPs parameters for scalar numbers #121 -- Added `GLM_FORCE_SILENT_WARNINGS` to silent *GLM* warnings when using language extensions but using W4 or Wpedantic warnings #814 #775 -- Added adjugate functions to `GLM_GTX_matrix_operation` #151 -- Added `GLM_FORCE_ALIGNED_GENTYPES` to enable aligned types and SIMD instruction are not enabled. This disable `constexpr` #816 - -#### Improvements: -- Added constant time ULP distance between float #121 -- Added `GLM_FORCE_SILENT_WARNINGS` to suppress *GLM* warnings #822 - -#### Fixes: -- Fixed `glm::simplex` noise build with double #734 -- Fixed `glm::bitfieldInsert` according to GLSL spec #818 -- Fixed `glm::refract` for negative 'k' #808 - -### [GLM 0.9.9.2](https://github.com/g-truc/glm/releases/tag/0.9.9.2) - 2018-09-14 -#### Fixes: -- Fixed `GLM_FORCE_CXX**` section in the manual -- Fixed default initialization with vector and quaternion types using `GLM_FORCE_CTOR_INIT` #812 - -### [GLM 0.9.9.1](https://github.com/g-truc/glm/releases/tag/0.9.9.1) - 2018-09-03 -#### Features: -- Added `bitfieldDeinterleave` to *GLM_GTC_bitfield* -- Added missing `glm::equal` and `glm::notEqual` with epsilon for quaternion types to *GLM_GTC_quaternion* -- Added *GLM_EXT_matrix_relational*: `glm::equal` and `glm::notEqual` with epsilon for matrix types -- Added missing aligned matrix types to *GLM_GTC_type_aligned* -- Added C++17 detection -- Added *Visual C++* language standard version detection -- Added PDF manual build from markdown - -#### Improvements: -- Added a section to the manual for contributing to *GLM* -- Refactor manual, lists all configuration defines -- Added missing `glm::vec1` based constructors -- Redesigned constexpr support which excludes both SIMD and `constexpr` #783 -- Added detection of *Visual C++ 2017* toolsets -- Added identity functions #765 -- Splitted headers into EXT extensions to improve compilation time #670 -- Added separated performance tests -- Clarified refract valid range of the indices of refraction, between -1 and 1 inclusively #806 - -#### Fixes: -- Fixed SIMD detection on *Clang* and *GCC* -- Fixed build problems due to `std::printf` and `std::clock_t` #778 -- Fixed int mod -- Anonymous unions require C++ language extensions -- Fixed `glm::ortho` #790 -- Fixed *Visual C++* 2013 warnings in vector relational code #782 -- Fixed *ICC* build errors with constexpr #704 -- Fixed defaulted operator= and constructors #791 -- Fixed invalid conversion from int scalar with vec4 constructor when using SSE instruction -- Fixed infinite loop in random functions when using negative radius values using an assert #739 - -### [GLM 0.9.9.0](https://github.com/g-truc/glm/releases/tag/0.9.9.0) - 2018-05-22 -#### Features: -- Added *RGBM* encoding in *GLM_GTC_packing* #420 -- Added *GLM_GTX_color_encoding* extension -- Added *GLM_GTX_vec_swizzle*, faster compile time swizzling then swizzle operator #558 -- Added *GLM_GTX_exterior_product* with a `vec2` `glm::cross` implementation #621 -- Added *GLM_GTX_matrix_factorisation* to factor matrices in various forms #654 -- Added [`GLM_ENABLE_EXPERIMENTAL`](manual.md#section7_4) to enable experimental features. -- Added packing functions for integer vectors #639 -- Added conan packaging configuration #643 #641 -- Added `glm::quatLookAt` to *GLM_GTX_quaternion* #659 -- Added `glm::fmin`, `glm::fmax` and `glm::fclamp` to *GLM_GTX_extended_min_max* #372 -- Added *GLM_EXT_vector_relational*: extend `glm::equal` and `glm::notEqual` to take an epsilon argument -- Added *GLM_EXT_vector_relational*: `glm::openBounded` and `glm::closeBounded` -- Added *GLM_EXT_vec1*: `*vec1` types -- Added *GLM_GTX_texture*: `levels` function -- Added spearate functions to use both nagative one and zero near clip plans #680 -- Added `GLM_FORCE_SINGLE_ONLY` to use *GLM* on platforms that don't support double #627 -- Added *GLM_GTX_easing* for interpolation functions #761 - -#### Improvements: -- No more default initialization of vector, matrix and quaternion types -- Added lowp variant of GTC_color_space convertLinearToSRGB #419 -- Replaced the manual by a markdown version #458 -- Improved API documentation #668 -- Optimized GTC_packing implementation -- Optimized GTC_noise functions -- Optimized GTC_color_space HSV to RGB conversions -- Optimised GTX_color_space_YCoCg YCoCgR conversions -- Optimized GTX_matrix_interpolation axisAngle function -- Added FAQ 12: Windows headers cause build errors... #557 -- Removed GCC shadow warnings #595 -- Added error for including of different versions of GLM #619 -- Added GLM_FORCE_IGNORE_VERSION to ignore error caused by including different version of GLM #619 -- Reduced warnings when using very strict compilation flags #646 -- length() member functions are constexpr #657 -- Added support of -Weverything with Clang #646 -- Improved exponential function test coverage -- Enabled warnings as error with Clang unit tests -- Conan package is an external repository: https://github.com/bincrafters/conan-glm -- Clarify quat_cast documentation, applying on pure rotation matrices #759 - -#### Fixes: -- Removed doxygen references to *GLM_GTC_half_float* which was removed in 0.9.4 -- Fixed `glm::decompose` #448 -- Fixed `glm::intersectRayTriangle` #6 -- Fixed dual quaternion != operator #629 -- Fixed usused variable warning in *GLM_GTX_spline* #618 -- Fixed references to `GLM_FORCE_RADIANS` which was removed #642 -- Fixed `glm::fastInverseSqrt` to use fast inverse square #640 -- Fixed `glm::axisAngle` NaN #638 -- Fixed integer pow from *GLM_GTX_integer* with null exponent #658 -- Fixed `quat` `normalize` build error #656 -- Fixed *Visual C++ 2017.2* warning regarding `__has_feature` definision #655 -- Fixed documentation warnings -- Fixed `GLM_HAS_OPENMP` when *OpenMP* is not enabled -- Fixed Better follow GLSL `min` and `max` specification #372 -- Fixed quaternion constructor from two vectors special cases #469 -- Fixed `glm::to_string` on quaternions wrong components order #681 -- Fixed `glm::acsch` #698 -- Fixed `glm::isnan` on *CUDA* #727 - -#### Deprecation: -- Requires *Visual Studio 2013*, *GCC 4.7*, *Clang 3.4*, *Cuda 7*, *ICC 2013* or a C++11 compiler -- Removed *GLM_GTX_simd_vec4* extension -- Removed *GLM_GTX_simd_mat4* extension -- Removed *GLM_GTX_simd_quat* extension -- Removed `GLM_SWIZZLE`, use `GLM_FORCE_SWIZZLE` instead -- Removed `GLM_MESSAGES`, use `GLM_FORCE_MESSAGES` instead -- Removed `GLM_DEPTH_ZERO_TO_ONE`, use `GLM_FORCE_DEPTH_ZERO_TO_ONE` instead -- Removed `GLM_LEFT_HANDED`, use `GLM_FORCE_LEFT_HANDED` instead -- Removed `GLM_FORCE_NO_CTOR_INIT` -- Removed `glm::uninitialize` - ---- -### [GLM 0.9.8.5](https://github.com/g-truc/glm/releases/tag/0.9.8.5) - 2017-08-16 -#### Features: -- Added *Conan* package support #647 - -#### Fixes: -- Fixed *Clang* version detection from source #608 -- Fixed `glm::packF3x9_E1x5` exponent packing #614 -- Fixed build error `min` and `max` specializations with integer #616 -- Fixed `simd_mat4` build error #652 - ---- -### [GLM 0.9.8.4](https://github.com/g-truc/glm/releases/tag/0.9.8.4) - 2017-01-22 -#### Fixes: -- Fixed *GLM_GTC_packing* test failing on *GCC* x86 due to denorms #212 #577 -- Fixed `POPCNT` optimization build in *Clang* #512 -- Fixed `glm::intersectRayPlane` returns true in parallel case #578 -- Fixed *GCC* 6.2 compiler warnings #580 -- Fixed *GLM_GTX_matrix_decompose* `glm::decompose` #582 #448 -- Fixed *GCC* 4.5 and older build #566 -- Fixed *Visual C++* internal error when declaring a global vec type with siwzzle expression enabled #594 -- Fixed `GLM_FORCE_CXX11` with Clang and libstlc++ which wasn't using C++11 STL features. #604 - ---- -### [GLM 0.9.8.3](https://github.com/g-truc/glm/releases/tag/0.9.8.3) - 2016-11-12 -#### Improvements: -- Broader support of `GLM_FORCE_UNRESTRICTED_GENTYPE` #378 - -#### Fixes: -- Fixed Android build error with C++11 compiler but C++98 STL #284 #564 -- Fixed *GLM_GTX_transform2* shear* functions #403 -- Fixed interaction between `GLM_FORCE_UNRESTRICTED_GENTYPE` and `glm::ortho` function #568 -- Fixed `glm::bitCount` with AVX on 32 bit builds #567 -- Fixed *CMake* `find_package` with version specification #572 #573 - ---- -### [GLM 0.9.8.2](https://github.com/g-truc/glm/releases/tag/0.9.8.2) - 2016-11-01 -#### Improvements: -- Added *Visual C++* 15 detection -- Added *Clang* 4.0 detection -- Added warning messages when using `GLM_FORCE_CXX**` but the compiler - is known to not fully support the requested C++ version #555 -- Refactored `GLM_COMPILER_VC` values -- Made quat, vec, mat type component `length()` static #565 - -#### Fixes: -- Fixed *Visual C++* `constexpr` build error #555, #556 - ---- -### [GLM 0.9.8.1](https://github.com/g-truc/glm/releases/tag/0.9.8.1) - 2016-09-25 -#### Improvements: -- Optimized quaternion `glm::log` function #554 - -#### Fixes: -- Fixed *GCC* warning filtering, replaced -pedantic by -Wpedantic -- Fixed SIMD faceforward bug. #549 -- Fixed *GCC* 4.8 with C++11 compilation option #550 -- Fixed *Visual Studio* aligned type W4 warning #548 -- Fixed packing/unpacking function fixed for 5_6_5 and 5_5_5_1 #552 - ---- -### [GLM 0.9.8.0](https://github.com/g-truc/glm/releases/tag/0.9.8.0) - 2016-09-11 -#### Features: -- Added right and left handed projection and clip control support #447 #415 #119 -- Added `glm::compNormalize` and `glm::compScale` functions to *GLM_GTX_component_wise* -- Added `glm::packF3x9_E1x5` and `glm::unpackF3x9_E1x5` to *GLM_GTC_packing* for RGB9E5 #416 -- Added `(un)packHalf` to *GLM_GTC_packing* -- Added `(un)packUnorm` and `(un)packSnorm` to *GLM_GTC_packing* -- Added 16bit pack and unpack to *GLM_GTC_packing* -- Added 8bit pack and unpack to *GLM_GTC_packing* -- Added missing `bvec*` && and || operators -- Added `glm::iround` and `glm::uround` to *GLM_GTC_integer*, fast round on positive values -- Added raw SIMD API -- Added 'aligned' qualifiers -- Added *GLM_GTC_type_aligned* with aligned *vec* types -- Added *GLM_GTC_functions* extension -- Added quaternion version of `glm::isnan` and `glm::isinf` #521 -- Added `glm::lowestBitValue` to *GLM_GTX_bit* #536 -- Added `GLM_FORCE_UNRESTRICTED_GENTYPE` allowing non basic `genType` #543 - -#### Improvements: -- Improved SIMD and swizzle operators interactions with *GCC* and *Clang* #474 -- Improved *GLM_GTC_random* `linearRand` documentation -- Improved *GLM_GTC_reciprocal* documentation -- Improved `GLM_FORCE_EXPLICIT_CTOR` coverage #481 -- Improved *OpenMP* support detection for *Clang*, *GCC*, *ICC* and *VC* -- Improved *GLM_GTX_wrap* for SIMD friendliness -- Added `constexpr` for `*vec*`, `*mat*`, `*quat*` and `*dual_quat*` types #493 -- Added *NEON* instruction set detection -- Added *MIPS* CPUs detection -- Added *PowerPC* CPUs detection -- Use *Cuda* built-in function for abs function implementation with Cuda compiler -- Factorized `GLM_COMPILER_LLVM` and `GLM_COMPILER_APPLE_CLANG` into `GLM_COMPILER_CLANG` -- No more warnings for use of long long -- Added more information to build messages - -#### Fixes: -- Fixed *GLM_GTX_extended_min_max* filename typo #386 -- Fixed `glm::intersectRayTriangle` to not do any unintentional backface culling -- Fixed long long warnings when using C++98 on *GCC* and *Clang* #482 -- Fixed sign with signed integer function on non-x86 architecture -- Fixed strict aliasing warnings #473 -- Fixed missing `glm::vec1` overload to `glm::length2` and `glm::distance2` functions #431 -- Fixed *GLM* test '/fp:fast' and '/Za' command-line options are incompatible -- Fixed quaterion to mat3 cast function `glm::mat3_cast` from *GLM_GTC_quaternion* #542 -- Fixed *GLM_GTX_io* for *Cuda* #547 #546 - -#### Deprecation: -- Removed `GLM_FORCE_SIZE_FUNC` define -- Deprecated *GLM_GTX_simd_vec4* extension -- Deprecated *GLM_GTX_simd_mat4* extension -- Deprecated *GLM_GTX_simd_quat* extension -- Deprecated `GLM_SWIZZLE`, use `GLM_FORCE_SWIZZLE` instead -- Deprecated `GLM_MESSAGES`, use `GLM_FORCE_MESSAGES` instead - ---- -### [GLM 0.9.7.6](https://github.com/g-truc/glm/releases/tag/0.9.7.6) - 2016-07-16 -#### Improvements: -- Added pkg-config file #509 -- Updated list of compiler versions detected -- Improved C++ 11 STL detection #523 - -#### Fixes: -- Fixed STL for C++11 detection on ICC #510 -- Fixed missing vec1 overload to length2 and distance2 functions #431 -- Fixed long long warnings when using C++98 on GCC and Clang #482 -- Fixed scalar reciprocal functions (GTC_reciprocal) #520 - ---- -### [GLM 0.9.7.5](https://github.com/g-truc/glm/releases/tag/0.9.7.5) - 2016-05-24 -#### Improvements: -- Added Visual C++ Clang toolset detection - -#### Fixes: -- Fixed uaddCarry warning #497 -- Fixed roundPowerOfTwo and floorPowerOfTwo #503 -- Fixed Visual C++ SIMD instruction set automatic detection in 64 bits -- Fixed to_string when used with GLM_FORCE_INLINE #506 -- Fixed GLM_FORCE_INLINE with binary vec4 operators -- Fixed GTX_extended_min_max filename typo #386 -- Fixed intersectRayTriangle to not do any unintentional backface culling - ---- -### [GLM 0.9.7.4](https://github.com/g-truc/glm/releases/tag/0.9.7.4) - 2016-03-19 -#### Fixes: -- Fixed asinh and atanh warning with C++98 STL #484 -- Fixed polar coordinates function latitude #485 -- Fixed outerProduct defintions and operator signatures for mat2x4 and vec4 #475 -- Fixed eulerAngles precision error, returns NaN #451 -- Fixed undefined reference errors #489 -- Fixed missing GLM_PLATFORM_CYGWIN declaration #495 -- Fixed various undefined reference errors #490 - ---- -### [GLM 0.9.7.3](https://github.com/g-truc/glm/releases/tag/0.9.7.3) - 2016-02-21 -#### Improvements: -- Added AVX512 detection - -#### Fixes: -- Fixed CMake policy warning -- Fixed GCC 6.0 detection #477 -- Fixed Clang build on Windows #479 -- Fixed 64 bits constants warnings on GCC #463 - ---- -### [GLM 0.9.7.2](https://github.com/g-truc/glm/releases/tag/0.9.7.2) - 2016-01-03 -#### Fixes: -- Fixed GTC_round floorMultiple/ceilMultiple #412 -- Fixed GTC_packing unpackUnorm3x10_1x2 #414 -- Fixed GTC_matrix_inverse affineInverse #192 -- Fixed ICC on Linux build errors #449 -- Fixed ldexp and frexp compilation errors -- Fixed "Declaration shadows a field" warning #468 -- Fixed 'GLM_COMPILER_VC2005 is not defined' warning #468 -- Fixed various 'X is not defined' warnings #468 -- Fixed missing unary + operator #435 -- Fixed Cygwin build errors when using C++11 #405 - ---- -### [GLM 0.9.7.1](https://github.com/g-truc/glm/releases/tag/0.9.7.1) - 2015-09-07 -#### Improvements: -- Improved constexpr for constant functions coverage #198 -- Added to_string for quat and dual_quat in GTX_string_cast #375 -- Improved overall execution time of unit tests #396 - -#### Fixes: -- Fixed strict alignment warnings #235 #370 -- Fixed link errors on compilers not supported default function #377 -- Fixed compilation warnings in vec4 -- Fixed non-identity quaternions for equal vectors #234 -- Fixed excessive GTX_fast_trigonometry execution time #396 -- Fixed Visual Studio 2015 'hides class member' warnings #394 -- Fixed builtin bitscan never being used #392 -- Removed unused func_noise.* files #398 - ---- -### [GLM 0.9.7.0](https://github.com/g-truc/glm/releases/tag/0.9.7.0) - 2015-08-02 -#### Features: -- Added GTC_color_space: convertLinearToSRGB and convertSRGBToLinear functions -- Added 'fmod' overload to GTX_common with tests #308 -- Left handed perspective and lookAt functions #314 -- Added functions eulerAngleXYZ and extractEulerAngleXYZ #311 -- Added to perform std::hash on GLM types #320 #367 -- Added for texcoord wrapping -- Added static components and precision members to all vector and quat types #350 -- Added .gitignore #349 -- Added support of defaulted functions to GLM types, to use them in unions #366 - -#### Improvements: -- Changed usage of __has_include to support Intel compiler #307 -- Specialized integer implementation of YCoCg-R #310 -- Don't show status message in 'FindGLM' if 'QUIET' option is set. #317 -- Added master branch continuous integration service on Linux 64 #332 -- Clarified manual regarding angle unit in GLM, added FAQ 11 #326 -- Updated list of compiler versions - -#### Fixes: -- Fixed default precision for quat and dual_quat type #312 -- Fixed (u)int64 MSB/LSB handling on BE archs #306 -- Fixed multi-line comment warning in g++. #315 -- Fixed specifier removal by 'std::make_pair<>' #333 -- Fixed perspective fovy argument documentation #327 -- Removed -m64 causing build issues on Linux 32 #331 -- Fixed isfinite with C++98 compilers #343 -- Fixed Intel compiler build error on Linux #354 -- Fixed use of libstdc++ with Clang #351 -- Fixed quaternion pow #346 -- Fixed decompose warnings #373 -- Fixed matrix conversions #371 - -#### Deprecation: -- Removed integer specification for 'mod' in GTC_integer #308 -- Removed GTX_multiple, replaced by GTC_round - ---- -### [GLM 0.9.6.3](https://github.com/g-truc/glm/releases/tag/0.9.6.3) - 2015-02-15 -- Fixed Android doesn't have C++ 11 STL #284 - ---- -### [GLM 0.9.6.2](https://github.com/g-truc/glm/releases/tag/0.9.6.2) - 2015-02-15 -#### Features: -- Added display of GLM version with other GLM_MESSAGES -- Added ARM instruction set detection - -#### Improvements: -- Removed assert for perspective with zFar < zNear #298 -- Added Visual Studio natvis support for vec1, quat and dualqual types -- Cleaned up C++11 feature detections -- Clarify GLM licensing - -#### Fixes: -- Fixed faceforward build #289 -- Fixed conflict with Xlib #define True 1 #293 -- Fixed decompose function VS2010 templating issues #294 -- Fixed mat4x3 = mat2x3 * mat4x2 operator #297 -- Fixed warnings in F2x11_1x10 packing function in GTC_packing #295 -- Fixed Visual Studio natvis support for vec4 #288 -- Fixed GTC_packing *pack*norm*x* build and added tests #292 -- Disabled GTX_scalar_multiplication for GCC, failing to build tests #242 -- Fixed Visual C++ 2015 constexpr errors: Disabled only partial support -- Fixed functions not inlined with Clang #302 -- Fixed memory corruption (undefined behaviour) #303 - ---- -### [GLM 0.9.6.1](https://github.com/g-truc/glm/releases/tag/0.9.6.1) - 2014-12-10 -#### Features: -- Added GLM_LANG_CXX14_FLAG and GLM_LANG_CXX1Z_FLAG language feature flags -- Added C++14 detection - -#### Improvements: -- Clean up GLM_MESSAGES compilation log to report only detected capabilities - -#### Fixes: -- Fixed scalar uaddCarry build error with Cuda #276 -- Fixed C++11 explicit conversion operators detection #282 -- Fixed missing explicit conversion when using integer log2 with *vec1 types -- Fixed 64 bits integer GTX_string_cast to_string on VC 32 bit compiler -- Fixed Android build issue, STL C++11 is not supported by the NDK #284 -- Fixed unsupported _BitScanForward64 and _BitScanReverse64 in VC10 -- Fixed Visual C++ 32 bit build #283 -- Fixed GLM_FORCE_SIZE_FUNC pragma message -- Fixed C++98 only build -- Fixed conflict between GTX_compatibility and GTC_quaternion #286 -- Fixed C++ language restriction using GLM_FORCE_CXX** - ---- -### [GLM 0.9.6.0](https://github.com/g-truc/glm/releases/tag/0.9.6.0) - 2014-11-30 -#### Features: -- Exposed template vector and matrix types in 'glm' namespace #239, #244 -- Added GTX_scalar_multiplication for C++ 11 compiler only #242 -- Added GTX_range for C++ 11 compiler only #240 -- Added closestPointOnLine function for tvec2 to GTX_closest_point #238 -- Added GTC_vec1 extension, *vec1 support to *vec* types -- Updated GTX_associated_min_max with vec1 support -- Added support of precision and integers to linearRand #230 -- Added Integer types support to GTX_string_cast #249 -- Added vec3 slerp #237 -- Added GTX_common with isdenomal #223 -- Added GLM_FORCE_SIZE_FUNC to replace .length() by .size() #245 -- Added GLM_FORCE_NO_CTOR_INIT -- Added 'uninitialize' to explicitly not initialize a GLM type -- Added GTC_bitfield extension, promoted GTX_bit -- Added GTC_integer extension, promoted GTX_bit and GTX_integer -- Added GTC_round extension, promoted GTX_bit -- Added GLM_FORCE_EXPLICIT_CTOR to require explicit type conversions #269 -- Added GTX_type_aligned for aligned vector, matrix and quaternion types - -#### Improvements: -- Rely on C++11 to implement isinf and isnan -- Removed GLM_FORCE_CUDA, Cuda is implicitly detected -- Separated Apple Clang and LLVM compiler detection -- Used pragma once -- Undetected C++ compiler automatically compile with GLM_FORCE_CXX98 and - GLM_FORCE_PURE -- Added not function (from GLSL specification) on VC12 -- Optimized bitfieldReverse and bitCount functions -- Optimized findLSB and findMSB functions. -- Optimized matrix-vector multiple performance with Cuda #257, #258 -- Reduced integer type redifinitions #233 -- Rewrited of GTX_fast_trigonometry #264 #265 -- Made types trivially copyable #263 -- Removed in GLM tests -- Used std features within GLM without redeclaring -- Optimized cot function #272 -- Optimized sign function #272 -- Added explicit cast from quat to mat3 and mat4 #275 - -#### Fixes: -- Fixed std::nextafter not supported with C++11 on Android #217 -- Fixed missing value_type for dual quaternion -- Fixed return type of dual quaternion length -- Fixed infinite loop in isfinite function with GCC #221 -- Fixed Visual Studio 14 compiler warnings -- Fixed implicit conversion from another tvec2 type to another tvec2 #241 -- Fixed lack of consistency of quat and dualquat constructors -- Fixed uaddCarray #253 -- Fixed float comparison warnings #270 - -#### Deprecation: -- Requires Visual Studio 2010, GCC 4.2, Apple Clang 4.0, LLVM 3.0, Cuda 4, ICC 2013 or a C++98 compiler -- Removed degrees for function parameters -- Removed GLM_FORCE_RADIANS, active by default -- Removed VC 2005 / 8 and 2008 / 9 support -- Removed GCC 3.4 to 4.3 support -- Removed LLVM GCC support -- Removed LLVM 2.6 to 3.1 support -- Removed CUDA 3.0 to 3.2 support - ---- -### [GLM 0.9.5.4 - 2014-06-21](https://github.com/g-truc/glm/releases/tag/0.9.5.4) -- Fixed non-utf8 character #196 -- Added FindGLM install for CMake #189 -- Fixed GTX_color_space - saturation #195 -- Fixed glm::isinf and glm::isnan for with Android NDK 9d #191 -- Fixed builtin GLM_ARCH_SSE4 #204 -- Optimized Quaternion vector rotation #205 -- Fixed missing doxygen @endcond tag #211 -- Fixed instruction set detection with Clang #158 -- Fixed orientate3 function #207 -- Fixed lerp when cosTheta is close to 1 in quaternion slerp #210 -- Added GTX_io for io with #144 -- Fixed fastDistance ambiguity #215 -- Fixed tweakedInfinitePerspective #208 and added user-defined epsilon to - tweakedInfinitePerspective -- Fixed std::copy and std::vector with GLM types #214 -- Fixed strict aliasing issues #212, #152 -- Fixed std::nextafter not supported with C++11 on Android #213 -- Fixed corner cases in exp and log functions for quaternions #199 - ---- -### GLM 0.9.5.3 - 2014-04-02 -- Added instruction set auto detection with Visual C++ using _M_IX86_FP - /arch - compiler argument -- Fixed GTX_raw_data code dependency -- Fixed GCC instruction set detection -- Added GLM_GTX_matrix_transform_2d extension (#178, #176) -- Fixed CUDA issues (#169, #168, #183, #182) -- Added support for all extensions but GTX_string_cast to CUDA -- Fixed strict aliasing warnings in GCC 4.8.1 / Android NDK 9c (#152) -- Fixed missing bitfieldInterleave definisions -- Fixed usubBorrow (#171) -- Fixed eulerAngle*** not consistent for right-handed coordinate system (#173) -- Added full tests for eulerAngle*** functions (#173) -- Added workaround for a CUDA compiler bug (#186, #185) - ---- -### GLM 0.9.5.2 - 2014-02-08 -- Fixed initializer list ambiguity (#159, #160) -- Fixed warnings with the Android NDK 9c -- Fixed non power of two matrix products -- Fixed mix function link error -- Fixed SSE code included in GLM tests on "pure" platforms -- Fixed undefined reference to fastInverseSqrt (#161) -- Fixed GLM_FORCE_RADIANS with build error (#165) -- Fix dot product clamp range for vector angle functions. (#163) -- Tentative fix for strict aliasing warning in GCC 4.8.1 / Android NDK 9c (#152) -- Fixed GLM_GTC_constants description brief (#162) - ---- -### GLM 0.9.5.1 - 2014-01-11 -- Fixed angle and orientedAngle that sometimes return NaN values (#145) -- Deprecated degrees for function parameters and display a message -- Added possible static_cast conversion of GLM types (#72) -- Fixed error 'inverse' is not a member of 'glm' from glm::unProject (#146) -- Fixed mismatch between some declarations and definitions -- Fixed inverse link error when using namespace glm; (#147) -- Optimized matrix inverse and division code (#149) -- Added intersectRayPlane function (#153) -- Fixed outerProduct return type (#155) - ---- -### GLM 0.9.5.0 - 2013-12-25 -- Added forward declarations (glm/fwd.hpp) for faster compilations -- Added per feature headers -- Minimized GLM internal dependencies -- Improved Intel Compiler detection -- Added bitfieldInterleave and _mm_bit_interleave_si128 functions -- Added GTX_scalar_relational -- Added GTX_dual_quaternion -- Added rotation function to GTX_quaternion (#22) -- Added precision variation of each type -- Added quaternion comparison functions -- Fixed GTX_multiple for negative value -- Removed GTX_ocl_type extension -- Fixed post increment and decrement operators -- Fixed perspective with zNear == 0 (#71) -- Removed l-value swizzle operators -- Cleaned up compiler detection code for unsupported compilers -- Replaced C cast by C++ casts -- Fixed .length() that should return a int and not a size_t -- Added GLM_FORCE_SIZE_T_LENGTH and glm::length_t -- Removed unnecessary conversions -- Optimized packing and unpacking functions -- Removed the normalization of the up argument of lookAt function (#114) -- Added low precision specializations of inversesqrt -- Fixed ldexp and frexp implementations -- Increased assert coverage -- Increased static_assert coverage -- Replaced GLM traits by STL traits when possible -- Allowed including individual core feature -- Increased unit tests completness -- Added creating of a quaternion from two vectors -- Added C++11 initializer lists -- Fixed umulExtended and imulExtended implementations for vector types (#76) -- Fixed CUDA coverage for GTC extensions -- Added GTX_io extension -- Improved GLM messages enabled when defining GLM_MESSAGES -- Hidden matrix _inverse function implementation detail into private section - ---- -### [GLM 0.9.4.6](https://github.com/g-truc/glm/releases/tag/0.9.4.6) - 2013-09-20 -- Fixed detection to select the last known compiler if newer version #106 -- Fixed is_int and is_uint code duplication with GCC and C++11 #107 -- Fixed test suite build while using Clang in C++11 mode -- Added c++1y mode support in CMake test suite -- Removed ms extension mode to CMake when no using Visual C++ -- Added pedantic mode to CMake test suite for Clang and GCC -- Added use of GCC frontend on Unix for ICC and Visual C++ fronted on Windows - for ICC -- Added compilation errors for unsupported compiler versions -- Fixed glm::orientation with GLM_FORCE_RADIANS defined #112 -- Fixed const ref issue on assignment operator taking a scalar parameter #116 -- Fixed glm::eulerAngleY implementation #117 - ---- -### GLM 0.9.4.5 - 2013-08-12 -- Fixed CUDA support -- Fixed inclusion of intrinsics in "pure" mode #92 -- Fixed language detection on GCC when the C++0x mode isn't enabled #95 -- Fixed issue #97: register is deprecated in C++11 -- Fixed issue #96: CUDA issues -- Added Windows CE detection #92 -- Added missing value_ptr for quaternions #99 - ---- -### GLM 0.9.4.4 - 2013-05-29 -- Fixed slerp when costheta is close to 1 #65 -- Fixed mat4x2 value_type constructor #70 -- Fixed glm.natvis for Visual C++ 12 #82 -- Added assert in inversesqrt to detect division by zero #61 -- Fixed missing swizzle operators #86 -- Fixed CUDA warnings #86 -- Fixed GLM natvis for VC11 #82 -- Fixed GLM_GTX_multiple with negative values #79 -- Fixed glm::perspective when zNear is zero #71 - ---- -### GLM 0.9.4.3 - 2013-03-20 -- Detected qualifier for Clang -- Fixed C++11 mode for GCC, couldn't be enabled without MS extensions -- Fixed squad, intermediate and exp quaternion functions -- Fixed GTX_polar_coordinates euclidean function, takes a vec2 instead of a vec3 -- Clarify the license applying on the manual -- Added a docx copy of the manual -- Fixed GLM_GTX_matrix_interpolation -- Fixed isnan and isinf on Android with Clang -- Autodetected C++ version using __cplusplus value -- Fixed mix for bool and bvec* third parameter - ---- -### GLM 0.9.4.2 - 2013-02-14 -- Fixed compAdd from GTX_component_wise -- Fixed SIMD support for Intel compiler on Windows -- Fixed isnan and isinf for CUDA compiler -- Fixed GLM_FORCE_RADIANS on glm::perspective -- Fixed GCC warnings -- Fixed packDouble2x32 on Xcode -- Fixed mix for vec4 SSE implementation -- Fixed 0x2013 dash character in comments that cause issue in Windows - Japanese mode -- Fixed documentation warnings -- Fixed CUDA warnings - ---- -### GLM 0.9.4.1 - 2012-12-22 -- Improved half support: -0.0 case and implicit conversions -- Fixed Intel Composer Compiler support on Linux -- Fixed interaction between quaternion and euler angles -- Fixed GTC_constants build -- Fixed GTX_multiple -- Fixed quat slerp using mix function when cosTheta close to 1 -- Improved fvec4SIMD and fmat4x4SIMD implementations -- Fixed assert messages -- Added slerp and lerp quaternion functions and tests - ---- -### GLM 0.9.4.0 - 2012-11-18 -- Added Intel Composer Compiler support -- Promoted GTC_espilon extension -- Promoted GTC_ulp extension -- Removed GLM website from the source repository -- Added GLM_FORCE_RADIANS so that all functions takes radians for arguments -- Fixed detection of Clang and LLVM GCC on MacOS X -- Added debugger visualizers for Visual C++ 2012 -- Requires Visual Studio 2005, GCC 4.2, Clang 2.6, Cuda 3, ICC 2013 or a C++98 compiler - ---- -### [GLM 0.9.3.4](https://github.com/g-truc/glm/releases/tag/0.9.3.4) - 2012-06-30 -- Added SSE4 and AVX2 detection. -- Removed VIRTREV_xstream and the incompatibility generated with GCC -- Fixed C++11 compiler option for GCC -- Removed MS language extension option for GCC (not fonctionnal) -- Fixed bitfieldExtract for vector types -- Fixed warnings -- Fixed SSE includes - ---- -### GLM 0.9.3.3 - 2012-05-10 -- Fixed isinf and isnan -- Improved compatibility with Intel compiler -- Added CMake test build options: SIMD, C++11, fast math and MS land ext -- Fixed SIMD mat4 test on GCC -- Fixed perspectiveFov implementation -- Fixed matrixCompMult for none-square matrices -- Fixed namespace issue on stream operators -- Fixed various warnings -- Added VC11 support - ---- -### GLM 0.9.3.2 - 2012-03-15 -- Fixed doxygen documentation -- Fixed Clang version detection -- Fixed simd mat4 /= operator - ---- -### GLM 0.9.3.1 - 2012-01-25 -- Fixed platform detection -- Fixed warnings -- Removed detail code from Doxygen doc - ---- -### GLM 0.9.3.0 - 2012-01-09 -- Added CPP Check project -- Fixed conflict with Windows headers -- Fixed isinf implementation -- Fixed Boost conflict -- Fixed warnings - ---- -### GLM 0.9.3.B - 2011-12-12 -- Added support for Chrone Native Client -- Added epsilon constant -- Removed value_size function from vector types -- Fixed roundEven on GCC -- Improved API documentation -- Fixed modf implementation -- Fixed step function accuracy -- Fixed outerProduct - ---- -### GLM 0.9.3.A - 2011-11-11 -- Improved doxygen documentation -- Added new swizzle operators for C++11 compilers -- Added new swizzle operators declared as functions -- Added GLSL 4.20 length for vector and matrix types -- Promoted GLM_GTC_noise extension: simplex, perlin, periodic noise functions -- Promoted GLM_GTC_random extension: linear, gaussian and various random number -generation distribution -- Added GLM_GTX_constants: provides useful constants -- Added extension versioning -- Removed many unused namespaces -- Fixed half based type contructors -- Added GLSL core noise functions - ---- -### [GLM 0.9.2.7](https://github.com/g-truc/glm/releases/tag/0.9.2.7) - 2011-10-24 -- Added more swizzling constructors -- Added missing none-squared matrix products - ---- -### [GLM 0.9.2.6](https://github.com/g-truc/glm/releases/tag/0.9.2.6) - 2011-10-01 -- Fixed half based type build on old GCC -- Fixed /W4 warnings on Visual C++ -- Fixed some missing l-value swizzle operators - ---- -### GLM 0.9.2.5 - 2011-09-20 -- Fixed floatBitToXint functions -- Fixed pack and unpack functions -- Fixed round functions - ---- -### GLM 0.9.2.4 - 2011-09-03 -- Fixed extensions bugs - ---- -### GLM 0.9.2.3 - 2011-06-08 -- Fixed build issues - ---- -### GLM 0.9.2.2 - 2011-06-02 -- Expend matrix constructors flexibility -- Improved quaternion implementation -- Fixed many warnings across platforms and compilers - ---- -### GLM 0.9.2.1 - 2011-05-24 -- Automatically detect CUDA support -- Improved compiler detection -- Fixed errors and warnings in VC with C++ extensions disabled -- Fixed and tested GLM_GTX_vector_angle -- Fixed and tested GLM_GTX_rotate_vector - ---- -### GLM 0.9.2.0 - 2011-05-09 -- Added CUDA support -- Added CTest test suite -- Added GLM_GTX_ulp extension -- Added GLM_GTX_noise extension -- Added GLM_GTX_matrix_interpolation extension -- Updated quaternion slerp interpolation - ---- -### [GLM 0.9.1.3](https://github.com/g-truc/glm/releases/tag/0.9.1.3) - 2011-05-07 -- Fixed bugs - ---- -### GLM 0.9.1.2 - 2011-04-15 -- Fixed bugs - ---- -### GLM 0.9.1.1 - 2011-03-17 -- Fixed bugs - ---- -### GLM 0.9.1.0 - 2011-03-03 -- Fixed bugs - ---- -### GLM 0.9.1.B - 2011-02-13 -- Updated API documentation -- Improved SIMD implementation -- Fixed Linux build - ---- -### [GLM 0.9.0.8](https://github.com/g-truc/glm/releases/tag/0.9.0.8) - 2011-02-13 -- Added quaternion product operator. -- Clarify that GLM is a header only library. - ---- -### GLM 0.9.1.A - 2011-01-31 -- Added SIMD support -- Added new swizzle functions -- Improved static assert error message with C++0x static_assert -- New setup system -- Reduced branching -- Fixed trunc implementation - ---- -### [GLM 0.9.0.7](https://github.com/g-truc/glm/releases/tag/0.9.0.7) - 2011-01-30 -- Added GLSL 4.10 packing functions -- Added == and != operators for every types. - ---- -### GLM 0.9.0.6 - 2010-12-21 -- Many matrices bugs fixed - ---- -### GLM 0.9.0.5 - 2010-11-01 -- Improved Clang support -- Fixed bugs - ---- -### GLM 0.9.0.4 - 2010-10-04 -- Added autoexp for GLM -- Fixed bugs - ---- -### GLM 0.9.0.3 - 2010-08-26 -- Fixed non-squared matrix operators - ---- -### GLM 0.9.0.2 - 2010-07-08 -- Added GLM_GTX_int_10_10_10_2 -- Fixed bugs - ---- -### GLM 0.9.0.1 - 2010-06-21 -- Fixed extensions errors - ---- -### GLM 0.9.0.0 - 2010-05-25 -- Objective-C support -- Fixed warnings -- Updated documentation - ---- -### GLM 0.9.B.2 - 2010-04-30 -- Git transition -- Removed experimental code from releases -- Fixed bugs - ---- -### GLM 0.9.B.1 - 2010-04-03 -- Based on GLSL 4.00 specification -- Added the new core functions -- Added some implicit conversion support - ---- -### GLM 0.9.A.2 - 2010-02-20 -- Improved some possible errors messages -- Improved declarations and definitions match - ---- -### GLM 0.9.A.1 - 2010-02-09 -- Removed deprecated features -- Internal redesign - ---- -### GLM 0.8.4.4 final - 2010-01-25 -- Fixed warnings - ---- -### GLM 0.8.4.3 final - 2009-11-16 -- Fixed Half float arithmetic -- Fixed setup defines - ---- -### GLM 0.8.4.2 final - 2009-10-19 -- Fixed Half float adds - ---- -### GLM 0.8.4.1 final - 2009-10-05 -- Updated documentation -- Fixed MacOS X build - ---- -### GLM 0.8.4.0 final - 2009-09-16 -- Added GCC 4.4 and VC2010 support -- Added matrix optimizations - ---- -### GLM 0.8.3.5 final - 2009-08-11 -- Fixed bugs - ---- -### GLM 0.8.3.4 final - 2009-08-10 -- Updated GLM according GLSL 1.5 spec -- Fixed bugs - ---- -### GLM 0.8.3.3 final - 2009-06-25 -- Fixed bugs - ---- -### GLM 0.8.3.2 final - 2009-06-04 -- Added GLM_GTC_quaternion -- Added GLM_GTC_type_precision - ---- -### GLM 0.8.3.1 final - 2009-05-21 -- Fixed old extension system. - ---- -### GLM 0.8.3.0 final - 2009-05-06 -- Added stable extensions. -- Added new extension system. - ---- -### GLM 0.8.2.3 final - 2009-04-01 -- Fixed bugs. - ---- -### GLM 0.8.2.2 final - 2009-02-24 -- Fixed bugs. - ---- -### GLM 0.8.2.1 final - 2009-02-13 -- Fixed bugs. - ---- -### GLM 0.8.2 final - 2009-01-21 -- Fixed bugs. - ---- -### GLM 0.8.1 final - 2008-10-30 -- Fixed bugs. - ---- -### GLM 0.8.0 final - 2008-10-23 -- New method to use extension. - ---- -### GLM 0.8.0 beta3 - 2008-10-10 -- Added CMake support for GLM tests. - ---- -### GLM 0.8.0 beta2 - 2008-10-04 -- Improved half scalars and vectors support. - ---- -### GLM 0.8.0 beta1 - 2008-09-26 -- Improved GLSL conformance -- Added GLSL 1.30 support -- Improved API documentation - ---- -### GLM 0.7.6 final - 2008-08-08 -- Improved C++ standard comformance -- Added Static assert for types checking - ---- -### GLM 0.7.5 final - 2008-07-05 -- Added build message system with Visual Studio -- Pedantic build with GCC - ---- -### GLM 0.7.4 final - 2008-06-01 -- Added external dependencies system. - ---- -### GLM 0.7.3 final - 2008-05-24 -- Fixed bugs -- Added new extension group - ---- -### GLM 0.7.2 final - 2008-04-27 -- Updated documentation -- Added preprocessor options - ---- -### GLM 0.7.1 final - 2008-03-24 -- Disabled half on GCC -- Fixed extensions - ---- -### GLM 0.7.0 final - 2008-03-22 -- Changed to MIT license -- Added new documentation - ---- -### GLM 0.6.4 - 2007-12-10 -- Fixed swizzle operators - ---- -### GLM 0.6.3 - 2007-11-05 -- Fixed type data accesses -- Fixed 3DSMax sdk conflict - ---- -### GLM 0.6.2 - 2007-10-08 -- Fixed extension - ---- -### GLM 0.6.1 - 2007-10-07 -- Fixed a namespace error -- Added extensions - ---- -### GLM 0.6.0 : 2007-09-16 -- Added new extension namespace mecanium -- Added Automatic compiler detection - ---- -### GLM 0.5.1 - 2007-02-19 -- Fixed swizzle operators - ---- -### GLM 0.5.0 - 2007-01-06 -- Upgrated to GLSL 1.2 -- Added swizzle operators -- Added setup settings - ---- -### GLM 0.4.1 - 2006-05-22 -- Added OpenGL examples - ---- -### GLM 0.4.0 - 2006-05-17 -- Added missing operators to vec* and mat* -- Added first GLSL 1.2 features -- Fixed windows.h before glm.h when windows.h required - ---- -### GLM 0.3.2 - 2006-04-21 -- Fixed texcoord components access. -- Fixed mat4 and imat4 division operators. - ---- -### GLM 0.3.1 - 2006-03-28 -- Added GCC 4.0 support under MacOS X. -- Added GCC 4.0 and 4.1 support under Linux. -- Added code optimisations. - ---- -### GLM 0.3 - 2006-02-19 -- Improved GLSL type conversion and construction compliance. -- Added experimental extensions. -- Added Doxygen Documentation. -- Added code optimisations. -- Fixed bugs. - ---- -### GLM 0.2 - 2005-05-05 -- Improve adaptative from GLSL. -- Add experimental extensions based on OpenGL extension process. -- Fixe bugs. - ---- -### GLM 0.1 - 2005-02-21 -- Add vec2, vec3, vec4 GLSL types -- Add ivec2, ivec3, ivec4 GLSL types -- Add bvec2, bvec3, bvec4 GLSL types -- Add mat2, mat3, mat4 GLSL types -- Add almost all functions - diff --git a/3rdparty/glm/source/test/CMakeLists.txt b/3rdparty/glm/source/test/CMakeLists.txt deleted file mode 100644 index e7f85f1..0000000 --- a/3rdparty/glm/source/test/CMakeLists.txt +++ /dev/null @@ -1,246 +0,0 @@ -option(GLM_QUIET "No CMake Message" OFF) -option(BUILD_SHARED_LIBS "Build shared library" ON) -option(BUILD_STATIC_LIBS "Build static library" ON) -option(GLM_TEST_ENABLE_CXX_98 "Enable C++ 98" OFF) -option(GLM_TEST_ENABLE_CXX_11 "Enable C++ 11" OFF) -option(GLM_TEST_ENABLE_CXX_14 "Enable C++ 14" OFF) -option(GLM_TEST_ENABLE_CXX_17 "Enable C++ 17" OFF) -option(GLM_TEST_ENABLE_CXX_20 "Enable C++ 20" OFF) - -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -if(GLM_TEST_ENABLE_CXX_20) - set(CMAKE_CXX_STANDARD 20) - add_definitions(-DGLM_FORCE_CXX2A) - if(NOT GLM_QUIET) - message(STATUS "GLM: Build with C++20 features") - endif() - -elseif(GLM_TEST_ENABLE_CXX_17) - set(CMAKE_CXX_STANDARD 17) - add_definitions(-DGLM_FORCE_CXX17) - if(NOT GLM_QUIET) - message(STATUS "GLM: Build with C++17 features") - endif() - -elseif(GLM_TEST_ENABLE_CXX_14) - set(CMAKE_CXX_STANDARD 14) - add_definitions(-DGLM_FORCE_CXX14) - if(NOT GLM_QUIET) - message(STATUS "GLM: Build with C++14 features") - endif() - -elseif(GLM_TEST_ENABLE_CXX_11) - set(CMAKE_CXX_STANDARD 11) - add_definitions(-DGLM_FORCE_CXX11) - if(NOT GLM_QUIET) - message(STATUS "GLM: Build with C++11 features") - endif() - -elseif(GLM_TEST_ENABLE_CXX_98) - set(CMAKE_CXX_STANDARD 98) - add_definitions(-DGLM_FORCE_CXX98) - if(NOT GLM_QUIET) - message(STATUS "GLM: Build with C++98 features") - endif() -endif() - -option(GLM_TEST_ENABLE_LANG_EXTENSIONS "Enable language extensions" OFF) - -option(GLM_DISABLE_AUTO_DETECTION "Enable language extensions" OFF) - -if(GLM_DISABLE_AUTO_DETECTION) - add_definitions(-DGLM_FORCE_PLATFORM_UNKNOWN -DGLM_FORCE_COMPILER_UNKNOWN -DGLM_FORCE_ARCH_UNKNOWN -DGLM_FORCE_CXX_UNKNOWN) -endif() - -if(GLM_TEST_ENABLE_LANG_EXTENSIONS) - set(CMAKE_CXX_EXTENSIONS ON) - if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "GNU")) - add_compile_options(-fms-extensions) - endif() - message(STATUS "GLM: Build with C++ language extensions") -else() - set(CMAKE_CXX_EXTENSIONS OFF) - if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - add_compile_options(/Za) - if(MSVC15) - add_compile_options(/permissive-) - endif() - endif() -endif() - -option(GLM_TEST_ENABLE_FAST_MATH "Enable fast math optimizations" OFF) -if(GLM_TEST_ENABLE_FAST_MATH) - if(NOT GLM_QUIET) - message(STATUS "GLM: Build with fast math optimizations") - endif() - - if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "GNU")) - add_compile_options(-ffast-math) - - elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - add_compile_options(/fp:fast) - endif() -else() - if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - add_compile_options(/fp:precise) - endif() -endif() - -option(GLM_TEST_ENABLE "Build unit tests" ON) -option(GLM_TEST_ENABLE_SIMD_SSE2 "Enable SSE2 optimizations" OFF) -option(GLM_TEST_ENABLE_SIMD_SSE3 "Enable SSE3 optimizations" OFF) -option(GLM_TEST_ENABLE_SIMD_SSSE3 "Enable SSSE3 optimizations" OFF) -option(GLM_TEST_ENABLE_SIMD_SSE4_1 "Enable SSE 4.1 optimizations" OFF) -option(GLM_TEST_ENABLE_SIMD_SSE4_2 "Enable SSE 4.2 optimizations" OFF) -option(GLM_TEST_ENABLE_SIMD_AVX "Enable AVX optimizations" OFF) -option(GLM_TEST_ENABLE_SIMD_AVX2 "Enable AVX2 optimizations" OFF) -option(GLM_TEST_FORCE_PURE "Force 'pure' instructions" OFF) - -if(GLM_TEST_FORCE_PURE) - add_definitions(-DGLM_FORCE_PURE) - - if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") - add_compile_options(-mfpmath=387) - endif() - message(STATUS "GLM: No SIMD instruction set") - -elseif(GLM_TEST_ENABLE_SIMD_AVX2) - add_definitions(-DGLM_FORCE_INTRINSICS) - - if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) - add_compile_options(-mavx2) - elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") - add_compile_options(/QxAVX2) - elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - add_compile_options(/arch:AVX2) - endif() - message(STATUS "GLM: AVX2 instruction set") - -elseif(GLM_TEST_ENABLE_SIMD_AVX) - add_definitions(-DGLM_FORCE_INTRINSICS) - - if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) - add_compile_options(-mavx) - elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") - add_compile_options(/QxAVX) - elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - add_compile_options(/arch:AVX) - endif() - message(STATUS "GLM: AVX instruction set") - -elseif(GLM_TEST_ENABLE_SIMD_SSE4_2) - add_definitions(-DGLM_FORCE_INTRINSICS) - - if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) - add_compile_options(-msse4.2) - elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") - add_compile_options(/QxSSE4.2) - elseif((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND NOT CMAKE_CL_64) - add_compile_options(/arch:SSE2) # VC doesn't support SSE4.2 - endif() - message(STATUS "GLM: SSE4.2 instruction set") - -elseif(GLM_TEST_ENABLE_SIMD_SSE4_1) - add_definitions(-DGLM_FORCE_INTRINSICS) - - if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) - add_compile_options(-msse4.1) - elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") - add_compile_options(/QxSSE4.1) - elseif((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND NOT CMAKE_CL_64) - add_compile_options(/arch:SSE2) # VC doesn't support SSE4.1 - endif() - message(STATUS "GLM: SSE4.1 instruction set") - -elseif(GLM_TEST_ENABLE_SIMD_SSSE3) - add_definitions(-DGLM_FORCE_INTRINSICS) - - if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) - add_compile_options(-mssse3) - elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") - add_compile_options(/QxSSSE3) - elseif((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND NOT CMAKE_CL_64) - add_compile_options(/arch:SSE2) # VC doesn't support SSSE3 - endif() - message(STATUS "GLM: SSSE3 instruction set") - -elseif(GLM_TEST_ENABLE_SIMD_SSE3) - add_definitions(-DGLM_FORCE_INTRINSICS) - - if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) - add_compile_options(-msse3) - elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") - add_compile_options(/QxSSE3) - elseif((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND NOT CMAKE_CL_64) - add_compile_options(/arch:SSE2) # VC doesn't support SSE3 - endif() - message(STATUS "GLM: SSE3 instruction set") - -elseif(GLM_TEST_ENABLE_SIMD_SSE2) - add_definitions(-DGLM_FORCE_INTRINSICS) - - if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) - add_compile_options(-msse2) - elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") - add_compile_options(/QxSSE2) - elseif((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND NOT CMAKE_CL_64) - add_compile_options(/arch:SSE2) - endif() - message(STATUS "GLM: SSE2 instruction set") -endif() - -# Compiler and default options - -if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - if(NOT GLM_QUIET) - message("GLM: Clang - ${CMAKE_CXX_COMPILER_ID} compiler") - endif() - - add_compile_options(-Werror -Weverything) - add_compile_options(-Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-c++11-long-long -Wno-padded -Wno-gnu-anonymous-struct -Wno-nested-anon-types) - add_compile_options(-Wno-undefined-reinterpret-cast -Wno-sign-conversion -Wno-unused-variable -Wno-missing-prototypes -Wno-unreachable-code -Wno-missing-variable-declarations -Wno-sign-compare -Wno-global-constructors -Wno-unused-macros -Wno-format-nonliteral) - -elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU") - if(NOT GLM_QUIET) - message("GLM: GCC - ${CMAKE_CXX_COMPILER_ID} compiler") - endif() - - add_compile_options(-O2) - add_compile_options(-Wno-long-long) - -elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") - if(NOT GLM_QUIET) - message("GLM: Intel - ${CMAKE_CXX_COMPILER_ID} compiler") - endif() - -elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - if(NOT GLM_QUIET) - message("GLM: Visual C++ - ${CMAKE_CXX_COMPILER_ID} compiler") - endif() - - add_compile_options(/W4 /WX) - add_compile_options(/wd4309 /wd4324 /wd4389 /wd4127 /wd4267 /wd4146 /wd4201 /wd4464 /wd4514 /wd4701 /wd4820 /wd4365) - add_definitions(-D_CRT_SECURE_NO_WARNINGS) -endif() - -function(glmCreateTestGTC NAME) - set(SAMPLE_NAME test-${NAME}) - add_executable(${SAMPLE_NAME} ${NAME}.cpp) - - add_test( - NAME ${SAMPLE_NAME} - COMMAND $ ) - target_link_libraries(${SAMPLE_NAME} PRIVATE glm::glm) -endfunction() - -if(GLM_TEST_ENABLE) - add_subdirectory(bug) - add_subdirectory(core) - add_subdirectory(ext) - add_subdirectory(gtc) - add_subdirectory(gtx) - add_subdirectory(perf) -endif() - - diff --git a/3rdparty/glm/source/test/bug/CMakeLists.txt b/3rdparty/glm/source/test/bug/CMakeLists.txt deleted file mode 100644 index 26e8569..0000000 --- a/3rdparty/glm/source/test/bug/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -glmCreateTestGTC(bug_ms_vec_static) diff --git a/3rdparty/glm/source/test/bug/bug_ms_vec_static.cpp b/3rdparty/glm/source/test/bug/bug_ms_vec_static.cpp deleted file mode 100644 index 7f44e40..0000000 --- a/3rdparty/glm/source/test/bug/bug_ms_vec_static.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include - -#if GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE -struct vec2; - -struct _swizzle -{ - char _buffer[1]; -}; - -struct vec2 -{ - GLM_CONSTEXPR vec2() : - x(0), y(0) - {} - - union - { - struct { float x, y; }; - struct { _swizzle xx; }; - }; -}; -#endif - -// Visual C++ has a bug generating the error: fatal error C1001: An internal error has occurred in the compiler. -// vec2 Bar; - -int main() -{ - return 0; -} diff --git a/3rdparty/glm/source/test/cmake/CMakeLists.txt b/3rdparty/glm/source/test/cmake/CMakeLists.txt deleted file mode 100644 index 5bc11ef..0000000 --- a/3rdparty/glm/source/test/cmake/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.2 FATAL_ERROR) -project(test_find_glm) - -find_package(glm REQUIRED) - -add_executable(test_find_glm test_find_glm.cpp) -target_link_libraries(test_find_glm glm::glm) - diff --git a/3rdparty/glm/source/test/cmake/test_find_glm.cpp b/3rdparty/glm/source/test/cmake/test_find_glm.cpp deleted file mode 100644 index 361b977..0000000 --- a/3rdparty/glm/source/test/cmake/test_find_glm.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include -#include -#include - -glm::mat4 camera(float Translate, glm::vec2 const& Rotate) -{ - glm::mat4 Projection = glm::perspective(glm::pi() * 0.25f, 4.0f / 3.0f, 0.1f, 100.f); - glm::mat4 View = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 0.0f, -Translate)); - View = glm::rotate(View, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f)); - View = glm::rotate(View, Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f)); - glm::mat4 Model = glm::scale(glm::mat4(1.0f), glm::vec3(0.5f)); - return Projection * View * Model; -} - -int main() -{ - const glm::mat4 m = camera(1.f, glm::vec2(1.f, 0.5f)); - std::cout << "matrix diagonal: " << m[0][0] << ", " - << m[1][1] << ", " << m[2][2] << ", " << m[3][3] << "\n"; - return 0; -} - diff --git a/3rdparty/glm/source/test/core/CMakeLists.txt b/3rdparty/glm/source/test/core/CMakeLists.txt deleted file mode 100644 index 6cd57b1..0000000 --- a/3rdparty/glm/source/test/core/CMakeLists.txt +++ /dev/null @@ -1,52 +0,0 @@ -glmCreateTestGTC(core_cpp_constexpr) -glmCreateTestGTC(core_cpp_defaulted_ctor) -glmCreateTestGTC(core_force_aligned_gentypes) -glmCreateTestGTC(core_force_ctor_init) -glmCreateTestGTC(core_force_cxx03) -glmCreateTestGTC(core_force_cxx98) -glmCreateTestGTC(core_force_arch_unknown) -glmCreateTestGTC(core_force_compiler_unknown) -glmCreateTestGTC(core_force_cxx_unknown) -glmCreateTestGTC(core_force_explicit_ctor) -glmCreateTestGTC(core_force_inline) -glmCreateTestGTC(core_force_platform_unknown) -glmCreateTestGTC(core_force_pure) -glmCreateTestGTC(core_force_unrestricted_gentype) -glmCreateTestGTC(core_force_xyzw_only) -glmCreateTestGTC(core_force_quat_xyzw) -glmCreateTestGTC(core_type_aligned) -glmCreateTestGTC(core_type_cast) -glmCreateTestGTC(core_type_ctor) -glmCreateTestGTC(core_type_int) -glmCreateTestGTC(core_type_length) -glmCreateTestGTC(core_type_mat2x2) -glmCreateTestGTC(core_type_mat2x3) -glmCreateTestGTC(core_type_mat2x4) -glmCreateTestGTC(core_type_mat3x2) -glmCreateTestGTC(core_type_mat3x3) -glmCreateTestGTC(core_type_mat3x4) -glmCreateTestGTC(core_type_mat4x2) -glmCreateTestGTC(core_type_mat4x3) -glmCreateTestGTC(core_type_mat4x4) -glmCreateTestGTC(core_type_vec1) -glmCreateTestGTC(core_type_vec2) -glmCreateTestGTC(core_type_vec3) -glmCreateTestGTC(core_type_vec4) -glmCreateTestGTC(core_func_common) -glmCreateTestGTC(core_func_exponential) -glmCreateTestGTC(core_func_geometric) -glmCreateTestGTC(core_func_integer) -glmCreateTestGTC(core_func_integer_bit_count) -glmCreateTestGTC(core_func_integer_find_lsb) -glmCreateTestGTC(core_func_integer_find_msb) -glmCreateTestGTC(core_func_matrix) -glmCreateTestGTC(core_func_noise) -glmCreateTestGTC(core_func_packing) -glmCreateTestGTC(core_func_trigonometric) -glmCreateTestGTC(core_func_vector_relational) -glmCreateTestGTC(core_func_swizzle) -glmCreateTestGTC(core_setup_force_cxx98) -glmCreateTestGTC(core_setup_force_size_t_length) -glmCreateTestGTC(core_setup_message) -glmCreateTestGTC(core_setup_platform_unknown) -glmCreateTestGTC(core_setup_precision) diff --git a/3rdparty/glm/source/test/core/core_cpp_constexpr.cpp b/3rdparty/glm/source/test/core/core_cpp_constexpr.cpp deleted file mode 100644 index 3dc0a92..0000000 --- a/3rdparty/glm/source/test/core/core_cpp_constexpr.cpp +++ /dev/null @@ -1,750 +0,0 @@ -#include - -#if GLM_CONFIG_CONSTEXP == GLM_ENABLE - -#include -#include -#include -#include -#include -#include -#include -#include - -static int test_vec1() -{ - int Error = 0; - - { - constexpr glm::bvec1 B(true); - constexpr bool A = glm::all(B); - static_assert(A, "GLM: Failed constexpr"); - - constexpr glm::bvec1 D(true); - constexpr bool C = glm::any(D); - static_assert(C, "GLM: Failed constexpr"); - } - - { - constexpr glm::bvec2 C(true); - constexpr glm::bvec2 B(true); - static_assert(glm::any(glm::equal(C, B)), "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec1 O(glm::ivec1(1)); - static_assert(glm::ivec1(1) == O, "GLM: Failed constexpr"); - - constexpr glm::ivec1 P(1); - static_assert(glm::ivec1(1) == P, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec1 L(glm::ivec2(1, 2)); - static_assert(glm::ivec1(1) == L, "GLM: Failed constexpr"); - - constexpr glm::ivec1 M(glm::ivec3(1, 2, 3)); - static_assert(glm::ivec1(1) == M, "GLM: Failed constexpr"); - - constexpr glm::ivec1 N(glm::ivec4(1, 2, 3, 4)); - static_assert(glm::ivec1(1) == N, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec1 A(1); - static_assert(A[0] == 1, "GLM: Failed constexpr"); - static_assert(glm::vec1(1.0f).x > 0.0f, "GLM: Failed constexpr"); - static_assert(glm::vec1::length() == 1, "GLM: Failed constexpr"); - } - - { - constexpr glm::bvec1 A1(true); - constexpr glm::bvec1 A2(true); - constexpr glm::bvec1 B1(false); - constexpr glm::bvec1 B2(false); - static_assert(A1 == A2 && B1 == B2, "GLM: Failed constexpr"); - static_assert(A1 == A2 || B1 == B2, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec1 A(1); - constexpr glm::ivec1 B = A + 1; - constexpr glm::ivec1 C(3); - static_assert(A + B == C, "GLM: Failed constexpr"); - - constexpr glm::ivec1 D = +A; - static_assert(D == A, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec1 A(3); - constexpr glm::ivec1 B = A - 1; - constexpr glm::ivec1 C(1); - static_assert(A - B == C, "GLM: Failed constexpr"); - - constexpr glm::ivec1 D = -A; - static_assert(-D == A, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec1 A(3); - constexpr glm::ivec1 B = A * 1; - static_assert(A == B, "GLM: Failed constexpr"); - - constexpr glm::ivec1 C(1); - static_assert(B * C == A, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec1 A(3); - constexpr glm::ivec1 B = A / 1; - static_assert(A == B, "GLM: Failed constexpr"); - - constexpr glm::ivec1 C(1); - static_assert(B / C == A, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec1 A(3); - constexpr glm::ivec1 B = A % 2; - constexpr glm::ivec1 C(1); - static_assert(B == C, "GLM: Failed constexpr"); - - constexpr glm::ivec1 D(2); - static_assert(A % D == C, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec1 A(1); - constexpr glm::ivec1 B = A & 1; - static_assert(A == B, "GLM: Failed constexpr"); - - constexpr glm::ivec1 C(1); - static_assert(A == (A & C), "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec1 A(1); - constexpr glm::ivec1 B = A | 1; - static_assert(A == B, "GLM: Failed constexpr"); - - constexpr glm::ivec1 C(1); - static_assert(A == (A | C), "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec1 A(1); - constexpr glm::ivec1 B = A ^ 0; - static_assert(A == B, "GLM: Failed constexpr"); - - constexpr glm::ivec1 C(0); - static_assert(A == (A ^ C), "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec1 A(1); - constexpr glm::ivec1 B = A << 1; - static_assert(B == glm::ivec1(2), "GLM: Failed constexpr"); - - constexpr glm::ivec1 C(1); - static_assert(B == (A << C), "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec1 A(2); - constexpr glm::ivec1 B = A >> 1; - static_assert(B == glm::ivec1(1), "GLM: Failed constexpr"); - - constexpr glm::ivec1 C(1); - static_assert(B == A >> C, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec1 A(~0); - constexpr glm::ivec1 B = ~A; - static_assert(A == ~B, "GLM: Failed constexpr"); - } - - return Error; -} - -static int test_vec2() -{ - int Error = 0; - - { - constexpr glm::bvec2 B(true); - constexpr bool A = glm::all(B); - static_assert(A, "GLM: Failed constexpr"); - - constexpr glm::bvec2 D(true, false); - constexpr bool C = glm::any(D); - static_assert(C, "GLM: Failed constexpr"); - } - - { - constexpr glm::bvec2 C(true); - constexpr glm::bvec2 B(true, false); - static_assert(glm::any(glm::equal(C, B)), "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec2 O(glm::ivec1(1)); - static_assert(glm::ivec2(1) == O, "GLM: Failed constexpr"); - - constexpr glm::ivec2 A(1); - static_assert(glm::ivec2(1) == A, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec2 F(glm::ivec1(1), glm::ivec1(2)); - static_assert(glm::ivec2(1, 2) == F, "GLM: Failed constexpr"); - - constexpr glm::ivec2 G(1, glm::ivec1(2)); - static_assert(glm::ivec2(1, 2) == G, "GLM: Failed constexpr"); - - constexpr glm::ivec2 H(glm::ivec1(1), 2); - static_assert(glm::ivec2(1, 2) == H, "GLM: Failed constexpr"); - - constexpr glm::ivec2 I(1, 2); - static_assert(glm::ivec2(1, 2) == I, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec2 L(glm::ivec2(1, 2)); - static_assert(glm::ivec2(1, 2) == L, "GLM: Failed constexpr"); - - constexpr glm::ivec2 M(glm::ivec3(1, 2, 3)); - static_assert(glm::ivec2(1, 2) == M, "GLM: Failed constexpr"); - - constexpr glm::ivec2 N(glm::ivec4(1, 2, 3, 4)); - static_assert(glm::ivec2(1, 2) == N, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec2 A(1); - static_assert(A[0] == 1, "GLM: Failed constexpr"); - static_assert(glm::vec2(1.0f).x > 0.0f, "GLM: Failed constexpr"); - static_assert(glm::vec2(1.0f, -1.0f).x > 0.0f, "GLM: Failed constexpr"); - static_assert(glm::vec2(1.0f, -1.0f).y < 0.0f, "GLM: Failed constexpr"); - static_assert(glm::vec2::length() == 2, "GLM: Failed constexpr"); - } - - { - constexpr glm::bvec2 A1(true); - constexpr glm::bvec2 A2(true); - constexpr glm::bvec2 B1(false); - constexpr glm::bvec2 B2(false); - static_assert(A1 == A2 && B1 == B2, "GLM: Failed constexpr"); - static_assert(A1 == A2 || B1 == B2, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec2 A(1); - constexpr glm::ivec2 B = A + 1; - constexpr glm::ivec2 C(3); - static_assert(A + B == C, "GLM: Failed constexpr"); - - constexpr glm::ivec2 D = +A; - static_assert(D == A, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec2 A(3); - constexpr glm::ivec2 B = A - 1; - constexpr glm::ivec2 C(1); - static_assert(A - B == C, "GLM: Failed constexpr"); - - constexpr glm::ivec2 D = -A; - static_assert(-D == A, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec2 A(3); - constexpr glm::ivec2 B = A * 1; - static_assert(A == B, "GLM: Failed constexpr"); - - constexpr glm::ivec2 C(1); - static_assert(B * C == A, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec2 A(3); - constexpr glm::ivec2 B = A / 1; - static_assert(A == B, "GLM: Failed constexpr"); - - constexpr glm::ivec2 C(1); - static_assert(B / C == A, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec2 A(3); - constexpr glm::ivec2 B = A % 2; - constexpr glm::ivec2 C(1); - static_assert(B == C, "GLM: Failed constexpr"); - - constexpr glm::ivec1 D(2); - static_assert(A % D == C, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec2 A(1); - constexpr glm::ivec2 B = A & 1; - static_assert(A == B, "GLM: Failed constexpr"); - - constexpr glm::ivec1 C(1); - static_assert(A == (A & C), "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec2 A(1); - constexpr glm::ivec2 B = A | 1; - static_assert(A == B, "GLM: Failed constexpr"); - - constexpr glm::ivec1 C(1); - static_assert(A == (A | C), "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec2 A(1); - constexpr glm::ivec2 B = A ^ 0; - static_assert(A == B, "GLM: Failed constexpr"); - - constexpr glm::ivec1 C(0); - static_assert(A == (A ^ C), "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec2 A(1); - constexpr glm::ivec2 B = A << 1; - static_assert(B == glm::ivec2(2), "GLM: Failed constexpr"); - - constexpr glm::ivec1 C(1); - static_assert(B == (A << C), "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec2 A(2); - constexpr glm::ivec2 B = A >> 1; - static_assert(B == glm::ivec2(1), "GLM: Failed constexpr"); - - constexpr glm::ivec1 C(1); - static_assert(B == A >> C, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec2 A(~0); - constexpr glm::ivec2 B = ~A; - static_assert(A == ~B, "GLM: Failed constexpr"); - } - - return Error; -} - -static int test_vec3() -{ - int Error = 0; - - { - constexpr glm::bvec3 B(true); - constexpr bool A = glm::all(B); - static_assert(A, "GLM: Failed constexpr"); - - constexpr glm::bvec3 D(true, false, true); - constexpr bool C = glm::any(D); - static_assert(C, "GLM: Failed constexpr"); - } - - { - constexpr glm::bvec3 C(true); - constexpr glm::bvec3 B(true, false, true); - static_assert(glm::any(glm::equal(C, B)), "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec3 O(glm::ivec1(1)); - static_assert(glm::ivec3(1) == O, "GLM: Failed constexpr"); - - constexpr glm::ivec3 A(1); - static_assert(glm::ivec3(1) == A, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec3 B(glm::ivec2(1, 2), 3); - static_assert(glm::ivec3(1, 2, 3) == B, "GLM: Failed constexpr"); - - constexpr glm::ivec3 C(1, glm::ivec2(2, 3)); - static_assert(glm::ivec3(1, 2, 3) == C, "GLM: Failed constexpr"); - - constexpr glm::ivec3 D(glm::ivec1(1), glm::ivec2(2, 3)); - static_assert(glm::ivec3(1, 2, 3) == D, "GLM: Failed constexpr"); - - constexpr glm::ivec3 E(glm::ivec2(1, 2), glm::ivec1(3)); - static_assert(glm::ivec3(1, 2, 3) == E, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec3 F(glm::ivec1(1), glm::ivec1(2), glm::ivec1(3)); - static_assert(glm::ivec3(1, 2, 3) == F, "GLM: Failed constexpr"); - - constexpr glm::ivec3 G(1, glm::ivec1(2), glm::ivec1(3)); - static_assert(glm::ivec3(1, 2, 3) == G, "GLM: Failed constexpr"); - - constexpr glm::ivec3 H(glm::ivec1(1), 2, glm::ivec1(3)); - static_assert(glm::ivec3(1, 2, 3) == H, "GLM: Failed constexpr"); - - constexpr glm::ivec3 I(1, 2, glm::ivec1(3)); - static_assert(glm::ivec3(1, 2, 3) == I, "GLM: Failed constexpr"); - - constexpr glm::ivec3 J(glm::ivec1(1), glm::ivec1(2), 3); - static_assert(glm::ivec3(1, 2, 3) == J, "GLM: Failed constexpr"); - - constexpr glm::ivec3 K(1, glm::ivec1(2), 3); - static_assert(glm::ivec3(1, 2, 3) == K, "GLM: Failed constexpr"); - - constexpr glm::ivec3 L(glm::ivec1(1), 2, 3); - static_assert(glm::ivec3(1, 2, 3) == L, "GLM: Failed constexpr"); - - constexpr glm::ivec3 M(1, 2, 3); - static_assert(glm::ivec3(1, 2, 3) == M, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec3 N(glm::ivec4(1, 2, 3, 4)); - static_assert(glm::ivec3(1, 2, 3) == N, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec3 const A(1); - static_assert(A[0] == 1, "GLM: Failed constexpr"); - static_assert(glm::vec3(1.0f).x > 0.0f, "GLM: Failed constexpr"); - static_assert(glm::vec3(1.0f, -1.0f, -1.0f).x > 0.0f, "GLM: Failed constexpr"); - static_assert(glm::vec3(1.0f, -1.0f, -1.0f).y < 0.0f, "GLM: Failed constexpr"); - static_assert(glm::vec3::length() == 3, "GLM: Failed constexpr"); - } - - { - constexpr glm::bvec3 A1(true); - constexpr glm::bvec3 A2(true); - constexpr glm::bvec3 B1(false); - constexpr glm::bvec3 B2(false); - static_assert(A1 == A2 && B1 == B2, "GLM: Failed constexpr"); - static_assert(A1 == A2 || B1 == B2, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec3 A(1); - constexpr glm::ivec3 B = A + 1; - constexpr glm::ivec3 C(3); - static_assert(A + B == C, "GLM: Failed constexpr"); - - constexpr glm::ivec3 D = +A; - static_assert(D == A, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec3 A(3); - constexpr glm::ivec3 B = A - 1; - constexpr glm::ivec3 C(1); - static_assert(A - B == C, "GLM: Failed constexpr"); - - constexpr glm::ivec3 D = -A; - static_assert(-D == A, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec3 A(3); - constexpr glm::ivec3 B = A * 1; - static_assert(A == B, "GLM: Failed constexpr"); - - constexpr glm::ivec3 C(1); - static_assert(B * C == A, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec3 A(3); - constexpr glm::ivec3 B = A / 1; - static_assert(A == B, "GLM: Failed constexpr"); - - constexpr glm::ivec3 C(1); - static_assert(B / C == A, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec3 A(3); - constexpr glm::ivec3 B = A % 2; - constexpr glm::ivec3 C(1); - static_assert(B == C, "GLM: Failed constexpr"); - - constexpr glm::ivec1 D(2); - static_assert(A % D == C, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec3 A(1); - constexpr glm::ivec3 B = A & 1; - static_assert(A == B, "GLM: Failed constexpr"); - - constexpr glm::ivec1 C(1); - static_assert(A == (A & C), "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec3 A(1); - constexpr glm::ivec3 B = A | 1; - static_assert(A == B, "GLM: Failed constexpr"); - - constexpr glm::ivec1 C(1); - static_assert(A == (A | C), "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec3 A(1); - constexpr glm::ivec3 B = A ^ 0; - static_assert(A == B, "GLM: Failed constexpr"); - - constexpr glm::ivec1 C(0); - static_assert(A == (A ^ C), "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec3 A(1); - constexpr glm::ivec3 B = A << 1; - static_assert(B == glm::ivec3(2), "GLM: Failed constexpr"); - - constexpr glm::ivec1 C(1); - static_assert(B == (A << C), "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec3 A(2); - constexpr glm::ivec3 B = A >> 1; - static_assert(B == glm::ivec3(1), "GLM: Failed constexpr"); - - constexpr glm::ivec1 C(1); - static_assert(B == A >> C, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec3 A(~0); - constexpr glm::ivec3 B = ~A; - static_assert(A == ~B, "GLM: Failed constexpr"); - } - - return Error; -} - -static int test_vec4() -{ - int Error = 0; - - { - constexpr glm::bvec4 B(true); - constexpr bool A = glm::all(B); - static_assert(A, "GLM: Failed constexpr"); - - constexpr glm::bvec4 D(true, false, true, false); - constexpr bool C = glm::any(D); - static_assert(C, "GLM: Failed constexpr"); - } - - { - constexpr glm::bvec4 C(true); - constexpr glm::bvec4 B(true, false, true, false); - static_assert(glm::any(glm::equal(C, B)), "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec4 O(glm::ivec4(1)); - static_assert(glm::ivec4(1) == O, "GLM: Failed constexpr"); - - constexpr glm::ivec4 A(1); - static_assert(glm::ivec4(1) == A, "GLM: Failed constexpr"); - - constexpr glm::ivec4 N(glm::ivec4(1, 2, 3, 4)); - static_assert(glm::ivec4(1, 2, 3, 4) == N, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec4 A(glm::ivec3(1, 2, 3), 4); - static_assert(glm::ivec4(1, 2, 3, 4) == A, "GLM: Failed constexpr"); - - constexpr glm::ivec4 B(glm::ivec2(1, 2), glm::ivec2(3, 4)); - static_assert(glm::ivec4(1, 2, 3, 4) == B, "GLM: Failed constexpr"); - - constexpr glm::ivec4 C(1, glm::ivec3(2, 3, 4)); - static_assert(glm::ivec4(1, 2, 3, 4) == C, "GLM: Failed constexpr"); - - constexpr glm::ivec4 D(glm::ivec1(1), glm::ivec2(2, 3), glm::ivec1(4)); - static_assert(glm::ivec4(1, 2, 3, 4) == D, "GLM: Failed constexpr"); - - constexpr glm::ivec4 E(glm::ivec2(1, 2), glm::ivec1(3), glm::ivec1(4)); - static_assert(glm::ivec4(1, 2, 3, 4) == E, "GLM: Failed constexpr"); - - constexpr glm::ivec4 F(glm::ivec1(1), glm::ivec1(2), glm::ivec2(3, 4)); - static_assert(glm::ivec4(1, 2, 3, 4) == F, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec4 A(1); - static_assert(A[0] == 1, "GLM: Failed constexpr"); - static_assert(glm::ivec4(1).x > 0, "GLM: Failed constexpr"); - static_assert(glm::ivec4(1.0f, -1.0f, -1.0f, 1.0f).x > 0, "GLM: Failed constexpr"); - static_assert(glm::ivec4(1.0f, -1.0f, -1.0f, 1.0f).y < 0, "GLM: Failed constexpr"); - static_assert(glm::ivec4::length() == 4, "GLM: Failed constexpr"); - } - - { - constexpr glm::bvec4 A1(true); - constexpr glm::bvec4 A2(true); - constexpr glm::bvec4 B1(false); - constexpr glm::bvec4 B2(false); - static_assert(A1 == A2 && B1 == B2, "GLM: Failed constexpr"); - static_assert(A1 == A2 || B1 == B2, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec4 A(1); - constexpr glm::ivec4 B = A + 1; - constexpr glm::ivec4 C(3); - static_assert(A + B == C, "GLM: Failed constexpr"); - - constexpr glm::ivec4 D = +A; - static_assert(D == A, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec4 A(3); - constexpr glm::ivec4 B = A - 1; - constexpr glm::ivec4 C(1); - static_assert(A - B == C, "GLM: Failed constexpr"); - - constexpr glm::ivec4 D = -A; - static_assert(-D == A, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec4 A(3); - constexpr glm::ivec4 B = A * 1; - static_assert(A == B, "GLM: Failed constexpr"); - - constexpr glm::ivec4 C(1); - static_assert(B * C == A, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec4 A(3); - constexpr glm::ivec4 B = A / 1; - static_assert(A == B, "GLM: Failed constexpr"); - - constexpr glm::ivec4 C(1); - static_assert(B / C == A, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec4 A(3); - constexpr glm::ivec4 B = A % 2; - constexpr glm::ivec4 C(1); - static_assert(B == C, "GLM: Failed constexpr"); - - constexpr glm::ivec1 D(2); - static_assert(A % D == C, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec4 A(1); - constexpr glm::ivec4 B = A & 1; - static_assert(A == B, "GLM: Failed constexpr"); - - constexpr glm::ivec1 C(1); - static_assert(A == (A & C), "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec4 A(1); - constexpr glm::ivec4 B = A | 1; - static_assert(A == B, "GLM: Failed constexpr"); - - constexpr glm::ivec1 C(1); - static_assert(A == (A | C), "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec4 A(1); - constexpr glm::ivec4 B = A ^ 0; - static_assert(A == B, "GLM: Failed constexpr"); - - constexpr glm::ivec1 C(0); - static_assert(A == (A ^ C), "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec4 A(1); - constexpr glm::ivec4 B = A << 1; - static_assert(B == glm::ivec4(2), "GLM: Failed constexpr"); - - constexpr glm::ivec1 C(1); - static_assert(B == (A << C), "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec4 A(2); - constexpr glm::ivec4 B = A >> 1; - static_assert(B == glm::ivec4(1), "GLM: Failed constexpr"); - - constexpr glm::ivec1 C(1); - static_assert(B == A >> C, "GLM: Failed constexpr"); - } - - { - constexpr glm::ivec4 A(~0); - constexpr glm::ivec4 B = ~A; - static_assert(A == ~B, "GLM: Failed constexpr"); - } - - return Error; -} - -static int test_quat() -{ - int Error = 0; - - { - static_assert(glm::quat::length() == 4, "GLM: Failed constexpr"); - static_assert(glm::quat(1.0f, glm::vec3(0.0f)).w > 0.0f, "GLM: Failed constexpr"); - static_assert(glm::quat(1.0f, 0.0f, 0.0f, 0.0f).w > 0.0f, "GLM: Failed constexpr"); - - glm::quat constexpr Q = glm::identity(); - static_assert(Q.x - glm::quat(1.0f, glm::vec3(0.0f)).x <= glm::epsilon(), "GLM: Failed constexpr"); - } - - return Error; -} - -static int test_mat2x2() -{ - int Error = 0; - - static_assert(glm::mat2x2::length() == 2, "GLM: Failed constexpr"); - - return Error; -} - -#endif//GLM_CONFIG_CONSTEXP == GLM_ENABLE - -int main() -{ - int Error = 0; - -# if GLM_CONFIG_CONSTEXP == GLM_ENABLE - Error += test_vec1(); - Error += test_vec2(); - Error += test_vec3(); - Error += test_vec4(); - Error += test_quat(); - Error += test_mat2x2(); -# endif//GLM_CONFIG_CONSTEXP == GLM_ENABLE - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_cpp_defaulted_ctor.cpp b/3rdparty/glm/source/test/core/core_cpp_defaulted_ctor.cpp deleted file mode 100644 index 07afd9c..0000000 --- a/3rdparty/glm/source/test/core/core_cpp_defaulted_ctor.cpp +++ /dev/null @@ -1,145 +0,0 @@ -#include - -#if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE - -#include -#include -#include -#include -#include -#include - -static int test_vec_memcpy() -{ - int Error = 0; - - { - glm::ivec1 const A = glm::ivec1(76); - glm::ivec1 B; - std::memcpy(&B, &A, sizeof(glm::ivec1)); - Error += B == A ? 0 : 1; - } - - { - glm::ivec2 const A = glm::ivec2(76); - glm::ivec2 B; - std::memcpy(&B, &A, sizeof(glm::ivec2)); - Error += B == A ? 0 : 1; - } - - { - glm::ivec3 const A = glm::ivec3(76); - glm::ivec3 B; - std::memcpy(&B, &A, sizeof(glm::ivec3)); - Error += B == A ? 0 : 1; - } - - { - glm::ivec4 const A = glm::ivec4(76); - glm::ivec4 B; - std::memcpy(&B, &A, sizeof(glm::ivec4)); - Error += B == A ? 0 : 1; - } - - return Error; -} - -static int test_mat_memcpy() -{ - int Error = 0; - - { - glm::mat2x2 const A = glm::mat2x2(76); - glm::mat2x2 B; - std::memcpy(&B, &A, sizeof(glm::mat2x2)); - Error += glm::all(glm::equal(B, A, glm::epsilon())) ? 0 : 1; - } - - { - glm::mat2x3 const A = glm::mat2x3(76); - glm::mat2x3 B; - std::memcpy(&B, &A, sizeof(glm::mat2x3)); - Error += glm::all(glm::equal(B, A, glm::epsilon())) ? 0 : 1; - } - - { - glm::mat2x4 const A = glm::mat2x4(76); - glm::mat2x4 B; - std::memcpy(&B, &A, sizeof(glm::mat2x4)); - Error += glm::all(glm::equal(B, A, glm::epsilon())) ? 0 : 1; - } - - { - glm::mat3x2 const A = glm::mat3x2(76); - glm::mat3x2 B; - std::memcpy(&B, &A, sizeof(glm::mat3x2)); - Error += glm::all(glm::equal(B, A, glm::epsilon())) ? 0 : 1; - } - - { - glm::mat3x3 const A = glm::mat3x3(76); - glm::mat3x3 B; - std::memcpy(&B, &A, sizeof(glm::mat3x3)); - Error += glm::all(glm::equal(B, A, glm::epsilon())) ? 0 : 1; - } - - { - glm::mat3x4 const A = glm::mat3x4(76); - glm::mat3x4 B; - std::memcpy(&B, &A, sizeof(glm::mat3x4)); - Error += glm::all(glm::equal(B, A, glm::epsilon())) ? 0 : 1; - } - - { - glm::mat4x2 const A = glm::mat4x2(76); - glm::mat4x2 B; - std::memcpy(&B, &A, sizeof(glm::mat4x2)); - Error += glm::all(glm::equal(B, A, glm::epsilon())) ? 0 : 1; - } - - { - glm::mat4x3 const A = glm::mat4x3(76); - glm::mat4x3 B; - std::memcpy(&B, &A, sizeof(glm::mat4x3)); - Error += glm::all(glm::equal(B, A, glm::epsilon())) ? 0 : 1; - } - - { - glm::mat4x4 const A = glm::mat4x4(76); - glm::mat4x4 B; - std::memcpy(&B, &A, sizeof(glm::mat4x4)); - Error += glm::all(glm::equal(B, A, glm::epsilon())) ? 0 : 1; - } - - return Error; -} - -static int test_quat_memcpy() -{ - int Error = 0; - - { - glm::quat const A = glm::quat(1, 0, 0, 0); - glm::quat B; - std::memcpy(&B, &A, sizeof(glm::quat)); - Error += glm::all(glm::equal(B, A, glm::epsilon())) ? 0 : 1; - } - - return Error; -} - -#endif//GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE - -int main() -{ - int Error = 0; - -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE - Error += test_vec_memcpy(); - Error += test_mat_memcpy(); - Error += test_quat_memcpy(); -# endif//GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_force_aligned_gentypes.cpp b/3rdparty/glm/source/test/core/core_force_aligned_gentypes.cpp deleted file mode 100644 index 70713c4..0000000 --- a/3rdparty/glm/source/test/core/core_force_aligned_gentypes.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include -#include - -int main() -{ - int Error = 0; - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_force_arch_unknown.cpp b/3rdparty/glm/source/test/core/core_force_arch_unknown.cpp deleted file mode 100644 index 45b51bf..0000000 --- a/3rdparty/glm/source/test/core/core_force_arch_unknown.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef GLM_FORCE_ARCH_UNKNOWN -# define GLM_FORCE_ARCH_UNKNOWN -#endif - -#include -#include - -int main() -{ - int Error = 0; - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_force_compiler_unknown.cpp b/3rdparty/glm/source/test/core/core_force_compiler_unknown.cpp deleted file mode 100644 index 44d7fc3..0000000 --- a/3rdparty/glm/source/test/core/core_force_compiler_unknown.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef GLM_FORCE_COMPILER_UNKNOWN -# define GLM_FORCE_COMPILER_UNKNOWN -#endif - -#include -#include - -int main() -{ - int Error = 0; - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_force_ctor_init.cpp b/3rdparty/glm/source/test/core/core_force_ctor_init.cpp deleted file mode 100644 index 298b7ed..0000000 --- a/3rdparty/glm/source/test/core/core_force_ctor_init.cpp +++ /dev/null @@ -1,139 +0,0 @@ -#define GLM_FORCE_CTOR_INIT - -#include -#include - -static int test_vec() -{ - int Error = 0; - - glm::vec1 V1; - Error += glm::all(glm::equal(V1, glm::vec1(0), glm::epsilon())) ? 0 : 1; - - glm::dvec1 U1; - Error += glm::all(glm::equal(U1, glm::dvec1(0), glm::epsilon())) ? 0 : 1; - - glm::vec2 V2; - Error += glm::all(glm::equal(V2, glm::vec2(0, 0), glm::epsilon())) ? 0 : 1; - - glm::dvec2 U2; - Error += glm::all(glm::equal(U2, glm::dvec2(0, 0), glm::epsilon())) ? 0 : 1; - - glm::vec3 V3; - Error += glm::all(glm::equal(V3, glm::vec3(0, 0, 0), glm::epsilon())) ? 0 : 1; - - glm::dvec3 U3; - Error += glm::all(glm::equal(U3, glm::dvec3(0, 0, 0), glm::epsilon())) ? 0 : 1; - - glm::vec4 V4; - Error += glm::all(glm::equal(V4, glm::vec4(0, 0, 0, 0), glm::epsilon())) ? 0 : 1; - - glm::dvec4 U4; - Error += glm::all(glm::equal(U4, glm::dvec4(0, 0, 0, 0), glm::epsilon())) ? 0 : 1; - - return Error; -} - -static int test_mat() -{ - int Error = 0; - - { - glm::mat2x2 F; - Error += glm::all(glm::equal(F, glm::mat2x2(1), glm::epsilon())) ? 0 : 1; - - glm::dmat2x2 D; - Error += glm::all(glm::equal(D, glm::dmat2x2(1), glm::epsilon())) ? 0 : 1; - } - - { - glm::mat2x3 F; - Error += glm::all(glm::equal(F, glm::mat2x3(1), glm::epsilon())) ? 0 : 1; - - glm::dmat2x3 D; - Error += glm::all(glm::equal(D, glm::dmat2x3(1), glm::epsilon())) ? 0 : 1; - } - - { - glm::mat2x4 F; - Error += glm::all(glm::equal(F, glm::mat2x4(1), glm::epsilon())) ? 0 : 1; - - glm::dmat2x4 D; - Error += glm::all(glm::equal(D, glm::dmat2x4(1), glm::epsilon())) ? 0 : 1; - } - - { - glm::mat3x2 F; - Error += glm::all(glm::equal(F, glm::mat3x2(1), glm::epsilon())) ? 0 : 1; - - glm::dmat3x2 D; - Error += glm::all(glm::equal(D, glm::dmat3x2(1), glm::epsilon())) ? 0 : 1; - } - - { - glm::mat3x3 F; - Error += glm::all(glm::equal(F, glm::mat3x3(1), glm::epsilon())) ? 0 : 1; - - glm::dmat3x3 D; - Error += glm::all(glm::equal(D, glm::dmat3x3(1), glm::epsilon())) ? 0 : 1; - } - - { - glm::mat3x4 F; - Error += glm::all(glm::equal(F, glm::mat3x4(1), glm::epsilon())) ? 0 : 1; - - glm::dmat3x4 D; - Error += glm::all(glm::equal(D, glm::dmat3x4(1), glm::epsilon())) ? 0 : 1; - } - - { - glm::mat4x2 F; - Error += glm::all(glm::equal(F, glm::mat4x2(1), glm::epsilon())) ? 0 : 1; - - glm::dmat4x2 D; - Error += glm::all(glm::equal(D, glm::dmat4x2(1), glm::epsilon())) ? 0 : 1; - } - - { - glm::mat4x3 F; - Error += glm::all(glm::equal(F, glm::mat4x3(1), glm::epsilon())) ? 0 : 1; - - glm::dmat4x3 D; - Error += glm::all(glm::equal(D, glm::dmat4x3(1), glm::epsilon())) ? 0 : 1; - } - - { - glm::mat4x4 F; - Error += glm::all(glm::equal(F, glm::mat4x4(1), glm::epsilon())) ? 0 : 1; - - glm::dmat4x4 D; - Error += glm::all(glm::equal(D, glm::dmat4x4(1), glm::epsilon())) ? 0 : 1; - } - - return Error; -} - -static int test_qua() -{ - int Error = 0; - - glm::quat F; - Error += glm::all(glm::equal(F, glm::quat(1, 0, 0, 0), glm::epsilon())) ? 0 : 1; - - glm::dquat D; - Error += glm::all(glm::equal(D, glm::dquat(1, 0, 0, 0), glm::epsilon())) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_vec(); - Error += test_mat(); - Error += test_qua(); - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_force_cxx03.cpp b/3rdparty/glm/source/test/core/core_force_cxx03.cpp deleted file mode 100644 index fc6e9c5..0000000 --- a/3rdparty/glm/source/test/core/core_force_cxx03.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef GLM_FORCE_CXX03 -# define GLM_FORCE_CXX03 -#endif - -#include -#include - -int main() -{ - int Error = 0; - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_force_cxx98.cpp b/3rdparty/glm/source/test/core/core_force_cxx98.cpp deleted file mode 100644 index 42a5c25..0000000 --- a/3rdparty/glm/source/test/core/core_force_cxx98.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef GLM_FORCE_CXX98 -# define GLM_FORCE_CXX98 -#endif - -#include -#include - -int main() -{ - int Error = 0; - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_force_cxx_unknown.cpp b/3rdparty/glm/source/test/core/core_force_cxx_unknown.cpp deleted file mode 100644 index 62299d6..0000000 --- a/3rdparty/glm/source/test/core/core_force_cxx_unknown.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef GLM_FORCE_CXX_UNKNOWN -# define GLM_FORCE_CXX_UNKNOWN -#endif - -#include -#include - -int main() -{ - int Error = 0; - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_force_depth_zero_to_one.cpp b/3rdparty/glm/source/test/core/core_force_depth_zero_to_one.cpp deleted file mode 100644 index 23b3615..0000000 --- a/3rdparty/glm/source/test/core/core_force_depth_zero_to_one.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#define GLM_FORCE_DEPTH_ZERO_TO_ONE - -#include -#include - -int main() -{ - int Error = 0; - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_force_explicit_ctor.cpp b/3rdparty/glm/source/test/core/core_force_explicit_ctor.cpp deleted file mode 100644 index 7af5b79..0000000 --- a/3rdparty/glm/source/test/core/core_force_explicit_ctor.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#define GLM_FORCE_EXPLICIT_CTOR - -#include -#include - -int main() -{ - int Error = 0; - - glm::ivec4 B(1); - Error += B == glm::ivec4(1) ? 0 : 1; - - //glm::vec4 A = B; - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_force_inline.cpp b/3rdparty/glm/source/test/core/core_force_inline.cpp deleted file mode 100644 index cd23fd9..0000000 --- a/3rdparty/glm/source/test/core/core_force_inline.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#define GLM_FORCE_INLINE - -#include -#include - -int main() -{ - int Error = 0; - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_force_left_handed.cpp b/3rdparty/glm/source/test/core/core_force_left_handed.cpp deleted file mode 100644 index b7ec31b..0000000 --- a/3rdparty/glm/source/test/core/core_force_left_handed.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#define GLM_FORCE_LEFT_HANDED - -#include -#include - -int main() -{ - int Error = 0; - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_force_platform_unknown.cpp b/3rdparty/glm/source/test/core/core_force_platform_unknown.cpp deleted file mode 100644 index fb7fa75..0000000 --- a/3rdparty/glm/source/test/core/core_force_platform_unknown.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef GLM_FORCE_PLATFORM_UNKNOWN -# define GLM_FORCE_PLATFORM_UNKNOWN -#endif - -#include -#include - -int main() -{ - int Error = 0; - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_force_pure.cpp b/3rdparty/glm/source/test/core/core_force_pure.cpp deleted file mode 100644 index a32a4ed..0000000 --- a/3rdparty/glm/source/test/core/core_force_pure.cpp +++ /dev/null @@ -1,434 +0,0 @@ -#ifndef GLM_FORCE_PURE -# define GLM_FORCE_PURE -#endif//GLM_FORCE_PURE -#define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES -#define GLM_FORCE_SWIZZLE -#include -#include -#include -#include -#include -#include -#include - -static int test_vec4_ctor() -{ - int Error = 0; - - { - glm::ivec4 A(1, 2, 3, 4); - glm::ivec4 B(A); - Error += glm::all(glm::equal(A, B)) ? 0 : 1; - } - -# if GLM_HAS_TRIVIAL_QUERIES - // Error += std::is_trivially_default_constructible::value ? 0 : 1; - // Error += std::is_trivially_copy_assignable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - - Error += std::is_copy_constructible::value ? 0 : 1; -# endif - -#if GLM_HAS_INITIALIZER_LISTS - { - glm::vec4 a{ 0, 1, 2, 3 }; - std::vector v = { - {0, 1, 2, 3}, - {4, 5, 6, 7}, - {8, 9, 0, 1}}; - } - - { - glm::dvec4 a{ 0, 1, 2, 3 }; - std::vector v = { - {0, 1, 2, 3}, - {4, 5, 6, 7}, - {8, 9, 0, 1}}; - } -#endif - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - { - glm::ivec4 A = glm::vec4(1.0f, 2.0f, 3.0f, 4.0f); - glm::ivec4 B = A.xyzw; - glm::ivec4 C(A.xyzw); - glm::ivec4 D(A.xyzw()); - glm::ivec4 E(A.x, A.yzw); - glm::ivec4 F(A.x, A.yzw()); - glm::ivec4 G(A.xyz, A.w); - glm::ivec4 H(A.xyz(), A.w); - glm::ivec4 I(A.xy, A.zw); - glm::ivec4 J(A.xy(), A.zw()); - glm::ivec4 K(A.x, A.y, A.zw); - glm::ivec4 L(A.x, A.yz, A.w); - glm::ivec4 M(A.xy, A.z, A.w); - - Error += glm::all(glm::equal(A, B)) ? 0 : 1; - Error += glm::all(glm::equal(A, C)) ? 0 : 1; - Error += glm::all(glm::equal(A, D)) ? 0 : 1; - Error += glm::all(glm::equal(A, E)) ? 0 : 1; - Error += glm::all(glm::equal(A, F)) ? 0 : 1; - Error += glm::all(glm::equal(A, G)) ? 0 : 1; - Error += glm::all(glm::equal(A, H)) ? 0 : 1; - Error += glm::all(glm::equal(A, I)) ? 0 : 1; - Error += glm::all(glm::equal(A, J)) ? 0 : 1; - Error += glm::all(glm::equal(A, K)) ? 0 : 1; - Error += glm::all(glm::equal(A, L)) ? 0 : 1; - Error += glm::all(glm::equal(A, M)) ? 0 : 1; - } -# endif - -# if GLM_CONFIG_SWIZZLE - { - glm::ivec4 A = glm::vec4(1.0f, 2.0f, 3.0f, 4.0f); - glm::ivec4 B = A.xyzw(); - glm::ivec4 C(A.xyzw()); - glm::ivec4 D(A.xyzw()); - glm::ivec4 E(A.x, A.yzw()); - glm::ivec4 F(A.x, A.yzw()); - glm::ivec4 G(A.xyz(), A.w); - glm::ivec4 H(A.xyz(), A.w); - glm::ivec4 I(A.xy(), A.zw()); - glm::ivec4 J(A.xy(), A.zw()); - glm::ivec4 K(A.x, A.y, A.zw()); - glm::ivec4 L(A.x, A.yz(), A.w); - glm::ivec4 M(A.xy(), A.z, A.w); - - Error += glm::all(glm::equal(A, B)) ? 0 : 1; - Error += glm::all(glm::equal(A, C)) ? 0 : 1; - Error += glm::all(glm::equal(A, D)) ? 0 : 1; - Error += glm::all(glm::equal(A, E)) ? 0 : 1; - Error += glm::all(glm::equal(A, F)) ? 0 : 1; - Error += glm::all(glm::equal(A, G)) ? 0 : 1; - Error += glm::all(glm::equal(A, H)) ? 0 : 1; - Error += glm::all(glm::equal(A, I)) ? 0 : 1; - Error += glm::all(glm::equal(A, J)) ? 0 : 1; - Error += glm::all(glm::equal(A, K)) ? 0 : 1; - Error += glm::all(glm::equal(A, L)) ? 0 : 1; - Error += glm::all(glm::equal(A, M)) ? 0 : 1; - } -# endif//GLM_CONFIG_SWIZZLE - - { - glm::ivec4 A(1); - glm::ivec4 B(1, 1, 1, 1); - - Error += A == B ? 0 : 1; - } - - { - std::vector Tests; - Tests.push_back(glm::ivec4(glm::ivec2(1, 2), 3, 4)); - Tests.push_back(glm::ivec4(1, glm::ivec2(2, 3), 4)); - Tests.push_back(glm::ivec4(1, 2, glm::ivec2(3, 4))); - Tests.push_back(glm::ivec4(glm::ivec3(1, 2, 3), 4)); - Tests.push_back(glm::ivec4(1, glm::ivec3(2, 3, 4))); - Tests.push_back(glm::ivec4(glm::ivec2(1, 2), glm::ivec2(3, 4))); - Tests.push_back(glm::ivec4(1, 2, 3, 4)); - Tests.push_back(glm::ivec4(glm::ivec4(1, 2, 3, 4))); - - for(std::size_t i = 0; i < Tests.size(); ++i) - Error += Tests[i] == glm::ivec4(1, 2, 3, 4) ? 0 : 1; - } - - return Error; -} - -static int test_bvec4_ctor() -{ - int Error = 0; - - glm::bvec4 const A(true); - glm::bvec4 const B(true); - glm::bvec4 const C(false); - glm::bvec4 const D = A && B; - glm::bvec4 const E = A && C; - glm::bvec4 const F = A || C; - - Error += D == glm::bvec4(true) ? 0 : 1; - Error += E == glm::bvec4(false) ? 0 : 1; - Error += F == glm::bvec4(true) ? 0 : 1; - - bool const G = A == C; - bool const H = A != C; - - Error += !G ? 0 : 1; - Error += H ? 0 : 1; - - return Error; -} - -static int test_vec4_operators() -{ - int Error = 0; - - { - glm::ivec4 A(1); - glm::ivec4 B(1); - bool R = A != B; - bool S = A == B; - - Error += (S && !R) ? 0 : 1; - } - - { - glm::vec4 const A(1.0f, 2.0f, 3.0f, 4.0f); - glm::vec4 const B(4.0f, 5.0f, 6.0f, 7.0f); - - glm::vec4 const C = A + B; - Error += glm::all(glm::equal(C, glm::vec4(5, 7, 9, 11), 0.001f)) ? 0 : 1; - - glm::vec4 D = B - A; - Error += glm::all(glm::equal(D, glm::vec4(3, 3, 3, 3), 0.001f)) ? 0 : 1; - - glm::vec4 E = A * B; - Error += glm::all(glm::equal(E, glm::vec4(4, 10, 18, 28), 0.001f)) ? 0 : 1; - - glm::vec4 F = B / A; - Error += glm::all(glm::equal(F, glm::vec4(4, 2.5, 2, 7.0f / 4.0f), 0.001f)) ? 0 : 1; - - glm::vec4 G = A + 1.0f; - Error += glm::all(glm::equal(G, glm::vec4(2, 3, 4, 5), 0.001f)) ? 0 : 1; - - glm::vec4 H = B - 1.0f; - Error += glm::all(glm::equal(H, glm::vec4(3, 4, 5, 6), 0.001f)) ? 0 : 1; - - glm::vec4 I = A * 2.0f; - Error += glm::all(glm::equal(I, glm::vec4(2, 4, 6, 8), 0.001f)) ? 0 : 1; - - glm::vec4 J = B / 2.0f; - Error += glm::all(glm::equal(J, glm::vec4(2, 2.5, 3, 3.5), 0.001f)) ? 0 : 1; - - glm::vec4 K = 1.0f + A; - Error += glm::all(glm::equal(K, glm::vec4(2, 3, 4, 5), 0.001f)) ? 0 : 1; - - glm::vec4 L = 1.0f - B; - Error += glm::all(glm::equal(L, glm::vec4(-3, -4, -5, -6), 0.001f)) ? 0 : 1; - - glm::vec4 M = 2.0f * A; - Error += glm::all(glm::equal(M, glm::vec4(2, 4, 6, 8), 0.001f)) ? 0 : 1; - - glm::vec4 const N = 2.0f / B; - Error += glm::all(glm::equal(N, glm::vec4(0.5, 2.0 / 5.0, 2.0 / 6.0, 2.0 / 7.0), 0.0001f)) ? 0 : 1; - } - - { - glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); - glm::ivec4 B(4.0f, 5.0f, 6.0f, 7.0f); - - A += B; - Error += A == glm::ivec4(5, 7, 9, 11) ? 0 : 1; - - A += 1; - Error += A == glm::ivec4(6, 8, 10, 12) ? 0 : 1; - } - { - glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); - glm::ivec4 B(4.0f, 5.0f, 6.0f, 7.0f); - - B -= A; - Error += B == glm::ivec4(3, 3, 3, 3) ? 0 : 1; - - B -= 1; - Error += B == glm::ivec4(2, 2, 2, 2) ? 0 : 1; - } - { - glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); - glm::ivec4 B(4.0f, 5.0f, 6.0f, 7.0f); - - A *= B; - Error += A == glm::ivec4(4, 10, 18, 28) ? 0 : 1; - - A *= 2; - Error += A == glm::ivec4(8, 20, 36, 56) ? 0 : 1; - } - { - glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); - glm::ivec4 B(4.0f, 4.0f, 6.0f, 8.0f); - - B /= A; - Error += B == glm::ivec4(4, 2, 2, 2) ? 0 : 1; - - B /= 2; - Error += B == glm::ivec4(2, 1, 1, 1) ? 0 : 1; - } - { - glm::ivec4 B(2); - - B /= B.y; - Error += B == glm::ivec4(1) ? 0 : 1; - } - - { - glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); - glm::ivec4 B = -A; - Error += B == glm::ivec4(-1.0f, -2.0f, -3.0f, -4.0f) ? 0 : 1; - } - - { - glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); - glm::ivec4 B = --A; - Error += B == glm::ivec4(0.0f, 1.0f, 2.0f, 3.0f) ? 0 : 1; - } - - { - glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); - glm::ivec4 B = A--; - Error += B == glm::ivec4(1.0f, 2.0f, 3.0f, 4.0f) ? 0 : 1; - Error += A == glm::ivec4(0.0f, 1.0f, 2.0f, 3.0f) ? 0 : 1; - } - - { - glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); - glm::ivec4 B = ++A; - Error += B == glm::ivec4(2.0f, 3.0f, 4.0f, 5.0f) ? 0 : 1; - } - - { - glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); - glm::ivec4 B = A++; - Error += B == glm::ivec4(1.0f, 2.0f, 3.0f, 4.0f) ? 0 : 1; - Error += A == glm::ivec4(2.0f, 3.0f, 4.0f, 5.0f) ? 0 : 1; - } - - return Error; -} - -static int test_vec4_equal() -{ - int Error = 0; - - { - glm::uvec4 const A(1, 2, 3, 4); - glm::uvec4 const B(1, 2, 3, 4); - Error += A == B ? 0 : 1; - Error += A != B ? 1 : 0; - } - - { - glm::ivec4 const A(1, 2, 3, 4); - glm::ivec4 const B(1, 2, 3, 4); - Error += A == B ? 0 : 1; - Error += A != B ? 1 : 0; - } - - return Error; -} - -static int test_vec4_size() -{ - int Error = 0; - - Error += sizeof(glm::vec4) == sizeof(glm::lowp_vec4) ? 0 : 1; - Error += sizeof(glm::vec4) == sizeof(glm::mediump_vec4) ? 0 : 1; - Error += sizeof(glm::vec4) == sizeof(glm::highp_vec4) ? 0 : 1; - Error += 16 == sizeof(glm::mediump_vec4) ? 0 : 1; - Error += sizeof(glm::dvec4) == sizeof(glm::lowp_dvec4) ? 0 : 1; - Error += sizeof(glm::dvec4) == sizeof(glm::mediump_dvec4) ? 0 : 1; - Error += sizeof(glm::dvec4) == sizeof(glm::highp_dvec4) ? 0 : 1; - Error += 32 == sizeof(glm::highp_dvec4) ? 0 : 1; - Error += glm::vec4().length() == 4 ? 0 : 1; - Error += glm::dvec4().length() == 4 ? 0 : 1; - - return Error; -} - -static int test_vec4_swizzle_partial() -{ - int Error = 0; - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - - glm::ivec4 A(1, 2, 3, 4); - - { - glm::ivec4 B(A.xy, A.zw); - Error += A == B ? 0 : 1; - } - { - glm::ivec4 B(A.xy, 3, 4); - Error += A == B ? 0 : 1; - } - { - glm::ivec4 B(1, A.yz, 4); - Error += A == B ? 0 : 1; - } - { - glm::ivec4 B(1, 2, A.zw); - Error += A == B ? 0 : 1; - } - - { - glm::ivec4 B(A.xyz, 4); - Error += A == B ? 0 : 1; - } - { - glm::ivec4 B(1, A.yzw); - Error += A == B ? 0 : 1; - } -# endif - - return Error; -} - -static int test_operator_increment() -{ - int Error(0); - - glm::ivec4 v0(1); - glm::ivec4 v1(v0); - glm::ivec4 v2(v0); - glm::ivec4 v3 = ++v1; - glm::ivec4 v4 = v2++; - - Error += glm::all(glm::equal(v0, v4)) ? 0 : 1; - Error += glm::all(glm::equal(v1, v2)) ? 0 : 1; - Error += glm::all(glm::equal(v1, v3)) ? 0 : 1; - - int i0(1); - int i1(i0); - int i2(i0); - int i3 = ++i1; - int i4 = i2++; - - Error += i0 == i4 ? 0 : 1; - Error += i1 == i2 ? 0 : 1; - Error += i1 == i3 ? 0 : 1; - - return Error; -} - -static int test_vec4_simd() -{ - int Error = 0; - - glm::vec4 const a(std::clock(), std::clock(), std::clock(), std::clock()); - glm::vec4 const b(std::clock(), std::clock(), std::clock(), std::clock()); - - glm::vec4 const c(b * a); - glm::vec4 const d(a + c); - - Error += glm::all(glm::greaterThanEqual(d, glm::vec4(0))) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_vec4_ctor(); - Error += test_bvec4_ctor(); - Error += test_vec4_size(); - Error += test_vec4_operators(); - Error += test_vec4_equal(); - Error += test_vec4_swizzle_partial(); - Error += test_vec4_simd(); - Error += test_operator_increment(); - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_force_quat_xyzw.cpp b/3rdparty/glm/source/test/core/core_force_quat_xyzw.cpp deleted file mode 100644 index 7d5281c..0000000 --- a/3rdparty/glm/source/test/core/core_force_quat_xyzw.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#define GLM_FORCE_QUAT_DATA_XYZW -#define GLM_FORCE_INLINE - -#include -#include - -int main() -{ - int Error = 0; - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_force_size_t_length.cpp b/3rdparty/glm/source/test/core/core_force_size_t_length.cpp deleted file mode 100644 index 19dac89..0000000 --- a/3rdparty/glm/source/test/core/core_force_size_t_length.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#define GLM_FORCE_SIZE_T_LENGTH - -#include -#include - -int main() -{ - int Error = 0; - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_force_unrestricted_gentype.cpp b/3rdparty/glm/source/test/core/core_force_unrestricted_gentype.cpp deleted file mode 100644 index 21d6e52..0000000 --- a/3rdparty/glm/source/test/core/core_force_unrestricted_gentype.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#define GLM_FORCE_UNRESTRICTED_GENTYPE - -#include -#include - -int main() -{ - int Error = 0; - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_force_xyzw_only.cpp b/3rdparty/glm/source/test/core/core_force_xyzw_only.cpp deleted file mode 100644 index d19509d..0000000 --- a/3rdparty/glm/source/test/core/core_force_xyzw_only.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#define GLM_FORCE_XYZW_ONLY - -#include -#include -#include -#include -#include -#include - -static int test_comp() -{ - int Error = 0; - - { - glm::ivec1 const A(1); - Error += A.x == 1 ? 0 : 1; - } - - { - glm::ivec2 const A(1, 2); - Error += A.x == 1 ? 0 : 1; - Error += A.y == 2 ? 0 : 1; - } - - { - glm::ivec3 const A(1, 2, 3); - Error += A.x == 1 ? 0 : 1; - Error += A.y == 2 ? 0 : 1; - Error += A.z == 3 ? 0 : 1; - } - - { - glm::ivec4 const A(1, 2, 3, 4); - Error += A.x == 1 ? 0 : 1; - Error += A.y == 2 ? 0 : 1; - Error += A.z == 3 ? 0 : 1; - Error += A.w == 4 ? 0 : 1; - } - - return Error; -} - -static int test_constexpr() -{ - int Error = 0; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_comp(); - Error += test_constexpr(); - - return Error; -} diff --git a/3rdparty/glm/source/test/core/core_func_common.cpp b/3rdparty/glm/source/test/core/core_func_common.cpp deleted file mode 100644 index b8640de..0000000 --- a/3rdparty/glm/source/test/core/core_func_common.cpp +++ /dev/null @@ -1,1349 +0,0 @@ -#define GLM_FORCE_EXPLICIT_CTOR -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// This file has divisions by zero to test isnan -#if GLM_COMPILER & GLM_COMPILER_VC -# pragma warning(disable : 4723) -#endif - -namespace floor_ -{ - static int test() - { - int Error = 0; - - { - float A = 1.1f; - float B = glm::floor(A); - Error += glm::equal(B, 1.f, 0.0001f) ? 0 : 1; - } - - { - double A = 1.1; - double B = glm::floor(A); - Error += glm::equal(B, 1.0, 0.0001) ? 0 : 1; - } - - { - glm::vec1 A(1.1f); - glm::vec1 B = glm::floor(A); - - Error += glm::all(glm::equal(B, glm::vec1(1.0), 0.0001f)) ? 0 : 1; - } - - { - glm::dvec1 A(1.1); - glm::dvec1 B = glm::floor(A); - - Error += glm::all(glm::equal(B, glm::dvec1(1.0), 0.0001)) ? 0 : 1; - } - - { - glm::vec2 A(1.1f); - glm::vec2 B = glm::floor(A); - - Error += glm::all(glm::equal(B, glm::vec2(1.0), 0.0001f)) ? 0 : 1; - } - - { - glm::dvec2 A(1.1); - glm::dvec2 B = glm::floor(A); - - Error += glm::all(glm::equal(B, glm::dvec2(1.0), 0.0001)) ? 0 : 1; - } - - { - glm::vec3 A(1.1f); - glm::vec3 B = glm::floor(A); - - Error += glm::all(glm::equal(B, glm::vec3(1.0), 0.0001f)) ? 0 : 1; - } - - { - glm::dvec3 A(1.1); - glm::dvec3 B = glm::floor(A); - - Error += glm::all(glm::equal(B, glm::dvec3(1.0), 0.0001)) ? 0 : 1; - } - - { - glm::vec4 A(1.1f); - glm::vec4 B = glm::floor(A); - - Error += glm::all(glm::equal(B, glm::vec4(1.0), 0.0001f)) ? 0 : 1; - } - - { - glm::dvec4 A(1.1); - glm::dvec4 B = glm::floor(A); - - Error += glm::all(glm::equal(B, glm::dvec4(1.0), 0.0001)) ? 0 : 1; - } - - return Error; - } -}//namespace floor - -namespace modf_ -{ - static int test() - { - int Error(0); - - { - float X(1.5f); - float I(0.0f); - float A = glm::modf(X, I); - - Error += glm::equal(I, 1.0f, 0.0001f) ? 0 : 1; - Error += glm::equal(A, 0.5f, 0.0001f) ? 0 : 1; - } - - { - glm::vec4 X(1.1f, 1.2f, 1.5f, 1.7f); - glm::vec4 I(0.0f); - glm::vec4 A = glm::modf(X, I); - - Error += glm::ivec4(I) == glm::ivec4(1) ? 0 : 1; - Error += glm::all(glm::equal(A, glm::vec4(0.1f, 0.2f, 0.5f, 0.7f), 0.00001f)) ? 0 : 1; - } - - { - glm::dvec4 X(1.1, 1.2, 1.5, 1.7); - glm::dvec4 I(0.0); - glm::dvec4 A = glm::modf(X, I); - - Error += glm::ivec4(I) == glm::ivec4(1) ? 0 : 1; - Error += glm::all(glm::equal(A, glm::dvec4(0.1, 0.2, 0.5, 0.7), 0.000000001)) ? 0 : 1; - } - - { - double X(1.5); - double I(0.0); - double A = glm::modf(X, I); - - Error += glm::equal(I, 1.0, 0.0001) ? 0 : 1; - Error += glm::equal(A, 0.5, 0.0001) ? 0 : 1; - } - - return Error; - } -}//namespace modf - -namespace mod_ -{ - static int test() - { - int Error(0); - - { - float A(1.5f); - float B(1.0f); - float C = glm::mod(A, B); - - Error += glm::equal(C, 0.5f, 0.00001f) ? 0 : 1; - } - - { - float A(-0.2f); - float B(1.0f); - float C = glm::mod(A, B); - - Error += glm::equal(C, 0.8f, 0.00001f) ? 0 : 1; - } - - { - float A(3.0); - float B(2.0f); - float C = glm::mod(A, B); - - Error += glm::equal(C, 1.0f, 0.00001f) ? 0 : 1; - } - - { - glm::vec4 A(3.0); - float B(2.0f); - glm::vec4 C = glm::mod(A, B); - - Error += glm::all(glm::equal(C, glm::vec4(1.0f), 0.00001f)) ? 0 : 1; - } - - { - glm::vec4 A(3.0); - glm::vec4 B(2.0f); - glm::vec4 C = glm::mod(A, B); - - Error += glm::all(glm::equal(C, glm::vec4(1.0f), 0.00001f)) ? 0 : 1; - } - - return Error; - } -}//namespace mod_ - -namespace floatBitsToInt -{ - static int test() - { - int Error = 0; - - { - float A = 1.0f; - int B = glm::floatBitsToInt(A); - float C = glm::intBitsToFloat(B); - Error += glm::equal(A, C, 0.0001f) ? 0 : 1; - } - - { - glm::vec2 A(1.0f, 2.0f); - glm::ivec2 B = glm::floatBitsToInt(A); - glm::vec2 C = glm::intBitsToFloat(B); - Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1; - } - - { - glm::vec3 A(1.0f, 2.0f, 3.0f); - glm::ivec3 B = glm::floatBitsToInt(A); - glm::vec3 C = glm::intBitsToFloat(B); - Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1; - } - - { - glm::vec4 A(1.0f, 2.0f, 3.0f, 4.0f); - glm::ivec4 B = glm::floatBitsToInt(A); - glm::vec4 C = glm::intBitsToFloat(B); - Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1; - } - - return Error; - } -}//namespace floatBitsToInt - -namespace floatBitsToUint -{ - static int test() - { - int Error = 0; - - { - float A = 1.0f; - glm::uint B = glm::floatBitsToUint(A); - float C = glm::uintBitsToFloat(B); - Error += glm::equal(A, C, 0.0001f) ? 0 : 1; - } - - { - glm::vec2 A(1.0f, 2.0f); - glm::uvec2 B = glm::floatBitsToUint(A); - glm::vec2 C = glm::uintBitsToFloat(B); - Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1; - } - - { - glm::vec3 A(1.0f, 2.0f, 3.0f); - glm::uvec3 B = glm::floatBitsToUint(A); - glm::vec3 C = glm::uintBitsToFloat(B); - Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1; - } - - { - glm::vec4 A(1.0f, 2.0f, 3.0f, 4.0f); - glm::uvec4 B = glm::floatBitsToUint(A); - glm::vec4 C = glm::uintBitsToFloat(B); - Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1; - } - - return Error; - } -}//namespace floatBitsToUint - -namespace min_ -{ - static int test() - { - int Error = 0; - - glm::vec1 A0 = glm::min(glm::vec1(1), glm::vec1(1)); - bool A1 = glm::all(glm::equal(A0, glm::vec1(1), glm::epsilon())); - Error += A1 ? 0 : 1; - - glm::vec2 B0 = glm::min(glm::vec2(1), glm::vec2(1)); - glm::vec2 B1 = glm::min(glm::vec2(1), 1.0f); - bool B2 = glm::all(glm::equal(B0, B1, glm::epsilon())); - Error += B2 ? 0 : 1; - - glm::vec3 C0 = glm::min(glm::vec3(1), glm::vec3(1)); - glm::vec3 C1 = glm::min(glm::vec3(1), 1.0f); - bool C2 = glm::all(glm::equal(C0, C1, glm::epsilon())); - Error += C2 ? 0 : 1; - - glm::vec4 D0 = glm::min(glm::vec4(1), glm::vec4(1)); - glm::vec4 D1 = glm::min(glm::vec4(1), 1.0f); - bool D2 = glm::all(glm::equal(D0, D1, glm::epsilon())); - Error += D2 ? 0 : 1; - - return Error; - } - - int min_tern(int a, int b) - { - return a < b ? a : b; - } - - int min_int(int x, int y) - { - return y ^ ((x ^ y) & -(x < y)); - } - - static int perf(std::size_t Count) - { - std::vector A(Count); - std::vector B(Count); - - std::size_t const InternalCount = 200000; - - for(std::size_t i = 0; i < Count; ++i) - { - A[i] = glm::linearRand(-1000, 1000); - B[i] = glm::linearRand(-1000, 1000); - } - - int Error = 0; - - glm::int32 SumA = 0; - { - std::clock_t Timestamp0 = std::clock(); - - for (std::size_t j = 0; j < InternalCount; ++j) - for (std::size_t i = 0; i < Count; ++i) - SumA += min_tern(A[i], B[i]); - - std::clock_t Timestamp1 = std::clock(); - - std::printf("min_tern Time %d clocks\n", static_cast(Timestamp1 - Timestamp0)); - } - - glm::int32 SumB = 0; - { - std::clock_t Timestamp0 = std::clock(); - - for (std::size_t j = 0; j < InternalCount; ++j) - for (std::size_t i = 0; i < Count; ++i) - SumB += min_int(A[i], B[i]); - - std::clock_t Timestamp1 = std::clock(); - - std::printf("min_int Time %d clocks\n", static_cast(Timestamp1 - Timestamp0)); - } - - Error += SumA == SumB ? 0 : 1; - - return Error; - } -}//namespace min_ - -namespace max_ -{ - static int test() - { - int Error = 0; - - glm::vec1 A0 = glm::max(glm::vec1(1), glm::vec1(1)); - bool A1 = glm::all(glm::equal(A0, glm::vec1(1), glm::epsilon())); - Error += A1 ? 0 : 1; - - - glm::vec2 B0 = glm::max(glm::vec2(1), glm::vec2(1)); - glm::vec2 B1 = glm::max(glm::vec2(1), 1.0f); - bool B2 = glm::all(glm::equal(B0, B1, glm::epsilon())); - Error += B2 ? 0 : 1; - - glm::vec3 C0 = glm::max(glm::vec3(1), glm::vec3(1)); - glm::vec3 C1 = glm::max(glm::vec3(1), 1.0f); - bool C2 = glm::all(glm::equal(C0, C1, glm::epsilon())); - Error += C2 ? 0 : 1; - - glm::vec4 D0 = glm::max(glm::vec4(1), glm::vec4(1)); - glm::vec4 D1 = glm::max(glm::vec4(1), 1.0f); - bool D2 = glm::all(glm::equal(D0, D1, glm::epsilon())); - Error += D2 ? 0 : 1; - - return Error; - } -}//namespace max_ - -namespace clamp_ -{ - static int test() - { - int Error = 0; - - return Error; - } -}//namespace clamp_ - -namespace mix_ -{ - template - struct entry - { - T x; - T y; - B a; - T Result; - }; - - entry const TestBool[] = - { - {0.0f, 1.0f, false, 0.0f}, - {0.0f, 1.0f, true, 1.0f}, - {-1.0f, 1.0f, false, -1.0f}, - {-1.0f, 1.0f, true, 1.0f} - }; - - entry const TestFloat[] = - { - {0.0f, 1.0f, 0.0f, 0.0f}, - {0.0f, 1.0f, 1.0f, 1.0f}, - {-1.0f, 1.0f, 0.0f, -1.0f}, - {-1.0f, 1.0f, 1.0f, 1.0f} - }; - - entry const TestVec2Bool[] = - { - {glm::vec2(0.0f), glm::vec2(1.0f), false, glm::vec2(0.0f)}, - {glm::vec2(0.0f), glm::vec2(1.0f), true, glm::vec2(1.0f)}, - {glm::vec2(-1.0f), glm::vec2(1.0f), false, glm::vec2(-1.0f)}, - {glm::vec2(-1.0f), glm::vec2(1.0f), true, glm::vec2(1.0f)} - }; - - entry const TestBVec2[] = - { - {glm::vec2(0.0f), glm::vec2(1.0f), glm::bvec2(false), glm::vec2(0.0f)}, - {glm::vec2(0.0f), glm::vec2(1.0f), glm::bvec2(true), glm::vec2(1.0f)}, - {glm::vec2(-1.0f), glm::vec2(1.0f), glm::bvec2(false), glm::vec2(-1.0f)}, - {glm::vec2(-1.0f), glm::vec2(1.0f), glm::bvec2(true), glm::vec2(1.0f)}, - {glm::vec2(-1.0f), glm::vec2(1.0f), glm::bvec2(true, false), glm::vec2(1.0f, -1.0f)} - }; - - entry const TestVec3Bool[] = - { - {glm::vec3(0.0f), glm::vec3(1.0f), false, glm::vec3(0.0f)}, - {glm::vec3(0.0f), glm::vec3(1.0f), true, glm::vec3(1.0f)}, - {glm::vec3(-1.0f), glm::vec3(1.0f), false, glm::vec3(-1.0f)}, - {glm::vec3(-1.0f), glm::vec3(1.0f), true, glm::vec3(1.0f)} - }; - - entry const TestBVec3[] = - { - {glm::vec3(0.0f), glm::vec3(1.0f), glm::bvec3(false), glm::vec3(0.0f)}, - {glm::vec3(0.0f), glm::vec3(1.0f), glm::bvec3(true), glm::vec3(1.0f)}, - {glm::vec3(-1.0f), glm::vec3(1.0f), glm::bvec3(false), glm::vec3(-1.0f)}, - {glm::vec3(-1.0f), glm::vec3(1.0f), glm::bvec3(true), glm::vec3(1.0f)}, - {glm::vec3(1.0f, 2.0f, 3.0f), glm::vec3(4.0f, 5.0f, 6.0f), glm::bvec3(true, false, true), glm::vec3(4.0f, 2.0f, 6.0f)} - }; - - entry const TestVec4Bool[] = - { - {glm::vec4(0.0f), glm::vec4(1.0f), false, glm::vec4(0.0f)}, - {glm::vec4(0.0f), glm::vec4(1.0f), true, glm::vec4(1.0f)}, - {glm::vec4(-1.0f), glm::vec4(1.0f), false, glm::vec4(-1.0f)}, - {glm::vec4(-1.0f), glm::vec4(1.0f), true, glm::vec4(1.0f)} - }; - - entry const TestBVec4[] = - { - {glm::vec4(0.0f, 0.0f, 1.0f, 1.0f), glm::vec4(2.0f, 2.0f, 3.0f, 3.0f), glm::bvec4(false, true, false, true), glm::vec4(0.0f, 2.0f, 1.0f, 3.0f)}, - {glm::vec4(0.0f), glm::vec4(1.0f), glm::bvec4(true), glm::vec4(1.0f)}, - {glm::vec4(-1.0f), glm::vec4(1.0f), glm::bvec4(false), glm::vec4(-1.0f)}, - {glm::vec4(-1.0f), glm::vec4(1.0f), glm::bvec4(true), glm::vec4(1.0f)}, - {glm::vec4(1.0f, 2.0f, 3.0f, 4.0f), glm::vec4(5.0f, 6.0f, 7.0f, 8.0f), glm::bvec4(true, false, true, false), glm::vec4(5.0f, 2.0f, 7.0f, 4.0f)} - }; - - static int test() - { - int Error = 0; - - // Float with bool - { - for(std::size_t i = 0; i < sizeof(TestBool) / sizeof(entry); ++i) - { - float Result = glm::mix(TestBool[i].x, TestBool[i].y, TestBool[i].a); - Error += glm::equal(Result, TestBool[i].Result, glm::epsilon()) ? 0 : 1; - } - } - - // Float with float - { - for(std::size_t i = 0; i < sizeof(TestFloat) / sizeof(entry); ++i) - { - float Result = glm::mix(TestFloat[i].x, TestFloat[i].y, TestFloat[i].a); - Error += glm::equal(Result, TestFloat[i].Result, glm::epsilon()) ? 0 : 1; - } - } - - // vec2 with bool - { - for(std::size_t i = 0; i < sizeof(TestVec2Bool) / sizeof(entry); ++i) - { - glm::vec2 Result = glm::mix(TestVec2Bool[i].x, TestVec2Bool[i].y, TestVec2Bool[i].a); - Error += glm::equal(Result.x, TestVec2Bool[i].Result.x, glm::epsilon()) ? 0 : 1; - Error += glm::equal(Result.y, TestVec2Bool[i].Result.y, glm::epsilon()) ? 0 : 1; - } - } - - // vec2 with bvec2 - { - for(std::size_t i = 0; i < sizeof(TestBVec2) / sizeof(entry); ++i) - { - glm::vec2 Result = glm::mix(TestBVec2[i].x, TestBVec2[i].y, TestBVec2[i].a); - Error += glm::equal(Result.x, TestBVec2[i].Result.x, glm::epsilon()) ? 0 : 1; - Error += glm::equal(Result.y, TestBVec2[i].Result.y, glm::epsilon()) ? 0 : 1; - } - } - - // vec3 with bool - { - for(std::size_t i = 0; i < sizeof(TestVec3Bool) / sizeof(entry); ++i) - { - glm::vec3 Result = glm::mix(TestVec3Bool[i].x, TestVec3Bool[i].y, TestVec3Bool[i].a); - Error += glm::equal(Result.x, TestVec3Bool[i].Result.x, glm::epsilon()) ? 0 : 1; - Error += glm::equal(Result.y, TestVec3Bool[i].Result.y, glm::epsilon()) ? 0 : 1; - Error += glm::equal(Result.z, TestVec3Bool[i].Result.z, glm::epsilon()) ? 0 : 1; - } - } - - // vec3 with bvec3 - { - for(std::size_t i = 0; i < sizeof(TestBVec3) / sizeof(entry); ++i) - { - glm::vec3 Result = glm::mix(TestBVec3[i].x, TestBVec3[i].y, TestBVec3[i].a); - Error += glm::equal(Result.x, TestBVec3[i].Result.x, glm::epsilon()) ? 0 : 1; - Error += glm::equal(Result.y, TestBVec3[i].Result.y, glm::epsilon()) ? 0 : 1; - Error += glm::equal(Result.z, TestBVec3[i].Result.z, glm::epsilon()) ? 0 : 1; - } - } - - // vec4 with bool - { - for(std::size_t i = 0; i < sizeof(TestVec4Bool) / sizeof(entry); ++i) - { - glm::vec4 Result = glm::mix(TestVec4Bool[i].x, TestVec4Bool[i].y, TestVec4Bool[i].a); - Error += glm::equal(Result.x, TestVec4Bool[i].Result.x, glm::epsilon()) ? 0 : 1; - Error += glm::equal(Result.y, TestVec4Bool[i].Result.y, glm::epsilon()) ? 0 : 1; - Error += glm::equal(Result.z, TestVec4Bool[i].Result.z, glm::epsilon()) ? 0 : 1; - Error += glm::equal(Result.w, TestVec4Bool[i].Result.w, glm::epsilon()) ? 0 : 1; - } - } - - // vec4 with bvec4 - { - for(std::size_t i = 0; i < sizeof(TestBVec4) / sizeof(entry); ++i) - { - glm::vec4 Result = glm::mix(TestBVec4[i].x, TestBVec4[i].y, TestBVec4[i].a); - Error += glm::equal(Result.x, TestBVec4[i].Result.x, glm::epsilon()) ? 0 : 1; - Error += glm::equal(Result.y, TestBVec4[i].Result.y, glm::epsilon()) ? 0 : 1; - Error += glm::equal(Result.z, TestBVec4[i].Result.z, glm::epsilon()) ? 0 : 1; - Error += glm::equal(Result.w, TestBVec4[i].Result.w, glm::epsilon()) ? 0 : 1; - } - } - - return Error; - } -}//namespace mix_ - -namespace step_ -{ - template - struct entry - { - EDGE edge; - VEC x; - VEC result; - }; - - entry TestVec4Scalar [] = - { - { 1.0f, glm::vec4(1.0f, 2.0f, 3.0f, 4.0f), glm::vec4(1.0f) }, - { 0.0f, glm::vec4(1.0f, 2.0f, 3.0f, 4.0f), glm::vec4(1.0f) }, - { 0.0f, glm::vec4(-1.0f, -2.0f, -3.0f, -4.0f), glm::vec4(0.0f) } - }; - - entry TestVec4Vector [] = - { - { glm::vec4(-1.0f, -2.0f, -3.0f, -4.0f), glm::vec4(-2.0f, -3.0f, -4.0f, -5.0f), glm::vec4(0.0f) }, - { glm::vec4( 0.0f, 1.0f, 2.0f, 3.0f), glm::vec4( 1.0f, 2.0f, 3.0f, 4.0f), glm::vec4(1.0f) }, - { glm::vec4( 2.0f, 3.0f, 4.0f, 5.0f), glm::vec4( 1.0f, 2.0f, 3.0f, 4.0f), glm::vec4(0.0f) }, - { glm::vec4( 0.0f, 1.0f, 2.0f, 3.0f), glm::vec4(-1.0f,-2.0f,-3.0f,-4.0f), glm::vec4(0.0f) } - }; - - static int test() - { - int Error = 0; - - // scalar - { - float const Edge = 2.0f; - - float const A = glm::step(Edge, 1.0f); - Error += glm::equal(A, 0.0f, glm::epsilon()) ? 0 : 1; - - float const B = glm::step(Edge, 3.0f); - Error += glm::equal(B, 1.0f, glm::epsilon()) ? 0 : 1; - - float const C = glm::step(Edge, 2.0f); - Error += glm::equal(C, 1.0f, glm::epsilon()) ? 0 : 1; - } - - // vec4 and float - { - for (std::size_t i = 0; i < sizeof(TestVec4Scalar) / sizeof(entry); ++i) - { - glm::vec4 Result = glm::step(TestVec4Scalar[i].edge, TestVec4Scalar[i].x); - Error += glm::all(glm::equal(Result, TestVec4Scalar[i].result, glm::epsilon())) ? 0 : 1; - } - } - - // vec4 and vec4 - { - for (std::size_t i = 0; i < sizeof(TestVec4Vector) / sizeof(entry); ++i) - { - glm::vec4 Result = glm::step(TestVec4Vector[i].edge, TestVec4Vector[i].x); - Error += glm::all(glm::equal(Result, TestVec4Vector[i].result, glm::epsilon())) ? 0 : 1; - } - } - - return Error; - } -}//namespace step_ - -namespace round_ -{ - static int test() - { - int Error = 0; - - { - float A = glm::round(0.0f); - Error += glm::equal(A, 0.0f, glm::epsilon()) ? 0 : 1; - float B = glm::round(0.5f); - Error += glm::equal(B, 1.0f, glm::epsilon()) ? 0 : 1; - float C = glm::round(1.0f); - Error += glm::equal(C, 1.0f, glm::epsilon()) ? 0 : 1; - float D = glm::round(0.1f); - Error += glm::equal(D, 0.0f, glm::epsilon()) ? 0 : 1; - float E = glm::round(0.9f); - Error += glm::equal(E, 1.0f, glm::epsilon()) ? 0 : 1; - float F = glm::round(1.5f); - Error += glm::equal(F, 2.0f, glm::epsilon()) ? 0 : 1; - float G = glm::round(1.9f); - Error += glm::equal(G, 2.0f, glm::epsilon()) ? 0 : 1; - } - - { - float A = glm::round(-0.0f); - Error += glm::equal(A, 0.0f, glm::epsilon()) ? 0 : 1; - float B = glm::round(-0.5f); - Error += glm::equal(B, -1.0f, glm::epsilon()) ? 0 : 1; - float C = glm::round(-1.0f); - Error += glm::equal(C, -1.0f, glm::epsilon()) ? 0 : 1; - float D = glm::round(-0.1f); - Error += glm::equal(D, 0.0f, glm::epsilon()) ? 0 : 1; - float E = glm::round(-0.9f); - Error += glm::equal(E, -1.0f, glm::epsilon()) ? 0 : 1; - float F = glm::round(-1.5f); - Error += glm::equal(F, -2.0f, glm::epsilon()) ? 0 : 1; - float G = glm::round(-1.9f); - Error += glm::equal(G, -2.0f, glm::epsilon()) ? 0 : 1; - } - - return Error; - } -}//namespace round_ - -namespace roundEven -{ - static int test() - { - int Error = 0; - - { - float A1 = glm::roundEven(-1.5f); - Error += glm::equal(A1, -2.0f, 0.0001f) ? 0 : 1; - - float A2 = glm::roundEven(1.5f); - Error += glm::equal(A2, 2.0f, 0.0001f) ? 0 : 1; - - float A5 = glm::roundEven(-2.5f); - Error += glm::equal(A5, -2.0f, 0.0001f) ? 0 : 1; - - float A6 = glm::roundEven(2.5f); - Error += glm::equal(A6, 2.0f, 0.0001f) ? 0 : 1; - - float A3 = glm::roundEven(-3.5f); - Error += glm::equal(A3, -4.0f, 0.0001f) ? 0 : 1; - - float A4 = glm::roundEven(3.5f); - Error += glm::equal(A4, 4.0f, 0.0001f) ? 0 : 1; - - float C7 = glm::roundEven(-4.5f); - Error += glm::equal(C7, -4.0f, 0.0001f) ? 0 : 1; - - float C8 = glm::roundEven(4.5f); - Error += glm::equal(C8, 4.0f, 0.0001f) ? 0 : 1; - - float C1 = glm::roundEven(-5.5f); - Error += glm::equal(C1, -6.0f, 0.0001f) ? 0 : 1; - - float C2 = glm::roundEven(5.5f); - Error += glm::equal(C2, 6.0f, 0.0001f) ? 0 : 1; - - float C3 = glm::roundEven(-6.5f); - Error += glm::equal(C3, -6.0f, 0.0001f) ? 0 : 1; - - float C4 = glm::roundEven(6.5f); - Error += glm::equal(C4, 6.0f, 0.0001f) ? 0 : 1; - - float C5 = glm::roundEven(-7.5f); - Error += glm::equal(C5, -8.0f, 0.0001f) ? 0 : 1; - - float C6 = glm::roundEven(7.5f); - Error += glm::equal(C6, 8.0f, 0.0001f) ? 0 : 1; - - Error += 0; - } - - { - float A7 = glm::roundEven(-2.4f); - Error += glm::equal(A7, -2.0f, 0.0001f) ? 0 : 1; - - float A8 = glm::roundEven(2.4f); - Error += glm::equal(A8, 2.0f, 0.0001f) ? 0 : 1; - - float B1 = glm::roundEven(-2.6f); - Error += glm::equal(B1, -3.0f, 0.0001f) ? 0 : 1; - - float B2 = glm::roundEven(2.6f); - Error += glm::equal(B2, 3.0f, 0.0001f) ? 0 : 1; - - float B3 = glm::roundEven(-2.0f); - Error += glm::equal(B3, -2.0f, 0.0001f) ? 0 : 1; - - float B4 = glm::roundEven(2.0f); - Error += glm::equal(B4, 2.0f, 0.0001f) ? 0 : 1; - - Error += 0; - } - - { - float A = glm::roundEven(0.0f); - Error += glm::equal(A, 0.0f, glm::epsilon()) ? 0 : 1; - float B = glm::roundEven(0.5f); - Error += glm::equal(B, 0.0f, glm::epsilon()) ? 0 : 1; - float C = glm::roundEven(1.0f); - Error += glm::equal(C, 1.0f, glm::epsilon()) ? 0 : 1; - float D = glm::roundEven(0.1f); - Error += glm::equal(D, 0.0f, glm::epsilon()) ? 0 : 1; - float E = glm::roundEven(0.9f); - Error += glm::equal(E, 1.0f, glm::epsilon()) ? 0 : 1; - float F = glm::roundEven(1.5f); - Error += glm::equal(F, 2.0f, glm::epsilon()) ? 0 : 1; - float G = glm::roundEven(1.9f); - Error += glm::equal(G, 2.0f, glm::epsilon()) ? 0 : 1; - } - - { - float A = glm::roundEven(-0.0f); - Error += glm::equal(A, 0.0f, glm::epsilon()) ? 0 : 1; - float B = glm::roundEven(-0.5f); - Error += glm::equal(B, -0.0f, glm::epsilon()) ? 0 : 1; - float C = glm::roundEven(-1.0f); - Error += glm::equal(C, -1.0f, glm::epsilon()) ? 0 : 1; - float D = glm::roundEven(-0.1f); - Error += glm::equal(D, 0.0f, glm::epsilon()) ? 0 : 1; - float E = glm::roundEven(-0.9f); - Error += glm::equal(E, -1.0f, glm::epsilon()) ? 0 : 1; - float F = glm::roundEven(-1.5f); - Error += glm::equal(F, -2.0f, glm::epsilon()) ? 0 : 1; - float G = glm::roundEven(-1.9f); - Error += glm::equal(G, -2.0f, glm::epsilon()) ? 0 : 1; - } - - { - float A = glm::roundEven(1.5f); - Error += glm::equal(A, 2.0f, glm::epsilon()) ? 0 : 1; - float B = glm::roundEven(2.5f); - Error += glm::equal(B, 2.0f, glm::epsilon()) ? 0 : 1; - float C = glm::roundEven(3.5f); - Error += glm::equal(C, 4.0f, glm::epsilon()) ? 0 : 1; - float D = glm::roundEven(4.5f); - Error += glm::equal(D, 4.0f, glm::epsilon()) ? 0 : 1; - float E = glm::roundEven(5.5f); - Error += glm::equal(E, 6.0f, glm::epsilon()) ? 0 : 1; - float F = glm::roundEven(6.5f); - Error += glm::equal(F, 6.0f, glm::epsilon()) ? 0 : 1; - float G = glm::roundEven(7.5f); - Error += glm::equal(G, 8.0f, glm::epsilon()) ? 0 : 1; - } - - { - float A = glm::roundEven(-1.5f); - Error += glm::equal(A, -2.0f, glm::epsilon()) ? 0 : 1; - float B = glm::roundEven(-2.5f); - Error += glm::equal(B, -2.0f, glm::epsilon()) ? 0 : 1; - float C = glm::roundEven(-3.5f); - Error += glm::equal(C, -4.0f, glm::epsilon()) ? 0 : 1; - float D = glm::roundEven(-4.5f); - Error += glm::equal(D, -4.0f, glm::epsilon()) ? 0 : 1; - float E = glm::roundEven(-5.5f); - Error += glm::equal(E, -6.0f, glm::epsilon()) ? 0 : 1; - float F = glm::roundEven(-6.5f); - Error += glm::equal(F, -6.0f, glm::epsilon()) ? 0 : 1; - float G = glm::roundEven(-7.5f); - Error += glm::equal(G, -8.0f, glm::epsilon()) ? 0 : 1; - } - - return Error; - } -}//namespace roundEven - -namespace isnan_ -{ - static int test() - { - int Error = 0; - - float Zero_f = 0.0; - double Zero_d = 0.0; - - { - Error += true == glm::isnan(0.0/Zero_d) ? 0 : 1; - Error += true == glm::any(glm::isnan(glm::dvec2(0.0 / Zero_d))) ? 0 : 1; - Error += true == glm::any(glm::isnan(glm::dvec3(0.0 / Zero_d))) ? 0 : 1; - Error += true == glm::any(glm::isnan(glm::dvec4(0.0 / Zero_d))) ? 0 : 1; - } - - { - Error += true == glm::isnan(0.0f/Zero_f) ? 0 : 1; - Error += true == glm::any(glm::isnan(glm::vec2(0.0f/Zero_f))) ? 0 : 1; - Error += true == glm::any(glm::isnan(glm::vec3(0.0f/Zero_f))) ? 0 : 1; - Error += true == glm::any(glm::isnan(glm::vec4(0.0f/Zero_f))) ? 0 : 1; - } - - return Error; - } -}//namespace isnan_ - -namespace isinf_ -{ - static int test() - { - int Error = 0; - - float Zero_f = 0.0; - double Zero_d = 0.0; - - { - Error += true == glm::isinf( 1.0/Zero_d) ? 0 : 1; - Error += true == glm::isinf(-1.0/Zero_d) ? 0 : 1; - Error += true == glm::any(glm::isinf(glm::dvec2( 1.0/Zero_d))) ? 0 : 1; - Error += true == glm::any(glm::isinf(glm::dvec2(-1.0/Zero_d))) ? 0 : 1; - Error += true == glm::any(glm::isinf(glm::dvec3( 1.0/Zero_d))) ? 0 : 1; - Error += true == glm::any(glm::isinf(glm::dvec3(-1.0/Zero_d))) ? 0 : 1; - Error += true == glm::any(glm::isinf(glm::dvec4( 1.0/Zero_d))) ? 0 : 1; - Error += true == glm::any(glm::isinf(glm::dvec4(-1.0/Zero_d))) ? 0 : 1; - } - - { - Error += true == glm::isinf( 1.0f/Zero_f) ? 0 : 1; - Error += true == glm::isinf(-1.0f/Zero_f) ? 0 : 1; - Error += true == glm::any(glm::isinf(glm::vec2( 1.0f/Zero_f))) ? 0 : 1; - Error += true == glm::any(glm::isinf(glm::vec2(-1.0f/Zero_f))) ? 0 : 1; - Error += true == glm::any(glm::isinf(glm::vec3( 1.0f/Zero_f))) ? 0 : 1; - Error += true == glm::any(glm::isinf(glm::vec3(-1.0f/Zero_f))) ? 0 : 1; - Error += true == glm::any(glm::isinf(glm::vec4( 1.0f/Zero_f))) ? 0 : 1; - Error += true == glm::any(glm::isinf(glm::vec4(-1.0f/Zero_f))) ? 0 : 1; - } - - return Error; - } -}//namespace isinf_ - -namespace sign -{ - template - GLM_FUNC_QUALIFIER genFIType sign_if(genFIType x) - { - GLM_STATIC_ASSERT( - std::numeric_limits::is_iec559 || - (std::numeric_limits::is_signed && std::numeric_limits::is_integer), "'sign' only accept signed inputs"); - - genFIType result; - if(x > genFIType(0)) - result = genFIType(1); - else if(x < genFIType(0)) - result = genFIType(-1); - else - result = genFIType(0); - return result; - } - - template - GLM_FUNC_QUALIFIER genFIType sign_alu1(genFIType x) - { - GLM_STATIC_ASSERT( - std::numeric_limits::is_signed && std::numeric_limits::is_integer, - "'sign' only accept integer inputs"); - - return (x >> 31) | (static_cast(-x) >> 31); - } - - GLM_FUNC_QUALIFIER int sign_alu2(int x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_signed && std::numeric_limits::is_integer, "'sign' only accept integer inputs"); - -# if GLM_COMPILER & GLM_COMPILER_VC -# pragma warning(push) -# pragma warning(disable : 4146) //cast truncates constant value -# endif - - return -(static_cast(x) >> 31) | (-static_cast(x) >> 31); - -# if GLM_COMPILER & GLM_COMPILER_VC -# pragma warning(pop) -# endif - } - - template - GLM_FUNC_QUALIFIER genFIType sign_sub(genFIType x) - { - GLM_STATIC_ASSERT( - std::numeric_limits::is_signed && std::numeric_limits::is_integer, - "'sign' only accept integer inputs"); - - return (static_cast(-x) >> 31) - (static_cast(x) >> 31); - } - - template - GLM_FUNC_QUALIFIER genFIType sign_cmp(genFIType x) - { - GLM_STATIC_ASSERT( - std::numeric_limits::is_signed && std::numeric_limits::is_integer, - "'sign' only accept integer inputs"); - - return (x > 0) - (x < 0); - } - - template - struct type - { - genType Value; - genType Return; - }; - - int test_int32() - { - type const Data[] = - { - { std::numeric_limits::max(), 1}, - { std::numeric_limits::min(), -1}, - { 0, 0}, - { 1, 1}, - { 2, 1}, - { 3, 1}, - {-1,-1}, - {-2,-1}, - {-3,-1} - }; - - int Error = 0; - - for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) - { - glm::int32 Result = glm::sign(Data[i].Value); - Error += Data[i].Return == Result ? 0 : 1; - } - - for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) - { - glm::int32 Result = sign_cmp(Data[i].Value); - Error += Data[i].Return == Result ? 0 : 1; - } - - for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) - { - glm::int32 Result = sign_if(Data[i].Value); - Error += Data[i].Return == Result ? 0 : 1; - } - - for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) - { - glm::int32 Result = sign_alu1(Data[i].Value); - Error += Data[i].Return == Result ? 0 : 1; - } - - for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) - { - glm::int32 Result = sign_alu2(Data[i].Value); - Error += Data[i].Return == Result ? 0 : 1; - } - - return Error; - } - - int test_i32vec4() - { - type const Data[] = - { - {glm::ivec4( 1), glm::ivec4( 1)}, - {glm::ivec4( 0), glm::ivec4( 0)}, - {glm::ivec4( 2), glm::ivec4( 1)}, - {glm::ivec4( 3), glm::ivec4( 1)}, - {glm::ivec4(-1), glm::ivec4(-1)}, - {glm::ivec4(-2), glm::ivec4(-1)}, - {glm::ivec4(-3), glm::ivec4(-1)} - }; - - int Error = 0; - - for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) - { - glm::ivec4 Result = glm::sign(Data[i].Value); - Error += glm::all(glm::equal(Data[i].Return, Result)) ? 0 : 1; - } - - return Error; - } - - int test_f32vec4() - { - type const Data[] = - { - {glm::vec4( 1), glm::vec4( 1)}, - {glm::vec4( 0), glm::vec4( 0)}, - {glm::vec4( 2), glm::vec4( 1)}, - {glm::vec4( 3), glm::vec4( 1)}, - {glm::vec4(-1), glm::vec4(-1)}, - {glm::vec4(-2), glm::vec4(-1)}, - {glm::vec4(-3), glm::vec4(-1)} - }; - - int Error = 0; - - for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) - { - glm::vec4 Result = glm::sign(Data[i].Value); - Error += glm::all(glm::equal(Data[i].Return, Result, glm::epsilon())) ? 0 : 1; - } - - return Error; - } - - static int test() - { - int Error = 0; - - Error += test_int32(); - Error += test_i32vec4(); - Error += test_f32vec4(); - - return Error; - } - - int perf_rand(std::size_t Samples) - { - int Error = 0; - - std::size_t const Count = Samples; - std::vector Input, Output; - Input.resize(Count); - Output.resize(Count); - for(std::size_t i = 0; i < Count; ++i) - Input[i] = static_cast(glm::linearRand(-65536.f, 65536.f)); - - std::clock_t Timestamp0 = std::clock(); - - for(std::size_t i = 0; i < Count; ++i) - Output[i] = sign_cmp(Input[i]); - - std::clock_t Timestamp1 = std::clock(); - - for(std::size_t i = 0; i < Count; ++i) - Output[i] = sign_if(Input[i]); - - std::clock_t Timestamp2 = std::clock(); - - for(std::size_t i = 0; i < Count; ++i) - Output[i] = sign_alu1(Input[i]); - - std::clock_t Timestamp3 = std::clock(); - - for(std::size_t i = 0; i < Count; ++i) - Output[i] = sign_alu2(Input[i]); - - std::clock_t Timestamp4 = std::clock(); - - for(std::size_t i = 0; i < Count; ++i) - Output[i] = sign_sub(Input[i]); - - std::clock_t Timestamp5 = std::clock(); - - for(std::size_t i = 0; i < Count; ++i) - Output[i] = glm::sign(Input[i]); - - std::clock_t Timestamp6 = std::clock(); - - std::printf("sign_cmp(rand) Time %d clocks\n", static_cast(Timestamp1 - Timestamp0)); - std::printf("sign_if(rand) Time %d clocks\n", static_cast(Timestamp2 - Timestamp1)); - std::printf("sign_alu1(rand) Time %d clocks\n", static_cast(Timestamp3 - Timestamp2)); - std::printf("sign_alu2(rand) Time %d clocks\n", static_cast(Timestamp4 - Timestamp3)); - std::printf("sign_sub(rand) Time %d clocks\n", static_cast(Timestamp5 - Timestamp4)); - std::printf("glm::sign(rand) Time %d clocks\n", static_cast(Timestamp6 - Timestamp5)); - - return Error; - } - - int perf_linear(std::size_t Samples) - { - int Error = 0; - - std::size_t const Count = Samples; - std::vector Input, Output; - Input.resize(Count); - Output.resize(Count); - for(std::size_t i = 0; i < Count; ++i) - Input[i] = static_cast(i); - - std::clock_t Timestamp0 = std::clock(); - - for(std::size_t i = 0; i < Count; ++i) - Output[i] = sign_cmp(Input[i]); - - std::clock_t Timestamp1 = std::clock(); - - for(std::size_t i = 0; i < Count; ++i) - Output[i] = sign_if(Input[i]); - - std::clock_t Timestamp2 = std::clock(); - - for(std::size_t i = 0; i < Count; ++i) - Output[i] = sign_alu1(Input[i]); - - std::clock_t Timestamp3 = std::clock(); - - for(std::size_t i = 0; i < Count; ++i) - Output[i] = sign_alu2(Input[i]); - - std::clock_t Timestamp4 = std::clock(); - - for(std::size_t i = 0; i < Count; ++i) - Output[i] = sign_sub(Input[i]); - - std::clock_t Timestamp5 = std::clock(); - - std::printf("sign_cmp(linear) Time %d clocks\n", static_cast(Timestamp1 - Timestamp0)); - std::printf("sign_if(linear) Time %d clocks\n", static_cast(Timestamp2 - Timestamp1)); - std::printf("sign_alu1(linear) Time %d clocks\n", static_cast(Timestamp3 - Timestamp2)); - std::printf("sign_alu2(linear) Time %d clocks\n", static_cast(Timestamp4 - Timestamp3)); - std::printf("sign_sub(linear) Time %d clocks\n", static_cast(Timestamp5 - Timestamp4)); - - return Error; - } - - int perf_linear_cal(std::size_t Samples) - { - int Error = 0; - - glm::int32 const Count = static_cast(Samples); - - std::clock_t Timestamp0 = std::clock(); - glm::int32 Sum = 0; - - for(glm::int32 i = 1; i < Count; ++i) - Sum += sign_cmp(i); - - std::clock_t Timestamp1 = std::clock(); - - for(glm::int32 i = 1; i < Count; ++i) - Sum += sign_if(i); - - std::clock_t Timestamp2 = std::clock(); - - for(glm::int32 i = 1; i < Count; ++i) - Sum += sign_alu1(i); - - std::clock_t Timestamp3 = std::clock(); - - for(glm::int32 i = 1; i < Count; ++i) - Sum += sign_alu2(i); - - std::clock_t Timestamp4 = std::clock(); - - for(glm::int32 i = 1; i < Count; ++i) - Sum += sign_sub(i); - - std::clock_t Timestamp5 = std::clock(); - - std::printf("Sum %d\n", static_cast(Sum)); - - std::printf("sign_cmp(linear_cal) Time %d clocks\n", static_cast(Timestamp1 - Timestamp0)); - std::printf("sign_if(linear_cal) Time %d clocks\n", static_cast(Timestamp2 - Timestamp1)); - std::printf("sign_alu1(linear_cal) Time %d clocks\n", static_cast(Timestamp3 - Timestamp2)); - std::printf("sign_alu2(linear_cal) Time %d clocks\n", static_cast(Timestamp4 - Timestamp3)); - std::printf("sign_sub(linear_cal) Time %d clocks\n", static_cast(Timestamp5 - Timestamp4)); - - return Error; - } - - static int perf(std::size_t Samples) - { - int Error(0); - - Error += perf_linear_cal(Samples); - Error += perf_linear(Samples); - Error += perf_rand(Samples); - - return Error; - } -}//namespace sign - -namespace frexp_ -{ - static int test() - { - int Error = 0; - - { - glm::vec1 const x(1024); - glm::ivec1 exp; - glm::vec1 A = glm::frexp(x, exp); - Error += glm::all(glm::equal(A, glm::vec1(0.5), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(exp, glm::ivec1(11))) ? 0 : 1; - } - - { - glm::vec2 const x(1024, 0.24); - glm::ivec2 exp; - glm::vec2 A = glm::frexp(x, exp); - Error += glm::all(glm::equal(A, glm::vec2(0.5, 0.96), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(exp, glm::ivec2(11, -2))) ? 0 : 1; - } - - { - glm::vec3 const x(1024, 0.24, 0); - glm::ivec3 exp; - glm::vec3 A = glm::frexp(x, exp); - Error += glm::all(glm::equal(A, glm::vec3(0.5, 0.96, 0.0), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(exp, glm::ivec3(11, -2, 0))) ? 0 : 1; - } - - { - glm::vec4 const x(1024, 0.24, 0, -1.33); - glm::ivec4 exp; - glm::vec4 A = glm::frexp(x, exp); - Error += glm::all(glm::equal(A, glm::vec4(0.5, 0.96, 0.0, -0.665), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(exp, glm::ivec4(11, -2, 0, 1))) ? 0 : 1; - } - - return Error; - } -}//namespace frexp_ - -namespace ldexp_ -{ - static int test() - { - int Error(0); - - { - glm::vec1 A = glm::vec1(0.5); - glm::ivec1 exp = glm::ivec1(11); - glm::vec1 x = glm::ldexp(A, exp); - Error += glm::all(glm::equal(x, glm::vec1(1024),0.00001f)) ? 0 : 1; - } - - { - glm::vec2 A = glm::vec2(0.5, 0.96); - glm::ivec2 exp = glm::ivec2(11, -2); - glm::vec2 x = glm::ldexp(A, exp); - Error += glm::all(glm::equal(x, glm::vec2(1024, .24),0.00001f)) ? 0 : 1; - } - - { - glm::vec3 A = glm::vec3(0.5, 0.96, 0.0); - glm::ivec3 exp = glm::ivec3(11, -2, 0); - glm::vec3 x = glm::ldexp(A, exp); - Error += glm::all(glm::equal(x, glm::vec3(1024, .24, 0),0.00001f)) ? 0 : 1; - } - - { - glm::vec4 A = glm::vec4(0.5, 0.96, 0.0, -0.665); - glm::ivec4 exp = glm::ivec4(11, -2, 0, 1); - glm::vec4 x = glm::ldexp(A, exp); - Error += glm::all(glm::equal(x, glm::vec4(1024, .24, 0, -1.33),0.00001f)) ? 0 : 1; - } - - return Error; - } -}//namespace ldexp_ - -static int test_constexpr() -{ -#if GLM_HAS_CONSTEXPR - static_assert(glm::abs(1.0f) > 0.0f, "GLM: Failed constexpr"); - constexpr glm::vec1 const A = glm::abs(glm::vec1(1.0f)); - constexpr glm::vec2 const B = glm::abs(glm::vec2(1.0f)); - constexpr glm::vec3 const C = glm::abs(glm::vec3(1.0f)); - constexpr glm::vec4 const D = glm::abs(glm::vec4(1.0f)); -#endif // GLM_HAS_CONSTEXPR - - return 0; -} - -int main() -{ - int Error = 0; - - Error += test_constexpr(); - Error += sign::test(); - Error += floor_::test(); - Error += mod_::test(); - Error += modf_::test(); - Error += floatBitsToInt::test(); - Error += floatBitsToUint::test(); - Error += mix_::test(); - Error += step_::test(); - Error += max_::test(); - Error += min_::test(); - Error += clamp_::test(); - Error += round_::test(); - Error += roundEven::test(); - Error += isnan_::test(); - Error += isinf_::test(); - Error += frexp_::test(); - Error += ldexp_::test(); - -# ifdef NDEBUG - std::size_t Samples = 1000; -# else - std::size_t Samples = 1; -# endif - Error += sign::perf(Samples); - - Error += min_::perf(Samples); - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_func_exponential.cpp b/3rdparty/glm/source/test/core/core_func_exponential.cpp deleted file mode 100644 index 380cdfb..0000000 --- a/3rdparty/glm/source/test/core/core_func_exponential.cpp +++ /dev/null @@ -1,185 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int test_pow() -{ - int Error(0); - - float A = glm::pow(2.f, 2.f); - Error += glm::equal(A, 4.f, 0.01f) ? 0 : 1; - - glm::vec1 B = glm::pow(glm::vec1(2.f), glm::vec1(2.f)); - Error += glm::all(glm::equal(B, glm::vec1(4.f), 0.01f)) ? 0 : 1; - - glm::vec2 C = glm::pow(glm::vec2(2.f), glm::vec2(2.f)); - Error += glm::all(glm::equal(C, glm::vec2(4.f), 0.01f)) ? 0 : 1; - - glm::vec3 D = glm::pow(glm::vec3(2.f), glm::vec3(2.f)); - Error += glm::all(glm::equal(D, glm::vec3(4.f), 0.01f)) ? 0 : 1; - - glm::vec4 E = glm::pow(glm::vec4(2.f), glm::vec4(2.f)); - Error += glm::all(glm::equal(E, glm::vec4(4.f), 0.01f)) ? 0 : 1; - - return Error; -} - -static int test_sqrt() -{ - int Error = 0; - - float A = glm::sqrt(4.f); - Error += glm::equal(A, 2.f, 0.01f) ? 0 : 1; - - glm::vec1 B = glm::sqrt(glm::vec1(4.f)); - Error += glm::all(glm::equal(B, glm::vec1(2.f), 0.01f)) ? 0 : 1; - - glm::vec2 C = glm::sqrt(glm::vec2(4.f)); - Error += glm::all(glm::equal(C, glm::vec2(2.f), 0.01f)) ? 0 : 1; - - glm::vec3 D = glm::sqrt(glm::vec3(4.f)); - Error += glm::all(glm::equal(D, glm::vec3(2.f), 0.01f)) ? 0 : 1; - - glm::vec4 E = glm::sqrt(glm::vec4(4.f)); - Error += glm::all(glm::equal(E, glm::vec4(2.f), 0.01f)) ? 0 : 1; - - return Error; -} - -static int test_exp() -{ - int Error = 0; - - float A = glm::exp(1.f); - Error += glm::equal(A, glm::e(), 0.01f) ? 0 : 1; - - glm::vec1 B = glm::exp(glm::vec1(1.f)); - Error += glm::all(glm::equal(B, glm::vec1(glm::e()), 0.01f)) ? 0 : 1; - - glm::vec2 C = glm::exp(glm::vec2(1.f)); - Error += glm::all(glm::equal(C, glm::vec2(glm::e()), 0.01f)) ? 0 : 1; - - glm::vec3 D = glm::exp(glm::vec3(1.f)); - Error += glm::all(glm::equal(D, glm::vec3(glm::e()), 0.01f)) ? 0 : 1; - - glm::vec4 E = glm::exp(glm::vec4(1.f)); - Error += glm::all(glm::equal(E, glm::vec4(glm::e()), 0.01f)) ? 0 : 1; - - return Error; -} - -static int test_log() -{ - int Error = 0; - - float const A = glm::log(glm::e()); - Error += glm::equal(A, 1.f, 0.01f) ? 0 : 1; - - glm::vec1 const B = glm::log(glm::vec1(glm::e())); - Error += glm::all(glm::equal(B, glm::vec1(1.f), 0.01f)) ? 0 : 1; - - glm::vec2 const C = glm::log(glm::vec2(glm::e())); - Error += glm::all(glm::equal(C, glm::vec2(1.f), 0.01f)) ? 0 : 1; - - glm::vec3 const D = glm::log(glm::vec3(glm::e())); - Error += glm::all(glm::equal(D, glm::vec3(1.f), 0.01f)) ? 0 : 1; - - glm::vec4 const E = glm::log(glm::vec4(glm::e())); - Error += glm::all(glm::equal(E, glm::vec4(1.f), 0.01f)) ? 0 : 1; - - return Error; -} - -static int test_exp2() -{ - int Error = 0; - - float A = glm::exp2(4.f); - Error += glm::equal(A, 16.f, 0.01f) ? 0 : 1; - - glm::vec1 B = glm::exp2(glm::vec1(4.f)); - Error += glm::all(glm::equal(B, glm::vec1(16.f), 0.01f)) ? 0 : 1; - - glm::vec2 C = glm::exp2(glm::vec2(4.f, 3.f)); - Error += glm::all(glm::equal(C, glm::vec2(16.f, 8.f), 0.01f)) ? 0 : 1; - - glm::vec3 D = glm::exp2(glm::vec3(4.f, 3.f, 2.f)); - Error += glm::all(glm::equal(D, glm::vec3(16.f, 8.f, 4.f), 0.01f)) ? 0 : 1; - - glm::vec4 E = glm::exp2(glm::vec4(4.f, 3.f, 2.f, 1.f)); - Error += glm::all(glm::equal(E, glm::vec4(16.f, 8.f, 4.f, 2.f), 0.01f)) ? 0 : 1; - -# if GLM_HAS_CXX11_STL - //large exponent - float F = glm::exp2(23.f); - Error += glm::equal(F, 8388608.f, 0.01f) ? 0 : 1; -# endif - - return Error; -} - -static int test_log2() -{ - int Error = 0; - - float A = glm::log2(16.f); - Error += glm::equal(A, 4.f, 0.01f) ? 0 : 1; - - glm::vec1 B = glm::log2(glm::vec1(16.f)); - Error += glm::all(glm::equal(B, glm::vec1(4.f), 0.01f)) ? 0 : 1; - - glm::vec2 C = glm::log2(glm::vec2(16.f, 8.f)); - Error += glm::all(glm::equal(C, glm::vec2(4.f, 3.f), 0.01f)) ? 0 : 1; - - glm::vec3 D = glm::log2(glm::vec3(16.f, 8.f, 4.f)); - Error += glm::all(glm::equal(D, glm::vec3(4.f, 3.f, 2.f), 0.01f)) ? 0 : 1; - - glm::vec4 E = glm::log2(glm::vec4(16.f, 8.f, 4.f, 2.f)); - Error += glm::all(glm::equal(E, glm::vec4(4.f, 3.f, 2.f, 1.f), 0.01f)) ? 0 : 1; - - return Error; -} - -static int test_inversesqrt() -{ - int Error = 0; - - float A = glm::inversesqrt(16.f) * glm::sqrt(16.f); - Error += glm::equal(A, 1.f, 0.01f) ? 0 : 1; - - glm::vec1 B = glm::inversesqrt(glm::vec1(16.f)) * glm::sqrt(16.f); - Error += glm::all(glm::equal(B, glm::vec1(1.f), 0.01f)) ? 0 : 1; - - glm::vec2 C = glm::inversesqrt(glm::vec2(16.f)) * glm::sqrt(16.f); - Error += glm::all(glm::equal(C, glm::vec2(1.f), 0.01f)) ? 0 : 1; - - glm::vec3 D = glm::inversesqrt(glm::vec3(16.f)) * glm::sqrt(16.f); - Error += glm::all(glm::equal(D, glm::vec3(1.f), 0.01f)) ? 0 : 1; - - glm::vec4 E = glm::inversesqrt(glm::vec4(16.f)) * glm::sqrt(16.f); - Error += glm::all(glm::equal(E, glm::vec4(1.f), 0.01f)) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_pow(); - Error += test_sqrt(); - Error += test_exp(); - Error += test_log(); - Error += test_exp2(); - Error += test_log2(); - Error += test_inversesqrt(); - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_func_geometric.cpp b/3rdparty/glm/source/test/core/core_func_geometric.cpp deleted file mode 100644 index 7ef9c68..0000000 --- a/3rdparty/glm/source/test/core/core_func_geometric.cpp +++ /dev/null @@ -1,200 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace length -{ - int test() - { - float Length1 = glm::length(glm::vec1(1)); - float Length2 = glm::length(glm::vec2(1, 0)); - float Length3 = glm::length(glm::vec3(1, 0, 0)); - float Length4 = glm::length(glm::vec4(1, 0, 0, 0)); - - int Error = 0; - - Error += glm::abs(Length1 - 1.0f) < std::numeric_limits::epsilon() ? 0 : 1; - Error += glm::abs(Length2 - 1.0f) < std::numeric_limits::epsilon() ? 0 : 1; - Error += glm::abs(Length3 - 1.0f) < std::numeric_limits::epsilon() ? 0 : 1; - Error += glm::abs(Length4 - 1.0f) < std::numeric_limits::epsilon() ? 0 : 1; - - return Error; - } -}//namespace length - -namespace distance -{ - int test() - { - float Distance1 = glm::distance(glm::vec1(1), glm::vec1(1)); - float Distance2 = glm::distance(glm::vec2(1, 0), glm::vec2(1, 0)); - float Distance3 = glm::distance(glm::vec3(1, 0, 0), glm::vec3(1, 0, 0)); - float Distance4 = glm::distance(glm::vec4(1, 0, 0, 0), glm::vec4(1, 0, 0, 0)); - - int Error = 0; - - Error += glm::abs(Distance1) < std::numeric_limits::epsilon() ? 0 : 1; - Error += glm::abs(Distance2) < std::numeric_limits::epsilon() ? 0 : 1; - Error += glm::abs(Distance3) < std::numeric_limits::epsilon() ? 0 : 1; - Error += glm::abs(Distance4) < std::numeric_limits::epsilon() ? 0 : 1; - - return Error; - } -}//namespace distance - -namespace dot -{ - int test() - { - float Dot1 = glm::dot(glm::vec1(1), glm::vec1(1)); - float Dot2 = glm::dot(glm::vec2(1), glm::vec2(1)); - float Dot3 = glm::dot(glm::vec3(1), glm::vec3(1)); - float Dot4 = glm::dot(glm::vec4(1), glm::vec4(1)); - - int Error = 0; - - Error += glm::abs(Dot1 - 1.0f) < std::numeric_limits::epsilon() ? 0 : 1; - Error += glm::abs(Dot2 - 2.0f) < std::numeric_limits::epsilon() ? 0 : 1; - Error += glm::abs(Dot3 - 3.0f) < std::numeric_limits::epsilon() ? 0 : 1; - Error += glm::abs(Dot4 - 4.0f) < std::numeric_limits::epsilon() ? 0 : 1; - - return Error; - } -}//namespace dot - -namespace cross -{ - int test() - { - glm::vec3 Cross1 = glm::cross(glm::vec3(1, 0, 0), glm::vec3(0, 1, 0)); - glm::vec3 Cross2 = glm::cross(glm::vec3(0, 1, 0), glm::vec3(1, 0, 0)); - - int Error = 0; - - Error += glm::all(glm::lessThan(glm::abs(Cross1 - glm::vec3(0, 0, 1)), glm::vec3(std::numeric_limits::epsilon()))) ? 0 : 1; - Error += glm::all(glm::lessThan(glm::abs(Cross2 - glm::vec3(0, 0,-1)), glm::vec3(std::numeric_limits::epsilon()))) ? 0 : 1; - - return Error; - } -}//namespace cross - -namespace normalize -{ - int test() - { - glm::vec3 Normalize1 = glm::normalize(glm::vec3(1, 0, 0)); - glm::vec3 Normalize2 = glm::normalize(glm::vec3(2, 0, 0)); - - glm::vec3 Normalize3 = glm::normalize(glm::vec3(-0.6, 0.7, -0.5)); - - glm::vec3 ro = glm::vec3(glm::cos(5.f) * 3.f, 2.f, glm::sin(5.f) * 3.f); - glm::vec3 w = glm::normalize(glm::vec3(0, -0.2f, 0) - ro); - glm::vec3 u = glm::normalize(glm::cross(w, glm::vec3(0, 1, 0))); - glm::vec3 v = glm::cross(u, w); - - int Error = 0; - - Error += glm::all(glm::lessThan(glm::abs(Normalize1 - glm::vec3(1, 0, 0)), glm::vec3(std::numeric_limits::epsilon()))) ? 0 : 1; - Error += glm::all(glm::lessThan(glm::abs(Normalize2 - glm::vec3(1, 0, 0)), glm::vec3(std::numeric_limits::epsilon()))) ? 0 : 1; - - return Error; - } -}//namespace normalize - -namespace faceforward -{ - int test() - { - int Error = 0; - - { - glm::vec3 N(0.0f, 0.0f, 1.0f); - glm::vec3 I(1.0f, 0.0f, 1.0f); - glm::vec3 Nref(0.0f, 0.0f, 1.0f); - glm::vec3 F = glm::faceforward(N, I, Nref); - } - - return Error; - } -}//namespace faceforward - -namespace reflect -{ - int test() - { - int Error = 0; - - { - glm::vec2 A(1.0f,-1.0f); - glm::vec2 B(0.0f, 1.0f); - glm::vec2 C = glm::reflect(A, B); - Error += glm::all(glm::equal(C, glm::vec2(1.0, 1.0), 0.0001f)) ? 0 : 1; - } - - { - glm::dvec2 A(1.0f,-1.0f); - glm::dvec2 B(0.0f, 1.0f); - glm::dvec2 C = glm::reflect(A, B); - Error += glm::all(glm::equal(C, glm::dvec2(1.0, 1.0), 0.0001)) ? 0 : 1; - } - - return Error; - } -}//namespace reflect - -namespace refract -{ - int test() - { - int Error = 0; - - { - float A(-1.0f); - float B(1.0f); - float C = glm::refract(A, B, 0.5f); - Error += glm::equal(C, -1.0f, 0.0001f) ? 0 : 1; - } - - { - glm::vec2 A(0.0f,-1.0f); - glm::vec2 B(0.0f, 1.0f); - glm::vec2 C = glm::refract(A, B, 0.5f); - Error += glm::all(glm::equal(C, glm::vec2(0.0, -1.0), 0.0001f)) ? 0 : 1; - } - - { - glm::dvec2 A(0.0f,-1.0f); - glm::dvec2 B(0.0f, 1.0f); - glm::dvec2 C = glm::refract(A, B, 0.5); - Error += glm::all(glm::equal(C, glm::dvec2(0.0, -1.0), 0.0001)) ? 0 : 1; - } - - return Error; - } -}//namespace refract - -int main() -{ - int Error(0); - - Error += length::test(); - Error += distance::test(); - Error += dot::test(); - Error += cross::test(); - Error += normalize::test(); - Error += faceforward::test(); - Error += reflect::test(); - Error += refract::test(); - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_func_integer.cpp b/3rdparty/glm/source/test/core/core_func_integer.cpp deleted file mode 100644 index 95d650c..0000000 --- a/3rdparty/glm/source/test/core/core_func_integer.cpp +++ /dev/null @@ -1,1556 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -enum result -{ - SUCCESS, - FAIL, - ASSERT, - STATIC_ASSERT -}; - -namespace bitfieldInsert -{ - template - struct type - { - genType Base; - genType Insert; - int Offset; - int Bits; - genType Return; - }; - - typedef type typeU32; - - typeU32 const Data32[] = - { - {0x00000000, 0xffffffff, 0, 32, 0xffffffff}, - {0x00000000, 0xffffffff, 0, 31, 0x7fffffff}, - {0x00000000, 0xffffffff, 0, 0, 0x00000000}, - {0xff000000, 0x000000ff, 8, 8, 0xff00ff00}, - {0xffff0000, 0xffff0000, 16, 16, 0x00000000}, - {0x0000ffff, 0x0000ffff, 16, 16, 0xffffffff} - }; - - static int test() - { - int Error = 0; - glm::uint count = sizeof(Data32) / sizeof(typeU32); - - for(glm::uint i = 0; i < count; ++i) - { - glm::uint Return = glm::bitfieldInsert( - Data32[i].Base, - Data32[i].Insert, - Data32[i].Offset, - Data32[i].Bits); - - Error += Data32[i].Return == Return ? 0 : 1; - } - - return Error; - } -}//bitfieldInsert - -namespace bitfieldExtract -{ - template - struct type - { - genType Value; - int Offset; - int Bits; - genType Return; - result Result; - }; - - typedef type typeU32; - - typeU32 const Data32[] = - { - {0xffffffff, 0,32, 0xffffffff, SUCCESS}, - {0xffffffff, 8, 0, 0x00000000, SUCCESS}, - {0x00000000, 0,32, 0x00000000, SUCCESS}, - {0x0f0f0f0f, 0,32, 0x0f0f0f0f, SUCCESS}, - {0x00000000, 8, 0, 0x00000000, SUCCESS}, - {0x80000000,31, 1, 0x00000001, SUCCESS}, - {0x7fffffff,31, 1, 0x00000000, SUCCESS}, - {0x00000300, 8, 8, 0x00000003, SUCCESS}, - {0x0000ff00, 8, 8, 0x000000ff, SUCCESS}, - {0xfffffff0, 0, 5, 0x00000010, SUCCESS}, - {0x000000ff, 1, 3, 0x00000007, SUCCESS}, - {0x000000ff, 0, 3, 0x00000007, SUCCESS}, - {0x00000000, 0, 2, 0x00000000, SUCCESS}, - {0xffffffff, 0, 8, 0x000000ff, SUCCESS}, - {0xffff0000,16,16, 0x0000ffff, SUCCESS}, - {0xfffffff0, 0, 8, 0x00000000, FAIL}, - {0xffffffff,16,16, 0x00000000, FAIL}, - //{0xffffffff,32, 1, 0x00000000, ASSERT}, // Throw an assert - //{0xffffffff, 0,33, 0x00000000, ASSERT}, // Throw an assert - //{0xffffffff,16,16, 0x00000000, ASSERT}, // Throw an assert - }; - - static int test() - { - int Error = 0; - - glm::uint count = sizeof(Data32) / sizeof(typeU32); - - for(glm::uint i = 0; i < count; ++i) - { - glm::uint Return = glm::bitfieldExtract( - Data32[i].Value, - Data32[i].Offset, - Data32[i].Bits); - - bool Compare = Data32[i].Return == Return; - - if(Data32[i].Result == SUCCESS && Compare) - continue; - else if(Data32[i].Result == FAIL && !Compare) - continue; - - Error += 1; - } - - return Error; - } -}//extractField - -namespace bitfieldReverse -{ -/* - GLM_FUNC_QUALIFIER unsigned int bitfieldReverseLoop(unsigned int v) - { - unsigned int Result(0); - unsigned int const BitSize = static_cast(sizeof(unsigned int) * 8); - for(unsigned int i = 0; i < BitSize; ++i) - { - unsigned int const BitSet(v & (static_cast(1) << i)); - unsigned int const BitFirst(BitSet >> i); - Result |= BitFirst << (BitSize - 1 - i); - } - return Result; - } - - GLM_FUNC_QUALIFIER glm::uint64_t bitfieldReverseLoop(glm::uint64_t v) - { - glm::uint64_t Result(0); - glm::uint64_t const BitSize = static_cast(sizeof(unsigned int) * 8); - for(glm::uint64_t i = 0; i < BitSize; ++i) - { - glm::uint64_t const BitSet(v & (static_cast(1) << i)); - glm::uint64_t const BitFirst(BitSet >> i); - Result |= BitFirst << (BitSize - 1 - i); - } - return Result; - } -*/ - template - GLM_FUNC_QUALIFIER glm::vec bitfieldReverseLoop(glm::vec const& v) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldReverse' only accept integer values"); - - glm::vec Result(0); - T const BitSize = static_cast(sizeof(T) * 8); - for(T i = 0; i < BitSize; ++i) - { - glm::vec const BitSet(v & (static_cast(1) << i)); - glm::vec const BitFirst(BitSet >> i); - Result |= BitFirst << (BitSize - 1 - i); - } - return Result; - } - - template - GLM_FUNC_QUALIFIER T bitfieldReverseLoop(T v) - { - return bitfieldReverseLoop(glm::vec<1, T>(v)).x; - } - - GLM_FUNC_QUALIFIER glm::uint32 bitfieldReverseUint32(glm::uint32 x) - { - x = (x & 0x55555555) << 1 | (x & 0xAAAAAAAA) >> 1; - x = (x & 0x33333333) << 2 | (x & 0xCCCCCCCC) >> 2; - x = (x & 0x0F0F0F0F) << 4 | (x & 0xF0F0F0F0) >> 4; - x = (x & 0x00FF00FF) << 8 | (x & 0xFF00FF00) >> 8; - x = (x & 0x0000FFFF) << 16 | (x & 0xFFFF0000) >> 16; - return x; - } - - GLM_FUNC_QUALIFIER glm::uint64 bitfieldReverseUint64(glm::uint64 x) - { - x = (x & 0x5555555555555555) << 1 | (x & 0xAAAAAAAAAAAAAAAA) >> 1; - x = (x & 0x3333333333333333) << 2 | (x & 0xCCCCCCCCCCCCCCCC) >> 2; - x = (x & 0x0F0F0F0F0F0F0F0F) << 4 | (x & 0xF0F0F0F0F0F0F0F0) >> 4; - x = (x & 0x00FF00FF00FF00FF) << 8 | (x & 0xFF00FF00FF00FF00) >> 8; - x = (x & 0x0000FFFF0000FFFF) << 16 | (x & 0xFFFF0000FFFF0000) >> 16; - x = (x & 0x00000000FFFFFFFF) << 32 | (x & 0xFFFFFFFF00000000) >> 32; - return x; - } - - template - struct compute_bitfieldReverseStep - { - template - GLM_FUNC_QUALIFIER static glm::vec call(glm::vec const& v, T, T) - { - return v; - } - }; - - template<> - struct compute_bitfieldReverseStep - { - template - GLM_FUNC_QUALIFIER static glm::vec call(glm::vec const& v, T Mask, T Shift) - { - return (v & Mask) << Shift | (v & (~Mask)) >> Shift; - } - }; - - template - GLM_FUNC_QUALIFIER glm::vec bitfieldReverseOps(glm::vec const& v) - { - glm::vec x(v); - x = compute_bitfieldReverseStep= 2>::call(x, static_cast(0x5555555555555555ull), static_cast( 1)); - x = compute_bitfieldReverseStep= 4>::call(x, static_cast(0x3333333333333333ull), static_cast( 2)); - x = compute_bitfieldReverseStep= 8>::call(x, static_cast(0x0F0F0F0F0F0F0F0Full), static_cast( 4)); - x = compute_bitfieldReverseStep= 16>::call(x, static_cast(0x00FF00FF00FF00FFull), static_cast( 8)); - x = compute_bitfieldReverseStep= 32>::call(x, static_cast(0x0000FFFF0000FFFFull), static_cast(16)); - x = compute_bitfieldReverseStep= 64>::call(x, static_cast(0x00000000FFFFFFFFull), static_cast(32)); - return x; - } - - template - GLM_FUNC_QUALIFIER genType bitfieldReverseOps(genType x) - { - return bitfieldReverseOps(glm::vec<1, genType, glm::defaultp>(x)).x; - } - - template - struct type - { - genType Value; - genType Return; - result Result; - }; - - typedef type typeU32; - - typeU32 const Data32[] = - { - {0x00000001, 0x80000000, SUCCESS}, - {0x0000000f, 0xf0000000, SUCCESS}, - {0x000000ff, 0xff000000, SUCCESS}, - {0xf0000000, 0x0000000f, SUCCESS}, - {0xff000000, 0x000000ff, SUCCESS}, - {0xffffffff, 0xffffffff, SUCCESS}, - {0x00000000, 0x00000000, SUCCESS} - }; - - typedef type typeU64; - - typeU64 const Data64[] = - { - {0x00000000000000ff, 0xff00000000000000, SUCCESS}, - {0x000000000000000f, 0xf000000000000000, SUCCESS}, - {0xf000000000000000, 0x000000000000000f, SUCCESS}, - {0xffffffffffffffff, 0xffffffffffffffff, SUCCESS}, - {0x0000000000000000, 0x0000000000000000, SUCCESS} - }; - - static int test32_bitfieldReverse() - { - int Error = 0; - std::size_t const Count = sizeof(Data32) / sizeof(typeU32); - - for(std::size_t i = 0; i < Count; ++i) - { - glm::uint Return = glm::bitfieldReverse(Data32[i].Value); - - bool Compare = Data32[i].Return == Return; - - if(Data32[i].Result == SUCCESS) - Error += Compare ? 0 : 1; - else - Error += Compare ? 1 : 0; - } - - return Error; - } - - static int test32_bitfieldReverseLoop() - { - int Error = 0; - std::size_t const Count = sizeof(Data32) / sizeof(typeU32); - - for(std::size_t i = 0; i < Count; ++i) - { - glm::uint Return = bitfieldReverseLoop(Data32[i].Value); - - bool Compare = Data32[i].Return == Return; - - if(Data32[i].Result == SUCCESS) - Error += Compare ? 0 : 1; - else - Error += Compare ? 1 : 0; - } - - return Error; - } - - static int test32_bitfieldReverseUint32() - { - int Error = 0; - std::size_t const Count = sizeof(Data32) / sizeof(typeU32); - - for(std::size_t i = 0; i < Count; ++i) - { - glm::uint Return = bitfieldReverseUint32(Data32[i].Value); - - bool Compare = Data32[i].Return == Return; - - if(Data32[i].Result == SUCCESS) - Error += Compare ? 0 : 1; - else - Error += Compare ? 1 : 0; - } - - return Error; - } - - static int test32_bitfieldReverseOps() - { - int Error = 0; - std::size_t const Count = sizeof(Data32) / sizeof(typeU32); - - for(std::size_t i = 0; i < Count; ++i) - { - glm::uint Return = bitfieldReverseOps(Data32[i].Value); - - bool Compare = Data32[i].Return == Return; - - if(Data32[i].Result == SUCCESS) - Error += Compare ? 0 : 1; - else - Error += Compare ? 1 : 0; - } - - return Error; - } - - static int test64_bitfieldReverse() - { - int Error = 0; - std::size_t const Count = sizeof(Data64) / sizeof(typeU64); - - for(std::size_t i = 0; i < Count; ++i) - { - glm::uint64 Return = glm::bitfieldReverse(Data64[i].Value); - - bool Compare = Data64[i].Return == Return; - - if(Data64[i].Result == SUCCESS) - Error += Compare ? 0 : 1; - else - Error += Compare ? 1 : 0; - } - - return Error; - } - - static int test64_bitfieldReverseLoop() - { - int Error = 0; - std::size_t const Count = sizeof(Data64) / sizeof(typeU64); - - for(std::size_t i = 0; i < Count; ++i) - { - glm::uint64 Return = bitfieldReverseLoop(Data64[i].Value); - - bool Compare = Data64[i].Return == Return; - - if(Data32[i].Result == SUCCESS) - Error += Compare ? 0 : 1; - else - Error += Compare ? 1 : 0; - } - - return Error; - } - - static int test64_bitfieldReverseUint64() - { - int Error = 0; - std::size_t const Count = sizeof(Data64) / sizeof(typeU64); - - for(std::size_t i = 0; i < Count; ++i) - { - glm::uint64 Return = bitfieldReverseUint64(Data64[i].Value); - - bool Compare = Data64[i].Return == Return; - - if(Data64[i].Result == SUCCESS) - Error += Compare ? 0 : 1; - else - Error += Compare ? 1 : 0; - } - - return Error; - } - - static int test64_bitfieldReverseOps() - { - int Error = 0; - std::size_t const Count = sizeof(Data64) / sizeof(typeU64); - - for(std::size_t i = 0; i < Count; ++i) - { - glm::uint64 Return = bitfieldReverseOps(Data64[i].Value); - - bool Compare = Data64[i].Return == Return; - - if(Data64[i].Result == SUCCESS) - Error += Compare ? 0 : 1; - else - Error += Compare ? 1 : 0; - } - - return Error; - } - - static int test() - { - int Error = 0; - - Error += test32_bitfieldReverse(); - Error += test32_bitfieldReverseLoop(); - Error += test32_bitfieldReverseUint32(); - Error += test32_bitfieldReverseOps(); - - Error += test64_bitfieldReverse(); - Error += test64_bitfieldReverseLoop(); - Error += test64_bitfieldReverseUint64(); - Error += test64_bitfieldReverseOps(); - - return Error; - } - - static int perf32(glm::uint32 Count) - { - int Error = 0; - - std::vector Data; - Data.resize(static_cast(Count)); - - std::clock_t Timestamps0 = std::clock(); - - for(glm::uint32 k = 0; k < Count; ++k) - Data[k] = glm::bitfieldReverse(k); - - std::clock_t Timestamps1 = std::clock(); - - for(glm::uint32 k = 0; k < Count; ++k) - Data[k] = bitfieldReverseLoop(k); - - std::clock_t Timestamps2 = std::clock(); - - for(glm::uint32 k = 0; k < Count; ++k) - Data[k] = bitfieldReverseUint32(k); - - std::clock_t Timestamps3 = std::clock(); - - for(glm::uint32 k = 0; k < Count; ++k) - Data[k] = bitfieldReverseOps(k); - - std::clock_t Timestamps4 = std::clock(); - - std::printf("glm::bitfieldReverse: %d clocks\n", static_cast(Timestamps1 - Timestamps0)); - std::printf("bitfieldReverseLoop: %d clocks\n", static_cast(Timestamps2 - Timestamps1)); - std::printf("bitfieldReverseUint32: %d clocks\n", static_cast(Timestamps3 - Timestamps2)); - std::printf("bitfieldReverseOps: %d clocks\n", static_cast(Timestamps4 - Timestamps3)); - - return Error; - } - - static int perf64(glm::uint64 Count) - { - int Error = 0; - - std::vector Data; - Data.resize(static_cast(Count)); - - std::clock_t Timestamps0 = std::clock(); - - for(glm::uint64 k = 0; k < Count; ++k) - Data[static_cast(k)] = glm::bitfieldReverse(k); - - std::clock_t Timestamps1 = std::clock(); - - for(glm::uint64 k = 0; k < Count; ++k) - Data[static_cast(k)] = bitfieldReverseLoop(k); - - std::clock_t Timestamps2 = std::clock(); - - for(glm::uint64 k = 0; k < Count; ++k) - Data[static_cast(k)] = bitfieldReverseUint64(k); - - std::clock_t Timestamps3 = std::clock(); - - for(glm::uint64 k = 0; k < Count; ++k) - Data[static_cast(k)] = bitfieldReverseOps(k); - - std::clock_t Timestamps4 = std::clock(); - - std::printf("glm::bitfieldReverse - 64: %d clocks\n", static_cast(Timestamps1 - Timestamps0)); - std::printf("bitfieldReverseLoop - 64: %d clocks\n", static_cast(Timestamps2 - Timestamps1)); - std::printf("bitfieldReverseUint - 64: %d clocks\n", static_cast(Timestamps3 - Timestamps2)); - std::printf("bitfieldReverseOps - 64: %d clocks\n", static_cast(Timestamps4 - Timestamps3)); - - return Error; - } - - static int perf(std::size_t Samples) - { - int Error = 0; - - Error += perf32(static_cast(Samples)); - Error += perf64(static_cast(Samples)); - - return Error; - } -}//bitfieldReverse - -namespace findMSB -{ - template - struct type - { - genType Value; - retType Return; - }; - -# if GLM_HAS_BITSCAN_WINDOWS - template - static int findMSB_intrinsic(genIUType Value) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findMSB' only accept integer values"); - - if(Value == 0) - return -1; - - unsigned long Result(0); - _BitScanReverse(&Result, Value); - return int(Result); - } -# endif//GLM_HAS_BITSCAN_WINDOWS - -# if GLM_ARCH & GLM_ARCH_AVX && GLM_COMPILER & GLM_COMPILER_VC - template - static int findMSB_avx(genIUType Value) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findMSB' only accept integer values"); - - if(Value == 0) - return -1; - - return int(_tzcnt_u32(Value)); - } -# endif//GLM_ARCH & GLM_ARCH_AVX && GLM_PLATFORM & GLM_PLATFORM_WINDOWS - - template - static int findMSB_095(genIUType Value) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findMSB' only accept integer values"); - - if(Value == genIUType(0) || Value == genIUType(-1)) - return -1; - else if(Value > 0) - { - genIUType Bit = genIUType(-1); - for(genIUType tmp = Value; tmp > 0; tmp >>= 1, ++Bit){} - return static_cast(Bit); - } - else //if(Value < 0) - { - int const BitCount(sizeof(genIUType) * 8); - int MostSignificantBit(-1); - for(int BitIndex(0); BitIndex < BitCount; ++BitIndex) - MostSignificantBit = (Value & (1 << BitIndex)) ? MostSignificantBit : BitIndex; - assert(MostSignificantBit >= 0); - return MostSignificantBit; - } - } - - template - static int findMSB_nlz1(genIUType x) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findMSB' only accept integer values"); - - if (x == 0) - return -1; - - int n = 0; - if (x <= 0x0000FFFF) {n = n +16; x = x <<16;} - if (x <= 0x00FFFFFF) {n = n + 8; x = x << 8;} - if (x <= 0x0FFFFFFF) {n = n + 4; x = x << 4;} - if (x <= 0x3FFFFFFF) {n = n + 2; x = x << 2;} - if (x <= 0x7FFFFFFF) {n = n + 1;} - return 31 - n; - } - - static int findMSB_nlz2(unsigned int x) - { - unsigned int y; - int n = 32; - - y = x >>16; if (y != 0) {n = n -16; x = y;} - y = x >> 8; if (y != 0) {n = n - 8; x = y;} - y = x >> 4; if (y != 0) {n = n - 4; x = y;} - y = x >> 2; if (y != 0) {n = n - 2; x = y;} - y = x >> 1; if (y != 0) return n - 2; - return 32 - (n - static_cast(x)); - } - - static int findMSB_pop(unsigned int x) - { - x = x | (x >> 1); - x = x | (x >> 2); - x = x | (x >> 4); - x = x | (x >> 8); - x = x | (x >>16); - return 31 - glm::bitCount(~x); - } - - static int perf_int(std::size_t Count) - { - type const Data[] = - { - {0x00000000, -1}, - {0x00000001, 0}, - {0x00000002, 1}, - {0x00000003, 1}, - {0x00000004, 2}, - {0x00000005, 2}, - {0x00000007, 2}, - {0x00000008, 3}, - {0x00000010, 4}, - {0x00000020, 5}, - {0x00000040, 6}, - {0x00000080, 7}, - {0x00000100, 8}, - {0x00000200, 9}, - {0x00000400, 10}, - {0x00000800, 11}, - {0x00001000, 12}, - {0x00002000, 13}, - {0x00004000, 14}, - {0x00008000, 15}, - {0x00010000, 16}, - {0x00020000, 17}, - {0x00040000, 18}, - {0x00080000, 19}, - {0x00100000, 20}, - {0x00200000, 21}, - {0x00400000, 22}, - {0x00800000, 23}, - {0x01000000, 24}, - {0x02000000, 25}, - {0x04000000, 26}, - {0x08000000, 27}, - {0x10000000, 28}, - {0x20000000, 29}, - {0x40000000, 30} - }; - - int Error(0); - - std::clock_t Timestamps0 = std::clock(); - - for(std::size_t k = 0; k < Count; ++k) - for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) - { - int Result = glm::findMSB(Data[i].Value); - Error += Data[i].Return == Result ? 0 : 1; - } - - std::clock_t Timestamps1 = std::clock(); - - for(std::size_t k = 0; k < Count; ++k) - for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) - { - int Result = findMSB_nlz1(Data[i].Value); - Error += Data[i].Return == Result ? 0 : 1; - } - - std::clock_t Timestamps2 = std::clock(); - - for(std::size_t k = 0; k < Count; ++k) - for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) - { - int Result = findMSB_nlz2(static_cast(Data[i].Value)); - Error += Data[i].Return == Result ? 0 : 1; - } - - std::clock_t Timestamps3 = std::clock(); - - for(std::size_t k = 0; k < Count; ++k) - for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) - { - int Result = findMSB_095(static_cast(Data[i].Value)); - Error += Data[i].Return == Result ? 0 : 1; - } - - std::clock_t Timestamps4 = std::clock(); - -# if GLM_HAS_BITSCAN_WINDOWS - for(std::size_t k = 0; k < Count; ++k) - for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) - { - int Result = findMSB_intrinsic(Data[i].Value); - Error += Data[i].Return == Result ? 0 : 1; - } -# endif//GLM_HAS_BITSCAN_WINDOWS - - std::clock_t Timestamps5 = std::clock(); - - for(std::size_t k = 0; k < Count; ++k) - for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) - { - int Result = findMSB_pop(static_cast(Data[i].Value)); - Error += Data[i].Return == Result ? 0 : 1; - } - - std::clock_t Timestamps6 = std::clock(); - -# if GLM_ARCH & GLM_ARCH_AVX && GLM_COMPILER & GLM_COMPILER_VC - for(std::size_t k = 0; k < Count; ++k) - for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) - { - int Result = findMSB_avx(Data[i].Value); - Error += Data[i].Return == Result ? 0 : 1; - } - - std::clock_t Timestamps7 = std::clock(); -# endif - - std::printf("glm::findMSB: %d clocks\n", static_cast(Timestamps1 - Timestamps0)); - std::printf("findMSB - nlz1: %d clocks\n", static_cast(Timestamps2 - Timestamps1)); - std::printf("findMSB - nlz2: %d clocks\n", static_cast(Timestamps3 - Timestamps2)); - std::printf("findMSB - 0.9.5: %d clocks\n", static_cast(Timestamps4 - Timestamps3)); - -# if GLM_HAS_BITSCAN_WINDOWS - std::printf("findMSB - intrinsics: %d clocks\n", static_cast(Timestamps5 - Timestamps4)); -# endif//GLM_HAS_BITSCAN_WINDOWS - std::printf("findMSB - pop: %d clocks\n", static_cast(Timestamps6 - Timestamps5)); - -# if GLM_ARCH & GLM_ARCH_AVX && GLM_COMPILER & GLM_COMPILER_VC - std::printf("findMSB - avx tzcnt: %d clocks\n", static_cast(Timestamps7 - Timestamps6)); -# endif//GLM_ARCH & GLM_ARCH_AVX && GLM_PLATFORM & GLM_PLATFORM_WINDOWS - - return Error; - } - - static int test_ivec4() - { - type const Data[] = - { - {glm::ivec4(0x00000000), glm::ivec4(-1)}, - {glm::ivec4(0x00000001), glm::ivec4( 0)}, - {glm::ivec4(0x00000002), glm::ivec4( 1)}, - {glm::ivec4(0x00000003), glm::ivec4( 1)}, - {glm::ivec4(0x00000004), glm::ivec4( 2)}, - {glm::ivec4(0x00000005), glm::ivec4( 2)}, - {glm::ivec4(0x00000007), glm::ivec4( 2)}, - {glm::ivec4(0x00000008), glm::ivec4( 3)}, - {glm::ivec4(0x00000010), glm::ivec4( 4)}, - {glm::ivec4(0x00000020), glm::ivec4( 5)}, - {glm::ivec4(0x00000040), glm::ivec4( 6)}, - {glm::ivec4(0x00000080), glm::ivec4( 7)}, - {glm::ivec4(0x00000100), glm::ivec4( 8)}, - {glm::ivec4(0x00000200), glm::ivec4( 9)}, - {glm::ivec4(0x00000400), glm::ivec4(10)}, - {glm::ivec4(0x00000800), glm::ivec4(11)}, - {glm::ivec4(0x00001000), glm::ivec4(12)}, - {glm::ivec4(0x00002000), glm::ivec4(13)}, - {glm::ivec4(0x00004000), glm::ivec4(14)}, - {glm::ivec4(0x00008000), glm::ivec4(15)}, - {glm::ivec4(0x00010000), glm::ivec4(16)}, - {glm::ivec4(0x00020000), glm::ivec4(17)}, - {glm::ivec4(0x00040000), glm::ivec4(18)}, - {glm::ivec4(0x00080000), glm::ivec4(19)}, - {glm::ivec4(0x00100000), glm::ivec4(20)}, - {glm::ivec4(0x00200000), glm::ivec4(21)}, - {glm::ivec4(0x00400000), glm::ivec4(22)}, - {glm::ivec4(0x00800000), glm::ivec4(23)}, - {glm::ivec4(0x01000000), glm::ivec4(24)}, - {glm::ivec4(0x02000000), glm::ivec4(25)}, - {glm::ivec4(0x04000000), glm::ivec4(26)}, - {glm::ivec4(0x08000000), glm::ivec4(27)}, - {glm::ivec4(0x10000000), glm::ivec4(28)}, - {glm::ivec4(0x20000000), glm::ivec4(29)}, - {glm::ivec4(0x40000000), glm::ivec4(30)} - }; - - int Error(0); - - for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) - { - glm::ivec4 Result0 = glm::findMSB(Data[i].Value); - Error += glm::all(glm::equal(Data[i].Return, Result0)) ? 0 : 1; - } - - return Error; - } - - static int test_int() - { - typedef type entry; - - entry const Data[] = - { - {0x00000000, -1}, - {0x00000001, 0}, - {0x00000002, 1}, - {0x00000003, 1}, - {0x00000004, 2}, - {0x00000005, 2}, - {0x00000007, 2}, - {0x00000008, 3}, - {0x00000010, 4}, - {0x00000020, 5}, - {0x00000040, 6}, - {0x00000080, 7}, - {0x00000100, 8}, - {0x00000200, 9}, - {0x00000400, 10}, - {0x00000800, 11}, - {0x00001000, 12}, - {0x00002000, 13}, - {0x00004000, 14}, - {0x00008000, 15}, - {0x00010000, 16}, - {0x00020000, 17}, - {0x00040000, 18}, - {0x00080000, 19}, - {0x00100000, 20}, - {0x00200000, 21}, - {0x00400000, 22}, - {0x00800000, 23}, - {0x01000000, 24}, - {0x02000000, 25}, - {0x04000000, 26}, - {0x08000000, 27}, - {0x10000000, 28}, - {0x20000000, 29}, - {0x40000000, 30} - }; - - int Error(0); - - for(std::size_t i = 0; i < sizeof(Data) / sizeof(entry); ++i) - { - int Result0 = glm::findMSB(Data[i].Value); - Error += Data[i].Return == Result0 ? 0 : 1; - } - - for(std::size_t i = 0; i < sizeof(Data) / sizeof(entry); ++i) - { - int Result0 = findMSB_nlz1(Data[i].Value); - Error += Data[i].Return == Result0 ? 0 : 1; - } -/* - for(std::size_t i = 0; i < sizeof(Data) / sizeof(entry); ++i) - { - int Result0 = findMSB_nlz2(Data[i].Value); - Error += Data[i].Return == Result0 ? 0 : 1; - } -*/ - for(std::size_t i = 0; i < sizeof(Data) / sizeof(entry); ++i) - { - int Result0 = findMSB_095(Data[i].Value); - Error += Data[i].Return == Result0 ? 0 : 1; - } - -# if GLM_HAS_BITSCAN_WINDOWS - for(std::size_t i = 0; i < sizeof(Data) / sizeof(entry); ++i) - { - int Result0 = findMSB_intrinsic(Data[i].Value); - Error += Data[i].Return == Result0 ? 0 : 1; - } -# endif//GLM_HAS_BITSCAN_WINDOWS - - for(std::size_t i = 0; i < sizeof(Data) / sizeof(entry); ++i) - { - int Result0 = findMSB_pop(Data[i].Value); - Error += Data[i].Return == Result0 ? 0 : 1; - } - - return Error; - } - - static int test() - { - int Error(0); - - Error += test_ivec4(); - Error += test_int(); - - return Error; - } - - static int perf(std::size_t Samples) - { - int Error(0); - - Error += perf_int(Samples); - - return Error; - } -}//findMSB - -namespace findLSB -{ - template - struct type - { - genType Value; - retType Return; - }; - - typedef type entry; - - entry const DataI32[] = - { - {0x00000001, 0}, - {0x00000003, 0}, - {0x00000002, 1}, - // {0x80000000, 31}, // Clang generates an error with this - {0x00010000, 16}, - {0x7FFF0000, 16}, - {0x7F000000, 24}, - {0x7F00FF00, 8}, - {0x00000000, -1} - }; - -# if GLM_HAS_BITSCAN_WINDOWS - template - static int findLSB_intrinsic(genIUType Value) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findLSB' only accept integer values"); - - if(Value == 0) - return -1; - - unsigned long Result(0); - _BitScanForward(&Result, Value); - return int(Result); - } -# endif - - template - static int findLSB_095(genIUType Value) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findLSB' only accept integer values"); - if(Value == 0) - return -1; - - genIUType Bit; - for(Bit = genIUType(0); !(Value & (1 << Bit)); ++Bit){} - return Bit; - } - - template - static int findLSB_ntz2(genIUType x) - { - if(x == 0) - return -1; - - return glm::bitCount(~x & (x - static_cast(1))); - } - - template - static int findLSB_branchfree(genIUType x) - { - bool IsNull(x == 0); - int const Keep(!IsNull); - int const Discard(IsNull); - - return static_cast(glm::bitCount(~x & (x - static_cast(1)))) * Keep + Discard * -1; - } - - static int test_int() - { - int Error(0); - - for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i) - { - int Result = glm::findLSB(DataI32[i].Value); - Error += DataI32[i].Return == Result ? 0 : 1; - } - - for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i) - { - int Result = findLSB_095(DataI32[i].Value); - Error += DataI32[i].Return == Result ? 0 : 1; - } - -# if GLM_HAS_BITSCAN_WINDOWS - for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i) - { - int Result = findLSB_intrinsic(DataI32[i].Value); - Error += DataI32[i].Return == Result ? 0 : 1; - } -# endif - - for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i) - { - int Result = findLSB_ntz2(DataI32[i].Value); - Error += DataI32[i].Return == Result ? 0 : 1; - } - - for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i) - { - int Result = findLSB_branchfree(DataI32[i].Value); - Error += DataI32[i].Return == Result ? 0 : 1; - } - - return Error; - } - - static int test() - { - int Error(0); - - Error += test_int(); - - return Error; - } - - static int perf_int(std::size_t Count) - { - int Error(0); - - std::clock_t Timestamps0 = std::clock(); - - for(std::size_t k = 0; k < Count; ++k) - for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i) - { - int Result = glm::findLSB(DataI32[i].Value); - Error += DataI32[i].Return == Result ? 0 : 1; - } - - std::clock_t Timestamps1 = std::clock(); - - for(std::size_t k = 0; k < Count; ++k) - for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i) - { - int Result = findLSB_095(DataI32[i].Value); - Error += DataI32[i].Return == Result ? 0 : 1; - } - - std::clock_t Timestamps2 = std::clock(); - -# if GLM_HAS_BITSCAN_WINDOWS - for(std::size_t k = 0; k < Count; ++k) - for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i) - { - int Result = findLSB_intrinsic(DataI32[i].Value); - Error += DataI32[i].Return == Result ? 0 : 1; - } -# endif - - std::clock_t Timestamps3 = std::clock(); - - for(std::size_t k = 0; k < Count; ++k) - for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i) - { - int Result = findLSB_ntz2(DataI32[i].Value); - Error += DataI32[i].Return == Result ? 0 : 1; - } - - std::clock_t Timestamps4 = std::clock(); - - for(std::size_t k = 0; k < Count; ++k) - for(std::size_t i = 0; i < sizeof(DataI32) / sizeof(entry); ++i) - { - int Result = findLSB_branchfree(DataI32[i].Value); - Error += DataI32[i].Return == Result ? 0 : 1; - } - - std::clock_t Timestamps5 = std::clock(); - - std::printf("glm::findLSB: %d clocks\n", static_cast(Timestamps1 - Timestamps0)); - std::printf("findLSB - 0.9.5: %d clocks\n", static_cast(Timestamps2 - Timestamps1)); - -# if GLM_HAS_BITSCAN_WINDOWS - std::printf("findLSB - intrinsics: %d clocks\n", static_cast(Timestamps3 - Timestamps2)); -# endif - - std::printf("findLSB - ntz2: %d clocks\n", static_cast(Timestamps4 - Timestamps3)); - std::printf("findLSB - branchfree: %d clocks\n", static_cast(Timestamps5 - Timestamps4)); - - return Error; - } - - static int perf(std::size_t Samples) - { - int Error(0); - - Error += perf_int(Samples); - - return Error; - } -}//findLSB - -namespace uaddCarry -{ - static int test() - { - int Error(0); - - { - glm::uint x = std::numeric_limits::max(); - glm::uint y = 0; - glm::uint Carry = 0; - glm::uint Result = glm::uaddCarry(x, y, Carry); - - Error += Carry == 0 ? 0 : 1; - Error += Result == std::numeric_limits::max() ? 0 : 1; - } - - { - glm::uint x = std::numeric_limits::max(); - glm::uint y = 1; - glm::uint Carry = 0; - glm::uint Result = glm::uaddCarry(x, y, Carry); - - Error += Carry == 1 ? 0 : 1; - Error += Result == 0 ? 0 : 1; - } - - { - glm::uvec1 x(std::numeric_limits::max()); - glm::uvec1 y(0); - glm::uvec1 Carry(0); - glm::uvec1 Result(glm::uaddCarry(x, y, Carry)); - - Error += glm::all(glm::equal(Carry, glm::uvec1(0))) ? 0 : 1; - Error += glm::all(glm::equal(Result, glm::uvec1(std::numeric_limits::max()))) ? 0 : 1; - } - - { - glm::uvec1 x(std::numeric_limits::max()); - glm::uvec1 y(1); - glm::uvec1 Carry(0); - glm::uvec1 Result(glm::uaddCarry(x, y, Carry)); - - Error += glm::all(glm::equal(Carry, glm::uvec1(1))) ? 0 : 1; - Error += glm::all(glm::equal(Result, glm::uvec1(0))) ? 0 : 1; - } - - return Error; - } -}//namespace uaddCarry - -namespace usubBorrow -{ - static int test() - { - int Error(0); - - { - glm::uint x = 16; - glm::uint y = 17; - glm::uint Borrow = 0; - glm::uint Result = glm::usubBorrow(x, y, Borrow); - - Error += Borrow == 1 ? 0 : 1; - Error += Result == 1 ? 0 : 1; - } - - { - glm::uvec1 x(16); - glm::uvec1 y(17); - glm::uvec1 Borrow(0); - glm::uvec1 Result(glm::usubBorrow(x, y, Borrow)); - - Error += glm::all(glm::equal(Borrow, glm::uvec1(1))) ? 0 : 1; - Error += glm::all(glm::equal(Result, glm::uvec1(1))) ? 0 : 1; - } - - { - glm::uvec2 x(16); - glm::uvec2 y(17); - glm::uvec2 Borrow(0); - glm::uvec2 Result(glm::usubBorrow(x, y, Borrow)); - - Error += glm::all(glm::equal(Borrow, glm::uvec2(1))) ? 0 : 1; - Error += glm::all(glm::equal(Result, glm::uvec2(1))) ? 0 : 1; - } - - { - glm::uvec3 x(16); - glm::uvec3 y(17); - glm::uvec3 Borrow(0); - glm::uvec3 Result(glm::usubBorrow(x, y, Borrow)); - - Error += glm::all(glm::equal(Borrow, glm::uvec3(1))) ? 0 : 1; - Error += glm::all(glm::equal(Result, glm::uvec3(1))) ? 0 : 1; - } - - { - glm::uvec4 x(16); - glm::uvec4 y(17); - glm::uvec4 Borrow(0); - glm::uvec4 Result(glm::usubBorrow(x, y, Borrow)); - - Error += glm::all(glm::equal(Borrow, glm::uvec4(1))) ? 0 : 1; - Error += glm::all(glm::equal(Result, glm::uvec4(1))) ? 0 : 1; - } - - return Error; - } -}//namespace usubBorrow - -namespace umulExtended -{ - static int test() - { - int Error(0); - - { - glm::uint x = 2; - glm::uint y = 3; - glm::uint msb = 0; - glm::uint lsb = 0; - glm::umulExtended(x, y, msb, lsb); - - Error += msb == 0 ? 0 : 1; - Error += lsb == 6 ? 0 : 1; - } - - { - glm::uvec1 x(2); - glm::uvec1 y(3); - glm::uvec1 msb(0); - glm::uvec1 lsb(0); - glm::umulExtended(x, y, msb, lsb); - - Error += glm::all(glm::equal(msb, glm::uvec1(0))) ? 0 : 1; - Error += glm::all(glm::equal(lsb, glm::uvec1(6))) ? 0 : 1; - } - - { - glm::uvec2 x(2); - glm::uvec2 y(3); - glm::uvec2 msb(0); - glm::uvec2 lsb(0); - glm::umulExtended(x, y, msb, lsb); - - Error += glm::all(glm::equal(msb, glm::uvec2(0))) ? 0 : 1; - Error += glm::all(glm::equal(lsb, glm::uvec2(6))) ? 0 : 1; - } - - { - glm::uvec3 x(2); - glm::uvec3 y(3); - glm::uvec3 msb(0); - glm::uvec3 lsb(0); - glm::umulExtended(x, y, msb, lsb); - - Error += glm::all(glm::equal(msb, glm::uvec3(0))) ? 0 : 1; - Error += glm::all(glm::equal(lsb, glm::uvec3(6))) ? 0 : 1; - } - - { - glm::uvec4 x(2); - glm::uvec4 y(3); - glm::uvec4 msb(0); - glm::uvec4 lsb(0); - glm::umulExtended(x, y, msb, lsb); - - Error += glm::all(glm::equal(msb, glm::uvec4(0))) ? 0 : 1; - Error += glm::all(glm::equal(lsb, glm::uvec4(6))) ? 0 : 1; - } - - return Error; - } -}//namespace umulExtended - -namespace imulExtended -{ - static int test() - { - int Error(0); - - { - int x = 2; - int y = 3; - int msb = 0; - int lsb = 0; - glm::imulExtended(x, y, msb, lsb); - - Error += msb == 0 ? 0 : 1; - Error += lsb == 6 ? 0 : 1; - } - - { - glm::ivec1 x(2); - glm::ivec1 y(3); - glm::ivec1 msb(0); - glm::ivec1 lsb(0); - glm::imulExtended(x, y, msb, lsb); - - Error += glm::all(glm::equal(msb, glm::ivec1(0))) ? 0 : 1; - Error += glm::all(glm::equal(lsb, glm::ivec1(6))) ? 0 : 1; - } - - { - glm::ivec2 x(2); - glm::ivec2 y(3); - glm::ivec2 msb(0); - glm::ivec2 lsb(0); - glm::imulExtended(x, y, msb, lsb); - - Error += glm::all(glm::equal(msb, glm::ivec2(0))) ? 0 : 1; - Error += glm::all(glm::equal(lsb, glm::ivec2(6))) ? 0 : 1; - } - - { - glm::ivec3 x(2); - glm::ivec3 y(3); - glm::ivec3 msb(0); - glm::ivec3 lsb(0); - glm::imulExtended(x, y, msb, lsb); - - Error += glm::all(glm::equal(msb, glm::ivec3(0))) ? 0 : 1; - Error += glm::all(glm::equal(lsb, glm::ivec3(6))) ? 0 : 1; - } - - { - glm::ivec4 x(2); - glm::ivec4 y(3); - glm::ivec4 msb(0); - glm::ivec4 lsb(0); - glm::imulExtended(x, y, msb, lsb); - - Error += glm::all(glm::equal(msb, glm::ivec4(0))) ? 0 : 1; - Error += glm::all(glm::equal(lsb, glm::ivec4(6))) ? 0 : 1; - } - - return Error; - } -}//namespace imulExtended - -namespace bitCount -{ - template - struct type - { - genType Value; - genType Return; - }; - - type const DataI32[] = - { - {0x00000001, 1}, - {0x00000003, 2}, - {0x00000002, 1}, - {0x7fffffff, 31}, - {0x00000000, 0} - }; - - template - inline int bitCount_if(T v) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitCount' only accept integer values"); - - int Count(0); - for(T i = 0, n = static_cast(sizeof(T) * 8); i < n; ++i) - { - if(v & static_cast(1 << i)) - ++Count; - } - return Count; - } - - template - inline int bitCount_vec(T v) - { - GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitCount' only accept integer values"); - - int Count(0); - for(T i = 0, n = static_cast(sizeof(T) * 8); i < n; ++i) - { - Count += static_cast((v >> i) & static_cast(1)); - } - return Count; - } - - template - struct compute_bitfieldBitCountStep - { - template - GLM_FUNC_QUALIFIER static glm::vec call(glm::vec const& v, T, T) - { - return v; - } - }; - - template<> - struct compute_bitfieldBitCountStep - { - template - GLM_FUNC_QUALIFIER static glm::vec call(glm::vec const& v, T Mask, T Shift) - { - return (v & Mask) + ((v >> Shift) & Mask); - } - }; - - template - static glm::vec bitCount_bitfield(glm::vec const& v) - { - glm::vec::type, Q> x(*reinterpret_cast::type, Q> const *>(&v)); - x = compute_bitfieldBitCountStep= 2>::call(x, static_cast::type>(0x5555555555555555ull), static_cast::type>( 1)); - x = compute_bitfieldBitCountStep= 4>::call(x, static_cast::type>(0x3333333333333333ull), static_cast::type>( 2)); - x = compute_bitfieldBitCountStep= 8>::call(x, static_cast::type>(0x0F0F0F0F0F0F0F0Full), static_cast::type>( 4)); - x = compute_bitfieldBitCountStep= 16>::call(x, static_cast::type>(0x00FF00FF00FF00FFull), static_cast::type>( 8)); - x = compute_bitfieldBitCountStep= 32>::call(x, static_cast::type>(0x0000FFFF0000FFFFull), static_cast::type>(16)); - x = compute_bitfieldBitCountStep= 64>::call(x, static_cast::type>(0x00000000FFFFFFFFull), static_cast::type>(32)); - return glm::vec(x); - } - - template - static int bitCount_bitfield(genType x) - { - return bitCount_bitfield(glm::vec<1, genType, glm::defaultp>(x)).x; - } - - static int perf(std::size_t Size) - { - int Error(0); - - std::vector v; - v.resize(Size); - - std::vector w; - w.resize(Size); - - - std::clock_t TimestampsA = std::clock(); - - // bitCount - TimeIf - { - for(std::size_t i = 0, n = v.size(); i < n; ++i) - v[i] = bitCount_if(static_cast(i)); - } - - std::clock_t TimestampsB = std::clock(); - - // bitCount - TimeVec - { - for(std::size_t i = 0, n = v.size(); i < n; ++i) - v[i] = bitCount_vec(i); - } - - std::clock_t TimestampsC = std::clock(); - - // bitCount - TimeDefault - { - for(std::size_t i = 0, n = v.size(); i < n; ++i) - v[i] = glm::bitCount(i); - } - - std::clock_t TimestampsD = std::clock(); - - // bitCount - TimeVec4 - { - for(std::size_t i = 0, n = v.size(); i < n; ++i) - w[i] = glm::bitCount(glm::ivec4(static_cast(i))); - } - - std::clock_t TimestampsE = std::clock(); - - { - for(std::size_t i = 0, n = v.size(); i < n; ++i) - v[i] = bitCount_bitfield(static_cast(i)); - } - - std::clock_t TimestampsF = std::clock(); - - std::printf("bitCount - TimeIf %d\n", static_cast(TimestampsB - TimestampsA)); - std::printf("bitCount - TimeVec %d\n", static_cast(TimestampsC - TimestampsB)); - std::printf("bitCount - TimeDefault %d\n", static_cast(TimestampsD - TimestampsC)); - std::printf("bitCount - TimeVec4 %d\n", static_cast(TimestampsE - TimestampsD)); - std::printf("bitCount - bitfield %d\n", static_cast(TimestampsF - TimestampsE)); - - return Error; - } - - static int test() - { - int Error(0); - - for(std::size_t i = 0, n = sizeof(DataI32) / sizeof(type); i < n; ++i) - { - int ResultA = glm::bitCount(DataI32[i].Value); - int ResultB = bitCount_if(DataI32[i].Value); - int ResultC = bitCount_vec(DataI32[i].Value); - int ResultE = bitCount_bitfield(DataI32[i].Value); - - Error += DataI32[i].Return == ResultA ? 0 : 1; - Error += DataI32[i].Return == ResultB ? 0 : 1; - Error += DataI32[i].Return == ResultC ? 0 : 1; - Error += DataI32[i].Return == ResultE ? 0 : 1; - - assert(!Error); - } - - return Error; - } -}//bitCount - -int main() -{ - int Error = 0; - - Error += ::bitCount::test(); - Error += ::bitfieldReverse::test(); - Error += ::findMSB::test(); - Error += ::findLSB::test(); - Error += ::umulExtended::test(); - Error += ::imulExtended::test(); - Error += ::uaddCarry::test(); - Error += ::usubBorrow::test(); - Error += ::bitfieldInsert::test(); - Error += ::bitfieldExtract::test(); - -# ifdef NDEBUG - std::size_t const Samples = 1000; -# else - std::size_t const Samples = 1; -# endif - - ::bitCount::perf(Samples); - ::bitfieldReverse::perf(Samples); - ::findMSB::perf(Samples); - ::findLSB::perf(Samples); - - return Error; -} diff --git a/3rdparty/glm/source/test/core/core_func_integer_bit_count.cpp b/3rdparty/glm/source/test/core/core_func_integer_bit_count.cpp deleted file mode 100644 index 0fa11fb..0000000 --- a/3rdparty/glm/source/test/core/core_func_integer_bit_count.cpp +++ /dev/null @@ -1,291 +0,0 @@ -// This has the programs for computing the number of 1-bits -// in a word, or byte, etc. -// Max line length is 57, to fit in hacker.book. -#include -#include //To define "exit", req'd by XLC. -#include - -unsigned rotatel(unsigned x, int n) -{ - if (static_cast(n) > 63) { std::printf("rotatel, n out of range.\n"); std::exit(1);} - return (x << n) | (x >> (32 - n)); -} - -int pop0(unsigned x) -{ - x = (x & 0x55555555) + ((x >> 1) & 0x55555555); - x = (x & 0x33333333) + ((x >> 2) & 0x33333333); - x = (x & 0x0F0F0F0F) + ((x >> 4) & 0x0F0F0F0F); - x = (x & 0x00FF00FF) + ((x >> 8) & 0x00FF00FF); - x = (x & 0x0000FFFF) + ((x >>16) & 0x0000FFFF); - return x; -} - -int pop1(unsigned x) -{ - x = x - ((x >> 1) & 0x55555555); - x = (x & 0x33333333) + ((x >> 2) & 0x33333333); - x = (x + (x >> 4)) & 0x0F0F0F0F; - x = x + (x >> 8); - x = x + (x >> 16); - return x & 0x0000003F; -} -/* Note: an alternative to the last three executable lines above is: - return x*0x01010101 >> 24; -if your machine has a fast multiplier (suggested by Jari Kirma). */ - -int pop2(unsigned x) -{ - unsigned n; - - n = (x >> 1) & 033333333333; // Count bits in - x = x - n; // each 3-bit - n = (n >> 1) & 033333333333; // field. - x = x - n; - x = (x + (x >> 3)) & 030707070707; // 6-bit sums. - return x%63; // Add 6-bit sums. -} - -/* An alternative to the "return" statement above is: - return ((x * 0404040404) >> 26) + // Add 6-bit sums. - (x >> 30); -which runs faster on most machines (suggested by Norbert Juffa). */ - -int pop3(unsigned x) -{ - unsigned n; - - n = (x >> 1) & 0x77777777; // Count bits in - x = x - n; // each 4-bit - n = (n >> 1) & 0x77777777; // field. - x = x - n; - n = (n >> 1) & 0x77777777; - x = x - n; - x = (x + (x >> 4)) & 0x0F0F0F0F; // Get byte sums. - x = x*0x01010101; // Add the bytes. - return x >> 24; -} - -int pop4(unsigned x) -{ - int n; - - n = 0; - while (x != 0) { - n = n + 1; - x = x & (x - 1); - } - return n; -} - -int pop5(unsigned x) -{ - int i, sum; - - // Rotate and sum method // Shift right & subtract - - sum = x; // sum = x; - for (i = 1; i <= 31; i++) { // while (x != 0) { - x = rotatel(x, 1); // x = x >> 1; - sum = sum + x; // sum = sum - x; - } // } - return -sum; // return sum; -} - -int pop5a(unsigned x) -{ - int sum; - - // Shift right & subtract - - sum = x; - while (x != 0) { - x = x >> 1; - sum = sum - x; - } - return sum; -} - -int pop6(unsigned x) -{ // Table lookup. - static char table[256] = { - 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, - 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, - 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - - 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, - - 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, - - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, - 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, - 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8}; - - return table[x & 0xFF] + - table[(x >> 8) & 0xFF] + - table[(x >> 16) & 0xFF] + - table[(x >> 24)]; -} - -// The following works only for 8-bit quantities. -int pop7(unsigned x) -{ - x = x*0x08040201; // Make 4 copies. - x = x >> 3; // So next step hits proper bits. - x = x & 0x11111111; // Every 4th bit. - x = x*0x11111111; // Sum the digits (each 0 or 1). - x = x >> 28; // Position the result. - return x; -} - -// The following works only for 7-bit quantities. -int pop8(unsigned x) -{ - x = x*0x02040810; // Make 4 copies, left-adjusted. - x = x & 0x11111111; // Every 4th bit. - x = x*0x11111111; // Sum the digits (each 0 or 1). - x = x >> 28; // Position the result. - return x; -} - -// The following works only for 15-bit quantities. -int pop9(unsigned x) -{ - unsigned long long y; - y = x * 0x0002000400080010ULL; - y = y & 0x1111111111111111ULL; - y = y * 0x1111111111111111ULL; - y = y >> 60; - return static_cast(y); -} - -int errors; -void error(int x, int y) -{ - errors = errors + 1; - std::printf("Error for x = %08x, got %08x\n", x, y); -} - -int main() -{ -# ifdef NDEBUG - - int i, n; - static unsigned test[] = {0,0, 1,1, 2,1, 3,2, 4,1, 5,2, 6,2, 7,3, - 8,1, 9,2, 10,2, 11,3, 12,2, 13,3, 14,3, 15,4, 16,1, 17,2, - 0x3F,6, 0x40,1, 0x41,2, 0x7f,7, 0x80,1, 0x81,2, 0xfe,7, 0xff,8, - 0x4000,1, 0x4001,2, 0x7000,3, 0x7fff,15, - 0x55555555,16, 0xAAAAAAAA, 16, 0xFF000000,8, 0xC0C0C0C0,8, - 0x0FFFFFF0,24, 0x80000000,1, 0xFFFFFFFF,32}; - - std::size_t const Count = 1000000; - - n = sizeof(test)/4; - - std::clock_t TimestampBeg = 0; - std::clock_t TimestampEnd = 0; - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (pop0(test[i]) != test[i+1]) error(test[i], pop0(test[i]));} - TimestampEnd = std::clock(); - - std::printf("pop0: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (pop1(test[i]) != test[i+1]) error(test[i], pop1(test[i]));} - TimestampEnd = std::clock(); - - std::printf("pop1: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (pop2(test[i]) != test[i+1]) error(test[i], pop2(test[i]));} - TimestampEnd = std::clock(); - - std::printf("pop2: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (pop3(test[i]) != test[i+1]) error(test[i], pop3(test[i]));} - TimestampEnd = std::clock(); - - std::printf("pop3: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (pop4(test[i]) != test[i+1]) error(test[i], pop4(test[i]));} - TimestampEnd = std::clock(); - - std::printf("pop4: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (pop5(test[i]) != test[i+1]) error(test[i], pop5(test[i]));} - TimestampEnd = std::clock(); - - std::printf("pop5: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (pop5a(test[i]) != test[i+1]) error(test[i], pop5a(test[i]));} - TimestampEnd = std::clock(); - - std::printf("pop5a: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (pop6(test[i]) != test[i+1]) error(test[i], pop6(test[i]));} - TimestampEnd = std::clock(); - - std::printf("pop6: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if ((test[i] & 0xffffff00) == 0) - if (pop7(test[i]) != test[i+1]) error(test[i], pop7(test[i]));} - TimestampEnd = std::clock(); - - std::printf("pop7: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if ((test[i] & 0xffffff80) == 0) - if (pop8(test[i]) != test[i+1]) error(test[i], pop8(test[i]));} - TimestampEnd = std::clock(); - - std::printf("pop8: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if ((test[i] & 0xffff8000) == 0) - if (pop9(test[i]) != test[i+1]) error(test[i], pop9(test[i]));} - TimestampEnd = std::clock(); - - std::printf("pop9: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - if (errors == 0) - std::printf("Passed all %d cases.\n", static_cast(sizeof(test)/8)); - -# endif//NDEBUG -} diff --git a/3rdparty/glm/source/test/core/core_func_integer_find_lsb.cpp b/3rdparty/glm/source/test/core/core_func_integer_find_lsb.cpp deleted file mode 100644 index 7b42d33..0000000 --- a/3rdparty/glm/source/test/core/core_func_integer_find_lsb.cpp +++ /dev/null @@ -1,416 +0,0 @@ -#include -#include -#include //To define "exit", req'd by XLC. -#include - -int nlz(unsigned x) -{ - int pop(unsigned x); - - x = x | (x >> 1); - x = x | (x >> 2); - x = x | (x >> 4); - x = x | (x >> 8); - x = x | (x >>16); - return pop(~x); -} - -int pop(unsigned x) -{ - x = x - ((x >> 1) & 0x55555555); - x = (x & 0x33333333) + ((x >> 2) & 0x33333333); - x = (x + (x >> 4)) & 0x0F0F0F0F; - x = x + (x << 8); - x = x + (x << 16); - return x >> 24; -} - -int ntz1(unsigned x) -{ - return 32 - nlz(~x & (x-1)); -} - -int ntz2(unsigned x) -{ - return pop(~x & (x - 1)); -} - -int ntz3(unsigned x) -{ - int n; - - if (x == 0) return(32); - n = 1; - if ((x & 0x0000FFFF) == 0) {n = n +16; x = x >>16;} - if ((x & 0x000000FF) == 0) {n = n + 8; x = x >> 8;} - if ((x & 0x0000000F) == 0) {n = n + 4; x = x >> 4;} - if ((x & 0x00000003) == 0) {n = n + 2; x = x >> 2;} - return n - (x & 1); -} - -int ntz4(unsigned x) -{ - unsigned y; - int n; - - if (x == 0) return 32; - n = 31; - y = x <<16; if (y != 0) {n = n -16; x = y;} - y = x << 8; if (y != 0) {n = n - 8; x = y;} - y = x << 4; if (y != 0) {n = n - 4; x = y;} - y = x << 2; if (y != 0) {n = n - 2; x = y;} - y = x << 1; if (y != 0) {n = n - 1;} - return n; -} - -int ntz4a(unsigned x) -{ - unsigned y; - int n; - - if (x == 0) return 32; - n = 31; - y = x <<16; if (y != 0) {n = n -16; x = y;} - y = x << 8; if (y != 0) {n = n - 8; x = y;} - y = x << 4; if (y != 0) {n = n - 4; x = y;} - y = x << 2; if (y != 0) {n = n - 2; x = y;} - n = n - ((x << 1) >> 31); - return n; -} - -int ntz5(char x) -{ - if (x & 15) { - if (x & 3) { - if (x & 1) return 0; - else return 1; - } - else if (x & 4) return 2; - else return 3; - } - else if (x & 0x30) { - if (x & 0x10) return 4; - else return 5; - } - else if (x & 0x40) return 6; - else if (x) return 7; - else return 8; -} - -int ntz6(unsigned x) -{ - int n; - - x = ~x & (x - 1); - n = 0; // n = 32; - while(x != 0) - { // while (x != 0) { - n = n + 1; // n = n - 1; - x = x >> 1; // x = x + x; - } // } - return n; // return n; -} - -int ntz6a(unsigned x) -{ - int n = 32; - - while (x != 0) { - n = n - 1; - x = x + x; - } - return n; -} - -/* Dean Gaudet's algorithm. To be most useful there must be a good way -to evaluate the C "conditional expression" (a?b:c construction) without -branching. The result of a?b:c is b if a is true (nonzero), and c if a -is false (0). - For example, a compare to zero op that sets a target GPR to 1 if the -operand is 0, and to 0 if the operand is nonzero, will do it. With this -instruction, the algorithm is entirely branch-free. But the most -interesting thing about it is the high degree of parallelism. All six -lines with conditional expressions can be executed in parallel (on a -machine with sufficient computational units). - Although the instruction count is 30 measured statically, it could -execute in only 10 cycles on a machine with sufficient parallelism. - The first two uses of y can instead be x, which would increase the -useful parallelism on most machines (the assignments to y, bz, and b4 -could then all run in parallel). */ - -int ntz7(unsigned x) -{ - unsigned y, bz, b4, b3, b2, b1, b0; - - y = x & -x; // Isolate rightmost 1-bit. - bz = y ? 0 : 1; // 1 if y = 0. - b4 = (y & 0x0000FFFF) ? 0 : 16; - b3 = (y & 0x00FF00FF) ? 0 : 8; - b2 = (y & 0x0F0F0F0F) ? 0 : 4; - b1 = (y & 0x33333333) ? 0 : 2; - b0 = (y & 0x55555555) ? 0 : 1; - return bz + b4 + b3 + b2 + b1 + b0; -} - -// This file has divisions by zero to test isnan -#if GLM_COMPILER & GLM_COMPILER_VC -# pragma warning(disable : 4800) -#endif - -int ntz7_christophe(unsigned x) -{ - unsigned y, bz, b4, b3, b2, b1, b0; - - y = x & -x; // Isolate rightmost 1-bit. - bz = unsigned(!bool(y)); // 1 if y = 0. - b4 = unsigned(!bool(y & 0x0000FFFF)) * 16; - b3 = unsigned(!bool(y & 0x00FF00FF)) * 8; - b2 = unsigned(!bool(y & 0x0F0F0F0F)) * 4; - b1 = unsigned(!bool(y & 0x33333333)) * 2; - b0 = unsigned(!bool(y & 0x55555555)) * 1; - return bz + b4 + b3 + b2 + b1 + b0; -} - -/* Below is David Seal's algorithm, found at -http://www.ciphersbyritter.com/NEWS4/BITCT.HTM Table -entries marked "u" are unused. 6 ops including a -multiply, plus an indexed load. */ - -#define u 99 -int ntz8(unsigned x) -{ - static char table[64] = - {32, 0, 1,12, 2, 6, u,13, 3, u, 7, u, u, u, u,14, - 10, 4, u, u, 8, u, u,25, u, u, u, u, u,21,27,15, - 31,11, 5, u, u, u, u, u, 9, u, u,24, u, u,20,26, - 30, u, u, u, u,23, u,19, 29, u,22,18,28,17,16, u}; - - x = (x & -x)*0x0450FBAF; - return table[x >> 26]; -} - -/* Seal's algorithm with multiply expanded. -9 elementary ops plus an indexed load. */ - -int ntz8a(unsigned x) -{ - static char table[64] = - {32, 0, 1,12, 2, 6, u,13, 3, u, 7, u, u, u, u,14, - 10, 4, u, u, 8, u, u,25, u, u, u, u, u,21,27,15, - 31,11, 5, u, u, u, u, u, 9, u, u,24, u, u,20,26, - 30, u, u, u, u,23, u,19, 29, u,22,18,28,17,16, u}; - - x = (x & -x); - x = (x << 4) + x; // x = x*17. - x = (x << 6) + x; // x = x*65. - x = (x << 16) - x; // x = x*65535. - return table[x >> 26]; -} - -/* Reiser's algorithm. Three ops including a "remainder," -plus an indexed load. */ - -int ntz9(unsigned x) -{ - static char table[37] = { - 32, 0, 1, 26, 2, 23, 27, - u, 3, 16, 24, 30, 28, 11, u, 13, 4, - 7, 17, u, 25, 22, 31, 15, 29, 10, 12, - 6, u, 21, 14, 9, 5, 20, 8, 19, 18}; - - x = (x & -x)%37; - return table[x]; -} - -/* Using a de Bruijn sequence. This is a table lookup with a 32-entry -table. The de Bruijn sequence used here is - 0000 0100 1101 0111 0110 0101 0001 1111, -obtained from Danny Dube's October 3, 1997, posting in -comp.compression.research. Thanks to Norbert Juffa for this reference. */ - -int ntz10(unsigned x) { - - static char table[32] = - { 0, 1, 2,24, 3,19, 6,25, 22, 4,20,10,16, 7,12,26, - 31,23,18, 5,21, 9,15,11, 30,17, 8,14,29,13,28,27}; - - if (x == 0) return 32; - x = (x & -x)*0x04D7651F; - return table[x >> 27]; -} - -/* Norbert Juffa's code, answer to exercise 1 of Chapter 5 (2nd ed). */ - -#define SLOW_MUL -int ntz11 (unsigned int n) { - - static unsigned char tab[32] = - { 0, 1, 2, 24, 3, 19, 6, 25, - 22, 4, 20, 10, 16, 7, 12, 26, - 31, 23, 18, 5, 21, 9, 15, 11, - 30, 17, 8, 14, 29, 13, 28, 27 - }; - unsigned int k; - n = n & (-n); /* isolate lsb */ - printf("n = %d\n", n); -#if defined(SLOW_MUL) - k = (n << 11) - n; - k = (k << 2) + k; - k = (k << 8) + n; - k = (k << 5) - k; -#else - k = n * 0x4d7651f; -#endif - return n ? tab[k>>27] : 32; -} - -int errors; -void error(int x, int y) { - errors = errors + 1; - std::printf("Error for x = %08x, got %d\n", x, y); -} - -int main() -{ -# ifdef NDEBUG - - int i, m, n; - static unsigned test[] = {0,32, 1,0, 2,1, 3,0, 4,2, 5,0, 6,1, 7,0, - 8,3, 9,0, 16,4, 32,5, 64,6, 128,7, 255,0, 256,8, 512,9, 1024,10, - 2048,11, 4096,12, 8192,13, 16384,14, 32768,15, 65536,16, - 0x20000,17, 0x40000,18, 0x80000,19, 0x100000,20, 0x200000,21, - 0x400000,22, 0x800000,23, 0x1000000,24, 0x2000000,25, - 0x4000000,26, 0x8000000,27, 0x10000000,28, 0x20000000,29, - 0x40000000,30, 0x80000000,31, 0xFFFFFFF0,4, 0x3000FF00,8, - 0xC0000000,30, 0x60000000,29, 0x00011000, 12}; - - std::size_t const Count = 1000; - - n = sizeof(test)/4; - - std::clock_t TimestampBeg = 0; - std::clock_t TimestampEnd = 0; - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (ntz1(test[i]) != test[i+1]) error(test[i], ntz1(test[i]));} - TimestampEnd = std::clock(); - - std::printf("ntz1: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (ntz2(test[i]) != test[i+1]) error(test[i], ntz2(test[i]));} - TimestampEnd = std::clock(); - - std::printf("ntz2: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (ntz3(test[i]) != test[i+1]) error(test[i], ntz3(test[i]));} - TimestampEnd = std::clock(); - - std::printf("ntz3: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (ntz4(test[i]) != test[i+1]) error(test[i], ntz4(test[i]));} - TimestampEnd = std::clock(); - - std::printf("ntz4: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (ntz4a(test[i]) != test[i+1]) error(test[i], ntz4a(test[i]));} - TimestampEnd = std::clock(); - - std::printf("ntz4a: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for(std::size_t k = 0; k < Count; ++k) - for(i = 0; i < n; i += 2) - { - m = test[i+1]; - if(m > 8) - m = 8; - if(ntz5(static_cast(test[i])) != m) - error(test[i], ntz5(static_cast(test[i]))); - } - TimestampEnd = std::clock(); - - std::printf("ntz5: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (ntz6(test[i]) != test[i+1]) error(test[i], ntz6(test[i]));} - TimestampEnd = std::clock(); - - std::printf("ntz6: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (ntz6a(test[i]) != test[i+1]) error(test[i], ntz6a(test[i]));} - TimestampEnd = std::clock(); - - std::printf("ntz6a: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (ntz7(test[i]) != test[i+1]) error(test[i], ntz7(test[i]));} - TimestampEnd = std::clock(); - - std::printf("ntz7: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (ntz7_christophe(test[i]) != test[i+1]) error(test[i], ntz7(test[i]));} - TimestampEnd = std::clock(); - - std::printf("ntz7_christophe: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (ntz8(test[i]) != test[i+1]) error(test[i], ntz8(test[i]));} - TimestampEnd = std::clock(); - - std::printf("ntz8: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (ntz8a(test[i]) != test[i+1]) error(test[i], ntz8a(test[i]));} - TimestampEnd = std::clock(); - - std::printf("ntz8a: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (ntz9(test[i]) != test[i+1]) error(test[i], ntz9(test[i]));} - TimestampEnd = std::clock(); - - std::printf("ntz9: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (ntz10(test[i]) != test[i+1]) error(test[i], ntz10(test[i]));} - TimestampEnd = std::clock(); - - std::printf("ntz10: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - if (errors == 0) - std::printf("Passed all %d cases.\n", static_cast(sizeof(test)/8)); - -# endif//NDEBUG -} diff --git a/3rdparty/glm/source/test/core/core_func_integer_find_msb.cpp b/3rdparty/glm/source/test/core/core_func_integer_find_msb.cpp deleted file mode 100644 index c435467..0000000 --- a/3rdparty/glm/source/test/core/core_func_integer_find_msb.cpp +++ /dev/null @@ -1,440 +0,0 @@ -#include -#include -#include // To define "exit", req'd by XLC. -#include - -#define LE 1 // 1 for little-endian, 0 for big-endian. - -int pop(unsigned x) { - x = x - ((x >> 1) & 0x55555555); - x = (x & 0x33333333) + ((x >> 2) & 0x33333333); - x = (x + (x >> 4)) & 0x0F0F0F0F; - x = x + (x << 8); - x = x + (x << 16); - return x >> 24; -} - -int nlz1(unsigned x) { - int n; - - if (x == 0) return(32); - n = 0; - if (x <= 0x0000FFFF) {n = n +16; x = x <<16;} - if (x <= 0x00FFFFFF) {n = n + 8; x = x << 8;} - if (x <= 0x0FFFFFFF) {n = n + 4; x = x << 4;} - if (x <= 0x3FFFFFFF) {n = n + 2; x = x << 2;} - if (x <= 0x7FFFFFFF) {n = n + 1;} - return n; -} - -int nlz1a(unsigned x) { - int n; - -/* if (x == 0) return(32); */ - if (static_cast(x) <= 0) return (~x >> 26) & 32; - n = 1; - if ((x >> 16) == 0) {n = n +16; x = x <<16;} - if ((x >> 24) == 0) {n = n + 8; x = x << 8;} - if ((x >> 28) == 0) {n = n + 4; x = x << 4;} - if ((x >> 30) == 0) {n = n + 2; x = x << 2;} - n = n - (x >> 31); - return n; -} -// On basic Risc, 12 to 20 instructions. - -int nlz2(unsigned x) { - unsigned y; - int n; - - n = 32; - y = x >>16; if (y != 0) {n = n -16; x = y;} - y = x >> 8; if (y != 0) {n = n - 8; x = y;} - y = x >> 4; if (y != 0) {n = n - 4; x = y;} - y = x >> 2; if (y != 0) {n = n - 2; x = y;} - y = x >> 1; if (y != 0) return n - 2; - return n - x; -} - -// As above but coded as a loop for compactness: -// 23 to 33 basic Risc instructions. -int nlz2a(unsigned x) { - unsigned y; - int n, c; - - n = 32; - c = 16; - do { - y = x >> c; if (y != 0) {n = n - c; x = y;} - c = c >> 1; - } while (c != 0); - return n - x; -} - -int nlz3(int x) { - int y, n; - - n = 0; - y = x; -L: if (x < 0) return n; - if (y == 0) return 32 - n; - n = n + 1; - x = x << 1; - y = y >> 1; - goto L; -} - -int nlz4(unsigned x) { - int y, m, n; - - y = -(x >> 16); // If left half of x is 0, - m = (y >> 16) & 16; // set n = 16. If left half - n = 16 - m; // is nonzero, set n = 0 and - x = x >> m; // shift x right 16. - // Now x is of the form 0000xxxx. - y = x - 0x100; // If positions 8-15 are 0, - m = (y >> 16) & 8; // add 8 to n and shift x left 8. - n = n + m; - x = x << m; - - y = x - 0x1000; // If positions 12-15 are 0, - m = (y >> 16) & 4; // add 4 to n and shift x left 4. - n = n + m; - x = x << m; - - y = x - 0x4000; // If positions 14-15 are 0, - m = (y >> 16) & 2; // add 2 to n and shift x left 2. - n = n + m; - x = x << m; - - y = x >> 14; // Set y = 0, 1, 2, or 3. - m = y & ~(y >> 1); // Set m = 0, 1, 2, or 2 resp. - return n + 2 - m; -} - -int nlz5(unsigned x) { - int pop(unsigned x); - - x = x | (x >> 1); - x = x | (x >> 2); - x = x | (x >> 4); - x = x | (x >> 8); - x = x | (x >>16); - return pop(~x); -} - -/* The four programs below are not valid ANSI C programs. This is -because they refer to the same storage locations as two different types. -However, they work with xlc/AIX, gcc/AIX, and gcc/NT. If you try to -code them more compactly by declaring a variable xx to be "double," and -then using - - n = 1054 - (*((unsigned *)&xx + LE) >> 20); - -then you are violating not only the rule above, but also the ANSI C -rule that pointer arithmetic can be performed only on pointers to -array elements. - When coded with the above statement, the program fails with xlc, -gcc/AIX, and gcc/NT, at some optimization levels. - BTW, these programs use the "anonymous union" feature of C++, not -available in C. */ - -int nlz6(unsigned k) -{ - union { - unsigned asInt[2]; - double asDouble; - }; - int n; - - asDouble = static_cast(k) + 0.5; - n = 1054 - (asInt[LE] >> 20); - return n; -} - -int nlz7(unsigned k) -{ - union { - unsigned asInt[2]; - double asDouble; - }; - int n; - - asDouble = static_cast(k); - n = 1054 - (asInt[LE] >> 20); - n = (n & 31) + (n >> 9); - return n; -} - - /* In single qualifier, round-to-nearest mode, the basic method fails for: - k = 0, k = 01FFFFFF, 03FFFFFE <= k <= 03FFFFFF, - 07FFFFFC <= k <= 07FFFFFF, - 0FFFFFF8 <= k <= 0FFFFFFF, - ... - 7FFFFFC0 <= k <= 7FFFFFFF. - FFFFFF80 <= k <= FFFFFFFF. - For k = 0 it gives 158, and for the other values it is too low by 1. */ - -int nlz8(unsigned k) -{ - union { - unsigned asInt; - float asFloat; - }; - int n; - - k = k & ~(k >> 1); /* Fix problem with rounding. */ - asFloat = static_cast(k) + 0.5f; - n = 158 - (asInt >> 23); - return n; -} - -/* The example below shows how to make a macro for nlz. It uses an -extension to the C and C++ languages that is provided by the GNU C/C++ -compiler, namely, that of allowing statements and declarations in -expressions (see "Using and Porting GNU CC", by Richard M. Stallman -(1998). The underscores are necessary to protect against the -possibility that the macro argument will conflict with one of its local -variables, e.g., NLZ(k). */ - -int nlz9(unsigned k) -{ - union { - unsigned asInt; - float asFloat; - }; - int n; - - k = k & ~(k >> 1); /* Fix problem with rounding. */ - asFloat = static_cast(k); - n = 158 - (asInt >> 23); - n = (n & 31) + (n >> 6); /* Fix problem with k = 0. */ - return n; -} - -/* Below are three nearly equivalent programs for computing the number -of leading zeros in a word. This material is not in HD, but may be in a -future edition. - Immediately below is Robert Harley's algorithm, found at the -comp.arch newsgroup entry dated 7/12/96, pointed out to me by Norbert -Juffa. - Table entries marked "u" are unused. 14 ops including a multiply, -plus an indexed load. - The smallest multiplier that works is 0x045BCED1 = 17*65*129*513 (all -of form 2**k + 1). There are no multipliers of three terms of the form -2**k +- 1 that work, with a table size of 64 or 128. There are some, -with a table size of 64, if you precede the multiplication with x = x - -(x >> 1), but that seems less elegant. There are also some if you use a -table size of 256, the smallest is 0x01033CBF = 65*255*1025 (this would -save two instructions in the form of this algorithm with the -multiplication expanded into shifts and adds, but the table size is -getting a bit large). */ - -#define u 99 -int nlz10(unsigned x) -{ - static char table[64] = - {32,31, u,16, u,30, 3, u, 15, u, u, u,29,10, 2, u, - u, u,12,14,21, u,19, u, u,28, u,25, u, 9, 1, u, - 17, u, 4, u, u, u,11, u, 13,22,20, u,26, u, u,18, - 5, u, u,23, u,27, u, 6, u,24, 7, u, 8, u, 0, u}; - - x = x | (x >> 1); // Propagate leftmost - x = x | (x >> 2); // 1-bit to the right. - x = x | (x >> 4); - x = x | (x >> 8); - x = x | (x >>16); - x = x*0x06EB14F9; // Multiplier is 7*255**3. - return table[x >> 26]; -} - -/* Harley's algorithm with multiply expanded. -19 elementary ops plus an indexed load. */ - -int nlz10a(unsigned x) -{ - static char table[64] = - {32,31, u,16, u,30, 3, u, 15, u, u, u,29,10, 2, u, - u, u,12,14,21, u,19, u, u,28, u,25, u, 9, 1, u, - 17, u, 4, u, u, u,11, u, 13,22,20, u,26, u, u,18, - 5, u, u,23, u,27, u, 6, u,24, 7, u, 8, u, 0, u}; - - x = x | (x >> 1); // Propagate leftmost - x = x | (x >> 2); // 1-bit to the right. - x = x | (x >> 4); - x = x | (x >> 8); - x = x | (x >> 16); - x = (x << 3) - x; // Multiply by 7. - x = (x << 8) - x; // Multiply by 255. - x = (x << 8) - x; // Again. - x = (x << 8) - x; // Again. - return table[x >> 26]; -} - -/* Julius Goryavsky's version of Harley's algorithm. -17 elementary ops plus an indexed load, if the machine -has "and not." */ - -int nlz10b(unsigned x) -{ - static char table[64] = - {32,20,19, u, u,18, u, 7, 10,17, u, u,14, u, 6, u, - u, 9, u,16, u, u, 1,26, u,13, u, u,24, 5, u, u, - u,21, u, 8,11, u,15, u, u, u, u, 2,27, 0,25, u, - 22, u,12, u, u, 3,28, u, 23, u, 4,29, u, u,30,31}; - - x = x | (x >> 1); // Propagate leftmost - x = x | (x >> 2); // 1-bit to the right. - x = x | (x >> 4); - x = x | (x >> 8); - x = x & ~(x >> 16); - x = x*0xFD7049FF; // Activate this line or the following 3. - // x = (x << 9) - x; // Multiply by 511. - // x = (x << 11) - x; // Multiply by 2047. - // x = (x << 14) - x; // Multiply by 16383. - return table[x >> 26]; -} - -int errors; -void error(int x, int y) -{ - errors = errors + 1; - std::printf("Error for x = %08x, got %d\n", x, y); -} - -int main() -{ -# ifdef NDEBUG - - int i, n; - static unsigned test[] = {0,32, 1,31, 2,30, 3,30, 4,29, 5,29, 6,29, - 7,29, 8,28, 9,28, 16,27, 32,26, 64,25, 128,24, 255,24, 256,23, - 512,22, 1024,21, 2048,20, 4096,19, 8192,18, 16384,17, 32768,16, - 65536,15, 0x20000,14, 0x40000,13, 0x80000,12, 0x100000,11, - 0x200000,10, 0x400000,9, 0x800000,8, 0x1000000,7, 0x2000000,6, - 0x4000000,5, 0x8000000,4, 0x0FFFFFFF,4, 0x10000000,3, - 0x3000FFFF,2, 0x50003333,1, 0x7FFFFFFF,1, 0x80000000,0, - 0xFFFFFFFF,0}; - std::size_t const Count = 1000; - - n = sizeof(test)/4; - - std::clock_t TimestampBeg = 0; - std::clock_t TimestampEnd = 0; - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (nlz1(test[i]) != test[i+1]) error(test[i], nlz1(test[i]));} - TimestampEnd = std::clock(); - - std::printf("nlz1: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (nlz1a(test[i]) != test[i+1]) error(test[i], nlz1a(test[i]));} - TimestampEnd = std::clock(); - - std::printf("nlz1a: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (nlz2(test[i]) != test[i+1]) error(test[i], nlz2(test[i]));} - TimestampEnd = std::clock(); - - std::printf("nlz2: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (nlz2a(test[i]) != test[i+1]) error(test[i], nlz2a(test[i]));} - TimestampEnd = std::clock(); - - std::printf("nlz2a: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (nlz3(test[i]) != test[i+1]) error(test[i], nlz3(test[i]));} - TimestampEnd = std::clock(); - - std::printf("nlz3: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (nlz4(test[i]) != test[i+1]) error(test[i], nlz4(test[i]));} - TimestampEnd = std::clock(); - - std::printf("nlz4: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (nlz5(test[i]) != test[i+1]) error(test[i], nlz5(test[i]));} - TimestampEnd = std::clock(); - - std::printf("nlz5: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (nlz6(test[i]) != test[i+1]) error(test[i], nlz6(test[i]));} - TimestampEnd = std::clock(); - - std::printf("nlz6: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (nlz7(test[i]) != test[i+1]) error(test[i], nlz7(test[i]));} - TimestampEnd = std::clock(); - - std::printf("nlz7: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (nlz8(test[i]) != test[i+1]) error(test[i], nlz8(test[i]));} - TimestampEnd = std::clock(); - - std::printf("nlz8: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (nlz9(test[i]) != test[i+1]) error(test[i], nlz9(test[i]));} - TimestampEnd = std::clock(); - - std::printf("nlz9: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (nlz10(test[i]) != test[i+1]) error(test[i], nlz10(test[i]));} - TimestampEnd = std::clock(); - - std::printf("nlz10: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (nlz10a(test[i]) != test[i+1]) error(test[i], nlz10a(test[i]));} - TimestampEnd = std::clock(); - - std::printf("nlz10a: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - TimestampBeg = std::clock(); - for (std::size_t k = 0; k < Count; ++k) - for (i = 0; i < n; i += 2) { - if (nlz10b(test[i]) != test[i+1]) error(test[i], nlz10b(test[i]));} - TimestampEnd = std::clock(); - - std::printf("nlz10b: %d clocks\n", static_cast(TimestampEnd - TimestampBeg)); - - if (errors == 0) - std::printf("Passed all %d cases.\n", static_cast(sizeof(test)/8)); - -# endif//NDEBUG -} diff --git a/3rdparty/glm/source/test/core/core_func_matrix.cpp b/3rdparty/glm/source/test/core/core_func_matrix.cpp deleted file mode 100644 index c5b2007..0000000 --- a/3rdparty/glm/source/test/core/core_func_matrix.cpp +++ /dev/null @@ -1,312 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace glm; - -int test_matrixCompMult() -{ - int Error(0); - - { - mat2 m(0, 1, 2, 3); - mat2 n = matrixCompMult(m, m); - mat2 expected = mat2(0, 1, 4, 9); - Error += all(equal(n, expected, epsilon())) ? 0 : 1; - } - - { - mat2x3 m(0, 1, 2, 3, 4, 5); - mat2x3 n = matrixCompMult(m, m); - mat2x3 expected = mat2x3(0, 1, 4, 9, 16, 25); - Error += all(equal(n, expected, epsilon())) ? 0 : 1; - } - - { - mat2x4 m(0, 1, 2, 3, 4, 5, 6, 7); - mat2x4 n = matrixCompMult(m, m); - mat2x4 expected = mat2x4(0, 1, 4, 9, 16, 25, 36, 49); - Error += all(equal(n, expected, epsilon())) ? 0 : 1; - } - - { - mat3 m(0, 1, 2, 3, 4, 5, 6, 7, 8); - mat3 n = matrixCompMult(m, m); - mat3 expected = mat3(0, 1, 4, 9, 16, 25, 36, 49, 64); - Error += all(equal(n, expected, epsilon())) ? 0 : 1; - } - - { - mat3x2 m(0, 1, 2, 3, 4, 5); - mat3x2 n = matrixCompMult(m, m); - mat3x2 expected = mat3x2(0, 1, 4, 9, 16, 25); - Error += all(equal(n, expected, epsilon())) ? 0 : 1; - } - - { - mat3x4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11); - mat3x4 n = matrixCompMult(m, m); - mat3x4 expected = mat3x4(0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121); - Error += all(equal(n, expected, epsilon())) ? 0 : 1; - } - - { - mat4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); - mat4 n = matrixCompMult(m, m); - mat4 expected = mat4(0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225); - Error += all(equal(n, expected, epsilon())) ? 0 : 1; - } - - { - mat4x2 m(0, 1, 2, 3, 4, 5, 6, 7); - mat4x2 n = matrixCompMult(m, m); - mat4x2 expected = mat4x2(0, 1, 4, 9, 16, 25, 36, 49); - Error += all(equal(n, expected, epsilon())) ? 0 : 1; - } - - { - mat4x3 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11); - mat4x3 n = matrixCompMult(m, m); - mat4x3 expected = mat4x3(0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121); - Error += all(equal(n, expected, epsilon())) ? 0 : 1; - } - - return Error; -} - -int test_outerProduct() -{ - { glm::mat2 m = glm::outerProduct(glm::vec2(1.0f), glm::vec2(1.0f)); } - { glm::mat3 m = glm::outerProduct(glm::vec3(1.0f), glm::vec3(1.0f)); } - { glm::mat4 m = glm::outerProduct(glm::vec4(1.0f), glm::vec4(1.0f)); } - - { glm::mat2x3 m = glm::outerProduct(glm::vec3(1.0f), glm::vec2(1.0f)); } - { glm::mat2x4 m = glm::outerProduct(glm::vec4(1.0f), glm::vec2(1.0f)); } - - { glm::mat3x2 m = glm::outerProduct(glm::vec2(1.0f), glm::vec3(1.0f)); } - { glm::mat3x4 m = glm::outerProduct(glm::vec4(1.0f), glm::vec3(1.0f)); } - - { glm::mat4x2 m = glm::outerProduct(glm::vec2(1.0f), glm::vec4(1.0f)); } - { glm::mat4x3 m = glm::outerProduct(glm::vec3(1.0f), glm::vec4(1.0f)); } - - return 0; -} - -int test_transpose() -{ - int Error(0); - - { - mat2 const m(0, 1, 2, 3); - mat2 const t = transpose(m); - mat2 const expected = mat2(0, 2, 1, 3); - Error += all(equal(t, expected, epsilon())) ? 0 : 1; - } - - { - mat2x3 m(0, 1, 2, 3, 4, 5); - mat3x2 t = transpose(m); - mat3x2 const expected = mat3x2(0, 3, 1, 4, 2, 5); - Error += all(equal(t, expected, epsilon())) ? 0 : 1; - } - - { - mat2x4 m(0, 1, 2, 3, 4, 5, 6, 7); - mat4x2 t = transpose(m); - mat4x2 const expected = mat4x2(0, 4, 1, 5, 2, 6, 3, 7); - Error += all(equal(t, expected, epsilon())) ? 0 : 1; - } - - { - mat3 m(0, 1, 2, 3, 4, 5, 6, 7, 8); - mat3 t = transpose(m); - mat3 const expected = mat3(0, 3, 6, 1, 4, 7, 2, 5, 8); - Error += all(equal(t, expected, epsilon())) ? 0 : 1; - } - - { - mat3x2 m(0, 1, 2, 3, 4, 5); - mat2x3 t = transpose(m); - mat2x3 const expected = mat2x3(0, 2, 4, 1, 3, 5); - Error += all(equal(t, expected, epsilon())) ? 0 : 1; - } - - { - mat3x4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11); - mat4x3 t = transpose(m); - mat4x3 const expected = mat4x3(0, 4, 8, 1, 5, 9, 2, 6, 10, 3, 7, 11); - Error += all(equal(t, expected, epsilon())) ? 0 : 1; - } - - { - mat4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); - mat4 t = transpose(m); - mat4 const expected = mat4(0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15); - Error += all(equal(t, expected, epsilon())) ? 0 : 1; - } - - { - mat4x2 m(0, 1, 2, 3, 4, 5, 6, 7); - mat2x4 t = transpose(m); - mat2x4 const expected = mat2x4(0, 2, 4, 6, 1, 3, 5, 7); - Error += all(equal(t, expected, epsilon())) ? 0 : 1; - } - - { - mat4x3 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11); - mat3x4 t = transpose(m); - mat3x4 const expected = mat3x4(0, 3, 6, 9, 1, 4, 7, 10, 2, 5, 8, 11); - Error += all(equal(t, expected, epsilon())) ? 0 : 1; - } - - return Error; -} - -int test_determinant() -{ - - - return 0; -} - -int test_inverse() -{ - int Error = 0; - - { - glm::mat4x4 A4x4( - glm::vec4(1, 0, 1, 0), - glm::vec4(0, 1, 0, 0), - glm::vec4(0, 0, 1, 0), - glm::vec4(0, 0, 0, 1)); - glm::mat4x4 B4x4 = inverse(A4x4); - glm::mat4x4 I4x4 = A4x4 * B4x4; - glm::mat4x4 Identity(1); - Error += all(equal(I4x4, Identity, epsilon())) ? 0 : 1; - } - - { - glm::mat3x3 A3x3( - glm::vec3(1, 0, 1), - glm::vec3(0, 1, 0), - glm::vec3(0, 0, 1)); - glm::mat3x3 B3x3 = glm::inverse(A3x3); - glm::mat3x3 I3x3 = A3x3 * B3x3; - glm::mat3x3 Identity(1); - Error += all(equal(I3x3, Identity, epsilon())) ? 0 : 1; - } - - { - glm::mat2x2 A2x2( - glm::vec2(1, 1), - glm::vec2(0, 1)); - glm::mat2x2 B2x2 = glm::inverse(A2x2); - glm::mat2x2 I2x2 = A2x2 * B2x2; - glm::mat2x2 Identity(1); - Error += all(equal(I2x2, Identity, epsilon())) ? 0 : 1; - } - - return Error; -} - -int test_inverse_simd() -{ - int Error = 0; - - glm::mat4x4 const Identity(1); - - glm::mat4x4 const A4x4( - glm::vec4(1, 0, 1, 0), - glm::vec4(0, 1, 0, 0), - glm::vec4(0, 0, 1, 0), - glm::vec4(0, 0, 0, 1)); - glm::mat4x4 const B4x4 = glm::inverse(A4x4); - glm::mat4x4 const I4x4 = A4x4 * B4x4; - - Error += glm::all(glm::equal(I4x4, Identity, 0.001f)) ? 0 : 1; - - return Error; -} - -template -int test_inverse_perf(std::size_t Count, std::size_t Instance, char const * Message) -{ - std::vector TestInputs; - TestInputs.resize(Count); - std::vector TestOutputs; - TestOutputs.resize(TestInputs.size()); - - VEC3 Axis(glm::normalize(VEC3(1.0f, 2.0f, 3.0f))); - - for(std::size_t i = 0; i < TestInputs.size(); ++i) - { - typename MAT4::value_type f = static_cast(i + Instance) * typename MAT4::value_type(0.1) + typename MAT4::value_type(0.1); - TestInputs[i] = glm::rotate(glm::translate(MAT4(1), Axis * f), f, Axis); - //TestInputs[i] = glm::translate(MAT4(1), Axis * f); - } - - std::clock_t StartTime = std::clock(); - - for(std::size_t i = 0; i < TestInputs.size(); ++i) - TestOutputs[i] = glm::inverse(TestInputs[i]); - - std::clock_t EndTime = std::clock(); - - for(std::size_t i = 0; i < TestInputs.size(); ++i) - TestOutputs[i] = TestOutputs[i] * TestInputs[i]; - - typename MAT4::value_type Diff(0); - for(std::size_t Entry = 0; Entry < TestOutputs.size(); ++Entry) - { - MAT4 i(1.0); - MAT4 m(TestOutputs[Entry]); - for(glm::length_t y = 0; y < m.length(); ++y) - for(glm::length_t x = 0; x < m[y].length(); ++x) - Diff = glm::max(m[y][x], i[y][x]); - } - - //glm::uint Ulp = 0; - //Ulp = glm::max(glm::float_distance(*Dst, *Src), Ulp); - - std::printf("inverse<%s>(%f): %lu\n", Message, static_cast(Diff), EndTime - StartTime); - - return 0; -} - -int main() -{ - int Error = 0; - Error += test_matrixCompMult(); - Error += test_outerProduct(); - Error += test_transpose(); - Error += test_determinant(); - Error += test_inverse(); - Error += test_inverse_simd(); - -# ifdef NDEBUG - std::size_t const Samples = 1000; -# else - std::size_t const Samples = 1; -# endif//NDEBUG - - for(std::size_t i = 0; i < 1; ++i) - { - Error += test_inverse_perf(Samples, i, "mat4"); - Error += test_inverse_perf(Samples, i, "dmat4"); - } - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_func_noise.cpp b/3rdparty/glm/source/test/core/core_func_noise.cpp deleted file mode 100644 index 4f0b430..0000000 --- a/3rdparty/glm/source/test/core/core_func_noise.cpp +++ /dev/null @@ -1,7 +0,0 @@ -int main() -{ - int Error = 0; - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_func_packing.cpp b/3rdparty/glm/source/test/core/core_func_packing.cpp deleted file mode 100644 index c3cd14a..0000000 --- a/3rdparty/glm/source/test/core/core_func_packing.cpp +++ /dev/null @@ -1,156 +0,0 @@ -#include -#include -#include -#include -#include - -int test_packUnorm2x16() -{ - int Error = 0; - - std::vector A; - A.push_back(glm::vec2(1.0f, 0.0f)); - A.push_back(glm::vec2(0.5f, 0.7f)); - A.push_back(glm::vec2(0.1f, 0.2f)); - - for(std::size_t i = 0; i < A.size(); ++i) - { - glm::vec2 B(A[i]); - glm::uint32 C = glm::packUnorm2x16(B); - glm::vec2 D = glm::unpackUnorm2x16(C); - Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 65535.f)) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int test_packSnorm2x16() -{ - int Error = 0; - - std::vector A; - A.push_back(glm::vec2( 1.0f, 0.0f)); - A.push_back(glm::vec2(-0.5f,-0.7f)); - A.push_back(glm::vec2(-0.1f, 0.1f)); - - for(std::size_t i = 0; i < A.size(); ++i) - { - glm::vec2 B(A[i]); - glm::uint32 C = glm::packSnorm2x16(B); - glm::vec2 D = glm::unpackSnorm2x16(C); - Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 32767.0f * 2.0f)) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int test_packUnorm4x8() -{ - int Error = 0; - - glm::uint32 Packed = glm::packUnorm4x8(glm::vec4(1.0f, 0.5f, 0.0f, 1.0f)); - glm::u8vec4 Vec(255, 128, 0, 255); - glm::uint32 & Ref = *reinterpret_cast(&Vec[0]); - - Error += Packed == Ref ? 0 : 1; - - std::vector A; - A.push_back(glm::vec4(1.0f, 0.7f, 0.3f, 0.0f)); - A.push_back(glm::vec4(0.5f, 0.1f, 0.2f, 0.3f)); - - for(std::size_t i = 0; i < A.size(); ++i) - { - glm::vec4 B(A[i]); - glm::uint32 C = glm::packUnorm4x8(B); - glm::vec4 D = glm::unpackUnorm4x8(C); - Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 255.f)) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int test_packSnorm4x8() -{ - int Error = 0; - - std::vector A; - A.push_back(glm::vec4( 1.0f, 0.0f,-0.5f,-1.0f)); - A.push_back(glm::vec4(-0.7f,-0.1f, 0.1f, 0.7f)); - - for(std::size_t i = 0; i < A.size(); ++i) - { - glm::vec4 B(A[i]); - glm::uint32 C = glm::packSnorm4x8(B); - glm::vec4 D = glm::unpackSnorm4x8(C); - Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 127.f)) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int test_packHalf2x16() -{ - int Error = 0; -/* - std::vector A; - A.push_back(glm::hvec2(glm::half( 1.0f), glm::half( 2.0f))); - A.push_back(glm::hvec2(glm::half(-1.0f), glm::half(-2.0f))); - A.push_back(glm::hvec2(glm::half(-1.1f), glm::half( 1.1f))); -*/ - std::vector A; - A.push_back(glm::vec2( 1.0f, 2.0f)); - A.push_back(glm::vec2(-1.0f,-2.0f)); - A.push_back(glm::vec2(-1.1f, 1.1f)); - - for(std::size_t i = 0; i < A.size(); ++i) - { - glm::vec2 B(A[i]); - glm::uint C = glm::packHalf2x16(B); - glm::vec2 D = glm::unpackHalf2x16(C); - //Error += B == D ? 0 : 1; - Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 127.f)) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int test_packDouble2x32() -{ - int Error = 0; - - std::vector A; - A.push_back(glm::uvec2( 1, 2)); - A.push_back(glm::uvec2(-1,-2)); - A.push_back(glm::uvec2(-1000, 1100)); - - for(std::size_t i = 0; i < A.size(); ++i) - { - glm::uvec2 B(A[i]); - double C = glm::packDouble2x32(B); - glm::uvec2 D = glm::unpackDouble2x32(C); - Error += B == D ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_packSnorm4x8(); - Error += test_packUnorm4x8(); - Error += test_packSnorm2x16(); - Error += test_packUnorm2x16(); - Error += test_packHalf2x16(); - Error += test_packDouble2x32(); - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_func_swizzle.cpp b/3rdparty/glm/source/test/core/core_func_swizzle.cpp deleted file mode 100644 index 9758533..0000000 --- a/3rdparty/glm/source/test/core/core_func_swizzle.cpp +++ /dev/null @@ -1,164 +0,0 @@ -#define GLM_FORCE_SWIZZLE -#include -#include -#include - -static int test_ivec2_swizzle() -{ - int Error = 0; - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION - { - glm::ivec2 A(1, 2); - glm::ivec2 B = A.yx(); - glm::ivec2 C = B.yx(); - - Error += A != B ? 0 : 1; - Error += A == C ? 0 : 1; - } -# endif//GLM_CONFIG_SWIZZLE - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - { - glm::ivec2 A(1, 2); - glm::ivec2 B = A.yx; - glm::ivec2 C = A.yx; - - Error += A != B ? 0 : 1; - Error += B == C ? 0 : 1; - - B.xy = B.yx; - C.xy = C.yx; - - Error += B == C ? 0 : 1; - - glm::ivec2 D(0, 0); - D.yx = A.xy; - Error += A.yx() == D ? 0 : 1; - - glm::ivec2 E = A.yx; - Error += E == D ? 0 : 1; - } -# endif//GLM_CONFIG_SWIZZLE - - return Error; -} - -int test_ivec3_swizzle() -{ - int Error = 0; - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION - { - glm::ivec3 A(1, 2, 3); - glm::ivec3 B = A.zyx(); - glm::ivec3 C = B.zyx(); - - Error += A != B ? 0 : 1; - Error += A == C ? 0 : 1; - } -# endif - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - { - glm::ivec3 const A(1, 2, 3); - glm::ivec2 B = A.yx; - glm::ivec2 C = A.yx; - - Error += A.yx() == B ? 0 : 1; - Error += B == C ? 0 : 1; - - B.xy = B.yx; - C.xy = C.yx; - - Error += B == C ? 0 : 1; - - glm::ivec2 D(0, 0); - D.yx = A.xy; - - Error += A.yx() == D ? 0 : 1; - - glm::ivec2 E(0, 0); - E.xy = A.xy(); - - Error += E == A.xy() ? 0 : 1; - Error += E.xy() == A.xy() ? 0 : 1; - - glm::ivec3 const F = A.xxx + A.xxx; - Error += F == glm::ivec3(2) ? 0 : 1; - - glm::ivec3 const G = A.xxx - A.xxx; - Error += G == glm::ivec3(0) ? 0 : 1; - - glm::ivec3 const H = A.xxx * A.xxx; - Error += H == glm::ivec3(1) ? 0 : 1; - - glm::ivec3 const I = A.xxx / A.xxx; - Error += I == glm::ivec3(1) ? 0 : 1; - - glm::ivec3 J(1, 2, 3); - J.xyz += glm::ivec3(1); - Error += J == glm::ivec3(2, 3, 4) ? 0 : 1; - - glm::ivec3 K(1, 2, 3); - K.xyz += A.xyz; - Error += K == glm::ivec3(2, 4, 6) ? 0 : 1; - } -# endif - - return Error; -} - -int test_ivec4_swizzle() -{ - int Error = 0; - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION - { - glm::ivec4 A(1, 2, 3, 4); - glm::ivec4 B = A.wzyx(); - glm::ivec4 C = B.wzyx(); - - Error += A != B ? 0 : 1; - Error += A == C ? 0 : 1; - } -# endif - - return Error; -} - -int test_vec4_swizzle() -{ - int Error = 0; - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION - { - glm::vec4 A(1, 2, 3, 4); - glm::vec4 B = A.wzyx(); - glm::vec4 C = B.wzyx(); - - Error += glm::any(glm::notEqual(A, B, 0.0001f)) ? 0 : 1; - Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1; - - float D = glm::dot(C.wzyx(), C.xyzw()); - Error += glm::equal(D, 20.f, 0.001f) ? 0 : 1; - } -# endif - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_ivec2_swizzle(); - Error += test_ivec3_swizzle(); - Error += test_ivec4_swizzle(); - Error += test_vec4_swizzle(); - - return Error; -} - - - diff --git a/3rdparty/glm/source/test/core/core_func_trigonometric.cpp b/3rdparty/glm/source/test/core/core_func_trigonometric.cpp deleted file mode 100644 index 3172340..0000000 --- a/3rdparty/glm/source/test/core/core_func_trigonometric.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include - -int main() -{ - int Error = 0; - - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_func_vector_relational.cpp b/3rdparty/glm/source/test/core/core_func_vector_relational.cpp deleted file mode 100644 index 0a4e7e7..0000000 --- a/3rdparty/glm/source/test/core/core_func_vector_relational.cpp +++ /dev/null @@ -1,180 +0,0 @@ -#include -#include -#include -#include -#include - -static int test_not() -{ - int Error = 0; - - { - glm::bvec1 v(false); - Error += glm::all(glm::not_(v)) ? 0 : 1; - } - - { - glm::bvec2 v(false); - Error += glm::all(glm::not_(v)) ? 0 : 1; - } - - { - glm::bvec3 v(false); - Error += glm::all(glm::not_(v)) ? 0 : 1; - } - - { - glm::bvec4 v(false); - Error += glm::all(glm::not_(v)) ? 0 : 1; - } - - return Error; -} - -static int test_less() -{ - int Error = 0; - - { - glm::vec2 const A(1, 2); - glm::vec2 const B(2, 3); - Error += glm::all(glm::lessThan(A, B)) ? 0: 1; - Error += glm::all(glm::lessThanEqual(A, B)) ? 0: 1; - } - - { - glm::vec3 const A(1, 2, 3); - glm::vec3 const B(2, 3, 4); - Error += glm::all(glm::lessThan(A, B)) ? 0: 1; - Error += glm::all(glm::lessThanEqual(A, B)) ? 0: 1; - } - - { - glm::vec4 const A(1, 2, 3, 4); - glm::vec4 const B(2, 3, 4, 5); - Error += glm::all(glm::lessThan(A, B)) ? 0: 1; - Error += glm::all(glm::lessThanEqual(A, B)) ? 0: 1; - } - - { - glm::ivec2 const A(1, 2); - glm::ivec2 const B(2, 3); - Error += glm::all(glm::lessThan(A, B)) ? 0: 1; - - glm::ivec2 const C(1, 3); - Error += glm::all(glm::lessThanEqual(A, C)) ? 0: 1; - } - - { - glm::ivec3 const A(1, 2, 3); - glm::ivec3 const B(2, 3, 4); - Error += glm::all(glm::lessThan(A, B)) ? 0: 1; - - glm::ivec3 const C(1, 3, 4); - Error += glm::all(glm::lessThanEqual(A, C)) ? 0: 1; - } - - { - glm::ivec4 const A(1, 2, 3, 4); - glm::ivec4 const B(2, 3, 4, 5); - Error += glm::all(glm::lessThan(A, B)) ? 0: 1; - - glm::ivec4 const C(1, 3, 4, 5); - Error += glm::all(glm::lessThanEqual(A, C)) ? 0: 1; - } - - return Error; -} - -static int test_greater() -{ - int Error = 0; - - { - glm::vec2 const A(1, 2); - glm::vec2 const B(2, 3); - Error += glm::all(glm::greaterThan(B, A)) ? 0: 1; - Error += glm::all(glm::greaterThanEqual(B, A)) ? 0: 1; - } - - { - glm::vec3 const A(1, 2, 3); - glm::vec3 const B(2, 3, 4); - Error += glm::all(glm::greaterThan(B, A)) ? 0: 1; - Error += glm::all(glm::greaterThanEqual(B, A)) ? 0: 1; - } - - { - glm::vec4 const A(1, 2, 3, 4); - glm::vec4 const B(2, 3, 4, 5); - Error += glm::all(glm::greaterThan(B, A)) ? 0: 1; - Error += glm::all(glm::greaterThanEqual(B, A)) ? 0: 1; - } - - { - glm::ivec2 const A(1, 2); - glm::ivec2 const B(2, 3); - Error += glm::all(glm::greaterThan(B, A)) ? 0: 1; - - glm::ivec2 const C(1, 3); - Error += glm::all(glm::greaterThanEqual(C, A)) ? 0: 1; - } - - { - glm::ivec3 const A(1, 2, 3); - glm::ivec3 const B(2, 3, 4); - Error += glm::all(glm::greaterThan(B, A)) ? 0: 1; - - glm::ivec3 const C(1, 3, 4); - Error += glm::all(glm::greaterThanEqual(C, A)) ? 0: 1; - } - - { - glm::ivec4 const A(1, 2, 3, 4); - glm::ivec4 const B(2, 3, 4, 5); - Error += glm::all(glm::greaterThan(B, A)) ? 0: 1; - - glm::ivec4 const C(1, 3, 4, 5); - Error += glm::all(glm::greaterThanEqual(C, A)) ? 0: 1; - } - - return Error; -} - -static int test_equal() -{ - int Error = 0; - - { - glm::ivec2 const A(1, 2); - glm::ivec2 const B(1, 2); - Error += glm::all(glm::equal(B, A)) ? 0: 1; - } - - { - glm::ivec3 const A(1, 2, 3); - glm::ivec3 const B(1, 2, 3); - Error += glm::all(glm::equal(B, A)) ? 0: 1; - } - - { - glm::ivec4 const A(1, 2, 3, 4); - glm::ivec4 const B(1, 2, 3, 4); - Error += glm::all(glm::equal(B, A)) ? 0: 1; - } - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_not(); - Error += test_less(); - Error += test_greater(); - Error += test_equal(); - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_setup_force_cxx98.cpp b/3rdparty/glm/source/test/core/core_setup_force_cxx98.cpp deleted file mode 100644 index 32bb63c..0000000 --- a/3rdparty/glm/source/test/core/core_setup_force_cxx98.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef GLM_FORCE_CXX98 -# define GLM_FORCE_CXX98 -#endif -#include -#include - -int main() -{ - int Error = 0; - - return Error; -} diff --git a/3rdparty/glm/source/test/core/core_setup_force_size_t_length.cpp b/3rdparty/glm/source/test/core/core_setup_force_size_t_length.cpp deleted file mode 100644 index 36010e3..0000000 --- a/3rdparty/glm/source/test/core/core_setup_force_size_t_length.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#define GLM_FORCE_SIZE_T_LENGTH -#include -#include - -template -genType add(genType const& a, genType const& b) -{ - genType result(0); - for(glm::length_t i = 0; i < a.length(); ++i) - result[i] = a[i] + b[i]; - return result; -} - -int main() -{ - int Error = 0; - - glm::ivec4 v(1); - Error += add(v, v) == glm::ivec4(2) ? 0 : 1; - - return Error; -} diff --git a/3rdparty/glm/source/test/core/core_setup_message.cpp b/3rdparty/glm/source/test/core/core_setup_message.cpp deleted file mode 100644 index 7594743..0000000 --- a/3rdparty/glm/source/test/core/core_setup_message.cpp +++ /dev/null @@ -1,230 +0,0 @@ -#define GLM_FORCE_MESSAGES -#include -#include - -int test_compiler() -{ - int Error(0); - - if(GLM_COMPILER & GLM_COMPILER_VC) - { - switch(GLM_COMPILER) - { - case GLM_COMPILER_VC12: - std::printf("Visual C++ 12 - 2013\n"); - break; - case GLM_COMPILER_VC14: - std::printf("Visual C++ 14 - 2015\n"); - break; - case GLM_COMPILER_VC15: - std::printf("Visual C++ 15 - 2017\n"); - break; - case GLM_COMPILER_VC15_3: - std::printf("Visual C++ 15.3 - 2017\n"); - break; - case GLM_COMPILER_VC15_5: - std::printf("Visual C++ 15.5 - 2017\n"); - break; - case GLM_COMPILER_VC15_6: - std::printf("Visual C++ 15.6 - 2017\n"); - break; - case GLM_COMPILER_VC15_7: - std::printf("Visual C++ 15.7 - 2017\n"); - break; - case GLM_COMPILER_VC15_8: - std::printf("Visual C++ 15.8 - 2017\n"); - break; - case GLM_COMPILER_VC15_9: - std::printf("Visual C++ 15.9 - 2017\n"); - break; - case GLM_COMPILER_VC16: - std::printf("Visual C++ 16 - 2019\n"); - break; - default: - std::printf("Visual C++ version not detected\n"); - Error += 1; - break; - } - } - else if(GLM_COMPILER & GLM_COMPILER_GCC) - { - switch(GLM_COMPILER) - { - case GLM_COMPILER_GCC46: - std::printf("GCC 4.6\n"); - break; - case GLM_COMPILER_GCC47: - std::printf("GCC 4.7\n"); - break; - case GLM_COMPILER_GCC48: - std::printf("GCC 4.8\n"); - break; - case GLM_COMPILER_GCC49: - std::printf("GCC 4.9\n"); - break; - case GLM_COMPILER_GCC5: - std::printf("GCC 5\n"); - break; - case GLM_COMPILER_GCC6: - std::printf("GCC 6\n"); - break; - case GLM_COMPILER_GCC7: - std::printf("GCC 7\n"); - break; - case GLM_COMPILER_GCC8: - std::printf("GCC 8\n"); - break; - default: - std::printf("GCC version not detected\n"); - Error += 1; - break; - } - } - else if(GLM_COMPILER & GLM_COMPILER_CUDA) - { - std::printf("CUDA\n"); - } - else if(GLM_COMPILER & GLM_COMPILER_CLANG) - { - switch(GLM_COMPILER) - { - case GLM_COMPILER_CLANG34: - std::printf("Clang 3.4\n"); - break; - case GLM_COMPILER_CLANG35: - std::printf("Clang 3.5\n"); - break; - case GLM_COMPILER_CLANG36: - std::printf("Clang 3.6\n"); - break; - case GLM_COMPILER_CLANG37: - std::printf("Clang 3.7\n"); - break; - case GLM_COMPILER_CLANG38: - std::printf("Clang 3.8\n"); - break; - case GLM_COMPILER_CLANG39: - std::printf("Clang 3.9\n"); - break; - case GLM_COMPILER_CLANG40: - std::printf("Clang 4.0\n"); - break; - case GLM_COMPILER_CLANG41: - std::printf("Clang 4.1\n"); - break; - case GLM_COMPILER_CLANG42: - std::printf("Clang 4.2\n"); - break; - default: - std::printf("LLVM version not detected\n"); - break; - } - } - else if(GLM_COMPILER & GLM_COMPILER_INTEL) - { - switch(GLM_COMPILER) - { - case GLM_COMPILER_INTEL14: - std::printf("ICC 14 - 2013 SP1\n"); - break; - case GLM_COMPILER_INTEL15: - std::printf("ICC 15 - 2015\n"); - break; - case GLM_COMPILER_INTEL16: - std::printf("ICC 16 - 2017\n"); - break; - case GLM_COMPILER_INTEL17: - std::printf("ICC 17 - 20XX\n"); - break; - default: - std::printf("Intel compiler version not detected\n"); - Error += 1; - break; - } - } - else - { - std::printf("Undetected compiler\n"); - Error += 1; - } - - return Error; -} - -int test_model() -{ - int Error = 0; - - Error += ((sizeof(void*) == 4) && (GLM_MODEL == GLM_MODEL_32)) || ((sizeof(void*) == 8) && (GLM_MODEL == GLM_MODEL_64)) ? 0 : 1; - - if(GLM_MODEL == GLM_MODEL_32) - std::printf("GLM_MODEL_32\n"); - else if(GLM_MODEL == GLM_MODEL_64) - std::printf("GLM_MODEL_64\n"); - - return Error; -} - -int test_instruction_set() -{ - int Error = 0; - - std::printf("GLM_ARCH: "); - - if(GLM_ARCH & GLM_ARCH_ARM_BIT) - std::printf("ARM "); - if(GLM_ARCH & GLM_ARCH_NEON_BIT) - std::printf("NEON "); - if(GLM_ARCH & GLM_ARCH_AVX2_BIT) - std::printf("AVX2 "); - if(GLM_ARCH & GLM_ARCH_AVX_BIT) - std::printf("AVX "); - if(GLM_ARCH & GLM_ARCH_SSE42_BIT) - std::printf("SSE4.2 "); - if(GLM_ARCH & GLM_ARCH_SSE41_BIT) - std::printf("SSE4.1 "); - if(GLM_ARCH & GLM_ARCH_SSSE3_BIT) - std::printf("SSSE3 "); - if(GLM_ARCH & GLM_ARCH_SSE3_BIT) - std::printf("SSE3 "); - if(GLM_ARCH & GLM_ARCH_SSE2_BIT) - std::printf("SSE2 "); - - std::printf("\n"); - - return Error; -} - -int test_cpp_version() -{ - std::printf("__cplusplus: %d\n", static_cast(__cplusplus)); - - return 0; -} - -int test_operators() -{ - glm::ivec3 A(1); - glm::ivec3 B(1); - bool R = A != B; - bool S = A == B; - - return (S && !R) ? 0 : 1; -} - -int main() -{ - int Error = 0; - -# if !defined(GLM_FORCE_PLATFORM_UNKNOWN) && !defined(GLM_FORCE_COMPILER_UNKNOWN) && !defined(GLM_FORCE_ARCH_UNKNOWN) && !defined(GLM_FORCE_CXX_UNKNOWN) - - Error += test_cpp_version(); - Error += test_compiler(); - Error += test_model(); - Error += test_instruction_set(); - Error += test_operators(); - -# endif - - return Error; -} diff --git a/3rdparty/glm/source/test/core/core_setup_platform_unknown.cpp b/3rdparty/glm/source/test/core/core_setup_platform_unknown.cpp deleted file mode 100644 index 9feaee3..0000000 --- a/3rdparty/glm/source/test/core/core_setup_platform_unknown.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef GLM_FORCE_PLATFORM_UNKNOWN -# define GLM_FORCE_PLATFORM_UNKNOWN -#endif -#ifndef GLM_FORCE_COMPILER_UNKNOWN -# define GLM_FORCE_COMPILER_UNKNOWN -#endif -#ifndef GLM_FORCE_ARCH_UNKNOWN -# define GLM_FORCE_ARCH_UNKNOWN -#endif -#ifndef GLM_FORCE_CXX_UNKNOWN -# define GLM_FORCE_CXX_UNKNOWN -#endif -#include -#include - -int main() -{ - int Error = 0; - - return Error; -} diff --git a/3rdparty/glm/source/test/core/core_setup_precision.cpp b/3rdparty/glm/source/test/core/core_setup_precision.cpp deleted file mode 100644 index b44bc50..0000000 --- a/3rdparty/glm/source/test/core/core_setup_precision.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#define GLM_FORCE_INLINE -#define GLM_PRECISION_HIGHP_FLOAT -#include -#include - -static int test_mat() -{ - int Error = 0; - - Error += sizeof(glm::mat2) == sizeof(glm::highp_mat2) ? 0 : 1; - Error += sizeof(glm::mat3) == sizeof(glm::highp_mat3) ? 0 : 1; - Error += sizeof(glm::mat4) == sizeof(glm::highp_mat4) ? 0 : 1; - - Error += sizeof(glm::mat2x2) == sizeof(glm::highp_mat2x2) ? 0 : 1; - Error += sizeof(glm::mat2x3) == sizeof(glm::highp_mat2x3) ? 0 : 1; - Error += sizeof(glm::mat2x4) == sizeof(glm::highp_mat2x4) ? 0 : 1; - Error += sizeof(glm::mat3x2) == sizeof(glm::highp_mat3x2) ? 0 : 1; - Error += sizeof(glm::mat3x3) == sizeof(glm::highp_mat3x3) ? 0 : 1; - Error += sizeof(glm::mat3x4) == sizeof(glm::highp_mat3x4) ? 0 : 1; - Error += sizeof(glm::mat4x2) == sizeof(glm::highp_mat4x2) ? 0 : 1; - Error += sizeof(glm::mat4x3) == sizeof(glm::highp_mat4x3) ? 0 : 1; - Error += sizeof(glm::mat4x4) == sizeof(glm::highp_mat4x4) ? 0 : 1; - - return Error; -} - -static int test_vec() -{ - int Error = 0; - - Error += sizeof(glm::vec2) == sizeof(glm::highp_vec2) ? 0 : 1; - Error += sizeof(glm::vec3) == sizeof(glm::highp_vec3) ? 0 : 1; - Error += sizeof(glm::vec4) == sizeof(glm::highp_vec4) ? 0 : 1; - - return Error; -} - -static int test_dvec() -{ - int Error = 0; - - Error += sizeof(glm::dvec2) == sizeof(glm::highp_dvec2) ? 0 : 1; - Error += sizeof(glm::dvec3) == sizeof(glm::highp_dvec3) ? 0 : 1; - Error += sizeof(glm::dvec4) == sizeof(glm::highp_dvec4) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_mat(); - Error += test_vec(); - Error += test_dvec(); - - return Error; -} diff --git a/3rdparty/glm/source/test/core/core_type_aligned.cpp b/3rdparty/glm/source/test/core/core_type_aligned.cpp deleted file mode 100644 index dff0939..0000000 --- a/3rdparty/glm/source/test/core/core_type_aligned.cpp +++ /dev/null @@ -1,92 +0,0 @@ -#define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES -#include - -#if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE -#include - -static_assert(sizeof(glm::bvec4) > sizeof(glm::bvec2), "Invalid sizeof"); -static_assert(sizeof(glm::ivec4) > sizeof(glm::uvec2), "Invalid sizeof"); -static_assert(sizeof(glm::dvec4) > sizeof(glm::dvec2), "Invalid sizeof"); - -static_assert(sizeof(glm::bvec4) == sizeof(glm::bvec3), "Invalid sizeof"); -static_assert(sizeof(glm::uvec4) == sizeof(glm::uvec3), "Invalid sizeof"); -static_assert(sizeof(glm::dvec4) == sizeof(glm::dvec3), "Invalid sizeof"); - -static int test_storage_aligned() -{ - int Error = 0; - - size_t size1_aligned = sizeof(glm::detail::storage<1, int, true>::type); - Error += size1_aligned == sizeof(int) * 1 ? 0 : 1; - size_t size2_aligned = sizeof(glm::detail::storage<2, int, true>::type); - Error += size2_aligned == sizeof(int) * 2 ? 0 : 1; - size_t size4_aligned = sizeof(glm::detail::storage<4, int, true>::type); - Error += size4_aligned == sizeof(int) * 4 ? 0 : 1; - - size_t align1_aligned = alignof(glm::detail::storage<1, int, true>::type); - Error += align1_aligned == 4 ? 0 : 1; - size_t align2_aligned = alignof(glm::detail::storage<2, int, true>::type); - Error += align2_aligned == 8 ? 0 : 1; - size_t align4_aligned = alignof(glm::detail::storage<4, int, true>::type); - Error += align4_aligned == 16 ? 0 : 1; - - return Error; -} - -static int test_storage_unaligned() -{ - int Error = 0; - - size_t align1_unaligned = alignof(glm::detail::storage<1, int, false>::type); - Error += align1_unaligned == sizeof(int) ? 0 : 1; - size_t align2_unaligned = alignof(glm::detail::storage<2, int, false>::type); - Error += align2_unaligned == sizeof(int) ? 0 : 1; - size_t align3_unaligned = alignof(glm::detail::storage<3, int, false>::type); - Error += align3_unaligned == sizeof(int) ? 0 : 1; - size_t align4_unaligned = alignof(glm::detail::storage<4, int, false>::type); - Error += align4_unaligned == sizeof(int) ? 0 : 1; - - return Error; -} - -static int test_vec3_aligned() -{ - int Error = 0; - - struct Struct1 - { - glm::vec4 A; - float B; - glm::vec3 C; - }; - - std::size_t const Size1 = sizeof(Struct1); - Error += Size1 == 48 ? 0 : 1; - - struct Struct2 - { - glm::vec4 A; - glm::vec3 B; - float C; - }; - - std::size_t const Size2 = sizeof(Struct2); - Error += Size2 == 48 ? 0 : 1; - - return Error; -} - -#endif - -int main() -{ - int Error = 0; - -# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE - Error += test_storage_aligned(); - Error += test_storage_unaligned(); - Error += test_vec3_aligned(); -# endif - - return Error; -} diff --git a/3rdparty/glm/source/test/core/core_type_cast.cpp b/3rdparty/glm/source/test/core/core_type_cast.cpp deleted file mode 100644 index 7ff1901..0000000 --- a/3rdparty/glm/source/test/core/core_type_cast.cpp +++ /dev/null @@ -1,146 +0,0 @@ -#include -#include -#include -#include -#include -#include - -struct my_vec2 -{ - operator glm::vec2() { return glm::vec2(x, y); } - float x, y; -}; - -int test_vec2_cast() -{ - glm::vec2 A(1.0f, 2.0f); - glm::lowp_vec2 B(A); - glm::mediump_vec2 C(A); - glm::highp_vec2 D(A); - - glm::vec2 E = static_cast(A); - glm::lowp_vec2 F = static_cast(A); - glm::mediump_vec2 G = static_cast(A); - glm::highp_vec2 H = static_cast(A); - - my_vec2 I; - glm::vec2 J = static_cast(I); - glm::vec2 K(7.8f); - - int Error(0); - - Error += glm::all(glm::equal(A, E, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(B, F, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(C, G, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(D, H, glm::epsilon())) ? 0 : 1; - - return Error; -} - -int test_vec3_cast() -{ - glm::vec3 A(1.0f, 2.0f, 3.0f); - glm::lowp_vec3 B(A); - glm::mediump_vec3 C(A); - glm::highp_vec3 D(A); - - glm::vec3 E = static_cast(A); - glm::lowp_vec3 F = static_cast(A); - glm::mediump_vec3 G = static_cast(A); - glm::highp_vec3 H = static_cast(A); - - int Error(0); - - Error += glm::all(glm::equal(A, E, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(B, F, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(C, G, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(D, H, glm::epsilon())) ? 0 : 1; - - return Error; -} - -int test_vec4_cast() -{ - glm::vec4 A(1.0f, 2.0f, 3.0f, 4.0f); - glm::lowp_vec4 B(A); - glm::mediump_vec4 C(A); - glm::highp_vec4 D(A); - - glm::vec4 E = static_cast(A); - glm::lowp_vec4 F = static_cast(A); - glm::mediump_vec4 G = static_cast(A); - glm::highp_vec4 H = static_cast(A); - - int Error(0); - - Error += glm::all(glm::equal(A, E, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(B, F, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(C, G, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(D, H, glm::epsilon())) ? 0 : 1; - - return Error; -} - -int test_std_copy() -{ - int Error = 0; - - { - std::vector High; - High.resize(64); - std::vector Medium(High.size()); - - std::copy(High.begin(), High.end(), Medium.begin()); - - *Medium.begin() = *High.begin(); - } - - { - std::vector High4; - High4.resize(64); - std::vector Medium4(High4.size()); - - std::copy(High4.begin(), High4.end(), Medium4.begin()); - - *Medium4.begin() = *High4.begin(); - } - - { - std::vector High3; - High3.resize(64); - std::vector Medium3(High3.size()); - - std::copy(High3.begin(), High3.end(), Medium3.begin()); - - *Medium3.begin() = *High3.begin(); - } - - { - std::vector High2; - High2.resize(64); - std::vector Medium2(High2.size()); - - std::copy(High2.begin(), High2.end(), Medium2.begin()); - - *Medium2.begin() = *High2.begin(); - } - - glm::dvec4 v1; - glm::vec4 v2; - - v2 = v1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_std_copy(); - Error += test_vec2_cast(); - Error += test_vec3_cast(); - Error += test_vec4_cast(); - - return Error; -} diff --git a/3rdparty/glm/source/test/core/core_type_ctor.cpp b/3rdparty/glm/source/test/core/core_type_ctor.cpp deleted file mode 100644 index 078fcdf..0000000 --- a/3rdparty/glm/source/test/core/core_type_ctor.cpp +++ /dev/null @@ -1,351 +0,0 @@ -#include -#include -#include -#include -#include - -static int test_vec1_ctor() -{ - int Error = 0; - -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE - { - union pack - { - glm::vec1 f; - glm::ivec1 i; - } A, B; - - A.f = glm::vec1(0); - Error += glm::all(glm::equal(A.i, glm::ivec1(0))) ? 0 : 1; - - B.f = glm::vec1(1); - Error += glm::all(glm::equal(B.i, glm::ivec1(1065353216))) ? 0 : 1; - } -# endif//GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE - - return Error; -} - -static int test_vec2_ctor() -{ - int Error = 0; - -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE - { - union pack - { - glm::vec2 f; - glm::ivec2 i; - } A, B; - - A.f = glm::vec2(0); - Error += glm::all(glm::equal(A.i, glm::ivec2(0))) ? 0 : 1; - - B.f = glm::vec2(1); - Error += glm::all(glm::equal(B.i, glm::ivec2(1065353216))) ? 0 : 1; - } -# endif - - return Error; -} - -static int test_vec3_ctor() -{ - int Error = 0; - -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE - { - union pack - { - glm::vec3 f; - glm::ivec3 i; - } A, B; - - A.f = glm::vec3(0); - Error += glm::all(glm::equal(A.i, glm::ivec3(0))) ? 0 : 1; - - B.f = glm::vec3(1); - Error += glm::all(glm::equal(B.i, glm::ivec3(1065353216))) ? 0 : 1; - } -# endif - - return Error; -} - -static int test_vec4_ctor() -{ - int Error = 0; - -# if GLM_CONFIG_DEFAULTED_FUNCTIONS == GLM_ENABLE - { - union pack - { - glm::vec4 f; - glm::ivec4 i; - } A, B; - - A.f = glm::vec4(0); - Error += glm::all(glm::equal(A.i, glm::ivec4(0))) ? 0 : 1; - - B.f = glm::vec4(1); - Error += glm::all(glm::equal(B.i, glm::ivec4(1065353216))) ? 0 : 1; - } -# endif - - return Error; -} - -static int test_mat2x2_ctor() -{ - int Error = 0; - -# if GLM_LANG & GLM_LANG_CXX11_FLAG - { - union pack - { - glm::mat2x2 f; - glm::mat2x2 i; - } A, B; - - A.f = glm::mat2x2(0); - Error += glm::all(glm::equal(A.i[0], glm::vec2(0), glm::epsilon())) ? 0 : 1; - - B.f = glm::mat2x2(1); - Error += glm::all(glm::equal(B.i[0], glm::vec2(1, 0), glm::epsilon())) ? 0 : 1; - } -# endif//GLM_LANG & GLM_LANG_CXX11_FLAG - - return Error; -} - -static int test_mat2x3_ctor() -{ - int Error = 0; - -# if GLM_LANG & GLM_LANG_CXX11_FLAG - { - union pack - { - glm::mat2x3 f; - glm::mat2x3 i; - } A, B; - - A.f = glm::mat2x3(0); - Error += glm::all(glm::equal(A.i[0], glm::vec3(0), glm::epsilon())) ? 0 : 1; - - B.f = glm::mat2x3(1); - Error += glm::all(glm::equal(B.i[0], glm::vec3(1, 0, 0), glm::epsilon())) ? 0 : 1; - } -# endif//GLM_LANG & GLM_LANG_CXX11_FLAG - - return Error; -} - -static int test_mat2x4_ctor() -{ - int Error = 0; - -# if GLM_LANG & GLM_LANG_CXX11_FLAG - { - union pack - { - glm::mat2x4 f; - glm::mat2x4 i; - } A, B; - - A.f = glm::mat2x4(0); - glm::vec4 const C(0, 0, 0, 0); - Error += glm::all(glm::equal(A.i[0], C, glm::epsilon())) ? 0 : 1; - - B.f = glm::mat2x4(1); - glm::vec4 const D(1, 0, 0, 0); - Error += glm::all(glm::equal(B.i[0], D, glm::epsilon())) ? 0 : 1; - } -# endif//GLM_LANG & GLM_LANG_CXX11_FLAG - - return Error; -} - -static int test_mat3x2_ctor() -{ - int Error = 0; - -# if GLM_LANG & GLM_LANG_CXX11_FLAG - { - union pack - { - glm::mat3x2 f; - glm::mat3x2 i; - } A, B; - - A.f = glm::mat3x2(0); - Error += glm::all(glm::equal(A.i[0], glm::vec2(0), glm::epsilon())) ? 0 : 1; - - B.f = glm::mat3x2(1); - Error += glm::all(glm::equal(B.i[0], glm::vec2(1, 0), glm::epsilon())) ? 0 : 1; - } -# endif//GLM_LANG & GLM_LANG_CXX11_FLAG - - return Error; -} - -static int test_mat3x3_ctor() -{ - int Error = 0; - -# if GLM_LANG & GLM_LANG_CXX11_FLAG - { - union pack - { - glm::mat3x3 f; - glm::mat3x3 i; - } A, B; - - A.f = glm::mat3x3(0); - Error += glm::all(glm::equal(A.i[0], glm::vec3(0), glm::epsilon())) ? 0 : 1; - - B.f = glm::mat3x3(1); - Error += glm::all(glm::equal(B.i[0], glm::vec3(1, 0, 0), glm::epsilon())) ? 0 : 1; - } -# endif//GLM_LANG & GLM_LANG_CXX11_FLAG - - return Error; -} - -static int test_mat3x4_ctor() -{ - int Error = 0; - -# if GLM_LANG & GLM_LANG_CXX11_FLAG - { - union pack - { - glm::mat3x4 f; - glm::mat3x4 i; - } A, B; - - A.f = glm::mat3x4(0); - Error += glm::all(glm::equal(A.i[0], glm::vec4(0), glm::epsilon())) ? 0 : 1; - - B.f = glm::mat3x4(1); - Error += glm::all(glm::equal(B.i[0], glm::vec4(1, 0, 0, 0), glm::epsilon())) ? 0 : 1; - } -# endif//GLM_LANG & GLM_LANG_CXX11_FLAG - - return Error; -} - -static int test_mat4x2_ctor() -{ - int Error = 0; - -# if GLM_LANG & GLM_LANG_CXX11_FLAG - { - union pack - { - glm::mat4x2 f; - glm::mat4x2 i; - } A, B; - - A.f = glm::mat4x2(0); - Error += glm::all(glm::equal(A.i[0], glm::vec2(0), glm::epsilon())) ? 0 : 1; - - B.f = glm::mat4x2(1); - Error += glm::all(glm::equal(B.i[0], glm::vec2(1, 0), glm::epsilon())) ? 0 : 1; - } -# endif//GLM_LANG & GLM_LANG_CXX11_FLAG - - return Error; -} - -static int test_mat4x3_ctor() -{ - int Error = 0; - -# if GLM_LANG & GLM_LANG_CXX11_FLAG - { - union pack - { - glm::mat4x3 f; - glm::mat4x3 i; - } A, B; - - A.f = glm::mat4x3(0); - Error += glm::all(glm::equal(A.i[0], glm::vec3(0), glm::epsilon())) ? 0 : 1; - - B.f = glm::mat4x3(1); - Error += glm::all(glm::equal(B.i[0], glm::vec3(1, 0, 0), glm::epsilon())) ? 0 : 1; - } -# endif//GLM_LANG & GLM_LANG_CXX11_FLAG - - return Error; -} - -static int test_mat4x4_ctor() -{ - int Error = 0; - -# if GLM_LANG & GLM_LANG_CXX11_FLAG - { - union pack - { - glm::mat4 f; - glm::mat4 i; - } A, B; - - A.f = glm::mat4(0); - Error += glm::all(glm::equal(A.i[0], glm::vec4(0), glm::epsilon())) ? 0 : 1; - - B.f = glm::mat4(1); - Error += glm::all(glm::equal(B.i[0], glm::vec4(1, 0, 0, 0), glm::epsilon())) ? 0 : 1; - } -# endif//GLM_LANG & GLM_LANG_CXX11_FLAG - - return Error; -} - -static int test_quat_ctor() -{ - int Error = 0; - -# if GLM_LANG & GLM_LANG_CXX11_FLAG - { - union pack - { - glm::quat f; - glm::quat i; - } A, B; - - A.f = glm::quat(0, 0, 0, 0); - Error += glm::all(glm::equal(A.i, glm::quat(0, 0, 0, 0), glm::epsilon())) ? 0 : 1; - - B.f = glm::quat(1, 1, 1, 1); - Error += glm::all(glm::equal(B.i, glm::quat(1, 1, 1, 1), glm::epsilon())) ? 0 : 1; - } -# endif//GLM_LANG & GLM_LANG_CXX11_FLAG - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_vec1_ctor(); - Error += test_vec2_ctor(); - Error += test_vec3_ctor(); - Error += test_vec4_ctor(); - Error += test_mat2x2_ctor(); - Error += test_mat2x3_ctor(); - Error += test_mat2x4_ctor(); - Error += test_mat3x2_ctor(); - Error += test_mat3x3_ctor(); - Error += test_mat3x4_ctor(); - Error += test_mat4x2_ctor(); - Error += test_mat4x3_ctor(); - Error += test_mat4x4_ctor(); - Error += test_quat_ctor(); - - return Error; -} diff --git a/3rdparty/glm/source/test/core/core_type_int.cpp b/3rdparty/glm/source/test/core/core_type_int.cpp deleted file mode 100644 index 2631509..0000000 --- a/3rdparty/glm/source/test/core/core_type_int.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include - -static int test_bit_operator() -{ - int Error = 0; - - glm::ivec4 const a(1); - glm::ivec4 const b = ~a; - Error += glm::all(glm::equal(b, glm::ivec4(-2))) ? 0 : 1; - - glm::int32 const c(1); - glm::int32 const d = ~c; - Error += d == -2 ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_bit_operator(); - - return Error; -} diff --git a/3rdparty/glm/source/test/core/core_type_length.cpp b/3rdparty/glm/source/test/core/core_type_length.cpp deleted file mode 100644 index f088cb3..0000000 --- a/3rdparty/glm/source/test/core/core_type_length.cpp +++ /dev/null @@ -1,78 +0,0 @@ -#include - -static int test_length_mat_non_squared() -{ - int Error = 0; - - Error += glm::mat2x3().length() == 2 ? 0 : 1; - Error += glm::mat2x4().length() == 2 ? 0 : 1; - Error += glm::mat3x2().length() == 3 ? 0 : 1; - Error += glm::mat3x4().length() == 3 ? 0 : 1; - Error += glm::mat4x2().length() == 4 ? 0 : 1; - Error += glm::mat4x3().length() == 4 ? 0 : 1; - - Error += glm::dmat2x3().length() == 2 ? 0 : 1; - Error += glm::dmat2x4().length() == 2 ? 0 : 1; - Error += glm::dmat3x2().length() == 3 ? 0 : 1; - Error += glm::dmat3x4().length() == 3 ? 0 : 1; - Error += glm::dmat4x2().length() == 4 ? 0 : 1; - Error += glm::dmat4x3().length() == 4 ? 0 : 1; - - return Error; -} - -static int test_length_mat() -{ - int Error = 0; - - Error += glm::mat2().length() == 2 ? 0 : 1; - Error += glm::mat3().length() == 3 ? 0 : 1; - Error += glm::mat4().length() == 4 ? 0 : 1; - Error += glm::mat2x2().length() == 2 ? 0 : 1; - Error += glm::mat3x3().length() == 3 ? 0 : 1; - Error += glm::mat4x4().length() == 4 ? 0 : 1; - - Error += glm::dmat2().length() == 2 ? 0 : 1; - Error += glm::dmat3().length() == 3 ? 0 : 1; - Error += glm::dmat4().length() == 4 ? 0 : 1; - Error += glm::dmat2x2().length() == 2 ? 0 : 1; - Error += glm::dmat3x3().length() == 3 ? 0 : 1; - Error += glm::dmat4x4().length() == 4 ? 0 : 1; - - return Error; -} - -static int test_length_vec() -{ - int Error = 0; - - Error += glm::vec2().length() == 2 ? 0 : 1; - Error += glm::vec3().length() == 3 ? 0 : 1; - Error += glm::vec4().length() == 4 ? 0 : 1; - - Error += glm::ivec2().length() == 2 ? 0 : 1; - Error += glm::ivec3().length() == 3 ? 0 : 1; - Error += glm::ivec4().length() == 4 ? 0 : 1; - - Error += glm::uvec2().length() == 2 ? 0 : 1; - Error += glm::uvec3().length() == 3 ? 0 : 1; - Error += glm::uvec4().length() == 4 ? 0 : 1; - - Error += glm::dvec2().length() == 2 ? 0 : 1; - Error += glm::dvec3().length() == 3 ? 0 : 1; - Error += glm::dvec4().length() == 4 ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_length_vec(); - Error += test_length_mat(); - Error += test_length_mat_non_squared(); - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_type_mat2x2.cpp b/3rdparty/glm/source/test/core/core_type_mat2x2.cpp deleted file mode 100644 index 2f8b018..0000000 --- a/3rdparty/glm/source/test/core/core_type_mat2x2.cpp +++ /dev/null @@ -1,177 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -int test_operators() -{ - glm::mat2x2 l(1.0f); - glm::mat2x2 m(1.0f); - glm::vec2 u(1.0f); - glm::vec2 v(1.0f); - float x = 1.0f; - glm::vec2 a = m * u; - glm::vec2 b = v * m; - glm::mat2x2 n = x / m; - glm::mat2x2 o = m / x; - glm::mat2x2 p = x * m; - glm::mat2x2 q = m * x; - bool R = glm::any(glm::notEqual(m, q, glm::epsilon())); - bool S = glm::all(glm::equal(m, l, glm::epsilon())); - - return (S && !R) ? 0 : 1; -} - -int test_inverse() -{ - int Error(0); - - { - glm::mat2 const Matrix(1, 2, 3, 4); - glm::mat2 const Inverse = glm::inverse(Matrix); - glm::mat2 const Identity = Matrix * Inverse; - - Error += glm::all(glm::equal(Identity[0], glm::vec2(1.0f, 0.0f), glm::vec2(0.01f))) ? 0 : 1; - Error += glm::all(glm::equal(Identity[1], glm::vec2(0.0f, 1.0f), glm::vec2(0.01f))) ? 0 : 1; - } - - { - glm::mat2 const Matrix(1, 2, 3, 4); - glm::mat2 const Identity = Matrix / Matrix; - - Error += glm::all(glm::equal(Identity[0], glm::vec2(1.0f, 0.0f), glm::vec2(0.01f))) ? 0 : 1; - Error += glm::all(glm::equal(Identity[1], glm::vec2(0.0f, 1.0f), glm::vec2(0.01f))) ? 0 : 1; - } - - return Error; -} - -int test_ctr() -{ - int Error = 0; - - { - glm::mediump_mat2x2 const A(1.0f); - glm::highp_mat2x2 const B(A); - glm::mediump_mat2x2 const C(B); - - Error += glm::all(glm::equal(A, C, glm::epsilon())) ? 0 : 1; - } - -#if GLM_HAS_INITIALIZER_LISTS - glm::mat2x2 m0( - glm::vec2(0, 1), - glm::vec2(2, 3)); - - glm::mat2x2 m1{0, 1, 2, 3}; - - glm::mat2x2 m2{ - {0, 1}, - {2, 3}}; - - Error += glm::all(glm::equal(m0, m2, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(m1, m2, glm::epsilon())) ? 0 : 1; - - std::vector v1{ - {0, 1, 2, 3}, - {0, 1, 2, 3} - }; - - std::vector v2{ - { - { 0, 1}, - { 4, 5} - }, - { - { 0, 1}, - { 4, 5} - } - }; - -#endif//GLM_HAS_INITIALIZER_LISTS - - return Error; -} - -namespace cast -{ - template - int entry() - { - int Error = 0; - - genType A(1.0f); - glm::mat2 B(A); - glm::mat2 Identity(1.0f); - - Error += glm::all(glm::equal(B, Identity, glm::epsilon())) ? 0 : 1; - - return Error; - } - - int test() - { - int Error = 0; - - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - - return Error; - } -}//namespace cast - -int test_size() -{ - int Error = 0; - - Error += 16 == sizeof(glm::mat2x2) ? 0 : 1; - Error += 32 == sizeof(glm::dmat2x2) ? 0 : 1; - Error += glm::mat2x2().length() == 2 ? 0 : 1; - Error += glm::dmat2x2().length() == 2 ? 0 : 1; - Error += glm::mat2x2::length() == 2 ? 0 : 1; - Error += glm::dmat2x2::length() == 2 ? 0 : 1; - - return Error; -} - -int test_constexpr() -{ -#if GLM_HAS_CONSTEXPR - static_assert(glm::mat2x2::length() == 2, "GLM: Failed constexpr"); -#endif - - return 0; -} - -int main() -{ - int Error = 0; - - Error += cast::test(); - Error += test_ctr(); - Error += test_operators(); - Error += test_inverse(); - Error += test_size(); - Error += test_constexpr(); - - return Error; -} diff --git a/3rdparty/glm/source/test/core/core_type_mat2x3.cpp b/3rdparty/glm/source/test/core/core_type_mat2x3.cpp deleted file mode 100644 index e3ad76b..0000000 --- a/3rdparty/glm/source/test/core/core_type_mat2x3.cpp +++ /dev/null @@ -1,142 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int test_operators() -{ - glm::mat2x3 l(1.0f); - glm::mat2x3 m(1.0f); - glm::vec2 u(1.0f); - glm::vec3 v(1.0f); - float x = 1.0f; - glm::vec3 a = m * u; - glm::vec2 b = v * m; - glm::mat2x3 n = x / m; - glm::mat2x3 o = m / x; - glm::mat2x3 p = x * m; - glm::mat2x3 q = m * x; - bool R = glm::any(glm::notEqual(m, q, glm::epsilon())); - bool S = glm::all(glm::equal(m, l, glm::epsilon())); - - return (S && !R) ? 0 : 1; -} - -int test_ctr() -{ - int Error(0); - -#if GLM_HAS_INITIALIZER_LISTS - glm::mat2x3 m0( - glm::vec3(0, 1, 2), - glm::vec3(3, 4, 5)); - - glm::mat2x3 m1{0, 1, 2, 3, 4, 5}; - - glm::mat2x3 m2{ - {0, 1, 2}, - {3, 4, 5}}; - - Error += glm::all(glm::equal(m0, m2, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(m1, m2, glm::epsilon())) ? 0 : 1; - - std::vector v1{ - {0, 1, 2, 3, 4, 5}, - {0, 1, 2, 3, 4, 5} - }; - - std::vector v2{ - { - { 0, 1, 2}, - { 4, 5, 6} - }, - { - { 0, 1, 2}, - { 4, 5, 6} - } - }; - -#endif//GLM_HAS_INITIALIZER_LISTS - - return Error; -} - -namespace cast -{ - template - int entry() - { - int Error = 0; - - genType A(1.0f); - glm::mat2x3 B(A); - glm::mat2x3 Identity(1.0f); - - Error += glm::all(glm::equal(B, Identity, glm::epsilon())) ? 0 : 1; - - return Error; - } - - int test() - { - int Error = 0; - - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - - return Error; - } -}//namespace cast - -int test_size() -{ - int Error = 0; - - Error += 24 == sizeof(glm::mat2x3) ? 0 : 1; - Error += 48 == sizeof(glm::dmat2x3) ? 0 : 1; - Error += glm::mat2x3().length() == 2 ? 0 : 1; - Error += glm::dmat2x3().length() == 2 ? 0 : 1; - Error += glm::mat2x3::length() == 2 ? 0 : 1; - Error += glm::dmat2x3::length() == 2 ? 0 : 1; - - return Error; -} - -int test_constexpr() -{ -#if GLM_HAS_CONSTEXPR - static_assert(glm::mat2x3::length() == 2, "GLM: Failed constexpr"); -#endif - - return 0; -} - -int main() -{ - int Error = 0; - - Error += cast::test(); - Error += test_ctr(); - Error += test_operators(); - Error += test_size(); - Error += test_constexpr(); - - return Error; -} diff --git a/3rdparty/glm/source/test/core/core_type_mat2x4.cpp b/3rdparty/glm/source/test/core/core_type_mat2x4.cpp deleted file mode 100644 index ade3a44..0000000 --- a/3rdparty/glm/source/test/core/core_type_mat2x4.cpp +++ /dev/null @@ -1,147 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int test_operators() -{ - glm::mat2x4 l(1.0f); - glm::mat2x4 m(1.0f); - glm::vec2 u(1.0f); - glm::vec4 v(1.0f); - float x = 1.0f; - glm::vec4 a = m * u; - glm::vec2 b = v * m; - glm::mat2x4 n = x / m; - glm::mat2x4 o = m / x; - glm::mat2x4 p = x * m; - glm::mat2x4 q = m * x; - bool R = glm::any(glm::notEqual(m, q, glm::epsilon())); - bool S = glm::all(glm::equal(m, l, glm::epsilon())); - - return (S && !R) ? 0 : 1; -} - -int test_ctr() -{ - int Error(0); - -#if(GLM_HAS_INITIALIZER_LISTS) - glm::mat2x4 m0( - glm::vec4(0, 1, 2, 3), - glm::vec4(4, 5, 6, 7)); - - glm::mat2x4 m1{0, 1, 2, 3, 4, 5, 6, 7}; - - glm::mat2x4 m2{ - {0, 1, 2, 3}, - {4, 5, 6, 7}}; - - Error += glm::all(glm::equal(m0, m2, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(m1, m2, glm::epsilon())) ? 0 : 1; - - std::vector v1{ - {0, 1, 2, 3, 4, 5, 6, 7}, - {0, 1, 2, 3, 4, 5, 6, 7} - }; - - std::vector v2{ - { - { 0, 1, 2, 3}, - { 4, 5, 6, 7} - }, - { - { 0, 1, 2, 3}, - { 4, 5, 6, 7} - } - }; - -#endif//GLM_HAS_INITIALIZER_LISTS - - return Error; -} - -namespace cast -{ - template - int entry() - { - int Error = 0; - - genType A(1.0f); - glm::mat2x4 B(A); - glm::mat2x4 Identity(1.0f); - - for(glm::length_t i = 0, length = B.length(); i < length; ++i) - Error += glm::all(glm::epsilonEqual(B[i], Identity[i], glm::epsilon())) ? 0 : 1; - - return Error; - } - - int test() - { - int Error = 0; - - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - - return Error; - } -}//namespace cast - -static int test_size() -{ - int Error = 0; - - Error += 32 == sizeof(glm::mat2x4) ? 0 : 1; - Error += 64 == sizeof(glm::dmat2x4) ? 0 : 1; - Error += glm::mat2x4().length() == 2 ? 0 : 1; - Error += glm::dmat2x4().length() == 2 ? 0 : 1; - Error += glm::mat2x4::length() == 2 ? 0 : 1; - Error += glm::dmat2x4::length() == 2 ? 0 : 1; - - return Error; -} - -static int test_constexpr() -{ -#if GLM_HAS_CONSTEXPR - static_assert(glm::mat2x4::length() == 2, "GLM: Failed constexpr"); -#endif - - return 0; -} - -int main() -{ - int Error = 0; - - Error += cast::test(); - Error += test_ctr(); - Error += test_operators(); - Error += test_size(); - Error += test_constexpr(); - - return Error; -} - - - diff --git a/3rdparty/glm/source/test/core/core_type_mat3x2.cpp b/3rdparty/glm/source/test/core/core_type_mat3x2.cpp deleted file mode 100644 index 7a40f90..0000000 --- a/3rdparty/glm/source/test/core/core_type_mat3x2.cpp +++ /dev/null @@ -1,148 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static bool test_operators() -{ - glm::mat3x2 l(1.0f); - glm::mat3x2 m(1.0f); - glm::vec3 u(1.0f); - glm::vec2 v(1.0f); - float x = 1.0f; - glm::vec2 a = m * u; - glm::vec3 b = v * m; - glm::mat3x2 n = x / m; - glm::mat3x2 o = m / x; - glm::mat3x2 p = x * m; - glm::mat3x2 q = m * x; - bool R = glm::any(glm::notEqual(m, q, glm::epsilon())); - bool S = glm::all(glm::equal(m, l, glm::epsilon())); - - return (S && !R) ? 0 : 1; -} - -int test_ctr() -{ - int Error(0); - -#if(GLM_HAS_INITIALIZER_LISTS) - glm::mat3x2 m0( - glm::vec2(0, 1), - glm::vec2(2, 3), - glm::vec2(4, 5)); - - glm::mat3x2 m1{0, 1, 2, 3, 4, 5}; - - glm::mat3x2 m2{ - {0, 1}, - {2, 3}, - {4, 5}}; - - Error += glm::all(glm::equal(m0, m2, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(m1, m2, glm::epsilon())) ? 0 : 1; - - std::vector v1{ - {0, 1, 2, 3, 4, 5}, - {0, 1, 2, 3, 4, 5} - }; - - std::vector v2{ - { - { 0, 1}, - { 2, 3}, - { 4, 5} - }, - { - { 0, 1}, - { 2, 3}, - { 4, 5} - } - }; - -#endif//GLM_HAS_INITIALIZER_LISTS - - return Error; -} - -namespace cast -{ - template - int entry() - { - int Error = 0; - - genType A(1.0f); - glm::mat3x2 B(A); - glm::mat3x2 Identity(1.0f); - - Error += glm::all(glm::equal(B, Identity, glm::epsilon())) ? 0 : 1; - - return Error; - } - - int test() - { - int Error = 0; - - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - - return Error; - } -}//namespace cast - -static int test_size() -{ - int Error = 0; - - Error += 24 == sizeof(glm::mat3x2) ? 0 : 1; - Error += 48 == sizeof(glm::dmat3x2) ? 0 : 1; - Error += glm::mat3x2().length() == 3 ? 0 : 1; - Error += glm::dmat3x2().length() == 3 ? 0 : 1; - Error += glm::mat3x2::length() == 3 ? 0 : 1; - Error += glm::dmat3x2::length() == 3 ? 0 : 1; - - return Error; -} - -static int test_constexpr() -{ -#if GLM_HAS_CONSTEXPR - static_assert(glm::mat3x2::length() == 3, "GLM: Failed constexpr"); -#endif - - return 0; -} - -int main() -{ - int Error = 0; - - Error += cast::test(); - Error += test_ctr(); - Error += test_operators(); - Error += test_size(); - Error += test_constexpr(); - - return Error; -} - - diff --git a/3rdparty/glm/source/test/core/core_type_mat3x3.cpp b/3rdparty/glm/source/test/core/core_type_mat3x3.cpp deleted file mode 100644 index 99e1f41..0000000 --- a/3rdparty/glm/source/test/core/core_type_mat3x3.cpp +++ /dev/null @@ -1,197 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int test_mat3x3() -{ - glm::dmat3 Mat0( - glm::dvec3(0.6f, 0.2f, 0.3f), - glm::dvec3(0.2f, 0.7f, 0.5f), - glm::dvec3(0.3f, 0.5f, 0.7f)); - glm::dmat3 Inv0 = glm::inverse(Mat0); - glm::dmat3 Res0 = Mat0 * Inv0; - - return glm::all(glm::equal(Res0, glm::dmat3(1.0), 0.01)) ? 0 : 1; -} - -static int test_operators() -{ - glm::mat3x3 l(1.0f); - glm::mat3x3 m(1.0f); - glm::vec3 u(1.0f); - glm::vec3 v(1.0f); - float x = 1.0f; - glm::vec3 a = m * u; - glm::vec3 b = v * m; - glm::mat3x3 n = x / m; - glm::mat3x3 o = m / x; - glm::mat3x3 p = x * m; - glm::mat3x3 q = m * x; - bool R = glm::any(glm::notEqual(m, q, glm::epsilon())); - bool S = glm::all(glm::equal(m, l, glm::epsilon())); - - return (S && !R) ? 0 : 1; -} - -static int test_inverse() -{ - int Error(0); - - { - glm::mat3 const Matrix( - glm::vec3(0.6f, 0.2f, 0.3f), - glm::vec3(0.2f, 0.7f, 0.5f), - glm::vec3(0.3f, 0.5f, 0.7f)); - glm::mat3 const Inverse = glm::inverse(Matrix); - glm::mat3 const Identity = Matrix * Inverse; - - Error += glm::all(glm::equal(Identity[0], glm::vec3(1.0f, 0.0f, 0.0f), glm::vec3(0.01f))) ? 0 : 1; - Error += glm::all(glm::equal(Identity[1], glm::vec3(0.0f, 1.0f, 0.0f), glm::vec3(0.01f))) ? 0 : 1; - Error += glm::all(glm::equal(Identity[2], glm::vec3(0.0f, 0.0f, 1.0f), glm::vec3(0.01f))) ? 0 : 1; - } - - { - glm::mat3 const Matrix( - glm::vec3(0.6f, 0.2f, 0.3f), - glm::vec3(0.2f, 0.7f, 0.5f), - glm::vec3(0.3f, 0.5f, 0.7f)); - glm::mat3 const Identity = Matrix / Matrix; - - Error += glm::all(glm::equal(Identity[0], glm::vec3(1.0f, 0.0f, 0.0f), glm::vec3(0.01f))) ? 0 : 1; - Error += glm::all(glm::equal(Identity[1], glm::vec3(0.0f, 1.0f, 0.0f), glm::vec3(0.01f))) ? 0 : 1; - Error += glm::all(glm::equal(Identity[2], glm::vec3(0.0f, 0.0f, 1.0f), glm::vec3(0.01f))) ? 0 : 1; - } - - return Error; -} - -static int test_ctr() -{ - int Error(0); - -#if(GLM_HAS_INITIALIZER_LISTS) - glm::mat3x3 m0( - glm::vec3(0, 1, 2), - glm::vec3(3, 4, 5), - glm::vec3(6, 7, 8)); - - glm::mat3x3 m1{0, 1, 2, 3, 4, 5, 6, 7, 8}; - - glm::mat3x3 m2{ - {0, 1, 2}, - {3, 4, 5}, - {6, 7, 8}}; - - Error += glm::all(glm::equal(m0, m2, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(m1, m2, glm::epsilon())) ? 0 : 1; - - std::vector v1{ - {0, 1, 2, 3, 4, 5, 6, 7, 8}, - {0, 1, 2, 3, 4, 5, 6, 7, 8} - }; - - std::vector v2{ - { - { 0, 1, 2}, - { 3, 4, 5}, - { 6, 7, 8} - }, - { - { 0, 1, 2}, - { 3, 4, 5}, - { 6, 7, 8} - } - }; - -#endif//GLM_HAS_INITIALIZER_LISTS - - return Error; -} - -namespace cast -{ - template - int entry() - { - int Error = 0; - - genType A(1.0f); - glm::mat3x3 B(A); - glm::mat3x3 Identity(1.0f); - - Error += glm::all(glm::equal(B, Identity, glm::epsilon())) ? 0 : 1; - - return Error; - } - - int test() - { - int Error = 0; - - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - - return Error; - } -}//namespace cast - -static int test_size() -{ - int Error = 0; - - Error += 36 == sizeof(glm::mat3x3) ? 0 : 1; - Error += 72 == sizeof(glm::dmat3x3) ? 0 : 1; - Error += glm::mat3x3().length() == 3 ? 0 : 1; - Error += glm::dmat3x3().length() == 3 ? 0 : 1; - Error += glm::mat3x3::length() == 3 ? 0 : 1; - Error += glm::dmat3x3::length() == 3 ? 0 : 1; - - return Error; -} - -static int test_constexpr() -{ -#if GLM_HAS_CONSTEXPR - static_assert(glm::mat3x3::length() == 3, "GLM: Failed constexpr"); - - constexpr glm::mat3x3 const Z(0.0f); -#endif - - return 0; -} - -int main() -{ - int Error = 0; - - Error += cast::test(); - Error += test_ctr(); - Error += test_mat3x3(); - Error += test_operators(); - Error += test_inverse(); - Error += test_size(); - Error += test_constexpr(); - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_type_mat3x4.cpp b/3rdparty/glm/source/test/core/core_type_mat3x4.cpp deleted file mode 100644 index 97d4574..0000000 --- a/3rdparty/glm/source/test/core/core_type_mat3x4.cpp +++ /dev/null @@ -1,149 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static bool test_operators() -{ - glm::mat3x4 l(1.0f); - glm::mat3x4 m(1.0f); - glm::vec3 u(1.0f); - glm::vec4 v(1.0f); - float x = 1.0f; - glm::vec4 a = m * u; - glm::vec3 b = v * m; - glm::mat3x4 n = x / m; - glm::mat3x4 o = m / x; - glm::mat3x4 p = x * m; - glm::mat3x4 q = m * x; - bool R = glm::any(glm::notEqual(m, q, glm::epsilon())); - bool S = glm::all(glm::equal(m, l, glm::epsilon())); - - return (S && !R) ? 0 : 1; -} - -int test_ctr() -{ - int Error(0); - -#if(GLM_HAS_INITIALIZER_LISTS) - glm::mat3x4 m0( - glm::vec4(0, 1, 2, 3), - glm::vec4(4, 5, 6, 7), - glm::vec4(8, 9, 10, 11)); - - glm::mat3x4 m1{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; - - glm::mat3x4 m2{ - {0, 1, 2, 3}, - {4, 5, 6, 7}, - {8, 9, 10, 11}}; - - Error += glm::all(glm::equal(m0, m2, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(m1, m2, glm::epsilon())) ? 0 : 1; - - std::vector v1{ - {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, - {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} - }; - - std::vector v2{ - { - { 0, 1, 2, 3}, - { 4, 5, 6, 7}, - { 8, 9, 10, 11} - }, - { - { 0, 1, 2, 3}, - { 4, 5, 6, 7}, - { 8, 9, 10, 11} - } - }; - -#endif//GLM_HAS_INITIALIZER_LISTS - - return Error; -} - -namespace cast -{ - template - int entry() - { - int Error = 0; - - genType A(1.0f); - glm::mat3x4 B(A); - glm::mat3x4 Identity(1.0f); - - for(glm::length_t i = 0, length = B.length(); i < length; ++i) - Error += glm::all(glm::epsilonEqual(B[i], Identity[i], glm::epsilon())) ? 0 : 1; - - return Error; - } - - int test() - { - int Error = 0; - - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - - return Error; - } -}//namespace cast - -static int test_size() -{ - int Error = 0; - - Error += 48 == sizeof(glm::mat3x4) ? 0 : 1; - Error += 96 == sizeof(glm::dmat3x4) ? 0 : 1; - Error += glm::mat3x4().length() == 3 ? 0 : 1; - Error += glm::dmat3x4().length() == 3 ? 0 : 1; - Error += glm::mat3x4::length() == 3 ? 0 : 1; - Error += glm::dmat3x4::length() == 3 ? 0 : 1; - - return Error; -} - -static int test_constexpr() -{ -#if GLM_HAS_CONSTEXPR - static_assert(glm::mat3x4::length() == 3, "GLM: Failed constexpr"); -#endif - - return 0; -} - -int main() -{ - int Error = 0; - - Error += cast::test(); - Error += test_ctr(); - Error += test_operators(); - Error += test_size(); - Error += test_constexpr(); - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_type_mat4x2.cpp b/3rdparty/glm/source/test/core/core_type_mat4x2.cpp deleted file mode 100644 index 7133edc..0000000 --- a/3rdparty/glm/source/test/core/core_type_mat4x2.cpp +++ /dev/null @@ -1,151 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int test_operators() -{ - glm::mat4x2 l(1.0f); - glm::mat4x2 m(1.0f); - glm::vec4 u(1.0f); - glm::vec2 v(1.0f); - float x = 1.0f; - glm::vec2 a = m * u; - glm::vec4 b = v * m; - glm::mat4x2 n = x / m; - glm::mat4x2 o = m / x; - glm::mat4x2 p = x * m; - glm::mat4x2 q = m * x; - bool R = glm::any(glm::notEqual(m, q, glm::epsilon())); - bool S = glm::all(glm::equal(m, l, glm::epsilon())); - - return (S && !R) ? 0 : 1; -} - -int test_ctr() -{ - int Error(0); - -#if(GLM_HAS_INITIALIZER_LISTS) - glm::mat4x2 m0( - glm::vec2(0, 1), - glm::vec2(2, 3), - glm::vec2(4, 5), - glm::vec2(6, 7)); - - glm::mat4x2 m1{0, 1, 2, 3, 4, 5, 6, 7}; - - glm::mat4x2 m2{ - {0, 1}, - {2, 3}, - {4, 5}, - {6, 7}}; - - Error += glm::all(glm::equal(m0, m2, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(m1, m2, glm::epsilon())) ? 0 : 1; - - std::vector v1{ - {0, 1, 2, 3, 4, 5, 6, 7}, - {0, 1, 2, 3, 4, 5, 6, 7} - }; - - std::vector v2{ - { - { 0, 1}, - { 4, 5}, - { 8, 9}, - { 12, 13} - }, - { - { 0, 1}, - { 4, 5}, - { 8, 9}, - { 12, 13} - } - }; - -#endif//GLM_HAS_INITIALIZER_LISTS - - return Error; -} - -namespace cast -{ - template - int entry() - { - int Error = 0; - - genType A(1.0f); - glm::mat4x2 B(A); - glm::mat4x2 Identity(1.0f); - - Error += glm::all(glm::equal(B, Identity, glm::epsilon())) ? 0 : 1; - - return Error; - } - - int test() - { - int Error = 0; - - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - - return Error; - } -}//namespace cast - -static int test_size() -{ - int Error = 0; - - Error += 32 == sizeof(glm::mat4x2) ? 0 : 1; - Error += 64 == sizeof(glm::dmat4x2) ? 0 : 1; - Error += glm::mat4x2().length() == 4 ? 0 : 1; - Error += glm::dmat4x2().length() == 4 ? 0 : 1; - Error += glm::mat4x2::length() == 4 ? 0 : 1; - Error += glm::dmat4x2::length() == 4 ? 0 : 1; - - return Error; -} - -static int test_constexpr() -{ -#if GLM_HAS_CONSTEXPR - static_assert(glm::mat4x2::length() == 4, "GLM: Failed constexpr"); -#endif - - return 0; -} - -int main() -{ - int Error = 0; - - Error += cast::test(); - Error += test_ctr(); - Error += test_operators(); - Error += test_size(); - Error += test_constexpr(); - - return Error; -} - diff --git a/3rdparty/glm/source/test/core/core_type_mat4x3.cpp b/3rdparty/glm/source/test/core/core_type_mat4x3.cpp deleted file mode 100644 index 1c65e7f..0000000 --- a/3rdparty/glm/source/test/core/core_type_mat4x3.cpp +++ /dev/null @@ -1,152 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static int test_operators() -{ - glm::mat4x3 l(1.0f); - glm::mat4x3 m(1.0f); - glm::vec4 u(1.0f); - glm::vec3 v(1.0f); - float x = 1.0f; - glm::vec3 a = m * u; - glm::vec4 b = v * m; - glm::mat4x3 n = x / m; - glm::mat4x3 o = m / x; - glm::mat4x3 p = x * m; - glm::mat4x3 q = m * x; - bool R = glm::any(glm::notEqual(m, q, glm::epsilon())); - bool S = glm::all(glm::equal(m, l, glm::epsilon())); - - return (S && !R) ? 0 : 1; -} - -int test_ctr() -{ - int Error(0); - -#if(GLM_HAS_INITIALIZER_LISTS) - glm::mat4x3 m0( - glm::vec3(0, 1, 2), - glm::vec3(3, 4, 5), - glm::vec3(6, 7, 8), - glm::vec3(9, 10, 11)); - - glm::mat4x3 m1{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; - - glm::mat4x3 m2{ - {0, 1, 2}, - {3, 4, 5}, - {6, 7, 8}, - {9, 10, 11}}; - - Error += glm::all(glm::equal(m0, m2, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(m1, m2, glm::epsilon())) ? 0 : 1; - - std::vector v1{ - {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, - {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11} - }; - - std::vector v2{ - { - { 0, 1, 2 }, - { 4, 5, 6 }, - { 8, 9, 10 }, - { 12, 13, 14 } - }, - { - { 0, 1, 2 }, - { 4, 5, 6 }, - { 8, 9, 10 }, - { 12, 13, 14 } - } - }; - -#endif//GLM_HAS_INITIALIZER_LISTS - - return Error; -} - -namespace cast -{ - template - int entry() - { - int Error = 0; - - genType A(1.0f); - glm::mat4x3 B(A); - glm::mat4x3 Identity(1.0f); - - Error += glm::all(glm::equal(B, Identity, glm::epsilon())) ? 0 : 1; - - return Error; - } - - int test() - { - int Error = 0; - - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - Error += entry(); - - return Error; - } -}//namespace cast - -static int test_size() -{ - int Error = 0; - - Error += 48 == sizeof(glm::mat4x3) ? 0 : 1; - Error += 96 == sizeof(glm::dmat4x3) ? 0 : 1; - Error += glm::mat4x3().length() == 4 ? 0 : 1; - Error += glm::dmat4x3().length() == 4 ? 0 : 1; - Error += glm::mat4x3::length() == 4 ? 0 : 1; - Error += glm::dmat4x3::length() == 4 ? 0 : 1; - - return Error; -} - -static int test_constexpr() -{ -#if GLM_HAS_CONSTEXPR - static_assert(glm::mat4x3::length() == 4, "GLM: Failed constexpr"); -#endif - - return 0; -} - -int main() -{ - int Error = 0; - - Error += cast::test(); - Error += test_ctr(); - Error += test_operators(); - Error += test_size(); - Error += test_constexpr(); - - return Error; -} - - diff --git a/3rdparty/glm/source/test/core/core_type_mat4x4.cpp b/3rdparty/glm/source/test/core/core_type_mat4x4.cpp deleted file mode 100644 index 0be87f1..0000000 --- a/3rdparty/glm/source/test/core/core_type_mat4x4.cpp +++ /dev/null @@ -1,218 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -template -static int test_operators() -{ - typedef typename matType::value_type value_type; - - value_type const Epsilon = static_cast(0.001); - - int Error = 0; - - matType const M(static_cast(2.0f)); - matType const N(static_cast(1.0f)); - vecType const U(static_cast(2.0f)); - - { - matType const P = N * static_cast(2.0f); - Error += glm::all(glm::equal(P, M, Epsilon)) ? 0 : 1; - - matType const Q = M / static_cast(2.0f); - Error += glm::all(glm::equal(Q, N, Epsilon)) ? 0 : 1; - } - - { - vecType const V = M * U; - Error += glm::all(glm::equal(V, vecType(static_cast(4.f)), Epsilon)) ? 0 : 1; - - vecType const W = U / M; - Error += glm::all(glm::equal(W, vecType(static_cast(1.f)), Epsilon)) ? 0 : 1; - } - - { - matType const O = M * N; - Error += glm::all(glm::equal(O, matType(static_cast(2.f)), Epsilon)) ? 0 : 1; - } - - return Error; -} - -template -static int test_inverse() -{ - typedef typename matType::value_type value_type; - - value_type const Epsilon = static_cast(0.001); - - int Error = 0; - - matType const Identity(static_cast(1.0f)); - matType const Matrix( - glm::vec4(0.6f, 0.2f, 0.3f, 0.4f), - glm::vec4(0.2f, 0.7f, 0.5f, 0.3f), - glm::vec4(0.3f, 0.5f, 0.7f, 0.2f), - glm::vec4(0.4f, 0.3f, 0.2f, 0.6f)); - matType const Inverse = Identity / Matrix; - matType const Result = Matrix * Inverse; - - Error += glm::all(glm::equal(Identity, Result, Epsilon)) ? 0 : 1; - - return Error; -} - -static int test_ctr() -{ - int Error = 0; - -#if GLM_HAS_TRIVIAL_QUERIES - //Error += std::is_trivially_default_constructible::value ? 0 : 1; - //Error += std::is_trivially_copy_assignable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - //Error += std::is_copy_constructible::value ? 0 : 1; - //Error += std::has_trivial_copy_constructor::value ? 0 : 1; -#endif - -#if GLM_HAS_INITIALIZER_LISTS - glm::mat4 const m0( - glm::vec4(0, 1, 2, 3), - glm::vec4(4, 5, 6, 7), - glm::vec4(8, 9, 10, 11), - glm::vec4(12, 13, 14, 15)); - - assert(sizeof(m0) == 4 * 4 * 4); - - glm::vec4 const V{0, 1, 2, 3}; - - glm::mat4 const m1{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; - - glm::mat4 const m2{ - {0, 1, 2, 3}, - {4, 5, 6, 7}, - {8, 9, 10, 11}, - {12, 13, 14, 15}}; - - Error += glm::all(glm::equal(m0, m2, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(m1, m2, glm::epsilon())) ? 0 : 1; - - - std::vector const m3{ - {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, - {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, - {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, - {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}}; - - glm::mat4 const m4{ - {1, 0, 0, 0}, - {0, 1, 0, 0}, - {0, 0, 1, 0}, - {0, 0, 0, 1} }; - - Error += glm::equal(m4[0][0], 1.0f, 0.0001f) ? 0 : 1; - Error += glm::equal(m4[3][3], 1.0f, 0.0001f) ? 0 : 1; - - std::vector const v1{ - {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, - {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}}; - - std::vector const v2{ - { - { 0, 1, 2, 3 }, - { 4, 5, 6, 7 }, - { 8, 9, 10, 11 }, - { 12, 13, 14, 15 } - }, - { - { 0, 1, 2, 3 }, - { 4, 5, 6, 7 }, - { 8, 9, 10, 11 }, - { 12, 13, 14, 15 } - }}; - -#endif//GLM_HAS_INITIALIZER_LISTS - - return Error; -} - -static int test_member_alloc_bug() -{ - int Error = 0; - - struct repro - { - repro(){ this->matrix = new glm::mat4(); } - ~repro(){delete this->matrix;} - - glm::mat4* matrix; - }; - - repro Repro; - - return Error; -} - -static int test_size() -{ - int Error = 0; - - Error += 64 == sizeof(glm::mat4) ? 0 : 1; - Error += 128 == sizeof(glm::dmat4) ? 0 : 1; - Error += glm::mat4().length() == 4 ? 0 : 1; - Error += glm::dmat4().length() == 4 ? 0 : 1; - Error += glm::mat4::length() == 4 ? 0 : 1; - Error += glm::dmat4::length() == 4 ? 0 : 1; - - return Error; -} - -static int test_constexpr() -{ -#if GLM_HAS_CONSTEXPR - static_assert(glm::mat4::length() == 4, "GLM: Failed constexpr"); - constexpr glm::mat4 A(1.f); - constexpr glm::mat4 B(1.f); - constexpr glm::bvec4 C = glm::equal(A, B, 0.01f); - static_assert(glm::all(C), "GLM: Failed constexpr"); -#endif - - return 0; -} - -int main() -{ - int Error = 0; - - Error += test_member_alloc_bug(); - Error += test_ctr(); - - Error += test_operators(); - Error += test_operators(); - Error += test_operators(); - Error += test_operators(); - - Error += test_operators(); - Error += test_operators(); - Error += test_operators(); - Error += test_operators(); - - Error += test_inverse(); - Error += test_inverse(); - Error += test_inverse(); - Error += test_inverse(); - - Error += test_inverse(); - Error += test_inverse(); - Error += test_inverse(); - Error += test_inverse(); - - Error += test_size(); - Error += test_constexpr(); - - return Error; -} diff --git a/3rdparty/glm/source/test/core/core_type_vec1.cpp b/3rdparty/glm/source/test/core/core_type_vec1.cpp deleted file mode 100644 index 77f3f84..0000000 --- a/3rdparty/glm/source/test/core/core_type_vec1.cpp +++ /dev/null @@ -1,169 +0,0 @@ -#define GLM_FORCE_SWIZZLE -#include -#include -#include -#include -#include - -static glm::vec1 g1; -static glm::vec1 g2(1); - -int test_vec1_operators() -{ - int Error = 0; - - glm::ivec1 A(1); - glm::ivec1 B(1); - { - bool R = A != B; - bool S = A == B; - - Error += (S && !R) ? 0 : 1; - } - - { - A *= 1; - B *= 1; - A += 1; - B += 1; - - bool R = A != B; - bool S = A == B; - - Error += (S && !R) ? 0 : 1; - } - - return Error; -} - -int test_vec1_ctor() -{ - int Error = 0; - -# if GLM_HAS_TRIVIAL_QUERIES - // Error += std::is_trivially_default_constructible::value ? 0 : 1; - // Error += std::is_trivially_copy_assignable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - - Error += std::is_copy_constructible::value ? 0 : 1; -# endif - -/* -#if GLM_HAS_INITIALIZER_LISTS - { - glm::vec1 a{ 0 }; - std::vector v = { - {0.f}, - {4.f}, - {8.f}}; - } - - { - glm::dvec2 a{ 0 }; - std::vector v = { - {0.0}, - {4.0}, - {8.0}}; - } -#endif -*/ - - { - glm::vec2 A = glm::vec2(2.0f); - glm::vec2 B = glm::vec2(2.0f, 3.0f); - glm::vec2 C = glm::vec2(2.0f, 3.0); - //glm::vec2 D = glm::dvec2(2.0); // Build error TODO: What does the specification says? - glm::vec2 E(glm::dvec2(2.0)); - glm::vec2 F(glm::ivec2(2)); - } - - return Error; -} - -static int test_vec1_size() -{ - int Error = 0; - - Error += sizeof(glm::vec1) == sizeof(glm::mediump_vec1) ? 0 : 1; - Error += 4 == sizeof(glm::mediump_vec1) ? 0 : 1; - Error += sizeof(glm::dvec1) == sizeof(glm::highp_dvec1) ? 0 : 1; - Error += 8 == sizeof(glm::highp_dvec1) ? 0 : 1; - Error += glm::vec1().length() == 1 ? 0 : 1; - Error += glm::dvec1().length() == 1 ? 0 : 1; - Error += glm::vec1::length() == 1 ? 0 : 1; - Error += glm::dvec1::length() == 1 ? 0 : 1; - - return Error; -} - -static int test_vec1_operator_increment() -{ - int Error(0); - - glm::ivec1 v0(1); - glm::ivec1 v1(v0); - glm::ivec1 v2(v0); - glm::ivec1 v3 = ++v1; - glm::ivec1 v4 = v2++; - - Error += glm::all(glm::equal(v0, v4)) ? 0 : 1; - Error += glm::all(glm::equal(v1, v2)) ? 0 : 1; - Error += glm::all(glm::equal(v1, v3)) ? 0 : 1; - - int i0(1); - int i1(i0); - int i2(i0); - int i3 = ++i1; - int i4 = i2++; - - Error += i0 == i4 ? 0 : 1; - Error += i1 == i2 ? 0 : 1; - Error += i1 == i3 ? 0 : 1; - - return Error; -} - -static int test_swizzle() -{ - int Error = 0; - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - { - glm::vec1 A = glm::vec1(1.0f); - //glm::vec1 B = A.x; - glm::vec1 C(A.x); - - //Error += glm::all(glm::equal(A, B)) ? 0 : 1; - Error += glm::all(glm::equal(A, C, glm::epsilon())) ? 0 : 1; - } -# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - - return Error; -} - -static int test_constexpr() -{ -#if GLM_HAS_CONSTEXPR - static_assert(glm::vec1::length() == 1, "GLM: Failed constexpr"); - static_assert(glm::vec1(1.0f).x > 0.0f, "GLM: Failed constexpr"); -#endif - - return 0; -} - -int main() -{ - int Error = 0; - - Error += test_vec1_size(); - Error += test_vec1_ctor(); - Error += test_vec1_operators(); - Error += test_vec1_operator_increment(); - Error += test_swizzle(); - Error += test_constexpr(); - - return Error; -} diff --git a/3rdparty/glm/source/test/core/core_type_vec2.cpp b/3rdparty/glm/source/test/core/core_type_vec2.cpp deleted file mode 100644 index 308c61f..0000000 --- a/3rdparty/glm/source/test/core/core_type_vec2.cpp +++ /dev/null @@ -1,392 +0,0 @@ -#define GLM_FORCE_SWIZZLE -#include -#include -#include -#include -#include -#include -#include -#if GLM_HAS_TRIVIAL_QUERIES -# include -#endif - -static glm::ivec2 g1; -static glm::ivec2 g2(1); -static glm::ivec2 g3(1, 1); - -static int test_operators() -{ - int Error = 0; - - { - glm::ivec2 A(1); - glm::ivec2 B(1); - Error += A != B ? 1 : 0; - Error += A == B ? 0 : 1; - } - - { - glm::vec2 A(1.0f); - glm::vec2 C = A + 1.0f; - A += 1.0f; - Error += glm::all(glm::equal(A, glm::vec2(2.0f), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, C, glm::epsilon())) ? 0 : 1; - } - - { - glm::vec2 A(1.0f); - glm::vec2 B(2.0f,-1.0f); - glm::vec2 C = A + B; - A += B; - Error += glm::all(glm::equal(A, glm::vec2(3.0f, 0.0f), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, C, glm::epsilon())) ? 0 : 1; - } - - { - glm::vec2 A(1.0f); - glm::vec2 C = A - 1.0f; - A -= 1.0f; - Error += glm::all(glm::equal(A, glm::vec2(0.0f), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, C, glm::epsilon())) ? 0 : 1; - } - - { - glm::vec2 A(1.0f); - glm::vec2 B(2.0f,-1.0f); - glm::vec2 C = A - B; - A -= B; - Error += glm::all(glm::equal(A, glm::vec2(-1.0f, 2.0f), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, C, glm::epsilon())) ? 0 : 1; - } - - { - glm::vec2 A(1.0f); - glm::vec2 C = A * 2.0f; - A *= 2.0f; - Error += glm::all(glm::equal(A, glm::vec2(2.0f), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, C, glm::epsilon())) ? 0 : 1; - } - - { - glm::vec2 A(2.0f); - glm::vec2 B(2.0f); - glm::vec2 C = A / B; - A /= B; - Error += glm::all(glm::equal(A, glm::vec2(1.0f), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, C, glm::epsilon())) ? 0 : 1; - } - - { - glm::vec2 A(1.0f, 2.0f); - glm::vec2 B(4.0f, 5.0f); - - glm::vec2 C = A + B; - Error += glm::all(glm::equal(C, glm::vec2(5, 7), glm::epsilon())) ? 0 : 1; - - glm::vec2 D = B - A; - Error += glm::all(glm::equal(D, glm::vec2(3, 3), glm::epsilon())) ? 0 : 1; - - glm::vec2 E = A * B; - Error += glm::all(glm::equal(E, glm::vec2(4, 10), glm::epsilon())) ? 0 : 1; - - glm::vec2 F = B / A; - Error += glm::all(glm::equal(F, glm::vec2(4, 2.5), glm::epsilon())) ? 0 : 1; - - glm::vec2 G = A + 1.0f; - Error += glm::all(glm::equal(G, glm::vec2(2, 3), glm::epsilon())) ? 0 : 1; - - glm::vec2 H = B - 1.0f; - Error += glm::all(glm::equal(H, glm::vec2(3, 4), glm::epsilon())) ? 0 : 1; - - glm::vec2 I = A * 2.0f; - Error += glm::all(glm::equal(I, glm::vec2(2, 4), glm::epsilon())) ? 0 : 1; - - glm::vec2 J = B / 2.0f; - Error += glm::all(glm::equal(J, glm::vec2(2, 2.5), glm::epsilon())) ? 0 : 1; - - glm::vec2 K = 1.0f + A; - Error += glm::all(glm::equal(K, glm::vec2(2, 3), glm::epsilon())) ? 0 : 1; - - glm::vec2 L = 1.0f - B; - Error += glm::all(glm::equal(L, glm::vec2(-3, -4), glm::epsilon())) ? 0 : 1; - - glm::vec2 M = 2.0f * A; - Error += glm::all(glm::equal(M, glm::vec2(2, 4), glm::epsilon())) ? 0 : 1; - - glm::vec2 N = 2.0f / B; - Error += glm::all(glm::equal(N, glm::vec2(0.5, 2.0 / 5.0), glm::epsilon())) ? 0 : 1; - } - - { - glm::vec2 A(1.0f, 2.0f); - glm::vec2 B(4.0f, 5.0f); - - A += B; - Error += glm::all(glm::equal(A, glm::vec2(5, 7), glm::epsilon())) ? 0 : 1; - - A += 1.0f; - Error += glm::all(glm::equal(A, glm::vec2(6, 8), glm::epsilon())) ? 0 : 1; - } - { - glm::ivec2 A(1.0f, 2.0f); - glm::ivec2 B(4.0f, 5.0f); - - B -= A; - Error += B == glm::ivec2(3, 3) ? 0 : 1; - - B -= 1.0f; - Error += B == glm::ivec2(2, 2) ? 0 : 1; - } - { - glm::ivec2 A(1.0f, 2.0f); - glm::ivec2 B(4.0f, 5.0f); - - A *= B; - Error += A == glm::ivec2(4, 10) ? 0 : 1; - - A *= 2; - Error += A == glm::ivec2(8, 20) ? 0 : 1; - } - { - glm::ivec2 A(1.0f, 2.0f); - glm::ivec2 B(4.0f, 16.0f); - - B /= A; - Error += B == glm::ivec2(4, 8) ? 0 : 1; - - B /= 2.0f; - Error += B == glm::ivec2(2, 4) ? 0 : 1; - } - { - glm::ivec2 B(2); - - B /= B.y; - Error += B == glm::ivec2(1) ? 0 : 1; - } - - { - glm::ivec2 A(1.0f, 2.0f); - glm::ivec2 B = -A; - Error += B == glm::ivec2(-1.0f, -2.0f) ? 0 : 1; - } - - { - glm::ivec2 A(1.0f, 2.0f); - glm::ivec2 B = --A; - Error += B == glm::ivec2(0.0f, 1.0f) ? 0 : 1; - } - - { - glm::ivec2 A(1.0f, 2.0f); - glm::ivec2 B = A--; - Error += B == glm::ivec2(1.0f, 2.0f) ? 0 : 1; - Error += A == glm::ivec2(0.0f, 1.0f) ? 0 : 1; - } - - { - glm::ivec2 A(1.0f, 2.0f); - glm::ivec2 B = ++A; - Error += B == glm::ivec2(2.0f, 3.0f) ? 0 : 1; - } - - { - glm::ivec2 A(1.0f, 2.0f); - glm::ivec2 B = A++; - Error += B == glm::ivec2(1.0f, 2.0f) ? 0 : 1; - Error += A == glm::ivec2(2.0f, 3.0f) ? 0 : 1; - } - - return Error; -} - -static int test_ctor() -{ - int Error = 0; - - { - glm::ivec2 A(1); - glm::ivec2 B(A); - Error += A == B ? 0 : 1; - } - -# if GLM_HAS_TRIVIAL_QUERIES - // Error += std::is_trivially_default_constructible::value ? 0 : 1; - // Error += std::is_trivially_copy_assignable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - - Error += std::is_copy_constructible::value ? 0 : 1; -# endif - -#if GLM_HAS_INITIALIZER_LISTS - { - glm::vec2 a{ 0, 1 }; - std::vector v = { - {0, 1}, - {4, 5}, - {8, 9}}; - } - - { - glm::dvec2 a{ 0, 1 }; - std::vector v = { - {0, 1}, - {4, 5}, - {8, 9}}; - } -#endif - - { - glm::vec2 A = glm::vec2(2.0f); - glm::vec2 B = glm::vec2(2.0f, 3.0f); - glm::vec2 C = glm::vec2(2.0f, 3.0); - //glm::vec2 D = glm::dvec2(2.0); // Build error TODO: What does the specification says? - glm::vec2 E(glm::dvec2(2.0)); - glm::vec2 F(glm::ivec2(2)); - } - - { - glm::vec1 const R(1.0f); - glm::vec1 const S(2.0f); - glm::vec2 const O(1.0f, 2.0f); - - glm::vec2 const A(R); - glm::vec2 const B(1.0f); - Error += glm::all(glm::equal(A, B, 0.0001f)) ? 0 : 1; - - glm::vec2 const C(R, S); - Error += glm::all(glm::equal(C, O, 0.0001f)) ? 0 : 1; - - glm::vec2 const D(R, 2.0f); - Error += glm::all(glm::equal(D, O, 0.0001f)) ? 0 : 1; - - glm::vec2 const E(1.0f, S); - Error += glm::all(glm::equal(E, O, 0.0001f)) ? 0 : 1; - } - - { - glm::vec1 const R(1.0f); - glm::dvec1 const S(2.0); - glm::vec2 const O(1.0, 2.0); - - glm::vec2 const A(R); - glm::vec2 const B(1.0); - Error += glm::all(glm::equal(A, B, 0.0001f)) ? 0 : 1; - - glm::vec2 const C(R, S); - Error += glm::all(glm::equal(C, O, 0.0001f)) ? 0 : 1; - - glm::vec2 const D(R, 2.0); - Error += glm::all(glm::equal(D, O, 0.0001f)) ? 0 : 1; - - glm::vec2 const E(1.0, S); - Error += glm::all(glm::equal(E, O, 0.0001f)) ? 0 : 1; - } - - return Error; -} - -static int test_size() -{ - int Error = 0; - - Error += sizeof(glm::vec2) == sizeof(glm::mediump_vec2) ? 0 : 1; - Error += 8 == sizeof(glm::mediump_vec2) ? 0 : 1; - Error += sizeof(glm::dvec2) == sizeof(glm::highp_dvec2) ? 0 : 1; - Error += 16 == sizeof(glm::highp_dvec2) ? 0 : 1; - Error += glm::vec2().length() == 2 ? 0 : 1; - Error += glm::dvec2().length() == 2 ? 0 : 1; - Error += glm::vec2::length() == 2 ? 0 : 1; - Error += glm::dvec2::length() == 2 ? 0 : 1; - - GLM_CONSTEXPR std::size_t Length = glm::vec2::length(); - Error += Length == 2 ? 0 : 1; - - return Error; -} - -static int test_operator_increment() -{ - int Error = 0; - - glm::ivec2 v0(1); - glm::ivec2 v1(v0); - glm::ivec2 v2(v0); - glm::ivec2 v3 = ++v1; - glm::ivec2 v4 = v2++; - - Error += glm::all(glm::equal(v0, v4)) ? 0 : 1; - Error += glm::all(glm::equal(v1, v2)) ? 0 : 1; - Error += glm::all(glm::equal(v1, v3)) ? 0 : 1; - - int i0(1); - int i1(i0); - int i2(i0); - int i3 = ++i1; - int i4 = i2++; - - Error += i0 == i4 ? 0 : 1; - Error += i1 == i2 ? 0 : 1; - Error += i1 == i3 ? 0 : 1; - - return Error; -} - -static int test_constexpr() -{ -#if GLM_HAS_CONSTEXPR - static_assert(glm::vec2::length() == 2, "GLM: Failed constexpr"); - static_assert(glm::vec2(1.0f).x > 0.0f, "GLM: Failed constexpr"); - static_assert(glm::vec2(1.0f, -1.0f).x > 0.0f, "GLM: Failed constexpr"); - static_assert(glm::vec2(1.0f, -1.0f).y < 0.0f, "GLM: Failed constexpr"); -#endif - - return 0; -} - -static int test_swizzle() -{ - int Error = 0; - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - { - glm::vec2 A = glm::vec2(1.0f, 2.0f); - glm::vec2 B = A.xy; - glm::vec2 C(A.xy); - glm::vec2 D(A.xy()); - - Error += glm::all(glm::equal(A, B, 0.0001f)) ? 0 : 1; - Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1; - Error += glm::all(glm::equal(A, D, 0.0001f)) ? 0 : 1; - } -# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION - { - glm::vec2 A = glm::vec2(1.0f, 2.0f); - glm::vec2 B = A.xy(); - glm::vec2 C(A.xy()); - - Error += glm::all(glm::equal(A, B, 0.0001f)) ? 0 : 1; - Error += glm::all(glm::equal(A, C, 0.0001f)) ? 0 : 1; - } -# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_size(); - Error += test_ctor(); - Error += test_operators(); - Error += test_operator_increment(); - Error += test_swizzle(); - Error += test_constexpr(); - - return Error; -} diff --git a/3rdparty/glm/source/test/core/core_type_vec3.cpp b/3rdparty/glm/source/test/core/core_type_vec3.cpp deleted file mode 100644 index 4da8187..0000000 --- a/3rdparty/glm/source/test/core/core_type_vec3.cpp +++ /dev/null @@ -1,628 +0,0 @@ -#define GLM_FORCE_SWIZZLE -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static glm::vec3 g1; -static glm::vec3 g2(1); -static glm::vec3 g3(1, 1, 1); - -int test_vec3_ctor() -{ - int Error = 0; - -# if GLM_HAS_TRIVIAL_QUERIES - // Error += std::is_trivially_default_constructible::value ? 0 : 1; - // Error += std::is_trivially_copy_assignable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - - Error += std::is_copy_constructible::value ? 0 : 1; -# endif - -# if GLM_HAS_INITIALIZER_LISTS - { - glm::vec3 a{ 0, 1, 2 }; - std::vector v = { - {0, 1, 2}, - {4, 5, 6}, - {8, 9, 0}}; - } - - { - glm::dvec3 a{ 0, 1, 2 }; - std::vector v = { - {0, 1, 2}, - {4, 5, 6}, - {8, 9, 0}}; - } -# endif - - { - glm::ivec3 A(1); - glm::ivec3 B(1, 1, 1); - - Error += A == B ? 0 : 1; - } - - { - std::vector Tests; - Tests.push_back(glm::ivec3(glm::ivec2(1, 2), 3)); - Tests.push_back(glm::ivec3(1, glm::ivec2(2, 3))); - Tests.push_back(glm::ivec3(1, 2, 3)); - Tests.push_back(glm::ivec3(glm::ivec4(1, 2, 3, 4))); - - for(std::size_t i = 0; i < Tests.size(); ++i) - Error += Tests[i] == glm::ivec3(1, 2, 3) ? 0 : 1; - } - - { - glm::vec1 const R(1.0f); - glm::vec1 const S(2.0f); - glm::vec1 const T(3.0f); - glm::vec3 const O(1.0f, 2.0f, 3.0f); - - glm::vec3 const A(R); - glm::vec3 const B(1.0f); - Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; - - glm::vec3 const C(R, S, T); - Error += glm::all(glm::equal(C, O, glm::epsilon())) ? 0 : 1; - - glm::vec3 const D(R, 2.0f, 3.0f); - Error += glm::all(glm::equal(D, O, glm::epsilon())) ? 0 : 1; - - glm::vec3 const E(1.0f, S, 3.0f); - Error += glm::all(glm::equal(E, O, glm::epsilon())) ? 0 : 1; - - glm::vec3 const F(1.0f, S, T); - Error += glm::all(glm::equal(F, O, glm::epsilon())) ? 0 : 1; - - glm::vec3 const G(R, 2.0f, T); - Error += glm::all(glm::equal(G, O, glm::epsilon())) ? 0 : 1; - - glm::vec3 const H(R, S, 3.0f); - Error += glm::all(glm::equal(H, O, glm::epsilon())) ? 0 : 1; - } - - { - glm::vec1 const R(1.0); - glm::dvec1 const S(2.0); - glm::vec1 const T(3.0); - glm::vec3 const O(1.0f, 2.0f, 3.0f); - - glm::vec3 const A(R); - glm::vec3 const B(1.0); - Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; - - glm::vec3 const C(R, S, T); - Error += glm::all(glm::equal(C, O, glm::epsilon())) ? 0 : 1; - - glm::vec3 const D(R, 2.0, 3.0); - Error += glm::all(glm::equal(D, O, glm::epsilon())) ? 0 : 1; - - glm::vec3 const E(1.0f, S, 3.0); - Error += glm::all(glm::equal(E, O, glm::epsilon())) ? 0 : 1; - - glm::vec3 const F(1.0, S, T); - Error += glm::all(glm::equal(F, O, glm::epsilon())) ? 0 : 1; - - glm::vec3 const G(R, 2.0, T); - Error += glm::all(glm::equal(G, O, glm::epsilon())) ? 0 : 1; - - glm::vec3 const H(R, S, 3.0); - Error += glm::all(glm::equal(H, O, glm::epsilon())) ? 0 : 1; - } - - return Error; -} - -float foo() -{ - glm::vec3 bar = glm::vec3(0.0f, 1.0f, 1.0f); - - return glm::length(bar); -} - -static int test_bvec3_ctor() -{ - int Error = 0; - - glm::bvec3 const A(true); - glm::bvec3 const B(true); - glm::bvec3 const C(false); - glm::bvec3 const D = A && B; - glm::bvec3 const E = A && C; - glm::bvec3 const F = A || C; - - Error += D == glm::bvec3(true) ? 0 : 1; - Error += E == glm::bvec3(false) ? 0 : 1; - Error += F == glm::bvec3(true) ? 0 : 1; - - bool const G = A == C; - bool const H = A != C; - Error += !G ? 0 : 1; - Error += H ? 0 : 1; - - return Error; -} - -static int test_vec3_operators() -{ - int Error = 0; - - { - glm::ivec3 A(1); - glm::ivec3 B(1); - bool R = A != B; - bool S = A == B; - - Error += (S && !R) ? 0 : 1; - } - - { - glm::vec3 const A(1.0f, 2.0f, 3.0f); - glm::vec3 const B(4.0f, 5.0f, 6.0f); - - glm::vec3 const C = A + B; - Error += glm::all(glm::equal(C, glm::vec3(5, 7, 9), glm::epsilon())) ? 0 : 1; - - glm::vec3 const D = B - A; - Error += glm::all(glm::equal(D, glm::vec3(3, 3, 3), glm::epsilon())) ? 0 : 1; - - glm::vec3 const E = A * B; - Error += glm::all(glm::equal(E, glm::vec3(4, 10, 18), glm::epsilon())) ? 0 : 1; - - glm::vec3 const F = B / A; - Error += glm::all(glm::equal(F, glm::vec3(4, 2.5, 2), glm::epsilon())) ? 0 : 1; - - glm::vec3 const G = A + 1.0f; - Error += glm::all(glm::equal(G, glm::vec3(2, 3, 4), glm::epsilon())) ? 0 : 1; - - glm::vec3 const H = B - 1.0f; - Error += glm::all(glm::equal(H, glm::vec3(3, 4, 5), glm::epsilon())) ? 0 : 1; - - glm::vec3 const I = A * 2.0f; - Error += glm::all(glm::equal(I, glm::vec3(2, 4, 6), glm::epsilon())) ? 0 : 1; - - glm::vec3 const J = B / 2.0f; - Error += glm::all(glm::equal(J, glm::vec3(2, 2.5, 3), glm::epsilon())) ? 0 : 1; - - glm::vec3 const K = 1.0f + A; - Error += glm::all(glm::equal(K, glm::vec3(2, 3, 4), glm::epsilon())) ? 0 : 1; - - glm::vec3 const L = 1.0f - B; - Error += glm::all(glm::equal(L, glm::vec3(-3, -4, -5), glm::epsilon())) ? 0 : 1; - - glm::vec3 const M = 2.0f * A; - Error += glm::all(glm::equal(M, glm::vec3(2, 4, 6), glm::epsilon())) ? 0 : 1; - - glm::vec3 const N = 2.0f / B; - Error += glm::all(glm::equal(N, glm::vec3(0.5, 2.0 / 5.0, 2.0 / 6.0), glm::epsilon())) ? 0 : 1; - } - - { - glm::ivec3 A(1.0f, 2.0f, 3.0f); - glm::ivec3 B(4.0f, 5.0f, 6.0f); - - A += B; - Error += A == glm::ivec3(5, 7, 9) ? 0 : 1; - - A += 1; - Error += A == glm::ivec3(6, 8, 10) ? 0 : 1; - } - { - glm::ivec3 A(1.0f, 2.0f, 3.0f); - glm::ivec3 B(4.0f, 5.0f, 6.0f); - - B -= A; - Error += B == glm::ivec3(3, 3, 3) ? 0 : 1; - - B -= 1; - Error += B == glm::ivec3(2, 2, 2) ? 0 : 1; - } - { - glm::ivec3 A(1.0f, 2.0f, 3.0f); - glm::ivec3 B(4.0f, 5.0f, 6.0f); - - A *= B; - Error += A == glm::ivec3(4, 10, 18) ? 0 : 1; - - A *= 2; - Error += A == glm::ivec3(8, 20, 36) ? 0 : 1; - } - { - glm::ivec3 A(1.0f, 2.0f, 3.0f); - glm::ivec3 B(4.0f, 4.0f, 6.0f); - - B /= A; - Error += B == glm::ivec3(4, 2, 2) ? 0 : 1; - - B /= 2; - Error += B == glm::ivec3(2, 1, 1) ? 0 : 1; - } - { - glm::ivec3 B(2); - - B /= B.y; - Error += B == glm::ivec3(1) ? 0 : 1; - } - - { - glm::ivec3 A(1.0f, 2.0f, 3.0f); - glm::ivec3 B = -A; - Error += B == glm::ivec3(-1.0f, -2.0f, -3.0f) ? 0 : 1; - } - - { - glm::ivec3 A(1.0f, 2.0f, 3.0f); - glm::ivec3 B = --A; - Error += B == glm::ivec3(0.0f, 1.0f, 2.0f) ? 0 : 1; - } - - { - glm::ivec3 A(1.0f, 2.0f, 3.0f); - glm::ivec3 B = A--; - Error += B == glm::ivec3(1.0f, 2.0f, 3.0f) ? 0 : 1; - Error += A == glm::ivec3(0.0f, 1.0f, 2.0f) ? 0 : 1; - } - - { - glm::ivec3 A(1.0f, 2.0f, 3.0f); - glm::ivec3 B = ++A; - Error += B == glm::ivec3(2.0f, 3.0f, 4.0f) ? 0 : 1; - } - - { - glm::ivec3 A(1.0f, 2.0f, 3.0f); - glm::ivec3 B = A++; - Error += B == glm::ivec3(1.0f, 2.0f, 3.0f) ? 0 : 1; - Error += A == glm::ivec3(2.0f, 3.0f, 4.0f) ? 0 : 1; - } - - return Error; -} - -int test_vec3_size() -{ - int Error = 0; - - Error += sizeof(glm::vec3) == sizeof(glm::lowp_vec3) ? 0 : 1; - Error += sizeof(glm::vec3) == sizeof(glm::mediump_vec3) ? 0 : 1; - Error += sizeof(glm::vec3) == sizeof(glm::highp_vec3) ? 0 : 1; - Error += 12 == sizeof(glm::mediump_vec3) ? 0 : 1; - Error += sizeof(glm::dvec3) == sizeof(glm::lowp_dvec3) ? 0 : 1; - Error += sizeof(glm::dvec3) == sizeof(glm::mediump_dvec3) ? 0 : 1; - Error += sizeof(glm::dvec3) == sizeof(glm::highp_dvec3) ? 0 : 1; - Error += 24 == sizeof(glm::highp_dvec3) ? 0 : 1; - Error += glm::vec3().length() == 3 ? 0 : 1; - Error += glm::dvec3().length() == 3 ? 0 : 1; - Error += glm::vec3::length() == 3 ? 0 : 1; - Error += glm::dvec3::length() == 3 ? 0 : 1; - - GLM_CONSTEXPR std::size_t Length = glm::vec3::length(); - Error += Length == 3 ? 0 : 1; - - return Error; -} - -int test_vec3_swizzle3_2() -{ - int Error = 0; - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - { - glm::ivec3 v(1, 2, 3); - glm::ivec2 u; - - // Can not assign a vec3 swizzle to a vec2 - //u = v.xyz; //Illegal - //u = v.rgb; //Illegal - //u = v.stp; //Illegal - - u = v.xx; Error += (u.x == 1 && u.y == 1) ? 0 : 1; - u = v.xy; Error += (u.x == 1 && u.y == 2) ? 0 : 1; - u = v.xz; Error += (u.x == 1 && u.y == 3) ? 0 : 1; - u = v.yx; Error += (u.x == 2 && u.y == 1) ? 0 : 1; - u = v.yy; Error += (u.x == 2 && u.y == 2) ? 0 : 1; - u = v.yz; Error += (u.x == 2 && u.y == 3) ? 0 : 1; - u = v.zx; Error += (u.x == 3 && u.y == 1) ? 0 : 1; - u = v.zy; Error += (u.x == 3 && u.y == 2) ? 0 : 1; - u = v.zz; Error += (u.x == 3 && u.y == 3) ? 0 : 1; - - u = v.rr; Error += (u.r == 1 && u.g == 1) ? 0 : 1; - u = v.rg; Error += (u.r == 1 && u.g == 2) ? 0 : 1; - u = v.rb; Error += (u.r == 1 && u.g == 3) ? 0 : 1; - u = v.gr; Error += (u.r == 2 && u.g == 1) ? 0 : 1; - u = v.gg; Error += (u.r == 2 && u.g == 2) ? 0 : 1; - u = v.gb; Error += (u.r == 2 && u.g == 3) ? 0 : 1; - u = v.br; Error += (u.r == 3 && u.g == 1) ? 0 : 1; - u = v.bg; Error += (u.r == 3 && u.g == 2) ? 0 : 1; - u = v.bb; Error += (u.r == 3 && u.g == 3) ? 0 : 1; - - u = v.ss; Error += (u.s == 1 && u.t == 1) ? 0 : 1; - u = v.st; Error += (u.s == 1 && u.t == 2) ? 0 : 1; - u = v.sp; Error += (u.s == 1 && u.t == 3) ? 0 : 1; - u = v.ts; Error += (u.s == 2 && u.t == 1) ? 0 : 1; - u = v.tt; Error += (u.s == 2 && u.t == 2) ? 0 : 1; - u = v.tp; Error += (u.s == 2 && u.t == 3) ? 0 : 1; - u = v.ps; Error += (u.s == 3 && u.t == 1) ? 0 : 1; - u = v.pt; Error += (u.s == 3 && u.t == 2) ? 0 : 1; - u = v.pp; Error += (u.s == 3 && u.t == 3) ? 0 : 1; - // Mixed member aliases are not valid - //u = v.rx; //Illegal - //u = v.sy; //Illegal - - u = glm::ivec2(1, 2); - v = glm::ivec3(1, 2, 3); - //v.xx = u; //Illegal - v.xy = u; Error += (v.x == 1 && v.y == 2 && v.z == 3) ? 0 : 1; - v.xz = u; Error += (v.x == 1 && v.y == 2 && v.z == 2) ? 0 : 1; - v.yx = u; Error += (v.x == 2 && v.y == 1 && v.z == 2) ? 0 : 1; - //v.yy = u; //Illegal - v.yz = u; Error += (v.x == 2 && v.y == 1 && v.z == 2) ? 0 : 1; - v.zx = u; Error += (v.x == 2 && v.y == 1 && v.z == 1) ? 0 : 1; - v.zy = u; Error += (v.x == 2 && v.y == 2 && v.z == 1) ? 0 : 1; - //v.zz = u; //Illegal - } -# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - - return Error; -} - -int test_vec3_swizzle3_3() -{ - int Error = 0; - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - { - glm::ivec3 v(1, 2, 3); - glm::ivec3 u; - - u = v; Error += (u.x == 1 && u.y == 2 && u.z == 3) ? 0 : 1; - - u = v.xyz; Error += (u.x == 1 && u.y == 2 && u.z == 3) ? 0 : 1; - u = v.zyx; Error += (u.x == 3 && u.y == 2 && u.z == 1) ? 0 : 1; - u.zyx = v; Error += (u.x == 3 && u.y == 2 && u.z == 1) ? 0 : 1; - - u = v.rgb; Error += (u.x == 1 && u.y == 2 && u.z == 3) ? 0 : 1; - u = v.bgr; Error += (u.x == 3 && u.y == 2 && u.z == 1) ? 0 : 1; - u.bgr = v; Error += (u.x == 3 && u.y == 2 && u.z == 1) ? 0 : 1; - - u = v.stp; Error += (u.x == 1 && u.y == 2 && u.z == 3) ? 0 : 1; - u = v.pts; Error += (u.x == 3 && u.y == 2 && u.z == 1) ? 0 : 1; - u.pts = v; Error += (u.x == 3 && u.y == 2 && u.z == 1) ? 0 : 1; - } -# endif//GLM_LANG - - return Error; -} - -int test_vec3_swizzle_operators() -{ - int Error = 0; - - glm::ivec3 const u = glm::ivec3(1, 2, 3); - glm::ivec3 const v = glm::ivec3(10, 20, 30); - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - { - glm::ivec3 q; - - // Swizzle, swizzle binary operators - q = u.xyz + v.xyz; Error += (q == (u + v)) ? 0 : 1; - q = (u.zyx + v.zyx).zyx; Error += (q == (u + v)) ? 0 : 1; - q = (u.xyz - v.xyz); Error += (q == (u - v)) ? 0 : 1; - q = (u.xyz * v.xyz); Error += (q == (u * v)) ? 0 : 1; - q = (u.xxx * v.xxx); Error += (q == glm::ivec3(u.x * v.x)) ? 0 : 1; - q = (u.xyz / v.xyz); Error += (q == (u / v)) ? 0 : 1; - - // vec, swizzle binary operators - q = u + v.xyz; Error += (q == (u + v)) ? 0 : 1; - q = (u - v.xyz); Error += (q == (u - v)) ? 0 : 1; - q = (u * v.xyz); Error += (q == (u * v)) ? 0 : 1; - q = (u * v.xxx); Error += (q == v.x * u) ? 0 : 1; - q = (u / v.xyz); Error += (q == (u / v)) ? 0 : 1; - - // swizzle,vec binary operators - q = u.xyz + v; Error += (q == (u + v)) ? 0 : 1; - q = (u.xyz - v); Error += (q == (u - v)) ? 0 : 1; - q = (u.xyz * v); Error += (q == (u * v)) ? 0 : 1; - q = (u.xxx * v); Error += (q == u.x * v) ? 0 : 1; - q = (u.xyz / v); Error += (q == (u / v)) ? 0 : 1; - } -# endif//GLM_LANG - - // Compile errors - //q = (u.yz * v.xyz); - //q = (u * v.xy); - - return Error; -} - -int test_vec3_swizzle_functions() -{ - int Error = 0; - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION - { - // NOTE: template functions cannot pick up the implicit conversion from - // a swizzle to the unswizzled type, therefore the operator() must be - // used. E.g.: - // - // glm::dot(u.xy, v.xy); <--- Compile error - // glm::dot(u.xy(), v.xy()); <--- Compiles correctly - - float r; - - // vec2 - glm::vec2 a(1, 2); - glm::vec2 b(10, 20); - r = glm::dot(a, b); Error += (int(r) == 50) ? 0 : 1; - r = glm::dot(glm::vec2(a.xy()), glm::vec2(b.xy())); Error += (int(r) == 50) ? 0 : 1; - r = glm::dot(glm::vec2(a.xy()), glm::vec2(b.yy())); Error += (int(r) == 60) ? 0 : 1; - - // vec3 - glm::vec3 u = glm::vec3(1, 2, 3); - glm::vec3 v = glm::vec3(10, 20, 30); - r = glm::dot(u, v); Error += (int(r) == 140) ? 0 : 1; - r = glm::dot(u.xyz(), v.zyz()); Error += (int(r) == 160) ? 0 : 1; - r = glm::dot(u, v.zyx()); Error += (int(r) == 100) ? 0 : 1; - r = glm::dot(u.xyz(), v); Error += (int(r) == 140) ? 0 : 1; - r = glm::dot(u.xy(), v.xy()); Error += (int(r) == 50) ? 0 : 1; - - // vec4 - glm::vec4 s = glm::vec4(1, 2, 3, 4); - glm::vec4 t = glm::vec4(10, 20, 30, 40); - r = glm::dot(s, t); Error += (int(r) == 300) ? 0 : 1; - r = glm::dot(s.xyzw(), t.xyzw()); Error += (int(r) == 300) ? 0 : 1; - r = glm::dot(s.xyz(), t.xyz()); Error += (int(r) == 140) ? 0 : 1; - } -# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION - - return Error; -} - -int test_vec3_swizzle_partial() -{ - int Error = 0; - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - { - glm::vec3 const A(1, 2, 3); - glm::vec3 B(A.xy, 3); - Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; - } - - { - glm::ivec3 const A(1, 2, 3); - glm::ivec3 const B(1, A.yz); - Error += A == B ? 0 : 1; - } - - { - glm::ivec3 const A(1, 2, 3); - glm::ivec3 const B(A.xyz); - Error += A == B ? 0 : 1; - } -# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - - return Error; -} - -static int test_operator_increment() -{ - int Error = 0; - - glm::ivec3 v0(1); - glm::ivec3 v1(v0); - glm::ivec3 v2(v0); - glm::ivec3 v3 = ++v1; - glm::ivec3 v4 = v2++; - - Error += glm::all(glm::equal(v0, v4)) ? 0 : 1; - Error += glm::all(glm::equal(v1, v2)) ? 0 : 1; - Error += glm::all(glm::equal(v1, v3)) ? 0 : 1; - - int i0(1); - int i1(i0); - int i2(i0); - int i3 = ++i1; - int i4 = i2++; - - Error += i0 == i4 ? 0 : 1; - Error += i1 == i2 ? 0 : 1; - Error += i1 == i3 ? 0 : 1; - - return Error; -} - -static int test_swizzle() -{ - int Error = 0; - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - { - glm::vec3 A = glm::vec3(1.0f, 2.0f, 3.0f); - glm::vec3 B = A.xyz; - glm::vec3 C(A.xyz); - glm::vec3 D(A.xyz()); - glm::vec3 E(A.x, A.yz); - glm::vec3 F(A.x, A.yz()); - glm::vec3 G(A.xy, A.z); - glm::vec3 H(A.xy(), A.z); - - Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, C, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, D, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, E, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, F, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, G, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, H, glm::epsilon())) ? 0 : 1; - } -# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION - { - glm::vec3 A = glm::vec3(1.0f, 2.0f, 3.0f); - glm::vec3 B = A.xyz(); - glm::vec3 C(A.xyz()); - glm::vec3 D(A.xyz()); - glm::vec3 E(A.x, A.yz()); - glm::vec3 F(A.x, A.yz()); - glm::vec3 G(A.xy(), A.z); - glm::vec3 H(A.xy(), A.z); - - Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, C, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, D, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, E, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, F, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, G, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, H, glm::epsilon())) ? 0 : 1; - } -# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION - - return Error; -} - -static int test_constexpr() -{ -#if GLM_HAS_CONSTEXPR - static_assert(glm::vec3::length() == 3, "GLM: Failed constexpr"); - static_assert(glm::vec3(1.0f).x > 0.0f, "GLM: Failed constexpr"); - static_assert(glm::vec3(1.0f, -1.0f, -1.0f).x > 0.0f, "GLM: Failed constexpr"); - static_assert(glm::vec3(1.0f, -1.0f, -1.0f).y < 0.0f, "GLM: Failed constexpr"); -#endif - - return 0; -} - -int main() -{ - int Error = 0; - - Error += test_vec3_ctor(); - Error += test_bvec3_ctor(); - Error += test_vec3_operators(); - Error += test_vec3_size(); - Error += test_operator_increment(); - Error += test_constexpr(); - - Error += test_swizzle(); - Error += test_vec3_swizzle3_2(); - Error += test_vec3_swizzle3_3(); - Error += test_vec3_swizzle_partial(); - Error += test_vec3_swizzle_operators(); - Error += test_vec3_swizzle_functions(); - - return Error; -} diff --git a/3rdparty/glm/source/test/core/core_type_vec4.cpp b/3rdparty/glm/source/test/core/core_type_vec4.cpp deleted file mode 100644 index 5d65259..0000000 --- a/3rdparty/glm/source/test/core/core_type_vec4.cpp +++ /dev/null @@ -1,850 +0,0 @@ -#define GLM_FORCE_SWIZZLE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static glm::vec4 g1; -static glm::vec4 g2(1); -static glm::vec4 g3(1, 1, 1, 1); - -template -struct mask -{ - enum{value = Value}; -}; - -enum comp -{ - X, - Y, - Z, - W -}; - -//template -//__m128 swizzle(glm::vec4 const& v) -//{ -// __m128 Src = _mm_set_ps(v.w, v.z, v.y, v.x); -// return _mm_shuffle_ps(Src, Src, mask<(int(W) << 6) | (int(Z) << 4) | (int(Y) << 2) | (int(X) << 0)>::value); -//} - -static int test_vec4_ctor() -{ - int Error = 0; - - { - glm::ivec4 A(1, 2, 3, 4); - glm::ivec4 B(A); - Error += glm::all(glm::equal(A, B)) ? 0 : 1; - } - -# if GLM_HAS_TRIVIAL_QUERIES - // Error += std::is_trivially_default_constructible::value ? 0 : 1; - // Error += std::is_trivially_copy_assignable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - - Error += std::is_copy_constructible::value ? 0 : 1; -# endif - -#if GLM_HAS_INITIALIZER_LISTS - { - glm::vec4 a{ 0, 1, 2, 3 }; - std::vector v = { - {0, 1, 2, 3}, - {4, 5, 6, 7}, - {8, 9, 0, 1}}; - } - - { - glm::dvec4 a{ 0, 1, 2, 3 }; - std::vector v = { - {0, 1, 2, 3}, - {4, 5, 6, 7}, - {8, 9, 0, 1}}; - } -#endif - - { - glm::ivec4 const A(1); - glm::ivec4 const B(1, 1, 1, 1); - - Error += A == B ? 0 : 1; - } - - { - std::vector Tests; - Tests.push_back(glm::ivec4(glm::ivec2(1, 2), 3, 4)); - Tests.push_back(glm::ivec4(1, glm::ivec2(2, 3), 4)); - Tests.push_back(glm::ivec4(1, 2, glm::ivec2(3, 4))); - Tests.push_back(glm::ivec4(glm::ivec3(1, 2, 3), 4)); - Tests.push_back(glm::ivec4(1, glm::ivec3(2, 3, 4))); - Tests.push_back(glm::ivec4(glm::ivec2(1, 2), glm::ivec2(3, 4))); - Tests.push_back(glm::ivec4(1, 2, 3, 4)); - Tests.push_back(glm::ivec4(glm::ivec4(1, 2, 3, 4))); - - for(std::size_t i = 0; i < Tests.size(); ++i) - Error += Tests[i] == glm::ivec4(1, 2, 3, 4) ? 0 : 1; - } - - { - glm::vec1 const R(1.0f); - glm::vec1 const S(2.0f); - glm::vec1 const T(3.0f); - glm::vec1 const U(4.0f); - glm::vec4 const O(1.0f, 2.0f, 3.0f, 4.0f); - - glm::vec4 const A(R); - glm::vec4 const B(1.0f); - Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; - - glm::vec4 const C(R, S, T, U); - Error += glm::all(glm::equal(C, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const D(R, 2.0f, 3.0f, 4.0f); - Error += glm::all(glm::equal(D, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const E(1.0f, S, 3.0f, 4.0f); - Error += glm::all(glm::equal(E, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const F(R, S, 3.0f, 4.0f); - Error += glm::all(glm::equal(F, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const G(1.0f, 2.0f, T, 4.0f); - Error += glm::all(glm::equal(G, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const H(R, 2.0f, T, 4.0f); - Error += glm::all(glm::equal(H, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const I(1.0f, S, T, 4.0f); - Error += glm::all(glm::equal(I, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const J(R, S, T, 4.0f); - Error += glm::all(glm::equal(J, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const K(R, 2.0f, 3.0f, U); - Error += glm::all(glm::equal(K, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const L(1.0f, S, 3.0f, U); - Error += glm::all(glm::equal(L, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const M(R, S, 3.0f, U); - Error += glm::all(glm::equal(M, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const N(1.0f, 2.0f, T, U); - Error += glm::all(glm::equal(N, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const P(R, 2.0f, T, U); - Error += glm::all(glm::equal(P, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const Q(1.0f, S, T, U); - Error += glm::all(glm::equal(Q, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const V(R, S, T, U); - Error += glm::all(glm::equal(V, O, glm::epsilon())) ? 0 : 1; - } - - { - glm::vec1 const R(1.0f); - glm::dvec1 const S(2.0); - glm::vec1 const T(3.0); - glm::dvec1 const U(4.0); - glm::vec4 const O(1.0f, 2.0, 3.0f, 4.0); - - glm::vec4 const A(R); - glm::vec4 const B(1.0); - Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; - - glm::vec4 const C(R, S, T, U); - Error += glm::all(glm::equal(C, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const D(R, 2.0f, 3.0, 4.0f); - Error += glm::all(glm::equal(D, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const E(1.0, S, 3.0f, 4.0); - Error += glm::all(glm::equal(E, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const F(R, S, 3.0, 4.0f); - Error += glm::all(glm::equal(F, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const G(1.0f, 2.0, T, 4.0); - Error += glm::all(glm::equal(G, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const H(R, 2.0, T, 4.0); - Error += glm::all(glm::equal(H, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const I(1.0, S, T, 4.0f); - Error += glm::all(glm::equal(I, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const J(R, S, T, 4.0f); - Error += glm::all(glm::equal(J, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const K(R, 2.0f, 3.0, U); - Error += glm::all(glm::equal(K, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const L(1.0f, S, 3.0, U); - Error += glm::all(glm::equal(L, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const M(R, S, 3.0, U); - Error += glm::all(glm::equal(M, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const N(1.0f, 2.0, T, U); - Error += glm::all(glm::equal(N, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const P(R, 2.0, T, U); - Error += glm::all(glm::equal(P, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const Q(1.0f, S, T, U); - Error += glm::all(glm::equal(Q, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const V(R, S, T, U); - Error += glm::all(glm::equal(V, O, glm::epsilon())) ? 0 : 1; - } - - { - glm::vec1 const v1_0(1.0f); - glm::vec1 const v1_1(2.0f); - glm::vec1 const v1_2(3.0f); - glm::vec1 const v1_3(4.0f); - - glm::vec2 const v2_0(1.0f, 2.0f); - glm::vec2 const v2_1(2.0f, 3.0f); - glm::vec2 const v2_2(3.0f, 4.0f); - - glm::vec3 const v3_0(1.0f, 2.0f, 3.0f); - glm::vec3 const v3_1(2.0f, 3.0f, 4.0f); - - glm::vec4 const O(1.0f, 2.0, 3.0f, 4.0); - - glm::vec4 const A(v1_0, v1_1, v2_2); - Error += glm::all(glm::equal(A, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const B(1.0f, 2.0f, v2_2); - Error += glm::all(glm::equal(B, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const C(v1_0, 2.0f, v2_2); - Error += glm::all(glm::equal(C, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const D(1.0f, v1_1, v2_2); - Error += glm::all(glm::equal(D, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const E(v2_0, v1_2, v1_3); - Error += glm::all(glm::equal(E, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const F(v2_0, 3.0, v1_3); - Error += glm::all(glm::equal(F, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const G(v2_0, v1_2, 4.0); - Error += glm::all(glm::equal(G, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const H(v2_0, 3.0f, 4.0); - Error += glm::all(glm::equal(H, O, glm::epsilon())) ? 0 : 1; - } - - { - glm::vec1 const v1_0(1.0f); - glm::vec1 const v1_1(2.0f); - glm::vec1 const v1_2(3.0f); - glm::vec1 const v1_3(4.0f); - - glm::vec2 const v2(2.0f, 3.0f); - - glm::vec4 const O(1.0f, 2.0, 3.0f, 4.0); - - glm::vec4 const A(v1_0, v2, v1_3); - Error += glm::all(glm::equal(A, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const B(v1_0, v2, 4.0); - Error += glm::all(glm::equal(B, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const C(1.0, v2, v1_3); - Error += glm::all(glm::equal(C, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const D(1.0f, v2, 4.0); - Error += glm::all(glm::equal(D, O, glm::epsilon())) ? 0 : 1; - - glm::vec4 const E(1.0, v2, 4.0f); - Error += glm::all(glm::equal(E, O, glm::epsilon())) ? 0 : 1; - } - - return Error; -} - -static int test_bvec4_ctor() -{ - int Error = 0; - - glm::bvec4 const A(true); - glm::bvec4 const B(true); - glm::bvec4 const C(false); - glm::bvec4 const D = A && B; - glm::bvec4 const E = A && C; - glm::bvec4 const F = A || C; - - Error += D == glm::bvec4(true) ? 0 : 1; - Error += E == glm::bvec4(false) ? 0 : 1; - Error += F == glm::bvec4(true) ? 0 : 1; - - bool const G = A == C; - bool const H = A != C; - Error += !G ? 0 : 1; - Error += H ? 0 : 1; - - return Error; -} - -static int test_operators() -{ - int Error = 0; - - { - glm::ivec4 A(1); - glm::ivec4 B(1); - bool R = A != B; - bool S = A == B; - - Error += (S && !R) ? 0 : 1; - } - - { - glm::vec4 const A(1.0f, 2.0f, 3.0f, 4.0f); - glm::vec4 const B(4.0f, 5.0f, 6.0f, 7.0f); - - glm::vec4 const C = A + B; - Error += glm::all(glm::equal(C, glm::vec4(5, 7, 9, 11), glm::epsilon())) ? 0 : 1; - - glm::vec4 const D = B - A; - Error += glm::all(glm::equal(D, glm::vec4(3, 3, 3, 3), glm::epsilon())) ? 0 : 1; - - glm::vec4 const E = A * B; - Error += glm::all(glm::equal(E, glm::vec4(4, 10, 18, 28), glm::epsilon()) )? 0 : 1; - - glm::vec4 const F = B / A; - Error += glm::all(glm::equal(F, glm::vec4(4, 2.5, 2, 7.0f / 4.0f), glm::epsilon())) ? 0 : 1; - - glm::vec4 const G = A + 1.0f; - Error += glm::all(glm::equal(G, glm::vec4(2, 3, 4, 5), glm::epsilon())) ? 0 : 1; - - glm::vec4 const H = B - 1.0f; - Error += glm::all(glm::equal(H, glm::vec4(3, 4, 5, 6), glm::epsilon())) ? 0 : 1; - - glm::vec4 const I = A * 2.0f; - Error += glm::all(glm::equal(I, glm::vec4(2, 4, 6, 8), glm::epsilon())) ? 0 : 1; - - glm::vec4 const J = B / 2.0f; - Error += glm::all(glm::equal(J, glm::vec4(2, 2.5, 3, 3.5), glm::epsilon())) ? 0 : 1; - - glm::vec4 const K = 1.0f + A; - Error += glm::all(glm::equal(K, glm::vec4(2, 3, 4, 5), glm::epsilon())) ? 0 : 1; - - glm::vec4 const L = 1.0f - B; - Error += glm::all(glm::equal(L, glm::vec4(-3, -4, -5, -6), glm::epsilon())) ? 0 : 1; - - glm::vec4 const M = 2.0f * A; - Error += glm::all(glm::equal(M, glm::vec4(2, 4, 6, 8), glm::epsilon())) ? 0 : 1; - - glm::vec4 const N = 2.0f / B; - Error += glm::all(glm::equal(N, glm::vec4(0.5, 2.0 / 5.0, 2.0 / 6.0, 2.0 / 7.0), glm::epsilon())) ? 0 : 1; - } - - { - glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); - glm::ivec4 B(4.0f, 5.0f, 6.0f, 7.0f); - - A += B; - Error += A == glm::ivec4(5, 7, 9, 11) ? 0 : 1; - - A += 1; - Error += A == glm::ivec4(6, 8, 10, 12) ? 0 : 1; - } - { - glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); - glm::ivec4 B(4.0f, 5.0f, 6.0f, 7.0f); - - B -= A; - Error += B == glm::ivec4(3, 3, 3, 3) ? 0 : 1; - - B -= 1; - Error += B == glm::ivec4(2, 2, 2, 2) ? 0 : 1; - } - { - glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); - glm::ivec4 B(4.0f, 5.0f, 6.0f, 7.0f); - - A *= B; - Error += A == glm::ivec4(4, 10, 18, 28) ? 0 : 1; - - A *= 2; - Error += A == glm::ivec4(8, 20, 36, 56) ? 0 : 1; - } - { - glm::ivec4 A(1.0f, 2.0f, 2.0f, 4.0f); - glm::ivec4 B(4.0f, 4.0f, 8.0f, 8.0f); - - B /= A; - Error += B == glm::ivec4(4, 2, 4, 2) ? 0 : 1; - - B /= 2; - Error += B == glm::ivec4(2, 1, 2, 1) ? 0 : 1; - } - { - glm::ivec4 B(2); - - B /= B.y; - Error += B == glm::ivec4(1) ? 0 : 1; - } - - { - glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); - glm::ivec4 B = -A; - Error += B == glm::ivec4(-1.0f, -2.0f, -3.0f, -4.0f) ? 0 : 1; - } - - { - glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); - glm::ivec4 B = --A; - Error += B == glm::ivec4(0.0f, 1.0f, 2.0f, 3.0f) ? 0 : 1; - } - - { - glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); - glm::ivec4 B = A--; - Error += B == glm::ivec4(1.0f, 2.0f, 3.0f, 4.0f) ? 0 : 1; - Error += A == glm::ivec4(0.0f, 1.0f, 2.0f, 3.0f) ? 0 : 1; - } - - { - glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); - glm::ivec4 B = ++A; - Error += B == glm::ivec4(2.0f, 3.0f, 4.0f, 5.0f) ? 0 : 1; - } - - { - glm::ivec4 A(1.0f, 2.0f, 3.0f, 4.0f); - glm::ivec4 B = A++; - Error += B == glm::ivec4(1.0f, 2.0f, 3.0f, 4.0f) ? 0 : 1; - Error += A == glm::ivec4(2.0f, 3.0f, 4.0f, 5.0f) ? 0 : 1; - } - - return Error; -} - -static int test_equal() -{ - int Error = 0; - - { - glm::uvec4 const A(1, 2, 3, 4); - glm::uvec4 const B(1, 2, 3, 4); - Error += A == B ? 0 : 1; - Error += A != B ? 1 : 0; - } - - { - glm::ivec4 const A(1, 2, 3, 4); - glm::ivec4 const B(1, 2, 3, 4); - Error += A == B ? 0 : 1; - Error += A != B ? 1 : 0; - } - - return Error; -} - -static int test_size() -{ - int Error = 0; - - Error += sizeof(glm::vec4) == sizeof(glm::lowp_vec4) ? 0 : 1; - Error += sizeof(glm::vec4) == sizeof(glm::mediump_vec4) ? 0 : 1; - Error += sizeof(glm::vec4) == sizeof(glm::highp_vec4) ? 0 : 1; - Error += 16 == sizeof(glm::mediump_vec4) ? 0 : 1; - Error += sizeof(glm::dvec4) == sizeof(glm::lowp_dvec4) ? 0 : 1; - Error += sizeof(glm::dvec4) == sizeof(glm::mediump_dvec4) ? 0 : 1; - Error += sizeof(glm::dvec4) == sizeof(glm::highp_dvec4) ? 0 : 1; - Error += 32 == sizeof(glm::highp_dvec4) ? 0 : 1; - Error += glm::vec4().length() == 4 ? 0 : 1; - Error += glm::dvec4().length() == 4 ? 0 : 1; - Error += glm::vec4::length() == 4 ? 0 : 1; - Error += glm::dvec4::length() == 4 ? 0 : 1; - - return Error; -} - -static int test_swizzle_partial() -{ - int Error = 0; - - glm::vec4 const A(1, 2, 3, 4); - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - { - glm::vec4 B(A.xy, A.zw); - Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; - } - { - glm::vec4 B(A.xy, 3.0f, 4.0f); - Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; - } - { - glm::vec4 B(1.0f, A.yz, 4.0f); - Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; - } - { - glm::vec4 B(1.0f, 2.0f, A.zw); - Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; - } - - { - glm::vec4 B(A.xyz, 4.0f); - Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; - } - { - glm::vec4 B(1.0f, A.yzw); - Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; - } -# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION - - return Error; -} - -static int test_swizzle() -{ - int Error = 0; - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - { - glm::ivec4 A = glm::ivec4(1.0f, 2.0f, 3.0f, 4.0f); - glm::ivec4 B = A.xyzw; - glm::ivec4 C(A.xyzw); - glm::ivec4 D(A.xyzw()); - glm::ivec4 E(A.x, A.yzw); - glm::ivec4 F(A.x, A.yzw()); - glm::ivec4 G(A.xyz, A.w); - glm::ivec4 H(A.xyz(), A.w); - glm::ivec4 I(A.xy, A.zw); - glm::ivec4 J(A.xy(), A.zw()); - glm::ivec4 K(A.x, A.y, A.zw); - glm::ivec4 L(A.x, A.yz, A.w); - glm::ivec4 M(A.xy, A.z, A.w); - - Error += glm::all(glm::equal(A, B)) ? 0 : 1; - Error += glm::all(glm::equal(A, C)) ? 0 : 1; - Error += glm::all(glm::equal(A, D)) ? 0 : 1; - Error += glm::all(glm::equal(A, E)) ? 0 : 1; - Error += glm::all(glm::equal(A, F)) ? 0 : 1; - Error += glm::all(glm::equal(A, G)) ? 0 : 1; - Error += glm::all(glm::equal(A, H)) ? 0 : 1; - Error += glm::all(glm::equal(A, I)) ? 0 : 1; - Error += glm::all(glm::equal(A, J)) ? 0 : 1; - Error += glm::all(glm::equal(A, K)) ? 0 : 1; - Error += glm::all(glm::equal(A, L)) ? 0 : 1; - Error += glm::all(glm::equal(A, M)) ? 0 : 1; - } -# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR - -# if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION - { - glm::vec4 A = glm::vec4(1.0f, 2.0f, 3.0f, 4.0f); - glm::vec4 B = A.xyzw(); - glm::vec4 C(A.xyzw()); - glm::vec4 D(A.xyzw()); - glm::vec4 E(A.x, A.yzw()); - glm::vec4 F(A.x, A.yzw()); - glm::vec4 G(A.xyz(), A.w); - glm::vec4 H(A.xyz(), A.w); - glm::vec4 I(A.xy(), A.zw()); - glm::vec4 J(A.xy(), A.zw()); - glm::vec4 K(A.x, A.y, A.zw()); - glm::vec4 L(A.x, A.yz(), A.w); - glm::vec4 M(A.xy(), A.z, A.w); - - Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, C, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, D, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, E, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, F, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, G, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, H, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, I, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, J, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, K, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, L, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(A, M, glm::epsilon())) ? 0 : 1; - } -# endif//GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR || GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_FUNCTION - - return Error; -} - -static int test_operator_increment() -{ - int Error = 0; - - glm::ivec4 v0(1); - glm::ivec4 v1(v0); - glm::ivec4 v2(v0); - glm::ivec4 v3 = ++v1; - glm::ivec4 v4 = v2++; - - Error += glm::all(glm::equal(v0, v4)) ? 0 : 1; - Error += glm::all(glm::equal(v1, v2)) ? 0 : 1; - Error += glm::all(glm::equal(v1, v3)) ? 0 : 1; - - int i0(1); - int i1(i0); - int i2(i0); - int i3 = ++i1; - int i4 = i2++; - - Error += i0 == i4 ? 0 : 1; - Error += i1 == i2 ? 0 : 1; - Error += i1 == i3 ? 0 : 1; - - return Error; -} - -struct AoS -{ - glm::vec4 A; - glm::vec3 B; - glm::vec3 C; - glm::vec2 D; -}; - -static int test_perf_AoS(std::size_t Size) -{ - int Error = 0; - - std::vector In; - std::vector Out; - In.resize(Size); - Out.resize(Size); - - std::clock_t StartTime = std::clock(); - - for(std::size_t i = 0; i < In.size(); ++i) - Out[i] = In[i]; - - std::clock_t EndTime = std::clock(); - - std::printf("AoS: %d\n", static_cast(EndTime - StartTime)); - - return Error; -} - -static int test_perf_SoA(std::size_t Size) -{ - int Error = 0; - - std::vector InA; - std::vector InB; - std::vector InC; - std::vector InD; - std::vector OutA; - std::vector OutB; - std::vector OutC; - std::vector OutD; - - InA.resize(Size); - InB.resize(Size); - InC.resize(Size); - InD.resize(Size); - OutA.resize(Size); - OutB.resize(Size); - OutC.resize(Size); - OutD.resize(Size); - - std::clock_t StartTime = std::clock(); - - for(std::size_t i = 0; i < InA.size(); ++i) - { - OutA[i] = InA[i]; - OutB[i] = InB[i]; - OutC[i] = InC[i]; - OutD[i] = InD[i]; - } - - std::clock_t EndTime = std::clock(); - - std::printf("SoA: %d\n", static_cast(EndTime - StartTime)); - - return Error; -} - -namespace heap -{ - struct A - { - float f; - }; - - struct B : public A - { - float g; - glm::vec4 v; - }; - - static int test() - { - int Error = 0; - - A* p = new B; - p->f = 0.0f; - delete p; - - Error += sizeof(B) == sizeof(glm::vec4) + sizeof(float) * 2 ? 0 : 1; - - return Error; - } -}//namespace heap - -static int test_simd() -{ - int Error = 0; - - glm::vec4 const a(std::clock(), std::clock(), std::clock(), std::clock()); - glm::vec4 const b(std::clock(), std::clock(), std::clock(), std::clock()); - - glm::vec4 const c(b * a); - glm::vec4 const d(a + c); - - Error += glm::all(glm::greaterThanEqual(d, glm::vec4(0))) ? 0 : 1; - - return Error; -} - -static int test_inheritance() -{ - struct my_vec4 : public glm::vec4 - { - my_vec4() - : glm::vec4(76.f, 75.f, 74.f, 73.f) - , member(82) - {} - - int member; - }; - - int Error = 0; - - my_vec4 v; - - Error += v.member == 82 ? 0 : 1; - Error += glm::equal(v.x, 76.f, glm::epsilon()) ? 0 : 1; - Error += glm::equal(v.y, 75.f, glm::epsilon()) ? 0 : 1; - Error += glm::equal(v.z, 74.f, glm::epsilon()) ? 0 : 1; - Error += glm::equal(v.w, 73.f, glm::epsilon()) ? 0 : 1; - - return Error; -} - -static int test_constexpr() -{ -#if GLM_HAS_CONSTEXPR - static_assert(glm::vec4::length() == 4, "GLM: Failed constexpr"); - static_assert(glm::vec4(1.0f).x > 0.0f, "GLM: Failed constexpr"); - static_assert(glm::vec4(1.0f, -1.0f, -1.0f, -1.0f).x > 0.0f, "GLM: Failed constexpr"); - static_assert(glm::vec4(1.0f, -1.0f, -1.0f, -1.0f).y < 0.0f, "GLM: Failed constexpr"); -#endif - - return 0; -} -/* -static int test_simd_gen() -{ - int Error = 0; - - int const C = static_cast(std::clock()); - int const D = static_cast(std::clock()); - - glm::ivec4 const A(C); - glm::ivec4 const B(D); - - Error += A != B ? 0 : 1; - - return Error; -} -*/ -int main() -{ - int Error = 0; - - //Error += test_simd_gen(); - -/* - { - glm::ivec4 const a1(2); - glm::ivec4 const b1 = a1 >> 1; - - __m128i const e1 = _mm_set1_epi32(2); - __m128i const f1 = _mm_srli_epi32(e1, 1); - - glm::ivec4 const g1 = *reinterpret_cast(&f1); - - glm::ivec4 const a2(-2); - glm::ivec4 const b2 = a2 >> 1; - - __m128i const e2 = _mm_set1_epi32(-1); - __m128i const f2 = _mm_srli_epi32(e2, 1); - - glm::ivec4 const g2 = *reinterpret_cast(&f2); - - std::printf("GNI\n"); - } - - { - glm::uvec4 const a1(2); - glm::uvec4 const b1 = a1 >> 1u; - - __m128i const e1 = _mm_set1_epi32(2); - __m128i const f1 = _mm_srli_epi32(e1, 1); - - glm::uvec4 const g1 = *reinterpret_cast(&f1); - - glm::uvec4 const a2(-1); - glm::uvec4 const b2 = a2 >> 1u; - - __m128i const e2 = _mm_set1_epi32(-1); - __m128i const f2 = _mm_srli_epi32(e2, 1); - - glm::uvec4 const g2 = *reinterpret_cast(&f2); - - std::printf("GNI\n"); - } -*/ - -# ifdef NDEBUG - std::size_t const Size(1000000); -# else - std::size_t const Size(1); -# endif//NDEBUG - - Error += test_perf_AoS(Size); - Error += test_perf_SoA(Size); - - Error += test_vec4_ctor(); - Error += test_bvec4_ctor(); - Error += test_size(); - Error += test_operators(); - Error += test_equal(); - Error += test_swizzle(); - Error += test_swizzle_partial(); - Error += test_simd(); - Error += test_operator_increment(); - Error += heap::test(); - Error += test_inheritance(); - Error += test_constexpr(); - - return Error; -} - diff --git a/3rdparty/glm/source/test/ext/CMakeLists.txt b/3rdparty/glm/source/test/ext/CMakeLists.txt deleted file mode 100644 index 40c91ba..0000000 --- a/3rdparty/glm/source/test/ext/CMakeLists.txt +++ /dev/null @@ -1,55 +0,0 @@ -glmCreateTestGTC(ext_matrix_relational) -glmCreateTestGTC(ext_matrix_transform) -glmCreateTestGTC(ext_matrix_common) -glmCreateTestGTC(ext_matrix_integer) -glmCreateTestGTC(ext_matrix_int2x2_sized) -glmCreateTestGTC(ext_matrix_int2x3_sized) -glmCreateTestGTC(ext_matrix_int2x4_sized) -glmCreateTestGTC(ext_matrix_int3x2_sized) -glmCreateTestGTC(ext_matrix_int3x3_sized) -glmCreateTestGTC(ext_matrix_int3x4_sized) -glmCreateTestGTC(ext_matrix_int4x2_sized) -glmCreateTestGTC(ext_matrix_int4x3_sized) -glmCreateTestGTC(ext_matrix_int4x4_sized) -glmCreateTestGTC(ext_matrix_uint2x2_sized) -glmCreateTestGTC(ext_matrix_uint2x3_sized) -glmCreateTestGTC(ext_matrix_uint2x4_sized) -glmCreateTestGTC(ext_matrix_uint3x2_sized) -glmCreateTestGTC(ext_matrix_uint3x3_sized) -glmCreateTestGTC(ext_matrix_uint3x4_sized) -glmCreateTestGTC(ext_matrix_uint4x2_sized) -glmCreateTestGTC(ext_matrix_uint4x3_sized) -glmCreateTestGTC(ext_matrix_uint4x4_sized) -glmCreateTestGTC(ext_quaternion_common) -glmCreateTestGTC(ext_quaternion_exponential) -glmCreateTestGTC(ext_quaternion_geometric) -glmCreateTestGTC(ext_quaternion_relational) -glmCreateTestGTC(ext_quaternion_transform) -glmCreateTestGTC(ext_quaternion_trigonometric) -glmCreateTestGTC(ext_quaternion_type) -glmCreateTestGTC(ext_scalar_common) -glmCreateTestGTC(ext_scalar_constants) -glmCreateTestGTC(ext_scalar_int_sized) -glmCreateTestGTC(ext_scalar_uint_sized) -glmCreateTestGTC(ext_scalar_integer) -glmCreateTestGTC(ext_scalar_ulp) -glmCreateTestGTC(ext_scalar_reciprocal) -glmCreateTestGTC(ext_scalar_relational) -glmCreateTestGTC(ext_vec1) -glmCreateTestGTC(ext_vector_bool1) -glmCreateTestGTC(ext_vector_common) -glmCreateTestGTC(ext_vector_iec559) -glmCreateTestGTC(ext_vector_int1_sized) -glmCreateTestGTC(ext_vector_int2_sized) -glmCreateTestGTC(ext_vector_int3_sized) -glmCreateTestGTC(ext_vector_int4_sized) -glmCreateTestGTC(ext_vector_integer) -glmCreateTestGTC(ext_vector_integer_sized) -glmCreateTestGTC(ext_vector_uint1_sized) -glmCreateTestGTC(ext_vector_uint2_sized) -glmCreateTestGTC(ext_vector_uint3_sized) -glmCreateTestGTC(ext_vector_uint4_sized) -glmCreateTestGTC(ext_vector_reciprocal) -glmCreateTestGTC(ext_vector_relational) -glmCreateTestGTC(ext_vector_ulp) - diff --git a/3rdparty/glm/source/test/ext/ext_matrix_clip_space.cpp b/3rdparty/glm/source/test/ext/ext_matrix_clip_space.cpp deleted file mode 100644 index ca84c19..0000000 --- a/3rdparty/glm/source/test/ext/ext_matrix_clip_space.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include -#include -#include -#include -#include - -int main() -{ - int Error = 0; - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_matrix_common.cpp b/3rdparty/glm/source/test/ext/ext_matrix_common.cpp deleted file mode 100644 index df0c3fe..0000000 --- a/3rdparty/glm/source/test/ext/ext_matrix_common.cpp +++ /dev/null @@ -1,53 +0,0 @@ -#include -#include -#include -#include -#include - -static int test_mix() -{ - int Error = 0; - - { - glm::mat4 A(2); - glm::mat4 B(4); - glm::mat4 C = glm::mix(A, B, 0.5f); - glm::bvec4 const D = glm::equal(C, glm::mat4(3), 1); - Error += glm::all(D) ? 0 : 1; - } - - { - glm::mat4 A(2); - glm::mat4 B(4); - glm::mat4 C = glm::mix(A, B, 0.5); - glm::bvec4 const D = glm::equal(C, glm::mat4(3), 1); - Error += glm::all(D) ? 0 : 1; - } - - { - glm::dmat4 A(2); - glm::dmat4 B(4); - glm::dmat4 C = glm::mix(A, B, 0.5); - glm::bvec4 const D = glm::equal(C, glm::dmat4(3), 1); - Error += glm::all(D) ? 0 : 1; - } - - { - glm::dmat4 A(2); - glm::dmat4 B(4); - glm::dmat4 C = glm::mix(A, B, 0.5f); - glm::bvec4 const D = glm::equal(C, glm::dmat4(3), 1); - Error += glm::all(D) ? 0 : 1; - } - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_mix(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_matrix_int2x2_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_int2x2_sized.cpp deleted file mode 100644 index 93b6e86..0000000 --- a/3rdparty/glm/source/test/ext/ext_matrix_int2x2_sized.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT - static_assert(sizeof(glm::i8mat2x2) == 4, "int8 size isn't 1 byte on this platform"); - static_assert(sizeof(glm::i16mat2x2) == 8, "int16 size isn't 2 bytes on this platform"); - static_assert(sizeof(glm::i32mat2x2) == 16, "int32 size isn't 4 bytes on this platform"); - static_assert(sizeof(glm::i64mat2x2) == 32, "int64 size isn't 8 bytes on this platform"); -#endif - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::i8mat2x2) < sizeof(glm::i16mat2x2) ? 0 : 1; - Error += sizeof(glm::i16mat2x2) < sizeof(glm::i32mat2x2) ? 0 : 1; - Error += sizeof(glm::i32mat2x2) < sizeof(glm::i64mat2x2) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_matrix_int2x3_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_int2x3_sized.cpp deleted file mode 100644 index 058f57b..0000000 --- a/3rdparty/glm/source/test/ext/ext_matrix_int2x3_sized.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT -static_assert(sizeof(glm::i8mat2x3) == 6, "int8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::i16mat2x3) == 12, "int16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::i32mat2x3) == 24, "int32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::i64mat2x3) == 48, "int64 size isn't 8 bytes on this platform"); -#endif - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::i8mat2x3) < sizeof(glm::i16mat2x3) ? 0 : 1; - Error += sizeof(glm::i16mat2x3) < sizeof(glm::i32mat2x3) ? 0 : 1; - Error += sizeof(glm::i32mat2x3) < sizeof(glm::i64mat2x3) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_matrix_int2x4_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_int2x4_sized.cpp deleted file mode 100644 index c20198d..0000000 --- a/3rdparty/glm/source/test/ext/ext_matrix_int2x4_sized.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT -static_assert(sizeof(glm::i8mat2x4) == 8, "int8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::i16mat2x4) == 16, "int16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::i32mat2x4) == 32, "int32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::i64mat2x4) == 64, "int64 size isn't 8 bytes on this platform"); -#endif - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::i8mat2x4) < sizeof(glm::i16mat2x4) ? 0 : 1; - Error += sizeof(glm::i16mat2x4) < sizeof(glm::i32mat2x4) ? 0 : 1; - Error += sizeof(glm::i32mat2x4) < sizeof(glm::i64mat2x4) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_matrix_int3x2_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_int3x2_sized.cpp deleted file mode 100644 index 1d14029..0000000 --- a/3rdparty/glm/source/test/ext/ext_matrix_int3x2_sized.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT -static_assert(sizeof(glm::i8mat3x2) == 6, "int8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::i16mat3x2) == 12, "int16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::i32mat3x2) == 24, "int32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::i64mat3x2) == 48, "int64 size isn't 8 bytes on this platform"); -#endif - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::i8mat3x2) < sizeof(glm::i16mat3x2) ? 0 : 1; - Error += sizeof(glm::i16mat3x2) < sizeof(glm::i32mat3x2) ? 0 : 1; - Error += sizeof(glm::i32mat3x2) < sizeof(glm::i64mat3x2) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_matrix_int3x3_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_int3x3_sized.cpp deleted file mode 100644 index d82836c..0000000 --- a/3rdparty/glm/source/test/ext/ext_matrix_int3x3_sized.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT -static_assert(sizeof(glm::i8mat3x3) == 9, "int8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::i16mat3x3) == 18, "int16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::i32mat3x3) == 36, "int32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::i64mat3x3) == 72, "int64 size isn't 8 bytes on this platform"); -#endif - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::i8mat3x3) < sizeof(glm::i16mat3x3) ? 0 : 1; - Error += sizeof(glm::i16mat3x3) < sizeof(glm::i32mat3x3) ? 0 : 1; - Error += sizeof(glm::i32mat3x3) < sizeof(glm::i64mat3x3) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_matrix_int3x4_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_int3x4_sized.cpp deleted file mode 100644 index 52b7d52..0000000 --- a/3rdparty/glm/source/test/ext/ext_matrix_int3x4_sized.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT -static_assert(sizeof(glm::i8mat3x4) == 12, "int8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::i16mat3x4) == 24, "int16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::i32mat3x4) == 48, "int32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::i64mat3x4) == 96, "int64 size isn't 8 bytes on this platform"); -#endif - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::i8mat3x4) < sizeof(glm::i16mat3x4) ? 0 : 1; - Error += sizeof(glm::i16mat3x4) < sizeof(glm::i32mat3x4) ? 0 : 1; - Error += sizeof(glm::i32mat3x4) < sizeof(glm::i64mat3x4) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_matrix_int4x2_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_int4x2_sized.cpp deleted file mode 100644 index 3c4566f..0000000 --- a/3rdparty/glm/source/test/ext/ext_matrix_int4x2_sized.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT -static_assert(sizeof(glm::i8mat4x2) == 8, "int8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::i16mat4x2) == 16, "int16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::i32mat4x2) == 32, "int32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::i64mat4x2) == 64, "int64 size isn't 8 bytes on this platform"); -#endif - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::i8mat4x2) < sizeof(glm::i16mat4x2) ? 0 : 1; - Error += sizeof(glm::i16mat4x2) < sizeof(glm::i32mat4x2) ? 0 : 1; - Error += sizeof(glm::i32mat4x2) < sizeof(glm::i64mat4x2) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_matrix_int4x3_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_int4x3_sized.cpp deleted file mode 100644 index fb882af..0000000 --- a/3rdparty/glm/source/test/ext/ext_matrix_int4x3_sized.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT -static_assert(sizeof(glm::i8mat4x3) == 12, "int8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::i16mat4x3) == 24, "int16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::i32mat4x3) == 48, "int32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::i64mat4x3) == 96, "int64 size isn't 8 bytes on this platform"); -#endif - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::i8mat4x3) < sizeof(glm::i16mat4x3) ? 0 : 1; - Error += sizeof(glm::i16mat4x3) < sizeof(glm::i32mat4x3) ? 0 : 1; - Error += sizeof(glm::i32mat4x3) < sizeof(glm::i64mat4x3) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_matrix_int4x4_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_int4x4_sized.cpp deleted file mode 100644 index 02769ea..0000000 --- a/3rdparty/glm/source/test/ext/ext_matrix_int4x4_sized.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT -static_assert(sizeof(glm::i8mat4x4) == 16, "int8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::i16mat4x4) == 32, "int16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::i32mat4x4) == 64, "int32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::i64mat4x4) == 128, "int64 size isn't 8 bytes on this platform"); -#endif - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::i8mat4x4) < sizeof(glm::i16mat4x4) ? 0 : 1; - Error += sizeof(glm::i16mat4x4) < sizeof(glm::i32mat4x4) ? 0 : 1; - Error += sizeof(glm::i32mat4x4) < sizeof(glm::i64mat4x4) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_matrix_integer.cpp b/3rdparty/glm/source/test/ext/ext_matrix_integer.cpp deleted file mode 100644 index c26d557..0000000 --- a/3rdparty/glm/source/test/ext/ext_matrix_integer.cpp +++ /dev/null @@ -1,237 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace glm; - -int test_matrixCompMult() -{ - int Error = 0; - - { - imat2 m(0, 1, 2, 3); - imat2 n = matrixCompMult(m, m); - imat2 expected = imat2(0, 1, 4, 9); - Error += all(equal(n, expected)) ? 0 : 1; - } - - { - imat2x3 m(0, 1, 2, 3, 4, 5); - imat2x3 n = matrixCompMult(m, m); - imat2x3 expected = imat2x3(0, 1, 4, 9, 16, 25); - Error += all(equal(n, expected)) ? 0 : 1; - } - - { - imat2x4 m(0, 1, 2, 3, 4, 5, 6, 7); - imat2x4 n = matrixCompMult(m, m); - imat2x4 expected = imat2x4(0, 1, 4, 9, 16, 25, 36, 49); - Error += all(equal(n, expected)) ? 0 : 1; - } - - { - imat3 m(0, 1, 2, 3, 4, 5, 6, 7, 8); - imat3 n = matrixCompMult(m, m); - imat3 expected = imat3(0, 1, 4, 9, 16, 25, 36, 49, 64); - Error += all(equal(n, expected)) ? 0 : 1; - } - - { - imat3x2 m(0, 1, 2, 3, 4, 5); - imat3x2 n = matrixCompMult(m, m); - imat3x2 expected = imat3x2(0, 1, 4, 9, 16, 25); - Error += all(equal(n, expected)) ? 0 : 1; - } - - { - imat3x4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11); - imat3x4 n = matrixCompMult(m, m); - imat3x4 expected = imat3x4(0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121); - Error += all(equal(n, expected)) ? 0 : 1; - } - - { - imat4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); - imat4 n = matrixCompMult(m, m); - imat4 expected = imat4(0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225); - Error += all(equal(n, expected)) ? 0 : 1; - } - - { - imat4x2 m(0, 1, 2, 3, 4, 5, 6, 7); - imat4x2 n = matrixCompMult(m, m); - imat4x2 expected = imat4x2(0, 1, 4, 9, 16, 25, 36, 49); - Error += all(equal(n, expected)) ? 0 : 1; - } - - { - imat4x3 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11); - imat4x3 n = matrixCompMult(m, m); - imat4x3 expected = imat4x3(0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121); - Error += all(equal(n, expected)) ? 0 : 1; - } - - return Error; -} - -int test_outerProduct() -{ - int Error = 0; - - { - glm::imat2x2 const m = glm::outerProduct(glm::ivec2(1), glm::ivec2(1)); - Error += all(equal(m, glm::imat2x2(1, 1, 1, 1))) ? 0 : 1; - } - { - glm::imat2x3 const m = glm::outerProduct(glm::ivec3(1), glm::ivec2(1)); - Error += all(equal(m, glm::imat2x3(1, 1, 1, 1, 1, 1))) ? 0 : 1; - } - { - glm::imat2x4 const m = glm::outerProduct(glm::ivec4(1), glm::ivec2(1)); - Error += all(equal(m, glm::imat2x4(1, 1, 1, 1, 1, 1, 1, 1))) ? 0 : 1; - } - - { - glm::imat3x2 const m = glm::outerProduct(glm::ivec2(1), glm::ivec3(1)); - Error += all(equal(m, glm::imat3x2(1, 1, 1, 1, 1, 1))) ? 0 : 1; - } - { - glm::imat3x3 const m = glm::outerProduct(glm::ivec3(1), glm::ivec3(1)); - Error += all(equal(m, glm::imat3x3(1, 1, 1, 1, 1, 1, 1, 1, 1))) ? 0 : 1; - } - { - glm::imat3x4 const m = glm::outerProduct(glm::ivec4(1), glm::ivec3(1)); - Error += all(equal(m, glm::imat3x4(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1))) ? 0 : 1; - } - - - { - glm::imat4x2 const m = glm::outerProduct(glm::ivec2(1), glm::ivec4(1)); - Error += all(equal(m, glm::imat4x2(1, 1, 1, 1, 1, 1, 1, 1))) ? 0 : 1; - } - { - glm::imat4x3 const m = glm::outerProduct(glm::ivec3(1), glm::ivec4(1)); - Error += all(equal(m, glm::imat4x3(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1))) ? 0 : 1; - } - { - glm::imat4x4 const m = glm::outerProduct(glm::ivec4(1), glm::ivec4(1)); - Error += all(equal(m, glm::imat4x4(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1))) ? 0 : 1; - } - - return Error; -} - -int test_transpose() -{ - int Error = 0; - - { - imat2 const m(0, 1, 2, 3); - imat2 const t = transpose(m); - imat2 const expected = imat2(0, 2, 1, 3); - Error += all(equal(t, expected)) ? 0 : 1; - } - - { - imat2x3 m(0, 1, 2, 3, 4, 5); - imat3x2 t = transpose(m); - imat3x2 const expected = imat3x2(0, 3, 1, 4, 2, 5); - Error += all(equal(t, expected)) ? 0 : 1; - } - - { - imat2x4 m(0, 1, 2, 3, 4, 5, 6, 7); - imat4x2 t = transpose(m); - imat4x2 const expected = imat4x2(0, 4, 1, 5, 2, 6, 3, 7); - Error += all(equal(t, expected)) ? 0 : 1; - } - - { - imat3 m(0, 1, 2, 3, 4, 5, 6, 7, 8); - imat3 t = transpose(m); - imat3 const expected = imat3(0, 3, 6, 1, 4, 7, 2, 5, 8); - Error += all(equal(t, expected)) ? 0 : 1; - } - - { - imat3x2 m(0, 1, 2, 3, 4, 5); - imat2x3 t = transpose(m); - imat2x3 const expected = imat2x3(0, 2, 4, 1, 3, 5); - Error += all(equal(t, expected)) ? 0 : 1; - } - - { - imat3x4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11); - imat4x3 t = transpose(m); - imat4x3 const expected = imat4x3(0, 4, 8, 1, 5, 9, 2, 6, 10, 3, 7, 11); - Error += all(equal(t, expected)) ? 0 : 1; - } - - { - imat4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); - imat4 t = transpose(m); - imat4 const expected = imat4(0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15); - Error += all(equal(t, expected)) ? 0 : 1; - } - - { - imat4x2 m(0, 1, 2, 3, 4, 5, 6, 7); - imat2x4 t = transpose(m); - imat2x4 const expected = imat2x4(0, 2, 4, 6, 1, 3, 5, 7); - Error += all(equal(t, expected)) ? 0 : 1; - } - - { - imat4x3 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11); - imat3x4 t = transpose(m); - imat3x4 const expected = imat3x4(0, 3, 6, 9, 1, 4, 7, 10, 2, 5, 8, 11); - Error += all(equal(t, expected)) ? 0 : 1; - } - - return Error; -} - -int test_determinant() -{ - int Error = 0; - - { - imat2 const m(1, 1, 1, 1); - int const t = determinant(m); - Error += t == 0 ? 0 : 1; - } - - { - imat3 m(1, 1, 1, 1, 1, 1, 1, 1, 1); - int t = determinant(m); - Error += t == 0 ? 0 : 1; - } - - { - imat4 m(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); - int t = determinant(m); - Error += t == 0 ? 0 : 1; - } - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_matrixCompMult(); - Error += test_outerProduct(); - Error += test_transpose(); - Error += test_determinant(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_matrix_projection.cpp b/3rdparty/glm/source/test/ext/ext_matrix_projection.cpp deleted file mode 100644 index 88f6ae9..0000000 --- a/3rdparty/glm/source/test/ext/ext_matrix_projection.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include -#include -#include -#include -#include -#include - -int main() -{ - int Error = 0; - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_matrix_relational.cpp b/3rdparty/glm/source/test/ext/ext_matrix_relational.cpp deleted file mode 100644 index 64c0dae..0000000 --- a/3rdparty/glm/source/test/ext/ext_matrix_relational.cpp +++ /dev/null @@ -1,163 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -template -static int test_equal() -{ - typedef typename matType::value_type valType; - - valType const Epsilon = static_cast(0.001f); - valType const One = static_cast(1); - valType const Two = static_cast(2); - - int Error = 0; - - Error += glm::all(glm::equal(matType(One), matType(One), Epsilon)) ? 0 : 1; - Error += glm::all(glm::equal(matType(One), matType(Two), vecType(Epsilon))) ? 1 : 0; - - return Error; -} - -template -static int test_notEqual() -{ - typedef typename matType::value_type valType; - - valType const Epsilon = static_cast(0.001f); - valType const One = static_cast(1); - valType const Two = static_cast(2); - - int Error = 0; - - Error += !glm::any(glm::notEqual(matType(One), matType(One), Epsilon)) ? 0 : 1; - Error += !glm::any(glm::notEqual(matType(One), matType(Two), vecType(Epsilon))) ? 1 : 0; - - return Error; -} - - -template -static int test_equal_ulps() -{ - typedef glm::mat<4, 4, T, glm::defaultp> mat4; - - T const One(1); - mat4 const Ones(1); - - int Error = 0; - - T const ULP1Plus = glm::nextFloat(One); - Error += glm::all(glm::equal(Ones, mat4(ULP1Plus), 1)) ? 0 : 1; - - T const ULP2Plus = glm::nextFloat(ULP1Plus); - Error += !glm::all(glm::equal(Ones, mat4(ULP2Plus), 1)) ? 0 : 1; - - T const ULP1Minus = glm::prevFloat(One); - Error += glm::all(glm::equal(Ones, mat4(ULP1Minus), 1)) ? 0 : 1; - - T const ULP2Minus = glm::prevFloat(ULP1Minus); - Error += !glm::all(glm::equal(Ones, mat4(ULP2Minus), 1)) ? 0 : 1; - - return Error; -} - -template -static int test_notEqual_ulps() -{ - typedef glm::mat<4, 4, T, glm::defaultp> mat4; - - T const One(1); - mat4 const Ones(1); - - int Error = 0; - - T const ULP1Plus = glm::nextFloat(One); - Error += !glm::all(glm::notEqual(Ones, mat4(ULP1Plus), 1)) ? 0 : 1; - - T const ULP2Plus = glm::nextFloat(ULP1Plus); - Error += glm::all(glm::notEqual(Ones, mat4(ULP2Plus), 1)) ? 0 : 1; - - T const ULP1Minus = glm::prevFloat(One); - Error += !glm::all(glm::notEqual(Ones, mat4(ULP1Minus), 1)) ? 0 : 1; - - T const ULP2Minus = glm::prevFloat(ULP1Minus); - Error += glm::all(glm::notEqual(Ones, mat4(ULP2Minus), 1)) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_equal_ulps(); - Error += test_equal_ulps(); - Error += test_notEqual_ulps(); - Error += test_notEqual_ulps(); - - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_matrix_transform.cpp b/3rdparty/glm/source/test/ext/ext_matrix_transform.cpp deleted file mode 100644 index cf653b7..0000000 --- a/3rdparty/glm/source/test/ext/ext_matrix_transform.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include -#include -#include -#include -#include -#include - -static int test_translate() -{ - int Error = 0; - - glm::mat4 const M(1.0f); - glm::vec3 const V(1.0f); - - glm::mat4 const T = glm::translate(M, V); - Error += glm::all(glm::equal(T[3], glm::vec4(1.0f), glm::epsilon())) ? 0 : 1; - - return Error; -} - -static int test_scale() -{ - int Error = 0; - - glm::mat4 const M(1.0f); - glm::vec3 const V(2.0f); - - glm::mat4 const S = glm::scale(M, V); - glm::mat4 const R = glm::mat4( - glm::vec4(2, 0, 0, 0), - glm::vec4(0, 2, 0, 0), - glm::vec4(0, 0, 2, 0), - glm::vec4(0, 0, 0, 1)); - Error += glm::all(glm::equal(S, R, glm::epsilon())) ? 0 : 1; - - return Error; -} - -static int test_rotate() -{ - int Error = 0; - - glm::vec4 const A(1.0f, 0.0f, 0.0f, 1.0f); - - glm::mat4 const R = glm::rotate(glm::mat4(1.0f), glm::radians(90.f), glm::vec3(0, 0, 1)); - glm::vec4 const B = R * A; - Error += glm::all(glm::equal(B, glm::vec4(0.0f, 1.0f, 0.0f, 1.0f), 0.0001f)) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_translate(); - Error += test_scale(); - Error += test_rotate(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_matrix_uint2x2_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_uint2x2_sized.cpp deleted file mode 100644 index a9bd49c..0000000 --- a/3rdparty/glm/source/test/ext/ext_matrix_uint2x2_sized.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT - static_assert(sizeof(glm::u8mat2x2) == 4, "uint8 size isn't 1 byte on this platform"); - static_assert(sizeof(glm::u16mat2x2) == 8, "uint16 size isn't 2 bytes on this platform"); - static_assert(sizeof(glm::u32mat2x2) == 16, "uint32 size isn't 4 bytes on this platform"); - static_assert(sizeof(glm::u64mat2x2) == 32, "uint64 size isn't 8 bytes on this platform"); -#endif - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::u8mat2x2) < sizeof(glm::u16mat2x2) ? 0 : 1; - Error += sizeof(glm::u16mat2x2) < sizeof(glm::u32mat2x2) ? 0 : 1; - Error += sizeof(glm::u32mat2x2) < sizeof(glm::u64mat2x2) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_matrix_uint2x3_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_uint2x3_sized.cpp deleted file mode 100644 index 0b75893..0000000 --- a/3rdparty/glm/source/test/ext/ext_matrix_uint2x3_sized.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT -static_assert(sizeof(glm::u8mat2x3) == 6, "uint8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::u16mat2x3) == 12, "uint16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::u32mat2x3) == 24, "uint32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::u64mat2x3) == 48, "uint64 size isn't 8 bytes on this platform"); -#endif - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::u8mat2x3) < sizeof(glm::u16mat2x3) ? 0 : 1; - Error += sizeof(glm::u16mat2x3) < sizeof(glm::u32mat2x3) ? 0 : 1; - Error += sizeof(glm::u32mat2x3) < sizeof(glm::u64mat2x3) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_matrix_uint2x4_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_uint2x4_sized.cpp deleted file mode 100644 index 84af4dd..0000000 --- a/3rdparty/glm/source/test/ext/ext_matrix_uint2x4_sized.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT -static_assert(sizeof(glm::u8mat2x4) == 8, "uint8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::u16mat2x4) == 16, "uint16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::u32mat2x4) == 32, "uint32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::u64mat2x4) == 64, "uint64 size isn't 8 bytes on this platform"); -#endif - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::u8mat2x4) < sizeof(glm::u16mat2x4) ? 0 : 1; - Error += sizeof(glm::u16mat2x4) < sizeof(glm::u32mat2x4) ? 0 : 1; - Error += sizeof(glm::u32mat2x4) < sizeof(glm::u64mat2x4) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_matrix_uint3x2_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_uint3x2_sized.cpp deleted file mode 100644 index 3c035e2..0000000 --- a/3rdparty/glm/source/test/ext/ext_matrix_uint3x2_sized.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT -static_assert(sizeof(glm::u8mat3x2) == 6, "uint8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::u16mat3x2) == 12, "uint16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::u32mat3x2) == 24, "uint32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::u64mat3x2) == 48, "uint64 size isn't 8 bytes on this platform"); -#endif - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::u8mat3x2) < sizeof(glm::u16mat3x2) ? 0 : 1; - Error += sizeof(glm::u16mat3x2) < sizeof(glm::u32mat3x2) ? 0 : 1; - Error += sizeof(glm::u32mat3x2) < sizeof(glm::u64mat3x2) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_matrix_uint3x3_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_uint3x3_sized.cpp deleted file mode 100644 index 64384ed..0000000 --- a/3rdparty/glm/source/test/ext/ext_matrix_uint3x3_sized.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT -static_assert(sizeof(glm::u8mat3x3) == 9, "uint8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::u16mat3x3) == 18, "uint16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::u32mat3x3) == 36, "uint32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::u64mat3x3) == 72, "uint64 size isn't 8 bytes on this platform"); -#endif - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::u8mat3x3) < sizeof(glm::u16mat3x3) ? 0 : 1; - Error += sizeof(glm::u16mat3x3) < sizeof(glm::u32mat3x3) ? 0 : 1; - Error += sizeof(glm::u32mat3x3) < sizeof(glm::u64mat3x3) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_matrix_uint3x4_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_uint3x4_sized.cpp deleted file mode 100644 index 7f743df..0000000 --- a/3rdparty/glm/source/test/ext/ext_matrix_uint3x4_sized.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT -static_assert(sizeof(glm::u8mat3x4) == 12, "uint8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::u16mat3x4) == 24, "uint16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::u32mat3x4) == 48, "uint32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::u64mat3x4) == 96, "uint64 size isn't 8 bytes on this platform"); -#endif - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::u8mat3x4) < sizeof(glm::u16mat3x4) ? 0 : 1; - Error += sizeof(glm::u16mat3x4) < sizeof(glm::u32mat3x4) ? 0 : 1; - Error += sizeof(glm::u32mat3x4) < sizeof(glm::u64mat3x4) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_matrix_uint4x2_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_uint4x2_sized.cpp deleted file mode 100644 index 2b4453f..0000000 --- a/3rdparty/glm/source/test/ext/ext_matrix_uint4x2_sized.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT -static_assert(sizeof(glm::u8mat4x2) == 8, "uint8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::u16mat4x2) == 16, "uint16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::u32mat4x2) == 32, "uint32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::u64mat4x2) == 64, "uint64 size isn't 8 bytes on this platform"); -#endif - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::u8mat4x2) < sizeof(glm::u16mat4x2) ? 0 : 1; - Error += sizeof(glm::u16mat4x2) < sizeof(glm::u32mat4x2) ? 0 : 1; - Error += sizeof(glm::u32mat4x2) < sizeof(glm::u64mat4x2) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_matrix_uint4x3_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_uint4x3_sized.cpp deleted file mode 100644 index 2820bde..0000000 --- a/3rdparty/glm/source/test/ext/ext_matrix_uint4x3_sized.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT -static_assert(sizeof(glm::u8mat4x3) == 12, "uint8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::u16mat4x3) == 24, "uint16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::u32mat4x3) == 48, "uint32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::u64mat4x3) == 96, "uint64 size isn't 8 bytes on this platform"); -#endif - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::u8mat4x3) < sizeof(glm::u16mat4x3) ? 0 : 1; - Error += sizeof(glm::u16mat4x3) < sizeof(glm::u32mat4x3) ? 0 : 1; - Error += sizeof(glm::u32mat4x3) < sizeof(glm::u64mat4x3) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_matrix_uint4x4_sized.cpp b/3rdparty/glm/source/test/ext/ext_matrix_uint4x4_sized.cpp deleted file mode 100644 index 8f9e239..0000000 --- a/3rdparty/glm/source/test/ext/ext_matrix_uint4x4_sized.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT -static_assert(sizeof(glm::u8mat4x4) == 16, "uint8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::u16mat4x4) == 32, "uint16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::u32mat4x4) == 64, "uint32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::u64mat4x4) == 128, "uint64 size isn't 8 bytes on this platform"); -#endif - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::u8mat4x4) < sizeof(glm::u16mat4x4) ? 0 : 1; - Error += sizeof(glm::u16mat4x4) < sizeof(glm::u32mat4x4) ? 0 : 1; - Error += sizeof(glm::u32mat4x4) < sizeof(glm::u64mat4x4) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_quaternion_common.cpp b/3rdparty/glm/source/test/ext/ext_quaternion_common.cpp deleted file mode 100644 index 861aa65..0000000 --- a/3rdparty/glm/source/test/ext/ext_quaternion_common.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -static int test_conjugate() -{ - int Error = 0; - - glm::quat const A(glm::vec3(1, 0, 0), glm::vec3(0, 1, 0)); - glm::quat const C = glm::conjugate(A); - Error += glm::any(glm::notEqual(A, C, glm::epsilon())) ? 0 : 1; - - glm::quat const B = glm::conjugate(C); - Error += glm::all(glm::equal(A, B, glm::epsilon())) ? 0 : 1; - - return Error; -} - -static int test_mix() -{ - int Error = 0; - - glm::quat const Q1(glm::vec3(1, 0, 0), glm::vec3(1, 0, 0)); - glm::quat const Q2(glm::vec3(1, 0, 0), glm::vec3(0, 1, 0)); - - { - glm::quat const Q3 = glm::mix(Q1, Q2, 0.5f); - float const F3 = glm::degrees(glm::angle(Q3)); - Error += glm::equal(F3, 45.0f, 0.001f) ? 0 : 1; - - glm::quat const Q4 = glm::mix(Q2, Q1, 0.5f); - float const F4 = glm::degrees(glm::angle(Q4)); - Error += glm::equal(F4, 45.0f, 0.001f) ? 0 : 1; - } - - { - glm::quat const Q3 = glm::slerp(Q1, Q2, 0.5f); - float const F3 = glm::degrees(glm::angle(Q3)); - Error += glm::equal(F3, 45.0f, 0.001f) ? 0 : 1; - - glm::quat const Q4 = glm::slerp(Q2, Q1, 0.5f); - float const F4 = glm::degrees(glm::angle(Q4)); - Error += glm::equal(F4, 45.0f, 0.001f) ? 0 : 1; - } - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_conjugate(); - Error += test_mix(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_quaternion_exponential.cpp b/3rdparty/glm/source/test/ext/ext_quaternion_exponential.cpp deleted file mode 100644 index fbcdbef..0000000 --- a/3rdparty/glm/source/test/ext/ext_quaternion_exponential.cpp +++ /dev/null @@ -1,87 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -template -int test_log() -{ - typedef typename quaType::value_type T; - - T const Epsilon = static_cast(0.001f); - - int Error = 0; - - quaType const Q(vecType(1, 0, 0), vecType(0, 1, 0)); - quaType const P = glm::log(Q); - Error += glm::any(glm::notEqual(Q, P, Epsilon)) ? 0 : 1; - - quaType const R = glm::exp(P); - Error += glm::all(glm::equal(Q, R, Epsilon)) ? 0 : 1; - - return Error; -} - -template -int test_pow() -{ - typedef typename quaType::value_type T; - - T const Epsilon = static_cast(0.001f); - - int Error = 0; - - quaType const Q(vecType(1, 0, 0), vecType(0, 1, 0)); - - { - T const One = static_cast(1.0f); - quaType const P = glm::pow(Q, One); - Error += glm::all(glm::equal(Q, P, Epsilon)) ? 0 : 1; - } - - { - T const Two = static_cast(2.0f); - quaType const P = glm::pow(Q, Two); - quaType const R = Q * Q; - Error += glm::all(glm::equal(P, R, Epsilon)) ? 0 : 1; - - quaType const U = glm::sqrt(P); - Error += glm::all(glm::equal(Q, U, Epsilon)) ? 0 : 1; - } - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_log(); - Error += test_log(); - Error += test_log(); - Error += test_log(); - - Error += test_log(); - Error += test_log(); - Error += test_log(); - Error += test_log(); - - Error += test_pow(); - Error += test_pow(); - Error += test_pow(); - Error += test_pow(); - - Error += test_pow(); - Error += test_pow(); - Error += test_pow(); - Error += test_pow(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_quaternion_geometric.cpp b/3rdparty/glm/source/test/ext/ext_quaternion_geometric.cpp deleted file mode 100644 index 73b5dea..0000000 --- a/3rdparty/glm/source/test/ext/ext_quaternion_geometric.cpp +++ /dev/null @@ -1,88 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -float const Epsilon = 0.001f; - -static int test_length() -{ - int Error = 0; - - { - float const A = glm::length(glm::quat(1, 0, 0, 0)); - Error += glm::equal(A, 1.0f, Epsilon) ? 0 : 1; - } - - { - float const A = glm::length(glm::quat(1, glm::vec3(0))); - Error += glm::equal(A, 1.0f, Epsilon) ? 0 : 1; - } - - { - float const A = glm::length(glm::quat(glm::vec3(1, 0, 0), glm::vec3(0, 1, 0))); - Error += glm::equal(A, 1.0f, Epsilon) ? 0 : 1; - } - - return Error; -} - -static int test_normalize() -{ - int Error = 0; - - { - glm::quat const A = glm::quat(1, 0, 0, 0); - glm::quat const N = glm::normalize(A); - Error += glm::all(glm::equal(A, N, Epsilon)) ? 0 : 1; - } - - { - glm::quat const A = glm::quat(1, glm::vec3(0)); - glm::quat const N = glm::normalize(A); - Error += glm::all(glm::equal(A, N, Epsilon)) ? 0 : 1; - } - - return Error; -} - -static int test_dot() -{ - int Error = 0; - - { - glm::quat const A = glm::quat(1, 0, 0, 0); - glm::quat const B = glm::quat(1, 0, 0, 0); - float const C = glm::dot(A, B); - Error += glm::equal(C, 1.0f, Epsilon) ? 0 : 1; - } - - return Error; -} - -static int test_cross() -{ - int Error = 0; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_length(); - Error += test_normalize(); - Error += test_dot(); - Error += test_cross(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_quaternion_relational.cpp b/3rdparty/glm/source/test/ext/ext_quaternion_relational.cpp deleted file mode 100644 index 7f51fdc..0000000 --- a/3rdparty/glm/source/test/ext/ext_quaternion_relational.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -template -static int test_equal() -{ - int Error = 0; - - quaType const Q(1, 0, 0, 0); - quaType const P(1, 0, 0, 0); - Error += glm::all(glm::equal(Q, P, glm::epsilon())) ? 0 : 1; - - return Error; -} - -template -static int test_notEqual() -{ - int Error = 0; - - quaType const Q(1, 0, 0, 0); - quaType const P(1, 0, 0, 0); - Error += glm::any(glm::notEqual(Q, P, glm::epsilon())) ? 1 : 0; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_quaternion_transform.cpp b/3rdparty/glm/source/test/ext/ext_quaternion_transform.cpp deleted file mode 100644 index fefe88e..0000000 --- a/3rdparty/glm/source/test/ext/ext_quaternion_transform.cpp +++ /dev/null @@ -1,45 +0,0 @@ -#include -#include -#include -#include - -#define GLM_ENABLE_EXPERIMENTAL -#include - -static int test_lookAt() -{ - int Error(0); - - glm::vec3 eye(0.0f); - glm::vec3 center(1.1f, -2.0f, 3.1416f); - glm::vec3 up(-0.17f, 7.23f, -1.744f); - - glm::quat test_quat = glm::quatLookAt(glm::normalize(center - eye), up); - glm::quat test_mat = glm::conjugate(glm::quat_cast(glm::lookAt(eye, center, up))); - - Error += static_cast(glm::abs(glm::length(test_quat) - 1.0f) > glm::epsilon()); - Error += static_cast(glm::min(glm::length(test_quat + (-test_mat)), glm::length(test_quat + test_mat)) > glm::epsilon()); - - // Test left-handed implementation - glm::quat test_quatLH = glm::quatLookAtLH(glm::normalize(center - eye), up); - glm::quat test_matLH = glm::conjugate(glm::quat_cast(glm::lookAtLH(eye, center, up))); - Error += static_cast(glm::abs(glm::length(test_quatLH) - 1.0f) > glm::epsilon()); - Error += static_cast(glm::min(glm::length(test_quatLH - test_matLH), glm::length(test_quatLH + test_matLH)) > glm::epsilon()); - - // Test right-handed implementation - glm::quat test_quatRH = glm::quatLookAtRH(glm::normalize(center - eye), up); - glm::quat test_matRH = glm::conjugate(glm::quat_cast(glm::lookAtRH(eye, center, up))); - Error += static_cast(glm::abs(glm::length(test_quatRH) - 1.0f) > glm::epsilon()); - Error += static_cast(glm::min(glm::length(test_quatRH - test_matRH), glm::length(test_quatRH + test_matRH)) > glm::epsilon()); - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_lookAt(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_quaternion_trigonometric.cpp b/3rdparty/glm/source/test/ext/ext_quaternion_trigonometric.cpp deleted file mode 100644 index d237125..0000000 --- a/3rdparty/glm/source/test/ext/ext_quaternion_trigonometric.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include -#include -#include -#include - -float const Epsilon = 0.001f; - -static int test_angle() -{ - int Error = 0; - - { - glm::quat const Q = glm::quat(glm::vec3(1, 0, 0), glm::vec3(0, 1, 0)); - float const A = glm::degrees(glm::angle(Q)); - Error += glm::equal(A, 90.0f, Epsilon) ? 0 : 1; - } - - { - glm::quat const Q = glm::quat(glm::vec3(0, 1, 0), glm::vec3(1, 0, 0)); - float const A = glm::degrees(glm::angle(Q)); - Error += glm::equal(A, 90.0f, Epsilon) ? 0 : 1; - } - - { - glm::quat const Q = glm::angleAxis(glm::two_pi() - 1.0f, glm::vec3(1, 0, 0)); - float const A = glm::angle(Q); - Error += glm::equal(A, 1.0f, Epsilon) ? 1 : 0; - } - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_angle(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_quaternion_type.cpp b/3rdparty/glm/source/test/ext/ext_quaternion_type.cpp deleted file mode 100644 index 7e61149..0000000 --- a/3rdparty/glm/source/test/ext/ext_quaternion_type.cpp +++ /dev/null @@ -1,113 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -static int test_ctr() -{ - int Error(0); - -# if GLM_HAS_TRIVIAL_QUERIES - // Error += std::is_trivially_default_constructible::value ? 0 : 1; - // Error += std::is_trivially_default_constructible::value ? 0 : 1; - // Error += std::is_trivially_copy_assignable::value ? 0 : 1; - // Error += std::is_trivially_copy_assignable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - - Error += std::is_copy_constructible::value ? 0 : 1; - Error += std::is_copy_constructible::value ? 0 : 1; -# endif - -# if GLM_HAS_INITIALIZER_LISTS - { - glm::quat A{0, 1, 2, 3}; - - std::vector B{ - {0, 1, 2, 3}, - {0, 1, 2, 3}}; - } -# endif//GLM_HAS_INITIALIZER_LISTS - - return Error; -} - -static int test_two_axis_ctr() -{ - int Error = 0; - - glm::quat const q1(glm::vec3(1, 0, 0), glm::vec3(0, 1, 0)); - glm::vec3 const v1 = q1 * glm::vec3(1, 0, 0); - Error += glm::all(glm::equal(v1, glm::vec3(0, 1, 0), 0.0001f)) ? 0 : 1; - - glm::quat const q2 = q1 * q1; - glm::vec3 const v2 = q2 * glm::vec3(1, 0, 0); - Error += glm::all(glm::equal(v2, glm::vec3(-1, 0, 0), 0.0001f)) ? 0 : 1; - - glm::quat const q3(glm::vec3(1, 0, 0), glm::vec3(-1, 0, 0)); - glm::vec3 const v3 = q3 * glm::vec3(1, 0, 0); - Error += glm::all(glm::equal(v3, glm::vec3(-1, 0, 0), 0.0001f)) ? 0 : 1; - - glm::quat const q4(glm::vec3(0, 1, 0), glm::vec3(0, -1, 0)); - glm::vec3 const v4 = q4 * glm::vec3(0, 1, 0); - Error += glm::all(glm::equal(v4, glm::vec3(0, -1, 0), 0.0001f)) ? 0 : 1; - - glm::quat const q5(glm::vec3(0, 0, 1), glm::vec3(0, 0, -1)); - glm::vec3 const v5 = q5 * glm::vec3(0, 0, 1); - Error += glm::all(glm::equal(v5, glm::vec3(0, 0, -1), 0.0001f)) ? 0 : 1; - - return Error; -} - -static int test_size() -{ - int Error = 0; - - std::size_t const A = sizeof(glm::quat); - Error += 16 == A ? 0 : 1; - std::size_t const B = sizeof(glm::dquat); - Error += 32 == B ? 0 : 1; - Error += glm::quat().length() == 4 ? 0 : 1; - Error += glm::dquat().length() == 4 ? 0 : 1; - Error += glm::quat::length() == 4 ? 0 : 1; - Error += glm::dquat::length() == 4 ? 0 : 1; - - return Error; -} - -static int test_precision() -{ - int Error = 0; - - Error += sizeof(glm::lowp_quat) <= sizeof(glm::mediump_quat) ? 0 : 1; - Error += sizeof(glm::mediump_quat) <= sizeof(glm::highp_quat) ? 0 : 1; - - return Error; -} - -static int test_constexpr() -{ -#if GLM_HAS_CONSTEXPR - static_assert(glm::quat::length() == 4, "GLM: Failed constexpr"); - static_assert(glm::quat(1.0f, glm::vec3(0.0f)).w > 0.0f, "GLM: Failed constexpr"); -#endif - - return 0; -} - -int main() -{ - int Error = 0; - - Error += test_ctr(); - Error += test_two_axis_ctr(); - Error += test_size(); - Error += test_precision(); - Error += test_constexpr(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_scalar_common.cpp b/3rdparty/glm/source/test/ext/ext_scalar_common.cpp deleted file mode 100644 index 917a242..0000000 --- a/3rdparty/glm/source/test/ext/ext_scalar_common.cpp +++ /dev/null @@ -1,360 +0,0 @@ -#include -#include -#include -#include - -#if ((GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC)) -# define GLM_NAN(T) NAN -#else -# define GLM_NAN(T) (static_cast(0.0f) / static_cast(0.0f)) -#endif - -template -static int test_min() -{ - int Error = 0; - - T const N = static_cast(0); - T const B = static_cast(1); - Error += glm::equal(glm::min(N, B), N, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::min(B, N), N, glm::epsilon()) ? 0 : 1; - - T const C = static_cast(2); - Error += glm::equal(glm::min(N, B, C), N, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::min(B, N, C), N, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::min(C, N, B), N, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::min(C, B, N), N, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::min(B, C, N), N, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::min(N, C, B), N, glm::epsilon()) ? 0 : 1; - - T const D = static_cast(3); - Error += glm::equal(glm::min(D, N, B, C), N, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::min(B, D, N, C), N, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::min(C, N, D, B), N, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::min(C, B, D, N), N, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::min(B, C, N, D), N, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::min(N, C, B, D), N, glm::epsilon()) ? 0 : 1; - - return Error; -} - -template -static int test_min_nan() -{ - int Error = 0; - - T const B = static_cast(1); - T const N = static_cast(GLM_NAN(T)); - Error += glm::isnan(glm::min(N, B)) ? 0 : 1; - Error += !glm::isnan(glm::min(B, N)) ? 0 : 1; - - T const C = static_cast(2); - Error += glm::isnan(glm::min(N, B, C)) ? 0 : 1; - Error += !glm::isnan(glm::min(B, N, C)) ? 0 : 1; - Error += !glm::isnan(glm::min(C, N, B)) ? 0 : 1; - Error += !glm::isnan(glm::min(C, B, N)) ? 0 : 1; - Error += !glm::isnan(glm::min(B, C, N)) ? 0 : 1; - Error += glm::isnan(glm::min(N, C, B)) ? 0 : 1; - - T const D = static_cast(3); - Error += !glm::isnan(glm::min(D, N, B, C)) ? 0 : 1; - Error += !glm::isnan(glm::min(B, D, N, C)) ? 0 : 1; - Error += !glm::isnan(glm::min(C, N, D, B)) ? 0 : 1; - Error += !glm::isnan(glm::min(C, B, D, N)) ? 0 : 1; - Error += !glm::isnan(glm::min(B, C, N, D)) ? 0 : 1; - Error += glm::isnan(glm::min(N, C, B, D)) ? 0 : 1; - - return Error; -} - -template -static int test_max() -{ - int Error = 0; - - T const N = static_cast(0); - T const B = static_cast(1); - Error += glm::equal(glm::max(N, B), B, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::max(B, N), B, glm::epsilon()) ? 0 : 1; - - T const C = static_cast(2); - Error += glm::equal(glm::max(N, B, C), C, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::max(B, N, C), C, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::max(C, N, B), C, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::max(C, B, N), C, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::max(B, C, N), C, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::max(N, C, B), C, glm::epsilon()) ? 0 : 1; - - T const D = static_cast(3); - Error += glm::equal(glm::max(D, N, B, C), D, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::max(B, D, N, C), D, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::max(C, N, D, B), D, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::max(C, B, D, N), D, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::max(B, C, N, D), D, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::max(N, C, B, D), D, glm::epsilon()) ? 0 : 1; - - return Error; -} - -template -static int test_max_nan() -{ - int Error = 0; - - T const B = static_cast(1); - T const N = static_cast(GLM_NAN(T)); - Error += glm::isnan(glm::max(N, B)) ? 0 : 1; - Error += !glm::isnan(glm::max(B, N)) ? 0 : 1; - - T const C = static_cast(2); - Error += glm::isnan(glm::max(N, B, C)) ? 0 : 1; - Error += !glm::isnan(glm::max(B, N, C)) ? 0 : 1; - Error += !glm::isnan(glm::max(C, N, B)) ? 0 : 1; - Error += !glm::isnan(glm::max(C, B, N)) ? 0 : 1; - Error += !glm::isnan(glm::max(B, C, N)) ? 0 : 1; - Error += glm::isnan(glm::max(N, C, B)) ? 0 : 1; - - T const D = static_cast(3); - Error += !glm::isnan(glm::max(D, N, B, C)) ? 0 : 1; - Error += !glm::isnan(glm::max(B, D, N, C)) ? 0 : 1; - Error += !glm::isnan(glm::max(C, N, D, B)) ? 0 : 1; - Error += !glm::isnan(glm::max(C, B, D, N)) ? 0 : 1; - Error += !glm::isnan(glm::max(B, C, N, D)) ? 0 : 1; - Error += glm::isnan(glm::max(N, C, B, D)) ? 0 : 1; - - return Error; -} - -template -static int test_fmin() -{ - int Error = 0; - - T const B = static_cast(1); - T const N = static_cast(GLM_NAN(T)); - Error += glm::equal(glm::fmin(N, B), B, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::fmin(B, N), B, glm::epsilon()) ? 0 : 1; - - T const C = static_cast(2); - Error += glm::equal(glm::fmin(N, B, C), B, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::fmin(B, N, C), B, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::fmin(C, N, B), B, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::fmin(C, B, N), B, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::fmin(B, C, N), B, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::fmin(N, C, B), B, glm::epsilon()) ? 0 : 1; - - T const D = static_cast(3); - Error += glm::equal(glm::fmin(D, N, B, C), B, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::fmin(B, D, N, C), B, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::fmin(C, N, D, B), B, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::fmin(C, B, D, N), B, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::fmin(B, C, N, D), B, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::fmin(N, C, B, D), B, glm::epsilon()) ? 0 : 1; - - return Error; -} - -template -static int test_fmax() -{ - int Error = 0; - - T const B = static_cast(1); - T const N = static_cast(GLM_NAN(T)); - Error += glm::equal(glm::fmax(N, B), B, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::fmax(B, N), B, glm::epsilon()) ? 0 : 1; - - T const C = static_cast(2); - Error += glm::equal(glm::fmax(N, B, C), C, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::fmax(B, N, C), C, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::fmax(C, N, B), C, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::fmax(C, B, N), C, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::fmax(B, C, N), C, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::fmax(N, C, B), C, glm::epsilon()) ? 0 : 1; - - T const D = static_cast(3); - Error += glm::equal(glm::fmax(D, N, B, C), D, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::fmax(B, D, N, C), D, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::fmax(C, N, D, B), D, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::fmax(C, B, D, N), D, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::fmax(B, C, N, D), D, glm::epsilon()) ? 0 : 1; - Error += glm::equal(glm::fmax(N, C, B, D), D, glm::epsilon()) ? 0 : 1; - - return Error; -} - -static int test_clamp() -{ - int Error = 0; - - float A = glm::clamp(0.5f); - Error += glm::equal(A, 0.5f, 0.00001f) ? 0 : 1; - - float B = glm::clamp(0.0f); - Error += glm::equal(B, 0.0f, 0.00001f) ? 0 : 1; - - float C = glm::clamp(1.0f); - Error += glm::equal(C, 1.0f, 0.00001f) ? 0 : 1; - - float D = glm::clamp(-0.5f); - Error += glm::equal(D, 0.0f, 0.00001f) ? 0 : 1; - - float E = glm::clamp(1.5f); - Error += glm::equal(E, 1.0f, 0.00001f) ? 0 : 1; - - return Error; -} - -static int test_repeat() -{ - int Error = 0; - - float A = glm::repeat(0.5f); - Error += glm::equal(A, 0.5f, 0.00001f) ? 0 : 1; - - float B = glm::repeat(0.0f); - Error += glm::equal(B, 0.0f, 0.00001f) ? 0 : 1; - - float C = glm::repeat(1.0f); - Error += glm::equal(C, 0.0f, 0.00001f) ? 0 : 1; - - float D = glm::repeat(-0.5f); - Error += glm::equal(D, 0.5f, 0.00001f) ? 0 : 1; - - float E = glm::repeat(1.5f); - Error += glm::equal(E, 0.5f, 0.00001f) ? 0 : 1; - - float F = glm::repeat(0.9f); - Error += glm::equal(F, 0.9f, 0.00001f) ? 0 : 1; - - return Error; -} - -static int test_mirrorClamp() -{ - int Error = 0; - - float A = glm::mirrorClamp(0.5f); - Error += glm::equal(A, 0.5f, 0.00001f) ? 0 : 1; - - float B = glm::mirrorClamp(0.0f); - Error += glm::equal(B, 0.0f, 0.00001f) ? 0 : 1; - - float C = glm::mirrorClamp(1.1f); - Error += glm::equal(C, 0.1f, 0.00001f) ? 0 : 1; - - float D = glm::mirrorClamp(-0.5f); - Error += glm::equal(D, 0.5f, 0.00001f) ? 0 : 1; - - float E = glm::mirrorClamp(1.5f); - Error += glm::equal(E, 0.5f, 0.00001f) ? 0 : 1; - - float F = glm::mirrorClamp(0.9f); - Error += glm::equal(F, 0.9f, 0.00001f) ? 0 : 1; - - float G = glm::mirrorClamp(3.1f); - Error += glm::equal(G, 0.1f, 0.00001f) ? 0 : 1; - - float H = glm::mirrorClamp(-3.1f); - Error += glm::equal(H, 0.1f, 0.00001f) ? 0 : 1; - - float I = glm::mirrorClamp(-0.9f); - Error += glm::equal(I, 0.9f, 0.00001f) ? 0 : 1; - - return Error; -} - -static int test_mirrorRepeat() -{ - int Error = 0; - - float A = glm::mirrorRepeat(0.5f); - Error += glm::equal(A, 0.5f, 0.00001f) ? 0 : 1; - - float B = glm::mirrorRepeat(0.0f); - Error += glm::equal(B, 0.0f, 0.00001f) ? 0 : 1; - - float C = glm::mirrorRepeat(1.0f); - Error += glm::equal(C, 1.0f, 0.00001f) ? 0 : 1; - - float D = glm::mirrorRepeat(-0.5f); - Error += glm::equal(D, 0.5f, 0.00001f) ? 0 : 1; - - float E = glm::mirrorRepeat(1.5f); - Error += glm::equal(E, 0.5f, 0.00001f) ? 0 : 1; - - float F = glm::mirrorRepeat(0.9f); - Error += glm::equal(F, 0.9f, 0.00001f) ? 0 : 1; - - float G = glm::mirrorRepeat(3.0f); - Error += glm::equal(G, 1.0f, 0.00001f) ? 0 : 1; - - float H = glm::mirrorRepeat(-3.0f); - Error += glm::equal(H, 1.0f, 0.00001f) ? 0 : 1; - - float I = glm::mirrorRepeat(-1.0f); - Error += glm::equal(I, 1.0f, 0.00001f) ? 0 : 1; - - return Error; -} - -static int test_iround() -{ - int Error = 0; - - for(float f = 0.0f; f < 3.1f; f += 0.05f) - { - int RoundFast = static_cast(glm::iround(f)); - int RoundSTD = static_cast(glm::round(f)); - Error += RoundFast == RoundSTD ? 0 : 1; - assert(!Error); - } - - return Error; -} - -static int test_uround() -{ - int Error = 0; - - for(float f = 0.0f; f < 3.1f; f += 0.05f) - { - int RoundFast = static_cast(glm::uround(f)); - int RoundSTD = static_cast(glm::round(f)); - Error += RoundFast == RoundSTD ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_min(); - Error += test_min(); - Error += test_min_nan(); - Error += test_min_nan(); - - Error += test_max(); - Error += test_max(); - Error += test_max_nan(); - Error += test_max_nan(); - - Error += test_fmin(); - Error += test_fmin(); - - Error += test_fmax(); - Error += test_fmax(); - - Error += test_clamp(); - Error += test_repeat(); - Error += test_mirrorClamp(); - Error += test_mirrorRepeat(); - - Error += test_iround(); - Error += test_uround(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_scalar_constants.cpp b/3rdparty/glm/source/test/ext/ext_scalar_constants.cpp deleted file mode 100644 index 3af7099..0000000 --- a/3rdparty/glm/source/test/ext/ext_scalar_constants.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include - -template -static int test_epsilon() -{ - int Error = 0; - - valType const Test = glm::epsilon(); - Error += Test > static_cast(0) ? 0 : 1; - - return Error; -} - -template -static int test_pi() -{ - int Error = 0; - - valType const Test = glm::pi(); - Error += Test > static_cast(3.14) ? 0 : 1; - Error += Test < static_cast(3.15) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_epsilon(); - Error += test_epsilon(); - Error += test_pi(); - Error += test_pi(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_scalar_int_sized.cpp b/3rdparty/glm/source/test/ext/ext_scalar_int_sized.cpp deleted file mode 100644 index b55c6ca..0000000 --- a/3rdparty/glm/source/test/ext/ext_scalar_int_sized.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT - static_assert(sizeof(glm::int8) == 1, "int8 size isn't 1 byte on this platform"); - static_assert(sizeof(glm::int16) == 2, "int16 size isn't 2 bytes on this platform"); - static_assert(sizeof(glm::int32) == 4, "int32 size isn't 4 bytes on this platform"); - static_assert(sizeof(glm::int64) == 8, "int64 size isn't 8 bytes on this platform"); - static_assert(sizeof(glm::int16) == sizeof(short), "signed short size isn't 4 bytes on this platform"); - static_assert(sizeof(glm::int32) == sizeof(int), "signed int size isn't 4 bytes on this platform"); -#endif - -static int test_size() -{ - int Error = 0; - - Error += sizeof(glm::int8) == 1 ? 0 : 1; - Error += sizeof(glm::int16) == 2 ? 0 : 1; - Error += sizeof(glm::int32) == 4 ? 0 : 1; - Error += sizeof(glm::int64) == 8 ? 0 : 1; - - return Error; -} - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::int8) < sizeof(glm::int16) ? 0 : 1; - Error += sizeof(glm::int16) < sizeof(glm::int32) ? 0 : 1; - Error += sizeof(glm::int32) < sizeof(glm::int64) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_size(); - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_scalar_integer.cpp b/3rdparty/glm/source/test/ext/ext_scalar_integer.cpp deleted file mode 100644 index f169e8a..0000000 --- a/3rdparty/glm/source/test/ext/ext_scalar_integer.cpp +++ /dev/null @@ -1,686 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#if GLM_LANG & GLM_LANG_CXX11_FLAG -#include - -namespace isPowerOfTwo -{ - template - struct type - { - genType Value; - bool Return; - }; - - int test_int16() - { - type const Data[] = - { - {0x0001, true}, - {0x0002, true}, - {0x0004, true}, - {0x0080, true}, - {0x0000, true}, - {0x0003, false} - }; - - int Error = 0; - - for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - bool Result = glm::isPowerOfTwo(Data[i].Value); - Error += Data[i].Return == Result ? 0 : 1; - } - - return Error; - } - - int test_uint16() - { - type const Data[] = - { - {0x0001, true}, - {0x0002, true}, - {0x0004, true}, - {0x0000, true}, - {0x0000, true}, - {0x0003, false} - }; - - int Error = 0; - - for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - bool Result = glm::isPowerOfTwo(Data[i].Value); - Error += Data[i].Return == Result ? 0 : 1; - } - - return Error; - } - - int test_int32() - { - type const Data[] = - { - {0x00000001, true}, - {0x00000002, true}, - {0x00000004, true}, - {0x0000000f, false}, - {0x00000000, true}, - {0x00000003, false} - }; - - int Error = 0; - - for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - bool Result = glm::isPowerOfTwo(Data[i].Value); - Error += Data[i].Return == Result ? 0 : 1; - } - - return Error; - } - - int test_uint32() - { - type const Data[] = - { - {0x00000001, true}, - {0x00000002, true}, - {0x00000004, true}, - {0x80000000, true}, - {0x00000000, true}, - {0x00000003, false} - }; - - int Error = 0; - - for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - bool Result = glm::isPowerOfTwo(Data[i].Value); - Error += Data[i].Return == Result ? 0 : 1; - } - - return Error; - } - - int test() - { - int Error = 0; - - Error += test_int16(); - Error += test_uint16(); - Error += test_int32(); - Error += test_uint32(); - - return Error; - } -}//isPowerOfTwo - -namespace nextPowerOfTwo_advanced -{ - template - GLM_FUNC_QUALIFIER genIUType highestBitValue(genIUType Value) - { - genIUType tmp = Value; - genIUType result = genIUType(0); - while(tmp) - { - result = (tmp & (~tmp + 1)); // grab lowest bit - tmp &= ~result; // clear lowest bit - } - return result; - } - - template - GLM_FUNC_QUALIFIER genType nextPowerOfTwo_loop(genType value) - { - return glm::isPowerOfTwo(value) ? value : highestBitValue(value) << 1; - } - - template - struct type - { - genType Value; - genType Return; - }; - - int test_int32() - { - type const Data[] = - { - {0x0000ffff, 0x00010000}, - {-3, -4}, - {-8, -8}, - {0x00000001, 0x00000001}, - {0x00000002, 0x00000002}, - {0x00000004, 0x00000004}, - {0x00000007, 0x00000008}, - {0x0000fff0, 0x00010000}, - {0x0000f000, 0x00010000}, - {0x08000000, 0x08000000}, - {0x00000000, 0x00000000}, - {0x00000003, 0x00000004} - }; - - int Error(0); - - for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - glm::int32 Result = glm::nextPowerOfTwo(Data[i].Value); - Error += Data[i].Return == Result ? 0 : 1; - } - - return Error; - } - - int test_uint32() - { - type const Data[] = - { - {0x00000001, 0x00000001}, - {0x00000002, 0x00000002}, - {0x00000004, 0x00000004}, - {0x00000007, 0x00000008}, - {0x0000ffff, 0x00010000}, - {0x0000fff0, 0x00010000}, - {0x0000f000, 0x00010000}, - {0x80000000, 0x80000000}, - {0x00000000, 0x00000000}, - {0x00000003, 0x00000004} - }; - - int Error(0); - - for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - glm::uint32 Result = glm::nextPowerOfTwo(Data[i].Value); - Error += Data[i].Return == Result ? 0 : 1; - } - - return Error; - } - - int perf() - { - int Error(0); - - std::vector v; - v.resize(100000000); - - std::clock_t Timestramp0 = std::clock(); - - for(glm::uint32 i = 0, n = static_cast(v.size()); i < n; ++i) - v[i] = nextPowerOfTwo_loop(i); - - std::clock_t Timestramp1 = std::clock(); - - for(glm::uint32 i = 0, n = static_cast(v.size()); i < n; ++i) - v[i] = glm::nextPowerOfTwo(i); - - std::clock_t Timestramp2 = std::clock(); - - std::printf("nextPowerOfTwo_loop: %d clocks\n", static_cast(Timestramp1 - Timestramp0)); - std::printf("glm::nextPowerOfTwo: %d clocks\n", static_cast(Timestramp2 - Timestramp1)); - - return Error; - } - - int test() - { - int Error(0); - - Error += test_int32(); - Error += test_uint32(); - - return Error; - } -}//namespace nextPowerOfTwo_advanced - -namespace prevPowerOfTwo -{ - template - int run() - { - int Error = 0; - - T const A = glm::prevPowerOfTwo(static_cast(7)); - Error += A == static_cast(4) ? 0 : 1; - - T const B = glm::prevPowerOfTwo(static_cast(15)); - Error += B == static_cast(8) ? 0 : 1; - - T const C = glm::prevPowerOfTwo(static_cast(31)); - Error += C == static_cast(16) ? 0 : 1; - - T const D = glm::prevPowerOfTwo(static_cast(32)); - Error += D == static_cast(32) ? 0 : 1; - - return Error; - } - - int test() - { - int Error = 0; - - Error += run(); - Error += run(); - Error += run(); - Error += run(); - - Error += run(); - Error += run(); - Error += run(); - Error += run(); - - return Error; - } -}//namespace prevPowerOfTwo - -namespace nextPowerOfTwo -{ - template - int run() - { - int Error = 0; - - T const A = glm::nextPowerOfTwo(static_cast(7)); - Error += A == static_cast(8) ? 0 : 1; - - T const B = glm::nextPowerOfTwo(static_cast(15)); - Error += B == static_cast(16) ? 0 : 1; - - T const C = glm::nextPowerOfTwo(static_cast(31)); - Error += C == static_cast(32) ? 0 : 1; - - T const D = glm::nextPowerOfTwo(static_cast(32)); - Error += D == static_cast(32) ? 0 : 1; - - return Error; - } - - int test() - { - int Error = 0; - - Error += run(); - Error += run(); - Error += run(); - Error += run(); - - Error += run(); - Error += run(); - Error += run(); - Error += run(); - - return Error; - } -}//namespace nextPowerOfTwo - -namespace prevMultiple -{ - template - struct type - { - genIUType Source; - genIUType Multiple; - genIUType Return; - }; - - template - int run() - { - type const Data[] = - { - {8, 3, 6}, - {7, 7, 7} - }; - - int Error = 0; - - for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - T const Result = glm::prevMultiple(Data[i].Source, Data[i].Multiple); - Error += Data[i].Return == Result ? 0 : 1; - } - - return Error; - } - - int test() - { - int Error = 0; - - Error += run(); - Error += run(); - Error += run(); - Error += run(); - - Error += run(); - Error += run(); - Error += run(); - Error += run(); - - return Error; - } -}//namespace prevMultiple - -namespace nextMultiple -{ - static glm::uint const Multiples = 128; - - int perf_nextMultiple(glm::uint Samples) - { - std::vector Results(Samples * Multiples); - - std::chrono::high_resolution_clock::time_point t0 = std::chrono::high_resolution_clock::now(); - - for(glm::uint Source = 0; Source < Samples; ++Source) - for(glm::uint Multiple = 0; Multiple < Multiples; ++Multiple) - { - Results[Source * Multiples + Multiple] = glm::nextMultiple(Source, Multiples); - } - - std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now(); - - std::printf("- glm::nextMultiple Time %d microseconds\n", static_cast(std::chrono::duration_cast(t1 - t0).count())); - - glm::uint Result = 0; - for(std::size_t i = 0, n = Results.size(); i < n; ++i) - Result += Results[i]; - - return Result > 0 ? 0 : 1; - } - - template - GLM_FUNC_QUALIFIER T nextMultipleMod(T Source, T Multiple) - { - T const Tmp = Source - static_cast(1); - return Tmp + (Multiple - (Tmp % Multiple)); - } - - int perf_nextMultipleMod(glm::uint Samples) - { - std::vector Results(Samples * Multiples); - - std::chrono::high_resolution_clock::time_point t0 = std::chrono::high_resolution_clock::now(); - - for(glm::uint Multiple = 0; Multiple < Multiples; ++Multiple) - for (glm::uint Source = 0; Source < Samples; ++Source) - { - Results[Source * Multiples + Multiple] = nextMultipleMod(Source, Multiples); - } - - std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now(); - - std::printf("- nextMultipleMod Time %d microseconds\n", static_cast(std::chrono::duration_cast(t1 - t0).count())); - - glm::uint Result = 0; - for(std::size_t i = 0, n = Results.size(); i < n; ++i) - Result += Results[i]; - - return Result > 0 ? 0 : 1; - } - - template - GLM_FUNC_QUALIFIER T nextMultipleNeg(T Source, T Multiple) - { - if(Source > static_cast(0)) - { - T const Tmp = Source - static_cast(1); - return Tmp + (Multiple - (Tmp % Multiple)); - } - else - return Source + (-Source % Multiple); - } - - int perf_nextMultipleNeg(glm::uint Samples) - { - std::vector Results(Samples * Multiples); - - std::chrono::high_resolution_clock::time_point t0 = std::chrono::high_resolution_clock::now(); - - for(glm::uint Source = 0; Source < Samples; ++Source) - for(glm::uint Multiple = 0; Multiple < Multiples; ++Multiple) - { - Results[Source * Multiples + Multiple] = nextMultipleNeg(Source, Multiples); - } - - std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now(); - - std::printf("- nextMultipleNeg Time %d microseconds\n", static_cast(std::chrono::duration_cast(t1 - t0).count())); - - glm::uint Result = 0; - for (std::size_t i = 0, n = Results.size(); i < n; ++i) - Result += Results[i]; - - return Result > 0 ? 0 : 1; - } - - template - GLM_FUNC_QUALIFIER T nextMultipleUFloat(T Source, T Multiple) - { - return Source + (Multiple - std::fmod(Source, Multiple)); - } - - int perf_nextMultipleUFloat(glm::uint Samples) - { - std::vector Results(Samples * Multiples); - - std::chrono::high_resolution_clock::time_point t0 = std::chrono::high_resolution_clock::now(); - - for(glm::uint Source = 0; Source < Samples; ++Source) - for(glm::uint Multiple = 0; Multiple < Multiples; ++Multiple) - { - Results[Source * Multiples + Multiple] = nextMultipleUFloat(static_cast(Source), static_cast(Multiples)); - } - - std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now(); - - std::printf("- nextMultipleUFloat Time %d microseconds\n", static_cast(std::chrono::duration_cast(t1 - t0).count())); - - float Result = 0; - for (std::size_t i = 0, n = Results.size(); i < n; ++i) - Result += Results[i]; - - return Result > 0.0f ? 0 : 1; - } - - template - GLM_FUNC_QUALIFIER T nextMultipleFloat(T Source, T Multiple) - { - if(Source > static_cast(0)) - return Source + (Multiple - std::fmod(Source, Multiple)); - else - return Source + std::fmod(-Source, Multiple); - } - - int perf_nextMultipleFloat(glm::uint Samples) - { - std::vector Results(Samples * Multiples); - - std::chrono::high_resolution_clock::time_point t0 = std::chrono::high_resolution_clock::now(); - - for(glm::uint Source = 0; Source < Samples; ++Source) - for(glm::uint Multiple = 0; Multiple < Multiples; ++Multiple) - { - Results[Source * Multiples + Multiple] = nextMultipleFloat(static_cast(Source), static_cast(Multiples)); - } - - std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now(); - - std::printf("- nextMultipleFloat Time %d microseconds\n", static_cast(std::chrono::duration_cast(t1 - t0).count())); - - float Result = 0; - for (std::size_t i = 0, n = Results.size(); i < n; ++i) - Result += Results[i]; - - return Result > 0.0f ? 0 : 1; - } - - template - struct type - { - genIUType Source; - genIUType Multiple; - genIUType Return; - }; - - template - int test_uint() - { - type const Data[] = - { - { 3, 4, 4 }, - { 6, 3, 6 }, - { 5, 3, 6 }, - { 7, 7, 7 }, - { 0, 1, 0 }, - { 8, 3, 9 } - }; - - int Error = 0; - - for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - T const Result0 = glm::nextMultiple(Data[i].Source, Data[i].Multiple); - Error += Data[i].Return == Result0 ? 0 : 1; - assert(!Error); - - T const Result1 = nextMultipleMod(Data[i].Source, Data[i].Multiple); - Error += Data[i].Return == Result1 ? 0 : 1; - assert(!Error); - } - - return Error; - } - - int perf() - { - int Error = 0; - - glm::uint const Samples = 10000; - - for(int i = 0; i < 4; ++i) - { - std::printf("Run %d :\n", i); - Error += perf_nextMultiple(Samples); - Error += perf_nextMultipleMod(Samples); - Error += perf_nextMultipleNeg(Samples); - Error += perf_nextMultipleUFloat(Samples); - Error += perf_nextMultipleFloat(Samples); - std::printf("\n"); - } - - return Error; - } - - int test() - { - int Error = 0; - - Error += test_uint(); - Error += test_uint(); - Error += test_uint(); - Error += test_uint(); - - Error += test_uint(); - Error += test_uint(); - Error += test_uint(); - Error += test_uint(); - - return Error; - } -}//namespace nextMultiple - -namespace findNSB -{ - template - struct type - { - T Source; - int SignificantBitCount; - int Return; - }; - - template - int run() - { - type const Data[] = - { - { 0x00, 1,-1 }, - { 0x01, 2,-1 }, - { 0x02, 2,-1 }, - { 0x06, 3,-1 }, - { 0x01, 1, 0 }, - { 0x03, 1, 0 }, - { 0x03, 2, 1 }, - { 0x07, 2, 1 }, - { 0x05, 2, 2 }, - { 0x0D, 2, 2 } - }; - - int Error = 0; - - for (std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - int const Result0 = glm::findNSB(Data[i].Source, Data[i].SignificantBitCount); - Error += Data[i].Return == Result0 ? 0 : 1; - assert(!Error); - } - - return Error; - } - - int test() - { - int Error = 0; - - Error += run(); - Error += run(); - Error += run(); - Error += run(); - - Error += run(); - Error += run(); - Error += run(); - Error += run(); - - return Error; - } -}//namespace findNSB - -int main() -{ - int Error = 0; - - Error += findNSB::test(); - - Error += isPowerOfTwo::test(); - Error += prevPowerOfTwo::test(); - Error += nextPowerOfTwo::test(); - Error += nextPowerOfTwo_advanced::test(); - Error += prevMultiple::test(); - Error += nextMultiple::test(); - -# ifdef NDEBUG - Error += nextPowerOfTwo_advanced::perf(); - Error += nextMultiple::perf(); -# endif//NDEBUG - - return Error; -} - -#else - -int main() -{ - return 0; -} - -#endif diff --git a/3rdparty/glm/source/test/ext/ext_scalar_packing.cpp b/3rdparty/glm/source/test/ext/ext_scalar_packing.cpp deleted file mode 100644 index 77616e3..0000000 --- a/3rdparty/glm/source/test/ext/ext_scalar_packing.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include -#include - -int test_packUnorm() -{ - int Error = 0; - - - return Error; -} - -int test_packSnorm() -{ - int Error = 0; - - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_packUnorm(); - Error += test_packSnorm(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_scalar_reciprocal.cpp b/3rdparty/glm/source/test/ext/ext_scalar_reciprocal.cpp deleted file mode 100644 index ebba10d..0000000 --- a/3rdparty/glm/source/test/ext/ext_scalar_reciprocal.cpp +++ /dev/null @@ -1,171 +0,0 @@ -#include -#include -#include - -static int test_sec() -{ - int Error = 0; - - Error += glm::equal(glm::sec(0.0), 1.0, 0.01) ? 0 : 1; - Error += glm::equal(glm::sec(glm::pi() * 2.0), 1.0, 0.01) ? 0 : 1; - Error += glm::equal(glm::sec(glm::pi() * -2.0), 1.0, 0.01) ? 0 : 1; - Error += glm::equal(glm::sec(glm::pi() * 1.0), -1.0, 0.01) ? 0 : 1; - Error += glm::equal(glm::sec(glm::pi() * -1.0), -1.0, 0.01) ? 0 : 1; - - return Error; -} - -static int test_csc() -{ - int Error = 0; - - double const a = glm::csc(glm::pi() * 0.5); - Error += glm::equal(a, 1.0, 0.01) ? 0 : 1; - double const b = glm::csc(glm::pi() * -0.5); - Error += glm::equal(b, -1.0, 0.01) ? 0 : 1; - - return Error; -} - -static int test_cot() -{ - int Error = 0; - - double const a = glm::cot(glm::pi() * 0.5); - Error += glm::equal(a, 0.0, 0.01) ? 0 : 1; - double const b = glm::cot(glm::pi() * -0.5); - Error += glm::equal(b, 0.0, 0.01) ? 0 : 1; - - return Error; -} - -static int test_asec() -{ - int Error = 0; - - Error += glm::equal(glm::asec(100000.0), glm::pi() * 0.5, 0.01) ? 0 : 1; - Error += glm::equal(glm::asec(-100000.0), glm::pi() * 0.5, 0.01) ? 0 : 1; - - return Error; -} - -static int test_acsc() -{ - int Error = 0; - - Error += glm::equal(glm::acsc(100000.0), 0.0, 0.01) ? 0 : 1; - Error += glm::equal(glm::acsc(-100000.0), 0.0, 0.01) ? 0 : 1; - - return Error; -} - -static int test_acot() -{ - int Error = 0; - - Error += glm::equal(glm::acot(100000.0), 0.0, 0.01) ? 0 : 1; - Error += glm::equal(glm::acot(-100000.0), glm::pi(), 0.01) ? 0 : 1; - Error += glm::equal(glm::acot(0.0), glm::pi() * 0.5, 0.01) ? 0 : 1; - - return Error; -} - -static int test_sech() -{ - int Error = 0; - - Error += glm::equal(glm::sech(100000.0), 0.0, 0.01) ? 0 : 1; - Error += glm::equal(glm::sech(-100000.0), 0.0, 0.01) ? 0 : 1; - Error += glm::equal(glm::sech(0.0), 1.0, 0.01) ? 0 : 1; - - return Error; -} - -static int test_csch() -{ - int Error = 0; - - Error += glm::equal(glm::csch(100000.0), 0.0, 0.01) ? 0 : 1; - Error += glm::equal(glm::csch(-100000.0), 0.0, 0.01) ? 0 : 1; - - return Error; -} - -static int test_coth() -{ - int Error = 0; - - double const a = glm::coth(100.0); - Error += glm::equal(a, 1.0, 0.01) ? 0 : 1; - - double const b = glm::coth(-100.0); - Error += glm::equal(b, -1.0, 0.01) ? 0 : 1; - - return Error; -} - -static int test_asech() -{ - int Error = 0; - - double const a = glm::asech(1.0); - Error += glm::equal(a, 0.0, 0.01) ? 0 : 1; - - return Error; -} - -static int test_acsch() -{ - int Error = 0; - - Error += glm::acsch(0.01) > 1.0 ? 0 : 1; - Error += glm::acsch(-0.01) < -1.0 ? 0 : 1; - - Error += glm::equal(glm::acsch(100.0), 0.0, 0.01) ? 0 : 1; - Error += glm::equal(glm::acsch(-100.0), 0.0, 0.01) ? 0 : 1; - - return Error; -} - -static int test_acoth() -{ - int Error = 0; - - double const a = glm::acoth(1.00001); - Error += a > 6.0 ? 0 : 1; - - double const b = glm::acoth(-1.00001); - Error += b < -6.0 ? 0 : 1; - - double const c = glm::acoth(10000.0); - Error += glm::equal(c, 0.0, 0.01) ? 0 : 1; - - double const d = glm::acoth(-10000.0); - Error += glm::equal(d, 0.0, 0.01) ? 0 : 1; - - return Error; -} - - -int main() -{ - int Error = 0; - - Error += test_sec(); - Error += test_csc(); - Error += test_cot(); - - Error += test_asec(); - Error += test_acsc(); - Error += test_acot(); - - Error += test_sech(); - Error += test_csch(); - Error += test_coth(); - - Error += test_asech(); - Error += test_acsch(); - Error += test_acoth(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_scalar_relational.cpp b/3rdparty/glm/source/test/ext/ext_scalar_relational.cpp deleted file mode 100644 index 61f1999..0000000 --- a/3rdparty/glm/source/test/ext/ext_scalar_relational.cpp +++ /dev/null @@ -1,106 +0,0 @@ -#include -#include -#include -#include - -static int test_equal_epsilon() -{ -# if GLM_CONFIG_CONSTEXP == GLM_ENABLE - static_assert(glm::equal(1.01f, 1.02f, 0.1f), "GLM: Failed constexpr"); - static_assert(!glm::equal(1.01f, 1.02f, 0.001f), "GLM: Failed constexpr"); -# endif - - int Error = 0; - - Error += glm::equal(1.01f, 1.02f, 0.1f) ? 0 : 1; - Error += !glm::equal(1.01f, 1.02f, 0.001f) ? 0 : 1; - - return Error; -} - -static int test_notEqual_epsilon() -{ -# if GLM_CONFIG_CONSTEXP == GLM_ENABLE - static_assert(glm::notEqual(1.01f, 1.02f, 0.001f), "GLM: Failed constexpr"); - static_assert(!glm::notEqual(1.01f, 1.02f, 0.1f), "GLM: Failed constexpr"); -# endif - - int Error = 0; - - Error += glm::notEqual(1.01f, 1.02f, 0.001f) ? 0 : 1; - Error += !glm::notEqual(1.01f, 1.02f, 0.1f) ? 0 : 1; - - return Error; -} - -static int test_equal_ulps() -{ - int Error = 0; - - float const ULP1Plus = glm::nextFloat(1.0f); - Error += glm::equal(1.0f, ULP1Plus, 1) ? 0 : 1; - - float const ULP2Plus = glm::nextFloat(ULP1Plus); - Error += !glm::equal(1.0f, ULP2Plus, 1) ? 0 : 1; - - float const ULP1Minus = glm::prevFloat(1.0f); - Error += glm::equal(1.0f, ULP1Minus, 1) ? 0 : 1; - - float const ULP2Minus = glm::prevFloat(ULP1Minus); - Error += !glm::equal(1.0f, ULP2Minus, 1) ? 0 : 1; - - return Error; -} - -static int test_notEqual_ulps() -{ - int Error = 0; - - float const ULP1Plus = glm::nextFloat(1.0f); - Error += !glm::notEqual(1.0f, ULP1Plus, 1) ? 0 : 1; - - float const ULP2Plus = glm::nextFloat(ULP1Plus); - Error += glm::notEqual(1.0f, ULP2Plus, 1) ? 0 : 1; - - float const ULP1Minus = glm::prevFloat(1.0f); - Error += !glm::notEqual(1.0f, ULP1Minus, 1) ? 0 : 1; - - float const ULP2Minus = glm::prevFloat(ULP1Minus); - Error += glm::notEqual(1.0f, ULP2Minus, 1) ? 0 : 1; - - return Error; -} - -static int test_equal_sign() -{ - int Error = 0; - - Error += !glm::equal(-0.0f, 0.0f, 2) ? 0 : 1; - Error += !glm::equal(-0.0, 0.0, 2) ? 0 : 1; - - Error += !glm::equal(-1.0f, 2.0f, 2) ? 0 : 1; - Error += !glm::equal(-1.0, 2.0, 2) ? 0 : 1; - - Error += !glm::equal(-0.00001f, 1.00000f, 2) ? 0 : 1; - Error += !glm::equal(-0.00001, 1.00000, 2) ? 0 : 1; - - Error += !glm::equal(-1.0f, 1.0f, 2) ? 0 : 1; - Error += !glm::equal(-1.0, 1.0, 2) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_equal_epsilon(); - Error += test_notEqual_epsilon(); - - Error += test_equal_ulps(); - Error += test_notEqual_ulps(); - - Error += test_equal_sign(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_scalar_uint_sized.cpp b/3rdparty/glm/source/test/ext/ext_scalar_uint_sized.cpp deleted file mode 100644 index 1122947..0000000 --- a/3rdparty/glm/source/test/ext/ext_scalar_uint_sized.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT - static_assert(sizeof(glm::uint8) == 1, "uint8 size isn't 1 byte on this platform"); - static_assert(sizeof(glm::uint16) == 2, "uint16 size isn't 2 bytes on this platform"); - static_assert(sizeof(glm::uint32) == 4, "uint32 size isn't 4 bytes on this platform"); - static_assert(sizeof(glm::uint64) == 8, "uint64 size isn't 8 bytes on this platform"); - static_assert(sizeof(glm::uint16) == sizeof(unsigned short), "unsigned short size isn't 4 bytes on this platform"); - static_assert(sizeof(glm::uint32) == sizeof(unsigned int), "unsigned int size isn't 4 bytes on this platform"); -#endif - -static int test_size() -{ - int Error = 0; - - Error += sizeof(glm::uint8) == 1 ? 0 : 1; - Error += sizeof(glm::uint16) == 2 ? 0 : 1; - Error += sizeof(glm::uint32) == 4 ? 0 : 1; - Error += sizeof(glm::uint64) == 8 ? 0 : 1; - - return Error; -} - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::uint8) < sizeof(glm::uint16) ? 0 : 1; - Error += sizeof(glm::uint16) < sizeof(glm::uint32) ? 0 : 1; - Error += sizeof(glm::uint32) < sizeof(glm::uint64) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_size(); - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_scalar_ulp.cpp b/3rdparty/glm/source/test/ext/ext_scalar_ulp.cpp deleted file mode 100644 index a19b774..0000000 --- a/3rdparty/glm/source/test/ext/ext_scalar_ulp.cpp +++ /dev/null @@ -1,96 +0,0 @@ -#include -#include - -static int test_ulp_float_dist() -{ - int Error = 0; - - float A = 1.0f; - - float B = glm::nextFloat(A); - Error += glm::notEqual(A, B, 0) ? 0 : 1; - float C = glm::prevFloat(B); - Error += glm::equal(A, C, 0) ? 0 : 1; - - int D = glm::floatDistance(A, B); - Error += D == 1 ? 0 : 1; - int E = glm::floatDistance(A, C); - Error += E == 0 ? 0 : 1; - - return Error; -} - -static int test_ulp_float_step() -{ - int Error = 0; - - float A = 1.0f; - - for(int i = 10; i < 1000; i *= 10) - { - float B = glm::nextFloat(A, i); - Error += glm::notEqual(A, B, 0) ? 0 : 1; - float C = glm::prevFloat(B, i); - Error += glm::equal(A, C, 0) ? 0 : 1; - - int D = glm::floatDistance(A, B); - Error += D == i ? 0 : 1; - int E = glm::floatDistance(A, C); - Error += E == 0 ? 0 : 1; - } - - return Error; -} - -static int test_ulp_double_dist() -{ - int Error = 0; - - double A = 1.0; - - double B = glm::nextFloat(A); - Error += glm::notEqual(A, B, 0) ? 0 : 1; - double C = glm::prevFloat(B); - Error += glm::equal(A, C, 0) ? 0 : 1; - - glm::int64 const D = glm::floatDistance(A, B); - Error += D == 1 ? 0 : 1; - glm::int64 const E = glm::floatDistance(A, C); - Error += E == 0 ? 0 : 1; - - return Error; -} - -static int test_ulp_double_step() -{ - int Error = 0; - - double A = 1.0; - - for(int i = 10; i < 1000; i *= 10) - { - double B = glm::nextFloat(A, i); - Error += glm::notEqual(A, B, 0) ? 0 : 1; - double C = glm::prevFloat(B, i); - Error += glm::equal(A, C, 0) ? 0 : 1; - - glm::int64 const D = glm::floatDistance(A, B); - Error += D == i ? 0 : 1; - glm::int64 const E = glm::floatDistance(A, C); - Error += E == 0 ? 0 : 1; - } - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_ulp_float_dist(); - Error += test_ulp_float_step(); - Error += test_ulp_double_dist(); - Error += test_ulp_double_step(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_vec1.cpp b/3rdparty/glm/source/test/ext/ext_vec1.cpp deleted file mode 100644 index fc0b931..0000000 --- a/3rdparty/glm/source/test/ext/ext_vec1.cpp +++ /dev/null @@ -1,157 +0,0 @@ -#define GLM_FORCE_SWIZZLE -#include -#include -#include - -static glm::vec1 g1; -static glm::vec1 g2(1); - -static int test_vec1_operators() -{ - int Error(0); - - glm::ivec1 A(1); - glm::ivec1 B(1); - { - bool R = A != B; - bool S = A == B; - - Error += (S && !R) ? 0 : 1; - } - - { - A *= 1; - B *= 1; - A += 1; - B += 1; - - bool R = A != B; - bool S = A == B; - - Error += (S && !R) ? 0 : 1; - } - - return Error; -} - -static int test_vec1_ctor() -{ - int Error = 0; - -# if GLM_HAS_TRIVIAL_QUERIES - // Error += std::is_trivially_default_constructible::value ? 0 : 1; - // Error += std::is_trivially_copy_assignable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - - Error += std::is_copy_constructible::value ? 0 : 1; -# endif - - - { - glm::ivec1 A = glm::vec1(2.0f); - - glm::ivec1 E(glm::dvec1(2.0)); - Error += A == E ? 0 : 1; - - glm::ivec1 F(glm::ivec1(2)); - Error += A == F ? 0 : 1; - } - - return Error; -} - -static int test_vec1_size() -{ - int Error = 0; - - Error += sizeof(glm::vec1) == sizeof(glm::mediump_vec1) ? 0 : 1; - Error += 4 == sizeof(glm::mediump_vec1) ? 0 : 1; - Error += sizeof(glm::dvec1) == sizeof(glm::highp_dvec1) ? 0 : 1; - Error += 8 == sizeof(glm::highp_dvec1) ? 0 : 1; - Error += glm::vec1().length() == 1 ? 0 : 1; - Error += glm::dvec1().length() == 1 ? 0 : 1; - Error += glm::vec1::length() == 1 ? 0 : 1; - Error += glm::dvec1::length() == 1 ? 0 : 1; - - GLM_CONSTEXPR std::size_t Length = glm::vec1::length(); - Error += Length == 1 ? 0 : 1; - - return Error; -} - -static int test_vec1_operator_increment() -{ - int Error(0); - - glm::ivec1 v0(1); - glm::ivec1 v1(v0); - glm::ivec1 v2(v0); - glm::ivec1 v3 = ++v1; - glm::ivec1 v4 = v2++; - - Error += glm::all(glm::equal(v0, v4)) ? 0 : 1; - Error += glm::all(glm::equal(v1, v2)) ? 0 : 1; - Error += glm::all(glm::equal(v1, v3)) ? 0 : 1; - - int i0(1); - int i1(i0); - int i2(i0); - int i3 = ++i1; - int i4 = i2++; - - Error += i0 == i4 ? 0 : 1; - Error += i1 == i2 ? 0 : 1; - Error += i1 == i3 ? 0 : 1; - - return Error; -} - -static int test_bvec1_ctor() -{ - int Error = 0; - - glm::bvec1 const A(true); - glm::bvec1 const B(true); - glm::bvec1 const C(false); - glm::bvec1 const D = A && B; - glm::bvec1 const E = A && C; - glm::bvec1 const F = A || C; - - Error += D == glm::bvec1(true) ? 0 : 1; - Error += E == glm::bvec1(false) ? 0 : 1; - Error += F == glm::bvec1(true) ? 0 : 1; - - bool const G = A == C; - bool const H = A != C; - Error += !G ? 0 : 1; - Error += H ? 0 : 1; - - return Error; -} - -static int test_constexpr() -{ -#if GLM_HAS_CONSTEXPR - static_assert(glm::vec1::length() == 1, "GLM: Failed constexpr"); - static_assert(glm::vec1(1.0f).x > 0.0f, "GLM: Failed constexpr"); -#endif - - return 0; -} - -int main() -{ - int Error = 0; - - Error += test_vec1_size(); - Error += test_vec1_ctor(); - Error += test_bvec1_ctor(); - Error += test_vec1_operators(); - Error += test_vec1_operator_increment(); - Error += test_constexpr(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_vector_bool1.cpp b/3rdparty/glm/source/test/ext/ext_vector_bool1.cpp deleted file mode 100644 index 43eed57..0000000 --- a/3rdparty/glm/source/test/ext/ext_vector_bool1.cpp +++ /dev/null @@ -1,104 +0,0 @@ -#include -#include - -template -static int test_operators() -{ - int Error = 0; - - genType const A(true); - genType const B(true); - { - bool const R = A != B; - bool const S = A == B; - Error += (S && !R) ? 0 : 1; - } - - return Error; -} - -template -static int test_ctor() -{ - int Error = 0; - - glm::bvec1 const A = genType(true); - - glm::bvec1 const E(genType(true)); - Error += A == E ? 0 : 1; - - glm::bvec1 const F(E); - Error += A == F ? 0 : 1; - - return Error; -} - -template -static int test_size() -{ - int Error = 0; - - Error += sizeof(glm::bvec1) == sizeof(genType) ? 0 : 1; - Error += genType().length() == 1 ? 0 : 1; - Error += genType::length() == 1 ? 0 : 1; - - return Error; -} - -template -static int test_relational() -{ - int Error = 0; - - genType const A(true); - genType const B(true); - genType const C(false); - - Error += A == B ? 0 : 1; - Error += (A && B) == A ? 0 : 1; - Error += (A || C) == A ? 0 : 1; - - return Error; -} - -template -static int test_constexpr() -{ -# if GLM_HAS_CONSTEXPR - static_assert(genType::length() == 1, "GLM: Failed constexpr"); -# endif - - return 0; -} - -int main() -{ - int Error = 0; - - Error += test_operators(); - Error += test_operators(); - Error += test_operators(); - Error += test_operators(); - - Error += test_ctor(); - Error += test_ctor(); - Error += test_ctor(); - Error += test_ctor(); - - Error += test_size(); - Error += test_size(); - Error += test_size(); - Error += test_size(); - - Error += test_relational(); - Error += test_relational(); - Error += test_relational(); - Error += test_relational(); - - Error += test_constexpr(); - Error += test_constexpr(); - Error += test_constexpr(); - Error += test_constexpr(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_vector_common.cpp b/3rdparty/glm/source/test/ext/ext_vector_common.cpp deleted file mode 100644 index 211003f..0000000 --- a/3rdparty/glm/source/test/ext/ext_vector_common.cpp +++ /dev/null @@ -1,365 +0,0 @@ -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if ((GLM_LANG & GLM_LANG_CXX11_FLAG) || (GLM_COMPILER & GLM_COMPILER_VC)) -# define GLM_NAN(T) NAN -#else -# define GLM_NAN(T) (static_cast(0.0f) / static_cast(0.0f)) -#endif - -template -static int test_min() -{ - typedef typename vecType::value_type T; - - int Error = 0; - - vecType const N(static_cast(0)); - vecType const B(static_cast(1)); - - Error += glm::all(glm::equal(glm::min(N, B), N, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::min(B, N), N, glm::epsilon())) ? 0 : 1; - - vecType const C(static_cast(2)); - Error += glm::all(glm::equal(glm::min(N, B, C), N, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::min(B, N, C), N, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::min(C, N, B), N, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::min(C, B, N), N, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::min(B, C, N), N, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::min(N, C, B), N, glm::epsilon())) ? 0 : 1; - - vecType const D(static_cast(3)); - Error += glm::all(glm::equal(glm::min(D, N, B, C), N, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::min(B, D, N, C), N, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::min(C, N, D, B), N, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::min(C, B, D, N), N, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::min(B, C, N, D), N, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::min(N, C, B, D), N, glm::epsilon())) ? 0 : 1; - - return Error; -} - -template -static int test_min_nan() -{ - typedef typename vecType::value_type T; - - int Error = 0; - - vecType const B(static_cast(1)); - vecType const N(GLM_NAN(T)); - - Error += glm::all(glm::isnan(glm::min(N, B))) ? 0 : 1; - Error += !glm::all(glm::isnan(glm::min(B, N))) ? 0 : 1; - - vecType const C(static_cast(2)); - Error += glm::all(glm::isnan(glm::min(N, B, C))) ? 0 : 1; - Error += !glm::all(glm::isnan(glm::min(B, N, C))) ? 0 : 1; - Error += !glm::all(glm::isnan(glm::min(C, N, B))) ? 0 : 1; - Error += !glm::all(glm::isnan(glm::min(C, B, N))) ? 0 : 1; - Error += !glm::all(glm::isnan(glm::min(B, C, N))) ? 0 : 1; - Error += glm::all(glm::isnan(glm::min(N, C, B))) ? 0 : 1; - - vecType const D(static_cast(3)); - Error += !glm::all(glm::isnan(glm::min(D, N, B, C))) ? 0 : 1; - Error += !glm::all(glm::isnan(glm::min(B, D, N, C))) ? 0 : 1; - Error += !glm::all(glm::isnan(glm::min(C, N, D, B))) ? 0 : 1; - Error += !glm::all(glm::isnan(glm::min(C, B, D, N))) ? 0 : 1; - Error += !glm::all(glm::isnan(glm::min(B, C, N, D))) ? 0 : 1; - Error += glm::all(glm::isnan(glm::min(N, C, B, D))) ? 0 : 1; - - return Error; -} - -template -static int test_max() -{ - typedef typename vecType::value_type T; - - int Error = 0; - - vecType const N(static_cast(0)); - vecType const B(static_cast(1)); - Error += glm::all(glm::equal(glm::max(N, B), B, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::max(B, N), B, glm::epsilon())) ? 0 : 1; - - vecType const C(static_cast(2)); - Error += glm::all(glm::equal(glm::max(N, B, C), C, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::max(B, N, C), C, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::max(C, N, B), C, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::max(C, B, N), C, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::max(B, C, N), C, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::max(N, C, B), C, glm::epsilon())) ? 0 : 1; - - vecType const D(static_cast(3)); - Error += glm::all(glm::equal(glm::max(D, N, B, C), D, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::max(B, D, N, C), D, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::max(C, N, D, B), D, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::max(C, B, D, N), D, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::max(B, C, N, D), D, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::max(N, C, B, D), D, glm::epsilon())) ? 0 : 1; - - return Error; -} - -template -static int test_max_nan() -{ - typedef typename vecType::value_type T; - - int Error = 0; - - vecType const B(static_cast(1)); - vecType const N(GLM_NAN(T)); - - Error += glm::all(glm::isnan(glm::max(N, B))) ? 0 : 1; - Error += !glm::all(glm::isnan(glm::max(B, N))) ? 0 : 1; - - vecType const C(static_cast(2)); - Error += glm::all(glm::isnan(glm::max(N, B, C))) ? 0 : 1; - Error += !glm::all(glm::isnan(glm::max(B, N, C))) ? 0 : 1; - Error += !glm::all(glm::isnan(glm::max(C, N, B))) ? 0 : 1; - Error += !glm::all(glm::isnan(glm::max(C, B, N))) ? 0 : 1; - Error += !glm::all(glm::isnan(glm::max(B, C, N))) ? 0 : 1; - Error += glm::all(glm::isnan(glm::max(N, C, B))) ? 0 : 1; - - vecType const D(static_cast(3)); - Error += !glm::all(glm::isnan(glm::max(D, N, B, C))) ? 0 : 1; - Error += !glm::all(glm::isnan(glm::max(B, D, N, C))) ? 0 : 1; - Error += !glm::all(glm::isnan(glm::max(C, N, D, B))) ? 0 : 1; - Error += !glm::all(glm::isnan(glm::max(C, B, D, N))) ? 0 : 1; - Error += !glm::all(glm::isnan(glm::max(B, C, N, D))) ? 0 : 1; - Error += glm::all(glm::isnan(glm::max(N, C, B, D))) ? 0 : 1; - - return Error; -} - -template -static int test_fmin() -{ - typedef typename vecType::value_type T; - - int Error = 0; - - vecType const B(static_cast(1)); - vecType const N(GLM_NAN(T)); - - Error += glm::all(glm::equal(glm::fmin(N, B), B, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::fmin(B, N), B, glm::epsilon())) ? 0 : 1; - - vecType const C(static_cast(2)); - Error += glm::all(glm::equal(glm::fmin(N, B, C), B, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::fmin(B, N, C), B, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::fmin(C, N, B), B, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::fmin(C, B, N), B, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::fmin(B, C, N), B, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::fmin(N, C, B), B, glm::epsilon())) ? 0 : 1; - - vecType const D(static_cast(3)); - Error += glm::all(glm::equal(glm::fmin(D, N, B, C), B, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::fmin(B, D, N, C), B, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::fmin(C, N, D, B), B, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::fmin(C, B, D, N), B, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::fmin(B, C, N, D), B, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::fmin(N, C, B, D), B, glm::epsilon())) ? 0 : 1; - - return Error; -} - -template -static int test_fmax() -{ - typedef typename vecType::value_type T; - - int Error = 0; - - vecType const B(static_cast(1)); - vecType const N(GLM_NAN(T)); - - Error += glm::all(glm::equal(glm::fmax(N, B), B, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::fmax(B, N), B, glm::epsilon())) ? 0 : 1; - - vecType const C(static_cast(2)); - Error += glm::all(glm::equal(glm::fmax(N, B, C), C, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::fmax(B, N, C), C, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::fmax(C, N, B), C, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::fmax(C, B, N), C, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::fmax(B, C, N), C, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::fmax(N, C, B), C, glm::epsilon())) ? 0 : 1; - - vecType const D(static_cast(3)); - Error += glm::all(glm::equal(glm::fmax(D, N, B, C), D, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::fmax(B, D, N, C), D, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::fmax(C, N, D, B), D, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::fmax(C, B, D, N), D, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::fmax(B, C, N, D), D, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::fmax(N, C, B, D), D, glm::epsilon())) ? 0 : 1; - - return Error; -} - -static int test_clamp() -{ - int Error = 0; - - glm::vec2 K = glm::clamp(glm::vec2(0.5f)); - Error += glm::all(glm::equal(K, glm::vec2(0.5f), glm::vec2(0.00001f))) ? 0 : 1; - - glm::vec3 L = glm::clamp(glm::vec3(0.5f)); - Error += glm::all(glm::equal(L, glm::vec3(0.5f), glm::vec3(0.00001f))) ? 0 : 1; - - glm::vec4 M = glm::clamp(glm::vec4(0.5f)); - Error += glm::all(glm::equal(M, glm::vec4(0.5f), glm::vec4(0.00001f))) ? 0 : 1; - - glm::vec1 N = glm::clamp(glm::vec1(0.5f)); - Error += glm::all(glm::equal(N, glm::vec1(0.5f), glm::vec1(0.00001f))) ? 0 : 1; - - return Error; -} - -static int test_repeat() -{ - int Error = 0; - - glm::vec2 K = glm::repeat(glm::vec2(0.5f)); - Error += glm::all(glm::equal(K, glm::vec2(0.5f), glm::vec2(0.00001f))) ? 0 : 1; - - glm::vec3 L = glm::repeat(glm::vec3(0.5f)); - Error += glm::all(glm::equal(L, glm::vec3(0.5f), glm::vec3(0.00001f))) ? 0 : 1; - - glm::vec4 M = glm::repeat(glm::vec4(0.5f)); - Error += glm::all(glm::equal(M, glm::vec4(0.5f), glm::vec4(0.00001f))) ? 0 : 1; - - glm::vec1 N = glm::repeat(glm::vec1(0.5f)); - Error += glm::all(glm::equal(N, glm::vec1(0.5f), glm::vec1(0.00001f))) ? 0 : 1; - - return Error; -} - -static int test_mirrorClamp() -{ - int Error = 0; - - glm::vec2 K = glm::mirrorClamp(glm::vec2(0.5f)); - Error += glm::all(glm::equal(K, glm::vec2(0.5f), glm::vec2(0.00001f))) ? 0 : 1; - - glm::vec3 L = glm::mirrorClamp(glm::vec3(0.5f)); - Error += glm::all(glm::equal(L, glm::vec3(0.5f), glm::vec3(0.00001f))) ? 0 : 1; - - glm::vec4 M = glm::mirrorClamp(glm::vec4(0.5f)); - Error += glm::all(glm::equal(M, glm::vec4(0.5f), glm::vec4(0.00001f))) ? 0 : 1; - - glm::vec1 N = glm::mirrorClamp(glm::vec1(0.5f)); - Error += glm::all(glm::equal(N, glm::vec1(0.5f), glm::vec1(0.00001f))) ? 0 : 1; - - return Error; -} - -static int test_mirrorRepeat() -{ - int Error = 0; - - glm::vec2 K = glm::mirrorRepeat(glm::vec2(0.5f)); - Error += glm::all(glm::equal(K, glm::vec2(0.5f), glm::vec2(0.00001f))) ? 0 : 1; - - glm::vec3 L = glm::mirrorRepeat(glm::vec3(0.5f)); - Error += glm::all(glm::equal(L, glm::vec3(0.5f), glm::vec3(0.00001f))) ? 0 : 1; - - glm::vec4 M = glm::mirrorRepeat(glm::vec4(0.5f)); - Error += glm::all(glm::equal(M, glm::vec4(0.5f), glm::vec4(0.00001f))) ? 0 : 1; - - glm::vec1 N = glm::mirrorRepeat(glm::vec1(0.5f)); - Error += glm::all(glm::equal(N, glm::vec1(0.5f), glm::vec1(0.00001f))) ? 0 : 1; - - return Error; -} - -static int test_iround() -{ - int Error = 0; - - for(float f = 0.0f; f < 3.1f; f += 0.05f) - { - int RoundFast = static_cast(glm::iround(f)); - int RoundSTD = static_cast(glm::round(f)); - Error += RoundFast == RoundSTD ? 0 : 1; - assert(!Error); - } - - return Error; -} - -static int test_uround() -{ - int Error = 0; - - for(float f = 0.0f; f < 3.1f; f += 0.05f) - { - int RoundFast = static_cast(glm::uround(f)); - int RoundSTD = static_cast(glm::round(f)); - Error += RoundFast == RoundSTD ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_min(); - Error += test_min(); - Error += test_min_nan(); - Error += test_min_nan(); - - Error += test_max(); - Error += test_max(); - Error += test_max_nan(); - Error += test_max_nan(); - - Error += test_fmin(); - Error += test_fmin(); - - Error += test_fmax(); - Error += test_fmax(); - - Error += test_clamp(); - Error += test_repeat(); - Error += test_mirrorClamp(); - Error += test_mirrorRepeat(); - - Error += test_iround(); - Error += test_uround(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_vector_iec559.cpp b/3rdparty/glm/source/test/ext/ext_vector_iec559.cpp deleted file mode 100644 index 5a9da50..0000000 --- a/3rdparty/glm/source/test/ext/ext_vector_iec559.cpp +++ /dev/null @@ -1,166 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -template -static int test_operators() -{ - typedef typename genType::value_type valType; - - int Error = 0; - - { - genType const A(1); - genType const B(1); - - genType const C = A + B; - Error += glm::all(glm::equal(C, genType(2), glm::epsilon())) ? 0 : 1; - - genType const D = A - B; - Error += glm::all(glm::equal(D, genType(0), glm::epsilon())) ? 0 : 1; - - genType const E = A * B; - Error += glm::all(glm::equal(E, genType(1), glm::epsilon())) ? 0 : 1; - - genType const F = A / B; - Error += glm::all(glm::equal(F, genType(1), glm::epsilon())) ? 0 : 1; - } - - return Error; -} - -template -static int test_ctor() -{ - typedef typename genType::value_type T; - - int Error = 0; - - glm::vec<1, T> const A = genType(1); - - glm::vec<1, T> const E(genType(1)); - Error += glm::all(glm::equal(A, E, glm::epsilon())) ? 0 : 1; - - glm::vec<1, T> const F(E); - Error += glm::all(glm::equal(A, F, glm::epsilon())) ? 0 : 1; - - genType const B = genType(1); - genType const G(glm::vec<2, T>(1)); - Error += glm::all(glm::equal(B, G, glm::epsilon())) ? 0 : 1; - - genType const H(glm::vec<3, T>(1)); - Error += glm::all(glm::equal(B, H, glm::epsilon())) ? 0 : 1; - - genType const I(glm::vec<4, T>(1)); - Error += glm::all(glm::equal(B, I, glm::epsilon())) ? 0 : 1; - - return Error; -} - -template -static int test_size() -{ - typedef typename genType::value_type T; - - int Error = 0; - - Error += sizeof(glm::vec<1, T>) == sizeof(genType) ? 0 : 1; - Error += genType().length() == 1 ? 0 : 1; - Error += genType::length() == 1 ? 0 : 1; - - return Error; -} - -template -static int test_relational() -{ - typedef typename genType::value_type valType; - - int Error = 0; - - genType const A(1); - genType const B(1); - genType const C(0); - - Error += all(equal(A, B, glm::epsilon())) ? 0 : 1; - Error += any(notEqual(A, C, glm::epsilon())) ? 0 : 1; - - return Error; -} - -template -static int test_constexpr() -{ -# if GLM_CONFIG_CONSTEXP == GLM_ENABLE - static_assert(genType::length() == 1, "GLM: Failed constexpr"); -# endif - - return 0; -} - -int main() -{ - int Error = 0; - - Error += test_operators(); - Error += test_operators(); - Error += test_operators(); - Error += test_operators(); - - Error += test_ctor(); - Error += test_ctor(); - Error += test_ctor(); - Error += test_ctor(); - - Error += test_size(); - Error += test_size(); - Error += test_size(); - Error += test_size(); - - Error += test_relational(); - Error += test_relational(); - Error += test_relational(); - Error += test_relational(); - - Error += test_constexpr(); - Error += test_constexpr(); - Error += test_constexpr(); - Error += test_constexpr(); - - Error += test_operators(); - Error += test_operators(); - Error += test_operators(); - Error += test_operators(); - - Error += test_ctor(); - Error += test_ctor(); - Error += test_ctor(); - Error += test_ctor(); - - Error += test_size(); - Error += test_size(); - Error += test_size(); - Error += test_size(); - - Error += test_relational(); - Error += test_relational(); - Error += test_relational(); - Error += test_relational(); - - Error += test_constexpr(); - Error += test_constexpr(); - Error += test_constexpr(); - Error += test_constexpr(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_vector_int1_sized.cpp b/3rdparty/glm/source/test/ext/ext_vector_int1_sized.cpp deleted file mode 100644 index c262f49..0000000 --- a/3rdparty/glm/source/test/ext/ext_vector_int1_sized.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT - static_assert(sizeof(glm::i8vec1) == 1, "int8 size isn't 1 byte on this platform"); - static_assert(sizeof(glm::i16vec1) == 2, "int16 size isn't 2 bytes on this platform"); - static_assert(sizeof(glm::i32vec1) == 4, "int32 size isn't 4 bytes on this platform"); - static_assert(sizeof(glm::i64vec1) == 8, "int64 size isn't 8 bytes on this platform"); -#endif - -static int test_size() -{ - int Error = 0; - - Error += sizeof(glm::i8vec1) == 1 ? 0 : 1; - Error += sizeof(glm::i16vec1) == 2 ? 0 : 1; - Error += sizeof(glm::i32vec1) == 4 ? 0 : 1; - Error += sizeof(glm::i64vec1) == 8 ? 0 : 1; - - return Error; -} - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::i8vec1) < sizeof(glm::i16vec1) ? 0 : 1; - Error += sizeof(glm::i16vec1) < sizeof(glm::i32vec1) ? 0 : 1; - Error += sizeof(glm::i32vec1) < sizeof(glm::i64vec1) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_size(); - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_vector_int2_sized.cpp b/3rdparty/glm/source/test/ext/ext_vector_int2_sized.cpp deleted file mode 100644 index f4ad8b6..0000000 --- a/3rdparty/glm/source/test/ext/ext_vector_int2_sized.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT - static_assert(sizeof(glm::i8vec2) == 2, "int8 size isn't 1 byte on this platform"); - static_assert(sizeof(glm::i16vec2) == 4, "int16 size isn't 2 bytes on this platform"); - static_assert(sizeof(glm::i32vec2) == 8, "int32 size isn't 4 bytes on this platform"); - static_assert(sizeof(glm::i64vec2) == 16, "int64 size isn't 8 bytes on this platform"); -#endif - -static int test_size() -{ - int Error = 0; - - Error += sizeof(glm::i8vec2) == 2 ? 0 : 1; - Error += sizeof(glm::i16vec2) == 4 ? 0 : 1; - Error += sizeof(glm::i32vec2) == 8 ? 0 : 1; - Error += sizeof(glm::i64vec2) == 16 ? 0 : 1; - - return Error; -} - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::i8vec2) < sizeof(glm::i16vec2) ? 0 : 1; - Error += sizeof(glm::i16vec2) < sizeof(glm::i32vec2) ? 0 : 1; - Error += sizeof(glm::i32vec2) < sizeof(glm::i64vec2) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_size(); - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_vector_int3_sized.cpp b/3rdparty/glm/source/test/ext/ext_vector_int3_sized.cpp deleted file mode 100644 index c51bfe7..0000000 --- a/3rdparty/glm/source/test/ext/ext_vector_int3_sized.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT - static_assert(sizeof(glm::i8vec3) == 3, "int8 size isn't 1 byte on this platform"); - static_assert(sizeof(glm::i16vec3) == 6, "int16 size isn't 2 bytes on this platform"); - static_assert(sizeof(glm::i32vec3) == 12, "int32 size isn't 4 bytes on this platform"); - static_assert(sizeof(glm::i64vec3) == 24, "int64 size isn't 8 bytes on this platform"); -#endif - -static int test_size() -{ - int Error = 0; - - Error += sizeof(glm::i8vec3) == 3 ? 0 : 1; - Error += sizeof(glm::i16vec3) == 6 ? 0 : 1; - Error += sizeof(glm::i32vec3) == 12 ? 0 : 1; - Error += sizeof(glm::i64vec3) == 24 ? 0 : 1; - - return Error; -} - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::i8vec3) < sizeof(glm::i16vec3) ? 0 : 1; - Error += sizeof(glm::i16vec3) < sizeof(glm::i32vec3) ? 0 : 1; - Error += sizeof(glm::i32vec3) < sizeof(glm::i64vec3) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_size(); - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_vector_int4_sized.cpp b/3rdparty/glm/source/test/ext/ext_vector_int4_sized.cpp deleted file mode 100644 index 93fd9ed..0000000 --- a/3rdparty/glm/source/test/ext/ext_vector_int4_sized.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT -static_assert(sizeof(glm::i8vec4) == 4, "int8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::i16vec4) == 8, "int16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::i32vec4) == 16, "int32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::i64vec4) == 32, "int64 size isn't 8 bytes on this platform"); -#endif - -static int test_size() -{ - int Error = 0; - - Error += sizeof(glm::i8vec4) == 4 ? 0 : 1; - Error += sizeof(glm::i16vec4) == 8 ? 0 : 1; - Error += sizeof(glm::i32vec4) == 16 ? 0 : 1; - Error += sizeof(glm::i64vec4) == 32 ? 0 : 1; - - return Error; -} - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::i8vec4) < sizeof(glm::i16vec4) ? 0 : 1; - Error += sizeof(glm::i16vec4) < sizeof(glm::i32vec4) ? 0 : 1; - Error += sizeof(glm::i32vec4) < sizeof(glm::i64vec4) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_size(); - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_vector_integer.cpp b/3rdparty/glm/source/test/ext/ext_vector_integer.cpp deleted file mode 100644 index d7278d3..0000000 --- a/3rdparty/glm/source/test/ext/ext_vector_integer.cpp +++ /dev/null @@ -1,547 +0,0 @@ -#include -#include -#include -#include -#include -#include - -namespace isPowerOfTwo -{ - template - struct type - { - genType Value; - bool Return; - }; - - template - int test_int16() - { - type const Data[] = - { - { 0x0001, true }, - { 0x0002, true }, - { 0x0004, true }, - { 0x0080, true }, - { 0x0000, true }, - { 0x0003, false } - }; - - int Error = 0; - - for (std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - glm::vec const Result = glm::isPowerOfTwo(glm::vec(Data[i].Value)); - Error += glm::vec(Data[i].Return) == Result ? 0 : 1; - } - - return Error; - } - - template - int test_uint16() - { - type const Data[] = - { - { 0x0001, true }, - { 0x0002, true }, - { 0x0004, true }, - { 0x0000, true }, - { 0x0000, true }, - { 0x0003, false } - }; - - int Error = 0; - - for (std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - glm::vec const Result = glm::isPowerOfTwo(glm::vec(Data[i].Value)); - Error += glm::vec(Data[i].Return) == Result ? 0 : 1; - } - - return Error; - } - - template - int test_int32() - { - type const Data[] = - { - { 0x00000001, true }, - { 0x00000002, true }, - { 0x00000004, true }, - { 0x0000000f, false }, - { 0x00000000, true }, - { 0x00000003, false } - }; - - int Error = 0; - - for (std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - glm::vec const Result = glm::isPowerOfTwo(glm::vec(Data[i].Value)); - Error += glm::vec(Data[i].Return) == Result ? 0 : 1; - } - - return Error; - } - - template - int test_uint32() - { - type const Data[] = - { - { 0x00000001, true }, - { 0x00000002, true }, - { 0x00000004, true }, - { 0x80000000, true }, - { 0x00000000, true }, - { 0x00000003, false } - }; - - int Error = 0; - - for (std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - glm::vec const Result = glm::isPowerOfTwo(glm::vec(Data[i].Value)); - Error += glm::vec(Data[i].Return) == Result ? 0 : 1; - } - - return Error; - } - - int test() - { - int Error = 0; - - Error += test_int16<1>(); - Error += test_int16<2>(); - Error += test_int16<3>(); - Error += test_int16<4>(); - - Error += test_uint16<1>(); - Error += test_uint16<2>(); - Error += test_uint16<3>(); - Error += test_uint16<4>(); - - Error += test_int32<1>(); - Error += test_int32<2>(); - Error += test_int32<3>(); - Error += test_int32<4>(); - - Error += test_uint32<1>(); - Error += test_uint32<2>(); - Error += test_uint32<3>(); - Error += test_uint32<4>(); - - return Error; - } -}//isPowerOfTwo - -namespace prevPowerOfTwo -{ - template - int run() - { - int Error = 0; - - glm::vec const A = glm::prevPowerOfTwo(glm::vec(7)); - Error += A == glm::vec(4) ? 0 : 1; - - glm::vec const B = glm::prevPowerOfTwo(glm::vec(15)); - Error += B == glm::vec(8) ? 0 : 1; - - glm::vec const C = glm::prevPowerOfTwo(glm::vec(31)); - Error += C == glm::vec(16) ? 0 : 1; - - glm::vec const D = glm::prevPowerOfTwo(glm::vec(32)); - Error += D == glm::vec(32) ? 0 : 1; - - return Error; - } - - int test() - { - int Error = 0; - - Error += run<1, glm::int8>(); - Error += run<2, glm::int8>(); - Error += run<3, glm::int8>(); - Error += run<4, glm::int8>(); - - Error += run<1, glm::int16>(); - Error += run<2, glm::int16>(); - Error += run<3, glm::int16>(); - Error += run<4, glm::int16>(); - - Error += run<1, glm::int32>(); - Error += run<2, glm::int32>(); - Error += run<3, glm::int32>(); - Error += run<4, glm::int32>(); - - Error += run<1, glm::int64>(); - Error += run<2, glm::int64>(); - Error += run<3, glm::int64>(); - Error += run<4, glm::int64>(); - - Error += run<1, glm::uint8>(); - Error += run<2, glm::uint8>(); - Error += run<3, glm::uint8>(); - Error += run<4, glm::uint8>(); - - Error += run<1, glm::uint16>(); - Error += run<2, glm::uint16>(); - Error += run<3, glm::uint16>(); - Error += run<4, glm::uint16>(); - - Error += run<1, glm::uint32>(); - Error += run<2, glm::uint32>(); - Error += run<3, glm::uint32>(); - Error += run<4, glm::uint32>(); - - Error += run<1, glm::uint64>(); - Error += run<2, glm::uint64>(); - Error += run<3, glm::uint64>(); - Error += run<4, glm::uint64>(); - - return Error; - } -}//namespace prevPowerOfTwo - -namespace nextPowerOfTwo -{ - template - int run() - { - int Error = 0; - - glm::vec const A = glm::nextPowerOfTwo(glm::vec(7)); - Error += A == glm::vec(8) ? 0 : 1; - - glm::vec const B = glm::nextPowerOfTwo(glm::vec(15)); - Error += B == glm::vec(16) ? 0 : 1; - - glm::vec const C = glm::nextPowerOfTwo(glm::vec(31)); - Error += C == glm::vec(32) ? 0 : 1; - - glm::vec const D = glm::nextPowerOfTwo(glm::vec(32)); - Error += D == glm::vec(32) ? 0 : 1; - - return Error; - } - - int test() - { - int Error = 0; - - Error += run<1, glm::int8>(); - Error += run<2, glm::int8>(); - Error += run<3, glm::int8>(); - Error += run<4, glm::int8>(); - - Error += run<1, glm::int16>(); - Error += run<2, glm::int16>(); - Error += run<3, glm::int16>(); - Error += run<4, glm::int16>(); - - Error += run<1, glm::int32>(); - Error += run<2, glm::int32>(); - Error += run<3, glm::int32>(); - Error += run<4, glm::int32>(); - - Error += run<1, glm::int64>(); - Error += run<2, glm::int64>(); - Error += run<3, glm::int64>(); - Error += run<4, glm::int64>(); - - Error += run<1, glm::uint8>(); - Error += run<2, glm::uint8>(); - Error += run<3, glm::uint8>(); - Error += run<4, glm::uint8>(); - - Error += run<1, glm::uint16>(); - Error += run<2, glm::uint16>(); - Error += run<3, glm::uint16>(); - Error += run<4, glm::uint16>(); - - Error += run<1, glm::uint32>(); - Error += run<2, glm::uint32>(); - Error += run<3, glm::uint32>(); - Error += run<4, glm::uint32>(); - - Error += run<1, glm::uint64>(); - Error += run<2, glm::uint64>(); - Error += run<3, glm::uint64>(); - Error += run<4, glm::uint64>(); - - return Error; - } -}//namespace nextPowerOfTwo - -namespace prevMultiple -{ - template - struct type - { - genIUType Source; - genIUType Multiple; - genIUType Return; - }; - - template - int run() - { - type const Data[] = - { - { 8, 3, 6 }, - { 7, 7, 7 } - }; - - int Error = 0; - - for (std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - glm::vec const Result0 = glm::prevMultiple(glm::vec(Data[i].Source), Data[i].Multiple); - Error += glm::vec(Data[i].Return) == Result0 ? 0 : 1; - - glm::vec const Result1 = glm::prevMultiple(glm::vec(Data[i].Source), glm::vec(Data[i].Multiple)); - Error += glm::vec(Data[i].Return) == Result1 ? 0 : 1; - } - - return Error; - } - - int test() - { - int Error = 0; - - Error += run<1, glm::int8>(); - Error += run<2, glm::int8>(); - Error += run<3, glm::int8>(); - Error += run<4, glm::int8>(); - - Error += run<1, glm::int16>(); - Error += run<2, glm::int16>(); - Error += run<3, glm::int16>(); - Error += run<4, glm::int16>(); - - Error += run<1, glm::int32>(); - Error += run<2, glm::int32>(); - Error += run<3, glm::int32>(); - Error += run<4, glm::int32>(); - - Error += run<1, glm::int64>(); - Error += run<2, glm::int64>(); - Error += run<3, glm::int64>(); - Error += run<4, glm::int64>(); - - Error += run<1, glm::uint8>(); - Error += run<2, glm::uint8>(); - Error += run<3, glm::uint8>(); - Error += run<4, glm::uint8>(); - - Error += run<1, glm::uint16>(); - Error += run<2, glm::uint16>(); - Error += run<3, glm::uint16>(); - Error += run<4, glm::uint16>(); - - Error += run<1, glm::uint32>(); - Error += run<2, glm::uint32>(); - Error += run<3, glm::uint32>(); - Error += run<4, glm::uint32>(); - - Error += run<1, glm::uint64>(); - Error += run<2, glm::uint64>(); - Error += run<3, glm::uint64>(); - Error += run<4, glm::uint64>(); - - return Error; - } -}//namespace prevMultiple - -namespace nextMultiple -{ - template - struct type - { - genIUType Source; - genIUType Multiple; - genIUType Return; - }; - - template - int run() - { - type const Data[] = - { - { 3, 4, 4 }, - { 6, 3, 6 }, - { 5, 3, 6 }, - { 7, 7, 7 }, - { 0, 1, 0 }, - { 8, 3, 9 } - }; - - int Error = 0; - - for (std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - glm::vec const Result0 = glm::nextMultiple(glm::vec(Data[i].Source), glm::vec(Data[i].Multiple)); - Error += glm::vec(Data[i].Return) == Result0 ? 0 : 1; - - glm::vec const Result1 = glm::nextMultiple(glm::vec(Data[i].Source), Data[i].Multiple); - Error += glm::vec(Data[i].Return) == Result1 ? 0 : 1; - } - - return Error; - } - - int test() - { - int Error = 0; - - Error += run<1, glm::int8>(); - Error += run<2, glm::int8>(); - Error += run<3, glm::int8>(); - Error += run<4, glm::int8>(); - - Error += run<1, glm::int16>(); - Error += run<2, glm::int16>(); - Error += run<3, glm::int16>(); - Error += run<4, glm::int16>(); - - Error += run<1, glm::int32>(); - Error += run<2, glm::int32>(); - Error += run<3, glm::int32>(); - Error += run<4, glm::int32>(); - - Error += run<1, glm::int64>(); - Error += run<2, glm::int64>(); - Error += run<3, glm::int64>(); - Error += run<4, glm::int64>(); - - Error += run<1, glm::uint8>(); - Error += run<2, glm::uint8>(); - Error += run<3, glm::uint8>(); - Error += run<4, glm::uint8>(); - - Error += run<1, glm::uint16>(); - Error += run<2, glm::uint16>(); - Error += run<3, glm::uint16>(); - Error += run<4, glm::uint16>(); - - Error += run<1, glm::uint32>(); - Error += run<2, glm::uint32>(); - Error += run<3, glm::uint32>(); - Error += run<4, glm::uint32>(); - - Error += run<1, glm::uint64>(); - Error += run<2, glm::uint64>(); - Error += run<3, glm::uint64>(); - Error += run<4, glm::uint64>(); - - return Error; - } -}//namespace nextMultiple - -namespace findNSB -{ - template - struct type - { - T Source; - int SignificantBitCount; - int Return; - }; - - template - int run() - { - type const Data[] = - { - { 0x00, 1,-1 }, - { 0x01, 2,-1 }, - { 0x02, 2,-1 }, - { 0x06, 3,-1 }, - { 0x01, 1, 0 }, - { 0x03, 1, 0 }, - { 0x03, 2, 1 }, - { 0x07, 2, 1 }, - { 0x05, 2, 2 }, - { 0x0D, 2, 2 } - }; - - int Error = 0; - - for (std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - glm::vec const Result0 = glm::findNSB(glm::vec(Data[i].Source), glm::vec(Data[i].SignificantBitCount)); - Error += glm::vec(Data[i].Return) == Result0 ? 0 : 1; - assert(!Error); - } - - return Error; - } - - int test() - { - int Error = 0; - - Error += run<1, glm::uint8>(); - Error += run<2, glm::uint8>(); - Error += run<3, glm::uint8>(); - Error += run<4, glm::uint8>(); - - Error += run<1, glm::uint16>(); - Error += run<2, glm::uint16>(); - Error += run<3, glm::uint16>(); - Error += run<4, glm::uint16>(); - - Error += run<1, glm::uint32>(); - Error += run<2, glm::uint32>(); - Error += run<3, glm::uint32>(); - Error += run<4, glm::uint32>(); - - Error += run<1, glm::uint64>(); - Error += run<2, glm::uint64>(); - Error += run<3, glm::uint64>(); - Error += run<4, glm::uint64>(); - - Error += run<1, glm::int8>(); - Error += run<2, glm::int8>(); - Error += run<3, glm::int8>(); - Error += run<4, glm::int8>(); - - Error += run<1, glm::int16>(); - Error += run<2, glm::int16>(); - Error += run<3, glm::int16>(); - Error += run<4, glm::int16>(); - - Error += run<1, glm::int32>(); - Error += run<2, glm::int32>(); - Error += run<3, glm::int32>(); - Error += run<4, glm::int32>(); - - Error += run<1, glm::int64>(); - Error += run<2, glm::int64>(); - Error += run<3, glm::int64>(); - Error += run<4, glm::int64>(); - - - return Error; - } -}//namespace findNSB - -int main() -{ - int Error = 0; - - Error += isPowerOfTwo::test(); - Error += prevPowerOfTwo::test(); - Error += nextPowerOfTwo::test(); - Error += prevMultiple::test(); - Error += nextMultiple::test(); - Error += findNSB::test(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_vector_integer_sized.cpp b/3rdparty/glm/source/test/ext/ext_vector_integer_sized.cpp deleted file mode 100644 index 52b3f4e..0000000 --- a/3rdparty/glm/source/test/ext/ext_vector_integer_sized.cpp +++ /dev/null @@ -1,216 +0,0 @@ -#include -#include -#include -#include -#include - -template -static int test_operators() -{ - int Error = 0; - - { - genType const A(1); - genType const B(1); - - bool const R = A != B; - bool const S = A == B; - Error += (S && !R) ? 0 : 1; - } - - { - genType const A(1); - genType const B(1); - - genType const C = A + B; - Error += C == genType(2) ? 0 : 1; - - genType const D = A - B; - Error += D == genType(0) ? 0 : 1; - - genType const E = A * B; - Error += E == genType(1) ? 0 : 1; - - genType const F = A / B; - Error += F == genType(1) ? 0 : 1; - } - - { - genType const A(3); - genType const B(2); - - genType const C = A % B; - Error += C == genType(1) ? 0 : 1; - } - - { - genType const A(1); - genType const B(1); - genType const C(0); - - genType const I = A & B; - Error += I == genType(1) ? 0 : 1; - genType const D = A & C; - Error += D == genType(0) ? 0 : 1; - - genType const E = A | B; - Error += E == genType(1) ? 0 : 1; - genType const F = A | C; - Error += F == genType(1) ? 0 : 1; - - genType const G = A ^ B; - Error += G == genType(0) ? 0 : 1; - genType const H = A ^ C; - Error += H == genType(1) ? 0 : 1; - } - - { - genType const A(0); - genType const B(1); - genType const C(2); - - genType const D = B << B; - Error += D == genType(2) ? 0 : 1; - genType const E = C >> B; - Error += E == genType(1) ? 0 : 1; - } - - return Error; -} - -template -static int test_ctor() -{ - typedef typename genType::value_type T; - - int Error = 0; - - genType const A = genType(1); - - genType const E(genType(1)); - Error += A == E ? 0 : 1; - - genType const F(E); - Error += A == F ? 0 : 1; - - genType const B = genType(1); - genType const G(glm::vec<2, T>(1)); - Error += B == G ? 0 : 1; - - genType const H(glm::vec<3, T>(1)); - Error += B == H ? 0 : 1; - - genType const I(glm::vec<4, T>(1)); - Error += B == I ? 0 : 1; - - return Error; -} - -template -static int test_size() -{ - int Error = 0; - - Error += sizeof(typename genType::value_type) == sizeof(genType) ? 0 : 1; - Error += genType().length() == 1 ? 0 : 1; - Error += genType::length() == 1 ? 0 : 1; - - return Error; -} - -template -static int test_relational() -{ - int Error = 0; - - genType const A(1); - genType const B(1); - genType const C(0); - - Error += A == B ? 0 : 1; - Error += A != C ? 0 : 1; - Error += all(equal(A, B)) ? 0 : 1; - Error += any(notEqual(A, C)) ? 0 : 1; - - return Error; -} - -template -static int test_constexpr() -{ -# if GLM_CONFIG_CONSTEXP == GLM_ENABLE - static_assert(genType::length() == 1, "GLM: Failed constexpr"); - static_assert(genType(1)[0] == 1, "GLM: Failed constexpr"); - static_assert(genType(1) == genType(1), "GLM: Failed constexpr"); - static_assert(genType(1) != genType(0), "GLM: Failed constexpr"); -# endif - - return 0; -} - -int main() -{ - int Error = 0; - - Error += test_operators(); - Error += test_operators(); - Error += test_operators(); - Error += test_operators(); - Error += test_operators(); - - Error += test_ctor(); - Error += test_ctor(); - Error += test_ctor(); - Error += test_ctor(); - Error += test_ctor(); - - Error += test_size(); - Error += test_size(); - Error += test_size(); - Error += test_size(); - Error += test_size(); - - Error += test_relational(); - Error += test_relational(); - Error += test_relational(); - Error += test_relational(); - Error += test_relational(); - - Error += test_constexpr(); - Error += test_constexpr(); - Error += test_constexpr(); - Error += test_constexpr(); - Error += test_constexpr(); - - Error += test_operators(); - Error += test_operators(); - Error += test_operators(); - Error += test_operators(); - Error += test_operators(); - - Error += test_ctor(); - Error += test_ctor(); - Error += test_ctor(); - Error += test_ctor(); - Error += test_ctor(); - - Error += test_size(); - Error += test_size(); - Error += test_size(); - Error += test_size(); - Error += test_size(); - - Error += test_relational(); - Error += test_relational(); - Error += test_relational(); - Error += test_relational(); - Error += test_relational(); - - Error += test_constexpr(); - Error += test_constexpr(); - Error += test_constexpr(); - Error += test_constexpr(); - Error += test_constexpr(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_vector_packing.cpp b/3rdparty/glm/source/test/ext/ext_vector_packing.cpp deleted file mode 100644 index d7cbce2..0000000 --- a/3rdparty/glm/source/test/ext/ext_vector_packing.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -int test_packUnorm() -{ - int Error = 0; - - std::vector A; - A.push_back(glm::vec2(1.0f, 0.7f)); - A.push_back(glm::vec2(0.5f, 0.1f)); - - for (std::size_t i = 0; i < A.size(); ++i) - { - glm::vec2 B(A[i]); - glm::u16vec2 C = glm::packUnorm(B); - glm::vec2 D = glm::unpackUnorm(C); - Error += glm::all(glm::equal(B, D, 1.0f / 255.f)) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int test_packSnorm() -{ - int Error = 0; - - std::vector A; - A.push_back(glm::vec2(1.0f, 0.0f)); - A.push_back(glm::vec2(-0.5f, -0.7f)); - A.push_back(glm::vec2(-0.1f, 0.1f)); - - for (std::size_t i = 0; i < A.size(); ++i) - { - glm::vec2 B(A[i]); - glm::i16vec2 C = glm::packSnorm(B); - glm::vec2 D = glm::unpackSnorm(C); - Error += glm::all(glm::equal(B, D, 1.0f / 32767.0f * 2.0f)) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_packUnorm(); - Error += test_packSnorm(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_vector_reciprocal.cpp b/3rdparty/glm/source/test/ext/ext_vector_reciprocal.cpp deleted file mode 100644 index f4b9f18..0000000 --- a/3rdparty/glm/source/test/ext/ext_vector_reciprocal.cpp +++ /dev/null @@ -1,186 +0,0 @@ -#include -#include -#include -#include - -static int test_sec() -{ - int Error = 0; - - glm::dvec1 const a = glm::sec(glm::dvec1(0.0)); - Error += glm::all(glm::equal(a, glm::dvec1(1.0), 0.01)) ? 0 : 1; - - glm::dvec1 const b = glm::sec(glm::dvec1(glm::pi() * 2.0)); - Error += glm::all(glm::equal(b, glm::dvec1(1.0), 0.01)) ? 0 : 1; - - glm::dvec1 const c = glm::sec(glm::dvec1(glm::pi() * -2.0)); - Error += glm::all(glm::equal(c, glm::dvec1(1.0), 0.01)) ? 0 : 1; - - glm::dvec1 const d = glm::sec(glm::dvec1(glm::pi() * 1.0)); - Error += glm::all(glm::equal(d, -glm::dvec1(1.0), 0.01)) ? 0 : 1; - - glm::dvec1 const e = glm::sec(glm::dvec1(glm::pi() * -1.0)); - Error += glm::all(glm::equal(e, -glm::dvec1(1.0), 0.01)) ? 0 : 1; - - return Error; -} - -static int test_csc() -{ - int Error = 0; - - glm::dvec1 const a = glm::csc(glm::dvec1(glm::pi() * 0.5)); - Error += glm::all(glm::equal(a, glm::dvec1(1.0), 0.01)) ? 0 : 1; - - glm::dvec1 const b = glm::csc(glm::dvec1(glm::pi() * -0.5)); - Error += glm::all(glm::equal(b, glm::dvec1(-1.0), 0.01)) ? 0 : 1; - - return Error; -} - -static int test_cot() -{ - int Error = 0; - - glm::dvec1 const a = glm::cot(glm::dvec1(glm::pi() * 0.5)); - Error += glm::all(glm::equal(a, glm::dvec1(0.0), 0.01)) ? 0 : 1; - - glm::dvec1 const b = glm::cot(glm::dvec1(glm::pi() * -0.5)); - Error += glm::all(glm::equal(b, glm::dvec1(0.0), 0.01)) ? 0 : 1; - - return Error; -} - -static int test_asec() -{ - int Error = 0; - - Error += glm::all(glm::equal(glm::asec(glm::dvec1(100000.0)), glm::dvec1(glm::pi() * 0.5), 0.01)) ? 0 : 1; - Error += glm::all(glm::equal(glm::asec(glm::dvec1(-100000.0)), glm::dvec1(glm::pi() * 0.5), 0.01)) ? 0 : 1; - - return Error; -} - -static int test_acsc() -{ - int Error = 0; - - Error += glm::all(glm::equal(glm::acsc(glm::dvec1(100000.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1; - Error += glm::all(glm::equal(glm::acsc(glm::dvec1(-100000.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1; - - return Error; -} - -static int test_acot() -{ - int Error = 0; - - Error += glm::all(glm::equal(glm::acot(glm::dvec1(100000.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1; - Error += glm::all(glm::equal(glm::acot(glm::dvec1(-100000.0)), glm::dvec1(glm::pi()), 0.01)) ? 0 : 1; - Error += glm::all(glm::equal(glm::acot(glm::dvec1(0.0)), glm::dvec1(glm::pi() * 0.5), 0.01)) ? 0 : 1; - - return Error; -} - -static int test_sech() -{ - int Error = 0; - - Error += glm::all(glm::equal(glm::sech(glm::dvec1(100000.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1; - Error += glm::all(glm::equal(glm::sech(glm::dvec1(-100000.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1; - Error += glm::all(glm::equal(glm::sech(glm::dvec1(0.0)), glm::dvec1(1.0), 0.01)) ? 0 : 1; - - return Error; -} - -static int test_csch() -{ - int Error = 0; - - Error += glm::all(glm::equal(glm::csch(glm::dvec1(100000.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1; - Error += glm::all(glm::equal(glm::csch(glm::dvec1(-100000.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1; - - return Error; -} - -static int test_coth() -{ - int Error = 0; - - glm::dvec1 const a = glm::coth(glm::dvec1(100.0)); - Error += glm::all(glm::equal(a, glm::dvec1(1.0), 0.01)) ? 0 : 1; - - glm::dvec1 const b = glm::coth(glm::dvec1(-100.0)); - Error += glm::all(glm::equal(b, glm::dvec1(-1.0), 0.01)) ? 0 : 1; - - return Error; -} - -static int test_asech() -{ - int Error = 0; - - glm::dvec1 const a = glm::asech(glm::dvec1(1.0)); - Error += glm::all(glm::equal(a, glm::dvec1(0.0), 0.01)) ? 0 : 1; - - return Error; -} - -static int test_acsch() -{ - int Error = 0; - - glm::dvec1 const a(glm::acsch(glm::dvec1(0.01))); - Error += a.x > 1.0 ? 0 : 1; - - glm::dvec1 const b(glm::acsch(glm::dvec1(-0.01))); - Error += b.x < -1.0 ? 0 : 1; - - Error += glm::all(glm::equal(glm::acsch(glm::dvec1(100.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1; - Error += glm::all(glm::equal(glm::acsch(glm::dvec1(-100.0)), glm::dvec1(0.0), 0.01)) ? 0 : 1; - - return Error; -} - -static int test_acoth() -{ - int Error = 0; - - glm::dvec1 const a = glm::acoth(glm::dvec1(1.00001)); - Error += a.x > 6.0 ? 0 : 1; - - glm::dvec1 const b = glm::acoth(glm::dvec1(-1.00001)); - Error += b.x < -6.0 ? 0 : 1; - - glm::dvec1 const c = glm::acoth(glm::dvec1(10000.0)); - Error += glm::all(glm::equal(c, glm::dvec1(0.0), 0.01)) ? 0 : 1; - - glm::dvec1 const d = glm::acoth(glm::dvec1(-10000.0)); - Error += glm::all(glm::equal(d, glm::dvec1(0.0), 0.01)) ? 0 : 1; - - return Error; -} - - -int main() -{ - int Error = 0; - - Error += test_sec(); - Error += test_csc(); - Error += test_cot(); - - Error += test_asec(); - Error += test_acsc(); - Error += test_acot(); - - Error += test_sech(); - Error += test_csch(); - Error += test_coth(); - - Error += test_asech(); - Error += test_acsch(); - Error += test_acoth(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_vector_relational.cpp b/3rdparty/glm/source/test/ext/ext_vector_relational.cpp deleted file mode 100644 index f6cd307..0000000 --- a/3rdparty/glm/source/test/ext/ext_vector_relational.cpp +++ /dev/null @@ -1,205 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -template -static int test_equal() -{ - typedef typename vecType::value_type valType; - - valType const A = static_cast(1.01f); - valType const B = static_cast(1.02f); - valType const Epsilon1 = static_cast(0.1f); - valType const Epsilon2 = static_cast(0.001f); - - int Error = 0; - - Error += glm::all(glm::equal(vecType(A), vecType(B), Epsilon1)) ? 0 : 1; - Error += glm::all(glm::equal(vecType(A), vecType(B), vecType(Epsilon1))) ? 0 : 1; - - Error += !glm::any(glm::equal(vecType(A), vecType(B), Epsilon2)) ? 0 : 1; - Error += !glm::any(glm::equal(vecType(A), vecType(B), vecType(Epsilon2))) ? 0 : 1; - - return Error; -} - -template -static int test_notEqual() -{ - typedef typename vecType::value_type valType; - - valType const A = static_cast(1.01f); - valType const B = static_cast(1.02f); - valType const Epsilon1 = static_cast(0.1f); - valType const Epsilon2 = static_cast(0.001f); - - int Error = 0; - - Error += glm::all(glm::notEqual(vecType(A), vecType(B), Epsilon2)) ? 0 : 1; - Error += glm::all(glm::notEqual(vecType(A), vecType(B), vecType(Epsilon2))) ? 0 : 1; - - Error += !glm::any(glm::notEqual(vecType(A), vecType(B), Epsilon1)) ? 0 : 1; - Error += !glm::any(glm::notEqual(vecType(A), vecType(B), vecType(Epsilon1))) ? 0 : 1; - - return Error; -} - -template -static int test_constexpr() -{ -# if GLM_CONFIG_CONSTEXP == GLM_ENABLE - static_assert(glm::all(glm::equal(genType(static_cast(1.01f)), genType(static_cast(1.02f)), static_cast(0.1f))), "GLM: Failed constexpr"); -# endif - - return 0; -} - -template -static int test_equal_ulps() -{ - typedef glm::vec<4, T, glm::defaultp> vec4; - - T const One(1); - vec4 const Ones(1); - - int Error = 0; - - T const ULP1Plus = glm::nextFloat(One); - Error += glm::all(glm::equal(Ones, vec4(ULP1Plus), 1)) ? 0 : 1; - - T const ULP2Plus = glm::nextFloat(ULP1Plus); - Error += !glm::all(glm::equal(Ones, vec4(ULP2Plus), 1)) ? 0 : 1; - - T const ULP1Minus = glm::prevFloat(One); - Error += glm::all(glm::equal(Ones, vec4(ULP1Minus), 1)) ? 0 : 1; - - T const ULP2Minus = glm::prevFloat(ULP1Minus); - Error += !glm::all(glm::equal(Ones, vec4(ULP2Minus), 1)) ? 0 : 1; - - return Error; -} - -template -static int test_notEqual_ulps() -{ - typedef glm::vec<4, T, glm::defaultp> vec4; - - T const One(1); - vec4 const Ones(1); - - int Error = 0; - - T const ULP1Plus = glm::nextFloat(One); - Error += !glm::all(glm::notEqual(Ones, vec4(ULP1Plus), 1)) ? 0 : 1; - - T const ULP2Plus = glm::nextFloat(ULP1Plus); - Error += glm::all(glm::notEqual(Ones, vec4(ULP2Plus), 1)) ? 0 : 1; - - T const ULP1Minus = glm::prevFloat(One); - Error += !glm::all(glm::notEqual(Ones, vec4(ULP1Minus), 1)) ? 0 : 1; - - T const ULP2Minus = glm::prevFloat(ULP1Minus); - Error += glm::all(glm::notEqual(Ones, vec4(ULP2Minus), 1)) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_equal_ulps(); - Error += test_equal_ulps(); - Error += test_notEqual_ulps(); - Error += test_notEqual_ulps(); - - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - Error += test_equal(); - - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - Error += test_notEqual(); - - Error += test_constexpr(); - Error += test_constexpr(); - Error += test_constexpr(); - Error += test_constexpr(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_vector_uint1_sized.cpp b/3rdparty/glm/source/test/ext/ext_vector_uint1_sized.cpp deleted file mode 100644 index f2e4624..0000000 --- a/3rdparty/glm/source/test/ext/ext_vector_uint1_sized.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT - static_assert(sizeof(glm::u8vec1) == 1, "uint8 size isn't 1 byte on this platform"); - static_assert(sizeof(glm::u16vec1) == 2, "uint16 size isn't 2 bytes on this platform"); - static_assert(sizeof(glm::u32vec1) == 4, "uint32 size isn't 4 bytes on this platform"); - static_assert(sizeof(glm::u64vec1) == 8, "uint64 size isn't 8 bytes on this platform"); -#endif - -static int test_size() -{ - int Error = 0; - - Error += sizeof(glm::u8vec1) == 1 ? 0 : 1; - Error += sizeof(glm::u16vec1) == 2 ? 0 : 1; - Error += sizeof(glm::u32vec1) == 4 ? 0 : 1; - Error += sizeof(glm::u64vec1) == 8 ? 0 : 1; - - return Error; -} - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::u8vec1) < sizeof(glm::u16vec1) ? 0 : 1; - Error += sizeof(glm::u16vec1) < sizeof(glm::u32vec1) ? 0 : 1; - Error += sizeof(glm::u32vec1) < sizeof(glm::u64vec1) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_size(); - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_vector_uint2_sized.cpp b/3rdparty/glm/source/test/ext/ext_vector_uint2_sized.cpp deleted file mode 100644 index 9c0977e..0000000 --- a/3rdparty/glm/source/test/ext/ext_vector_uint2_sized.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT -static_assert(sizeof(glm::u8vec2) == 2, "int8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::u16vec2) == 4, "int16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::u32vec2) == 8, "int32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::u64vec2) == 16, "int64 size isn't 8 bytes on this platform"); -#endif - -static int test_size() -{ - int Error = 0; - - Error += sizeof(glm::u8vec2) == 2 ? 0 : 1; - Error += sizeof(glm::u16vec2) == 4 ? 0 : 1; - Error += sizeof(glm::u32vec2) == 8 ? 0 : 1; - Error += sizeof(glm::u64vec2) == 16 ? 0 : 1; - - return Error; -} - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::u8vec2) < sizeof(glm::u16vec2) ? 0 : 1; - Error += sizeof(glm::u16vec2) < sizeof(glm::u32vec2) ? 0 : 1; - Error += sizeof(glm::u32vec2) < sizeof(glm::u64vec2) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_size(); - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_vector_uint3_sized.cpp b/3rdparty/glm/source/test/ext/ext_vector_uint3_sized.cpp deleted file mode 100644 index 4cc2e44..0000000 --- a/3rdparty/glm/source/test/ext/ext_vector_uint3_sized.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT -static_assert(sizeof(glm::u8vec3) == 3, "int8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::u16vec3) == 6, "int16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::u32vec3) == 12, "int32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::u64vec3) == 24, "int64 size isn't 8 bytes on this platform"); -#endif - -static int test_size() -{ - int Error = 0; - - Error += sizeof(glm::u8vec3) == 3 ? 0 : 1; - Error += sizeof(glm::u16vec3) == 6 ? 0 : 1; - Error += sizeof(glm::u32vec3) == 12 ? 0 : 1; - Error += sizeof(glm::u64vec3) == 24 ? 0 : 1; - - return Error; -} - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::u8vec3) < sizeof(glm::u16vec3) ? 0 : 1; - Error += sizeof(glm::u16vec3) < sizeof(glm::u32vec3) ? 0 : 1; - Error += sizeof(glm::u32vec3) < sizeof(glm::u64vec3) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_size(); - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_vector_uint4_sized.cpp b/3rdparty/glm/source/test/ext/ext_vector_uint4_sized.cpp deleted file mode 100644 index 9e7ffe7..0000000 --- a/3rdparty/glm/source/test/ext/ext_vector_uint4_sized.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include - -#if GLM_HAS_STATIC_ASSERT -static_assert(sizeof(glm::u8vec4) == 4, "int8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::u16vec4) == 8, "int16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::u32vec4) == 16, "int32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::u64vec4) == 32, "int64 size isn't 8 bytes on this platform"); -#endif - -static int test_size() -{ - int Error = 0; - - Error += sizeof(glm::u8vec4) == 4 ? 0 : 1; - Error += sizeof(glm::u16vec4) == 8 ? 0 : 1; - Error += sizeof(glm::u32vec4) == 16 ? 0 : 1; - Error += sizeof(glm::u64vec4) == 32 ? 0 : 1; - - return Error; -} - -static int test_comp() -{ - int Error = 0; - - Error += sizeof(glm::u8vec4) < sizeof(glm::u16vec4) ? 0 : 1; - Error += sizeof(glm::u16vec4) < sizeof(glm::u32vec4) ? 0 : 1; - Error += sizeof(glm::u32vec4) < sizeof(glm::u64vec4) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_size(); - Error += test_comp(); - - return Error; -} diff --git a/3rdparty/glm/source/test/ext/ext_vector_ulp.cpp b/3rdparty/glm/source/test/ext/ext_vector_ulp.cpp deleted file mode 100644 index 6ebd1a1..0000000 --- a/3rdparty/glm/source/test/ext/ext_vector_ulp.cpp +++ /dev/null @@ -1,99 +0,0 @@ -#include -#include -#include -#include -#include - -static int test_ulp_float_dist() -{ - int Error = 0; - - glm::vec4 const A(1.0f); - - glm::vec4 const B = glm::nextFloat(A); - Error += glm::any(glm::notEqual(A, B, 0)) ? 0 : 1; - glm::vec4 const C = glm::prevFloat(B); - Error += glm::all(glm::equal(A, C, 0)) ? 0 : 1; - - glm::ivec4 const D = glm::floatDistance(A, B); - Error += D == glm::ivec4(1) ? 0 : 1; - glm::ivec4 const E = glm::floatDistance(A, C); - Error += E == glm::ivec4(0) ? 0 : 1; - - return Error; -} - -static int test_ulp_float_step() -{ - int Error = 0; - - glm::vec4 const A(1.0f); - - for(int i = 10; i < 1000; i *= 10) - { - glm::vec4 const B = glm::nextFloat(A, i); - Error += glm::any(glm::notEqual(A, B, 0)) ? 0 : 1; - glm::vec4 const C = glm::prevFloat(B, i); - Error += glm::all(glm::equal(A, C, 0)) ? 0 : 1; - - glm::ivec4 const D = glm::floatDistance(A, B); - Error += D == glm::ivec4(i) ? 0 : 1; - glm::ivec4 const E = glm::floatDistance(A, C); - Error += E == glm::ivec4(0) ? 0 : 1; - } - - return Error; -} - -static int test_ulp_double_dist() -{ - int Error = 0; - - glm::dvec4 const A(1.0); - - glm::dvec4 const B = glm::nextFloat(A); - Error += glm::any(glm::notEqual(A, B, 0)) ? 0 : 1; - glm::dvec4 const C = glm::prevFloat(B); - Error += glm::all(glm::equal(A, C, 0)) ? 0 : 1; - - glm::ivec4 const D(glm::floatDistance(A, B)); - Error += D == glm::ivec4(1) ? 0 : 1; - glm::ivec4 const E = glm::floatDistance(A, C); - Error += E == glm::ivec4(0) ? 0 : 1; - - return Error; -} - -static int test_ulp_double_step() -{ - int Error = 0; - - glm::dvec4 const A(1.0); - - for(int i = 10; i < 1000; i *= 10) - { - glm::dvec4 const B = glm::nextFloat(A, i); - Error += glm::any(glm::notEqual(A, B, 0)) ? 0 : 1; - glm::dvec4 const C = glm::prevFloat(B, i); - Error += glm::all(glm::equal(A, C, 0)) ? 0 : 1; - - glm::ivec4 const D(glm::floatDistance(A, B)); - Error += D == glm::ivec4(i) ? 0 : 1; - glm::ivec4 const E(glm::floatDistance(A, C)); - Error += E == glm::ivec4(0) ? 0 : 1; - } - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_ulp_float_dist(); - Error += test_ulp_float_step(); - Error += test_ulp_double_dist(); - Error += test_ulp_double_step(); - - return Error; -} diff --git a/3rdparty/glm/source/test/glm.cppcheck b/3rdparty/glm/source/test/glm.cppcheck deleted file mode 100644 index 12081fe..0000000 --- a/3rdparty/glm/source/test/glm.cppcheck +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/3rdparty/glm/source/test/gtc/CMakeLists.txt b/3rdparty/glm/source/test/gtc/CMakeLists.txt deleted file mode 100644 index 4aef24a..0000000 --- a/3rdparty/glm/source/test/gtc/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -glmCreateTestGTC(gtc_bitfield) -glmCreateTestGTC(gtc_color_space) -glmCreateTestGTC(gtc_constants) -glmCreateTestGTC(gtc_epsilon) -glmCreateTestGTC(gtc_integer) -glmCreateTestGTC(gtc_matrix_access) -glmCreateTestGTC(gtc_matrix_integer) -glmCreateTestGTC(gtc_matrix_inverse) -glmCreateTestGTC(gtc_matrix_transform) -glmCreateTestGTC(gtc_noise) -glmCreateTestGTC(gtc_packing) -glmCreateTestGTC(gtc_quaternion) -glmCreateTestGTC(gtc_random) -glmCreateTestGTC(gtc_round) -glmCreateTestGTC(gtc_reciprocal) -glmCreateTestGTC(gtc_type_aligned) -glmCreateTestGTC(gtc_type_precision) -glmCreateTestGTC(gtc_type_ptr) -glmCreateTestGTC(gtc_ulp) -glmCreateTestGTC(gtc_vec1) diff --git a/3rdparty/glm/source/test/gtc/gtc_bitfield.cpp b/3rdparty/glm/source/test/gtc/gtc_bitfield.cpp deleted file mode 100644 index 95c41f1..0000000 --- a/3rdparty/glm/source/test/gtc/gtc_bitfield.cpp +++ /dev/null @@ -1,936 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -namespace mask -{ - template - struct type - { - genType Value; - genType Return; - }; - - inline int mask_zero(int Bits) - { - return ~((~0) << Bits); - } - - inline int mask_mix(int Bits) - { - return Bits >= sizeof(int) * 8 ? 0xffffffff : (static_cast(1) << Bits) - static_cast(1); - } - - inline int mask_half(int Bits) - { - // We do the shift in two steps because 1 << 32 on an int is undefined. - - int const Half = Bits >> 1; - int const Fill = ~0; - int const ShiftHaft = (Fill << Half); - int const Rest = Bits - Half; - int const Reversed = ShiftHaft << Rest; - - return ~Reversed; - } - - inline int mask_loop(int Bits) - { - int Mask = 0; - for(int Bit = 0; Bit < Bits; ++Bit) - Mask |= (static_cast(1) << Bit); - return Mask; - } - - int perf() - { - int const Count = 100000000; - - std::clock_t Timestamp1 = std::clock(); - - { - std::vector Mask; - Mask.resize(Count); - for(int i = 0; i < Count; ++i) - Mask[i] = mask_mix(i % 32); - } - - std::clock_t Timestamp2 = std::clock(); - - { - std::vector Mask; - Mask.resize(Count); - for(int i = 0; i < Count; ++i) - Mask[i] = mask_loop(i % 32); - } - - std::clock_t Timestamp3 = std::clock(); - - { - std::vector Mask; - Mask.resize(Count); - for(int i = 0; i < Count; ++i) - Mask[i] = glm::mask(i % 32); - } - - std::clock_t Timestamp4 = std::clock(); - - { - std::vector Mask; - Mask.resize(Count); - for(int i = 0; i < Count; ++i) - Mask[i] = mask_zero(i % 32); - } - - std::clock_t Timestamp5 = std::clock(); - - { - std::vector Mask; - Mask.resize(Count); - for(int i = 0; i < Count; ++i) - Mask[i] = mask_half(i % 32); - } - - std::clock_t Timestamp6 = std::clock(); - - std::clock_t TimeMix = Timestamp2 - Timestamp1; - std::clock_t TimeLoop = Timestamp3 - Timestamp2; - std::clock_t TimeDefault = Timestamp4 - Timestamp3; - std::clock_t TimeZero = Timestamp5 - Timestamp4; - std::clock_t TimeHalf = Timestamp6 - Timestamp5; - - std::printf("mask[mix]: %d\n", static_cast(TimeMix)); - std::printf("mask[loop]: %d\n", static_cast(TimeLoop)); - std::printf("mask[default]: %d\n", static_cast(TimeDefault)); - std::printf("mask[zero]: %d\n", static_cast(TimeZero)); - std::printf("mask[half]: %d\n", static_cast(TimeHalf)); - - return TimeDefault < TimeLoop ? 0 : 1; - } - - int test_uint() - { - type const Data[] = - { - { 0, 0x00000000}, - { 1, 0x00000001}, - { 2, 0x00000003}, - { 3, 0x00000007}, - {31, 0x7fffffff}, - {32, 0xffffffff} - }; - - int Error = 0; -/* mask_zero is sadly not a correct code - for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) - { - int Result = mask_zero(Data[i].Value); - Error += Data[i].Return == Result ? 0 : 1; - } -*/ - for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) - { - int Result = mask_mix(Data[i].Value); - Error += Data[i].Return == Result ? 0 : 1; - } - - for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) - { - int Result = mask_half(Data[i].Value); - Error += Data[i].Return == Result ? 0 : 1; - } - - for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) - { - int Result = mask_loop(Data[i].Value); - Error += Data[i].Return == Result ? 0 : 1; - } - - for(std::size_t i = 0; i < sizeof(Data) / sizeof(type); ++i) - { - int Result = glm::mask(Data[i].Value); - Error += Data[i].Return == Result ? 0 : 1; - } - - return Error; - } - - int test_uvec4() - { - type const Data[] = - { - {glm::ivec4( 0), glm::ivec4(0x00000000)}, - {glm::ivec4( 1), glm::ivec4(0x00000001)}, - {glm::ivec4( 2), glm::ivec4(0x00000003)}, - {glm::ivec4( 3), glm::ivec4(0x00000007)}, - {glm::ivec4(31), glm::ivec4(0x7fffffff)}, - {glm::ivec4(32), glm::ivec4(0xffffffff)} - }; - - int Error(0); - - for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - glm::ivec4 Result = glm::mask(Data[i].Value); - Error += glm::all(glm::equal(Data[i].Return, Result)) ? 0 : 1; - } - - return Error; - } - - int test() - { - int Error(0); - - Error += test_uint(); - Error += test_uvec4(); - - return Error; - } -}//namespace mask - -namespace bitfieldInterleave3 -{ - template - inline RET refBitfieldInterleave(PARAM x, PARAM y, PARAM z) - { - RET Result = 0; - for(RET i = 0; i < sizeof(PARAM) * 8; ++i) - { - Result |= ((RET(x) & (RET(1U) << i)) << ((i << 1) + 0)); - Result |= ((RET(y) & (RET(1U) << i)) << ((i << 1) + 1)); - Result |= ((RET(z) & (RET(1U) << i)) << ((i << 1) + 2)); - } - return Result; - } - - int test() - { - int Error(0); - - glm::uint16 x_max = 1 << 11; - glm::uint16 y_max = 1 << 11; - glm::uint16 z_max = 1 << 11; - - for(glm::uint16 z = 0; z < z_max; z += 27) - for(glm::uint16 y = 0; y < y_max; y += 27) - for(glm::uint16 x = 0; x < x_max; x += 27) - { - glm::uint64 ResultA = refBitfieldInterleave(x, y, z); - glm::uint64 ResultB = glm::bitfieldInterleave(x, y, z); - Error += ResultA == ResultB ? 0 : 1; - } - - return Error; - } -} - -namespace bitfieldInterleave4 -{ - template - inline RET loopBitfieldInterleave(PARAM x, PARAM y, PARAM z, PARAM w) - { - RET const v[4] = {x, y, z, w}; - RET Result = 0; - for(RET i = 0; i < sizeof(PARAM) * 8; i++) - { - Result |= ((((v[0] >> i) & 1U)) << ((i << 2) + 0)); - Result |= ((((v[1] >> i) & 1U)) << ((i << 2) + 1)); - Result |= ((((v[2] >> i) & 1U)) << ((i << 2) + 2)); - Result |= ((((v[3] >> i) & 1U)) << ((i << 2) + 3)); - } - return Result; - } - - int test() - { - int Error(0); - - glm::uint16 x_max = 1 << 11; - glm::uint16 y_max = 1 << 11; - glm::uint16 z_max = 1 << 11; - glm::uint16 w_max = 1 << 11; - - for(glm::uint16 w = 0; w < w_max; w += 27) - for(glm::uint16 z = 0; z < z_max; z += 27) - for(glm::uint16 y = 0; y < y_max; y += 27) - for(glm::uint16 x = 0; x < x_max; x += 27) - { - glm::uint64 ResultA = loopBitfieldInterleave(x, y, z, w); - glm::uint64 ResultB = glm::bitfieldInterleave(x, y, z, w); - Error += ResultA == ResultB ? 0 : 1; - } - - return Error; - } -} - -namespace bitfieldInterleave -{ - inline glm::uint64 fastBitfieldInterleave(glm::uint32 x, glm::uint32 y) - { - glm::uint64 REG1; - glm::uint64 REG2; - - REG1 = x; - REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF); - REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF); - REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F); - REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333); - REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555); - - REG2 = y; - REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF); - REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF); - REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F); - REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333); - REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555); - - return REG1 | (REG2 << 1); - } - - inline glm::uint64 interleaveBitfieldInterleave(glm::uint32 x, glm::uint32 y) - { - glm::uint64 REG1; - glm::uint64 REG2; - - REG1 = x; - REG2 = y; - - REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF); - REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF); - - REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF); - REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF); - - REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F); - REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F); - - REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333); - REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333); - - REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555); - REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555); - - return REG1 | (REG2 << 1); - } -/* - inline glm::uint64 loopBitfieldInterleave(glm::uint32 x, glm::uint32 y) - { - static glm::uint64 const Mask[5] = - { - 0x5555555555555555, - 0x3333333333333333, - 0x0F0F0F0F0F0F0F0F, - 0x00FF00FF00FF00FF, - 0x0000FFFF0000FFFF - }; - - glm::uint64 REG1 = x; - glm::uint64 REG2 = y; - for(int i = 4; i >= 0; --i) - { - REG1 = ((REG1 << (1 << i)) | REG1) & Mask[i]; - REG2 = ((REG2 << (1 << i)) | REG2) & Mask[i]; - } - - return REG1 | (REG2 << 1); - } -*/ -#if GLM_ARCH & GLM_ARCH_SSE2_BIT - inline glm::uint64 sseBitfieldInterleave(glm::uint32 x, glm::uint32 y) - { - __m128i const Array = _mm_set_epi32(0, y, 0, x); - - __m128i const Mask4 = _mm_set1_epi32(0x0000FFFF); - __m128i const Mask3 = _mm_set1_epi32(0x00FF00FF); - __m128i const Mask2 = _mm_set1_epi32(0x0F0F0F0F); - __m128i const Mask1 = _mm_set1_epi32(0x33333333); - __m128i const Mask0 = _mm_set1_epi32(0x55555555); - - __m128i Reg1; - __m128i Reg2; - - // REG1 = x; - // REG2 = y; - Reg1 = _mm_load_si128(&Array); - - //REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF); - //REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF); - Reg2 = _mm_slli_si128(Reg1, 2); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask4); - - //REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF); - //REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF); - Reg2 = _mm_slli_si128(Reg1, 1); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask3); - - //REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F); - //REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F); - Reg2 = _mm_slli_epi32(Reg1, 4); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask2); - - //REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333); - //REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333); - Reg2 = _mm_slli_epi32(Reg1, 2); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask1); - - //REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555); - //REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555); - Reg2 = _mm_slli_epi32(Reg1, 1); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask0); - - //return REG1 | (REG2 << 1); - Reg2 = _mm_slli_epi32(Reg1, 1); - Reg2 = _mm_srli_si128(Reg2, 8); - Reg1 = _mm_or_si128(Reg1, Reg2); - - __m128i Result; - _mm_store_si128(&Result, Reg1); - return *reinterpret_cast(&Result); - } - - inline glm::uint64 sseUnalignedBitfieldInterleave(glm::uint32 x, glm::uint32 y) - { - __m128i const Array = _mm_set_epi32(0, y, 0, x); - - __m128i const Mask4 = _mm_set1_epi32(0x0000FFFF); - __m128i const Mask3 = _mm_set1_epi32(0x00FF00FF); - __m128i const Mask2 = _mm_set1_epi32(0x0F0F0F0F); - __m128i const Mask1 = _mm_set1_epi32(0x33333333); - __m128i const Mask0 = _mm_set1_epi32(0x55555555); - - __m128i Reg1; - __m128i Reg2; - - // REG1 = x; - // REG2 = y; - Reg1 = _mm_loadu_si128(&Array); - - //REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF); - //REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF); - Reg2 = _mm_slli_si128(Reg1, 2); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask4); - - //REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF); - //REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF); - Reg2 = _mm_slli_si128(Reg1, 1); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask3); - - //REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F); - //REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F); - Reg2 = _mm_slli_epi32(Reg1, 4); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask2); - - //REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333); - //REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333); - Reg2 = _mm_slli_epi32(Reg1, 2); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask1); - - //REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555); - //REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555); - Reg2 = _mm_slli_epi32(Reg1, 1); - Reg1 = _mm_or_si128(Reg2, Reg1); - Reg1 = _mm_and_si128(Reg1, Mask0); - - //return REG1 | (REG2 << 1); - Reg2 = _mm_slli_epi32(Reg1, 1); - Reg2 = _mm_srli_si128(Reg2, 8); - Reg1 = _mm_or_si128(Reg1, Reg2); - - __m128i Result; - _mm_store_si128(&Result, Reg1); - return *reinterpret_cast(&Result); - } -#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT - - int test() - { - int Error = 0; - -/* - { - for(glm::uint32 y = 0; y < (1 << 10); ++y) - for(glm::uint32 x = 0; x < (1 << 10); ++x) - { - glm::uint64 A = glm::bitfieldInterleave(x, y); - glm::uint64 B = fastBitfieldInterleave(x, y); - //glm::uint64 C = loopBitfieldInterleave(x, y); - glm::uint64 D = interleaveBitfieldInterleave(x, y); - - assert(A == B); - //assert(A == C); - assert(A == D); - -# if GLM_ARCH & GLM_ARCH_SSE2_BIT - glm::uint64 E = sseBitfieldInterleave(x, y); - glm::uint64 F = sseUnalignedBitfieldInterleave(x, y); - assert(A == E); - assert(A == F); - - __m128i G = glm_i128_interleave(_mm_set_epi32(0, y, 0, x)); - glm::uint64 Result[2]; - _mm_storeu_si128((__m128i*)Result, G); - assert(A == Result[0]); -# endif//GLM_ARCH & GLM_ARCH_SSE2_BIT - } - } -*/ - { - for(glm::uint8 y = 0; y < 127; ++y) - for(glm::uint8 x = 0; x < 127; ++x) - { - glm::uint64 A(glm::bitfieldInterleave(glm::u8vec2(x, y))); - glm::uint64 B(glm::bitfieldInterleave(glm::u16vec2(x, y))); - glm::uint64 C(glm::bitfieldInterleave(glm::u32vec2(x, y))); - - Error += A == B ? 0 : 1; - Error += A == C ? 0 : 1; - - glm::u32vec2 const& D = glm::bitfieldDeinterleave(C); - Error += D.x == x ? 0 : 1; - Error += D.y == y ? 0 : 1; - } - } - - { - for(glm::uint8 y = 0; y < 127; ++y) - for(glm::uint8 x = 0; x < 127; ++x) - { - glm::int64 A(glm::bitfieldInterleave(glm::int8(x), glm::int8(y))); - glm::int64 B(glm::bitfieldInterleave(glm::int16(x), glm::int16(y))); - glm::int64 C(glm::bitfieldInterleave(glm::int32(x), glm::int32(y))); - - Error += A == B ? 0 : 1; - Error += A == C ? 0 : 1; - } - } - - return Error; - } - - int perf() - { - glm::uint32 x_max = 1 << 11; - glm::uint32 y_max = 1 << 10; - - // ALU - std::vector Data(x_max * y_max); - std::vector Param(x_max * y_max); - for(glm::uint32 i = 0; i < Param.size(); ++i) - Param[i] = glm::u32vec2(i % x_max, i / y_max); - - { - std::clock_t LastTime = std::clock(); - - for(std::size_t i = 0; i < Data.size(); ++i) - Data[i] = glm::bitfieldInterleave(Param[i].x, Param[i].y); - - std::clock_t Time = std::clock() - LastTime; - - std::printf("glm::bitfieldInterleave Time %d clocks\n", static_cast(Time)); - } - - { - std::clock_t LastTime = std::clock(); - - for(std::size_t i = 0; i < Data.size(); ++i) - Data[i] = fastBitfieldInterleave(Param[i].x, Param[i].y); - - std::clock_t Time = std::clock() - LastTime; - - std::printf("fastBitfieldInterleave Time %d clocks\n", static_cast(Time)); - } -/* - { - std::clock_t LastTime = std::clock(); - - for(std::size_t i = 0; i < Data.size(); ++i) - Data[i] = loopBitfieldInterleave(Param[i].x, Param[i].y); - - std::clock_t Time = std::clock() - LastTime; - - std::printf("loopBitfieldInterleave Time %d clocks\n", static_cast(Time)); - } -*/ - { - std::clock_t LastTime = std::clock(); - - for(std::size_t i = 0; i < Data.size(); ++i) - Data[i] = interleaveBitfieldInterleave(Param[i].x, Param[i].y); - - std::clock_t Time = std::clock() - LastTime; - - std::printf("interleaveBitfieldInterleave Time %d clocks\n", static_cast(Time)); - } - -# if GLM_ARCH & GLM_ARCH_SSE2_BIT - { - std::clock_t LastTime = std::clock(); - - for(std::size_t i = 0; i < Data.size(); ++i) - Data[i] = sseBitfieldInterleave(Param[i].x, Param[i].y); - - std::clock_t Time = std::clock() - LastTime; - - std::printf("sseBitfieldInterleave Time %d clocks\n", static_cast(Time)); - } - - { - std::clock_t LastTime = std::clock(); - - for(std::size_t i = 0; i < Data.size(); ++i) - Data[i] = sseUnalignedBitfieldInterleave(Param[i].x, Param[i].y); - - std::clock_t Time = std::clock() - LastTime; - - std::printf("sseUnalignedBitfieldInterleave Time %d clocks\n", static_cast(Time)); - } -# endif//GLM_ARCH & GLM_ARCH_SSE2_BIT - - { - std::clock_t LastTime = std::clock(); - - for(std::size_t i = 0; i < Data.size(); ++i) - Data[i] = glm::bitfieldInterleave(Param[i].x, Param[i].y, Param[i].x); - - std::clock_t Time = std::clock() - LastTime; - - std::printf("glm::detail::bitfieldInterleave Time %d clocks\n", static_cast(Time)); - } - -# if(GLM_ARCH & GLM_ARCH_SSE2_BIT && !(GLM_COMPILER & GLM_COMPILER_GCC)) - { - // SIMD - std::vector<__m128i> SimdData; - SimdData.resize(static_cast(x_max * y_max)); - std::vector<__m128i> SimdParam; - SimdParam.resize(static_cast(x_max * y_max)); - for(std::size_t i = 0; i < SimdParam.size(); ++i) - SimdParam[i] = _mm_set_epi32(static_cast(i % static_cast(x_max)), 0, static_cast(i / static_cast(y_max)), 0); - - std::clock_t LastTime = std::clock(); - - for(std::size_t i = 0; i < SimdData.size(); ++i) - SimdData[i] = glm_i128_interleave(SimdParam[i]); - - std::clock_t Time = std::clock() - LastTime; - - std::printf("_mm_bit_interleave_si128 Time %d clocks\n", static_cast(Time)); - } -# endif//GLM_ARCH & GLM_ARCH_SSE2_BIT - - return 0; - } -}//namespace bitfieldInterleave - -namespace bitfieldInterleave5 -{ - GLM_FUNC_QUALIFIER glm::uint16 bitfieldInterleave_u8vec2(glm::uint8 x, glm::uint8 y) - { - glm::uint32 Result = (glm::uint32(y) << 16) | glm::uint32(x); - Result = ((Result << 4) | Result) & 0x0F0F0F0F; - Result = ((Result << 2) | Result) & 0x33333333; - Result = ((Result << 1) | Result) & 0x55555555; - return static_cast((Result & 0x0000FFFF) | (Result >> 15)); - } - - GLM_FUNC_QUALIFIER glm::u8vec2 bitfieldDeinterleave_u8vec2(glm::uint16 InterleavedBitfield) - { - glm::uint32 Result(InterleavedBitfield); - Result = ((Result << 15) | Result) & 0x55555555; - Result = ((Result >> 1) | Result) & 0x33333333; - Result = ((Result >> 2) | Result) & 0x0F0F0F0F; - Result = ((Result >> 4) | Result) & 0x00FF00FF; - return glm::u8vec2(Result & 0x0000FFFF, Result >> 16); - } - - GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave_u8vec4(glm::uint8 x, glm::uint8 y, glm::uint8 z, glm::uint8 w) - { - glm::uint64 Result = (glm::uint64(w) << 48) | (glm::uint64(z) << 32) | (glm::uint64(y) << 16) | glm::uint64(x); - Result = ((Result << 12) | Result) & 0x000F000F000F000Full; - Result = ((Result << 6) | Result) & 0x0303030303030303ull; - Result = ((Result << 3) | Result) & 0x1111111111111111ull; - - const glm::uint32 a = static_cast((Result & 0x000000000000FFFF) >> ( 0 - 0)); - const glm::uint32 b = static_cast((Result & 0x00000000FFFF0000) >> (16 - 3)); - const glm::uint32 c = static_cast((Result & 0x0000FFFF00000000) >> (32 - 6)); - const glm::uint32 d = static_cast((Result & 0xFFFF000000000000) >> (48 - 12)); - - return a | b | c | d; - } - - GLM_FUNC_QUALIFIER glm::u8vec4 bitfieldDeinterleave_u8vec4(glm::uint32 InterleavedBitfield) - { - glm::uint64 Result(InterleavedBitfield); - Result = ((Result << 15) | Result) & 0x9249249249249249ull; - Result = ((Result >> 1) | Result) & 0x30C30C30C30C30C3ull; - Result = ((Result >> 2) | Result) & 0xF00F00F00F00F00Full; - Result = ((Result >> 4) | Result) & 0x00FF0000FF0000FFull; - return glm::u8vec4( - (Result >> 0) & 0x000000000000FFFFull, - (Result >> 16) & 0x00000000FFFF0000ull, - (Result >> 32) & 0x0000FFFF00000000ull, - (Result >> 48) & 0xFFFF000000000000ull); - } - - GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave_u16vec2(glm::uint16 x, glm::uint16 y) - { - glm::uint64 Result = (glm::uint64(y) << 32) | glm::uint64(x); - Result = ((Result << 8) | Result) & static_cast(0x00FF00FF00FF00FFull); - Result = ((Result << 4) | Result) & static_cast(0x0F0F0F0F0F0F0F0Full); - Result = ((Result << 2) | Result) & static_cast(0x3333333333333333ull); - Result = ((Result << 1) | Result) & static_cast(0x5555555555555555ull); - return static_cast((Result & 0x00000000FFFFFFFFull) | (Result >> 31)); - } - - GLM_FUNC_QUALIFIER glm::u16vec2 bitfieldDeinterleave_u16vec2(glm::uint32 InterleavedBitfield) - { - glm::uint64 Result(InterleavedBitfield); - Result = ((Result << 31) | Result) & 0x5555555555555555ull; - Result = ((Result >> 1) | Result) & 0x3333333333333333ull; - Result = ((Result >> 2) | Result) & 0x0F0F0F0F0F0F0F0Full; - Result = ((Result >> 4) | Result) & 0x00FF00FF00FF00FFull; - Result = ((Result >> 8) | Result) & 0x0000FFFF0000FFFFull; - return glm::u16vec2(Result & 0x00000000FFFFFFFFull, Result >> 32); - } - - int test() - { - int Error = 0; - - for(glm::size_t j = 0; j < 256; ++j) - for(glm::size_t i = 0; i < 256; ++i) - { - glm::uint16 A = bitfieldInterleave_u8vec2(glm::uint8(i), glm::uint8(j)); - glm::uint16 B = glm::bitfieldInterleave(glm::uint8(i), glm::uint8(j)); - Error += A == B ? 0 : 1; - - glm::u8vec2 C = bitfieldDeinterleave_u8vec2(A); - Error += C.x == glm::uint8(i) ? 0 : 1; - Error += C.y == glm::uint8(j) ? 0 : 1; - } - - for(glm::size_t j = 0; j < 256; ++j) - for(glm::size_t i = 0; i < 256; ++i) - { - glm::uint32 A = bitfieldInterleave_u8vec4(glm::uint8(i), glm::uint8(j), glm::uint8(i), glm::uint8(j)); - glm::uint32 B = glm::bitfieldInterleave(glm::uint8(i), glm::uint8(j), glm::uint8(i), glm::uint8(j)); - Error += A == B ? 0 : 1; -/* - glm::u8vec4 C = bitfieldDeinterleave_u8vec4(A); - Error += C.x == glm::uint8(i) ? 0 : 1; - Error += C.y == glm::uint8(j) ? 0 : 1; - Error += C.z == glm::uint8(i) ? 0 : 1; - Error += C.w == glm::uint8(j) ? 0 : 1; -*/ - } - - for(glm::size_t j = 0; j < 256; ++j) - for(glm::size_t i = 0; i < 256; ++i) - { - glm::uint32 A = bitfieldInterleave_u16vec2(glm::uint16(i), glm::uint16(j)); - glm::uint32 B = glm::bitfieldInterleave(glm::uint16(i), glm::uint16(j)); - Error += A == B ? 0 : 1; - } - - return Error; - } - - int perf_old_u8vec2(std::vector& Result) - { - int Error = 0; - - const std::clock_t BeginTime = std::clock(); - - for(glm::size_t k = 0; k < 10000; ++k) - for(glm::size_t j = 0; j < 256; ++j) - for(glm::size_t i = 0; i < 256; ++i) - Error += Result[j * 256 + i] == glm::bitfieldInterleave(glm::uint8(i), glm::uint8(j)) ? 0 : 1; - - const std::clock_t EndTime = std::clock(); - - std::printf("glm::bitfieldInterleave Time %d clocks\n", static_cast(EndTime - BeginTime)); - - return Error; - } - - int perf_new_u8vec2(std::vector& Result) - { - int Error = 0; - - const std::clock_t BeginTime = std::clock(); - - for(glm::size_t k = 0; k < 10000; ++k) - for(glm::size_t j = 0; j < 256; ++j) - for(glm::size_t i = 0; i < 256; ++i) - Error += Result[j * 256 + i] == bitfieldInterleave_u8vec2(glm::uint8(i), glm::uint8(j)) ? 0 : 1; - - const std::clock_t EndTime = std::clock(); - - std::printf("bitfieldInterleave_u8vec2 Time %d clocks\n", static_cast(EndTime - BeginTime)); - - return Error; - } - - int perf_old_u8vec4(std::vector& Result) - { - int Error = 0; - - const std::clock_t BeginTime = std::clock(); - - for(glm::size_t k = 0; k < 10000; ++k) - for(glm::size_t j = 0; j < 256; ++j) - for(glm::size_t i = 0; i < 256; ++i) - Error += Result[j * 256 + i] == glm::bitfieldInterleave(glm::uint8(i), glm::uint8(j), glm::uint8(i), glm::uint8(j)) ? 0 : 1; - - const std::clock_t EndTime = std::clock(); - - std::printf("glm::bitfieldInterleave Time %d clocks\n", static_cast(EndTime - BeginTime)); - - return Error; - } - - int perf_new_u8vec4(std::vector& Result) - { - int Error = 0; - - const std::clock_t BeginTime = std::clock(); - - for(glm::size_t k = 0; k < 10000; ++k) - for(glm::size_t j = 0; j < 256; ++j) - for(glm::size_t i = 0; i < 256; ++i) - Error += Result[j * 256 + i] == bitfieldInterleave_u8vec4(glm::uint8(i), glm::uint8(j), glm::uint8(i), glm::uint8(j)) ? 0 : 1; - - const std::clock_t EndTime = std::clock(); - - std::printf("bitfieldInterleave_u8vec4 Time %d clocks\n", static_cast(EndTime - BeginTime)); - - return Error; - } - - int perf_old_u16vec2(std::vector& Result) - { - int Error = 0; - - const std::clock_t BeginTime = std::clock(); - - for(glm::size_t k = 0; k < 10000; ++k) - for(glm::size_t j = 0; j < 256; ++j) - for(glm::size_t i = 0; i < 256; ++i) - Error += Result[j * 256 + i] == glm::bitfieldInterleave(glm::uint16(i), glm::uint16(j)) ? 0 : 1; - - const std::clock_t EndTime = std::clock(); - - std::printf("glm::bitfieldInterleave Time %d clocks\n", static_cast(EndTime - BeginTime)); - - return Error; - } - - int perf_new_u16vec2(std::vector& Result) - { - int Error = 0; - - const std::clock_t BeginTime = std::clock(); - - for(glm::size_t k = 0; k < 10000; ++k) - for(glm::size_t j = 0; j < 256; ++j) - for(glm::size_t i = 0; i < 256; ++i) - Error += Result[j * 256 + i] == bitfieldInterleave_u16vec2(glm::uint16(i), glm::uint16(j)) ? 0 : 1; - - const std::clock_t EndTime = std::clock(); - - std::printf("bitfieldInterleave_u16vec2 Time %d clocks\n", static_cast(EndTime - BeginTime)); - - return Error; - } - - int perf() - { - int Error = 0; - - std::printf("bitfieldInterleave perf: init\r"); - - std::vector Result_u8vec2(256 * 256, 0); - for(glm::size_t j = 0; j < 256; ++j) - for(glm::size_t i = 0; i < 256; ++i) - Result_u8vec2[j * 256 + i] = glm::bitfieldInterleave(glm::uint8(i), glm::uint8(j)); - - Error += perf_old_u8vec2(Result_u8vec2); - Error += perf_new_u8vec2(Result_u8vec2); - - std::vector Result_u8vec4(256 * 256, 0); - for(glm::size_t j = 0; j < 256; ++j) - for(glm::size_t i = 0; i < 256; ++i) - Result_u8vec4[j * 256 + i] = glm::bitfieldInterleave(glm::uint8(i), glm::uint8(j), glm::uint8(i), glm::uint8(j)); - - Error += perf_old_u8vec4(Result_u8vec4); - Error += perf_new_u8vec4(Result_u8vec4); - - std::vector Result_u16vec2(256 * 256, 0); - for(glm::size_t j = 0; j < 256; ++j) - for(glm::size_t i = 0; i < 256; ++i) - Result_u16vec2[j * 256 + i] = glm::bitfieldInterleave(glm::uint16(i), glm::uint16(j)); - - Error += perf_old_u16vec2(Result_u16vec2); - Error += perf_new_u16vec2(Result_u16vec2); - - std::printf("bitfieldInterleave perf: %d Errors\n", Error); - - return Error; - } - -}//namespace bitfieldInterleave5 - -static int test_bitfieldRotateRight() -{ - glm::ivec4 const A = glm::bitfieldRotateRight(glm::ivec4(2), 1); - glm::ivec4 const B = glm::ivec4(2) >> 1; - - return A == B; -} - -static int test_bitfieldRotateLeft() -{ - glm::ivec4 const A = glm::bitfieldRotateLeft(glm::ivec4(2), 1); - glm::ivec4 const B = glm::ivec4(2) << 1; - - return A == B; -} - -int main() -{ - int Error = 0; - -/* Tests for a faster and to reserve bitfieldInterleave - Error += ::bitfieldInterleave5::test(); - Error += ::bitfieldInterleave5::perf(); -*/ - Error += ::mask::test(); - Error += ::bitfieldInterleave3::test(); - Error += ::bitfieldInterleave4::test(); - Error += ::bitfieldInterleave::test(); - - Error += test_bitfieldRotateRight(); - Error += test_bitfieldRotateLeft(); - -# ifdef NDEBUG - Error += ::mask::perf(); - Error += ::bitfieldInterleave::perf(); -# endif//NDEBUG - - return Error; -} diff --git a/3rdparty/glm/source/test/gtc/gtc_color_space.cpp b/3rdparty/glm/source/test/gtc/gtc_color_space.cpp deleted file mode 100644 index 67650c5..0000000 --- a/3rdparty/glm/source/test/gtc/gtc_color_space.cpp +++ /dev/null @@ -1,78 +0,0 @@ -#include -#include -#include - -namespace srgb -{ - int test() - { - int Error(0); - - glm::vec3 const ColorSourceRGB(1.0, 0.5, 0.0); - - { - glm::vec3 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGB); - glm::vec3 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB); - Error += glm::all(glm::epsilonEqual(ColorSourceRGB, ColorRGB, 0.00001f)) ? 0 : 1; - } - - { - glm::vec3 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGB, 2.8f); - glm::vec3 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB, 2.8f); - Error += glm::all(glm::epsilonEqual(ColorSourceRGB, ColorRGB, 0.00001f)) ? 0 : 1; - } - - glm::vec4 const ColorSourceRGBA(1.0, 0.5, 0.0, 1.0); - - { - glm::vec4 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGBA); - glm::vec4 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB); - Error += glm::all(glm::epsilonEqual(ColorSourceRGBA, ColorRGB, 0.00001f)) ? 0 : 1; - } - - { - glm::vec4 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGBA, 2.8f); - glm::vec4 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB, 2.8f); - Error += glm::all(glm::epsilonEqual(ColorSourceRGBA, ColorRGB, 0.00001f)) ? 0 : 1; - } - - glm::vec4 const ColorSourceGNI = glm::vec4(107, 107, 104, 131) / glm::vec4(255); - - { - glm::vec4 const ColorGNA = glm::convertSRGBToLinear(ColorSourceGNI) * glm::vec4(255); - glm::vec4 const ColorGNE = glm::convertLinearToSRGB(ColorSourceGNI) * glm::vec4(255); - glm::vec4 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceGNI); - glm::vec4 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB); - Error += glm::all(glm::epsilonEqual(ColorSourceGNI, ColorRGB, 0.00001f)) ? 0 : 1; - } - - return Error; - } -}//namespace srgb - -namespace srgb_lowp -{ - int test() - { - int Error(0); - - for(float Color = 0.0f; Color < 1.0f; Color += 0.01f) - { - glm::highp_vec3 const HighpSRGB = glm::convertLinearToSRGB(glm::highp_vec3(Color)); - glm::lowp_vec3 const LowpSRGB = glm::convertLinearToSRGB(glm::lowp_vec3(Color)); - Error += glm::all(glm::epsilonEqual(glm::abs(HighpSRGB - glm::highp_vec3(LowpSRGB)), glm::highp_vec3(0), 0.1f)) ? 0 : 1; - } - - return Error; - } -}//namespace srgb_lowp - -int main() -{ - int Error(0); - - Error += srgb::test(); - Error += srgb_lowp::test(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtc/gtc_constants.cpp b/3rdparty/glm/source/test/gtc/gtc_constants.cpp deleted file mode 100644 index 3897cd0..0000000 --- a/3rdparty/glm/source/test/gtc/gtc_constants.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include - -int test_epsilon() -{ - int Error = 0; - - { - float Test = glm::epsilon(); - Error += Test > 0.0f ? 0 : 1; - } - - { - double Test = glm::epsilon(); - Error += Test > 0.0 ? 0 : 1; - } - - return Error; -} - -int main() -{ - int Error(0); - - //float MinHalf = 0.0f; - //while (glm::half(MinHalf) == glm::half(0.0f)) - // MinHalf += std::numeric_limits::epsilon(); - Error += test_epsilon(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtc/gtc_epsilon.cpp b/3rdparty/glm/source/test/gtc/gtc_epsilon.cpp deleted file mode 100644 index f0e6c8a..0000000 --- a/3rdparty/glm/source/test/gtc/gtc_epsilon.cpp +++ /dev/null @@ -1,78 +0,0 @@ -#include -#include -#include -#include - -int test_defined() -{ - glm::epsilonEqual(glm::vec2(), glm::vec2(), glm::vec2()); - glm::epsilonEqual(glm::vec3(), glm::vec3(), glm::vec3()); - glm::epsilonEqual(glm::vec4(), glm::vec4(), glm::vec4()); - - glm::epsilonNotEqual(glm::vec2(), glm::vec2(), glm::vec2()); - glm::epsilonNotEqual(glm::vec3(), glm::vec3(), glm::vec3()); - glm::epsilonNotEqual(glm::vec4(), glm::vec4(), glm::vec4()); - - glm::epsilonEqual(glm::vec2(), glm::vec2(), 0.0f); - glm::epsilonEqual(glm::vec3(), glm::vec3(), 0.0f); - glm::epsilonEqual(glm::vec4(), glm::vec4(), 0.0f); - glm::epsilonEqual(glm::quat(), glm::quat(), 0.0f); - - glm::epsilonNotEqual(glm::vec2(), glm::vec2(), 0.0f); - glm::epsilonNotEqual(glm::vec3(), glm::vec3(), 0.0f); - glm::epsilonNotEqual(glm::vec4(), glm::vec4(), 0.0f); - glm::epsilonNotEqual(glm::quat(), glm::quat(), 0.0f); - - return 0; -} - -template -int test_equal() -{ - int Error(0); - - { - T A = glm::epsilon(); - T B = glm::epsilon(); - Error += glm::epsilonEqual(A, B, glm::epsilon() * T(2)) ? 0 : 1; - } - - { - T A(0); - T B = static_cast(0) + glm::epsilon(); - Error += glm::epsilonEqual(A, B, glm::epsilon() * T(2)) ? 0 : 1; - } - - { - T A(0); - T B = static_cast(0) - glm::epsilon(); - Error += glm::epsilonEqual(A, B, glm::epsilon() * T(2)) ? 0 : 1; - } - - { - T A = static_cast(0) + glm::epsilon(); - T B = static_cast(0); - Error += glm::epsilonEqual(A, B, glm::epsilon() * T(2)) ? 0 : 1; - } - - { - T A = static_cast(0) - glm::epsilon(); - T B = static_cast(0); - Error += glm::epsilonEqual(A, B, glm::epsilon() * T(2)) ? 0 : 1; - } - - return Error; -} - -int main() -{ - int Error(0); - - Error += test_defined(); - Error += test_equal(); - Error += test_equal(); - - return Error; -} - - diff --git a/3rdparty/glm/source/test/gtc/gtc_integer.cpp b/3rdparty/glm/source/test/gtc/gtc_integer.cpp deleted file mode 100644 index 769d969..0000000 --- a/3rdparty/glm/source/test/gtc/gtc_integer.cpp +++ /dev/null @@ -1,233 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#define GLM_FORCE_INLINE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace log2_ -{ - int test() - { - int Error = 0; - - int A0 = static_cast(glm::log2(16.f)); - glm::ivec1 B0(glm::log2(glm::vec1(16.f))); - glm::ivec2 C0(glm::log2(glm::vec2(16.f))); - glm::ivec3 D0(glm::log2(glm::vec3(16.f))); - glm::ivec4 E0(glm::log2(glm::vec4(16.f))); - - int A1 = glm::log2(int(16)); - glm::ivec1 B1 = glm::log2(glm::ivec1(16)); - glm::ivec2 C1 = glm::log2(glm::ivec2(16)); - glm::ivec3 D1 = glm::log2(glm::ivec3(16)); - glm::ivec4 E1 = glm::log2(glm::ivec4(16)); - - Error += A0 == A1 ? 0 : 1; - Error += glm::all(glm::equal(B0, B1)) ? 0 : 1; - Error += glm::all(glm::equal(C0, C1)) ? 0 : 1; - Error += glm::all(glm::equal(D0, D1)) ? 0 : 1; - Error += glm::all(glm::equal(E0, E1)) ? 0 : 1; - - glm::uint64 A2 = glm::log2(glm::uint64(16)); - glm::u64vec1 B2 = glm::log2(glm::u64vec1(16)); - glm::u64vec2 C2 = glm::log2(glm::u64vec2(16)); - glm::u64vec3 D2 = glm::log2(glm::u64vec3(16)); - glm::u64vec4 E2 = glm::log2(glm::u64vec4(16)); - - Error += A2 == glm::uint64(4) ? 0 : 1; - Error += glm::all(glm::equal(B2, glm::u64vec1(4))) ? 0 : 1; - Error += glm::all(glm::equal(C2, glm::u64vec2(4))) ? 0 : 1; - Error += glm::all(glm::equal(D2, glm::u64vec3(4))) ? 0 : 1; - Error += glm::all(glm::equal(E2, glm::u64vec4(4))) ? 0 : 1; - - return Error; - } - - int perf(std::size_t Count) - { - int Error = 0; - - { - std::vector Result; - Result.resize(Count); - - std::clock_t Begin = clock(); - - for(int i = 0; i < static_cast(Count); ++i) - Result[i] = glm::log2(static_cast(i)); - - std::clock_t End = clock(); - - std::printf("glm::log2: %d clocks\n", static_cast(End - Begin)); - } - - { - std::vector Result; - Result.resize(Count); - - std::clock_t Begin = clock(); - - for(int i = 0; i < static_cast(Count); ++i) - Result[i] = glm::log2(glm::ivec4(i)); - - std::clock_t End = clock(); - - std::printf("glm::log2: %d clocks\n", static_cast(End - Begin)); - } - -# if GLM_HAS_BITSCAN_WINDOWS - { - std::vector Result; - Result.resize(Count); - - std::clock_t Begin = clock(); - - for(std::size_t i = 0; i < Count; ++i) - { - glm::vec<4, unsigned long, glm::defaultp> Tmp; - _BitScanReverse(&Tmp.x, i); - _BitScanReverse(&Tmp.y, i); - _BitScanReverse(&Tmp.z, i); - _BitScanReverse(&Tmp.w, i); - Result[i] = glm::ivec4(Tmp); - } - - std::clock_t End = clock(); - - std::printf("glm::log2 inlined: %d clocks\n", static_cast(End - Begin)); - } - - - { - std::vector > Result; - Result.resize(Count); - - std::clock_t Begin = clock(); - - for(std::size_t i = 0; i < Count; ++i) - { - _BitScanReverse(&Result[i].x, i); - _BitScanReverse(&Result[i].y, i); - _BitScanReverse(&Result[i].z, i); - _BitScanReverse(&Result[i].w, i); - } - - std::clock_t End = clock(); - - std::printf("glm::log2 inlined no cast: %d clocks\n", static_cast(End - Begin)); - } - - - { - std::vector Result; - Result.resize(Count); - - std::clock_t Begin = clock(); - - for(std::size_t i = 0; i < Count; ++i) - { - _BitScanReverse(reinterpret_cast(&Result[i].x), i); - _BitScanReverse(reinterpret_cast(&Result[i].y), i); - _BitScanReverse(reinterpret_cast(&Result[i].z), i); - _BitScanReverse(reinterpret_cast(&Result[i].w), i); - } - - std::clock_t End = clock(); - - std::printf("glm::log2 reinterpret: %d clocks\n", static_cast(End - Begin)); - } -# endif//GLM_HAS_BITSCAN_WINDOWS - - { - std::vector Result; - Result.resize(Count); - - std::clock_t Begin = clock(); - - for(std::size_t i = 0; i < Count; ++i) - Result[i] = glm::log2(static_cast(i)); - - std::clock_t End = clock(); - - std::printf("glm::log2: %d clocks\n", static_cast(End - Begin)); - } - - { - std::vector Result; - Result.resize(Count); - - std::clock_t Begin = clock(); - - for(int i = 0; i < static_cast(Count); ++i) - Result[i] = glm::log2(glm::vec4(static_cast(i))); - - std::clock_t End = clock(); - - std::printf("glm::log2: %d clocks\n", static_cast(End - Begin)); - } - - return Error; - } -}//namespace log2_ - -namespace iround -{ - int test() - { - int Error = 0; - - for(float f = 0.0f; f < 3.1f; f += 0.05f) - { - int RoundFast = static_cast(glm::iround(f)); - int RoundSTD = static_cast(glm::round(f)); - Error += RoundFast == RoundSTD ? 0 : 1; - assert(!Error); - } - - return Error; - } -}//namespace iround - -namespace uround -{ - int test() - { - int Error = 0; - - for(float f = 0.0f; f < 3.1f; f += 0.05f) - { - int RoundFast = static_cast(glm::uround(f)); - int RoundSTD = static_cast(glm::round(f)); - Error += RoundFast == RoundSTD ? 0 : 1; - assert(!Error); - } - - return Error; - } -}//namespace uround - -int main() -{ - int Error(0); - - Error += ::log2_::test(); - Error += ::iround::test(); - Error += ::uround::test(); - -# ifdef NDEBUG - std::size_t const Samples(1000); - Error += ::log2_::perf(Samples); -# endif//NDEBUG - - return Error; -} diff --git a/3rdparty/glm/source/test/gtc/gtc_matrix_access.cpp b/3rdparty/glm/source/test/gtc/gtc_matrix_access.cpp deleted file mode 100644 index 1b966e2..0000000 --- a/3rdparty/glm/source/test/gtc/gtc_matrix_access.cpp +++ /dev/null @@ -1,383 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -int test_mat2x2_row_set() -{ - int Error = 0; - - glm::mat2x2 m(1); - - m = glm::row(m, 0, glm::vec2( 0, 1)); - m = glm::row(m, 1, glm::vec2( 4, 5)); - - Error += glm::all(glm::equal(glm::row(m, 0), glm::vec2( 0, 1), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::row(m, 1), glm::vec2( 4, 5), glm::epsilon())) ? 0 : 1; - - return Error; -} - -int test_mat2x2_col_set() -{ - int Error = 0; - - glm::mat2x2 m(1); - - m = glm::column(m, 0, glm::vec2( 0, 1)); - m = glm::column(m, 1, glm::vec2( 4, 5)); - - Error += glm::all(glm::equal(glm::column(m, 0), glm::vec2( 0, 1), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::column(m, 1), glm::vec2( 4, 5), glm::epsilon())) ? 0 : 1; - - return Error; -} - -int test_mat2x3_row_set() -{ - int Error = 0; - - glm::mat2x3 m(1); - - m = glm::row(m, 0, glm::vec2( 0, 1)); - m = glm::row(m, 1, glm::vec2( 4, 5)); - m = glm::row(m, 2, glm::vec2( 8, 9)); - - Error += glm::all(glm::equal(glm::row(m, 0), glm::vec2( 0, 1), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::row(m, 1), glm::vec2( 4, 5), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::row(m, 2), glm::vec2( 8, 9), glm::epsilon())) ? 0 : 1; - - return Error; -} - -int test_mat2x3_col_set() -{ - int Error = 0; - - glm::mat2x3 m(1); - - m = glm::column(m, 0, glm::vec3( 0, 1, 2)); - m = glm::column(m, 1, glm::vec3( 4, 5, 6)); - - Error += glm::all(glm::equal(glm::column(m, 0), glm::vec3( 0, 1, 2), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::column(m, 1), glm::vec3( 4, 5, 6), glm::epsilon())) ? 0 : 1; - - return Error; -} - -int test_mat2x4_row_set() -{ - int Error = 0; - - glm::mat2x4 m(1); - - m = glm::row(m, 0, glm::vec2( 0, 1)); - m = glm::row(m, 1, glm::vec2( 4, 5)); - m = glm::row(m, 2, glm::vec2( 8, 9)); - m = glm::row(m, 3, glm::vec2(12, 13)); - - Error += glm::all(glm::equal(glm::row(m, 0), glm::vec2( 0, 1), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::row(m, 1), glm::vec2( 4, 5), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::row(m, 2), glm::vec2( 8, 9), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::row(m, 3), glm::vec2(12, 13), glm::epsilon())) ? 0 : 1; - - return Error; -} - -int test_mat2x4_col_set() -{ - int Error = 0; - - glm::mat2x4 m(1); - - m = glm::column(m, 0, glm::vec4( 0, 1, 2, 3)); - m = glm::column(m, 1, glm::vec4( 4, 5, 6, 7)); - - Error += glm::all(glm::equal(glm::column(m, 0), glm::vec4( 0, 1, 2, 3), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::column(m, 1), glm::vec4( 4, 5, 6, 7), glm::epsilon())) ? 0 : 1; - - return Error; -} - -int test_mat3x2_row_set() -{ - int Error = 0; - - glm::mat3x2 m(1); - - m = glm::row(m, 0, glm::vec3( 0, 1, 2)); - m = glm::row(m, 1, glm::vec3( 4, 5, 6)); - - Error += glm::all(glm::equal(glm::row(m, 0), glm::vec3( 0, 1, 2), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::row(m, 1), glm::vec3( 4, 5, 6), glm::epsilon())) ? 0 : 1; - - return Error; -} - -int test_mat3x2_col_set() -{ - int Error = 0; - - glm::mat3x2 m(1); - - m = glm::column(m, 0, glm::vec2( 0, 1)); - m = glm::column(m, 1, glm::vec2( 4, 5)); - m = glm::column(m, 2, glm::vec2( 8, 9)); - - Error += glm::all(glm::equal(glm::column(m, 0), glm::vec2( 0, 1), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::column(m, 1), glm::vec2( 4, 5), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::column(m, 2), glm::vec2( 8, 9), glm::epsilon())) ? 0 : 1; - - return Error; -} - -int test_mat3x3_row_set() -{ - int Error = 0; - - glm::mat3x3 m(1); - - m = glm::row(m, 0, glm::vec3( 0, 1, 2)); - m = glm::row(m, 1, glm::vec3( 4, 5, 6)); - m = glm::row(m, 2, glm::vec3( 8, 9, 10)); - - Error += glm::all(glm::equal(glm::row(m, 0), glm::vec3( 0, 1, 2), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::row(m, 1), glm::vec3( 4, 5, 6), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::row(m, 2), glm::vec3( 8, 9, 10), glm::epsilon())) ? 0 : 1; - - return Error; -} - -int test_mat3x3_col_set() -{ - int Error = 0; - - glm::mat3x3 m(1); - - m = glm::column(m, 0, glm::vec3( 0, 1, 2)); - m = glm::column(m, 1, glm::vec3( 4, 5, 6)); - m = glm::column(m, 2, glm::vec3( 8, 9, 10)); - - Error += glm::all(glm::equal(glm::column(m, 0), glm::vec3( 0, 1, 2), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::column(m, 1), glm::vec3( 4, 5, 6), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::column(m, 2), glm::vec3( 8, 9, 10), glm::epsilon())) ? 0 : 1; - - return Error; -} - -int test_mat3x4_row_set() -{ - int Error = 0; - - glm::mat3x4 m(1); - - m = glm::row(m, 0, glm::vec3( 0, 1, 2)); - m = glm::row(m, 1, glm::vec3( 4, 5, 6)); - m = glm::row(m, 2, glm::vec3( 8, 9, 10)); - m = glm::row(m, 3, glm::vec3(12, 13, 14)); - - Error += glm::all(glm::equal(glm::row(m, 0), glm::vec3( 0, 1, 2), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::row(m, 1), glm::vec3( 4, 5, 6), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::row(m, 2), glm::vec3( 8, 9, 10), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::row(m, 3), glm::vec3(12, 13, 14), glm::epsilon())) ? 0 : 1; - - return Error; -} - -int test_mat3x4_col_set() -{ - int Error = 0; - - glm::mat3x4 m(1); - - m = glm::column(m, 0, glm::vec4( 0, 1, 2, 3)); - m = glm::column(m, 1, glm::vec4( 4, 5, 6, 7)); - m = glm::column(m, 2, glm::vec4( 8, 9, 10, 11)); - - Error += glm::all(glm::equal(glm::column(m, 0), glm::vec4( 0, 1, 2, 3), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::column(m, 1), glm::vec4( 4, 5, 6, 7), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::column(m, 2), glm::vec4( 8, 9, 10, 11), glm::epsilon())) ? 0 : 1; - - return Error; -} - -int test_mat4x2_row_set() -{ - int Error = 0; - - glm::mat4x2 m(1); - - m = glm::row(m, 0, glm::vec4( 0, 1, 2, 3)); - m = glm::row(m, 1, glm::vec4( 4, 5, 6, 7)); - - Error += glm::all(glm::equal(glm::row(m, 0), glm::vec4( 0, 1, 2, 3), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::row(m, 1), glm::vec4( 4, 5, 6, 7), glm::epsilon())) ? 0 : 1; - - return Error; -} - -int test_mat4x2_col_set() -{ - int Error = 0; - - glm::mat4x2 m(1); - - m = glm::column(m, 0, glm::vec2( 0, 1)); - m = glm::column(m, 1, glm::vec2( 4, 5)); - m = glm::column(m, 2, glm::vec2( 8, 9)); - m = glm::column(m, 3, glm::vec2(12, 13)); - - Error += glm::all(glm::equal(glm::column(m, 0), glm::vec2( 0, 1), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::column(m, 1), glm::vec2( 4, 5), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::column(m, 2), glm::vec2( 8, 9), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::column(m, 3), glm::vec2(12, 13), glm::epsilon())) ? 0 : 1; - - return Error; -} - -int test_mat4x3_row_set() -{ - int Error = 0; - - glm::mat4x3 m(1); - - m = glm::row(m, 0, glm::vec4( 0, 1, 2, 3)); - m = glm::row(m, 1, glm::vec4( 4, 5, 6, 7)); - m = glm::row(m, 2, glm::vec4( 8, 9, 10, 11)); - - Error += glm::all(glm::equal(glm::row(m, 0), glm::vec4( 0, 1, 2, 3), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::row(m, 1), glm::vec4( 4, 5, 6, 7), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::row(m, 2), glm::vec4( 8, 9, 10, 11), glm::epsilon())) ? 0 : 1; - - return Error; -} - -int test_mat4x3_col_set() -{ - int Error = 0; - - glm::mat4x3 m(1); - - m = glm::column(m, 0, glm::vec3( 0, 1, 2)); - m = glm::column(m, 1, glm::vec3( 4, 5, 6)); - m = glm::column(m, 2, glm::vec3( 8, 9, 10)); - m = glm::column(m, 3, glm::vec3(12, 13, 14)); - - Error += glm::all(glm::equal(glm::column(m, 0), glm::vec3( 0, 1, 2), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::column(m, 1), glm::vec3( 4, 5, 6), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::column(m, 2), glm::vec3( 8, 9, 10), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::column(m, 3), glm::vec3(12, 13, 14), glm::epsilon())) ? 0 : 1; - - return Error; -} - -int test_mat4x4_row_set() -{ - int Error = 0; - - glm::mat4 m(1); - - m = glm::row(m, 0, glm::vec4( 0, 1, 2, 3)); - m = glm::row(m, 1, glm::vec4( 4, 5, 6, 7)); - m = glm::row(m, 2, glm::vec4( 8, 9, 10, 11)); - m = glm::row(m, 3, glm::vec4(12, 13, 14, 15)); - - Error += glm::all(glm::equal(glm::row(m, 0), glm::vec4( 0, 1, 2, 3), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::row(m, 1), glm::vec4( 4, 5, 6, 7), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::row(m, 2), glm::vec4( 8, 9, 10, 11), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::row(m, 3), glm::vec4(12, 13, 14, 15), glm::epsilon())) ? 0 : 1; - - return Error; -} - -int test_mat4x4_col_set() -{ - int Error = 0; - - glm::mat4 m(1); - - m = glm::column(m, 0, glm::vec4( 0, 1, 2, 3)); - m = glm::column(m, 1, glm::vec4( 4, 5, 6, 7)); - m = glm::column(m, 2, glm::vec4( 8, 9, 10, 11)); - m = glm::column(m, 3, glm::vec4(12, 13, 14, 15)); - - Error += glm::all(glm::equal(glm::column(m, 0), glm::vec4( 0, 1, 2, 3), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::column(m, 1), glm::vec4( 4, 5, 6, 7), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::column(m, 2), glm::vec4( 8, 9, 10, 11), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(glm::column(m, 3), glm::vec4(12, 13, 14, 15), glm::epsilon())) ? 0 : 1; - - return Error; -} - -int test_mat4x4_row_get() -{ - int Error = 0; - - glm::mat4 m(1); - - glm::vec4 A = glm::row(m, 0); - Error += glm::all(glm::equal(A, glm::vec4(1, 0, 0, 0), glm::epsilon())) ? 0 : 1; - glm::vec4 B = glm::row(m, 1); - Error += glm::all(glm::equal(B, glm::vec4(0, 1, 0, 0), glm::epsilon())) ? 0 : 1; - glm::vec4 C = glm::row(m, 2); - Error += glm::all(glm::equal(C, glm::vec4(0, 0, 1, 0), glm::epsilon())) ? 0 : 1; - glm::vec4 D = glm::row(m, 3); - Error += glm::all(glm::equal(D, glm::vec4(0, 0, 0, 1), glm::epsilon())) ? 0 : 1; - - return Error; -} - -int test_mat4x4_col_get() -{ - int Error = 0; - - glm::mat4 m(1); - - glm::vec4 A = glm::column(m, 0); - Error += glm::all(glm::equal(A, glm::vec4(1, 0, 0, 0), glm::epsilon())) ? 0 : 1; - glm::vec4 B = glm::column(m, 1); - Error += glm::all(glm::equal(B, glm::vec4(0, 1, 0, 0), glm::epsilon())) ? 0 : 1; - glm::vec4 C = glm::column(m, 2); - Error += glm::all(glm::equal(C, glm::vec4(0, 0, 1, 0), glm::epsilon())) ? 0 : 1; - glm::vec4 D = glm::column(m, 3); - Error += glm::all(glm::equal(D, glm::vec4(0, 0, 0, 1), glm::epsilon())) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_mat2x2_row_set(); - Error += test_mat2x2_col_set(); - Error += test_mat2x3_row_set(); - Error += test_mat2x3_col_set(); - Error += test_mat2x4_row_set(); - Error += test_mat2x4_col_set(); - Error += test_mat3x2_row_set(); - Error += test_mat3x2_col_set(); - Error += test_mat3x3_row_set(); - Error += test_mat3x3_col_set(); - Error += test_mat3x4_row_set(); - Error += test_mat3x4_col_set(); - Error += test_mat4x2_row_set(); - Error += test_mat4x2_col_set(); - Error += test_mat4x3_row_set(); - Error += test_mat4x3_col_set(); - Error += test_mat4x4_row_set(); - Error += test_mat4x4_col_set(); - - Error += test_mat4x4_row_get(); - Error += test_mat4x4_col_get(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtc/gtc_matrix_integer.cpp b/3rdparty/glm/source/test/gtc/gtc_matrix_integer.cpp deleted file mode 100644 index 108016a..0000000 --- a/3rdparty/glm/source/test/gtc/gtc_matrix_integer.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include - -int main() -{ - int Error = 0; - - return Error; -} diff --git a/3rdparty/glm/source/test/gtc/gtc_matrix_inverse.cpp b/3rdparty/glm/source/test/gtc/gtc_matrix_inverse.cpp deleted file mode 100644 index eaec6e1..0000000 --- a/3rdparty/glm/source/test/gtc/gtc_matrix_inverse.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include -#include - -int test_affine() -{ - int Error = 0; - - { - glm::mat3 const M( - 2.f, 0.f, 0.f, - 0.f, 2.f, 0.f, - 0.f, 0.f, 1.f); - glm::mat3 const A = glm::affineInverse(M); - glm::mat3 const I = glm::inverse(M); - glm::mat3 const R = glm::affineInverse(A); - - for(glm::length_t i = 0; i < A.length(); ++i) - { - Error += glm::all(glm::epsilonEqual(M[i], R[i], 0.01f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(A[i], I[i], 0.01f)) ? 0 : 1; - } - } - - { - glm::mat4 const M( - 2.f, 0.f, 0.f, 0.f, - 0.f, 2.f, 0.f, 0.f, - 0.f, 0.f, 2.f, 0.f, - 0.f, 0.f, 0.f, 1.f); - glm::mat4 const A = glm::affineInverse(M); - glm::mat4 const I = glm::inverse(M); - glm::mat4 const R = glm::affineInverse(A); - - for(glm::length_t i = 0; i < A.length(); ++i) - { - Error += glm::all(glm::epsilonEqual(M[i], R[i], 0.01f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(A[i], I[i], 0.01f)) ? 0 : 1; - } - } - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_affine(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtc/gtc_matrix_transform.cpp b/3rdparty/glm/source/test/gtc/gtc_matrix_transform.cpp deleted file mode 100644 index b50666e..0000000 --- a/3rdparty/glm/source/test/gtc/gtc_matrix_transform.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include -#include -#include - -int test_perspective() -{ - int Error = 0; - - glm::mat4 Projection = glm::perspective(glm::pi() * 0.25f, 4.0f / 3.0f, 0.1f, 100.0f); - - return Error; -} - -int test_pick() -{ - int Error = 0; - - glm::mat4 Pick = glm::pickMatrix(glm::vec2(1, 2), glm::vec2(3, 4), glm::ivec4(0, 0, 320, 240)); - - return Error; -} - -int test_tweakedInfinitePerspective() -{ - int Error = 0; - - glm::mat4 ProjectionA = glm::tweakedInfinitePerspective(45.f, 640.f/480.f, 1.0f); - glm::mat4 ProjectionB = glm::tweakedInfinitePerspective(45.f, 640.f/480.f, 1.0f, 0.001f); - - - return Error; -} - -int test_translate() -{ - int Error = 0; - - glm::lowp_vec3 v(1.0); - glm::lowp_mat4 m(0); - glm::lowp_mat4 t = glm::translate(m, v); - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_translate(); - Error += test_tweakedInfinitePerspective(); - Error += test_pick(); - Error += test_perspective(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtc/gtc_noise.cpp b/3rdparty/glm/source/test/gtc/gtc_noise.cpp deleted file mode 100644 index 6ecec22..0000000 --- a/3rdparty/glm/source/test/gtc/gtc_noise.cpp +++ /dev/null @@ -1,86 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#include -#include - -static int test_simplex_float() -{ - int Error = 0; - - glm::u8vec4 const PixelSimplex2D(glm::byte(glm::abs(glm::simplex(glm::vec2(0.f, 0.f))) * 255.f)); - glm::u8vec4 const PixelSimplex3D(glm::byte(glm::abs(glm::simplex(glm::vec3(0.f, 0.f, 0.f))) * 255.f)); - glm::u8vec4 const PixelSimplex4D(glm::byte(glm::abs(glm::simplex(glm::vec4(0.f, 0.f, 0.f, 0.f))) * 255.f)); - - return Error; -} - -static int test_simplex_double() -{ - int Error = 0; - - glm::u8vec4 const PixelSimplex2D(glm::byte(glm::abs(glm::simplex(glm::dvec2(0.f, 0.f))) * 255.)); - glm::u8vec4 const PixelSimplex3D(glm::byte(glm::abs(glm::simplex(glm::dvec3(0.f, 0.f, 0.f))) * 255.)); - glm::u8vec4 const PixelSimplex4D(glm::byte(glm::abs(glm::simplex(glm::dvec4(0.f, 0.f, 0.f, 0.f))) * 255.)); - - return Error; -} - -static int test_perlin_float() -{ - int Error = 0; - - glm::u8vec4 const PixelPerlin2D(glm::byte(glm::abs(glm::perlin(glm::vec2(0.f, 0.f))) * 255.f)); - glm::u8vec4 const PixelPerlin3D(glm::byte(glm::abs(glm::perlin(glm::vec3(0.f, 0.f, 0.f))) * 255.f)); - glm::u8vec4 const PixelPerlin4D(glm::byte(glm::abs(glm::perlin(glm::vec4(0.f, 0.f, 0.f, 0.f))) * 255.f)); - - return Error; -} - -static int test_perlin_double() -{ - int Error = 0; - - glm::u8vec4 const PixelPerlin2D(glm::byte(glm::abs(glm::perlin(glm::dvec2(0.f, 0.f))) * 255.)); - glm::u8vec4 const PixelPerlin3D(glm::byte(glm::abs(glm::perlin(glm::dvec3(0.f, 0.f, 0.f))) * 255.)); - glm::u8vec4 const PixelPerlin4D(glm::byte(glm::abs(glm::perlin(glm::dvec4(0.f, 0.f, 0.f, 0.f))) * 255.)); - - return Error; -} - -static int test_perlin_pedioric_float() -{ - int Error = 0; - - glm::u8vec4 const PixelPeriodic2D(glm::byte(glm::abs(glm::perlin(glm::vec2(0.f, 0.f), glm::vec2(2.0f))) * 255.f)); - glm::u8vec4 const PixelPeriodic3D(glm::byte(glm::abs(glm::perlin(glm::vec3(0.f, 0.f, 0.f), glm::vec3(2.0f))) * 255.f)); - glm::u8vec4 const PixelPeriodic4D(glm::byte(glm::abs(glm::perlin(glm::vec4(0.f, 0.f, 0.f, 0.f), glm::vec4(2.0f))) * 255.f)); - - return Error; -} - -static int test_perlin_pedioric_double() -{ - int Error = 0; - - glm::u8vec4 const PixelPeriodic2D(glm::byte(glm::abs(glm::perlin(glm::dvec2(0.f, 0.f), glm::dvec2(2.0))) * 255.)); - glm::u8vec4 const PixelPeriodic3D(glm::byte(glm::abs(glm::perlin(glm::dvec3(0.f, 0.f, 0.f), glm::dvec3(2.0))) * 255.)); - glm::u8vec4 const PixelPeriodic4D(glm::byte(glm::abs(glm::perlin(glm::dvec4(0.f, 0.f, 0.f, 0.f), glm::dvec4(2.0))) * 255.)); - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_simplex_float(); - Error += test_simplex_double(); - - Error += test_perlin_float(); - Error += test_perlin_double(); - - Error += test_perlin_pedioric_float(); - Error += test_perlin_pedioric_double(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtc/gtc_packing.cpp b/3rdparty/glm/source/test/gtc/gtc_packing.cpp deleted file mode 100644 index df5b3bb..0000000 --- a/3rdparty/glm/source/test/gtc/gtc_packing.cpp +++ /dev/null @@ -1,878 +0,0 @@ -#include -#include -#include -#include -#include -#include - -void print_bits(float const& s) -{ - union - { - float f; - unsigned int i; - } uif; - - uif.f = s; - - std::printf("f32: "); - for(std::size_t j = sizeof(s) * 8; j > 0; --j) - { - if(j == 23 || j == 31) - std::printf(" "); - std::printf("%d", (uif.i & (1 << (j - 1))) ? 1 : 0); - } -} - -void print_10bits(glm::uint const& s) -{ - std::printf("10b: "); - for(std::size_t j = 10; j > 0; --j) - { - if(j == 5) - std::printf(" "); - std::printf("%d", (s & (1 << (j - 1))) ? 1 : 0); - } -} - -void print_11bits(glm::uint const& s) -{ - std::printf("11b: "); - for(std::size_t j = 11; j > 0; --j) - { - if(j == 6) - std::printf(" "); - std::printf("%d", (s & (1 << (j - 1))) ? 1 : 0); - } -} - -void print_value(float const& s) -{ - std::printf("%2.5f, ", static_cast(s)); - print_bits(s); - std::printf(", "); -// print_11bits(detail::floatTo11bit(s)); -// std::printf(", "); -// print_10bits(detail::floatTo10bit(s)); - std::printf("\n"); -} - -int test_Half1x16() -{ - int Error = 0; - - std::vector Tests; - Tests.push_back(0.0f); - Tests.push_back(1.0f); - Tests.push_back(-1.0f); - Tests.push_back(2.0f); - Tests.push_back(-2.0f); - Tests.push_back(1.9f); - - for(std::size_t i = 0; i < Tests.size(); ++i) - { - glm::uint16 p0 = glm::packHalf1x16(Tests[i]); - float v0 = glm::unpackHalf1x16(p0); - glm::uint16 p1 = glm::packHalf1x16(v0); - float v1 = glm::unpackHalf1x16(p1); - Error += glm::epsilonEqual(v0, v1, glm::epsilon()) ? 0 : 1; - } - - return Error; -} - -int test_Half4x16() -{ - int Error = 0; - - std::vector Tests; - Tests.push_back(glm::vec4(1.0f)); - Tests.push_back(glm::vec4(0.0f)); - Tests.push_back(glm::vec4(2.0f)); - Tests.push_back(glm::vec4(0.1f)); - Tests.push_back(glm::vec4(0.5f)); - Tests.push_back(glm::vec4(-0.9f)); - - for(std::size_t i = 0; i < Tests.size(); ++i) - { - glm::uint64 p0 = glm::packHalf4x16(Tests[i]); - glm::vec4 v0 = glm::unpackHalf4x16(p0); - glm::uint64 p1 = glm::packHalf4x16(v0); - glm::vec4 v1 = glm::unpackHalf4x16(p1); - glm::u16vec4 p2 = glm::packHalf(v0); - glm::vec4 v2 = glm::unpackHalf(p2); - - Error += glm::all(glm::equal(v0, v1, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(v0, v2, glm::epsilon())) ? 0 : 1; - } - - return Error; -} - -int test_I3x10_1x2() -{ - int Error = 0; - - std::vector Tests; - Tests.push_back(glm::ivec4(0)); - Tests.push_back(glm::ivec4(1)); - Tests.push_back(glm::ivec4(-1)); - Tests.push_back(glm::ivec4(2)); - Tests.push_back(glm::ivec4(-2)); - Tests.push_back(glm::ivec4(3)); - - for(std::size_t i = 0; i < Tests.size(); ++i) - { - glm::uint32 p0 = glm::packI3x10_1x2(Tests[i]); - glm::ivec4 v0 = glm::unpackI3x10_1x2(p0); - glm::uint32 p1 = glm::packI3x10_1x2(v0); - glm::ivec4 v1 = glm::unpackI3x10_1x2(p1); - Error += glm::all(glm::equal(v0, v1)) ? 0 : 1; - } - - return Error; -} - -int test_U3x10_1x2() -{ - int Error = 0; - - std::vector Tests; - Tests.push_back(glm::uvec4(0)); - Tests.push_back(glm::uvec4(1)); - Tests.push_back(glm::uvec4(2)); - Tests.push_back(glm::uvec4(3)); - Tests.push_back(glm::uvec4(4)); - Tests.push_back(glm::uvec4(5)); - - for(std::size_t i = 0; i < Tests.size(); ++i) - { - glm::uint32 p0 = glm::packU3x10_1x2(Tests[i]); - glm::uvec4 v0 = glm::unpackU3x10_1x2(p0); - glm::uint32 p1 = glm::packU3x10_1x2(v0); - glm::uvec4 v1 = glm::unpackU3x10_1x2(p1); - Error += glm::all(glm::equal(v0, v1)) ? 0 : 1; - } - - glm::u8vec4 const v0(0xff, 0x77, 0x0, 0x33); - glm::uint32 const p0 = *reinterpret_cast(&v0[0]); - glm::uint32 const r0 = 0x330077ff; - - Error += p0 == r0 ? 0 : 1; - - glm::uvec4 const v1(0xff, 0x77, 0x0, 0x33); - glm::uint32 const p1 = glm::packU3x10_1x2(v1); - glm::uint32 const r1 = 0xc001dcff; - - Error += p1 == r1 ? 0 : 1; - - return Error; -} - -int test_Snorm3x10_1x2() -{ - int Error = 0; - - std::vector Tests; - Tests.push_back(glm::vec4(1.0f)); - Tests.push_back(glm::vec4(0.0f)); - Tests.push_back(glm::vec4(2.0f)); - Tests.push_back(glm::vec4(0.1f)); - Tests.push_back(glm::vec4(0.5f)); - Tests.push_back(glm::vec4(0.9f)); - - for(std::size_t i = 0; i < Tests.size(); ++i) - { - glm::uint32 p0 = glm::packSnorm3x10_1x2(Tests[i]); - glm::vec4 v0 = glm::unpackSnorm3x10_1x2(p0); - glm::uint32 p1 = glm::packSnorm3x10_1x2(v0); - glm::vec4 v1 = glm::unpackSnorm3x10_1x2(p1); - - Error += glm::all(glm::epsilonEqual(v0, v1, 0.01f)) ? 0 : 1; - } - - return Error; -} - -int test_Unorm3x10_1x2() -{ - int Error = 0; - - std::vector Tests; - Tests.push_back(glm::vec4(1.0f)); - Tests.push_back(glm::vec4(0.0f)); - Tests.push_back(glm::vec4(2.0f)); - Tests.push_back(glm::vec4(0.1f)); - Tests.push_back(glm::vec4(0.5f)); - Tests.push_back(glm::vec4(0.9f)); - - for(std::size_t i = 0; i < Tests.size(); ++i) - { - glm::uint32 p0 = glm::packUnorm3x10_1x2(Tests[i]); - glm::vec4 v0 = glm::unpackUnorm3x10_1x2(p0); - glm::uint32 p1 = glm::packUnorm3x10_1x2(v0); - glm::vec4 v1 = glm::unpackUnorm3x10_1x2(p1); - - Error += glm::all(glm::epsilonEqual(v0, v1, 0.001f)) ? 0 : 1; - } - - return Error; -} - -int test_F2x11_1x10() -{ - int Error = 0; - - std::vector Tests; - Tests.push_back(glm::vec3(1.0f)); - Tests.push_back(glm::vec3(0.0f)); - Tests.push_back(glm::vec3(2.0f)); - Tests.push_back(glm::vec3(0.1f)); - Tests.push_back(glm::vec3(0.5f)); - Tests.push_back(glm::vec3(0.9f)); - - for(std::size_t i = 0; i < Tests.size(); ++i) - { - glm::uint32 p0 = glm::packF2x11_1x10(Tests[i]); - glm::vec3 v0 = glm::unpackF2x11_1x10(p0); - glm::uint32 p1 = glm::packF2x11_1x10(v0); - glm::vec3 v1 = glm::unpackF2x11_1x10(p1); - Error += glm::all(glm::equal(v0, v1, glm::epsilon())) ? 0 : 1; - } - - return Error; -} - -int test_F3x9_E1x5() -{ - int Error = 0; - - std::vector Tests; - Tests.push_back(glm::vec3(1.0f)); - Tests.push_back(glm::vec3(0.0f)); - Tests.push_back(glm::vec3(2.0f)); - Tests.push_back(glm::vec3(0.1f)); - Tests.push_back(glm::vec3(0.5f)); - Tests.push_back(glm::vec3(0.9f)); - - for(std::size_t i = 0; i < Tests.size(); ++i) - { - glm::uint32 p0 = glm::packF3x9_E1x5(Tests[i]); - glm::vec3 v0 = glm::unpackF3x9_E1x5(p0); - glm::uint32 p1 = glm::packF3x9_E1x5(v0); - glm::vec3 v1 = glm::unpackF3x9_E1x5(p1); - Error += glm::all(glm::equal(v0, v1, glm::epsilon())) ? 0 : 1; - } - - return Error; -} - -int test_RGBM() -{ - int Error = 0; - - for(std::size_t i = 0; i < 1024; ++i) - { - glm::vec3 const Color(static_cast(i)); - glm::vec4 const RGBM = glm::packRGBM(Color); - glm::vec3 const Result= glm::unpackRGBM(RGBM); - - Error += glm::all(glm::equal(Color, Result, 0.01f)) ? 0 : 1; - } - - return Error; -} - -int test_packUnorm1x16() -{ - int Error = 0; - - std::vector A; - A.push_back(glm::vec1(1.0f)); - A.push_back(glm::vec1(0.5f)); - A.push_back(glm::vec1(0.1f)); - A.push_back(glm::vec1(0.0f)); - - for(std::size_t i = 0; i < A.size(); ++i) - { - glm::vec1 B(A[i]); - glm::uint16 C = glm::packUnorm1x16(B.x); - glm::vec1 D(glm::unpackUnorm1x16(C)); - Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 65535.f)) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int test_packSnorm1x16() -{ - int Error = 0; - - std::vector A; - A.push_back(glm::vec1( 1.0f)); - A.push_back(glm::vec1( 0.0f)); - A.push_back(glm::vec1(-0.5f)); - A.push_back(glm::vec1(-0.1f)); - - for(std::size_t i = 0; i < A.size(); ++i) - { - glm::vec1 B(A[i]); - glm::uint16 C = glm::packSnorm1x16(B.x); - glm::vec1 D(glm::unpackSnorm1x16(C)); - Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 32767.0f * 2.0f)) ? 0 : 1; - } - - return Error; -} - -int test_packUnorm2x16() -{ - int Error = 0; - - std::vector A; - A.push_back(glm::vec2(1.0f, 0.0f)); - A.push_back(glm::vec2(0.5f, 0.7f)); - A.push_back(glm::vec2(0.1f, 0.2f)); - - for(std::size_t i = 0; i < A.size(); ++i) - { - glm::vec2 B(A[i]); - glm::uint32 C = glm::packUnorm2x16(B); - glm::vec2 D = glm::unpackUnorm2x16(C); - Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 65535.f)) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int test_packSnorm2x16() -{ - int Error = 0; - - std::vector A; - A.push_back(glm::vec2( 1.0f, 0.0f)); - A.push_back(glm::vec2(-0.5f,-0.7f)); - A.push_back(glm::vec2(-0.1f, 0.1f)); - - for(std::size_t i = 0; i < A.size(); ++i) - { - glm::vec2 B(A[i]); - glm::uint32 C = glm::packSnorm2x16(B); - glm::vec2 D = glm::unpackSnorm2x16(C); - Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 32767.0f * 2.0f)) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int test_packUnorm4x16() -{ - int Error = 0; - - std::vector A; - A.push_back(glm::vec4(1.0f)); - A.push_back(glm::vec4(0.5f)); - A.push_back(glm::vec4(0.1f)); - A.push_back(glm::vec4(0.0f)); - - for(std::size_t i = 0; i < A.size(); ++i) - { - glm::vec4 B(A[i]); - glm::uint64 C = glm::packUnorm4x16(B); - glm::vec4 D(glm::unpackUnorm4x16(C)); - Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 65535.f)) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int test_packSnorm4x16() -{ - int Error = 0; - - std::vector A; - A.push_back(glm::vec4( 1.0f, 0.0f, -0.5f, 0.5f)); - A.push_back(glm::vec4(-0.3f,-0.7f, 0.3f, 0.7f)); - A.push_back(glm::vec4(-0.1f, 0.1f, -0.2f, 0.2f)); - - for(std::size_t i = 0; i < A.size(); ++i) - { - glm::vec4 B(A[i]); - glm::uint64 C = glm::packSnorm4x16(B); - glm::vec4 D(glm::unpackSnorm4x16(C)); - Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 32767.0f * 2.0f)) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int test_packUnorm1x8() -{ - int Error = 0; - - std::vector A; - A.push_back(glm::vec1(1.0f)); - A.push_back(glm::vec1(0.5f)); - A.push_back(glm::vec1(0.0f)); - - for(std::size_t i = 0; i < A.size(); ++i) - { - glm::vec1 B(A[i]); - glm::uint8 C = glm::packUnorm1x8(B.x); - glm::vec1 D(glm::unpackUnorm1x8(C)); - Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 255.f)) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int test_packSnorm1x8() -{ - int Error = 0; - - std::vector A; - A.push_back(glm::vec1( 1.0f)); - A.push_back(glm::vec1(-0.7f)); - A.push_back(glm::vec1(-1.0f)); - - for(std::size_t i = 0; i < A.size(); ++i) - { - glm::vec1 B(A[i]); - glm::uint8 C = glm::packSnorm1x8(B.x); - glm::vec1 D(glm::unpackSnorm1x8(C)); - Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 127.f)) ? 0 : 1; - } - - return Error; -} - -int test_packUnorm2x8() -{ - int Error = 0; - - std::vector A; - A.push_back(glm::vec2(1.0f, 0.7f)); - A.push_back(glm::vec2(0.5f, 0.1f)); - - for(std::size_t i = 0; i < A.size(); ++i) - { - glm::vec2 B(A[i]); - glm::uint16 C = glm::packUnorm2x8(B); - glm::vec2 D = glm::unpackUnorm2x8(C); - Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 255.f)) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int test_packSnorm2x8() -{ - int Error = 0; - - std::vector A; - A.push_back(glm::vec2( 1.0f, 0.0f)); - A.push_back(glm::vec2(-0.7f,-0.1f)); - - for(std::size_t i = 0; i < A.size(); ++i) - { - glm::vec2 B(A[i]); - glm::uint16 C = glm::packSnorm2x8(B); - glm::vec2 D = glm::unpackSnorm2x8(C); - Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 127.f)) ? 0 : 1; - } - - return Error; -} - -int test_packUnorm4x8() -{ - int Error = 0; - - std::vector A; - A.push_back(glm::vec4(1.0f, 0.7f, 0.3f, 0.0f)); - A.push_back(glm::vec4(0.5f, 0.1f, 0.2f, 0.3f)); - - for(std::size_t i = 0; i < A.size(); ++i) - { - glm::vec4 B(A[i]); - glm::uint32 C = glm::packUnorm4x8(B); - glm::vec4 D = glm::unpackUnorm4x8(C); - Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 255.f)) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int test_packSnorm4x8() -{ - int Error = 0; - - std::vector A; - A.push_back(glm::vec4( 1.0f, 0.0f,-0.5f,-1.0f)); - A.push_back(glm::vec4(-0.7f,-0.1f, 0.1f, 0.7f)); - - for(std::size_t i = 0; i < A.size(); ++i) - { - glm::vec4 B(A[i]); - glm::uint32 C = glm::packSnorm4x8(B); - glm::vec4 D = glm::unpackSnorm4x8(C); - Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 127.f)) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int test_packUnorm() -{ - int Error = 0; - - std::vector A; - A.push_back(glm::vec2(1.0f, 0.7f)); - A.push_back(glm::vec2(0.5f, 0.1f)); - - for(std::size_t i = 0; i < A.size(); ++i) - { - glm::vec2 B(A[i]); - glm::u16vec2 C = glm::packUnorm(B); - glm::vec2 D = glm::unpackUnorm(C); - Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 255.f)) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int test_packSnorm() -{ - int Error = 0; - - std::vector A; - A.push_back(glm::vec2( 1.0f, 0.0f)); - A.push_back(glm::vec2(-0.5f,-0.7f)); - A.push_back(glm::vec2(-0.1f, 0.1f)); - - for(std::size_t i = 0; i < A.size(); ++i) - { - glm::vec2 B(A[i]); - glm::i16vec2 C = glm::packSnorm(B); - glm::vec2 D = glm::unpackSnorm(C); - Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 32767.0f * 2.0f)) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int test_packUnorm2x4() -{ - int Error = 0; - - std::vector A; - A.push_back(glm::vec2(1.0f, 0.7f)); - A.push_back(glm::vec2(0.5f, 0.0f)); - - for(std::size_t i = 0; i < A.size(); ++i) - { - glm::vec2 B(A[i]); - glm::uint8 C = glm::packUnorm2x4(B); - glm::vec2 D = glm::unpackUnorm2x4(C); - Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 15.f)) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int test_packUnorm4x4() -{ - int Error = 0; - - std::vector A; - A.push_back(glm::vec4(1.0f, 0.7f, 0.5f, 0.0f)); - A.push_back(glm::vec4(0.5f, 0.1f, 0.0f, 1.0f)); - - for(std::size_t i = 0; i < A.size(); ++i) - { - glm::vec4 B(A[i]); - glm::uint16 C = glm::packUnorm4x4(B); - glm::vec4 D = glm::unpackUnorm4x4(C); - Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 15.f)) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int test_packUnorm3x5_1x1() -{ - int Error = 0; - - std::vector A; - A.push_back(glm::vec4(1.0f, 0.7f, 0.5f, 0.0f)); - A.push_back(glm::vec4(0.5f, 0.1f, 0.0f, 1.0f)); - - for(std::size_t i = 0; i < A.size(); ++i) - { - glm::vec4 B(A[i]); - glm::uint16 C = glm::packUnorm3x5_1x1(B); - glm::vec4 D = glm::unpackUnorm3x5_1x1(C); - Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 15.f)) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int test_packUnorm1x5_1x6_1x5() -{ - int Error = 0; - - std::vector A; - A.push_back(glm::vec3(1.0f, 0.7f, 0.5f)); - A.push_back(glm::vec3(0.5f, 0.1f, 0.0f)); - - for(std::size_t i = 0; i < A.size(); ++i) - { - glm::vec3 B(A[i]); - glm::uint16 C = glm::packUnorm1x5_1x6_1x5(B); - glm::vec3 D = glm::unpackUnorm1x5_1x6_1x5(C); - Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 15.f)) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int test_packUnorm2x3_1x2() -{ - int Error = 0; - - std::vector A; - A.push_back(glm::vec3(1.0f, 0.7f, 0.5f)); - A.push_back(glm::vec3(0.5f, 0.1f, 0.0f)); - - for(std::size_t i = 0; i < A.size(); ++i) - { - glm::vec3 B(A[i]); - glm::uint8 C = glm::packUnorm2x3_1x2(B); - glm::vec3 D = glm::unpackUnorm2x3_1x2(C); - Error += glm::all(glm::epsilonEqual(B, D, 1.0f / 3.f)) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int test_packUint2x8() -{ - int Error = 0; - - glm::u8vec2 const Source(1, 2); - - glm::uint16 const Packed = glm::packUint2x8(Source); - Error += Packed != 0 ? 0 : 1; - - glm::u8vec2 const Unpacked = glm::unpackUint2x8(Packed); - Error += Source == Unpacked ? 0 : 1; - - return Error; -} - -int test_packUint4x8() -{ - int Error = 0; - - glm::u8vec4 const Source(1, 2, 3, 4); - - glm::uint32 const Packed = glm::packUint4x8(Source); - Error += Packed != 0 ? 0 : 1; - - glm::u8vec4 const Unpacked = glm::unpackUint4x8(Packed); - Error += Source == Unpacked ? 0 : 1; - - return Error; -} - -int test_packUint2x16() -{ - int Error = 0; - - glm::u16vec2 const Source(1, 2); - - glm::uint32 const Packed = glm::packUint2x16(Source); - Error += Packed != 0 ? 0 : 1; - - glm::u16vec2 const Unpacked = glm::unpackUint2x16(Packed); - Error += Source == Unpacked ? 0 : 1; - - return Error; -} - -int test_packUint4x16() -{ - int Error = 0; - - glm::u16vec4 const Source(1, 2, 3, 4); - - glm::uint64 const Packed = glm::packUint4x16(Source); - Error += Packed != 0 ? 0 : 1; - - glm::u16vec4 const Unpacked = glm::unpackUint4x16(Packed); - Error += Source == Unpacked ? 0 : 1; - - return Error; -} - -int test_packUint2x32() -{ - int Error = 0; - - glm::u32vec2 const Source(1, 2); - - glm::uint64 const Packed = glm::packUint2x32(Source); - Error += Packed != 0 ? 0 : 1; - - glm::u32vec2 const Unpacked = glm::unpackUint2x32(Packed); - Error += Source == Unpacked ? 0 : 1; - - return Error; -} - -int test_packInt2x8() -{ - int Error = 0; - - glm::i8vec2 const Source(1, 2); - - glm::int16 const Packed = glm::packInt2x8(Source); - Error += Packed != 0 ? 0 : 1; - - glm::i8vec2 const Unpacked = glm::unpackInt2x8(Packed); - Error += Source == Unpacked ? 0 : 1; - - return Error; -} - -int test_packInt4x8() -{ - int Error = 0; - - glm::i8vec4 const Source(1, 2, 3, 4); - - glm::int32 const Packed = glm::packInt4x8(Source); - Error += Packed != 0 ? 0 : 1; - - glm::i8vec4 const Unpacked = glm::unpackInt4x8(Packed); - Error += Source == Unpacked ? 0 : 1; - - return Error; -} - -int test_packInt2x16() -{ - int Error = 0; - - glm::i16vec2 const Source(1, 2); - - glm::int32 const Packed = glm::packInt2x16(Source); - Error += Packed != 0 ? 0 : 1; - - glm::i16vec2 const Unpacked = glm::unpackInt2x16(Packed); - Error += Source == Unpacked ? 0 : 1; - - return Error; -} - -int test_packInt4x16() -{ - int Error = 0; - - glm::i16vec4 const Source(1, 2, 3, 4); - - glm::int64 const Packed = glm::packInt4x16(Source); - Error += Packed != 0 ? 0 : 1; - - glm::i16vec4 const Unpacked = glm::unpackInt4x16(Packed); - Error += Source == Unpacked ? 0 : 1; - - return Error; -} - -int test_packInt2x32() -{ - int Error = 0; - - glm::i32vec2 const Source(1, 2); - - glm::int64 const Packed = glm::packInt2x32(Source); - Error += Packed != 0 ? 0 : 1; - - glm::i32vec2 const Unpacked = glm::unpackInt2x32(Packed); - Error += Source == Unpacked ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_packUnorm(); - Error += test_packSnorm(); - - Error += test_packSnorm1x16(); - Error += test_packSnorm2x16(); - Error += test_packSnorm4x16(); - - Error += test_packSnorm1x8(); - Error += test_packSnorm2x8(); - Error += test_packSnorm4x8(); - - Error += test_packUnorm1x16(); - Error += test_packUnorm2x16(); - Error += test_packUnorm4x16(); - - Error += test_packUnorm1x8(); - Error += test_packUnorm2x8(); - Error += test_packUnorm4x8(); - - Error += test_packUnorm2x4(); - Error += test_packUnorm4x4(); - Error += test_packUnorm3x5_1x1(); - Error += test_packUnorm1x5_1x6_1x5(); - Error += test_packUnorm2x3_1x2(); - - Error += test_packUint2x8(); - Error += test_packUint4x8(); - Error += test_packUint2x16(); - Error += test_packUint4x16(); - Error += test_packUint2x32(); - - Error += test_packInt2x8(); - Error += test_packInt4x8(); - Error += test_packInt2x16(); - Error += test_packInt4x16(); - Error += test_packInt2x32(); - - Error += test_F2x11_1x10(); - Error += test_F3x9_E1x5(); - Error += test_RGBM(); - Error += test_Unorm3x10_1x2(); - Error += test_Snorm3x10_1x2(); - - Error += test_I3x10_1x2(); - Error += test_U3x10_1x2(); - Error += test_Half1x16(); - Error += test_Half4x16(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtc/gtc_quaternion.cpp b/3rdparty/glm/source/test/gtc/gtc_quaternion.cpp deleted file mode 100644 index 540ca42..0000000 --- a/3rdparty/glm/source/test/gtc/gtc_quaternion.cpp +++ /dev/null @@ -1,345 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -int test_quat_angle() -{ - int Error = 0; - - { - glm::quat Q = glm::angleAxis(glm::pi() * 0.25f, glm::vec3(0, 0, 1)); - glm::quat N = glm::normalize(Q); - float L = glm::length(N); - Error += glm::equal(L, 1.0f, 0.01f) ? 0 : 1; - float A = glm::angle(N); - Error += glm::equal(A, glm::pi() * 0.25f, 0.01f) ? 0 : 1; - } - { - glm::quat Q = glm::angleAxis(glm::pi() * 0.25f, glm::normalize(glm::vec3(0, 1, 1))); - glm::quat N = glm::normalize(Q); - float L = glm::length(N); - Error += glm::equal(L, 1.0f, 0.01f) ? 0 : 1; - float A = glm::angle(N); - Error += glm::equal(A, glm::pi() * 0.25f, 0.01f) ? 0 : 1; - } - { - glm::quat Q = glm::angleAxis(glm::pi() * 0.25f, glm::normalize(glm::vec3(1, 2, 3))); - glm::quat N = glm::normalize(Q); - float L = glm::length(N); - Error += glm::equal(L, 1.0f, 0.01f) ? 0 : 1; - float A = glm::angle(N); - Error += glm::equal(A, glm::pi() * 0.25f, 0.01f) ? 0 : 1; - } - - return Error; -} - -int test_quat_angleAxis() -{ - int Error = 0; - - glm::quat A = glm::angleAxis(0.f, glm::vec3(0.f, 0.f, 1.f)); - glm::quat B = glm::angleAxis(glm::pi() * 0.5f, glm::vec3(0, 0, 1)); - glm::quat C = glm::mix(A, B, 0.5f); - glm::quat D = glm::angleAxis(glm::pi() * 0.25f, glm::vec3(0, 0, 1)); - - Error += glm::equal(C.x, D.x, 0.01f) ? 0 : 1; - Error += glm::equal(C.y, D.y, 0.01f) ? 0 : 1; - Error += glm::equal(C.z, D.z, 0.01f) ? 0 : 1; - Error += glm::equal(C.w, D.w, 0.01f) ? 0 : 1; - - return Error; -} - -int test_quat_mix() -{ - int Error = 0; - - glm::quat A = glm::angleAxis(0.f, glm::vec3(0.f, 0.f, 1.f)); - glm::quat B = glm::angleAxis(glm::pi() * 0.5f, glm::vec3(0, 0, 1)); - glm::quat C = glm::mix(A, B, 0.5f); - glm::quat D = glm::angleAxis(glm::pi() * 0.25f, glm::vec3(0, 0, 1)); - - Error += glm::equal(C.x, D.x, 0.01f) ? 0 : 1; - Error += glm::equal(C.y, D.y, 0.01f) ? 0 : 1; - Error += glm::equal(C.z, D.z, 0.01f) ? 0 : 1; - Error += glm::equal(C.w, D.w, 0.01f) ? 0 : 1; - - return Error; -} - -int test_quat_normalize() -{ - int Error(0); - - { - glm::quat Q = glm::angleAxis(glm::pi() * 0.25f, glm::vec3(0, 0, 1)); - glm::quat N = glm::normalize(Q); - float L = glm::length(N); - Error += glm::equal(L, 1.0f, 0.000001f) ? 0 : 1; - } - { - glm::quat Q = glm::angleAxis(glm::pi() * 0.25f, glm::vec3(0, 0, 2)); - glm::quat N = glm::normalize(Q); - float L = glm::length(N); - Error += glm::equal(L, 1.0f, 0.000001f) ? 0 : 1; - } - { - glm::quat Q = glm::angleAxis(glm::pi() * 0.25f, glm::vec3(1, 2, 3)); - glm::quat N = glm::normalize(Q); - float L = glm::length(N); - Error += glm::equal(L, 1.0f, 0.000001f) ? 0 : 1; - } - - return Error; -} - -int test_quat_euler() -{ - int Error = 0; - - { - glm::quat q(1.0f, 0.0f, 0.0f, 1.0f); - float Roll = glm::roll(q); - float Pitch = glm::pitch(q); - float Yaw = glm::yaw(q); - glm::vec3 Angles = glm::eulerAngles(q); - Error += glm::all(glm::equal(Angles, glm::vec3(Pitch, Yaw, Roll), 0.000001f)) ? 0 : 1; - } - - { - glm::dquat q(1.0, 0.0, 0.0, 1.0); - double Roll = glm::roll(q); - double Pitch = glm::pitch(q); - double Yaw = glm::yaw(q); - glm::dvec3 Angles = glm::eulerAngles(q); - Error += glm::all(glm::equal(Angles, glm::dvec3(Pitch, Yaw, Roll), 0.000001)) ? 0 : 1; - } - - return Error; -} - -int test_quat_slerp() -{ - int Error = 0; - - float const Epsilon = 0.0001f;//glm::epsilon(); - - float sqrt2 = std::sqrt(2.0f)/2.0f; - glm::quat id(static_cast(1), static_cast(0), static_cast(0), static_cast(0)); - glm::quat Y90rot(sqrt2, 0.0f, sqrt2, 0.0f); - glm::quat Y180rot(0.0f, 0.0f, 1.0f, 0.0f); - - // Testing a == 0 - // Must be id - glm::quat id2 = glm::slerp(id, Y90rot, 0.0f); - Error += glm::all(glm::equal(id, id2, Epsilon)) ? 0 : 1; - - // Testing a == 1 - // Must be 90° rotation on Y : 0 0.7 0 0.7 - glm::quat Y90rot2 = glm::slerp(id, Y90rot, 1.0f); - Error += glm::all(glm::equal(Y90rot, Y90rot2, Epsilon)) ? 0 : 1; - - // Testing standard, easy case - // Must be 45° rotation on Y : 0 0.38 0 0.92 - glm::quat Y45rot1 = glm::slerp(id, Y90rot, 0.5f); - - // Testing reverse case - // Must be 45° rotation on Y : 0 0.38 0 0.92 - glm::quat Ym45rot2 = glm::slerp(Y90rot, id, 0.5f); - - // Testing against full circle around the sphere instead of shortest path - // Must be 45° rotation on Y - // certainly not a 135° rotation - glm::quat Y45rot3 = glm::slerp(id , -Y90rot, 0.5f); - float Y45angle3 = glm::angle(Y45rot3); - Error += glm::equal(Y45angle3, glm::pi() * 0.25f, Epsilon) ? 0 : 1; - Error += glm::all(glm::equal(Ym45rot2, Y45rot3, Epsilon)) ? 0 : 1; - - // Same, but inverted - // Must also be 45° rotation on Y : 0 0.38 0 0.92 - // -0 -0.38 -0 -0.92 is ok too - glm::quat Y45rot4 = glm::slerp(-Y90rot, id, 0.5f); - Error += glm::all(glm::equal(Ym45rot2, -Y45rot4, Epsilon)) ? 0 : 1; - - // Testing q1 = q2 - // Must be 90° rotation on Y : 0 0.7 0 0.7 - glm::quat Y90rot3 = glm::slerp(Y90rot, Y90rot, 0.5f); - Error += glm::all(glm::equal(Y90rot, Y90rot3, Epsilon)) ? 0 : 1; - - // Testing 180° rotation - // Must be 90° rotation on almost any axis that is on the XZ plane - glm::quat XZ90rot = glm::slerp(id, -Y90rot, 0.5f); - float XZ90angle = glm::angle(XZ90rot); // Must be PI/4 = 0.78; - Error += glm::equal(XZ90angle, glm::pi() * 0.25f, Epsilon) ? 0 : 1; - - // Testing almost equal quaternions (this test should pass through the linear interpolation) - // Must be 0 0.00X 0 0.99999 - glm::quat almostid = glm::slerp(id, glm::angleAxis(0.1f, glm::vec3(0.0f, 1.0f, 0.0f)), 0.5f); - - // Testing quaternions with opposite sign - { - glm::quat a(-1, 0, 0, 0); - - glm::quat result = glm::slerp(a, id, 0.5f); - - Error += glm::equal(glm::pow(glm::dot(id, result), 2.f), 1.f, 0.01f) ? 0 : 1; - } - - return Error; -} - -int test_quat_slerp_spins() -{ - int Error = 0; - - float const Epsilon = 0.0001f;//glm::epsilon(); - - float sqrt2 = std::sqrt(2.0f) / 2.0f; - glm::quat id(static_cast(1), static_cast(0), static_cast(0), static_cast(0)); - glm::quat Y90rot(sqrt2, 0.0f, sqrt2, 0.0f); - glm::quat Y180rot(0.0f, 0.0f, 1.0f, 0.0f); - - // Testing a == 0, k == 1 - // Must be id - glm::quat id2 = glm::slerp(id, id, 1.0f, 1); - Error += glm::all(glm::equal(id, id2, Epsilon)) ? 0 : 1; - - // Testing a == 1, k == 2 - // Must be id - glm::quat id3 = glm::slerp(id, id, 1.0f, 2); - Error += glm::all(glm::equal(id, id3, Epsilon)) ? 0 : 1; - - // Testing a == 1, k == 1 - // Must be 90° rotation on Y : 0 0.7 0 0.7 - // Negative quaternion is representing same orientation - glm::quat Y90rot2 = glm::slerp(id, Y90rot, 1.0f, 1); - Error += glm::all(glm::equal(Y90rot, -Y90rot2, Epsilon)) ? 0 : 1; - - // Testing a == 1, k == 2 - // Must be id - glm::quat Y90rot3 = glm::slerp(id, Y90rot, 8.0f / 9.0f, 2); - Error += glm::all(glm::equal(id, Y90rot3, Epsilon)) ? 0 : 1; - - // Testing a == 1, k == 1 - // Must be 90° rotation on Y : 0 0.7 0 0.7 - glm::quat Y90rot4 = glm::slerp(id, Y90rot, 0.2f, 1); - Error += glm::all(glm::equal(Y90rot, Y90rot4, Epsilon)) ? 0 : 1; - - // Testing reverse case - // Must be 45° rotation on Y : 0 0.38 0 0.92 - // Negative quaternion is representing same orientation - glm::quat Ym45rot2 = glm::slerp(Y90rot, id, 0.9f, 1); - glm::quat Ym45rot3 = glm::slerp(Y90rot, id, 0.5f); - Error += glm::all(glm::equal(-Ym45rot2, Ym45rot3, Epsilon)) ? 0 : 1; - - // Testing against full circle around the sphere instead of shortest path - // Must be 45° rotation on Y - // certainly not a 135° rotation - glm::quat Y45rot3 = glm::slerp(id, -Y90rot, 0.5f, 0); - float Y45angle3 = glm::angle(Y45rot3); - Error += glm::equal(Y45angle3, glm::pi() * 0.25f, Epsilon) ? 0 : 1; - Error += glm::all(glm::equal(Ym45rot3, Y45rot3, Epsilon)) ? 0 : 1; - - // Same, but inverted - // Must also be 45° rotation on Y : 0 0.38 0 0.92 - // -0 -0.38 -0 -0.92 is ok too - glm::quat Y45rot4 = glm::slerp(-Y90rot, id, 0.5f, 0); - Error += glm::all(glm::equal(Ym45rot2, Y45rot4, Epsilon)) ? 0 : 1; - - // Testing q1 = q2 k == 2 - // Must be 90° rotation on Y : 0 0.7 0 0.7 - glm::quat Y90rot5 = glm::slerp(Y90rot, Y90rot, 0.5f, 2); - Error += glm::all(glm::equal(Y90rot, Y90rot5, Epsilon)) ? 0 : 1; - - // Testing 180° rotation - // Must be 90° rotation on almost any axis that is on the XZ plane - glm::quat XZ90rot = glm::slerp(id, -Y90rot, 0.5f, 1); - float XZ90angle = glm::angle(XZ90rot); // Must be PI/4 = 0.78; - Error += glm::equal(XZ90angle, glm::pi() * 1.25f, Epsilon) ? 0 : 1; - - // Testing rotation over long arc - // Distance from id to 90° is 270°, so 2/3 of it should be 180° - // Negative quaternion is representing same orientation - glm::quat Neg90rot = glm::slerp(id, Y90rot, 2.0f / 3.0f, -1); - Error += glm::all(glm::equal(Y180rot, -Neg90rot, Epsilon)) ? 0 : 1; - - return Error; -} - -static int test_quat_mul_vec() -{ - int Error(0); - - glm::quat q = glm::angleAxis(glm::pi() * 0.5f, glm::vec3(0, 0, 1)); - glm::vec3 v(1, 0, 0); - glm::vec3 u(q * v); - glm::vec3 w(u * q); - - Error += glm::all(glm::equal(v, w, 0.01f)) ? 0 : 1; - - return Error; -} - -static int test_mul() -{ - int Error = 0; - - glm::quat temp1 = glm::normalize(glm::quat(1.0f, glm::vec3(0.0, 1.0, 0.0))); - glm::quat temp2 = glm::normalize(glm::quat(0.5f, glm::vec3(1.0, 0.0, 0.0))); - - glm::vec3 transformed0 = (temp1 * glm::vec3(0.0, 1.0, 0.0) * glm::inverse(temp1)); - glm::vec3 temp4 = temp2 * transformed0 * glm::inverse(temp2); - - glm::quat temp5 = glm::normalize(temp1 * temp2); - glm::vec3 temp6 = temp5 * glm::vec3(0.0, 1.0, 0.0) * glm::inverse(temp5); - - glm::quat temp7(1.0f, glm::vec3(0.0, 1.0, 0.0)); - - temp7 *= temp5; - temp7 *= glm::inverse(temp5); - - Error += glm::any(glm::notEqual(temp7, glm::quat(1.0f, glm::vec3(0.0, 1.0, 0.0)), glm::epsilon())) ? 1 : 0; - - return Error; -} - -int test_identity() -{ - int Error = 0; - - glm::quat const Q = glm::identity(); - - Error += glm::all(glm::equal(Q, glm::quat(1, 0, 0, 0), 0.0001f)) ? 0 : 1; - Error += glm::any(glm::notEqual(Q, glm::quat(1, 0, 0, 0), 0.0001f)) ? 1 : 0; - - glm::mat4 const M = glm::identity(); - glm::mat4 const N(1.0f); - - Error += glm::all(glm::equal(M, N, 0.0001f)) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_mul(); - Error += test_quat_mul_vec(); - Error += test_quat_angle(); - Error += test_quat_angleAxis(); - Error += test_quat_mix(); - Error += test_quat_normalize(); - Error += test_quat_euler(); - Error += test_quat_slerp(); - Error += test_quat_slerp_spins(); - Error += test_identity(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtc/gtc_random.cpp b/3rdparty/glm/source/test/gtc/gtc_random.cpp deleted file mode 100644 index 60fb60c..0000000 --- a/3rdparty/glm/source/test/gtc/gtc_random.cpp +++ /dev/null @@ -1,381 +0,0 @@ -#define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES -#include -#include -#include -#if GLM_LANG & GLM_LANG_CXX0X_FLAG -# include -#endif - -std::size_t const TestSamples = 10000; - -int test_linearRand() -{ - int Error = 0; - - glm::int32 const Min = 16; - glm::int32 const Max = 32; - - { - glm::u8vec2 AMin(std::numeric_limits::max()); - glm::u8vec2 AMax(std::numeric_limits::min()); - { - for(std::size_t i = 0; i < TestSamples; ++i) - { - glm::u8vec2 A = glm::linearRand(glm::u8vec2(Min), glm::u8vec2(Max)); - AMin = glm::min(AMin, A); - AMax = glm::max(AMax, A); - - if(!glm::all(glm::lessThanEqual(A, glm::u8vec2(Max)))) - ++Error; - if(!glm::all(glm::greaterThanEqual(A, glm::u8vec2(Min)))) - ++Error; - assert(!Error); - } - - Error += glm::all(glm::equal(AMin, glm::u8vec2(Min))) ? 0 : 1; - Error += glm::all(glm::equal(AMax, glm::u8vec2(Max))) ? 0 : 1; - assert(!Error); - } - - glm::u16vec2 BMin(std::numeric_limits::max()); - glm::u16vec2 BMax(std::numeric_limits::min()); - { - for(std::size_t i = 0; i < TestSamples; ++i) - { - glm::u16vec2 B = glm::linearRand(glm::u16vec2(Min), glm::u16vec2(Max)); - BMin = glm::min(BMin, B); - BMax = glm::max(BMax, B); - - if(!glm::all(glm::lessThanEqual(B, glm::u16vec2(Max)))) - ++Error; - if(!glm::all(glm::greaterThanEqual(B, glm::u16vec2(Min)))) - ++Error; - assert(!Error); - } - - Error += glm::all(glm::equal(BMin, glm::u16vec2(Min))) ? 0 : 1; - Error += glm::all(glm::equal(BMax, glm::u16vec2(Max))) ? 0 : 1; - assert(!Error); - } - - glm::u32vec2 CMin(std::numeric_limits::max()); - glm::u32vec2 CMax(std::numeric_limits::min()); - { - for(std::size_t i = 0; i < TestSamples; ++i) - { - glm::u32vec2 C = glm::linearRand(glm::u32vec2(Min), glm::u32vec2(Max)); - CMin = glm::min(CMin, C); - CMax = glm::max(CMax, C); - - if(!glm::all(glm::lessThanEqual(C, glm::u32vec2(Max)))) - ++Error; - if(!glm::all(glm::greaterThanEqual(C, glm::u32vec2(Min)))) - ++Error; - assert(!Error); - } - - Error += glm::all(glm::equal(CMin, glm::u32vec2(Min))) ? 0 : 1; - Error += glm::all(glm::equal(CMax, glm::u32vec2(Max))) ? 0 : 1; - assert(!Error); - } - - glm::u64vec2 DMin(std::numeric_limits::max()); - glm::u64vec2 DMax(std::numeric_limits::min()); - { - for(std::size_t i = 0; i < TestSamples; ++i) - { - glm::u64vec2 D = glm::linearRand(glm::u64vec2(Min), glm::u64vec2(Max)); - DMin = glm::min(DMin, D); - DMax = glm::max(DMax, D); - - if(!glm::all(glm::lessThanEqual(D, glm::u64vec2(Max)))) - ++Error; - if(!glm::all(glm::greaterThanEqual(D, glm::u64vec2(Min)))) - ++Error; - assert(!Error); - } - - Error += glm::all(glm::equal(DMin, glm::u64vec2(Min))) ? 0 : 1; - Error += glm::all(glm::equal(DMax, glm::u64vec2(Max))) ? 0 : 1; - assert(!Error); - } - } - - { - glm::i8vec2 AMin(std::numeric_limits::max()); - glm::i8vec2 AMax(std::numeric_limits::min()); - { - for(std::size_t i = 0; i < TestSamples; ++i) - { - glm::i8vec2 A = glm::linearRand(glm::i8vec2(Min), glm::i8vec2(Max)); - AMin = glm::min(AMin, A); - AMax = glm::max(AMax, A); - - if(!glm::all(glm::lessThanEqual(A, glm::i8vec2(Max)))) - ++Error; - if(!glm::all(glm::greaterThanEqual(A, glm::i8vec2(Min)))) - ++Error; - assert(!Error); - } - - Error += glm::all(glm::equal(AMin, glm::i8vec2(Min))) ? 0 : 1; - Error += glm::all(glm::equal(AMax, glm::i8vec2(Max))) ? 0 : 1; - assert(!Error); - } - - glm::i16vec2 BMin(std::numeric_limits::max()); - glm::i16vec2 BMax(std::numeric_limits::min()); - { - for(std::size_t i = 0; i < TestSamples; ++i) - { - glm::i16vec2 B = glm::linearRand(glm::i16vec2(Min), glm::i16vec2(Max)); - BMin = glm::min(BMin, B); - BMax = glm::max(BMax, B); - - if(!glm::all(glm::lessThanEqual(B, glm::i16vec2(Max)))) - ++Error; - if(!glm::all(glm::greaterThanEqual(B, glm::i16vec2(Min)))) - ++Error; - assert(!Error); - } - - Error += glm::all(glm::equal(BMin, glm::i16vec2(Min))) ? 0 : 1; - Error += glm::all(glm::equal(BMax, glm::i16vec2(Max))) ? 0 : 1; - assert(!Error); - } - - glm::i32vec2 CMin(std::numeric_limits::max()); - glm::i32vec2 CMax(std::numeric_limits::min()); - { - for(std::size_t i = 0; i < TestSamples; ++i) - { - glm::i32vec2 C = glm::linearRand(glm::i32vec2(Min), glm::i32vec2(Max)); - CMin = glm::min(CMin, C); - CMax = glm::max(CMax, C); - - if(!glm::all(glm::lessThanEqual(C, glm::i32vec2(Max)))) - ++Error; - if(!glm::all(glm::greaterThanEqual(C, glm::i32vec2(Min)))) - ++Error; - assert(!Error); - } - - Error += glm::all(glm::equal(CMin, glm::i32vec2(Min))) ? 0 : 1; - Error += glm::all(glm::equal(CMax, glm::i32vec2(Max))) ? 0 : 1; - assert(!Error); - } - - glm::i64vec2 DMin(std::numeric_limits::max()); - glm::i64vec2 DMax(std::numeric_limits::min()); - { - for(std::size_t i = 0; i < TestSamples; ++i) - { - glm::i64vec2 D = glm::linearRand(glm::i64vec2(Min), glm::i64vec2(Max)); - DMin = glm::min(DMin, D); - DMax = glm::max(DMax, D); - - if(!glm::all(glm::lessThanEqual(D, glm::i64vec2(Max)))) - ++Error; - if(!glm::all(glm::greaterThanEqual(D, glm::i64vec2(Min)))) - ++Error; - assert(!Error); - } - - Error += glm::all(glm::equal(DMin, glm::i64vec2(Min))) ? 0 : 1; - Error += glm::all(glm::equal(DMax, glm::i64vec2(Max))) ? 0 : 1; - assert(!Error); - } - } - - for(std::size_t i = 0; i < TestSamples; ++i) - { - glm::f32vec2 const A(glm::linearRand(glm::f32vec2(static_cast(Min)), glm::f32vec2(static_cast(Max)))); - if(!glm::all(glm::lessThanEqual(A, glm::f32vec2(static_cast(Max))))) - ++Error; - if(!glm::all(glm::greaterThanEqual(A, glm::f32vec2(static_cast(Min))))) - ++Error; - - glm::f64vec2 const B(glm::linearRand(glm::f64vec2(Min), glm::f64vec2(Max))); - if(!glm::all(glm::lessThanEqual(B, glm::f64vec2(Max)))) - ++Error; - if(!glm::all(glm::greaterThanEqual(B, glm::f64vec2(Min)))) - ++Error; - assert(!Error); - } - - { - float ResultFloat = 0.0f; - double ResultDouble = 0.0; - for(std::size_t i = 0; i < TestSamples; ++i) - { - ResultFloat += glm::linearRand(-1.0f, 1.0f); - ResultDouble += glm::linearRand(-1.0, 1.0); - } - - Error += glm::epsilonEqual(ResultFloat, 0.0f, 0.0001f); - Error += glm::epsilonEqual(ResultDouble, 0.0, 0.0001); - assert(!Error); - } - - return Error; -} - -int test_circularRand() -{ - int Error = 0; - - { - std::size_t Max = TestSamples; - float ResultFloat = 0.0f; - double ResultDouble = 0.0; - double Radius = 2.0; - - for(std::size_t i = 0; i < Max; ++i) - { - ResultFloat += glm::length(glm::circularRand(1.0f)); - ResultDouble += glm::length(glm::circularRand(Radius)); - } - - Error += glm::epsilonEqual(ResultFloat, float(Max), 0.01f) ? 0 : 1; - Error += glm::epsilonEqual(ResultDouble, double(Max) * double(Radius), 0.01) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int test_sphericalRand() -{ - int Error = 0; - - { - std::size_t Max = TestSamples; - float ResultFloatA = 0.0f; - float ResultFloatB = 0.0f; - float ResultFloatC = 0.0f; - double ResultDoubleA = 0.0; - double ResultDoubleB = 0.0; - double ResultDoubleC = 0.0; - - for(std::size_t i = 0; i < Max; ++i) - { - ResultFloatA += glm::length(glm::sphericalRand(1.0f)); - ResultDoubleA += glm::length(glm::sphericalRand(1.0)); - ResultFloatB += glm::length(glm::sphericalRand(2.0f)); - ResultDoubleB += glm::length(glm::sphericalRand(2.0)); - ResultFloatC += glm::length(glm::sphericalRand(3.0f)); - ResultDoubleC += glm::length(glm::sphericalRand(3.0)); - } - - Error += glm::epsilonEqual(ResultFloatA, float(Max), 0.01f) ? 0 : 1; - Error += glm::epsilonEqual(ResultDoubleA, double(Max), 0.0001) ? 0 : 1; - Error += glm::epsilonEqual(ResultFloatB, float(Max * 2), 0.01f) ? 0 : 1; - Error += glm::epsilonEqual(ResultDoubleB, double(Max * 2), 0.0001) ? 0 : 1; - Error += glm::epsilonEqual(ResultFloatC, float(Max * 3), 0.01f) ? 0 : 1; - Error += glm::epsilonEqual(ResultDoubleC, double(Max * 3), 0.01) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int test_diskRand() -{ - int Error = 0; - - { - float ResultFloat = 0.0f; - double ResultDouble = 0.0; - - for(std::size_t i = 0; i < TestSamples; ++i) - { - ResultFloat += glm::length(glm::diskRand(2.0f)); - ResultDouble += glm::length(glm::diskRand(2.0)); - } - - Error += ResultFloat < float(TestSamples) * 2.f ? 0 : 1; - Error += ResultDouble < double(TestSamples) * 2.0 ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int test_ballRand() -{ - int Error = 0; - - { - float ResultFloat = 0.0f; - double ResultDouble = 0.0; - - for(std::size_t i = 0; i < TestSamples; ++i) - { - ResultFloat += glm::length(glm::ballRand(2.0f)); - ResultDouble += glm::length(glm::ballRand(2.0)); - } - - Error += ResultFloat < float(TestSamples) * 2.f ? 0 : 1; - Error += ResultDouble < double(TestSamples) * 2.0 ? 0 : 1; - assert(!Error); - } - - return Error; -} -/* -#if(GLM_LANG & GLM_LANG_CXX0X_FLAG) -int test_grid() -{ - int Error = 0; - - typedef std::array colors; - typedef std::array grid; - - grid Grid; - colors Colors; - - grid GridBest; - colors ColorsBest; - - while(true) - { - for(std::size_t i = 0; i < Grid.size(); ++i) - Grid[i] = int(glm::linearRand(0.0, 8.0 * 8.0 * 8.0 - 1.0) / 64.0); - - for(std::size_t i = 0; i < Grid.size(); ++i) - ++Colors[Grid[i]]; - - bool Exit = true; - for(std::size_t i = 0; i < Colors.size(); ++i) - { - if(Colors[i] == 8) - continue; - - Exit = false; - break; - } - - if(Exit == true) - break; - } - - return Error; -} -#endif -*/ -int main() -{ - int Error = 0; - - Error += test_linearRand(); - Error += test_circularRand(); - Error += test_sphericalRand(); - Error += test_diskRand(); - Error += test_ballRand(); -/* -#if(GLM_LANG & GLM_LANG_CXX0X_FLAG) - Error += test_grid(); -#endif -*/ - return Error; -} diff --git a/3rdparty/glm/source/test/gtc/gtc_reciprocal.cpp b/3rdparty/glm/source/test/gtc/gtc_reciprocal.cpp deleted file mode 100644 index 5158413..0000000 --- a/3rdparty/glm/source/test/gtc/gtc_reciprocal.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include - -int main() -{ - return 0; -} - diff --git a/3rdparty/glm/source/test/gtc/gtc_round.cpp b/3rdparty/glm/source/test/gtc/gtc_round.cpp deleted file mode 100644 index 60d9a85..0000000 --- a/3rdparty/glm/source/test/gtc/gtc_round.cpp +++ /dev/null @@ -1,458 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -namespace isPowerOfTwo -{ - template - struct type - { - genType Value; - bool Return; - }; - - int test_int16() - { - type const Data[] = - { - {0x0001, true}, - {0x0002, true}, - {0x0004, true}, - {0x0080, true}, - {0x0000, true}, - {0x0003, false} - }; - - int Error(0); - - for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - bool Result = glm::isPowerOfTwo(Data[i].Value); - Error += Data[i].Return == Result ? 0 : 1; - } - - return Error; - } - - int test_uint16() - { - type const Data[] = - { - {0x0001, true}, - {0x0002, true}, - {0x0004, true}, - {0x0000, true}, - {0x0000, true}, - {0x0003, false} - }; - - int Error(0); - - for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - bool Result = glm::isPowerOfTwo(Data[i].Value); - Error += Data[i].Return == Result ? 0 : 1; - } - - return Error; - } - - int test_int32() - { - type const Data[] = - { - {0x00000001, true}, - {0x00000002, true}, - {0x00000004, true}, - {0x0000000f, false}, - {0x00000000, true}, - {0x00000003, false} - }; - - int Error(0); - - for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - bool Result = glm::isPowerOfTwo(Data[i].Value); - Error += Data[i].Return == Result ? 0 : 1; - } - - for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - glm::bvec1 Result = glm::isPowerOfTwo(glm::ivec1(Data[i].Value)); - Error += glm::all(glm::equal(glm::bvec1(Data[i].Return), Result)) ? 0 : 1; - } - - for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - glm::bvec2 Result = glm::isPowerOfTwo(glm::ivec2(Data[i].Value)); - Error += glm::all(glm::equal(glm::bvec2(Data[i].Return), Result)) ? 0 : 1; - } - - for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - glm::bvec3 Result = glm::isPowerOfTwo(glm::ivec3(Data[i].Value)); - Error += glm::all(glm::equal(glm::bvec3(Data[i].Return), Result)) ? 0 : 1; - } - - for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - glm::bvec4 Result = glm::isPowerOfTwo(glm::ivec4(Data[i].Value)); - Error += glm::all(glm::equal(glm::bvec4(Data[i].Return), Result)) ? 0 : 1; - } - - return Error; - } - - int test_uint32() - { - type const Data[] = - { - {0x00000001, true}, - {0x00000002, true}, - {0x00000004, true}, - {0x80000000, true}, - {0x00000000, true}, - {0x00000003, false} - }; - - int Error(0); - - for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - bool Result = glm::isPowerOfTwo(Data[i].Value); - Error += Data[i].Return == Result ? 0 : 1; - } - - return Error; - } - - int test() - { - int Error(0); - - Error += test_int16(); - Error += test_uint16(); - Error += test_int32(); - Error += test_uint32(); - - return Error; - } -}//isPowerOfTwo - -namespace ceilPowerOfTwo_advanced -{ - template - GLM_FUNC_QUALIFIER genIUType highestBitValue(genIUType Value) - { - genIUType tmp = Value; - genIUType result = genIUType(0); - while(tmp) - { - result = (tmp & (~tmp + 1)); // grab lowest bit - tmp &= ~result; // clear lowest bit - } - return result; - } - - template - GLM_FUNC_QUALIFIER genType ceilPowerOfTwo_loop(genType value) - { - return glm::isPowerOfTwo(value) ? value : highestBitValue(value) << 1; - } - - template - struct type - { - genType Value; - genType Return; - }; - - int test_int32() - { - type const Data[] = - { - {0x0000ffff, 0x00010000}, - {-3, -4}, - {-8, -8}, - {0x00000001, 0x00000001}, - {0x00000002, 0x00000002}, - {0x00000004, 0x00000004}, - {0x00000007, 0x00000008}, - {0x0000fff0, 0x00010000}, - {0x0000f000, 0x00010000}, - {0x08000000, 0x08000000}, - {0x00000000, 0x00000000}, - {0x00000003, 0x00000004} - }; - - int Error(0); - - for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - glm::int32 Result = glm::ceilPowerOfTwo(Data[i].Value); - Error += Data[i].Return == Result ? 0 : 1; - } - - return Error; - } - - int test_uint32() - { - type const Data[] = - { - {0x00000001, 0x00000001}, - {0x00000002, 0x00000002}, - {0x00000004, 0x00000004}, - {0x00000007, 0x00000008}, - {0x0000ffff, 0x00010000}, - {0x0000fff0, 0x00010000}, - {0x0000f000, 0x00010000}, - {0x80000000, 0x80000000}, - {0x00000000, 0x00000000}, - {0x00000003, 0x00000004} - }; - - int Error(0); - - for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - glm::uint32 Result = glm::ceilPowerOfTwo(Data[i].Value); - Error += Data[i].Return == Result ? 0 : 1; - } - - return Error; - } - - int perf() - { - int Error(0); - - std::vector v; - v.resize(100000000); - - std::clock_t Timestramp0 = std::clock(); - - for(glm::uint32 i = 0, n = static_cast(v.size()); i < n; ++i) - v[i] = ceilPowerOfTwo_loop(i); - - std::clock_t Timestramp1 = std::clock(); - - for(glm::uint32 i = 0, n = static_cast(v.size()); i < n; ++i) - v[i] = glm::ceilPowerOfTwo(i); - - std::clock_t Timestramp2 = std::clock(); - - std::printf("ceilPowerOfTwo_loop: %d clocks\n", static_cast(Timestramp1 - Timestramp0)); - std::printf("glm::ceilPowerOfTwo: %d clocks\n", static_cast(Timestramp2 - Timestramp1)); - - return Error; - } - - int test() - { - int Error(0); - - Error += test_int32(); - Error += test_uint32(); - - return Error; - } -}//namespace ceilPowerOfTwo_advanced - -namespace roundPowerOfTwo -{ - int test() - { - int Error = 0; - - glm::uint32 const A = glm::roundPowerOfTwo(7u); - Error += A == 8u ? 0 : 1; - - glm::uint32 const B = glm::roundPowerOfTwo(15u); - Error += B == 16u ? 0 : 1; - - glm::uint32 const C = glm::roundPowerOfTwo(31u); - Error += C == 32u ? 0 : 1; - - glm::uint32 const D = glm::roundPowerOfTwo(9u); - Error += D == 8u ? 0 : 1; - - glm::uint32 const E = glm::roundPowerOfTwo(17u); - Error += E == 16u ? 0 : 1; - - glm::uint32 const F = glm::roundPowerOfTwo(33u); - Error += F == 32u ? 0 : 1; - - return Error; - } -}//namespace roundPowerOfTwo - -namespace floorPowerOfTwo -{ - int test() - { - int Error = 0; - - glm::uint32 const A = glm::floorPowerOfTwo(7u); - Error += A == 4u ? 0 : 1; - - glm::uint32 const B = glm::floorPowerOfTwo(15u); - Error += B == 8u ? 0 : 1; - - glm::uint32 const C = glm::floorPowerOfTwo(31u); - Error += C == 16u ? 0 : 1; - - return Error; - } -}//namespace floorPowerOfTwo - -namespace ceilPowerOfTwo -{ - int test() - { - int Error = 0; - - glm::uint32 const A = glm::ceilPowerOfTwo(7u); - Error += A == 8u ? 0 : 1; - - glm::uint32 const B = glm::ceilPowerOfTwo(15u); - Error += B == 16u ? 0 : 1; - - glm::uint32 const C = glm::ceilPowerOfTwo(31u); - Error += C == 32u ? 0 : 1; - - return Error; - } -}//namespace ceilPowerOfTwo - -namespace floorMultiple -{ - template - struct type - { - genType Source; - genType Multiple; - genType Return; - genType Epsilon; - }; - - int test_float() - { - type const Data[] = - { - {3.4, 0.3, 3.3, 0.0001}, - {-1.4, 0.3, -1.5, 0.0001}, - }; - - int Error(0); - - for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - glm::float64 Result = glm::floorMultiple(Data[i].Source, Data[i].Multiple); - Error += glm::epsilonEqual(Data[i].Return, Result, Data[i].Epsilon) ? 0 : 1; - } - - return Error; - } - - int test() - { - int Error(0); - - Error += test_float(); - - return Error; - } -}//namespace floorMultiple - -namespace ceilMultiple -{ - template - struct type - { - genType Source; - genType Multiple; - genType Return; - genType Epsilon; - }; - - int test_float() - { - type const Data[] = - { - {3.4, 0.3, 3.6, 0.0001}, - {-1.4, 0.3, -1.2, 0.0001}, - }; - - int Error(0); - - for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - glm::float64 Result = glm::ceilMultiple(Data[i].Source, Data[i].Multiple); - Error += glm::epsilonEqual(Data[i].Return, Result, Data[i].Epsilon) ? 0 : 1; - } - - return Error; - } - - int test_int() - { - type const Data[] = - { - {3, 4, 4, 0}, - {7, 4, 8, 0}, - {5, 4, 8, 0}, - {1, 4, 4, 0}, - {1, 3, 3, 0}, - {4, 3, 6, 0}, - {4, 1, 4, 0}, - {1, 1, 1, 0}, - {7, 1, 7, 0}, - }; - - int Error(0); - - for(std::size_t i = 0, n = sizeof(Data) / sizeof(type); i < n; ++i) - { - int Result = glm::ceilMultiple(Data[i].Source, Data[i].Multiple); - Error += Data[i].Return == Result ? 0 : 1; - } - - return Error; - } - - int test() - { - int Error(0); - - Error += test_int(); - Error += test_float(); - - return Error; - } -}//namespace ceilMultiple - -int main() -{ - int Error(0); - - Error += isPowerOfTwo::test(); - Error += floorPowerOfTwo::test(); - Error += roundPowerOfTwo::test(); - Error += ceilPowerOfTwo::test(); - Error += ceilPowerOfTwo_advanced::test(); - -# ifdef NDEBUG - Error += ceilPowerOfTwo_advanced::perf(); -# endif//NDEBUG - - Error += floorMultiple::test(); - Error += ceilMultiple::test(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtc/gtc_type_aligned.cpp b/3rdparty/glm/source/test/gtc/gtc_type_aligned.cpp deleted file mode 100644 index 3c071ef..0000000 --- a/3rdparty/glm/source/test/gtc/gtc_type_aligned.cpp +++ /dev/null @@ -1,181 +0,0 @@ -#include - -#if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE -#include -#include -#include -#include - -GLM_STATIC_ASSERT(glm::detail::is_aligned::value, "aligned_lowp is not aligned"); -GLM_STATIC_ASSERT(glm::detail::is_aligned::value, "aligned_mediump is not aligned"); -GLM_STATIC_ASSERT(glm::detail::is_aligned::value, "aligned_highp is not aligned"); -GLM_STATIC_ASSERT(!glm::detail::is_aligned::value, "packed_highp is aligned"); -GLM_STATIC_ASSERT(!glm::detail::is_aligned::value, "packed_mediump is aligned"); -GLM_STATIC_ASSERT(!glm::detail::is_aligned::value, "packed_lowp is aligned"); - -struct my_vec4_packed -{ - glm::uint32 a; - glm::vec4 b; -}; -GLM_STATIC_ASSERT(sizeof(my_vec4_packed) == sizeof(glm::uint32) + sizeof(glm::vec4), "glm::vec4 packed is not correct"); - -struct my_vec4_aligned -{ - glm::uint32 a; - glm::aligned_vec4 b; -}; -GLM_STATIC_ASSERT(sizeof(my_vec4_aligned) == sizeof(glm::aligned_vec4) * 2, "glm::vec4 aligned is not correct"); - -struct my_dvec4_packed -{ - glm::uint64 a; - glm::dvec4 b; -}; -GLM_STATIC_ASSERT(sizeof(my_dvec4_packed) == sizeof(glm::uint64) + sizeof(glm::dvec4), "glm::dvec4 packed is not correct"); - -struct my_dvec4_aligned -{ - glm::uint64 a; - glm::aligned_dvec4 b; -}; -//GLM_STATIC_ASSERT(sizeof(my_dvec4_aligned) == sizeof(glm::aligned_dvec4) * 2, "glm::dvec4 aligned is not correct"); - -struct my_ivec4_packed -{ - glm::uint32 a; - glm::ivec4 b; -}; -GLM_STATIC_ASSERT(sizeof(my_ivec4_packed) == sizeof(glm::uint32) + sizeof(glm::ivec4), "glm::ivec4 packed is not correct"); - -struct my_ivec4_aligned -{ - glm::uint32 a; - glm::aligned_ivec4 b; -}; -GLM_STATIC_ASSERT(sizeof(my_ivec4_aligned) == sizeof(glm::aligned_ivec4) * 2, "glm::ivec4 aligned is not correct"); - -struct my_u8vec4_packed -{ - glm::uint32 a; - glm::u8vec4 b; -}; -GLM_STATIC_ASSERT(sizeof(my_u8vec4_packed) == sizeof(glm::uint32) + sizeof(glm::u8vec4), "glm::u8vec4 packed is not correct"); - -static int test_copy() -{ - int Error = 0; - - { - glm::aligned_ivec4 const a(1, 2, 3, 4); - glm::ivec4 const u(a); - - Error += a.x == u.x ? 0 : 1; - Error += a.y == u.y ? 0 : 1; - Error += a.z == u.z ? 0 : 1; - Error += a.w == u.w ? 0 : 1; - } - - { - my_ivec4_aligned a; - a.b = glm::ivec4(1, 2, 3, 4); - - my_ivec4_packed u; - u.b = a.b; - - Error += a.b.x == u.b.x ? 0 : 1; - Error += a.b.y == u.b.y ? 0 : 1; - Error += a.b.z == u.b.z ? 0 : 1; - Error += a.b.w == u.b.w ? 0 : 1; - } - - return Error; -} - -static int test_ctor() -{ - int Error = 0; - -# if GLM_HAS_CONSTEXPR - { - constexpr glm::aligned_ivec4 v(1); - - Error += v.x == 1 ? 0 : 1; - Error += v.y == 1 ? 0 : 1; - Error += v.z == 1 ? 0 : 1; - Error += v.w == 1 ? 0 : 1; - } - - { - constexpr glm::packed_ivec4 v(1); - - Error += v.x == 1 ? 0 : 1; - Error += v.y == 1 ? 0 : 1; - Error += v.z == 1 ? 0 : 1; - Error += v.w == 1 ? 0 : 1; - } - - { - constexpr glm::ivec4 v(1); - - Error += v.x == 1 ? 0 : 1; - Error += v.y == 1 ? 0 : 1; - Error += v.z == 1 ? 0 : 1; - Error += v.w == 1 ? 0 : 1; - } -# endif//GLM_HAS_CONSTEXPR - - return Error; -} - -static int test_aligned_ivec4() -{ - int Error = 0; - - glm::aligned_ivec4 const v(1, 2, 3, 4); - Error += glm::all(glm::equal(v, glm::aligned_ivec4(1, 2, 3, 4))) ? 0 : 1; - - glm::aligned_ivec4 const u = v * 2; - Error += glm::all(glm::equal(u, glm::aligned_ivec4(2, 4, 6, 8))) ? 0 : 1; - - return Error; -} - -static int test_aligned_mat4() -{ - int Error = 0; - - glm::aligned_vec4 const u(1.f, 2.f, 3.f, 4.f); - Error += glm::all(glm::equal(u, glm::aligned_vec4(1.f, 2.f, 3.f, 4.f), 0.0001f)) ? 0 : 1; - - glm::aligned_vec4 const v(1, 2, 3, 4); - Error += glm::all(glm::equal(v, glm::aligned_vec4(1.f, 2.f, 3.f, 4.f), 0.0001f)) ? 0 : 1; - - glm::aligned_mat4 const m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); - glm::aligned_mat4 const t = glm::transpose(m); - glm::aligned_mat4 const expected = glm::mat4(0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15); - Error += glm::all(glm::equal(t, expected, 0.0001f)) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_ctor(); - Error += test_copy(); - Error += test_aligned_ivec4(); - Error += test_aligned_mat4(); - - return Error; -} - -#else - -int main() -{ - return 0; -} - -#endif diff --git a/3rdparty/glm/source/test/gtc/gtc_type_precision.cpp b/3rdparty/glm/source/test/gtc/gtc_type_precision.cpp deleted file mode 100644 index 77f0686..0000000 --- a/3rdparty/glm/source/test/gtc/gtc_type_precision.cpp +++ /dev/null @@ -1,1041 +0,0 @@ -#include -#include -#include -#include -#include -#if GLM_HAS_OPENMP -# include -#endif - -#if GLM_HAS_STATIC_ASSERT -static_assert(sizeof(glm::lowp_u8vec1) == 1, "uint8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::mediump_u8vec1) == 1, "uint8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::highp_u8vec1) == 1, "uint8 size isn't 1 byte on this platform"); - -static_assert(sizeof(glm::lowp_u16vec1) == 2, "uint16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::mediump_u16vec1) == 2, "uint16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::highp_u16vec1) == 2, "uint16 size isn't 2 bytes on this platform"); - -static_assert(sizeof(glm::lowp_u32vec1) == 4, "uint32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::mediump_u32vec1) == 4, "uint32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::highp_u32vec1) == 4, "uint32 size isn't 4 bytes on this platform"); - -static_assert(sizeof(glm::lowp_u64vec1) == 8, "uint64 size isn't 8 bytes on this platform"); -static_assert(sizeof(glm::mediump_u64vec1) == 8, "uint64 size isn't 8 bytes on this platform"); -static_assert(sizeof(glm::highp_u64vec1) == 8, "uint64 size isn't 8 bytes on this platform"); - - -static_assert(sizeof(glm::lowp_u8vec2) == 2, "uint8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::mediump_u8vec2) == 2, "uint8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::highp_u8vec2) == 2, "uint8 size isn't 1 byte on this platform"); - -static_assert(sizeof(glm::lowp_u16vec2) == 4, "uint16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::mediump_u16vec2) == 4, "uint16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::highp_u16vec2) == 4, "uint16 size isn't 2 bytes on this platform"); - -static_assert(sizeof(glm::lowp_u32vec2) == 8, "uint32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::mediump_u32vec2) == 8, "uint32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::highp_u32vec2) == 8, "uint32 size isn't 4 bytes on this platform"); - -static_assert(sizeof(glm::lowp_u64vec2) == 16, "uint64 size isn't 8 bytes on this platform"); -static_assert(sizeof(glm::mediump_u64vec2) == 16, "uint64 size isn't 8 bytes on this platform"); -static_assert(sizeof(glm::highp_u64vec2) == 16, "uint64 size isn't 8 bytes on this platform"); - - -static_assert(sizeof(glm::lowp_u8vec3) == 3, "uint8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::mediump_u8vec3) == 3, "uint8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::highp_u8vec3) == 3, "uint8 size isn't 1 byte on this platform"); - -static_assert(sizeof(glm::lowp_u16vec3) == 6, "uint16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::mediump_u16vec3) == 6, "uint16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::highp_u16vec3) == 6, "uint16 size isn't 2 bytes on this platform"); - -static_assert(sizeof(glm::lowp_u32vec3) == 12, "uint32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::mediump_u32vec3) == 12, "uint32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::highp_u32vec3) == 12, "uint32 size isn't 4 bytes on this platform"); - -static_assert(sizeof(glm::lowp_u64vec3) == 24, "uint64 size isn't 8 bytes on this platform"); -static_assert(sizeof(glm::mediump_u64vec3) == 24, "uint64 size isn't 8 bytes on this platform"); -static_assert(sizeof(glm::highp_u64vec3) == 24, "uint64 size isn't 8 bytes on this platform"); - - -static_assert(sizeof(glm::lowp_u8vec4) == 4, "int8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::mediump_u8vec4) == 4, "int8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::highp_u8vec4) == 4, "int8 size isn't 1 byte on this platform"); - -static_assert(sizeof(glm::lowp_u16vec4) == 8, "int16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::mediump_u16vec4) == 8, "int16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::highp_u16vec4) == 8, "int16 size isn't 2 bytes on this platform"); - -static_assert(sizeof(glm::lowp_u32vec4) == 16, "int32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::mediump_u32vec4) == 16, "int32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::highp_u32vec4) == 16, "int32 size isn't 4 bytes on this platform"); - -static_assert(sizeof(glm::lowp_u64vec4) == 32, "int64 size isn't 8 bytes on this platform"); -static_assert(sizeof(glm::mediump_u64vec4) == 32, "int64 size isn't 8 bytes on this platform"); -static_assert(sizeof(glm::highp_u64vec4) == 32, "int64 size isn't 8 bytes on this platform"); - - -static_assert(sizeof(glm::lowp_u8vec1) == 1, "uint8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::mediump_u8vec1) == 1, "uint8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::highp_u8vec1) == 1, "uint8 size isn't 1 byte on this platform"); - -static_assert(sizeof(glm::lowp_u16vec1) == 2, "uint16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::mediump_u16vec1) == 2, "uint16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::highp_u16vec1) == 2, "uint16 size isn't 2 bytes on this platform"); - -static_assert(sizeof(glm::lowp_u32vec1) == 4, "uint32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::mediump_u32vec1) == 4, "uint32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::highp_u32vec1) == 4, "uint32 size isn't 4 bytes on this platform"); - -static_assert(sizeof(glm::lowp_u64vec1) == 8, "uint64 size isn't 8 bytes on this platform"); -static_assert(sizeof(glm::mediump_u64vec1) == 8, "uint64 size isn't 8 bytes on this platform"); -static_assert(sizeof(glm::highp_u64vec1) == 8, "uint64 size isn't 8 bytes on this platform"); - - -static_assert(sizeof(glm::lowp_u8vec2) == 2, "uint8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::mediump_u8vec2) == 2, "uint8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::highp_u8vec2) == 2, "uint8 size isn't 1 byte on this platform"); - -static_assert(sizeof(glm::lowp_u16vec2) == 4, "uint16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::mediump_u16vec2) == 4, "uint16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::highp_u16vec2) == 4, "uint16 size isn't 2 bytes on this platform"); - -static_assert(sizeof(glm::lowp_u32vec2) == 8, "uint32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::mediump_u32vec2) == 8, "uint32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::highp_u32vec2) == 8, "uint32 size isn't 4 bytes on this platform"); - -static_assert(sizeof(glm::lowp_u64vec2) == 16, "uint64 size isn't 8 bytes on this platform"); -static_assert(sizeof(glm::mediump_u64vec2) == 16, "uint64 size isn't 8 bytes on this platform"); -static_assert(sizeof(glm::highp_u64vec2) == 16, "uint64 size isn't 8 bytes on this platform"); - - -static_assert(sizeof(glm::lowp_u8vec3) == 3, "uint8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::mediump_u8vec3) == 3, "uint8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::highp_u8vec3) == 3, "uint8 size isn't 1 byte on this platform"); - -static_assert(sizeof(glm::lowp_u16vec3) == 6, "uint16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::mediump_u16vec3) == 6, "uint16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::highp_u16vec3) == 6, "uint16 size isn't 2 bytes on this platform"); - -static_assert(sizeof(glm::lowp_u32vec3) == 12, "uint32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::mediump_u32vec3) == 12, "uint32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::highp_u32vec3) == 12, "uint32 size isn't 4 bytes on this platform"); - -static_assert(sizeof(glm::lowp_u64vec3) == 24, "uint64 size isn't 8 bytes on this platform"); -static_assert(sizeof(glm::mediump_u64vec3) == 24, "uint64 size isn't 8 bytes on this platform"); -static_assert(sizeof(glm::highp_u64vec3) == 24, "uint64 size isn't 8 bytes on this platform"); - - -static_assert(sizeof(glm::lowp_u8vec4) == 4, "uint8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::mediump_u8vec4) == 4, "uint8 size isn't 1 byte on this platform"); -static_assert(sizeof(glm::highp_u8vec4) == 4, "uint8 size isn't 1 byte on this platform"); - -static_assert(sizeof(glm::lowp_u16vec4) == 8, "uint16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::mediump_u16vec4) == 8, "uint16 size isn't 2 bytes on this platform"); -static_assert(sizeof(glm::highp_u16vec4) == 8, "uint16 size isn't 2 bytes on this platform"); - -static_assert(sizeof(glm::lowp_u32vec4) == 16, "uint32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::mediump_u32vec4) == 16, "uint32 size isn't 4 bytes on this platform"); -static_assert(sizeof(glm::highp_u32vec4) == 16, "uint32 size isn't 4 bytes on this platform"); - -static_assert(sizeof(glm::lowp_u64vec4) == 32, "uint64 size isn't 8 bytes on this platform"); -static_assert(sizeof(glm::mediump_u64vec4) == 32, "uint64 size isn't 8 bytes on this platform"); -static_assert(sizeof(glm::highp_u64vec4) == 32, "uint64 size isn't 8 bytes on this platform"); - -#endif - -static int test_scalar_size() -{ - int Error = 0; - - Error += sizeof(glm::int8) != 1; - Error += sizeof(glm::int16) != 2; - Error += sizeof(glm::int32) != 4; - Error += sizeof(glm::int64) != 8; - Error += sizeof(glm::uint8) != 1; - Error += sizeof(glm::uint16) != 2; - Error += sizeof(glm::uint32) != 4; - Error += sizeof(glm::uint64) != 8; - Error += sizeof(glm::float32) != 4; - Error += sizeof(glm::float64) != 8; - - Error += sizeof(glm::lowp_int8) != 1; - Error += sizeof(glm::lowp_int16) != 2; - Error += sizeof(glm::lowp_int32) != 4; - Error += sizeof(glm::lowp_int64) != 8; - Error += sizeof(glm::lowp_uint8) != 1; - Error += sizeof(glm::lowp_uint16) != 2; - Error += sizeof(glm::lowp_uint32) != 4; - Error += sizeof(glm::lowp_uint64) != 8; - Error += sizeof(glm::lowp_float32) != 4; - Error += sizeof(glm::lowp_float64) != 8; - - Error += sizeof(glm::mediump_int8) != 1; - Error += sizeof(glm::mediump_int16) != 2; - Error += sizeof(glm::mediump_int32) != 4; - Error += sizeof(glm::mediump_int64) != 8; - Error += sizeof(glm::mediump_uint8) != 1; - Error += sizeof(glm::mediump_uint16) != 2; - Error += sizeof(glm::mediump_uint32) != 4; - Error += sizeof(glm::mediump_uint64) != 8; - Error += sizeof(glm::mediump_float32) != 4; - Error += sizeof(glm::mediump_float64) != 8; - - Error += sizeof(glm::highp_int8) != 1; - Error += sizeof(glm::highp_int16) != 2; - Error += sizeof(glm::highp_int32) != 4; - Error += sizeof(glm::highp_int64) != 8; - Error += sizeof(glm::highp_uint8) != 1; - Error += sizeof(glm::highp_uint16) != 2; - Error += sizeof(glm::highp_uint32) != 4; - Error += sizeof(glm::highp_uint64) != 8; - Error += sizeof(glm::highp_float32) != 4; - Error += sizeof(glm::highp_float64) != 8; - - return Error; -} - -static int test_fvec_size() -{ - int Error = 0; - - Error += sizeof(glm::f32vec2) != 8; - Error += sizeof(glm::f32vec3) != 12; - Error += sizeof(glm::f32vec4) != 16; - Error += sizeof(glm::f64vec2) != 16; - Error += sizeof(glm::f64vec3) != 24; - Error += sizeof(glm::f64vec4) != 32; - - Error += sizeof(glm::lowp_f32vec2) != 8; - Error += sizeof(glm::lowp_f32vec3) != 12; - Error += sizeof(glm::lowp_f32vec4) != 16; - Error += sizeof(glm::lowp_f64vec2) != 16; - Error += sizeof(glm::lowp_f64vec3) != 24; - Error += sizeof(glm::lowp_f64vec4) != 32; - - Error += sizeof(glm::mediump_f32vec2) != 8; - Error += sizeof(glm::mediump_f32vec3) != 12; - Error += sizeof(glm::mediump_f32vec4) != 16; - Error += sizeof(glm::mediump_f64vec2) != 16; - Error += sizeof(glm::mediump_f64vec3) != 24; - Error += sizeof(glm::mediump_f64vec4) != 32; - - Error += sizeof(glm::highp_f32vec2) != 8; - Error += sizeof(glm::highp_f32vec3) != 12; - Error += sizeof(glm::highp_f32vec4) != 16; - Error += sizeof(glm::highp_f64vec2) != 16; - Error += sizeof(glm::highp_f64vec3) != 24; - Error += sizeof(glm::highp_f64vec4) != 32; - - return Error; -} - -static int test_fvec_precision() -{ - int Error = 0; - - { - glm::f32vec2 v1(1.f); - glm::lowp_f32vec2 v2(v1); - glm::mediump_f32vec2 v3(v1); - glm::highp_f32vec2 v4(v1); - - Error += glm::all(glm::equal(v1, glm::f32vec2(v2), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::f32vec2(v3), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::f32vec2(v4), glm::epsilon())) ? 0 : 1; - } - - { - glm::f32vec3 v1(1.f); - glm::lowp_f32vec3 v2(v1); - glm::mediump_f32vec3 v3(v1); - glm::highp_f32vec3 v4(v1); - - Error += glm::all(glm::equal(v1, glm::f32vec3(v2), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::f32vec3(v3), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::f32vec3(v4), glm::epsilon())) ? 0 : 1; - } - - { - glm::f32vec4 v1(1.f); - glm::lowp_f32vec4 v2(v1); - glm::mediump_f32vec4 v3(v1); - glm::highp_f32vec4 v4(v1); - - Error += glm::all(glm::equal(v1, glm::f32vec4(v2), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::f32vec4(v3), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::f32vec4(v4), glm::epsilon())) ? 0 : 1; - } - - return Error; -} - -static int test_dvec_precision() -{ - int Error = 0; - - { - glm::f64vec2 v1(1.0); - glm::lowp_f64vec2 v2(v1); - glm::mediump_f64vec2 v3(v1); - glm::highp_f64vec2 v4(v1); - - Error += glm::all(glm::equal(v1, glm::f64vec2(v2), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::f64vec2(v3), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::f64vec2(v4), glm::epsilon())) ? 0 : 1; - } - - { - glm::f64vec3 v1(1.0); - glm::lowp_f64vec3 v2(v1); - glm::mediump_f64vec3 v3(v1); - glm::highp_f64vec3 v4(v1); - - Error += glm::all(glm::equal(v1, glm::f64vec3(v2), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::f64vec3(v3), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::f64vec3(v4), glm::epsilon())) ? 0 : 1; - } - - { - glm::f64vec4 v1(1.0); - glm::lowp_f64vec4 v2(v1); - glm::mediump_f64vec4 v3(v1); - glm::highp_f64vec4 v4(v1); - - Error += glm::all(glm::equal(v1, glm::f64vec4(v2), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::f64vec4(v3), glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::f64vec4(v4), glm::epsilon())) ? 0 : 1; - } - - return Error; -} - -static int test_ivec_size() -{ - int Error = 0; - - Error += sizeof(glm::i8vec2) != 2; - Error += sizeof(glm::i8vec3) != 3; - Error += sizeof(glm::i8vec4) != 4; - Error += sizeof(glm::i16vec2) != 4; - Error += sizeof(glm::i16vec3) != 6; - Error += sizeof(glm::i16vec4) != 8; - Error += sizeof(glm::i32vec2) != 8; - Error += sizeof(glm::i32vec3) != 12; - Error += sizeof(glm::i32vec4) != 16; - Error += sizeof(glm::i64vec2) != 16; - Error += sizeof(glm::i64vec3) != 24; - Error += sizeof(glm::i64vec4) != 32; - - Error += sizeof(glm::lowp_i8vec2) != 2; - Error += sizeof(glm::lowp_i8vec3) != 3; - Error += sizeof(glm::lowp_i8vec4) != 4; - Error += sizeof(glm::lowp_i16vec2) != 4; - Error += sizeof(glm::lowp_i16vec3) != 6; - Error += sizeof(glm::lowp_i16vec4) != 8; - Error += sizeof(glm::lowp_i32vec2) != 8; - Error += sizeof(glm::lowp_i32vec3) != 12; - Error += sizeof(glm::lowp_i32vec4) != 16; - Error += sizeof(glm::lowp_i64vec2) != 16; - Error += sizeof(glm::lowp_i64vec3) != 24; - Error += sizeof(glm::lowp_i64vec4) != 32; - - Error += sizeof(glm::mediump_i8vec2) != 2; - Error += sizeof(glm::mediump_i8vec3) != 3; - Error += sizeof(glm::mediump_i8vec4) != 4; - Error += sizeof(glm::mediump_i16vec2) != 4; - Error += sizeof(glm::mediump_i16vec3) != 6; - Error += sizeof(glm::mediump_i16vec4) != 8; - Error += sizeof(glm::mediump_i32vec2) != 8; - Error += sizeof(glm::mediump_i32vec3) != 12; - Error += sizeof(glm::mediump_i32vec4) != 16; - Error += sizeof(glm::mediump_i64vec2) != 16; - Error += sizeof(glm::mediump_i64vec3) != 24; - Error += sizeof(glm::mediump_i64vec4) != 32; - - Error += sizeof(glm::highp_i8vec2) != 2; - Error += sizeof(glm::highp_i8vec3) != 3; - Error += sizeof(glm::highp_i8vec4) != 4; - Error += sizeof(glm::highp_i16vec2) != 4; - Error += sizeof(glm::highp_i16vec3) != 6; - Error += sizeof(glm::highp_i16vec4) != 8; - Error += sizeof(glm::highp_i32vec2) != 8; - Error += sizeof(glm::highp_i32vec3) != 12; - Error += sizeof(glm::highp_i32vec4) != 16; - Error += sizeof(glm::highp_i64vec2) != 16; - Error += sizeof(glm::highp_i64vec3) != 24; - Error += sizeof(glm::highp_i64vec4) != 32; - - return Error; -} - -static int test_ivec_precision() -{ - int Error = 0; - - { - glm::i8vec2 v1(0); - glm::lowp_i8vec2 v2(v1); - glm::mediump_i8vec2 v3(v1); - glm::highp_i8vec2 v4(v1); - - Error += glm::all(glm::equal(v1, glm::i8vec2(v2))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::i8vec2(v3))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::i8vec2(v4))) ? 0 : 1; - } - - { - glm::i8vec3 v1(0); - glm::lowp_i8vec3 v2(v1); - glm::mediump_i8vec3 v3(v1); - glm::highp_i8vec3 v4(v1); - - Error += glm::all(glm::equal(v1, glm::i8vec3(v2))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::i8vec3(v3))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::i8vec3(v4))) ? 0 : 1; - } - - { - glm::i8vec4 v1(0); - glm::lowp_i8vec4 v2(v1); - glm::mediump_i8vec4 v3(v1); - glm::highp_i8vec4 v4(v1); - - Error += glm::all(glm::equal(v1, glm::i8vec4(v2))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::i8vec4(v3))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::i8vec4(v4))) ? 0 : 1; - } - - { - glm::i16vec2 v1(0); - glm::lowp_i16vec2 v2(v1); - glm::mediump_i16vec2 v3(v1); - glm::highp_i16vec2 v4(v1); - - Error += glm::all(glm::equal(v1, glm::i16vec2(v2))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::i16vec2(v3))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::i16vec2(v4))) ? 0 : 1; - } - - { - glm::i16vec3 v1(0); - glm::lowp_i16vec3 v2(v1); - glm::mediump_i16vec3 v3(v1); - glm::highp_i16vec3 v4(v1); - - Error += glm::all(glm::equal(v1, glm::i16vec3(v2))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::i16vec3(v3))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::i16vec3(v4))) ? 0 : 1; - } - - { - glm::i16vec4 v1(0); - glm::lowp_i16vec4 v2(v1); - glm::mediump_i16vec4 v3(v1); - glm::highp_i16vec4 v4(v1); - - Error += glm::all(glm::equal(v1, glm::i16vec4(v2))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::i16vec4(v3))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::i16vec4(v4))) ? 0 : 1; - } - - { - glm::i32vec2 v1(0); - glm::lowp_i32vec2 v2(v1); - glm::mediump_i32vec2 v3(v1); - glm::highp_i32vec2 v4(v1); - - Error += glm::all(glm::equal(v1, glm::i32vec2(v2))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::i32vec2(v3))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::i32vec2(v4))) ? 0 : 1; - } - - { - glm::i32vec3 v1(0); - glm::lowp_i32vec3 v2(v1); - glm::mediump_i32vec3 v3(v1); - glm::highp_i32vec3 v4(v1); - - Error += glm::all(glm::equal(v1, glm::i32vec3(v2))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::i32vec3(v3))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::i32vec3(v4))) ? 0 : 1; - } - - { - glm::i32vec4 v1(0); - glm::lowp_i32vec4 v2(v1); - glm::mediump_i32vec4 v3(v1); - glm::highp_i32vec4 v4(v1); - - Error += glm::all(glm::equal(v1, glm::i32vec4(v2))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::i32vec4(v3))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::i32vec4(v4))) ? 0 : 1; - } - - { - glm::i64vec2 v1(0); - glm::lowp_i64vec2 v2(v1); - glm::mediump_i64vec2 v3(v1); - glm::highp_i64vec2 v4(v1); - - Error += glm::all(glm::equal(v1, glm::i64vec2(v2))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::i64vec2(v3))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::i64vec2(v4))) ? 0 : 1; - } - - { - glm::i64vec3 v1(0); - glm::lowp_i64vec3 v2(v1); - glm::mediump_i64vec3 v3(v1); - glm::highp_i64vec3 v4(v1); - - Error += glm::all(glm::equal(v1, glm::i64vec3(v2))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::i64vec3(v3))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::i64vec3(v4))) ? 0 : 1; - } - - { - glm::i64vec4 v1(0); - glm::lowp_i64vec4 v2(v1); - glm::mediump_i64vec4 v3(v1); - glm::highp_i64vec4 v4(v1); - - Error += glm::all(glm::equal(v1, glm::i64vec4(v2))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::i64vec4(v3))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::i64vec4(v4))) ? 0 : 1; - } - - return Error; -} - -static int test_uvec_size() -{ - int Error = 0; - - Error += sizeof(glm::u8vec2) != 2; - Error += sizeof(glm::u8vec3) != 3; - Error += sizeof(glm::u8vec4) != 4; - Error += sizeof(glm::u16vec2) != 4; - Error += sizeof(glm::u16vec3) != 6; - Error += sizeof(glm::u16vec4) != 8; - Error += sizeof(glm::u32vec2) != 8; - Error += sizeof(glm::u32vec3) != 12; - Error += sizeof(glm::u32vec4) != 16; - Error += sizeof(glm::u64vec2) != 16; - Error += sizeof(glm::u64vec3) != 24; - Error += sizeof(glm::u64vec4) != 32; - - Error += sizeof(glm::lowp_u8vec2) != 2; - Error += sizeof(glm::lowp_u8vec3) != 3; - Error += sizeof(glm::lowp_u8vec4) != 4; - Error += sizeof(glm::lowp_u16vec2) != 4; - Error += sizeof(glm::lowp_u16vec3) != 6; - Error += sizeof(glm::lowp_u16vec4) != 8; - Error += sizeof(glm::lowp_u32vec2) != 8; - Error += sizeof(glm::lowp_u32vec3) != 12; - Error += sizeof(glm::lowp_u32vec4) != 16; - Error += sizeof(glm::lowp_u64vec2) != 16; - Error += sizeof(glm::lowp_u64vec3) != 24; - Error += sizeof(glm::lowp_u64vec4) != 32; - - Error += sizeof(glm::mediump_u8vec2) != 2; - Error += sizeof(glm::mediump_u8vec3) != 3; - Error += sizeof(glm::mediump_u8vec4) != 4; - Error += sizeof(glm::mediump_u16vec2) != 4; - Error += sizeof(glm::mediump_u16vec3) != 6; - Error += sizeof(glm::mediump_u16vec4) != 8; - Error += sizeof(glm::mediump_u32vec2) != 8; - Error += sizeof(glm::mediump_u32vec3) != 12; - Error += sizeof(glm::mediump_u32vec4) != 16; - Error += sizeof(glm::mediump_u64vec2) != 16; - Error += sizeof(glm::mediump_u64vec3) != 24; - Error += sizeof(glm::mediump_u64vec4) != 32; - - Error += sizeof(glm::highp_u8vec2) != 2; - Error += sizeof(glm::highp_u8vec3) != 3; - Error += sizeof(glm::highp_u8vec4) != 4; - Error += sizeof(glm::highp_u16vec2) != 4; - Error += sizeof(glm::highp_u16vec3) != 6; - Error += sizeof(glm::highp_u16vec4) != 8; - Error += sizeof(glm::highp_u32vec2) != 8; - Error += sizeof(glm::highp_u32vec3) != 12; - Error += sizeof(glm::highp_u32vec4) != 16; - Error += sizeof(glm::highp_u64vec2) != 16; - Error += sizeof(glm::highp_u64vec3) != 24; - Error += sizeof(glm::highp_u64vec4) != 32; - - return Error; -} - -static int test_uvec_precision() -{ - int Error = 0; - - { - glm::u8vec2 v1(0); - glm::lowp_u8vec2 v2(v1); - glm::mediump_u8vec2 v3(v1); - glm::highp_u8vec2 v4(v1); - - Error += glm::all(glm::equal(v1, glm::u8vec2(v2))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::u8vec2(v3))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::u8vec2(v4))) ? 0 : 1; - } - - { - glm::u8vec3 v1(0); - glm::lowp_u8vec3 v2(v1); - glm::mediump_u8vec3 v3(v1); - glm::highp_u8vec3 v4(v1); - - Error += glm::all(glm::equal(v1, glm::u8vec3(v2))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::u8vec3(v3))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::u8vec3(v4))) ? 0 : 1; - } - - { - glm::u8vec4 v1(0); - glm::lowp_u8vec4 v2(v1); - glm::mediump_u8vec4 v3(v1); - glm::highp_u8vec4 v4(v1); - - Error += glm::all(glm::equal(v1, glm::u8vec4(v2))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::u8vec4(v3))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::u8vec4(v4))) ? 0 : 1; - } - - { - glm::u16vec2 v1(0); - glm::lowp_u16vec2 v2(v1); - glm::mediump_u16vec2 v3(v1); - glm::highp_u16vec2 v4(v1); - - Error += glm::all(glm::equal(v1, glm::u16vec2(v2))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::u16vec2(v3))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::u16vec2(v4))) ? 0 : 1; - } - - { - glm::u16vec3 v1(0); - glm::lowp_u16vec3 v2(v1); - glm::mediump_u16vec3 v3(v1); - glm::highp_u16vec3 v4(v1); - - Error += glm::all(glm::equal(v1, glm::u16vec3(v2))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::u16vec3(v3))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::u16vec3(v4))) ? 0 : 1; - } - - { - glm::u16vec4 v1(0); - glm::lowp_u16vec4 v2(v1); - glm::mediump_u16vec4 v3(v1); - glm::highp_u16vec4 v4(v1); - - Error += glm::all(glm::equal(v1, glm::u16vec4(v2))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::u16vec4(v3))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::u16vec4(v4))) ? 0 : 1; - } - - { - glm::u32vec2 v1(0); - glm::lowp_u32vec2 v2(v1); - glm::mediump_u32vec2 v3(v1); - glm::highp_u32vec2 v4(v1); - - Error += glm::all(glm::equal(v1, glm::u32vec2(v2))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::u32vec2(v3))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::u32vec2(v4))) ? 0 : 1; - } - - { - glm::u32vec3 v1(0); - glm::lowp_u32vec3 v2(v1); - glm::mediump_u32vec3 v3(v1); - glm::highp_u32vec3 v4(v1); - - Error += glm::all(glm::equal(v1, glm::u32vec3(v2))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::u32vec3(v3))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::u32vec3(v4))) ? 0 : 1; - } - - { - glm::u32vec4 v1(0); - glm::lowp_u32vec4 v2(v1); - glm::mediump_u32vec4 v3(v1); - glm::highp_u32vec4 v4(v1); - - Error += glm::all(glm::equal(v1, glm::u32vec4(v2))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::u32vec4(v3))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::u32vec4(v4))) ? 0 : 1; - } - - { - glm::u64vec2 v1(0); - glm::lowp_u64vec2 v2(v1); - glm::mediump_u64vec2 v3(v1); - glm::highp_u64vec2 v4(v1); - - Error += glm::all(glm::equal(v1, glm::u64vec2(v2))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::u64vec2(v3))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::u64vec2(v4))) ? 0 : 1; - } - - { - glm::u64vec3 v1(0); - glm::lowp_u64vec3 v2(v1); - glm::mediump_u64vec3 v3(v1); - glm::highp_u64vec3 v4(v1); - - Error += glm::all(glm::equal(v1, glm::u64vec3(v2))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::u64vec3(v3))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::u64vec3(v4))) ? 0 : 1; - } - - { - glm::u64vec4 v1(0); - glm::lowp_u64vec4 v2(v1); - glm::mediump_u64vec4 v3(v1); - glm::highp_u64vec4 v4(v1); - - Error += glm::all(glm::equal(v1, glm::u64vec4(v2))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::u64vec4(v3))) ? 0 : 1; - Error += glm::all(glm::equal(v1, glm::u64vec4(v4))) ? 0 : 1; - } - - return Error; -} - -static int test_fmat_size() -{ - int Error = 0; - - Error += sizeof(glm::mat2) != 16; - Error += sizeof(glm::mat3) != 36; - Error += sizeof(glm::mat4) != 64; - Error += sizeof(glm::mat2x2) != 16; - Error += sizeof(glm::mat2x3) != 24; - Error += sizeof(glm::mat2x4) != 32; - Error += sizeof(glm::mat3x2) != 24; - Error += sizeof(glm::mat3x3) != 36; - Error += sizeof(glm::mat3x4) != 48; - Error += sizeof(glm::mat4x2) != 32; - Error += sizeof(glm::mat4x3) != 48; - Error += sizeof(glm::mat4x4) != 64; - - Error += sizeof(glm::fmat2) != 16; - Error += sizeof(glm::fmat3) != 36; - Error += sizeof(glm::fmat4) != 64; - Error += sizeof(glm::fmat2x2) != 16; - Error += sizeof(glm::fmat2x3) != 24; - Error += sizeof(glm::fmat2x4) != 32; - Error += sizeof(glm::fmat3x2) != 24; - Error += sizeof(glm::fmat3x3) != 36; - Error += sizeof(glm::fmat3x4) != 48; - Error += sizeof(glm::fmat4x2) != 32; - Error += sizeof(glm::fmat4x3) != 48; - Error += sizeof(glm::fmat4x4) != 64; - - Error += sizeof(glm::f32mat2) != 16; - Error += sizeof(glm::f32mat3) != 36; - Error += sizeof(glm::f32mat4) != 64; - Error += sizeof(glm::f32mat2x2) != 16; - Error += sizeof(glm::f32mat2x3) != 24; - Error += sizeof(glm::f32mat2x4) != 32; - Error += sizeof(glm::f32mat3x2) != 24; - Error += sizeof(glm::f32mat3x3) != 36; - Error += sizeof(glm::f32mat3x4) != 48; - Error += sizeof(glm::f32mat4x2) != 32; - Error += sizeof(glm::f32mat4x3) != 48; - Error += sizeof(glm::f32mat4x4) != 64; - - - Error += sizeof(glm::lowp_mat2) != 16; - Error += sizeof(glm::lowp_mat3) != 36; - Error += sizeof(glm::lowp_mat4) != 64; - Error += sizeof(glm::lowp_mat2x2) != 16; - Error += sizeof(glm::lowp_mat2x3) != 24; - Error += sizeof(glm::lowp_mat2x4) != 32; - Error += sizeof(glm::lowp_mat3x2) != 24; - Error += sizeof(glm::lowp_mat3x3) != 36; - Error += sizeof(glm::lowp_mat3x4) != 48; - Error += sizeof(glm::lowp_mat4x2) != 32; - Error += sizeof(glm::lowp_mat4x3) != 48; - Error += sizeof(glm::lowp_mat4x4) != 64; - - Error += sizeof(glm::lowp_fmat2) != 16; - Error += sizeof(glm::lowp_fmat3) != 36; - Error += sizeof(glm::lowp_fmat4) != 64; - Error += sizeof(glm::lowp_fmat2x2) != 16; - Error += sizeof(glm::lowp_fmat2x3) != 24; - Error += sizeof(glm::lowp_fmat2x4) != 32; - Error += sizeof(glm::lowp_fmat3x2) != 24; - Error += sizeof(glm::lowp_fmat3x3) != 36; - Error += sizeof(glm::lowp_fmat3x4) != 48; - Error += sizeof(glm::lowp_fmat4x2) != 32; - Error += sizeof(glm::lowp_fmat4x3) != 48; - Error += sizeof(glm::lowp_fmat4x4) != 64; - - Error += sizeof(glm::lowp_f32mat2) != 16; - Error += sizeof(glm::lowp_f32mat3) != 36; - Error += sizeof(glm::lowp_f32mat4) != 64; - Error += sizeof(glm::lowp_f32mat2x2) != 16; - Error += sizeof(glm::lowp_f32mat2x3) != 24; - Error += sizeof(glm::lowp_f32mat2x4) != 32; - Error += sizeof(glm::lowp_f32mat3x2) != 24; - Error += sizeof(glm::lowp_f32mat3x3) != 36; - Error += sizeof(glm::lowp_f32mat3x4) != 48; - Error += sizeof(glm::lowp_f32mat4x2) != 32; - Error += sizeof(glm::lowp_f32mat4x3) != 48; - Error += sizeof(glm::lowp_f32mat4x4) != 64; - - Error += sizeof(glm::mediump_mat2) != 16; - Error += sizeof(glm::mediump_mat3) != 36; - Error += sizeof(glm::mediump_mat4) != 64; - Error += sizeof(glm::mediump_mat2x2) != 16; - Error += sizeof(glm::mediump_mat2x3) != 24; - Error += sizeof(glm::mediump_mat2x4) != 32; - Error += sizeof(glm::mediump_mat3x2) != 24; - Error += sizeof(glm::mediump_mat3x3) != 36; - Error += sizeof(glm::mediump_mat3x4) != 48; - Error += sizeof(glm::mediump_mat4x2) != 32; - Error += sizeof(glm::mediump_mat4x3) != 48; - Error += sizeof(glm::mediump_mat4x4) != 64; - - Error += sizeof(glm::mediump_fmat2) != 16; - Error += sizeof(glm::mediump_fmat3) != 36; - Error += sizeof(glm::mediump_fmat4) != 64; - Error += sizeof(glm::mediump_fmat2x2) != 16; - Error += sizeof(glm::mediump_fmat2x3) != 24; - Error += sizeof(glm::mediump_fmat2x4) != 32; - Error += sizeof(glm::mediump_fmat3x2) != 24; - Error += sizeof(glm::mediump_fmat3x3) != 36; - Error += sizeof(glm::mediump_fmat3x4) != 48; - Error += sizeof(glm::mediump_fmat4x2) != 32; - Error += sizeof(glm::mediump_fmat4x3) != 48; - Error += sizeof(glm::mediump_fmat4x4) != 64; - - Error += sizeof(glm::mediump_f32mat2) != 16; - Error += sizeof(glm::mediump_f32mat3) != 36; - Error += sizeof(glm::mediump_f32mat4) != 64; - Error += sizeof(glm::mediump_f32mat2x2) != 16; - Error += sizeof(glm::mediump_f32mat2x3) != 24; - Error += sizeof(glm::mediump_f32mat2x4) != 32; - Error += sizeof(glm::mediump_f32mat3x2) != 24; - Error += sizeof(glm::mediump_f32mat3x3) != 36; - Error += sizeof(glm::mediump_f32mat3x4) != 48; - Error += sizeof(glm::mediump_f32mat4x2) != 32; - Error += sizeof(glm::mediump_f32mat4x3) != 48; - Error += sizeof(glm::mediump_f32mat4x4) != 64; - - Error += sizeof(glm::highp_mat2) != 16; - Error += sizeof(glm::highp_mat3) != 36; - Error += sizeof(glm::highp_mat4) != 64; - Error += sizeof(glm::highp_mat2x2) != 16; - Error += sizeof(glm::highp_mat2x3) != 24; - Error += sizeof(glm::highp_mat2x4) != 32; - Error += sizeof(glm::highp_mat3x2) != 24; - Error += sizeof(glm::highp_mat3x3) != 36; - Error += sizeof(glm::highp_mat3x4) != 48; - Error += sizeof(glm::highp_mat4x2) != 32; - Error += sizeof(glm::highp_mat4x3) != 48; - Error += sizeof(glm::highp_mat4x4) != 64; - - Error += sizeof(glm::highp_fmat2) != 16; - Error += sizeof(glm::highp_fmat3) != 36; - Error += sizeof(glm::highp_fmat4) != 64; - Error += sizeof(glm::highp_fmat2x2) != 16; - Error += sizeof(glm::highp_fmat2x3) != 24; - Error += sizeof(glm::highp_fmat2x4) != 32; - Error += sizeof(glm::highp_fmat3x2) != 24; - Error += sizeof(glm::highp_fmat3x3) != 36; - Error += sizeof(glm::highp_fmat3x4) != 48; - Error += sizeof(glm::highp_fmat4x2) != 32; - Error += sizeof(glm::highp_fmat4x3) != 48; - Error += sizeof(glm::highp_fmat4x4) != 64; - - Error += sizeof(glm::highp_f32mat2) != 16; - Error += sizeof(glm::highp_f32mat3) != 36; - Error += sizeof(glm::highp_f32mat4) != 64; - Error += sizeof(glm::highp_f32mat2x2) != 16; - Error += sizeof(glm::highp_f32mat2x3) != 24; - Error += sizeof(glm::highp_f32mat2x4) != 32; - Error += sizeof(glm::highp_f32mat3x2) != 24; - Error += sizeof(glm::highp_f32mat3x3) != 36; - Error += sizeof(glm::highp_f32mat3x4) != 48; - Error += sizeof(glm::highp_f32mat4x2) != 32; - Error += sizeof(glm::highp_f32mat4x3) != 48; - Error += sizeof(glm::highp_f32mat4x4) != 64; - - return Error; -} - -static int test_dmat_size() -{ - int Error = 0; - - Error += sizeof(glm::f64mat2) != 32; - Error += sizeof(glm::f64mat3) != 72; - Error += sizeof(glm::f64mat4) != 128; - Error += sizeof(glm::f64mat2x2) != 32; - Error += sizeof(glm::f64mat2x3) != 48; - Error += sizeof(glm::f64mat2x4) != 64; - Error += sizeof(glm::f64mat3x2) != 48; - Error += sizeof(glm::f64mat3x3) != 72; - Error += sizeof(glm::f64mat3x4) != 96; - Error += sizeof(glm::f64mat4x2) != 64; - Error += sizeof(glm::f64mat4x3) != 96; - Error += sizeof(glm::f64mat4x4) != 128; - - Error += sizeof(glm::lowp_f64mat2) != 32; - Error += sizeof(glm::lowp_f64mat3) != 72; - Error += sizeof(glm::lowp_f64mat4) != 128; - Error += sizeof(glm::lowp_f64mat2x2) != 32; - Error += sizeof(glm::lowp_f64mat2x3) != 48; - Error += sizeof(glm::lowp_f64mat2x4) != 64; - Error += sizeof(glm::lowp_f64mat3x2) != 48; - Error += sizeof(glm::lowp_f64mat3x3) != 72; - Error += sizeof(glm::lowp_f64mat3x4) != 96; - Error += sizeof(glm::lowp_f64mat4x2) != 64; - Error += sizeof(glm::lowp_f64mat4x3) != 96; - Error += sizeof(glm::lowp_f64mat4x4) != 128; - - Error += sizeof(glm::mediump_f64mat2) != 32; - Error += sizeof(glm::mediump_f64mat3) != 72; - Error += sizeof(glm::mediump_f64mat4) != 128; - Error += sizeof(glm::mediump_f64mat2x2) != 32; - Error += sizeof(glm::mediump_f64mat2x3) != 48; - Error += sizeof(glm::mediump_f64mat2x4) != 64; - Error += sizeof(glm::mediump_f64mat3x2) != 48; - Error += sizeof(glm::mediump_f64mat3x3) != 72; - Error += sizeof(glm::mediump_f64mat3x4) != 96; - Error += sizeof(glm::mediump_f64mat4x2) != 64; - Error += sizeof(glm::mediump_f64mat4x3) != 96; - Error += sizeof(glm::mediump_f64mat4x4) != 128; - - Error += sizeof(glm::highp_f64mat2) != 32; - Error += sizeof(glm::highp_f64mat3) != 72; - Error += sizeof(glm::highp_f64mat4) != 128; - Error += sizeof(glm::highp_f64mat2x2) != 32; - Error += sizeof(glm::highp_f64mat2x3) != 48; - Error += sizeof(glm::highp_f64mat2x4) != 64; - Error += sizeof(glm::highp_f64mat3x2) != 48; - Error += sizeof(glm::highp_f64mat3x3) != 72; - Error += sizeof(glm::highp_f64mat3x4) != 96; - Error += sizeof(glm::highp_f64mat4x2) != 64; - Error += sizeof(glm::highp_f64mat4x3) != 96; - Error += sizeof(glm::highp_f64mat4x4) != 128; - - return Error; -} - -static int test_quat_size() -{ - int Error = 0; - - Error += sizeof(glm::f32quat) != 16; - Error += sizeof(glm::f64quat) != 32; - - Error += sizeof(glm::lowp_f32quat) != 16; - Error += sizeof(glm::lowp_f64quat) != 32; - - Error += sizeof(glm::mediump_f32quat) != 16; - Error += sizeof(glm::mediump_f64quat) != 32; - - Error += sizeof(glm::highp_f32quat) != 16; - Error += sizeof(glm::highp_f64quat) != 32; - - return Error; -} - -static int test_quat_precision() -{ - int Error = 0; - - { - glm::f32quat q1(0.f, glm::vec3(0.f, 0.f, 1.f)); - glm::lowp_f32quat qA(q1); - glm::mediump_f32quat qB(q1); - glm::highp_f32quat qC(q1); - glm::f32quat q2(qA); - glm::f32quat q3(qB); - glm::f32quat q4(qC); - - Error += glm::all(glm::equal(q1, q2, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(q1, q3, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(q1, q4, glm::epsilon())) ? 0 : 1; - } - - return Error; -} - -static int test_fvec_conversion() -{ - int Error(0); - - { - glm::highp_vec4 a = glm::vec4(1, 2, 3, 4); - glm::mediump_vec4 b = glm::vec4(1, 2, 3, 4); - glm::lowp_vec4 c = b; - glm::mediump_vec4 d = c; - glm::lowp_ivec4 e = glm::ivec4(d); - glm::lowp_ivec3 f = glm::ivec3(e); - - Error += glm::all(glm::equal(b, d, glm::epsilon())) ? 0 : 1; - } - - return Error; -} - -#if GLM_HAS_OPENMP -static int test_openmp() -{ - std::vector VectorA(1000); - std::vector VectorB(1000); - std::vector VectorC(1000); - - for (std::size_t i = 0; i < VectorA.size(); ++i) - { - VectorA[i] = glm::u8vec3(1, 1, 1); - VectorB[i] = glm::u8vec3(1, 1, 1); - } - - #pragma omp parallel for default(none) shared(VectorA, VectorB, VectorC) - for (int i = 0; i < static_cast(VectorC.size()); ++i) - { - VectorC[i] = VectorA[i] + VectorB[i]; - } - - return 0; -} -#endif//GLM_HAS_OPENMP - -int main() -{ - int Error = 0; - - Error += test_scalar_size(); - Error += test_fvec_size(); - - Error += test_fvec_precision(); - Error += test_fvec_conversion(); - - Error += test_dvec_precision(); - - Error += test_uvec_size(); - Error += test_uvec_precision(); - Error += test_ivec_size(); - Error += test_ivec_precision(); - - Error += test_fmat_size(); - Error += test_dmat_size(); - Error += test_quat_size(); - Error += test_quat_precision(); - -# if GLM_HAS_OPENMP - Error += test_openmp(); -# endif// - - return Error; -} diff --git a/3rdparty/glm/source/test/gtc/gtc_type_ptr.cpp b/3rdparty/glm/source/test/gtc/gtc_type_ptr.cpp deleted file mode 100644 index 6fcd305..0000000 --- a/3rdparty/glm/source/test/gtc/gtc_type_ptr.cpp +++ /dev/null @@ -1,335 +0,0 @@ -#include -#include -#include -#include - -int test_value_ptr_vec() -{ - int Error = 0; - - { - glm::vec2 v(1.0); - float * p = glm::value_ptr(v); - Error += p == &v[0] ? 0 : 1; - } - { - glm::vec3 v(1.0); - float * p = glm::value_ptr(v); - Error += p == &v[0] ? 0 : 1; - } - { - glm::vec4 v(1.0); - float * p = glm::value_ptr(v); - Error += p == &v[0] ? 0 : 1; - } - - { - glm::dvec2 v(1.0); - double * p = glm::value_ptr(v); - Error += p == &v[0] ? 0 : 1; - } - { - glm::dvec3 v(1.0); - double * p = glm::value_ptr(v); - Error += p == &v[0] ? 0 : 1; - } - { - glm::dvec4 v(1.0); - double * p = glm::value_ptr(v); - Error += p == &v[0] ? 0 : 1; - } - - return Error; -} - -int test_value_ptr_vec_const() -{ - int Error = 0; - - { - glm::vec2 const v(1.0); - float const * p = glm::value_ptr(v); - Error += p == &v[0] ? 0 : 1; - } - { - glm::vec3 const v(1.0); - float const * p = glm::value_ptr(v); - Error += p == &v[0] ? 0 : 1; - } - { - glm::vec4 const v(1.0); - float const * p = glm::value_ptr(v); - Error += p == &v[0] ? 0 : 1; - } - - { - glm::dvec2 const v(1.0); - double const * p = glm::value_ptr(v); - Error += p == &v[0] ? 0 : 1; - } - { - glm::dvec3 const v(1.0); - double const * p = glm::value_ptr(v); - Error += p == &v[0] ? 0 : 1; - } - { - glm::dvec4 const v(1.0); - double const * p = glm::value_ptr(v); - Error += p == &v[0] ? 0 : 1; - } - - return Error; -} - -int test_value_ptr_mat() -{ - int Error = 0; - - { - glm::mat2x2 m(1.0); - float * p = glm::value_ptr(m); - Error += p == &m[0][0] ? 0 : 1; - } - { - glm::mat2x3 m(1.0); - float * p = glm::value_ptr(m); - Error += p == &m[0][0] ? 0 : 1; - } - { - glm::mat2x4 m(1.0); - float * p = glm::value_ptr(m); - Error += p == &m[0][0] ? 0 : 1; - } - { - glm::mat3x2 m(1.0); - float * p = glm::value_ptr(m); - Error += p == &m[0][0] ? 0 : 1; - } - { - glm::mat3x3 m(1.0); - float * p = glm::value_ptr(m); - Error += p == &m[0][0] ? 0 : 1; - } - { - glm::mat3x4 m(1.0); - float * p = glm::value_ptr(m); - Error += p == &m[0][0] ? 0 : 1; - } - { - glm::mat4x2 m(1.0); - float * p = glm::value_ptr(m); - Error += p == &m[0][0] ? 0 : 1; - } - { - glm::mat4x3 m(1.0); - float * p = glm::value_ptr(m); - Error += p == &m[0][0] ? 0 : 1; - } - { - glm::mat4x4 m(1.0); - float * p = glm::value_ptr(m); - Error += p == &m[0][0] ? 0 : 1; - } - - return Error; -} - -int test_value_ptr_mat_const() -{ - int Error = 0; - - { - glm::mat2x2 const m(1.0); - float const * p = glm::value_ptr(m); - Error += p == &m[0][0] ? 0 : 1; - } - { - glm::mat2x3 const m(1.0); - float const * p = glm::value_ptr(m); - Error += p == &m[0][0] ? 0 : 1; - } - { - glm::mat2x4 const m(1.0); - float const * p = glm::value_ptr(m); - Error += p == &m[0][0] ? 0 : 1; - } - { - glm::mat3x2 const m(1.0); - float const * p = glm::value_ptr(m); - Error += p == &m[0][0] ? 0 : 1; - } - { - glm::mat3x3 const m(1.0); - float const * p = glm::value_ptr(m); - Error += p == &m[0][0] ? 0 : 1; - } - { - glm::mat3x4 const m(1.0); - float const * p = glm::value_ptr(m); - Error += p == &m[0][0] ? 0 : 1; - } - { - glm::mat4x2 const m(1.0); - float const * p = glm::value_ptr(m); - Error += p == &m[0][0] ? 0 : 1; - } - { - glm::mat4x3 const m(1.0); - float const * p = glm::value_ptr(m); - Error += p == &m[0][0] ? 0 : 1; - } - { - glm::mat4x4 const m(1.0); - float const * p = glm::value_ptr(m); - Error += p == &m[0][0] ? 0 : 1; - } - - return Error; -} - -int test_make_pointer_mat() -{ - int Error = 0; - - float ArrayA[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; - double ArrayB[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; - - glm::mat2x2 Mat2x2A = glm::make_mat2x2(ArrayA); - glm::mat2x3 Mat2x3A = glm::make_mat2x3(ArrayA); - glm::mat2x4 Mat2x4A = glm::make_mat2x4(ArrayA); - glm::mat3x2 Mat3x2A = glm::make_mat3x2(ArrayA); - glm::mat3x3 Mat3x3A = glm::make_mat3x3(ArrayA); - glm::mat3x4 Mat3x4A = glm::make_mat3x4(ArrayA); - glm::mat4x2 Mat4x2A = glm::make_mat4x2(ArrayA); - glm::mat4x3 Mat4x3A = glm::make_mat4x3(ArrayA); - glm::mat4x4 Mat4x4A = glm::make_mat4x4(ArrayA); - - glm::dmat2x2 Mat2x2B = glm::make_mat2x2(ArrayB); - glm::dmat2x3 Mat2x3B = glm::make_mat2x3(ArrayB); - glm::dmat2x4 Mat2x4B = glm::make_mat2x4(ArrayB); - glm::dmat3x2 Mat3x2B = glm::make_mat3x2(ArrayB); - glm::dmat3x3 Mat3x3B = glm::make_mat3x3(ArrayB); - glm::dmat3x4 Mat3x4B = glm::make_mat3x4(ArrayB); - glm::dmat4x2 Mat4x2B = glm::make_mat4x2(ArrayB); - glm::dmat4x3 Mat4x3B = glm::make_mat4x3(ArrayB); - glm::dmat4x4 Mat4x4B = glm::make_mat4x4(ArrayB); - - return Error; -} - -int test_make_pointer_vec() -{ - int Error = 0; - - float ArrayA[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; - int ArrayB[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; - bool ArrayC[] = {true, false, true, false, true, false, true, false, true, false, true, false, true, false, true, false}; - - glm::vec2 Vec2A = glm::make_vec2(ArrayA); - glm::vec3 Vec3A = glm::make_vec3(ArrayA); - glm::vec4 Vec4A = glm::make_vec4(ArrayA); - - glm::ivec2 Vec2B = glm::make_vec2(ArrayB); - glm::ivec3 Vec3B = glm::make_vec3(ArrayB); - glm::ivec4 Vec4B = glm::make_vec4(ArrayB); - - glm::bvec2 Vec2C = glm::make_vec2(ArrayC); - glm::bvec3 Vec3C = glm::make_vec3(ArrayC); - glm::bvec4 Vec4C = glm::make_vec4(ArrayC); - - return Error; -} - -int test_make_vec1() -{ - int Error = 0; - - glm::ivec1 const v1 = glm::make_vec1(glm::ivec1(2)); - Error += v1 == glm::ivec1(2) ? 0 : 1; - - glm::ivec1 const v2 = glm::make_vec1(glm::ivec2(2)); - Error += v2 == glm::ivec1(2) ? 0 : 1; - - glm::ivec1 const v3 = glm::make_vec1(glm::ivec3(2)); - Error += v3 == glm::ivec1(2) ? 0 : 1; - - glm::ivec1 const v4 = glm::make_vec1(glm::ivec4(2)); - Error += v3 == glm::ivec1(2) ? 0 : 1; - - return Error; -} - -int test_make_vec2() -{ - int Error = 0; - - glm::ivec2 const v1 = glm::make_vec2(glm::ivec1(2)); - Error += v1 == glm::ivec2(2, 0) ? 0 : 1; - - glm::ivec2 const v2 = glm::make_vec2(glm::ivec2(2)); - Error += v2 == glm::ivec2(2, 2) ? 0 : 1; - - glm::ivec2 const v3 = glm::make_vec2(glm::ivec3(2)); - Error += v3 == glm::ivec2(2, 2) ? 0 : 1; - - glm::ivec2 const v4 = glm::make_vec2(glm::ivec4(2)); - Error += v3 == glm::ivec2(2, 2) ? 0 : 1; - - return Error; -} - -int test_make_vec3() -{ - int Error = 0; - - glm::ivec3 const v1 = glm::make_vec3(glm::ivec1(2)); - Error += v1 == glm::ivec3(2, 0, 0) ? 0 : 1; - - glm::ivec3 const v2 = glm::make_vec3(glm::ivec2(2)); - Error += v2 == glm::ivec3(2, 2, 0) ? 0 : 1; - - glm::ivec3 const v3 = glm::make_vec3(glm::ivec3(2)); - Error += v3 == glm::ivec3(2, 2, 2) ? 0 : 1; - - glm::ivec3 const v4 = glm::make_vec3(glm::ivec4(2)); - Error += v3 == glm::ivec3(2, 2, 2) ? 0 : 1; - - return Error; -} - -int test_make_vec4() -{ - int Error = 0; - - glm::ivec4 const v1 = glm::make_vec4(glm::ivec1(2)); - Error += v1 == glm::ivec4(2, 0, 0, 1) ? 0 : 1; - - glm::ivec4 const v2 = glm::make_vec4(glm::ivec2(2)); - Error += v2 == glm::ivec4(2, 2, 0, 1) ? 0 : 1; - - glm::ivec4 const v3 = glm::make_vec4(glm::ivec3(2)); - Error += v3 == glm::ivec4(2, 2, 2, 1) ? 0 : 1; - - glm::ivec4 const v4 = glm::make_vec4(glm::ivec4(2)); - Error += v4 == glm::ivec4(2, 2, 2, 2) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_make_vec1(); - Error += test_make_vec2(); - Error += test_make_vec3(); - Error += test_make_vec4(); - Error += test_make_pointer_vec(); - Error += test_make_pointer_mat(); - Error += test_value_ptr_vec(); - Error += test_value_ptr_vec_const(); - Error += test_value_ptr_mat(); - Error += test_value_ptr_mat_const(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtc/gtc_ulp.cpp b/3rdparty/glm/source/test/gtc/gtc_ulp.cpp deleted file mode 100644 index d5074a3..0000000 --- a/3rdparty/glm/source/test/gtc/gtc_ulp.cpp +++ /dev/null @@ -1,99 +0,0 @@ -#include -#include -#include - -int test_ulp_float_dist() -{ - int Error = 0; - - float A = 1.0f; - - float B = glm::next_float(A); - Error += glm::notEqual(A, B, 0) ? 0 : 1; - float C = glm::prev_float(B); - Error += glm::equal(A, C, 0) ? 0 : 1; - - int D = glm::float_distance(A, B); - Error += D == 1 ? 0 : 1; - int E = glm::float_distance(A, C); - Error += E == 0 ? 0 : 1; - - return Error; -} - -int test_ulp_float_step() -{ - int Error = 0; - - float A = 1.0f; - - for(int i = 10; i < 1000; i *= 10) - { - float B = glm::next_float(A, i); - Error += glm::notEqual(A, B, 0) ? 0 : 1; - float C = glm::prev_float(B, i); - Error += glm::equal(A, C, 0) ? 0 : 1; - - int D = glm::float_distance(A, B); - Error += D == i ? 0 : 1; - int E = glm::float_distance(A, C); - Error += E == 0 ? 0 : 1; - } - - return Error; -} - -int test_ulp_double_dist() -{ - int Error = 0; - - double A = 1.0; - - double B = glm::next_float(A); - Error += glm::notEqual(A, B, 0) ? 0 : 1; - double C = glm::prev_float(B); - Error += glm::equal(A, C, 0) ? 0 : 1; - - glm::int64 const D = glm::float_distance(A, B); - Error += D == 1 ? 0 : 1; - glm::int64 const E = glm::float_distance(A, C); - Error += E == 0 ? 0 : 1; - - return Error; -} - -int test_ulp_double_step() -{ - int Error = 0; - - double A = 1.0; - - for(int i = 10; i < 1000; i *= 10) - { - double B = glm::next_float(A, i); - Error += glm::notEqual(A, B, 0) ? 0 : 1; - double C = glm::prev_float(B, i); - Error += glm::equal(A, C, 0) ? 0 : 1; - - glm::int64 const D = glm::float_distance(A, B); - Error += D == i ? 0 : 1; - glm::int64 const E = glm::float_distance(A, C); - Error += E == 0 ? 0 : 1; - } - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_ulp_float_dist(); - Error += test_ulp_float_step(); - Error += test_ulp_double_dist(); - Error += test_ulp_double_step(); - - return Error; -} - - diff --git a/3rdparty/glm/source/test/gtc/gtc_user_defined_types.cpp b/3rdparty/glm/source/test/gtc/gtc_user_defined_types.cpp deleted file mode 100644 index af39620..0000000 --- a/3rdparty/glm/source/test/gtc/gtc_user_defined_types.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2010-09-16 -// Updated : 2011-05-27 -// Licence : This source is under MIT licence -// File : test/gtc/type_ptr.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#define GLM_FORCE_RADIANS -#include - -int test_make_pointer_vec() -{ - int Error = 0; - - glm::func(); - //func(); - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_make_pointer_vec(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtc/gtc_vec1.cpp b/3rdparty/glm/source/test/gtc/gtc_vec1.cpp deleted file mode 100644 index 268d95e..0000000 --- a/3rdparty/glm/source/test/gtc/gtc_vec1.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include - -int main() -{ - int Error = 0; - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/CMakeLists.txt b/3rdparty/glm/source/test/gtx/CMakeLists.txt deleted file mode 100644 index ad7bf49..0000000 --- a/3rdparty/glm/source/test/gtx/CMakeLists.txt +++ /dev/null @@ -1,59 +0,0 @@ -glmCreateTestGTC(gtx) -glmCreateTestGTC(gtx_associated_min_max) -glmCreateTestGTC(gtx_closest_point) -glmCreateTestGTC(gtx_color_encoding) -glmCreateTestGTC(gtx_color_space_YCoCg) -glmCreateTestGTC(gtx_color_space) -glmCreateTestGTC(gtx_common) -glmCreateTestGTC(gtx_compatibility) -glmCreateTestGTC(gtx_component_wise) -glmCreateTestGTC(gtx_easing) -glmCreateTestGTC(gtx_euler_angle) -glmCreateTestGTC(gtx_extend) -glmCreateTestGTC(gtx_extended_min_max) -glmCreateTestGTC(gtx_exterior_product) -glmCreateTestGTC(gtx_fast_exponential) -glmCreateTestGTC(gtx_fast_square_root) -glmCreateTestGTC(gtx_fast_trigonometry) -glmCreateTestGTC(gtx_functions) -glmCreateTestGTC(gtx_gradient_paint) -glmCreateTestGTC(gtx_handed_coordinate_space) -glmCreateTestGTC(gtx_integer) -glmCreateTestGTC(gtx_intersect) -glmCreateTestGTC(gtx_io) -glmCreateTestGTC(gtx_load) -glmCreateTestGTC(gtx_log_base) -glmCreateTestGTC(gtx_matrix_cross_product) -glmCreateTestGTC(gtx_matrix_decompose) -glmCreateTestGTC(gtx_matrix_factorisation) -glmCreateTestGTC(gtx_matrix_interpolation) -glmCreateTestGTC(gtx_matrix_major_storage) -glmCreateTestGTC(gtx_matrix_operation) -glmCreateTestGTC(gtx_matrix_query) -glmCreateTestGTC(gtx_matrix_transform_2d) -glmCreateTestGTC(gtx_norm) -glmCreateTestGTC(gtx_normal) -glmCreateTestGTC(gtx_normalize_dot) -glmCreateTestGTC(gtx_number_precision) -glmCreateTestGTC(gtx_orthonormalize) -glmCreateTestGTC(gtx_optimum_pow) -glmCreateTestGTC(gtx_pca) -glmCreateTestGTC(gtx_perpendicular) -glmCreateTestGTC(gtx_polar_coordinates) -glmCreateTestGTC(gtx_projection) -glmCreateTestGTC(gtx_quaternion) -glmCreateTestGTC(gtx_dual_quaternion) -glmCreateTestGTC(gtx_range) -glmCreateTestGTC(gtx_rotate_normalized_axis) -glmCreateTestGTC(gtx_rotate_vector) -glmCreateTestGTC(gtx_scalar_multiplication) -glmCreateTestGTC(gtx_scalar_relational) -glmCreateTestGTC(gtx_spline) -glmCreateTestGTC(gtx_string_cast) -glmCreateTestGTC(gtx_texture) -glmCreateTestGTC(gtx_type_aligned) -glmCreateTestGTC(gtx_type_trait) -glmCreateTestGTC(gtx_vec_swizzle) -glmCreateTestGTC(gtx_vector_angle) -glmCreateTestGTC(gtx_vector_query) -glmCreateTestGTC(gtx_wrap) diff --git a/3rdparty/glm/source/test/gtx/gtx.cpp b/3rdparty/glm/source/test/gtx/gtx.cpp deleted file mode 100644 index 1b143b6..0000000 --- a/3rdparty/glm/source/test/gtx/gtx.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include - -int main() -{ - int Error = 0; - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_associated_min_max.cpp b/3rdparty/glm/source/test/gtx/gtx_associated_min_max.cpp deleted file mode 100644 index 9007f8a..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_associated_min_max.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#include - -int main() -{ - int Error(0); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_closest_point.cpp b/3rdparty/glm/source/test/gtx/gtx_closest_point.cpp deleted file mode 100644 index 0f6303a..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_closest_point.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include - -int main() -{ - int Error(0); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_color_encoding.cpp b/3rdparty/glm/source/test/gtx/gtx_color_encoding.cpp deleted file mode 100644 index 8b499be..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_color_encoding.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include -#include -#include -#include - -namespace srgb -{ - int test() - { - int Error(0); - - glm::vec3 const ColorSourceRGB(1.0, 0.5, 0.0); -/* - { - glm::vec3 const ColorSRGB = glm::convertLinearSRGBToD65XYZ(ColorSourceRGB); - glm::vec3 const ColorRGB = glm::convertD65XYZToLinearSRGB(ColorSRGB); - Error += glm::all(glm::epsilonEqual(ColorSourceRGB, ColorRGB, 0.00001f)) ? 0 : 1; - } -*/ - { - glm::vec3 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGB, 2.8f); - glm::vec3 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB, 2.8f); - Error += glm::all(glm::epsilonEqual(ColorSourceRGB, ColorRGB, 0.00001f)) ? 0 : 1; - } - - glm::vec4 const ColorSourceRGBA(1.0, 0.5, 0.0, 1.0); - - { - glm::vec4 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGBA); - glm::vec4 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB); - Error += glm::all(glm::epsilonEqual(ColorSourceRGBA, ColorRGB, 0.00001f)) ? 0 : 1; - } - - { - glm::vec4 const ColorSRGB = glm::convertLinearToSRGB(ColorSourceRGBA, 2.8f); - glm::vec4 const ColorRGB = glm::convertSRGBToLinear(ColorSRGB, 2.8f); - Error += glm::all(glm::epsilonEqual(ColorSourceRGBA, ColorRGB, 0.00001f)) ? 0 : 1; - } - - return Error; - } -}//namespace srgb - -int main() -{ - int Error(0); - - Error += srgb::test(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_color_space.cpp b/3rdparty/glm/source/test/gtx/gtx_color_space.cpp deleted file mode 100644 index a23d2c8..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_color_space.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include - -int test_saturation() -{ - int Error(0); - - glm::vec4 Color = glm::saturation(1.0f, glm::vec4(1.0, 0.5, 0.0, 1.0)); - - return Error; -} - -int main() -{ - int Error(0); - - Error += test_saturation(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_color_space_YCoCg.cpp b/3rdparty/glm/source/test/gtx/gtx_color_space_YCoCg.cpp deleted file mode 100644 index 2ca131d..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_color_space_YCoCg.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include - -int main() -{ - int Error(0); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_common.cpp b/3rdparty/glm/source/test/gtx/gtx_common.cpp deleted file mode 100644 index fd4fa99..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_common.cpp +++ /dev/null @@ -1,161 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#include -#include -#include -#include - -namespace fmod_ -{ - template - GLM_FUNC_QUALIFIER genType modTrunc(genType a, genType b) - { - return a - b * glm::trunc(a / b); - } - - int test() - { - int Error(0); - - { - float A0(3.0); - float B0(2.0f); - float C0 = glm::fmod(A0, B0); - - Error += glm::abs(C0 - 1.0f) < 0.00001f ? 0 : 1; - - glm::vec4 A1(3.0); - float B1(2.0f); - glm::vec4 C1 = glm::fmod(A1, B1); - - Error += glm::all(glm::epsilonEqual(C1, glm::vec4(1.0f), 0.00001f)) ? 0 : 1; - - glm::vec4 A2(3.0); - glm::vec4 B2(2.0f); - glm::vec4 C2 = glm::fmod(A2, B2); - - Error += glm::all(glm::epsilonEqual(C2, glm::vec4(1.0f), 0.00001f)) ? 0 : 1; - - glm::ivec4 A3(3); - int B3(2); - glm::ivec4 C3 = glm::fmod(A3, B3); - - Error += glm::all(glm::equal(C3, glm::ivec4(1))) ? 0 : 1; - - glm::ivec4 A4(3); - glm::ivec4 B4(2); - glm::ivec4 C4 = glm::fmod(A4, B4); - - Error += glm::all(glm::equal(C4, glm::ivec4(1))) ? 0 : 1; - } - - { - float A0(22.0); - float B0(-10.0f); - float C0 = glm::fmod(A0, B0); - - Error += glm::abs(C0 - 2.0f) < 0.00001f ? 0 : 1; - - glm::vec4 A1(22.0); - float B1(-10.0f); - glm::vec4 C1 = glm::fmod(A1, B1); - - Error += glm::all(glm::epsilonEqual(C1, glm::vec4(2.0f), 0.00001f)) ? 0 : 1; - - glm::vec4 A2(22.0); - glm::vec4 B2(-10.0f); - glm::vec4 C2 = glm::fmod(A2, B2); - - Error += glm::all(glm::epsilonEqual(C2, glm::vec4(2.0f), 0.00001f)) ? 0 : 1; - - glm::ivec4 A3(22); - int B3(-10); - glm::ivec4 C3 = glm::fmod(A3, B3); - - Error += glm::all(glm::equal(C3, glm::ivec4(2))) ? 0 : 1; - - glm::ivec4 A4(22); - glm::ivec4 B4(-10); - glm::ivec4 C4 = glm::fmod(A4, B4); - - Error += glm::all(glm::equal(C4, glm::ivec4(2))) ? 0 : 1; - } - - // http://stackoverflow.com/questions/7610631/glsl-mod-vs-hlsl-fmod - { - for (float y = -10.0f; y < 10.0f; y += 0.1f) - for (float x = -10.0f; x < 10.0f; x += 0.1f) - { - float const A(std::fmod(x, y)); - //float const B(std::remainder(x, y)); - float const C(glm::fmod(x, y)); - float const D(modTrunc(x, y)); - - //Error += glm::epsilonEqual(A, B, 0.0001f) ? 0 : 1; - //assert(!Error); - Error += glm::epsilonEqual(A, C, 0.0001f) ? 0 : 1; - assert(!Error); - Error += glm::epsilonEqual(A, D, 0.00001f) ? 0 : 1; - assert(!Error); - } - } - - return Error; - } -}//namespace fmod_ - -int test_isdenormal() -{ - int Error = 0; - - bool A = glm::isdenormal(1.0f); - Error += !A ? 0 : 1; - - glm::bvec1 B = glm::isdenormal(glm::vec1(1.0f)); - Error += !glm::any(B) ? 0 : 1; - - glm::bvec2 C = glm::isdenormal(glm::vec2(1.0f)); - Error += !glm::any(C) ? 0 : 1; - - glm::bvec3 D = glm::isdenormal(glm::vec3(1.0f)); - Error += !glm::any(D) ? 0 : 1; - - glm::bvec4 E = glm::isdenormal(glm::vec4(1.0f)); - Error += !glm::any(E) ? 0 : 1; - - return Error; -} - -int test_openBounded() -{ - int Error = 0; - - Error += glm::all(glm::openBounded(glm::ivec2(2), glm::ivec2(1), glm::ivec2(3))) ? 0 : 1; - Error += !glm::all(glm::openBounded(glm::ivec2(1), glm::ivec2(1), glm::ivec2(3))) ? 0 : 1; - Error += !glm::all(glm::openBounded(glm::ivec2(3), glm::ivec2(1), glm::ivec2(3))) ? 0 : 1; - - return Error; -} - -int test_closeBounded() -{ - int Error = 0; - - Error += glm::all(glm::closeBounded(glm::ivec2(2), glm::ivec2(1), glm::ivec2(3))) ? 0 : 1; - Error += glm::all(glm::closeBounded(glm::ivec2(1), glm::ivec2(1), glm::ivec2(3))) ? 0 : 1; - Error += glm::all(glm::closeBounded(glm::ivec2(3), glm::ivec2(1), glm::ivec2(3))) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_isdenormal(); - Error += ::fmod_::test(); - Error += test_openBounded(); - Error += test_closeBounded(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_compatibility.cpp b/3rdparty/glm/source/test/gtx/gtx_compatibility.cpp deleted file mode 100644 index e5351ce..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_compatibility.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include - -int main() -{ - int Error(0); - - Error += glm::isfinite(1.0f) ? 0 : 1; - Error += glm::isfinite(1.0) ? 0 : 1; - Error += glm::isfinite(-1.0f) ? 0 : 1; - Error += glm::isfinite(-1.0) ? 0 : 1; - - Error += glm::all(glm::isfinite(glm::vec4(1.0f))) ? 0 : 1; - Error += glm::all(glm::isfinite(glm::dvec4(1.0))) ? 0 : 1; - Error += glm::all(glm::isfinite(glm::vec4(-1.0f))) ? 0 : 1; - Error += glm::all(glm::isfinite(glm::dvec4(-1.0))) ? 0 : 1; - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_component_wise.cpp b/3rdparty/glm/source/test/gtx/gtx_component_wise.cpp deleted file mode 100644 index 29c81af..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_component_wise.cpp +++ /dev/null @@ -1,116 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#include -#include -#include -#include - -namespace compNormalize -{ - int run() - { - int Error(0); - - { - glm::vec4 const A = glm::compNormalize(glm::u8vec4(0, 127, 128, 255)); - - Error += glm::epsilonEqual(A.x, 0.0f, glm::epsilon()) ? 0 : 1; - Error += A.y < 0.5f ? 0 : 1; - Error += A.z > 0.5f ? 0 : 1; - Error += glm::epsilonEqual(A.w, 1.0f, glm::epsilon()) ? 0 : 1; - } - - { - glm::vec4 const A = glm::compNormalize(glm::i8vec4(-128, -1, 0, 127)); - - Error += glm::epsilonEqual(A.x,-1.0f, glm::epsilon()) ? 0 : 1; - Error += A.y < 0.0f ? 0 : 1; - Error += A.z > 0.0f ? 0 : 1; - Error += glm::epsilonEqual(A.w, 1.0f, glm::epsilon()) ? 0 : 1; - } - - { - glm::vec4 const A = glm::compNormalize(glm::u16vec4( - std::numeric_limits::min(), - (std::numeric_limits::max() >> 1) + 0, - (std::numeric_limits::max() >> 1) + 1, - std::numeric_limits::max())); - - Error += glm::epsilonEqual(A.x, 0.0f, glm::epsilon()) ? 0 : 1; - Error += A.y < 0.5f ? 0 : 1; - Error += A.z > 0.5f ? 0 : 1; - Error += glm::epsilonEqual(A.w, 1.0f, glm::epsilon()) ? 0 : 1; - } - - { - glm::vec4 const A = glm::compNormalize(glm::i16vec4( - std::numeric_limits::min(), - static_cast(-1), - static_cast(0), - std::numeric_limits::max())); - - Error += glm::epsilonEqual(A.x,-1.0f, glm::epsilon()) ? 0 : 1; - Error += A.y < 0.0f ? 0 : 1; - Error += A.z > 0.0f ? 0 : 1; - Error += glm::epsilonEqual(A.w, 1.0f, glm::epsilon()) ? 0 : 1; - } - - return Error; - } -}//namespace compNormalize - -namespace compScale -{ - int run() - { - int Error(0); - - { - glm::u8vec4 const A = glm::compScale(glm::vec4(0.0f, 0.2f, 0.5f, 1.0f)); - - Error += A.x == std::numeric_limits::min() ? 0 : 1; - Error += A.y < (std::numeric_limits::max() >> 2) ? 0 : 1; - Error += A.z == 127 ? 0 : 1; - Error += A.w == 255 ? 0 : 1; - } - - { - glm::i8vec4 const A = glm::compScale(glm::vec4(0.0f,-1.0f, 0.5f, 1.0f)); - - Error += A.x == 0 ? 0 : 1; - Error += A.y == -128 ? 0 : 1; - Error += A.z == 63 ? 0 : 1; - Error += A.w == 127 ? 0 : 1; - } - - { - glm::u16vec4 const A = glm::compScale(glm::vec4(0.0f, 0.2f, 0.5f, 1.0f)); - - Error += A.x == std::numeric_limits::min() ? 0 : 1; - Error += A.y < (std::numeric_limits::max() >> 2) ? 0 : 1; - Error += A.z == 32767 ? 0 : 1; - Error += A.w == 65535 ? 0 : 1; - } - - { - glm::i16vec4 const A = glm::compScale(glm::vec4(0.0f,-1.0f, 0.5f, 1.0f)); - - Error += A.x == 0 ? 0 : 1; - Error += A.y == -32768 ? 0 : 1; - Error += A.z == 16383 ? 0 : 1; - Error += A.w == 32767 ? 0 : 1; - } - - return Error; - } -}// compScale - -int main() -{ - int Error(0); - - Error += compNormalize::run(); - Error += compScale::run(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_dual_quaternion.cpp b/3rdparty/glm/source/test/gtx/gtx_dual_quaternion.cpp deleted file mode 100644 index ceedc2c..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_dual_quaternion.cpp +++ /dev/null @@ -1,205 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#define GLM_FORCE_CTOR_INIT -#include -#include -#include -#include -#include -#if GLM_HAS_TRIVIAL_QUERIES -# include -#endif - -int myrand() -{ - static int holdrand = 1; - return (((holdrand = holdrand * 214013L + 2531011L) >> 16) & 0x7fff); -} - -float myfrand() // returns values from -1 to 1 inclusive -{ - return float(double(myrand()) / double( 0x7ffff )) * 2.0f - 1.0f; -} - -int test_dquat_type() -{ - glm::dvec3 vA; - glm::dquat dqA, dqB; - glm::ddualquat C(dqA, dqB); - glm::ddualquat B(dqA); - glm::ddualquat D(dqA, vA); - return 0; -} - -int test_scalars() -{ - float const Epsilon = 0.0001f; - - int Error(0); - - glm::quat src_q1 = glm::quat(1.0f,2.0f,3.0f,4.0f); - glm::quat src_q2 = glm::quat(5.0f,6.0f,7.0f,8.0f); - glm::dualquat src1(src_q1,src_q2); - - { - glm::dualquat dst1 = src1 * 2.0f; - glm::dualquat dst2 = 2.0f * src1; - glm::dualquat dst3 = src1; - dst3 *= 2.0f; - glm::dualquat dstCmp(src_q1 * 2.0f,src_q2 * 2.0f); - Error += glm::all(glm::epsilonEqual(dst1.real,dstCmp.real, Epsilon)) && glm::all(glm::epsilonEqual(dst1.dual,dstCmp.dual, Epsilon)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(dst2.real,dstCmp.real, Epsilon)) && glm::all(glm::epsilonEqual(dst2.dual,dstCmp.dual, Epsilon)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(dst3.real,dstCmp.real, Epsilon)) && glm::all(glm::epsilonEqual(dst3.dual,dstCmp.dual, Epsilon)) ? 0 : 1; - } - - { - glm::dualquat dst1 = src1 / 2.0f; - glm::dualquat dst2 = src1; - dst2 /= 2.0f; - glm::dualquat dstCmp(src_q1 / 2.0f,src_q2 / 2.0f); - Error += glm::all(glm::epsilonEqual(dst1.real,dstCmp.real, Epsilon)) && glm::all(glm::epsilonEqual(dst1.dual,dstCmp.dual, Epsilon)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(dst2.real,dstCmp.real, Epsilon)) && glm::all(glm::epsilonEqual(dst2.dual,dstCmp.dual, Epsilon)) ? 0 : 1; - } - return Error; -} - -int test_inverse() -{ - int Error(0); - - float const Epsilon = 0.0001f; - - glm::dualquat dqid = glm::dual_quat_identity(); - glm::mat4x4 mid(1.0f); - - for (int j = 0; j < 100; ++j) - { - glm::mat4x4 rot = glm::yawPitchRoll(myfrand() * 360.0f, myfrand() * 360.0f, myfrand() * 360.0f); - glm::vec3 vt = glm::vec3(myfrand() * 10.0f, myfrand() * 10.0f, myfrand() * 10.0f); - - glm::mat4x4 m = glm::translate(mid, vt) * rot; - - glm::quat qr = glm::quat_cast(m); - - glm::dualquat dq(qr); - - glm::dualquat invdq = glm::inverse(dq); - - glm::dualquat r1 = invdq * dq; - glm::dualquat r2 = dq * invdq; - - Error += glm::all(glm::epsilonEqual(r1.real, dqid.real, Epsilon)) && glm::all(glm::epsilonEqual(r1.dual, dqid.dual, Epsilon)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(r2.real, dqid.real, Epsilon)) && glm::all(glm::epsilonEqual(r2.dual, dqid.dual, Epsilon)) ? 0 : 1; - - // testing commutative property - glm::dualquat r ( glm::quat( myfrand() * glm::pi() * 2.0f, myfrand(), myfrand(), myfrand() ), - glm::vec3(myfrand() * 10.0f, myfrand() * 10.0f, myfrand() * 10.0f) ); - glm::dualquat riq = (r * invdq) * dq; - glm::dualquat rqi = (r * dq) * invdq; - - Error += glm::all(glm::epsilonEqual(riq.real, rqi.real, Epsilon)) && glm::all(glm::epsilonEqual(riq.dual, rqi.dual, Epsilon)) ? 0 : 1; - } - - return Error; -} - -int test_mul() -{ - int Error(0); - - float const Epsilon = 0.0001f; - - glm::mat4x4 mid(1.0f); - - for (int j = 0; j < 100; ++j) - { - // generate random rotations and translations and compare transformed by matrix and dualquats random points - glm::vec3 vt1 = glm::vec3(myfrand() * 10.0f, myfrand() * 10.0f, myfrand() * 10.0f); - glm::vec3 vt2 = glm::vec3(myfrand() * 10.0f, myfrand() * 10.0f, myfrand() * 10.0f); - - glm::mat4x4 rot1 = glm::yawPitchRoll(myfrand() * 360.0f, myfrand() * 360.0f, myfrand() * 360.0f); - glm::mat4x4 rot2 = glm::yawPitchRoll(myfrand() * 360.0f, myfrand() * 360.0f, myfrand() * 360.0f); - glm::mat4x4 m1 = glm::translate(mid, vt1) * rot1; - glm::mat4x4 m2 = glm::translate(mid, vt2) * rot2; - glm::mat4x4 m3 = m2 * m1; - glm::mat4x4 m4 = m1 * m2; - - glm::quat qrot1 = glm::quat_cast(rot1); - glm::quat qrot2 = glm::quat_cast(rot2); - - glm::dualquat dq1 = glm::dualquat(qrot1,vt1); - glm::dualquat dq2 = glm::dualquat(qrot2,vt2); - glm::dualquat dq3 = dq2 * dq1; - glm::dualquat dq4 = dq1 * dq2; - - for (int i = 0; i < 100; ++i) - { - glm::vec4 src_pt = glm::vec4(myfrand() * 4.0f, myfrand() * 5.0f, myfrand() * 3.0f,1.0f); - // test both multiplication orders - glm::vec4 dst_pt_m3 = m3 * src_pt; - glm::vec4 dst_pt_dq3 = dq3 * src_pt; - - glm::vec4 dst_pt_m3_i = glm::inverse(m3) * src_pt; - glm::vec4 dst_pt_dq3_i = src_pt * dq3; - - glm::vec4 dst_pt_m4 = m4 * src_pt; - glm::vec4 dst_pt_dq4 = dq4 * src_pt; - - glm::vec4 dst_pt_m4_i = glm::inverse(m4) * src_pt; - glm::vec4 dst_pt_dq4_i = src_pt * dq4; - - Error += glm::all(glm::epsilonEqual(dst_pt_m3, dst_pt_dq3, Epsilon)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(dst_pt_m4, dst_pt_dq4, Epsilon)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(dst_pt_m3_i, dst_pt_dq3_i, Epsilon)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(dst_pt_m4_i, dst_pt_dq4_i, Epsilon)) ? 0 : 1; - } - } - - return Error; -} - -int test_dual_quat_ctr() -{ - int Error(0); - -# if GLM_HAS_TRIVIAL_QUERIES - // Error += std::is_trivially_default_constructible::value ? 0 : 1; - // Error += std::is_trivially_default_constructible::value ? 0 : 1; - // Error += std::is_trivially_copy_assignable::value ? 0 : 1; - // Error += std::is_trivially_copy_assignable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - Error += std::is_trivially_copyable::value ? 0 : 1; - - Error += std::is_copy_constructible::value ? 0 : 1; - Error += std::is_copy_constructible::value ? 0 : 1; -# endif - - return Error; -} - -int test_size() -{ - int Error = 0; - - Error += 32 == sizeof(glm::dualquat) ? 0 : 1; - Error += 64 == sizeof(glm::ddualquat) ? 0 : 1; - Error += glm::dualquat().length() == 2 ? 0 : 1; - Error += glm::ddualquat().length() == 2 ? 0 : 1; - Error += glm::dualquat::length() == 2 ? 0 : 1; - Error += glm::ddualquat::length() == 2 ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_dual_quat_ctr(); - Error += test_dquat_type(); - Error += test_scalars(); - Error += test_inverse(); - Error += test_mul(); - Error += test_size(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_easing.cpp b/3rdparty/glm/source/test/gtx/gtx_easing.cpp deleted file mode 100644 index 0e98cd5..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_easing.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#include -#include - -namespace -{ - - template - void _test_easing() - { - T a = static_cast(0.5); - T r; - - r = glm::linearInterpolation(a); - - r = glm::quadraticEaseIn(a); - r = glm::quadraticEaseOut(a); - r = glm::quadraticEaseInOut(a); - - r = glm::cubicEaseIn(a); - r = glm::cubicEaseOut(a); - r = glm::cubicEaseInOut(a); - - r = glm::quarticEaseIn(a); - r = glm::quarticEaseOut(a); - r = glm::quinticEaseInOut(a); - - r = glm::sineEaseIn(a); - r = glm::sineEaseOut(a); - r = glm::sineEaseInOut(a); - - r = glm::circularEaseIn(a); - r = glm::circularEaseOut(a); - r = glm::circularEaseInOut(a); - - r = glm::exponentialEaseIn(a); - r = glm::exponentialEaseOut(a); - r = glm::exponentialEaseInOut(a); - - r = glm::elasticEaseIn(a); - r = glm::elasticEaseOut(a); - r = glm::elasticEaseInOut(a); - - r = glm::backEaseIn(a); - r = glm::backEaseOut(a); - r = glm::backEaseInOut(a); - - r = glm::bounceEaseIn(a); - r = glm::bounceEaseOut(a); - r = glm::bounceEaseInOut(a); - } - -} - -int main() -{ - int Error = 0; - - _test_easing(); - _test_easing(); - - return Error; -} - diff --git a/3rdparty/glm/source/test/gtx/gtx_euler_angle.cpp b/3rdparty/glm/source/test/gtx/gtx_euler_angle.cpp deleted file mode 100644 index 348f581..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_euler_angle.cpp +++ /dev/null @@ -1,539 +0,0 @@ -// Code sample from Filippo Ramaciotti - -#define GLM_ENABLE_EXPERIMENTAL -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace test_eulerAngleX -{ - int test() - { - int Error = 0; - - float const Angle(glm::pi() * 0.5f); - glm::vec3 const X(1.0f, 0.0f, 0.0f); - - glm::vec4 const Y(0.0f, 1.0f, 0.0f, 1.0f); - glm::vec4 const Y1 = glm::rotate(glm::mat4(1.0f), Angle, X) * Y; - glm::vec4 const Y2 = glm::eulerAngleX(Angle) * Y; - glm::vec4 const Y3 = glm::eulerAngleXY(Angle, 0.0f) * Y; - glm::vec4 const Y4 = glm::eulerAngleYX(0.0f, Angle) * Y; - glm::vec4 const Y5 = glm::eulerAngleXZ(Angle, 0.0f) * Y; - glm::vec4 const Y6 = glm::eulerAngleZX(0.0f, Angle) * Y; - glm::vec4 const Y7 = glm::eulerAngleYXZ(0.0f, Angle, 0.0f) * Y; - Error += glm::all(glm::epsilonEqual(Y1, Y2, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(Y1, Y3, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(Y1, Y4, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(Y1, Y5, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(Y1, Y6, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(Y1, Y7, 0.00001f)) ? 0 : 1; - - glm::vec4 const Z(0.0f, 0.0f, 1.0f, 1.0f); - glm::vec4 const Z1 = glm::rotate(glm::mat4(1.0f), Angle, X) * Z; - glm::vec4 const Z2 = glm::eulerAngleX(Angle) * Z; - glm::vec4 const Z3 = glm::eulerAngleXY(Angle, 0.0f) * Z; - glm::vec4 const Z4 = glm::eulerAngleYX(0.0f, Angle) * Z; - glm::vec4 const Z5 = glm::eulerAngleXZ(Angle, 0.0f) * Z; - glm::vec4 const Z6 = glm::eulerAngleZX(0.0f, Angle) * Z; - glm::vec4 const Z7 = glm::eulerAngleYXZ(0.0f, Angle, 0.0f) * Z; - Error += glm::all(glm::epsilonEqual(Z1, Z2, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(Z1, Z3, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(Z1, Z4, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(Z1, Z5, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(Z1, Z6, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(Z1, Z7, 0.00001f)) ? 0 : 1; - - return Error; - } -}//namespace test_eulerAngleX - -namespace test_eulerAngleY -{ - int test() - { - int Error = 0; - - float const Angle(glm::pi() * 0.5f); - glm::vec3 const Y(0.0f, 1.0f, 0.0f); - - glm::vec4 const X(1.0f, 0.0f, 0.0f, 1.0f); - glm::vec4 const X1 = glm::rotate(glm::mat4(1.0f), Angle, Y) * X; - glm::vec4 const X2 = glm::eulerAngleY(Angle) * X; - glm::vec4 const X3 = glm::eulerAngleYX(Angle, 0.0f) * X; - glm::vec4 const X4 = glm::eulerAngleXY(0.0f, Angle) * X; - glm::vec4 const X5 = glm::eulerAngleYZ(Angle, 0.0f) * X; - glm::vec4 const X6 = glm::eulerAngleZY(0.0f, Angle) * X; - glm::vec4 const X7 = glm::eulerAngleYXZ(Angle, 0.0f, 0.0f) * X; - Error += glm::all(glm::epsilonEqual(X1, X2, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(X1, X3, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(X1, X4, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(X1, X5, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(X1, X6, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(X1, X7, 0.00001f)) ? 0 : 1; - - glm::vec4 const Z(0.0f, 0.0f, 1.0f, 1.0f); - glm::vec4 const Z1 = glm::eulerAngleY(Angle) * Z; - glm::vec4 const Z2 = glm::rotate(glm::mat4(1.0f), Angle, Y) * Z; - glm::vec4 const Z3 = glm::eulerAngleYX(Angle, 0.0f) * Z; - glm::vec4 const Z4 = glm::eulerAngleXY(0.0f, Angle) * Z; - glm::vec4 const Z5 = glm::eulerAngleYZ(Angle, 0.0f) * Z; - glm::vec4 const Z6 = glm::eulerAngleZY(0.0f, Angle) * Z; - glm::vec4 const Z7 = glm::eulerAngleYXZ(Angle, 0.0f, 0.0f) * Z; - Error += glm::all(glm::epsilonEqual(Z1, Z2, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(Z1, Z3, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(Z1, Z4, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(Z1, Z5, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(Z1, Z6, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(Z1, Z7, 0.00001f)) ? 0 : 1; - - return Error; - } -}//namespace test_eulerAngleY - -namespace test_eulerAngleZ -{ - int test() - { - int Error = 0; - - float const Angle(glm::pi() * 0.5f); - glm::vec3 const Z(0.0f, 0.0f, 1.0f); - - glm::vec4 const X(1.0f, 0.0f, 0.0f, 1.0f); - glm::vec4 const X1 = glm::rotate(glm::mat4(1.0f), Angle, Z) * X; - glm::vec4 const X2 = glm::eulerAngleZ(Angle) * X; - glm::vec4 const X3 = glm::eulerAngleZX(Angle, 0.0f) * X; - glm::vec4 const X4 = glm::eulerAngleXZ(0.0f, Angle) * X; - glm::vec4 const X5 = glm::eulerAngleZY(Angle, 0.0f) * X; - glm::vec4 const X6 = glm::eulerAngleYZ(0.0f, Angle) * X; - glm::vec4 const X7 = glm::eulerAngleYXZ(0.0f, 0.0f, Angle) * X; - Error += glm::all(glm::epsilonEqual(X1, X2, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(X1, X3, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(X1, X4, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(X1, X5, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(X1, X6, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(X1, X7, 0.00001f)) ? 0 : 1; - - glm::vec4 const Y(1.0f, 0.0f, 0.0f, 1.0f); - glm::vec4 const Z1 = glm::rotate(glm::mat4(1.0f), Angle, Z) * Y; - glm::vec4 const Z2 = glm::eulerAngleZ(Angle) * Y; - glm::vec4 const Z3 = glm::eulerAngleZX(Angle, 0.0f) * Y; - glm::vec4 const Z4 = glm::eulerAngleXZ(0.0f, Angle) * Y; - glm::vec4 const Z5 = glm::eulerAngleZY(Angle, 0.0f) * Y; - glm::vec4 const Z6 = glm::eulerAngleYZ(0.0f, Angle) * Y; - glm::vec4 const Z7 = glm::eulerAngleYXZ(0.0f, 0.0f, Angle) * Y; - Error += glm::all(glm::epsilonEqual(Z1, Z2, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(Z1, Z3, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(Z1, Z4, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(Z1, Z5, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(Z1, Z6, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(Z1, Z7, 0.00001f)) ? 0 : 1; - - return Error; - } -}//namespace test_eulerAngleZ - -namespace test_derivedEulerAngles -{ - bool epsilonEqual(glm::mat4 const& mat1, glm::mat4 const& mat2, glm::mat4::value_type const& epsilon) - { - return glm::all(glm::epsilonEqual(mat1[0], mat2[0], epsilon)) ? - ( - glm::all(glm::epsilonEqual(mat1[1], mat2[1], epsilon)) ? - ( - glm::all(glm::epsilonEqual(mat1[2], mat2[2], epsilon)) ? - ( - glm::all(glm::epsilonEqual(mat1[3], mat2[3], epsilon)) ? true : false - ) : false - ) : false - ) : false; - } - - template - int test(RotationFunc rotationFunc, TestDerivedFunc testDerivedFunc, const glm::vec3& basis) - { - int Error = 0; - - typedef glm::vec3::value_type value; - value const zeroAngle(0.0f); - value const Angle(glm::pi() * 0.75f); - value const negativeAngle(-Angle); - value const zeroAngleVelocity(0.0f); - value const AngleVelocity(glm::pi() * 0.27f); - value const negativeAngleVelocity(-AngleVelocity); - - typedef std::pair AngleAndAngleVelocity; - std::vector testPairs; - testPairs.push_back(AngleAndAngleVelocity(zeroAngle, zeroAngleVelocity)); - testPairs.push_back(AngleAndAngleVelocity(zeroAngle, AngleVelocity)); - testPairs.push_back(AngleAndAngleVelocity(zeroAngle, negativeAngleVelocity)); - testPairs.push_back(AngleAndAngleVelocity(Angle, zeroAngleVelocity)); - testPairs.push_back(AngleAndAngleVelocity(Angle, AngleVelocity)); - testPairs.push_back(AngleAndAngleVelocity(Angle, negativeAngleVelocity)); - testPairs.push_back(AngleAndAngleVelocity(negativeAngle, zeroAngleVelocity)); - testPairs.push_back(AngleAndAngleVelocity(negativeAngle, AngleVelocity)); - testPairs.push_back(AngleAndAngleVelocity(negativeAngle, negativeAngleVelocity)); - - for (size_t i = 0, size = testPairs.size(); i < size; ++i) - { - AngleAndAngleVelocity const& pair = testPairs.at(i); - - glm::mat4 const W = glm::matrixCross4(basis * pair.second); - glm::mat4 const rotMt = glm::transpose(rotationFunc(pair.first)); - glm::mat4 const derivedRotM = testDerivedFunc(pair.first, pair.second); - - Error += epsilonEqual(W, derivedRotM * rotMt, 0.00001f) ? 0 : 1; - } - - return Error; - } -}//namespace test_derivedEulerAngles - -namespace test_eulerAngleXY -{ - int test() - { - int Error = 0; - - glm::vec4 const V(1.0f); - - float const AngleX(glm::pi() * 0.5f); - float const AngleY(glm::pi() * 0.25f); - - glm::vec3 const axisX(1.0f, 0.0f, 0.0f); - glm::vec3 const axisY(0.0f, 1.0f, 0.0f); - - glm::vec4 const V1 = (glm::rotate(glm::mat4(1.0f), AngleX, axisX) * glm::rotate(glm::mat4(1.0f), AngleY, axisY)) * V; - glm::vec4 const V2 = glm::eulerAngleXY(AngleX, AngleY) * V; - glm::vec4 const V3 = glm::eulerAngleX(AngleX) * glm::eulerAngleY(AngleY) * V; - Error += glm::all(glm::epsilonEqual(V1, V2, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(V1, V3, 0.00001f)) ? 0 : 1; - - return Error; - } -}//namespace test_eulerAngleXY - -namespace test_eulerAngleYX -{ - int test() - { - int Error = 0; - - glm::vec4 const V(1.0f); - - float const AngleX(glm::pi() * 0.5f); - float const AngleY(glm::pi() * 0.25f); - - glm::vec3 const axisX(1.0f, 0.0f, 0.0f); - glm::vec3 const axisY(0.0f, 1.0f, 0.0f); - - glm::vec4 const V1 = (glm::rotate(glm::mat4(1.0f), AngleY, axisY) * glm::rotate(glm::mat4(1.0f), AngleX, axisX)) * V; - glm::vec4 const V2 = glm::eulerAngleYX(AngleY, AngleX) * V; - glm::vec4 const V3 = glm::eulerAngleY(AngleY) * glm::eulerAngleX(AngleX) * V; - Error += glm::all(glm::epsilonEqual(V1, V2, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(V1, V3, 0.00001f)) ? 0 : 1; - - return Error; - } -}//namespace test_eulerAngleYX - -namespace test_eulerAngleXZ -{ - int test() - { - int Error = 0; - - glm::vec4 const V(1.0f); - - float const AngleX(glm::pi() * 0.5f); - float const AngleZ(glm::pi() * 0.25f); - - glm::vec3 const axisX(1.0f, 0.0f, 0.0f); - glm::vec3 const axisZ(0.0f, 0.0f, 1.0f); - - glm::vec4 const V1 = (glm::rotate(glm::mat4(1.0f), AngleX, axisX) * glm::rotate(glm::mat4(1.0f), AngleZ, axisZ)) * V; - glm::vec4 const V2 = glm::eulerAngleXZ(AngleX, AngleZ) * V; - glm::vec4 const V3 = glm::eulerAngleX(AngleX) * glm::eulerAngleZ(AngleZ) * V; - Error += glm::all(glm::epsilonEqual(V1, V2, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(V1, V3, 0.00001f)) ? 0 : 1; - - return Error; - } -}//namespace test_eulerAngleXZ - -namespace test_eulerAngleZX -{ - int test() - { - int Error = 0; - - glm::vec4 const V(1.0f); - - float const AngleX(glm::pi() * 0.5f); - float const AngleZ(glm::pi() * 0.25f); - - glm::vec3 const axisX(1.0f, 0.0f, 0.0f); - glm::vec3 const axisZ(0.0f, 0.0f, 1.0f); - - glm::vec4 const V1 = (glm::rotate(glm::mat4(1.0f), AngleZ, axisZ) * glm::rotate(glm::mat4(1.0f), AngleX, axisX)) * V; - glm::vec4 const V2 = glm::eulerAngleZX(AngleZ, AngleX) * V; - glm::vec4 const V3 = glm::eulerAngleZ(AngleZ) * glm::eulerAngleX(AngleX) * V; - Error += glm::all(glm::epsilonEqual(V1, V2, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(V1, V3, 0.00001f)) ? 0 : 1; - - return Error; - } -}//namespace test_eulerAngleZX - -namespace test_eulerAngleYZ -{ - int test() - { - int Error = 0; - - glm::vec4 const V(1.0f); - - float const AngleY(glm::pi() * 0.5f); - float const AngleZ(glm::pi() * 0.25f); - - glm::vec3 const axisX(1.0f, 0.0f, 0.0f); - glm::vec3 const axisY(0.0f, 1.0f, 0.0f); - glm::vec3 const axisZ(0.0f, 0.0f, 1.0f); - - glm::vec4 const V1 = (glm::rotate(glm::mat4(1.0f), AngleY, axisY) * glm::rotate(glm::mat4(1.0f), AngleZ, axisZ)) * V; - glm::vec4 const V2 = glm::eulerAngleYZ(AngleY, AngleZ) * V; - glm::vec4 const V3 = glm::eulerAngleY(AngleY) * glm::eulerAngleZ(AngleZ) * V; - Error += glm::all(glm::epsilonEqual(V1, V2, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(V1, V3, 0.00001f)) ? 0 : 1; - - return Error; - } -}//namespace test_eulerAngleYZ - -namespace test_eulerAngleZY -{ - int test() - { - int Error = 0; - - glm::vec4 const V(1.0f); - - float const AngleY(glm::pi() * 0.5f); - float const AngleZ(glm::pi() * 0.25f); - - glm::vec3 const axisX(1.0f, 0.0f, 0.0f); - glm::vec3 const axisY(0.0f, 1.0f, 0.0f); - glm::vec3 const axisZ(0.0f, 0.0f, 1.0f); - - glm::vec4 const V1 = (glm::rotate(glm::mat4(1.0f), AngleZ, axisZ) * glm::rotate(glm::mat4(1.0f), AngleY, axisY)) * V; - glm::vec4 const V2 = glm::eulerAngleZY(AngleZ, AngleY) * V; - glm::vec4 const V3 = glm::eulerAngleZ(AngleZ) * glm::eulerAngleY(AngleY) * V; - Error += glm::all(glm::epsilonEqual(V1, V2, 0.00001f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(V1, V3, 0.00001f)) ? 0 : 1; - - return Error; - } -}//namespace test_eulerAngleZY - -namespace test_eulerAngleYXZ -{ - int test() - { - glm::f32 first = 1.046f; - glm::f32 second = 0.52f; - glm::f32 third = -0.785f; - - glm::fmat4 rotationEuler = glm::eulerAngleYXZ(first, second, third); - - glm::fmat4 rotationInvertedY = glm::eulerAngleY(-1.f*first) * glm::eulerAngleX(second) * glm::eulerAngleZ(third); - glm::fmat4 rotationDumb = glm::fmat4(); - rotationDumb = glm::rotate(rotationDumb, first, glm::fvec3(0,1,0)); - rotationDumb = glm::rotate(rotationDumb, second, glm::fvec3(1,0,0)); - rotationDumb = glm::rotate(rotationDumb, third, glm::fvec3(0,0,1)); - - std::printf("%s\n", glm::to_string(glm::fmat3(rotationEuler)).c_str()); - std::printf("%s\n", glm::to_string(glm::fmat3(rotationDumb)).c_str()); - std::printf("%s\n", glm::to_string(glm::fmat3(rotationInvertedY)).c_str()); - - std::printf("\nRESIDUAL\n"); - std::printf("%s\n", glm::to_string(glm::fmat3(rotationEuler-(rotationDumb))).c_str()); - std::printf("%s\n", glm::to_string(glm::fmat3(rotationEuler-(rotationInvertedY))).c_str()); - - return 0; - } -}//namespace eulerAngleYXZ - -namespace test_eulerAngles -{ - template - int test(TestRotationFunc testRotationFunc, glm::vec3 const& I, glm::vec3 const& J, glm::vec3 const& K) - { - int Error = 0; - - typedef glm::mat4::value_type value; - value const minAngle(-glm::pi()); - value const maxAngle(glm::pi()); - value const maxAngleWithDelta(maxAngle - 0.0000001f); - value const minMidAngle(-glm::pi() * 0.5f); - value const maxMidAngle(glm::pi() * 0.5f); - - std::vector testEulerAngles; - testEulerAngles.push_back(glm::vec3(1.046f, 0.52f, -0.785f)); - testEulerAngles.push_back(glm::vec3(minAngle, minMidAngle, minAngle)); - testEulerAngles.push_back(glm::vec3(minAngle, minMidAngle, maxAngle)); - testEulerAngles.push_back(glm::vec3(minAngle, minMidAngle, maxAngleWithDelta)); - testEulerAngles.push_back(glm::vec3(minAngle, maxMidAngle, minAngle)); - testEulerAngles.push_back(glm::vec3(minAngle, maxMidAngle, maxAngle)); - testEulerAngles.push_back(glm::vec3(minAngle, maxMidAngle, maxAngleWithDelta)); - testEulerAngles.push_back(glm::vec3(maxAngle, minMidAngle, minAngle)); - testEulerAngles.push_back(glm::vec3(maxAngle, minMidAngle, maxAngle)); - testEulerAngles.push_back(glm::vec3(maxAngle, minMidAngle, maxAngleWithDelta)); - testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, minMidAngle, maxAngle)); - testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, minMidAngle, maxAngleWithDelta)); - testEulerAngles.push_back(glm::vec3(maxAngle, maxMidAngle, minAngle)); - testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, maxMidAngle, minAngle)); - testEulerAngles.push_back(glm::vec3(maxAngle, maxMidAngle, maxAngle)); - testEulerAngles.push_back(glm::vec3(maxAngle, maxMidAngle, maxAngleWithDelta)); - testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, maxMidAngle, maxAngle)); - testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, maxMidAngle, maxAngleWithDelta)); - testEulerAngles.push_back(glm::vec3(minAngle, 0.0f, minAngle)); - testEulerAngles.push_back(glm::vec3(minAngle, 0.0f, maxAngle)); - testEulerAngles.push_back(glm::vec3(maxAngle, maxAngle, minAngle)); - testEulerAngles.push_back(glm::vec3(maxAngle, maxAngle, maxAngle)); - - for (size_t i = 0, size = testEulerAngles.size(); i < size; ++i) - { - glm::vec3 const& angles = testEulerAngles.at(i); - glm::mat4 const rotationEuler = testRotationFunc(angles.x, angles.y, angles.z); - - glm::mat4 rotationDumb = glm::diagonal4x4(glm::mat4::col_type(1.0f)); - rotationDumb = glm::rotate(rotationDumb, angles.x, I); - rotationDumb = glm::rotate(rotationDumb, angles.y, J); - rotationDumb = glm::rotate(rotationDumb, angles.z, K); - - glm::vec4 const V(1.0f,1.0f,1.0f,1.0f); - glm::vec4 const V1 = rotationEuler * V; - glm::vec4 const V2 = rotationDumb * V; - - Error += glm::all(glm::epsilonEqual(V1, V2, 0.00001f)) ? 0 : 1; - } - - return Error; - } -}//namespace test_extractsEulerAngles - -namespace test_extractsEulerAngles -{ - template - int test(RotationFunc rotationFunc, TestExtractionFunc testExtractionFunc) - { - int Error = 0; - - typedef glm::mat4::value_type value; - value const minAngle(-glm::pi()); - value const maxAngle(glm::pi()); - value const maxAngleWithDelta(maxAngle - 0.0000001f); - value const minMidAngle(-glm::pi() * 0.5f); - value const maxMidAngle(glm::pi() * 0.5f); - - std::vector testEulerAngles; - testEulerAngles.push_back(glm::vec3(1.046f, 0.52f, -0.785f)); - testEulerAngles.push_back(glm::vec3(minAngle, minMidAngle, minAngle)); - testEulerAngles.push_back(glm::vec3(minAngle, minMidAngle, maxAngle)); - testEulerAngles.push_back(glm::vec3(minAngle, minMidAngle, maxAngleWithDelta)); - testEulerAngles.push_back(glm::vec3(minAngle, maxMidAngle, minAngle)); - testEulerAngles.push_back(glm::vec3(minAngle, maxMidAngle, maxAngle)); - testEulerAngles.push_back(glm::vec3(minAngle, maxMidAngle, maxAngleWithDelta)); - testEulerAngles.push_back(glm::vec3(maxAngle, minMidAngle, minAngle)); - testEulerAngles.push_back(glm::vec3(maxAngle, minMidAngle, maxAngle)); - testEulerAngles.push_back(glm::vec3(maxAngle, minMidAngle, maxAngleWithDelta)); - testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, minMidAngle, maxAngle)); - testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, minMidAngle, maxAngleWithDelta)); - testEulerAngles.push_back(glm::vec3(maxAngle, maxMidAngle, minAngle)); - testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, maxMidAngle, minAngle)); - testEulerAngles.push_back(glm::vec3(maxAngle, maxMidAngle, maxAngle)); - testEulerAngles.push_back(glm::vec3(maxAngle, maxMidAngle, maxAngleWithDelta)); - testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, maxMidAngle, maxAngle)); - testEulerAngles.push_back(glm::vec3(maxAngleWithDelta, maxMidAngle, maxAngleWithDelta)); - testEulerAngles.push_back(glm::vec3(minAngle, 0.0f, minAngle)); - testEulerAngles.push_back(glm::vec3(minAngle, 0.0f, maxAngle)); - testEulerAngles.push_back(glm::vec3(maxAngle, maxAngle, minAngle)); - testEulerAngles.push_back(glm::vec3(maxAngle, maxAngle, maxAngle)); - - for (size_t i = 0, size = testEulerAngles.size(); i < size; ++i) - { - glm::vec3 const& angles = testEulerAngles.at(i); - glm::mat4 const rotation = rotationFunc(angles.x, angles.y, angles.z); - - glm::vec3 extractedEulerAngles(0.0f); - testExtractionFunc(rotation, extractedEulerAngles.x, extractedEulerAngles.y, extractedEulerAngles.z); - glm::mat4 const extractedRotation = rotationFunc(extractedEulerAngles.x, extractedEulerAngles.y, extractedEulerAngles.z); - - glm::vec4 const V(1.0f,1.0f,1.0f,1.0f); - glm::vec4 const V1 = rotation * V; - glm::vec4 const V2 = extractedRotation * V; - - Error += glm::all(glm::epsilonEqual(V1, V2, 0.00001f)) ? 0 : 1; - } - - return Error; - } -}//namespace test_extractsEulerAngles - -int main() -{ - int Error = 0; - - typedef glm::mat4::value_type value; - glm::vec3 const X(1.0f, 0.0f, 0.0f); - glm::vec3 const Y(0.0f, 1.0f, 0.0f); - glm::vec3 const Z(0.0f, 0.0f, 1.0f); - - Error += test_eulerAngleX::test(); - Error += test_eulerAngleY::test(); - Error += test_eulerAngleZ::test(); - - Error += test_derivedEulerAngles::test(glm::eulerAngleX, glm::derivedEulerAngleX, X); - Error += test_derivedEulerAngles::test(glm::eulerAngleY, glm::derivedEulerAngleY, Y); - Error += test_derivedEulerAngles::test(glm::eulerAngleZ, glm::derivedEulerAngleZ, Z); - - Error += test_eulerAngleXY::test(); - Error += test_eulerAngleYX::test(); - Error += test_eulerAngleXZ::test(); - Error += test_eulerAngleZX::test(); - Error += test_eulerAngleYZ::test(); - Error += test_eulerAngleZY::test(); - Error += test_eulerAngleYXZ::test(); - - Error += test_eulerAngles::test(glm::eulerAngleXZX, X, Z, X); - Error += test_eulerAngles::test(glm::eulerAngleXYX, X, Y, X); - Error += test_eulerAngles::test(glm::eulerAngleYXY, Y, X, Y); - Error += test_eulerAngles::test(glm::eulerAngleYZY, Y, Z, Y); - Error += test_eulerAngles::test(glm::eulerAngleZYZ, Z, Y, Z); - Error += test_eulerAngles::test(glm::eulerAngleZXZ, Z, X, Z); - Error += test_eulerAngles::test(glm::eulerAngleXZY, X, Z, Y); - Error += test_eulerAngles::test(glm::eulerAngleYZX, Y, Z, X); - Error += test_eulerAngles::test(glm::eulerAngleZYX, Z, Y, X); - Error += test_eulerAngles::test(glm::eulerAngleZXY, Z, X, Y); - - Error += test_extractsEulerAngles::test(glm::eulerAngleYXZ, glm::extractEulerAngleYXZ); - Error += test_extractsEulerAngles::test(glm::eulerAngleXZX, glm::extractEulerAngleXZX); - Error += test_extractsEulerAngles::test(glm::eulerAngleXYX, glm::extractEulerAngleXYX); - Error += test_extractsEulerAngles::test(glm::eulerAngleYXY, glm::extractEulerAngleYXY); - Error += test_extractsEulerAngles::test(glm::eulerAngleYZY, glm::extractEulerAngleYZY); - Error += test_extractsEulerAngles::test(glm::eulerAngleZYZ, glm::extractEulerAngleZYZ); - Error += test_extractsEulerAngles::test(glm::eulerAngleZXZ, glm::extractEulerAngleZXZ); - Error += test_extractsEulerAngles::test(glm::eulerAngleXZY, glm::extractEulerAngleXZY); - Error += test_extractsEulerAngles::test(glm::eulerAngleYZX, glm::extractEulerAngleYZX); - Error += test_extractsEulerAngles::test(glm::eulerAngleZYX, glm::extractEulerAngleZYX); - Error += test_extractsEulerAngles::test(glm::eulerAngleZXY, glm::extractEulerAngleZXY); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_extend.cpp b/3rdparty/glm/source/test/gtx/gtx_extend.cpp deleted file mode 100644 index 0c37df5..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_extend.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include - -int main() -{ - int Error(0); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_extended_min_max.cpp b/3rdparty/glm/source/test/gtx/gtx_extended_min_max.cpp deleted file mode 100644 index 3d20f10..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_extended_min_max.cpp +++ /dev/null @@ -1,101 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL - -#include -#include -#include -#include -#include - -// This file has divisions by zero to test isnan -#if GLM_COMPILER & GLM_COMPILER_VC -# pragma warning(disable : 4723) -#endif - -namespace fmin_ -{ - static int test() - { - int Error = 0; - - float Zero_f = 0.0f; - glm::vec1 A0 = glm::fmin(glm::vec1(1), glm::vec1(Zero_f / 0.0f)); - Error += glm::equal(A0.x, 1.0f, glm::epsilon()) ? 0 : 1; - - glm::vec1 A1 = glm::fmin(glm::vec1(Zero_f / 0.0f), glm::vec1(1)); - Error += glm::equal(A1.x, 1.0f, glm::epsilon()) ? 0 : 1; - - glm::vec2 B0 = glm::fmin(glm::vec2(1), glm::vec2(1)); - glm::vec2 B1 = glm::fmin(glm::vec2(1), 1.0f); - bool B2 = glm::all(glm::equal(B0, B1, glm::epsilon())); - Error += B2 ? 0 : 1; - - glm::vec3 C0 = glm::fmin(glm::vec3(1), glm::vec3(1)); - glm::vec3 C1 = glm::fmin(glm::vec3(1), 1.0f); - bool C2 = glm::all(glm::equal(C0, C1, glm::epsilon())); - Error += C2 ? 0 : 1; - - glm::vec4 D0 = glm::fmin(glm::vec4(1), glm::vec4(1)); - glm::vec4 D1 = glm::fmin(glm::vec4(1), 1.0f); - bool D2 = glm::all(glm::equal(D0, D1, glm::epsilon())); - Error += D2 ? 0 : 1; - - return Error; - } -}//namespace fmin_ - -namespace fmax_ -{ - static int test() - { - int Error = 0; - - float Zero_f = 0.0f; - glm::vec1 A0 = glm::fmax(glm::vec1(1), glm::vec1(Zero_f / 0.0f)); - Error += glm::equal(A0.x, 1.0f, glm::epsilon()) ? 0 : 1; - - glm::vec1 A1 = glm::fmax(glm::vec1(Zero_f / 0.0f), glm::vec1(1)); - Error += glm::equal(A0.x, 1.0f, glm::epsilon()) ? 0 : 1; - - glm::vec2 B0 = glm::fmax(glm::vec2(1), glm::vec2(1)); - glm::vec2 B1 = glm::fmax(glm::vec2(1), 1.0f); - bool B2 = glm::all(glm::equal(B0, B1, glm::epsilon())); - Error += B2 ? 0 : 1; - - glm::vec3 C0 = glm::fmax(glm::vec3(1), glm::vec3(1)); - glm::vec3 C1 = glm::fmax(glm::vec3(1), 1.0f); - bool C2 = glm::all(glm::equal(C0, C1, glm::epsilon())); - Error += C2 ? 0 : 1; - - glm::vec4 D0 = glm::fmax(glm::vec4(1), glm::vec4(1)); - glm::vec4 D1 = glm::fmax(glm::vec4(1), 1.0f); - bool D2 = glm::all(glm::equal(D0, D1, glm::epsilon())); - Error += D2 ? 0 : 1; - - return Error; - } -}//namespace fmax_ - -namespace fclamp_ -{ - static int test() - { - int Error = 0; - - float Zero_f = 0.0f; - glm::vec1 A0 = glm::fclamp(glm::vec1(1), glm::vec1(Zero_f / 0.0f), glm::vec1(2.0f)); - Error += glm::equal(A0.x, 1.0f, glm::epsilon()) ? 0 : 1; - - return Error; - } -}//namespace fclamp_ - -int main() -{ - int Error = 0; - - Error += fmin_::test(); - Error += fmax_::test(); - Error += fclamp_::test(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_extented_min_max.cpp b/3rdparty/glm/source/test/gtx/gtx_extented_min_max.cpp deleted file mode 100644 index c8c7847..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_extented_min_max.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @file test/gtx/gtx_extented_min_max.cpp -/// @date 2013-10-25 / 2014-11-25 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#include - -int main() -{ - int Error(0); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_exterior_product.cpp b/3rdparty/glm/source/test/gtx/gtx_exterior_product.cpp deleted file mode 100644 index a02c983..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_exterior_product.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include -#include -#include - -int main() -{ - int Error = 0; - - float const f = glm::cross(glm::vec2(1.0f, 1.0f), glm::vec2(1.0f, 1.0f)); - Error += glm::epsilonEqual(f, 0.0f, 0.001f) ? 0 : 1; - - return Error; -} - diff --git a/3rdparty/glm/source/test/gtx/gtx_fast_exponential.cpp b/3rdparty/glm/source/test/gtx/gtx_fast_exponential.cpp deleted file mode 100644 index 341e26e..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_fast_exponential.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include - -int main() -{ - int Error(0); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_fast_square_root.cpp b/3rdparty/glm/source/test/gtx/gtx_fast_square_root.cpp deleted file mode 100644 index 80d7fe4..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_fast_square_root.cpp +++ /dev/null @@ -1,45 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#include -#include -#include - -int test_fastInverseSqrt() -{ - int Error = 0; - - Error += glm::epsilonEqual(glm::fastInverseSqrt(1.0f), 1.0f, 0.01f) ? 0 : 1; - Error += glm::epsilonEqual(glm::fastInverseSqrt(1.0), 1.0, 0.01) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(glm::fastInverseSqrt(glm::vec2(1.0f)), glm::vec2(1.0f), 0.01f)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(glm::fastInverseSqrt(glm::dvec3(1.0)), glm::dvec3(1.0), 0.01)) ? 0 : 1; - Error += glm::all(glm::epsilonEqual(glm::fastInverseSqrt(glm::dvec4(1.0)), glm::dvec4(1.0), 0.01)) ? 0 : 1; - - return Error; -} - -int test_fastDistance() -{ - int Error = 0; - - float const A = glm::fastDistance(0.0f, 1.0f); - float const B = glm::fastDistance(glm::vec2(0.0f), glm::vec2(1.0f, 0.0f)); - float const C = glm::fastDistance(glm::vec3(0.0f), glm::vec3(1.0f, 0.0f, 0.0f)); - float const D = glm::fastDistance(glm::vec4(0.0f), glm::vec4(1.0f, 0.0f, 0.0f, 0.0f)); - - Error += glm::epsilonEqual(A, 1.0f, 0.01f) ? 0 : 1; - Error += glm::epsilonEqual(B, 1.0f, 0.01f) ? 0 : 1; - Error += glm::epsilonEqual(C, 1.0f, 0.01f) ? 0 : 1; - Error += glm::epsilonEqual(D, 1.0f, 0.01f) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_fastInverseSqrt(); - Error += test_fastDistance(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_fast_trigonometry.cpp b/3rdparty/glm/source/test/gtx/gtx_fast_trigonometry.cpp deleted file mode 100644 index 8bf86ba..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_fast_trigonometry.cpp +++ /dev/null @@ -1,564 +0,0 @@ -#include - -#define GLM_ENABLE_EXPERIMENTAL -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace fastCos -{ - int perf(bool NextFloat) - { - const float begin = -glm::pi(); - const float end = glm::pi(); - float result = 0.f; - - const std::clock_t timestamp1 = std::clock(); - for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f) - result = glm::fastCos(i); - - const std::clock_t timestamp2 = std::clock(); - for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f) - result = glm::cos(i); - - const std::clock_t timestamp3 = std::clock(); - const std::clock_t time_fast = timestamp2 - timestamp1; - const std::clock_t time_default = timestamp3 - timestamp2; - std::printf("fastCos Time %d clocks\n", static_cast(time_fast)); - std::printf("cos Time %d clocks\n", static_cast(time_default)); - - return time_fast <= time_default ? 0 : 1; - } -}//namespace fastCos - -namespace fastSin -{ - /* - float sin(float x) { - float temp; - temp = (x + M_PI) / ((2 * M_PI) - M_PI); - return limited_sin((x + M_PI) - ((2 * M_PI) - M_PI) * temp)); - } - */ - - int perf(bool NextFloat) - { - const float begin = -glm::pi(); - const float end = glm::pi(); - float result = 0.f; - - const std::clock_t timestamp1 = std::clock(); - for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f) - result = glm::fastSin(i); - - const std::clock_t timestamp2 = std::clock(); - for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f) - result = glm::sin(i); - - const std::clock_t timestamp3 = std::clock(); - const std::clock_t time_fast = timestamp2 - timestamp1; - const std::clock_t time_default = timestamp3 - timestamp2; - std::printf("fastSin Time %d clocks\n", static_cast(time_fast)); - std::printf("sin Time %d clocks\n", static_cast(time_default)); - - return time_fast <= time_default ? 0 : 1; - } -}//namespace fastSin - -namespace fastTan -{ - int perf(bool NextFloat) - { - const float begin = -glm::pi(); - const float end = glm::pi(); - float result = 0.f; - - const std::clock_t timestamp1 = std::clock(); - for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f) - result = glm::fastTan(i); - - const std::clock_t timestamp2 = std::clock(); - for (float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f) - result = glm::tan(i); - - const std::clock_t timestamp3 = std::clock(); - const std::clock_t time_fast = timestamp2 - timestamp1; - const std::clock_t time_default = timestamp3 - timestamp2; - std::printf("fastTan Time %d clocks\n", static_cast(time_fast)); - std::printf("tan Time %d clocks\n", static_cast(time_default)); - - return time_fast <= time_default ? 0 : 1; - } -}//namespace fastTan - -namespace fastAcos -{ - int perf(bool NextFloat) - { - const float begin = -glm::pi(); - const float end = glm::pi(); - float result = 0.f; - - const std::clock_t timestamp1 = std::clock(); - for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f) - result = glm::fastAcos(i); - - const std::clock_t timestamp2 = std::clock(); - for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f) - result = glm::acos(i); - - const std::clock_t timestamp3 = std::clock(); - const std::clock_t time_fast = timestamp2 - timestamp1; - const std::clock_t time_default = timestamp3 - timestamp2; - - std::printf("fastAcos Time %d clocks\n", static_cast(time_fast)); - std::printf("acos Time %d clocks\n", static_cast(time_default)); - - return time_fast <= time_default ? 0 : 1; - } -}//namespace fastAcos - -namespace fastAsin -{ - int perf(bool NextFloat) - { - const float begin = -glm::pi(); - const float end = glm::pi(); - float result = 0.f; - const std::clock_t timestamp1 = std::clock(); - for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f) - result = glm::fastAsin(i); - const std::clock_t timestamp2 = std::clock(); - for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f) - result = glm::asin(i); - const std::clock_t timestamp3 = std::clock(); - const std::clock_t time_fast = timestamp2 - timestamp1; - const std::clock_t time_default = timestamp3 - timestamp2; - std::printf("fastAsin Time %d clocks\n", static_cast(time_fast)); - std::printf("asin Time %d clocks\n", static_cast(time_default)); - - return time_fast <= time_default ? 0 : 1; - } -}//namespace fastAsin - -namespace fastAtan -{ - int perf(bool NextFloat) - { - const float begin = -glm::pi(); - const float end = glm::pi(); - float result = 0.f; - const std::clock_t timestamp1 = std::clock(); - for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f) - result = glm::fastAtan(i); - const std::clock_t timestamp2 = std::clock(); - for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f) - result = glm::atan(i); - const std::clock_t timestamp3 = std::clock(); - const std::clock_t time_fast = timestamp2 - timestamp1; - const std::clock_t time_default = timestamp3 - timestamp2; - std::printf("fastAtan Time %d clocks\n", static_cast(time_fast)); - std::printf("atan Time %d clocks\n", static_cast(time_default)); - - return time_fast <= time_default ? 0 : 1; - } -}//namespace fastAtan - -namespace taylorCos -{ - using glm::qualifier; - using glm::length_t; - - glm::vec4 const AngleShift(0.0f, glm::half_pi(), glm::pi(), glm::three_over_two_pi()); - - template - GLM_FUNC_QUALIFIER glm::vec taylorSeriesNewCos(glm::vec const& x) - { - glm::vec const Powed2(x * x); - glm::vec const Powed4(Powed2 * Powed2); - glm::vec const Powed6(Powed4 * Powed2); - glm::vec const Powed8(Powed4 * Powed4); - - return static_cast(1) - - Powed2 * static_cast(0.5) - + Powed4 * static_cast(0.04166666666666666666666666666667) - - Powed6 * static_cast(0.00138888888888888888888888888889) - + Powed8 * static_cast(2.4801587301587301587301587301587e-5); - } - - template - GLM_FUNC_QUALIFIER glm::vec taylorSeriesNewCos6(glm::vec const& x) - { - glm::vec const Powed2(x * x); - glm::vec const Powed4(Powed2 * Powed2); - glm::vec const Powed6(Powed4 * Powed2); - - return static_cast(1) - - Powed2 * static_cast(0.5) - + Powed4 * static_cast(0.04166666666666666666666666666667) - - Powed6 * static_cast(0.00138888888888888888888888888889); - } - - template - GLM_FUNC_QUALIFIER glm::vec fastAbs(glm::vec x) - { - int* Pointer = reinterpret_cast(&x[0]); - Pointer[0] &= 0x7fffffff; - Pointer[1] &= 0x7fffffff; - Pointer[2] &= 0x7fffffff; - Pointer[3] &= 0x7fffffff; - return x; - } - - template - GLM_FUNC_QUALIFIER glm::vec fastCosNew(glm::vec const& x) - { - glm::vec const Angle0_PI(fastAbs(fmod(x + glm::pi(), glm::two_pi()) - glm::pi())); - return taylorSeriesNewCos6(x); -/* - vec const FirstQuarterPi(lessThanEqual(Angle0_PI, vec(glm::half_pi()))); - - vec const RevertAngle(mix(vec(glm::pi()), vec(0), FirstQuarterPi)); - vec const ReturnSign(mix(vec(-1), vec(1), FirstQuarterPi)); - vec const SectionAngle(RevertAngle - Angle0_PI); - - return ReturnSign * taylorSeriesNewCos(SectionAngle); -*/ - } - - int perf_fastCosNew(float Begin, float End, std::size_t Samples) - { - std::vector Results; - Results.resize(Samples); - - float const Steps = (End - Begin) / static_cast(Samples); - - std::clock_t const TimeStampBegin = std::clock(); - - for(std::size_t i = 0; i < Samples; ++i) - Results[i] = fastCosNew(AngleShift + glm::vec4(Begin + Steps * static_cast(i))); - - std::clock_t const TimeStampEnd = std::clock(); - - std::printf("fastCosNew %d clocks\n", static_cast(TimeStampEnd - TimeStampBegin)); - - int Error = 0; - for(std::size_t i = 0; i < Samples; ++i) - Error += Results[i].x >= -1.0f && Results[i].x <= 1.0f ? 0 : 1; - return Error; - } - - template - GLM_FUNC_QUALIFIER glm::vec deterministic_fmod(glm::vec const& x, T y) - { - return x - y * trunc(x / y); - } - - template - GLM_FUNC_QUALIFIER glm::vec fastCosDeterminisctic(glm::vec const& x) - { - glm::vec const Angle0_PI(abs(deterministic_fmod(x + glm::pi(), glm::two_pi()) - glm::pi())); - glm::vec const FirstQuarterPi(lessThanEqual(Angle0_PI, glm::vec(glm::half_pi()))); - - glm::vec const RevertAngle(mix(glm::vec(glm::pi()), glm::vec(0), FirstQuarterPi)); - glm::vec const ReturnSign(mix(glm::vec(-1), glm::vec(1), FirstQuarterPi)); - glm::vec const SectionAngle(RevertAngle - Angle0_PI); - - return ReturnSign * taylorSeriesNewCos(SectionAngle); - } - - int perf_fastCosDeterminisctic(float Begin, float End, std::size_t Samples) - { - std::vector Results; - Results.resize(Samples); - - float const Steps = (End - Begin) / static_cast(Samples); - - std::clock_t const TimeStampBegin = std::clock(); - - for(std::size_t i = 0; i < Samples; ++i) - Results[i] = taylorCos::fastCosDeterminisctic(AngleShift + glm::vec4(Begin + Steps * static_cast(i))); - - std::clock_t const TimeStampEnd = std::clock(); - - std::printf("fastCosDeterminisctic %d clocks\n", static_cast(TimeStampEnd - TimeStampBegin)); - - int Error = 0; - for(std::size_t i = 0; i < Samples; ++i) - Error += Results[i].x >= -1.0f && Results[i].x <= 1.0f ? 0 : 1; - return Error; - } - - template - GLM_FUNC_QUALIFIER glm::vec taylorSeriesRefCos(glm::vec const& x) - { - return static_cast(1) - - (x * x) / glm::factorial(static_cast(2)) - + (x * x * x * x) / glm::factorial(static_cast(4)) - - (x * x * x * x * x * x) / glm::factorial(static_cast(6)) - + (x * x * x * x * x * x * x * x) / glm::factorial(static_cast(8)); - } - - template - GLM_FUNC_QUALIFIER glm::vec fastRefCos(glm::vec const& x) - { - glm::vec const Angle0_PI(glm::abs(fmod(x + glm::pi(), glm::two_pi()) - glm::pi())); -// return taylorSeriesRefCos(Angle0_PI); - - glm::vec const FirstQuarterPi(lessThanEqual(Angle0_PI, glm::vec(glm::half_pi()))); - - glm::vec const RevertAngle(mix(glm::vec(glm::pi()), glm::vec(0), FirstQuarterPi)); - glm::vec const ReturnSign(mix(glm::vec(-1), glm::vec(1), FirstQuarterPi)); - glm::vec const SectionAngle(RevertAngle - Angle0_PI); - - return ReturnSign * taylorSeriesRefCos(SectionAngle); - } - - int perf_fastCosRef(float Begin, float End, std::size_t Samples) - { - std::vector Results; - Results.resize(Samples); - - float const Steps = (End - Begin) / static_cast(Samples); - - std::clock_t const TimeStampBegin = std::clock(); - - for(std::size_t i = 0; i < Samples; ++i) - Results[i] = taylorCos::fastRefCos(AngleShift + glm::vec4(Begin + Steps * static_cast(i))); - - std::clock_t const TimeStampEnd = std::clock(); - - std::printf("fastCosRef %d clocks\n", static_cast(TimeStampEnd - TimeStampBegin)); - - int Error = 0; - for(std::size_t i = 0; i < Samples; ++i) - Error += Results[i].x >= -1.0f && Results[i].x <= 1.0f ? 0 : 1; - return Error; - } - - int perf_fastCosOld(float Begin, float End, std::size_t Samples) - { - std::vector Results; - Results.resize(Samples); - - float const Steps = (End - Begin) / static_cast(Samples); - - std::clock_t const TimeStampBegin = std::clock(); - - for(std::size_t i = 0; i < Samples; ++i) - Results[i] = glm::fastCos(AngleShift + glm::vec4(Begin + Steps * static_cast(i))); - - std::clock_t const TimeStampEnd = std::clock(); - - std::printf("fastCosOld %d clocks\n", static_cast(TimeStampEnd - TimeStampBegin)); - - int Error = 0; - for(std::size_t i = 0; i < Samples; ++i) - Error += Results[i].x >= -1.0f && Results[i].x <= 1.0f ? 0 : 1; - return Error; - } - - int perf_cos(float Begin, float End, std::size_t Samples) - { - std::vector Results; - Results.resize(Samples); - - float const Steps = (End - Begin) / static_cast(Samples); - - std::clock_t const TimeStampBegin = std::clock(); - - for(std::size_t i = 0; i < Samples; ++i) - Results[i] = glm::cos(AngleShift + glm::vec4(Begin + Steps * static_cast(i))); - - std::clock_t const TimeStampEnd = std::clock(); - - std::printf("cos %d clocks\n", static_cast(TimeStampEnd - TimeStampBegin)); - - int Error = 0; - for(std::size_t i = 0; i < Samples; ++i) - Error += Results[i].x >= -1.0f && Results[i].x <= 1.0f ? 0 : 1; - return Error; - } - - int perf(std::size_t const Samples) - { - int Error = 0; - - float const Begin = -glm::pi(); - float const End = glm::pi(); - - Error += perf_cos(Begin, End, Samples); - Error += perf_fastCosOld(Begin, End, Samples); - Error += perf_fastCosRef(Begin, End, Samples); - //Error += perf_fastCosNew(Begin, End, Samples); - Error += perf_fastCosDeterminisctic(Begin, End, Samples); - - return Error; - } - - int test() - { - int Error = 0; - - //for(float Angle = -4.0f * glm::pi(); Angle < 4.0f * glm::pi(); Angle += 0.1f) - //for(float Angle = -720.0f; Angle < 720.0f; Angle += 0.1f) - for(float Angle = 0.0f; Angle < 180.0f; Angle += 0.1f) - { - float const modAngle = std::fmod(glm::abs(Angle), 360.f); - assert(modAngle >= 0.0f && modAngle <= 360.f); - float const radAngle = glm::radians(modAngle); - float const Cos0 = std::cos(radAngle); - - float const Cos1 = taylorCos::fastRefCos(glm::fvec1(radAngle)).x; - Error += glm::abs(Cos1 - Cos0) < 0.1f ? 0 : 1; - - //float const Cos2 = taylorCos::fastCosNew(glm::fvec1(radAngle)).x; - //Error += glm::abs(Cos2 - Cos0) < 0.1f ? 0 : 1; - - assert(!Error); - } - - return Error; - } -}//namespace taylorCos - -namespace taylor2 -{ - glm::vec4 const AngleShift(0.0f, glm::pi() * 0.5f, glm::pi() * 1.0f, glm::pi() * 1.5f); - - float taylorCosA(float x) - { - return 1.f - - (x * x) * (1.f / 2.f) - + (x * x * x * x) * (1.f / 24.f) - - (x * x * x * x * x * x) * (1.f / 720.f) - + (x * x * x * x * x * x * x * x) * (1.f / 40320.f); - } - - float taylorCosB(float x) - { - return 1.f - - (x * x) * (1.f / 2.f) - + (x * x * x * x) * (1.f / 24.f) - - (x * x * x * x * x * x) * (1.f / 720.f) - + (x * x * x * x * x * x * x * x) * (1.f / 40320.f); - } - - float taylorCosC(float x) - { - return 1.f - - (x * x) * (1.f / 2.f) - + ((x * x) * (x * x)) * (1.f / 24.f) - - (((x * x) * (x * x)) * (x * x)) * (1.f / 720.f) - + (((x * x) * (x * x)) * ((x * x) * (x * x))) * (1.f / 40320.f); - } - - int perf_taylorCosA(float Begin, float End, std::size_t Samples) - { - std::vector Results; - Results.resize(Samples); - - float const Steps = (End - Begin) / static_cast(Samples); - - std::clock_t const TimeStampBegin = std::clock(); - - for(std::size_t i = 0; i < Samples; ++i) - Results[i] = taylorCosA(AngleShift.x + Begin + Steps * static_cast(i)); - - std::clock_t const TimeStampEnd = std::clock(); - - std::printf("taylorCosA %d clocks\n", static_cast(TimeStampEnd - TimeStampBegin)); - - int Error = 0; - for(std::size_t i = 0; i < Samples; ++i) - Error += Results[i] >= -1.0f && Results[i] <= 1.0f ? 0 : 1; - return Error; - } - - int perf_taylorCosB(float Begin, float End, std::size_t Samples) - { - std::vector Results; - Results.resize(Samples); - - float const Steps = (End - Begin) / static_cast(Samples); - - std::clock_t const TimeStampBegin = std::clock(); - - for(std::size_t i = 0; i < Samples; ++i) - Results[i] = taylorCosB(AngleShift.x + Begin + Steps * static_cast(i)); - - std::clock_t const TimeStampEnd = std::clock(); - - std::printf("taylorCosB %d clocks\n", static_cast(TimeStampEnd - TimeStampBegin)); - - int Error = 0; - for(std::size_t i = 0; i < Samples; ++i) - Error += Results[i] >= -1.0f && Results[i] <= 1.0f ? 0 : 1; - return Error; - } - - int perf_taylorCosC(float Begin, float End, std::size_t Samples) - { - std::vector Results; - Results.resize(Samples); - - float const Steps = (End - Begin) / static_cast(Samples); - - std::clock_t const TimeStampBegin = std::clock(); - - for(std::size_t i = 0; i < Samples; ++i) - Results[i] = taylorCosC(AngleShift.x + Begin + Steps * static_cast(i)); - - std::clock_t const TimeStampEnd = std::clock(); - - std::printf("taylorCosC %d clocks\n", static_cast(TimeStampEnd - TimeStampBegin)); - - int Error = 0; - for(std::size_t i = 0; i < Samples; ++i) - Error += Results[i] >= -1.0f && Results[i] <= 1.0f ? 0 : 1; - return Error; - } - - int perf(std::size_t Samples) - { - int Error = 0; - - float const Begin = -glm::pi(); - float const End = glm::pi(); - - Error += perf_taylorCosA(Begin, End, Samples); - Error += perf_taylorCosB(Begin, End, Samples); - Error += perf_taylorCosC(Begin, End, Samples); - - return Error; - } - -}//namespace taylor2 - -int main() -{ - int Error(0); - - Error += ::taylor2::perf(1000); - Error += ::taylorCos::test(); - Error += ::taylorCos::perf(1000); - -# ifdef NDEBUG - ::fastCos::perf(false); - ::fastSin::perf(false); - ::fastTan::perf(false); - ::fastAcos::perf(false); - ::fastAsin::perf(false); - ::fastAtan::perf(false); -# endif//NDEBUG - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_functions.cpp b/3rdparty/glm/source/test/gtx/gtx_functions.cpp deleted file mode 100644 index 48a6af0..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_functions.cpp +++ /dev/null @@ -1,36 +0,0 @@ -#include -#include -#include - -int test_gauss_1d() -{ - int Error = 0; - - std::vector Result(20); - for(std::size_t i = 0, n = Result.size(); i < n; ++i) - Result[i] = glm::gauss(static_cast(i) * 0.1f, 0.0f, 1.0f); - - return Error; -} - -int test_gauss_2d() -{ - int Error = 0; - - std::vector Result(20); - for(std::size_t i = 0, n = Result.size(); i < n; ++i) - Result[i] = glm::gauss(glm::vec2(static_cast(i)) * 0.1f, glm::vec2(0.0f), glm::vec2(1.0f)); - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_gauss_1d(); - Error += test_gauss_2d(); - - return Error; -} - diff --git a/3rdparty/glm/source/test/gtx/gtx_gradient_paint.cpp b/3rdparty/glm/source/test/gtx/gtx_gradient_paint.cpp deleted file mode 100644 index 01f521b..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_gradient_paint.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include - -int test_radialGradient() -{ - int Error = 0; - - float Gradient = glm::radialGradient(glm::vec2(0), 1.0f, glm::vec2(1), glm::vec2(0.5)); - Error += Gradient != 0.0f ? 0 : 1; - - return Error; -} - -int test_linearGradient() -{ - int Error = 0; - - float Gradient = glm::linearGradient(glm::vec2(0), glm::vec2(1), glm::vec2(0.5)); - Error += Gradient != 0.0f ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_radialGradient(); - Error += test_linearGradient(); - - return Error; -} - - diff --git a/3rdparty/glm/source/test/gtx/gtx_handed_coordinate_space.cpp b/3rdparty/glm/source/test/gtx/gtx_handed_coordinate_space.cpp deleted file mode 100644 index e417688..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_handed_coordinate_space.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include - -int main() -{ - int Error(0); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_int_10_10_10_2.cpp b/3rdparty/glm/source/test/gtx/gtx_int_10_10_10_2.cpp deleted file mode 100644 index ab59bb2..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_int_10_10_10_2.cpp +++ /dev/null @@ -1,18 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2013-10-25 -// Updated : 2013-10-25 -// Licence : This source is under MIT licence -// File : test/gtx/associated_min_max.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include -#include - -int main() -{ - int Error(0); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_integer.cpp b/3rdparty/glm/source/test/gtx/gtx_integer.cpp deleted file mode 100644 index 4c4225d..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_integer.cpp +++ /dev/null @@ -1,108 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#include -#include -#include -/* -int test_floor_log2() -{ - int Error = 0; - - for(std::size_t i = 1; i < 1000000; ++i) - { - glm::uint A = glm::floor_log2(glm::uint(i)); - glm::uint B = glm::uint(glm::floor(glm::log2(double(i)))); // Will fail with float, lack of accuracy - - Error += A == B ? 0 : 1; - assert(!Error); - } - - return Error; -} -*/ -int test_log2() -{ - int Error = 0; - - for(std::size_t i = 1; i < 24; ++i) - { - glm::uint A = glm::log2(glm::uint(1 << i)); - glm::uint B = glm::uint(glm::log2(double(1 << i))); - - //Error += glm::equalEpsilon(double(A), B, 1.0) ? 0 : 1; - Error += glm::abs(double(A) - B) <= 24 ? 0 : 1; - assert(!Error); - - std::printf("Log2(%d) error A=%d, B=%d\n", 1 << i, A, B); - } - - std::printf("log2 error=%d\n", Error); - - return Error; -} - -int test_nlz() -{ - int Error = 0; - - for(glm::uint i = 1; i < glm::uint(33); ++i) - Error += glm::nlz(i) == glm::uint(31u) - glm::findMSB(i) ? 0 : 1; - //printf("%d, %d\n", glm::nlz(i), 31u - glm::findMSB(i)); - - return Error; -} - -int test_pow_uint() -{ - int Error = 0; - - glm::uint const p0 = glm::pow(2u, 0u); - Error += p0 == 1u ? 0 : 1; - - glm::uint const p1 = glm::pow(2u, 1u); - Error += p1 == 2u ? 0 : 1; - - glm::uint const p2 = glm::pow(2u, 2u); - Error += p2 == 4u ? 0 : 1; - - return Error; -} - -int test_pow_int() -{ - int Error = 0; - - int const p0 = glm::pow(2, 0u); - Error += p0 == 1 ? 0 : 1; - - int const p1 = glm::pow(2, 1u); - Error += p1 == 2 ? 0 : 1; - - int const p2 = glm::pow(2, 2u); - Error += p2 == 4 ? 0 : 1; - - int const p0n = glm::pow(-2, 0u); - Error += p0n == -1 ? 0 : 1; - - int const p1n = glm::pow(-2, 1u); - Error += p1n == -2 ? 0 : 1; - - int const p2n = glm::pow(-2, 2u); - Error += p2n == 4 ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_nlz(); -// Error += test_floor_log2(); - Error += test_log2(); - Error += test_pow_uint(); - Error += test_pow_int(); - - return Error; -} - diff --git a/3rdparty/glm/source/test/gtx/gtx_intersect.cpp b/3rdparty/glm/source/test/gtx/gtx_intersect.cpp deleted file mode 100644 index c4a1b2a..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_intersect.cpp +++ /dev/null @@ -1,88 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#include -#include - -int test_intersectRayPlane() -{ - int Error = 0; - glm::vec3 const PlaneOrigin(0, 0, 1); - glm::vec3 const PlaneNormal(0, 0, -1); - glm::vec3 const RayOrigin(0, 0, 0); - glm::vec3 const RayDir(0, 0, 1); - - // check that inversion of the plane normal has no effect - { - float Distance = 0; - bool const Result = glm::intersectRayPlane(RayOrigin, RayDir, PlaneOrigin, PlaneNormal, Distance); - Error += glm::abs(Distance - 1.f) <= std::numeric_limits::epsilon() ? 0 : 1; - Error += Result ? 0 : 1; - } - { - float Distance = 0; - bool const Result = glm::intersectRayPlane(RayOrigin, RayDir, PlaneOrigin, -1.f * PlaneNormal, Distance); - Error += glm::abs(Distance - 1.f) <= std::numeric_limits::epsilon() ? 0 : 1; - Error += Result ? 0 : 1; - } - - // check if plane is before of behind the ray origin - { - float Distance = 9.9999f; // value should not be changed - bool const Result = glm::intersectRayPlane(RayOrigin, RayDir, -1.f * PlaneOrigin, PlaneNormal, Distance); - Error += glm::abs(Distance - 9.9999f) <= std::numeric_limits::epsilon() ? 0 : 1; - Error += Result ? 1 : 0; // there is no intersection in front of the ray origin, only behind - } - - return Error; -} - -int test_intersectRayTriangle() -{ - int Error = 0; - - glm::vec3 const Orig(0, 0, 2); - glm::vec3 const Dir(0, 0, -1); - glm::vec3 const Vert0(0, 0, 0); - glm::vec3 const Vert1(-1, -1, 0); - glm::vec3 const Vert2(1, -1, 0); - glm::vec2 BaryPosition(0); - float Distance = 0; - - bool const Result = glm::intersectRayTriangle(Orig, Dir, Vert0, Vert1, Vert2, BaryPosition, Distance); - - Error += glm::all(glm::epsilonEqual(BaryPosition, glm::vec2(0), std::numeric_limits::epsilon())) ? 0 : 1; - Error += glm::abs(Distance - 2.f) <= std::numeric_limits::epsilon() ? 0 : 1; - Error += Result ? 0 : 1; - - return Error; -} - -int test_intersectLineTriangle() -{ - int Error = 0; - - glm::vec3 const Orig(0, 0, 2); - glm::vec3 const Dir(0, 0, -1); - glm::vec3 const Vert0(0, 0, 0); - glm::vec3 const Vert1(-1, -1, 0); - glm::vec3 const Vert2(1, -1, 0); - glm::vec3 Position(2.0f, 0.0f, 0.0f); - - bool const Result = glm::intersectLineTriangle(Orig, Dir, Vert0, Vert1, Vert2, Position); - - Error += glm::all(glm::epsilonEqual(Position, glm::vec3(2.0f, 0.0f, 0.0f), std::numeric_limits::epsilon())) ? 0 : 1; - Error += Result ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_intersectRayPlane(); - Error += test_intersectRayTriangle(); - Error += test_intersectLineTriangle(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_io.cpp b/3rdparty/glm/source/test/gtx/gtx_io.cpp deleted file mode 100644 index 7d90fd7..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_io.cpp +++ /dev/null @@ -1,186 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#if GLM_LANG & GLM_LANG_CXXMS_FLAG -#include -#include -#include -#include -#include - -namespace -{ - template - std::basic_ostream& operator<<(std::basic_ostream& os, glm::qualifier const& a) - { - typename std::basic_ostream::sentry const cerberus(os); - - if (cerberus) - { - switch (a) { - case glm::highp: os << "uhi"; break; - case glm::mediump: os << "umd"; break; - case glm::lowp: os << "ulo"; break; -# if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE - case glm::aligned_highp: os << "ahi"; break; - case glm::aligned_mediump: os << "amd"; break; - case glm::aligned_lowp: os << "alo"; break; -# endif - } - } - - return os; - } - - template - std::basic_string type_name(std::basic_ostream&, T const&) - { - std::basic_ostringstream ostr; - - if (typeid(T) == typeid(glm::qua)) { ostr << "quat"; } - else if (typeid(T) == typeid(glm::vec<2, U,P>)) { ostr << "vec2"; } - else if (typeid(T) == typeid(glm::vec<3, U,P>)) { ostr << "vec3"; } - else if (typeid(T) == typeid(glm::vec<4, U,P>)) { ostr << "vec4"; } - else if (typeid(T) == typeid(glm::mat<2, 2, U,P>)) { ostr << "mat2x2"; } - else if (typeid(T) == typeid(glm::mat<2, 3, U,P>)) { ostr << "mat2x3"; } - else if (typeid(T) == typeid(glm::mat<2, 4, U,P>)) { ostr << "mat2x4"; } - else if (typeid(T) == typeid(glm::mat<3, 2, U,P>)) { ostr << "mat3x2"; } - else if (typeid(T) == typeid(glm::mat<3, 3, U,P>)) { ostr << "mat3x3"; } - else if (typeid(T) == typeid(glm::mat<3, 4, U,P>)) { ostr << "mat3x4"; } - else if (typeid(T) == typeid(glm::mat<4, 2, U,P>)) { ostr << "mat4x2"; } - else if (typeid(T) == typeid(glm::mat<4, 3, U,P>)) { ostr << "mat4x3"; } - else if (typeid(T) == typeid(glm::mat<4, 4, U,P>)) { ostr << "mat4x4"; } - else { ostr << "unknown"; } - - ostr << '<' << typeid(U).name() << ',' << P << '>'; - - return ostr.str(); - } -} // namespace { - -template -int test_io_quat(OS& os) -{ - os << '\n' << typeid(OS).name() << '\n'; - - glm::qua const q(1, 0, 0, 0); - - { - glm::io::basic_format_saver const iofs(os); - - os << glm::io::precision(2) << glm::io::width(1 + 2 + 1 + 2) - << type_name(os, q) << ": " << q << '\n'; - } - - { - glm::io::basic_format_saver const iofs(os); - - os << glm::io::unformatted - << type_name(os, q) << ": " << q << '\n'; - } - - return 0; -} - -template -int test_io_vec(OS& os) -{ - os << '\n' << typeid(OS).name() << '\n'; - - glm::vec<2, T,P> const v2(0, 1); - glm::vec<3, T,P> const v3(2, 3, 4); - glm::vec<4, T,P> const v4(5, 6, 7, 8); - - os << type_name(os, v2) << ": " << v2 << '\n' - << type_name(os, v3) << ": " << v3 << '\n' - << type_name(os, v4) << ": " << v4 << '\n'; - - glm::io::basic_format_saver const iofs(os); - - os << glm::io::precision(2) << glm::io::width(1 + 2 + 1 + 2) - << type_name(os, v2) << ": " << v2 << '\n' - << type_name(os, v3) << ": " << v3 << '\n' - << type_name(os, v4) << ": " << v4 << '\n'; - - return 0; -} - -template -int test_io_mat(OS& os, glm::io::order_type otype) -{ - os << '\n' << typeid(OS).name() << '\n'; - - glm::vec<2, T,P> const v2_1( 0, 1); - glm::vec<2, T,P> const v2_2( 2, 3); - glm::vec<2, T,P> const v2_3( 4, 5); - glm::vec<2, T,P> const v2_4( 6, 7); - glm::vec<3, T,P> const v3_1( 8, 9, 10); - glm::vec<3, T,P> const v3_2(11, 12, 13); - glm::vec<3, T,P> const v3_3(14, 15, 16); - glm::vec<3, T,P> const v3_4(17, 18, 19); - glm::vec<4, T,P> const v4_1(20, 21, 22, 23); - glm::vec<4, T,P> const v4_2(24, 25, 26, 27); - glm::vec<4, T,P> const v4_3(28, 29, 30, 31); - glm::vec<4, T,P> const v4_4(32, 33, 34, 35); - - glm::io::basic_format_saver const iofs(os); - - os << glm::io::precision(2) << glm::io::width(1 + 2 + 1 + 2) - << glm::io::order(otype) - << "mat2x2<" << typeid(T).name() << ',' << P << ">: " << glm::mat<2, 2, T,P>(v2_1, v2_2) << '\n' - << "mat2x3<" << typeid(T).name() << ',' << P << ">: " << glm::mat<2, 3, T,P>(v3_1, v3_2) << '\n' - << "mat2x4<" << typeid(T).name() << ',' << P << ">: " << glm::mat<2, 4, T,P>(v4_1, v4_2) << '\n' - << "mat3x2<" << typeid(T).name() << ',' << P << ">: " << glm::mat<3, 2, T,P>(v2_1, v2_2, v2_3) << '\n' - << "mat3x3<" << typeid(T).name() << ',' << P << ">: " << glm::mat<3, 3, T,P>(v3_1, v3_2, v3_3) << '\n' - << "mat3x4<" << typeid(T).name() << ',' << P << ">: " << glm::mat<3, 4, T,P>(v4_1, v4_2, v4_3) << '\n' - << "mat4x2<" << typeid(T).name() << ',' << P << ">: " << glm::mat<4, 2, T,P>(v2_1, v2_2, v2_3, v2_4) << '\n' - << "mat4x3<" << typeid(T).name() << ',' << P << ">: " << glm::mat<4, 3, T,P>(v3_1, v3_2, v3_3, v3_4) << '\n' - << "mat4x4<" << typeid(T).name() << ',' << P << ">: " << glm::mat<4, 4, T,P>(v4_1, v4_2, v4_3, v4_4) << '\n'; - - os << glm::io::unformatted - << glm::io::order(otype) - << "mat2x2<" << typeid(T).name() << ',' << P << ">: " << glm::mat<2, 2, T,P>(v2_1, v2_2) << '\n' - << "mat2x3<" << typeid(T).name() << ',' << P << ">: " << glm::mat<2, 3, T,P>(v3_1, v3_2) << '\n' - << "mat2x4<" << typeid(T).name() << ',' << P << ">: " << glm::mat<2, 4, T,P>(v4_1, v4_2) << '\n' - << "mat3x2<" << typeid(T).name() << ',' << P << ">: " << glm::mat<3, 2, T,P>(v2_1, v2_2, v2_3) << '\n' - << "mat3x3<" << typeid(T).name() << ',' << P << ">: " << glm::mat<3, 3, T,P>(v3_1, v3_2, v3_3) << '\n' - << "mat3x4<" << typeid(T).name() << ',' << P << ">: " << glm::mat<3, 4, T,P>(v4_1, v4_2, v4_3) << '\n' - << "mat4x2<" << typeid(T).name() << ',' << P << ">: " << glm::mat<4, 2, T,P>(v2_1, v2_2, v2_3, v2_4) << '\n' - << "mat4x3<" << typeid(T).name() << ',' << P << ">: " << glm::mat<4, 3, T,P>(v3_1, v3_2, v3_3, v3_4) << '\n' - << "mat4x4<" << typeid(T).name() << ',' << P << ">: " << glm::mat<4, 4, T,P>(v4_1, v4_2, v4_3, v4_4) << '\n'; - - return 0; -} - -int main() -{ - int Error(0); - - Error += test_io_quat(std::cout); - Error += test_io_quat(std::wcout); - Error += test_io_quat(std::cout); - Error += test_io_quat(std::wcout); - Error += test_io_quat(std::cout); - Error += test_io_quat(std::wcout); - - Error += test_io_vec(std::cout); - Error += test_io_vec(std::wcout); - Error += test_io_vec(std::cout); - Error += test_io_vec(std::wcout); - Error += test_io_vec(std::cout); - Error += test_io_vec(std::wcout); - - Error += test_io_mat(std::cout, glm::io::column_major); - Error += test_io_mat(std::wcout, glm::io::column_major); - Error += test_io_mat(std::cout, glm::io::row_major); - Error += test_io_mat(std::wcout, glm::io::row_major); - - return Error; -} -#else - -int main() -{ - return 0; -} - -#endif// GLM_LANG & GLM_LANG_CXXMS_FLAG diff --git a/3rdparty/glm/source/test/gtx/gtx_load.cpp b/3rdparty/glm/source/test/gtx/gtx_load.cpp deleted file mode 100644 index 1467b9b..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_load.cpp +++ /dev/null @@ -1,124 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -/* -#if GLM_CONFIG_SIMD == GLM_ENABLE - -#include -#include -#include -#include -#include - -namespace glm -{ - enum genTypeEnum - { - QUALIFIER_HIGHP, - QUALIFIER_MEDIUMP, - QUALIFIER_LOWP - }; - - template - struct genTypeTrait - {}; - - template - struct genTypeTrait > - { - static const genTypeEnum GENTYPE = QUALIFIER_HIGHP; - }; - - template - struct genTypeTrait > - { - static const genTypeEnum GENTYPE = QUALIFIER_MEDIUMP; - }; - - template - struct genTypeTrait > - { - static const genTypeEnum GENTYPE = QUALIFIER_LOWP; - }; - - template - struct load_gentype - { - - }; - -# if GLM_ARCH & GLM_ARCH_SSE_BIT - template - struct load_gentype<4, float, Q, true> - { - GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, float, Q> load(float const* Mem) - { - vec<4, float, Q> Result; - Result.data = _mm_loadu_ps(Mem); - return Result; - } - }; -# endif//GLM_ARCH & GLM_ARCH_SSE_BIT - - template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType example_identity() - { - return detail::init_gentype::GENTYPE>::identity(); - } - - template - genType load(valType const* Mem) - { - - } - - aligned_vec4 loadu(float const* Mem) - { - aligned_vec4 Result; -# if GLM_ARCH & GLM_ARCH_SSE_BIT - Result.data = _mm_loadu_ps(Mem); -# else - Result[0] = *(Mem + 0); - Result[1] = *(Mem + 1); - Result[2] = *(Mem + 2); - Result[3] = *(Mem + 3); -# endif//GLM_ARCH & GLM_ARCH_SSE_BIT - return Result; - } - - aligned_vec4 loada(float const* Mem) - { - aligned_vec4 Result; -# if GLM_ARCH & GLM_ARCH_SSE_BIT - Result.data = _mm_load_ps(Mem); -# else - Result[0] = *(Mem + 0); - Result[1] = *(Mem + 1); - Result[2] = *(Mem + 2); - Result[3] = *(Mem + 3); -# endif//GLM_ARCH & GLM_ARCH_SSE_BIT - return Result; - } -}//namespace glm - -int test_vec4_load() -{ - int Error = 0; - - float Data[] = {1.f, 2.f, 3.f, 4.f}; - glm::aligned_vec4 const V = glm::loadu(Data); - Error += glm::all(glm::equal(V, glm::aligned_vec4(1.f, 2.f, 3.f, 4.f), glm::epsilon())) ? 0 : 1; - - return Error; -} -#endif -*/ -int main() -{ - int Error = 0; -/* -# if GLM_CONFIG_SIMD == GLM_ENABLE - Error += test_vec4_load(); -# endif -*/ - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_log_base.cpp b/3rdparty/glm/source/test/gtx/gtx_log_base.cpp deleted file mode 100644 index 37c7464..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_log_base.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#include -#include -#include - -namespace test_log -{ - int run() - { - int Error = 0; - - { - float A = glm::log(10.f, 2.0f); - float B = glm::log2(10.f); - Error += glm::epsilonEqual(A, B, 0.00001f) ? 0 : 1; - } - - { - glm::vec1 A = glm::log(glm::vec1(10.f), glm::vec1(2.0f)); - glm::vec1 B = glm::log2(glm::vec1(10.f)); - Error += glm::all(glm::epsilonEqual(A, B, glm::vec1(0.00001f))) ? 0 : 1; - } - - { - glm::vec2 A = glm::log(glm::vec2(10.f), glm::vec2(2.0f)); - glm::vec2 B = glm::log2(glm::vec2(10.f)); - Error += glm::all(glm::epsilonEqual(A, B, glm::vec2(0.00001f))) ? 0 : 1; - } - - { - glm::vec3 A = glm::log(glm::vec3(10.f), glm::vec3(2.0f)); - glm::vec3 B = glm::log2(glm::vec3(10.f)); - Error += glm::all(glm::epsilonEqual(A, B, glm::vec3(0.00001f))) ? 0 : 1; - } - - { - glm::vec4 A = glm::log(glm::vec4(10.f), glm::vec4(2.0f)); - glm::vec4 B = glm::log2(glm::vec4(10.f)); - Error += glm::all(glm::epsilonEqual(A, B, glm::vec4(0.00001f))) ? 0 : 1; - } - - return Error; - } -}//namespace test_log - -int main() -{ - int Error(0); - - Error += test_log::run(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_matrix_cross_product.cpp b/3rdparty/glm/source/test/gtx/gtx_matrix_cross_product.cpp deleted file mode 100644 index c1d0fa9..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_matrix_cross_product.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include - -int main() -{ - int Error(0); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_matrix_decompose.cpp b/3rdparty/glm/source/test/gtx/gtx_matrix_decompose.cpp deleted file mode 100644 index 5a1884e..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_matrix_decompose.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include - -int main() -{ - int Error(0); - - glm::mat4 Matrix(1); - - glm::vec3 Scale; - glm::quat Orientation; - glm::vec3 Translation; - glm::vec3 Skew(1); - glm::vec4 Perspective(1); - - glm::decompose(Matrix, Scale, Orientation, Translation, Skew, Perspective); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_matrix_factorisation.cpp b/3rdparty/glm/source/test/gtx/gtx_matrix_factorisation.cpp deleted file mode 100644 index 6771dba..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_matrix_factorisation.cpp +++ /dev/null @@ -1,105 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#include -#include - -template -int test_qr(glm::mat m) -{ - int Error = 0; - - T const epsilon = static_cast(1e-10); - - glm::mat<(C < R ? C : R), R, T, Q> q(-999); - glm::mat r(-999); - - glm::qr_decompose(m, q, r); - - //Test if q*r really equals the input matrix - glm::mat tm = q*r; - glm::mat err = tm - m; - - for (glm::length_t i = 0; i < C; i++) - for (glm::length_t j = 0; j < R; j++) - Error += glm::abs(err[i][j]) > epsilon ? 1 : 0; - - //Test if the columns of q are orthonormal - for (glm::length_t i = 0; i < (C < R ? C : R); i++) - { - Error += (length(q[i]) - 1) > epsilon ? 1 : 0; - - for (glm::length_t j = 0; j epsilon ? 1 : 0; - } - - //Test if the matrix r is upper triangular - for (glm::length_t i = 0; i < C; i++) - for (glm::length_t j = i + 1; j < (C < R ? C : R); j++) - Error += glm::epsilonEqual(r[i][j], static_cast(0), glm::epsilon()) ? 0 : 1; - - return Error; -} - -template -int test_rq(glm::mat m) -{ - int Error = 0; - - T const epsilon = static_cast(1e-10); - - glm::mat q(-999); - glm::mat<(C < R ? C : R), R, T, Q> r(-999); - - glm::rq_decompose(m, r, q); - - //Test if q*r really equals the input matrix - glm::mat tm = r*q; - glm::mat err = tm - m; - - for (glm::length_t i = 0; i < C; i++) - for (glm::length_t j = 0; j < R; j++) - Error += glm::abs(err[i][j]) > epsilon ? 1 : 0; - - //Test if the rows of q are orthonormal - glm::mat<(C < R ? C : R), C, T, Q> tq = transpose(q); - - for (glm::length_t i = 0; i < (C < R ? C : R); i++) - { - Error += (length(tq[i]) - 1) > epsilon ? 1 : 0; - - for (glm::length_t j = 0; j epsilon ? 1 : 0; - } - - //Test if the matrix r is upper triangular - for (glm::length_t i = 0; i < (C < R ? C : R); i++) - for (glm::length_t j = R - (C < R ? C : R) + i + 1; j < R; j++) - Error += glm::epsilonEqual(r[i][j], static_cast(0), glm::epsilon()) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - //Test QR square - Error += test_qr(glm::dmat3(12.0, 6.0, -4.0, -51.0, 167.0, 24.0, 4.0, -68.0, -41.0)) ? 1 : 0; - - //Test RQ square - Error += test_rq(glm::dmat3(12.0, 6.0, -4.0, -51.0, 167.0, 24.0, 4.0, -68.0, -41.0)) ? 1 : 0; - - //Test QR triangular 1 - Error += test_qr(glm::dmat3x4(12.0, 6.0, -4.0, -51.0, 167.0, 24.0, 4.0, -68.0, -41.0, 7.0, 2.0, 15.0)) ? 1 : 0; - - //Test QR triangular 2 - Error += test_qr(glm::dmat4x3(12.0, 6.0, -4.0, -51.0, 167.0, 24.0, 4.0, -68.0, -41.0, 7.0, 2.0, 15.0)) ? 1 : 0; - - //Test RQ triangular 1 : Fails at the triangular test - Error += test_rq(glm::dmat3x4(12.0, 6.0, -4.0, -51.0, 167.0, 24.0, 4.0, -68.0, -41.0, 7.0, 2.0, 15.0)) ? 1 : 0; - - //Test QR triangular 2 - Error += test_rq(glm::dmat4x3(12.0, 6.0, -4.0, -51.0, 167.0, 24.0, 4.0, -68.0, -41.0, 7.0, 2.0, 15.0)) ? 1 : 0; - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_matrix_interpolation.cpp b/3rdparty/glm/source/test/gtx/gtx_matrix_interpolation.cpp deleted file mode 100644 index 108f02e..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_matrix_interpolation.cpp +++ /dev/null @@ -1,122 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#include -#include - -#include -#include -#include - - -static int test_axisAngle() -{ - int Error = 0; - - glm::mat4 m1(-0.9946f, 0.0f, -0.104531f, 0.0f, - 0.0f, 1.0f, 0.0f, 0.0f, - 0.104531f, 0.0f, -0.9946f, 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f); - glm::mat4 m2(-0.992624f, 0.0f, -0.121874f, 0.0f, - 0.0f, 1.0f, 0.0f, 0.0f, - 0.121874f, 0.0f, -0.992624f, 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f); - - glm::mat4 const m1rot = glm::extractMatrixRotation(m1); - glm::mat4 const dltRotation = m2 * glm::transpose(m1rot); - - glm::vec3 dltAxis(0.0f); - float dltAngle = 0.0f; - glm::axisAngle(dltRotation, dltAxis, dltAngle); - - std::cout << "dltAxis: (" << dltAxis.x << ", " << dltAxis.y << ", " << dltAxis.z << "), dltAngle: " << dltAngle << std::endl; - - glm::quat q = glm::quat_cast(dltRotation); - std::cout << "q: (" << q.x << ", " << q.y << ", " << q.z << ", " << q.w << ")" << std::endl; - float yaw = glm::yaw(q); - std::cout << "Yaw: " << yaw << std::endl; - - return Error; -} - -template -int testForAxisAngle(glm::vec<3, T, glm::defaultp> const axisTrue, T const angleTrue) -{ - T const eps = std::sqrt(std::numeric_limits::epsilon()); - - glm::mat<4, 4, T, glm::defaultp> const matTrue = glm::axisAngleMatrix(axisTrue, angleTrue); - - glm::vec<3, T, glm::defaultp> axis; - T angle; - glm::axisAngle(matTrue, axis, angle); - glm::mat<4, 4, T, glm::defaultp> const matRebuilt = glm::axisAngleMatrix(axis, angle); - - glm::mat<4, 4, T, glm::defaultp> const errMat = matTrue - matRebuilt; - T const maxErr = glm::compMax(glm::vec<4, T, glm::defaultp>( - glm::compMax(glm::abs(errMat[0])), - glm::compMax(glm::abs(errMat[1])), - glm::compMax(glm::abs(errMat[2])), - glm::compMax(glm::abs(errMat[3])) - )); - - return maxErr < eps ? 0 : 1; -} - -static int test_axisAngle2() -{ - int Error = 0; - - Error += testForAxisAngle(glm::vec3(0.0f, 1.0f, 0.0f), 0.0f); - Error += testForAxisAngle(glm::vec3(0.358f, 0.0716f, 0.9309f), 0.00001f); - Error += testForAxisAngle(glm::vec3(1.0f, 0.0f, 0.0f), 0.0001f); - Error += testForAxisAngle(glm::vec3(0.0f, 0.0f, 1.0f), 0.001f); - Error += testForAxisAngle(glm::vec3(0.0f, 0.0f, 1.0f), 0.001f); - Error += testForAxisAngle(glm::vec3(0.0f, 1.0f, 0.0f), 0.005f); - Error += testForAxisAngle(glm::vec3(0.0f, 0.0f, 1.0f), 0.005f); - Error += testForAxisAngle(glm::vec3(0.358f, 0.0716f, 0.9309f), 0.03f); - Error += testForAxisAngle(glm::vec3(0.358f, 0.0716f, 0.9309f), 0.0003f); - Error += testForAxisAngle(glm::vec3(0.0f, 0.0f, 1.0f), 0.01f); - Error += testForAxisAngle(glm::dvec3(0.0f, 1.0f, 0.0f), 0.00005); - Error += testForAxisAngle(glm::dvec3(-1.0f, 0.0f, 0.0f), 0.000001); - Error += testForAxisAngle(glm::dvec3(0.7071f, 0.7071f, 0.0f), 0.5); - Error += testForAxisAngle(glm::dvec3(0.7071f, 0.0f, 0.7071f), 0.0002); - Error += testForAxisAngle(glm::dvec3(0.7071f, 0.0f, 0.7071f), 0.00002); - Error += testForAxisAngle(glm::dvec3(0.7071f, 0.0f, 0.7071f), 0.000002); - Error += testForAxisAngle(glm::dvec3(0.7071f, 0.0f, 0.7071f), 0.0000002); - Error += testForAxisAngle(glm::vec3(0.0f, 0.7071f, 0.7071f), 1.3f); - Error += testForAxisAngle(glm::vec3(0.0f, 0.7071f, 0.7071f), 6.3f); - Error += testForAxisAngle(glm::vec3(1.0f, 0.0f, 0.0f), -0.23456f); - Error += testForAxisAngle(glm::vec3(1.0f, 0.0f, 0.0f), glm::pi()); - Error += testForAxisAngle(glm::vec3(0.0f, 1.0f, 0.0f), -glm::pi()); - Error += testForAxisAngle(glm::vec3(0.358f, 0.0716f, 0.9309f), -glm::pi()); - Error += testForAxisAngle(glm::vec3(1.0f, 0.0f, 0.0f), glm::pi() + 2e-6f); - Error += testForAxisAngle(glm::vec3(1.0f, 0.0f, 0.0f), glm::pi() + 1e-4f); - Error += testForAxisAngle(glm::vec3(0.0f, 1.0f, 0.0f), -glm::pi() + 1e-3f); - Error += testForAxisAngle(glm::vec3(0.358f, 0.0716f, 0.9309f), -glm::pi() + 5e-3f); - - return Error; -} - -static int test_rotate() -{ - glm::mat4 m2(1.0); - float myAngle = 1.0f; - m2 = glm::rotate(m2, myAngle, glm::vec3(1.0f, 0.0f, 0.0f)); - glm::vec3 m2Axis; - float m2Angle; - glm::axisAngle(m2, m2Axis, m2Angle); - - return 0; -} - -int main() -{ - int Error = 0; - - Error += test_axisAngle(); - Error += test_axisAngle2(); - Error += test_rotate(); - - return Error; -} - - diff --git a/3rdparty/glm/source/test/gtx/gtx_matrix_major_storage.cpp b/3rdparty/glm/source/test/gtx/gtx_matrix_major_storage.cpp deleted file mode 100644 index 21de7f7..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_matrix_major_storage.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include - -int main() -{ - int Error(0); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_matrix_operation.cpp b/3rdparty/glm/source/test/gtx/gtx_matrix_operation.cpp deleted file mode 100644 index 79c95c5..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_matrix_operation.cpp +++ /dev/null @@ -1,86 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#include -#include -#include - -int test_adjugate() -{ - int Error = 0; - - const float epsilon = std::numeric_limits::epsilon(); - - // mat2 - const glm::mat2 m2( - 2, 3, - 1, 5 - ); - - const glm::mat2 eam2( - 5, -3, - -1, 2 - ); - - const glm::mat2 am2 = glm::adjugate(m2); - - Error += glm::all(glm::bvec2( - glm::all(glm::epsilonEqual(am2[0], eam2[0], epsilon)), - glm::all(glm::epsilonEqual(am2[1], eam2[1], epsilon)) - )) ? 0 : 1; - - // mat3 - const glm::mat3 m3( - 2, 3, 3, - 1, 5, 4, - 4, 6, 8 - ); - - const glm::mat3 eam3( - 16, -6, -3, - 8, 4, -5, - -14, 0, 7 - ); - - const glm::mat3 am3 = glm::adjugate(m3); - - Error += glm::all(glm::bvec3( - glm::all(glm::epsilonEqual(am3[0], eam3[0], epsilon)), - glm::all(glm::epsilonEqual(am3[1], eam3[1], epsilon)), - glm::all(glm::epsilonEqual(am3[2], eam3[2], epsilon)) - )) ? 0 : 1; - - // mat4 - const glm::mat4 m4( - 2, 3, 3, 1, - 1, 5, 4, 3, - 4, 6, 8, 5, - -2, -3, -3, 4 - ); - - const glm::mat4 eam4( - 97, -30, -15, 17, - 45, 20, -25, 5, - -91, 0, 35, -21, - 14, 0, 0, 14 - ); - - const glm::mat4 am4 = glm::adjugate(m4); - - Error += glm::all(glm::bvec4( - glm::all(glm::epsilonEqual(am4[0], eam4[0], epsilon)), - glm::all(glm::epsilonEqual(am4[1], eam4[1], epsilon)), - glm::all(glm::epsilonEqual(am4[2], eam4[2], epsilon)), - glm::all(glm::epsilonEqual(am4[3], eam4[3], epsilon)) - )) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_adjugate(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_matrix_query.cpp b/3rdparty/glm/source/test/gtx/gtx_matrix_query.cpp deleted file mode 100644 index 0dda1f0..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_matrix_query.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include - -int test_isNull() -{ - int Error(0); - - bool TestA = glm::isNull(glm::mat4(0), 0.00001f); - Error += TestA ? 0 : 1; - - return Error; -} - -int test_isIdentity() -{ - int Error(0); - - { - bool TestA = glm::isIdentity(glm::mat2(1), 0.00001f); - Error += TestA ? 0 : 1; - } - { - bool TestA = glm::isIdentity(glm::mat3(1), 0.00001f); - Error += TestA ? 0 : 1; - } - { - bool TestA = glm::isIdentity(glm::mat4(1), 0.00001f); - Error += TestA ? 0 : 1; - } - - return Error; -} - -int test_isNormalized() -{ - int Error(0); - - bool TestA = glm::isNormalized(glm::mat4(1), 0.00001f); - Error += TestA ? 0 : 1; - - return Error; -} - -int test_isOrthogonal() -{ - int Error(0); - - bool TestA = glm::isOrthogonal(glm::mat4(1), 0.00001f); - Error += TestA ? 0 : 1; - - return Error; -} - -int main() -{ - int Error(0); - - Error += test_isNull(); - Error += test_isIdentity(); - Error += test_isNormalized(); - Error += test_isOrthogonal(); - - return Error; -} - - diff --git a/3rdparty/glm/source/test/gtx/gtx_matrix_transform_2d.cpp b/3rdparty/glm/source/test/gtx/gtx_matrix_transform_2d.cpp deleted file mode 100644 index f80d263..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_matrix_transform_2d.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include - -int main() -{ - int Error(0); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_mixed_product.cpp b/3rdparty/glm/source/test/gtx/gtx_mixed_product.cpp deleted file mode 100644 index ab59bb2..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_mixed_product.cpp +++ /dev/null @@ -1,18 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2013-10-25 -// Updated : 2013-10-25 -// Licence : This source is under MIT licence -// File : test/gtx/associated_min_max.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include -#include - -int main() -{ - int Error(0); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_norm.cpp b/3rdparty/glm/source/test/gtx/gtx_norm.cpp deleted file mode 100644 index e82102a..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_norm.cpp +++ /dev/null @@ -1,81 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include - - -int test_lMaxNorm() -{ - int Error(0); - - { - float norm = glm::lMaxNorm(glm::vec3(-1, -2, -3)); - Error += glm::epsilonEqual(norm, 3.f, 0.00001f) ? 0 : 1; - } - - { - float norm = glm::lMaxNorm(glm::vec3(2, 3, 1)); - Error += glm::epsilonEqual(norm, 3.f, 0.00001f) ? 0 : 1; - } - - return Error; -} - -int test_lxNorm() -{ - int Error(0); - - { - unsigned int depth_1 = 1; - float normA = glm::lxNorm(glm::vec3(2, 3, 1), depth_1); - float normB = glm::l1Norm(glm::vec3(2, 3, 1)); - Error += glm::epsilonEqual(normA, normB, 0.00001f) ? 0 : 1; - Error += glm::epsilonEqual(normA, 6.f, 0.00001f) ? 0 : 1; - } - - { - unsigned int depth_1 = 1; - float normA = glm::lxNorm(glm::vec3(-1, -2, -3), depth_1); - float normB = glm::l1Norm(glm::vec3(-1, -2, -3)); - Error += glm::epsilonEqual(normA, normB, 0.00001f) ? 0 : 1; - Error += glm::epsilonEqual(normA, 6.f, 0.00001f) ? 0 : 1; - } - - { - unsigned int depth_2 = 2; - float normA = glm::lxNorm(glm::vec3(2, 3, 1), depth_2); - float normB = glm::l2Norm(glm::vec3(2, 3, 1)); - Error += glm::epsilonEqual(normA, normB, 0.00001f) ? 0 : 1; - Error += glm::epsilonEqual(normA, 3.741657387f, 0.00001f) ? 0 : 1; - } - - { - unsigned int depth_2 = 2; - float normA = glm::lxNorm(glm::vec3(-1, -2, -3), depth_2); - float normB = glm::l2Norm(glm::vec3(-1, -2, -3)); - Error += glm::epsilonEqual(normA, normB, 0.00001f) ? 0 : 1; - Error += glm::epsilonEqual(normA, 3.741657387f, 0.00001f) ? 0 : 1; - } - - { - unsigned int oddDepth = 3; - float norm = glm::lxNorm(glm::vec3(2, 3, 1), oddDepth); - Error += glm::epsilonEqual(norm, 3.301927249f, 0.00001f) ? 0 : 1; - } - - { - unsigned int oddDepth = 3; - float norm = glm::lxNorm(glm::vec3(-1, -2, -3), oddDepth); - Error += glm::epsilonEqual(norm, 3.301927249f, 0.00001f) ? 0 : 1; - } - - return Error; -} - -int main() -{ - int Error(0); - - Error += test_lMaxNorm(); - Error += test_lxNorm(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_normal.cpp b/3rdparty/glm/source/test/gtx/gtx_normal.cpp deleted file mode 100644 index 7a01ec0..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_normal.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include - -int main() -{ - int Error(0); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_normalize_dot.cpp b/3rdparty/glm/source/test/gtx/gtx_normalize_dot.cpp deleted file mode 100644 index 9605863..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_normalize_dot.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include - -int main() -{ - int Error(0); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_number_precision.cpp b/3rdparty/glm/source/test/gtx/gtx_number_precision.cpp deleted file mode 100644 index a5a3ef2..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_number_precision.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include - -int main() -{ - int Error(0); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_optimum_pow.cpp b/3rdparty/glm/source/test/gtx/gtx_optimum_pow.cpp deleted file mode 100644 index c0a3fd4..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_optimum_pow.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include - -int main() -{ - int Error(0); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_orthonormalize.cpp b/3rdparty/glm/source/test/gtx/gtx_orthonormalize.cpp deleted file mode 100644 index 0e7a8c8..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_orthonormalize.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include - -int main() -{ - int Error(0); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_pca.cpp b/3rdparty/glm/source/test/gtx/gtx_pca.cpp deleted file mode 100644 index 120e277..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_pca.cpp +++ /dev/null @@ -1,724 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#include -#include -#include - -#include -#include -#if GLM_HAS_CXX11_STL == 1 -#include -#endif - -template -T myEpsilon(); -template<> -GLM_INLINE GLM_CONSTEXPR float myEpsilon() { return 0.00001f; } -template<> -GLM_INLINE GLM_CONSTEXPR double myEpsilon() { return 0.000001; } - -template -bool vectorEpsilonEqual(glm::vec const& a, glm::vec const& b, T epsilon) -{ - for (int c = 0; c < D; ++c) - if (!glm::epsilonEqual(a[c], b[c], epsilon)) - { - fprintf(stderr, "failing vectorEpsilonEqual: [%d] %lf != %lf (~%lf)\n", - c, - static_cast(a[c]), - static_cast(b[c]), - static_cast(epsilon) - ); - return false; - } - return true; -} - -template -bool matrixEpsilonEqual(glm::mat const& a, glm::mat const& b, T epsilon) -{ - for (int c = 0; c < D; ++c) - for (int r = 0; r < D; ++r) - if (!glm::epsilonEqual(a[c][r], b[c][r], epsilon)) - { - fprintf(stderr, "failing vectorEpsilonEqual: [%d][%d] %lf != %lf (~%lf)\n", - c, r, - static_cast(a[c][r]), - static_cast(b[c][r]), - static_cast(epsilon) - ); - return false; - } - return true; -} - -template -GLM_INLINE bool sameSign(T const& a, T const& b) -{ - return ((a >= 0) && (b >= 0)) || ((a < 0) && (b < 0)); -} - -template -T failReport(T line) -{ - fprintf(stderr, "Failed in line %d\n", static_cast(line)); - return line; -} - -// Test data: 1AGA 'agarose double helix' -// https://www.rcsb.org/structure/1aga -// The fourth coordinate is randomized -namespace _1aga -{ - - // Fills `outTestData` with hard-coded atom positions from 1AGA - // The fourth coordinate is randomized - template - void fillTestData(std::vector& outTestData) - { - // x,y,z coordinates copied from RCSB PDB file of 1AGA - // w coordinate randomized with standard normal distribution - static const double _1aga[] = { - 3.219, -0.637, 19.462, 2.286, - 4.519, 0.024, 18.980, -0.828, - 4.163, 1.425, 18.481, -0.810, - 3.190, 1.341, 17.330, -0.170, - 1.962, 0.991, 18.165, 0.816, - 2.093, 1.952, 19.331, 0.276, - 5.119, -0.701, 17.908, -0.490, - 3.517, 2.147, 19.514, -0.207, - 2.970, 2.609, 16.719, 0.552, - 2.107, -0.398, 18.564, 0.403, - 2.847, 2.618, 15.335, 0.315, - 1.457, 3.124, 14.979, 0.683, - 1.316, 3.291, 13.473, 0.446, - 2.447, 4.155, 12.931, 1.324, - 3.795, 3.614, 13.394, 0.112, - 4.956, 4.494, 12.982, 0.253, - 0.483, 2.217, 15.479, 1.316, - 0.021, 3.962, 13.166, 1.522, - 2.311, 5.497, 13.395, 0.248, - 3.830, 3.522, 14.827, 0.591, - 5.150, 4.461, 11.576, 0.635, - -1.057, 3.106, 13.132, 0.191, - -2.280, 3.902, 12.650, 1.135, - -3.316, 2.893, 12.151, 0.794, - -2.756, 2.092, 11.000, 0.720, - -1.839, 1.204, 11.835, -1.172, - -2.737, 0.837, 13.001, -0.313, - -1.952, 4.784, 11.578, 2.082, - -3.617, 1.972, 13.184, 0.653, - -3.744, 1.267, 10.389, -0.413, - -0.709, 2.024, 12.234, -1.747, - -3.690, 1.156, 9.005, -1.275, - -3.434, -0.300, 8.649, 0.441, - -3.508, -0.506, 7.143, 0.237, - -4.822, 0.042, 6.601, -2.856, - -5.027, 1.480, 7.064, 0.985, - -6.370, 2.045, 6.652, 0.915, - -2.162, -0.690, 9.149, 1.100, - -3.442, -1.963, 6.836, -0.081, - -5.916, -0.747, 7.065, -2.345, - -4.965, 1.556, 8.497, 0.504, - -6.439, 2.230, 5.246, 1.451, - -2.161, -2.469, 6.802, -1.171, - -2.239, -3.925, 6.320, -1.434, - -0.847, -4.318, 5.821, 0.098, - -0.434, -3.433, 4.670, -1.446, - -0.123, -2.195, 5.505, 0.182, - 0.644, -2.789, 6.671, 0.865, - -3.167, -4.083, 5.248, -0.098, - 0.101, -4.119, 6.854, -0.001, - 0.775, -3.876, 4.059, 1.061, - -1.398, -1.625, 5.904, 0.230, - 0.844, -3.774, 2.675, 1.313, - 1.977, -2.824, 2.319, -0.112, - 2.192, -2.785, 0.813, -0.981, - 2.375, -4.197, 0.271, -0.355, - 1.232, -5.093, 0.734, 0.632, - 1.414, -6.539, 0.322, 0.576, - 1.678, -1.527, 2.819, -1.187, - 3.421, -1.999, 0.496, -1.770, - 3.605, -4.750, 0.735, 1.099, - 1.135, -5.078, 2.167, 0.854, - 1.289, -6.691, -1.084, -0.487, - -1.057, 3.106, 22.602, -1.297, - -2.280, 3.902, 22.120, 0.376, - -3.316, 2.893, 21.621, 0.932, - -2.756, 2.092, 20.470, 1.680, - -1.839, 1.204, 21.305, 0.615, - -2.737, 0.837, 22.471, 0.899, - -1.952, 4.784, 21.048, -0.521, - -3.617, 1.972, 22.654, 0.133, - -3.744, 1.267, 19.859, 0.081, - -0.709, 2.024, 21.704, 1.420, - -3.690, 1.156, 18.475, -0.850, - -3.434, -0.300, 18.119, -0.249, - -3.508, -0.506, 16.613, 1.434, - -4.822, 0.042, 16.071, -2.466, - -5.027, 1.480, 16.534, -1.045, - -6.370, 2.045, 16.122, 1.707, - -2.162, -0.690, 18.619, -2.023, - -3.442, -1.963, 16.336, -0.304, - -5.916, -0.747, 16.535, 0.979, - -4.965, 1.556, 17.967, -1.165, - -6.439, 2.230, 14.716, 0.929, - -2.161, -2.469, 16.302, -0.234, - -2.239, -3.925, 15.820, -0.228, - -0.847, -4.318, 15.321, 1.844, - -0.434, -3.433, 14.170, 1.132, - -0.123, -2.195, 15.005, 0.211, - 0.644, -2.789, 16.171, -0.632, - -3.167, -4.083, 14.748, -0.519, - 0.101, -4.119, 16.354, 0.173, - 0.775, -3.876, 13.559, 1.243, - -1.398, -1.625, 15.404, -0.187, - 0.844, -3.774, 12.175, -1.332, - 1.977, -2.824, 11.819, -1.616, - 2.192, -2.785, 10.313, 1.320, - 2.375, -4.197, 9.771, 0.237, - 1.232, -5.093, 10.234, 0.851, - 1.414, -6.539, 9.822, 1.816, - 1.678, -1.527, 12.319, -1.657, - 3.421, -1.999, 10.036, 1.559, - 3.605, -4.750, 10.235, 0.831, - 1.135, -5.078, 11.667, 0.060, - 1.289, -6.691, 8.416, 1.066, - 3.219, -0.637, 10.002, 2.111, - 4.519, 0.024, 9.520, -0.874, - 4.163, 1.425, 9.021, -1.012, - 3.190, 1.341, 7.870, -0.250, - 1.962, 0.991, 8.705, -1.359, - 2.093, 1.952, 9.871, -0.126, - 5.119, -0.701, 8.448, 0.995, - 3.517, 2.147, 10.054, 0.941, - 2.970, 2.609, 7.259, -0.562, - 2.107, -0.398, 9.104, -0.038, - 2.847, 2.618, 5.875, 0.398, - 1.457, 3.124, 5.519, 0.481, - 1.316, 3.291, 4.013, -0.187, - 2.447, 4.155, 3.471, -0.429, - 3.795, 3.614, 3.934, -0.432, - 4.956, 4.494, 3.522, -0.788, - 0.483, 2.217, 6.019, -0.923, - 0.021, 3.962, 3.636, -0.316, - 2.311, 5.497, 3.935, -1.917, - 3.830, 3.522, 5.367, -0.302, - 5.150, 4.461, 2.116, -1.615 - }; - static const glm::length_t _1agaSize = sizeof(_1aga) / (4 * sizeof(double)); - - outTestData.resize(_1agaSize); - for(glm::length_t i = 0; i < _1agaSize; ++i) - for(glm::length_t d = 0; d < static_cast(vec::length()); ++d) - outTestData[i][d] = static_cast(_1aga[i * 4 + d]); - } - - // All reference values computed separately using symbolic precision - // https://github.com/sgrottel/exp-pca-precision - // This applies to all functions named: `_1aga::expected*()` - - GLM_INLINE glm::dmat4 const& expectedCovarData() - { - static const glm::dmat4 covar4x4d( - 9.62434068027210898322, -0.00006657369614512471, -4.29321376568405099761, 0.01879374187452758846, - -0.00006657369614512471, 9.62443937868480681175, 5.35113872637944076871, -0.11569259145880574080, - -4.29321376568405099761, 5.35113872637944076871, 35.62848549634668415820, 0.90874239254220201545, - 0.01879374187452758846, -0.11569259145880574080, 0.90874239254220201545, 1.09705971856890904803 - ); - return covar4x4d; - } - - template - GLM_INLINE glm::vec const& expectedEigenvalues(); - template<> - GLM_INLINE glm::dvec2 const& expectedEigenvalues<2>() - { - static const glm::dvec2 evals2( - 9.62447289926297399961763301774251330057894539467032275382255, - 9.62430715969394210015560961264297422776572580714373620309355 - ); - return evals2; - } - template<> - GLM_INLINE glm::dvec3 const& expectedEigenvalues<3>() - { - static const glm::dvec3 evals3( - 37.3274494274683425233695502581182052836449738530676689472257, - 9.62431434161498823505729817436585077939509766554969096873168, - 7.92550178622027216422369326567668971675332732240052872097887 - ); - return evals3; - } - template<> - GLM_INLINE glm::dvec4 const& expectedEigenvalues<4>() - { - static const glm::dvec4 evals4( - 37.3477389918792213596879452204499702406947817221901007885630, - 9.62470688921105696017807313860277172063600080413412567999700, - 7.94017075281634999342344275928070533134615133171969063657713, - 1.06170863996588365446060186982477896078741484440002343404155 - ); - return evals4; - } - - template - GLM_INLINE glm::mat const& expectedEigenvectors(); - template<> - GLM_INLINE glm::dmat2 const& expectedEigenvectors<2>() - { - static const glm::dmat2 evecs2( - glm::dvec2( - -0.503510847492551904906870957742619139443409162857537237123308, - 1 - ), - glm::dvec2( - 1.98605453086051402895741763848787613048533838388005162794043, - 1 - ) - ); - return evecs2; - } - template<> - GLM_INLINE glm::dmat3 const& expectedEigenvectors<3>() - { - static const glm::dmat3 evecs3( - glm::dvec3( - -0.154972738414395866005286433008304444294405085038689821864654, - 0.193161285869815165989799191097521722568079378840201629578695, - 1 - ), - glm::dvec3( - -158565.112775416943154745839952575022429933119522746586149868, - -127221.506282351944358932458687410410814983610301927832439675, - 1 - ), - glm::dvec3( - 2.52702248596556806145700361724323960543858113426446460406536, - -3.14959802931313870497377546974185300816008580801457419079412, - 1 - ) - ); - return evecs3; - } - template<> - GLM_INLINE glm::dmat4 const& expectedEigenvectors<4>() - { - static const glm::dmat4 evecs4( - glm::dvec4( - -6.35322390281037045217295803597357821705371650876122113027264, - 7.91546394153385394517767054617789939529794642646629201212056, - 41.0301543819240679808549819457450130787045236815736490549663, - 1 - ), - glm::dvec4( - -114.622418941087829756565311692197154422302604224781253861297, - -92.2070185807065289900871215218752013659402949497379896153118, - 0.0155846091025912430932734548933329458404665760587569100867246, - 1 - ), - glm::dvec4( - 13.1771887761559019483954743159026938257325190511642952175789, - -16.3688257459634877666638419310116970616615816436949741766895, - 5.17386502341472097227408249233288958059579189051394773143190, - 1 - ), - glm::dvec4( - -0.0192777078948229800494895064532553117703859768210647632969276, - 0.0348034950916108873629241563077465542944938906271231198634442, - -0.0340715609308469289267379681032545422644143611273049912226126, - 1 - ) - ); - return evecs4; - } - -} // namespace _1aga - -// Compute center of gravity -template -vec computeCenter(const std::vector& testData) -{ - double c[4]; - std::fill(c, c + vec::length(), 0.0); - - typename std::vector::const_iterator e = testData.end(); - for(typename std::vector::const_iterator i = testData.begin(); i != e; ++i) - for(glm::length_t d = 0; d < static_cast(vec::length()); ++d) - c[d] += static_cast((*i)[d]); - - vec cVec(0); - for(glm::length_t d = 0; d < static_cast(vec::length()); ++d) - cVec[d] = static_cast(c[d] / static_cast(testData.size())); - return cVec; -} - -// Test sorting of Eigenvalue&Eigenvector lists. Use exhaustive search. -template -int testEigenvalueSort() -{ - // Test input data: four arbitrary values - static const glm::vec refVal( - glm::vec<4, T, Q>( - 10, 8, 6, 4 - ) - ); - // Test input data: four arbitrary vectors, which can be matched to the above values - static const glm::mat refVec( - glm::mat<4, 4, T, Q>( - 10, 20, 5, 40, - 8, 16, 4, 32, - 6, 12, 3, 24, - 4, 8, 2, 16 - ) - ); - // Permutations of test input data for exhaustive check, based on `D` (1 <= D <= 4) - static const int permutationCount[] = { - 0, - 1, - 2, - 6, - 24 - }; - // The permutations t perform, based on `D` (1 <= D <= 4) - static const glm::ivec4 permutation[] = { - glm::ivec4(0, 1, 2, 3), - glm::ivec4(1, 0, 2, 3), // last for D = 2 - glm::ivec4(0, 2, 1, 3), - glm::ivec4(1, 2, 0, 3), - glm::ivec4(2, 0, 1, 3), - glm::ivec4(2, 1, 0, 3), // last for D = 3 - glm::ivec4(0, 1, 3, 2), - glm::ivec4(1, 0, 3, 2), - glm::ivec4(0, 2, 3, 1), - glm::ivec4(1, 2, 3, 0), - glm::ivec4(2, 0, 3, 1), - glm::ivec4(2, 1, 3, 0), - glm::ivec4(0, 3, 1, 2), - glm::ivec4(1, 3, 0, 2), - glm::ivec4(0, 3, 2, 1), - glm::ivec4(1, 3, 2, 0), - glm::ivec4(2, 3, 0, 1), - glm::ivec4(2, 3, 1, 0), - glm::ivec4(3, 0, 1, 2), - glm::ivec4(3, 1, 0, 2), - glm::ivec4(3, 0, 2, 1), - glm::ivec4(3, 1, 2, 0), - glm::ivec4(3, 2, 0, 1), - glm::ivec4(3, 2, 1, 0) // last for D = 4 - }; - - // initial sanity check - if(!vectorEpsilonEqual(refVal, refVal, myEpsilon())) - return failReport(__LINE__); - if(!matrixEpsilonEqual(refVec, refVec, myEpsilon())) - return failReport(__LINE__); - - // Exhaustive search through all permutations - for(int p = 0; p < permutationCount[D]; ++p) - { - glm::vec testVal; - glm::mat testVec; - for(int i = 0; i < D; ++i) - { - testVal[i] = refVal[permutation[p][i]]; - testVec[i] = refVec[permutation[p][i]]; - } - - glm::sortEigenvalues(testVal, testVec); - - if (!vectorEpsilonEqual(testVal, refVal, myEpsilon())) - return failReport(__LINE__); - if (!matrixEpsilonEqual(testVec, refVec, myEpsilon())) - return failReport(__LINE__); - } - - return 0; -} - -// Test covariance matrix creation functions -template -int testCovar( -#if GLM_HAS_CXX11_STL == 1 - glm::length_t dataSize, unsigned int randomEngineSeed -#else // GLM_HAS_CXX11_STL == 1 - glm::length_t, unsigned int -#endif // GLM_HAS_CXX11_STL == 1 -) -{ - typedef glm::vec vec; - typedef glm::mat mat; - - // #1: test expected result with fixed data set - std::vector testData; - _1aga::fillTestData(testData); - - // compute center of gravity - vec center = computeCenter(testData); - - mat covarMat = glm::computeCovarianceMatrix(testData.data(), testData.size(), center); - if(!matrixEpsilonEqual(covarMat, mat(_1aga::expectedCovarData()), myEpsilon())) - { - fprintf(stderr, "Reconstructed covarMat:\n%s\n", glm::to_string(covarMat).c_str()); - return failReport(__LINE__); - } - - // #2: test function variant consitency with random data -#if GLM_HAS_CXX11_STL == 1 - std::default_random_engine rndEng(randomEngineSeed); - std::normal_distribution normalDist; - testData.resize(dataSize); - // some common offset of all data - T offset[D]; - for(glm::length_t d = 0; d < D; ++d) - offset[d] = normalDist(rndEng); - // init data - for(glm::length_t i = 0; i < dataSize; ++i) - for(glm::length_t d = 0; d < D; ++d) - testData[i][d] = offset[d] + normalDist(rndEng); - center = computeCenter(testData); - - std::vector centeredTestData; - centeredTestData.reserve(testData.size()); - typename std::vector::const_iterator e = testData.end(); - for(typename std::vector::const_iterator i = testData.begin(); i != e; ++i) - centeredTestData.push_back((*i) - center); - - mat c1 = glm::computeCovarianceMatrix(centeredTestData.data(), centeredTestData.size()); - mat c2 = glm::computeCovarianceMatrix(centeredTestData.begin(), centeredTestData.end()); - mat c3 = glm::computeCovarianceMatrix(testData.data(), testData.size(), center); - mat c4 = glm::computeCovarianceMatrix(testData.rbegin(), testData.rend(), center); - - if(!matrixEpsilonEqual(c1, c2, myEpsilon())) - return failReport(__LINE__); - if(!matrixEpsilonEqual(c1, c3, myEpsilon())) - return failReport(__LINE__); - if(!matrixEpsilonEqual(c1, c4, myEpsilon())) - return failReport(__LINE__); -#endif // GLM_HAS_CXX11_STL == 1 - return 0; -} - -// Computes eigenvalues and eigenvectors from well-known covariance matrix -template -int testEigenvectors(T epsilon) -{ - typedef glm::vec vec; - typedef glm::mat mat; - - // test expected result with fixed data set - std::vector testData; - mat covarMat(_1aga::expectedCovarData()); - - vec eigenvalues; - mat eigenvectors; - unsigned int c = glm::findEigenvaluesSymReal(covarMat, eigenvalues, eigenvectors); - if(c != D) - return failReport(__LINE__); - glm::sortEigenvalues(eigenvalues, eigenvectors); - - if (!vectorEpsilonEqual(eigenvalues, vec(_1aga::expectedEigenvalues()), epsilon)) - return failReport(__LINE__); - - for (int i = 0; i < D; ++i) - { - vec act = glm::normalize(eigenvectors[i]); - vec exp = glm::normalize(_1aga::expectedEigenvectors()[i]); - if (!sameSign(act[0], exp[0])) exp = -exp; - if (!vectorEpsilonEqual(act, exp, epsilon)) - return failReport(__LINE__); - } - - return 0; -} - -// A simple small smoke test: -// - a uniformly sampled block -// - reconstruct main axes -// - check order of eigenvalues equals order of extends of block in direction of main axes -int smokeTest() -{ - using glm::vec3; - using glm::mat3; - std::vector pts; - pts.reserve(11 * 15 * 7); - - for(int x = -5; x <= 5; ++x) - for(int y = -7; y <= 7; ++y) - for(int z = -3; z <= 3; ++z) - pts.push_back(vec3(x, y, z)); - - mat3 covar = glm::computeCovarianceMatrix(pts.data(), pts.size()); - mat3 eVec; - vec3 eVal; - int eCnt = glm::findEigenvaluesSymReal(covar, eVal, eVec); - if(eCnt != 3) - return failReport(__LINE__); - - // sort eVec by decending eVal - if(eVal[0] < eVal[1]) - { - std::swap(eVal[0], eVal[1]); - std::swap(eVec[0], eVec[1]); - } - if(eVal[0] < eVal[2]) - { - std::swap(eVal[0], eVal[2]); - std::swap(eVec[0], eVec[2]); - } - if(eVal[1] < eVal[2]) - { - std::swap(eVal[1], eVal[2]); - std::swap(eVec[1], eVec[2]); - } - - if(!vectorEpsilonEqual(glm::abs(eVec[0]), vec3(0, 1, 0), myEpsilon())) - return failReport(__LINE__); - if(!vectorEpsilonEqual(glm::abs(eVec[1]), vec3(1, 0, 0), myEpsilon())) - return failReport(__LINE__); - if(!vectorEpsilonEqual(glm::abs(eVec[2]), vec3(0, 0, 1), myEpsilon())) - return failReport(__LINE__); - - return 0; -} - -#if GLM_HAS_CXX11_STL == 1 -int rndTest(unsigned int randomEngineSeed) -{ - std::default_random_engine rndEng(randomEngineSeed); - std::normal_distribution normalDist; - - // construct orthonormal system - glm::dvec3 x(normalDist(rndEng), normalDist(rndEng), normalDist(rndEng)); - double l = glm::length(x); - while(l < myEpsilon()) - x = glm::dvec3(normalDist(rndEng), normalDist(rndEng), normalDist(rndEng)); - x = glm::normalize(x); - glm::dvec3 y(normalDist(rndEng), normalDist(rndEng), normalDist(rndEng)); - l = glm::length(y); - while(l < myEpsilon()) - y = glm::dvec3(normalDist(rndEng), normalDist(rndEng), normalDist(rndEng)); - while(glm::abs(glm::dot(x, y)) < myEpsilon()) - { - y = glm::dvec3(normalDist(rndEng), normalDist(rndEng), normalDist(rndEng)); - while(l < myEpsilon()) - y = glm::dvec3(normalDist(rndEng), normalDist(rndEng), normalDist(rndEng)); - } - y = glm::normalize(y); - glm::dvec3 z = glm::normalize(glm::cross(x, y)); - y = glm::normalize(glm::cross(z, x)); - - // generate input point data - std::vector ptData; - static const int pattern[] = { - 8, 0, 0, - 4, 1, 2, - 0, 2, 0, - 0, 0, 4 - }; - glm::dvec3 offset(normalDist(rndEng), normalDist(rndEng), normalDist(rndEng)); - for(int p = 0; p < 4; ++p) - for(int xs = 1; xs >= -1; xs -= 2) - for(int ys = 1; ys >= -1; ys -= 2) - for(int zs = 1; zs >= -1; zs -= 2) - ptData.push_back( - offset - + x * static_cast(pattern[p * 3 + 0] * xs) - + y * static_cast(pattern[p * 3 + 1] * ys) - + z * static_cast(pattern[p * 3 + 2] * zs)); - - // perform PCA: - glm::dvec3 center = computeCenter(ptData); - glm::dmat3 covarMat = glm::computeCovarianceMatrix(ptData.data(), ptData.size(), center); - glm::dvec3 evals; - glm::dmat3 evecs; - int evcnt = glm::findEigenvaluesSymReal(covarMat, evals, evecs); - if(evcnt != 3) - return failReport(__LINE__); - glm::sortEigenvalues(evals, evecs); - - if (!sameSign(evecs[0][0], x[0])) evecs[0] = -evecs[0]; - if(!vectorEpsilonEqual(x, evecs[0], myEpsilon())) - return failReport(__LINE__); - if (!sameSign(evecs[2][0], y[0])) evecs[2] = -evecs[2]; - if (!vectorEpsilonEqual(y, evecs[2], myEpsilon())) - return failReport(__LINE__); - if (!sameSign(evecs[1][0], z[0])) evecs[1] = -evecs[1]; - if (!vectorEpsilonEqual(z, evecs[1], myEpsilon())) - return failReport(__LINE__); - - return 0; -} -#endif // GLM_HAS_CXX11_STL == 1 - -int main() -{ - int error(0); - - // A small smoke test to fail early with most problems - if(smokeTest()) - return failReport(__LINE__); - - // test sorting utility. - if(testEigenvalueSort<2, float, glm::defaultp>() != 0) - error = failReport(__LINE__); - if(testEigenvalueSort<2, double, glm::defaultp>() != 0) - error = failReport(__LINE__); - if(testEigenvalueSort<3, float, glm::defaultp>() != 0) - error = failReport(__LINE__); - if(testEigenvalueSort<3, double, glm::defaultp>() != 0) - error = failReport(__LINE__); - if(testEigenvalueSort<4, float, glm::defaultp>() != 0) - error = failReport(__LINE__); - if(testEigenvalueSort<4, double, glm::defaultp>() != 0) - error = failReport(__LINE__); - if (error != 0) - return error; - - // Note: the random engine uses a fixed seed to create consistent and reproducible test data - // test covariance matrix computation from different data sources - if(testCovar<2, float, glm::defaultp>(100, 12345) != 0) - error = failReport(__LINE__); - if(testCovar<2, double, glm::defaultp>(100, 42) != 0) - error = failReport(__LINE__); - if(testCovar<3, float, glm::defaultp>(100, 2021) != 0) - error = failReport(__LINE__); - if(testCovar<3, double, glm::defaultp>(100, 815) != 0) - error = failReport(__LINE__); - if(testCovar<4, float, glm::defaultp>(100, 3141) != 0) - error = failReport(__LINE__); - if(testCovar<4, double, glm::defaultp>(100, 174) != 0) - error = failReport(__LINE__); - if (error != 0) - return error; - - // test PCA eigen vector reconstruction - // Expected epsilon precision evaluated separately: - // https://github.com/sgrottel/exp-pca-precision - if(testEigenvectors<2, float, glm::defaultp>(0.002f) != 0) - error = failReport(__LINE__); - if(testEigenvectors<2, double, glm::defaultp>(0.00000000001) != 0) - error = failReport(__LINE__); - if(testEigenvectors<3, float, glm::defaultp>(0.00001f) != 0) - error = failReport(__LINE__); - if(testEigenvectors<3, double, glm::defaultp>(0.0000000001) != 0) - error = failReport(__LINE__); - if(testEigenvectors<4, float, glm::defaultp>(0.0001f) != 0) - error = failReport(__LINE__); - if(testEigenvectors<4, double, glm::defaultp>(0.0000001) != 0) - error = failReport(__LINE__); - if(error != 0) - return error; - - // Final tests with randomized data -#if GLM_HAS_CXX11_STL == 1 - if(rndTest(12345) != 0) - error = failReport(__LINE__); - if(rndTest(42) != 0) - error = failReport(__LINE__); - if (error != 0) - return error; -#endif // GLM_HAS_CXX11_STL == 1 - - return error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_perpendicular.cpp b/3rdparty/glm/source/test/gtx/gtx_perpendicular.cpp deleted file mode 100644 index d14cfee..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_perpendicular.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include - -int main() -{ - int Error(0); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_polar_coordinates.cpp b/3rdparty/glm/source/test/gtx/gtx_polar_coordinates.cpp deleted file mode 100644 index da2fe53..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_polar_coordinates.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include - -int main() -{ - int Error(0); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_projection.cpp b/3rdparty/glm/source/test/gtx/gtx_projection.cpp deleted file mode 100644 index 8f9f772..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_projection.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include - -int main() -{ - int Error(0); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_quaternion.cpp b/3rdparty/glm/source/test/gtx/gtx_quaternion.cpp deleted file mode 100644 index 80cbbac..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_quaternion.cpp +++ /dev/null @@ -1,107 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#include -#include -#include -#include -#include -#include - -int test_quat_fastMix() -{ - int Error = 0; - - glm::quat A = glm::angleAxis(0.0f, glm::vec3(0, 0, 1)); - glm::quat B = glm::angleAxis(glm::pi() * 0.5f, glm::vec3(0, 0, 1)); - glm::quat C = glm::fastMix(A, B, 0.5f); - glm::quat D = glm::angleAxis(glm::pi() * 0.25f, glm::vec3(0, 0, 1)); - - Error += glm::epsilonEqual(C.x, D.x, 0.01f) ? 0 : 1; - Error += glm::epsilonEqual(C.y, D.y, 0.01f) ? 0 : 1; - Error += glm::epsilonEqual(C.z, D.z, 0.01f) ? 0 : 1; - Error += glm::epsilonEqual(C.w, D.w, 0.01f) ? 0 : 1; - - return Error; -} - -int test_quat_shortMix() -{ - int Error(0); - - glm::quat A = glm::angleAxis(0.0f, glm::vec3(0, 0, 1)); - glm::quat B = glm::angleAxis(glm::pi() * 0.5f, glm::vec3(0, 0, 1)); - glm::quat C = glm::shortMix(A, B, 0.5f); - glm::quat D = glm::angleAxis(glm::pi() * 0.25f, glm::vec3(0, 0, 1)); - - Error += glm::epsilonEqual(C.x, D.x, 0.01f) ? 0 : 1; - Error += glm::epsilonEqual(C.y, D.y, 0.01f) ? 0 : 1; - Error += glm::epsilonEqual(C.z, D.z, 0.01f) ? 0 : 1; - Error += glm::epsilonEqual(C.w, D.w, 0.01f) ? 0 : 1; - - return Error; -} - -int test_orientation() -{ - int Error = 0; - - { - glm::quat q(1.0f, 0.0f, 0.0f, 1.0f); - float p = glm::roll(q); - Error += glm::epsilonEqual(p, glm::pi() * 0.5f, 0.0001f) ? 0 : 1; - } - - { - glm::quat q(1.0f, 0.0f, 0.0f, 1.0f); - float p = glm::pitch(q); - Error += glm::epsilonEqual(p, 0.f, 0.0001f) ? 0 : 1; - } - - { - glm::quat q(1.0f, 0.0f, 0.0f, 1.0f); - float p = glm::yaw(q); - Error += glm::epsilonEqual(p, 0.f, 0.0001f) ? 0 : 1; - } - - return Error; -} - -int test_rotation() -{ - int Error(0); - - glm::vec3 v(1, 0, 0); - glm::vec3 u(0, 1, 0); - - glm::quat Rotation = glm::rotation(v, u); - - float Angle = glm::angle(Rotation); - - Error += glm::abs(Angle - glm::pi() * 0.5f) < glm::epsilon() ? 0 : 1; - - return Error; -} - -int test_log() -{ - int Error(0); - - glm::quat q; - glm::quat p = glm::log(q); - glm::quat r = glm::exp(p); - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_log(); - Error += test_rotation(); - Error += test_orientation(); - Error += test_quat_fastMix(); - Error += test_quat_shortMix(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_random.cpp b/3rdparty/glm/source/test/gtx/gtx_random.cpp deleted file mode 100644 index e562c31..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_random.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////// -// OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) -/////////////////////////////////////////////////////////////////////////////////////////////////// -// Created : 2011-05-31 -// Updated : 2011-05-31 -// Licence : This source is under MIT licence -// File : test/gtx/random.cpp -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#include -#include -#include -#include - -int test_signedRand1() -{ - int Error = 0; - - { - float ResultFloat = 0.0f; - double ResultDouble = 0.0f; - for(std::size_t i = 0; i < 100000; ++i) - { - ResultFloat += glm::signedRand1(); - ResultDouble += glm::signedRand1(); - } - - Error += glm::equalEpsilon(ResultFloat, 0.0f, 0.0001f); - Error += glm::equalEpsilon(ResultDouble, 0.0, 0.0001); - } - - return Error; -} - -int test_normalizedRand2() -{ - int Error = 0; - - { - std::size_t Max = 100000; - float ResultFloat = 0.0f; - double ResultDouble = 0.0f; - for(std::size_t i = 0; i < Max; ++i) - { - ResultFloat += glm::length(glm::normalizedRand2()); - ResultDouble += glm::length(glm::normalizedRand2()); - } - - Error += glm::equalEpsilon(ResultFloat, float(Max), 0.000001f) ? 0 : 1; - Error += glm::equalEpsilon(ResultDouble, double(Max), 0.000001) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int test_normalizedRand3() -{ - int Error = 0; - - { - std::size_t Max = 100000; - float ResultFloatA = 0.0f; - float ResultFloatB = 0.0f; - float ResultFloatC = 0.0f; - double ResultDoubleA = 0.0f; - double ResultDoubleB = 0.0f; - double ResultDoubleC = 0.0f; - for(std::size_t i = 0; i < Max; ++i) - { - ResultFloatA += glm::length(glm::normalizedRand3()); - ResultDoubleA += glm::length(glm::normalizedRand3()); - ResultFloatB += glm::length(glm::normalizedRand3(2.0f, 2.0f)); - ResultDoubleB += glm::length(glm::normalizedRand3(2.0, 2.0)); - ResultFloatC += glm::length(glm::normalizedRand3(1.0f, 3.0f)); - ResultDoubleC += glm::length(glm::normalizedRand3(1.0, 3.0)); - } - - Error += glm::equalEpsilon(ResultFloatA, float(Max), 0.0001f) ? 0 : 1; - Error += glm::equalEpsilon(ResultDoubleA, double(Max), 0.0001) ? 0 : 1; - Error += glm::equalEpsilon(ResultFloatB, float(Max * 2), 0.0001f) ? 0 : 1; - Error += glm::equalEpsilon(ResultDoubleB, double(Max * 2), 0.0001) ? 0 : 1; - Error += (ResultFloatC >= float(Max) && ResultFloatC <= float(Max * 3)) ? 0 : 1; - Error += (ResultDoubleC >= double(Max) && ResultDoubleC <= double(Max * 3)) ? 0 : 1; - } - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_signedRand1(); - Error += test_normalizedRand2(); - Error += test_normalizedRand3(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_range.cpp b/3rdparty/glm/source/test/gtx/gtx_range.cpp deleted file mode 100644 index 434731b..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_range.cpp +++ /dev/null @@ -1,83 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#include -#include -#include - -#if GLM_HAS_RANGE_FOR - -#include - -int test_vec() -{ - int Error = 0; - - { - glm::ivec3 const v(1, 2, 3); - - int count = 0; - glm::ivec3 Result(0); - for(int x : v) - { - Result[count] = x; - count++; - } - Error += count == 3 ? 0 : 1; - Error += v == Result ? 0 : 1; - } - - { - glm::ivec3 v(1, 2, 3); - for(int& x : v) - x = 0; - Error += glm::all(glm::equal(v, glm::ivec3(0))) ? 0 : 1; - } - - return Error; -} - -int test_mat() -{ - int Error = 0; - - { - glm::mat4x3 m(1.0f); - - int count = 0; - float Sum = 0.0f; - for(float x : m) - { - count++; - Sum += x; - } - Error += count == 12 ? 0 : 1; - Error += glm::equal(Sum, 3.0f, 0.001f) ? 0 : 1; - } - - { - glm::mat4x3 m(1.0f); - - for (float& x : m) { x = 0; } - glm::vec4 v(1, 1, 1, 1); - Error += glm::all(glm::equal(m*v, glm::vec3(0, 0, 0), glm::epsilon())) ? 0 : 1; - } - - return Error; -} - -int main() -{ - int Error = 0; - Error += test_vec(); - Error += test_mat(); - return Error; -} - -#else - -int main() -{ - return 0; -} - -#endif//GLM_HAS_RANGE_FOR diff --git a/3rdparty/glm/source/test/gtx/gtx_rotate_normalized_axis.cpp b/3rdparty/glm/source/test/gtx/gtx_rotate_normalized_axis.cpp deleted file mode 100644 index d4eecdf..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_rotate_normalized_axis.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include - -int main() -{ - int Error(0); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_rotate_vector.cpp b/3rdparty/glm/source/test/gtx/gtx_rotate_vector.cpp deleted file mode 100644 index becd63f..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_rotate_vector.cpp +++ /dev/null @@ -1,77 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#include -#include - -int test_rotate() -{ - int Error = 0; - - glm::vec2 A = glm::rotate(glm::vec2(1, 0), glm::pi() * 0.5f); - glm::vec3 B = glm::rotate(glm::vec3(1, 0, 0), glm::pi() * 0.5f, glm::vec3(0, 0, 1)); - glm::vec4 C = glm::rotate(glm::vec4(1, 0, 0, 1), glm::pi() * 0.5f, glm::vec3(0, 0, 1)); - glm::vec3 D = glm::rotateX(glm::vec3(1, 0, 0), glm::pi() * 0.5f); - glm::vec4 E = glm::rotateX(glm::vec4(1, 0, 0, 1), glm::pi() * 0.5f); - glm::vec3 F = glm::rotateY(glm::vec3(1, 0, 0), glm::pi() * 0.5f); - glm::vec4 G = glm::rotateY(glm::vec4(1, 0, 0, 1), glm::pi() * 0.5f); - glm::vec3 H = glm::rotateZ(glm::vec3(1, 0, 0), glm::pi() * 0.5f); - glm::vec4 I = glm::rotateZ(glm::vec4(1, 0, 0,1 ), glm::pi() * 0.5f); - glm::mat4 O = glm::orientation(glm::normalize(glm::vec3(1)), glm::vec3(0, 0, 1)); - - return Error; -} - -int test_rotateX() -{ - int Error = 0; - - glm::vec3 D = glm::rotateX(glm::vec3(1, 0, 0), glm::pi() * 0.5f); - glm::vec4 E = glm::rotateX(glm::vec4(1, 0, 0, 1), glm::pi() * 0.5f); - - return Error; -} - -int test_rotateY() -{ - int Error = 0; - - glm::vec3 F = glm::rotateY(glm::vec3(1, 0, 0), glm::pi() * 0.5f); - glm::vec4 G = glm::rotateY(glm::vec4(1, 0, 0, 1), glm::pi() * 0.5f); - - return Error; -} - - -int test_rotateZ() -{ - int Error = 0; - - glm::vec3 H = glm::rotateZ(glm::vec3(1, 0, 0), glm::pi() * 0.5f); - glm::vec4 I = glm::rotateZ(glm::vec4(1, 0, 0,1 ), glm::pi() * 0.5f); - - return Error; -} - -int test_orientation() -{ - int Error = 0; - - glm::mat4 O = glm::orientation(glm::normalize(glm::vec3(1)), glm::vec3(0, 0, 1)); - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_rotate(); - Error += test_rotateX(); - Error += test_rotateY(); - Error += test_rotateZ(); - Error += test_orientation(); - - return Error; -} - - diff --git a/3rdparty/glm/source/test/gtx/gtx_scalar_multiplication.cpp b/3rdparty/glm/source/test/gtx/gtx_scalar_multiplication.cpp deleted file mode 100644 index 4aa96d6..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_scalar_multiplication.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#include -#include - -#if GLM_HAS_TEMPLATE_ALIASES && !(GLM_COMPILER & GLM_COMPILER_GCC) -#include - -int main() -{ - int Error(0); - glm::vec3 v(0.5, 3.1, -9.1); - - Error += glm::all(glm::equal(v, 1.0 * v, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(v, 1 * v, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(v, 1u * v, glm::epsilon())) ? 0 : 1; - - glm::mat3 m(1, 2, 3, 4, 5, 6, 7, 8, 9); - glm::vec3 w = 0.5f * m * v; - - Error += glm::all(glm::equal((m*v)/2, w, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(m*(v/2), w, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal((m/2)*v, w, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal((0.5*m)*v, w, glm::epsilon())) ? 0 : 1; - Error += glm::all(glm::equal(0.5*(m*v), w, glm::epsilon())) ? 0 : 1; - - return Error; -} - -#else - -int main() -{ - return 0; -} - -#endif diff --git a/3rdparty/glm/source/test/gtx/gtx_scalar_relational.cpp b/3rdparty/glm/source/test/gtx/gtx_scalar_relational.cpp deleted file mode 100644 index fc6a09a..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_scalar_relational.cpp +++ /dev/null @@ -1,174 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#include -#include -#include -#include -#include - -static int test_lessThan() -{ - int Error = 0; - - Error += glm::lessThan(0, 1) ? 0 : 1; - Error += glm::lessThan(1, 0) ? 1 : 0; - Error += glm::lessThan(0, 0) ? 1 : 0; - Error += glm::lessThan(1, 1) ? 1 : 0; - Error += glm::lessThan(0.0f, 1.0f) ? 0 : 1; - Error += glm::lessThan(1.0f, 0.0f) ? 1 : 0; - Error += glm::lessThan(0.0f, 0.0f) ? 1 : 0; - Error += glm::lessThan(1.0f, 1.0f) ? 1 : 0; - Error += glm::lessThan(0.0, 1.0) ? 0 : 1; - Error += glm::lessThan(1.0, 0.0) ? 1 : 0; - Error += glm::lessThan(0.0, 0.0) ? 1 : 0; - Error += glm::lessThan(1.0, 1.0) ? 1 : 0; - - return Error; -} - -static int test_lessThanEqual() -{ - int Error = 0; - - Error += glm::lessThanEqual(0, 1) ? 0 : 1; - Error += glm::lessThanEqual(1, 0) ? 1 : 0; - Error += glm::lessThanEqual(0, 0) ? 0 : 1; - Error += glm::lessThanEqual(1, 1) ? 0 : 1; - Error += glm::lessThanEqual(0.0f, 1.0f) ? 0 : 1; - Error += glm::lessThanEqual(1.0f, 0.0f) ? 1 : 0; - Error += glm::lessThanEqual(0.0f, 0.0f) ? 0 : 1; - Error += glm::lessThanEqual(1.0f, 1.0f) ? 0 : 1; - Error += glm::lessThanEqual(0.0, 1.0) ? 0 : 1; - Error += glm::lessThanEqual(1.0, 0.0) ? 1 : 0; - Error += glm::lessThanEqual(0.0, 0.0) ? 0 : 1; - Error += glm::lessThanEqual(1.0, 1.0) ? 0 : 1; - - return Error; -} - -static int test_greaterThan() -{ - int Error = 0; - - Error += glm::greaterThan(0, 1) ? 1 : 0; - Error += glm::greaterThan(1, 0) ? 0 : 1; - Error += glm::greaterThan(0, 0) ? 1 : 0; - Error += glm::greaterThan(1, 1) ? 1 : 0; - Error += glm::greaterThan(0.0f, 1.0f) ? 1 : 0; - Error += glm::greaterThan(1.0f, 0.0f) ? 0 : 1; - Error += glm::greaterThan(0.0f, 0.0f) ? 1 : 0; - Error += glm::greaterThan(1.0f, 1.0f) ? 1 : 0; - Error += glm::greaterThan(0.0, 1.0) ? 1 : 0; - Error += glm::greaterThan(1.0, 0.0) ? 0 : 1; - Error += glm::greaterThan(0.0, 0.0) ? 1 : 0; - Error += glm::greaterThan(1.0, 1.0) ? 1 : 0; - - return Error; -} - -static int test_greaterThanEqual() -{ - int Error = 0; - - Error += glm::greaterThanEqual(0, 1) ? 1 : 0; - Error += glm::greaterThanEqual(1, 0) ? 0 : 1; - Error += glm::greaterThanEqual(0, 0) ? 0 : 1; - Error += glm::greaterThanEqual(1, 1) ? 0 : 1; - Error += glm::greaterThanEqual(0.0f, 1.0f) ? 1 : 0; - Error += glm::greaterThanEqual(1.0f, 0.0f) ? 0 : 1; - Error += glm::greaterThanEqual(0.0f, 0.0f) ? 0 : 1; - Error += glm::greaterThanEqual(1.0f, 1.0f) ? 0 : 1; - Error += glm::greaterThanEqual(0.0, 1.0) ? 1 : 0; - Error += glm::greaterThanEqual(1.0, 0.0) ? 0 : 1; - Error += glm::greaterThanEqual(0.0, 0.0) ? 0 : 1; - Error += glm::greaterThanEqual(1.0, 1.0) ? 0 : 1; - - return Error; -} - -static int test_equal() -{ - int Error = 0; - - Error += glm::equal(0, 1) ? 1 : 0; - Error += glm::equal(1, 0) ? 1 : 0; - Error += glm::equal(0, 0) ? 0 : 1; - Error += glm::equal(1, 1) ? 0 : 1; - Error += glm::equal(0.0f, 1.0f, glm::epsilon()) ? 1 : 0; - Error += glm::equal(1.0f, 0.0f, glm::epsilon()) ? 1 : 0; - Error += glm::equal(0.0f, 0.0f, glm::epsilon()) ? 0 : 1; - Error += glm::equal(1.0f, 1.0f, glm::epsilon()) ? 0 : 1; - Error += glm::equal(0.0, 1.0, glm::epsilon()) ? 1 : 0; - Error += glm::equal(1.0, 0.0, glm::epsilon()) ? 1 : 0; - Error += glm::equal(0.0, 0.0, glm::epsilon()) ? 0 : 1; - Error += glm::equal(1.0, 1.0, glm::epsilon()) ? 0 : 1; - - return Error; -} - -static int test_notEqual() -{ - int Error = 0; - - Error += glm::notEqual(0, 1) ? 0 : 1; - Error += glm::notEqual(1, 0) ? 0 : 1; - Error += glm::notEqual(0, 0) ? 1 : 0; - Error += glm::notEqual(1, 1) ? 1 : 0; - Error += glm::notEqual(0.0f, 1.0f, glm::epsilon()) ? 0 : 1; - Error += glm::notEqual(1.0f, 0.0f, glm::epsilon()) ? 0 : 1; - Error += glm::notEqual(0.0f, 0.0f, glm::epsilon()) ? 1 : 0; - Error += glm::notEqual(1.0f, 1.0f, glm::epsilon()) ? 1 : 0; - Error += glm::notEqual(0.0, 1.0, glm::epsilon()) ? 0 : 1; - Error += glm::notEqual(1.0, 0.0, glm::epsilon()) ? 0 : 1; - Error += glm::notEqual(0.0, 0.0, glm::epsilon()) ? 1 : 0; - Error += glm::notEqual(1.0, 1.0, glm::epsilon()) ? 1 : 0; - - return Error; -} - -static int test_any() -{ - int Error = 0; - - Error += glm::any(true) ? 0 : 1; - Error += glm::any(false) ? 1 : 0; - - return Error; -} - -static int test_all() -{ - int Error = 0; - - Error += glm::all(true) ? 0 : 1; - Error += glm::all(false) ? 1 : 0; - - return Error; -} - -static int test_not() -{ - int Error = 0; - - Error += glm::not_(true) ? 1 : 0; - Error += glm::not_(false) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_lessThan(); - Error += test_lessThanEqual(); - Error += test_greaterThan(); - Error += test_greaterThanEqual(); - Error += test_equal(); - Error += test_notEqual(); - Error += test_any(); - Error += test_all(); - Error += test_not(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_simd_mat4.cpp b/3rdparty/glm/source/test/gtx/gtx_simd_mat4.cpp deleted file mode 100644 index 28d7ec5..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_simd_mat4.cpp +++ /dev/null @@ -1,324 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @file test/gtx/gtx_simd_mat4.cpp -/// @date 2010-09-16 / 2014-11-25 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if(GLM_ARCH != GLM_ARCH_PURE) - -std::vector test_detA(std::vector const & Data) -{ - std::vector Test(Data.size()); - - std::clock_t TimeStart = clock(); - - for(std::size_t i = 0; i < Test.size() - 1; ++i) - Test[i] = glm::determinant(Data[i]); - - std::clock_t TimeEnd = clock(); - printf("Det A: %ld\n", TimeEnd - TimeStart); - - return Test; -} - -std::vector test_detB(std::vector const & Data) -{ - std::vector Test(Data.size()); - - std::clock_t TimeStart = clock(); - - for(std::size_t i = 0; i < Test.size() - 1; ++i) - { - _mm_prefetch((char*)&Data[i + 1], _MM_HINT_T0); - glm::simdMat4 m(Data[i]); - glm::simdVec4 d(glm::detail::sse_slow_det_ps((__m128 const * const)&m)); - glm::vec4 v;//(d); - Test[i] = v.x; - } - - std::clock_t TimeEnd = clock(); - printf("Det B: %ld\n", TimeEnd - TimeStart); - - return Test; -} - -std::vector test_detC(std::vector const & Data) -{ - std::vector Test(Data.size()); - - std::clock_t TimeStart = clock(); - - for(std::size_t i = 0; i < Test.size() - 1; ++i) - { - _mm_prefetch((char*)&Data[i + 1], _MM_HINT_T0); - glm::simdMat4 m(Data[i]); - glm::simdVec4 d(glm::detail::sse_det_ps((__m128 const * const)&m)); - glm::vec4 v;//(d); - Test[i] = v.x; - } - - std::clock_t TimeEnd = clock(); - printf("Det C: %ld\n", TimeEnd - TimeStart); - - return Test; -} - -std::vector test_detD(std::vector const & Data) -{ - std::vector Test(Data.size()); - - std::clock_t TimeStart = clock(); - - for(std::size_t i = 0; i < Test.size() - 1; ++i) - { - _mm_prefetch((char*)&Data[i + 1], _MM_HINT_T0); - glm::simdMat4 m(Data[i]); - glm::simdVec4 d(glm::detail::sse_detd_ps((__m128 const * const)&m)); - glm::vec4 v;//(d); - Test[i] = v.x; - } - - std::clock_t TimeEnd = clock(); - printf("Det D: %ld\n", TimeEnd - TimeStart); - - return Test; -} - -void test_invA(std::vector const & Data, std::vector & Out) -{ - //std::vector Test(Data.size()); - Out.resize(Data.size()); - - std::clock_t TimeStart = clock(); - - for(std::size_t i = 0; i < Out.size() - 1; ++i) - { - Out[i] = glm::inverse(Data[i]); - } - - std::clock_t TimeEnd = clock(); - printf("Inv A: %ld\n", TimeEnd - TimeStart); -} - -void test_invC(std::vector const & Data, std::vector & Out) -{ - //std::vector Test(Data.size()); - Out.resize(Data.size()); - - std::clock_t TimeStart = clock(); - - for(std::size_t i = 0; i < Out.size() - 1; ++i) - { - _mm_prefetch((char*)&Data[i + 1], _MM_HINT_T0); - glm::simdMat4 m(Data[i]); - glm::simdMat4 o; - glm::detail::sse_inverse_fast_ps((__m128 const * const)&m, (__m128 *)&o); - Out[i] = *(glm::mat4*)&o; - } - - std::clock_t TimeEnd = clock(); - printf("Inv C: %ld\n", TimeEnd - TimeStart); -} - -void test_invD(std::vector const & Data, std::vector & Out) -{ - //std::vector Test(Data.size()); - Out.resize(Data.size()); - - std::clock_t TimeStart = clock(); - - for(std::size_t i = 0; i < Out.size() - 1; ++i) - { - _mm_prefetch((char*)&Data[i + 1], _MM_HINT_T0); - glm::simdMat4 m(Data[i]); - glm::simdMat4 o; - glm::detail::sse_inverse_ps((__m128 const * const)&m, (__m128 *)&o); - Out[i] = *(glm::mat4*)&o; - } - - std::clock_t TimeEnd = clock(); - printf("Inv D: %ld\n", TimeEnd - TimeStart); -} - -void test_mulA(std::vector const & Data, std::vector & Out) -{ - //std::vector Test(Data.size()); - Out.resize(Data.size()); - - std::clock_t TimeStart = clock(); - - for(std::size_t i = 0; i < Out.size() - 1; ++i) - { - Out[i] = Data[i] * Data[i]; - } - - std::clock_t TimeEnd = clock(); - printf("Mul A: %ld\n", TimeEnd - TimeStart); -} - -void test_mulD(std::vector const & Data, std::vector & Out) -{ - //std::vector Test(Data.size()); - Out.resize(Data.size()); - - std::clock_t TimeStart = clock(); - - for(std::size_t i = 0; i < Out.size() - 1; ++i) - { - _mm_prefetch((char*)&Data[i + 1], _MM_HINT_T0); - glm::simdMat4 m(Data[i]); - glm::simdMat4 o; - glm::detail::sse_mul_ps((__m128 const * const)&m, (__m128 const * const)&m, (__m128*)&o); - Out[i] = *(glm::mat4*)&o; - } - - std::clock_t TimeEnd = clock(); - printf("Mul D: %ld\n", TimeEnd - TimeStart); -} - -int test_compute_glm() -{ - return 0; -} - -int test_compute_gtx() -{ - std::vector Output(1000000); - - std::clock_t TimeStart = clock(); - - for(std::size_t k = 0; k < Output.size(); ++k) - { - float i = float(k) / 1000.f + 0.001f; - glm::vec3 A = glm::normalize(glm::vec3(i)); - glm::vec3 B = glm::cross(A, glm::normalize(glm::vec3(1, 1, 2))); - glm::mat4 C = glm::rotate(glm::mat4(1.0f), i, B); - glm::mat4 D = glm::scale(C, glm::vec3(0.8f, 1.0f, 1.2f)); - glm::mat4 E = glm::translate(D, glm::vec3(1.4f, 1.2f, 1.1f)); - glm::mat4 F = glm::perspective(i, 1.5f, 0.1f, 1000.f); - glm::mat4 G = glm::inverse(F * E); - glm::vec3 H = glm::unProject(glm::vec3(i), G, F, E[3]); - glm::vec3 I = glm::any(glm::isnan(glm::project(H, G, F, E[3]))) ? glm::vec3(2) : glm::vec3(1); - glm::mat4 J = glm::lookAt(glm::normalize(glm::max(B, glm::vec3(0.001f))), H, I); - glm::mat4 K = glm::transpose(J); - glm::quat L = glm::normalize(glm::quat_cast(K)); - glm::vec4 M = L * glm::smoothstep(K[3], J[3], glm::vec4(i)); - glm::mat4 N = glm::mat4(glm::normalize(glm::max(M, glm::vec4(0.001f))), K[3], J[3], glm::vec4(i)); - glm::mat4 O = N * glm::inverse(N); - glm::vec4 P = O * glm::reflect(N[3], glm::vec4(A, 1.0f)); - glm::vec4 Q = glm::vec4(glm::dot(M, P)); - glm::vec4 R = glm::quat(Q.w, glm::vec3(Q)) * P; - Output[k] = R; - } - - std::clock_t TimeEnd = clock(); - printf("test_compute_gtx: %ld\n", TimeEnd - TimeStart); - - return 0; -} - -int main() -{ - int Error = 0; - - std::vector Data(64 * 64 * 1); - for(std::size_t i = 0; i < Data.size(); ++i) - Data[i] = glm::mat4( - glm::vec4(glm::linearRand(glm::vec4(-2.0f), glm::vec4(2.0f))), - glm::vec4(glm::linearRand(glm::vec4(-2.0f), glm::vec4(2.0f))), - glm::vec4(glm::linearRand(glm::vec4(-2.0f), glm::vec4(2.0f))), - glm::vec4(glm::linearRand(glm::vec4(-2.0f), glm::vec4(2.0f)))); - - { - std::vector TestInvA; - test_invA(Data, TestInvA); - } - { - std::vector TestInvC; - test_invC(Data, TestInvC); - } - { - std::vector TestInvD; - test_invD(Data, TestInvD); - } - - { - std::vector TestA; - test_mulA(Data, TestA); - } - { - std::vector TestD; - test_mulD(Data, TestD); - } - - { - std::vector TestDetA = test_detA(Data); - std::vector TestDetB = test_detB(Data); - std::vector TestDetD = test_detD(Data); - std::vector TestDetC = test_detC(Data); - - for(std::size_t i = 0; i < TestDetA.size(); ++i) - if(TestDetA[i] != TestDetB[i] && TestDetC[i] != TestDetB[i] && TestDetC[i] != TestDetD[i]) - return 1; - } - - // shuffle test - glm::simdVec4 A(1.0f, 2.0f, 3.0f, 4.0f); - glm::simdVec4 B(5.0f, 6.0f, 7.0f, 8.0f); - //__m128 C = _mm_shuffle_ps(A.Data, B.Data, _MM_SHUFFLE(1, 0, 1, 0)); - - Error += test_compute_glm(); - Error += test_compute_gtx(); - float Det = glm::determinant(glm::simdMat4(1.0)); - Error += Det == 1.0f ? 0 : 1; - - glm::simdMat4 D = glm::matrixCompMult(glm::simdMat4(1.0), glm::simdMat4(1.0)); - - return Error; -} - -#else - -int main() -{ - int Error = 0; - - return Error; -} - -#endif//(GLM_ARCH != GLM_ARCH_PURE) diff --git a/3rdparty/glm/source/test/gtx/gtx_simd_vec4.cpp b/3rdparty/glm/source/test/gtx/gtx_simd_vec4.cpp deleted file mode 100644 index e71a60b..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_simd_vec4.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////// -/// OpenGL Mathematics (glm.g-truc.net) -/// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) -/// Permission is hereby granted, free of charge, to any person obtaining a copy -/// of this software and associated documentation files (the "Software"), to deal -/// in the Software without restriction, including without limitation the rights -/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -/// copies of the Software, and to permit persons to whom the Software is -/// furnished to do so, subject to the following conditions: -/// -/// The above copyright notice and this permission notice shall be included in -/// all copies or substantial portions of the Software. -/// -/// Restrictions: -/// By making use of the Software for military purposes, you choose to make -/// a Bunny unhappy. -/// -/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -/// THE SOFTWARE. -/// -/// @file test/gtx/gtx_simd_vec4.cpp -/// @date 2010-09-16 / 2014-11-25 -/// @author Christophe Riccio -/////////////////////////////////////////////////////////////////////////////////// - -#include -#include -#include - -#if(GLM_ARCH != GLM_ARCH_PURE) - -int main() -{ - glm::simdVec4 A1(0.0f, 0.1f, 0.2f, 0.3f); - glm::simdVec4 B1(0.4f, 0.5f, 0.6f, 0.7f); - glm::simdVec4 C1 = A1 + B1; - glm::simdVec4 D1 = A1.swizzle(); - glm::simdVec4 E1(glm::vec4(1.0f)); - glm::vec4 F1 = glm::vec4_cast(E1); - //glm::vec4 G1(E1); - - //printf("A1(%2.3f, %2.3f, %2.3f, %2.3f)\n", A1.x, A1.y, A1.z, A1.w); - //printf("B1(%2.3f, %2.3f, %2.3f, %2.3f)\n", B1.x, B1.y, B1.z, B1.w); - //printf("C1(%2.3f, %2.3f, %2.3f, %2.3f)\n", C1.x, C1.y, C1.z, C1.w); - //printf("D1(%2.3f, %2.3f, %2.3f, %2.3f)\n", D1.x, D1.y, D1.z, D1.w); - - __m128 value = _mm_set1_ps(0.0f); - __m128 data = _mm_cmpeq_ps(value, value); - __m128 add0 = _mm_add_ps(data, data); - - glm::simdVec4 GNI(add0); - - return 0; -} - -#else - -int main() -{ - int Error = 0; - - return Error; -} - -#endif//(GLM_ARCH != GLM_ARCH_PURE) diff --git a/3rdparty/glm/source/test/gtx/gtx_spline.cpp b/3rdparty/glm/source/test/gtx/gtx_spline.cpp deleted file mode 100644 index c93ee17..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_spline.cpp +++ /dev/null @@ -1,100 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#include -#include -#include - -namespace catmullRom -{ - int test() - { - int Error(0); - - glm::vec2 Result2 = glm::catmullRom( - glm::vec2(0.0f, 0.0f), - glm::vec2(1.0f, 0.0f), - glm::vec2(1.0f, 1.0f), - glm::vec2(0.0f, 1.0f), 0.5f); - - glm::vec3 Result3 = glm::catmullRom( - glm::vec3(0.0f, 0.0f, 0.0f), - glm::vec3(1.0f, 0.0f, 0.0f), - glm::vec3(1.0f, 1.0f, 0.0f), - glm::vec3(0.0f, 1.0f, 0.0f), 0.5f); - - glm::vec4 Result4 = glm::catmullRom( - glm::vec4(0.0f, 0.0f, 0.0f, 1.0f), - glm::vec4(1.0f, 0.0f, 0.0f, 1.0f), - glm::vec4(1.0f, 1.0f, 0.0f, 1.0f), - glm::vec4(0.0f, 1.0f, 0.0f, 1.0f), 0.5f); - - return Error; - } -}//catmullRom - -namespace hermite -{ - int test() - { - int Error(0); - - glm::vec2 Result2 = glm::hermite( - glm::vec2(0.0f, 0.0f), - glm::vec2(1.0f, 0.0f), - glm::vec2(1.0f, 1.0f), - glm::vec2(0.0f, 1.0f), 0.5f); - - glm::vec3 Result3 = glm::hermite( - glm::vec3(0.0f, 0.0f, 0.0f), - glm::vec3(1.0f, 0.0f, 0.0f), - glm::vec3(1.0f, 1.0f, 0.0f), - glm::vec3(0.0f, 1.0f, 0.0f), 0.5f); - - glm::vec4 Result4 = glm::hermite( - glm::vec4(0.0f, 0.0f, 0.0f, 1.0f), - glm::vec4(1.0f, 0.0f, 0.0f, 1.0f), - glm::vec4(1.0f, 1.0f, 0.0f, 1.0f), - glm::vec4(0.0f, 1.0f, 0.0f, 1.0f), 0.5f); - - return Error; - } -}//catmullRom - -namespace cubic -{ - int test() - { - int Error(0); - - glm::vec2 Result2 = glm::cubic( - glm::vec2(0.0f, 0.0f), - glm::vec2(1.0f, 0.0f), - glm::vec2(1.0f, 1.0f), - glm::vec2(0.0f, 1.0f), 0.5f); - - glm::vec3 Result3 = glm::cubic( - glm::vec3(0.0f, 0.0f, 0.0f), - glm::vec3(1.0f, 0.0f, 0.0f), - glm::vec3(1.0f, 1.0f, 0.0f), - glm::vec3(0.0f, 1.0f, 0.0f), 0.5f); - - glm::vec4 Result = glm::cubic( - glm::vec4(0.0f, 0.0f, 0.0f, 1.0f), - glm::vec4(1.0f, 0.0f, 0.0f, 1.0f), - glm::vec4(1.0f, 1.0f, 0.0f, 1.0f), - glm::vec4(0.0f, 1.0f, 0.0f, 1.0f), 0.5f); - - return Error; - } -}//catmullRom - -int main() -{ - int Error(0); - - Error += catmullRom::test(); - Error += hermite::test(); - Error += cubic::test(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_string_cast.cpp b/3rdparty/glm/source/test/gtx/gtx_string_cast.cpp deleted file mode 100644 index b04c870..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_string_cast.cpp +++ /dev/null @@ -1,155 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#include -#include - -int test_string_cast_vector() -{ - int Error = 0; - - { - glm::vec2 A1(1, 2); - std::string A2 = glm::to_string(A1); - Error += A2 != std::string("vec2(1.000000, 2.000000)") ? 1 : 0; - - glm::vec3 B1(1, 2, 3); - std::string B2 = glm::to_string(B1); - Error += B2 != std::string("vec3(1.000000, 2.000000, 3.000000)") ? 1 : 0; - - glm::vec4 C1(1, 2, 3, 4); - std::string C2 = glm::to_string(C1); - Error += C2 != std::string("vec4(1.000000, 2.000000, 3.000000, 4.000000)") ? 1 : 0; - - glm::dvec2 J1(1, 2); - std::string J2 = glm::to_string(J1); - Error += J2 != std::string("dvec2(1.000000, 2.000000)") ? 1 : 0; - - glm::dvec3 K1(1, 2, 3); - std::string K2 = glm::to_string(K1); - Error += K2 != std::string("dvec3(1.000000, 2.000000, 3.000000)") ? 1 : 0; - - glm::dvec4 L1(1, 2, 3, 4); - std::string L2 = glm::to_string(L1); - Error += L2 != std::string("dvec4(1.000000, 2.000000, 3.000000, 4.000000)") ? 1 : 0; - } - - { - glm::bvec2 M1(false, true); - std::string M2 = glm::to_string(M1); - Error += M2 != std::string("bvec2(false, true)") ? 1 : 0; - - glm::bvec3 O1(false, true, false); - std::string O2 = glm::to_string(O1); - Error += O2 != std::string("bvec3(false, true, false)") ? 1 : 0; - - glm::bvec4 P1(false, true, false, true); - std::string P2 = glm::to_string(P1); - Error += P2 != std::string("bvec4(false, true, false, true)") ? 1 : 0; - } - - { - glm::ivec2 D1(1, 2); - std::string D2 = glm::to_string(D1); - Error += D2 != std::string("ivec2(1, 2)") ? 1 : 0; - - glm::ivec3 E1(1, 2, 3); - std::string E2 = glm::to_string(E1); - Error += E2 != std::string("ivec3(1, 2, 3)") ? 1 : 0; - - glm::ivec4 F1(1, 2, 3, 4); - std::string F2 = glm::to_string(F1); - Error += F2 != std::string("ivec4(1, 2, 3, 4)") ? 1 : 0; - } - - { - glm::i8vec2 D1(1, 2); - std::string D2 = glm::to_string(D1); - Error += D2 != std::string("i8vec2(1, 2)") ? 1 : 0; - - glm::i8vec3 E1(1, 2, 3); - std::string E2 = glm::to_string(E1); - Error += E2 != std::string("i8vec3(1, 2, 3)") ? 1 : 0; - - glm::i8vec4 F1(1, 2, 3, 4); - std::string F2 = glm::to_string(F1); - Error += F2 != std::string("i8vec4(1, 2, 3, 4)") ? 1 : 0; - } - - { - glm::i16vec2 D1(1, 2); - std::string D2 = glm::to_string(D1); - Error += D2 != std::string("i16vec2(1, 2)") ? 1 : 0; - - glm::i16vec3 E1(1, 2, 3); - std::string E2 = glm::to_string(E1); - Error += E2 != std::string("i16vec3(1, 2, 3)") ? 1 : 0; - - glm::i16vec4 F1(1, 2, 3, 4); - std::string F2 = glm::to_string(F1); - Error += F2 != std::string("i16vec4(1, 2, 3, 4)") ? 1 : 0; - } - - { - glm::i64vec2 D1(1, 2); - std::string D2 = glm::to_string(D1); - Error += D2 != std::string("i64vec2(1, 2)") ? 1 : 0; - - glm::i64vec3 E1(1, 2, 3); - std::string E2 = glm::to_string(E1); - Error += E2 != std::string("i64vec3(1, 2, 3)") ? 1 : 0; - - glm::i64vec4 F1(1, 2, 3, 4); - std::string F2 = glm::to_string(F1); - Error += F2 != std::string("i64vec4(1, 2, 3, 4)") ? 1 : 0; - } - - return Error; -} - -int test_string_cast_matrix() -{ - int Error = 0; - - glm::mat2x2 A1(1.000000, 2.000000, 3.000000, 4.000000); - std::string A2 = glm::to_string(A1); - Error += A2 != std::string("mat2x2((1.000000, 2.000000), (3.000000, 4.000000))") ? 1 : 0; - - return Error; -} - -int test_string_cast_quaternion() -{ - int Error = 0; - - glm::quat Q0 = glm::quat(1.0f, 2.0f, 3.0f, 4.0f); - std::string S0 = glm::to_string(Q0); - Error += S0 != std::string("quat(1.000000, {2.000000, 3.000000, 4.000000})") ? 1 : 0; - - return Error; - -} - -int test_string_cast_dual_quaternion() -{ - int Error = 0; - - glm::dualquat Q0 = glm::dualquat(glm::quat(1.0f, 2.0f, 3.0f, 4.0f), glm::quat(5.0f, 6.0f, 7.0f, 8.0f)); - std::string S0 = glm::to_string(Q0); - Error += S0 != std::string("dualquat((1.000000, {2.000000, 3.000000, 4.000000}), (5.000000, {6.000000, 7.000000, 8.000000}))") ? 1 : 0; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_string_cast_vector(); - Error += test_string_cast_matrix(); - Error += test_string_cast_quaternion(); - Error += test_string_cast_dual_quaternion(); - - return Error; -} - - diff --git a/3rdparty/glm/source/test/gtx/gtx_texture.cpp b/3rdparty/glm/source/test/gtx/gtx_texture.cpp deleted file mode 100644 index 0b98ed7..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_texture.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#include - -int test_levels() -{ - int Error = 0; - - int const Levels = glm::levels(glm::ivec2(3, 2)); - Error += Levels == 2 ? 0 : 1; - - return Error; -} - -int main() -{ - int Error = 0; - - Error += test_levels(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_type_aligned.cpp b/3rdparty/glm/source/test/gtx/gtx_type_aligned.cpp deleted file mode 100644 index 8d045c0..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_type_aligned.cpp +++ /dev/null @@ -1,114 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#include - -int test_decl() -{ - int Error(0); - - { - struct S1 - { - glm::aligned_vec4 B; - }; - - struct S2 - { - glm::vec4 B; - }; - - std::printf("vec4 - Aligned: %d, unaligned: %d\n", static_cast(sizeof(S1)), static_cast(sizeof(S2))); - - Error += sizeof(S1) >= sizeof(S2) ? 0 : 1; - } - - { - struct S1 - { - bool A; - glm::vec3 B; - }; - - struct S2 - { - bool A; - glm::aligned_vec3 B; - }; - - std::printf("vec3 - Aligned: %d, unaligned: %d\n", static_cast(sizeof(S1)), static_cast(sizeof(S2))); - - Error += sizeof(S1) <= sizeof(S2) ? 0 : 1; - } - - { - struct S1 - { - bool A; - glm::aligned_vec4 B; - }; - - struct S2 - { - bool A; - glm::vec4 B; - }; - - std::printf("vec4 - Aligned: %d, unaligned: %d\n", static_cast(sizeof(S1)), static_cast(sizeof(S2))); - - Error += sizeof(S1) >= sizeof(S2) ? 0 : 1; - } - - { - struct S1 - { - bool A; - glm::aligned_dvec4 B; - }; - - struct S2 - { - bool A; - glm::dvec4 B; - }; - - std::printf("dvec4 - Aligned: %d, unaligned: %d\n", static_cast(sizeof(S1)), static_cast(sizeof(S2))); - - Error += sizeof(S1) >= sizeof(S2) ? 0 : 1; - } - - return Error; -} - -template -void print(genType const& Mat0) -{ - std::printf("mat4(\n"); - std::printf("\tvec4(%2.9f, %2.9f, %2.9f, %2.9f)\n", static_cast(Mat0[0][0]), static_cast(Mat0[0][1]), static_cast(Mat0[0][2]), static_cast(Mat0[0][3])); - std::printf("\tvec4(%2.9f, %2.9f, %2.9f, %2.9f)\n", static_cast(Mat0[1][0]), static_cast(Mat0[1][1]), static_cast(Mat0[1][2]), static_cast(Mat0[1][3])); - std::printf("\tvec4(%2.9f, %2.9f, %2.9f, %2.9f)\n", static_cast(Mat0[2][0]), static_cast(Mat0[2][1]), static_cast(Mat0[2][2]), static_cast(Mat0[2][3])); - std::printf("\tvec4(%2.9f, %2.9f, %2.9f, %2.9f))\n\n", static_cast(Mat0[3][0]), static_cast(Mat0[3][1]), static_cast(Mat0[3][2]), static_cast(Mat0[3][3])); -} - -int perf_mul() -{ - int Error = 0; - - glm::mat4 A(1.0f); - glm::mat4 B(1.0f); - - glm::mat4 C = A * B; - - print(C); - - return Error; -} - -int main() -{ - int Error(0); - - Error += test_decl(); - Error += perf_mul(); - - return Error; -} diff --git a/3rdparty/glm/source/test/gtx/gtx_type_trait.cpp b/3rdparty/glm/source/test/gtx/gtx_type_trait.cpp deleted file mode 100644 index 9b96a36..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_type_trait.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#include - -int main() -{ - int Error = 0; - - - - return Error; -} - diff --git a/3rdparty/glm/source/test/gtx/gtx_vec_swizzle.cpp b/3rdparty/glm/source/test/gtx/gtx_vec_swizzle.cpp deleted file mode 100644 index 0b0c8b8..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_vec_swizzle.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include - -int main() -{ - int Error = 0; - - - return Error; -} - diff --git a/3rdparty/glm/source/test/gtx/gtx_vector_angle.cpp b/3rdparty/glm/source/test/gtx/gtx_vector_angle.cpp deleted file mode 100644 index 4e8172b..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_vector_angle.cpp +++ /dev/null @@ -1,59 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#include -#include - -int test_angle() -{ - int Error = 0; - - float AngleA = glm::angle(glm::vec2(1, 0), glm::normalize(glm::vec2(1, 1))); - Error += glm::epsilonEqual(AngleA, glm::pi() * 0.25f, 0.01f) ? 0 : 1; - float AngleB = glm::angle(glm::vec3(1, 0, 0), glm::normalize(glm::vec3(1, 1, 0))); - Error += glm::epsilonEqual(AngleB, glm::pi() * 0.25f, 0.01f) ? 0 : 1; - float AngleC = glm::angle(glm::vec4(1, 0, 0, 0), glm::normalize(glm::vec4(1, 1, 0, 0))); - Error += glm::epsilonEqual(AngleC, glm::pi() * 0.25f, 0.01f) ? 0 : 1; - - return Error; -} - -int test_orientedAngle_vec2() -{ - int Error = 0; - - float AngleA = glm::orientedAngle(glm::vec2(1, 0), glm::normalize(glm::vec2(1, 1))); - Error += glm::epsilonEqual(AngleA, glm::pi() * 0.25f, 0.01f) ? 0 : 1; - float AngleB = glm::orientedAngle(glm::vec2(0, 1), glm::normalize(glm::vec2(1, 1))); - Error += glm::epsilonEqual(AngleB, -glm::pi() * 0.25f, 0.01f) ? 0 : 1; - float AngleC = glm::orientedAngle(glm::normalize(glm::vec2(1, 1)), glm::vec2(0, 1)); - Error += glm::epsilonEqual(AngleC, glm::pi() * 0.25f, 0.01f) ? 0 : 1; - - return Error; -} - -int test_orientedAngle_vec3() -{ - int Error = 0; - - float AngleA = glm::orientedAngle(glm::vec3(1, 0, 0), glm::normalize(glm::vec3(1, 1, 0)), glm::vec3(0, 0, 1)); - Error += glm::epsilonEqual(AngleA, glm::pi() * 0.25f, 0.01f) ? 0 : 1; - float AngleB = glm::orientedAngle(glm::vec3(0, 1, 0), glm::normalize(glm::vec3(1, 1, 0)), glm::vec3(0, 0, 1)); - Error += glm::epsilonEqual(AngleB, -glm::pi() * 0.25f, 0.01f) ? 0 : 1; - float AngleC = glm::orientedAngle(glm::normalize(glm::vec3(1, 1, 0)), glm::vec3(0, 1, 0), glm::vec3(0, 0, 1)); - Error += glm::epsilonEqual(AngleC, glm::pi() * 0.25f, 0.01f) ? 0 : 1; - - return Error; -} - -int main() -{ - int Error(0); - - Error += test_angle(); - Error += test_orientedAngle_vec2(); - Error += test_orientedAngle_vec3(); - - return Error; -} - - diff --git a/3rdparty/glm/source/test/gtx/gtx_vector_query.cpp b/3rdparty/glm/source/test/gtx/gtx_vector_query.cpp deleted file mode 100644 index 729f9e1..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_vector_query.cpp +++ /dev/null @@ -1,82 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#include -#include -#include - -int test_areCollinear() -{ - int Error(0); - - { - bool TestA = glm::areCollinear(glm::vec2(-1), glm::vec2(1), 0.00001f); - Error += TestA ? 0 : 1; - } - - { - bool TestA = glm::areCollinear(glm::vec3(-1), glm::vec3(1), 0.00001f); - Error += TestA ? 0 : 1; - } - - { - bool TestA = glm::areCollinear(glm::vec4(-1), glm::vec4(1), 0.00001f); - Error += TestA ? 0 : 1; - } - - return Error; -} - -int test_areOrthogonal() -{ - int Error(0); - - bool TestA = glm::areOrthogonal(glm::vec2(1, 0), glm::vec2(0, 1), 0.00001f); - Error += TestA ? 0 : 1; - - return Error; -} - -int test_isNormalized() -{ - int Error(0); - - bool TestA = glm::isNormalized(glm::vec4(1, 0, 0, 0), 0.00001f); - Error += TestA ? 0 : 1; - - return Error; -} - -int test_isNull() -{ - int Error(0); - - bool TestA = glm::isNull(glm::vec4(0), 0.00001f); - Error += TestA ? 0 : 1; - - return Error; -} - -int test_areOrthonormal() -{ - int Error(0); - - bool TestA = glm::areOrthonormal(glm::vec2(1, 0), glm::vec2(0, 1), 0.00001f); - Error += TestA ? 0 : 1; - - return Error; -} - -int main() -{ - int Error(0); - - Error += test_areCollinear(); - Error += test_areOrthogonal(); - Error += test_isNormalized(); - Error += test_isNull(); - Error += test_areOrthonormal(); - - return Error; -} - - diff --git a/3rdparty/glm/source/test/gtx/gtx_wrap.cpp b/3rdparty/glm/source/test/gtx/gtx_wrap.cpp deleted file mode 100644 index 2354cc8..0000000 --- a/3rdparty/glm/source/test/gtx/gtx_wrap.cpp +++ /dev/null @@ -1,191 +0,0 @@ -#define GLM_ENABLE_EXPERIMENTAL -#include -#include -#include - -namespace clamp -{ - int test() - { - int Error(0); - - float A = glm::clamp(0.5f); - Error += glm::equal(A, 0.5f, 0.00001f) ? 0 : 1; - - float B = glm::clamp(0.0f); - Error += glm::equal(B, 0.0f, 0.00001f) ? 0 : 1; - - float C = glm::clamp(1.0f); - Error += glm::equal(C, 1.0f, 0.00001f) ? 0 : 1; - - float D = glm::clamp(-0.5f); - Error += glm::equal(D, 0.0f, 0.00001f) ? 0 : 1; - - float E = glm::clamp(1.5f); - Error += glm::equal(E, 1.0f, 0.00001f) ? 0 : 1; - - glm::vec2 K = glm::clamp(glm::vec2(0.5f)); - Error += glm::all(glm::equal(K, glm::vec2(0.5f), glm::vec2(0.00001f))) ? 0 : 1; - - glm::vec3 L = glm::clamp(glm::vec3(0.5f)); - Error += glm::all(glm::equal(L, glm::vec3(0.5f), glm::vec3(0.00001f))) ? 0 : 1; - - glm::vec4 M = glm::clamp(glm::vec4(0.5f)); - Error += glm::all(glm::equal(M, glm::vec4(0.5f), glm::vec4(0.00001f))) ? 0 : 1; - - glm::vec1 N = glm::clamp(glm::vec1(0.5f)); - Error += glm::all(glm::equal(N, glm::vec1(0.5f), glm::vec1(0.00001f))) ? 0 : 1; - - return Error; - } -}//namespace clamp - -namespace repeat -{ - int test() - { - int Error(0); - - float A = glm::repeat(0.5f); - Error += glm::equal(A, 0.5f, 0.00001f) ? 0 : 1; - - float B = glm::repeat(0.0f); - Error += glm::equal(B, 0.0f, 0.00001f) ? 0 : 1; - - float C = glm::repeat(1.0f); - Error += glm::equal(C, 0.0f, 0.00001f) ? 0 : 1; - - float D = glm::repeat(-0.5f); - Error += glm::equal(D, 0.5f, 0.00001f) ? 0 : 1; - - float E = glm::repeat(1.5f); - Error += glm::equal(E, 0.5f, 0.00001f) ? 0 : 1; - - float F = glm::repeat(0.9f); - Error += glm::equal(F, 0.9f, 0.00001f) ? 0 : 1; - - glm::vec2 K = glm::repeat(glm::vec2(0.5f)); - Error += glm::all(glm::equal(K, glm::vec2(0.5f), glm::vec2(0.00001f))) ? 0 : 1; - - glm::vec3 L = glm::repeat(glm::vec3(0.5f)); - Error += glm::all(glm::equal(L, glm::vec3(0.5f), glm::vec3(0.00001f))) ? 0 : 1; - - glm::vec4 M = glm::repeat(glm::vec4(0.5f)); - Error += glm::all(glm::equal(M, glm::vec4(0.5f), glm::vec4(0.00001f))) ? 0 : 1; - - glm::vec1 N = glm::repeat(glm::vec1(0.5f)); - Error += glm::all(glm::equal(N, glm::vec1(0.5f), glm::vec1(0.00001f))) ? 0 : 1; - - return Error; - } -}//namespace repeat - -namespace mirrorClamp -{ - int test() - { - int Error(0); - - float A = glm::mirrorClamp(0.5f); - Error += glm::equal(A, 0.5f, 0.00001f) ? 0 : 1; - - float B = glm::mirrorClamp(0.0f); - Error += glm::equal(B, 0.0f, 0.00001f) ? 0 : 1; - - float C = glm::mirrorClamp(1.1f); - Error += glm::equal(C, 0.1f, 0.00001f) ? 0 : 1; - - float D = glm::mirrorClamp(-0.5f); - Error += glm::equal(D, 0.5f, 0.00001f) ? 0 : 1; - - float E = glm::mirrorClamp(1.5f); - Error += glm::equal(E, 0.5f, 0.00001f) ? 0 : 1; - - float F = glm::mirrorClamp(0.9f); - Error += glm::equal(F, 0.9f, 0.00001f) ? 0 : 1; - - float G = glm::mirrorClamp(3.1f); - Error += glm::equal(G, 0.1f, 0.00001f) ? 0 : 1; - - float H = glm::mirrorClamp(-3.1f); - Error += glm::equal(H, 0.1f, 0.00001f) ? 0 : 1; - - float I = glm::mirrorClamp(-0.9f); - Error += glm::equal(I, 0.9f, 0.00001f) ? 0 : 1; - - glm::vec2 K = glm::mirrorClamp(glm::vec2(0.5f)); - Error += glm::all(glm::equal(K, glm::vec2(0.5f), glm::vec2(0.00001f))) ? 0 : 1; - - glm::vec3 L = glm::mirrorClamp(glm::vec3(0.5f)); - Error += glm::all(glm::equal(L, glm::vec3(0.5f), glm::vec3(0.00001f))) ? 0 : 1; - - glm::vec4 M = glm::mirrorClamp(glm::vec4(0.5f)); - Error += glm::all(glm::equal(M, glm::vec4(0.5f), glm::vec4(0.00001f))) ? 0 : 1; - - glm::vec1 N = glm::mirrorClamp(glm::vec1(0.5f)); - Error += glm::all(glm::equal(N, glm::vec1(0.5f), glm::vec1(0.00001f))) ? 0 : 1; - - return Error; - } -}//namespace mirrorClamp - -namespace mirrorRepeat -{ - int test() - { - int Error(0); - - float A = glm::mirrorRepeat(0.5f); - Error += glm::equal(A, 0.5f, 0.00001f) ? 0 : 1; - - float B = glm::mirrorRepeat(0.0f); - Error += glm::equal(B, 0.0f, 0.00001f) ? 0 : 1; - - float C = glm::mirrorRepeat(1.0f); - Error += glm::equal(C, 1.0f, 0.00001f) ? 0 : 1; - - float D = glm::mirrorRepeat(-0.5f); - Error += glm::equal(D, 0.5f, 0.00001f) ? 0 : 1; - - float E = glm::mirrorRepeat(1.5f); - Error += glm::equal(E, 0.5f, 0.00001f) ? 0 : 1; - - float F = glm::mirrorRepeat(0.9f); - Error += glm::equal(F, 0.9f, 0.00001f) ? 0 : 1; - - float G = glm::mirrorRepeat(3.0f); - Error += glm::equal(G, 1.0f, 0.00001f) ? 0 : 1; - - float H = glm::mirrorRepeat(-3.0f); - Error += glm::equal(H, 1.0f, 0.00001f) ? 0 : 1; - - float I = glm::mirrorRepeat(-1.0f); - Error += glm::equal(I, 1.0f, 0.00001f) ? 0 : 1; - - glm::vec2 K = glm::mirrorRepeat(glm::vec2(0.5f)); - Error += glm::all(glm::equal(K, glm::vec2(0.5f), glm::vec2(0.00001f))) ? 0 : 1; - - glm::vec3 L = glm::mirrorRepeat(glm::vec3(0.5f)); - Error += glm::all(glm::equal(L, glm::vec3(0.5f), glm::vec3(0.00001f))) ? 0 : 1; - - glm::vec4 M = glm::mirrorRepeat(glm::vec4(0.5f)); - Error += glm::all(glm::equal(M, glm::vec4(0.5f), glm::vec4(0.00001f))) ? 0 : 1; - - glm::vec1 N = glm::mirrorRepeat(glm::vec1(0.5f)); - Error += glm::all(glm::equal(N, glm::vec1(0.5f), glm::vec1(0.00001f))) ? 0 : 1; - - return Error; - } -}//namespace mirrorRepeat - -int main() -{ - int Error(0); - - Error += clamp::test(); - Error += repeat::test(); - Error += mirrorClamp::test(); - Error += mirrorRepeat::test(); - - return Error; -} diff --git a/3rdparty/glm/source/test/perf/CMakeLists.txt b/3rdparty/glm/source/test/perf/CMakeLists.txt deleted file mode 100644 index 19c7050..0000000 --- a/3rdparty/glm/source/test/perf/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -glmCreateTestGTC(perf_matrix_div) -glmCreateTestGTC(perf_matrix_inverse) -glmCreateTestGTC(perf_matrix_mul) -glmCreateTestGTC(perf_matrix_mul_vector) -glmCreateTestGTC(perf_matrix_transpose) -glmCreateTestGTC(perf_vector_mul_matrix) diff --git a/3rdparty/glm/source/test/perf/perf_matrix_div.cpp b/3rdparty/glm/source/test/perf/perf_matrix_div.cpp deleted file mode 100644 index 630188d..0000000 --- a/3rdparty/glm/source/test/perf/perf_matrix_div.cpp +++ /dev/null @@ -1,153 +0,0 @@ -#define GLM_FORCE_INLINE -#include -#include -#include -#include -#include -#if GLM_CONFIG_SIMD == GLM_ENABLE -#include -#include -#include -#include - -template -static void test_mat_div_mat(matType const& M, std::vector const& I, std::vector& O) -{ - for (std::size_t i = 0, n = I.size(); i < n; ++i) - O[i] = M / I[i]; -} - -template -static int launch_mat_div_mat(std::vector& O, matType const& Transform, matType const& Scale, std::size_t Samples) -{ - typedef typename matType::value_type T; - - std::vector I(Samples); - O.resize(Samples); - - for(std::size_t i = 0; i < Samples; ++i) - I[i] = Scale * static_cast(i) + Scale; - - std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now(); - test_mat_div_mat(Transform, I, O); - std::chrono::high_resolution_clock::time_point t2 = std::chrono::high_resolution_clock::now(); - - return static_cast(std::chrono::duration_cast(t2 - t1).count()); -} - -template -static int comp_mat2_div_mat2(std::size_t Samples) -{ - typedef typename packedMatType::value_type T; - - int Error = 0; - - packedMatType const Transform(1, 2, 3, 4); - packedMatType const Scale(0.01, 0.02, 0.03, 0.05); - - std::vector SISD; - std::printf("- SISD: %d us\n", launch_mat_div_mat(SISD, Transform, Scale, Samples)); - - std::vector SIMD; - std::printf("- SIMD: %d us\n", launch_mat_div_mat(SIMD, Transform, Scale, Samples)); - - for(std::size_t i = 0; i < Samples; ++i) - { - packedMatType const A = SISD[i]; - packedMatType const B = SIMD[i]; - Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -template -static int comp_mat3_div_mat3(std::size_t Samples) -{ - typedef typename packedMatType::value_type T; - - int Error = 0; - - packedMatType const Transform(1, 2, 3, 4, 5, 6, 7, 8, 9); - packedMatType const Scale(0.01, 0.02, 0.03, 0.05, 0.01, 0.02, 0.03, 0.05, 0.01); - - std::vector SISD; - std::printf("- SISD: %d us\n", launch_mat_div_mat(SISD, Transform, Scale, Samples)); - - std::vector SIMD; - std::printf("- SIMD: %d us\n", launch_mat_div_mat(SIMD, Transform, Scale, Samples)); - - for(std::size_t i = 0; i < Samples; ++i) - { - packedMatType const A = SISD[i]; - packedMatType const B = SIMD[i]; - Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -template -static int comp_mat4_div_mat4(std::size_t Samples) -{ - typedef typename packedMatType::value_type T; - - int Error = 0; - - packedMatType const Transform(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); - packedMatType const Scale(0.01, 0.02, 0.05, 0.04, 0.02, 0.08, 0.05, 0.01, 0.08, 0.03, 0.05, 0.06, 0.02, 0.03, 0.07, 0.05); - - std::vector SISD; - std::printf("- SISD: %d us\n", launch_mat_div_mat(SISD, Transform, Scale, Samples)); - - std::vector SIMD; - std::printf("- SIMD: %d us\n", launch_mat_div_mat(SIMD, Transform, Scale, Samples)); - - for(std::size_t i = 0; i < Samples; ++i) - { - packedMatType const A = SISD[i]; - packedMatType const B = SIMD[i]; - Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int main() -{ - std::size_t const Samples = 100000; - - int Error = 0; - - std::printf("mat2 / mat2:\n"); - Error += comp_mat2_div_mat2(Samples); - - std::printf("dmat2 / dmat2:\n"); - Error += comp_mat2_div_mat2(Samples); - - std::printf("mat3 / mat3:\n"); - Error += comp_mat3_div_mat3(Samples); - - std::printf("dmat3 / dmat3:\n"); - Error += comp_mat3_div_mat3(Samples); - - std::printf("mat4 / mat4:\n"); - Error += comp_mat4_div_mat4(Samples); - - std::printf("dmat4 / dmat4:\n"); - Error += comp_mat4_div_mat4(Samples); - - return Error; -} - -#else - -int main() -{ - return 0; -} - -#endif diff --git a/3rdparty/glm/source/test/perf/perf_matrix_inverse.cpp b/3rdparty/glm/source/test/perf/perf_matrix_inverse.cpp deleted file mode 100644 index 1a989ae..0000000 --- a/3rdparty/glm/source/test/perf/perf_matrix_inverse.cpp +++ /dev/null @@ -1,150 +0,0 @@ -#define GLM_FORCE_INLINE -#include -#include -#include -#include -#include -#if GLM_CONFIG_SIMD == GLM_ENABLE -#include -#include -#include -#include - -template -static void test_mat_inverse(std::vector const& I, std::vector& O) -{ - for (std::size_t i = 0, n = I.size(); i < n; ++i) - O[i] = glm::inverse(I[i]); -} - -template -static int launch_mat_inverse(std::vector& O, matType const& Scale, std::size_t Samples) -{ - typedef typename matType::value_type T; - - std::vector I(Samples); - O.resize(Samples); - - for(std::size_t i = 0; i < Samples; ++i) - I[i] = Scale * static_cast(i) + Scale; - - std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now(); - test_mat_inverse(I, O); - std::chrono::high_resolution_clock::time_point t2 = std::chrono::high_resolution_clock::now(); - - return static_cast(std::chrono::duration_cast(t2 - t1).count()); -} - -template -static int comp_mat2_inverse(std::size_t Samples) -{ - typedef typename packedMatType::value_type T; - - int Error = 0; - - packedMatType const Scale(0.01, 0.02, 0.03, 0.05); - - std::vector SISD; - std::printf("- SISD: %d us\n", launch_mat_inverse(SISD, Scale, Samples)); - - std::vector SIMD; - std::printf("- SIMD: %d us\n", launch_mat_inverse(SIMD, Scale, Samples)); - - for(std::size_t i = 0; i < Samples; ++i) - { - packedMatType const A = SISD[i]; - packedMatType const B = SIMD[i]; - Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -template -static int comp_mat3_inverse(std::size_t Samples) -{ - typedef typename packedMatType::value_type T; - - int Error = 0; - - packedMatType const Scale(0.01, 0.02, 0.03, 0.05, 0.01, 0.02, 0.03, 0.05, 0.01); - - std::vector SISD; - std::printf("- SISD: %d us\n", launch_mat_inverse(SISD, Scale, Samples)); - - std::vector SIMD; - std::printf("- SIMD: %d us\n", launch_mat_inverse(SIMD, Scale, Samples)); - - for(std::size_t i = 0; i < Samples; ++i) - { - packedMatType const A = SISD[i]; - packedMatType const B = SIMD[i]; - Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -template -static int comp_mat4_inverse(std::size_t Samples) -{ - typedef typename packedMatType::value_type T; - - int Error = 0; - - packedMatType const Scale(0.01, 0.02, 0.05, 0.04, 0.02, 0.08, 0.05, 0.01, 0.08, 0.03, 0.05, 0.06, 0.02, 0.03, 0.07, 0.05); - - std::vector SISD; - std::printf("- SISD: %d us\n", launch_mat_inverse(SISD, Scale, Samples)); - - std::vector SIMD; - std::printf("- SIMD: %d us\n", launch_mat_inverse(SIMD, Scale, Samples)); - - for(std::size_t i = 0; i < Samples; ++i) - { - packedMatType const A = SISD[i]; - packedMatType const B = SIMD[i]; - Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int main() -{ - std::size_t const Samples = 100000; - - int Error = 0; - - std::printf("glm::inverse(mat2):\n"); - Error += comp_mat2_inverse(Samples); - - std::printf("glm::inverse(dmat2):\n"); - Error += comp_mat2_inverse(Samples); - - std::printf("glm::inverse(mat3):\n"); - Error += comp_mat3_inverse(Samples); - - std::printf("glm::inverse(dmat3):\n"); - Error += comp_mat3_inverse(Samples); - - std::printf("glm::inverse(mat4):\n"); - Error += comp_mat4_inverse(Samples); - - std::printf("glm::inverse(dmat4):\n"); - Error += comp_mat4_inverse(Samples); - - return Error; -} - -#else - -int main() -{ - return 0; -} - -#endif diff --git a/3rdparty/glm/source/test/perf/perf_matrix_mul.cpp b/3rdparty/glm/source/test/perf/perf_matrix_mul.cpp deleted file mode 100644 index d6b1f10..0000000 --- a/3rdparty/glm/source/test/perf/perf_matrix_mul.cpp +++ /dev/null @@ -1,154 +0,0 @@ -#define GLM_FORCE_INLINE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if GLM_CONFIG_SIMD == GLM_ENABLE -#include -#include -#include -#include - -template -static void test_mat_mul_mat(matType const& M, std::vector const& I, std::vector& O) -{ - for (std::size_t i = 0, n = I.size(); i < n; ++i) - O[i] = M * I[i]; -} - -template -static int launch_mat_mul_mat(std::vector& O, matType const& Transform, matType const& Scale, std::size_t Samples) -{ - typedef typename matType::value_type T; - - std::vector I(Samples); - O.resize(Samples); - - for(std::size_t i = 0; i < Samples; ++i) - I[i] = Scale * static_cast(i); - - std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now(); - test_mat_mul_mat(Transform, I, O); - std::chrono::high_resolution_clock::time_point t2 = std::chrono::high_resolution_clock::now(); - - return static_cast(std::chrono::duration_cast(t2 - t1).count()); -} - -template -static int comp_mat2_mul_mat2(std::size_t Samples) -{ - typedef typename packedMatType::value_type T; - - int Error = 0; - - packedMatType const Transform(1, 2, 3, 4); - packedMatType const Scale(0.01, 0.02, 0.03, 0.05); - - std::vector SISD; - std::printf("- SISD: %d us\n", launch_mat_mul_mat(SISD, Transform, Scale, Samples)); - - std::vector SIMD; - std::printf("- SIMD: %d us\n", launch_mat_mul_mat(SIMD, Transform, Scale, Samples)); - - for(std::size_t i = 0; i < Samples; ++i) - { - packedMatType const A = SISD[i]; - packedMatType const B = SIMD[i]; - Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; - } - - return Error; -} - -template -static int comp_mat3_mul_mat3(std::size_t Samples) -{ - typedef typename packedMatType::value_type T; - - int Error = 0; - - packedMatType const Transform(1, 2, 3, 4, 5, 6, 7, 8, 9); - packedMatType const Scale(0.01, 0.02, 0.03, 0.05, 0.01, 0.02, 0.03, 0.05, 0.01); - - std::vector SISD; - std::printf("- SISD: %d us\n", launch_mat_mul_mat(SISD, Transform, Scale, Samples)); - - std::vector SIMD; - std::printf("- SIMD: %d us\n", launch_mat_mul_mat(SIMD, Transform, Scale, Samples)); - - for(std::size_t i = 0; i < Samples; ++i) - { - packedMatType const A = SISD[i]; - packedMatType const B = SIMD[i]; - Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; - } - - return Error; -} - -template -static int comp_mat4_mul_mat4(std::size_t Samples) -{ - typedef typename packedMatType::value_type T; - - int Error = 0; - - packedMatType const Transform(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); - packedMatType const Scale(0.01, 0.02, 0.03, 0.05, 0.01, 0.02, 0.03, 0.05, 0.01, 0.02, 0.03, 0.05, 0.01, 0.02, 0.03, 0.05); - - std::vector SISD; - std::printf("- SISD: %d us\n", launch_mat_mul_mat(SISD, Transform, Scale, Samples)); - - std::vector SIMD; - std::printf("- SIMD: %d us\n", launch_mat_mul_mat(SIMD, Transform, Scale, Samples)); - - for(std::size_t i = 0; i < Samples; ++i) - { - packedMatType const A = SISD[i]; - packedMatType const B = SIMD[i]; - Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; - } - - return Error; -} - -int main() -{ - std::size_t const Samples = 100000; - - int Error = 0; - - std::printf("mat2 * mat2:\n"); - Error += comp_mat2_mul_mat2(Samples); - - std::printf("dmat2 * dmat2:\n"); - Error += comp_mat2_mul_mat2(Samples); - - std::printf("mat3 * mat3:\n"); - Error += comp_mat3_mul_mat3(Samples); - - std::printf("dmat3 * dmat3:\n"); - Error += comp_mat3_mul_mat3(Samples); - - std::printf("mat4 * mat4:\n"); - Error += comp_mat4_mul_mat4(Samples); - - std::printf("dmat4 * dmat4:\n"); - Error += comp_mat4_mul_mat4(Samples); - - return Error; -} - -#else - -int main() -{ - return 0; -} - -#endif diff --git a/3rdparty/glm/source/test/perf/perf_matrix_mul_vector.cpp b/3rdparty/glm/source/test/perf/perf_matrix_mul_vector.cpp deleted file mode 100644 index 8e555f8..0000000 --- a/3rdparty/glm/source/test/perf/perf_matrix_mul_vector.cpp +++ /dev/null @@ -1,154 +0,0 @@ -#define GLM_FORCE_INLINE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if GLM_CONFIG_SIMD == GLM_ENABLE -#include -#include -#include -#include - -template -static void test_mat_mul_vec(matType const& M, std::vector const& I, std::vector& O) -{ - for (std::size_t i = 0, n = I.size(); i < n; ++i) - O[i] = M * I[i]; -} - -template -static int launch_mat_mul_vec(std::vector& O, matType const& Transform, vecType const& Scale, std::size_t Samples) -{ - typedef typename matType::value_type T; - - std::vector I(Samples); - O.resize(Samples); - - for(std::size_t i = 0; i < Samples; ++i) - I[i] = Scale * static_cast(i); - - std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now(); - test_mat_mul_vec(Transform, I, O); - std::chrono::high_resolution_clock::time_point t2 = std::chrono::high_resolution_clock::now(); - - return static_cast(std::chrono::duration_cast(t2 - t1).count()); -} - -template -static int comp_mat2_mul_vec2(std::size_t Samples) -{ - typedef typename packedMatType::value_type T; - - int Error = 0; - - packedMatType const Transform(1, 2, 3, 4); - packedVecType const Scale(0.01, 0.02); - - std::vector SISD; - std::printf("- SISD: %d us\n", launch_mat_mul_vec(SISD, Transform, Scale, Samples)); - - std::vector SIMD; - std::printf("- SIMD: %d us\n", launch_mat_mul_vec(SIMD, Transform, Scale, Samples)); - - for(std::size_t i = 0; i < Samples; ++i) - { - packedVecType const A = SISD[i]; - packedVecType const B = packedVecType(SIMD[i]); - Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; - } - - return Error; -} - -template -static int comp_mat3_mul_vec3(std::size_t Samples) -{ - typedef typename packedMatType::value_type T; - - int Error = 0; - - packedMatType const Transform(1, 2, 3, 4, 5, 6, 7, 8, 9); - packedVecType const Scale(0.01, 0.02, 0.05); - - std::vector SISD; - std::printf("- SISD: %d us\n", launch_mat_mul_vec(SISD, Transform, Scale, Samples)); - - std::vector SIMD; - std::printf("- SIMD: %d us\n", launch_mat_mul_vec(SIMD, Transform, Scale, Samples)); - - for(std::size_t i = 0; i < Samples; ++i) - { - packedVecType const A = SISD[i]; - packedVecType const B = SIMD[i]; - Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; - } - - return Error; -} - -template -static int comp_mat4_mul_vec4(std::size_t Samples) -{ - typedef typename packedMatType::value_type T; - - int Error = 0; - - packedMatType const Transform(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); - packedVecType const Scale(0.01, 0.02, 0.03, 0.05); - - std::vector SISD; - std::printf("- SISD: %d us\n", launch_mat_mul_vec(SISD, Transform, Scale, Samples)); - - std::vector SIMD; - std::printf("- SIMD: %d us\n", launch_mat_mul_vec(SIMD, Transform, Scale, Samples)); - - for(std::size_t i = 0; i < Samples; ++i) - { - packedVecType const A = SISD[i]; - packedVecType const B = SIMD[i]; - Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; - } - - return Error; -} - -int main() -{ - std::size_t const Samples = 100000; - - int Error = 0; - - std::printf("mat2 * vec2:\n"); - Error += comp_mat2_mul_vec2(Samples); - - std::printf("dmat2 * dvec2:\n"); - Error += comp_mat2_mul_vec2(Samples); - - std::printf("mat3 * vec3:\n"); - Error += comp_mat3_mul_vec3(Samples); - - std::printf("dmat3 * dvec3:\n"); - Error += comp_mat3_mul_vec3(Samples); - - std::printf("mat4 * vec4:\n"); - Error += comp_mat4_mul_vec4(Samples); - - std::printf("dmat4 * dvec4:\n"); - Error += comp_mat4_mul_vec4(Samples); - - return Error; -} - -#else - -int main() -{ - return 0; -} - -#endif diff --git a/3rdparty/glm/source/test/perf/perf_matrix_transpose.cpp b/3rdparty/glm/source/test/perf/perf_matrix_transpose.cpp deleted file mode 100644 index 2fdc782..0000000 --- a/3rdparty/glm/source/test/perf/perf_matrix_transpose.cpp +++ /dev/null @@ -1,150 +0,0 @@ -#define GLM_FORCE_INLINE -#include -#include -#include -#include -#include -#if GLM_CONFIG_SIMD == GLM_ENABLE -#include -#include -#include -#include - -template -static void test_mat_transpose(std::vector const& I, std::vector& O) -{ - for (std::size_t i = 0, n = I.size(); i < n; ++i) - O[i] = glm::transpose(I[i]); -} - -template -static int launch_mat_transpose(std::vector& O, matType const& Scale, std::size_t Samples) -{ - typedef typename matType::value_type T; - - std::vector I(Samples); - O.resize(Samples); - - for(std::size_t i = 0; i < Samples; ++i) - I[i] = Scale * static_cast(i) + Scale; - - std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now(); - test_mat_transpose(I, O); - std::chrono::high_resolution_clock::time_point t2 = std::chrono::high_resolution_clock::now(); - - return static_cast(std::chrono::duration_cast(t2 - t1).count()); -} - -template -static int comp_mat2_transpose(std::size_t Samples) -{ - typedef typename packedMatType::value_type T; - - int Error = 0; - - packedMatType const Scale(0.01, 0.02, 0.03, 0.05); - - std::vector SISD; - std::printf("- SISD: %d us\n", launch_mat_transpose(SISD, Scale, Samples)); - - std::vector SIMD; - std::printf("- SIMD: %d us\n", launch_mat_transpose(SIMD, Scale, Samples)); - - for(std::size_t i = 0; i < Samples; ++i) - { - packedMatType const A = SISD[i]; - packedMatType const B = SIMD[i]; - Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -template -static int comp_mat3_transpose(std::size_t Samples) -{ - typedef typename packedMatType::value_type T; - - int Error = 0; - - packedMatType const Scale(0.01, 0.02, 0.03, 0.05, 0.01, 0.02, 0.03, 0.05, 0.01); - - std::vector SISD; - std::printf("- SISD: %d us\n", launch_mat_transpose(SISD, Scale, Samples)); - - std::vector SIMD; - std::printf("- SIMD: %d us\n", launch_mat_transpose(SIMD, Scale, Samples)); - - for(std::size_t i = 0; i < Samples; ++i) - { - packedMatType const A = SISD[i]; - packedMatType const B = SIMD[i]; - Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -template -static int comp_mat4_transpose(std::size_t Samples) -{ - typedef typename packedMatType::value_type T; - - int Error = 0; - - packedMatType const Scale(0.01, 0.02, 0.05, 0.04, 0.02, 0.08, 0.05, 0.01, 0.08, 0.03, 0.05, 0.06, 0.02, 0.03, 0.07, 0.05); - - std::vector SISD; - std::printf("- SISD: %d us\n", launch_mat_transpose(SISD, Scale, Samples)); - - std::vector SIMD; - std::printf("- SIMD: %d us\n", launch_mat_transpose(SIMD, Scale, Samples)); - - for(std::size_t i = 0; i < Samples; ++i) - { - packedMatType const A = SISD[i]; - packedMatType const B = SIMD[i]; - Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; - assert(!Error); - } - - return Error; -} - -int main() -{ - std::size_t const Samples = 100000; - - int Error = 0; - - std::printf("glm::transpose(mat2):\n"); - Error += comp_mat2_transpose(Samples); - - std::printf("glm::transpose(dmat2):\n"); - Error += comp_mat2_transpose(Samples); - - std::printf("glm::transpose(mat3):\n"); - Error += comp_mat3_transpose(Samples); - - std::printf("glm::transpose(dmat3):\n"); - Error += comp_mat3_transpose(Samples); - - std::printf("glm::transpose(mat4):\n"); - Error += comp_mat4_transpose(Samples); - - std::printf("glm::transpose(dmat4):\n"); - Error += comp_mat4_transpose(Samples); - - return Error; -} - -#else - -int main() -{ - return 0; -} - -#endif diff --git a/3rdparty/glm/source/test/perf/perf_vector_mul_matrix.cpp b/3rdparty/glm/source/test/perf/perf_vector_mul_matrix.cpp deleted file mode 100644 index 20991df..0000000 --- a/3rdparty/glm/source/test/perf/perf_vector_mul_matrix.cpp +++ /dev/null @@ -1,154 +0,0 @@ -#define GLM_FORCE_INLINE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if GLM_CONFIG_SIMD == GLM_ENABLE -#include -#include -#include -#include - -template -static void test_vec_mul_mat(matType const& M, std::vector const& I, std::vector& O) -{ - for (std::size_t i = 0, n = I.size(); i < n; ++i) - O[i] = I[i] * M; -} - -template -static int launch_vec_mul_mat(std::vector& O, matType const& Transform, vecType const& Scale, std::size_t Samples) -{ - typedef typename matType::value_type T; - - std::vector I(Samples); - O.resize(Samples); - - for(std::size_t i = 0; i < Samples; ++i) - I[i] = Scale * static_cast(i); - - std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now(); - test_vec_mul_mat(Transform, I, O); - std::chrono::high_resolution_clock::time_point t2 = std::chrono::high_resolution_clock::now(); - - return static_cast(std::chrono::duration_cast(t2 - t1).count()); -} - -template -static int comp_vec2_mul_mat2(std::size_t Samples) -{ - typedef typename packedMatType::value_type T; - - int Error = 0; - - packedMatType const Transform(1, 2, 3, 4); - packedVecType const Scale(0.01, 0.02); - - std::vector SISD; - std::printf("- SISD: %d us\n", launch_vec_mul_mat(SISD, Transform, Scale, Samples)); - - std::vector SIMD; - std::printf("- SIMD: %d us\n", launch_vec_mul_mat(SIMD, Transform, Scale, Samples)); - - for(std::size_t i = 0; i < Samples; ++i) - { - packedVecType const A = SISD[i]; - packedVecType const B = packedVecType(SIMD[i]); - Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; - } - - return Error; -} - -template -static int comp_vec3_mul_mat3(std::size_t Samples) -{ - typedef typename packedMatType::value_type T; - - int Error = 0; - - packedMatType const Transform(1, 2, 3, 4, 5, 6, 7, 8, 9); - packedVecType const Scale(0.01, 0.02, 0.05); - - std::vector SISD; - std::printf("- SISD: %d us\n", launch_vec_mul_mat(SISD, Transform, Scale, Samples)); - - std::vector SIMD; - std::printf("- SIMD: %d us\n", launch_vec_mul_mat(SIMD, Transform, Scale, Samples)); - - for(std::size_t i = 0; i < Samples; ++i) - { - packedVecType const A = SISD[i]; - packedVecType const B = SIMD[i]; - Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; - } - - return Error; -} - -template -static int comp_vec4_mul_mat4(std::size_t Samples) -{ - typedef typename packedMatType::value_type T; - - int Error = 0; - - packedMatType const Transform(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); - packedVecType const Scale(0.01, 0.02, 0.03, 0.05); - - std::vector SISD; - std::printf("- SISD: %d us\n", launch_vec_mul_mat(SISD, Transform, Scale, Samples)); - - std::vector SIMD; - std::printf("- SIMD: %d us\n", launch_vec_mul_mat(SIMD, Transform, Scale, Samples)); - - for(std::size_t i = 0; i < Samples; ++i) - { - packedVecType const A = SISD[i]; - packedVecType const B = SIMD[i]; - Error += glm::all(glm::equal(A, B, static_cast(0.001))) ? 0 : 1; - } - - return Error; -} - -int main() -{ - std::size_t const Samples = 100000; - - int Error = 0; - - std::printf("vec2 * mat2:\n"); - Error += comp_vec2_mul_mat2(Samples); - - std::printf("dvec2 * dmat2:\n"); - Error += comp_vec2_mul_mat2(Samples); - - std::printf("vec3 * mat3:\n"); - Error += comp_vec3_mul_mat3(Samples); - - std::printf("dvec3 * dmat3:\n"); - Error += comp_vec3_mul_mat3(Samples); - - std::printf("vec4 * mat4:\n"); - Error += comp_vec4_mul_mat4(Samples); - - std::printf("dvec4 * dmat4:\n"); - Error += comp_vec4_mul_mat4(Samples); - - return Error; -} - -#else - -int main() -{ - return 0; -} - -#endif diff --git a/3rdparty/glm/source/util/autoexp.txt b/3rdparty/glm/source/util/autoexp.txt deleted file mode 100644 index 5a07bed..0000000 --- a/3rdparty/glm/source/util/autoexp.txt +++ /dev/null @@ -1,28 +0,0 @@ -[Visualizer] - -glm::detail::tvec2<*>{ - preview ( - #(#($c.x,$c.y)) - ) - children ( - #([x]: $c.x,[y]: $c.y) - ) -} - -glm::detail::tvec3<*>{ - preview ( - #($e.x,$e.y,$e.z) - ) - children ( - #([x]: $e.x,[y]: $e.y,[z]: $e.z) - ) -} - -glm::detail::tvec4<*>{ - preview ( - #($c.x,$c.y,$c.z,$c.w) - ) - children ( - #([x]: $e.x,[y]: $e.y,[z]: $e.z, #([w]: $e.w)) - ) -} diff --git a/3rdparty/glm/source/util/autoexp.vc2010.dat b/3rdparty/glm/source/util/autoexp.vc2010.dat deleted file mode 100644 index e28d31d..0000000 --- a/3rdparty/glm/source/util/autoexp.vc2010.dat +++ /dev/null @@ -1,3896 +0,0 @@ -; AutoExp.Dat - templates for automatically expanding data -; Copyright(c) Microsoft Corporation. All Rights Reserved. -;--------------------------------------------------------------- -; -; While debugging, Data Tips and items in the Watch and Variable -; windows are automatically expanded to show their most important -; elements. The expansion follows the format given by the rules -; in this file. You can add rules for your types or change the -; predefined rules. -; -; For good examples, read the rules in this file. -; -; To find what the debugger considers the type of a variable to -; be, add it to the Watch window and look at the Type column. -; -; An AutoExpand rule is a line with the name of a type, an equals -; sign, and text with replaceable parts in angle brackets. The -; part in angle brackets names a member of the type and an -; optional Watch format specifier. -; -; AutoExpand rules use the following syntax. The equals sign (=), -; angle brackets (<>), and comma are taken literally. Square -; brackets ([]) indicate optional items. -; -; type=[text]... -; -; type Name of the type (may be followed by <*> for template -; types such as the ATL types listed below). -; -; text Any text.Usually the name of the member to display, -; or a shorthand name for the member. -; -; member Name of a member to display. -; -; format Watch format specifier. One of the following: -; -; Letter Description Sample Display -; ------ -------------------------- ------------ ------------- -; d,i Signed decimal integer 0xF000F065,d -268373915 -; u Unsigned decimal integer 0x0065,u 101 -; o Unsigned octal integer 0xF065,o 0170145 -; x,X Hexadecimal integer 61541,X 0X0000F065 -; l,h long or short prefix for 00406042,hx 0x0c22 -; d, i, u, o, x, X -; f Signed floating-point 3./2.,f 1.500000 -; e Signed scientific-notation 3./2.,e 1.500000e+000 -; g Shorter of e and f 3./2.,g 1.5 -; c Single character 0x0065,c 'e' -; s Zero-terminated string pVar,s "Hello world" -; su Unicode string pVar,su "Hello world" -; -; For details of other format specifiers see Help under: -; "format specifiers/watch variable" -; -; The special format <,t> specifies the name of the most-derived -; type of the object. This is especially useful with pointers or -; references to a base class. -; -; If there is no rule for a class, the base classes are checked for -; a matching rule. -; -; There are some special entries allowed in the AutoExpand section: -; $BUILTIN is used to display more complex types that need to do more -; than just show a member variable or two. -; $ADDIN allows external DLLs to be added to display even more complex -; types via the EE Add-in API. The first argument is the DLL name, the -; second argument is the name of the export from the DLL to use. For -; further information on this API see the sample called EEAddIn. -; -; WARNING: if hexadecimal mode is on in the watch window, all numbers here are -; evaluated in hex, e.g. 42 becomes 0x42 - -[AutoExpand] - -; from windef.h -tagPOINT =x= y= -tagRECT =top= bottom= left= right= - -; from winuser.h -tagMSG =msg= wp= lp= - -; intrinsics -__m64 = -__m128=$BUILTIN(M128) -__m128i=$BUILTIN(M128I) -__m128d=$BUILTIN(M128D) - -; from afxwin.h -CDC =hDC= attrib= -CPaintDC =<,t> hWnd= -CPoint =x= y= -CRect =top= bottom= left= right= -CSize =cx= cy= -CWnd =<,t> hWnd= -CWinApp =<,t> -CWinThread =<,t> h= proc= - -; from afxcoll.h -CPtrList =cnt= - -; from afxstat_.h -CProcessLocalObject =<,t> -CThreadLocalObject =<,t> - -; from afx.h -CArchiveException =cause= -CFile =hFile= name= -CFileException =cause= OS Error=m_lOsError -CMemFile =pos= size= -CObject =<,t> -CRuntimeClass = -CStdioFile =FILE*= name= -CTimeSpan =time= -CTime =time= - -; from afxcoll.h -CByteArray =count= -CStringList =count= -; same for all CXXXArray classes -; same for CXXXList -; same for CMapXXToXX - -; various string classes from MFC & ATL - -_com_error= -_bstr_t=m_wstr,su> (m_RefCount,u>) -_com_ptr_t<*>= -_LARGE_INTEGER= -_ULARGE_INTEGER= -ATL::CComPtr<*>=

- -ATL::CComQIPtr<*>=

- -tagVARIANT=$BUILTIN(VARIANT) -VARIANT=$BUILTIN(VARIANT) -_GUID=$BUILTIN(GUID) - -; see EEAddIn sample for how to use these -;_SYSTEMTIME=$ADDIN(EEAddIn.dll,AddIn_SystemTime) -;_FILETIME=$ADDIN(EEAddIn.dll,AddIn_FileTime) - -[Visualizer] -; This section contains visualizers for STL and ATL containers -; DO NOT MODIFY -ATL::CStringT|CSimpleStringT|ATL::CSimpleStringT{ - preview ([$e.m_pszData,s]) - stringview ([$e.m_pszData,sb]) -} -ATL::CStringT|CSimpleStringT|ATL::CSimpleStringT|ATL::CStringT|CSimpleStringT|ATL::CSimpleStringT{ - preview ([$e.m_pszData,su]) - stringview ([$e.m_pszData,sub]) -} -ATL::CComBSTR{ - preview ([$e.m_str,su]) - stringview ([$e.m_str,sub]) -} - - -; Many visualizers use nested #()s. -; Why not use #(foo, bar) instead of #(#(foo), #(bar))? -; The former alphabetically sorts its fields, while the latter does not. - -;------------------------------------------------------------------------------ -; std::pair from -;------------------------------------------------------------------------------ -std::pair<*>{ - ; pair is previewed with "(, )". - preview ( - #( - "(", - $e.first, - ", ", - $e.second, - ")" - ) - ) - - ; We gloss over the fact that first and second are actually stored in _Pair_base. - children ( - #( - #(first : $e.first), - #(second : $e.second) - ) - ) -} - -;------------------------------------------------------------------------------ -; std::plus, etc. from -;------------------------------------------------------------------------------ -; STL functors are previewed with their names. -; They have no state, so they have no children. -std::plus<*>{ - preview ( "plus" ) - children ( #array(expr: 0, size: 0) ) -} -std::minus<*>{ - preview ( "minus" ) - children ( #array(expr: 0, size: 0) ) -} -std::multiplies<*>{ - preview ( "multiplies" ) - children ( #array(expr: 0, size: 0) ) -} -std::divides<*>{ - preview ( "divides" ) - children ( #array(expr: 0, size: 0) ) -} -std::modulus<*>{ - preview ( "modulus" ) - children ( #array(expr: 0, size: 0) ) -} -std::negate<*>{ - preview ( "negate" ) - children ( #array(expr: 0, size: 0) ) -} -std::equal_to<*>{ - preview ( "equal_to" ) - children ( #array(expr: 0, size: 0) ) -} -std::not_equal_to<*>{ - preview ( "not_equal_to" ) - children ( #array(expr: 0, size: 0) ) -} -std::greater<*>{ - preview ( "greater" ) - children ( #array(expr: 0, size: 0) ) -} -std::less<*>{ - preview ( "less" ) - children ( #array(expr: 0, size: 0) ) -} -std::greater_equal<*>{ - preview ( "greater_equal" ) - children ( #array(expr: 0, size: 0) ) -} -std::less_equal<*>{ - preview ( "less_equal" ) - children ( #array(expr: 0, size: 0) ) -} -std::logical_and<*>{ - preview ( "logical_and" ) - children ( #array(expr: 0, size: 0) ) -} -std::logical_or<*>{ - preview ( "logical_or" ) - children ( #array(expr: 0, size: 0) ) -} -std::logical_not<*>{ - preview ( "logical_not" ) - children ( #array(expr: 0, size: 0) ) -} - -;------------------------------------------------------------------------------ -; std::not1() from -; std::not2() from -;------------------------------------------------------------------------------ -; STL negators are previewed with "not[12]()". -; They have a child with the fake name of [pred], so that the -; stored functor can be inspected. -std::unary_negate<*>{ - preview ( - #( - "not1(", - $e._Functor, - ")" - ) - ) - - children ( - #([pred] : $e._Functor) - ) -} -std::binary_negate<*>{ - preview ( - #( - "not2(", - $e._Functor, - ")" - ) - ) - - children ( - #([pred] : $e._Functor) - ) -} - -;------------------------------------------------------------------------------ -; std::bind1st() from -; std::bind2nd() from -;------------------------------------------------------------------------------ -; STL binders are previewed with "bind1st(, )" or "bind2nd(, )". -; We gloss over the fact that they derive from unary_function. -std::binder1st<*>{ - preview ( - #( - "bind1st(", - $e.op, - ", ", - $e.value, - ")" - ) - ) - - children ( - #( - #(op : $e.op), - #(value : $e.value) - ) - ) -} -std::binder2nd<*>{ - preview ( - #( - "bind2nd(", - $e.op, - ", ", - $e.value, - ")" - ) - ) - - children ( - #( - #(op : $e.op), - #(value : $e.value) - ) - ) -} - -;------------------------------------------------------------------------------ -; std::ptr_fun() from -;------------------------------------------------------------------------------ -; STL function pointer adaptors are previewed with "ptr_fun()". -; Function pointers have no children, so the adaptors have no children. -std::pointer_to_unary_function<*>|std::pointer_to_binary_function<*>{ - preview ( - #( - "ptr_fun(", - $e._Pfun, - ")" - ) - ) - - children ( #array(expr: 0, size: 0) ) -} - -;------------------------------------------------------------------------------ -; std::mem_fun() from -; std::mem_fun_ref() from -;------------------------------------------------------------------------------ -; See ptr_fun(). -std::mem_fun_t<*>|std::mem_fun1_t<*>|std::const_mem_fun_t<*>|std::const_mem_fun1_t<*>{ - preview ( - #( - "mem_fun(", - $e._Pmemfun, - ")" - ) - ) - - children ( #array(expr: 0, size: 0) ) -} -std::mem_fun_ref_t<*>|std::mem_fun1_ref_t<*>|std::const_mem_fun_ref_t<*>|std::const_mem_fun1_ref_t<*>{ - preview ( - #( - "mem_fun_ref(", - $e._Pmemfun, - ")" - ) - ) - - children ( #array(expr: 0, size: 0) ) -} - -;------------------------------------------------------------------------------ -; std::auto_ptr from -;------------------------------------------------------------------------------ -std::auto_ptr<*>{ - ; An empty auto_ptr is previewed with "empty". - ; Otherwise, it is previewed with "auto_ptr ". - preview ( - #if ($e._Myptr == 0) ( - "empty" - ) #else ( - #( - "auto_ptr ", - *$e._Myptr - ) - ) - ) - - ; An empty auto_ptr has no children. - ; Otherwise, it has a single child, its stored pointer, with a fake name of [ptr]. - children ( - #if ($e._Myptr == 0) ( - #array(expr: 0, size: 0) - ) #else ( - #([ptr] : $e._Myptr) - ) - ) -} - -;------------------------------------------------------------------------------ -; std::basic_string from -;------------------------------------------------------------------------------ -; basic_string is previewed with its stored string. -; It has [size] and [capacity] children, followed by [0], [1], [2], etc. children -; displaying its stored characters. -; The ($e._Myres) < ($e._BUF_SIZE) test determines whether the Small String Optimization -; is in effect. -; NOTE: The parentheses in ($e._Myres) < ($e._BUF_SIZE) are necessary. -std::basic_string{ - preview ( #if (($e._Myres) < ($e._BUF_SIZE)) ( [$e._Bx._Buf,s] ) #else ( [$e._Bx._Ptr,s] )) - stringview ( #if (($e._Myres) < ($e._BUF_SIZE)) ( [$e._Bx._Buf,sb] ) #else ( [$e._Bx._Ptr,sb] )) - - children ( - #( - #([size] : $e._Mysize), - #([capacity] : $e._Myres), - #if (($e._Myres) < ($e._BUF_SIZE)) ( - #array(expr: $e._Bx._Buf[$i], size: $e._Mysize) - ) #else ( - #array(expr: $e._Bx._Ptr[$i], size: $e._Mysize) - ) - ) - ) -} -std::basic_string|std::basic_string{ - preview ( #if (($e._Myres) < ($e._BUF_SIZE)) ( [$e._Bx._Buf,su] ) #else ( [$e._Bx._Ptr,su] )) - stringview ( #if (($e._Myres) < ($e._BUF_SIZE)) ( [$e._Bx._Buf,sub] ) #else ( [$e._Bx._Ptr,sub] )) - - children ( - #( - #([size] : $e._Mysize), - #([capacity] : $e._Myres), - #if (($e._Myres) < ($e._BUF_SIZE)) ( - #array(expr: $e._Bx._Buf[$i], size: $e._Mysize) - ) #else ( - #array(expr: $e._Bx._Ptr[$i], size: $e._Mysize) - ) - ) - ) -} -std::_String_iterator|std::_String_const_iterator{ - preview ( [$e._Ptr,s] ) - stringview ( [$e._Ptr,sb] ) - children ( #([ptr] : $e._Ptr) ) -} -std::_String_iterator|std::_String_const_iterator|std::_String_iterator|std::_String_const_iterator{ - preview ( [$e._Ptr,su] ) - stringview ( [$e._Ptr,sub] ) - children ( #([ptr] : $e._Ptr) ) -} - -;------------------------------------------------------------------------------ -; std::vector from -;------------------------------------------------------------------------------ -; Despite its packed representation, vector is visualized like vector. -std::vector{ - preview ( - #( - "[", - $e._Mysize, - "](", - #array( - expr: (bool)(($e._Myvec._Myfirst[$i / _VBITS] >> ($i % _VBITS)) & 1), - size: $e._Mysize - ), - ")" - ) - ) - - children ( - #( - #([size] : $e._Mysize), - #([capacity] : ($e._Myvec._Myend - $e._Myvec._Myfirst) * _VBITS), - #array( - expr: (bool)(($e._Myvec._Myfirst[$i / _VBITS] >> ($i % _VBITS)) & 1), - size: $e._Mysize - ) - ) - ) -} -std::_Vb_reference<*>|std::_Vb_iterator<*>|std::_Vb_const_iterator<*>{ - preview ( - (bool)((*$e._Myptr >> $e._Myoff) & 1) - ) - - children ( - #( - #([ptr] : $e._Myptr), - #([offset] : $e._Myoff) - ) - ) -} - -;------------------------------------------------------------------------------ -; std::vector from -;------------------------------------------------------------------------------ -; vector is previewed with "[]()". -; It has [size] and [capacity] children, followed by its elements. -; The other containers follow its example. -std::vector<*>{ - preview ( - #( - "[", - $e._Mylast - $e._Myfirst, - "](", - #array( - expr: $e._Myfirst[$i], - size: $e._Mylast - $e._Myfirst - ), - ")" - ) - ) - - children ( - #( - #([size] : $e._Mylast - $e._Myfirst), - #([capacity] : $e._Myend - $e._Myfirst), - #array( - expr: $e._Myfirst[$i], - size: $e._Mylast - $e._Myfirst - ) - ) - ) -} -std::_Vector_iterator<*>|std::_Vector_const_iterator<*>{ - preview ( - *$e._Ptr - ) - - children ( - #([ptr] : $e._Ptr) - ) -} - -;------------------------------------------------------------------------------ -; std::deque from -;------------------------------------------------------------------------------ -std::deque<*>{ - preview ( - #( - "[", - $e._Mysize, - "](", - #array( - expr: $e._Map[(($i + $e._Myoff) / $e._EEN_DS) % $e._Mapsize][($i + $e._Myoff) % $e._EEN_DS], - size: $e._Mysize - ), - ")" - ) - ) - - children ( - #( - #array( - expr: $e._Map[(($i + $e._Myoff) / $e._EEN_DS) % $e._Mapsize][($i + $e._Myoff) % $e._EEN_DS], - size: $e._Mysize - ) - ) - ) -} -std::_Deque_iterator<*,*>|std::_Deque_const_iterator<*,*>{ - preview ( - #if ($e._Myoff >= ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Myoff + ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Mysize) ( - "end" - ) #else ( - ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Map[($e._Myoff / ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_EEN_DS) % ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Mapsize][$e._Myoff % ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_EEN_DS] - ) - ) - - children ( - #if ($e._Myoff >= ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Myoff + ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Mysize) ( - #array(expr: 0, size: 0) - ) #else ( - #( - #([index] : $e._Myoff - ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Myoff), - #([ptr] : &((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Map[($e._Myoff / ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_EEN_DS) % ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_Mapsize][$e._Myoff % ((std::deque<$T1,$T2> *)$e._Myproxy->_Mycont)->_EEN_DS] ) - ) - ) - ) -} - -;------------------------------------------------------------------------------ -; std::list from -;------------------------------------------------------------------------------ -std::list<*>{ - preview ( - #( - "[", - $e._Mysize, - "](", - #list( - head: $e._Myhead->_Next, - size: $e._Mysize, - next: _Next - ) : $e._Myval, - ")" - ) - ) - - children ( - #list( - head: $e._Myhead->_Next, - size: $e._Mysize, - next: _Next - ) : $e._Myval - ) -} -std::_List_iterator<*>|std::_List_const_iterator<*>{ - preview ( $e._Ptr->_Myval ) - children ( #([ptr] : &$e._Ptr->_Myval) ) -} - -;------------------------------------------------------------------------------ -; std::queue from -; std::stack from -;------------------------------------------------------------------------------ -std::queue<*>|std::stack<*>{ - preview ( $e.c ) - children ( #(c : $e.c) ) -} - -;------------------------------------------------------------------------------ -; std::priority_queue from -;------------------------------------------------------------------------------ -std::priority_queue<*>{ - preview ( $e.c ) - - children ( - #( - #(c [heap]: $e.c), - #(comp : $e.comp) - ) - ) -} - -;------------------------------------------------------------------------------ -; std::map from -; std::multimap from -; std::set from -; std::multiset from -;------------------------------------------------------------------------------ -std::map<*>|std::multimap<*>|std::set<*>|std::multiset<*>{ - preview ( - #( - "[", - $e._Mysize, - "](", - #tree( - head: $e._Myhead->_Parent, - skip: $e._Myhead, - left: _Left, - right: _Right, - size: $e._Mysize - ) : $e._Myval, - ")" - ) - ) - - children ( - #( - #([comp] : $e.comp), - #tree( - head: $e._Myhead->_Parent, - skip: $e._Myhead, - left: _Left, - right: _Right, - size: $e._Mysize - ) : $e._Myval - ) - ) -} -std::_Tree_iterator<*>|std::_Tree_const_iterator<*>{ - preview ( $e._Ptr->_Myval ) - children ( #([ptr] : &$e._Ptr->_Myval) ) -} - -;------------------------------------------------------------------------------ -; std::bitset from -;------------------------------------------------------------------------------ -std::bitset<*>{ - preview ( - #( - "[", - $e._EEN_BITS, - "](", - #array( - expr: [($e._Array[$i / $e._Bitsperword] >> ($i % $e._Bitsperword)) & 1,d], - size: $e._EEN_BITS - ), - ")" - ) - ) - - children ( - #array( - expr: [($e._Array[$i / $e._Bitsperword] >> ($i % $e._Bitsperword)) & 1,d], - size: $e._EEN_BITS - ) - ) -} -std::bitset<*>::reference{ - preview ( - [($e._Pbitset->_Array[$i / $e._Pbitset->_Bitsperword] >> ($e._Mypos % $e._Pbitset->_Bitsperword)) & 1,d] - ) - - children ( - #( - #([bitset] : $e._Pbitset), - #([pos] : $e._Mypos) - ) - ) -} - -;------------------------------------------------------------------------------ -; std::reverse_iterator from -;------------------------------------------------------------------------------ -std::reverse_iterator >|std::reverse_iterator >{ - preview ( - #( - "reverse_iterator to ", - $e.current._Ptr[-1] - ) - ) - - children ( - #( - #([to] : $e.current._Ptr - 1), - #(current : $e.current) - ) - ) -} -std::reverse_iterator >|std::reverse_iterator >{ - preview ( - #( - "reverse_iterator to ", - #if ($e.current._Myoff != 0) ( - (bool)((*$e.current._Myptr >> ($e.current._Myoff - 1)) & 1) - ) #else ( - (bool)(($e.current._Myptr[-1] >> (_VBITS - 1)) & 1) - ) - ) - ) - - children ( - #if ($e.current._Myoff != 0) ( - #( - #([to ptr] : $e.current._Myptr), - #([to offset] : $e.current._Myoff - 1), - #(current : $e.current) - ) - ) #else ( - #( - #([to ptr] : $e.current._Myptr - 1), - #([to offset] : _VBITS - 1), - #(current : $e.current) - ) - ) - ) -} -std::reverse_iterator >|std::reverse_iterator >{ - preview ( - #( - "reverse_iterator to ", - $e.current._Ptr[-1] - ) - ) - - children ( - #( - #([to] : $e.current._Ptr - 1), - #(current : $e.current) - ) - ) -} -std::reverse_iterator >|std::reverse_iterator >{ - preview ( - #( - "reverse_iterator to ", - #if ($e.current._Myoff == ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Myoff) ( - "end" - ) #else ( - ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Map[(($e.current._Myoff - 1) / ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_EEN_DS) % ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Mapsize][($e.current._Myoff - 1) % ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_EEN_DS] - ) - ) - ) - - children ( - #if ($e.current._Myoff == ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Myoff) ( - #(current : $e.current) - ) #else ( - #( - #([to index] : ($e.current._Myoff - 1) - ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Myoff), - #([to ptr] : &((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Map[(($e.current._Myoff - 1) / ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_EEN_DS) % ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_Mapsize][($e.current._Myoff - 1) % ((std::deque<$T1,$T2> *)$e.current._Myproxy->_Mycont)->_EEN_DS] ), - #(current : $e.current) - ) - ) - ) -} -std::reverse_iterator >|std::reverse_iterator >{ - preview ( - #( - "reverse_iterator to ", - $e.current._Ptr->_Prev->_Myval - ) - ) - - children ( - #( - #([to] : &$e.current._Ptr->_Prev->_Myval), - #(current : $e.current) - ) - ) -} -std::reverse_iterator >|std::reverse_iterator >{ - preview ( - #( - "reverse_iterator to ", - #if ($e.current._EEN_IDL == 0) ( - $e.current._Ptr[-1] - ) #else ( - #if ($e.current._Idx == 0) ( - "end" - ) #else ( - $e.current._Ptr[$e.current._Idx - 1] - ) - ) - ) - ) - - children ( - #if ($e.current._EEN_IDL == 0) ( - #( - #([to] : $e.current._Ptr - 1), - #(current : $e.current) - ) - ) #else ( - #if ($e.current._Idx == 0) ( - #(current : $e.current) - ) #else ( - #( - #([to] : $e.current._Ptr + $e.current._Idx - 1), - #(current : $e.current) - ) - ) - ) - ) -} -std::reverse_iterator<*>{ - preview ( - #( - "reverse_iterator current ", - $e.current - ) - ) - - children ( - #(current : $e.current) - ) -} - -;------------------------------------------------------------------------------ -; std::complex from -;------------------------------------------------------------------------------ -std::complex<*>{ - preview ( - #if ($e._Val[1] == 0) ( - ; Purely real. - $e._Val[0] - ) #else ( - #if ($e._Val[0] == 0) ( - ; Purely imaginary. - #if ($e._Val[1] < 0) ( - #("-i*", -$e._Val[1]) - ) #else ( - #("i*", $e._Val[1]) - ) - ) #else ( - ; Mixed. - #if ($e._Val[1] < 0) ( - #($e._Val[0], "-i*", -$e._Val[1]) - ) #else ( - #($e._Val[0], "+i*", $e._Val[1]) - ) - ) - ) - ) - - children ( - #( - #(real : $e._Val[0]), - #(imag : $e._Val[1]) - ) - ) -} - -;------------------------------------------------------------------------------ -; std::valarray from -;------------------------------------------------------------------------------ -std::valarray<*>{ - preview ( - #( - "[", - $e._Mysize, - "](", - #array( - expr: $e._Myptr[$i], - size: $e._Mysize - ), - ")" - ) - ) - - children ( - #array( - expr: $e._Myptr[$i], - size: $e._Mysize - ) - ) -} - -;------------------------------------------------------------------------------ -; std::tr1::reference_wrapper from -;------------------------------------------------------------------------------ -std::tr1::reference_wrapper<*>{ - preview ( - #if ($e._Callee._EEN_INDIRECT == 1) ( - ; For ordinary T, reference_wrapper stores a T * _Callee._Ptr - ; which is non-null. Actual references are previewed with what they - ; refer to, so reference_wrapper is previewed with dereferencing its - ; stored pointer. - *$e._Callee._Ptr - ) #else ( - ; When T is a pointer to data member type, reference_wrapper - ; stores a T _Callee._Object directly. - $e._Callee._Object - ) - ) - - children ( - #if ($e._Callee._EEN_INDIRECT == 1) ( - ; Actual references have the same children as what they refer to. - ; Unfortunately, there appears to be no way to imitate this exactly. - ; Therefore, we make reference_wrapper appear to have a single - ; child, its stored pointer, with a fake name of [ptr]. - #([ptr] : $e._Callee._Ptr) - ) #else ( - ; When T is a pointer to data member type, T has no children, - ; so we make reference_wrapper appear to have no children. - #array(expr: 0, size: 0) - ) - ) -} - -;------------------------------------------------------------------------------ -; std::tr1::shared_ptr from -;------------------------------------------------------------------------------ -std::tr1::_Ref_count<*>{ - preview ( "default" ) - children ( #array(expr: 0, size: 0) ) -} -std::tr1::_Ref_count_del<*>{ - preview ( "custom deleter" ) - children ( #([deleter] : $e._Dtor) ) -} -std::tr1::_Ref_count_del_alloc<*>{ - preview ( "custom deleter, custom allocator" ) - children ( - #( - #([deleter] : $e._Dtor), - #([allocator] : $e._Myal) - ) - ) -} -std::tr1::_Ref_count_obj<*>{ - preview ( "make_shared" ) - children ( #array(expr: 0, size: 0) ) -} -std::tr1::_Ref_count_obj_alloc<*>{ - preview ( "allocate_shared" ) - children ( #([allocator] : $e._Myal) ) -} -std::tr1::shared_ptr<*>{ - preview ( - ; shared_ptr stores a T * _Ptr . - #if ($e._Ptr == 0) ( - ; A default-constructed shared_ptr has a null _Ptr and a null _Rep, - ; and is formally said to be empty. - ; A shared_ptr constructed from a null pointer has a null _Ptr - ; and a NON-null _Rep . It is formally said to own the null pointer. - ; We preview both with "empty". - "empty" - ) #else ( - ; Raw pointers are previewed with " ". - ; auto_ptr is previewed with "auto_ptr ". - ; Following these examples, shared_ptr is previewed with - ; "shared_ptr [N strong refs, M weak refs]". - #( - "shared_ptr ", - *$e._Ptr, - " [", - $e._Rep->_Uses, - #if ($e._Rep->_Uses == 1) (" strong ref") #else (" strong refs"), - #if ($e._Rep->_Weaks - 1 > 0) ( - #( - ", ", - $e._Rep->_Weaks - 1, - #if ($e._Rep->_Weaks - 1 == 1) (" weak ref") #else (" weak refs") - ) - ), - "] [", - *$e._Rep, - "]" - ) - ; Note: _Rep->_Uses counts how many shared_ptrs share ownership of the object, - ; so we directly display it as the strong reference count. - ; _Rep->_Weaks counts how many shared_ptrs and weak_ptrs share ownership of - ; the "representation object" (or "control block"). All of the shared_ptrs are - ; counted as a single owner. That is, _Weaks is initialized to 1, and when - ; _Uses falls to 0, _Weaks is decremented. This avoids incrementing and decrementing - ; _Weaks every time that a shared_ptr gains or loses ownership. Therefore, - ; _Weaks - 1 is the weak reference count, the number of weak_ptrs that are observing - ; the shared object. - ) - ) - - children ( - #if ($e._Ptr == 0) ( - ; We make empty shared_ptrs (and shared_ptrs that own - ; the null pointer) appear to have no children. - #array(expr: 0, size: 0) - ) #else ( - #( - ; We make shared_ptr appear to have two children: - - ; Its stored pointer, with a fake name of [ptr]. - #([ptr] : $e._Ptr), - - ; Its deleter and allocator, which may be default or custom. - #([deleter and allocator] : *$e._Rep) - ) - ) - ) -} - -;------------------------------------------------------------------------------ -; std::tr1::weak_ptr from -;------------------------------------------------------------------------------ -std::tr1::weak_ptr<*>{ - preview ( - #if ($e._Ptr == 0) ( - "empty" - ) #elif ($e._Rep->_Uses == 0) ( - ; weak_ptr is just like shared_ptr, except that a weak_ptr can be expired. - #( - "expired [", - *$e._Rep, - "]" - ) - ) #else ( - #( - "weak_ptr ", - *$e._Ptr, - " [", - $e._Rep->_Uses, - #if ($e._Rep->_Uses == 1) (" strong ref") #else (" strong refs"), - #if ($e._Rep->_Weaks - 1 > 0) ( - #( - ", ", - $e._Rep->_Weaks - 1, - #if ($e._Rep->_Weaks - 1 == 1) (" weak ref") #else (" weak refs") - ) - ), - "] [", - *$e._Rep, - "]" - ) - ) - ) - - children ( - #if ($e._Ptr == 0) ( - #array(expr: 0, size: 0) - ) #elif ($e._Rep->_Uses == 0) ( - ; When a weak_ptr is expired, we show its deleter and allocator. - ; The deleter has already been used, but the control block has not yet been deallocated. - #([deleter and allocator] : *$e._Rep) - ) #else ( - #( - #([ptr] : $e._Ptr), - #([deleter and allocator] : *$e._Rep) - ) - ) - ) -} - -;------------------------------------------------------------------------------ -; std::tr1::mem_fn() from -;------------------------------------------------------------------------------ -; Note that when mem_fn() is given a data member pointer, it returns a _Call_wrapper<_Callable_pmd<*> > . -; Data member pointers themselves don't have useful previews, so we don't attempt to visualize this. -; When mem_fn() is given a member function pointer, it returns a _Mem_fn[N], which we can visualize. -std::tr1::_Mem_fn1<*>|std::tr1::_Mem_fn2<*>|std::tr1::_Mem_fn3<*>|std::tr1::_Mem_fn4<*>|std::tr1::_Mem_fn5<*>|std::tr1::_Mem_fn6<*>|std::tr1::_Mem_fn7<*>|std::tr1::_Mem_fn8<*>|std::tr1::_Mem_fn9<*>|std::tr1::_Mem_fn10<*>{ - preview ( - ; We preview the functor returned by mem_fn() with "mem_fn()". - #( - "mem_fn(", - $e._Callee._Object, - ")" - ) - ) - - children ( - ; Member function pointers have no children. - #array(expr: 0, size: 0) - ) -} - -;------------------------------------------------------------------------------ -; std::tr1::bind() from -;------------------------------------------------------------------------------ -; bind() placeholders are previewed with their names. -; They have no state, so they have no children. -std::tr1::_Ph<1>{ - preview ( "_1" ) - children ( #array(expr: 0, size: 0) ) -} -std::tr1::_Ph<2>{ - preview ( "_2" ) - children ( #array(expr: 0, size: 0) ) -} -std::tr1::_Ph<3>{ - preview ( "_3" ) - children ( #array(expr: 0, size: 0) ) -} -std::tr1::_Ph<4>{ - preview ( "_4" ) - children ( #array(expr: 0, size: 0) ) -} -std::tr1::_Ph<5>{ - preview ( "_5" ) - children ( #array(expr: 0, size: 0) ) -} -std::tr1::_Ph<6>{ - preview ( "_6" ) - children ( #array(expr: 0, size: 0) ) -} -std::tr1::_Ph<7>{ - preview ( "_7" ) - children ( #array(expr: 0, size: 0) ) -} -std::tr1::_Ph<8>{ - preview ( "_8" ) - children ( #array(expr: 0, size: 0) ) -} -std::tr1::_Ph<9>{ - preview ( "_9" ) - children ( #array(expr: 0, size: 0) ) -} -std::tr1::_Ph<10>{ - preview ( "_10" ) - children ( #array(expr: 0, size: 0) ) -} - -; The functor returned by bind(f, t1, t2) is previewed with "bind(f, t1, t2)". -; It has children with the fake names of [f], [t1], [t2], etc. -std::tr1::_Bind<*,*,std::tr1::_Bind0<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind0<*> >{ - preview ( - #( - "bind(", $e._Bx._Callee._Object, - ")" - ) - ) - - children ( - #( - #([f] : $e._Bx._Callee._Object) - ) - ) -} -std::tr1::_Bind<*,*,std::tr1::_Bind1<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind1<*> >{ - preview ( - #( - "bind(", $e._Bx._Callee._Object, - ", ", $e._Bx._Vx0, - ")" - ) - ) - - children ( - #( - #([f] : $e._Bx._Callee._Object), - #([t1] : $e._Bx._Vx0) - ) - ) -} -std::tr1::_Bind<*,*,std::tr1::_Bind2<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind2<*> >{ - preview ( - #( - "bind(", $e._Bx._Callee._Object, - ", ", $e._Bx._Vx0, - ", ", $e._Bx._Vx1, - ")" - ) - ) - - children ( - #( - #([f] : $e._Bx._Callee._Object), - #([t1] : $e._Bx._Vx0), - #([t2] : $e._Bx._Vx1) - ) - ) -} -std::tr1::_Bind<*,*,std::tr1::_Bind3<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind3<*> >{ - preview ( - #( - "bind(", $e._Bx._Callee._Object, - ", ", $e._Bx._Vx0, - ", ", $e._Bx._Vx1, - ", ", $e._Bx._Vx2, - ")" - ) - ) - - children ( - #( - #([f] : $e._Bx._Callee._Object), - #([t1] : $e._Bx._Vx0), - #([t2] : $e._Bx._Vx1), - #([t3] : $e._Bx._Vx2) - ) - ) -} -std::tr1::_Bind<*,*,std::tr1::_Bind4<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind4<*> >{ - preview ( - #( - "bind(", $e._Bx._Callee._Object, - ", ", $e._Bx._Vx0, - ", ", $e._Bx._Vx1, - ", ", $e._Bx._Vx2, - ", ", $e._Bx._Vx3, - ")" - ) - ) - - children ( - #( - #([f] : $e._Bx._Callee._Object), - #([t1] : $e._Bx._Vx0), - #([t2] : $e._Bx._Vx1), - #([t3] : $e._Bx._Vx2), - #([t4] : $e._Bx._Vx3) - ) - ) -} -std::tr1::_Bind<*,*,std::tr1::_Bind5<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind5<*> >{ - preview ( - #( - "bind(", $e._Bx._Callee._Object, - ", ", $e._Bx._Vx0, - ", ", $e._Bx._Vx1, - ", ", $e._Bx._Vx2, - ", ", $e._Bx._Vx3, - ", ", $e._Bx._Vx4, - ")" - ) - ) - - children ( - #( - #([f] : $e._Bx._Callee._Object), - #([t1] : $e._Bx._Vx0), - #([t2] : $e._Bx._Vx1), - #([t3] : $e._Bx._Vx2), - #([t4] : $e._Bx._Vx3), - #([t5] : $e._Bx._Vx4) - ) - ) -} -std::tr1::_Bind<*,*,std::tr1::_Bind6<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind6<*> >{ - preview ( - #( - "bind(", $e._Bx._Callee._Object, - ", ", $e._Bx._Vx0, - ", ", $e._Bx._Vx1, - ", ", $e._Bx._Vx2, - ", ", $e._Bx._Vx3, - ", ", $e._Bx._Vx4, - ", ", $e._Bx._Vx5, - ")" - ) - ) - - children ( - #( - #([f] : $e._Bx._Callee._Object), - #([t1] : $e._Bx._Vx0), - #([t2] : $e._Bx._Vx1), - #([t3] : $e._Bx._Vx2), - #([t4] : $e._Bx._Vx3), - #([t5] : $e._Bx._Vx4), - #([t6] : $e._Bx._Vx5) - ) - ) -} -std::tr1::_Bind<*,*,std::tr1::_Bind7<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind7<*> >{ - preview ( - #( - "bind(", $e._Bx._Callee._Object, - ", ", $e._Bx._Vx0, - ", ", $e._Bx._Vx1, - ", ", $e._Bx._Vx2, - ", ", $e._Bx._Vx3, - ", ", $e._Bx._Vx4, - ", ", $e._Bx._Vx5, - ", ", $e._Bx._Vx6, - ")" - ) - ) - - children ( - #( - #([f] : $e._Bx._Callee._Object), - #([t1] : $e._Bx._Vx0), - #([t2] : $e._Bx._Vx1), - #([t3] : $e._Bx._Vx2), - #([t4] : $e._Bx._Vx3), - #([t5] : $e._Bx._Vx4), - #([t6] : $e._Bx._Vx5), - #([t7] : $e._Bx._Vx6) - ) - ) -} -std::tr1::_Bind<*,*,std::tr1::_Bind8<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind8<*> >{ - preview ( - #( - "bind(", $e._Bx._Callee._Object, - ", ", $e._Bx._Vx0, - ", ", $e._Bx._Vx1, - ", ", $e._Bx._Vx2, - ", ", $e._Bx._Vx3, - ", ", $e._Bx._Vx4, - ", ", $e._Bx._Vx5, - ", ", $e._Bx._Vx6, - ", ", $e._Bx._Vx7, - ")" - ) - ) - - children ( - #( - #([f] : $e._Bx._Callee._Object), - #([t1] : $e._Bx._Vx0), - #([t2] : $e._Bx._Vx1), - #([t3] : $e._Bx._Vx2), - #([t4] : $e._Bx._Vx3), - #([t5] : $e._Bx._Vx4), - #([t6] : $e._Bx._Vx5), - #([t7] : $e._Bx._Vx6), - #([t8] : $e._Bx._Vx7) - ) - ) -} -std::tr1::_Bind<*,*,std::tr1::_Bind9<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind9<*> >{ - preview ( - #( - "bind(", $e._Bx._Callee._Object, - ", ", $e._Bx._Vx0, - ", ", $e._Bx._Vx1, - ", ", $e._Bx._Vx2, - ", ", $e._Bx._Vx3, - ", ", $e._Bx._Vx4, - ", ", $e._Bx._Vx5, - ", ", $e._Bx._Vx6, - ", ", $e._Bx._Vx7, - ", ", $e._Bx._Vx8, - ")" - ) - ) - - children ( - #( - #([f] : $e._Bx._Callee._Object), - #([t1] : $e._Bx._Vx0), - #([t2] : $e._Bx._Vx1), - #([t3] : $e._Bx._Vx2), - #([t4] : $e._Bx._Vx3), - #([t5] : $e._Bx._Vx4), - #([t6] : $e._Bx._Vx5), - #([t7] : $e._Bx._Vx6), - #([t8] : $e._Bx._Vx7), - #([t9] : $e._Bx._Vx8) - ) - ) -} -std::tr1::_Bind<*,*,std::tr1::_Bind10<*> >|std::tr1::_Bind_fty<*,*,std::tr1::_Bind10<*> >{ - preview ( - #( - "bind(", $e._Bx._Callee._Object, - ", ", $e._Bx._Vx0, - ", ", $e._Bx._Vx1, - ", ", $e._Bx._Vx2, - ", ", $e._Bx._Vx3, - ", ", $e._Bx._Vx4, - ", ", $e._Bx._Vx5, - ", ", $e._Bx._Vx6, - ", ", $e._Bx._Vx7, - ", ", $e._Bx._Vx8, - ", ", $e._Bx._Vx9, - ")" - ) - ) - - children ( - #( - #([f] : $e._Bx._Callee._Object), - #([t1] : $e._Bx._Vx0), - #([t2] : $e._Bx._Vx1), - #([t3] : $e._Bx._Vx2), - #([t4] : $e._Bx._Vx3), - #([t5] : $e._Bx._Vx4), - #([t6] : $e._Bx._Vx5), - #([t7] : $e._Bx._Vx6), - #([t8] : $e._Bx._Vx7), - #([t9] : $e._Bx._Vx8), - #([t10] : $e._Bx._Vx9) - ) - ) -} - -;------------------------------------------------------------------------------ -; std::tr1::function from -;------------------------------------------------------------------------------ -std::tr1::_Impl_no_alloc0<*>|std::tr1::_Impl_no_alloc1<*>|std::tr1::_Impl_no_alloc2<*>|std::tr1::_Impl_no_alloc3<*>|std::tr1::_Impl_no_alloc4<*>|std::tr1::_Impl_no_alloc5<*>|std::tr1::_Impl_no_alloc6<*>|std::tr1::_Impl_no_alloc7<*>|std::tr1::_Impl_no_alloc8<*>|std::tr1::_Impl_no_alloc9<*>|std::tr1::_Impl_no_alloc10<*>{ - preview ( $e._Callee._Object ) - children ( #([functor] : $e._Callee._Object) ) -} -std::tr1::_Impl0<*>|std::tr1::_Impl1<*>|std::tr1::_Impl2<*>|std::tr1::_Impl3<*>|std::tr1::_Impl4<*>|std::tr1::_Impl5<*>|std::tr1::_Impl6<*>|std::tr1::_Impl7<*>|std::tr1::_Impl8<*>|std::tr1::_Impl9<*>|std::tr1::_Impl10<*>{ - preview ( $e._Callee._Object ) - children ( - #( - #([functor] : $e._Callee._Object), - #([allocator] : $e._Myal) - ) - ) -} -std::tr1::function<*>{ - preview ( - #if ($e._Impl == 0) ( - ; Detecting empty functions is trivial. - "empty" - ) #else ( - *$e._Impl - ) - ) - - children ( - #if ($e._Impl == 0) ( - ; We make empty functions appear to have no children. - #array(expr: 0, size: 0) - ) #else ( - #([functor and allocator] : *$e._Impl) - ) - ) -} - -;------------------------------------------------------------------------------ -; std::tr1::tuple from -;------------------------------------------------------------------------------ -; tuple is visualized like pair, except that we have to give fake names to tuple's children. -std::tr1::tuple{ - preview ( - "()" - ) - - children ( - #array(expr: 0, size: 0) - ) -} -std::tr1::tuple<*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ - preview ( - #( - "(", $e._Impl._Value, - ")" - ) - ) - - children ( - #( - [0] : $e._Impl._Value - ) - ) -} -std::tr1::tuple<*,*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ - preview ( - #( - "(", $e._Impl._Value, - ", ", $e._Impl._Tail._Value, - ")" - ) - ) - - children ( - #( - [0] : $e._Impl._Value, - [1] : $e._Impl._Tail._Value - ) - ) -} -std::tr1::tuple<*,*,*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ - preview ( - #( - "(", $e._Impl._Value, - ", ", $e._Impl._Tail._Value, - ", ", $e._Impl._Tail._Tail._Value, - ")" - ) - ) - - children ( - #( - [0] : $e._Impl._Value, - [1] : $e._Impl._Tail._Value, - [2] : $e._Impl._Tail._Tail._Value - ) - ) -} -std::tr1::tuple<*,*,*,*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ - preview ( - #( - "(", $e._Impl._Value, - ", ", $e._Impl._Tail._Value, - ", ", $e._Impl._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Value, - ")" - ) - ) - - children ( - #( - [0] : $e._Impl._Value, - [1] : $e._Impl._Tail._Value, - [2] : $e._Impl._Tail._Tail._Value, - [3] : $e._Impl._Tail._Tail._Tail._Value - ) - ) -} -std::tr1::tuple<*,*,*,*,*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ - preview ( - #( - "(", $e._Impl._Value, - ", ", $e._Impl._Tail._Value, - ", ", $e._Impl._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Tail._Value, - ")" - ) - ) - - children ( - #( - [0] : $e._Impl._Value, - [1] : $e._Impl._Tail._Value, - [2] : $e._Impl._Tail._Tail._Value, - [3] : $e._Impl._Tail._Tail._Tail._Value, - [4] : $e._Impl._Tail._Tail._Tail._Tail._Value - ) - ) -} -std::tr1::tuple<*,*,*,*,*,*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ - preview ( - #( - "(", $e._Impl._Value, - ", ", $e._Impl._Tail._Value, - ", ", $e._Impl._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, - ")" - ) - ) - - children ( - #( - [0] : $e._Impl._Value, - [1] : $e._Impl._Tail._Value, - [2] : $e._Impl._Tail._Tail._Value, - [3] : $e._Impl._Tail._Tail._Tail._Value, - [4] : $e._Impl._Tail._Tail._Tail._Tail._Value, - [5] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Value - ) - ) -} -std::tr1::tuple<*,*,*,*,*,*,*,std::tr1::_Nil,std::tr1::_Nil,std::tr1::_Nil>{ - preview ( - #( - "(", $e._Impl._Value, - ", ", $e._Impl._Tail._Value, - ", ", $e._Impl._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, - ")" - ) - ) - - children ( - #( - [0] : $e._Impl._Value, - [1] : $e._Impl._Tail._Value, - [2] : $e._Impl._Tail._Tail._Value, - [3] : $e._Impl._Tail._Tail._Tail._Value, - [4] : $e._Impl._Tail._Tail._Tail._Tail._Value, - [5] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, - [6] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value - ) - ) -} -std::tr1::tuple<*,*,*,*,*,*,*,*,std::tr1::_Nil,std::tr1::_Nil>{ - preview ( - #( - "(", $e._Impl._Value, - ", ", $e._Impl._Tail._Value, - ", ", $e._Impl._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, - ")" - ) - ) - - children ( - #( - [0] : $e._Impl._Value, - [1] : $e._Impl._Tail._Value, - [2] : $e._Impl._Tail._Tail._Value, - [3] : $e._Impl._Tail._Tail._Tail._Value, - [4] : $e._Impl._Tail._Tail._Tail._Tail._Value, - [5] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, - [6] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, - [7] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value - ) - ) -} -std::tr1::tuple<*,*,*,*,*,*,*,*,*,std::tr1::_Nil>{ - preview ( - #( - "(", $e._Impl._Value, - ", ", $e._Impl._Tail._Value, - ", ", $e._Impl._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, - ")" - ) - ) - - children ( - #( - [0] : $e._Impl._Value, - [1] : $e._Impl._Tail._Value, - [2] : $e._Impl._Tail._Tail._Value, - [3] : $e._Impl._Tail._Tail._Tail._Value, - [4] : $e._Impl._Tail._Tail._Tail._Tail._Value, - [5] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, - [6] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, - [7] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, - [8] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value - ) - ) -} -std::tr1::tuple<*,*,*,*,*,*,*,*,*,*>{ - preview ( - #( - "(", $e._Impl._Value, - ", ", $e._Impl._Tail._Value, - ", ", $e._Impl._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, - ", ", $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, - ")" - ) - ) - - children ( - #( - [0] : $e._Impl._Value, - [1] : $e._Impl._Tail._Value, - [2] : $e._Impl._Tail._Tail._Value, - [3] : $e._Impl._Tail._Tail._Tail._Value, - [4] : $e._Impl._Tail._Tail._Tail._Tail._Value, - [5] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Value, - [6] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Value, - [7] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, - [8] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value, - [9] : $e._Impl._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Tail._Value - ) - ) -} - -;------------------------------------------------------------------------------ -; std::tr1::array from -;------------------------------------------------------------------------------ -std::tr1::array<*>{ - preview ( - ; An actual array is previewed with its address. - ; array is previewed like vector. - #( - "[", - $e._EEN_SIZE, - "](", - #array(expr: $e._Elems[$i], size: $e._EEN_SIZE), - ")" - ) - ) - - children ( - ; Just like an actual array. - #array(expr: $e._Elems[$i], size: $e._EEN_SIZE) - ) -} -std::_Array_iterator<*>|std::_Array_const_iterator<*>{ - preview ( - #if ($e._EEN_IDL == 0) ( - *$e._Ptr - ) #else ( - #if ($e._Idx == $e._EEN_SIZE) ( - ; array iterators are represented by _Ptr + _Idx, - ; and they know how large their parent arrays are. Therefore, detecting - ; end iterators is trivial. - "end" - ) #else ( - ; Like vector iterators, array iterators are previewed with what they point to. - $e._Ptr[$e._Idx] - ) - ) - ) - - children ( - #if ($e._EEN_IDL == 0) ( - #([ptr] : $e._Ptr) - ) #else ( - #if ($e._Idx == $e._EEN_SIZE) ( - ; We make end iterators appear to have no children. - #array(expr: 0, size: 0) - ) #else ( - ; An array iterator is conceptually a pointer, so we make it appear to store one. - #([ptr] : $e._Ptr + $e._Idx) - ) - ) - ) -} - -;------------------------------------------------------------------------------ -; stdext::hash_map from -; stdext::hash_multimap from -; stdext::hash_set from -; stdext::hash_multiset from -;------------------------------------------------------------------------------ -stdext::hash_map<*>|stdext::hash_multimap<*>|stdext::hash_set<*>|stdext::hash_multiset<*>{ - preview ( - #( - "[", - $e._List._Mysize, - "](", - #list( - head: $e._List._Myhead->_Next, - size: $e._List._Mysize, - next: _Next - ) : $e._Myval, - ")" - ) - ) - - children ( - #list( - head: $e._List._Myhead->_Next, - size: $e._List._Mysize, - next: _Next - ) : $e._Myval - ) -} - -;------------------------------------------------------------------------------ -; std::tr1::unordered_map from -; std::tr1::unordered_multimap from -; std::tr1::unordered_set from -; std::tr1::unordered_multiset from -;------------------------------------------------------------------------------ -std::hash<*>{ - preview ( "hash" ) - children ( #array(expr: 0, size: 0) ) -} -std::tr1::unordered_map<*>|std::tr1::unordered_multimap<*>|std::tr1::unordered_set<*>|std::tr1::unordered_multiset<*>{ - preview ( - #( - "[", - $e._List._Mysize, - "](", - #list( - head: $e._List._Myhead->_Next, - size: $e._List._Mysize, - next: _Next - ) : $e._Myval, - ")" - ) - ) - - children ( - #( - #([hash] : $e.comp._Hashobj), - #([equal] : $e.comp._Keyeqobj), - #list( - head: $e._List._Myhead->_Next, - size: $e._List._Mysize, - next: _Next - ) : $e._Myval - ) - ) -} - -;------------------------------------------------------------------------------ -; std::tr1::basic_regex from -;------------------------------------------------------------------------------ -std::tr1::basic_regex<*>{ - preview ( - #if ($e._Rep == 0) ( - ; Default construction creates an empty basic_regex. - "empty" - ) #elif ($e._EEN_VIS == 1) ( - ; By default, _ENHANCED_REGEX_VISUALIZER is defined to be 1 in debug and 0 in ship. - ; When it is 1, basic_regex stores the string from which it was constructed. - ; When it is 0, basic_regex stores only the resulting finite state machine. - $e._Visualization - ) #else ( - ; basic_regex contains many static const flags, which would be shown in the preview by default. - ; Its actual members are _Rep and _Traits. _Rep holds the finite state machine, so we - ; use it to preview basic_regex. (It does contain some human-readable information.) - *$e._Rep - ) - ) - - children ( - #if ($e._Rep == 0) ( - ; We make empty basic_regexes appear to have no children. - #array(expr: 0, size: 0) - ) #elif ($e._EEN_VIS == 1) ( - ; We want to hide those static const flags. - ; We also want to give _Visualization a fake name. - #( - #([str] : $e._Visualization), - #(_Rep : $e._Rep), - #(_Traits : $e._Traits) - ) - ) #else ( - ; We want to hide those static const flags. - #( - _Rep : $e._Rep, - _Traits : $e._Traits - ) - ) - ) -} - -;------------------------------------------------------------------------------ -; std::tr1::sub_match from -;------------------------------------------------------------------------------ -std::tr1::sub_match|std::tr1::sub_match|std::tr1::sub_match|std::tr1::sub_match|std::tr1::sub_match|std::tr1::sub_match{ - preview ( - ; It would be nice if we could preview sub_match with its str(). - ; However, visualizers cannot handle strings represented by pointer pairs. - ; Therefore, our preview contains more limited information. - #if ($e.matched) ( - ; If this sub_match participated in a match, - ; we preview it with its length(). - $e.second - $e.first - ) #else ( - ; Otherwise, we preview it with its matched bool (i.e. "false"). - ; (Why not length() (i.e. "0")? It's meaningful to have - ; matched == true and length() == 0. - "false" - ) - ) - - children ( - #( - ; sub_match's three data members are public, but we list them here - ; (a) to display matched before first and second, and - ; (b) to gloss over the fact that sub_match derives from std::pair. - #(matched : $e.matched), - #(first : $e.first), - #(second : $e.second) - ) - ) -} -std::tr1::sub_match >|std::tr1::sub_match >{ - preview ( - #if ($e.matched) ( - ; We visualize ssub_match and wssub_match just like csub_match and wcsub_match, - ; except that when determining the length(), we can't subtract iterators. - ; We have to subtract their stored pointers. - $e.second._Ptr - $e.first._Ptr - ) #else ( - "false" - ) - ) - - children ( - #( - #(matched : $e.matched), - #(first : $e.first), - #(second : $e.second) - ) - ) -} - -;------------------------------------------------------------------------------ -; std::tr1::match_results from -;------------------------------------------------------------------------------ -std::tr1::match_results<*>{ - preview ( - ; A match_results object is empty iff its vector _Matches is empty. - #if ($e._Matches._Myfirst == $e._Matches._Mylast) ( - "empty" - ) #else ( - ; We preview a non-empty match_results object with its vector. - $e._Matches - ) - ) - - children ( - #if ($e._Matches._Myfirst == $e._Matches._Mylast) ( - ; We make empty match_results appear to have no children. - #array(expr: 0, size: 0) - ) #else ( - ; As match_results has operator[](), prefix(), and suffix() member functions, - ; we make it appear to directly contain [0], [1], [2], etc. elements, - ; as well as [prefix] and [suffix] elements. - #( - #array(expr: $e._Matches._Myfirst[$i], size: $e._Matches._Mylast - $e._Matches._Myfirst), - #([prefix] : $e._Prefix), - #([suffix] : $e._Suffix) - ) - ) - ) -} - -;------------------------------------------------------------------------------ -; std::tr1::regex_iterator from -;------------------------------------------------------------------------------ -std::tr1::regex_iterator<*>{ - preview ( - #if ($e._MyRe == 0) ( - ; We represent end-of-sequence regex_iterators with null regex pointers. - "end" - ) #else ( - ; Dereferenceable regex_iterators return match_results when dereferenced, - ; so we'll preview them with that. - $e._MyVal - ) - ) - - children ( - #if ($e._MyRe == 0) ( - ; We make end-of-sequence regex_iterators appear to have no children. - #array(expr: 0, size: 0) - ) #else ( - ; For ease of understanding, we make dereferenceable regex_iterators - ; appear to have data members with the "for exposition only" names from TR1. - #( - #([begin] : $e._Begin), - #([end] : $e._End), - #([pregex] : $e._MyRe), - #([flags] : $e._Flags), - #([match] : $e._MyVal) - ) - ) - ) -} - -;------------------------------------------------------------------------------ -; std::tr1::regex_token_iterator from -;------------------------------------------------------------------------------ -std::tr1::regex_token_iterator<*>{ - preview ( - #if ($e._Res == 0) ( - ; We represent end-of-sequence regex_token_iterators with null result pointers. - "end" - ) #else ( - ; Dereferenceable regex_token_iterators return *result when dereferenced, - ; so we'll preview them with that. - *$e._Res - ) - ) - - children ( - #if ($e._Res == 0) ( - ; We make end-of-sequence regex_token_iterators appear to have no children. - #array(expr: 0, size: 0) - ) #else ( - ; For ease of understanding, we make dereferenceable regex_token_iterators - ; appear to have data members with the "for exposition only" names from TR1. - #( - #([position] : $e._Pos), - #([result] : $e._Res), - #([suffix] : $e._Suffix), - #([N] : $e._Cur), - #([subs] : $e._Subs) - ) - ) - ) -} - -;------------------------------------------------------------------------------ -; std::identity, etc. from -;------------------------------------------------------------------------------ -std::identity<*>{ - preview ( "identity" ) - children ( #array(expr: 0, size: 0) ) -} -std::bit_and<*>{ - preview ( "bit_and" ) - children ( #array(expr: 0, size: 0) ) -} -std::bit_or<*>{ - preview ( "bit_or" ) - children ( #array(expr: 0, size: 0) ) -} -std::bit_xor<*>{ - preview ( "bit_xor" ) - children ( #array(expr: 0, size: 0) ) -} - -;------------------------------------------------------------------------------ -; std::unique_ptr from -;------------------------------------------------------------------------------ -std::unique_ptr<*>{ - preview ( - #if ($e._Myptr == 0) ( - "empty" - ) #else ( - #( - "unique_ptr ", - *$e._Myptr - ) - ) - ) - - children ( - #if ($e._Myptr == 0) ( - #array(expr: 0, size: 0) - ) #else ( - #([ptr] : $e._Myptr) - ) - ) -} - -;------------------------------------------------------------------------------ -; std::forward_list from -;------------------------------------------------------------------------------ -std::forward_list<*>{ - preview ( - #( - "(", - #list( - head: $e._Myhead, - next: _Next - ) : $e._Myval, - ")" - ) - ) - - children ( - #list( - head: $e._Myhead, - next: _Next - ) : $e._Myval - ) -} -std::_Flist_iterator<*>|std::_Flist_const_iterator<*>{ - preview ( - #if ($e._Ptr == 0) ( - "end" - ) #else ( - $e._Ptr->_Myval - ) - ) - - children ( - #if ($e._Ptr == 0) ( - #array(expr: 0, size: 0) - ) #else ( - #([ptr] : &$e._Ptr->_Myval) - ) - ) -} - - -;------------------------------------------------------------------------------ -; PROPVARIANT -;------------------------------------------------------------------------------ -; Visualizers for VT_VECTOR C arrays -tagCAC|tagCAUB|tagCAI|tagCAUI|tagCAL|tagCAUL|tagCAFLT|tagCADBL|tagCACY|tagCADATE|tagCABSTR|tagCABSTRBLOB|tagCABOOL|tagCASCODE|tagCAPROPVARIANT|tagCAH|tagCAUH|tagCALPSTR|tagCALPWSTR|tagCAFILETIME|tagCACLIPDATA|tagCACLSID{ - preview( - #( - "[", $e.cElems , "](", - #array - ( - expr : ($e.pElems)[$i], - size : $e.cElems - ), - ")" - ) - ) - children - ( - #array - ( - expr : ($e.pElems)[$i], - size : $e.cElems - ) - ) -} -; Visualizers for SAFE ARRAY -tagSAFEARRAY|SAFEARRAY{ - preview( - #if ($e.fFeatures & 0x0080) ; FADF_HAVEVARTYPE - ( - ; Switch on the variant type field - which is stored 4 bytes - ; before the beginning of the SAFEARRAY type - #switch( ((unsigned *)&($e))[-1] ) - #case 0x2 ; VT_I2 | VT_ARRAY - ( - #( - "safearray of I2 = [", - ; output the rank array - #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), - "](", - ; output the data elements - #array( - expr: ((signed short *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ), - ")" - ) - ) - #case 0x3 ; VT_I4 | VT_ARRAY - ( - #( - "safearray of I4 = [", - ; output the rank array - #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), - "](", - ; output the data elements - #array( - expr: ((signed int *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ), - ")" - ) - ) - #case 0x4 ; VT_R4 | VT_ARRAY - ( - #( - "safearray of R4 = [", - ; output the rank array - #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), - "](", - ; output the data elements - #array( - expr: ((float *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ), - ")" - ) - ) - #case 0x5 ; VT_R8 | VT_ARRAY - ( - #( - "safearray of R8 = [", - ; output the rank array - #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), - "](", - ; output the data elements - #array( - expr: ((double *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ), - ")" - ) - ) - #case 0x6 ; VT_CY | VT_ARRAY - ( - #( - "safearray of CY = [", - ; output the rank array - #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), - "](", - ; output the data elements - #array( - expr: ((CY *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ), - ")" - ) - ) - #case 0x7 ; VT_DATE | VT_ARRAY - ( - #( - "safearray of DATE = [", - ; output the rank array - #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), - "](", - ; output the data elements - #array( - expr: ((DATE *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ), - ")" - ) - ) - #case 0x8 ; VT_BSTR | VT_ARRAY - ( - #( - "safearray of BSTR = [", - ; output the rank array - #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), - "](", - ; output the data elements - #array( - expr: ((wchar_t **)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ), - ")" - ) - ) - #case 0xa ; VT_ERROR | VT_ARRAY - ( - #( - "safearray of ERROR = [", - ; output the rank array - #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), - "](", - ; output the data elements - #array( - expr: ((long *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ), - ")" - ) - ) - #case 0xb ; VT_BOOL | VT_ARRAY - ( - #( - "safearray of BOOL = [", - ; output the rank array - #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), - "](", - ; output the data elements - #array( - expr: ((short *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ), - ")" - ) - ) - #case 0xc ; VT_VARIANT | VT_ARRAY - ( - #( - "safearray of VARIANT = [", - ; output the rank array - #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), - "](", - ; output the data elements - #array( - expr: ((tagVARIANT *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ), - ")" - ) - ) - #case 0x10 ; VT_I1 | VT_ARRAY - ( - #( - "safearray of I1 = [", - ; output the rank array - #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), - "](", - ; output the data elements - #array( - expr: ((signed char *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ), - ")" - ) - ) - #case 0x11 ; VT_UI1 | VT_ARRAY - ( - #( - "safearray of UI1 = [", - ; output the rank array - #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), - "](", - ; output the data elements - #array( - expr: ((unsigned char *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ), - ")" - ) - ) - #case 0x12 ; VT_UI2 | VT_ARRAY - ( - #( - "safearray of UI2 = [", - ; output the rank array - #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), - "](", - ; output the data elements - #array( - expr: ((unsigned short *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ), - ")" - ) - ) - #case 0x13 ; VT_UI4 | VT_ARRAY - ( - #( - "safearray of UI4 = [", - ; output the rank array - #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), - "](", - ; output the data elements - #array( - expr: ((unsigned int *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ), - ")" - ) - ) - #case 0x14 ; VT_I8 | VT_ARRAY - ( - #( - "safearray of I8 = [", - ; output the rank array - #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), - "](", - ; output the data elements - #array( - expr: ((signed __int64 *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ), - ")" - ) - ) - #case 0x15 ; VT_UI8 | VT_ARRAY - ( - #( - "safearray of UI8 = [", - ; output the rank array - #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), - "](", - ; output the data elements - #array( - expr: ((unsigned __int64 *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ), - ")" - ) - ) - #case 0x16 ; VT_INT | VT_ARRAY - ( - #( - "safearray of INT = [", - ; output the rank array - #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), - "](", - ; output the data elements - #array( - expr: ((int *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ), - ")" - ) - ) - #case 0x17 ; VT_UINT | VT_ARRAY - ( - #( - "safearray of UINT = [", - ; output the rank array - #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), - "](", - ; output the data elements - #array( - expr: ((unsigned *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ), - ")" - ) - ) - #case 0x1e ; VT_LPSTR | VT_ARRAY - ( - #( - "safearray of LPSTR = [", - ; output the rank array - #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), - "](", - ; output the data elements - #array( - expr: ((char **)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ), - ")" - ) - ) - #case 0x1f ; VT_LPWSTR | VT_ARRAY - ( - #( - "safearray of LPWSTR = [", - ; output the rank array - #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), - "](", - ; output the data elements - #array( - expr: ((wchar_t **)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ), - ")" - ) - ) - #case 0x40 ; VT_FILETIME | VT_ARRAY - ( - #( - "safearray of FILETIME = [", - ; output the rank array - #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), - "](", - ; output the data elements - #array( - expr: ((FILETIME *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ), - ")" - ) - ) - #case 0x47 ; VT_CLIPDATA | VT_ARRAY - ( - #( - "safearray of CLIPDATA = [", - ; output the rank array - #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), - "](", - ; output the data elements - #array( - expr: ((CLIPDATA *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ), - ")" - ) - ) - #case 0x48 ; VT_CLSID | VT_ARRAY - ( - #( - "safearray of CLSID = [", - ; output the rank array - #array( expr: $e.rgsabound[$i].cElements, size: $e.cDims), - "](", - ; output the data elements - #array( - expr: ((CLSID *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ), - ")" - ) - ) - ) - #elif ($e.fFeatures & 0x0100) ; FADF_BSTR - ( - #("safearray of BSTR = ",#array(expr: $e.rgsabound[$i].cElements, size: $e.cDims) : #("[",$e,"]"), "(", #array(expr: ((wchar_t * *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ), ")") - ) - #elif ($e.fFeatures & 0x0200) ; FADF_UNKNOWN - ( - #("safearray of IUnknown* = [",#array(expr: $e.rgsabound[$i].cElements, size: $e.cDims), "](", #array(expr: ((IUnknown * *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ), ")") - ) - #elif ($e.fFeatures & 0x0400) ; FADF_DISPATCH - ( - #("safearray of IDispatch* = [",#array(expr: $e.rgsabound[$i].cElements, size: $e.cDims), "](", #array(expr: ((IDispatch * *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ), ")") - ) - #elif ($e.fFeatures & 0x0800) ; FADF_VARIANT - ( - #("safearray of VARIANT = ",#array(expr: $e.rgsabound[$i].cElements, size: $e.cDims) : #("[",$e,"]"), "(", #array(expr: ((tagVARIANT *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ), ")") - ) - ) - children - ( - #( ;[actual members]: [$e,!], - #if ($e.fFeatures & 0x0080) ; FADF_HAVEVARTYPE - ( - #switch( ((unsigned *)&($e))[-1] ) ; for some reason the VT field is before the SAFEARRAY struct - #case 2 ; VT_I2|VT_ARRAY - ( - #array( - expr: ((signed short *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ) - ) - #case 3 ; VT_I4|VT_ARRAY - ( - #array( - expr: ((signed int *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ) - ) - #case 4 ; VT_R4|VT_ARRAY - ( - #array( - expr: ((float *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ) - ) - #case 5 ; VT_R8|VT_ARRAY - ( - #array( - expr: ((double *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ) - ) - #case 0x10 ; VT_I1|VT_ARRAY - ( - #array( - expr: ((signed char *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ) - ) - #case 0x11 ; VT_UI1|VT_ARRAY - ( - #array( - expr: ((unsigned char *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ) - ) - #case 0x12 ; VT_UI2|VT_ARRAY - ( - #array( - expr: ((unsigned short *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ) - ) - #case 0x13 ; VT_UI4|VT_ARRAY - ( - #array( - expr: ((unsigned int *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ) - ) - #case 0x14 ; VT_I8|VT_ARRAY - ( - #array( - expr: ((signed __int64 *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ) - ) - #case 0x15 ; VT_UI8|VT_ARRAY - ( - #array( - expr: ((unsigned __int64 *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ) - ) - #case 0x1e ; VT_LPSTR|VT_ARRAY - ( - #array( - expr: ((char * *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ) - ) - #case 0x1f ; VT_LPWSTR|VT_ARRAY - ( - #array( - expr: ((wchar_t **)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ) - ) - #case 0xc ; VT_VARIANT|VT_ARRAY - ( - #array( - expr: ((tagVARIANT *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ) - ) - #case 0xb ; VT_BOOL|VT_ARRAY - ( - #array( - expr: ((short *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ) - ) - #case 0xa ; VT_ERROR|VT_ARRAY - ( - #array( - expr: ((long *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ) - ) - #case 6 ; VT_CY|VT_ARRAY - ( - #array( - expr: ((CY *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ) - ) - #case 7 ; VT_DATE|VT_ARRAY - ( - #array( - expr: ((DATE *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ) - ) - #case 0x40 ; VT_FILETIME|VT_ARRAY - ( - #array( - expr: ((FILETIME *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ) - ) - #case 0x48 ; VT_CLSID|VT_ARRAY - ( - #array( - expr: ((CLSID *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ) - ) - #case 0x47 ; VT_CF|VT_ARRAY - ( - #array( - expr: ((CLIPDATA *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ) - ) - #case 8 ; VT_BSTR|VT_ARRAY - ( - #array( - expr: ((wchar_t * *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ) - ) - #case 0x16 ; VT_INT|VT_ARRAY - ( - #array( - expr: ((int *)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ) - ) - #case 0x17 ; VT_UINT|VT_ARRAY - ( - #array( - expr: ((unsigned int*)$e.pvData)[$i], - size: $e.rgsabound[$r].cElements, - rank: $e.cDims, - base: $e.rgsabound[$r].lLbound - ) - ) - #default - ( - #([actual members]: [$e,!]) - ) - #except - ( - #([actual members]: [$e,!]) - ) - ) - #elif ($e.fFeatures & 0x0100) ; FADF_BSTR - ( - #array(expr: ((wchar_t * *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ) - ) - #elif ($e.fFeatures & 0x0200) ; FADF_UNKNOWN - ( - #array(expr: ((IUnknown * *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ) - ) - #elif ($e.fFeatures & 0x0400) ; FADF_DISPATCH - ( - #array(expr: ((IDispatch * *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ) - ) - #elif ($e.fFeatures & 0x0800) ; FADF_VARIANT - ( - #array(expr: ((tagVARIANT *)$e.pvData)[$i], size: $e.rgsabound[$r].cElements, rank: $e.cDims, base: $e.rgsabound[$r].lLbound ) - ) - ) - ) -} -tagPROPVARIANT|tagVARIANT|PROPVARIANT|VARIANT{ - preview( - #switch ($e.vt) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;; Base Types ;; - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - #case 0 ( #("Empty") ) ; VT_EMPTY - #case 1 ( #("NULL") ) ; VT_NULL - #case 2 ( #("I2 = ", $e.iVal) ) ; VT_I2 - #case 3 ( #("I4 = ", $e.lVal) ) ; VT_I4 - #case 4 ( #("R4 = ", $e.fltVal) ) ; VT_R4 - #case 5 ( #("R8 = ", $e.dblVal) ) ; VT_R8 - #case 6 ( #("CY = ", $e.cyVal) ) ; VT_CY - #case 7 ( #("DATE = ", $e.date) ) ; VT_DATE - #case 8 ( #("BSTR = ", $e.bstrVal) ) ; VT_BSTR - #case 9 ( #("DISPATCH = ", $e.pdispVal) ) ; VT_DISPATCH - #case 10 ( #("ERROR = ", $e.scode) ) ; VT_ERROR - #case 0xB ( #("BOOL = ", $e.boolVal) ) ; VT_BOOL - #case 0xC ( #("VARIANT ") ) ; VT_VARIANT - #case 0xD ( #("UNKNOWN = ", $e.punkVal) ) ; VT_UNKOWN - #case 0xE ( #("DECIMAL = ", $e.decVal) ) ; VT_DECIMAL - #case 0x10 ( #("I1 = ", $e.cVal) ) ; VT_I1 - #case 0x11 ( #("UI1 = ", $e.bVal) ) ; VT_UI1 - #case 0x12 ( #("UI2 = ", $e.uiVal) ) ; VT_UI2 - #case 0x13 ( #("UI4 = ", $e.ulVal) ) ; VT_UI4 - #case 0x14 ( #("I8 = ", *(__int64*)&$e.dblVal) ) ; VT_I8 - #case 0x15 ( #("UI8 = ", *(unsigned __int64*)&$e.dblVal) ) ; VT_UI8 - #case 0x16 ( #("INT = ", $e.intVal) ) ; VT_INT - #case 0x17 ( #("UINT = ", $e.uintVal) ) ; VT_UINT - #case 0x18 ( #("VOID ") ) ; VT_VOID - #case 0x19 ( #("HRESULT ") ) ; VT_HRESULT - #case 0x1A ( #("PTR ") ) ; VT_PTR - #case 0x1B ( #("SAFEARRAY ") ) ; VT_SAFEARRAY - #case 0x1C ( #("CARRAY ") ) ; VT_CARRAY - #case 0x1D ( #("USERDEFINED ") ) ; VT_USERDEFINED - #case 0x1E ( #("LPSTR = ", $e.pszVal) ) ; VT_LPSTR - #case 0x1F ( #("LPWSTR = ", $e.pwszVal) ) ; VT_LPWSTR - #case 0x24 ( #("RECORD ") ) ; VT_RECORD - #case 0x26 ( #("UINT_PTR ") ) ; VT_UINT_PTR - #case 0x40 ( #("FILETIME = ", $e.filetime) ) ; VT_FILETIME - #case 0x42 ( #("STREAM = ", $e.pStream) ) ; VT_STREAM - #case 0x43 ( #("STORAGE = ", $e.pStorage) ) ; VT_STORAGE - #case 0x44 ( #("STREAMED_OBJECT = ", $e.pStream) ) ; VT_STREAMED_OBJECT - #case 0x45 ( #("STORED_OBJECT = ", $e.pStorage) ) ; VT_STORED_OBJECT - #case 0x46 ( #("BLOB_OBJECT = ", $e.blob ) ) ; VT_BLOB_OBJECT - #case 0x47 ( #("CF = ", $e.pclipdata) ) ; VT_CF - #case 0x48 ( #("CLSID = ", $e.puuid) ) ; VT_CLSID - #case 0x49 ( #("VERSIONED_STREAM = ", $e.pVersionedStream) ) ; VT_VERSIONED_STREAM - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;; Vector types ;; - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - #case 0x1002 ( #("vector of I2 = ", $e.cai) ) ; VT_I2|VT_VECTOR - #case 0x1003 ( #("vector of I4 = ", $e.cal) ) ; VT_I4|VT_VECTOR - #case 0x1004 ( #("vector of R4 = ", $e.caflt) ) ; VT_R4|VT_VECTOR - #case 0x1005 ( #("vector of R8 = ", $e.cadbl) ) ; VT_R8|VT_VECTOR - #case 0x1010 ( #("vector of I1 = ", $e.cac) ) ; VT_I1|VT_VECTOR - #case 0x1011 ( #("vector of UI1 = ", $e.caub) ) ; VT_UI1|VT_VECTOR - #case 0x1012 ( #("vector of UI2 = ", $e.caui) ) ; VT_UI2|VT_VECTOR - #case 0x1013 ( #("vector of UI4 = ", $e.caul) ) ; VT_UI4|VT_VECTOR - #case 0x1014 ( #("vector of I8 = ", $e.cah) ) ; VT_I8|VT_VECTOR - #case 0x1015 ( #("vector of UI8 = ", $e.cauh) ) ; VT_UI8|VT_VECTOR - #case 0x101E ( #("vector of LPSTR = ", $e.calpstr) ) ; VT_LPSTR|VT_VECTOR - #case 0x101F ( #("vector of LPWSTR = ", $e.calpwstr) ) ; VT_LPWSTR|VT_VECTOR - #case 0x100C ( #("vector of VARIANT ", $e.capropvar) ) ; VT_VARIANT|VT_VECTOR - #case 0x100B ( #("vector of BOOL = ", $e.cabool) ) ; VT_BOOL|VT_VECTOR - #case 0x100A ( #("vector of ERROR = ", $e.cascode) ) ; VT_ERROR|VT_VECTOR - #case 0x1006 ( #("vector of CY = ", $e.cacy) ) ; VT_CY|VT_VECTOR - #case 0x1007 ( #("vector of DATE = ", $e.cadate) ) ; VT_DATE|VT_VECTOR - #case 0x1040 ( #("vector of FILETIME = ", $e.cafiletime) ) ; VT_FILETIME|VT_VECTOR - #case 0x1048 ( #("vector of CLSID = ", $e.cauuid) ) ; VT_CLSID|VT_VECTOR - #case 0x1047 ( #("vector of CF = ", $e.caclipdata) ) ; VT_CF|VT_VECTOR - #case 0x1008 ( #("vector of BSTR = ", $e.cabstr) ) ; VT_BSTR|VT_VECTOR - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;; Byref Types ;; - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - #case 0x4016 ( #("byref of INT = ", $e.pintVal) ) ; VT_INT|VT_BYREF - #case 0x4017 ( #("byref of UINT = ", $e.puintVal) ) ; VT_UINT|VT_BYREF - #case 0x4002 ( #("byref of I2 = ", $e.piVal) ) ; VT_I2|VT_BYREF - #case 0x4003 ( #("byref of I4 = ", $e.plVal) ) ; VT_I4|VT_BYREF - #case 0x4004 ( #("byref of R4 = ", $e.pfltVal) ) ; VT_R4|VT_BYREF - #case 0x4005 ( #("byref of R8 = ", $e.pdblVal) ) ; VT_R8|VT_BYREF - #case 0x4010 ( #("byref of I1 = ", $e.pcVal) ) ; VT_I1|VT_BYREF - #case 0x4011 ( #("byref of UI1 = ", $e.pbVal) ) ; VT_UI1|VT_BYREF - #case 0x4012 ( #("byref of UI2 = ", $e.puiVal) ) ; VT_UI2|VT_BYREF - #case 0x4013 ( #("byref of UI4 = ", $e.pulVal) ) ; VT_UI4|VT_BYREF - #case 0x4014 ( #("byref of I8 = ", (__int64*)$e.pdblVal) ) ; VT_I8|VT_BYREF - #case 0x4015 ( #("byref of UI8 = ", (unsigned __int64*)$e.pudblVal) ) ; VT_UI8|VT_BYREF - #case 0x400C ( #("byref of VARIANT ", $e.pvarVal) ) ; VT_VARIANT|VT_BYREF - #case 0x400B ( #("byref of BOOL = ", $e.pboolVal) ) ; VT_BOOL|VT_BYREF - #case 0x400A ( #("byref of ERROR = ", $e.pscode) ) ; VT_ERROR|VT_BYREF - #case 0x4006 ( #("byref of CY = ", $e.pcyVal) ) ; VT_CY|VT_BYREF - #case 0x4007 ( #("byref of DATE = ", $e.pdate) ) ; VT_DATE|VT_BYREF - #case 0x4008 ( #("byref of BSTR = ", $e.pbstrVal) ) ; VT_BSTR|VT_BYREF - #case 0x400E ( #("byref of DECIMAL = ", $e.pdecVal) ) ; VT_DECIMAL|VT_BYREF - #case 0x400D ( #("byref of UNKNOWN = ", $e.ppunkVal) ) ; VT_UNKOWN|VT_BYREF - #case 0x4009 ( #("byref of DISPATCH = ", $e.ppdispVal) ) ; VT_DISPATCH|VT_BYREF - #case 0x6000 ( #("byref of ARRAY = ", $e.pparray) ) ; VT_ARRAY|VT_BYREF - #default - ( - #if ($e.vt & 0x2000) ( $e.parray) - #else ( #("Unknown vt type = ", $e.vt)) - ) - ) - children( - #( - vt: $e.vt, - #switch ($e.vt) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;; Base Types ;; - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - #case 0x2 ( #(I2 : $e.iVal) ) ; VT_I2 - #case 0x3 ( #(I4 : $e.lVal) ) ; VT_I4 - #case 0x4 ( #(R4 : $e.fltVal) ) ; VT_R4 - #case 0x5 ( #(R8 : $e.dblVal) ) ; VT_R8 - #case 0x6 ( #(CY : $e.cyVal) ) ; VT_CY - #case 0x7 ( #(DATE : $e.date) ) ; VT_DATE - #case 0x8 ( #(BSTR : $e.bstrVal) ) ; VT_BSTR - #case 0x9 ( #(DISPATCH : $e.pdispVal) ) ; VT_DISPATCH - #case 0xA ( #(ERROR : $e.scode) ) ; VT_ERROR - #case 0xB ( #(BOOL : $e.boolVal) ) ; VT_BOOL - #case 0xD ( #(UNKNOWN : $e.punkVal) ) ; VT_UNKOWN - #case 0xE ( #(DECIMAL : $e.decVal) ) ; VT_DECIMAL - #case 0x10 ( #(I1 : $e.cVal) ) ; VT_I1 - #case 0x11 ( #(UI1 : $e.bVal) ) ; VT_UI1 - #case 0x12 ( #(UI2 : $e.uiVal) ) ; VT_UI2 - #case 0x13 ( #(UI4 : $e.ulVal) ) ; VT_UI4 - #case 0x14 ( #(I8 : *(__int64*)&$e.dblVal) ) ; VT_I8 - #case 0x15 ( #(UI8 : *(unsigned __int64*)&$e.dblVal) ) ; VT_UI8 - #case 0x16 ( #(INT : $e.intVal) ) ; VT_INT - #case 0x17 ( #(UINT : $e.uintVal) ) ; VT_UINT - #case 0x1E ( #(LPSTR : $e.pszVal) ) ; VT_LPSTR - #case 0x1F ( #(LPWSTR : $e.pwszVal) ) ; VT_LPWSTR - #case 0x40 ( #(FILETIME : $e.filetime) ) ; VT_FILETIME - #case 0x42 ( #(STREAM : $e.pStream) ) ; VT_STREAM - #case 0x43 ( #(STORAGE : $e.pStorage) ) ; VT_STORAGE - #case 0x44 ( #(STREAMED_OBJECT : $e.pStream) ) ; VT_STREAMED_OBJECT - #case 0x45 ( #(STORED_OBJECT : $e.pStorage) ) ; VT_STORED_OBJECT - #case 0x46 ( #(BLOB_OBJECT : $e.blob ) ) ; VT_BLOB_OBJECT - #case 0x47 ( #(CF : $e.pclipdata) ) ; VT_CF - #case 0x48 ( #(CLSID : $e.puuid) ) ; VT_CLSID - #case 0x49 ( #(VERSIONED_STREAM : $e.pVersionedStream) ) ; VT_VERSIONED_STREAM - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;; Vector types ;; - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - #case 0x1002 ( #(vector of I2 : $e.cai) ) ; VT_I2|VT_VECTOR - #case 0x1003 ( #(vector of I4 : $e.cal) ) ; VT_I4|VT_VECTOR - #case 0x1004 ( #(vector of R4 : $e.caflt) ) ; VT_R4|VT_VECTOR - #case 0x1005 ( #(vector of R8 : $e.cadbl) ) ; VT_R8|VT_VECTOR - #case 0x1010 ( #(vector of I1 : $e.cac) ) ; VT_I1|VT_VECTOR - #case 0x1011 ( #(vector of UI1 : $e.caub) ) ; VT_UI1|VT_VECTOR - #case 0x1012 ( #(vector of UI2 : $e.caui) ) ; VT_UI2|VT_VECTOR - #case 0x1013 ( #(vector of UI4 : $e.caul) ) ; VT_UI4|VT_VECTOR - #case 0x1014 ( #(vector of I8 : $e.cah) ) ; VT_I8|VT_VECTOR - #case 0x1015 ( #(vector of UI8 : $e.cauh) ) ; VT_UI8|VT_VECTOR - #case 0x101E ( #(vector of LPSTR : $e.calpstr) ) ; VT_LPSTR|VT_VECTOR - #case 0x101F ( #(vector of LPWSTR : $e.calpwstr) ) ; VT_LPWSTR|VT_VECTOR - #case 0x100C ( #(vector of VARIANT : $e.capropvar) ) ; VT_VARIANT|VT_VECTOR - #case 0x100B ( #(vector of BOOL : $e.cabool) ) ; VT_BOOL|VT_VECTOR - #case 0x100A ( #(vector of ERROR : $e.cascode) ) ; VT_ERROR|VT_VECTOR - #case 0x1006 ( #(vector of CY : $e.cacy) ) ; VT_CY|VT_VECTOR - #case 0x1007 ( #(vector of DATE : $e.cadate) ) ; VT_DATE|VT_VECTOR - #case 0x1040 ( #(vector of FILETIME : $e.cafiletime) ) ; VT_FILETIME|VT_VECTOR - #case 0x1048 ( #(vector of CLSID : $e.cauuid) ) ; VT_CLSID|VT_VECTOR - #case 0x1047 ( #(vector of CF : $e.caclipdata) ) ; VT_CF|VT_VECTOR - #case 0x1008 ( #(vector of BSTR : $e.cabstr) ) ; VT_BSTR|VT_VECTOR - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;; Byref Types ;; - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - #case 0x4016 ( #(byref of INT : $e.pintVal) ) ; VT_INT|VT_BYREF - #case 0x4017 ( #(byref of UINT : $e.puintVal) ) ; VT_UINT|VT_BYREF - #case 0x4002 ( #(byref of I2 : $e.piVal) ) ; VT_I2|VT_BYREF - #case 0x4003 ( #(byref of I4 : $e.plVal) ) ; VT_I4|VT_BYREF - #case 0x4004 ( #(byref of R4 : $e.pfltVal) ) ; VT_R4|VT_BYREF - #case 0x4005 ( #(byref of R8 : $e.pdblVal) ) ; VT_R8|VT_BYREF - #case 0x4010 ( #(byref of I1 : $e.pcVal) ) ; VT_I1|VT_BYREF - #case 0x4011 ( #(byref of UI1 : $e.pbVal) ) ; VT_UI1|VT_BYREF - #case 0x4012 ( #(byref of UI2 : $e.puiVal) ) ; VT_UI2|VT_BYREF - #case 0x4013 ( #(byref of UI4 : $e.pulVal) ) ; VT_UI4|VT_BYREF - #case 0x4014 ( #(byref of I8 : (__int64*)$e.pdblVal) ) ; VT_I8|VT_BYREF - #case 0x4015 ( #(byref of UI8 : (unsigned __int64*)$e.pdblVal) ) ; VT_UI8|VT_BYREF - #case 0x400C ( #(byref of VARIANT : $e.pvarVal) ) ; VT_VARIANT|VT_BYREF - #case 0x400B ( #(byref of BOOL : $e.pboolVal) ) ; VT_BOOL|VT_BYREF - #case 0x400A ( #(byref of ERROR : $e.pscode) ) ; VT_ERROR|VT_BYREF - #case 0x4006 ( #(byref of CY : $e.pcyVal) ) ; VT_CY|VT_BYREF - #case 0x4007 ( #(byref of DATE : $e.pdate) ) ; VT_DATE|VT_BYREF - #case 0x4008 ( #(byref of BSTR : $e.pbstrVal) ) ; VT_BSTR|VT_BYREF - #case 0x400E ( #(byref of DECIMAL : $e.pdecVal) ) ; VT_DECIMAL|VT_BYREF - #case 0x400D ( #(byref of UNKNOWN : $e.ppunkVal) ) ; VT_UNKOWN|VT_BYREF - #case 0x4009 ( #(byref of DISPATCH : $e.ppdispVal) ) ; VT_DISPATCH|VT_BYREF - #case 0x6000 ( #(byref of ARRAY : $e.pparray) ) ; VT_ARRAY|VT_BYREF - - ; the following are either empty or invalid vt values for a variant - ; #case 0 ( #(Empty :) ) ; VT_EMPTY - ; #case 0x1 ( #(NULL :) ) ; VT_NULL - ; #case 0xC ( #(VARIANT :) ) ; VT_VARIANT - ; #case 0x18 ( #(VOID :) ) ; VT_VOID - ; #case 0x19 ( #(HRESULT :) ) ; VT_HRESULT - ; #case 0x1A ( #(PTR :) ) ; VT_PTR - ; #case 0x1B ( #(SAFEARRAY :) ) ; VT_SAFEARRAY - ; #case 0x1C ( #(CARRAY :) ) ; VT_CARRAY - ; #case 0x1D ( #(USERDEFINED :) ) ; VT_USERDEFINED - ; #case 0x24 ( #(RECORD :) ) ; VT_RECORD - ; #case 0x26 ( #(UINT_PTR :) ) ; VT_UINT_PTR - #default - ( - #if ($e.vt & 0x2000 ) - ( #(safearray: $e.parray)) - #else - ( - #( - [raw members]: [$e,!] ; unformatted data members - ) - ) - ) - #except - ( - #( - [raw members]: [$e,!] ; unformatted data members - ) - ) - ) - ) -} - -; Visualizers for data structures in namespace Concurrency -;------------------------------------------------------------------------------ -; Concurrency::message from -;------------------------------------------------------------------------------ -Concurrency::message<*>{ - preview ( - #( - $e.payload - ) - ) - - children ( - #( - #(payload: $e.payload), - #([msg_id]: $e._M_id) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::multi_link_registry from -;------------------------------------------------------------------------------ -Concurrency::multi_link_registry<*>{ - preview ( - #( - "[", - $e._M_vector._M_index, - "](", - #array( - expr: *($e._M_vector._M_array[$i]), - size: $e._M_vector._M_index - ), - ")" - ) - ) - - children ( - #( - #([size]: $e._M_vector._M_index), - #array( - expr: *($e._M_vector._M_array[$i]), - size: $e._M_vector._M_index - ) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::details::_Queue from -;------------------------------------------------------------------------------ -Concurrency::details::_Queue<*>{ - preview ( - #( - "[", - $e._M_count, - "](", - #list( - head: $e._M_pHead, - next: _M_pNext, - size: _M_count - ), - ")" - ) - ) - - children ( - #( - #([size]: $e._M_count), - #list( - head: $e._M_pHead, - next: _M_pNext, - size: _M_count - ) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::unbounded_buffer from -;------------------------------------------------------------------------------ -Concurrency::unbounded_buffer<*>{ - preview ( - #( - $e._M_messageBuffer - ) - ) - - children ( - #( - #(unprocessed_messages: $e._M_messageProcessor._M_queuedMessages._M_queue), - #(messages: $e._M_messageBuffer), - #(message_filter: *($e._M_pFilter)), - #(linked_sources: $e._M_connectedSources._M_links), - #(linked_targets: $e._M_connectedTargets), - #(reserving_target: *($e._M_pReservedFor)), - #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), - #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::overwrite_buffer from -;------------------------------------------------------------------------------ -Concurrency::overwrite_buffer<*>{ - preview ( - #( - $e._M_pMessage - ) - ) - - children ( - #( - #(value: *($e._M_pMessage)), - #(unprocessed_messages: $e._M_messageProcessor._M_queuedMessages._M_queue), - #(message_filter: *($e._M_pFilter)), - #(linked_sources: $e._M_connectedSources._M_links), - #(linked_targets: $e._M_connectedTargets), - #(reserving_target: *($e._M_pReservedFor)), - #(reserved_message: *($e._M_pReservedMessage)), - #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), - #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::single_assignment from -;------------------------------------------------------------------------------ -Concurrency::single_assignment<*>{ - preview ( - #( - $e._M_pMessage - ) - ) - - children ( - #( - #(value: *($e._M_pMessage)), - #(unprocessed_messages: $e._M_messageProcessor._M_queuedMessages._M_queue), - #(message_filter: *($e._M_pFilter)), - #(linked_sources: $e._M_connectedSources._M_links), - #(linked_targets: $e._M_connectedTargets), - #(reserving_target: *($e._M_pReservedFor)), - #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), - #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::call from -;------------------------------------------------------------------------------ -Concurrency::call<*>{ - preview ( - #( - $e._M_pFunc - ) - ) - - children ( - #( - #(call_method: $e._M_pFunc), - #(unprocessed_messages: $e._M_messageProcessor._M_queuedMessages._M_queue), - #(message_filter: *($e._M_pFilter)), - #(linked_sources: $e._M_connectedSources._M_links), - #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), - #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::transformer from -;------------------------------------------------------------------------------ -Concurrency::transformer<*>{ - preview ( - #( - $e._M_pFunc - ) - ) - - children ( - #( - #(transform_method: $e._M_pFunc), - #(unprocessed_messages: $e._M_messageProcessor._M_queuedMessages._M_queue), - #(messages: $e._M_messageBuffer), - #(message_filter: *($e._M_pFilter)), - #(linked_sources: $e._M_connectedSources._M_links), - #(linked_target: *($e._M_connectedTargets._M_connectedLink)), - #(reserving_target: *($e._M_pReservedFor)), - #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), - #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::choice from -;------------------------------------------------------------------------------ -Concurrency::choice<*>{ - preview ( - #( - "[", - #if ($e._M_pSingleAssignment->_M_fIsInitialized) ("initialized") - #else ("not_initialized"), - "] ", - $e._M_sourceTuple - ) - ) - - children ( - #( - #([input_count]: $e._M_pSingleAssignment->_M_connectedSources._M_links._M_vector._M_index), - #(index: $e._M_pSingleAssignment->_M_pMessage->payload), - #(source_tuple: $e._M_sourceTuple), - #(linked_sources: $e._M_pSingleAssignment->_M_connectedSources._M_links), - #(linked_targets: $e._M_pSingleAssignment->_M_connectedTargets), - #(reserving_target: *($e._M_pSingleAssignment->_M_pReservedFor)), - #(Scheduler: *($e._M_pScheduler)), - #(ScheduleGroup: *($e._M_pScheduleGroup)), - #([raw _M_pSourceChoices] : $e._M_pSourceChoices) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::join<*,*>::_MessageArray from -;------------------------------------------------------------------------------ -Concurrency::join<*,*>::_MessageArray{ - preview ( - #( - "[", - $e._M_count, - "](", - #array( - expr: *(((Concurrency::message<$T1>**)$e._M_messages)[$i]), - size: $e._M_count - ), - ")" - ) - ) - - children ( - #( - #([size]: $e._M_count), - #array( - expr: *(((Concurrency::message<$T1>**)$e._M_messages)[$i]), - size: $e._M_count - ) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::join<*,*>::_SavedMessageIdArray from -;------------------------------------------------------------------------------ -Concurrency::join<*,*>::_SavedMessageIdArray{ - preview ( - #( - "[", - $e._M_count, - "](", - #array( - expr: ((int*)$e._M_savedIds)[$i], - size: $e._M_count - ), - ")" - ) - ) - - children ( - #( - #([size]: $e._M_count), - #array( - expr: ((int*)$e._M_savedIds)[$i], - size: $e._M_count - ) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::join from -;------------------------------------------------------------------------------ -Concurrency::join<*,*>{ - preview ( - #( - "[", - $e._M_messageArray._M_count - $e._M_messagesRemaining, - "/", - $e._M_messageArray._M_count, - "](", - #array( - expr: *($e._M_connectedSources._M_links._M_vector._M_array[$i]), - size: $e._M_connectedSources._M_links._M_vector._M_index - ), - ")" - ) - ) - - children ( - #( - #([join_type]: (Concurrency::join_type)$T2), - #([offer_count]: $e._M_messageArray._M_count - $e._M_messagesRemaining), - #(offer_IDs: $e._M_savedMessageIdArray), - #([input_count]: $e._M_messageArray._M_count), - #(input_values: $e._M_messageArray), - #(messages: $e._M_messageBuffer), - #(message_filter: *($e._M_pFilter)), - #(linked_sources: $e._M_connectedSources._M_links), - #(linked_target: $e._M_connectedTargets._M_connectedLink), - #(reserving_target: *($e._M_pReservedFor)), - #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), - #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::multitype_join from -;------------------------------------------------------------------------------ -Concurrency::multitype_join<*,*>{ - preview ( - #( - "[", - $e._M_pJoinNode->_M_connectedSources._M_links._M_vector._M_index - $e._M_pJoinNode->_M_counter, - "/", - $e._M_pJoinNode->_M_connectedSources._M_links._M_vector._M_index, - "]", - $e._M_sourceTuple - ) - ) - - children ( - #( - #([join_type]: (Concurrency::join_type)$T2), - #([offer_count]: $e._M_pJoinNode->_M_connectedSources._M_links._M_vector._M_index - $e._M_pJoinNode->_M_counter), - #([input_count]: $e._M_pJoinNode->_M_connectedSources._M_links._M_vector._M_index), - #(source_tuple: $e._M_sourceTuple), - #(messages: $e._M_pJoinNode->_M_messageBuffer), - #(linked_sources: $e._M_pJoinNode->_M_connectedSources._M_links), - #(linked_target: $e._M_pJoinNode->_M_connectedTargets._M_connectedLink), - #(reserving_target: *($e._M_pJoinNode->_M_pReservedFor)), - #(Scheduler: *($e._M_pJoinNode->_M_messageProcessor._M_pScheduler)), - #(ScheduleGroup: *($e._M_pJoinNode->_M_messageProcessor._M_pScheduleGroup)), - #([raw _M_pSourceJoins] : $e._M_pSourceJoins) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::timer from -;------------------------------------------------------------------------------ -Concurrency::timer<*>{ - preview ( - #( - $e._M_state - ) - ) - - children ( - #( - #(state: $e._M_state), - #(value: $e._M_value), - #(repeating: $e._M_fRepeating), - #(interval_ms: $e._M_ms), - #(linked_target: *($e._M_connectedTargets._M_connectedLink)), - #(reserving_target: *($e._M_pReservedFor)), - #(Scheduler: *($e._M_messageProcessor._M_pScheduler)), - #(ScheduleGroup: *($e._M_messageProcessor._M_pScheduleGroup)) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::details::SchedulerBase from -; Concurrency::details::ThreadScheduler from -; Concurrency::details::UMSThreadScheduler from -;------------------------------------------------------------------------------ -Concurrency::details::SchedulerBase|Concurrency::details::ThreadScheduler|Concurrency::details::UMSThreadScheduler{ - preview ( - #( - "[", - $e.m_id, - "] ", - #if ($e.m_schedulerKind == 0) ("ThreadScheduler") - #else ("UmsScheduler"), - #if ($e.m_id == $e.s_pDefaultScheduler->m_id) (", default") - #else ("") - ) - ) - - children ( - #( - #(ID: $e.m_id), - #(SchedulerPolicy: $e.m_policy), - #(VirtualProcessorCount: $e.m_virtualProcessorCount), - #(ReferenceCount: $e.m_refCount), - #([isDefaultScheduler]: $e.m_id == $e.s_pDefaultScheduler->m_id) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::details::ScheduleGroupBase from -; Concurrency::details::CacheLocalScheduleGroup from -; Concurrency::details::FairScheduleGroup from -;------------------------------------------------------------------------------ -Concurrency::details::ScheduleGroupBase|Concurrency::details::CacheLocalScheduleGroup|Concurrency::details::FairScheduleGroup{ - preview ( - #( - "[", - $e.m_id, - "]", - #if ($e.m_kind & 4) (" AnonymousScheduleGroup") - #else ("") - ) - ) - - children ( - #( - #(ID: $e.m_id), - #(Scheduler: *($e.m_pScheduler)) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::details::ContextBase from -; Concurrency::details::InternalContextBase from -; Concurrency::details::ThreadInternalContext from -; Concurrency::details::UMSThreadInternalContext from -;------------------------------------------------------------------------------ -Concurrency::details::ContextBase|Concurrency::details::InternalContextBase|Concurrency::details::ThreadInternalContext|Concurrency::details::UMSThreadInternalContext{ - preview ( - #( - "[", - $e.m_threadId, - "] ", - #if ($e.m_blockedState == 0) ("not_concrt_blocked") - #elif ($e.m_blockedState == 1) ("concrt_blocked") - #elif ($e.m_blockedState == 2) ("ums_sync_blocked") - #elif ($e.m_blockedState == 4) ("ums_async_blocked") - #else ("") - ) - ) - - children ( - #( - #(ID: $e.m_id), - #(ThreadID: $e.m_threadId), - #(Scheduler: *($e.m_pScheduler)), - #(ScheduleGroup: *($e.m_pGroup)) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::details::ExternalContextBase from -;------------------------------------------------------------------------------ -Concurrency::details::ExternalContextBase{ - preview ( - #( - "[", - $e.m_threadId, - "] ", - #if ($e.m_contextSwitchingFence == 1) ("concrt_blocked") - #else ("not_concrt_blocked") - ) - ) - - children ( - #( - #(ID: $e.m_id), - #(ThreadID: $e.m_threadId), - #(Scheduler: *($e.m_pScheduler)), - #(ScheduleGroup: *($e.m_pGroup)) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::SchedulerPolicy from -;------------------------------------------------------------------------------ -Concurrency::SchedulerPolicy{ - preview ( - #( - $e._M_pPolicyBag->_M_values._M_specificValues._M_schedulerKind, - ", Min=", - $e._M_pPolicyBag->_M_values._M_specificValues._M_minConcurrency, - ", Max=", - $e._M_pPolicyBag->_M_values._M_specificValues._M_maxConcurrency - ) - ) - - children ( - #( - #(SchedulerKind: $e._M_pPolicyBag->_M_values._M_specificValues._M_schedulerKind), - #(MinConcurrency: $e._M_pPolicyBag->_M_values._M_specificValues._M_minConcurrency), - #(MaxConcurrency: $e._M_pPolicyBag->_M_values._M_specificValues._M_maxConcurrency), - #(TargetOversubscriptionFactor: $e._M_pPolicyBag->_M_values._M_specificValues._M_targetOversubscriptionFactor), - #(LocalContextCacheSize: $e._M_pPolicyBag->_M_values._M_specificValues._M_localContextCacheSize), - #(ContextStackSize: $e._M_pPolicyBag->_M_values._M_specificValues._M_contextStackSize), - #(ContextPriority: $e._M_pPolicyBag->_M_values._M_specificValues._M_contextPriority), - #(SchedulingProtocol: $e._M_pPolicyBag->_M_values._M_specificValues._M_schedulingProtocol), - #(DynamicProgressFeedback: $e._M_pPolicyBag->_M_values._M_specificValues._M_dynamicProgressFeedback) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::event from -;------------------------------------------------------------------------------ -Concurrency::event{ - preview ( - #( - #if ($e._M_pWaitChain == 1) ("set") - #else ("not_set") - ) - ) - - children ( - #( - #([is_set]: ($e._M_pWaitChain == 1)), - #([has_waiters]: (($e._M_pWaitChain != 0) && ($e._M_pWaitChain != 1))) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::critical_section from -;------------------------------------------------------------------------------ -Concurrency::critical_section{ - preview ( - #( - #if ($e._M_pHead != 0) ("locked") - #else ("not_locked") - ) - ) - - children ( - #( - #([is_locked]: ($e._M_pHead != 0)), - #(OwningContext: *((Concurrency::Context*)($e._M_activeNode[0]))) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::critical_section::scoped_lock from -;------------------------------------------------------------------------------ -Concurrency::critical_section::scoped_lock{ - preview ( - #( - $e._M_critical_section - ) - ) - - children ( - #( - CriticalSection: $e._M_critical_section - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::reader_writer_lock from -;------------------------------------------------------------------------------ -Concurrency::reader_writer_lock{ - preview ( - #( - #if (($e._M_lockState < 8) && ($e._M_lockState & 2)) ("held_by_writer") - #elif ($e._M_lockState >= 8) ( - #( - "held_by_reader(s) [", - ($e._M_lockState / 8), - "]" - ) - ) - #else ("not_held") - ) - ) - - children ( - #( - #([is_reader_lock_held]: ($e._M_lockState >= 8)), - #([num_reader_lock_holders]: ($e._M_lockState / 8)), - #([is_writer_lock_held]: ($e._M_lockState < 8) && ($e._M_lockState & 2)), - #(OwningWriterContext: *((Concurrency::Context*)($e._M_activeWriter[0]))) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::reader_writer_lock::scoped_lock from -; Concurrency::reader_writer_lock::scoped_lock_read from -;------------------------------------------------------------------------------ -Concurrency::reader_writer_lock::scoped_lock|Concurrency::reader_writer_lock::scoped_lock_read{ - preview ( - #( - $e._M_reader_writer_lock - ) - ) - - children ( - #( - ReaderWriterLock: $e._M_reader_writer_lock - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::details::_TaskCollectionBase from -;------------------------------------------------------------------------------ -Concurrency::details::_TaskCollectionBase{ - preview ( - #( - #if ((((int)$e._M_pException & ~0x3) != 0) && (((int)$e._M_pException & ~0x3) != 0xC)) ("exception") - #else ("no_exception") - ) - ) - - children ( - #( - #([has_exception]: (((int)$e._M_pException & ~0x3) != 0) && (((int)$e._M_pException & ~0x3) != 0xC)), - #(CreatingContext: *((Concurrency::Context*)$e._M_pOwningContext)) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::task_group from -; Concurrency::structured_task_group from -;------------------------------------------------------------------------------ -Concurrency::task_group|Concurrency::structured_task_group{ - preview ( - #( - #if ((((int)$e._M_task_collection._M_pException & ~0x3) != 0) && (((int)$e._M_task_collection._M_pException & ~0x3) != 0xC)) ("exception") - #else ("no_exception") - ) - ) - - children ( - #( - #([has_exception]: (((int)$e._M_task_collection._M_pException & ~0x3) != 0) && (((int)$e._M_task_collection._M_pException & ~0x3) != 0xC)), - #(CreatingContext: *((Concurrency::Context*)$e._M_task_collection._M_pOwningContext)) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::task_handle from -;------------------------------------------------------------------------------ -Concurrency::task_handle<*>{ - preview ( - #( - $e._M_function - ) - ) - - children ( - #( - #(Function: $e._M_function), - #(RuntimeOwnsLifetime: $e._M_fRuntimeOwnsLifetime), - #(TaskCollection: *($e._M_pTaskCollection)) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::combinable from -;------------------------------------------------------------------------------ -Concurrency::combinable<*>{ - preview( - #( - "(", - #array( - expr: *($e._M_buckets[$i]), - size: $e._M_size - ) : #list( - head: $e, - next: _M_chain - ) : $e._M_value, - ")" - ) - ) - children( - #( - #array( - expr: *($e._M_buckets[$i]), - size: $e._M_size - ) : #list( - head: $e, - next: _M_chain - ) : $e._M_value, - #(InitFunction : $e._M_fnInitialize) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::concurrent_vector from -;------------------------------------------------------------------------------ -Concurrency::concurrent_vector<*,*>{ - preview( - #( - "[", - $e._My_early_size._M_value, - "](", - #array ( - expr: #( - #if (($i >> 1) == 0) ((($T1*)$e._My_segment._M_value[0]._My_array)[$i]) - #else ((($T1*)$e._My_segment._M_value[__log2($i)]._My_array)[$i - (0x1 << __log2($i))]) - ), - size: $e._My_early_size._M_value - ), - ")" - ) - ) - children( - #( - [size] : $e._My_early_size._M_value, - #array ( - expr: #( - #if (($i >> 1) == 0) ((($T1*)$e._My_segment._M_value[0]._My_array)[$i]) - #else ((($T1*)$e._My_segment._M_value[__log2($i)]._My_array)[$i - (0x1 << __log2($i))]) - ), - size: $e._My_early_size._M_value - ) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::details::_Vector_iterator from -;------------------------------------------------------------------------------ -Concurrency::details::_Vector_iterator,*>{ - preview( - #( - #if (($e._My_index >> 1) == 0) ((($T1*)$e._My_vector->_My_segment._M_value[0]._My_array)[$e._My_index]) - #else ((($T1*)$e._My_vector->_My_segment._M_value[__log2($e._My_index)]._My_array)[$e._My_index - (0x1 << __log2($e._My_index))]) - ) - ) - children( - #( - [ptr]: #if (($e._My_index >> 1) == 0) (&((($T1*)$e._My_vector->_My_segment._M_value[0]._My_array)[$e._My_index])) - #else (&((($T1*)$e._My_vector->_My_segment._M_value[__log2($e._My_index)]._My_array)[$e._My_index - (0x1 << __log2($e._My_index))])) - - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::concurrent_queue from -;------------------------------------------------------------------------------ -Concurrency::concurrent_queue<*,*>{ - preview - ( - #( - "[", - $e._My_rep->_Tail_counter._M_value - $e._My_rep->_Head_counter._M_value, - "](", - #array - ( - expr : #if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 0) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 1) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 2) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 3) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 4) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 5) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 6) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 7) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 8) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 9) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 10) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 11) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 12) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 13) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 14) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 15) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 16) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 17) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 18) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 19) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1])))))))))))))))))))), - size : #if ($e._My_rep->_Tail_counter._M_value-$e._My_rep->_Head_counter._M_value < 20*8*$e._Items_per_page) ($e._My_rep->_Tail_counter._M_value-$e._My_rep->_Head_counter._M_value) - #else (20*8*$e._Items_per_page) - ), - ")" - ) - ) - children - ( - #( - #([unsafe_size]: $e._My_rep->_Tail_counter._M_value-$e._My_rep->_Head_counter._M_value), - #array - ( - expr : #if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 0) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 1) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 2) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 3) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 4) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 5) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 6) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 7) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 8) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 9) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 10) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 11) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 12) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 13) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 14) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 15) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 16) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 17) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 18) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else (#if (($i+($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)))/(8*$e._Items_per_page)-($e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>(8*($e._Items_per_page-1)))*($i%8+$e._My_rep->_Head_counter._M_value%(8*$e._Items_per_page)>=(8*$e._Items_per_page)) == 19) ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1]) - #else ((($T1*)(($e._My_rep->_Array[(($i+$e._My_rep->_Head_counter._M_value)*3%8)]._Head_page._M_value->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next->_Next) + 1))[(($i+$e._My_rep->_Head_counter._M_value)&-8)/8&$e._Items_per_page-1])))))))))))))))))))), - size : #if ($e._My_rep->_Tail_counter._M_value-$e._My_rep->_Head_counter._M_value < 20*8*$e._Items_per_page) ($e._My_rep->_Tail_counter._M_value-$e._My_rep->_Head_counter._M_value) - #else (20*8*$e._Items_per_page) - ) - ) - ) -} - -;------------------------------------------------------------------------------ -; Concurrency::details::_Concurrent_queue_iterator from -;------------------------------------------------------------------------------ -Concurrency::details::_Concurrent_queue_iterator,*>{ - preview( - #( - *(($T1*)$e._My_item) - ) - ) - children( - #( - [ptr]: (($T1*)$e._My_item) - - ) - ) -} - -; This section lets you define your own errors for the HRESULT display. -; You need to list the error code in unsigned decimal, followed by the message. -; Changes will take effect the next time you redisplay the variable. - -[hresult] -;1234=my custom error code - -[Visualizer] - -glm::detail::tvec2<*>{ - preview ( - #(#($c.x,$c.y)) - ) - children ( - #([x]: $c.x,[y]: $c.y) - ) -} - -glm::detail::tvec3<*>{ - preview ( - #($e.x,$e.y,$e.z) - ) - children ( - #([x]: $e.x,[y]: $e.y,[z]: $e.z) - ) -} - -glm::detail::tvec4<*>{ - preview ( - #($c.x,$c.y,$c.z,$c.w) - ) - children ( - #([x]: $e.x,[y]: $e.y,[z]: $e.z, #([w]: $e.w)) - ) -} diff --git a/3rdparty/glm/source/util/glm.natvis b/3rdparty/glm/source/util/glm.natvis deleted file mode 100644 index 4db2418..0000000 --- a/3rdparty/glm/source/util/glm.natvis +++ /dev/null @@ -1,555 +0,0 @@ - - - - - - - - [{x,g}] - - x,g - - - - - [{x,g} {y,g}] - - x,g - y,g - - - - - [{x,g} {y,g} {z,g}] - - x,g - y,g - z,g - - - - - [{x,g} {y,g} {z,g} {w,g}] - - x,g - y,g - z,g - w,g - - - - - [{(int)x}] - - x - - - - - [{(int)x} {(int)y}] - - x - y - - - - - [{(int)x,g} {(int)y,g} {(int)z,g}] - - x - y - z - - - - - [{(int)x,g} {(int)y,g} {(int)z,g} {(int)w,g}] - - x - y - z - w - - - - - [{x,g} {y,g}] - - - - - - - - k = *(float *)&i - k = k * (1.5f - (n * k * k)) - k = k * (1.5f - (n * k * k)) - k = k * (1.5f - (n * k * k)) - 1/k,g - - - 0.0f,g - - - x,g - y,g - - - - - [{x,g} {y,g} {z,g}] - - - - - - - - k = *(float *)&i - k = k * (1.5f - (n * k * k)) - k = k * (1.5f - (n * k * k)) - k = k * (1.5f - (n * k * k)) - 1/k,g - - - 0.0f,g - - - - - - #{ - (unsigned((x<0?0:(x>1?1:x))*255.5f) << 24) | - (unsigned((y<0?0:(y>1?1:y))*255.5f) << 16) | - (unsigned((z<0?0:(z>1?1:z))*255.5f) << 8) | 0xFF,Xb - } - - - x,g - y,g - z,g - - - - - [{x,g} {y,g} {z,g} {w,g}] - - - - - - - - k = *(float *)&i - k = k * (1.5f - (n * k * k)) - k = k * (1.5f - (n * k * k)) - k = k * (1.5f - (n * k * k)) - 1/k,g - - - 0.0f,g - - - - - - #{ - (unsigned((x<0?0:(x>1?1:x))*255.5f) << 24) | - (unsigned((y<0?0:(y>1?1:y))*255.5f) << 16) | - (unsigned((z<0?0:(z>1?1:z))*255.5f) << 8) | - (unsigned((w<0?0:(w>1?1:w))*255.5f) << 0),Xb - } - - - x,g - y,g - z,g - w,g - - - - - [{x,g} {y,g}] - - - - - - - - k = *(double *)&i - k = k * (1.5 - (n * k * k)) - k = k * (1.5 - (n * k * k)) - k = k * (1.5 - (n * k * k)) - 1/k,g - - - 0.0,g - - - x,g - y,g - - - - - [{x,g} {y,g} {z,g}] - - - - - - - - k = *(double *)&i - k = k * (1.5 - (n * k * k)) - k = k * (1.5 - (n * k * k)) - k = k * (1.5 - (n * k * k)) - 1/k,g - - - 0.0,g - - - x,g - y,g - z,g - - - - - [{x,g} {y,g} {z,g} {w,g}] - - - - - - - - k = *(double *)&i - k = k * (1.5 - (n * k * k)) - k = k * (1.5 - (n * k * k)) - k = k * (1.5 - (n * k * k)) - 1/k,g - - - 0.0,g - - - x,g - y,g - z,g - w,g - - - - - {w,g} + {x,g}i + {y,g}j + {z,g}k - - x,g - y,g - z,g - w,g - - - - - {w,g} + {x,g}i + {y,g}j + {z,g}k - - - - - - - - k = *(float *)&i - k = k * (1.5f - (n * k * k)) - k = k * (1.5f - (n * k * k)) - k = k * (1.5f - (n * k * k)) - 1/k,g - - - 0.0f,g - - - x,g - y,g - z,g - w,g - - - - - {w,g} + {x,g}i + {y,g}j + {z,g}k - - - - - - - - k = *(double *)&i - k = k * (1.5 - (n * k * k)) - k = k * (1.5 - (n * k * k)) - k = k * (1.5 - (n * k * k)) - 1/k,g - - - 0.0,g - - - x,g - y,g - z,g - w,g - - - - - [{value[0]} {value[1]}] - - - - [{value[0].x,g} {value[1].x,g}] - - - [{value[0].y,g} {value[1].y,g}] - - - - value[0] - value[1] - - - - - - - [{value[0]} {value[1]}] - - - - [{value[0].x,g} {value[1].x,g}] - - - [{value[0].y,g} {value[1].y,g}] - - - [{value[0].z,g} {value[1].z,g}] - - - - value[0] - value[1] - - - - - - - [{value[0]} {value[1]}] - - - - [{value[0].x,g} {value[1].x,g}] - - - [{value[0].y,g} {value[1].y,g}] - - - [{value[0].z,g} {value[1].z,g}] - - - [{value[0].w,g} {value[1].w,g}] - - - - value[0] - value[1] - - - - - - - [{value[0]} {value[1]} {value[2]}] - - - - [{value[0].x,g} {value[1].x,g} {value[2].x,g}] - - - [{value[0].y,g} {value[1].y,g} {value[2].y,g}] - - - - value[0] - value[1] - value[2] - - - - - - - [{value[0]} {value[1]} {value[2]}] - - - - [{value[0].x,g} {value[1].x,g} {value[2].x,g}] - - - [{value[0].y,g} {value[1].y,g} {value[2].y,g}] - - - [{value[0].z,g} {value[1].z,g} {value[2].z,g}] - - - - value[0] - value[1] - value[2] - - - - - - - [{value[0]} {value[1]} {value[2]}] - - - - [{value[0].x,g} {value[1].x,g} {value[2].x,g}] - - - [{value[0].y,g} {value[1].y,g} {value[2].y,g}] - - - [{value[0].z,g} {value[1].z,g} {value[2].z,g}] - - - [{value[0].w,g} {value[1].w,g} {value[2].w,g}] - - - - value[0] - value[1] - value[2] - - - - - - - [{value[0]} {value[1]} {value[2]} {value[3]}] - - - - [{value[0].x,g} {value[1].x,g} {value[2].x,g} {value[3].x,g}] - - - [{value[0].y,g} {value[1].y,g} {value[2].y,g} {value[3].y,g}] - - - - value[0] - value[1] - value[2] - value[3] - - - - - - - [{value[0]} {value[1]} {value[2]} {value[3]}] - - - - [{value[0].x,g} {value[1].x,g} {value[2].x,g} {value[3].x,g}] - - - [{value[0].y,g} {value[1].y,g} {value[2].y,g} {value[3].y,g}] - - - [{value[0].z,g} {value[1].z,g} {value[2].z,g} {value[3].z,g}] - - - - value[0] - value[1] - value[2] - value[3] - - - - - - - [{value[0]} {value[1]} {value[2]} {value[3]}] - - - - [{value[0].x,g} {value[1].x,g} {value[2].x,g} {value[3].x,g}] - - - [{value[0].y,g} {value[1].y,g} {value[2].y,g} {value[3].y,g}] - - - [{value[0].z,g} {value[1].z,g} {value[2].z,g} {value[3].z,g}] - - - [{value[0].w,g} {value[1].w,g} {value[2].w,g} {value[3].w,g}] - - - - value[0] - value[1] - value[2] - value[3] - - - - - - - [r: {real}] [d: {dual}] - - real - dual - - - - \ No newline at end of file diff --git a/3rdparty/glm/source/util/usertype.dat b/3rdparty/glm/source/util/usertype.dat deleted file mode 100644 index cb44de3..0000000 --- a/3rdparty/glm/source/util/usertype.dat +++ /dev/null @@ -1,407 +0,0 @@ -attribute -const -uniform -varying -break -continue -do -for -while -if -else -in -out -inout -float -int -void -bool -true -false -discard -return -mat2 -mat3 -mat4 -mat2x2 -mat3x3 -mat4x4 -mat2x3 -mat3x2 -mat2x4 -mat4x2 -mat3x4 -mat4x3 -vec2 -vec3 -vec4 -ivec2 -ivec3 -ivec4 -uvec2 -uvec3 -uvec4 -bvec2 -bvec3 -bvec4 -sampler1D -sampler2D -sampler3D -samplerCube -sampler1DShadow -sampler2DShadow -struct - -asm -class -union -enum -typedef -template -this -packed -goto -switch -default -inline -noinline -volatile -public -static -extern -external -interface -long -short -double -half -fixed -unsigned -input -output -sampler2DRect -sampler3DRect -sampler2DRectShadow -sizeof -cast -namespace -using - -layout -location -smooth -flat -noperspective -centroid -invariant -lowp -mediump -highp -precision -patch -sample -subroutine - -hvec2 -hvec3 -hvec4 -fvec2 -fvec3 -fvec4 -dvec2 -dvec3 -dvec4 - -on - -final -abstract -limited -access -self - -uchar -schar -uint -sint - -int8 -int16 -int32 -int64 - -sint8 -sint16 -sint32 -sint64 - -uint8 -uint16 -uint32 -uint64 - -float16 -float32 -float64 - -quat -hquat -fquat -dquat - -handle -handle8 -handle16 -handle32 -handle64 - -flag -flag8 -flag16 -flag32 -flag64 - -import -export - -hmat2 -hmat3 -hmat4 - -fmat2 -fmat3 -fmat4 - -dmat2 -dmat3 -dmat4 - -hmat2x3 -hmat3x2 -hmat2x4 -hmat4x2 -hmat3x4 -hmat4x3 - -fmat2x3 -fmat3x2 -fmat2x4 -fmat4x2 -fmat3x4 -fmat4x3 - -dmat2x3 -dmat3x2 -dmat2x4 -dmat4x2 -dmat3x4 -dmat4x3 - -null -pi -epsilon -infinite -self - -byte -word -dword -qword - -new_object -new_array -delete_object -delete_array - -int8 -int16 -int32 -int64 - -i8 -i16 -i32 -i64 - -i8vec2 -i8vec3 -i8vec4 - -i16vec2 -i16vec3 -i16vec4 - -i32vec2 -i32vec3 -i32vec4 - -i64vec2 -i64vec3 -i64vec4 - -uint8 -uint16 -uint32 -uint64 - -u8 -u16 -u32 -u64 - -u8vec2 -u8vec3 -u8vec4 - -u16vec2 -u16vec3 -u16vec4 - -u32vec2 -u32vec3 -u32vec4 - -u64vec2 -u64vec3 -u64vec4 - -float16 -float32 -float64 - -f16 -f32 -f64 - -f16vec2 -f16vec3 -f16vec4 - -f32vec2 -f32vec3 -f32vec4 - -f64vec2 -f64vec3 -f64vec4 - -f16mat2 -f16mat3 -f16mat4 - -f16mat2x3 -f16mat2x4 -f16mat3x2 -f16mat3x4 -f16mat4x2 -f16mat4x3 - -f32mat2 -f32mat3 -f32mat4 - -f32mat2x3 -f32mat2x4 -f32mat3x2 -f32mat3x4 -f32mat4x2 -f32mat4x3 - -f64mat2 -f64mat3 -f64mat4 - -f64mat2x3 -f64mat2x4 -f64mat3x2 -f64mat3x4 -f64mat4x2 -f64mat4x3 - -f16quat -f32quat -f64quat - -bool1 -bool2 -bool3 -bool4 - -bool1x1 -bool2x2 -bool3x3 -bool4x4 - -bool2x3 -bool2x4 -bool3x2 -bool3x4 -bool4x2 -bool4x3 - -int1 -int2 -int3 -int4 - -int1x1 -int2x2 -int3x3 -int4x4 - -int2x3 -int2x4 -int3x2 -int3x4 -int4x2 -int4x3 - -half1 -half2 -half3 -half4 - -half2x2 -half3x3 -half4x4 - -half2x3 -half2x4 -half3x2 -half3x4 -half4x2 -half4x3 - -float1 -float2 -float3 -float4 - -float1x1 -float2x2 -float3x3 -float4x4 - -float2x3 -float2x4 -float3x2 -float3x4 -float4x2 -float4x3 - -double1 -double2 -double3 -double4 - -double1x1 -double2x2 -double3x3 -double4x4 - -double2x3 -double2x4 -double3x2 -double3x4 -double4x2 -double4x3 -- cgit v1.2.3-70-g09d2