Graphics using C

Discussion in 'C++' started by manojgeorge@gmail.com, Nov 19, 2006.

  1. Guest

    Hi,

    I am a student for physics graduation and looking forward to develop
    and implement a simple graphics display in C( As this is the only
    language which has been taught as part of my syllabus).

    Can I use graphics in C to simulate a "fountain effect"? Is it
    possibile to use graphics in C? (Not in C++). Sorry to put this in C++
    discussion forum as I couldn't yet find a C discussion forum which is
    active.

    Waiting for your expert comments on this.

    Many thanks in advance,
    Manoj
     
    , Nov 19, 2006
    #1
    1. Advertising

  2. Phlip Guest

    manojgeorge wrote:

    > Can I use graphics in C to simulate a "fountain effect"? Is it
    > possibile to use graphics in C? (Not in C++). Sorry to put this in C++
    > discussion forum as I couldn't yet find a C discussion forum which is
    > active.


    Was everyone at news:comp.lang.c having, like, a staring contest or
    something??

    They will tell you graphics are off-topic. Post to a newsgroup that covers
    whatever compiler you use, for the best answers. Use Google Groups to find
    such a newsgroup - I think you are familiar with it! ;-)

    > Waiting for your expert comments on this.


    I specialize in graphics but I ain't gonna digress about them here and now!

    --
    Phlip
    http://www.greencheese.us/ZeekLand <-- NOT a blog!!!
     
    Phlip, Nov 19, 2006
    #2
    1. Advertising

  3. Moonlit Guest

    Hi,

    Graphics are not contained in any of the standard libraries. But, yes you
    can do graphics in C/C++. The easiest way I think is to use Visual C++ and
    GDI. Lookup WM_PAINT message on msdn,

    Another approach is to use some kind of library (google for it since there
    are many)

    Note that whatever you are going to use it will be a study on its own.


    Regards, Ron AF Greve

    http://moonlit.xs4all.nl

    <> wrote in message
    news:...
    > Hi,
    >
    > I am a student for physics graduation and looking forward to develop
    > and implement a simple graphics display in C( As this is the only
    > language which has been taught as part of my syllabus).
    >
    > Can I use graphics in C to simulate a "fountain effect"? Is it
    > possibile to use graphics in C? (Not in C++). Sorry to put this in C++
    > discussion forum as I couldn't yet find a C discussion forum which is
    > active.
    >
    > Waiting for your expert comments on this.
    >
    > Many thanks in advance,
    > Manoj
    >
     
    Moonlit, Nov 19, 2006
    #3
  4. kwikius Guest

    wrote:
    > Hi,
    >
    > I am a student for physics graduation and looking forward to develop
    > and implement a simple graphics display in C( As this is the only
    > language which has been taught as part of my syllabus).
    >
    > Can I use graphics in C to simulate a "fountain effect"? Is it
    > possibile to use graphics in C? (Not in C++). Sorry to put this in C++
    > discussion forum as I couldn't yet find a C discussion forum which is
    > active.


    C++ cant handle graphics. Its just a text langauage

    regards
    Andy Little
     
    kwikius, Nov 21, 2006
    #4
  5. Joey Sabey Guest

    kwikius wrote:
    > C++ cant handle graphics. Its just a text langauage


    C++ is a general programming language. ;-)

    Most games are programmed in C++, for example. And a great deal of
    other programs.

    Ever heard of the OpenGL library? ;-)

    Personally I like the SDL library for simple graphics, and 2D stuff.

    ~Joey~
     
    Joey Sabey, Nov 21, 2006
    #5
  6. kwikius Guest

    Joey Sabey wrote:
    > kwikius wrote:
    > > C++ cant handle graphics. Its just a text langauage

    >
    > C++ is a general programming language. ;-)
    >
    > Most games are programmed in C++, for example. And a great deal of
    > other programs.
    >
    > Ever heard of the OpenGL library? ;-)


    I cant find it in my copy of the C++ standard.

    Situation is that C++ cant deal with graphics. Best advice is to try
    Java.

    Andy Little
     
    kwikius, Nov 21, 2006
    #6
  7. Joey Sabey Guest

    kwikius wrote:
    > I cant find it in my copy of the C++ standard.
    >
    > Situation is that C++ cant deal with graphics. Best advice is to try
    > Java.


    The standard libraries don't deal with graphics, no, but drop in
    something like driectX, openGL SDL or Allegro, and you have graphics
    handling in C++. I don't like Java much, myself, and it certainly isn't
    used for most graphical programs, or games.

    ~Joey~
     
    Joey Sabey, Nov 21, 2006
    #7
  8. kwikius Guest

    Joey Sabey wrote:
    > kwikius wrote:
    > > I cant find it in my copy of the C++ standard.
    > >
    > > Situation is that C++ cant deal with graphics. Best advice is to try
    > > Java.

    >
    > The standard libraries don't deal with graphics, no, but drop in
    > something like driectX, openGL SDL or Allegro, and you have graphics
    > handling in C++.


    All O.T here I'm afraid bud. C++ doesnt do graphics

    regards
    Andy Little
     
    kwikius, Nov 21, 2006
    #8
  9. Joey Sabey Guest

    kwikius wrote:
    > All O.T here I'm afraid bud. C++ doesnt do graphics


    Heh, I'm just pointing out that you don't have to go in search of a new
    language to do graphics, that there are extensions to C++ for it.
    It can't hurt to point people in the direction of a solution to their
    problem. =P

    ~Joey~
     
    Joey Sabey, Nov 21, 2006
    #9
  10. * :
    >
    > I am a student for physics graduation and looking forward to develop
    > and implement a simple graphics display in C( As this is the only
    > language which has been taught as part of my syllabus).


    You're posting to a C++ group; C is mostly off-topic here.


    > Can I use graphics in C to simulate a "fountain effect"? Is it
    > possibile to use graphics in C? (Not in C++). Sorry to put this in C++
    > discussion forum as I couldn't yet find a C discussion forum which is
    > active.


    [comp.lang.c]


    --
    A: Because it messes up the order in which people normally read text.
    Q: Why is it such a bad thing?
    A: Top-posting.
    Q: What is the most annoying thing on usenet and in e-mail?
     
    Alf P. Steinbach, Nov 21, 2006
    #10
  11. DragonSt0rm Guest

    wrote:

    > Can I use graphics in C to simulate a "fountain effect"? Is it
    > possibile to use graphics in C? (Not in C++). Sorry to put this in C++
    > discussion forum as I couldn't yet find a C discussion forum which is
    > active.


    Yes, this newsgroup is not the right place to ask about graphics.
    But you already got some taliban-ic comments that will make you very confuse
    so here is a non-fundamentalist answer:

    If you want to do just simulation graphic, no standard user interface
    software, I advise you to look at SDL: http://www.libsdl.org/index.php

    Also, you can look at OpenGL for advanced 3D graphic capabilities.
    And not only 3D, you can do cool 2D stuff with OpenGL too.
    http://www.opengl.org/

    If you want to develop a nice user interface software, then you can look for
    GTK: http://www.gtk.org/
    But keep in mind that doing complex GUI development in plain old C it is not
    a trivial task.

    I would rather advice you to learn C++ then use wxWidgets:
    http://wxwidgets.org/ if you want to implement sophisticated GUI software.

    Java is another alternative if you want to develop complex GUI.

    All this libraries have their own blogs where you can ask details about
    using that library.
    If you came back in this puritan group with questions regarding SDL
    functions they will grill you on the stake :)
     
    DragonSt0rm, Nov 21, 2006
    #11
  12. kwikius Guest

    Joey Sabey wrote:
    > kwikius wrote:
    > > All O.T here I'm afraid bud. C++ doesnt do graphics

    >
    > Heh, I'm just pointing out that you don't have to go in search of a new
    > language to do graphics, that there are extensions to C++ for it.
    > It can't hurt to point people in the direction of a solution to their
    > problem. =P


    C++ has no Graphical User Interface standard. There is nothing on which
    to display any graphics. In fact there is no standard for text either.
    Its kind of pathetic, but its true. A platform independent GUI for C++
    wouldnt be hard to achieve, but there are a lot of commercial interests
    that prefer things as they are.

    regards
    Andy little
     
    kwikius, Nov 21, 2006
    #12
  13. Bo Persson Guest

    kwikius wrote:
    > Joey Sabey wrote:
    >> kwikius wrote:
    >>> All O.T here I'm afraid bud. C++ doesnt do graphics

    >>
    >> Heh, I'm just pointing out that you don't have to go in search of
    >> a new language to do graphics, that there are extensions to C++
    >> for it.
    >> It can't hurt to point people in the direction of a solution to
    >> their problem. =P

    >
    > C++ has no Graphical User Interface standard. There is nothing on
    > which to display any graphics. In fact there is no standard for
    > text either. Its kind of pathetic, but its true. A platform
    > independent GUI for C++ wouldnt be hard to achieve, but there are a
    > lot of commercial interests that prefer things as they are.
    >


    Some of us would like a platform native GUI with a portable API. That's
    hard!

    Java isn't platform independent at all, it just brings it's own platform
    around.


    Bo Persson
     
    Bo Persson, Nov 21, 2006
    #13
  14. kwikius Guest

    Bo Persson wrote:
    > kwikius wrote:
    > > Joey Sabey wrote:
    > >> kwikius wrote:
    > >>> All O.T here I'm afraid bud. C++ doesnt do graphics
    > >>
    > >> Heh, I'm just pointing out that you don't have to go in search of
    > >> a new language to do graphics, that there are extensions to C++
    > >> for it.
    > >> It can't hurt to point people in the direction of a solution to
    > >> their problem. =P

    > >
    > > C++ has no Graphical User Interface standard. There is nothing on
    > > which to display any graphics. In fact there is no standard for
    > > text either. Its kind of pathetic, but its true. A platform
    > > independent GUI for C++ wouldnt be hard to achieve, but there are a
    > > lot of commercial interests that prefer things as they are.
    > >

    >
    > Some of us would like a platform native GUI with a portable API. That's
    > hard!


    I've only looked at two platforms Windows and Linux. I havent looked at
    Mac but AFAIK the system there is an extension of X, which is the basis
    of Unix systems. In Windows you have the SDK and on Linux you have X11
    and the Xt Intrinsics. If you look above the prehistoric raw code in
    both systems, they are remarkably similar. It appears to me that at
    various times one or both ceratinly borrowed ideas from each other. To
    my eye it doesnt look that hard to wrap both in terms of one API.

    Second it has been done in several incarnations

    look at Qt, Ultimate++, GtK and wxWidgets. These are all successful.

    Ultimate++ looks the more modern. GtK and wXWidgets expose a lot of raw
    pointers, which makes coding pretty ugly. Having never used Qt I can't
    coment but by all accounts like the other systems it reinvents the
    wheel. (Maybe because many of these implementations predate the C++
    standard). They all prefer their own strings and containers and so on
    and so forth. This is a problem.

    The other issues with these libraries is licensing. Qt licensing is
    weird. If you do commercial development it costs you good money. As for
    the others they all AFAIK use some form of 'free' license which puts me
    off as I'm not a lawyer, but I really don't want to bundle source code
    with all my apps or point application users who frankly couldnt care
    less in most cases at the source.

    Apart from all this the interface, IOW main window, menus buttons,
    controls ("widgets") ,modal dialogs and so on and so forth and their
    functionality is essentially sorted across platforms and has been for
    many years, and there are various UI standards around. IOW the hard
    work of how to design a GUI has basically been done. All thats needed
    is to hide all that ugly casting behind a nice interface.... Simple
    really ;-)

    > Java isn't platform independent at all, it just brings it's own platform
    > around.


    Well at least they have a GUI (or two) though !

    regards
    Andy Little
     
    kwikius, Nov 21, 2006
    #14
  15. kwikius Guest

    Bo Persson wrote:
    > kwikius wrote:
    > > Joey Sabey wrote:
    > >> kwikius wrote:
    > >>> All O.T here I'm afraid bud. C++ doesnt do graphics
    > >>
    > >> Heh, I'm just pointing out that you don't have to go in search of
    > >> a new language to do graphics, that there are extensions to C++
    > >> for it.
    > >> It can't hurt to point people in the direction of a solution to
    > >> their problem. =P

    > >
    > > C++ has no Graphical User Interface standard. There is nothing on
    > > which to display any graphics. In fact there is no standard for
    > > text either. Its kind of pathetic, but its true. A platform
    > > independent GUI for C++ wouldnt be hard to achieve, but there are a
    > > lot of commercial interests that prefer things as they are.
    > >

    >
    > Some of us would like a platform native GUI with a portable API. That's
    > hard!


    I've only looked at two platforms Windows and Linux. I havent looked at
    Mac but AFAIK the system there is an extension of X, which is the basis
    of Unix systems. In Windows you have the SDK and on Linux you have X11
    and the Xt Intrinsics. If you look above the prehistoric raw code in
    both systems, they are remarkably similar. It appears to me that at
    various times one or both ceratinly borrowed ideas from each other. To
    my eye it doesnt look that hard to wrap both in terms of one API.

    Second it has been done in several incarnations

    look at Qt, Ultimate++, GtK and wxWidgets. These are all successful.

    Ultimate++ looks the more modern. GtK and wXWidgets expose a lot of raw
    pointers, which makes coding pretty ugly. Having never used Qt I can't
    coment but by all accounts like the other systems it reinvents the
    wheel. (Maybe because many of these implementations predate the C++
    standard). They all prefer their own strings and containers and so on
    and so forth. This is a problem.

    The other issues with these libraries is licensing. Qt licensing is
    weird. If you do commercial development it costs you good money. As for
    the others they all AFAIK use some form of 'free' license which puts me
    off as I'm not a lawyer, but I really don't want to bundle source code
    with all my apps or point application users who frankly couldnt care
    less in most cases at the source.

    Apart from all this the interface, IOW main window, menus buttons,
    controls ("widgets") ,modal dialogs and so on and so forth and their
    functionality is essentially sorted across platforms and has been for
    many years, and there are various UI standards around. IOW the hard
    work of how to design a GUI has basically been done. All thats needed
    is to hide all that ugly casting behind a nice interface.... Simple
    really ;-)

    > Java isn't platform independent at all, it just brings it's own platform
    > around.


    Well at least they have a GUI (or two) though !

    regards
    Andy Little
     
    kwikius, Nov 21, 2006
    #15
  16. kwikius wrote:

    > Joey Sabey wrote:
    >> kwikius wrote:


    >>> C++ cant handle graphics. Its just a text langauage


    >> Ever heard of the OpenGL library? ;-)

    >
    > I cant find it in my copy of the C++ standard.


    It is impossible to write novels in the English language. I found no
    instructions for that in my grammar book.
     
    Eberhard Schefold, Nov 21, 2006
    #16
  17. kwikius Guest

    Eberhard Schefold wrote:
    > kwikius wrote:
    >
    > > Joey Sabey wrote:
    > >> kwikius wrote:

    >
    > >>> C++ cant handle graphics. Its just a text langauage

    >
    > >> Ever heard of the OpenGL library? ;-)

    > >
    > > I cant find it in my copy of the C++ standard.

    >
    > It is impossible to write novels in the English language.


    Yeah. I know... weird isnt it? but off topic sadly.

    regards
    Andy Little
     
    kwikius, Nov 21, 2006
    #17
  18. Mirek Fidler Guest

    On Nov 21, 2:23 pm, "kwikius" <> wrote:

    > The other issues with these libraries is licensing. Qt licensing is
    > weird. If you do commercial development it costs you good money. As for
    > the others they all AFAIK use some form of 'free' license which puts me
    > off as I'm not a lawyer, but I really don't want to bundle source code
    > with all my apps or point application users who frankly couldnt care
    > less in most cases at the source.


    Ultimate++ is BSD licensed -> you can do whatever you want with it
    except redistributing the source tree with copyright info removed.

    Mirek
     
    Mirek Fidler, Dec 1, 2006
    #18
  19. kwikius Guest

    Mirek Fidler wrote:
    > On Nov 21, 2:23 pm, "kwikius" <> wrote:
    >
    > > The other issues with these libraries is licensing. Qt licensing is
    > > weird. If you do commercial development it costs you good money. As for
    > > the others they all AFAIK use some form of 'free' license which puts me
    > > off as I'm not a lawyer, but I really don't want to bundle source code
    > > with all my apps or point application users who frankly couldnt care
    > > less in most cases at the source.

    >
    > Ultimate++ is BSD licensed -> you can do whatever you want with it
    > except redistributing the source tree with copyright info removed.
    >
    > Mirek


    Hi Mirek,

    I have been perusing Ultimate++ from time to time, but only the docs
    rather than code. It looks very comprehensive and very interesting. My
    main interest is in somehow or other trying to get together a GUI
    proposal to submit as part of the C++ standard. FWIW I don't expect
    that to be happening any time soon!, (Some corners might argue that I
    am about the last person to succeed at that), but nevertheless as
    nobody else seems to be doing anything about it I am working slowly
    away at it. Therefore I am trying to look at the various C++ GUI
    libraries out there and certain parts of Ultimate++ look attractive.

    The main problem is that a standards proposal would I assume, expect
    where at all possible the components of the current standard library to
    be used. Obviously this is a big problem where Ultimate++ is concerned.

    The extensive nature of the lib is also a problem simply from the point
    of view of trying to provide standards quality documentation.

    Anyway, *If* I get further along with the standards proposal and
    especially where there is a crossover or I see something from
    Ultimate++ that might be incorporated I would certainly like to get in
    touch to get your views about it.

    regards
    Andy Little
     
    kwikius, Dec 1, 2006
    #19
  20. Mirek Fidler Guest

    kwikius wrote:

    > proposal to submit as part of the C++ standard. FWIW I don't expect
    > that to be happening any time soon!


    Yep, 2018 seems to be the nearest possible term :)

    > am about the last person to succeed at that), but nevertheless as
    > nobody else seems to be doing anything about it I am working slowly
    > away at it. Therefore I am trying to look at the various C++ GUI
    > libraries out there and certain parts of Ultimate++ look attractive.


    Ah, I just wanted to supply the licensing info. But thanks.

    > The main problem is that a standards proposal would I assume, expect
    > where at all possible the components of the current standard library to
    > be used. Obviously this is a big problem where Ultimate++ is concerned.


    Yes. The aim was to build the optimal library/platform, not the
    standard one :)

    > Anyway, *If* I get further along with the standards proposal and
    > especially where there is a crossover or I see something from
    > Ultimate++ that might be incorporated I would certainly like to get in
    > touch to get your views about it.


    You are welcome. I am quite pessimistic w.r.t. standard C++ GUI and I
    am very pessimistic about "STL-boosted" C++ future, but do not feel shy
    to ask for help or info (e.g. in U++ forum).

    Mirek
     
    Mirek Fidler, Dec 1, 2006
    #20
    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. Replies:
    2
    Views:
    374
  2. Martin Chan
    Replies:
    2
    Views:
    3,327
    Mark Thornton
    Dec 11, 2003
  3. ***C.Steamer***

    Using the Graphics translate function()

    ***C.Steamer***, Sep 30, 2004, in forum: Java
    Replies:
    1
    Views:
    3,103
    Andrew Thompson
    Sep 30, 2004
  4. Pmb
    Replies:
    14
    Views:
    716
    Prateek R Karandikar
    Jun 4, 2004
  5. pooja
    Replies:
    2
    Views:
    410
    CBFalconer
    Apr 4, 2004
Loading...

Share This Page