I am running a program in SDL, which obviously should load resources for the file system. I would like the file calls within the program to be platform independent. My initial idea is to define a macro (allows you to call it PTH for the path), which is defined in the preprocessor based on the type of system, and then makes file calls in the program using it. for instance
SDL_LoadBMP(PTH("data","images","filename"));
will just translate to something related to the file system.
If macros are an accepted way to do this, such macros would look (how to check which system is used, combine lines in a macro?)
If not, what is an acceptable way to do this?
source share