I am trying to open some openGL shaders on my C++ application. My application is separated on two abstraction layers: the graphics engine (which uses openGL) and the actual application logic. I want the graphics engine to be as recyclable as possible[1] (for other projects).
The problem is that if I define the shader file's path relatively (for instance #define FOO_FRAG_SHADER "shaders/foo.frag"
) the program is not able to find it, as this directory is relative to the graphics engine's path and not the application's path. For the reason commented above [1], I really don't want to specify it's directory relative to the application's dir, as it becomes application dependent.
Therefore, my question is: Is there anyway to specify a directory relative to a file which specifies it?