Sign in to follow this  
skow

Problems with alDeleteBuffers in OpenAl - Solved

Recommended Posts

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]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this