Reputation: 105
I am tryig to draw a rectangle with texture using VertexPositionTexture but I get an error:
An unhandled exception of type 'System.NotSupportedException' occurred in Microsoft.Xna.Framework.Graphics.dll
Additional information: XNA Framework Reach profile requires TextureAddressMode to be Clamp when using texture sizes that are not powers of two.
Thanks.
Upvotes: 1
Views: 328
Reputation: 1297
Three options:
(1) Try adding this line:
GraphicsDevice.SamplerStates[0] = SamplerState.LinearClamp;
This may change the appearance of the texture.
(2)
Change the height and width of the texture such that height * width is a power of 2. (i.e. ((2^9) * (2^9)) = 512*512 = 2^18)
(3) Change the XNA profile from Reach to Hi-def.
Right-click your project in Solution Explorer
Choose Properties
Focus the XNA Game Studio tab, and make your selection
(http://blogs.msdn.com/b/shawnhar/archive/2010/07/19/selecting-reach-vs-hidef.aspx)
Upvotes: 1