Texture from string.

I have a string of the binary contents of a png file (sent by a non-panda server) that I would like to use as a texture. I am completely confused as to how without writing it to disk first. PNMImage only seems to load from files or uncompressed strings. Same with setRamImage. I would be very grateful is someone could walk me through the process as I am quite lost at this point.

You could make a IStringStream, and use that as argument to Texture.read, I think.

An example of doing exactly this is illustrated in the manual under Loading resources for nonstandard sources.


I now feel embarrassed that I didn’t find this. Thank you