On wikipedia it says that GDI is an API and core operating system component responsible for representing graphical objects and transmitting them to output devices.

I'm not finding much on what GDI+ actually does so I'm wondering, is GDI+ replaceable with gui frameworks like wxWidgets and GTK+ or are those frameworks rather built on top of GDI+?

When drawing to screen with GDI+ it seems it makes sure one doesn't draw outside of the application's window. Is it actually GDI+ doing this and if not, what is? If it is GDI then doesn't everything have to go through GDI+ to promise this functionality and not let applications paint anywhere they want?

Where does the framebuffer come into all of this? I would imagine that whatever controls the coordinate transforms controls the framebuffer as well. However it seems applications have much control of framebuffers and how to use them. I see that OpenGL has multiple types of framebuffers and functions for generating framebuffers, deleting them, ect. And I'm reading that they are stored in video memory. I would imagine that gui frameworks that are not as heavily involved with the GPU don't store theirs in video memory. So how does this stuff work and interact with the transformations?

1 Answer 1


1) GDI+ is Windows' library that handles low-level screen drawing... lines, bitmap copying, that kind of stuff. You don't replace it. Other GUI frameworks on Windows are implemented on top of GDI. GDI+ itself is theoretically implemented on top of DirectX.

2) GDI knows about clipping areas, but not really about windows or their borders; when you're drawing in a window, it talks to the USER library, which does know about window positions, to figure out the appropriate clipping area. There's a certain amount of blurring of responsibilities here; some functions that "rationally" belong in USER are in GDI for performance or historical reasons.

3) A frame buffer can be an bitmap in RAM that might eventually be copied to video memory, or it can be video memory directly mapped into the CPU's address space. If you're using GDI, don't think about frame buffers. If you use OpenGL or DirectX, you use the frame buffers those interfaces provide.

  • 1
    Could you expand on theoretically?
    – cubuspl42
    Aug 24, 2016 at 7:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.