static UINT uniqueMenuHandler = 1;
/* DEPRICATED, use glutMenuStatusFunc instead. */
-void APIENTRY
+void GLUTAPIENTRY
glutMenuStateFunc(GLUTmenuStateCB menuStateFunc)
{
__glutMenuStatusFunc = (GLUTmenuStatusCB) menuStateFunc;
}
-void APIENTRY
+void GLUTAPIENTRY
glutMenuStatusFunc(GLUTmenuStatusCB menuStatusFunc)
{
__glutMenuStatusFunc = menuStatusFunc;
static void
mapMenu(GLUTmenu * menu, int x, int y)
{
- TrackPopupMenu(menu->win, TPM_LEFTALIGN |
- __glutMenuButton == TPM_RIGHTBUTTON ?
- TPM_RIGHTBUTTON : TPM_LEFTBUTTON,
+ TrackPopupMenu((HMENU) menu->win, TPM_LEFTALIGN |
+ (__glutMenuButton == TPM_RIGHTBUTTON) ? TPM_RIGHTBUTTON : TPM_LEFTBUTTON,
x, y, 0, __glutCurrentWindow->win, NULL);
}
__glutFatalError("menu manipulation not allowed while menus in use.");
}
-int APIENTRY
+int GLUTAPIENTRY
glutCreateMenu(GLUTselectCB selectFunc)
{
GLUTmenu *menu;
menu->cascade = NULL;
menu->highlighted = NULL;
menu->anchor = NULL;
- menu->win = CreatePopupMenu();
+ menu->win = (HWND) CreatePopupMenu();
menuList[menuid] = menu;
__glutSetMenu(menu);
return menuid + 1;
}
-int APIENTRY
+int GLUTAPIENTRY
__glutCreateMenuWithExit(GLUTselectCB selectFunc, void (__cdecl *exitfunc)(int))
{
__glutExitFunc = exitfunc;
return glutCreateMenu(selectFunc);
}
-void APIENTRY
+void GLUTAPIENTRY
glutDestroyMenu(int menunum)
{
GLUTmenu *menu = __glutGetMenuByNum(menunum);
menuModificationError();
}
assert(menu->id == menunum - 1);
- DestroyMenu(menu->win);
+ DestroyMenu( (HMENU) menu->win);
menuList[menunum - 1] = NULL;
/* free all menu entries */
item = menu->list;
free(menu);
}
-int APIENTRY
+int GLUTAPIENTRY
glutGetMenu(void)
{
if (__glutCurrentMenu) {
}
}
-void APIENTRY
+void GLUTAPIENTRY
glutSetMenu(int menuid)
{
GLUTmenu *menu;
item->value = value;
item->unique = uniqueMenuHandler++;
if (isTrigger) {
- AppendMenu(menu->win, MF_POPUP, (UINT)item->win, label);
+ AppendMenu((HMENU) menu->win, MF_POPUP, (UINT)item->win, label);
} else {
- AppendMenu(menu->win, MF_STRING, item->unique, label);
+ AppendMenu((HMENU) menu->win, MF_STRING, item->unique, label);
}
}
-void APIENTRY
+void GLUTAPIENTRY
glutAddMenuEntry(const char *label, int value)
{
GLUTmenuItem *entry;
__glutCurrentMenu->list = entry;
}
-void APIENTRY
+void GLUTAPIENTRY
glutAddSubMenu(const char *label, int menu)
{
GLUTmenuItem *submenu;
__glutCurrentMenu->list = submenu;
}
-void APIENTRY
+void GLUTAPIENTRY
glutChangeToMenuEntry(int num, const char *label, int value)
{
GLUTmenuItem *item;
need to account for submenus. */
item->menu->submenus--;
/* Nuke the Win32 menu. */
- DestroyMenu(item->win);
+ DestroyMenu((HMENU) item->win);
}
free(item->label);
item->len = (int) strlen(label);
item->value = value;
item->unique = uniqueMenuHandler++;
- ModifyMenu(__glutCurrentMenu->win, (UINT) i - 1,
+ ModifyMenu((HMENU) __glutCurrentMenu->win, (UINT) i - 1,
MF_BYPOSITION | MFT_STRING, item->unique, label);
return;
__glutWarning("Current menu has no %d item.", num);
}
-void APIENTRY
+void GLUTAPIENTRY
glutChangeToSubMenu(int num, const char *label, int menu)
{
GLUTmenu *popupmenu;
/* If changing a menu entry to as submenu trigger, we
need to account for submenus. */
item->menu->submenus++;
- item->win = CreatePopupMenu();
+ item->win = (HWND) CreatePopupMenu();
}
free(item->label);
popupmenu = __glutGetMenuByNum(menu);
if (popupmenu)
item->win = popupmenu->win;
- ModifyMenu(__glutCurrentMenu->win, (UINT) i - 1,
+ ModifyMenu((HMENU) __glutCurrentMenu->win, (UINT) i - 1,
MF_BYPOSITION | MF_POPUP, (UINT) item->win, label);
return;
}
__glutWarning("Current menu has no %d item.", num);
}
-void APIENTRY
+void GLUTAPIENTRY
glutRemoveMenuItem(int num)
{
GLUTmenuItem *item, **prev;
/* Patch up menu's item list. */
*prev = item->next;
- RemoveMenu(__glutCurrentMenu->win, (UINT) i - 1, MF_BYPOSITION);
+ RemoveMenu((HMENU) __glutCurrentMenu->win, (UINT) i - 1, MF_BYPOSITION);
free(item->label);
free(item);
__glutWarning("Current menu has no %d item.", num);
}
-void APIENTRY
+void GLUTAPIENTRY
glutAttachMenu(int button)
{
if (__glutCurrentWindow == __glutGameModeWindow) {
__glutCurrentWindow->menu[button] = __glutCurrentMenu->id + 1;
}
-void APIENTRY
+void GLUTAPIENTRY
glutDetachMenu(int button)
{
if (__glutMappedMenu) {