Path: chuka.playstation.co.uk!news From: "Scott Ward" Newsgroups: scee.yaroze.beginners Subject: Re: FntPrint,FntOpen, etc.... Date: Sun, 6 Feb 2000 14:25:08 -0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 92 Message-ID: <87jvr7$9ih3@chuka.playstation.co.uk> References: <87g5um$2s32@chuka.playstation.co.uk> NNTP-Posting-Host: m115-mp1-cvx1b.hud.ntl.com X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 It's all sorted now. It turned out to be a pointer that I initialised wrong in another function somewhere (that loads images to the frame buffer). I don't have a clue why it affected all the print streams but there you go, bizarre. Anyway, cheers to Stuart who took the time to look through the code and give me some nice pointers( that's pointers as in tips, not pointers as in the things that hold memory add......ah forget it. ;o) ) Scott "Scott Ward" wrote in message news:87g5um$2s32@chuka.playstation.co.uk... > I seem to be having a little bit of bother with FntPrint() although I can't > see where I'm going wrong. Hopefully, someone could help me out. > Basically, I've got a simple program which does very little as yet and I > want to set up 8 different print streams so I can write basic text onto the > screen. Sounds simple until I tried to pull it off. > > The main loop goes something like this: > > main > { > Initiatefunction(); // Sets up all the graphics stuff etc. > including FntLoad and FntOpen. > > for(;;) > { > SetUpScreen(); // Get currentbuffer, clear OT, blah blah... > > Gamefunctions(); // There are actually a few functions here but > basically this is where I print to the > // streams using FntPrint and then > flush them to the frame buffer (FntFlush). > > DrawScreen(); // DrawSync, SwapBuffers, DrawOT, etc. > } > } > > Okay, this all works fine if I use a default print stream but as soon as I > try allocating the print streams to int variables it doesn't work. :o( > > eg. > > FntLoad(960,256); > FntOpen(0,0,.......); > FntPrint("TEXT IN HERE.\n"); > FntFlush(-1); > THIS WORKS!!! > > FntLoad(960); > fontid[0]=FntOpen(0,0,........); > fontid[1]=FntOpen(0,0.........); > FntPrint(fontid[0],"TEXT ON STREAM ONE"); > FntPrint(fontid[1],"TEXT ON STREAM TWO"); > FntFlush(fontid[0]); > FntFlush(fontid[1]); > THIS HAS CRASHED THE CODE, SHOWN BLANK STREAMS OR SHOWN NO STREAMS. > > I've looked over example bits of code which use the same method so it > *should* work. After bucket loads of time and effort trying to find the root > of the problem I can only assume the problem lies in the 'fontid' variables > that I'm declaring. At the moment they are declared as globals like so: int > fontid[8]; > I've tried swapping and changing all sorts of things to get it to work but > to no avail. > > Are there any occasions when global variables can get overwritten? > > Any help at all will be much appreciated or if anyone has the decency to > look at my code then PLEASE let me know where I am going wrong. I'd love to > move on from this and get back to coding the good stuff. :o) > > Cheers, > > Scott > > > >