File indexing completed on 2026-04-09 07:49:18
0001 #include <cassert>
0002
0003 #include <glm/glm.hpp>
0004 #include "OPTICKS_LOG.hh"
0005 #include "SGLM.h"
0006
0007
0008 void test_GetEVec()
0009 {
0010 glm::vec3 v(0.f, 0.f, 0.f );
0011 SGLM::GetEVec(v, "VEC3" , "1,2,3" );
0012
0013 assert( v.x == 1.f );
0014 assert( v.y == 2.f );
0015 assert( v.z == 3.f );
0016
0017 const char* key = "VEC4" ;
0018
0019 glm::vec4 f(SGLM::EVec4(key, "10,20,30,40", 40.f ));
0020
0021 LOG(info) << std::setw(10) << key << SGLM::Present(f) ;
0022
0023 assert( f.x == 10.f );
0024 assert( f.y == 20.f );
0025 assert( f.z == 30.f );
0026 assert( f.w == 40.f );
0027 }
0028
0029
0030 void test_Narrow()
0031 {
0032 glm::tmat4x4<double> md = SGLM::DemoMatrix<double>(1.);
0033 glm::tmat4x4<float> mf = SGLM::DemoMatrix<float>(2.f);
0034 std::cout << "SGLM::DemoMatrix<double> md " << std::endl << SGLM::Present_<double>(md) << std::endl ;
0035 std::cout << "SGLM::DemoMatrix<float> mf" << std::endl << SGLM::Present_<float>(mf) << std::endl ;
0036
0037 mf = md ;
0038 std::cout << "SGLM::DemoMatrix<float> mf (after mf = md )" << std::endl << SGLM::Present_<float>(mf) << std::endl ;
0039 }
0040
0041
0042
0043 int main(int argc, char** argv)
0044 {
0045 OPTICKS_LOG(argc, argv);
0046
0047 test_GetEVec();
0048 test_Narrow();
0049
0050 return 0 ;
0051 }