Commit | Line | Data |
8fde61e3 |
1 | # Music.pm |
2 | # |
3 | # a SDL_mixer data module |
4 | # |
5 | # Copyright (C) 2000,2002 David J. Goehrig |
6 | |
7 | package SDL::Music; |
8 | use strict; |
9 | use SDL; |
10 | |
11 | sub new { |
12 | my $proto = shift; |
13 | my $class = ref($proto) || $proto; |
14 | my $filename = shift; |
15 | my $self = \SDL::MixLoadMusic($filename); |
16 | bless $self,$class; |
17 | return $self; |
18 | } |
19 | |
20 | sub DESTROY { |
21 | my $self = shift; |
22 | SDL::MixFreeMusic($$self); |
23 | } |
24 | |
25 | 1; |
26 | |
27 | __END__; |
28 | |
29 | =pod |
30 | |
31 | =head1 NAME |
32 | |
33 | SDL::Music - a perl extension |
34 | |
35 | =head1 DESCRIPTION |
36 | |
37 | L<SDL::Music> is used to load music files for use with L<SDL::Mixer>. |
38 | To load a music file one simply creates a new object passing the filename |
39 | to the constructor: |
40 | |
41 | my $music = new SDL::Music 'my_song.ogg'; |
42 | |
43 | |
44 | =head1 AUTHOR |
45 | |
46 | David J. Goehrig |
47 | |
48 | =head1 SEE ALSO |
49 | |
50 | L<perl> L<SDL::Mixer> |
51 | |
52 | =cut |