Allow InProcessExampleBrowser to use a malloc allocated memory block, instead of system shared memory.

Make shared memory client/server a bit more robust, in case the server is terminated early.
This commit is contained in:
erwincoumans
2016-03-10 14:36:46 -08:00
parent 40a9b8cea0
commit efbb1edecc
19 changed files with 186 additions and 23 deletions

View File

@@ -49,6 +49,7 @@ static CommonParameterInterface* s_parameterInterface=0;
static CommonRenderInterface* s_instancingRenderer=0;
static OpenGLGuiHelper* s_guiHelper=0;
static MyProfileWindow* s_profWindow =0;
static SharedMemoryInterface* sSharedMem = 0;
#define DEMO_SELECTION_COMBOBOX 13
const char* startFileName = "0_Bullet3Demo.txt";
@@ -326,6 +327,7 @@ void selectDemo(int demoIndex)
int option = gAllExamples->getExampleOption(demoIndex);
s_guiHelper= new OpenGLGuiHelper(s_app, sUseOpenGL2);
CommonExampleOptions options(s_guiHelper, option);
options.m_sharedMem = sSharedMem;
sCurrentDemo = (*func)(options);
if (sCurrentDemo)
{
@@ -1078,3 +1080,8 @@ void OpenGLExampleBrowser::update(float deltaTime)
gui->forceUpdateScrollBars();
}
void OpenGLExampleBrowser::setSharedMemoryInterface(class SharedMemoryInterface* sharedMem)
{
sSharedMem = sharedMem;
}