Merge pull request #1572 from erwincoumans/master

explicitly remove textures during resetSimulation
This commit is contained in:
erwincoumans
2018-02-22 08:37:03 -08:00
committed by GitHub
15 changed files with 100 additions and 5 deletions

View File

@@ -962,9 +962,18 @@ int GLInstancingRenderer::registerGraphicsInstance(int shapeIndex, const float*
return newUid;
}
void GLInstancingRenderer::removeTexture(int textureIndex)
{
if ((textureIndex >= 0) && (textureIndex < m_data->m_textureHandles.size()))
{
InternalTextureHandle& h = m_data->m_textureHandles[textureIndex];
glDeleteTextures(1, &h.m_glTexture);
}
}
int GLInstancingRenderer::registerTexture(const unsigned char* texels, int width, int height, bool flipPixelsY)
{
B3_PROFILE("GLInstancingRenderer::registerTexture");
b3Assert(glGetError() ==GL_NO_ERROR);
glActiveTexture(GL_TEXTURE0);