graphicsServer to workaround OpenGL issues on some servers.
This commit is contained in:
@@ -11,6 +11,9 @@
|
||||
#include "../RenderingExamples/RaytracerSetup.h"
|
||||
#include "../RenderingExamples/TinyRendererSetup.h"
|
||||
#include "../RenderingExamples/DynamicTexturedCubeDemo.h"
|
||||
#include "../SharedMemory/GraphicsServerExample.h"
|
||||
#include "../SharedMemory/GraphicsClientExample.h"
|
||||
|
||||
#include "../ForkLift/ForkLiftDemo.h"
|
||||
#include "../MultiThreadedDemo/MultiThreadedDemo.h"
|
||||
#include "../BasicDemo/BasicExample.h"
|
||||
@@ -150,7 +153,10 @@ static ExampleEntry gDefaultExamples[] =
|
||||
PhysicsServerCreateFuncBullet2, PHYSICS_SERVER_ENABLE_COMMAND_LOGGING),
|
||||
ExampleEntry(1, "Physics Server (Replay Log)", "Create a physics server that replay a command log from disk.",
|
||||
PhysicsServerCreateFuncBullet2, PHYSICS_SERVER_REPLAY_FROM_COMMAND_LOG),
|
||||
//
|
||||
ExampleEntry(1, "Graphics Server", "Create a graphics server.",GraphicsServerCreateFuncBullet),
|
||||
ExampleEntry(1, "Graphics Client", "Create a graphics client.", GraphicsClientCreateFunc),
|
||||
|
||||
//
|
||||
// ExampleEntry(1, "Physics Client (Direct)", "Create a physics client that can communicate with a physics server directly in-process.", PhysicsClientCreateFunc,eCLIENTEXAMPLE_DIRECT),
|
||||
|
||||
ExampleEntry(0, "BlockSolver"),
|
||||
|
||||
@@ -1157,17 +1157,22 @@ void OpenGLExampleBrowser::updateGraphics()
|
||||
|
||||
void OpenGLExampleBrowser::update(float deltaTime)
|
||||
{
|
||||
|
||||
b3ChromeUtilsEnableProfiling();
|
||||
|
||||
if (!gEnableRenderLoop && !singleStepSimulation)
|
||||
{
|
||||
B3_PROFILE("updateGraphics");
|
||||
sCurrentDemo->updateGraphics();
|
||||
return;
|
||||
}
|
||||
|
||||
B3_PROFILE("OpenGLExampleBrowser::update");
|
||||
assert(glGetError() == GL_NO_ERROR);
|
||||
s_instancingRenderer->init();
|
||||
//assert(glGetError() == GL_NO_ERROR);
|
||||
{
|
||||
B3_PROFILE("s_instancingRenderer");
|
||||
s_instancingRenderer->init();
|
||||
}
|
||||
DrawGridData dg;
|
||||
dg.upAxis = s_app->getUpAxis();
|
||||
|
||||
@@ -1215,6 +1220,7 @@ void OpenGLExampleBrowser::update(float deltaTime)
|
||||
|
||||
if (gFixedTimeStep > 0)
|
||||
{
|
||||
|
||||
sCurrentDemo->stepSimulation(gFixedTimeStep);
|
||||
}
|
||||
else
|
||||
@@ -1279,22 +1285,25 @@ void OpenGLExampleBrowser::update(float deltaTime)
|
||||
}
|
||||
#endif //#ifndef BT_NO_PROFILE
|
||||
|
||||
if (sUseOpenGL2)
|
||||
{
|
||||
saveOpenGLState(s_instancingRenderer->getScreenWidth() * s_window->getRetinaScale(), s_instancingRenderer->getScreenHeight() * s_window->getRetinaScale());
|
||||
}
|
||||
B3_PROFILE("updateOpenGL");
|
||||
if (sUseOpenGL2)
|
||||
{
|
||||
saveOpenGLState(s_instancingRenderer->getScreenWidth() * s_window->getRetinaScale(), s_instancingRenderer->getScreenHeight() * s_window->getRetinaScale());
|
||||
}
|
||||
|
||||
if (m_internalData->m_gui)
|
||||
{
|
||||
gBlockGuiMessages = true;
|
||||
m_internalData->m_gui->draw(s_instancingRenderer->getScreenWidth(), s_instancingRenderer->getScreenHeight());
|
||||
if (m_internalData->m_gui)
|
||||
{
|
||||
gBlockGuiMessages = true;
|
||||
m_internalData->m_gui->draw(s_instancingRenderer->getScreenWidth(), s_instancingRenderer->getScreenHeight());
|
||||
|
||||
gBlockGuiMessages = false;
|
||||
}
|
||||
gBlockGuiMessages = false;
|
||||
}
|
||||
|
||||
if (sUseOpenGL2)
|
||||
{
|
||||
restoreOpenGLState();
|
||||
if (sUseOpenGL2)
|
||||
{
|
||||
restoreOpenGLState();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user