diff options
| author | sschirm <[email protected]> | 2017-02-27 16:40:12 +0100 |
|---|---|---|
| committer | sschirm <[email protected]> | 2017-03-01 18:04:26 +0100 |
| commit | 7840347c32755e94a807f978f1cbb558717ac8cf (patch) | |
| tree | 295cd3ca93a45f8fcc43cf3cbf3887c0e0c5526b /APEX_1.4/snippets/SnippetCreateActor/SnippetCreateActor.cpp | |
| parent | Pre-release comments marking end of beta. (diff) | |
| download | physx-3.4-7840347c32755e94a807f978f1cbb558717ac8cf.tar.xz physx-3.4-7840347c32755e94a807f978f1cbb558717ac8cf.zip | |
PhysX 3.4, APEX 1.4 final release @21757769v3.4.0-rc-2
Diffstat (limited to 'APEX_1.4/snippets/SnippetCreateActor/SnippetCreateActor.cpp')
| -rw-r--r-- | APEX_1.4/snippets/SnippetCreateActor/SnippetCreateActor.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/APEX_1.4/snippets/SnippetCreateActor/SnippetCreateActor.cpp b/APEX_1.4/snippets/SnippetCreateActor/SnippetCreateActor.cpp index 949597ec..794e1dd3 100644 --- a/APEX_1.4/snippets/SnippetCreateActor/SnippetCreateActor.cpp +++ b/APEX_1.4/snippets/SnippetCreateActor/SnippetCreateActor.cpp @@ -15,6 +15,8 @@ #include "nvparameterized/NvParameterized.h" #include "nvparameterized/NvParamUtils.h" +#include <legacy/ModuleLegacy.h> + #include "PsString.h" #include <sys/stat.h> @@ -43,8 +45,7 @@ public: const char* path = name; // does file exists? - struct stat info; - if ((stat(path, &info) != -1) && (info.st_mode & (S_IFREG)) != 0) + if (isFileExist(path)) { PxFileBuf* stream = gApexSDK->createStream(path, PxFileBuf::OPEN_READ_ONLY); @@ -113,11 +114,20 @@ void initApex() gApexSDK = CreateApexSDK(apexDesc, &error); PX_ASSERT(gApexSDK); +#if APEX_MODULES_STATIC_LINK + nvidia::apex::instantiateModuleDestructible(); + nvidia::apex::instantiateModuleLegacy(); +#endif + // Initialize destructible module gModuleDestructible = static_cast<ModuleDestructible*>(gApexSDK->createModule("Destructible")); NvParameterized::Interface* params = gModuleDestructible->getDefaultModuleDesc(); gModuleDestructible->init(*params); + // Initialize legacy module + Module* legacy = (gApexSDK->createModule("Legacy")); + legacy->init(*legacy->getDefaultModuleDesc()); + // Create Apex scene SceneDesc sceneDesc; sceneDesc.scene = gPhysicsScene; @@ -137,18 +147,17 @@ void releaseAPEX() delete gMyResourceCallback; } -#include "Shlwapi.h" -int main(int, char**) +void snippetMain(const char* rootPath) { initPhysX(); initApex(); - LPTSTR cmd = GetCommandLine(); - PathRemoveFileSpec(cmd); - strcat(cmd, "/../../snippets/SnippetCommon/cow.apb"); + std::string path; + path.append(rootPath); + path.append("/snippets/SnippetCommon/Wall.apx"); - Asset* asset = loadApexAsset(&cmd[1]); + Asset* asset = loadApexAsset(path.c_str()); DestructibleAsset* destructibleAsset = static_cast<DestructibleAsset*>(asset); @@ -168,6 +177,4 @@ int main(int, char**) releaseAPEX(); releasePhysX(); - - return 0; } |