ULRE/inc/hgl/graph/CoordinateSystem.h

29 lines
638 B
C
Raw Normal View History

#pragma once
#include<hgl/TypeFunc.h>
2025-05-05 03:25:19 +08:00
namespace hgl::graph
{
2025-05-05 03:25:19 +08:00
enum class CoordinateSystem2D
{
2025-05-05 03:25:19 +08:00
NDC,
ZeroToOne, //左上角为0,0右下角为1,1
Ortho, //左上角为0,0右下角为(width-1),(height-1)
2025-05-05 03:25:19 +08:00
ENUM_CLASS_RANGE(NDC,Ortho)
};
constexpr const char *CoordinateSystem2DName[]=
{
"NDC",
"0to1",
"Ortho"
};
inline const char *GetCoordinateSystem2DName(const enum class CoordinateSystem2D &cs)
{
RANGE_CHECK_RETURN_NULLPTR(cs)
return CoordinateSystem2DName[size_t(cs)];
}
2025-05-05 03:25:19 +08:00
}//namespace hgl::graph