Can someone please give me a link to a tutorial that shows how to make menus in c++. Thanks.
This is a discussion on Game Menus within the Game Programming forums, part of the General Programming Boards category; Can someone please give me a link to a tutorial that shows how to make menus in c++. Thanks....
Can someone please give me a link to a tutorial that shows how to make menus in c++. Thanks.
Your mom is like a struct, she has no class
![]()
How many C programmers does it take to screw in a light bulb? One to do it, 99 to tell him how to do it faster.
You know what? There are way too many ways to list them all right here.
Perhaps he ment implementing a menusystem in a game.
Heres what I like to do - branch the game loop to two sections:
The first section is menu section
The second section is the game section
Toggled by a boolean flag you either render the game, or you render the menu - you can also add update functions for the game in the menu too - if you dont want to pause certain events.
As far as menu structure goes i start with a menu item:
Then I might make a class or another struct for actual menu's that has an array of menu items. I push what ever items into what ever menu i want.Code:struct sMenuItem { int top; // top left corner to start drawing menu item int left; int height; // how much space is this item going to take up? int height; media content; // all in one abstract graphic interface for easy art->Render(); :) // .. could be text, could be pictures,could be sound - yippe bool interact; // does this thing interact with user? clicks - mouse over etc. lpfn focus; // function pointer to the fucus function you want to use // .. could vary between graphic items, list items, check box etc. lpfn action; // function pointer to the function this item enacts when clicked sMenuItem *dependant; // this item could control another itme: Ie. the arrow in drop down lists smenuItem *depends; // thsi item might depend on another item: ie. the arrow in drop down lists heh }
I got a lot of ideas working with quake 3 sdk. That thing has been the light unto my path for inspiration I come to realize. I've learned so much tinkering with it.
Either way - I've lost interest in further tutorage on this subject - so instead I'll post some old code for the menu system of my direct x game XWORM! or something like that ....
LOL - after downloading my game source from a siteI gave it to- i remembered how lazy i got with comments. Sorry.
c++->visualc++->directx->opengl->c++;
(it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)
and the .h file has the struct definitions.
Btw, I make no claims as to the cleanliness, effectiveness, or correctness in the coding of, or implimenting of, my ideas.
c++->visualc++->directx->opengl->c++;
(it should be realized my posts are all in a light hearted manner. And should not be taken offense to.)