I'm having a problem with shader code. To use them, I load in the file containing the shader code into main.c and then compiling in the main.c file.
This is good, but the way I have implemented it causes the file to be loaded relative to my working directory. This causes the file to only be loaded when I'm in a specific directory causing the executable to not be able to run anywhere else.
For example:
game/build/bin
game/obj/main.o
game/src/shader/shader.vert
game/src/shader/shader.frag
game/src/main.c
This barebones file structure is similar to mine.
The problem is that the binary can only work when running it in the game/ directory.
Is it possible to compile the shaders into the executable so it can be moved to any of directory and still work?
I have tried searching for solutions online but I can't find a solution yet. I have went to the opengl documentation but can't see anything that would work.