mirror of
https://github.com/bulletphysics/bullet3
synced 2025-01-19 05:20:06 +00:00
Merge pull request #237 from erwincoumans/master
escape quits SimpleOpenGLApp
This commit is contained in:
commit
3205f71e5e
@ -48,13 +48,27 @@ struct SimpleInternalData
|
||||
|
||||
static SimpleOpenGL3App* gApp=0;
|
||||
|
||||
void SimpleResizeCallback( float width, float height)
|
||||
static void SimpleResizeCallback( float width, float height)
|
||||
{
|
||||
gApp->m_instancingRenderer->resize(width,height);
|
||||
gApp->m_primRenderer->setScreenSize(width,height);
|
||||
|
||||
}
|
||||
|
||||
static void SimpleKeyboardCallback(int key, int state)
|
||||
{
|
||||
if (key==B3G_ESCAPE && gApp && gApp->m_window)
|
||||
{
|
||||
gApp->m_window->setRequestExit();
|
||||
} else
|
||||
{
|
||||
b3DefaultKeyboardCallback(key,state);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
static GLuint BindFont(const CTexFont *_Font)
|
||||
{
|
||||
GLuint TexID = 0;
|
||||
@ -135,8 +149,8 @@ SimpleOpenGL3App::SimpleOpenGL3App( const char* title, int width,int height)
|
||||
|
||||
m_window->setMouseMoveCallback(b3DefaultMouseMoveCallback);
|
||||
m_window->setMouseButtonCallback(b3DefaultMouseButtonCallback);
|
||||
m_window->setKeyboardCallback(b3DefaultKeyboardCallback);
|
||||
m_window->setWheelCallback(b3DefaultWheelCallback);
|
||||
m_window->setKeyboardCallback(SimpleKeyboardCallback);
|
||||
m_window->setWheelCallback(b3DefaultWheelCallback);
|
||||
m_window->setResizeCallback(SimpleResizeCallback);
|
||||
|
||||
TwGenerateDefaultFonts();
|
||||
|
Loading…
Reference in New Issue
Block a user