How can I render to a texture in BlitzMax v1.24?

BlitzMax Forums/BlitzMax Programming/How can I render to a texture in BlitzMax v1.24?

But luckerly you have indiepaths, which you know at least nearly works.