Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9064065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:09:16+00:00 2026-06-16T16:09:16+00:00

I have made a game in OpenGL , and also have added a menu

  • 0

I have made a game in OpenGL, and also have added a menu item. when I right click on the OpenGL Screen, the menu item is displayed and I have added an option “Reset Game” in it. How Can I clear all the variables involved in the game by clicking on this (Any clear or flush function?).

Here is my code

glutCreateMenu(menu);
glutAddMenuEntry("Reset Game", 1);

void menu(int item)
{
    switch (item)
    {
    case 1:
        {
            //Adding a function here to clear all the variables    
        }    
        break;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T16:09:18+00:00Added an answer on June 16, 2026 at 4:09 pm

    You just need to code up the routine to reset all your variables to their default values.

    void Reset()
    {
        score = 0;
        lives = 3;
        // etc.
    }
    

    OpenGL doesn’t know what these are so you have to do it yourself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a multiplayer game using the GameKit Framework where 2 iPhones/iPods can
I have made this board game which can be run on browser, and I
I have made a small number guessing game in Java. My main JFrame(main menu)
I have made a game using HTML5 Canvas Element, Javascript for facebook. You can
I have made a snake game using javascript and HTML5 Canvas element. It can
I have made a flash game for facebook. All happened right expect when I
i have made a option's page where where we can choose fire to auto
All right, so I have made a basic game, in which I made a
I have made it open a full screen window but now how can i
I have made a game which is nearly identical to Popcap's Atomica. ( http://www.popcap.com/gamepopup.php?theGame=atomica

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.