Issues with alGenBuffers()

Herbert Elwood Gilliland III <[email protected]>
Newsgroups gmane.comp.lib.openal
Message-ID <[email protected]>
Well, this is my first implementation of an OpenAL API from scratch.  I used
tutorials found at devmaster.net

The error I am experiencing is :
<> <+sacrebleu> Audio ALSoundManager:WAV:alGenSources Error #40963 Invalid
Value
<> <+sacrebleu>   alGenBuffers(1, &(sound.Buffer.id));
if(ALError("ALSoundManager:WAV:alGenBuffers")) ...
 AL_INVALID_VALUE
The buffer array isn't large enough to hold the number of buffers requested.

sound.Buffer.id is an ALuint
 the example says the value should be ALuint Buffer;

My ALuint is contained in a class:
<> class ALBuffer {
<>  ALBuffer next,head;
<>  ALuint id; ...

This happens in alGenBuffers, after init, when I go to load the first file.

That function looks like this:

 ALSound WAV( char *filename, float Pitch, float Gain, bool Looped, bool
CreateSource )
 {
  ALSound sound;
  int newid;
  alGetError();
  if ( (sound=sounds.findInList( filename )) ) { printf("Sound already
loaded into the active buffer as %d\n", sound.Buffer.id ); return sound; }
  if ( unusedBuffers <= 0 ) { printf( "ALSound: No more buffers available
(%d used)\n", bufferClamp-unusedBuffers ); return null; }
  sound = ALSound { pitch=Pitch, gain=Gain, loop= (ALboolean) Looped };
  // Load wav data into a buffer..
  sound.Buffer = ALBuffer { };
->  alGenBuffers(1, &(sound.Buffer.id));
if(ALError("ALSoundManager:WAV:alGenBuffers")) { delete sound; return null;
}
  sound.Buffer.next=Buffers; sound.Buffer.rehead(Buffers=sound.Buffer);
unusedBuffers--;
.
.


There is only 1 file being loaded.  The buffer class (ALBuffer) looks like
this:

class ALBuffer {
 ALBuffer next,head;
 ALuint id;.
.
.

What gives?


-- 
H. E. Gilliland III

"Astronomy compels the soul to look upwards and leads us from this world to
another."
 — Plato

_______________________________________________
Openal mailing list
[email protected]
http://opensource.creative.com/mailman/listinfo/openal
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.