Results 1 to 3 of 3

Thread: Creating menus in an opengl window???

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2000
    Posts
    14

    Creating menus in an opengl window???

    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.
    fyp2001

  2. #2
    Junior Member Newbie
    Join Date
    Sep 2000
    Posts
    15

    Re: Creating menus in an opengl window???

    You can't use Windows GDI functions in conjunction with OpenGL. You will have to draw your own menus.

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: Creating menus in an opengl window???

    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

    switch(LOWORD(wParam))
    {
    case FILE_NEW:
    // do whatever
    blah;
    }
    Deiussum
    Software Engineer and OpenGL enthusiast

Similar Threads

  1. OpenGL Creating Window
    By killermud in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-15-2013, 08:42 AM
  2. using opengl without creating window
    By shivmitra in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 07-02-2011, 05:40 AM
  3. Need some help with creating menus
    By linuxfan in forum OpenGL: Linux
    Replies: 4
    Last Post: 02-13-2011, 04:06 AM
  4. Creating Optimal OpenGL Window
    By Furrage in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 04-16-2002, 07:07 AM
  5. GLUT & OS 9: Window draws over menus...
    By hmmwv19 in forum OpenGL: macOS
    Replies: 1
    Last Post: 04-04-2002, 12:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean