473,387 Members | 1,579 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Graphics using C

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 '06 #1
19 5102
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!!!
Nov 19 '06 #2
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

<ma*********@gmail.comwrote in message
news:11*********************@h54g2000cwb.googlegro ups.com...
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 '06 #3

ma*********@gmail.com 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

Nov 21 '06 #4

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~

Nov 21 '06 #5

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

Nov 21 '06 #6

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~

Nov 21 '06 #7

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

Nov 21 '06 #8
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~

Nov 21 '06 #9
* ma*********@gmail.com:
>
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?
Nov 21 '06 #10
ma*********@gmail.com 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 :-)

Nov 21 '06 #11


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

Nov 21 '06 #12
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
Nov 21 '06 #13

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

Nov 21 '06 #14

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

Nov 21 '06 #15
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.
Nov 21 '06 #16

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

Nov 21 '06 #17


On Nov 21, 2:23 pm, "kwikius" <a...@servocomm.freeserve.co.ukwrote:
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

Dec 1 '06 #18

Mirek Fidler wrote:
On Nov 21, 2:23 pm, "kwikius" <a...@servocomm.freeserve.co.ukwrote:
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

Dec 1 '06 #19

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

Dec 1 '06 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: JBiagio | last post by:
Hello All, I am attempting to learn a bit about the GDI+ transforms and charting data and I feel like I'm getting a handle on how the transforms work. My chart object has a large "canvas" bitmap...
12
by: Sanjay | last post by:
hi, We are currently porting our project from VB6 to VB .NET. Earlier we used to make scale transformations on objects like pictureBox , forms etc.Now Such transformations are made on the...
0
by: Eric | last post by:
I'm also interested in finding out more about using vector graphics when designing the UI in Windows forms applications. I know a lot about GDI+ and raster graphics, but vector graphics is a new...
7
by: Peter Row | last post by:
Hi, I've started work on my own control some parts of which use standard controls, others I need to draw on my controls surface to get the display output I require, however.... I seem to be...
0
by: Hasim AH | last post by:
Hi .. Just getting interested to learn C# and needs help. I want to write C# application so that the program will execute and draw graphics when the user select the drawing menu from the main...
8
by: pigeonrandle | last post by:
Hi, Please pity me, i am on a dial-up connection for the first time in 5 years :( ! Does anyone know how the resulting Graphics objects differ ...? What i really mean is can someone explain it...
7
by: rayreeves | last post by:
If I look for guidance on this topic I find simple examples like this: public class Form2:Form { public Form2() { this.Text = "FORM2"; this.Size = new Size(450,400); this.Paint += new...
2
by: _A_C-ker_ | last post by:
Hello geek(s), I'm in desperate need of graphics programming using C language. Does anyone have material or web-links that explain graphics programming in- detail? I would appreciate your help...
9
by: DaveL | last post by:
hello I have a Bit map 1367 wide 32 high this bitmap contains like 40 separate Images 32x32 I tell it the id*32 to get the approiate Image from the source Bitmap When i CreateGraphics()...
8
by: Abhiraj Chauhan | last post by:
I need someone to make an example of how to create a graphics window in VB.net 2008. I understand the basics of how to draw a rectangle and lines etc. What I need is an example of how to make a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.