Skip to content

ClearWorld

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

ClearWorld

ClearWorld:Void entities:Int32=1, brushes:Int32=1, textures:Int32=1
Parameter Mode Type Default Description
entities In Int32 1 True to free every entity. Defaults to True.
brushes In Int32 1 True to free every brush. Defaults to True.
textures In Int32 1 True to free every texture. Defaults to True.

Description

Frees entities, brushes and textures in one call, which suits changing from one level to the next. After it, handles of the cleared kind are no longer valid, so do not use them again. Cameras and lights are entities too, so create them again afterwards.

Examples

Graphics3D 320, 240, 0, 2
SetBuffer BackBuffer()

; Level one.
camera = CreateCamera()
cube = CreateCube()
tex = CreateTexture(64, 64)
EntityTexture cube, tex

; Level two begins with an empty world.
ClearWorld
camera = CreateCamera()
Text 8, 8, "Textures left: " + ActiveTextures()
Flip
WaitKey

Related Commands

AntiAlias, CaptureWorld, RenderWorld, UpdateWorld

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally