• Advertisement
Sign in to follow this  

Single tile as background?

This topic is 1444 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement