To be specific, (I think) the problem is that SDL_PollEvent likes to provide event information in 'bursts', when I want it in a stream. For clarification, see the cout's in the code and the bit of console output I paste at the end of it all.
There is also a nice video I took that illustrates the issue.
int Infinita::mainGameLoop(){
cout<<"general\n"; //for debugging purposes
if(isKeyPressed(SDLK_k)){ //this strange snippet is used to emulate that there is a mouse event every single time mainGameLoop loops
SDL_WarpMouse(320,lolx+=1);
if(lolx>100){
lolx=0;
}
}
while(SDL_PollEvent(&Event)){
if(Event.type == SDL_MOUSEMOTION){
mouseMovementEvent(Event); //this function adds a constant value to a rotation variable used to rotate camera
cout<<"there is mouse movement\n"; //for debugging purposes
}
}
movementHandler(1,1); //this function handles wasd movement, I highly doubt it is source of the problem
drawGLScene(); //renders everything and swaps buffers
return 0;
}
Now when this is run and I shake the mouse around, the console does this:
general
general
there is mouse movement
there is mouse movement
general
general
there is mouse movement
there is mouse movement
general
general
there is mouse movement
there is mouse movement
Now what this means is that rotation is going up pretty fast, and each individual increment in rotation isn't being rendered. This is my best guess at the cause of the jitteryness.
Here is video example. In first half of video, I am moving the mouse around and getting console activity as seen in above snippet. In second half, I am holding down the 'k' button, which makes it so there is (fake) mouse activity every time the code loops.
[media]
[/media]
However this is my best guess at what is wrong with the program after an hour or so of debugging, and it may be wrong and there is something catastrophically wrong somewhere else \o/. I want to "smooth" out the lack of mouseevents somehow, but there is no way to distinguish which 'lackings' of mouseevent are legitimate because the mouse stopped moving, and which are this strange behavior.
Here is a 7zip of the entire project: http://dl.dropbox.co...520/Infinita.7z
Thanks for your time.