It's been a while since I've used this.
Setting up the Ogre3D SDK is always a tough job, so I decided not to get all smarty-pantsy and to just install 1.4.5 from ubuntu's repositores (instead of 1.4.8 from svn ...).
Well, now it's working, and now I'm going to take some time to get to know this sucker a little better than I did last time!
Getting back to Ogre3D
OpenAL and error handling
I'm writing a thin wrapper for OpenAL that only does some basic checking after doing some work.
After writing a few modifier/inspector methods, one thing is impossible to miss. The error handling mechanism in OpenAL is not exactly the most user (in this case user-programmer) friendly.
OpenAL was designed as a C library (which I fully support, although I would like an official C++ wrapper, so that there was no need to reinvent the wheel). After that decision, using C++ exceptions was really not an option anymore. So they were left with returning NULL/an error code or going the errno way. Set an error code and leave it up to the user-programmer to poll it.
Why, oh why did they not put a return code in every function so that one would now when to poll for errors ? Oh no, just return void and force the poor programmer to poll for errors after every call.
Now that hardly seems efficient ... Maybe if I was using OpenAL directly, I could do the error checking after a block of OpenAL instructions ...
My options now ?
1 - check for errors after every OpenAL call (at least the ones with no return code)
2 - implement some mechanism to check for errors at appropriate times (a sentry class? a simple function?)
I'm following Donald Knuth's advice and keep optimization to a later stage.
After all, that's what profilers are for.
OpenAL up and running
Well, not quite yet, but I managed to play a wav file wohoo!!!
...It's about time! I'm getting rusty at this stuff!
The problem was all mine (as usual when coding alone ;) )
And I was blamming ubuntu for it! Shame on me :(
Now I'm just going to create a thin wrapper around openal so that I can make it a little bit more object oriented. And also error safe. I'll check for errors after each method call and launch a nice descriptive exception when something fails.
Havok is free
At least for non-commercial use.
The announcement is here (via gamedev.net).
Thank you Intel!
I hope pal takes advantage of this ;)
update:
I guess pal support for havok is confirmed and will take about 3 weeks...
Thank you adrian!