LPDIRECT3DTEXTURE9 texture; D3DXCreateTextureFromFile(device, "texture.jpg", &texture);
mesh->SetTexture(0, texture);
D3DSURFACE_DESC desc; texture->GetLevelDesc(0, &desc);This code retrieves information about the texture, such as its width, height, format, and usage. The first parameter is the texture level (0 is the base level) and the second parameter is a pointer to the D3DSURFACE_DESC structure. These code examples are part of the DirectX SDK package library, which provides a comprehensive set of tools for 3D graphics programming using C++.