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

View File

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

View File

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

View File

@ -71,12 +71,14 @@ Features:
Improvements: Improvements:
- Removed assert for perspective with zFar < zNear #298 - Removed assert for perspective with zFar < zNear #298
- Added Visual Studio natvis support for vec1, quat and dualqual types
Fixes: Fixes:
- Fixed faceforward build #289 - Fixed faceforward build #289
- Fixed decompose function VS2010 templating issues #294 - Fixed decompose function VS2010 templating issues #294
- Fixed mat4x3 = mat2x3 * mat4x2 operator #297 - Fixed mat4x3 = mat2x3 * mat4x2 operator #297
- Fixed warnings in F2x11_1x10 pcking function in GTC_packing #295 - Fixed warnings in F2x11_1x10 packing function in GTC_packing #295
- Fixed Visual Studio natvis support for vec4 #288
================================================================================ ================================================================================
GLM 0.9.6.1: 2014-12-10 GLM 0.9.6.1: 2014-12-10

View File

@ -4,23 +4,32 @@
<!-- Put them into My Documents/Visual Studio 2012/Visualizers/ --> <!-- Put them into My Documents/Visual Studio 2012/Visualizers/ -->
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010"> <AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="glm::detail::tvec2&lt;*&gt;"> <Type Name="glm::tvec1&lt;*&gt;">
<DisplayString>({x}, {y})</DisplayString> <DisplayString>{x}</DisplayString>
<Expand>
<Item Name="x">x</Item>
</Expand>
</Type>
<Type Name="glm::tvec2&lt;*&gt;">
<DisplayString>{x}, {y}</DisplayString>
<Expand> <Expand>
<Item Name="x">x</Item> <Item Name="x">x</Item>
<Item Name="y">y</Item> <Item Name="y">y</Item>
</Expand> </Expand>
</Type> </Type>
<Type Name="glm::detail::tvec3&lt;*&gt;">
<DisplayString>({x}, {y}, {z})</DisplayString> <Type Name="glm::tvec3&lt;*&gt;">
<DisplayString>{x}, {y}, {z}</DisplayString>
<Expand> <Expand>
<Item Name="x">x</Item> <Item Name="x">x</Item>
<Item Name="y">y</Item> <Item Name="y">y</Item>
<Item Name="z">z</Item> <Item Name="z">z</Item>
</Expand> </Expand>
</Type> </Type>
<Type Name="glm::detail::tvec4&lt;*&gt;">
<DisplayString>({x}, {y}, {z}, {w})</DisplayString> <Type Name="glm::tvec4&lt;*&gt;">
<DisplayString>{x}, {y}, {z}, {w}</DisplayString>
<Expand> <Expand>
<Item Name="x">x</Item> <Item Name="x">x</Item>
<Item Name="y">y</Item> <Item Name="y">y</Item>
@ -28,4 +37,33 @@
<Item Name="w">w</Item> <Item Name="w">w</Item>
</Expand> </Expand>
</Type> </Type>
<!--Type Name="glm::tmat4&lt;*&gt;">
<DisplayString>{value[0]}, {value[1]}, {value[2]}, {value[3]}</DisplayString>
<Expand>
<Item Name="[0]">value[0]</Item>
<Item Name="[1]">value[1]</Item>
<Item Name="[2]">value[2]</Item>
<Item Name="[3]">value[3]</Item>
</Expand>
</Type-->
<Type Name="glm::tquat&lt;*&gt;">
<DisplayString>({x}, {y}, {z}), {w}</DisplayString>
<Expand>
<Item Name="x">x</Item>
<Item Name="y">y</Item>
<Item Name="z">z</Item>
<Item Name="w">w</Item>
</Expand>
</Type>
<Type Name="glm::tdualquat&lt;*&gt;">
<DisplayString>(({real.x}, {real.y}, {real.z}), {real.w}), (({dual.x}, {dual.y}, {dual.z}), {dual.w})</DisplayString>
<Expand>
<Item Name="real">real</Item>
<Item Name="dual">dual</Item>
</Expand>
</Type>
</AutoVisualizer> </AutoVisualizer>