b2dFreeMesh

Frees a mesh loaded with b2dLoadMesh, including the texture it auto-loaded. Takes handle (mesh handle from b2dLoadMesh, integer). Returns nothing.

2D Overlay

Parameters & Returns

Parameters

handle Int

Returns

Void

Quick Summary

Frees a mesh loaded with b2dLoadMesh, including the texture it auto-loaded. Takes handle (mesh handle from b2dLoadMesh, integer). Returns nothing.

Technical Exegesis...

Frees a mesh loaded with b2dLoadMesh: its vertex frames, faces, UVs, material palette and animation clips, plus the texture image b2dLoadMesh auto-loaded for it (the handle b2dMeshTexture returned is freed too, so don't draw with it afterwards). Takes handle (mesh handle from b2dLoadMesh, integer). Returns nothing. Meshes are not freed automatically, so a program that loads meshes repeatedly (level changes, swapping models) should free the old one first or it will leak memory.

Example

Example.bam
mesh = b2dLoadMesh("Media/level1.bb3d")
; ... play level 1 ...
b2dFreeMesh(mesh)
mesh = b2dLoadMesh("Media/level2.bb3d")