SDLbgi is a Borland Graphics Interface ( graphics.h) emulation library based on SDL2. This library strictly emulates most BGI functions, making it possible to compile SDL versions of programs written for Turbo/Borland C. ARGB extensions and basic mouse support are also implemented; further, native SDL2 functions may be used in SDLbgi programs.
Graphics.h library is used to include and facilitate graphical operations in program. Graphics.h functions can be used to draw different shapes, display text in different fonts, change colors and many more. Using functions of graphics.h you can make graphics programs, animations, projects and games. You can draw circles, lines, rectangles, bars and many other geometrical figures. You can change their colors using the available functions and fill them.Examples:For line 1, Input: x1 = 150, y1 = 150, x2 = 450, y2 = 150For line 2, Input: x1 = 150, y1 = 200, x2 = 450, y2 = 200For line 2, Input: x1 = 150, y1 = 250, x2 = 450, y2 = 250Output.
![]()
Is not a standard header. Most commonly it refers to the header for Borland's BGI API for DOS and is antiquated at best.However it is nicely simple; there is a Win32 implementation of the BGI interface called.
It is implemented using Win32 GDI calls - the lowest level Windows graphics interface. As it is provided as source code, it is perhaps a simple way of understanding how GDI works.WinBGIm however is by no means cross-platform. If all you want are simple graphics primitives, most of the higher level GUI libraries such as wxWidgets and Qt support that too. There are simpler libraries suggested in the possible duplicate answers mentioned in the comments.
![]()
There is a modern port for this Turbo C graphics interface, it's called, which emulates BGI graphics under MinGW/GCC.I haven't it tried but it looks promising. For example creates a window, andfrom this point you can draw into that window using the good old functions, at the end deletes the window.
It also has some more advanced extensions (eg. Mouse handling and double buffering).When I first moved from DOS programming to Windows I didn't have internet, and I begged for something simple like this.
But at the end I had to learn how to create windows and how to handle events and use device contexts from the offline help of the Windows SDK.
Comments are closed.
|
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |