Graphics using C

M

manojgeorge

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
 
P

Phlip

manojgeorge said:
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 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!
 
M

Moonlit

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
 
K

kwikius

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
 
J

Joey Sabey

kwikius said:
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~
 
K

kwikius

Joey said:
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
 
J

Joey Sabey

kwikius said:
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~
 
K

kwikius

Joey said:
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
 
J

Joey Sabey

kwikius said:
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~
 
A

Alf P. Steinbach

* (e-mail address removed):
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]
 
D

DragonSt0rm

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 :)
 
K

kwikius

Joey said:
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
 
B

Bo Persson

kwikius said:
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
 
K

kwikius

Bo said:
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
 
K

kwikius

Bo said:
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
 
E

Eberhard Schefold

kwikius said:
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.
 
M

Mirek Fidler

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
 
K

kwikius

Mirek said:
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
 
M

Mirek Fidler

kwikius said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top