What is a good 2D graphics API for Windows / C ++?

I was working on a small small application, and I used DirectX / 3D to draw textures on the screen (all two-dimensional elements). The API, I find it, is pretty easy to use and incorporates the principles of OOP, but I can't help but feel that using DirectX for something that this little is insanely overwhelming.

I seem to be unable to find consensus on a good alternative. Any suggestions?

EDIT: Needed support for alpha blending and PNG files.

With great love of the first occasion, Jengerer

+6
c ++ windows api directx
source share
4 answers

If you need alpha blending, you should use graphics hardware; the only good way to do this is to use a 3D API similar to the way you do it now (DirectX or OpenGL). Any alternative (GDI / + or, say, DirectDraw) will not use full graphics equipment to speed up mixing and will have to run it on the processor, which significantly reduces performance.

As already mentioned, Direct2D is also an option - it is functionally a layer on top of Direct3D, which supports more functional 2D functions, as well as excellent text support.

+5
source share

If you do not need XP support, use Direct2D .
Otherwise, use GDI + .

+4
source share

Windows has one of them. (GDI32.DLL). In a WindowProc call, you can connect to the WM_PAINT message and use BeginPaint() to start drawing. A really good idea of ​​what can be done, and a basic tutorial is available on Zetcode .

+1
source share

I used Gosu in the past, and it was working fine with it. It was designed to be used more with Ruby, but it is not bad for C ++. We used it in a fast scrolling game where we mixed up with z-order and alpha channel. Perhaps worth checking out.

+1
source share

All Articles