Jump to content

  • Log In with Google      Sign In   
  • Create Account

Single tile as background?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 OnlyAntony   Members   -  Reputation: 140

Like
0Likes
Like

Posted 06 February 2014 - 11:42 AM

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.



Sponsor:

#2 Tispe   Members   -  Reputation: 1039

Like
2Likes
Like

Posted 06 February 2014 - 12:33 PM

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.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS