From bbf4819c01be3c29a2f848236fc2cfbe611e4a4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Thu, 11 Dec 2014 20:17:38 -0800 Subject: [PATCH] Fixed issue #208. --- src/renderer_gl.cpp | 10 +++++++--- src/renderer_gl.h | 4 ---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index cbd13dc64..6516b3d6a 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -204,7 +204,7 @@ namespace bgfx { GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, GL_ZERO, false }, // PTC24 { GL_ZERO, GL_ZERO, GL_ZERO, true }, // Unknown { GL_ZERO, GL_ZERO, GL_ZERO, true }, // R1 - { GL_LUMINANCE, GL_LUMINANCE, GL_UNSIGNED_BYTE, true }, // R8 + { GL_R8, GL_RED, GL_UNSIGNED_BYTE, true }, // R8 { GL_R16, GL_RED, GL_UNSIGNED_SHORT, true }, // R16 { GL_R16F, GL_RED, GL_HALF_FLOAT, true }, // R16F { GL_R32UI, GL_RED, GL_UNSIGNED_INT, true }, // R32 @@ -808,12 +808,16 @@ namespace bgfx bool isTextureFormatValid(TextureFormat::Enum _format) { + const TextureFormatInfo& tfi = s_textureFormat[_format]; + if (GL_ZERO == tfi.m_internalFmt) + { + return false; + } + GLuint id; GL_CHECK(glGenTextures(1, &id) ); GL_CHECK(glBindTexture(GL_TEXTURE_2D, id) ); - const TextureFormatInfo& tfi = s_textureFormat[_format]; - GLsizei size = (16*16*getBitsPerPixel(_format) )/8; void* data = alloca(size); diff --git a/src/renderer_gl.h b/src/renderer_gl.h index 48fd39bbd..48da73f76 100644 --- a/src/renderer_gl.h +++ b/src/renderer_gl.h @@ -88,10 +88,6 @@ typedef uint64_t GLuint64; #include "ovr.h" -#ifndef GL_LUMINANCE -# define GL_LUMINANCE 0x1909 -#endif // GL_LUMINANCE - #ifndef GL_BGRA # define GL_BGRA 0x80E1 #endif // GL_BGRA