Xref: news2.mv.net comp.os.msdos.djgpp:4133 From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: Using mikmod and allegro - how? Date: Mon, 20 May 1996 19:57:02 +0100 Organization: The University of York, UK Lines: 33 Message-ID: NNTP-Posting-Host: tower.york.ac.uk Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII In-Reply-To: <4npgtk$drm@groa.uct.ac.za> To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp On 20 May 1996, David Nunez wrote: > Could someone please post the solution to the using mikmod together > with allegro problem? I followed the thread for a while, but > then got totally lost. If it's possibly, could you please post it > in a easy, step by step sort of way (I'm a bit new to all this). I just tried this, and successfully hacked my Allegro demo game to play MikMod music in the background. I ran into two problems: Allegro and MikMod both define a SAMPLE struct. If you are using MikMod you obviously won't be using any of the sound code in Allegro, so you can just delete anything containing SAMPLE from allegro.h, or rename SAMPLE to ALLEGRO_SAMPLE or something like that. Allegro sets the _crt0_startup_flags variable to make sure the non-moving sbrk() algorithm is in use. The MikMod example programs all set it to enable near pointers, and the two definitions of it conflict. Solution: delete it from the MikMod examples, and call _djgpp_nearptr_enable() at the start of the program instead. btw. do I really need to set _crt0_startup_flags in Allegro? I am just setting it to _CRT0_FLAG_NONMOVE_SBRK, which is the default in any case, but the docs warn that it might change in the future. Do they really mean that, or would I be safe not bothering to set it? /* * Shawn Hargreaves. Why is 'phonetic' spelt with a ph? * Check out Allegro and FED on http://www.york.ac.uk/~slh100/ */