views:

190

answers:

6

hi ,

i would like to program some graphic figures such as line, circle,etc. i have used turboc++ 3.0 for
dos graphics. i would like to do the same with the compilers dev c++ or code blocks or vc++.

i would like to implement dda and bresenhems line and circle drawing algorithm. how should i go about implementing these programs through these compilers (not the command line tools).

i have a really vague picture of graphics programming.please help..

thanks in advance.

please note : i have a nvidia graphics card 1gb.. so i cannot use dos graphics (i think the card is the reason).

+2  A: 

You really have a vast variety of options. Starting from GDI (not hardware accelerated), finishing with a heavy stuff like DirectX, OpenGl. There is also a nice library, called SDL. It does not really matter what technology you will use to solve your problems. If the speed is not a matter, i think GDI is the right and most simple choice.

n535
will i be able to program scan line algorithms
PVB
Of course you will. I personally programmed scanline algorithm using GDI. Basically, you will need only one graphics function - for drawing a single pixel.Using libraries like DirectX and OpenGl you wouldn't even have to program such low level things.
n535
A: 

You may want to start off with these tutorials:

http://www.tutorialized.com/tutorials/C-and-Cpp/Graphics/1

DVK
A: 

From the sound of things, you're trying to produce a program that runs on Windows. In that case, you don't need to implement basics like Bresenham's algorithm to be able to draw lines and circles. Windows provides MoveTo and LineTo to do basic line drawing, and Ellipse to draw ellipses -- and if the axes are equal, the ellipse it draws will be a circle.

Edit: It also sounds like you haven't written any code for Windows. This is quite different from writing code for DOS, so you'll probably need a good book. Charles Petzold's Programming Windows is a classic (though for C++ you'll want a somewhat older version -- I believe the current ones concentrate on the .NET languages).

Jerry Coffin
A: 

Hi, I am using the powerful cross platform project: http://cimg.sourceforge.net/ . you have there all primitives and more. I you wish to use your GPU power you can use glut library for OpenGL.

cheers Arman.

Arman
the link you have provided is a bad link.
PVB
@PVB: what is bad with that?you don't like the content? or what?the link is the CImg project web page hosted on sourceforge.net .
Arman
He means what he says, the link returns an error message.
Turtle
@Turtle: Thanks for explanation, but the link is not broken. I just checked it is ok.
Arman
+2  A: 

If you're wanting to play around with graphics code to draw objects and do things with them may I suggest that you skip the whole Windows/GDI/DirectX/ thing completely and take a look at Processing?

It's basically Java, so you won't have to jump too far for the language, but more specifically it's designed for playing around and experimenting with graphics, so may suit you perfectly.

Cruachan
thanks v.much...
PVB
A: 

If you are wanting to get started in DirectX, these tutorials do a great job.

http://www.drunkenhyena.com/cgi-bin/directx.pl

He does them in c++ (unmanaged) and c# & Vb.net (managed)

hamlin11