How do you setup graphics.h in Ubuntu?

150 Views Asked by At

I just switched to Ubuntu from Windows. Figuring out how to setup graphics.h in Ubuntu so that I can do my lab works of the course Computer Graphics. Found bunch of stuff online, none seems to work. Any help would do wonders for me..

I tried bunch of stuff shown online none seems to work...

1

There are 1 best solutions below

0
Clifford On

graphics.h is not a standard library header, or even a standard Windows header. It normally refers to the Borland BGI API that was included with Borland's MS-DOS compilers.

If you have been using it on Windows, you have probably been using WinBGIm which is a BGI clone (with some extensions) for Windows implemented on top of Windows' native GDI API. As such it is a simple to use wrapper over the rather more complex but still rather basic Windows 2D graphics API.

As such it is rather inextricably linked to Windows. However there is a similar project for Linux based on SDL called SDL_bgi . In this case it is a wrapper over SDL, so there is an argument for moving away from this antique and poorly supported API and using SDL directly. However if you have existing code you wish to port it may be useful. If this is for submission of school work, you may run into issues if the two interfaces are not identical or you have used WinBGIm extensions not supported in SDL_bgi - however the documentation links to WinGBIm so it is likley a clone of that rather than of BGI directly.

My advice for school work is to use the courseware recommended and used by your tutor. For that you could perhaps use a WindowsVM on Linux - though you would of course need a Windows licence for that.