| 8 | #include <openxr/openxr_platform.h> |
| 9 | |
| 10 | unsigned int ovrTextureSwapChainGL::TextureFormatToGLFormat(ovrTextureFormat format) |
| 11 | { |
| 12 | switch (format) |
| 13 | { |
| 14 | case OVR_FORMAT_UNKNOWN: return GL_RGBA8; |
| 15 | case OVR_FORMAT_B5G6R5_UNORM: return GL_RGB565; |
| 16 | case OVR_FORMAT_B5G5R5A1_UNORM: return GL_RGB5_A1; |
| 17 | case OVR_FORMAT_B4G4R4A4_UNORM: return GL_RGBA4; |
| 18 | case OVR_FORMAT_R8G8B8A8_UNORM: return GL_RGBA8; |
| 19 | case OVR_FORMAT_R8G8B8A8_UNORM_SRGB: return GL_SRGB8_ALPHA8; |
| 20 | case OVR_FORMAT_B8G8R8A8_UNORM: return GL_RGBA8; |
| 21 | case OVR_FORMAT_B8G8R8A8_UNORM_SRGB: return GL_SRGB8_ALPHA8; |
| 22 | case OVR_FORMAT_B8G8R8X8_UNORM: return GL_RGBA8; |
| 23 | case OVR_FORMAT_B8G8R8X8_UNORM_SRGB: return GL_SRGB8_ALPHA8; |
| 24 | case OVR_FORMAT_R16G16B16A16_FLOAT: return GL_RGBA16F; |
| 25 | case OVR_FORMAT_D16_UNORM: return GL_DEPTH_COMPONENT16; |
| 26 | case OVR_FORMAT_D24_UNORM_S8_UINT: return GL_DEPTH24_STENCIL8; |
| 27 | case OVR_FORMAT_D32_FLOAT: return GL_DEPTH_COMPONENT32F; |
| 28 | case OVR_FORMAT_D32_FLOAT_S8X24_UINT: return GL_DEPTH32F_STENCIL8; |
| 29 | default: return GL_RGBA8; |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | ovrResult ovrTextureSwapChainGL::Create(ovrSession session, const ovrTextureSwapChainDesc* desc, ovrTextureSwapChain* out_TextureSwapChain) |
| 34 | { |
nothing calls this directly
no outgoing calls
no test coverage detected