MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / getGFXFormat

Function getGFXFormat

Engine/source/gfx/bitmap/ddsData.h:599–639  ·  view source on GitHub ↗

get GFXFormat from D3DFMT - todo more formats

Source from the content-addressed store, hash-verified

597
598 //get GFXFormat from D3DFMT - todo more formats
599 const GFXFormat getGFXFormat(const D3DFMT format)
600 {
601 switch (format)
602 {
603 //byte
604 case D3DFMT_A4L4: return GFXFormatA4L4;
605 case D3DFMT_L8: return GFXFormatL8;
606 case D3DFMT_A8: return GFXFormatA8;
607 case D3DFMT_A8L8: return GFXFormatA8L8;
608 case D3DFMT_L16: return GFXFormatL16;
609 case D3DFMT_R5G6B5: return GFXFormatR5G6B5;
610 case D3DFMT_A1R5G5B5: return GFXFormatR5G5B5A1;
611 case D3DFMT_R8G8B8: return GFXFormatR8G8B8;
612 case D3DFMT_A8R8G8B8: return GFXFormatR8G8B8A8;
613 case D3DFMT_X8R8G8B8: return GFXFormatR8G8B8A8;
614 case D3DFMT_A8B8G8R8: return GFXFormatB8G8R8A8;
615 case D3DFMT_X8B8G8R8: return GFXFormatB8G8R8A8;
616 //uint
617 case D3DFMT_G16R16: return GFXFormatR16G16;
618 case D3DFMT_A16B16G16R16: return GFXFormatR16G16B16A16;
619 //float
620 case D3DFMT_R16F: return GFXFormatR16F;
621 case D3DFMT_R32F: return GFXFormatR32F;
622 case D3DFMT_G16R16F: return GFXFormatR16G16F;
623 case D3DFMT_A16B16G16R16F: return GFXFormatR16G16B16A16F;
624 case D3DFMT_A32B32G32R32F: return GFXFormatR32G32B32A32F;
625 //compressed
626 case D3DFMT_DXT1: return GFXFormatBC1;
627 case D3DFMT_DXT2:
628 case D3DFMT_DXT3: return GFXFormatBC2;
629 case D3DFMT_DXT4:
630 case D3DFMT_DXT5: return GFXFormatBC3;
631 case D3DFMT_ATI1: return GFXFormatBC4;
632 case D3DFMT_ATI2: return GFXFormatBC5;
633 default:
634 {
635 Con::errorf("dds::getGFXFormat: unknown format");
636 return GFXFormat_FIRST;
637 }
638 }
639 }
640
641 //get GFXFormat from DXGI_FORMAT - todo more formats
642 const GFXFormat getGFXFormat(const DXGI_FORMAT format)

Callers 1

readHeaderMethod · 0.85

Calls 1

errorfFunction · 0.50

Tested by

no test coverage detected