Merge remote-tracking branch 'upstream/master'

This commit is contained in:
jan p springer 2016-04-29 22:29:16 +01:00
commit 57310708e5
17 changed files with 101 additions and 26 deletions

View File

@ -97,7 +97,7 @@
# own custom ConfigVersion.cmake file instead of using this macro.
#
# Internally, this macro executes configure_file() to create the resulting
# version file. Depending on the COMPATIBLITY, either the file
# version file. Depending on the COMPATIBILITY, either the file
# BasicConfigVersion-SameMajorVersion.cmake.in or BasicConfigVersion-AnyNewerVersion.cmake.in
# is used. Please note that these two files are internal to CMake and you should
# not call configure_file() on them yourself, but they can be used as starting

View File

@ -7,7 +7,7 @@ a) The Happy Bunny License, or b) the MIT License.
================================================================================
The Happy Bunny License (Modified MIT License)
--------------------------------------------------------------------------------
Copyright (c) 2005 - 2015 G-Truc Creation
Copyright (c) 2005 - 2016 G-Truc Creation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -33,7 +33,7 @@ THE SOFTWARE.
================================================================================
The MIT License
--------------------------------------------------------------------------------
Copyright (c) 2005 - 2015 G-Truc Creation
Copyright (c) 2005 - 2016 G-Truc Creation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -75,7 +75,7 @@
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;<span class="preprocessor">#include &quot;common.inl&quot;</span></div>
<div class="ttc" id="a00190_html_ga74aa7c7462245d83bd5a9edf9c6c2d91"><div class="ttname"><a href="a00190.html#ga74aa7c7462245d83bd5a9edf9c6c2d91">glm::isdenormal</a></div><div class="ttdeci">GLM_FUNC_DECL genType::bool_type isdenormal(genType const &amp;x)</div><div class="ttdoc">Returns true if x is a denormalized number Numbers whose absolute value is too small to be represente...</div></div>
<div class="ttc" id="a00190_html_ga2580f50d4064557d62f4a533dfc6c7e3"><div class="ttname"><a href="a00190.html#ga2580f50d4064557d62f4a533dfc6c7e3">glm::fmod</a></div><div class="ttdeci">GLM_FUNC_DECL vecType&lt; T, P &gt; fmod(vecType&lt; T, P &gt; const &amp;v)</div><div class="ttdoc">Similiar to &#39;mod&#39; but with a different rounding and integer support. </div></div>
<div class="ttc" id="a00190_html_ga2580f50d4064557d62f4a533dfc6c7e3"><div class="ttname"><a href="a00190.html#ga2580f50d4064557d62f4a533dfc6c7e3">glm::fmod</a></div><div class="ttdeci">GLM_FUNC_DECL vecType&lt; T, P &gt; fmod(vecType&lt; T, P &gt; const &amp;v)</div><div class="ttdoc">Similar to &#39;mod&#39; but with a different rounding and integer support. </div></div>
<div class="ttc" id="a00146_html"><div class="ttname"><a href="a00146.html">glm</a></div><div class="ttdef"><b>Definition:</b> <a href="a00003_source.html#l00040">_noise.hpp:40</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->

View File

@ -501,7 +501,7 @@
<div class="line"><a name="l00486"></a><span class="lineno"> 486</span>&#160;<span class="preprocessor"># define GLM_LANG (GLM_LANG_CXX | GLM_LANG_CXXMS_FLAG)</span></div>
<div class="line"><a name="l00487"></a><span class="lineno"> 487</span>&#160;<span class="preprocessor"># endif</span></div>
<div class="line"><a name="l00488"></a><span class="lineno"> 488</span>&#160;<span class="preprocessor"># endif</span></div>
<div class="line"><a name="l00489"></a><span class="lineno"> 489</span>&#160;<span class="preprocessor"># else // Unkown compiler</span></div>
<div class="line"><a name="l00489"></a><span class="lineno"> 489</span>&#160;<span class="preprocessor"># else // Unknown compiler</span></div>
<div class="line"><a name="l00490"></a><span class="lineno"> 490</span>&#160;<span class="preprocessor"># if __cplusplus &gt;= 201402L</span></div>
<div class="line"><a name="l00491"></a><span class="lineno"> 491</span>&#160;<span class="preprocessor"># define GLM_LANG GLM_LANG_CXX14</span></div>
<div class="line"><a name="l00492"></a><span class="lineno"> 492</span>&#160;<span class="preprocessor"># elif __cplusplus &gt;= 201103L</span></div>

