简体   繁体   中英

graphics programming

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..

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

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.

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.

You may want to start off with these tutorials:

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

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).

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM