Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#Actualaddy914

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.

#2addy914

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)

#1addy914

Posted 19 June 2012 - 07:40 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?

PARTNERS