Mr Bell
Mr Bell

Reputation: 9338

How to set xna's TextureFilter to Point

I have a little Texture2D:

myTexture = new Texture2D(GraphicsDevice, 512, 512, false, SurfaceFormat.Vector4);

when I try to draw it:

        spriteBatch.Begin();
        spriteBatch.Draw(myTexture, new Rectangle(0, 0, 512, 512), Color.White);
        spriteBatch.End();

I get an exception:

"XNA Framework HiDef profile requires TextureFilter to be Point when using texture format Vector4."

How can I set TextureFilter to Point?

Upvotes: 2

Views: 1728

Answers (1)

Andrew Russell
Andrew Russell

Reputation: 27245

Pass SamplerState.PointClamp or SamplerState.PointWrap to SpriteBatch.Begin.

Upvotes: 2

Related Questions