View File

@ -275,7 +275,7 @@
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160;<span class="preprocessor">#elif(!defined(GLM_PRECISION_HIGHP_INT) &amp;&amp; !defined(GLM_PRECISION_MEDIUMP_INT) &amp;&amp; defined(GLM_PRECISION_LOWP_INT))</span></div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160; <span class="keyword">typedef</span> lowp_int int_t;</div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160;<span class="preprocessor"># error &quot;GLM error: multiple default precision requested for signed interger types&quot;</span></div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160;<span class="preprocessor"># error &quot;GLM error: multiple default precision requested for signed integer types&quot;</span></div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160;</div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160;<span class="preprocessor">#if(!defined(GLM_PRECISION_HIGHP_UINT) &amp;&amp; !defined(GLM_PRECISION_MEDIUMP_UINT) &amp;&amp; !defined(GLM_PRECISION_LOWP_UINT))</span></div>
@ -287,7 +287,7 @@
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160;<span class="preprocessor">#elif(!defined(GLM_PRECISION_HIGHP_UINT) &amp;&amp; !defined(GLM_PRECISION_MEDIUMP_UINT) &amp;&amp; defined(GLM_PRECISION_LOWP_UINT))</span></div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160; <span class="keyword">typedef</span> lowp_uint uint_t;</div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>&#160;<span class="preprocessor"># error &quot;GLM error: multiple default precision requested for unsigned interger types&quot;</span></div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>&#160;<span class="preprocessor"># error &quot;GLM error: multiple default precision requested for unsigned integer types&quot;</span></div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160;</div>
<div class="line"><a name="l00308"></a><span class="lineno"><a class="line" href="a00164.html#ga91ad9478d81a7aaf2593e8d9c3d06a14"> 308</a></span>&#160; <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="a00164.html#ga91ad9478d81a7aaf2593e8d9c3d06a14">uint</a>;</div>

View File

@ -132,7 +132,7 @@ Typedefs</h2></td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>The standard types defined by the specification. </p>
<p>These types are all typedefs of more generalized, template types. To see the definiton of these template types, go to <a class="el" href="a00165.html">Template types</a>. </p>
<p>These types are all typedefs of more generalized, template types. To see the definition of these template types, go to <a class="el" href="a00165.html">Template types</a>. </p>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="ga0e46aaaccc5e713eac5bfbc8d6885a60"></a>
<div class="memitem">

View File

@ -70,7 +70,7 @@ Functions</h2></td></tr>
</table>
</div><div class="memdoc">
<p>Similiar to 'mod' but with a different rounding and integer support. </p>
<p>Similar to 'mod' but with a different rounding and integer support. </p>
<p>Returns 'x - y * trunc(x/y)' instead of 'x - y * floor(x/y)'</p>
<dl class="section see"><dt>See also</dt><dd><a href="http://stackoverflow.com/questions/7610631/glsl-mod-vs-hlsl-fmod">GLSL mod vs HLSL fmod</a> </dd>
<dd>

View File

@ -54,7 +54,7 @@
<li>Any conform C++98 compiler</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>The Doxygen-generated documentation will often state that a type or function is defined in a namespace that is a child of the <a class="el" href="">glm </a> namespace. Please ignore this; All publicly available types and functions can be accessed as a direct children of the glm namespace.</dd></dl>
<p>The source code is licenced under the <a href="http://glm.g-truc.net/copying.txt">Happy Bunny License (Modified MIT)</a> and <a href="http://glm.g-truc.net/copying.txt">MIT license</a>.</p>
<p>The source code is licensed under the <a href="http://glm.g-truc.net/copying.txt">Happy Bunny License (Modified MIT)</a> and <a href="http://glm.g-truc.net/copying.txt">MIT license</a>.</p>
<p>These pages are the API reference only. For more information about how to use GLM, please have a look at <a href="http://glm.g-truc.net/glm.pdf">the manual</a>.</p>
<p>Thanks for contributing to the project by <a href="https://github.com/g-truc/glm/issues">submitting tickets for bug reports and feature requests</a>. Any feedback is welcome at <a href="#" onclick="location.href='mai'+'lto:'+'glm'+'@g'+'-tr'+'uc'+'.ne'+'t'; return false;">glm@g<span style="display: none;">.nosp@m.</span>-tru<span style="display: none;">.nosp@m.</span>c.net</a>. </p>
</div></div><!-- contents -->

