From: Nicolas Blais Newsgroups: comp.os.msdos.djgpp Subject: Small Allegro Problem Date: Thu, 29 Oct 1998 19:53:38 -0500 Organization: Alpha Quark Technologie Lines: 48 Message-ID: <36390E11.B6CAE0F@phreaker.net> NNTP-Posting-Host: ts1-33.f2005.quebectel.com Mime-Version: 1.0 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.5b2 [en] (Win95; I) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hi, I made an small program that goes in graphic mode.  It works great actually, but the problem is that I want the user to know if the text to graphic change was successful.  Here is the code that I used.  It doesn't bug the program, it just goes in a black screen (in text) when I change my gfx_driver to ATI for example (which I don' t have).  But in auto_detect it works fine.
res_x = 800
res_y = 600
color_depth = 15

short engine::init_graphics(ushort res_x, ushort res_y, ushort color_depth)
{
cout << "Loading Graphic system at " << res_x << "x" << res_y << "x" << color_depth << "bits...\n";
clear_keybuf();
fade_out(1);
set_color_depth(color_depth);
short int g_result = set_gfx_mode(GFX_ATI, res_x, res_y, 0, 0); // *** TO CAUSE THE ERROR, WORS IN AUTO_DETECT
if (g_result < 0)
   {
   stop(1);
   textcolor(LIGHTRED);
   cprintf("Error, graphic initialisation failed...Aborting...\n\r");
   cprintf("Possible error(s):\n\r");
   textcolor(WHITE);
   cprintf("%s", allegro_error);
   exit(1);
   }
else cout << endl;
return g_result;
}

void engine::stop(ushort error_num)
{
allegro_exit();
clrscr();
textcolor(WHITE);
textbackground(RED);
cprintf("Stoping Omega Engine                                                            ");
normvideo();
cout << "All systems unloaded..." << error_num << " errors.\n\n";
textcolor(WHITE);
}

Thanks, Nicolas Blais