I am having some trouble loading image files from non-standard locations. For instance, the way I have my project setup is as such:
root
----Source
----Assets
----Apps
------VS2013
---
------OSX
As a result, in order to load assets, I have to do the following:
#define ASSET_SCRIPT_DIRECTORY "../../../Assets/"
void ASSET_DIR(char* result, char const* fileName)
{
assert(result != 0);
assert(strlen(result) > strlen(fileName) + strlen(ASSET_SCRIPT_DIRECTORY));
strcpy(result, ASSET_SCRIPT_DIRECTORY);
strcat(result, fileName);
}
and to assign the sprite's image
int imageID = agk::LoadImage(spriteName);
AGK::cImage* image = agk::GetImagePtr(imageID);
this->spritePtr->SetImage(image);
I have also tried the following:
int imageID = agk::LoadImage(spriteName);
agk::SetSpriteImage(this->spriteID, imageID);
I am however getting the default "no image found" image.
The only way I can get images to load properly is if they are in the same directory as the EXE. This isn't very comfortable since I have multiple project types so the asset have to be outside the VS solution folder (or the XCode directory)
Any help is greatly appreciated!