I am making a graphics application in Direct2D, and it has text editing capabilities powered by DirectWrite. However, I am not sure what the best way to render the caret is. I can either get the position using HitTestTextPosition
and render a line manually, which seems to work, or I can attempt to use SetCaretPosition
and related methods. The Direct2D surface does not cover my entire window.
What are the pros and cons of each approach; and which one would provide better usability/robustness?