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;
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();