App_PhysicsServer_SharedMemory_VR: expose max_num_object_capacity and max_shape_capacity_in_bytes (and shared_memory_key)
Default values are: int maxNumObjectCapacity = 128 * 1024; int maxShapeCapacityInBytes = 128 * 1024 * 1024; int shared_memory_key = -1
This commit is contained in:
@@ -295,7 +295,7 @@ static void printGLString(const char *name, GLenum s) {
|
||||
bool sOpenGLVerbose = true;
|
||||
|
||||
|
||||
SimpleOpenGL3App::SimpleOpenGL3App( const char* title, int width,int height, bool allowRetina)
|
||||
SimpleOpenGL3App::SimpleOpenGL3App(const char* title, int width, int height, bool allowRetina, int maxNumObjectCapacity, int maxShapeCapacityInBytes)
|
||||
{
|
||||
gApp = this;
|
||||
|
||||
@@ -369,7 +369,7 @@ SimpleOpenGL3App::SimpleOpenGL3App( const char* title, int width,int height, boo
|
||||
|
||||
b3Assert(glGetError() ==GL_NO_ERROR);
|
||||
|
||||
m_instancingRenderer = new GLInstancingRenderer(128*1024,128*1024*1024);
|
||||
m_instancingRenderer = new GLInstancingRenderer(maxNumObjectCapacity, maxShapeCapacityInBytes);
|
||||
|
||||
m_primRenderer = new GLPrimitiveRenderer(width,height);
|
||||
|
||||
|
||||
@@ -16,7 +16,8 @@ struct SimpleOpenGL3App : public CommonGraphicsApp
|
||||
class GLInstancingRenderer* m_instancingRenderer;
|
||||
virtual void setBackgroundColor(float red, float green, float blue);
|
||||
|
||||
SimpleOpenGL3App(const char* title, int width,int height, bool allowRetina=true);
|
||||
SimpleOpenGL3App(const char* title, int width,int height, bool allowRetina=true, int maxNumObjectCapacity = 128 * 1024, int maxShapeCapacityInBytes = 128 * 1024 * 1024);
|
||||
|
||||
virtual ~SimpleOpenGL3App();
|
||||
|
||||
virtual int registerCubeShape(float halfExtentsX=1.f,float halfExtentsY=1.f, float halfExtentsZ = 1.f, int textureIndex = -1, float textureScaling = 1);
|
||||
|
||||
@@ -28,9 +28,12 @@
|
||||
|
||||
#include "LinearMath/btIDebugDraw.h"
|
||||
int gSharedMemoryKey = -1;
|
||||
int gDebugDrawFlags = 0;
|
||||
bool gDisplayDistortion = false;
|
||||
bool gDisableDesktopGL = false;
|
||||
static int gDebugDrawFlags = 0;
|
||||
static bool gDisplayDistortion = false;
|
||||
static bool gDisableDesktopGL = false;
|
||||
|
||||
static int maxNumObjectCapacity = 128 * 1024;
|
||||
static int maxShapeCapacityInBytes = 128 * 1024 * 1024;
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -477,7 +480,8 @@ bool CMainApplication::BInit()
|
||||
SDL_GL_SetAttribute( SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG );
|
||||
|
||||
*/
|
||||
m_app = new SimpleOpenGL3App("SimpleOpenGL3App",m_nWindowWidth,m_nWindowHeight,true);
|
||||
|
||||
m_app = new SimpleOpenGL3App("SimpleOpenGL3App",m_nWindowWidth,m_nWindowHeight,true, maxNumObjectCapacity, maxShapeCapacityInBytes);
|
||||
|
||||
|
||||
sGuiPtr = new OpenGLGuiHelper(m_app,false);
|
||||
@@ -2354,6 +2358,9 @@ int main(int argc, char *argv[])
|
||||
b3ChromeUtilsEnableProfiling();
|
||||
}
|
||||
|
||||
args.GetCmdLineArgument("max_num_object_capacity", maxNumObjectCapacity);
|
||||
args.GetCmdLineArgument("max_shape_capacity_in_bytes", maxShapeCapacityInBytes);
|
||||
args.GetCmdLineArgument("shared_memory_key", gSharedMemoryKey);
|
||||
|
||||
#ifdef BT_USE_CUSTOM_PROFILER
|
||||
b3SetCustomEnterProfileZoneFunc(dcEnter);
|
||||
|
||||
Reference in New Issue
Block a user