Mail Archives: djgpp/1997/11/19/22:31:21
Mike McLean wrote:
>
> I'm using the WIP Nov 16th version of allegro and I am trying to play
> a midi file, the source compiles fine, but I don't get the file to
> play. I've never tried to play midi with any version of allegro
> before. Please help me out, and tell me what mistake(s) I am making.
> I'm trying to better myself at programming.
> Here is the code:
>
> #include <allegro.h>
> #include <iostream.h>
>
> int main(void)
> {
> load_midi("mission.mid");
> play_midi(load_midi("mission.mid"),1);
> }
it looks like you haven't read any of the documentation. i _never_
really programmed anything using allegro, but it doesn't take more than
5 seconds on an old dx4-75 to find the following info in allegro.txt:
int allegro_init();
Initialises the Allegro library. It doesn't actually do very much
except setting up some global variables, locking some memory, and
installing allegro_exit() as an atexit() routine, but you must call
it before doing anything else. Returns zero for success (at the
moment it can't fail, so there is not much point checking the
return value).
int install_timer();
Installs the Allegro timer interrupt handler. You must do this before
installing any user timer routines, and also before displaying a
mouse pointer, playing FLI animations or MIDI music, and using any of
the GUI routines.
and i thought i was lazy.
--
----------------------------------------------------------------------
A. Sinan Unur
Department of Policy Analysis and Management, College of Human Ecology,
Cornell University, Ithaca, NY 14853, USA
mailto:sinan DOT unur AT cornell DOT edu
http://www.people.cornell.edu/pages/asu1/
- Raw text -