Krig Game Engine
Loading...
Searching...
No Matches
src
Music.h
Go to the documentation of this file.
1
7
#ifndef _MUSIC_H_
8
#define _MUSIC_H_
9
10
#include <AL/al.h>
11
#include <vorbis/vorbisfile.h>
12
13
#include "constants.h"
14
15
#define BUFFER_SIZE 65536
16
17
class
Music {
18
public
:
19
Music();
20
~Music();
21
22
void
SetMusicListener(
23
const
ALfloat&,
const
ALfloat&,
const
ALfloat&,
24
const
ALfloat&,
const
ALfloat&,
const
ALfloat&
25
);
26
27
void
PlaySong(
const
char
*,
const
bool
&);
28
void
Update();
29
void
StopSong();
30
void
PauseSong();
31
32
void
load
();
33
void
unload();
34
35
private
:
36
ALuint Source;
37
ALenum Format;
38
ALint State;
39
ALuint Buffers[2];
40
ALuint Temp_Buffer;
41
42
// Flags for setting states.
43
bool
Playing;
44
bool
Repeat;
45
bool
initialized_;
46
47
// File decoding variables.
48
FILE *Music_File;
49
vorbis_info *Ogg_Info;
50
OggVorbis_File Ogg_File;
51
52
// variables for loop streaming.
53
int
Processed, Size, Section, Bytes;
54
char
Sound_Buffer[BUFFER_SIZE];
55
};
56
57
#endif
load
GameObject load()
Generated on
for Krig Game Engine by
1.16.1