Insert PNMimage into texturePool

Hi,

I use copySubImage to crop a bigger png image, and now I would like to store the subparts in the texturePool with a “fake” name to have a cache. Is it possible or do I have to write my own little cache ?

Thanks.

It is. You have to create a Texture object, call .load(image) to load the PNMImage into it, and then set a fake fullpath using tex.fullpath = "fake/path". After that you can use TexturePool.addTexture(tex) to add it to the texture pool.

1 Like