Pārlūkot izejas kodu

gpu: fix compilation on platforms that don't have GL_BGRA.

undefined
Sam Hocevar pirms 10 gadiem
vecāks
revīzija
5fcc47b74c
1 mainītis faili ar 9 papildinājumiem un 1 dzēšanām
  1. +9
    -1
      src/gpu/framebuffer.cpp

+ 9
- 1
src/gpu/framebuffer.cpp Parādīt failu

@@ -173,7 +173,11 @@ uint32_t FramebufferFormat::GetFormat()
case RGBA_32:
case RGBA_32_I:
case RGBA_32_UI:
# if defined GL_BGRA
case RGBA_32_F: return (m_invert_rgb)?(GL_BGRA):(GL_RGBA);
# else
case RGBA_32_F: return GL_RGBA;
# endif
#else
case R_8: return GL_R8;
case R_8_I: return GL_R8I;
@@ -290,7 +294,11 @@ uint32_t FramebufferFormat::GetFormatOrder()
case RGBA_8: case RGBA_8_I: case RGBA_8_UI: case RGBA_8_F:
case RGBA_16: case RGBA_16_I: case RGBA_16_UI: case RGBA_16_F:
case RGBA_32: case RGBA_32_I: case RGBA_32_UI: case RGBA_32_F:
# if defined GL_BGRA
return (m_invert_rgb)?(GL_BGRA):(GL_RGBA);
# else
return GL_RGBA;
# endif
#endif
default:
ASSERT(false, "unknown framebuffer format order %d", m_format);
@@ -457,7 +465,7 @@ Image Framebuffer::GetImage() const
#else
u8vec4 *buffer = ret.Lock<PixelFormat::RGBA_8>();
glReadPixels(0, 0, m_data->m_size.x, m_data->m_size.y,
GL_BGRA, GL_UNSIGNED_BYTE, buffer);
GL_RGBA, GL_UNSIGNED_BYTE, buffer);
ret.Unlock(buffer);
#endif



Notiek ielāde…
Atcelt
Saglabāt