View Full Version : Creating menus in an opengl window???
03-05-2001, 08:41 AM
Does anyone know how to create a menu such as file edit etc in an opengl window. i am not using glut i am using nehe tutorials. I know how to do it in vc++ but how in opengl. is it when you create you window and you pass a parameter. Any suggesstions are most welcome.
03-05-2001, 11:43 AM
You can't use Windows GDI functions in conjunction with OpenGL. You will have to draw your own menus.
03-05-2001, 03:27 PM
It definitely IS possible to use menus with OpenGL. I'm assuming you are using the Win32 API for menu creation since you said you used the Nehe tutorials. All you have to do is to create a menu resource, then use that id as a parameter to CreateWindow, and as the hMenu member of the WNDCLASS that you register. You then check for the WM_COMMAND message for menu commands, where the WPARAM
is the notification code and identifier of the menu option that generated the event.
So... if you have a file->new option that you gave the ID FILE_NEW, you could use something like this in the WM_COMMAND case of your message handler
// do whatever
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.