Jump to content
  • Advertisement

Archived

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

ZoomBoy

Game Loop Control

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

Hi I''ve got a problem with program flow My program goes through a process that keeps watch of the timer and keeps page flipping each frame I''ve got { check keys // this is somewhat out of place if (time == right) UpdateFrame } UpdateFrame { PaintScreen if (Menu) PaintMenu get mouseinfo process_page(mouseinfo) } process_page(mouseinfo) { // this moves process control over to the MenuFunction if (have Menulist on screen) DoMenuFunction(); return; LoopThruActors { Actor-Check out my web-site

Share this post


Link to post
Share on other sites
Advertisement
If you''re talking about the MessageBox api call, you have to acknowledge the message before you can continue processing your screen. Otherwise the best thing to do would be to draw your own message and when the user clicks the mouse go through your list of objects to see which one has been hit and act accordingly.

Hope this helps.

--Antz
Quanta
http://quanta.virtualave.net

Share this post


Link to post
Share on other sites
Ya, I''ve decided that the best way to do what I want is
to set up a MessageBox Object
Besides initializing the size, message, Yes/No buttons etc. I''ve decided to store the pointer to a ScreenPaint() function in the object.

so in the main Process

process_page(mouseinfo)
{
// this moves process control over to the MenuFunction
if (have Menulist on screen) DoMenuFunction(); return;
LoopThruActors
{ Actor-
From mousinfo findAreaonScreen
Process Screen + Mouse interactions //clicking and the rest
{
case AREA: OnArea()
pMessageBox = New MessageBox(initvalues)
int nResult = pMessageBox->Process()
}

And in pMessageBox->Process()
int MessageBox:rocess()
{
GetMousInfo(MouseInfo);
while (TestMessage(MouseInfo) != YESorNOorCANCEL)
{
PaintScreen(); // making sure I don''t do process_map or I''m endlessly hooped
GetMousInfo(MouseInfo);
}


Thanks for letting me talk it out


ZoomBoy
A 2D RPG with skills, weapons, and adventure.
See my character editor, Tile editor and diary at
Check out my web-site


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!