explicitly remove textures during resetSimulation

move glViewport to Win32Window
This commit is contained in:
erwincoumans
2018-02-21 23:22:16 -08:00
parent 15c46a0237
commit 73a4334e30
16 changed files with 102 additions and 5 deletions

View File

@@ -135,6 +135,7 @@ enum MultiThreadedGUIHelperCommunicationEnums
eGUIHelperChangeGraphicsInstanceTextureId,
eGUIHelperGetShapeIndexFromInstance,
eGUIHelperChangeTexture,
eGUIHelperRemoveTexture,
};
@@ -859,6 +860,17 @@ public:
//m_childGuiHelper->createPhysicsDebugDrawer(rbWorld);
}
int m_removeTextureUid;
virtual void removeTexture(int textureUid)
{
m_removeTextureUid = textureUid;
m_cs->lock();
m_cs->setSharedParam(1, eGUIHelperRemoveTexture);
workerThreadWait();
}
virtual int registerTexture(const unsigned char* texels, int width, int height)
{
m_texels = texels;
@@ -1878,6 +1890,13 @@ void PhysicsServerExample::updateGraphics()
m_multiThreadedHelper->mainThreadRelease();
break;
}
case eGUIHelperRemoveTexture:
{
B3_PROFILE("eGUIHelperRemoveTexture");
m_multiThreadedHelper->m_childGuiHelper->removeTexture(m_multiThreadedHelper->m_removeTextureUid);
m_multiThreadedHelper->mainThreadRelease();
break;
}
case eGUIHelperRegisterGraphicsShape:
{
B3_PROFILE("eGUIHelperRegisterGraphicsShape");