I am trying to build a game engine from scratch by following various tutorials using Java, LWJGL, and OpenGL. My current plan, is to follow each tutorial, generating the code they teach, until I have working code. Step 2 is to re-organize, rename, document, and otherwise move stuff around until it matches my specific coding style.
Each new subject, is then packaged up nice and neat in its own project, which is then turned into a library .jar file.
That way I can create a new program, add a few specific library .jar files for "2D Text" or "particle effects" to add new features to my game as needed without a ton of copy and pasting between projects, or importing a super large library into a program that isn't going to use all aspects of it.
Now, here is the part I can't figure out. Most OpenGL rendering with the programmable pipeline uses shaders. If I locate the shaders within my new program, everything is fine. I reference the shaders using the "src/Shaders/shaderEntity.vert" file path.
However, If I want everything nice and neat, and reusable, I should locate those shaders within the library .jar file with the rest of the classes for that feature.
How do I reference a shader file, within another .jar file? The library .jar file itself is located in "dist/lib/myJarFile.jar" and would be in the "/Shaders/shaderEntity.vert" location within the .jar file.
Or is this a bad idea and I should continue locating my shaders within the new programs?