delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/20/11:06:07

Date: Sun, 20 Apr 1997 09:51:08 -0500 (CDT)
From: Andrew Deren <aderen AT eecs DOT uic DOT edu>
To: Helix <Helix AT Unknown>
cc: djgpp AT delorie DOT com
Subject: Re: Allegro: Problem? HELP
In-Reply-To: <01bc4d11$eb03aa40$LocalHost@stachowiak>
Message-ID: <Pine.SUN.3.95.970420094521.20420B-100000@bert.eecs.uic.edu>
MIME-Version: 1.0

It is really simple.
try something like this:
#include <allegro.h>
#include "helix.h" //you need to include this one only if you are using
the names from the data file.
main()
{
*Initialize allegro *
DATAFILE *my_data;
//to play a midi use
play_midi((MIDI*)my_data[MY_SONG_FROM_DATA_FILE].dat, FALSE);
//the other way to do this, you could create a pointer to MIDI
MIDI *my_song = (MIDI*)my_data[MY_SONG_FROM_DATA_FILE].dat;
play_midi(my_song, FALSE);

you do the same stuff with samples and bitmaps
play_sample((SAMPLE*)my_data[MY_SAMPLE].dat, 200, 125, 1000, FALSE);
draw_sprite(screen, (BITMAP*)my_data[MY_BITMAP].dat, 10, 10);

On 19 Apr 1997, Helix wrote:

> 
> Basically I used the grabber utility to create a data file named, helix.dat
> inside the data file I inserted a midi file named INTRO and I created a
> header file name helix.h.
> 
> What code do I insert into the actual source file (helix.c) to make it play
> the midi file in the data file?
> 
> What code would I use to in the source file to display a bitmap or play a
> wav file?
> 
> I've read the docs on the Grabber utility but don't understand them very
> well.
> 
> anyways, THANKS in advance.  
> 

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019