   Miss Dimensions in Gui
  Hi,I'm trying to develop a little gui for my dx engine.Here is how I draw the push button:  vertexBuffer->Lock(0, 0, (void**)&vertices, NULL);  //Setup vertices  vertices[0].colour = vertexColour;  vertices[0].x = mRect.left;  vertices[0].y = mRect.top;  vertices[0].z = 0.0f;  vertices[0].rhw = 1.0f;  vertices[0].u = 0.0f;  vertices[0].v = 0.0f;  vertices[1].colour = vertexColour;  vertices[1].x = mRect.left+mRect.width;  vertices[1].y = mRect.top;  vertices[1].z = 0.0f;  vertices[1].rhw = 1.0f;  vertices[1].u = 1.0f;  vertices[1].v = 0.0f;  vertices[2].colour = vertexColour;  vertices[2].x = mRect.left+mRect.width;  vertices[2].y = mRect.top+mRect.height;  vertices[2].z = 0.0f;  vertices[2].rhw = 1.0f;  vertices[2].u = 1.0f;  vertices[2].v = 1.0f;  vertices[3].colour = vertexColour;  vertices[3].x = mRect.left;  vertices[3].y = mRect.top+mRect.height;  vertices[3].z = 0.0f;  vertices[3].rhw = 1.0f;  vertices[3].u = 0.0f;  vertices[3].v = 1.0f;    //Unlock the vertex buffer  vertexBuffer->Unlock();  //Set texture  gd3dDevice->SetTexture (0, mTex);  //Draw image  gd3dDevice->DrawPrimitive (D3DPT_TRIANGLEFAN, 0, 2);Texture is an image 100 width and 50 height. And mRect is just a struct for holding left,top,width and height and in this case is left=0,top=0,width=100 and height=50..Ok after some hours guessing what's is wrong in my function IsOver, I noticed that image is screen size is lesser than 100x50. So i tryed to just draw a line after that code:   ID3DXLine *line;   D3DXCreateLine( gd3dDevice, &line ); line->SetWidth( 1 ); line->SetPattern( 0xffffffff ); D3DXVECTOR2 points[2]; points[0] = D3DXVECTOR2( mRect.left,mRect.top );points[1] = D3DXVECTOR2( mRect.left+mRect.width, mRect.top );line->Draw( points, 2, 0xffffffff ); And here the result:  So, indeed my textured quad's dimensions are lesser than 100x50.. WHY ?!I think is not a simple question , so feel free to ask me everythings you want, but i really need help cause after 3 hours i can't figure why this miss dimensions.Thx to all.[Edited by - jpetrie on April 9, 2010 12:33:54 AM]
  I don't know DX, but I would guess that it has something to do with the camera setup. You quad is a 3d primitive, your line seems to be a 2d primitive. In this case your 3d primitive will be rendered according to your camera setup, whereas your line will be drawed directly on screen.Try to check your camera setup, use orthogonal projection instead of perspective projection for gui rendering.Good luck.   ;  He's using pretransformed vertices so matrices don't apply.How did you load the texture? If you used one of the D3DX helper functions the texture might have been padded to the next power of two width/height (128x64).   ;  :) Endurion you saved me ..I was wrong loading texturing now with HR(D3DXCreateTextureFromFileEx (gd3dDevice,TextureString.c_str() , D3DX_DEFAULT_NONPOW2, D3DX_DEFAULT_NONPOW2, D3DX_FROM_FILE, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, D3DX_FILTER_NONE, D3DX_DEFAULT, colorkey, &SrcInfo, NULL, &mTex));Everythings is good.. Really thx and offcourse like i think before this is incredible noob problem :)ehehe Thx again.   ;  Now the question is: For gui there are some kind of problems using non power of 2 tex? Is memory wasting problem or performance problem ?   ;  If anything non power of two might be better on memory usage. They might however be slower for the card to process (I don't think you'll ever notice) or for some cards are plain not available (this might pose a rather realistic problem)   