Original Post
Hello. I have a question regarding the SetTranfrom method in the IDirect3DDevice9 class. What we have here is the texture of the background that gets rendered 2 times larger and tiled 10 times in both directions. The code for that is basically this:
D3DXMATRIX texScaling;
D3DXMatrixScaling(&texScaling, 10.0f, 10.0f, 0.0f); //this line says that the background will be tiled 10 times
gd3dDevice->SetTransform(D3DTS_TEXTURE0, &texScaling);
..
D3DXMATRIX S;
D3DXMatrixScaling(&S, 20.0f, 20.0f, 0.0f); // this says that the background will be displaid 20 times larger
mSprite->SetTransform(&S);
mSprite->Daw(....);
And here's the problem. gd3dDevice->SetTransform doesn't just tile the texture 10 times. If that's just what it does, then the texture should be diplayed 20 times larger, as the code for tranfrorming it uses the scaling matrix "D3DXMatrixScaling(&S, 20.0f, 20.0f, 0.0f);". What i want to say is that for the effect we want to achieve, shouldn't we rewrite that line like this
D3DXMatrixScaling(&S, 2.0f, 2.0f, 0.0f); ? But If we make it like this then what we get is the texture much smaller and tiled together ( 10 times? you can't really tell ) and with a general size only 2 times bigger that the size of the original texture. The documentation for gd3dDevice->SetTransform doesn't explain it at all ( it says that it just "Sets a single device transformation-related state" ) -- I also have another question.Since we shouldn't use DirectInput8, what should we use? It was really good because we didn't have to place our code for the input in the main window procedure. Right?