Should we use OpenGL for 2D graphics? -


If we want to create applications like MS Paint, should we use OpenGL for render graphics? When using traditional GDI versus OpenGL, I want to tell about performance. And if there are some better lbs for this purpose, please see me one.

GDI, X11, OpenGL ... are providing APIs, that is, you usually image them Do not use for manipulation (you can do this, but there is some caution in it).

In the drawing application like MS Paint, if it is pixel-based, you will usually manipulate some image buffer in the customary code, or a special image manipulation library, then complete buffer in the rendering API Send.

If your data model has strokes and personal shapes, i.e. vector graphics, then OpenGL creates a very good backend. However, it may be appropriate to search for some other APIs for vector graphics, such as OpenVG (which sits on the top of OpenGL in its current implementation, but the basic implementation of directly working on the GPU may come in).

Scenarios in your use that you will not run in any display problem on existing computers, so choose your API from that criteria. OPOG is definitely faster than GDI when it comes to texturing, alpha blending etc. Although systems and GPUs can leave OpenGL behind the simple things such as OpenGL, or simple complicated rules like filling a complex multicolor with complex GDI.

Comments