Processing textures in Blitz

Blitz3D Forums/Blitz3D Programming/Processing textures in Blitz

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Sure.
myTexture = LoadTexture("texfile.tga")
SetBuffer TextureBuffer(myTexture)

Then just use readpixel, writepixel, text, lines, whatever you like. Two things though --

One, it's often more efficient to CopyRect the texture to an image, perform pixel level operations on that copied image and then re-copyrect the image back to the texture, as I've seen it perform a lot faster, and

Two, if you insist on directly manipulating the texture in this way, load the texture via flag 256, forcing it to vram -- direct access will be faster this way.

Do note, however, that flag 256 has the occasional compatibility problem. Copyrect does not.