summaryrefslogtreecommitdiff
path: root/src/glm/gtx/optimum_pow.hpp
blob: fd1542f215e9bc6f24db30b9dff5f0598f7012ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2005-12-21
// Updated : 2006-11-13
// Licence : This source is under MIT License
// File    : glm/gtx/optimum_pow.hpp
///////////////////////////////////////////////////////////////////////////////////////////////////
// Dependency:
// - GLM core
///////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef glm_gtx_optimum_pow
#define glm_gtx_optimum_pow

// Dependency:
#include "../glm.hpp"

#if(defined(GLM_MESSAGES) && !defined(glm_ext))
#	pragma message("GLM: GLM_GTX_optimum_pow extension included")
#endif

namespace glm{
namespace gtx{
namespace optimum_pow ///< GLM_GTX_optimum_pow extension: Integer exponentiation of power functions.
{
	/// \addtogroup gtx_optimum_pow
	/// @{

	//! Returns x raised to the power of 2.
	//! From GLM_GTX_optimum_pow extension.
    template <typename genType> 
	genType pow2(const genType& x);

	//! Returns x raised to the power of 3.
	//! From GLM_GTX_optimum_pow extension.
    template <typename genType> 
	genType pow3(const genType& x);

	//! Returns x raised to the power of 4.
	//! From GLM_GTX_optimum_pow extension.
	template <typename genType> 
	genType pow4(const genType& x);
        
	//! Checks if the parameter is a power of 2 number. 
	//! From GLM_GTX_optimum_pow extension.
    bool powOfTwo(int num);

	//! Checks to determine if the parameter component are power of 2 numbers.
	//! From GLM_GTX_optimum_pow extension.
    detail::tvec2<bool> powOfTwo(const detail::tvec2<int>& x);

	//! Checks to determine if the parameter component are power of 2 numbers. 
	//! From GLM_GTX_optimum_pow extension.
    detail::tvec3<bool> powOfTwo(const detail::tvec3<int>& x);

	//! Checks to determine if the parameter component are power of 2 numbers. 
	//! From GLM_GTX_optimum_pow extension.
    detail::tvec4<bool> powOfTwo(const detail::tvec4<int>& x);

	/// @}
}//namespace optimum_pow
}//namespace gtx
}//namespace glm

#include "optimum_pow.inl"

namespace glm{using namespace gtx::optimum_pow;}

#endif//glm_gtx_optimum_pow