Sign in to follow this  
llloyd

scaling down textures

Recommended Posts

llloyd    124
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
llloyd    124
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
Supernat02    604
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this