[CLUE-Tech] C language in Linux

Michael J. Hammel mjhammel at graphics-muse.org
Wed Dec 11 17:51:21 MST 2002


Thus spoke Marcin
> int main()
> {
>   clrscr();
>   int gdriver, gmode;
>   gdriver = DETECT;
>   initgraph(&gdriver, &gmode, "path to BGI");
>   circle(100, 100, 50);
>   closegraph();
>   return 0;
> }
> 
> How I should write this code in Linux?

Under MS OS's, the graphics subsystem is built into the OS.  On Unix/Linux, it
is a separate subsystem.  For Linux, you can do graphics work using the
framebuffer, the VGA library or the X Window System.  The closest analogy to
your MSDOS program is probably the VGA library, though few people use that
these days.  Next would be the framebuffer.  X programming is more like real
Windows programming.

As to how you'd do it, I can only point you to X resources (I don't do
framebuffer development).  Start with the O'Reilly texts on the X Window System.
If you want to just jump into programming, you might want to start with the
GTK+ (www.gtk.org) toolkit (specifically looking at the low-level glib layer
if you want to draw graphics primitives like circles and if
you're into C programming) or Qt/KDE (if you're into C++ style coding).

Hope that helps.
-- 
Michael J. Hammel                               The Graphics Muse 
mjhammel at graphics-muse.org                      http://www.graphics-muse.com
------------------------------------------------------------------------------
Pray that there's intelligent life somewhere out there because there's
bugger all down here on earth.  -- Eric Idle, The Galaxy Song



More information about the clue-tech mailing list