resizer demo:

some breaks missing in keyboard switch
added instruction text for which buttons can be pressed

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1699 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
dcnieho 2014-08-27 05:47:05 +00:00
parent a894e63bdd
commit f57980927a

View File

@ -194,7 +194,7 @@ void SampleKeyboard( unsigned char cChar, int nMouseX, int nMouseY )
glutTimerFunc(2000, UnhideTimer, nWindow);
}
glutHideWindow();
break;
case 'p':
case 'P':
@ -214,6 +214,7 @@ void SampleKeyboard( unsigned char cChar, int nMouseX, int nMouseY )
else
glutSetCursor(GLUT_CURSOR_CYCLE);
}
break;
default:
break;
@ -275,6 +276,7 @@ void WindowStatus(int state)
void Redisplay(void)
{
int win = glutGetWindow();
int viewport[4];
if (win==nWindow)
{
@ -291,6 +293,14 @@ void Redisplay(void)
glClear(GL_COLOR_BUFFER_BIT);
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();
glutPostWindowRedisplay(win);
}