Remove disabled warnings (#1213)

* Remove disabled warnings
This commit is contained in:
Christophe 2024-01-20 10:11:13 +01:00 committed by GitHub
parent b06b775c1c
commit f86092a658
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
182 changed files with 2669 additions and 1719 deletions

View File

@ -54,51 +54,51 @@ jobs:
cmake --build ./build_auto --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_auto
- name: Run with GLM_TEST_FORCE_PURE
- name: Run with GLM_FORCE_PURE
run: |
cmake -S. -B ./build_pure_std -T ${{matrix.toolkit}} -DGLM_TEST_FORCE_PURE=ON -DGLM_TEST_ENABLE_CXX_${{matrix.std}}=ON
cmake -S. -B ./build_pure_std -T ${{matrix.toolkit}} -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
cmake --build ./build_pure_std --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_pure_std
- name: Run with GLM_TEST_FORCE_PURE and language extensions
- name: Run with GLM_FORCE_PURE and language extensions
run: |
cmake -S. -B ./build_pure_ext -T ${{matrix.toolkit}} -DGLM_TEST_FORCE_PURE=ON -DGLM_TEST_ENABLE_CXX_${{matrix.std}}=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON
cmake -S. -B ./build_pure_ext -T ${{matrix.toolkit}} -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON
cmake --build ./build_pure_ext --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_pure_ext
- name: Run with GLM_TEST_ENABLE_SIMD_SSE2
- name: Run with GLM_ENABLE_SIMD_SSE2
run: |
cmake -S. -B ./build_sse2_std -T ${{matrix.toolkit}} -DGLM_TEST_FORCE_PURE=ON -DGLM_TEST_ENABLE_CXX_${{matrix.std}}=ON
cmake -S. -B ./build_sse2_std -T ${{matrix.toolkit}} -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
cmake --build ./build_sse2_std --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_sse2_std
- name: Run with GLM_TEST_ENABLE_SIMD_SSE2 and language extensions
- name: Run with GLM_ENABLE_SIMD_SSE2 and language extensions
run: |
cmake -S. -B ./build_sse2_ext -T ${{matrix.toolkit}} -DGLM_TEST_ENABLE_SIMD_SSE2=ON -DGLM_TEST_ENABLE_CXX_${{matrix.std}}=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON
cmake -S. -B ./build_sse2_ext -T ${{matrix.toolkit}} -DGLM_ENABLE_SIMD_SSE2=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON
cmake --build ./build_sse2_ext --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_sse2_ext
- name: Run with GLM_TEST_ENABLE_SIMD_AVX
- name: Run with GLM_ENABLE_SIMD_AVX
run: |
cmake -S. -B ./build_avx1_std -T ${{matrix.toolkit}} -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_CXX_${{matrix.std}}=ON
cmake -S. -B ./build_avx1_std -T ${{matrix.toolkit}} -DGLM_ENABLE_SIMD_AVX=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
cmake --build ./build_avx1_std --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx1_std
- name: Run with GLM_TEST_ENABLE_SIMD_AVX and language extensions
- name: Run with GLM_ENABLE_SIMD_AVX and language extensions
run: |
cmake -S. -B ./build_avx1_ext -T ${{matrix.toolkit}} -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_CXX_${{matrix.std}}=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON
cmake -S. -B ./build_avx1_ext -T ${{matrix.toolkit}} -DGLM_ENABLE_SIMD_AVX=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON
cmake --build ./build_avx1_ext --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx1_ext
- name: Run with GLM_TEST_ENABLE_SIMD_AVX2
- name: Run with GLM_ENABLE_SIMD_AVX2
run: |
cmake -S. -B ./build_avx2_std -T ${{matrix.toolkit}} -DGLM_TEST_ENABLE_SIMD_AVX2=ON -DGLM_TEST_ENABLE_CXX_${{matrix.std}}=ON
cmake -S. -B ./build_avx2_std -T ${{matrix.toolkit}} -DGLM_ENABLE_SIMD_AVX2=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
cmake --build ./build_avx2_std --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx2_std
- name: Run with GLM_TEST_ENABLE_SIMD_AVX2 and language extensions
- name: Run with GLM_ENABLE_SIMD_AVX2 and language extensions
run: |
cmake -S. -B ./build_avx2_ext -T ${{matrix.toolkit}} -DGLM_TEST_ENABLE_SIMD_AVX2=ON -DGLM_TEST_ENABLE_CXX_${{matrix.std}}=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON
cmake -S. -B ./build_avx2_ext -T ${{matrix.toolkit}} -DGLM_ENABLE_SIMD_AVX2=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON
cmake --build ./build_avx2_ext --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx2_ext
@ -134,47 +134,47 @@ jobs:
cmake --build ./build_auto --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_auto
- name: Run with GLM_TEST_FORCE_PURE
- name: Run with GLM_FORCE_PURE
run: |
cmake -S. -B ./build_pure_std -DGLM_TEST_FORCE_PURE=ON -DGLM_TEST_ENABLE_CXX_${{matrix.std}}=ON
cmake -S. -B ./build_pure_std -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
cmake --build ./build_pure_std --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_pure_std
- name: Run with GLM_TEST_FORCE_PURE and language extensions
- name: Run with GLM_FORCE_PURE and language extensions
run: |
cmake -S. -B ./build_pure_ext -DGLM_TEST_FORCE_PURE=ON -DGLM_TEST_ENABLE_CXX_${{matrix.std}}=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON
cmake -S. -B ./build_pure_ext -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON
cmake --build ./build_pure_ext --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_pure_ext
- name: Run with GLM_TEST_ENABLE_SIMD_SSE2
- name: Run with GLM_ENABLE_SIMD_SSE2
run: |
cmake -S. -B ./build_sse2_std -DGLM_TEST_FORCE_PURE=ON -DGLM_TEST_ENABLE_CXX_${{matrix.std}}=ON
cmake -S. -B ./build_sse2_std -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
cmake --build ./build_sse2_std --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_sse2_std
- name: Run with GLM_TEST_ENABLE_SIMD_SSE2 and language extensions
- name: Run with GLM_ENABLE_SIMD_SSE2 and language extensions
run: |
cmake -S. -B ./build_sse2_ext -DGLM_TEST_ENABLE_SIMD_SSE2=ON -DGLM_TEST_ENABLE_CXX_${{matrix.std}}=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON
cmake -S. -B ./build_sse2_ext -DGLM_ENABLE_SIMD_SSE2=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON
cmake --build ./build_sse2_ext --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_sse2_ext
- name: Run with GLM_TEST_ENABLE_SIMD_AVX
- name: Run with GLM_ENABLE_SIMD_AVX
run: |
cmake -S. -B ./build_avx1_std -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_CXX_${{matrix.std}}=ON
cmake -S. -B ./build_avx1_std -DGLM_ENABLE_SIMD_AVX=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
cmake --build ./build_avx1_std --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx1_std
- name: Run with GLM_TEST_ENABLE_SIMD_AVX and language extensions
- name: Run with GLM_ENABLE_SIMD_AVX and language extensions
run: |
cmake -S. -B ./build_avx1_ext -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_CXX_${{matrix.std}}=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON
cmake -S. -B ./build_avx1_ext -DGLM_ENABLE_SIMD_AVX=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON
cmake --build ./build_avx1_ext --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx1_ext
- name: Run with GLM_TEST_ENABLE_SIMD_AVX2
- name: Run with GLM_ENABLE_SIMD_AVX2
run: |
cmake -S. -B ./build_avx2_std -DGLM_TEST_ENABLE_SIMD_AVX2=ON -DGLM_TEST_ENABLE_CXX_${{matrix.std}}=ON
cmake -S. -B ./build_avx2_std -DGLM_ENABLE_SIMD_AVX2=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
cmake --build ./build_avx2_std --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx2_std
- name: Run with GLM_TEST_ENABLE_SIMD_AVX2 and language extensions
- name: Run with GLM_ENABLE_SIMD_AVX2 and language extensions
run: |
cmake -S. -B ./build_avx2_ext -DGLM_TEST_ENABLE_SIMD_AVX2=ON -DGLM_TEST_ENABLE_CXX_${{matrix.std}}=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON
cmake -S. -B ./build_avx2_ext -DGLM_ENABLE_SIMD_AVX2=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON
cmake --build ./build_avx2_ext --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx2_ext
@ -210,38 +210,36 @@ jobs:
cmake --build ./build_auto --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_auto
- name: Run with GLM_TEST_FORCE_PURE
- name: Run with GLM_FORCE_PURE
run: |
cmake -S. -B ./build_pure_std -DGLM_TEST_FORCE_PURE=ON -DGLM_TEST_ENABLE_CXX_${{matrix.std}}=ON
cmake -S. -B ./build_pure_std -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
cmake --build ./build_pure_std --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_pure_std
- name: Run with GLM_TEST_FORCE_PURE and language extensions
- name: Run with GLM_FORCE_PURE and language extensions
run: |
cmake -S. -B ./build_pure_ext -DGLM_TEST_FORCE_PURE=ON -DGLM_TEST_ENABLE_CXX_${{matrix.std}}=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON
cmake -S. -B ./build_pure_ext -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON
cmake --build ./build_pure_ext --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_pure_ext
- name: Run with GLM_TEST_ENABLE_SIMD_SSE2
- name: Run with GLM_ENABLE_SIMD_SSE2
run: |
cmake -S. -B ./build_sse2_std -DGLM_TEST_FORCE_PURE=ON -DGLM_TEST_ENABLE_CXX_${{matrix.std}}=ON
cmake -S. -B ./build_sse2_std -DGLM_FORCE_PURE=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
cmake --build ./build_sse2_std --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_sse2_std
- name: Run with GLM_TEST_ENABLE_SIMD_SSE2 and language extensions
- name: Run with GLM_ENABLE_SIMD_SSE2 and language extensions
run: |
cmake -S. -B ./build_sse2_ext -DGLM_TEST_ENABLE_SIMD_SSE2=ON -DGLM_TEST_ENABLE_CXX_${{matrix.std}}=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON
cmake -S. -B ./build_sse2_ext -DGLM_ENABLE_SIMD_SSE2=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON
cmake --build ./build_sse2_ext --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_sse2_ext
- name: Run with GLM_TEST_ENABLE_SIMD_AVX
- name: Run with GLM_ENABLE_SIMD_AVX
run: |
cmake -S. -B ./build_avx1_std -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_CXX_${{matrix.std}}=ON
cmake -S. -B ./build_avx1_std -DGLM_ENABLE_SIMD_AVX=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON
cmake --build ./build_avx1_std --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx1_std
- name: Run with GLM_TEST_ENABLE_SIMD_AVX and language extensions
- name: Run with GLM_ENABLE_SIMD_AVX and language extensions
run: |
cmake -S. -B ./build_avx1_ext -DGLM_TEST_ENABLE_SIMD_AVX=ON -DGLM_TEST_ENABLE_CXX_${{matrix.std}}=ON -DGLM_TEST_ENABLE_LANG_EXTENSIONS=ON
cmake -S. -B ./build_avx1_ext -DGLM_ENABLE_SIMD_AVX=ON -DGLM_ENABLE_CXX_${{matrix.std}}=ON -DGLM_ENABLE_LANG_EXTENSIONS=ON
cmake --build ./build_avx1_ext --config ${{matrix.config}}
ctest --verbose -C ${{matrix.config}} --test-dir ./build_avx1_ext

View File

@ -1,7 +1,6 @@
cmake_minimum_required(VERSION 3.6 FATAL_ERROR)
cmake_policy(VERSION 3.6)
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}")
@ -27,6 +26,256 @@ option(GLM_BUILD_INSTALL "Generate the install target" ${GLM_IS_MASTER_PROJECT})
include(GNUInstallDirs)
option(GLM_ENABLE_CXX_98 "Enable C++ 98" OFF)
option(GLM_ENABLE_CXX_11 "Enable C++ 11" OFF)
option(GLM_ENABLE_CXX_14 "Enable C++ 14" OFF)
option(GLM_ENABLE_CXX_17 "Enable C++ 17" OFF)
option(GLM_ENABLE_CXX_20 "Enable C++ 20" OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(GLM_ENABLE_CXX_20)
set(CMAKE_CXX_STANDARD 20)
add_definitions(-DGLM_FORCE_CXX20)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
message(STATUS "GLM: Disable -Wc++98-compat warnings")
add_compile_options(-Wno-c++98-compat)
add_compile_options(-Wno-c++98-compat-pedantic)
endif()
if(NOT GLM_QUIET)
message(STATUS "GLM: Build with C++20 features")
endif()
elseif(GLM_ENABLE_CXX_17)
set(CMAKE_CXX_STANDARD 17)
add_definitions(-DGLM_FORCE_CXX17)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
message(STATUS "GLM: Disable -Wc++98-compat warnings")
add_compile_options(-Wno-c++98-compat)
add_compile_options(-Wno-c++98-compat-pedantic)
endif()
if(NOT GLM_QUIET)
message(STATUS "GLM: Build with C++17 features")
endif()
elseif(GLM_ENABLE_CXX_14)
set(CMAKE_CXX_STANDARD 14)
add_definitions(-DGLM_FORCE_CXX14)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
message(STATUS "GLM: Disable -Wc++98-compat warnings")
add_compile_options(-Wno-c++98-compat)
add_compile_options(-Wno-c++98-compat-pedantic)
endif()
if(NOT GLM_QUIET)
message(STATUS "GLM: Build with C++14 features")
endif()
elseif(GLM_ENABLE_CXX_11)
set(CMAKE_CXX_STANDARD 11)
add_definitions(-DGLM_FORCE_CXX11)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
message(STATUS "GLM: Disable -Wc++98-compat warnings")
add_compile_options(-Wno-c++98-compat)
add_compile_options(-Wno-c++98-compat-pedantic)
endif()
if(NOT GLM_QUIET)
message(STATUS "GLM: Build with C++11 features")
endif()
elseif(GLM_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_ENABLE_LANG_EXTENSIONS "Enable language extensions" OFF)
option(GLM_DISABLE_AUTO_DETECTION "Disable platform, compiler, arch and C++ language detection" 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_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_ENABLE_FAST_MATH "Enable fast math optimizations" OFF)
if(GLM_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_ENABLE_SIMD_SSE2 "Enable SSE2 optimizations" OFF)
option(GLM_ENABLE_SIMD_SSE3 "Enable SSE3 optimizations" OFF)
option(GLM_ENABLE_SIMD_SSSE3 "Enable SSSE3 optimizations" OFF)
option(GLM_ENABLE_SIMD_SSE4_1 "Enable SSE 4.1 optimizations" OFF)
option(GLM_ENABLE_SIMD_SSE4_2 "Enable SSE 4.2 optimizations" OFF)
option(GLM_ENABLE_SIMD_AVX "Enable AVX optimizations" OFF)
option(GLM_ENABLE_SIMD_AVX2 "Enable AVX2 optimizations" OFF)
option(GLM_FORCE_PURE "Force 'pure' instructions" OFF)
if(GLM_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_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_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_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_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_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_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_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()
if(NOT GLM_DISABLE_AUTO_DETECTION)
add_compile_options(-Werror -Weverything)
endif()
# 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 -Wno-float-equal)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
if(NOT GLM_QUIET)
message("GLM: GCC - ${CMAKE_CXX_COMPILER_ID} compiler")
endif()
if(NOT GLM_DISABLE_AUTO_DETECTION)
add_compile_options(-Werror)
# add_compile_options(-Wpedantic)
# add_compile_options(-Wall)
# add_compile_options(-Wextra)
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()
if(NOT GLM_DISABLE_AUTO_DETECTION)
add_compile_options(/W4 /WX)
endif()
# add_compile_options(/wd4309 /wd4324 /wd4389 /wd4127 /wd4267 /wd4146 /wd4201 /wd4464 /wd4514 /wd4701 /wd4820 /wd4365)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif()
add_subdirectory(glm)
if (GLM_BUILD_TESTS)

View File

@ -8,8 +8,8 @@ namespace detail
struct _swizzle_base0
{
protected:
GLM_FUNC_QUALIFIER T& elem(size_t i){ return (reinterpret_cast<T*>(_buffer))[i]; }
GLM_FUNC_QUALIFIER T const& elem(size_t i) const{ return (reinterpret_cast<const T*>(_buffer))[i]; }
GLM_FUNC_QUALIFIER T& elem(int i){ return (reinterpret_cast<T*>(_buffer))[i]; }
GLM_FUNC_QUALIFIER T const& elem(int i) const{ return (reinterpret_cast<const T*>(_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
@ -113,12 +113,12 @@ namespace detail
_apply_op(that, op_div());
}
GLM_FUNC_QUALIFIER T& operator[](size_t i)
GLM_FUNC_QUALIFIER T& operator[](int 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
GLM_FUNC_QUALIFIER T operator[](int i) const
{
const int offset_dst[4] = { E0, E1, E2, E3 };
return this->elem(offset_dst[i]);
@ -147,7 +147,7 @@ namespace detail
GLM_FUNC_QUALIFIER _swizzle_base2& operator= (Stub const&) { return *this; }
GLM_FUNC_QUALIFIER T operator[] (size_t i) const
GLM_FUNC_QUALIFIER T operator[] (int i) const
{
const int offset_dst[4] = { E0, E1, E2, E3 };
return this->elem(offset_dst[i]);

View File

@ -93,7 +93,7 @@ namespace detail
{
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<L, T, Q> call(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, bool, Q> const& a)
{
vec<L, T, Q> Result;
vec<L, T, Q> Result(0);
for(length_t i = 0; i < x.length(); ++i)
Result[i] = a[i] ? y[i] : x[i];
return Result;
@ -614,7 +614,7 @@ namespace detail
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isnan' only accept floating-point inputs");
vec<L, bool, Q> Result;
vec<L, bool, Q> Result(0);
for (length_t l = 0; l < v.length(); ++l)
Result[l] = glm::isnan(v[l]);
return Result;
@ -656,7 +656,7 @@ namespace detail
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isinf' only accept floating-point inputs");
vec<L, bool, Q> Result;
vec<L, bool, Q> Result(0);
for (length_t l = 0; l < v.length(); ++l)
Result[l] = glm::isinf(v[l]);
return Result;
@ -761,7 +761,7 @@ namespace detail
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'frexp' only accept floating-point inputs");
vec<L, T, Q> Result;
vec<L, T, Q> Result(0);
for (length_t l = 0; l < v.length(); ++l)
Result[l] = std::frexp(v[l], &exp[l]);
return Result;
@ -780,7 +780,7 @@ namespace detail
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'ldexp' only accept floating-point inputs");
vec<L, T, Q> Result;
vec<L, T, Q> Result(0);
for (length_t l = 0; l < v.length(); ++l)
Result[l] = std::ldexp(v[l], exp[l]);
return Result;

View File

@ -9,9 +9,11 @@
#if !GLM_HAS_EXTENDED_INTEGER_TYPE
# if GLM_COMPILER & GLM_COMPILER_GCC
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
# if (GLM_COMPILER & GLM_COMPILER_CLANG)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wc++11-long-long"
# endif
#endif
@ -274,6 +276,11 @@ namespace detail
return (Base & ~Mask) | ((Insert << static_cast<T>(Offset)) & Mask);
}
#if GLM_COMPILER & GLM_COMPILER_VC
# pragma warning(push)
# pragma warning(disable : 4309)
#endif
// bitfieldReverse
template<typename genIUType>
GLM_FUNC_QUALIFIER genIUType bitfieldReverse(genIUType x)
@ -298,6 +305,10 @@ namespace detail
return x;
}
# if GLM_COMPILER & GLM_COMPILER_VC
# pragma warning(pop)
# endif
// bitCount
template<typename genIUType>
GLM_FUNC_QUALIFIER int bitCount(genIUType x)
@ -366,6 +377,15 @@ namespace detail
}
}//namespace glm
#if !GLM_HAS_EXTENDED_INTEGER_TYPE
# if GLM_COMPILER & GLM_COMPILER_GCC
# pragma GCC diagnostic pop
# endif
# if (GLM_COMPILER & GLM_COMPILER_CLANG)
# pragma clang diagnostic pop
# endif
#endif
#if GLM_CONFIG_SIMD == GLM_ENABLE
# include "func_integer_simd.inl"
#endif

View File

@ -14,11 +14,11 @@ namespace detail
__m128i const set1 = _mm_set1_epi32(static_cast<int>(Mask));
__m128i const and1 = _mm_and_si128(set0, set1);
__m128i const sft1 = _mm_slli_epi32(and1, Shift);
__m128i const sft1 = _mm_slli_epi32(and1, static_cast<int>(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 sft2 = _mm_srai_epi32(and2, static_cast<int>(Shift));
__m128i const or0 = _mm_or_si128(sft1, sft2);
@ -35,7 +35,7 @@ namespace detail
__m128i const set1 = _mm_set1_epi32(static_cast<int>(Mask));
__m128i const and0 = _mm_and_si128(set0, set1);
__m128i const sft0 = _mm_slli_epi32(set0, Shift);
__m128i const sft0 = _mm_slli_epi32(set0, static_cast<int>(Shift));
__m128i const and1 = _mm_and_si128(sft0, set1);
__m128i const add0 = _mm_add_epi32(and0, and1);

View File

@ -9,7 +9,7 @@ namespace detail
{
GLM_FUNC_QUALIFIER static mat<C, R, T, Q> call(mat<C, R, T, Q> const& x, mat<C, R, T, Q> const& y)
{
mat<C, R, T, Q> Result;
mat<C, R, T, Q> Result(1);
for(length_t i = 0; i < Result.length(); ++i)
Result[i] = x[i] * y[i];
return Result;
@ -30,7 +30,7 @@ namespace detail
struct compute_outerProduct {
GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait<DA, DB, T, Q>::type call(vec<DA, T, Q> const& c, vec<DB, T, Q> const& r)
{
typename detail::outerProduct_trait<DA, DB, T, Q>::type m;
typename detail::outerProduct_trait<DA, DB, T, Q>::type m(0);
for(length_t i = 0; i < m.length(); ++i)
m[i] = c * r[i];
return m;
@ -56,7 +56,7 @@ namespace detail
{
GLM_FUNC_QUALIFIER static mat<2, 2, T, Q> call(mat<2, 2, T, Q> const& m)
{
mat<2, 2, T, Q> Result;
mat<2, 2, T, Q> Result(1);
Result[0][0] = m[0][0];
Result[0][1] = m[1][0];
Result[1][0] = m[0][1];
@ -70,7 +70,7 @@ namespace detail
{
GLM_FUNC_QUALIFIER static mat<3, 2, T, Q> call(mat<2, 3, T, Q> const& m)
{
mat<3,2, T, Q> Result;
mat<3,2, T, Q> Result(1);
Result[0][0] = m[0][0];
Result[0][1] = m[1][0];
Result[1][0] = m[0][1];
@ -86,7 +86,7 @@ namespace detail
{
GLM_FUNC_QUALIFIER static mat<4, 2, T, Q> call(mat<2, 4, T, Q> const& m)
{
mat<4, 2, T, Q> Result;
mat<4, 2, T, Q> Result(1);
Result[0][0] = m[0][0];
Result[0][1] = m[1][0];
Result[1][0] = m[0][1];
@ -104,7 +104,7 @@ namespace detail
{
GLM_FUNC_QUALIFIER static mat<2, 3, T, Q> call(mat<3, 2, T, Q> const& m)
{
mat<2, 3, T, Q> Result;
mat<2, 3, T, Q> Result(1);
Result[0][0] = m[0][0];
Result[0][1] = m[1][0];
Result[0][2] = m[2][0];
@ -120,7 +120,7 @@ namespace detail
{
GLM_FUNC_QUALIFIER static mat<3, 3, T, Q> call(mat<3, 3, T, Q> const& m)
{
mat<3, 3, T, Q> Result;
mat<3, 3, T, Q> Result(1);
Result[0][0] = m[0][0];
Result[0][1] = m[1][0];
Result[0][2] = m[2][0];
@ -141,7 +141,7 @@ namespace detail
{
GLM_FUNC_QUALIFIER static mat<4, 3, T, Q> call(mat<3, 4, T, Q> const& m)
{
mat<4, 3, T, Q> Result;
mat<4, 3, T, Q> Result(1);
Result[0][0] = m[0][0];
Result[0][1] = m[1][0];
Result[0][2] = m[2][0];
@ -163,7 +163,7 @@ namespace detail
{
GLM_FUNC_QUALIFIER static mat<2, 4, T, Q> call(mat<4, 2, T, Q> const& m)
{
mat<2, 4, T, Q> Result;
mat<2, 4, T, Q> Result(1);
Result[0][0] = m[0][0];
Result[0][1] = m[1][0];
Result[0][2] = m[2][0];
@ -181,7 +181,7 @@ namespace detail
{
GLM_FUNC_QUALIFIER static mat<3, 4, T, Q> call(mat<4, 3, T, Q> const& m)
{
mat<3, 4, T, Q> Result;
mat<3, 4, T, Q> Result(1);
Result[0][0] = m[0][0];
Result[0][1] = m[1][0];
Result[0][2] = m[2][0];
@ -203,7 +203,7 @@ namespace detail
{
GLM_FUNC_QUALIFIER static mat<4, 4, T, Q> call(mat<4, 4, T, Q> const& m)
{
mat<4, 4, T, Q> Result;
mat<4, 4, T, Q> Result(1);
Result[0][0] = m[0][0];
Result[0][1] = m[1][0];
Result[0][2] = m[2][0];

View File

@ -877,10 +877,10 @@ namespace detail
///////////////////////////////////////////////////////////////////////////////////
// Silent warnings
#ifdef GLM_FORCE_SILENT_WARNINGS
# define GLM_SILENT_WARNINGS GLM_ENABLE
#else
#ifdef GLM_FORCE_WARNINGS
# define GLM_SILENT_WARNINGS GLM_DISABLE
#else
# define GLM_SILENT_WARNINGS GLM_ENABLE
#endif
///////////////////////////////////////////////////////////////////////////////////

View File

@ -15,16 +15,6 @@
namespace glm
{
template<typename T, qualifier Q>
struct qua
{
// -- Implementation detail --
typedef qua<T, Q> type;
typedef T value_type;
// -- Data --
# if GLM_SILENT_WARNINGS == GLM_ENABLE
# if GLM_COMPILER & GLM_COMPILER_GCC
# pragma GCC diagnostic push
@ -39,6 +29,16 @@ namespace glm
# endif
# endif
template<typename T, qualifier Q>
struct qua
{
// -- Implementation detail --
typedef qua<T, Q> type;
typedef T value_type;
// -- Data --
# if GLM_LANG & GLM_LANG_CXXMS_FLAG
union
{
@ -56,16 +56,6 @@ namespace glm
# else
T x, y, z, w;
# 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 --
@ -139,6 +129,16 @@ namespace glm
GLM_FUNC_DECL GLM_CONSTEXPR qua<T, Q>& operator/=(U s);
};
# 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
// -- Unary bit operators --
template<typename T, qualifier Q>

View File

@ -10,9 +10,13 @@
#include <cmath>
#include <cfloat>
#if(GLM_COMPILER & GLM_COMPILER_VC)
#if GLM_COMPILER & GLM_COMPILER_VC
# pragma warning(push)
# pragma warning(disable : 4127)
#elif GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wsign-conversion"
# pragma clang diagnostic ignored "-Wpadded"
#endif
typedef union
@ -44,13 +48,13 @@ typedef union
do { \
ieee_float_shape_type gf_u; \
gf_u.value = (d); \
(i) = gf_u.word; \
(i) = static_cast<int>(gf_u.word); \
} while (0)
#define GLM_SET_FLOAT_WORD(d,i) \
do { \
ieee_float_shape_type sf_u; \
sf_u.word = (i); \
sf_u.word = static_cast<unsigned int>(i); \
(d) = sf_u.value; \
} while (0)
@ -182,8 +186,10 @@ namespace detail
}//namespace detail
}//namespace glm
#if(GLM_COMPILER & GLM_COMPILER_VC)
#if GLM_COMPILER & GLM_COMPILER_VC
# pragma warning(pop)
#elif GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic pop
#endif
namespace glm

View File

@ -3,7 +3,7 @@ namespace glm
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> nextFloat(vec<L, T, Q> const& x)
{
vec<L, T, Q> Result;
vec<L, T, Q> Result(0);
for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = nextFloat(x[i]);
return Result;
@ -12,7 +12,7 @@ namespace glm
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> nextFloat(vec<L, T, Q> const& x, int ULPs)
{
vec<L, T, Q> Result;
vec<L, T, Q> Result(0);
for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = nextFloat(x[i], ULPs);
return Result;
@ -21,7 +21,7 @@ namespace glm
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> nextFloat(vec<L, T, Q> const& x, vec<L, int, Q> const& ULPs)
{
vec<L, T, Q> Result;
vec<L, T, Q> Result(0);
for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = nextFloat(x[i], ULPs[i]);
return Result;
@ -30,7 +30,7 @@ namespace glm
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> prevFloat(vec<L, T, Q> const& x)
{
vec<L, T, Q> Result;
vec<L, T, Q> Result(0);
for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = prevFloat(x[i]);
return Result;
@ -39,7 +39,7 @@ namespace glm
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> prevFloat(vec<L, T, Q> const& x, int ULPs)
{
vec<L, T, Q> Result;
vec<L, T, Q> Result(0);
for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = prevFloat(x[i], ULPs);
return Result;
@ -48,7 +48,7 @@ namespace glm
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> prevFloat(vec<L, T, Q> const& x, vec<L, int, Q> const& ULPs)
{
vec<L, T, Q> Result;
vec<L, T, Q> Result(0);
for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = prevFloat(x[i], ULPs[i]);
return Result;
@ -57,7 +57,7 @@ namespace glm
template<length_t L, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, int, Q> floatDistance(vec<L, float, Q> const& x, vec<L, float, Q> const& y)
{
vec<L, int, Q> Result;
vec<L, int, Q> Result(0);
for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = floatDistance(x[i], y[i]);
return Result;
@ -66,7 +66,7 @@ namespace glm
template<length_t L, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, int64, Q> floatDistance(vec<L, double, Q> const& x, vec<L, double, Q> const& y)
{
vec<L, int64, Q> Result;
vec<L, int64, Q> Result(0);
for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = floatDistance(x[i], y[i]);
return Result;

View File

@ -221,6 +221,11 @@ namespace detail
}
}//namespace detail
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wsign-compare"
#endif
template<typename genIUType>
GLM_FUNC_QUALIFIER genIUType mask(genIUType Bits)
{
@ -229,6 +234,10 @@ namespace detail
return Bits >= sizeof(genIUType) * 8 ? ~static_cast<genIUType>(0) : (static_cast<genIUType>(1) << Bits) - static_cast<genIUType>(1);
}
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic pop
#endif
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> mask(vec<L, T, Q> const& v)
{

View File

@ -179,9 +179,16 @@ namespace detail
// return ((floatTo11bit(x) & ((1 << 11) - 1)) << 0) | ((floatTo11bit(y) & ((1 << 11) - 1)) << 11) | ((floatTo10bit(z) & ((1 << 10) - 1)) << 22);
// }
#if GLM_SILENT_WARNINGS == GLM_ENABLE
# if defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wpadded"
# endif
#endif
union u3u3u2
{
struct
struct Data
{
uint x : 3;
uint y : 3;
@ -192,7 +199,7 @@ namespace detail
union u4u4
{
struct
struct Data
{
uint x : 4;
uint y : 4;
@ -202,7 +209,7 @@ namespace detail
union u4u4u4u4
{
struct
struct Data
{
uint x : 4;
uint y : 4;
@ -214,7 +221,7 @@ namespace detail
union u5u6u5
{
struct
struct Data
{
uint x : 5;
uint y : 6;
@ -225,7 +232,7 @@ namespace detail
union u5u5u5u1
{
struct
struct Data
{
uint x : 5;
uint y : 5;
@ -235,9 +242,15 @@ namespace detail
uint16 pack;
};
#if GLM_SILENT_WARNINGS == GLM_ENABLE
# if defined(__clang__)
# pragma clang diagnostic pop
# endif
#endif
union u10u10u10u2
{
struct
struct Data
{
uint x : 10;
uint y : 10;
@ -249,7 +262,7 @@ namespace detail
union i10i10i10i2
{
struct
struct Data
{
int x : 10;
int y : 10;
@ -261,7 +274,7 @@ namespace detail
union u9u9u9e5
{
struct
struct Data
{
uint x : 9;
uint y : 9;
@ -347,7 +360,7 @@ namespace detail
{
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));
return vec<4, float, Q>(detail::toFloat32(Unpack.x), detail::toFloat32(Unpack.y), detail::toFloat32(Unpack.z), detail::toFloat32(Unpack.w));
}
};
}//namespace detail

View File

@ -16,13 +16,11 @@
// 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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_associated_min_max extension included")
#endif
#endif
namespace glm
{

View File

@ -15,13 +15,11 @@
// 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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_bit extension included")
#endif
#endif
namespace glm
{

View File

@ -15,13 +15,11 @@
// 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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_closest_point extension included")
#endif
#endif
namespace glm
{

View File

@ -19,13 +19,11 @@
#include "../vec3.hpp"
#include <limits>
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTC_color_encoding extension included")
#endif
#endif
namespace glm
{

View File

@ -15,13 +15,11 @@
// 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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_color_space extension included")
#endif
#endif
namespace glm
{

View File

@ -1,5 +1,7 @@
/// @ref gtx_color_space
#include <glm/ext/scalar_relational.hpp>
namespace glm
{
template<typename T, qualifier Q>
@ -8,7 +10,7 @@ namespace glm
vec<3, T, Q> hsv = hsvColor;
vec<3, T, Q> rgbColor;
if(hsv.y == static_cast<T>(0))
if(equal(hsv.y, static_cast<T>(0), epsilon<T>()))
// achromatic (grey)
rgbColor = vec<3, T, Q>(hsv.z);
else
@ -69,15 +71,15 @@ namespace glm
hsv.z = Max;
if(Max != static_cast<T>(0))
if(!equal(Max, static_cast<T>(0), epsilon<T>()))
{
hsv.y = Delta / hsv.z;
T h = static_cast<T>(0);
if(rgbColor.r == Max)
if(equal(rgbColor.r, Max, epsilon<T>()))
// between yellow & magenta
h = static_cast<T>(0) + T(60) * (rgbColor.g - rgbColor.b) / Delta;
else if(rgbColor.g == Max)
else if(equal(rgbColor.g, Max, epsilon<T>()))
// between cyan & yellow
h = static_cast<T>(120) + T(60) * (rgbColor.b - rgbColor.r) / Delta;
else

View File

@ -15,13 +15,11 @@
// 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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_color_space_YCoCg extension included")
#endif
#endif
namespace glm
{

View File

@ -18,13 +18,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_common extension included")
#endif
#endif
namespace glm
{

View File

@ -16,13 +16,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_compatibility extension included")
#endif
#endif
#if GLM_COMPILER & GLM_COMPILER_VC
# include <cfloat>

View File

@ -18,13 +18,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_component_wise extension included")
#endif
#endif
namespace glm
{

View File

@ -20,13 +20,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_dual_quaternion extension included")
#endif
#endif
namespace glm
{

View File

@ -21,13 +21,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_easing extension included")
#endif
#endif
namespace glm{
/// @addtogroup gtx_easing

View File

@ -18,13 +18,11 @@
// 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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_euler_angles extension included")
#endif
#endif
namespace glm
{

View File

@ -15,13 +15,11 @@
// 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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_extend extension included")
#endif
#endif
namespace glm
{

View File

@ -16,13 +16,11 @@
#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_extended_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
# error "GLM: GLM_GTX_extended_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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_extended_min_max extension included")
#endif
#endif
namespace glm
{

View File

@ -17,13 +17,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_exterior_product extension included")
#endif
#endif
namespace glm
{

View File

@ -16,13 +16,11 @@
// 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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_fast_exponential extension included")
#endif
#endif
namespace glm
{

View File

@ -19,13 +19,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_fast_square_root extension included")
#endif
#endif
namespace glm
{

View File

@ -15,13 +15,11 @@
// 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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_fast_trigonometry extension included")
#endif
#endif
namespace glm
{

View File

@ -18,13 +18,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_functions extension included")
#endif
#endif
namespace glm
{

View File

@ -17,13 +17,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_gradient_paint extension included")
#endif
#endif
namespace glm
{

View File

@ -15,13 +15,11 @@
// 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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_handed_coordinate_space extension included")
#endif
#endif
namespace glm
{

View File

@ -16,13 +16,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_integer extension included")
#endif
#endif
namespace glm
{

View File

@ -141,13 +141,13 @@ namespace detail
return x - y * (x / y);
}
#if(GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_GCC))
//#if(GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_GCC))
GLM_FUNC_QUALIFIER unsigned int nlz(unsigned int x)
{
return 31u - findMSB(x);
return 31u - static_cast<unsigned int>(findMSB(x));
}
/*
#else
// Hackers Delight: http://www.hackersdelight.org/HDcode/nlz.c.txt
@ -181,5 +181,5 @@ namespace detail
}
#endif//(GLM_COMPILER)
*/
}//namespace glm

View File

@ -21,13 +21,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_closest_point extension included")
#endif
#endif
namespace glm
{

View File

@ -23,12 +23,17 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_io extension included")
#endif
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wpadded"
# pragma clang diagnostic ignored "-Wshorten-64-to-32"
# pragma clang diagnostic ignored "-Wglobal-constructors"
#endif
#include <iosfwd> // std::basic_ostream<> (fwd)
@ -198,4 +203,8 @@ namespace glm
/// @}
}//namespace glm
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic pop
#endif
#include "io.inl"

View File

@ -6,6 +6,13 @@
#include "../gtc/matrix_access.hpp" // glm::col, glm::row
#include "../gtx/type_trait.hpp" // glm::type<>
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wpadded"
# pragma clang diagnostic ignored "-Wshorten-64-to-32"
# pragma clang diagnostic ignored "-Wglobal-constructors"
#endif
namespace glm{
namespace io
{
@ -167,11 +174,11 @@ namespace detail
{
io::basic_state_saver<CTy> const bss(os);
os << std::fixed << std::right << std::setprecision(fmt.precision) << std::setfill(fmt.space) << fmt.delim_left;
os << std::fixed << std::right << std::setprecision(static_cast<std::streamsize>(fmt.precision)) << std::setfill(fmt.space) << fmt.delim_left;
for(length_t i(0); i < components; ++i)
{
os << std::setw(fmt.width) << a[i];
os << std::setw(static_cast<int>(fmt.width)) << a[i];
if(components-1 != i)
os << fmt.separator;
}
@ -438,3 +445,8 @@ namespace detail
return detail::print_matrix_pair_on(os, a);
}
}//namespace glm
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic pop
#endif

View File

@ -15,13 +15,11 @@
// 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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_log_base extension included")
#endif
#endif
namespace glm
{

View File

@ -16,13 +16,11 @@
// 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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_matrix_cross_product extension included")
#endif
#endif
namespace glm
{

View File

@ -20,13 +20,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_matrix_decompose extension included")
#endif
#endif
namespace glm
{

View File

@ -15,13 +15,11 @@
// 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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_matrix_factorisation extension included")
#endif
#endif
/*
Suggestions:

View File

@ -16,13 +16,11 @@
// 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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_matrix_interpolation extension included")
#endif
#endif
namespace glm
{

View File

@ -16,13 +16,11 @@
// 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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_matrix_major_storage extension included")
#endif
#endif
namespace glm
{

View File

@ -15,13 +15,11 @@
// 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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_matrix_operation extension included")
#endif
#endif
namespace glm
{

View File

@ -18,13 +18,11 @@
#include "../gtx/vector_query.hpp"
#include <limits>
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_matrix_query extension included")
#endif
#endif
namespace glm
{

View File

@ -17,13 +17,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_matrix_transform_2d extension included")
#endif
#endif
namespace glm
{

View File

@ -15,13 +15,11 @@
// 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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_mixed_product extension included")
#endif
#endif
namespace glm
{

View File

@ -19,13 +19,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_norm extension included")
#endif
#endif
namespace glm
{

View File

@ -16,13 +16,11 @@
// 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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_normal extension included")
#endif
#endif
namespace glm
{

View File

@ -16,13 +16,11 @@
// 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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_normalize_dot extension included")
#endif
#endif
namespace glm
{

View File

@ -18,13 +18,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_number_precision extension included")
#endif
#endif
namespace glm{
/////////////////////////////

View File

@ -15,13 +15,11 @@
// 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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_optimum_pow extension included")
#endif
#endif
namespace glm
{

View File

@ -18,13 +18,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_orthonormalize extension included")
#endif
#endif
namespace glm
{

View File

@ -42,14 +42,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_pca extension included")
#endif
#endif
namespace glm {
/// @addtogroup gtx_pca

View File

@ -17,13 +17,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_perpendicular extension included")
#endif
#endif
namespace glm
{

View File

@ -15,13 +15,11 @@
// 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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_polar_coordinates extension included")
#endif
#endif
namespace glm
{

View File

@ -15,13 +15,11 @@
// 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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_projection extension included")
#endif
#endif
namespace glm
{

View File

@ -20,13 +20,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_quaternion extension included")
#endif
#endif
namespace glm
{

View File

@ -15,13 +15,11 @@
// 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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_range extension included")
#endif
#endif
#include "../gtc/type_ptr.hpp"
#include "../gtc/vec1.hpp"

View File

@ -16,13 +16,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_raw_data extension included")
#endif
#endif
namespace glm
{

View File

@ -19,13 +19,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_rotate_normalized_axis extension included")
#endif
#endif
namespace glm
{

View File

@ -19,13 +19,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_rotate_vector extension included")
#endif
#endif
namespace glm
{

View File

@ -19,13 +19,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_scalar_multiplication extension included")
#endif
#endif
#include "../vec2.hpp"
#include "../vec3.hpp"

View File

@ -15,12 +15,10 @@
// 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
# error "GLM: GLM_GTX_scalar_relational 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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_scalar_relational extension included")
#endif
namespace glm

View File

@ -16,13 +16,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_spline extension included")
#endif
#endif
namespace glm
{

View File

@ -17,13 +17,11 @@
#include "../glm.hpp"
#include <cstdlib>
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_std_based_type extension included")
#endif
#endif
namespace glm
{

View File

@ -21,14 +21,13 @@
#include "../gtx/dual_quaternion.hpp"
#include <string>
#include <cmath>
#include <cstring>
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_string_cast extension included")
#endif
#endif
namespace glm
{

View File

@ -18,24 +18,29 @@ namespace detail
typedef double value_type;
};
GLM_FUNC_QUALIFIER std::string format(const char* msg, ...)
{
GLM_FUNC_QUALIFIER std::string format(const char* message, ...) {
std::size_t const STRING_BUFFER(4096);
char text[STRING_BUFFER];
assert(message != NULL);
assert(strlen(message) >= 0 && strlen(message) < STRING_BUFFER);
char buffer[STRING_BUFFER];
va_list list;
if(msg == GLM_NULLPTR)
return std::string();
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wformat-nonliteral"
#endif
va_start(list, msg);
# if (GLM_COMPILER & GLM_COMPILER_VC)
vsprintf_s(text, STRING_BUFFER, msg, list);
# else//
std::vsnprintf(text, STRING_BUFFER, msg, list);
# endif//
va_start(list, message);
vsnprintf(buffer, STRING_BUFFER, message, list);
va_end(list);
return std::string(text);
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic pop
#endif
return buffer;
}
static const char* LabelTrue = "true";

View File

@ -17,13 +17,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_texture extension included")
#endif
#endif
namespace glm
{

View File

@ -19,13 +19,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_transform extension included")
#endif
#endif
namespace glm
{

View File

@ -17,13 +17,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_transform2 extension included")
#endif
#endif
namespace glm
{

View File

@ -17,13 +17,11 @@
#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
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_type_aligned extension included")
#endif
#endif
namespace glm
{

View File

@ -12,13 +12,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_type_trait extension included")
#endif
#endif
// Dependency:
#include "../detail/qualifier.hpp"

View File

@ -14,13 +14,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_vec_swizzle extension included")
#endif
#endif
namespace glm {
/// @addtogroup gtx_vec_swizzle

View File

@ -20,13 +20,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_vector_angle extension included")
#endif
#endif
namespace glm
{

View File

@ -17,13 +17,11 @@
#include <cfloat>
#include <limits>
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_vector_query extension included")
#endif
#endif
namespace glm
{

View File

@ -18,13 +18,11 @@
#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
# error "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."
#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
# pragma message("GLM: GLM_GTX_wrap extension included")
#endif
#endif
namespace glm
{

View File

@ -1,231 +1,7 @@
option(GLM_QUIET "No CMake Message" OFF)
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_CXX20)
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 "Disable platform, compiler, arch and C++ language detection" 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_PERF_TEST_ENABLE "Build perf tests" OFF)
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()
if(NOT GLM_DISABLE_AUTO_DETECTION)
add_compile_options(-Werror -Weverything)
endif()
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 -Wno-float-equal)
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()
if(NOT GLM_DISABLE_AUTO_DETECTION)
add_compile_options(/W4 /WX)
endif()
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})

View File

@ -14,11 +14,28 @@ struct vec2
x(0), y(0)
{}
#if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union
#endif
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
# pragma clang diagnostic ignored "-Wnested-anon-types"
#endif
union
{
struct { float x, y; };
struct { _swizzle xx; };
};
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic pop
#endif
#if defined(_MSC_VER)
# pragma warning(pop)
#endif
};
#endif

View File

@ -2,11 +2,8 @@ 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)
@ -45,7 +42,9 @@ glmCreateTestGTC(core_func_packing)
glmCreateTestGTC(core_func_trigonometric)
glmCreateTestGTC(core_func_vector_relational)
glmCreateTestGTC(core_func_swizzle)
glmCreateTestGTC(core_setup_force_cxx_unknown)
glmCreateTestGTC(core_setup_force_cxx98)
glmCreateTestGTC(core_setup_force_cxx03)
glmCreateTestGTC(core_setup_force_size_t_length)
glmCreateTestGTC(core_setup_message)
glmCreateTestGTC(core_setup_platform_unknown)

View File

@ -2,9 +2,32 @@
# define GLM_FORCE_COMPILER_UNKNOWN
#endif
#if defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
# pragma clang diagnostic ignored "-Wnested-anon-types"
# pragma clang diagnostic ignored "-Wsign-conversion"
# pragma clang diagnostic ignored "-Wpadded"
# pragma clang diagnostic ignored "-Wc++11-long-long"
#elif defined(__GNUC__)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wpedantic"
#elif defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union
#endif
#include <glm/glm.hpp>
#include <glm/ext.hpp>
#if defined(__clang__)
# pragma clang diagnostic pop
#elif defined(__GNUC__)
# pragma GCC diagnostic pop
#elif defined(_MSC_VER)
# pragma warning(pop)
#endif
int main()
{
int Error = 0;

View File

@ -1,14 +0,0 @@
#ifndef GLM_FORCE_CXX03
# define GLM_FORCE_CXX03
#endif
#include <glm/glm.hpp>
#include <glm/ext.hpp>
int main()
{
int Error = 0;
return Error;
}

View File

@ -1,14 +0,0 @@
#ifndef GLM_FORCE_CXX98
# define GLM_FORCE_CXX98
#endif
#include <glm/glm.hpp>
#include <glm/ext.hpp>
int main()
{
int Error = 0;
return Error;
}

View File

@ -3,6 +3,7 @@
#endif//GLM_FORCE_PURE
#define GLM_FORCE_DEFAULT_ALIGNED_GENTYPES
#define GLM_FORCE_SWIZZLE
#include <glm/ext/scalar_constants.hpp>
#include <glm/ext/vector_relational.hpp>
#include <glm/vector_relational.hpp>
#include <glm/vec2.hpp>
@ -35,18 +36,28 @@ static int test_vec4_ctor()
#if GLM_HAS_INITIALIZER_LISTS
{
glm::vec4 a{ 0, 1, 2, 3 };
Error += glm::all(glm::equal(a, glm::vec4(0, 1, 2, 3), glm::epsilon<float>())) ? 0 : 1;
std::vector<glm::vec4> v = {
{0, 1, 2, 3},
{4, 5, 6, 7},
{8, 9, 0, 1}};
Error += glm::all(glm::equal(v[0], glm::vec4(0, 1, 2, 3), glm::epsilon<float>())) ? 0 : 1;
Error += glm::all(glm::equal(v[1], glm::vec4(4, 5, 6, 7), glm::epsilon<float>())) ? 0 : 1;
Error += glm::all(glm::equal(v[2], glm::vec4(8, 9, 0, 1), glm::epsilon<float>())) ? 0 : 1;
}
{
glm::dvec4 a{ 0, 1, 2, 3 };
Error += glm::all(glm::equal(a, glm::dvec4(0, 1, 2, 3), glm::epsilon<double>())) ? 0 : 1;
std::vector<glm::dvec4> v = {
{0, 1, 2, 3},
{4, 5, 6, 7},
{8, 9, 0, 1}};
Error += glm::all(glm::equal(v[0], glm::dvec4(0, 1, 2, 3), glm::epsilon<double>())) ? 0 : 1;
Error += glm::all(glm::equal(v[1], glm::dvec4(4, 5, 6, 7), glm::epsilon<double>())) ? 0 : 1;
Error += glm::all(glm::equal(v[2], glm::dvec4(8, 9, 0, 1), glm::epsilon<double>())) ? 0 : 1;
}
#endif
@ -141,19 +152,19 @@ 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;
glm::bvec4 A(true);
glm::bvec4 B(true);
glm::bvec4 C(false);
glm::bvec4 D = A && B;
glm::bvec4 E = A && C;
glm::bvec4 F = A || C;
Error += D == glm::bvec4(true) ? 0 : 1;
Error += E == glm::bvec4(false) ? 0 : 1;
Error += F == glm::bvec4(true) ? 0 : 1;
Error += (D == A) ? 0 : 1;
Error += (E == C) ? 0 : 1;
Error += (F == A) ? 0 : 1;
bool const G = A == C;
bool const H = A != C;
bool G = A == C;
bool H = A != C;
Error += !G ? 0 : 1;
Error += H ? 0 : 1;
@ -302,17 +313,15 @@ 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::uvec4 A(1, 2, 3, 4);
Error += (A == glm::uvec4(1, 2, 3, 4)) ? 0 : 1;
Error += (A != glm::uvec4(1, 2, 3, 4)) ? 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;
glm::ivec4 A(1, 2, 3, 4);
Error += (A == glm::ivec4(1, 2, 3, 4)) ? 0 : 1;
Error += (A != glm::ivec4(1, 2, 3, 4)) ? 1 : 0;
}
return Error;

View File

@ -12,25 +12,25 @@ static int test_comp()
int Error = 0;
{
glm::ivec1 const A(1);
glm::ivec1 A(1);
Error += A.x == 1 ? 0 : 1;
}
{
glm::ivec2 const A(1, 2);
glm::ivec2 A(1, 2);
Error += A.x == 1 ? 0 : 1;
Error += A.y == 2 ? 0 : 1;
}
{
glm::ivec3 const A(1, 2, 3);
glm::ivec3 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);
glm::ivec4 A(1, 2, 3, 4);
Error += A.x == 1 ? 0 : 1;
Error += A.y == 2 ? 0 : 1;
Error += A.z == 3 ? 0 : 1;

View File

@ -16,6 +16,7 @@
// This file has divisions by zero to test isnan
#if GLM_COMPILER & GLM_COMPILER_VC
# pragma warning(push)
# pragma warning(disable : 4723)
#endif
@ -297,12 +298,12 @@ namespace min_
return Error;
}
int min_tern(int a, int b)
static int min_tern(int a, int b)
{
return a < b ? a : b;
}
int min_int(int x, int y)
static int min_int(int x, int y)
{
return y ^ ((x ^ y) & -(x < y));
}
@ -396,6 +397,11 @@ namespace clamp_
namespace mix_
{
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wpadded"
#endif
template<typename T, typename B>
struct entry
{
@ -405,7 +411,16 @@ namespace mix_
T Result;
};
entry<float, bool> const TestBool[] =
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic pop
#endif
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wglobal-constructors"
#endif
static entry<float, bool> const TestBool[] =
{
{0.0f, 1.0f, false, 0.0f},
{0.0f, 1.0f, true, 1.0f},
@ -413,7 +428,7 @@ namespace mix_
{-1.0f, 1.0f, true, 1.0f}
};
entry<float, float> const TestFloat[] =
static entry<float, float> const TestFloat[] =
{
{0.0f, 1.0f, 0.0f, 0.0f},
{0.0f, 1.0f, 1.0f, 1.0f},
@ -421,7 +436,7 @@ namespace mix_
{-1.0f, 1.0f, 1.0f, 1.0f}
};
entry<glm::vec2, bool> const TestVec2Bool[] =
static entry<glm::vec2, bool> 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)},
@ -429,7 +444,7 @@ namespace mix_
{glm::vec2(-1.0f), glm::vec2(1.0f), true, glm::vec2(1.0f)}
};
entry<glm::vec2, glm::bvec2> const TestBVec2[] =
static entry<glm::vec2, glm::bvec2> 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)},
@ -438,7 +453,7 @@ namespace mix_
{glm::vec2(-1.0f), glm::vec2(1.0f), glm::bvec2(true, false), glm::vec2(1.0f, -1.0f)}
};
entry<glm::vec3, bool> const TestVec3Bool[] =
static entry<glm::vec3, bool> 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)},
@ -446,7 +461,7 @@ namespace mix_
{glm::vec3(-1.0f), glm::vec3(1.0f), true, glm::vec3(1.0f)}
};
entry<glm::vec3, glm::bvec3> const TestBVec3[] =
static entry<glm::vec3, glm::bvec3> 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)},
@ -455,7 +470,7 @@ namespace mix_
{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<glm::vec4, bool> const TestVec4Bool[] =
static entry<glm::vec4, bool> 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)},
@ -463,7 +478,7 @@ namespace mix_
{glm::vec4(-1.0f), glm::vec4(1.0f), true, glm::vec4(1.0f)}
};
entry<glm::vec4, glm::bvec4> const TestBVec4[] =
static entry<glm::vec4, glm::bvec4> 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)},
@ -472,6 +487,10 @@ namespace mix_
{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)}
};
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic pop
#endif
static int test()
{
int Error = 0;
@ -574,14 +593,19 @@ namespace step_
VEC result;
};
entry<float, glm::vec4> TestVec4Scalar [] =
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wglobal-constructors"
#endif
static const entry<float, glm::vec4> 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<glm::vec4, glm::vec4> TestVec4Vector [] =
static const entry<glm::vec4, glm::vec4> 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) },
@ -589,6 +613,10 @@ namespace step_
{ glm::vec4( 0.0f, 1.0f, 2.0f, 3.0f), glm::vec4(-1.0f,-2.0f,-3.0f,-4.0f), glm::vec4(0.0f) }
};
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic pop
#endif
static int test()
{
int Error = 0;
@ -900,6 +928,11 @@ namespace sign
return result;
}
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wsign-conversion"
#endif
template<typename genFIType>
GLM_FUNC_QUALIFIER genFIType sign_alu1(genFIType x)
{
@ -910,6 +943,10 @@ namespace sign
return (x >> 31) | (static_cast<unsigned>(-x) >> 31);
}
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic pop
#endif
GLM_FUNC_QUALIFIER int sign_alu2(int x)
{
GLM_STATIC_ASSERT(std::numeric_limits<int>::is_signed && std::numeric_limits<int>::is_integer, "'sign' only accept integer inputs");
@ -953,7 +990,7 @@ namespace sign
genType Return;
};
int test_int32()
static int test_int32()
{
type<glm::int32> const Data[] =
{
@ -1003,7 +1040,7 @@ namespace sign
return Error;
}
int test_i32vec4()
static int test_i32vec4()
{
type<glm::ivec4> const Data[] =
{
@ -1027,7 +1064,7 @@ namespace sign
return Error;
}
int test_f32vec4()
static int test_f32vec4()
{
type<glm::vec4> const Data[] =
{
@ -1062,7 +1099,7 @@ namespace sign
return Error;
}
int perf_rand(std::size_t Samples)
static int perf_rand(std::size_t Samples)
{
int Error = 0;
@ -1115,7 +1152,7 @@ namespace sign
return Error;
}
int perf_linear(std::size_t Samples)
static int perf_linear(std::size_t Samples)
{
int Error = 0;
@ -1162,7 +1199,7 @@ namespace sign
return Error;
}
int perf_linear_cal(std::size_t Samples)
static int perf_linear_cal(std::size_t Samples)
{
int Error = 0;
@ -1265,7 +1302,7 @@ namespace ldexp_
{
static int test()
{
int Error(0);
int Error = 0;
{
glm::vec1 A = glm::vec1(0.5);
@ -1307,6 +1344,11 @@ static int test_constexpr()
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));
static_assert(glm::all(glm::equal(A, glm::vec1(1.0f), glm::epsilon<float>())), "GLM: Failed constexpr");
static_assert(glm::all(glm::equal(B, glm::vec2(1.0f), glm::epsilon<float>())), "GLM: Failed constexpr");
static_assert(glm::all(glm::equal(C, glm::vec3(1.0f), glm::epsilon<float>())), "GLM: Failed constexpr");
static_assert(glm::all(glm::equal(D, glm::vec4(1.0f), glm::epsilon<float>())), "GLM: Failed constexpr");
#endif // GLM_HAS_CONSTEXPR
return 0;
@ -1347,3 +1389,6 @@ int main()
return Error;
}
#if(GLM_COMPILER & GLM_COMPILER_VC)
# pragma warning(pop)
#endif

View File

@ -13,7 +13,7 @@
namespace length
{
int test()
static int test()
{
float Length1 = glm::length(glm::vec1(1));
float Length2 = glm::length(glm::vec2(1, 0));
@ -33,7 +33,7 @@ namespace length
namespace distance
{
int test()
static int test()
{
float Distance1 = glm::distance(glm::vec1(1), glm::vec1(1));
float Distance2 = glm::distance(glm::vec2(1, 0), glm::vec2(1, 0));
@ -53,7 +53,7 @@ namespace distance
namespace dot
{
int test()
static int test()
{
float Dot1 = glm::dot(glm::vec1(1), glm::vec1(1));
float Dot2 = glm::dot(glm::vec2(1), glm::vec2(1));
@ -73,7 +73,7 @@ namespace dot
namespace cross
{
int test()
static 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));
@ -89,22 +89,23 @@ namespace cross
namespace normalize
{
int test()
static int test()
{
int Error = 0;
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));
Error += glm::all(glm::lessThan(glm::abs(Normalize1 - glm::vec3(1, 0, 0)), glm::vec3(std::numeric_limits<float>::epsilon()))) ? 0 : 1;
Error += glm::all(glm::lessThan(glm::abs(Normalize2 - glm::vec3(1, 0, 0)), glm::vec3(std::numeric_limits<float>::epsilon()))) ? 0 : 1;
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);
glm::vec3 x = glm::cross(w, u);
int Error = 0;
Error += glm::all(glm::lessThan(glm::abs(Normalize1 - glm::vec3(1, 0, 0)), glm::vec3(std::numeric_limits<float>::epsilon()))) ? 0 : 1;
Error += glm::all(glm::lessThan(glm::abs(Normalize2 - glm::vec3(1, 0, 0)), glm::vec3(std::numeric_limits<float>::epsilon()))) ? 0 : 1;
Error += glm::all(glm::equal(x + v, glm::vec3(0), 0.01f)) ? 0 : 1;
return Error;
}
@ -112,7 +113,7 @@ namespace normalize
namespace faceforward
{
int test()
static int test()
{
int Error = 0;
@ -121,6 +122,8 @@ namespace faceforward
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);
Error += glm::all(glm::equal(F, glm::vec3(0.0, 0.0, -1.0), 0.0001f)) ? 0 : 1;
}
return Error;
@ -129,7 +132,7 @@ namespace faceforward
namespace reflect
{
int test()
static int test()
{
int Error = 0;
@ -153,7 +156,7 @@ namespace reflect
namespace refract
{
int test()
static int test()
{
int Error = 0;

View File

@ -223,6 +223,11 @@ namespace bitfieldReverse
}
};
# if GLM_COMPILER & GLM_COMPILER_VC
# pragma warning(push)
# pragma warning(disable : 4309)
# endif
template<glm::length_t L, typename T, glm::qualifier Q>
GLM_FUNC_QUALIFIER glm::vec<L, T, Q> bitfieldReverseOps(glm::vec<L, T, Q> const& v)
{
@ -236,12 +241,21 @@ namespace bitfieldReverse
return x;
}
# if GLM_COMPILER & GLM_COMPILER_VC
# pragma warning(pop)
# endif
template<typename genType>
GLM_FUNC_QUALIFIER genType bitfieldReverseOps(genType x)
{
return bitfieldReverseOps(glm::vec<1, genType, glm::defaultp>(x)).x;
}
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wpadded"
#endif
template<typename genType>
struct type
{
@ -250,6 +264,10 @@ namespace bitfieldReverse
result Result;
};
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic pop
#endif
typedef type<glm::uint> typeU32;
typeU32 const Data32[] =
@ -1423,6 +1441,11 @@ namespace bitCount
}
};
# if GLM_COMPILER & GLM_COMPILER_VC
# pragma warning(push)
# pragma warning(disable : 4309)
# endif
template<glm::length_t L, typename T, glm::qualifier Q>
static glm::vec<L, int, Q> bitCount_bitfield(glm::vec<L, T, Q> const& v)
{
@ -1436,6 +1459,10 @@ namespace bitCount
return glm::vec<L, int, Q>(x);
}
# if GLM_COMPILER & GLM_COMPILER_VC
# pragma warning(pop)
# endif
template<typename genType>
static int bitCount_bitfield(genType x)
{

View File

@ -5,13 +5,20 @@
#include <cstdlib> //To define "exit", req'd by XLC.
#include <ctime>
unsigned rotatel(unsigned x, int n)
#ifdef NDEBUG
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wsign-conversion"
#endif
static unsigned rotatel(unsigned x, int n)
{
if (static_cast<unsigned>(n) > 63) { std::printf("rotatel, n out of range.\n"); std::exit(1);}
return (x << n) | (x >> (32 - n));
}
int pop0(unsigned x)
static int pop0(unsigned x)
{
x = (x & 0x55555555) + ((x >> 1) & 0x55555555);
x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
@ -21,7 +28,7 @@ int pop0(unsigned x)
return x;
}
int pop1(unsigned x)
static int pop1(unsigned x)
{
x = x - ((x >> 1) & 0x55555555);
x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
@ -34,7 +41,7 @@ int pop1(unsigned x)
return x*0x01010101 >> 24;
if your machine has a fast multiplier (suggested by Jari Kirma). */
int pop2(unsigned x)
static int pop2(unsigned x)
{
unsigned n;
@ -51,7 +58,7 @@ int pop2(unsigned x)
(x >> 30);
which runs faster on most machines (suggested by Norbert Juffa). */
int pop3(unsigned x)
static int pop3(unsigned x)
{
unsigned n;
@ -66,7 +73,7 @@ int pop3(unsigned x)
return x >> 24;
}
int pop4(unsigned x)
static int pop4(unsigned x)
{
int n;
@ -78,7 +85,7 @@ int pop4(unsigned x)
return n;
}
int pop5(unsigned x)
static int pop5(unsigned x)
{
int i, sum;
@ -92,7 +99,7 @@ int pop5(unsigned x)
return -sum; // return sum;
}
int pop5a(unsigned x)
static int pop5a(unsigned x)
{
int sum;
@ -106,7 +113,7 @@ int pop5a(unsigned x)
return sum;
}
int pop6(unsigned x)
static 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,
@ -136,7 +143,7 @@ int pop6(unsigned x)
}
// The following works only for 8-bit quantities.
int pop7(unsigned x)
static int pop7(unsigned x)
{
x = x*0x08040201; // Make 4 copies.
x = x >> 3; // So next step hits proper bits.
@ -147,7 +154,7 @@ int pop7(unsigned x)
}
// The following works only for 7-bit quantities.
int pop8(unsigned x)
static int pop8(unsigned x)
{
x = x*0x02040810; // Make 4 copies, left-adjusted.
x = x & 0x11111111; // Every 4th bit.
@ -157,7 +164,7 @@ int pop8(unsigned x)
}
// The following works only for 15-bit quantities.
int pop9(unsigned x)
static int pop9(unsigned x)
{
unsigned long long y;
y = x * 0x0002000400080010ULL;
@ -168,16 +175,19 @@ int pop9(unsigned x)
}
int errors;
void error(int x, int y)
static void error(int x, int y)
{
errors = errors + 1;
std::printf("Error for x = %08x, got %08x\n", x, y);
}
#if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable: 4389) // nonstandard extension used : nameless struct/union
#endif
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,
@ -286,6 +296,21 @@ int main()
if (errors == 0)
std::printf("Passed all %d cases.\n", static_cast<int>(sizeof(test)/8));
}
#if defined(_MSC_VER)
# pragma warning(pop)
#endif
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic pop
#endif
#else
int main()
{
return 0;
}
#endif//NDEBUG
}

View File

@ -3,19 +3,9 @@
#include <cstdlib> //To define "exit", req'd by XLC.
#include <ctime>
int nlz(unsigned x)
{
int pop(unsigned x);
#ifdef NDEBUG
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)
static int pop(unsigned x)
{
x = x - ((x >> 1) & 0x55555555);
x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
@ -25,17 +15,27 @@ int pop(unsigned x)
return x >> 24;
}
int ntz1(unsigned x)
static int nlz(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);
}
static int ntz1(unsigned x)
{
return 32 - nlz(~x & (x-1));
}
int ntz2(unsigned x)
static int ntz2(unsigned x)
{
return pop(~x & (x - 1));
}
int ntz3(unsigned x)
static int ntz3(unsigned x)
{
int n;
@ -48,7 +48,7 @@ int ntz3(unsigned x)
return n - (x & 1);
}
int ntz4(unsigned x)
static int ntz4(unsigned x)
{
unsigned y;
int n;
@ -63,7 +63,7 @@ int ntz4(unsigned x)
return n;
}
int ntz4a(unsigned x)
static int ntz4a(unsigned x)
{
unsigned y;
int n;
@ -78,7 +78,7 @@ int ntz4a(unsigned x)
return n;
}
int ntz5(char x)
static int ntz5(char x)
{
if (x & 15) {
if (x & 3) {
@ -97,7 +97,7 @@ int ntz5(char x)
else return 8;
}
int ntz6(unsigned x)
static int ntz6(unsigned x)
{
int n;
@ -111,7 +111,7 @@ int ntz6(unsigned x)
return n; // return n;
}
int ntz6a(unsigned x)
static int ntz6a(unsigned x)
{
int n = 32;
@ -138,7 +138,12 @@ execute in only 10 cycles on a machine with sufficient parallelism.
useful parallelism on most machines (the assignments to y, bz, and b4
could then all run in parallel). */
int ntz7(unsigned x)
#if GLM_COMPILER & GLM_COMPILER_VC
# pragma warning(push)
# pragma warning(disable : 4146)
#endif
static int ntz7(unsigned x)
{
unsigned y, bz, b4, b3, b2, b1, b0;
@ -152,12 +157,18 @@ int ntz7(unsigned x)
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)
#if(GLM_COMPILER & GLM_COMPILER_VC)
# pragma warning(pop)
#endif
int ntz7_christophe(unsigned x)
// This file has divisions by zero to test isnan
#if GLM_COMPILER & GLM_COMPILER_VC
# pragma warning(push)
# pragma warning(disable : 4800)
# pragma warning(disable : 4146)
#endif
static int ntz7_christophe(unsigned x)
{
unsigned y, bz, b4, b3, b2, b1, b0;
@ -177,7 +188,7 @@ entries marked "u" are unused. 6 ops including a
multiply, plus an indexed load. */
#define u 99
int ntz8(unsigned x)
static int ntz8(unsigned x)
{
static char table[64] =
{32, 0, 1,12, 2, 6, u,13, 3, u, 7, u, u, u, u,14,
@ -192,7 +203,7 @@ int ntz8(unsigned x)
/* Seal's algorithm with multiply expanded.
9 elementary ops plus an indexed load. */
int ntz8a(unsigned x)
static int ntz8a(unsigned x)
{
static char table[64] =
{32, 0, 1,12, 2, 6, u,13, 3, u, 7, u, u, u, u,14,
@ -210,7 +221,7 @@ int ntz8a(unsigned x)
/* Reiser's algorithm. Three ops including a "remainder,"
plus an indexed load. */
int ntz9(unsigned x)
static int ntz9(unsigned x)
{
static char table[37] = {
32, 0, 1, 26, 2, 23, 27,
@ -228,7 +239,7 @@ table. The de Bruijn sequence used here is
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 int ntz10(unsigned x) {
static char table[32] =
{ 0, 1, 2,24, 3,19, 6,25, 22, 4,20,10,16, 7,12,26,
@ -242,7 +253,7 @@ int ntz10(unsigned x) {
/* Norbert Juffa's code, answer to exercise 1 of Chapter 5 (2nd ed). */
#define SLOW_MUL
int ntz11 (unsigned int n) {
static int ntz11(unsigned int n) {
static unsigned char tab[32] =
{ 0, 1, 2, 24, 3, 19, 6, 25,
@ -264,16 +275,23 @@ int ntz11 (unsigned int n) {
return n ? tab[k>>27] : 32;
}
#if(GLM_COMPILER & GLM_COMPILER_VC)
# pragma warning(pop)
#endif
int errors;
void error(int x, int y) {
static void error(int x, int y) {
errors = errors + 1;
std::printf("Error for x = %08x, got %d\n", x, y);
}
#if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable: 4389) // nonstandard extension used : nameless struct/union
#endif
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,
@ -409,8 +427,28 @@ int main()
std::printf("ntz10: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
TimestampBeg = std::clock();
for (std::size_t k = 0; k < Count; ++k)
for (i = 0; i < n; i += 2) {
if (ntz11(test[i]) != test[i + 1]) error(test[i], ntz11(test[i]));
}
TimestampEnd = std::clock();
std::printf("ntz11: %d clocks\n", static_cast<int>(TimestampEnd - TimestampBeg));
if (errors == 0)
std::printf("Passed all %d cases.\n", static_cast<int>(sizeof(test)/8));
}
#if defined(_MSC_VER)
# pragma warning(pop)
#endif
#else
int main()
{
return 0;
}
#endif//NDEBUG
}

View File

@ -3,9 +3,11 @@
#include <cstdlib> // To define "exit", req'd by XLC.
#include <ctime>
#ifdef NDEBUG
#define LE 1 // 1 for little-endian, 0 for big-endian.
int pop(unsigned x) {
static int pop(unsigned x) {
x = x - ((x >> 1) & 0x55555555);
x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
x = (x + (x >> 4)) & 0x0F0F0F0F;
@ -14,7 +16,7 @@ int pop(unsigned x) {
return x >> 24;
}
int nlz1(unsigned x) {
static int nlz1(unsigned x) {
int n;
if (x == 0) return(32);
@ -27,7 +29,7 @@ int nlz1(unsigned x) {
return n;
}
int nlz1a(unsigned x) {
static int nlz1a(unsigned x) {
int n;
/* if (x == 0) return(32); */
@ -42,7 +44,7 @@ int nlz1a(unsigned x) {
}
// On basic Risc, 12 to 20 instructions.
int nlz2(unsigned x) {
static int nlz2(unsigned x) {
unsigned y;
int n;
@ -57,7 +59,7 @@ int nlz2(unsigned x) {
// As above but coded as a loop for compactness:
// 23 to 33 basic Risc instructions.
int nlz2a(unsigned x) {
static int nlz2a(unsigned x) {
unsigned y;
int n, c;
@ -70,7 +72,7 @@ int nlz2a(unsigned x) {
return n - x;
}
int nlz3(int x) {
static int nlz3(int x) {
int y, n;
n = 0;
@ -83,7 +85,12 @@ L: if (x < 0) return n;
goto L;
}
int nlz4(unsigned x) {
#if GLM_COMPILER & GLM_COMPILER_VC
# pragma warning(push)
# pragma warning(disable : 4146)
#endif
static int nlz4(unsigned x) {
int y, m, n;
y = -(x >> 16); // If left half of x is 0,
@ -111,7 +118,11 @@ int nlz4(unsigned x) {
return n + 2 - m;
}
int nlz5(unsigned x) {
#if(GLM_COMPILER & GLM_COMPILER_VC)
# pragma warning(pop)
#endif
static int nlz5(unsigned x) {
int pop(unsigned x);
x = x | (x >> 1);
@ -138,7 +149,7 @@ 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)
static int nlz6(unsigned k)
{
union {
unsigned asInt[2];
@ -151,7 +162,7 @@ int nlz6(unsigned k)
return n;
}
int nlz7(unsigned k)
static int nlz7(unsigned k)
{
union {
unsigned asInt[2];
@ -174,7 +185,7 @@ int nlz7(unsigned k)
FFFFFF80 <= k <= FFFFFFFF.
For k = 0 it gives 158, and for the other values it is too low by 1. */
int nlz8(unsigned k)
static int nlz8(unsigned k)
{
union {
unsigned asInt;
@ -196,7 +207,7 @@ expressions (see "Using and Porting GNU CC", by Richard M. Stallman
possibility that the macro argument will conflict with one of its local
variables, e.g., NLZ(k). */
int nlz9(unsigned k)
static int nlz9(unsigned k)
{
union {
unsigned asInt;
@ -230,7 +241,7 @@ multiplication expanded into shifts and adds, but the table size is
getting a bit large). */
#define u 99
int nlz10(unsigned x)
static int nlz10(unsigned x)
{
static char table[64] =
{32,31, u,16, u,30, 3, u, 15, u, u, u,29,10, 2, u,
@ -250,7 +261,7 @@ int nlz10(unsigned x)
/* Harley's algorithm with multiply expanded.
19 elementary ops plus an indexed load. */
int nlz10a(unsigned x)
static int nlz10a(unsigned x)
{
static char table[64] =
{32,31, u,16, u,30, 3, u, 15, u, u, u,29,10, 2, u,
@ -274,7 +285,7 @@ int nlz10a(unsigned x)
17 elementary ops plus an indexed load, if the machine
has "and not." */
int nlz10b(unsigned x)
static int nlz10b(unsigned x)
{
static char table[64] =
{32,20,19, u, u,18, u, 7, 10,17, u, u,14, u, 6, u,
@ -295,16 +306,19 @@ int nlz10b(unsigned x)
}
int errors;
void error(int x, int y)
static void error(int x, int y)
{
errors = errors + 1;
std::printf("Error for x = %08x, got %d\n", x, y);
}
#if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable: 4389) // nonstandard extension used : nameless struct/union
#endif
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,
@ -435,6 +449,17 @@ int main()
if (errors == 0)
std::printf("Passed all %d cases.\n", static_cast<int>(sizeof(test)/8));
}
#if defined(_MSC_VER)
# pragma warning(pop)
#endif
#else
int main()
{
return 0;
}
#endif//NDEBUG
}

View File

@ -16,7 +16,7 @@
using namespace glm;
int test_matrixCompMult()
static int test_matrixCompMult()
{
int Error(0);
@ -86,25 +86,50 @@ int test_matrixCompMult()
return Error;
}
int test_outerProduct()
static 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)); }
int Error = 0;
{ 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::mat2 m0 = glm::outerProduct(glm::vec2(1.0f), glm::vec2(1.0f));
glm::mat2 n0(1, 1, 1, 1);
Error += all(equal(m0, n0, epsilon<float>())) ? 0 : 1;
{ 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::mat3 m1 = glm::outerProduct(glm::vec3(1.0f), glm::vec3(1.0f));
glm::mat3 n1(1, 1, 1, 1, 1, 1, 1, 1, 1);
Error += all(equal(m1, n1, epsilon<float>())) ? 0 : 1;
{ 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)); }
glm::mat4 m2 = glm::outerProduct(glm::vec4(1.0f), glm::vec4(1.0f));
glm::mat4 n2(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
Error += all(equal(m2, n2, epsilon<float>())) ? 0 : 1;
return 0;
glm::mat2x3 m3 = glm::outerProduct(glm::vec3(1.0f), glm::vec2(1.0f));
glm::mat2x3 n3(1, 1, 1, 1, 1, 1);
Error += all(equal(m3, n3, epsilon<float>())) ? 0 : 1;
glm::mat2x4 m4 = glm::outerProduct(glm::vec4(1.0f), glm::vec2(1.0f));
glm::mat2x4 n4(1, 1, 1, 1, 1, 1, 1, 1);
Error += all(equal(m4, n4, epsilon<float>())) ? 0 : 1;
glm::mat3x2 m5 = glm::outerProduct(glm::vec2(1.0f), glm::vec3(1.0f));
glm::mat3x2 n5(1, 1, 1, 1, 1, 1);
Error += all(equal(m5, n5, epsilon<float>())) ? 0 : 1;
glm::mat3x4 m6 = glm::outerProduct(glm::vec4(1.0f), glm::vec3(1.0f));
glm::mat3x4 n6(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
Error += all(equal(m6, n6, epsilon<float>())) ? 0 : 1;
glm::mat4x2 m7 = glm::outerProduct(glm::vec2(1.0f), glm::vec4(1.0f));
glm::mat4x2 n7(1, 1, 1, 1, 1, 1, 1, 1);
Error += all(equal(m7, n7, epsilon<float>())) ? 0 : 1;
glm::mat4x3 m8 = glm::outerProduct(glm::vec3(1.0f), glm::vec4(1.0f));
glm::mat4x3 n8(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
Error += all(equal(m8, n8, epsilon<float>())) ? 0 : 1;
return Error;
}
int test_transpose()
static int test_transpose()
{
int Error(0);
@ -174,14 +199,14 @@ int test_transpose()
return Error;
}
int test_determinant()
static int test_determinant()
{
return 0;
}
int test_inverse()
static int test_inverse()
{
int Error = 0;
@ -221,7 +246,7 @@ int test_inverse()
return Error;
}
int test_inverse_simd()
static int test_inverse_simd()
{
int Error = 0;
@ -240,7 +265,7 @@ int test_inverse_simd()
return Error;
}
int test_shearing()
static int test_shearing()
{
int Error = 0;
@ -320,7 +345,7 @@ int test_shearing()
}
template<typename VEC3, typename MAT4>
int test_inverse_perf(std::size_t Count, std::size_t Instance, char const * Message)
static int test_inverse_perf(std::size_t Count, std::size_t Instance, char const * Message)
{
std::vector<MAT4> TestInputs;
TestInputs.resize(Count);

View File

@ -4,7 +4,7 @@
#include <glm/packing.hpp>
#include <vector>
int test_packUnorm2x16()
static int test_packUnorm2x16()
{
int Error = 0;
@ -25,7 +25,7 @@ int test_packUnorm2x16()
return Error;
}
int test_packSnorm2x16()
static int test_packSnorm2x16()
{
int Error = 0;
@ -46,7 +46,7 @@ int test_packSnorm2x16()
return Error;
}
int test_packUnorm4x8()
static int test_packUnorm4x8()
{
int Error = 0;
@ -72,7 +72,7 @@ int test_packUnorm4x8()
return Error;
}
int test_packSnorm4x8()
static int test_packSnorm4x8()
{
int Error = 0;
@ -92,7 +92,7 @@ int test_packSnorm4x8()
return Error;
}
int test_packHalf2x16()
static int test_packHalf2x16()
{
int Error = 0;
/*
@ -119,7 +119,7 @@ int test_packHalf2x16()
return Error;
}
int test_packDouble2x32()
static int test_packDouble2x32()
{
int Error = 0;

View File

@ -44,7 +44,7 @@ static int test_ivec2_swizzle()
return Error;
}
int test_ivec3_swizzle()
static int test_ivec3_swizzle()
{
int Error = 0;
@ -109,7 +109,7 @@ int test_ivec3_swizzle()
return Error;
}
int test_ivec4_swizzle()
static int test_ivec4_swizzle()
{
int Error = 0;
@ -127,7 +127,7 @@ int test_ivec4_swizzle()
return Error;
}
int test_vec4_swizzle()
static int test_vec4_swizzle()
{
int Error = 0;

View File

@ -0,0 +1,34 @@
#ifdef GLM_FORCE_CXX_UNKNOWN
#undef GLM_FORCE_CXX_UNKNOWN
#endif
#ifdef GLM_FORCE_CXX20
#undef GLM_FORCE_CXX20
#endif
#ifdef GLM_FORCE_CXX17
#undef GLM_FORCE_CXX17
#endif
#ifdef GLM_FORCE_CXX14
#undef GLM_FORCE_CXX14
#endif
#ifdef GLM_FORCE_CXX11
#undef GLM_FORCE_CXX11
#endif
#ifdef GLM_FORCE_CXX03
#undef GLM_FORCE_CXX03
#endif
#ifdef GLM_FORCE_CXX98
#undef GLM_FORCE_CXX98
#endif
#define GLM_FORCE_CXX03
#include <glm/glm.hpp>
#include <glm/ext.hpp>
int main()
{
int Error = 0;
return Error;
}

View File

@ -1,6 +1,27 @@
#ifndef GLM_FORCE_CXX98
# define GLM_FORCE_CXX98
#ifdef GLM_FORCE_CXX_UNKNOWN
#undef GLM_FORCE_CXX_UNKNOWN
#endif
#ifdef GLM_FORCE_CXX20
#undef GLM_FORCE_CXX20
#endif
#ifdef GLM_FORCE_CXX17
#undef GLM_FORCE_CXX17
#endif
#ifdef GLM_FORCE_CXX14
#undef GLM_FORCE_CXX14
#endif
#ifdef GLM_FORCE_CXX11
#undef GLM_FORCE_CXX11
#endif
#ifdef GLM_FORCE_CXX03
#undef GLM_FORCE_CXX03
#endif
#ifdef GLM_FORCE_CXX98
#undef GLM_FORCE_CXX98
#endif
#define GLM_FORCE_CXX98
#include <glm/glm.hpp>
#include <glm/ext.hpp>

Some files were not shown because too many files have changed in this diff Show More