View File

@ -23,7 +23,7 @@
Please ignore this; All publicly available types and functions can be accessed as a direct children
of the glm namespace.
The source code is licenced under the <a href="http://glm.g-truc.net/copying.txt">Happy Bunny License (Modified MIT)</a> and <a href="http://glm.g-truc.net/copying.txt">MIT license</a>.
The source code is licensed under the <a href="http://glm.g-truc.net/copying.txt">Happy Bunny License (Modified MIT)</a> and <a href="http://glm.g-truc.net/copying.txt">MIT license</a>.
These pages are the API reference only. For more information about how to use GLM, please have a look at <a href="http://glm.g-truc.net/glm.pdf">the manual</a>.

View File

@ -208,7 +208,7 @@ namespace detail
{
uint64 const Value64(static_cast<uint64>(x) + static_cast<uint64>(y));
uint64 const Max32((static_cast<uint64>(1) << static_cast<uint64>(32)) - static_cast<uint64>(1));
Carry = Value64 > Max32 ? 1 : 0;
Carry = Value64 > Max32 ? 1u : 0u;
return static_cast<uint32>(Value64 % (Max32 + static_cast<uint64>(1)));
}

View File

@ -597,7 +597,7 @@
# else
# define GLM_LANG (GLM_LANG_CXX | GLM_MSC_EXT)
# endif
# else // Unkown compiler
# else // Unknown compiler
# if __cplusplus >= 201402L
# define GLM_LANG GLM_LANG_CXX14
# elif __cplusplus >= 201103L

View File

@ -287,7 +287,7 @@ namespace detail
#elif(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && defined(GLM_PRECISION_LOWP_INT))
typedef lowp_int int_t;
#else
# error "GLM error: multiple default precision requested for signed interger types"
# error "GLM error: multiple default precision requested for signed integer types"
#endif
#if(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))
@ -299,7 +299,7 @@ namespace detail
#elif(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && defined(GLM_PRECISION_LOWP_UINT))
typedef lowp_uint uint_t;
#else
# error "GLM error: multiple default precision requested for unsigned interger types"
# error "GLM error: multiple default precision requested for unsigned integer types"
#endif
/// Unsigned integer type.

View File

@ -48,7 +48,7 @@
///
/// @brief The standard types defined by the specification.
///
/// These types are all typedefs of more generalized, template types. To see the definiton
/// These types are all typedefs of more generalized, template types. To see the definition
/// of these template types, go to @ref core_template.
///
/// @ingroup core

View File

