Mail Archives: djgpp/1998/10/30/08:18:42
From: | "Arthur" <arfa AT clara DOT net>
|
To: | <djgpp AT delorie DOT com>
|
Subject: | RE: Small Allegro Problem
|
Date: | Fri, 30 Oct 1998 13:13:49 -0000
|
Message-ID: | <000601be0407$226b6ba0$464e08c3@arthur>
|
MIME-Version: | 1.0
|
X-Priority: | 3 (Normal)
|
X-MSMail-Priority: | Normal
|
X-Mailer: | Microsoft Outlook 8.5, Build 4.71.2173.0
|
In-Reply-To: | <36390E11.B6CAE0F@phreaker.net>
|
X-MimeOLE: | Produced By Microsoft MimeOLE V4.72.3110.3
|
Importance: | Normal
|
Reply-To: | djgpp AT delorie DOT com
|
Please don't post in HTML format.
You have called allegro_init() before creating engine, havn't you? Put it in
the constructor for engine if engine is a global, otherwise call it
beforehand.
James Arthur
jaa AT arfa DOT clara DOT net
ICQ#15054819
-----Original Message-----
From: Nicolas Blais [mailto:alphaqt AT phreaker DOT net]
Sent: 30 October 1998 00:54
To: djgpp AT delorie DOT com
Subject: Small Allegro Problem
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
- Raw text -