2
\$\begingroup\$

I can draw some curves using this:

GraphicsDevice.DrawUserPrimitives<VertexPositionColor>
           (PrimitiveType.LineStrip, Points, 0, count);

Now I try to set the PointSize to make the line thicker but I can only find a solution for XNA 3.0 using:

GraphicsDevice.RenderState.PointSize

How can I make my lines thicker in XNA 4.0?

\$\endgroup\$
2
\$\begingroup\$

XNA 4 does not support point sprites, which is (I believe) all that PointSize is for; for some rationale, see Shawn Hargreaves' blog post on the subject. The short version is that D3D10+ does not support them, and continuing to expose them in XNA restricts options for eventually moving XNA's underpinnings to a newer D3D version.

While it's not a decision that was met with universal praise, it's not the end of the world because you can simulate the effects yourself. It just requires more work. Fortunately, there are third-party solutions to do so that already exist -- something like the RoundLine library might serve your needs, or you can see this blog post about a similar technique (probably actually the same one RoundLine uses).

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.