OGRECave / ogre-audiovideo

plugins for theora video playback and openAL audio
https://ogrecave.github.io/ogre-audiovideo/
BSD 3-Clause "New" or "Revised" License
14 stars 11 forks source link

OGGSOUND_THREADED and HAVE_EFX macros #42

Closed rpaciorek closed 2 years ago

rpaciorek commented 2 years ago
  1. OGGSOUND_THREADED and HAVE_EFX macros change OgreOggSound::OgreOggSoundManager size and data offsets.
  2. OgreOggSound don't store build time values of this macros in installed headers. (example: when build with cmake flag USE_EFX=0 in installed headers default value of HAVE_EFX is set to 2)

In effect if you don't manually reproduce values of this macros in your project, you get weird errors (e.g. wrong pointer to listener return by getListener()).

Possible solutions:

paroj commented 2 years ago

ideally one would not expose any #ifdef stuff in public headers, so the implementation is opaque to the user.

While possible with HAVE_EFX, it is particularly messy for OGGSOUND_THREADED.

Therefore, I suggest to go with 1). Here is how I implemented it in Ogre: https://github.com/OGRECave/ogre/blob/47f51a8e57336b2b9a7b1ca0fa57b7b6ec6b171f/CMake/ConfigureBuild.cmake#L144