• Create Account

Need scary sound effects or creepy audio loops for your next horror-themed game? Check out Highscore Vol.3 - The Horror Edition in our marketplace. 50 sounds and 10 loops for only \$9.99!

Posted 19 June 2012 - 08:04 AM

I left the half pixel offset peice of code in there. In the draw function it is where I define the left,top,bottom,right. I subtract 0.5! from them. I think I have found my main cause, the texture I am using is 128x192, and when I load it, it does load it on a 128x256 texture. Well, I made sure that it rendered 128x192, but I did not pay attention to the texture. It stretches the texture to fit the 128x256 which is causing the problem. I saved the texture to a file and I saw that it was stretched.
What could I do to turn off the stretching when loading the texture?
Also, what's a way to get the true width and height of the texture(non power of two dimensions)

I have got it figured out with a little bit of messing around. Now I just need to find a way to get the true width/height of the texture, but I'll google around for that. For future reference, the solution I made was this for loading my texture:
texture = texture.FromFile(device, fileName, 0, 0, 0, Usage.None, Format.Unknown, Pool.Managed, Filter.Point, Filter.Box, 0)

I just changed the filter method basically.

Posted 19 June 2012 - 07:41 AM

I left the half pixel offset peice of code in there. In the draw function it is where I define the left,top,bottom,right. I subtract 0.5! from them. I think I have found my main cause, the texture I am using is 128x192, and when I load it, it does load it on a 128x256 texture. Well, I made sure that it rendered 128x192, but I did not pay attention to the texture. It stretches the texture to fit the 128x256 which is causing the problem. I saved the texture to a file and I saw that it was stretched.
What could I do to turn off the stretching when loading the texture?
Also, what's a way to get the true width and height of the texture(non power of two dimensions)