| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <html>
- <head>
- <title>Blitz3D Docs</title>
- <link rel=stylesheet href=../css/commands.css type=text/css>
- </head>
- <body>
- <h1>FreeTexture texture</h1>
- <h1>Parameters</h1>
- <table>
- <tr>
- <td>
- texture - texture handle
- </td>
- </tr>
- </table>
- <h1>Description</h1>
- <table>
- <tr>
- <td>
- Frees up a texture from memory.
<br />
-
<br />
- Freeing a texture means you will not be able to use it again; however, entities already textured with it will not lose the texture.
- </td>
- </tr>
- </table>
- <h1><a href=../3d_examples/FreeTexture.bb>Example</a></h1>
- <table>
- <tr>
- <td>
- ; FreeTexture Example
<br />
- ; -------------------
<br />
-
<br />
- Graphics3D 640,480
<br />
- SetBuffer BackBuffer()
<br />
-
<br />
- camera=CreateCamera()
<br />
-
<br />
- light=CreateLight()
<br />
- RotateEntity light,90,0,0
<br />
-
<br />
- cube=CreateCube()
<br />
- PositionEntity cube,0,0,5
<br />
-
<br />
- ; Load texture
<br />
- tex=LoadTexture( "media/b3dlogo.jpg" )
<br />
-
<br />
- ; Texture cube with texture
<br />
- EntityTexture cube,tex
<br />
-
<br />
- While Not KeyDown( 1 )
<br />
-
<br />
- ; If spacebar pressed then free texture
<br />
- If KeyHit( 57 )=True Then FreeTexture tex
<br />
-
<br />
- pitch#=0
<br />
- yaw#=0
<br />
- roll#=0
<br />
-
<br />
- If KeyDown( 208 )=True Then pitch#=-1
<br />
- If KeyDown( 200 )=True Then pitch#=1
<br />
- If KeyDown( 203 )=True Then yaw#=-1
<br />
- If KeyDown( 205 )=True Then yaw#=1
<br />
- If KeyDown( 45 )=True Then roll#=-1
<br />
- If KeyDown( 44 )=True Then roll#=1
<br />
-
<br />
- TurnEntity cube,pitch#,yaw#,roll#
<br />
-
<br />
- RenderWorld
<br />
-
<br />
- Text 0,0,"Press spacebar to free texture"
<br />
- Text 0,20,"As you can see this will not affect already textured entities"
<br />
-
<br />
- Flip
<br />
-
<br />
- Wend
<br />
-
<br />
- End
- </td>
- </tr>
- </table>
- <br>
- <a target=_top href=../index.htm>Index</a><br>
- <br>
- Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=FreeTexture&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
- </html>
|