I am working with a custom game engine, and in the engine's Object class:
std::string gObject::exepath;
gObject::gObject() {
char temp[256];
exepath = getcwd(temp, sizeof(temp));
exepath += "/";
for (int i = 0; i < exepath.size(); i++) {
if (exepath[i] == '\\') {
exepath[i] = '/';
}
}
}
This is how the engine gets the exepath. It also has a images path coded in:
std::string gObject::gGetImagesDir() {
if (releasescaling == 1) return exepath + "assets/mipmaps/" + resolutiondirs[releaseresolution];
return exepath + "assets/images/";
}
This path works in eclipse and returns: ../GlistApp/assets/images/
,
but when i tried to move the engine into VS Code, it returns the path: ../GlistApp/build/assets/images/
. Which is actually the expected behaviour since the app is being run in that folder.
Any explanation on why this works in eclipse but not on VS Code? Also the engine is open-source, so how would I go about changing and correcting this issue for VS Code?