• Advertisement
Sign in to follow this  

scaling down textures

This topic is 4895 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

i wrote a 2d game using managed directx where we used very high resolution textures and the sprite helper class. at the time the plan was to only ever work with 1024x768 so I would load a 1024x1024 texture with no filtering and then only specify 1024x768 when i'm calling sprite.draw(...) of course now that its finished the spec has been changed and now they want to support other resolutions. so far i can't figure out how i tell it to stretch the texture... if i change the size in sprite.draw it just shows more of less of the jpeg, rather than scaling it up or down... anyone want to point me in the right direction?

Share this post


Link to post
Share on other sites
Advertisement
The 'other resolution'-gfxcards simply don't support 1024x1024. You need to split the file, and draw at each side to join the splitted into one images.

Share this post


Link to post
Share on other sites
no it runs fine, just it still displays the 1024x768, just cut off at 800x600... i dont know how to tell sprite to reduce the size while still using only the 1024x768 of 1024x1024 texture.

Share this post


Link to post
Share on other sites
You should know the resoultion you want to support when you initialize the game, so you could just load it into the texture at that resolution.

i.e. 1024x1024 is okay, so load a 1024x768 image into it. Or 800x600 is requested, so create a texture at 800x600 and load the 1024x768 image into it. DirectX will scale it and you can turn filtering on or off.

Good luck,
Chris

Share this post


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

  • Advertisement