FreeTexture.htm 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <html>
  2. <head>
  3. <title>Blitz3D Docs</title>
  4. <link rel=stylesheet href=../css/commands.css type=text/css>
  5. </head>
  6. <body>
  7. <h1>FreeTexture texture</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. texture - texture handle
  13. </td>
  14. </tr>
  15. </table>
  16. <h1>Description</h1>
  17. <table>
  18. <tr>
  19. <td>
  20. Frees up a texture from memory. <br />
  21. <br />
  22. Freeing a texture means you will not be able to use it again; however, entities already textured with it will not lose the texture.
  23. </td>
  24. </tr>
  25. </table>
  26. <h1><a href=../3d_examples/FreeTexture.bb>Example</a></h1>
  27. <table>
  28. <tr>
  29. <td>
  30. ; FreeTexture Example <br />
  31. ; ------------------- <br />
  32. <br />
  33. Graphics3D 640,480 <br />
  34. SetBuffer BackBuffer() <br />
  35. <br />
  36. camera=CreateCamera() <br />
  37. <br />
  38. light=CreateLight() <br />
  39. RotateEntity light,90,0,0 <br />
  40. <br />
  41. cube=CreateCube() <br />
  42. PositionEntity cube,0,0,5 <br />
  43. <br />
  44. ; Load texture <br />
  45. tex=LoadTexture( "media/b3dlogo.jpg" ) <br />
  46. <br />
  47. ; Texture cube with texture <br />
  48. EntityTexture cube,tex <br />
  49. <br />
  50. While Not KeyDown( 1 ) <br />
  51. <br />
  52. ; If spacebar pressed then free texture <br />
  53. If KeyHit( 57 )=True Then FreeTexture tex <br />
  54. <br />
  55. pitch#=0 <br />
  56. yaw#=0 <br />
  57. roll#=0 <br />
  58. <br />
  59. If KeyDown( 208 )=True Then pitch#=-1 <br />
  60. If KeyDown( 200 )=True Then pitch#=1 <br />
  61. If KeyDown( 203 )=True Then yaw#=-1 <br />
  62. If KeyDown( 205 )=True Then yaw#=1 <br />
  63. If KeyDown( 45 )=True Then roll#=-1 <br />
  64. If KeyDown( 44 )=True Then roll#=1 <br />
  65. <br />
  66. TurnEntity cube,pitch#,yaw#,roll# <br />
  67. <br />
  68. RenderWorld <br />
  69. <br />
  70. Text 0,0,"Press spacebar to free texture" <br />
  71. Text 0,20,"As you can see this will not affect already textured entities" <br />
  72. <br />
  73. Flip <br />
  74. <br />
  75. Wend <br />
  76. <br />
  77. End
  78. </td>
  79. </tr>
  80. </table>
  81. <br>
  82. <a target=_top href=../index.htm>Index</a><br>
  83. <br>
  84. 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>
  85. </html>