Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: A way of knowing when alGenSources failed.  (Read 3676 times)

0 Members and 1 Guest are viewing this topic.

nitram_cero

  • Full Member
  • ***
  • Posts: 166
    • View Profile
A way of knowing when alGenSources failed.
« on: May 13, 2009, 12:04:36 am »
As this is the only way to know the limit of sound sources in OpenAL as far as I know.

A Sound::GetLimit() or GetMaxSounds() static would be nice, but there is no nice way to do it.
Maybe getting as much sources as possible, , and after they fail or not, free them, keeping the count.
(This should be capped to a realistic number like 128 and 256 for OpenAL implementations that do not impose a limit).

At least a Sound::IsOk()/IsValid() (non-static).

Avoiding the errors on cout/cerr that say alGenSources failed will be nice (at least not for the first failure)

It's crucial to make a good sound priority manager which has to get the most sounds possible.

Thanks
-Martín

EDIT: ditch this. I'm rewriting sf::Sound as "ManagedSound" and making a manager with direct calls to OpenAL. Thanks