reduce memory allocation, lack of GPU memory totally destroys performance on my GTX 650M on the Macbook retina
add some keys to toggle gui drawing and shadows
This commit is contained in:
@@ -64,6 +64,7 @@ static void MyResizeCallback( float width, float height)
|
||||
b3gWindowInterface* window=0;
|
||||
GwenUserInterface* gui = 0;
|
||||
bool gPause = false;
|
||||
bool gDrawGui = true;
|
||||
bool gStep = false;
|
||||
bool gReset = false;
|
||||
|
||||
@@ -222,9 +223,19 @@ static void MyMouseButtonCallback(int button, int state, float x, float y)
|
||||
}
|
||||
}
|
||||
|
||||
extern bool useShadowMap;
|
||||
|
||||
void MyKeyboardCallback(int key, int state)
|
||||
{
|
||||
if (key=='s' && state)
|
||||
{
|
||||
useShadowMap=!useShadowMap;
|
||||
}
|
||||
if (key=='g' && state)
|
||||
{
|
||||
gDrawGui = !gDrawGui;
|
||||
}
|
||||
|
||||
if (key==B3G_ESCAPE && window)
|
||||
{
|
||||
window->setRequestExit();
|
||||
@@ -891,7 +902,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
{
|
||||
B3_PROFILE("gui->draw");
|
||||
if (gui)
|
||||
if (gui && gDrawGui)
|
||||
gui->draw(g_OpenGLWidth,g_OpenGLHeight);
|
||||
}
|
||||
err = glGetError();
|
||||
|
||||
@@ -1512,7 +1512,7 @@ void GLInstancingRenderer::renderSceneInternal(int renderMode)
|
||||
|
||||
#ifndef __APPLE__
|
||||
glEnable(GL_POINT_SPRITE_ARB);
|
||||
glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE);
|
||||
// glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE);
|
||||
#endif
|
||||
|
||||
glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
|
||||
|
||||
@@ -39,7 +39,14 @@ subject to the following restrictions:
|
||||
#endif //_WINDOWS
|
||||
#endif //APPLE
|
||||
|
||||
|
||||
//disable glGetError
|
||||
//#undef glGetError
|
||||
//#define glGetError MyGetError
|
||||
//
|
||||
//GLenum inline MyGetError()
|
||||
//{
|
||||
// return 0;
|
||||
//}
|
||||
|
||||
///on Linux only glDrawElementsInstancedARB is defined?!?
|
||||
//#ifdef __linux
|
||||
|
||||
@@ -32,7 +32,7 @@ struct b3Config
|
||||
m_maxConvexShapes = m_maxConvexBodies;
|
||||
m_maxBroadphasePairs = 16*m_maxConvexBodies;
|
||||
m_maxContactCapacity = m_maxBroadphasePairs;
|
||||
m_compoundPairCapacity = 16*1524*1024;
|
||||
m_compoundPairCapacity = 1024*1024;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user