I’m working on a text rendering library and in order to make it easier to add to a project I am including the shader in the dll file.
What I do right now is this:
- I use MGCB to manually build the shader for both WindowsDX and DesktopGL
- I include those two files in my project as embedded resources
- At runtime I save the appropriate version of the shader to a temporary file and load it with ContentManager.
- I delete the temp file.
As far as I can tell there’s no way to load a shader from a stream (or anything else using ContentManager), which is why I save to a temp file.
I’d like to know if any of this could be done in a simpler/better way. In particular it’d be nice if I could edit the shader and then not have to manually build it.