Mail Archives: djgpp/1997/11/28/16:32:59
Jonathan Villani wrote:
> My problem is that i want to have a pointer that contains the address of
> my putpixel function depending on what mode i am (8bpp to 32bpp) each
> one as a function.
> void main()
> {
> void far *pix_func = NULL; /* My pointer to the RIGHT putpixel function*/
> /* Select the RIGHT put pixel function */
> if (mode == _8bpp)
> pix_func = &pix8(); /* get address of putpixel function in
> 8bpp */
>
> if (mode == _24bpp)
> pix_func = &pix24(); /* get address of putpixel function in 24bpp
I suggest that you try to use the right syntax for the function
pointers:
void (*pix_func)(word,word,byte)=NULL;
and then make the assignements like:
pix_func=pix24;
About the assembly part, i gave up assembly after i've seen
assembly code build from C++ programs compiled with DJGPP.
I once made a class "Sprite" that had the hability to draw
a bitmap inside a 4 vertex poligon streched in any way, and compiled
everything with DJGPP. The final code was able to draw about 2000
polygons a second on my 486 AT 80Mhz machine at that time.
- Raw text -