| 1 | //************************************ bs::framework - Copyright 2018 Marko Pintera **************************************// | 
|---|---|
| 2 | //*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********// | 
| 3 | #include "BsOAPrerequisites.h" | 
| 4 | #include "Audio/BsAudioManager.h" | 
| 5 | #include "BsOAAudio.h" | 
| 6 | #include "BsOAImporter.h" | 
| 7 | #include "Importer/BsImporter.h" | 
| 8 | |
| 9 | namespace bs | 
| 10 | { | 
| 11 | class OAFactory : public AudioFactory | 
| 12 | { | 
| 13 | public: | 
| 14 | void startUp() override | 
| 15 | { | 
| 16 | Audio::startUp<OAAudio>(); | 
| 17 | } | 
| 18 | |
| 19 | void shutDown() override | 
| 20 | { | 
| 21 | Audio::shutDown(); | 
| 22 | } | 
| 23 | }; | 
| 24 | |
| 25 | /** Returns a name of the plugin. */ | 
| 26 | 	extern "C"BS_PLUGIN_EXPORT const char* getPluginName()  | 
| 27 | { | 
| 28 | 		static const char* pluginName = "OpenAudio";  | 
| 29 | return pluginName; | 
| 30 | } | 
| 31 | |
| 32 | /** Entry point to the plugin. Called by the engine when the plugin is loaded. */ | 
| 33 | 	extern "C"BS_PLUGIN_EXPORT void* loadPlugin()  | 
| 34 | { | 
| 35 | OAImporter* importer = bs_new<OAImporter>(); | 
| 36 | Importer::instance()._registerAssetImporter(importer); | 
| 37 | |
| 38 | return bs_new<OAFactory>(); | 
| 39 | } | 
| 40 | |
| 41 | /** Exit point of the plugin. Called by the engine before the plugin is unloaded. */ | 
| 42 | 	extern "C"BS_PLUGIN_EXPORT void unloadPlugin(OAFactory* instance)  | 
| 43 | { | 
| 44 | bs_delete(instance); | 
| 45 | } | 
| 46 | } |