I came with a nice solution to all this and thought I'd share... <div><br></div><div>I wrote a tool named makeres. In Lazarus edit the default project configuration adding Compilation | Execute Before | makeres $(CompPath). Then when ever you build/run a project the following happens:</div>
<div><br></div><div>* Two directories are created if they don't already exist, one named raw the other resources.</div><div>* Any files in raw get compressed and converted to base64 encoded res files placed in the resources folder</div>
<div>* A unit is automatically maintained for your project named ProjectName.Resources</div><div>* The ProjectName.Resources unit contains the following (example resources from raw)</div><div><br></div><div><div>unit ProjectName.Resources;</div>
<div><br></div><div>{$mode delphi}</div><div><br></div><div>interface</div><div><br></div><div>{doc off}</div><div>{ To strip unused resources turn off debug symbols and compile with -CX -XX }</div><div><br></div><div>const</div>
<div> ResLargeFont = {$i resources/large.font.base64};</div><div> ResShaderFrag = {$i resources/shader.frag.base64};</div><div> ResShaderVert = {$i resources/shader.vert.base64};</div><div> ResSkyboxJpeg = {$i resources/skybox.jpg.base64};</div>
<div>{doc on}</div><div><br></div><div>implementation</div><div><br></div><div>end.</div></div><div><br></div><div>* Then to decompressed and read a resources in your app you call call any of these functions (built into my library)</div>
<div><br></div><div><div>{ Convert a resource into a memory location }</div><div>function ResMemory(constref Resource: string): Pointer;</div><div>{ Convert a resource into a stream }</div><div>function ResStream(constref Resource: string): TStream;</div>
<div>{ Convert a resource into a string }</div><div>function ResString(constref Resource: string): string;</div></div><div><br></div><div>So for example you can say:</div><div><br></div><div>Font.LoadFromStream(ResStream(ResLargeFont));</div>
<div>or</div><div>Shader.Compile(ResString(ResShaderFrag), shaderFragment);</div><div><br></div><div>So in summary, you just drop files into your raw folder, and use the above two lines of code. That's all you have to do.</div>