From: ao950 AT FreeNet DOT Carleton DOT CA (Paul Derbyshire) Newsgroups: comp.os.msdos.djgpp Subject: Re: Question about textout Date: 25 Aug 1997 08:09:10 GMT Organization: The National Capital FreeNet Lines: 44 Message-ID: <5trej6$ju6@freenet-news.carleton.ca> References: <01bcb08b$19492ce0$cf4f05c3 AT padrino> Reply-To: ao950 AT FreeNet DOT Carleton DOT CA (Paul Derbyshire) NNTP-Posting-Host: freenet6.carleton.ca To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk "moabdib" (moabdib AT arrakis DOT es) writes: > with textout i can print string, how can i use to print variables? Put the following in a file called something.c, compile it into a .o, and add it to liballeg.a using ar and some arcane command line switches. :-) (Shawn, want to test this and stick it into WIP?) /* gfxprintf.c Printf-alikes for graphic printing with Allegro. Copyright (C) 1997 PGD, freely distributable, no warranty, and this might need slight tweaking/debugging as I only have the libc/allegro references right here right now. */ #include #include #include void gfxprintf (BITMAP *bmp,FONT *fnt,int sx,int sy,int c,char *format,...); void gfxprintf_centre (BITMAP *bmp,FONT *fnt,int sx,int sy,int c,char *format,...); void gfxprintf (BITMAP *bmp,FONT *fnt,int sx,int sy,int c,char *format,...) { va_list args; char buf[256]; va_start(args); vsprintf(buf,format,args); va_end(args); textout(bmp,fnt,(unsigned char *)buf,sx,sy,c); } void gfxprintf_centre (BITMAP *bmp,FONT *fnt,int sx,int sy,int c,char *format,...) { va_list args; char buf[256]; va_start(args); vsprintf(buf,format,args); va_end(args); textout_centre(bmp,fnt,(unsigned char *)buf,sx,sy,c); } -- .*. Where feelings are concerned, answers are rarely simple [GeneDeWeese] -() < When I go to the theater, I always go straight to the "bag and mix" `*' bulk candy section...because variety is the spice of life... [me] Paul Derbyshire ao950 AT freenet DOT carleton DOT ca, http://chat.carleton.ca/~pderbysh