entity - entity handle texture - texture handle frame (optional) - frame of texture. Defaults to 0. index (optional) - index number of texture. Should be in the range to 0-7. Defaults to 0. |
Applies a texture to an entity. The optional frame parameter specifies which texture animation frame should be used as the texture. The optional index parameter specifies which index number should be assigned to the texture. Index numbers are used for the purpose of multitexturing. See dxTextureBlend. A little note about multitexturing and slowdown. Graphics cards support a maximum amount of textures per object, which can be used with very little, if any, slowdown. For most cards this is two, but for a GeForce3 it is four. However, once you use more than this amount, Blitz will emulate the effect itself by duplicating objects and textures. Obviously, this may then cause slowdown. |
; dxEntityTexture Example ; --------------------- dxGraphics3D 640,480 dxSetBuffer dxBackBuffer() camera=dxCreateCamera() light=dxCreateLight() dxRotateEntity light,90,0,0 cube=dxCreateCube() dxPositionEntity cube,0,0,5 ; Load texture tex=dxLoadTexture( "media/b3dlogo.jpg" ) ; Texture entity dxEntityTexture cube,tex While Not dxKeyDown( 1 ) pitch#=0 yaw#=0 roll#=0 If dxKeyDown( 208 )=True Then pitch#=-1 If dxKeyDown( 200 )=True Then pitch#=1 If dxKeyDown( 203 )=True Then yaw#=-1 If dxKeyDown( 205 )=True Then yaw#=1 If dxKeyDown( 45 )=True Then roll#=-1 If dxKeyDown( 44 )=True Then roll#=1 dxTurnEntity cube,pitch#,yaw#,roll# dxRenderWorld dxFlip Wend End |