delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/02/20:39:26

From: Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Allegro & memory access
Date: Mon, 2 Jun 1997 22:18:31 +0100
Organization: None
Distribution: world
Message-ID: <zWgvhHAnizkzEwiZ@talula.demon.co.uk>
References: <01bc6d4e$720f1900$ec3e63c3 AT default>
NNTP-Posting-Host: talula.demon.co.uk
MIME-Version: 1.0
Lines: 31
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Thomas Harte writes:
>with Allegro. I cannot find anything in the readme (although I am good at
>missing stuff), 

There is a section titled "video memory access" in the documentation...

>so I was just checking if it's alright for me to load
>Allegro, have it initiate VGA mode (or whatever), and then just write to
>the VRAM myself, allowing Allegro to do it's stuff for the enemies and
>title screens. 

Yeah, you could go directly to the video RAM without using anything
related to Allegro, but that will obviously only work if you and Allegro
agree about what video mode you are in! (ie. you are only going to run
your program in 13h, or you are going to handle the various SVGA and
mode-X resolutions yourself). Alternatively, you could write your code
so that it draws onto an Allegro bitmap object. If you want to write
directly to the screen you'll need to use far pointers and the bank
switching functions (this is described in the docs), but it is very easy
to just draw onto an Allegro memory bitmap and then use blit() to copy
the resulting image across to the screen (and that way your program will
work in every resolution supported by Allegro).

To set a pixel in a memory bitmap, just write:

    bmp->line[y][x] = color;


--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
Beauty is a French phonetic corruption of a short cloth neck ornament.

- Raw text -


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