Advertisement Jump to content


This topic is now archived and is closed to further replies.


OpenGL Main Menu - PART 2

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

Thanks to all who replied to my earlier forum, Still having probs though: Resource file contains all the suggested code, and I have the resource.h file etc... Im initialising the menu using: wndclass.lpszMenuName = szAppName (Where szAppName = name of menu or name of resource file...I tried them both) Not sure what else I need to put in, but it doesnt work. If anyone has any ideas of sample code, I would love to hear them... thanks to you all. Adam

Share this post

Link to post
Share on other sites
Post the first line of menu definition from .rc file. Post szAppName definition. Do you #define your menu identifier as a number?

Edit: you should've posted this in your other thread rather than starting a new one.

What exactly do you mean by "doesn't work"?

[edited by - IndirectX on April 21, 2002 3:02:03 AM]

Share this post

Link to post
Share on other sites
The Nehe''s basecode is not exactly standard, so the first thing to do is compare a "win32 hello world" created by visual c++ with the code you''re having.

One of the things that I notice first, is the lack of TranslateMessage() in the message loop. I think the os only sends WM_KEYUP and WM_KEYDOWN to windows, and this function converts this messages to WM_CHAR and others (Hope I''m right!). Maybe menus need such messages, try adding it!

In the mail you sent me, you use GetMenu() in the WM_COMMAND handler. This is not necessary! In WM_COMMAND you only respond to commands sent by the menu, like ID_OPEN_FILE, or ID_ABOUT or whatever your menu has the options to.

The menu displaying/operation is completly automatic once it is created properly. You need to add it to the project''s resources and to the WNDCLASSEX struct created in RegisterWindowClass(). Check that in MSDN.

In the previous forum post, I mentioned you should call DefWindowProc in the WM_PAINT message. The basecode''s WndProc doesn''t do anything to do with that message and calls DefWindowProc at the end! I was only supposing you could have changed something.

Good luck! Hope I''m not being very confusing

Share this post

Link to post
Share on other sites
Thanks to you all...

Got it sorted yesterday. I didnt realise that your main source code, resource file and menu name all had to be the same for it to work...

THanks again.

Now just got to get this face lipsyncing with the sapi and its all good.


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!