Jump to content
  • Advertisement

Archived

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

adsshepherd

OpenGL Main Menu - PART 2

This topic is 5935 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
Advertisement
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.

Cheers
ADam

Share this post


Link to post
Share on other sites

  • 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!