mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 09:08:22 -05:00
Fixed NaCl crash.
This commit is contained in:
parent
ea34b9476c
commit
aadd9bd1c1
1 changed files with 5 additions and 2 deletions
|
@ -670,13 +670,16 @@ namespace bgfx
|
||||||
|
|
||||||
const TextureFormatInfo& tfi = s_textureFormat[_format];
|
const TextureFormatInfo& tfi = s_textureFormat[_format];
|
||||||
|
|
||||||
|
GLsizei size = (16*16*getBitsPerPixel(_format) )/8;
|
||||||
|
void* data = alloca(size);
|
||||||
|
|
||||||
if (isCompressed(_format) )
|
if (isCompressed(_format) )
|
||||||
{
|
{
|
||||||
glCompressedTexImage2D(GL_TEXTURE_2D, 0, tfi.m_internalFmt, 16, 16, 0, (16*16*getBitsPerPixel(_format) )/8, NULL);
|
glCompressedTexImage2D(GL_TEXTURE_2D, 0, tfi.m_internalFmt, 16, 16, 0, size, data);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, tfi.m_internalFmt, 16, 16, 0, tfi.m_fmt, tfi.m_type, NULL);
|
glTexImage2D(GL_TEXTURE_2D, 0, tfi.m_internalFmt, 16, 16, 0, tfi.m_fmt, tfi.m_type, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
GLenum err = glGetError();
|
GLenum err = glGetError();
|
||||||
|
|
Loading…
Reference in a new issue