   IDirectxFile
  Anybody can help me with an example with the best procedure to load a .x file with texture properties?thanks. 
  Here''s mine function meshobject.LoadMesh(filename: PChar): HRESULT;var  pVertices: PByte;  i: integer;  strTexturePath: array[0..511] of Char;  pTempMesh: ID3DXMesh;  p1,p2,p3: PDword;begin  result := E_INVALIDARG;  if filename = nil then // No problem    exit;  // D3DXMESH_SYSTEMMEM is for meshes that we will process.  // You can also use D3DXMESH_USEHWONLY  Result:= D3DXLoadMeshFromX(filename, D3DXMESH_SYSTEMMEM, dev.D3DDevice,    @bufAdjacency, @bufMaterials, @NumMaterials,    MeshSysMem);  if failed(result) then  begin    debugD3Derror(result, ''D3DXLoadMeshFromFileX'');    exit;  end;  debugout(''Mesh loaded with ''+inttostr(numMaterials)+'' materials.'');  Result:= MeshSysMem.GetVertexBuffer(Vertexbuffer);  if FAILED(Result) then  begin    debugD3Derror(result, ''Mesh.GetVertexBuffer'');    Exit;  end;  Result:= VertexBuffer.Lock(0, 0, pVertices, 0);  if FAILED(Result) then  begin    debugD3Derror(result, ''Vertexbuffer.Lock'');    Exit;  end;  Result:= D3DXComputeBoundingBox(pVertices^, MeshSysMem.GetNumVertices,    MeshSysMem.GetFVF, aabb1, aabb2);  if FAILED(Result) then  begin    debugD3Derror(result, ''D3DXComputeBoundingBox'');    Vertexbuffer.Unlock;    Vertexbuffer:= nil;    Exit;  end;  if (NumMaterials = 0) then  begin    Vertexbuffer.Unlock;    Vertexbuffer:= nil;    Result := E_INVALIDARG;    Exit;  end;  // Get the array of materials out of the Result :=ed buffer, allocate a  // texture array, and load the textures  Materials := PD3DXMaterialsArray(bufMaterials.GetBufferPointer);//  SetLength(Textures, NumMaterials);  for i:= 0 to (NumMaterials - 1) do  begin strcopy(strTexturePath, Materials[i].pTextureFilename); AssignTexture(strTexturePath);  end;  Vertexbuffer.Unlock;  Vertexbuffer:= nil;  // Make sure there are normals, which are required for the drawing  // enhancement  if (MeshSysMem.GetFVF and D3DFVF_NORMAL) = 0 then  begin    Result:= MeshSysMem.CloneMeshFVF(D3DXMESH_MANAGED,  MeshSysMem.GetFVF or D3DFVF_NORMAL,  dev.D3DDevice, pTempMesh);    if FAILED(Result) then    begin debugD3Derror(result, ''CloneMeshFVF''); Exit;    end;    D3DXComputeNormals(pTempMesh, nil);    // tempmesh has normals now, so meshsysmem takes it over    MeshSysMem:= nil;    MeshSysMem:= pTempMesh;  end;  D3DXCreateBuffer(bufadjacency.GetBufferSize, bufAdjacency2);//    Result := MeshSysMem.GenerateAdjacency(0.0, bufAdjacency.GetBufferPointer); Result := MeshSysMem.OptimizeinPlace(D3DXMESHOPT_COMPACT or D3DXMESHOPT_VERTEXCACHE, bufAdjacency.GetBufferPointer, bufAdjacency.getbufferpointer, nil, nil);    if FAILED(Result) then    begin debugD3Derror(result, ''OptimizeInPlace''); Exit;    end;  Result:= S_OK;end;;  Oh I guess you''''ll need this too unit Textureunit;// Manages all the textures the application needs.// Loads them, avoids duplicatesinterfaceuses Windows,Direct3D8, D3DX8, debugunit;const MAXTEXTURES = 32;type  TTexman = class  public    // Textures    Texnames : array[0..MAXTEXTURES-1] of string;    Textures : array[0..MAXTEXTURES-1] of IDirect3DTexture8;    Texsizes : array[0..MAXTEXTURES-1] of TD3DSurfaceDesc;    Numtextures: integer;    MaxSimultaneousTextures: integer;    Multitexture: boolean;    procedure Init;    function AddTexture(const texfile: string): integer;    function SetTexture(stage,tex: integer): HRESULT;    function UnsetTexture(num: integer): HRESULT;  private    constructor Create;    destructor Destroy;  end;var  Texmanager: TTexman;implementationuses sceneunit;// Things that can only happen when the device is initialized, so they cannot// be called in the constructorprocedure TTexman.Init;begin  MaxSimultaneousTextures := scene.scenedev.D3DDeviceCaps.MaxSimultaneousTextures;  Multitexture := (MaxSimultaneousTextures <> 1);  Addtexture(''temp\null.bmp''); // Load the NULL texture. // If you can see it, there is a problemend;function TTexman.AddTexture(const texfile: string): integer;var i: integer;  hr: HRESULT;begin  result := -1;  if Numtextures >= MAXTEXTURES-1 then    exit;  // Find if texture exists  for i:=0 to Numtextures-1 do    if Texnames[i] = texfile then    begin result := i; exit;    end;  // Not found, add it  //    result := D3DXCreateTextureFromFileA(dev.D3DDevice, texfile, Textures[Numtextures]);  hr := D3DXCreateTextureFromFileExA(scene.scenedev.D3DDevice, PChar(texfile),    D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, D3DFMT_UNKNOWN,    D3DPOOL_MANAGED, D3DX_FILTER_NONE, D3DX_DEFAULT, 0, nil, nil, Textures[Numtextures]);  if failed(hr) then  begin    debugD3Derror(hr, ''D3DXCreateTextureFromFileA'');    exit;  end;  Texnames[Numtextures] := texfile;  Textures[Numtextures].GetLevelDesc(0, Texsizes[numtextures]);  result := Numtextures;  inc(Numtextures);end;function TTexman.SetTexture(stage,tex: integer): HRESULT;begin  scene.scenedev.D3DDevice.SetTexture(stage, Textures[tex]);end;function TTexman.UnsetTexture(num: integer): HRESULT;var i: integer;begin  for i := 0 to num-1 do    scene.scenedev.D3DDevice.SetTextureStageState(i, D3DTSS_COLOROP, D3DTOP_DISABLE);end;// ==========================================================================constructor TTexman.Create;begin  NumTextures := 0;end;destructor TTexman.Destroy;var i: integer;begin  for i:=0 to numtextures-1 do  begin    Textures[i] := nil;  end;  Numtextures := 0;end;initialization// SingletonTexmanager := TTexman.Create;end.;  hi, with directx 9 SDK there is an application called mesh viewer, and with this application you can load a .x file an you can select any object and look its name, anybody know how does it do?And if in the .x file someone texture y wrapped (with tile U,V) 3x3 how does it do to directx load texture wrapped (with tile U,V) without resize? ;  The easiest way:  go through the last tutorial from Microsoft.  It''s included in the SDK.  They are in the Tutorials and Samples subfolder in the docs (at least, the are in the Tutorials and Samples subfolder in the DX summer update docs) 