Clean up CMake project, added arithmetic operators to swizzle operators types
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
function(glmCreateTestGTC NAME)
|
||||
if(GLM_TEST_ENABLE)
|
||||
set(SAMPLE_NAME test-${NAME})
|
||||
add_executable(${SAMPLE_NAME} ${NAME}.cpp)
|
||||
set(SAMPLE_NAME test-${NAME})
|
||||
add_executable(${SAMPLE_NAME} ${NAME}.cpp)
|
||||
|
||||
add_test(
|
||||
NAME ${SAMPLE_NAME}
|
||||
COMMAND $<TARGET_FILE:${SAMPLE_NAME}> )
|
||||
endif(GLM_TEST_ENABLE)
|
||||
add_test(
|
||||
NAME ${SAMPLE_NAME}
|
||||
COMMAND $<TARGET_FILE:${SAMPLE_NAME}> )
|
||||
endfunction()
|
||||
|
||||
add_subdirectory(bug)
|
||||
|
||||
@@ -60,7 +60,7 @@ int test_ivec3_swizzle()
|
||||
|
||||
# if GLM_SWIZZLE == GLM_SWIZZLE_OPERATOR
|
||||
{
|
||||
glm::ivec3 A(1, 2, 3);
|
||||
glm::ivec3 const A(1, 2, 3);
|
||||
glm::ivec2 B = A.yx;
|
||||
glm::ivec2 C = A.yx;
|
||||
|
||||
@@ -82,6 +82,18 @@ int test_ivec3_swizzle()
|
||||
|
||||
Error += E == A.xy() ? 0 : 1;
|
||||
Error += E.xy() == A.xy() ? 0 : 1;
|
||||
|
||||
glm::ivec3 const F = A.xxx + A.xxx;
|
||||
Error += F == glm::ivec3(2) ? 0 : 1;
|
||||
|
||||
glm::ivec3 const G = A.xxx - A.xxx;
|
||||
Error += G == glm::ivec3(0) ? 0 : 1;
|
||||
|
||||
glm::ivec3 const H = A.xxx * A.xxx;
|
||||
Error += H == glm::ivec3(1) ? 0 : 1;
|
||||
|
||||
glm::ivec3 const I = A.xxx / A.xxx;
|
||||
Error += I == glm::ivec3(1) ? 0 : 1;
|
||||
}
|
||||
# endif//GLM_SWIZZLE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user