   Mapping textures into coordinates ?
  For example I've got an image (.jpg) that is 1042 x 815 that I want to display on a quad.  I'm using D3DX function loadTextureFromFile (something like this).Now If I want it to fit in the quad, what will be the coordinates of my quad ?Why does it always crash when I modify the mipmaps levels parameter to somethjing other than 0 ?And Is it an obligation to use textures that are a power of 2 ?Any help would be appreciated, including links to useful ressources avbout texturing with DirectXOh and by the way, how many different textures can I render in a scene before it starts to mess the frame rate ?  I mean just an approximation 10, 50, 5000 ?Thanks.   
  1. If you've loaded the file onto a 1042x815 texture, then the texture coordinates will simply be in the range of 0 to 1 in both the U and V direction to specify the whole texture.If you (or D3DX acting on your behalf) have loaded the file into a larger texture that is the next power of 2, then the texture coordinates will be as follows (assuming the origin of your quad is the top left corner):- top left corner of the quad: U=0,V=0- bottom right corner of the quad:U = file_width / texture_widthV = file_height / texture_height- where file_width and file_height are the dimensions of your source image (e.g. 1042x815) and- texture_width and texture_height are the dimensions of the power-of-2 texture you've loaded the image onto (e.g. 2048x1024)2. check the capabilities of your hardware. Many graphics chips cannot mip-map textures which don't have power-of-2 dimensions. In particular, check D3DCAPS9.TextureCaps for the presence of D3DPTEXTURECAPS_NONPOW2CONDITIONAL. When that flag is set, then although the card will handle textures which aren't powers of 2, those texture must meet a number of conditions (see the SDK documentation for a list) - one of those conditions is that the texture is not mip-mapped.3. You don't need to use power-of-2 surfaces, but many graphics chips don't like non-power-of-2 - generally it's advisable to use power-of-2 where possible and ensure your source images are too.4. A 2048x1024 texture can be wasteful of memory so if you really need non-power of-2 source images, it's a good idea to either:- split the loaded image across a few power-of-2 textures to make best use of space (e.g. for a 1042x512 image, use a 1024x512 texture and a 32x512 texture).- and/or pack parts of the image into a texture that's a closer fit - for example, create a 1024x1024 texture then copy/move the extra parts from the right of the source image into the bottom unused space of the 1024x1024 texture   ;  Thanks, I'll try that.   