delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/04/01:05:43

To: djgpp AT delorie DOT com
Subject: Re: Allegro.h to GNU Pascal unit conversion?
Message-ID: <19970303.220414.8255.6.chambersb@juno.com>
References: <5fdfjo$bkb$1 AT canopus DOT cc DOT umanitoba DOT ca>
From: chambersb AT juno DOT com (Benjamin D Chambers)
Date: Tue, 04 Mar 1997 01:01:10 EST

On 3 Mar 1997 03:12:56 GMT umbagnal AT cc DOT UManitoba DOT CA (Kevin Bagnall)
writes:
It's been a while since my Pascal days, but I'll give it a try:
(BTW excuse the poor Pascal syntax, I'm doing the best job I can):
>int  (*getpixel)(struct BITMAP *bmp, int x, int y);
>void (*putpixel)(struct BITMAP *bmp, int x, int y, int color);
var putpixel : procedure;
var getpixel : function;

Procedure _putpixel(bmp : ^BITMAP; x, y : dword);
Function  _getpixel(bmp : ^BITMAP; x, y, color : dword);

putpixel=_putpixel;
getpixel=_getpixel;

I used dword because I don't know what Pascal uses for 32bit ints (BP7
used byte and word).

>Is the second a pointer to a function? How would I change these to GNU 
>pascal?
No, it returns a void (meaning it's a procedure, rather than a function).

>
>Later I might convert the entire allegro.h file.  I'm probably not the 
>right 
>person to do this since I've only written two small C programs in my 
>life and 
>I'm new to both DJGPP and GNU Pascal(but not pascal).
Once you get down what it's doing, porting it should be easy.

...Chambers

- Raw text -


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