Advertisement

Problems with alDeleteBuffers in OpenAl - Solved

Started by August 05, 2004 01:02 PM
-1 comments, last by skow 20 years, 3 months ago
Well the audio fourm here doesn't seem to get any traffic, so I'm posting here as I know a few people here use openAL. I'm triing to create a simple wrapper class for AL, the problem is when ever I call alDeleteBuffers it doesn't delete the buffer, alGetError() returns AL_ILLEGAL_COMMAND or AL_INVALID_OPERATION. If I try and then gen a buffer, my program will crash. I create the buffer with the following:

	ALenum format;
	ALsizei size;
	ALvoid* data;
	ALsizei freq;
	ALboolean loop;

	//Find a open buffer spot
	int bufferSlot = FindOpenBufferSlot();
	alGenBuffers(1, &bufferVector[bufferSlot].buffer);



I then delete it with:

		alDeleteBuffers(1, &bufferVector[nId].buffer);
		int errorNum = alGetError();
		if(errorNum != AL_NO_ERROR)
		{
			breakFunc();
		}
		bufferOpenQueue.push(nId);



I'm really at a loss, I've read all the documentation, searched the net, tried debugging for hours. No luck. I also have this problem when i run a tutorial I found, at the end where it deletes the buffers I added the check and it returns an error. If any one can help, or knows a place I could post AL questions, That would be great. EDIT - I figured it out, I have to delete all sources using that buffer (duh). [Edited by - skow on August 5, 2004 3:35:58 PM]

This topic is closed to new replies.

Advertisement