Merge remote-tracking branch 'svn/trunk' into git_master

This commit is contained in:
Diederick Niehorster 2014-08-27 13:47:24 +08:00
commit 07a7dbd8ca

View File

@ -194,7 +194,7 @@ void SampleKeyboard( unsigned char cChar, int nMouseX, int nMouseY )
glutTimerFunc(2000, UnhideTimer, nWindow); glutTimerFunc(2000, UnhideTimer, nWindow);
} }
glutHideWindow(); glutHideWindow();
break;
case 'p': case 'p':
case 'P': case 'P':
@ -214,6 +214,7 @@ void SampleKeyboard( unsigned char cChar, int nMouseX, int nMouseY )
else else
glutSetCursor(GLUT_CURSOR_CYCLE); glutSetCursor(GLUT_CURSOR_CYCLE);
} }
break;
default: default:
break; break;
@ -275,6 +276,7 @@ void WindowStatus(int state)
void Redisplay(void) void Redisplay(void)
{ {
int win = glutGetWindow(); int win = glutGetWindow();
int viewport[4];
if (win==nWindow) if (win==nWindow)
{ {
@ -291,6 +293,14 @@ void Redisplay(void)
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
DrawQuad(); DrawQuad();
if (win==nWindow)
{
glColor3f(1, 1, 0);
glGetIntegerv(GL_VIEWPORT, viewport);
glRasterPos2i(2, -glutBitmapHeight(GLUT_BITMAP_9_BY_15)+3+viewport[3]);
glutBitmapString(GLUT_BITMAP_9_BY_15, (unsigned char*)"press f/r/m/d/c/i/h/p");
}
glutSwapBuffers(); glutSwapBuffers();
glutPostWindowRedisplay(win); glutPostWindowRedisplay(win);
} }