Sockerdrickan
July 17th, 2008, 01:41 PM
Hi I can't get mouselook working it's been bugging me off for hours
void MouseUpdate() {
static int old_x, old_y;
int x, y;
SDL_GetRelativeMouseState(&x,&y);
CamYaw+=x;
CamPitch+=y;
old_x=x;
old_y=y;
if(CamPitch<-90)
CamPitch=-90;
if(CamPitch>90)
CamPitch=90;
SDL_WarpMouse(r_width/2,r_height/2);
}
I don't know where to use old_x and old_y :mad:
void MouseUpdate() {
static int old_x, old_y;
int x, y;
SDL_GetRelativeMouseState(&x,&y);
CamYaw+=x;
CamPitch+=y;
old_x=x;
old_y=y;
if(CamPitch<-90)
CamPitch=-90;
if(CamPitch>90)
CamPitch=90;
SDL_WarpMouse(r_width/2,r_height/2);
}
I don't know where to use old_x and old_y :mad: