Search code examples
c++wxwidgets

wxGraphicsContext and wxDC


I have written a chart application all using wxDC and its subclasses. However, I realized wxGraphicsContext offers truly superior advantages to wxDC but has its own ecosystem and this is very much inconsistent with wxWidget's ecosystem (such as wxRect to wxRect2DDouble and so on and even for basic member function names are different GetTopLeft vs GetLeftTop).

I wonder keeping wxGraphicsContext like an outsider is intentional? Will it be deprecated? If not why is the integration to wxWidgets so poor?


Solution

  • wxGraphicsContext is not an outsider, it's indeed the recommended way to do graphics since more than 10 years, and you should use it.

    The discrepancies between wxRect and wxRect2DDouble are unfortunate, but really not a huge deal in practice.