delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/25/08:15:42

From: "Christopher Nelson" <paradox AT gye DOT satnet DOT net>
To: <djgpp AT delorie DOT com>
Subject: Re: Allegro - why doesnt this work??
Date: Wed, 24 Mar 1999 15:17:27 -0700
Message-ID: <01be7644$1a1b4100$LocalHost@thendren>
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.71.1712.3
X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3
Reply-To: djgpp AT delorie DOT com

>Matthew Feeney wrote:
>
>> I ve been trying to blit one colour to the screen using the code below
but
>> it doesnt work (this is my first c/c++ proggy). All it does is display a
>> small band of the colour on the top of the screen ( its about 4 in wide).
>> Can anyone tell me why this isnt working because i think it should.
>>
>> #include <stdlib.h>
>> #include <stdio.h>
>> #include "allegro.h"
>>
>> int main()
>> {
>>    BITMAP *memory_bitmap;
>>
>>  /* allegro init stuff (video and keyboard routines) */
>>    allegro_init();
>>    set_gfx_mode(GFX_AUTODETECT, 320, 200, 0, 0);
>>    set_pallete(desktop_pallete);
>>
>>  /* make a memory bitmap sized 320x200 */
>>    memory_bitmap = create_bitmap(320, 200);
>>
>> /* draw something onto it */
>>    clear_to_color(memory_bitmap ,0);
>>
>> /* stick it onto the screen */
>>    blit(memory_bitmap, screen, 0 ,0 ,0 ,0 ,320 ,200);
>>     return 0;
>> }
>>
>> Thanks
>>


This SHOULD work, but your package may accidently be detecting an
"accelerated" driver, especially if you have Scitech's DisplayDoctor
installed.  VESA does not normally handle this resolution, but Scitech's
program often will try to.  On my system, this causes problems because the
driver in DD doesn't work right.  Try to explicity set it to GFX_VGA.  That
ought to do it.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019