Mail Archives: djgpp/1998/10/29/22:20:05
From: | Nicolas Blais <alphaqt AT phreaker DOT net>
|
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
|
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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
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.
<BR>res_x = 800
<BR>res_y = 600
<BR>color_depth = 15
<P>short engine::init_graphics(ushort res_x, ushort res_y, ushort color_depth)
<BR>{
<BR>cout << "Loading Graphic system at " << res_x <<
"x" << res_y << "x" << color_depth << "bits...\n";
<BR>clear_keybuf();
<BR>fade_out(1);
<BR>set_color_depth(color_depth);
<BR>short int g_result = set_gfx_mode(GFX_ATI, res_x, res_y, 0, 0); //
*** TO CAUSE THE ERROR, WORS IN AUTO_DETECT
<BR>if (g_result < 0)
<BR> {
<BR> stop(1);
<BR> textcolor(LIGHTRED);
<BR> cprintf("Error, graphic initialisation failed...Aborting...\n\r");
<BR> cprintf("Possible error(s):\n\r");
<BR> textcolor(WHITE);
<BR> cprintf("%s", allegro_error);
<BR> exit(1);
<BR> }
<BR>else cout << endl;
<BR>return g_result;
<BR>}
<P>void engine::stop(ushort error_num)
<BR>{
<BR>allegro_exit();
<BR>clrscr();
<BR>textcolor(WHITE);
<BR>textbackground(RED);
<BR>cprintf("Stoping Omega Engine
");
<BR>normvideo();
<BR>cout << "All systems unloaded..." << error_num <<
" errors.\n\n";
<BR>textcolor(WHITE);
<BR>}
<P>Thanks, Nicolas Blais</HTML>
- Raw text -