From: "Jon" Newsgroups: comp.os.msdos.djgpp References: <57n86.4082$wt2 DOT 26425 AT news1 DOT oke DOT nextra DOT no> <93tlh4$bd027$1 AT ID-57378 DOT news DOT dfncis DOT de> Subject: Re: ASCII GUI Lines: 122 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Message-ID: Date: Mon, 15 Jan 2001 10:46:40 +0100 NNTP-Posting-Host: 130.67.203.123 X-Complaints-To: news-abuse AT nextra DOT no X-Trace: news1.oke.nextra.no 979551947 130.67.203.123 (Mon, 15 Jan 2001 10:45:47 MET) NNTP-Posting-Date: Mon, 15 Jan 2001 10:45:47 MET Organization: Nextra Public Access To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com I can't really compare to Turbo Vision, since DJGPP is currently the only compiler I have used. Im not sure of how to hide the cursor either, usually I place the cursor at a position above the screen, so it wont show to much. And im new with C also, so there is perhaps something wrong with my code. The following is an example of the function I use which moves very slow. #include #include void frame(char x, char y, char x2, char y2, char color); int main() { char x=30, y=5, x2=50, y2=10; while(x != 1) { delay(100); clrscr(); frame(x, y, x2, y2, 15); if(y>1) y--; if(y2<24) y2++; x--; x2++; } return 0; } void frame(char x, char y, char x2, char y2, char color) { char c; textcolor(color); for(c=x; c wrote in message news:93tlh4$bd027$1 AT ID-57378 DOT news DOT dfncis DOT de... > Hey! > > You may notice how fast TurboVision (text GUI from Turbo Pascal) is. It's > even fast on 286! > So the things to think of are: > 1. turn off cursor while redrawing, if it bores you > 2. perform redraws in an off-screen buffer which should be a) usually > noticable faster and b) is hidden from user > 3. think of window clipping. if you redraw a window entirely regardless of > whether it's visible to user or not (e.g. under other windows). this should > make some performance improvements > 4. turn on optimizations in GCC (perhaps this should go before 1 and 2 :)) > 5. if the thing is still slow, then there's something wrong with your code > because GCC does very good optimization so that you often don't need to > think of ASM at all > > Good Luck > -- > Alexei A. Frounze > alexfru [AT] chat [DOT] ru > frounze [AT] ece [DOT] rochester [DOT] edu > http://alexfru.chat.ru > http://members.xoom.com/alexfru/ > http://welcome.to/pmode/ > > "Jon" wrote in message > news:57n86.4082$wt2 DOT 26425 AT news1 DOT oke DOT nextra DOT no... > > I'm fairly new to programming, and have just started writing a program in > > DJGPP which uses > > an ASCII GUI. The problem is that, it redraws the GUI very slow. Even on > my > > 850 MHZ Athlon, I can see the cursor drawing up the GUI. Currently I use > the > > gotoxy(); function and cprintf(); to draw the GUI. > > But when doing big redraws, it just become too slow, like on another > program > > I made, I used the ASCII character 219 to form a word, which I moved > across > > the screen. This was also terrible slow. > > So, do anyone know of a better way to draw up ASCII graphics without using > > the gotoxy and cprintf? > > > > Jon > > > > > >