texture.hpp 418 B

12345678910111213
  1. auto OpenGLTexture::getFormat() const -> GLuint {
  2. if(format == GL_R32I) return GL_RED_INTEGER;
  3. if(format == GL_R32UI) return GL_RED_INTEGER;
  4. return GL_BGRA;
  5. }
  6. auto OpenGLTexture::getType() const -> GLuint {
  7. if(format == GL_R32I) return GL_UNSIGNED_INT;
  8. if(format == GL_R32UI) return GL_UNSIGNED_INT;
  9. if(format == GL_RGB10_A2) return GL_UNSIGNED_INT_2_10_10_10_REV;
  10. return GL_UNSIGNED_INT_8_8_8_8_REV;
  11. }