/// <summary> /// Sets the global menu status callback. /// </summary> /// <param name="func"> /// The new menu status button callback function. See /// <see cref="MenuStatusCallback" />. /// </param> /// <remarks> /// <para> /// <b>glutMenuStatusFunc</b> 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 /// <see cref="GLUT_MENU_IN_USE" /> for its <i>val</i> parameter when pop-up menus /// are in use by the user; and the callback will be called with the value /// <see cref="GLUT_MENU_NOT_IN_USE" /> for its <i>status</i> parameter when /// pop-up menus are no longer in use. The <i>x</i> and <i>y</i> 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 <i>func</i> 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. /// </para> /// <para> /// When the menu status callback is called, the current menu will be set to the /// initial pop-up menu in both the <i>GLUT_MENU_IN_USE</i> and /// <i>GLUT_MENU_NOT_IN_USE</i> cases. The current window will be set to the /// window from which the initial menu was popped up from, also in both cases. /// </para> /// <para> /// Passing <c>null</c> to <b>glutMenuStatusFunc</b> disables the generation of /// the menu status callback. /// </para> /// <para> /// <see cref="glutMenuStateFunc" /> is a deprecated version of the /// <b>glutMenuStatusFunc</b> routine. The only difference is /// <b>glutMenuStateFunc</b> callback prototype does not deliver the two /// additional <i>x</i> and <i>y</i> coordinates. /// </para> /// </remarks> /// <seealso cref="MenuStateCallback" /> /// <seealso cref="MenuStatusCallback" /> /// <seealso cref="glutMenuStateFunc" /> // GLUTAPI void APIENTRY glutMenuStatusFunc(void (GLUTCALLBACK *func)(int status, int x, int y)); public static void glutMenuStatusFunc([In] MenuStatusCallback func) { menuStatusCallback = func; __glutMenuStatusFunc(menuStatusCallback); }
private static extern void __glutMenuStatusFunc(MenuStatusCallback func);