ColinGilbert / noobwerkz-engine

My happy playground of programmer fun.
Apache License 2.0
20 stars 3 forks source link

Keep temp data in memory instead of writing to disk #46

Closed ColinGilbert closed 8 years ago

ColinGilbert commented 8 years ago

In Assimp (and I think OpenMesh) Some functions either didn't exist in-memory and even then, only really worked from file. As a workaround, we have been using temporary files on-disk. This is certainly.sub-optimal.

There are three ways to deal with this (that come off the top of my head):

Build the file structure in-memory (Easiest?)
Fix the upstream libraries to work with in-memory files // Second-easiest(?)
Provide a filesystem from a chunk of memory. // Hardest (?)
ColinGilbert commented 8 years ago

OpenMesh has an IO function that allowed the use of an ostringstream. Assimp was made to work with a simple fmt::MemoryWriter.str() quite nicely. :+1