Skip to content

FreeTexture

Narta Xaymar Dirks edited this page Oct 28, 2026 · 9 revisions
Blitz3D

FreeTexture

FreeTexture:Void texture:Int32
Parameter Mode Type Default Description
texture In Int32 required The texture to free.

Description

Releases a texture and its memory. Entities and brushes that were already painted with the texture keep showing it; only the handle becomes unusable, and the image goes away once nothing uses it any more. Do not use the handle itself after freeing it.

Textures are also freed by ClearWorld and when the program ends, but freeing the ones you no longer need keeps memory use down.

Differences

  • ActiveTextures keeps counting a freed texture until the last entity or brush that uses it is gone.
  • A debug build (-d) stops the program when the texture does not exist (a texture that is freed already), see Debug handle checks. The 0 of a texture that failed to load is an error too.

Related Commands

AtlasTexture, CreateTexture, LoadAnimTexture, LoadTexture, PositionTexture, RotateTexture, SaveTexture 〔BlitzLLVM〕, ScaleTexture

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally