MCPcopy Create free account
hub / github.com/LibreVR/Revive / TextureFormatToGLFormat

Method TextureFormatToGLFormat

Revive/TextureGL.cpp:64–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64unsigned int TextureGL::TextureFormatToGLFormat(ovrTextureFormat format)
65{
66 switch (format)
67 {
68 case OVR_FORMAT_UNKNOWN: return GL_RGBA;
69 case OVR_FORMAT_B5G6R5_UNORM: return GL_BGR;
70 case OVR_FORMAT_B5G5R5A1_UNORM: return GL_BGRA;
71 case OVR_FORMAT_B4G4R4A4_UNORM: return GL_BGRA;
72 case OVR_FORMAT_R8G8B8A8_UNORM: return GL_RGBA;
73 case OVR_FORMAT_R8G8B8A8_UNORM_SRGB: return GL_RGBA;
74 case OVR_FORMAT_B8G8R8A8_UNORM: return GL_BGRA;
75 case OVR_FORMAT_B8G8R8A8_UNORM_SRGB: return GL_BGRA;
76 case OVR_FORMAT_B8G8R8X8_UNORM: return GL_BGRA;
77 case OVR_FORMAT_B8G8R8X8_UNORM_SRGB: return GL_BGRA;
78 case OVR_FORMAT_R16G16B16A16_FLOAT: return GL_RGBA;
79 case OVR_FORMAT_D16_UNORM: return GL_DEPTH_COMPONENT;
80 case OVR_FORMAT_D24_UNORM_S8_UINT: return GL_DEPTH_STENCIL;
81 case OVR_FORMAT_D32_FLOAT: return GL_DEPTH_COMPONENT;
82 case OVR_FORMAT_D32_FLOAT_S8X24_UINT: return GL_DEPTH_STENCIL;
83 default: return GL_RGBA;
84 }
85}
86
87bool TextureGL::Init(ovrTextureType Type, int Width, int Height, int MipLevels, int SampleCount,
88 int ArraySize, ovrTextureFormat Format, unsigned int MiscFlags, unsigned int BindFlags)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected