aboutsummaryrefslogtreecommitdiff
path: root/APEX_1.4/snippets/SnippetResourcesLoading/SnippetResourcesLoading.cpp
diff options
context:
space:
mode:
authorsschirm <[email protected]>2016-12-27 13:43:54 +0100
committersschirm <[email protected]>2016-12-27 13:43:54 +0100
commit64566804758e08a4c1d13fc1f8f7cb9ea8c674c8 (patch)
treeff28d36ab8f2023176d84ba397ad5aaf508dcff6 /APEX_1.4/snippets/SnippetResourcesLoading/SnippetResourcesLoading.cpp
parentPhysX 3.4 / APEX 1.4 release candidate @21506124 (diff)
downloadphysx-3.4-64566804758e08a4c1d13fc1f8f7cb9ea8c674c8.tar.xz
physx-3.4-64566804758e08a4c1d13fc1f8f7cb9ea8c674c8.zip
PhysX 3.4, APEX 1.4 release candidate update: @21511067-21511214
Diffstat (limited to 'APEX_1.4/snippets/SnippetResourcesLoading/SnippetResourcesLoading.cpp')
-rw-r--r--APEX_1.4/snippets/SnippetResourcesLoading/SnippetResourcesLoading.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/APEX_1.4/snippets/SnippetResourcesLoading/SnippetResourcesLoading.cpp b/APEX_1.4/snippets/SnippetResourcesLoading/SnippetResourcesLoading.cpp
index 6fec78be..39e85349 100644
--- a/APEX_1.4/snippets/SnippetResourcesLoading/SnippetResourcesLoading.cpp
+++ b/APEX_1.4/snippets/SnippetResourcesLoading/SnippetResourcesLoading.cpp
@@ -22,6 +22,7 @@
#include "PsString.h"
#include <sys/stat.h>
+#include "Shlwapi.h"
using namespace nvidia::apex;
@@ -31,6 +32,7 @@ ApexSDK* gApexSDK = NULL;
DummyRenderResourceManager* gDummyRenderResourceManager = NULL;
MyResourceCallback* gMyResourceCallback = NULL;
+LPTSTR gMediaPath;
class MyMaterial
{
@@ -56,7 +58,11 @@ public:
{
Asset* asset = 0;
- const char* path = name;
+ CHAR buf[256];
+ strcpy(buf, gMediaPath);
+ strcat(buf, name);
+ strcat(buf, ".apx");
+ const char* path = &buf[1];
// does file exists?
struct stat info;
@@ -172,9 +178,6 @@ void releaseAPEX()
delete gMyResourceCallback;
}
-
-#include "Shlwapi.h"
-
int main(int, char**)
{
initPhysX();
@@ -182,21 +185,16 @@ int main(int, char**)
Asset* asset;
- LPTSTR cmd = GetCommandLine();
- PathRemoveFileSpec(cmd);
- strcat(cmd, "/../../snippets/SnippetCommon/");
+ gMediaPath = GetCommandLine();
+ PathRemoveFileSpec(gMediaPath);
+ strcat(gMediaPath, "/../../snippets/SnippetCommon/");
- CHAR buf[256];
- strcpy(buf, cmd);
- strcat(buf, "testMeshEmitter4BasicIos6.apx");
- asset = loadApexAsset(EMITTER_AUTHORING_TYPE_NAME, &buf[1]);
+ asset = loadApexAsset(EMITTER_AUTHORING_TYPE_NAME, "testMeshEmitter4BasicIos6");
asset->forceLoadAssets();
gApexSDK->forceLoadAssets();
asset->release();
- strcpy(buf, cmd);
- strcat(buf, "testSpriteEmitter4BasicIos6.apx");
- asset = loadApexAsset(EMITTER_AUTHORING_TYPE_NAME, &buf[1]);
+ asset = loadApexAsset(EMITTER_AUTHORING_TYPE_NAME, "testSpriteEmitter4BasicIos6");
asset->forceLoadAssets();
gApexSDK->forceLoadAssets();
asset->release();