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

From: "Matthew Feeney" <mathewf AT enterprise DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Allegro - why doesnt this work??
Lines: 38
X-Newsreader: Microsoft Outlook Express 4.71.1712.3
X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3
Message-ID: <CWWE2.25$gZ4.281@news.enterprise.net>
Date: Mon, 8 Mar 1999 09:04:21 -0000
NNTP-Posting-Host: 194.72.197.238
X-Complaints-To: news AT enterprise DOT net
X-Trace: news.enterprise.net 920927010 194.72.197.238 (Mon, 08 Mar 1999 21:03:30 BST)
NNTP-Posting-Date: Mon, 08 Mar 1999 21:03:30 BST
Organization: Enterprise PLC
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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

-----------------------------------------------------
Matthew  "Max Damage"  Feeney
Email- mathewf AT enterprise DOT net
-----------------------------------------------------


- Raw text -


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