Single tile as background?

Started by
0 comments, last by Tispe 10 years, 2 months ago

Hello, I have a question regarding drawing a single tile as a background with DirectX 9.

Lets say that I have a single tile with a size 50px X 50px how would one go about drawing this? Currently I can only think of having multiple copies of the tile and draw each one individually to the screen. Is this the best way of doing this? Or is it the only way?

Thanks.

Advertisement

you set the addressing modes for the sampler, MIRROR or WRAP


device->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_MIRROR);
device->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_MIRROR);

Then you can draw a Quad where the UV addresses goes beyond 1.0f. for example if the vertex has an UV address of 2.0f, you will have the texture repeated two times in the same Quad.

This topic is closed to new replies.

Advertisement