Windows Menu or Own
Windows Menu or Own
I was wondering if most games used windows api menus or if they made their own system?
Computer too slow? Consider running a VM on your toaster.
Re: Windows Menu or Own
i would say that most games use their own system, but you can use whichever method you prefer (and well using chili framework, windows api method wouldn't be easy to connect with it)
always available, always on, about ~10 years c/c++, java[script], win32/directx api, [x]html/css/php/some asp/sql experience. (all self taught)
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat --
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat --
Re: Windows Menu or Own
Ok, I am working on my own system right now, I was just making sure it wasnt pointless.
Computer too slow? Consider running a VM on your toaster.
Re: Windows Menu or Own
Hi cameron,
I got a windows menu working in my missile command, but then decided it is pointless having two menus and removed the windows menu.
Basically all you have to do is to set it up in winmain, and just pass the result to the game
I had my gamestates setup in game.h
Then I set up my menu
And finally pass my menu to the game
It worked, but then I thought it was a waste of time having two menus, and took it out LOL.
I got a windows menu working in my missile command, but then decided it is pointless having two menus and removed the windows menu.
Basically all you have to do is to set it up in winmain, and just pass the result to the game
I had my gamestates setup in game.h
Code: Select all
enum GameState
{
Menu,
Level,
Running,
MenuPause,
RunGame
};
Code: Select all
LRESULT WINAPI MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
switch( msg )
{
case WM_CREATE:
{
HMENU hMenubar = CreateMenu();
HMENU hfile= CreateMenu();
HMENU hOptions=CreateMenu();
AppendMenu (hMenubar,MF_POPUP,(UINT_PTR)hfile,L"File");
AppendMenu (hMenubar,MF_POPUP,ID_ABOUT,L"About");
AppendMenu (hfile, MF_STRING, ID_START,L"Start");
AppendMenu (hfile, MF_STRING, ID_FILE_EXIT,L"Exit");
SetMenu(hWnd, hMenubar);
break;
}
And finally pass my menu to the game
Code: Select all
while( msg.message != WM_QUIT )
{
if( PeekMessage( &msg,NULL,0,0,PM_REMOVE ) )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
else
{
//ShowCursor(false);
if (start){theGame.Gamestate=RunGame;}
start=false;
theGame.Go();
}
}
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk
Re: Windows Menu or Own
I got my menu system working basically, I have a few different menu types: menu, menu link, menu back,and menu dropdown. Each of these links to a menuwindow class( it is not an actual window just a thing that holds all the menu classes for that time I guess you could say ). And each menu link and menu back links to a menuwindow. It works but I don't know if this is an efficient way of doing it.
Computer too slow? Consider running a VM on your toaster.
Re: Windows Menu or Own
All I really have to do is link a bunch of menus to windows in game.cpp and call do(); on the first menu link. BTW it uses vectors so I don't know if that will be a slowdown problem.
Computer too slow? Consider running a VM on your toaster.