[openal] Can I use effect functions without using macros?

Chris Robinson chris.kcat at gmail.com
Tue Jan 26 10:30:52 EST 2021


On Tue, 26 Jan 2021 16:22:58 +0300
Sean <s.tolstoyevski at gmail.com> wrote:

> Hello all,
> 
> I am trying to write OpenAL wrapper for Golang.
> C and Go are nice. So mixing them up is easy enough.
> But there is no macro support. Doing this confuses me. Because I
> don't know enough ce and cpp to understand macros.
> 
> Can I use effect functions in OpenAL-Soft without a macros?

Yes. The macros are syntactic sugar to make the code more readable and
easier to understand. When you write

alEffecti(effect, AL_EFFECT_TYPE, AL_EFFECT_REVERB);

as far as the library is concerned, and what the compiler essentially
produces, it's

alEffecti(effect, 0x8001, 0x0001);

The same goes for all other macros. It's just a search-and-replace done
by the preprocessor before compiling.


More information about the openal mailing list