added a newly test that it's ColorTest.cpp

This commit is contained in:
HuYingzhuo(hugo/hyzboy) 2023-02-07 22:47:51 +08:00
parent 05ab513b8b
commit 5d9edc35c8
2 changed files with 23 additions and 0 deletions

View File

@ -15,6 +15,8 @@ macro(cm_example_project project_name)
set_property(TARGET ${project_name} PROPERTY FOLDER "CM/Examples")
endmacro()
add_executable(ColorTest ColorTest.cpp)
cm_example_project(ColorTest)
add_executable(GetCpuInfo GetCpuInfo.cpp)
cm_example_project(GetCpuInfo)

21
ColorTest.cpp Normal file
View File

@ -0,0 +1,21 @@
#include<hgl/color/ColorFormat.h>
#include<iostream>
using namespace hgl;
using namespace std;
void half_float_test()
{
const float f_12_34 =12.34f;
const half_float hf_12_23=float2half(12.34f);
const float f_12_23_hf=half2float(hf_12_23);
cout<<"f_12_34="<<f_12_34<<endl;
cout<<"hf_12_23="<<hf_12_23<<endl;
cout<<"f_12_23_hf="<<f_12_23_hf<<endl;
}
void main(int,char **)
{
half_float_test();
}