forked from icaven/glm
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2834400
commit 86135d4
Showing
5 changed files
with
112 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,57 @@ | ||
#define GLM_ENABLE_EXPERIMENTAL | ||
#include <glm/gtx/hash.hpp> | ||
#include <unordered_map> | ||
#include <map> | ||
|
||
#if GLM_LANG& GLM_LANG_CXX11 | ||
int test_compile() | ||
{ | ||
int Error = 0; | ||
|
||
// Vector types | ||
std::unordered_map<glm::vec1, int> map_vec1; | ||
std::map<glm::vec1, int> map_vec1; | ||
Error += ++map_vec1[glm::vec1(0.0f)]; | ||
std::unordered_map<glm::vec2, int> map_vec2; | ||
std::map<glm::vec2, int> map_vec2; | ||
Error += ++map_vec2[glm::vec2(0.0f)]; | ||
std::unordered_map<glm::vec3, int> map_vec3; | ||
std::map<glm::vec3, int> map_vec3; | ||
Error += ++map_vec3[glm::vec3(0.0f)]; | ||
std::unordered_map<glm::vec4, int> map_vec4; | ||
std::map<glm::vec4, int> map_vec4; | ||
Error += ++map_vec4[glm::vec4(0.0f)]; | ||
|
||
// Quaternion types | ||
std::unordered_map<glm::quat, int> map_quat; | ||
std::map<glm::quat, int> map_quat; | ||
Error += ++map_quat[glm::quat(0.0f, glm::vec3(0.0f))]; | ||
std::unordered_map<glm::dualquat, int> map_dualquat; | ||
std::map<glm::dualquat, int> map_dualquat; | ||
Error += ++map_dualquat[glm::dualquat(glm::quat(0.0f, glm::vec3(0.0f)), glm::vec3(0.0f))]; | ||
|
||
// Matrix types | ||
std::unordered_map<glm::mat2x2, int> map_mat2x2; | ||
std::map<glm::mat2x2, int> map_mat2x2; | ||
Error += ++map_mat2x2[glm::mat2x2(0.0f)]; | ||
std::unordered_map<glm::mat2x3, int> map_mat2x3; | ||
std::map<glm::mat2x3, int> map_mat2x3; | ||
Error += ++map_mat2x3[glm::mat2x3(0.0f)]; | ||
std::unordered_map<glm::mat2x4, int> map_mat2x4; | ||
std::map<glm::mat2x4, int> map_mat2x4; | ||
Error += ++map_mat2x4[glm::mat2x4(0.0f)]; | ||
std::unordered_map<glm::mat3x2, int> map_mat3x2; | ||
std::map<glm::mat3x2, int> map_mat3x2; | ||
Error += ++map_mat3x2[glm::mat3x2(0.0f)]; | ||
std::unordered_map<glm::mat3x3, int> map_mat3x3; | ||
std::map<glm::mat3x3, int> map_mat3x3; | ||
Error += ++map_mat3x3[glm::mat3x3(0.0f)]; | ||
std::unordered_map<glm::mat3x4, int> map_mat3x4; | ||
std::map<glm::mat3x4, int> map_mat3x4; | ||
Error += ++map_mat3x4[glm::mat3x4(0.0f)]; | ||
std::unordered_map<glm::mat4x2, int> map_mat4x2; | ||
std::map<glm::mat4x2, int> map_mat4x2; | ||
Error += ++map_mat4x2[glm::mat4x2(0.0f)]; | ||
std::unordered_map<glm::mat4x3, int> map_mat4x3; | ||
std::map<glm::mat4x3, int> map_mat4x3; | ||
Error += ++map_mat4x3[glm::mat4x3(0.0f)]; | ||
std::unordered_map<glm::mat4x4, int> map_mat4x4; | ||
std::map<glm::mat4x4, int> map_mat4x4; | ||
Error += ++map_mat4x4[glm::mat4x4(0.0f)]; | ||
|
||
return Error > 0 ? 0 : 1; | ||
} | ||
|
||
int main() | ||
{ | ||
int Error = 0; | ||
int Error = 0; | ||
|
||
Error += test_compile(); | ||
Error += test_compile(); | ||
|
||
return Error; | ||
return Error; | ||
} | ||
|
||
#endif//GLM_LANG& GLM_LANG_CXX11 |