Cross-platform drawing library

后端 未结 11 1125
独厮守ぢ
独厮守ぢ 2020-12-24 10:01

I\'ve been looking for a good cross-platform 2D drawing library that can be called from C++ and can be used to draw some fairly simple geometry; lines, rectangles, circles,

相关标签:
11条回答
  • 2020-12-24 10:35

    I would go for AGG or Cairo.

    0 讨论(0)
  • 2020-12-24 10:37

    Another one: Skia. Used in Android and Chrome, under active development, HW acceleration.

    0 讨论(0)
  • 2020-12-24 10:44

    I use CImg: cross platform (self contained single header file), simple, concise. PNG is not natively supported but can be handled if ImageMagick is installed (see supported formats).

    See also this related question.

    0 讨论(0)
  • 2020-12-24 10:44

    You might use Allegro 5 (since SDL and SFML are mentioned). This provides all of the platforms you require (and more) and can render shapes and save to PNG. Version 5 has a much improved API and hardware acceleration. With any of these low level cross platform libraries you'd have to find your own charting solution.

    I put some notes on my blog about Allegro and using it on the Mac.

    0 讨论(0)
  • 2020-12-24 10:45

    There is also libgd - simple one, but well-written.

    Regarding Cairo Graphics, I can't believe it renders text that looks bad. If you are particularly concerned about text rendering, State of the Text Rendering from Jan 2010 gives quite good overview.

    0 讨论(0)
  • 2020-12-24 10:48

    Try Anti-Grain Geometry. From the description:

    Anti-Grain Geometry (AGG) is an Open Source, free of charge graphic library, written in industrially standard C++. The terms and conditions of use AGG are described on The License page. AGG doesn't depend on any graphic API or technology. Basically, you can think of AGG as of a rendering engine that produces pixel images in memory from some vectorial data. But of course, AGG can do much more than that. The ideas and the philosophy of AGG are:

    • Anti-Aliasing.
    • Subpixel Accuracy.
    • The highest possible quality.
    • High performance.
    • Platform independence and compatibility.
    • Flexibility and extensibility.
    • Lightweight design.
    • Reliability and stability (including numerical stability).
    0 讨论(0)
提交回复
热议问题