novice user. free help needed

A

arun

I work a lot with graphics in c++. I've got a Turbo c++ v3.0. I need
some advice on some general topics like templating and file handling.
It would help if someone either mails it to me or link me to other free
sites. I find c++ resources like templating etc, are rare to get on the
web.

I've the knowledge of plotting points on the graphics screen with
reference to a fixed point or origin. Its basically child's play! In
fact if anyone wants to know about it I can help. The code is free. But
I'm curious to know if there is a way to stay an image on screen.
Suppose I've a plot of a curve and a line on the screen, can I make the
line disappear without the curve getting erased off. I've come up with
a temporary solution - but it involves reconstructing everything i.e.
the x-axis, the y-axis and then regenerating the curve. I use the
cleardevice() function; so basically this wipes out the whole screen.
That is why I have to regenerate everything.

Is there any way around this problem? I'm thinking assembly language. I
don't know anything of assembly. But I have a prejudice such things
often require assembly. The story behind this: I've asked someone to
give me some tip to enable the mouse on the graphics screen. He showed
me his file written in c++, but there was so many things I could not
understand. He told me it was assembly! Of course I could see he
implemented classes and everything; but I could not know anything
inside the class.

So in the future I might need help with assembly too. Can I get advice
on this issue? For the time being is there anyone to give me 'free
advice' on my current problem. The mouse enabling can wait. Very
desperate for solution!

-arun
 
T

Thomas Matthews

arun said:
I work a lot with graphics in c++. I've got a Turbo c++ v3.0. I need
some advice on some general topics like templating and file handling.
It would help if someone either mails it to me or link me to other free
sites. I find c++ resources like templating etc, are rare to get on the
web.
Turbo C++ is an ancient compiler. Perhaps you would want to
upgrade to Borland C++ version 6.0 or better.
I've the knowledge of plotting points on the graphics screen with
reference to a fixed point or origin. Its basically child's play! In
fact if anyone wants to know about it I can help. The code is free. But
I'm curious to know if there is a way to stay an image on screen.
Suppose I've a plot of a curve and a line on the screen, can I make the
line disappear without the curve getting erased off. I've come up with
a temporary solution - but it involves reconstructing everything i.e.
the x-axis, the y-axis and then regenerating the curve. I use the
cleardevice() function; so basically this wipes out the whole screen.
That is why I have to regenerate everything.

Graphics is generally not discussed in a newsgroup about the language.
A newsgroup about Turbo C++ or DOS or Windows or graphics would be a
better place.

Essentially, when graphical objects overlap (or intersect) and one
of the objects is erased, all intersecting or overlapping objects
must be redrawn. This is the easiest method. Some Windowing packages
provide a "paint" method for each object and window. If something
changes, then the window erases its background and tells each object
in the window to paint itself.
Is there any way around this problem? I'm thinking assembly language. I
don't know anything of assembly. But I have a prejudice such things
often require assembly. The story behind this: I've asked someone to
give me some tip to enable the mouse on the graphics screen. He showed
me his file written in c++, but there was so many things I could not
understand. He told me it was assembly! Of course I could see he
implemented classes and everything; but I could not know anything
inside the class.

Another method is to draw each object onto a sprite, tile or bitmap
(I'm using these terms as equals). In your case, the line would
be on a bitmap and your curve would be on another bitmap. When
removing the line, erase the area, then place the curve bitmap
onto the screen. This is also known as "blitting" or "bit-blitting".
This is a common technique in animation. Many graphics packages
allow some functions to be applied between the bitmap and the
screen (such as ORing, ANDing and Exclusive-ORing). This is how
your mouse pointer is drawn on the screen.
So in the future I might need help with assembly too. Can I get advice
on this issue? For the time being is there anyone to give me 'free
advice' on my current problem. The mouse enabling can wait. Very
desperate for solution!

Assembly language may not be needed. However, a platform specific
graphics package will be. The _standard_ C language has no facilities
for graphics, thus graphics is not discussed in this newsgroup.

1. Upgrade your compiler.
2. Upgrade your operating system.
3. Don't be afraid to redraw the picture using the different components.
In today's modern computers, plotting curves shouldn't take too
long.
4. Research:
Sprites
Blitting
Bitmaps
Curve fitting
Layers
Linked lists or containers
Graphics
Direct Memory Access (DMA) controllers
Graphic processors
Graphic libraries.
 
I

infobahn

arun said:
I've the knowledge of plotting points on the graphics screen with
reference to a fixed point or origin. Its basically child's play! In
fact if anyone wants to know about it I can help. The code is free. But
I'm curious to know if there is a way to stay an image on screen.
Suppose I've a plot of a curve and a line on the screen, can I make the
line disappear without the curve getting erased off. I've come up with
a temporary solution - but it involves reconstructing everything i.e.
the x-axis, the y-axis and then regenerating the curve. I use the
cleardevice() function; so basically this wipes out the whole screen.
That is why I have to regenerate everything.

That's basically how you do it. The trick you haven't yet discovered
is called "back buffering", where you show the user one buffer whilst
building up the next image on the other buffer. When you've finished
building, you tell the graphics subsystem to swap them round (or
blit one to the other, or whatever it is). There will be *some* way
to do this, even if it isn't exactly as I described. If you can't
find "back buffering", look for "double buffering" or "logical
screen".

This query is utterly and 100% off-topic for comp.lang.c, however;
you'd get much better help in a graphics programming newsgroup.

Good luck.
Is there any way around this problem? I'm thinking assembly language.

You shouldn't need it. See above.
 
R

Randy Yates

Thomas Matthews said:
[...]
1. Upgrade your compiler.

Although I haven't used it in a couple of years, mingw (Minimal GNU for
Windows) was an excellent public-domain development environment for the
PC. I recommend it for do-it-yourself windows hackers that want to avoid
the cost (and mindlessness) of the MSVC++ IDE.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top