diff --git a/glm/gen_external_templates.py b/glm/gen_external_templates.py new file mode 100644 index 00000000..581f2f17 --- /dev/null +++ b/glm/gen_external_templates.py @@ -0,0 +1,59 @@ + +__author__="eloraiby" +__date__ ="$5-Sep-2010 9:35:29 PM$" + +atomic_types = ["unsigned char", "unsigned short", "unsigned int", + "signed char", "signed short", "signed int", + "float", "double"] + + +glsl_vector_types = ["tvec2", "tvec3", "tvec4"] +glsl_matrix_types = ["tmat2x2", "tmat2x3", "tmat2x4", + "tmat3x2", "tmat3x3", "tmat3x4", + "tmat4x2", "tmat4x3", "tmat4x4"] + +glsl_operators = [] + +def gen_vectors(): + for v in glsl_vector_types: + print + print "//" + print "// " + v + " type explicit instantiation" + print "//" + for a in atomic_types: + print "template struct " + v + "<" + a + ">;" + print + +def gen_matrices(): + for m in glsl_matrix_types: + print + print "//" + print "// " + m + " type explicit instantiation" + print "//" + for a in atomic_types: + print "template struct " + m + "<" + a + ">;" + print + +if __name__ == "__main__": + print "//" + print "// GLM External templates generator script version 0.1 for GLM core" + print "//" + print "// atomic types:", atomic_types + print "// GLSL vector types:", glsl_vector_types; + print "// GLSL matrix types:", glsl_matrix_types; + print "//" + print + print "#include \"glm.hpp\"" + print + print "namespace glm {" + print "namespace detail {" + + + gen_vectors() + gen_matrices() + + print "} // namespace detail" + print "} // namespace glm" + + + diff --git a/glm/glm_core.cpp b/glm/glm_core.cpp new file mode 100644 index 00000000..3942cc38 --- /dev/null +++ b/glm/glm_core.cpp @@ -0,0 +1,170 @@ +// +// GLM External templates generator script version 0.1 for GLM core +// +// atomic types: ['unsigned char', 'unsigned short', 'unsigned int', 'signed char', 'signed short', 'signed int', 'float', 'double'] +// GLSL vector types: ['tvec2', 'tvec3', 'tvec4'] +// GLSL matrix types: ['tmat2x2', 'tmat2x3', 'tmat2x4', 'tmat3x2', 'tmat3x3', 'tmat3x4', 'tmat4x2', 'tmat4x3', 'tmat4x4'] +// + +#include "glm.hpp" + +namespace glm { +namespace detail { + +// +// tvec2 type explicit instantiation +// +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; +template struct tvec2; + + +// +// tvec3 type explicit instantiation +// +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; +template struct tvec3; + + +// +// tvec4 type explicit instantiation +// +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; +template struct tvec4; + + +// +// tmat2x2 type explicit instantiation +// +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; +template struct tmat2x2; + + +// +// tmat2x3 type explicit instantiation +// +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; +template struct tmat2x3; + + +// +// tmat2x4 type explicit instantiation +// +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; +template struct tmat2x4; + + +// +// tmat3x2 type explicit instantiation +// +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; +template struct tmat3x2; + + +// +// tmat3x3 type explicit instantiation +// +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; +template struct tmat3x3; + + +// +// tmat3x4 type explicit instantiation +// +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; +template struct tmat3x4; + + +// +// tmat4x2 type explicit instantiation +// +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; +template struct tmat4x2; + + +// +// tmat4x3 type explicit instantiation +// +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; +template struct tmat4x3; + + +// +// tmat4x4 type explicit instantiation +// +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; +template struct tmat4x4; + +} // namespace detail +} // namespace glm