问题相关代码,请勿粘贴截图
#include <stdio.h>
#include <stdlib.h>
#include <SDL.h>
#include <string.h>
#include <math.h>
#include <SDL_draw.h>
int main(){
SDL_Surface *screen = SDL_SetVideoMode(640,640,16,SDL_SWSURFACE);
int x,i;
x=0;
double y;
if(screen == NULL){
fprintf(stderr,"SDL_SetVideoMode error %s\n",SDL_GetError());
exit(1);
}
if(SDL_Init(SDL_INIT_VIDEO) < 0){
fprintf(stderr,"SDL_INIT_VIDEO error %s\n",SDL_GetError());
exit(1);
}
atexit(SDL_Quit);
for (i=0;i<120;i++,x=x+3,y=y+sin(x-80))
{
Draw_Circle(screen,x,y,15,SDL_MapRGB(screen->format, 255,0,0));
SDL_Delay(100);
Draw_Circle(screen,x,y,15,SDL_MapRGB(screen->format, 255,255,255));
Draw_Line(screen,x,y,x+3,y=y+sin(x-80),SDL_MapRGB (screen->format, 255,0,0));
SDL_UpdateRect(screen, 0, 0, 0, 0); /*更新整个屏幕*/ }
return 0;
}
运行结果及报错内容

我想要达到的结果
成功运行,实现画一个圆,此圆沿着正弦曲线运动