Mail Archives: djgpp/2001/02/08/06:51:50
Does anyone know what is going on? I am trying to set the graphics mode in
Allegro and it won't open the screen on Windows 2000. Any ideas anyone?!
Code follows:
--------------------------------------------------------------------
int cscreen::init(int sw_, int sh_, int depth_)
{
sw = sw_;
sh = sh_;
// set the screen mode... first try the specified depth
set_color_depth(depth_);
if (set_gfx_mode(GFX_AUTODETECT, sw, sh, 0, 0) != 0) {
// cannot set specified depth... find best depth
set_color_depth(32);
if (set_gfx_mode(GFX_AUTODETECT, sw, sh, 0, 0) != 0) {
set_color_depth(24);
if (set_gfx_mode(GFX_AUTODETECT, sw, sh, 0, 0) != 0) {
set_color_depth(16);
if (set_gfx_mode(GFX_AUTODETECT, sw, sh, 0, 0) != 0) {
set_color_depth(15);
if (set_gfx_mode(GFX_AUTODETECT, sw, sh, 0, 0) != 0) {
set_color_depth(8);
if (set_gfx_mode(GFX_AUTODETECT, sw, sh, 0, 0) != 0)
return 4;
}
}
}
}
}
PALETTE pal;
// in case this is a 256 colour mode, generate a nice palette
generate_332_palette(pal);
set_palette(pal);
clear_to_color(screen, makecol(0, 0, 0));
}
--------------------------------------------------------------------
The program returns 4 and outputs "cannot set graphics mode".
Thanks in advance,
Jamie.
- Raw text -