Computer graphics in c++

I want to make a simple cg program in c++ of a moving circle.
The circle should move to left when left arrow key is pressed and same with other
arrow keys.
Please help .
How much programming experience do you have?
What's the problem there? Is very easy, if you know how to do it... First of all, you have to know graphics.h or other headers... then you have to control the circle using getch() to get a character by the user. Then you have to translate the code found with getch in a integer number. Using a switch case, you move the center of the circle, related on which arrow key you had digited
<graphics.h> really? That's not a standard header and was really built for DOS. It was packaged with the Borland C++ compiler in the 90s.

I'd recommend SFML. It has a lot of good tutorials on the site and provides some easy wrappers for window management and events. It has a 2d library where you can create shapes and put textures on them. I think that's what you want.

If you want to go 3D, SFML also shows you how to use OpenGL so that you can get started with a real graphics engine.
thanks for the reply..
wat's wrong with this code..
void main()
int gd=DETECT,gm;
char ch;
int d=(int)ch;
case 68:
for(int i=250;i<500;i++)

case 87:
for(int j=250;j>50;j--)

case 65:
for(int k=250;k>50;k--)

case 83:
for(int l=250;l<500;l++)

instead of arrows keys i m trying for w,a,d,s keys
when i press any of the keys the alphabet itself is displayed on the screen
instead of any movement of the circle.
please help.
Why are clearing the device after you draw to it?
Topic archived. No new replies allowed.