Jump to content

Graphics Device Interface

From Simple English Wikipedia, the free encyclopedia

The Graphics Device Interface is an API of Microsoft Windows used for representing graphical objects and transmitting them to output devices, such as printers and monitors.

GDI is responsible for tasks such as drawing lines and curves, rendering fonts and handling palettes. It is not directly responsible for drawing windows, menus, etc.; that task is reserved for another subsystem built on top of GDI. Other systems have components that are similar to GDI, for example Macintosh's QuickDraw and GNOME/GTK's GDK/Xlib.

Perhaps the most significant capability of GDI over more direct methods of accessing the hardware is its scaling capabilities, and abstraction of target devices. Using GDI, it is very easy to draw on multiple devices, such as a screen and a printer, and expect proper reproduction in each case. This capability is at the center of all What You See Is What You Get applications for Microsoft Windows.

Simple games that do not require fast graphics rendering use GDI. However, GDI cannot animate properly as it has no notion of synchronizing with the framebuffer, and lacks rasterization for 3D. Modern games usually use DirectX or OpenGL instead, which give programmers the capabilities to use features of modern hardware.