@ -30,8 +30,9 @@
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
namespace glm
{
#include "../detail/func_integer.hpp"
namespace glm{
namespace detail
{
template <typename T, precision P, template <typename, precision> class vecType, bool compute = false>
@ -275,7 +276,7 @@ namespace detail
template <typename genType>
GLM_FUNC_QUALIFIER genType floorPowerOfTwo(genType value)
{
return isPowerOfTwo(value) ? value : highestBitValue(value);
return isPowerOfTwo(value) ? value : static_cast<genType>(1) << findMSB(value);
}
template <typename T, precision P, template <typename, precision> class vecType>
@ -293,8 +294,8 @@ namespace detail
if(isPowerOfTwo(value))
return value;
genIUType const prev = highestBitValue(value);
genIUType const next = prev << 1;
genIUType const prev = static_cast<genIUType>(1) << findMSB(value);
genIUType const next = prev << static_cast<genIUType>(1);
return (next - value) < (value - prev) ? next : prev;
}

View File

@ -68,7 +68,7 @@ namespace glm
template <typename genType>
GLM_FUNC_DECL typename genType::bool_type isdenormal(genType const & x);
/// Similiar to 'mod' but with a different rounding and integer support.
/// Similar to 'mod' but with a different rounding and integer support.
/// Returns 'x - y * trunc(x/y)' instead of 'x - y * floor(x/y)'
///
/// @see <a href="http://stackoverflow.com/questions/7610631/glsl-mod-vs-hlsl-fmod">GLSL mod vs HLSL fmod</a>

View File

@ -76,6 +76,11 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate)
##### Deprecation:
- Removed GLM_FORCE_SIZE_FUNC define
#### [GLM 0.9.7.5](https://github.com/g-truc/glm/tree/0.9.7) - 2016-0X-XX
##### Fixes:
- Fixed uaddCarry warning #497
- Fixed roundPowerOfTwo and floorPowerOfTwo #503
#### [GLM 0.9.7.4](https://github.com/g-truc/glm/releases/tag/0.9.7.4) - 2016-03-19
##### Fixes:
- Fixed asinh and atanh warning with C++98 STL #484
@ -205,7 +210,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate)
##### Fixes:
- Fixed scalar uaddCarry build error with Cuda #276
- Fixed C++11 explicit conversion operators detection #282
- Fixed missing explicit convertion when using integer log2 with *vec1 types
- Fixed missing explicit conversion when using integer log2 with *vec1 types
- Fixed 64 bits integer GTX_string_cast to_string on VC 32 bit compiler
- Fixed Android build issue, STL C++11 is not supported by the NDK #284
- Fixed unsupported _BitScanForward64 and _BitScanReverse64 in VC10
@ -526,7 +531,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate)
- Promoted GLM_GTC_noise extension: simplex, perlin, periodic noise functions
- Promoted GLM_GTC_random extension: linear, gaussian and various random number
generation distribution
- Added GLM_GTX_constants: provides usefull constants
- Added GLM_GTX_constants: provides useful constants
- Added extension versioning
- Removed many unused namespaces
- Fixed half based type contructors

View File

@ -174,7 +174,7 @@ namespace isPowerOfTwo
}
}//isPowerOfTwo
namespace ceilPowerOfTwo
namespace ceilPowerOfTwo_advanced
{
template <typename genIUType>
GLM_FUNC_QUALIFIER genIUType highestBitValue(genIUType Value)
@ -290,6 +290,72 @@ namespace ceilPowerOfTwo
Error += test_int32();
Error += test_uint32();
return Error;
}
}//namespace ceilPowerOfTwo_advanced
namespace roundPowerOfTwo
{
int test()
{
int Error = 0;
glm::uint32 const A = glm::roundPowerOfTwo(7u);
Error += A == 8u ? 0 : 1;
glm::uint32 const B = glm::roundPowerOfTwo(15u);
Error += B == 16u ? 0 : 1;
glm::uint32 const C = glm::roundPowerOfTwo(31u);
Error += C == 32u ? 0 : 1;
glm::uint32 const D = glm::roundPowerOfTwo(9u);
Error += D == 8u ? 0 : 1;
glm::uint32 const E = glm::roundPowerOfTwo(17u);
Error += E == 16u ? 0 : 1;
glm::uint32 const F = glm::roundPowerOfTwo(33u);
Error += F == 32u ? 0 : 1;
return Error;
}
}//namespace roundPowerOfTwo
namespace floorPowerOfTwo
{
int test()
{
int Error = 0;
glm::uint32 const A = glm::floorPowerOfTwo(7u);
Error += A == 4u ? 0 : 1;
glm::uint32 const B = glm::floorPowerOfTwo(15u);
Error += B == 8u ? 0 : 1;
glm::uint32 const C = glm::floorPowerOfTwo(31u);
Error += C == 16u ? 0 : 1;
return Error;
}
}//namespace floorPowerOfTwo
namespace ceilPowerOfTwo
{
int test()
{
int Error = 0;
glm::uint32 const A = glm::ceilPowerOfTwo(7u);
Error += A == 8u ? 0 : 1;
glm::uint32 const B = glm::ceilPowerOfTwo(15u);
Error += B == 16u ? 0 : 1;
glm::uint32 const C = glm::ceilPowerOfTwo(31u);
Error += C == 32u ? 0 : 1;
return Error;
}
}//namespace ceilPowerOfTwo
@ -406,7 +472,10 @@ int main()
int Error(0);
Error += isPowerOfTwo::test();
Error += floorPowerOfTwo::test();
Error += roundPowerOfTwo::test();
Error += ceilPowerOfTwo::test();
Error += ceilPowerOfTwo_advanced::test();
# ifdef NDEBUG
Error += ceilPowerOfTwo::perf();