graphics functions under unix...

Discussion in 'C Programming' started by ehab, Aug 30, 2003.

  1. ehab

    ehab Guest

    How can I use the graphics functions with gcc such as box,palette,color.
    ehab, Aug 30, 2003
    #1
    1. Advertising

  2. ehab

    Derk Gwen Guest

    (ehab) wrote:
    # How can I use the graphics functions with gcc such as box,palette,color.

    Every unix should have a library called _curses_ which is a very old windowing
    system that runs inside a terminal window. For modern bit mapped graphics,
    you can use _X-Windows_. Some unices have other windowings, like MacOSX Aqua.

    --
    Derk Gwen http://derkgwen.250free.com/html/index.html
    So....that would make Bethany part black?
    Derk Gwen, Aug 30, 2003
    #2
    1. Advertising

  3. ehab

    Malcolm Guest

    "ehab" <> wrote in message
    > How can I use the graphics functions with gcc such as
    > box,palette,color.
    >

    You need a non-standard library. The first thing to do is determine which
    non-standard libraries are available on your system - if you have a GUI then
    almost certainly some sort of graphics capability will be provided.

    In your source you then #include the headers (non-standard) needed for that
    library, and then call the functions as directed in the documentation.

    Then you need to link the library at link time. This may be done
    automatically, or it may be necessary to specify this directly to the
    compiler, using an option like -l.
    Malcolm, Aug 30, 2003
    #3
  4. ehab

    Logan Shaw Guest

    Malcolm wrote:

    > "ehab" <> wrote in message
    >
    >>How can I use the graphics functions with gcc such as
    >>box,palette,color.


    > You need a non-standard library.


    If by non-standard, you mean something that gcc doesn't link in
    by default, then yes. But if by non-standard, you mean some
    third-party library, you don't really need that. You can do
    all of the above with libX11, right? Windows, lines, rectangles,
    colors, etc. It's probably not the best library to use for
    a real application (with buttons, menus, etc.), but it might
    not be bad for some experimentation and learning.

    - Logan
    Logan Shaw, Aug 30, 2003
    #4
  5. Logan Shaw <> writes:

    > Malcolm wrote:
    >
    > > "ehab" <> wrote in message
    > >
    > >>How can I use the graphics functions with gcc such as
    > >>box,palette,color.

    >
    > > You need a non-standard library.

    >
    > If by non-standard, you mean something that gcc doesn't link in by
    > default, then yes. But if by non-standard, you mean some third-party
    > library, you don't really need that. You can do all of the above with
    > libX11, right?


    I don't know in which of the five newsgroups Malcolm read the original post,
    but "here" in comp.lang.c, everything not defined by the ISO C standard is
    cosidered non-standard. Therefore, libX11 *is* non-standard in the context
    of comp.lang.c.

    That said, I think it is in fact possible to write a strictly conforming C
    program which opens windows, draws buttons and menus, etc., on an X server.
    Just implement the X protocol, and run the program in such a way that
    standard input and standard output are network connections to the X server.
    ;)

    Martin
    Martin Dickopp, Aug 30, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Xiangliang Meng
    Replies:
    1
    Views:
    1,591
    Victor Bazarov
    Jun 21, 2004
  2. Replies:
    12
    Views:
    1,635
    Dave Thompson
    Jan 10, 2005
  3. Replies:
    18
    Views:
    618
    Dave Thompson
    Jan 10, 2005
  4. Adam

    graphics under dos

    Adam, Jan 11, 2006, in forum: C Programming
    Replies:
    3
    Views:
    348
    Peter Shaggy Haywood
    Jan 14, 2006
  5. Robert Wallace

    my own perl "dos->unix"/"unix->dos"

    Robert Wallace, Jan 21, 2004, in forum: Perl Misc
    Replies:
    7
    Views:
    276
    Michele Dondi
    Jan 22, 2004
Loading...

Share This Page