Jump to content
  • Advertisement
Sign in to follow this  
Elahrairah

OpenGL swapping glut menus on Windows?

This topic is 3692 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey genii, take pity on a n00b and help me figure this one out. I'm setting up an openGL environment and I'm using GLUT to handle the right-click menus, including picking (so one menu pops up when you click object A, and a different menu pops up when you click object B). Problem is I'm switching the menus inside my wndproc, where I catch the WM_RBUTTONDOWN event. What I'm doing right now is on the event, I pick to see if I'm on an object, and if I am, I set and attach the appropriate menu. Then, to get the menu to actually show up, I PostMessage another WM_RBUTTONDOWN event. My problem is that I'm crashing every time I select a waypoint. The commented-out code is what's making me crash... bool setWayPtMenu() { /*int tmp = glutGetMenu(); if (tmp != wayPtMenuID); { glutSetMenu(wayPtMenuID); glutAttachMenu(GLUT_RIGHT_BUTTON); return true; }*/ return false; }// end setWayPTMenu And here's how it gets called in the case: WM_RBUTTONDOWN section... if (wayPtSelected) wayPtSelected = FALSE; else wayPtSelected = ps->mousePick((int) LOWORD (lParam), (int) HIWORD (lParam), RightButton); if (wayPtSelected) { ps->debug("Waypoint Picked!\n"); ps->debug("Menu set to Waypoint\n"); switchmade = setWayPtMenu(); } else { ps->debug("Menu set to Regular\n"); switchmade = setRegMenu(); } if ((!wayPtPostedMessage) && (switchmade)) { PostMessage(hWnd, WM_RBUTTONDOWN, wParam, lParam); wayPtPostedMessage = true; } else wayPtPostedMessage = false; Any ideas?

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!