I'm new to programming with c++ and direct3d. I try to draw textures(LPDIRECT3DTEXTURE9) on the screen with a sprite(LPD3DXSPRITE). But when I draw a texture it seems to enlarge it, a 100x100 px texture is not drawn from coordinates (100, 100) to (200, 200) but from (100, 100) to (227, 227), I tested that by drawing 1x1 px blocks at those coordinates. I can't figure out why this is the case... Is the creation of the LPDIRECT3DDEVICE9 of any influence on it or could it be 开发者_如何学编程something completely different?
This seems to be a scaling issue. When you first call CreateTextureFromFile(), the function causes the texture to be scaled to a power of 2 rule (512, 256 for example). To fix this, simply call the setScale function to 1,1 and this should fix your problem :)
精彩评论