Fixed Visual Studio natvis support for vec4 #288, Added Visual Studio natvis support for vec1, quat and dualqual types

This commit is contained in:
Christophe Riccio
2015-01-09 01:37:16 +01:00
parent ed3d8e17e4
commit 1e0825028e
5 changed files with 71 additions and 19 deletions

View File

@@ -4,6 +4,7 @@ file(GLOB ROOT_SOURCE *.cpp)
file(GLOB ROOT_INLINE *.inl)
file(GLOB ROOT_HEADER *.hpp)
file(GLOB ROOT_TEXT ../*.txt)
file(GLOB ROOT_NAT ../util/glm.natvis)
file(GLOB_RECURSE CORE_SOURCE ./detail/*.cpp)
file(GLOB_RECURSE CORE_INLINE ./detail/*.inl)
@@ -31,7 +32,7 @@ source_group("GTX Files" FILES ${GTX_HEADER})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
if(GLM_TEST_ENABLE)
add_executable(${NAME} ${ROOT_TEXT}
add_executable(${NAME} ${ROOT_TEXT} ${ROOT_NAT}
${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}

View File

@@ -34,7 +34,8 @@
///////////////////////////////////////////////////////////////////////////////////
#define GLM_MESSAGES
#include "../glm.hpp"
#include <glm/glm.hpp>
#include <glm/ext.hpp>
#include <limits>
struct material
@@ -213,10 +214,19 @@ typename vecType::value_type normalizeDotC(vecType const & a, vecType const & b)
int main()
{
glm::vec4 v(1);
float a = normalizeDotA(v, v);
float b = normalizeDotB(v, v);
float c = normalizeDotC(v, v);
glm::vec1 o(1);
glm::vec2 a(1);
glm::vec3 b(1);
glm::vec4 c(1);
glm::quat q;
glm::dualquat p;
glm::mat4 m(1);
float a0 = normalizeDotA(a, a);
float b0 = normalizeDotB(b, b);
float c0 = normalizeDotC(c, c);
return 0;
}

View File

@@ -115,10 +115,11 @@ namespace detail
# if GLM_HAS_ANONYMOUS_UNION
union
{
typename detail::simd<T>::type data;
struct { T x, y, z, w;};
struct { T r, g, b, a; };
struct { T s, t, p, q; };
struct { T x, y, z, w;};
typename detail::simd<T>::type data;
# ifdef GLM_SWIZZLE
_GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, x, y, z, w)