Simple Open Source 2D Game API
Simple OO wrapper around an OpenAL source, defines the interface used for Sample and Music.
Source is a template class and can not be used directly, use either Sample or Music. Sample is for playing small files such as sound effects. Music is for streaming files such as background music.
Define a new named resource. (Ex. Image::addResource(“monkey”,”images/monkey.png”) would make it so that any attempts to load “monkey” would load the image images/monkey.png)
Default constructor, initalizes internal state of Source.
Opens an audio file, supported formats are WAV and Ogg.
void open( const std:: string & name )
Destructor for source, frees the OpenAL source resource.
Starts the playback of the sound attached to the source.
Stops the playback of the sound attached to the source.
Pauses the playback of the sound attached to the source.
Rewinds the position of the sound attached to the source.
Sets if the source’s sound is looping or is played only once.
void setLooping( bool loop )
Determine status of Source.
bool isValid() const
Determine if source is playing.
bool isPlaying() const
Determine if source is looping.
bool isLooping() const
Define a new named resource.
static void addResource( const std:: string & name, const std:: string & path )