Hilfe
FreeTexture
Aufruf
Parameter
Rückgabewert
Beschreibung
Beispiel
Siehe auch
FreeTexture textur%
Parameter
textur% | Identität einer Textur |
Rückgabewert
-
Beschreibung
Der Befehl FreeTexture löscht eine Textur. Man kann danach einen neue laden/erstellen.
Das Löschen einer Textur übernimmt BlitzBasic auch automatisch am Ende des Programms. Trotzdem ist es besser, wenn man es manuell macht. Zudem kann man während der Ausführung Texturen löschen.
Beispiel
Standardbeispiel:
Graphics3D 640, 480
SetBuffer BackBuffer()
camera = CreateCamera()
PositionEntity camera, 0, 1, - 5
light = CreateLight()
RotateEntity light, 90, 0, 0
cone = CreateCone(32)
PositionEntity cone, 0, 2, 0
plane = CreatePlane()
grass_tex = LoadTexture("media/chorme-2.bmp")
EntityTexture plane, grass_tex
EntityAlpha plane, 0.5
mirror = CreateMirror()
While Not KeyHit(1)
If KeyDown(203) = 1 Then MoveEntity cone, - 0.1, 0, 0
If KeyDown(205) = 1 Then MoveEntity cone, 0.1, 0, 0
If KeyDown(208) = 1 Then MoveEntity cone, 0, - 0.1, 0
If KeyDown(200) = 1 Then MoveEntity cone, 0, 0.1, 0
If KeyDown(44) = 1 Then MoveEntity cone, 0, 0, - 0.1
If KeyDown(30) = 1 Then MoveEntity cone, 0, 0, 0.1
RenderWorld
Text 0, 0, "Benutze Cursortasten und A/Z"
Flip
Wend
FreeTexture grass_tex
End
SetBuffer BackBuffer()
camera = CreateCamera()
PositionEntity camera, 0, 1, - 5
light = CreateLight()
RotateEntity light, 90, 0, 0
cone = CreateCone(32)
PositionEntity cone, 0, 2, 0
plane = CreatePlane()
grass_tex = LoadTexture("media/chorme-2.bmp")
EntityTexture plane, grass_tex
EntityAlpha plane, 0.5
mirror = CreateMirror()
While Not KeyHit(1)
If KeyDown(203) = 1 Then MoveEntity cone, - 0.1, 0, 0
If KeyDown(205) = 1 Then MoveEntity cone, 0.1, 0, 0
If KeyDown(208) = 1 Then MoveEntity cone, 0, - 0.1, 0
If KeyDown(200) = 1 Then MoveEntity cone, 0, 0.1, 0
If KeyDown(44) = 1 Then MoveEntity cone, 0, 0, - 0.1
If KeyDown(30) = 1 Then MoveEntity cone, 0, 0, 0.1
RenderWorld
Text 0, 0, "Benutze Cursortasten und A/Z"
Flip
Wend
FreeTexture grass_tex
End
Siehe auch
ClearTextureFilters, CreateTexture, FreeBrush, FreeEntity, LoadAnimTexture, LoadTexture, ClearWorld

