title: I don't fully understand D2D1_FIGURE_BEGIN: why is it needed, what's the difference, and why does Microsoft's sample code mismatch types anyway?
body: <p>I'm reading up on Direct2D before I migrate my GDI code to it, and I'm trying to figure out how paths work. I understand most of the work involved with geometries and geometry sinks, but there's one thing I don't understand: the <code>D2D1_FIGURE_BEGIN</code> type and its parameter to <code>BeginFigure()</code>.</p>
  <p>First, why is this value even needed? Why does a geometry need to know if it's filled or hollow ahead of time? I don't know nay other drawing API which cares about whether path objects are filled or not ahead of time; you just define the endpoints of the shapes and <em>then</em> call <code>fill()</code> or <code>stroke()</code> to draw your path, so how are geometries any different?</p>
  <p>And if this parameter is necessary, how does choosing one value over the other affect the shapes I draw in?</p>
  <p>Finally, if I understand the usage of this enumeration correctly, you're supposed to only use filled paths with <code>FillGeometry()</code> and hollow paths with <code>DrawGeometry()</code>. However, <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/dd756682%28v=vs.85%29.aspx" rel="nofollow noreferrer">the hourglass example here</a> and cited by several method documentation pages (like the <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/dd316929%28v=vs.85%29.aspx" rel="nofollow noreferrer"><code>BeginFigure()</code> one</a>) creates a filled figure and draws it with both <code>DrawGeometry()</code> and <code>FillGeometry()</code>! Is this undefined behavior? Does it have anything to do with the blue border around the gradient in the example picture, which I don't see anywhere in the code?</p>
  <p>Thanks.</p>
  <p><strong>EDIT</strong> Okay I think I understand what's going on with the gradient's weird outline: the gradient is also transitioning alpha values, and the fill is overlapping the stroke because the stroke is centered on the line, and the fill is drawn <em>after</em> the stroke. That still doesn't explain why I can fill and stroke with a filled geometry, or what the difference between hollow and filled geometries are...</p>
  <p>Also I just realized that hollow geometries are documented as not having bounds. Does this mean that hollow geometries are purely an optimization for stroke-only geometries and otherwise behave identically to a filled geometry?</p>