Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

glutmenustatusfunc(3glut) [osx man page]

glutMenuStatusFunc(3GLUT)					       GLUT						 glutMenuStatusFunc(3GLUT)

NAME
glutMenuStatusFunc - sets the global menu status callback. SYNTAX
#include <GLUT/glut.h> void glutMenuStatusFunc(void (*func)(int status, int x, int y)); void glutMenuStateFunc(void (*func)(int status)); ARGUMENTS
func The new menu status (or state) callback function. DESCRIPTION
glutMenuStatusFunc sets the global menu status callback so a GLUT program can determine when a menu is in use or not. When a menu status callback is registered, it will be called with the value GLUT_MENU_IN_USE for its value parameter when pop-up menus are in use by the user; and the callback will be called with the value GLUT_MENU_NOT_IN_USE for its status parameter when pop-up menus are no longer in use. The x and y parameters indicate the location in window coordinates of the button press that caused the menu to go into use, or the location where the menu was released (may be outside the window). The func parameter names the callback function. Other callbacks continue to operate (except mouse motion callbacks) when pop-up menus are in use so the menu status callback allows a program to suspend animation or other tasks when menus are in use. The cascading and unmapping of sub-menus from an initial pop-up menu does not generate menu status callbacks. There is a single menu status callback for GLUT. When the menu status callback is called, the current menu will be set to the initial pop-up menu in both the GLUT_MENU_IN_USE and GLUT_MENU_NOT_IN_USE cases. The current window will be set to the window from which the initial menu was popped up from, also in both cases. Passing NULL to glutMenuStatusFunc disables the generation of the menu status callback. glutMenuStateFunc is a deprecated version of the glutMenuStatusFunc routine. The only difference is glutMenuStateFunc callback prototype does not deliver the two additional x and y coordinates. SEE ALSO
glutCreateMenu, glutCreateWindow AUTHOR
Mark J. Kilgard (mjk@nvidia.com) GLUT
3.7 glutMenuStatusFunc(3GLUT)

Check Out this Related Man Page

glutIdleFunc(3GLUT)						       GLUT						       glutIdleFunc(3GLUT)

NAME
glutIdleFunc - sets the global idle callback. SYNTAX
#include <GLUT/glut.h> void glutIdleFunc(void (*func)(void)); ARGUMENTS
func The new idle callback function. DESCRIPTION
glutIdleFunc sets the global idle callback to be func so a GLUT program can perform background processing tasks or continuous animation when window system events are not being received. If enabled, the idle callback is continuously called when events are not being received. The callback routine has no parameters. The current window and current menu will not be changed before the idle callback. Programs with multiple windows and/or menus should explicitly set the current window and/or current menu and not rely on its current setting. The amount of computation and rendering done in an idle callback should be minimized to avoid affecting the program's interactive response. In general, not more than a single frame of rendering should be done in an idle callback. Passing NULL to glutIdleFunc disables the generation of the idle callback. EXAMPLE
A typical idle callback to animate a window might look like: void idle(void) { time += 0.05; glutSetWindow(window); glutPostRedisplay(); } Notice how the idle callback does not do any actual drawing; it only advances the time scene state global variable. That is left to the window's display callback which will be triggered by the call to glutPostRedisplay. If you use the idle callback for animation, you should be sure to stop rendering when the window is not visible. This is easy to set up with a visibility callback. For example: void visible(int vis) { if (vis == GLUT_VISIBLE) glutIdleFunc(idle); else glutIdleFunc(NULL); } If you do use the idle callback for animation, one thing you should not do is setup the idle callback before calling glutMainLoop. It is much better to use the visibility callback to install idle callback when the window first becomes visible on the screen. SEE ALSO
glutTimerFunc, glutVisibilityFunc AUTHOR
Mark J. Kilgard (mjk@nvidia.com) GLUT
3.7 glutIdleFunc(3GLUT)
Man Page