samedi 11 janvier 2020

How to have access to the current directory inside a class? [closed]

I have a class Sprite and I want to be able to construct a sprite by passing a relative file path. How can I have access to the current path inside that class? I can’t just do std::filesystem::current_path because the path depends on another singleton class. Should I call the static class inside the Sprite class? The problem is that the static class isn’t yet avalaible when I already need to construct a Sprite. How can I organize the code?

Aucun commentaire:

Enregistrer un commentaire