delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/26/05:26:14

From: G DOT DegliEsposti AT ads DOT it
To: djgpp AT delorie DOT com
Message-ID: <C12565D3.00391BC5.00@vega.ads.it>
Date: Thu, 26 Mar 1998 11:24:11 +0100
Subject: Re: Re: even more graphics problems with allegro
Mime-Version: 1.0




>> I guess what you wanted was something like this:
>>   blit((BITMAP *)data[selecto].dat, screen, 0, 0, 0, 0, 320, 200);
>
>Actually, the typecast is not neccessary, AFAIK.
>simply using
>
>blit(data[selecto].dat, screen, 0, 0, 0, 0, 320, 200);
>
>should work fine, and it's slightly less long to type.

Yes, maybe I was mislead my this piece of information form the Allegro
docs...

---
If you are programming in C++ you will get an error because the dat field
is
a void pointer and draw_sprite() expects a BITMAP pointer. You can get
around this with a cast, eg:

   draw_sprite(screen, (BITMAP *)data[THE_IMAGE].dat, x, y);
---

Anyway, I had some bad experiences with pointers while programming under
windows 3.1 and I put explicit casts to avoid problems every time I can.

ciao
  Giacomo


- Raw text -


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