Jump to content
  • Advertisement
Sign in to follow this  
Gazzall50

OpenGL Make a menu after a right click on the mouse

This topic is 4949 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

Hi, I am making a 3D chess using WIN32 and OpenGL I have already my menu that I made using openGL square. But I would like a menu when the user click right on the mouse. like (enable view ...) I would like the piece of code to show how add the menu entity after a right clcik. Thanks Gazzall

Share this post


Link to post
Share on other sites
Advertisement
I don't know exactly, but such menus are called 'context menus'. Perhaps you can google on that term and find out more.

Greetz (again),

Illco

Share this post


Link to post
Share on other sites
Yes, there should be plenty of info available on text menu's. What you basically should do is receiving the WM_RBUTTONDOWN message (or WM_CONTEXTMENU). In both cases you should get the current mouse cursor position and convert that to screen coordinates. Then there is a windows function, can't recall its name that will display the menu (TrackPopupMenu or something like that).

Hope this helps a bit.

Share this post


Link to post
Share on other sites
Hey


Probably you can use this thing

glutCreateMenu(quit_menu);
glutAddMenuEntry("quit",1);
glutAttachMenu(GLUT_RIGHT_BUTTON);

And then something like

void quit_menu(int id)
{
if(id ==1) exit (0);
}

Hope this helps you.

GK

Share this post


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

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!