aboutsummaryrefslogtreecommitdiff
path: root/APEX_1.4/module/loader/include
diff options
context:
space:
mode:
Diffstat (limited to 'APEX_1.4/module/loader/include')
-rw-r--r--APEX_1.4/module/loader/include/ModuleLoaderImpl.h128
-rw-r--r--APEX_1.4/module/loader/include/ModuleXmacro.h41
-rw-r--r--APEX_1.4/module/loader/include/Modules.h39
3 files changed, 208 insertions, 0 deletions
diff --git a/APEX_1.4/module/loader/include/ModuleLoaderImpl.h b/APEX_1.4/module/loader/include/ModuleLoaderImpl.h
new file mode 100644
index 00000000..8b39e890
--- /dev/null
+++ b/APEX_1.4/module/loader/include/ModuleLoaderImpl.h
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved.
+ *
+ * NVIDIA CORPORATION and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA CORPORATION is strictly prohibited.
+ */
+
+
+#ifndef MODULELEGACY_H_
+#define MODULELEGACY_H_
+
+#include "Apex.h"
+#include "ApexSDKIntl.h"
+#include "ModuleIntl.h"
+#include "ModuleBase.h"
+#include "ModuleLoader.h"
+#include "PsArray.h"
+#include "ApexRWLockable.h"
+
+namespace nvidia
+{
+namespace apex
+{
+
+class ModuleLoaderImpl : public ModuleLoader, public ModuleIntl, public ModuleBase, public ApexRWLockable
+{
+ physx::Array<Module*> mModules; // Loaded modules
+ ModuleLoader::ModuleNameErrorMap mCreateModuleError; // Modules error during it creating
+
+ uint32_t getIdx(const char* name) const;
+
+ uint32_t getIdx(Module* module) const;
+
+public:
+ APEX_RW_LOCKABLE_BOILERPLATE
+
+ ModuleLoaderImpl(ApexSDKIntl* inSdk)
+ {
+ mName = "Loader";
+ mSdk = inSdk;
+ mApiProxy = this;
+ }
+
+ Module* loadModule(const char* name);
+
+ void loadModules(const char** names, uint32_t size, Module** modules);
+
+ void loadAllModules();
+
+ const ModuleNameErrorMap& getLoadedModulesErrors() const;
+
+ void loadAllLegacyModules();
+
+ uint32_t getLoadedModuleCount() const;
+
+ Module* getLoadedModule(uint32_t idx) const;
+
+ Module* getLoadedModule(const char* name) const;
+
+ void releaseModule(uint32_t idx);
+
+ void releaseModule(const char* name);
+
+ void releaseModule(Module* module);
+
+ void releaseModules(const char** modules, uint32_t size);
+
+ void releaseModules(Module** modules, uint32_t size);
+
+ void releaseLoadedModules();
+
+protected:
+
+ virtual ~ModuleLoaderImpl() {}
+
+ // ModuleBase's stuff
+
+ void init(NvParameterized::Interface&) {}
+
+ NvParameterized::Interface* getDefaultModuleDesc()
+ {
+ return 0;
+ }
+
+ void release()
+ {
+ ModuleBase::release();
+ }
+ void destroy()
+ {
+ ModuleBase::destroy();
+ delete this;
+ }
+
+ const char* getName() const
+ {
+ return ModuleBase::getName();
+ }
+
+ AuthObjTypeID getModuleID() const
+ {
+ return UINT32_MAX;
+ }
+ RenderableIterator* createRenderableIterator(const Scene&)
+ {
+ return NULL;
+ }
+
+ // ModuleIntl's stuff
+
+ ModuleSceneIntl* createInternalModuleScene(SceneIntl&, RenderDebugInterface*)
+ {
+ return NULL;
+ }
+ void releaseModuleSceneIntl(ModuleSceneIntl&) {}
+ uint32_t forceLoadAssets()
+ {
+ return 0;
+ }
+};
+
+}
+} // physx::apex
+
+#endif
diff --git a/APEX_1.4/module/loader/include/ModuleXmacro.h b/APEX_1.4/module/loader/include/ModuleXmacro.h
new file mode 100644
index 00000000..60fd2604
--- /dev/null
+++ b/APEX_1.4/module/loader/include/ModuleXmacro.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved.
+ *
+ * NVIDIA CORPORATION and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA CORPORATION is strictly prohibited.
+ */
+
+
+// Run X-macro over all modules
+// #define MODULE(moduleName, instFunc, hasInit)
+
+#include <PhysXSDKVersion.h>
+
+#pragma warning(push)
+#pragma warning(disable:4127)
+
+#ifndef MODULE_LEGACY
+#define MODULE_LEGACY(moduleName, instFunc, hasInit) MODULE(moduleName, instFunc, hasInit)
+#endif
+
+
+MODULE("Clothing", instantiateModuleClothing, true)
+MODULE("Destructible", instantiateModuleDestructible, true)
+MODULE("Legacy", instantiateModuleLegacy, false);
+
+
+#if APEX_USE_PARTICLES
+MODULE("Particles", instantiateModuleParticles, true)
+// No correct init method yet...
+MODULE("TurbulenceFS", instantiateModuleTurbulenceFS, false)
+#endif // APEX_USE_PARTICLES
+
+
+// Clear inputs
+#undef MODULE
+#undef MODULE_LEGACY
+
+#pragma warning(pop)
diff --git a/APEX_1.4/module/loader/include/Modules.h b/APEX_1.4/module/loader/include/Modules.h
new file mode 100644
index 00000000..1d142ab9
--- /dev/null
+++ b/APEX_1.4/module/loader/include/Modules.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved.
+ *
+ * NVIDIA CORPORATION and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA CORPORATION is strictly prohibited.
+ */
+
+
+#ifndef MODULES_H_
+#define MODULES_H_
+
+#include <ApexDefs.h>
+
+#include <ModuleLegacy.h>
+#include <ModuleClothing.h>
+
+#if PX_PHYSICS_VERSION_MAJOR == 3
+#include <ModuleDestructible.h>
+
+#if APEX_USE_PARTICLES
+
+#include <ModuleBasicFS.h>
+#include <ModuleBasicIos.h>
+#include <ModuleEmitter.h>
+#include <ModuleFieldSampler.h>
+#include <ModuleForceField.h>
+#include <ModuleIofx.h>
+#include <ModuleParticleIos.h>
+#include <ModuleParticles.h>
+#include <ModuleTurbulenceFS.h>
+
+#endif
+
+#endif
+
+#endif