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:
erwin coumans
2013-08-22 23:15:37 -07:00
parent d860e7f51a
commit 2c019d579f
4 changed files with 22 additions and 4 deletions

View File

@@ -64,6 +64,7 @@ static void MyResizeCallback( float width, float height)
b3gWindowInterface* window=0; b3gWindowInterface* window=0;
GwenUserInterface* gui = 0; GwenUserInterface* gui = 0;
bool gPause = false; bool gPause = false;
bool gDrawGui = true;
bool gStep = false; bool gStep = false;
bool gReset = 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) void MyKeyboardCallback(int key, int state)
{ {
if (key=='s' && state)
{
useShadowMap=!useShadowMap;
}
if (key=='g' && state)
{
gDrawGui = !gDrawGui;
}
if (key==B3G_ESCAPE && window) if (key==B3G_ESCAPE && window)
{ {
window->setRequestExit(); window->setRequestExit();
@@ -891,7 +902,7 @@ int main(int argc, char* argv[])
{ {
B3_PROFILE("gui->draw"); B3_PROFILE("gui->draw");
if (gui) if (gui && gDrawGui)
gui->draw(g_OpenGLWidth,g_OpenGLHeight); gui->draw(g_OpenGLWidth,g_OpenGLHeight);
} }
err = glGetError(); err = glGetError();

View File

@@ -1512,7 +1512,7 @@ void GLInstancingRenderer::renderSceneInternal(int renderMode)
#ifndef __APPLE__ #ifndef __APPLE__
glEnable(GL_POINT_SPRITE_ARB); 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 #endif
glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);

View File

@@ -39,7 +39,14 @@ subject to the following restrictions:
#endif //_WINDOWS #endif //_WINDOWS
#endif //APPLE #endif //APPLE
//disable glGetError
//#undef glGetError
//#define glGetError MyGetError
//
//GLenum inline MyGetError()
//{
// return 0;
//}
///on Linux only glDrawElementsInstancedARB is defined?!? ///on Linux only glDrawElementsInstancedARB is defined?!?
//#ifdef __linux //#ifdef __linux

View File

@@ -32,7 +32,7 @@ struct b3Config
m_maxConvexShapes = m_maxConvexBodies; m_maxConvexShapes = m_maxConvexBodies;
m_maxBroadphasePairs = 16*m_maxConvexBodies; m_maxBroadphasePairs = 16*m_maxConvexBodies;
m_maxContactCapacity = m_maxBroadphasePairs; m_maxContactCapacity = m_maxBroadphasePairs;
m_compoundPairCapacity = 16*1524*1024; m_compoundPairCapacity = 1024*1024;
} }
}; };