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

  • Home
  • SEARCH
  • 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 6333905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:33:22+00:00 2026-05-24T18:33:22+00:00

Here is a sample from Allegro5 tutorial: (to see the original sample, follow the

  • 0

Here is a sample from Allegro5 tutorial: (to see the original sample, follow the link, I’ve simplified it a bit for illustratory purposes.

#include <allegro5/allegro.h>

int main(int argc, char **argv)
{
   ALLEGRO_DISPLAY *display = NULL;
   ALLEGRO_EVENT_QUEUE *event_queue = NULL;
   al_init()
   display = al_create_display(640, 480);
   event_queue = al_create_event_queue();
   al_register_event_source(event_queue, al_get_display_event_source(display));
   al_clear_to_color(al_map_rgb(0,0,0));
   al_flip_display();
   while(1)
   {
      ALLEGRO_EVENT ev;
      ALLEGRO_TIMEOUT timeout;
      al_init_timeout(&timeout, 0.06);
      bool get_event = al_wait_for_event_until(event_queue, &ev, &timeout);
      //-->// if(get_event && ev.type == ALLEGRO_EVENT_DISPLAY_CLOSE) {
      //-->//   break;
      //-->// }

      al_clear_to_color(al_map_rgb(0,0,0));
      al_flip_display();
   }

   al_destroy_display(display);
   al_destroy_event_queue(event_queue);

   return 0;
}

If I don’t manually check for the ALLEGRO_EVENT_DISPLAY_CLOSE, then I can’t close the window or terminate the program (without killing the process through task manager). I understand this. But in this case I don’t understand how the minimize button works without me manually handling it. Can someone please explain?

  • 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-05-24T18:33:24+00:00Added an answer on May 24, 2026 at 6:33 pm

    Disclaimer: I don’t know Allegro.

    Minimizing a window at the most basic level only involves work from the process that deals with the windows (the Window Manager), not the process itself.
    Terminating a program, usually requires files to be closed or memory to be freed or something else that only the process itself can do.

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

Sidebar

Related Questions

i have to learn JQuery. Here is the first sample from their tutorial: <html>
Here is a sample from Kernighan & Ritchie's The C Programming Language: int getline(char
Here is my sample code: from xml.dom.minidom import * def make_xml(): doc = Document()
I got some sample code from the net here: http://www.javadb.com/sending-a-post-request-with-parameters-from-a-java-class That works fine. It
Here is a sample code to retrieve data from a database using the yield
BeautifulSoup newbe... Need help Here is the code sample... from mechanize import Browser from
i am trying to send MMS using code sample from here . I am
Here is a sample program from RWH book. I'm wondering why the first works
While taking lessons in spring3 I coded a sample from a tutorial. I created
here is the sample code: from mechanize import Browser br = Browser() page =

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.