Browse Source

Fixed warning, set_pitch added

master
Joshua Moerman 12 years ago
parent
commit
53c005fa51
  1. 2
      J/shader.h
  2. 8
      J/sound.h

2
J/shader.h

@ -271,7 +271,7 @@ private:
// *************** // ***************
// status checking // status checking
void check_compile_status(GLint shader, std::string source = "") { void check_compile_status(GLuint shader, std::string source = "") {
#if defined(DEBUG) #if defined(DEBUG)
GLint status = GL_FALSE; GLint status = GL_FALSE;
glGetShaderiv(shader, GL_COMPILE_STATUS, &status); glGetShaderiv(shader, GL_COMPILE_STATUS, &status);

8
J/sound.h

@ -87,12 +87,12 @@ struct Source {
Source & operator=(Source const &) = delete; Source & operator=(Source const &) = delete;
Source(Buffer const & buffer){ Source(Buffer const & buffer){
int r = rand() % 10;
float pitch = 0.5 + r*0.5;
alGenSources(1, &source); alGenSources(1, &source);
alSourcei(source, AL_BUFFER, buffer.buffer); alSourcei(source, AL_BUFFER, buffer.buffer);
alSourcef(source, AL_PITCH, pitch); //? }
void set_pitch(float pitch){
alSourcef(source, AL_PITCH, pitch);
} }
void play(){ void play(){