Jump to content

View more

Image of the Day

WIP title screen for #DeathOfAPartisan #screenshotsaturday #gamedev https://t.co/qJNhfZCvd4
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Single tile as background?

4: Adsense

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   

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.



#2 Tispe   Members   

1468
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.