Ethan Posted April 20, 2011 Share Posted April 20, 2011 (edited) Hello,After, have debug the program, it seem that there are a problem with the "define function AL_CHECK"who use al_check().#define AL_CHECK al_check(__func__,__LINE__)static void al_check(const char* caller, int line){ ALenum err = alGetError(); if(err != AL_NO_ERROR) al_ReportError(err, caller, line);}For what I understand, before take the last error, it is necessary to clear the error state.So I have called alGetError(), beforeALenum err...And now I have the sound, in main menu, and when I play.But the sound is not perfect.I launched the game in windowed mode.But now there are a new issue, when I return to the main menu, and I quit, I have this error:h_mgr.cpp(659): Function call failed: return value was -100021 (Invalid Handle (argument))What do you think ?Than youEthan. Edited April 20, 2011 by Ethan Link to comment Share on other sites More sharing options...
Ykkrosh Posted April 22, 2011 Share Posted April 22, 2011 For what I understand, before take the last error, it is necessary to clear the error state.So I have called alGetError(), beforeALenum err...Do you mean you've changed it tostatic void al_check(const char* caller, int line){ alGetError(); ALenum err = alGetError(); if(err != AL_NO_ERROR) al_ReportError(err, caller, line);}or something like that? In that case the first line will capture any real error that has occurred, and then ignore the return value, and the "ALenum err = alGetError()" will always return no error because the error state was cleared. So this will just hide any real errors that occur - I don't think it'll ever really fix anything. (We should never trigger any OpenAL errors so it shouldn't be necessary to clear the error state at all, as far as I'm aware.) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now