From: mert0407 AT sable DOT ox DOT ac DOT uk (George Foot) Newsgroups: comp.os.msdos.djgpp Subject: Re: Allegro Error (in my game): Why? Date: 7 Jun 1997 00:25:04 GMT Organization: Oxford University, England Message-ID: <5na9p0$jh7@news.ox.ac.uk> References: <5na0cl$h9m AT news DOT interlog DOT com> NNTP-Posting-Host: sable.ox.ac.uk Lines: 29 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Gautam N. Lad (gautam AT interlog DOT com) wrote: : And it points to this line: : BITMAP *DBuffer = create_bitmap(640, 480); create_bitmap is a function, and you can't call functions except inside code blocks. What you need to do is seperate the definition of DBuffer from its initialisation. Put BITMAP *DBuffer; at top level, and somewhere during your initialisation put DBuffer = create_bitmap(640,480); and it should be okay. : BTW, It seems that the Allegro Documentation is full of 'What and not much : 'Why' and 'How'? Also, I'm not flaming anyone (esp. Shawn H.), 'cause I know : how hard it is to write a Documentation. And, I may use the game I'm making, : as a tutorial, that I may plan on writing (MAYBE). Just wish the docs was : better. Oh well, I can learn just fine from the EXample sources! ;) You might like to look at Allegro Vivace (http://users.ox.ac.uk/~mert0407/vivace.txt) - it is intended to be a tutorial and introduction to game programming, aimed at relative beginners. It isn't nearly finished yet, but it will take you as far as displaying graphics at the moment. I did actually write sections 5, 6 and 7, but have lost 6 and 7 now for some reason I couldn't fathom. -- George Foot Merton College, Oxford