Re: alGetError() at start of program behavior differs between Windows and Linux
Chris Robinson <[email protected]> Sat, 18 Jun 2011 18:39:06 -0700
| Newsgroups | gmane.comp.lib.openal |
|---|---|
| Message-ID | <[email protected]> |
On Saturday, June 18, 2011 5:20:36 PM Dan Kegel wrote:
> I guess the thing to do is to fudge wine's alGetError() to return
> AL_NO_ERROR instead of AL_INVALID_OPERATION,
> and/or report the bug to the game developer
> and/or report the bug to the developer of Windows OpenAL (whoever they
> are). Right?
> Or should the Linux OpenAL change to follow the behavior of the Windows
> one?
FWIW, the same problem would occur using the Windows build of OpenAL Soft
without the router DLL, in real Windows. Hacking Wine's DLL thunk will just
hide the problem.
It's a difficult problem to solve. Simply returning AL_NO_ERROR is just asking
for its own problems:
ALuint src;
alGenSources(1, &src);
if(alGetError() == AL_NO_ERROR)
{
// Without a context, the app will assume src is valid; not only will it
// not be valid, but it's uninitialized junk
}
Keeping track of a separate "no context" error can have concurrency and
locking problems.
The best option would be getting the game's developer to fix the app, but
short of that I can add a hack to OpenAL Soft to check for an environment
variable and return 0 when no context is available (similar to how it handles
reversed Z for TrackMania, via __ALSOFT_REVERSE_Z=1, or half-angle cones, via
__ALSOFT_HALF_ANGLE_CONES=1; things that break spec, but are needed to get
certain apps working correctly).
_______________________________________________
Openal mailing list
[email protected]
http://opensource.creative.com/mailman/listinfo/openal