Setting TextureAddressMode to Clamp for XNA Reach
I get this exception:
XNA Framework Reach profile requires TextureAddressMode to be Clamp when using texture sizes that are not powers of two.
when running my game under Reach settings.
I've already set everything to use SamplerState.LinearClamp but the exception is still being t开发者_Python百科hrown all over the place!
e.g.
spriteBatch.Begin(0, BlendState.Opaque, SamplerState.LinearClamp, DepthStencilState.None,
RasterizerState.CullCounterClockwise, effect);
spriteBatch.Draw(texture, new Rectangle(0, 0, width, height), Color.White);
spriteBatch.End();
That should work right?? BUT IT DOESN'T!
Help!
I may be a bit out of date with my XNA knowledge, but can't you only change blend/rasterizer state if the SpriteBatch is set to SpriteSortMode.Immediate?
The other option of course is to make sure all your textures are power of two, which they really should be anyway ;)
精彩评论