Created
June 3, 2014 20:42
-
-
Save Symphonym/2ae40f056aa8d70c4aab to your computer and use it in GitHub Desktop.
HidingTest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace internal | |
{ | |
// Forward declare OpenAL dependant classes | |
class ALSourceWrapper; | |
} | |
class AudioSource | |
{ | |
private: | |
// This adds dependencies to the header file that I don't want | |
ALuint m_source; | |
// Something like this is what I'm currently using | |
std::unique_ptr<internal::ALSourceWrapper> m_source; | |
} | |
// AudioImpl.hpp | |
namespace internal | |
{ | |
// This class will only be included in .cpp files so we can freely use | |
// external dependencies such as OpenAL and its types | |
struct ALSourceWrapper | |
{ | |
ALuint source; | |
ALSourceWrapper() | |
{ | |
alGenSources(1, &source); | |
} | |
~ALSourceWrapper() | |
{ | |
alDeleteSources(1, &source); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment