MCPcopy Create free account
hub / github.com/carbonengine/trinity / ToString

Function ToString

trinity/Tr2GpuResourcePool.cpp:55–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55std::string ToString( const Tr2BitmapDimensions& desc )
56{
57 char buf[128];
58 switch( desc.GetType() )
59 {
60 case ImageIO::TEX_TYPE_1D:
61 sprintf_s( buf, "1D %u fmt=%u", desc.GetWidth(), (uint32_t)desc.GetFormat() );
62 break;
63 case ImageIO::TEX_TYPE_2D:
64 sprintf_s( buf, "2D %ux%u fmt=%u", desc.GetWidth(), desc.GetHeight(), (uint32_t)desc.GetFormat() );
65 break;
66 case ImageIO::TEX_TYPE_3D:
67 sprintf_s( buf, "3D %ux%ux%u fmt=%u", desc.GetWidth(), desc.GetHeight(), desc.GetDepth(), (uint32_t)desc.GetFormat() );
68 break;
69 case ImageIO::TEX_TYPE_CUBE:
70 sprintf_s( buf, "Cube %ux%u fmt=%u", desc.GetWidth(), desc.GetHeight(), (uint32_t)desc.GetFormat() );
71 break;
72 default:
73 strcpy_s( buf, "Invalid type" );
74 break;
75 }
76 return std::string( buf );
77}
78
79}
80

Callers 2

GetTempTextureMethod · 0.70
GetPersistentTextureMethod · 0.70

Calls 5

GetTypeMethod · 0.45
GetWidthMethod · 0.45
GetFormatMethod · 0.45
GetHeightMethod · 0.45
GetDepthMethod · 0.45

Tested by

no test coverage detected