开发者

Setting TextureAddressMode to Clamp for XNA Reach

开发者 https://www.devze.com 2023-02-03 03:55 出处:网络
I get this exception: XNA Framework Reach profile requires TextureAddressMode to be Clamp when using texture sizes that are not

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 ;)

0

精彩评论

暂无评论...
验证码 换一张
取 消